code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import numpy as np
from maro.rl import AbstractStateShaper
class ECRStateShaper(AbstractStateShaper):
def __init__(self, *, look_back, max_ports_downstream, port_attributes, vessel_attributes):
super().__init__()
self._look_... | [
"numpy.concatenate"
] | [((1172, 1220), 'numpy.concatenate', 'np.concatenate', (['(port_features, vessel_features)'], {}), '((port_features, vessel_features))\n', (1186, 1220), True, 'import numpy as np\n')] |
from __future__ import division
import numpy as np
__all__ = ['subtract_CAR',
'subtract_common_median_reference']
def subtract_CAR(X, b_size=16):
"""
Compute and subtract common average reference in 16 channel blocks.
"""
channels, time_points = X.shape
s = channels // b_size
r = ... | [
"numpy.nanmean",
"numpy.nanmedian"
] | [((431, 469), 'numpy.nanmean', 'np.nanmean', (['X_1'], {'axis': '(1)', 'keepdims': '(True)'}), '(X_1, axis=1, keepdims=True)\n', (441, 469), True, 'import numpy as np\n'), ((1105, 1154), 'numpy.nanmedian', 'np.nanmedian', (['X'], {'axis': 'channel_axis', 'keepdims': '(True)'}), '(X, axis=channel_axis, keepdims=True)\n'... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import json
import numpy as np
import scipy.sparse as sparse
import defenses
import upper_bounds
class NumpyEncoder(json.JSONEncoder):
def default(self, obj):
... | [
"numpy.clip",
"numpy.sqrt",
"numpy.array",
"numpy.linalg.norm",
"numpy.cov",
"defenses.compute_dists_under_Q",
"numpy.mean",
"numpy.reshape",
"numpy.where",
"numpy.max",
"numpy.random.seed",
"numpy.concatenate",
"numpy.min",
"scipy.sparse.csr_matrix",
"numpy.tile",
"numpy.eye",
"nump... | [((833, 870), 'numpy.zeros', 'np.zeros', (['(num_classes, num_features)'], {}), '((num_classes, num_features))\n', (841, 870), True, 'import numpy as np\n'), ((1122, 1150), 'numpy.linalg.norm', 'np.linalg.norm', (['centroid_vec'], {}), '(centroid_vec)\n', (1136, 1150), True, 'import numpy as np\n'), ((1170, 1203), 'num... |
#%% [markdown]
#
# We will load EEG data from the lab and attemp to build a classifier that distinguishes between learners and non-learners
#%%
import mne
import numpy as np
import os.path
import glob
import re
import pandas as pd
# try to enable cuda support to speed up filtering, make sure the MNE_USE_C... | [
"mne.cuda.init_cuda",
"pandas.read_csv",
"mne.find_events",
"mne.Epochs",
"numpy.array",
"mne.io.read_raw_edf"
] | [((361, 381), 'mne.cuda.init_cuda', 'mne.cuda.init_cuda', ([], {}), '()\n', (379, 381), False, 'import mne\n'), ((591, 635), 'mne.io.read_raw_edf', 'mne.io.read_raw_edf', (['data_path'], {'preload': '(True)'}), '(data_path, preload=True)\n', (610, 635), False, 'import mne\n'), ((913, 936), 'pandas.read_csv', 'pd.read_c... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import integrate, optimize
from scipy.signal import savgol_filter
from dane import population as popu
dias_restar = 4 # Los últimos días de información que no se tienen en cuenta
dias_pred = 31 # Días sobre los cuáles se hará la predic... | [
"scipy.optimize.curve_fit",
"pandas.to_timedelta",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"scipy.integrate.odeint",
"dane.population",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.array",
"pandas.date_range",
"pandas.DataFrame",
"pandas.to_datetime",
"matplotlib.pyplo... | [((631, 774), 'pandas.read_csv', 'pd.read_csv', (['"""https://www.datos.gov.co/api/views/gt2j-8ykr/rows.csv?accessType=DOWNLOAD"""'], {'sep': '""","""', 'encoding': '"""utf-8"""', 'low_memory': '(False)'}), "(\n 'https://www.datos.gov.co/api/views/gt2j-8ykr/rows.csv?accessType=DOWNLOAD'\n , sep=',', encoding='utf... |
# Copyright 2019 The Keras Tuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"six.moves.zip_longest",
"numpy.nanmean",
"tensorflow.nest.flatten"
] | [((3473, 3545), 'six.moves.zip_longest', 'six.moves.zip_longest', (['*[h[metric] for h in histories]'], {'fillvalue': 'np.nan'}), '(*[h[metric] for h in histories], fillvalue=np.nan)\n', (3494, 3545), False, 'import six\n'), ((1924, 1949), 'tensorflow.nest.flatten', 'tf.nest.flatten', (['fit_args'], {}), '(fit_args)\n'... |
import tkinter as tk
from tkinter import filedialog
from urllib.request import urlopen
from pathlib import Path
from tkinter import ttk
import numpy as np
import base64
import io
import re
from src.theme import theme
from src.algorithm import blosum
from src.utils import RichText
def qopen(path:str):
'''Opens and... | [
"tkinter.ttk.Button",
"src.theme.theme",
"numpy.hstack",
"pathlib.Path.home",
"src.algorithm.blosum",
"tkinter.ttk.LabelFrame",
"base64.encodestring",
"src.utils.RichText",
"tkinter.Label",
"tkinter.ttk.Entry",
"tkinter.ttk.Frame",
"tkinter.ttk.Label",
"numpy.asarray",
"numpy.ndenumerate",... | [((500, 507), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (505, 507), True, 'import tkinter as tk\n'), ((702, 713), 'tkinter.ttk.Style', 'ttk.Style', ([], {}), '()\n', (711, 713), False, 'from tkinter import ttk\n'), ((984, 1019), 'tkinter.ttk.Notebook', 'ttk.Notebook', (['self.root'], {'padding': '(10)'}), '(self.root, p... |
import numpy as np
import re
def apply_colormaps_based_on_mask(mask, data_for_inside_mask, data_for_outside_mask,
colormap_inside_mask, colormap_outside_mask):
"""
Returns the combination of applying two colormaps to two datasets on two mutually exclusive sets of pixels
a... | [
"re.fullmatch",
"numpy.stack",
"numpy.clip"
] | [((2605, 2638), 'numpy.stack', 'np.stack', (['([frame] * depth)'], {'axis': '(2)'}), '([frame] * depth, axis=2)\n', (2613, 2638), True, 'import numpy as np\n'), ((2915, 2968), 're.fullmatch', 're.fullmatch', (['"""[ra][\\\\-\\\\.0-9]+"""', 'mv_thresholdOnValue'], {}), "('[ra][\\\\-\\\\.0-9]+', mv_thresholdOnValue)\n", ... |
# -*- coding: utf8
from gb.randomkit.random import RNG
from gb.samplers import BaseSampler
from gb.samplers import CollapsedGibbsSampler
from gb.stamps import Timestamps
from gb.sloppy import SloppyCounter
from numpy.testing import assert_equal
import numpy as np
def test_get_probability():
d = {}
d[0] = ... | [
"numpy.array",
"gb.sloppy.SloppyCounter",
"gb.randomkit.random.RNG",
"gb.stamps.Timestamps"
] | [((379, 392), 'gb.stamps.Timestamps', 'Timestamps', (['d'], {}), '(d)\n', (389, 392), False, 'from gb.stamps import Timestamps\n'), ((654, 686), 'numpy.array', 'np.array', (['[5, 5]'], {'dtype': '"""uint64"""'}), "([5, 5], dtype='uint64')\n", (662, 686), True, 'import numpy as np\n'), ((704, 738), 'numpy.array', 'np.ar... |
# pylint: disable=invalid-name
'''
Pytests for the common utilities included in this package. Includes:
- conversions.py
- specs.py
- utils.py
To run the tests, type the following in the top level repo directory:
python -m pytest --nat-file [path/to/gribfile] --prs-file [path/to/gribfile]
'''
from... | [
"adb_graphics.conversions.m_to_mi",
"adb_graphics.conversions.pa_to_hpa",
"inspect.getfullargspec",
"adb_graphics.conversions.m_to_kft",
"adb_graphics.datahandler.gribdata.__getattribute__",
"adb_graphics.conversions.weasd_to_1hsnw",
"adb_graphics.conversions.k_to_f",
"adb_graphics.conversions.ms_to_k... | [((830, 845), 'numpy.ones', 'np.ones', (['[3, 2]'], {}), '([3, 2])\n', (837, 845), True, 'import numpy as np\n'), ((928, 949), 'adb_graphics.conversions.k_to_c', 'conversions.k_to_c', (['a'], {}), '(a)\n', (946, 949), True, 'import adb_graphics.conversions as conversions\n'), ((989, 1010), 'adb_graphics.conversions.k_t... |
import os
import shutil
import tempfile
import numpy as np
from yt.loaders import load, load_uniform_grid
from yt.testing import (
assert_array_equal,
assert_fname,
fake_random_ds,
requires_file,
requires_module,
)
from yt.utilities.answer_testing.framework import data_dir_load
from yt.visualizati... | [
"yt.loaders.load_uniform_grid",
"yt.visualization.plot_window.SlicePlot",
"yt.testing.assert_fname",
"yt.testing.assert_array_equal",
"numpy.arange",
"yt.testing.fake_random_ds",
"os.path.join",
"yt.loaders.load",
"os.getcwd",
"os.chdir",
"yt.utilities.answer_testing.framework.data_dir_load",
... | [((399, 422), 'yt.testing.requires_module', 'requires_module', (['"""h5py"""'], {}), "('h5py')\n", (414, 422), False, 'from yt.testing import assert_array_equal, assert_fname, fake_random_ds, requires_file, requires_module\n'), ((1300, 1323), 'yt.testing.requires_module', 'requires_module', (['"""h5py"""'], {}), "('h5p... |
import numba as nb
import numpy as np
import scipy.stats
@nb.njit(parallel=True)
def tiecorrect(rankvals):
"""
parallelized version of scipy.stats.tiecorrect
:param rankvals: p x n array of ranked data (output of rankdata function)
"""
tc = np.ones(rankvals.shape[1], dtype=np.float64)
for j i... | [
"numpy.sqrt",
"numpy.ones",
"numpy.float64",
"numpy.log",
"numba.njit",
"numpy.asarray",
"numpy.diff",
"numpy.argsort",
"numpy.sum",
"numpy.errstate",
"numpy.array",
"numpy.empty",
"numpy.concatenate",
"numpy.nonzero",
"numpy.maximum",
"numba.prange",
"numpy.all",
"numpy.ravel"
] | [((60, 82), 'numba.njit', 'nb.njit', ([], {'parallel': '(True)'}), '(parallel=True)\n', (67, 82), True, 'import numba as nb\n'), ((718, 740), 'numba.njit', 'nb.njit', ([], {'parallel': '(True)'}), '(parallel=True)\n', (725, 740), True, 'import numba as nb\n'), ((264, 308), 'numpy.ones', 'np.ones', (['rankvals.shape[1]'... |
from collections import deque
import numpy as np
import os
from abc import ABCMeta, abstractmethod
import random
random.seed(42)
from common import config, VehicleState
from helper import Helper
INFO = """Average merging time: {} s
Traffic flow: {} vehicle/s
Average speed: {} km/h
Average fuel consumptio... | [
"matplotlib.pyplot.grid",
"bokeh.plotting.figure",
"helper.Helper.getTmOptimal2",
"matplotlib.pyplot.ylabel",
"numpy.random.rand",
"helper.Helper.getConfigVec",
"numpy.random.exponential",
"numpy.array",
"numpy.arange",
"helper.Helper.getTc",
"helper.Helper.getTimeMatrix",
"collections.deque",... | [((118, 133), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (129, 133), False, 'import random\n'), ((2806, 2813), 'collections.deque', 'deque', ([], {}), '()\n', (2811, 2813), False, 'from collections import deque\n'), ((5912, 5936), 'numpy.arange', 'np.arange', (['(10)', '(30.1)', '(2.0)'], {}), '(10, 30.1, ... |
# -*- coding: utf-8 -*-
import os
import torch
from torch.autograd import Variable
import numpy as np
import scipy
import matplotlib.pyplot as plt
import cv2
import scipy.ndimage
import shutil
import scipy.misc as misc
from PIL import Image
def mkdirs(folders, erase=False):
if type(folders) is not list:
... | [
"torch.LongTensor",
"torch.cuda.is_available",
"scipy.misc.imresize",
"numpy.arange",
"matplotlib.pyplot.imshow",
"os.path.exists",
"numpy.mean",
"numpy.reshape",
"scipy.misc.imsave",
"numpy.max",
"numpy.stack",
"numpy.min",
"numpy.random.permutation",
"numpy.tile",
"torch.abs",
"itert... | [((724, 747), 'os.path.exists', 'os.path.exists', (['imgfile'], {}), '(imgfile)\n', (738, 747), False, 'import os\n'), ((799, 818), 'cv2.imread', 'cv2.imread', (['imgfile'], {}), '(imgfile)\n', (809, 818), False, 'import cv2\n'), ((833, 872), 'cv2.cvtColor', 'cv2.cvtColor', (['srcBGR', 'cv2.COLOR_BGR2RGB'], {}), '(srcB... |
"""plot.py: Utility builder class for ML plots.
Uses scikit-learn code samples and framework
"""
__author__ = "<NAME>"
__license__ = "BSD"
__email__ = "<EMAIL>"
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import randomcolor
import math
from sklearn.me... | [
"matplotlib.pyplot.ylabel",
"sklearn.metrics.auc",
"numpy.argsort",
"numpy.array",
"sklearn.metrics.roc_curve",
"randomcolor.RandomColor",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xticks",
"m... | [((697, 707), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (705, 707), True, 'import matplotlib.pyplot as plt\n'), ((2273, 2298), 'randomcolor.RandomColor', 'randomcolor.RandomColor', ([], {}), '()\n', (2296, 2298), False, 'import randomcolor\n'), ((3572, 3597), 'randomcolor.RandomColor', 'randomcolor.Random... |
import os
import time
import random
import scipy.sparse as sp
import numpy as np
import tensorflow as tf
import argparse
from models import SpHGAT
from utils import process
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', help='Dataset.', default='imdb', type=str)
parser.add_argument('--epochs', he... | [
"tensorflow.local_variables_initializer",
"numpy.random.standard_normal",
"tensorflow.sparse_placeholder",
"utils.process.load_heterogeneous_data",
"numpy.array",
"utils.process.preprocess_features",
"tensorflow.Graph",
"argparse.ArgumentParser",
"tensorflow.placeholder",
"tensorflow.Session",
"... | [((184, 209), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (207, 209), False, 'import argparse\n'), ((2336, 2377), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'allow_soft_placement': '(True)'}), '(allow_soft_placement=True)\n', (2350, 2377), True, 'import tensorflow as tf\n'), ((3550, 3... |
import numpy as np
import h5py
import os
import sys
from copy import deepcopy
#handle .(period) and slash specially since it is part of path
#replace with \period or \slash-forward when store, recover later
#not using '\forward-slash' is because \f is a special character
PERIOD='\period'
SLASH='\slash-forward'
'''
... | [
"os.path.join",
"h5py.File",
"numpy.array",
"sys.stdout.flush",
"sys.stdout.write"
] | [((892, 915), 'h5py.File', 'h5py.File', (['f_name', 'mode'], {}), '(f_name, mode)\n', (901, 915), False, 'import h5py\n'), ((1759, 1781), 'h5py.File', 'h5py.File', (['f_name', '"""r"""'], {}), "(f_name, 'r')\n", (1768, 1781), False, 'import h5py\n'), ((1923, 1943), 'numpy.array', 'np.array', (['group[key]'], {}), '(gro... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"bigbench.api.util.postprocess_output",
"numpy.log"
] | [((1171, 1239), 'bigbench.api.util.postprocess_output', 'util.postprocess_output', (['text', 'max_length', 'stop_string', 'output_regex'], {}), '(text, max_length, stop_string, output_regex)\n', (1194, 1239), True, 'import bigbench.api.util as util\n'), ((1417, 1436), 'numpy.log', 'np.log', (['(1 / (i + 1))'], {}), '(1... |
import pybullet_data
import pybullet as p
import time
import numpy as np
from src.utils_geom import *
from src.utils_depth import *
from src.panda import Panda
def full_jacob_pb(jac_t, jac_r):
return np.vstack((jac_t[0], jac_t[1], jac_t[2], jac_r[0], jac_r[1], jac_r[2]))
class pandaEnv():
def __init__(self,
... | [
"pybullet_data.getDataPath",
"numpy.linalg.pinv",
"numpy.hstack",
"pybullet.setTimeStep",
"pybullet.setGravity",
"numpy.array",
"pybullet.setPhysicsEngineParameter",
"src.panda.Panda",
"pybullet.calculateJacobian",
"pybullet.createConstraint",
"numpy.vstack",
"pybullet.changeConstraint",
"py... | [((207, 278), 'numpy.vstack', 'np.vstack', (['(jac_t[0], jac_t[1], jac_t[2], jac_r[0], jac_r[1], jac_r[2])'], {}), '((jac_t[0], jac_t[1], jac_t[2], jac_r[0], jac_r[1], jac_r[2]))\n', (216, 278), True, 'import numpy as np\n'), ((333, 360), 'pybullet_data.getDataPath', 'pybullet_data.getDataPath', ([], {}), '()\n', (358,... |
import numpy as np
import pandas as pd
from pathlib import Path
import multiprocessing as mp
from functools import partial
from src.audio import read_as_melspectrogram
from src.utils import get_params_hash
from src import config
NOISE_SOUNDS = [
'Buzz',
'Car_passing_by',
'Crackle',
'Cricket',
'Hi... | [
"pandas.read_csv",
"pathlib.Path",
"src.audio.read_as_melspectrogram",
"multiprocessing.cpu_count",
"functools.partial",
"numpy.save"
] | [((906, 953), 'src.audio.read_as_melspectrogram', 'read_as_melspectrogram', (['file_path', 'audio_params'], {}), '(file_path, audio_params)\n', (928, 953), False, 'from src.audio import read_as_melspectrogram\n'), ((1194, 1208), 'pathlib.Path', 'Path', (['dir_path'], {}), '(dir_path)\n', (1198, 1208), False, 'from path... |
import numpy as np
import pandas as pd
from sklearn.externals import joblib
#from sklearn.ensemble import RandomForestRegressor
#from sklearn.multioutput import MultiOutputRegressor
#from sklearn.multioutput import MultiOutputRegressor
from sklearn.model_selection import train_test_split
df = pd.read_csv('https://dr... | [
"numpy.abs",
"numpy.mean",
"pandas.read_csv",
"sklearn.externals.joblib.load",
"pandas.get_dummies"
] | [((297, 411), 'pandas.read_csv', 'pd.read_csv', (['"""https://drive.google.com/uc?export=download&id=1XoV8SfvHmzaxRuDRe81OWSQu10dYTbO5"""'], {'sep': '""","""'}), "(\n 'https://drive.google.com/uc?export=download&id=1XoV8SfvHmzaxRuDRe81OWSQu10dYTbO5'\n , sep=',')\n", (308, 411), True, 'import pandas as pd\n'), ((4... |
# Costs
# 2019 - Luque, Straub - Risk-based optimal inspection strategies for
# structural systems using dynamic Bayesian networks
# Table 4, case 1
import numpy as np
class InspectionMaintenance:
"""
Inspection and Maintenance
==========================
Cost calculation for inspection and main... | [
"numpy.unique",
"numpy.diff",
"numpy.array",
"numpy.vstack",
"numpy.zeros_like"
] | [((1359, 1392), 'numpy.vstack', 'np.vstack', (['system_model.system_pf'], {}), '(system_model.system_pf)\n', (1368, 1392), True, 'import numpy as np\n'), ((1417, 1427), 'numpy.diff', 'np.diff', (['t'], {}), '(t)\n', (1424, 1427), True, 'import numpy as np\n'), ((1452, 1463), 'numpy.diff', 'np.diff', (['pf'], {}), '(pf)... |
from __future__ import absolute_import, division, print_function
import json
import os.path as op
import six
import numpy as np
import scipy.signal as sig
import scipy.io.wavfile as sciwav
MAXINT16 = 2**15 - 1
FS = 44100
COEFF_DIR = op.join(op.dirname(op.abspath(__file__)), 'coeffs')
def normalize(data, maxamp=1):
... | [
"numpy.random.random",
"os.path.join",
"json.load",
"numpy.array",
"scipy.signal.lfilter",
"scipy.io.wavfile.read",
"numpy.around",
"numpy.random.seed",
"scipy.io.wavfile.write",
"os.path.abspath",
"numpy.savetxt",
"numpy.loadtxt"
] | [((255, 275), 'os.path.abspath', 'op.abspath', (['__file__'], {}), '(__file__)\n', (265, 275), True, 'import os.path as op\n'), ((443, 455), 'json.load', 'json.load', (['f'], {}), '(f)\n', (452, 455), False, 'import json\n'), ((565, 585), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (579, 585), Tr... |
# Standard library
import atexit
import os
os.environ["OMP_NUM_THREADS"] = "1"
import sys
import traceback
# Third-party
from astropy.utils import iers
iers.conf.auto_download = False
import astropy.table as at
import numpy as np
# This project
from totoro.config import cache_path
from totoro.data import datasets, el... | [
"os.path.exists",
"numpy.random.default_rng",
"argparse.ArgumentParser",
"astropy.table.Table",
"astropy.table.vstack",
"totoro.data.datasets.items",
"numpy.array",
"os.unlink",
"sys.exit",
"totoro.objective.TorusImagingObjective",
"traceback.print_exc",
"atexit.register",
"glob.glob",
"as... | [((1200, 1228), 'os.path.exists', 'os.path.exists', (['all_filename'], {}), '(all_filename)\n', (1214, 1228), False, 'import os\n'), ((1430, 1457), 'glob.glob', 'glob.glob', (['cache_glob_pattr'], {}), '(cache_glob_pattr)\n', (1439, 1457), False, 'import glob\n'), ((2009, 2025), 'totoro.data.datasets.items', 'datasets.... |
# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"sys.path.insert",
"numpy.reshape",
"numpy.minimum",
"numpy.hstack",
"caffe.io.Transformer",
"numpy.where",
"cv2.cvtColor",
"caffe.Net",
"numpy.meshgrid",
"numpy.maximum",
"numpy.arange"
] | [((1052, 1084), 'numpy.maximum', 'np.maximum', (['x1[i]', 'x1[order[1:]]'], {}), '(x1[i], x1[order[1:]])\n', (1062, 1084), True, 'import numpy as np\n'), ((1099, 1131), 'numpy.maximum', 'np.maximum', (['y1[i]', 'y1[order[1:]]'], {}), '(y1[i], y1[order[1:]])\n', (1109, 1131), True, 'import numpy as np\n'), ((1146, 1178)... |
# =============================================================================
# Copyright 2020 NVIDIA. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | [
"nemo.logging.info",
"numpy.all"
] | [((2735, 2798), 'nemo.logging.info', 'logging.info', (['f"""Total errors (multiplied by 2): {total_errors}"""'], {}), "(f'Total errors (multiplied by 2): {total_errors}')\n", (2747, 2798), False, 'from nemo import logging\n'), ((3193, 3262), 'nemo.logging.info', 'logging.info', (['f"""*** Misclassified intent queries (... |
import numpy as np
import cv2
import glob
from matplotlib import pyplot as plt
class CameraCalibration():
def __init__(self):
pass
# ===========================================================
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@staticmethod
def find_chess(frame... | [
"cv2.norm",
"cv2.projectPoints",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.calibrateCamera",
"cv2.findChessboardCorners",
"cv2.cornerSubPix",
"matplotlib.pyplot.imshow",
"cv2.line",
"cv2.undistort",
"matplotlib.pyplot.yticks",
"numpy.concatenate",
"cv2.waitKey",
"matplotlib.pyplot.xticks... | [((604, 660), 'numpy.zeros', 'np.zeros', (['(chess_size[0] * chess_size[1], 3)', 'np.float32'], {}), '((chess_size[0] * chess_size[1], 3), np.float32)\n', (612, 660), True, 'import numpy as np\n'), ((947, 992), 'cv2.cvtColor', 'cv2.cvtColor', (['frame_input', 'cv2.COLOR_BGR2GRAY'], {}), '(frame_input, cv2.COLOR_BGR2GRA... |
# -*- coding: utf-8 -*-
"""
Utilities for reading and writing USID datasets that are highly model-dependent (with or without N-dimensional form)
Created on Tue Nov 3 21:14:25 2015
@author: <NAME>, <NAME>
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from warnings import warn
... | [
"numpy.product",
"numpy.prod",
"sidpy.base.string_utils.validate_list_of_strings",
"numpy.hstack",
"numpy.argsort",
"numpy.array",
"numpy.divide",
"numpy.arange",
"numpy.atleast_2d",
"dask.array.reshape",
"sidpy.hdf.hdf_utils.copy_dataset",
"numpy.where",
"sidpy.hdf.hdf_utils.lazy_load_array... | [((4720, 4743), 'numpy.array', 'np.array', (["['Positions']"], {}), "(['Positions'])\n", (4728, 4743), True, 'import numpy as np\n'), ((4760, 4787), 'numpy.array', 'np.array', (["['Spectral_Step']"], {}), "(['Spectral_Step'])\n", (4768, 4787), True, 'import numpy as np\n'), ((10784, 10849), 'numpy.hstack', 'np.hstack',... |
import numpy as np
import scipy
import scipy.linalg as linalg
import scipy.spatial
import scipy.special
import scipy.optimize
import sklearn
def bases(name):
if name == 'linear':
f = lambda x: x
elif name == 'cubic':
f = lambda x: x**3
elif name == 'multiquadric':
f = lambda x, s: ... | [
"scipy.special.xlogy",
"numpy.sqrt",
"numpy.linalg.cond",
"matplotlib.pyplot.fill_between",
"numpy.sin",
"scipy.linalg.lstsq",
"matplotlib.pyplot.plot",
"sklearn.model_selection.ShuffleSplit",
"numpy.exp",
"numpy.linspace",
"numpy.dot",
"numpy.empty",
"scipy.optimize.minimize_scalar",
"mat... | [((7360, 7382), 'numpy.linspace', 'np.linspace', (['lo', 'hi', 'N'], {}), '(lo, hi, N)\n', (7371, 7382), True, 'import numpy as np\n'), ((7582, 7593), 'time.time', 'time.time', ([], {}), '()\n', (7591, 7593), False, 'import time\n'), ((7757, 7843), 'matplotlib.pyplot.fill_between', 'plt.fill_between', (['t', '(y_pred -... |
"""Tests for qr.py."""
from jax import lax
import jax.numpy as jnp
import numpy as np
import pytest
import tempfile
from distla_core.linalg.utils import testutils
from distla_core.linalg.qr import qr_ooc
from distla_core.utils import pops
DTYPE = jnp.float32
seeds = [0, 1]
flags = [True, False]
def _dephase_qr(R,... | [
"distla_core.linalg.utils.testutils.eps",
"distla_core.linalg.utils.testutils.assert_allclose",
"numpy.diagonal",
"numpy.linalg.qr",
"numpy.ones",
"distla_core.linalg.qr.qr_ooc.qr_ooc",
"numpy.linalg.cond",
"numpy.linalg.norm",
"pytest.mark.parametrize",
"distla_core.utils.pops.undistribute",
"n... | [((697, 739), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""N"""', '[8, 32, 128]'], {}), "('N', [8, 32, 128])\n", (720, 739), False, 'import pytest\n'), ((741, 792), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""aspect_ratio"""', '[1, 2, 10]'], {}), "('aspect_ratio', [1, 2, 10])\n", (764, 79... |
import os
import logging
import argparse
import numpy as np
import tensorflow as tf
from keras_preprocessing.text import Tokenizer
from tqdm import tqdm
from data import DataLoader
class EmbeddingsBuilder:
def __init__(self, args):
logging.info('initializing...')
self.args = args
self.da... | [
"logging.basicConfig",
"keras_preprocessing.text.Tokenizer",
"argparse.ArgumentParser",
"os.path.splitext",
"numpy.append",
"tensorflow.gfile.GFile",
"logging.info",
"data.DataLoader"
] | [((1951, 2025), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(message)s"""', 'level': 'logging.DEBUG'}), "(format='%(asctime)s %(message)s', level=logging.DEBUG)\n", (1970, 2025), False, 'import logging\n'), ((2030, 2066), 'logging.info', 'logging.info', (['"""initializing task..."""']... |
import pytest
import json
import numpy as np
@pytest.mark.parametrize("candidate, expected", [
(1.345, True),
(-4.554, True),
('9999', True)
])
def test_number_please(candidate, expected):
from hrm_code import number_please
assert number_please(candidate) == expected
def test_import_data():
... | [
"hrm_code.num_beat",
"hrm_code.detect_peak",
"hrm_code.number_please",
"pytest.mark.parametrize",
"hrm_code.import_data",
"hrm_code.calc_bpm",
"hrm_code.create_jason",
"hrm_code.find_max_min_volt",
"hrm_code.calc_sample_freq",
"numpy.sin",
"hrm_code.create_metrics",
"numpy.arange",
"hrm_code... | [((48, 148), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""candidate, expected"""', "[(1.345, True), (-4.554, True), ('9999', True)]"], {}), "('candidate, expected', [(1.345, True), (-4.554, \n True), ('9999', True)])\n", (71, 148), False, 'import pytest\n'), ((375, 414), 'hrm_code.import_data', 'impor... |
import numpy as np
from math import sqrt
def robot_distance_incorrect(robot_actual_location, hexagon_pixel_values):
distance_to_get_back = []
distances = []
pixel_distance = []
for i in range(0, len(hexagon_pixel_values)):
dist = sqrt((robot_actual_location[0] - hexagon_pixel_values[i][0]) ** ... | [
"numpy.argmin",
"math.sqrt"
] | [((450, 470), 'numpy.argmin', 'np.argmin', (['distances'], {}), '(distances)\n', (459, 470), True, 'import numpy as np\n'), ((256, 390), 'math.sqrt', 'sqrt', (['((robot_actual_location[0] - hexagon_pixel_values[i][0]) ** 2 + (\n robot_actual_location[1] - hexagon_pixel_values[i][1]) ** 2)'], {}), '((robot_actual_loc... |
"""Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143?
"""
import math
import numpy as np
def largest_prime_factor_naive(number):
"""
Let the given number be n and let k = 2, 3, 4, 5, ... .
For each k, if it is a factor of n ... | [
"numpy.array",
"math.sqrt",
"numpy.arange"
] | [((2287, 2304), 'math.sqrt', 'math.sqrt', (['number'], {}), '(number)\n', (2296, 2304), False, 'import math\n'), ((2735, 2760), 'numpy.array', 'np.array', (['([True] * length)'], {}), '([True] * length)\n', (2743, 2760), True, 'import numpy as np\n'), ((2569, 2586), 'math.sqrt', 'math.sqrt', (['number'], {}), '(number)... |
# encoding: utf-8
'''
@author: <NAME>
@contact: <EMAIL>
@software: basenef
@file: doc_generator.py
@date: 4/13/2019
@desc:
'''
import os
import sys
import time
from getpass import getuser
import matplotlib
import numpy as np
import json
from srfnef import Image, MlemFull
matplotlib.use('Agg')
author = getuser()
de... | [
"srfnef.image_metric.nsd",
"getpass.getuser",
"matplotlib.pyplot.imshow",
"srfnef.image_metric.noise2",
"json.dumps",
"matplotlib.pyplot.plot",
"srfnef.image_metric.pos_dev",
"srfnef.image_metric.bg_visibility",
"srfnef.image_metric.crc2",
"numpy.round",
"srfnef.image_metric.standard_error",
"... | [((274, 295), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (288, 295), False, 'import matplotlib\n'), ((306, 315), 'getpass.getuser', 'getuser', ([], {}), '()\n', (313, 315), False, 'from getpass import getuser\n'), ((357, 368), 'time.time', 'time.time', ([], {}), '()\n', (366, 368), False, 'im... |
import math
import numpy as np
from matplotlib.patches import FancyArrowPatch
def home_has_possession(row):
if row.possessionTeam == row.homeTeamAbbr:
return True
return False
def calculate_team_sitation(row):
ball_string = 'football'
if row.team == ball_string:
return ball_string
... | [
"math.radians",
"math.sqrt",
"numpy.square"
] | [((3550, 3568), 'numpy.square', 'np.square', (['(x1 - x2)'], {}), '(x1 - x2)\n', (3559, 3568), True, 'import numpy as np\n'), ((3571, 3589), 'numpy.square', 'np.square', (['(y1 - y2)'], {}), '(y1 - y2)\n', (3580, 3589), True, 'import numpy as np\n'), ((2039, 2075), 'math.sqrt', 'math.sqrt', (['(delta ** 2 - y_delta ** ... |
"""
Automatic speech recognition scenario
"""
import logging
from typing import Optional
from tqdm import tqdm
import numpy as np
from art.preprocessing.audio import LFilter, LFilterPyTorch
from armory.utils.config_loading import (
load_dataset,
load_model,
load_attack,
load_adversarial_dataset,
... | [
"logging.getLogger",
"armory.utils.config_loading.load_label_targeter",
"art.preprocessing.audio.LFilterPyTorch",
"armory.utils.export.SampleExporter",
"armory.utils.metrics.MetricsLogger.from_config",
"tqdm.tqdm",
"art.preprocessing.audio.LFilter",
"armory.utils.config_loading.load_defense_wrapper",
... | [((530, 557), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (547, 557), False, 'import logging\n'), ((2030, 2103), 'art.preprocessing.audio.LFilter', 'LFilter', ([], {'numerator_coef': 'numerator_coef', 'denominator_coef': 'denominator_coef'}), '(numerator_coef=numerator_coef, denominato... |
import tensorflow as tf
from os import path
import numpy as np
from scipy import misc
from styx_msgs.msg import TrafficLight
import cv2
import rospy
import tensorflow as tf
class CarlaModel(object):
def __init__(self, model_checkpoint):
self.sess = None
self.checkpoint = model_checkpoint
... | [
"numpy.abs",
"tensorflow.reset_default_graph",
"tensorflow.Session",
"tensorflow.GraphDef",
"tensorflow.import_graph_def",
"cv2.cvtColor",
"tensorflow.gfile.GFile",
"numpy.expand_dims",
"rospy.loginfo",
"tensorflow.get_default_graph"
] | [((417, 441), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (439, 441), True, 'import tensorflow as tf\n'), ((522, 535), 'tensorflow.GraphDef', 'tf.GraphDef', ([], {}), '()\n', (533, 535), True, 'import tensorflow as tf\n'), ((625, 677), 'tensorflow.import_graph_def', 'tf.import_graph_de... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021 The HERA Collaboration
# Licensed under the MIT License
"""Utilities for dealing with galaxy/QSO catalogs."""
import numpy as np
import matplotlib.pyplot as plt
from astropy.coordinates import SkyCoord
from .util import deg_per_hr
_xshooter_ref = "https://ui.adsabs.harva... | [
"numpy.array",
"matplotlib.pyplot.figure",
"astropy.coordinates.SkyCoord"
] | [((5676, 5709), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'num': 'num'}), '(num=num, **fig_kwargs)\n', (5686, 5709), True, 'import matplotlib.pyplot as plt\n'), ((8031, 8045), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (8039, 8045), True, 'import numpy as np\n'), ((7872, 7895), 'astropy.coordinates.Sk... |
"""*****************************************************************************************
MIT License
Copyright (c) 2022 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to dea... | [
"numpy.linalg.matrix_rank",
"numpy.sqrt",
"numpy.hstack",
"numpy.log",
"Utils.UPPER_BOUND",
"Utils.computeDistanceToSubspace",
"numpy.array",
"numpy.count_nonzero",
"numpy.argsort",
"numpy.einsum",
"numpy.linalg.norm",
"numpy.arange",
"Utils.determineUpperBound",
"numpy.multiply",
"numpy... | [((2252, 2269), 'numpy.hstack', 'np.hstack', (['(p, 1)'], {}), '((p, 1))\n', (2261, 2269), True, 'import numpy as np\n'), ((4103, 4112), 'numpy.linalg.svd', 'la.svd', (['B'], {}), '(B)\n', (4109, 4112), True, 'from numpy import linalg as la\n'), ((4953, 4971), 'numpy.eye', 'np.eye', (['A.shape[0]'], {}), '(A.shape[0])\... |
import logic
import numpy as np
import gym
ACTION_MAP = {
0: 'up',
1: 'down',
2: 'left',
3: 'right'
}
class Env2048(gym.Env):
metadata = {'render.modes': ['human']}
def __init__(self, n=4, max_idle=100, seed=None):
super(Env2048, self).__init__()
self.n = n
self.max... | [
"numpy.eye",
"logic.left",
"numpy.random.choice",
"logic.game_state",
"gym.spaces.Discrete",
"gym.spaces.Box",
"logic.new_game",
"numpy.array",
"numpy.sum",
"logic.right",
"numpy.random.seed",
"logic.add_two",
"logic.up",
"numpy.log2",
"logic.down"
] | [((434, 456), 'gym.spaces.Discrete', 'gym.spaces.Discrete', (['(4)'], {}), '(4)\n', (453, 456), False, 'import gym\n'), ((490, 569), 'gym.spaces.Box', 'gym.spaces.Box', ([], {'low': '(0)', 'high': '(255)', 'shape': '(self.n, self.n, 2 ** n)', 'dtype': 'np.uint8'}), '(low=0, high=255, shape=(self.n, self.n, 2 ** n), dty... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 13 12:55:47 2018
@name: CSVMachLearn.py
@description: 1D CNN using CSV vector for machine learning
@author: <NAME>
"""
from __future__ import absolute_import, division, print_function
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
fro... | [
"tensorflow.enable_eager_execution",
"tensorflow.GradientTape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.MaxPooling1D",
"tensorflow.set_random_seed",
"matplotlib.lines.Line2D",
"tensorflow.keras.models.save_model",
"tensorflow.keras.layers.Reshape",
"sklearn.decomposition.PCA",
"t... | [((485, 512), 'tensorflow.enable_eager_execution', 'tf.enable_eager_execution', ([], {}), '()\n', (510, 512), True, 'import tensorflow as tf\n'), ((514, 532), 'tensorflow.set_random_seed', 'set_random_seed', (['(0)'], {}), '(0)\n', (529, 532), False, 'from tensorflow import set_random_seed\n'), ((5009, 5163), 'tensorfl... |
# -*- coding: utf-8 -*-
"""
Created on 2020/03/16
Feature selection: Relief-based feature selection algorithm.
------
@author: <NAME>
"""
import numpy as np
from sklearn import preprocessing
import os
from sklearn.externals import joblib
from el_classify_sensitive_person_train_validation import ClassifyFourKindOfPers... | [
"pandas.DataFrame",
"os.path.join",
"numpy.array",
"numpy.vstack",
"eslearn.utils.lc_evaluation_model_performances.eval_performance",
"el_classify_sensitive_person_train_validation.ClassifyFourKindOfPersonTrain",
"numpy.load"
] | [((2744, 2940), 'eslearn.utils.lc_evaluation_model_performances.eval_performance', 'eval_performance', (['selftest.label_test', 'selftest.prediction', 'selftest.decision'], {'accuracy_kfold': 'None', 'sensitivity_kfold': 'None', 'specificity_kfold': 'None', 'AUC_kfold': 'None', 'verbose': '(1)', 'is_showfig': '(0)'}), ... |
from pandas.core.algorithms import mode
import torch
import torch.nn as nn
from albumentations import Compose,Resize,Normalize
from albumentations.pytorch import ToTensorV2
import wandb
import time
import torchvision
import torch.nn.functional as F
import torch.optim as optim
from torch.cuda.amp import autocast,GradSc... | [
"wandb.log",
"pandas.read_csv",
"wandb.init",
"torch.cuda.is_available",
"torch.cuda.amp.GradScaler",
"torch.cuda.amp.autocast",
"numpy.random.seed",
"build_model.Deformed_Darknet53",
"albumentations.Normalize",
"callbacks.EarlyStopping",
"torch.nn.BCEWithLogitsLoss",
"torch.optim.zero_grad",
... | [((585, 608), 'torch.manual_seed', 'torch.manual_seed', (['(2021)'], {}), '(2021)\n', (602, 608), False, 'import torch\n'), ((609, 629), 'numpy.random.seed', 'np.random.seed', (['(2021)'], {}), '(2021)\n', (623, 629), True, 'import numpy as np\n'), ((630, 647), 'random.seed', 'random.seed', (['(2021)'], {}), '(2021)\n'... |
import os.path as op
from urllib.request import urlretrieve
import matplotlib
import numpy as np
from numpy.testing import assert_allclose
import pytest
import hnn_core
from hnn_core import read_params, read_dipole, average_dipoles
from hnn_core import Network, jones_2009_model
from hnn_core.viz import plot_dipole
fr... | [
"hnn_core.jones_2009_model",
"hnn_core.dipole.Dipole",
"numpy.array",
"numpy.loadtxt",
"numpy.arange",
"os.path.exists",
"hnn_core.dipole.simulate_dipole",
"urllib.request.urlretrieve",
"numpy.random.random",
"numpy.testing.assert_allclose",
"hnn_core.average_dipoles",
"hnn_core.dipole._rmse",... | [((450, 471), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (464, 471), False, 'import matplotlib\n'), ((571, 600), 'os.path.dirname', 'op.dirname', (['hnn_core.__file__'], {}), '(hnn_core.__file__)\n', (581, 600), True, 'import os.path as op\n'), ((620, 667), 'os.path.join', 'op.join', (['hnn_c... |
# USAGE
# python extract_embeddings.py --dataset dataset --embeddings output/embeddings.pickle \
# --detector face_detection_model --embedding-model openface_nn4.small2.v1.t7
# import the necessary packages
from imutils.face_utils import FaceAligner
from imutils import paths
import numpy as np
import argparse
import i... | [
"cv2.dnn.blobFromImage",
"PIL.Image.fromarray",
"cv2.dnn.readNetFromTorch",
"argparse.ArgumentParser",
"yolo.YOLO",
"pickle.dumps",
"keras.backend.learning_phase",
"numpy.asarray",
"dlib.shape_predictor",
"numpy.array",
"imutils.resize",
"cv2.waitKey",
"imutils.paths.list_images",
"numpy.e... | [((1650, 1675), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1673, 1675), False, 'import argparse\n'), ((2238, 2283), 'dlib.shape_predictor', 'dlib.shape_predictor', (["args['shape_predictor']"], {}), "(args['shape_predictor'])\n", (2258, 2283), False, 'import dlib\n'), ((2340, 2346), 'yolo.... |
#!/usr/bin/env python
""" HIAS AI Model Data Augmentation Class.
Provides data augmentation methods.
MIT License
Copyright (c) 2021 Asociación de Investigacion en Inteligencia Artificial
Para la Leucemia <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associa... | [
"numpy.dstack",
"cv2.warpAffine",
"cv2.flip",
"numpy.float32",
"skimage.transform.AffineTransform",
"skimage.transform.warp",
"random.seed",
"cv2.equalizeHist",
"numpy.random.seed",
"cv2.cvtColor",
"scipy.ndimage.gaussian_filter",
"cv2.getRotationMatrix2D",
"random.randint"
] | [((1721, 1736), 'numpy.random.seed', 'seed', (['self.seed'], {}), '(self.seed)\n', (1725, 1736), False, 'from numpy.random import seed\n'), ((1921, 1959), 'cv2.cvtColor', 'cv2.cvtColor', (['data', 'cv2.COLOR_BGR2GRAY'], {}), '(data, cv2.COLOR_BGR2GRAY)\n', (1933, 1959), False, 'import cv2\n'), ((2139, 2176), 'cv2.cvtCo... |
# Program 8_plot_data_perstation.py written by <NAME> (<EMAIL>)
file_name= '8_plot_data_perstation.py'
# Uses receiver functions computed to produce a nice graph for every directory in DATARF
import obspy
from obspy import read
from obspy.core import Stream
from obspy.core import trace
import matplotlib.pyplot as plt
... | [
"obspy.read",
"numpy.abs",
"matplotlib.pyplot.ylabel",
"numpy.round",
"matplotlib.pyplot.xlabel",
"obspy.UTCDateTime",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplot",
"glob.glob",
"matplotlib.pyplot.show"
] | [((509, 532), 'glob.glob', 'glob.glob', (["(direc + '/*')"], {}), "(direc + '/*')\n", (518, 532), False, 'import glob\n'), ((713, 744), 'glob.glob', 'glob.glob', (["(stadir + '/*.PICKLE')"], {}), "(stadir + '/*.PICKLE')\n", (722, 744), False, 'import glob\n'), ((3703, 3723), 'matplotlib.pyplot.subplot', 'plt.subplot', ... |
import tensorflow as tf
from netensorflow.ann.ANN import ANN
from netensorflow.ann.macro_layer.MacroLayer import MacroLayer
from netensorflow.ann.macro_layer.layer_structure.InputLayerStructure import InputLayerStructure
from netensorflow.ann.macro_layer.layer_structure.LayerStructure import LayerStructure, LayerType
... | [
"netensorflow.ann.macro_layer.layer_structure.InputLayerStructure.InputLayerStructure",
"netensorflow.ann.macro_layer.layer_structure.layers.FullConnectedWithSoftmaxLayer.FullConnectedWithSoftmaxLayer",
"tensorflow.Session",
"netensorflow.ann.macro_layer.layer_structure.layers.FullConnected.FullConnected",
... | [((706, 718), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (716, 718), True, 'import tensorflow as tf\n'), ((779, 810), 'netensorflow.ann.macro_layer.layer_structure.layers.FullConnected.FullConnected', 'FullConnected', ([], {'inputs_amount': '(20)'}), '(inputs_amount=20)\n', (792, 810), False, 'from netensorf... |
# import modules
import numpy as np
import argparse
import cv2
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-b", "--buffer", type=int, default=64,
help="max buffer size")
args = vars(ap.parse_args())
# define the lower and upper boundaries of ... | [
"numpy.ones",
"argparse.ArgumentParser",
"cv2.inRange",
"cv2.minEnclosingCircle",
"cv2.imshow",
"cv2.morphologyEx",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.moments",
"cv2.resize",
"cv2.GaussianBlur",
"cv2.waitKey"
] | [((125, 150), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (148, 150), False, 'import argparse\n'), ((853, 888), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0 + cv2.CAP_DSHOW)'], {}), '(0 + cv2.CAP_DSHOW)\n', (869, 888), False, 'import cv2\n'), ((3087, 3110), 'cv2.destroyAllWindows', 'cv2.des... |
from CHECLabPy.plotting.setup import Plotter
from CHECLabPy.plotting.camera import CameraImage
from CHECLabPy.utils.files import create_directory
from CHECLabPy.utils.mapping import get_ctapipe_camera_geometry
from sstcam_sandbox import get_plot, get_data
from os.path import join
from matplotlib import pyplot as plt
fr... | [
"CHECLabPy.plotting.camera.CameraImage.from_mapping",
"sstcam_sandbox.get_plot",
"CHECOnsky.calib.obtain_cleaning_mask",
"numpy.tan",
"CHECLabPy.utils.mapping.get_ctapipe_camera_geometry",
"CHECLabPy.calib.TimeCalibrator",
"pandas.Timedelta",
"warnings.catch_warnings",
"numpy.max",
"sstcam_sandbox... | [((659, 682), 'mpl_toolkits.axes_grid1.make_axes_locatable', 'make_axes_locatable', (['ax'], {}), '(ax)\n', (678, 682), False, 'from mpl_toolkits.axes_grid1 import make_axes_locatable\n'), ((4380, 4415), 'sstcam_sandbox.get_data', 'get_data', (['"""d190717_alpha/wobble.h5"""'], {}), "('d190717_alpha/wobble.h5')\n", (43... |
import argparse
import numpy as np
import os
import random
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from datasets import custom_collate_fn, load_data, WebDataset
from models import WebObjExtractionNet
from train import train_model, evaluate_model
from utils... | [
"torch.manual_seed",
"os.path.exists",
"train.train_model",
"argparse.ArgumentParser",
"os.makedirs",
"utils.print_and_log",
"models.WebObjExtractionNet",
"torch.nn.CrossEntropyLoss",
"random.seed",
"numpy.loadtxt",
"torch.cuda.is_available",
"numpy.random.seed",
"torch.utils.data.DataLoader... | [((388, 426), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Train Model"""'], {}), "('Train Model')\n", (411, 426), False, 'import argparse\n'), ((1664, 1681), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1675, 1681), False, 'import random\n'), ((1682, 1702), 'numpy.random.seed', 'np.random.... |
import numpy as np
from typing import Union, Optional, List, Dict, Any
from buffers.chunk_buffer import ChunkReplayBuffer
class IntrospectiveChunkReplayBuffer(ChunkReplayBuffer):
def __init__(self, buffer_size: int, *args, **kwargs):
super().__init__(buffer_size, *args, **kwargs)
self.sam... | [
"numpy.zeros",
"numpy.zeros_like"
] | [((333, 371), 'numpy.zeros', 'np.zeros', (['(buffer_size,)'], {'dtype': 'np.int'}), '((buffer_size,), dtype=np.int)\n', (341, 371), True, 'import numpy as np\n'), ((537, 581), 'numpy.zeros_like', 'np.zeros_like', (['self.first_access'], {'dtype': 'bool'}), '(self.first_access, dtype=bool)\n', (550, 581), True, 'import ... |
""" Identify low-level jets in wind profile data.
<NAME>
December 2020
"""
import numpy as np
import xarray as xr
def detect_llj(x, axis=None, falloff=0, output='strength', inverse=False):
""" Identify maxima in wind profiles.
args:
- x : ndarray with wind profile data
- axis ... | [
"numpy.ones",
"numpy.minimum",
"numpy.hstack",
"numpy.where",
"numpy.rollaxis",
"numpy.argmax",
"numpy.zeros",
"numpy.apply_along_axis",
"numpy.isnan",
"numpy.ma.masked_invalid"
] | [((1794, 1844), 'numpy.apply_along_axis', 'np.apply_along_axis', (['inner', 'axis', 'x'], {'output': 'output'}), '(inner, axis, x, output=output)\n', (1813, 1844), True, 'import numpy as np\n'), ((2690, 2711), 'numpy.rollaxis', 'np.rollaxis', (['xs', 'axis'], {}), '(xs, axis)\n', (2701, 2711), True, 'import numpy as np... |
import time
import sys
import numpy as np
from local_search import kmedian_local_search
import feasibility
from kmedkpm import k_median_k_partitions_LS
import psutil
from sklearn.datasets import make_blobs
import generator
import random
test = False
def lp_ls_complete(data, color_mat, rvec, k, logfile):
#########... | [
"feasibility.calculate",
"kmedkpm.k_median_k_partitions_LS",
"psutil.Process",
"sklearn.datasets.make_blobs",
"generator.get_feasible_instance",
"numpy.stack",
"local_search.kmedian_local_search",
"time.time"
] | [((865, 881), 'psutil.Process', 'psutil.Process', ([], {}), '()\n', (879, 881), False, 'import psutil\n'), ((895, 906), 'time.time', 'time.time', ([], {}), '()\n', (904, 906), False, 'import time\n'), ((922, 933), 'time.time', 'time.time', ([], {}), '()\n', (931, 933), False, 'import time\n'), ((952, 1056), 'feasibilit... |
import numpy as np
import pandas as pd
import datetime
import json
class DateTimeTransformer(object):
def __init__(self):
self._new_columns = []
self._old_column = None
self._min_datetime = None
self._transforms = []
def fit(self, X, column):
self._old_column = column
... | [
"numpy.unique",
"pandas.to_datetime",
"numpy.min"
] | [((349, 366), 'numpy.min', 'np.min', (['X[column]'], {}), '(X[column])\n', (355, 366), True, 'import numpy as np\n'), ((3456, 3473), 'pandas.to_datetime', 'pd.to_datetime', (['d'], {}), '(d)\n', (3470, 3473), True, 'import pandas as pd\n'), ((418, 435), 'numpy.unique', 'np.unique', (['values'], {}), '(values)\n', (427,... |
from flask import Flask, request, render_template, send_file, Response
import io
import base64
import csv
import json
import time
from collections import OrderedDict
import numpy
import pandas as pd
from numpy import genfromtxt
from flask import jsonify
from flask_cors import CORS
from LoadingNetwork import... | [
"flask.render_template",
"flask_cors.CORS",
"flask.Flask",
"json.dumps",
"tornado.ioloop.IOLoop.instance",
"gc.collect",
"time.time",
"pandas.DataFrame",
"tornado.wsgi.WSGIContainer",
"numpy.genfromtxt"
] | [((547, 565), 'flask.Flask', 'Flask', (['"""flasknado"""'], {}), "('flasknado')\n", (552, 565), False, 'from flask import Flask, request, render_template, send_file, Response\n'), ((609, 618), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (613, 618), False, 'from flask_cors import CORS\n'), ((936, 984), 'numpy.g... |
# Copyright (C) 2021 <NAME>
#
# SPDX-License-Identifier: MIT
from typing import Callable, Tuple, Union
import dolfinx.common as _common
import dolfinx.fem as _fem
import dolfinx.log as _log
import dolfinx.mesh as _mesh
import dolfinx_cuas
import numpy as np
import ufl
from dolfinx.cpp.graph import AdjacencyList_in... | [
"dolfinx.common.timing",
"ufl.Measure",
"numpy.hstack",
"ufl.FacetNormal",
"numpy.array",
"dolfinx.fem.petsc.set_bc",
"dolfinx_contact.NewtonSolver",
"dolfinx.fem.petsc.apply_lifting",
"dolfinx.fem.petsc.assemble_matrix",
"dolfinx_contact.cpp.Contact",
"dolfinx.fem.Expression",
"dolfinx.fem.lo... | [((5390, 5419), 'dolfinx_contact.helpers.lame_parameters', 'lame_parameters', (['plane_strain'], {}), '(plane_strain)\n', (5405, 5419), False, 'from dolfinx_contact.helpers import epsilon, lame_parameters, rigid_motions_nullspace, sigma_func\n'), ((5487, 5508), 'dolfinx_contact.helpers.sigma_func', 'sigma_func', (['mu'... |
import numpy as np
from sklearn.metrics import average_precision_score as ap
from sklearn.metrics import roc_auc_score
"""
each row is an instance
each column is the prediction of a class
"""
def _score_to_rank(score_list):
rank_array = np.zeros([len(score_list)])
score_array = np.array(score_list)
idx_so... | [
"numpy.mean",
"sklearn.metrics.average_precision_score",
"sklearn.metrics.roc_auc_score",
"numpy.array",
"numpy.nonzero"
] | [((289, 309), 'numpy.array', 'np.array', (['score_list'], {}), '(score_list)\n', (297, 309), True, 'import numpy as np\n'), ((780, 798), 'numpy.array', 'np.array', (['Y_target'], {}), '(Y_target)\n', (788, 798), True, 'import numpy as np\n'), ((813, 830), 'numpy.array', 'np.array', (['Y_score'], {}), '(Y_score)\n', (82... |
"""
:filename transformations.py
:author <NAME>
:email <EMAIL>
from
Classes of custom transformations that are applied during the training as additional augmentation of the depth maps.
"""
import torch
import random
import numpy as np
import torch.nn.functional as F
from random import randrange
from s... | [
"torch.nn.functional.grid_sample",
"random.uniform",
"random.choice",
"numpy.random.rand",
"random.randrange",
"skimage.transform.AffineTransform",
"numpy.asarray",
"skimage.transform.warp",
"torch.sin",
"torch.tensor",
"torch.cos",
"skimage.transform.resize",
"torch.cat"
] | [((1466, 1487), 'numpy.asarray', 'np.asarray', (['landmarks'], {}), '(landmarks)\n', (1476, 1487), True, 'import numpy as np\n'), ((4681, 4699), 'random.randrange', 'randrange', (['(-32)', '(-6)'], {}), '(-32, -6)\n', (4690, 4699), False, 'from random import randrange\n'), ((4719, 4735), 'random.randrange', 'randrange'... |
import astropy.units as u
import numpy as np
from lofti_gaia.loftitools import *
from lofti_gaia.cFunctions import calcOFTI_C
#from loftitools import *
import pickle
import time
import matplotlib.pyplot as plt
# Astroquery throws some warnings we can ignore:
import warnings
warnings.filterwarnings("ignore")
'''This mo... | [
"numpy.radians",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.hist",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.arctan2",
"numpy.nanmin",
"numpy.sin",
"numpy.arange",
"numpy.mean",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.max",
"n... | [((275, 308), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (298, 308), False, 'import warnings\n'), ((14422, 14529), 'numpy.average', 'np.average', (['[self.plx1[0].value, self.plx2[0].value]'], {'weights': '[self.plx1[1].value, self.plx2[1].value]'}), '([self.plx1[0].va... |
"""
script to run mc sims on the three associations techniques when the tracks origin are equal. Used to calculate the
total number of correctly associating tracks and total # falsly not associating tracks from the same target.
"""
import numpy as np
from stonesoup.types.state import GaussianState
from data_associati... | [
"utils.open_object.open_object",
"stonesoup.types.state.GaussianState",
"numpy.diag",
"data_association.CountingAssociator.CountingAssociator",
"trackers.kf_dependent_fusion_async_sensors.KalmanFilterDependentFusionAsyncSensors",
"utils.scenario_generator.generate_scenario_3"
] | [((1806, 2051), 'utils.scenario_generator.generate_scenario_3', 'generate_scenario_3', ([], {'seed': 'seed', 'permanent_save': '(False)', 'radar_meas_rate': 'radar_meas_rate', 'ais_meas_rate': 'ais_meas_rate', 'sigma_process': 'sigma_process', 'sigma_meas_radar': 'sigma_meas_radar', 'sigma_meas_ais': 'sigma_meas_ais', ... |
from numpy import exp, pi, cos, sin, tan
from ....Functions.Geometry.inter_line_circle import inter_line_circle
def _comp_point_coordinate(self):
"""Compute the point coordinates needed to plot the Slot.
Parameters
----------
self : HoleM51
A HoleM51 object
Returns
-------
point_... | [
"numpy.exp",
"numpy.sin",
"numpy.cos",
"numpy.tan"
] | [((565, 575), 'numpy.cos', 'cos', (['alpha'], {}), '(alpha)\n', (568, 575), False, 'from numpy import exp, pi, cos, sin, tan\n'), ((1175, 1198), 'numpy.exp', 'exp', (['(1.0j * self.W1 / 2)'], {}), '(1.0j * self.W1 / 2)\n', (1178, 1198), False, 'from numpy import exp, pi, cos, sin, tan\n'), ((1691, 1715), 'numpy.exp', '... |
print("\n")
print("PythonExercises-v2 by <NAME>")
print("\n")
print("=== EXERCISE 1 ===")
print("\n")
print("(a) 5 / 3 = " + str(5 / 3))
print("=> with python3 you can receive a float even if you divide two \
integers")
print("\n")
print("(b) 5 % 3 = " + str(5 % 3))
print("=> % is the modulus which divides left hand... | [
"functools.reduce",
"numpy.sin",
"re.findall",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((7097, 7122), 'numpy.arange', 'np.arange', (['(0.0)', '(2.0)', '(0.01)'], {}), '(0.0, 2.0, 0.01)\n', (7106, 7122), True, 'import numpy as np\n'), ((7177, 7191), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (7189, 7191), True, 'import matplotlib.pyplot as plt\n'), ((7266, 7276), 'matplotlib.pyplot.s... |
#-------------------------------------------------------------------------------
# This function defines the sea level change timeseries for marine ice sheet problem.
# *Default = sinusoidal tidal cycle if 'tides' with 1m amplitude if 'tides' turned 'on', OR...
# = zero if 'tides' turned 'off'
#---------------... | [
"numpy.sin"
] | [((505, 555), 'numpy.sin', 'np.sin', (['(4 * np.pi * t / (31540000.0 / 12.0 / 30.0))'], {}), '(4 * np.pi * t / (31540000.0 / 12.0 / 30.0))\n', (511, 555), True, 'import numpy as np\n')] |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
# from scipy.stats import entropy
import sys
sys.path.append('../')
import cloudtropy
# data
gen_dim = 2
gen_N = 300
lims = (-2,6)
scale = 0.2
X = np.random.uniform(low=lims[0],high=lims[1],size=(10000,2)) # background
X = np.co... | [
"matplotlib.pyplot.savefig",
"cloudtropy.entropy",
"cloudtropy.pmf",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.random.randn",
"matplotlib.pyplot.tight_layout",
"numpy.random.uniform",
"sys.path.append"
] | [((133, 155), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (148, 155), False, 'import sys\n'), ((239, 300), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': 'lims[0]', 'high': 'lims[1]', 'size': '(10000, 2)'}), '(low=lims[0], high=lims[1], size=(10000, 2))\n', (256, 300), True, 'impo... |
#!/usr/bin/env python
# _*_ encoding: utf-8 _*_
"""simplex.py: Simplex algorithm with rational coefficients"""
import numpy as np
import fractions as frac
__author__ = "<NAME>"
__email__ = "<EMAIL>"
class RestrictedSimplex(object):
def __init__(self, leaving_index=None, entering_index=None):
if not le... | [
"numpy.copy",
"numpy.ones",
"fractions.Fraction",
"numpy.zeros",
"numpy.argmin"
] | [((3105, 3128), 'numpy.copy', 'np.copy', (['lin_p.table[0]'], {}), '(lin_p.table[0])\n', (3112, 3128), True, 'import numpy as np\n'), ((3237, 3257), 'fractions.Fraction', 'frac.Fraction', (['(-1)', '(1)'], {}), '(-1, 1)\n', (3250, 3257), True, 'import fractions as frac\n'), ((3486, 3516), 'numpy.argmin', 'np.argmin', (... |
# STL imports
import random
import logging
import string
import time
import datetime
import random
import struct
import sys
from functools import wraps
# Third party imports
import numpy as np
import faker
from faker.providers import BaseProvider
logging.getLogger('faker').setLevel(logging.ERROR)
sys.path.append('.'... | [
"logging.getLogger",
"random.choice",
"time.perf_counter",
"functools.wraps",
"datetime.timedelta",
"faker.Faker",
"datetime.datetime.now",
"numpy.random.randint",
"random.random",
"time.localtime",
"sys.path.append",
"random.randint",
"numpy.random.RandomState"
] | [((301, 321), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (316, 321), False, 'import sys\n'), ((1553, 1566), 'faker.Faker', 'faker.Faker', ([], {}), '()\n', (1564, 1566), False, 'import faker\n'), ((532, 559), 'numpy.random.RandomState', 'np.random.RandomState', (['(1234)'], {}), '(1234)\n', (55... |
import numba
import numpy as np
from scipy.sparse import csr_matrix
from .base import BasePointer, GraphBlasContainer
from .context import handle_panic, return_error
from .exceptions import GrB_Info
class MatrixPtr(BasePointer):
def set_matrix(self, matrix):
self.instance = matrix
class Matrix(GraphBlas... | [
"scipy.sparse.csr_matrix",
"numpy.empty"
] | [((2755, 2796), 'numpy.empty', 'np.empty', (['(tmp_output_size,)'], {'dtype': 'dtype'}), '((tmp_output_size,), dtype=dtype)\n', (2763, 2796), True, 'import numpy as np\n'), ((2811, 2862), 'numpy.empty', 'np.empty', (['(tmp_output_size,)'], {'dtype': 'a_indices.dtype'}), '((tmp_output_size,), dtype=a_indices.dtype)\n', ... |
import numpy as np
class CellularAutomationModel:
grid_width = 40
grid_height = 40
def __init__(self):
self.grid = self._randomised_grid()
def evolve(self):
"""
Evolve the current grid state using Conway's Game of Life algorithm.
:returns
dict: A dictiona... | [
"numpy.random.randint"
] | [((2271, 2333), 'numpy.random.randint', 'np.random.randint', (['(2)'], {'size': '(self.grid_height, self.grid_width)'}), '(2, size=(self.grid_height, self.grid_width))\n', (2288, 2333), True, 'import numpy as np\n')] |
# run.py
"""
Script for running a specific pipeline from a given yaml config file
"""
import os
import argparse
import yaml
from importlib import import_module
import numpy as np
import time
import pandas as pd
def import_from_path(path_to_module, obj_name = None):
"""
Import an object from a module based o... | [
"importlib.import_module",
"os.makedirs",
"argparse.ArgumentParser",
"pandas.read_csv",
"os.path.join",
"pandas.DataFrame.from_dict",
"yaml.safe_load",
"os.path.isdir",
"pandas.concat",
"pandas.DataFrame",
"time.time",
"numpy.arange"
] | [((525, 551), 'importlib.import_module', 'import_module', (['module_name'], {}), '(module_name)\n', (538, 551), False, 'from importlib import import_module\n'), ((691, 735), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (714, 735), False, 'import argp... |
import glob
import os
import os.path
import sys
import shutil
import cPickle
from types import StringType, UnicodeType
from distutils.core import setup
from distutils.extension import Extension
from distutils.command.install import install
PY3K = sys.version_info[0] > 2
with open('README.rst') as inp:
long_descr... | [
"os.path.join",
"distutils.extension.Extension",
"numpy.get_include"
] | [((1721, 1820), 'distutils.extension.Extension', 'Extension', (['"""prody.proteins.cpairwise2"""', "['prody/proteins/cpairwise2.c']"], {'include_dirs': "['prody']"}), "('prody.proteins.cpairwise2', ['prody/proteins/cpairwise2.c'],\n include_dirs=['prody'])\n", (1730, 1820), False, 'from distutils.extension import Ex... |
import numpy as np
def pline(x1, y1, x2, y2, x, y):
px = x2 - x1
py = y2 - y1
dd = px * px + py * py
u = ((x - x1) * px + (y - y1) * py) / max(1e-9, float(dd))
dx = x1 + u * px - x
dy = y1 + u * py - y
return dx * dx + dy * dy
def psegment(x1, y1, x2, y2, x, y):
px = x2 - x1
py =... | [
"numpy.array"
] | [((2149, 2165), 'numpy.array', 'np.array', (['nlines'], {}), '(nlines)\n', (2157, 2165), True, 'import numpy as np\n'), ((2167, 2184), 'numpy.array', 'np.array', (['nscores'], {}), '(nscores)\n', (2175, 2184), True, 'import numpy as np\n'), ((2056, 2106), 'numpy.array', 'np.array', (['[p + (q - p) * start, p + (q - p) ... |
import os
from typing import List, Optional
import pickle
import numpy as np
from utilities import augment_long_text, tokenize, tokenize_long_text, to_chars, align
from config import Config as cf
PAD = 0 # TODO: choose appropriate index for these special chars
UNK = 1
DEFAULT = {'PAD': PAD, 'UNK': UNK}
DEFAULT_C = {''... | [
"os.path.exists",
"pickle.dump",
"os.makedirs",
"pickle.load",
"utilities.align",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.random.uniform",
"utilities.to_chars",
"numpy.save",
"utilities.tokenize",
"utilities.tokenize_long_text",
"numpy.load"
] | [((6131, 6178), 'utilities.to_chars', 'to_chars', (['answer_toks', 'cf.WORD_LEN', 'cf.PAD_CHAR'], {}), '(answer_toks, cf.WORD_LEN, cf.PAD_CHAR)\n', (6139, 6178), False, 'from utilities import augment_long_text, tokenize, tokenize_long_text, to_chars, align\n'), ((7546, 7590), 'utilities.to_chars', 'to_chars', (['questi... |
import numpy
from kapteyn import maputils
from matplotlib.pyplot import show, figure
import csv # Read some poitions from file in Comma Separated Values format
# Some initializations
blankcol = "#334455" # Represent undefined values by this color
epsilon = 0.0000000001
figsize = (9,7) ... | [
"matplotlib.pyplot.figure",
"kapteyn.maputils.FITSimage",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((387, 410), 'matplotlib.pyplot.figure', 'figure', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (393, 410), False, 'from matplotlib.pyplot import show, figure\n'), ((453, 490), 'kapteyn.maputils.FITSimage', 'maputils.FITSimage', (['"""allsky_raw.fits"""'], {}), "('allsky_raw.fits')\n", (471, 490), False, 'from... |
import uuid
import random
import os
import math
import numpy as np
import simpy
import matplotlib.pyplot as plt
from simulation.ghostdag import block
from simulation.ghostdag.dag import select_ghostdag_k, DAG
from simulation.fakes import FakeDAG
from simulation.channel import Hub, Channel, PlanarTopology
from simulat... | [
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"simulation.ghostdag.dag.DAG",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"simulation.channel.Hub",
"os.path.isdir",
"os.mkdir",
"numpy.random.seed",
"simpy.Environment",
"uuid.uuid1",
"matplotlib.pyplot.show",
"simulation.helpers.print_st... | [((570, 632), 'simulation.ghostdag.dag.DAG', 'DAG', ([], {'k': 'k', 'interval': '(0, 2 ** 64 - 1)', 'genesis_hash': 'genesis_hash'}), '(k=k, interval=(0, 2 ** 64 - 1), genesis_hash=genesis_hash)\n', (573, 632), False, 'from simulation.ghostdag.dag import select_ghostdag_k, DAG\n'), ((846, 899), 'simulation.miner.Miner'... |
import argparse
import os
import cv2
import numpy as np
def gamma_correction(source_path, destination_path, a, b, version):
# Load image into memory
# Algorithm can work correctly with colored and grayscale images
if version == 'colored':
original_image = cv2.imread(source_path)
elif version ... | [
"os.path.exists",
"numpy.rint",
"argparse.ArgumentParser",
"cv2.imread"
] | [((836, 860), 'numpy.rint', 'np.rint', (['processed_image'], {}), '(processed_image)\n', (843, 860), True, 'import numpy as np\n'), ((1040, 1104), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Perform gamma correction."""'}), "(description='Perform gamma correction.')\n", (1063, 1104), ... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"numpy.mean",
"paddle.distributed.fleet.worker_index",
"paddle.fluid.default_startup_program",
"paddle.fluid.CPUPlace",
"os.environ.get",
"paddle.fluid.default_main_program",
"paddle.fluid.Executor",
"paddle.distributed.fleet.stop_worker",
"paddle.distributed.fleet.init_worker",
"time.time"
] | [((960, 976), 'paddle.fluid.CPUPlace', 'fluid.CPUPlace', ([], {}), '()\n', (974, 976), True, 'import paddle.fluid as fluid\n'), ((996, 1022), 'paddle.fluid.Executor', 'fluid.Executor', (['self.place'], {}), '(self.place)\n', (1010, 1022), True, 'import paddle.fluid as fluid\n'), ((1092, 1111), 'paddle.distributed.fleet... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"logging.getLogger",
"numpy.ones",
"numpy.asarray",
"numpy.array",
"numpy.zeros",
"numpy.full"
] | [((1026, 1053), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1043, 1053), False, 'import logging\n'), ((8151, 8180), 'numpy.zeros', 'np.zeros', (['num_vars'], {'dtype': 'int'}), '(num_vars, dtype=int)\n', (8159, 8180), True, 'import numpy as np\n'), ((8201, 8242), 'numpy.zeros', 'np.ze... |
""" Decision Trees - Supervised learning: 1-Classification*, 2-Regression.
D.T.s are a non-parametric supervised learning method used for classification and regression. The goal is to create a
model that predicts the value of a target variable by learning simple decision rules inferred from the data features.
Some adv... | [
"sklearn.metrics.classification_report",
"sklearn.tree.DecisionTreeClassifier",
"numpy.asarray",
"sklearn.datasets.load_breast_cancer",
"sklearn.cross_validation.train_test_split",
"sklearn.externals.joblib.dump",
"sklearn.metrics.confusion_matrix"
] | [((4019, 4048), 'sklearn.datasets.load_breast_cancer', 'datasets.load_breast_cancer', ([], {}), '()\n', (4046, 4048), False, 'from sklearn import datasets, metrics, tree\n'), ((4099, 4132), 'numpy.asarray', 'np.asarray', (['data'], {'dtype': '"""float32"""'}), "(data, dtype='float32')\n", (4109, 4132), True, 'import nu... |
"""
.. todo::
WRITEME
"""
import logging
from theano import function, shared
from pylearn2.optimization import linear_cg as cg
from pylearn2.optimization.feature_sign import feature_sign_search
import numpy as N
import theano.tensor as T
from pylearn2.utils.rng import make_np_rng
logger = logging.getLogger(__nam... | [
"logging.getLogger",
"pylearn2.optimization.feature_sign.feature_sign_search",
"pylearn2.utils.rng.make_np_rng",
"pylearn2.optimization.linear_cg.linear_cg",
"numpy.abs",
"theano.function",
"theano.tensor.sum",
"theano.tensor.vector",
"theano.tensor.sqr",
"numpy.zeros",
"numpy.isnan",
"numpy.i... | [((297, 324), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (314, 324), False, 'import logging\n'), ((647, 697), 'pylearn2.utils.rng.make_np_rng', 'make_np_rng', (['None', '[1, 2, 3]'], {'which_method': '"""randn"""'}), "(None, [1, 2, 3], which_method='randn')\n", (658, 697), False, 'fro... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import time
import sys
import functools
import math
import paddle
import paddle.fluid as fluid
import paddle.dataset.flowers as flowers
import models
import reader
import argparse
fr... | [
"paddle.fluid.DataFeeder",
"paddle.dataset.flowers.test",
"paddle.fluid.layers.data",
"paddle.fluid.layers.cross_entropy",
"numpy.array",
"paddle.fluid.Executor",
"paddle.dataset.flowers.train",
"paddle.fluid.layers.piecewise_decay",
"reader.train",
"numpy.mean",
"argparse.ArgumentParser",
"pa... | [((425, 469), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (448, 469), False, 'import argparse\n'), ((480, 530), 'functools.partial', 'functools.partial', (['add_arguments'], {'argparser': 'parser'}), '(add_arguments, argparser=parser)\n', (497, 530)... |
from __future__ import print_function
import os
import base64
import cStringIO
import time
import numpy
from PIL import Image
from flask import (Flask, request, render_template, url_for, flash, redirect,
send_file)
from SeamErasure import seam_erasure, obj_reader, util
from SeamErasure.lib import weight_data
... | [
"flask.render_template",
"PIL.Image.fromarray",
"cStringIO.StringIO",
"SeamErasure.obj_reader.parse_obj",
"SeamErasure.lib.weight_data.write_tex_to_file",
"PIL.Image.open",
"flask.Flask",
"SeamErasure.lib.weight_data.read_tex_from_file",
"SeamErasure.seam_erasure.erase_seam",
"numpy.squeeze",
"o... | [((326, 341), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (331, 341), False, 'from flask import Flask, request, render_template, url_for, flash, redirect, send_file\n'), ((1175, 1207), 'flask.render_template', 'render_template', (['"""min-form.html"""'], {}), "('min-form.html')\n", (1190, 1207), False, ... |
# Copyright 2018 <NAME>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | [
"tensorflow.device",
"tensorflow.nn.tanh",
"utils.PytorchInitializer",
"tensorflow.GradientTape",
"numpy.array",
"tensorflow.concat",
"numpy.zeros",
"tensorflow.constant",
"tensorflow.stop_gradient",
"numpy.expand_dims",
"tensorflow.add_n",
"tensorflow.train.AdamOptimizer"
] | [((3624, 3668), 'tensorflow.train.AdamOptimizer', 'tf.train.AdamOptimizer', ([], {'learning_rate': '(0.0001)'}), '(learning_rate=0.0001)\n', (3646, 3668), True, 'import tensorflow as tf\n'), ((3977, 4020), 'tensorflow.train.AdamOptimizer', 'tf.train.AdamOptimizer', ([], {'learning_rate': '(0.001)'}), '(learning_rate=0.... |
import numpy as np
from scipy.io import loadmat
import os
import logging
from scipy.signal import butter, filtfilt
def mat2npy(mat_chanmap_dir):
mat_chanmap = loadmat(mat_chanmap_dir)
x = mat_chanmap['xcoords']
y = mat_chanmap['ycoords']
npy_chanmap = np.hstack([x,y])
#np.save('chanmap.npy', n... | [
"logging.getLogger",
"numpy.mean",
"numpy.savez",
"os.listdir",
"numpy.abs",
"numpy.hstack",
"scipy.signal.filtfilt",
"numpy.where",
"scipy.io.loadmat",
"os.path.join",
"scipy.signal.butter",
"numpy.zeros",
"numpy.load",
"numpy.divide"
] | [((164, 188), 'scipy.io.loadmat', 'loadmat', (['mat_chanmap_dir'], {}), '(mat_chanmap_dir)\n', (171, 188), False, 'from scipy.io import loadmat\n'), ((274, 291), 'numpy.hstack', 'np.hstack', (['[x, y]'], {}), '([x, y])\n', (283, 291), True, 'import numpy as np\n'), ((495, 524), 'os.listdir', 'os.listdir', (['filtered_l... |
#
# Copyright (c) 2021 Idiap Research Institute, https://www.idiap.ch/
# Written by <NAME> <<EMAIL>>
#
""" Computes the proportion of novel bigrams in the summary. """
import numpy as np
import pandas as pd
from interface import Evaluation
from eval_utils import preprocess_article, preprocess_summary
class NovelBi... | [
"numpy.mean",
"eval_utils.preprocess_summary",
"eval_utils.preprocess_article",
"argparse.ArgumentParser"
] | [((2008, 2108), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Computes the proportion of novel bigrams in the summary."""'}), "(description=\n 'Computes the proportion of novel bigrams in the summary.')\n", (2031, 2108), False, 'import argparse\n'), ((869, 896), 'eval_utils.preproces... |
from scipy.special import factorial
from itertools import count
import numpy as np
from tmps.utils import pauli, fock
def get_boson_boson_dim(alpha, cutoff_coh):
"""
Find the cutoff for the local dimension (identical everywhere) from the chosen accuracy alpha for the impurity
coherent state.
"... | [
"tmps.utils.fock.a_dag",
"numpy.abs",
"scipy.special.factorial",
"numpy.array",
"tmps.utils.fock.n",
"tmps.utils.fock.a",
"itertools.count"
] | [((462, 482), 'itertools.count', 'count', (['cutoff_dim', '(1)'], {}), '(cutoff_dim, 1)\n', (467, 482), False, 'from itertools import count\n'), ((1654, 1676), 'tmps.utils.fock.n', 'fock.n', (['bath_local_dim'], {}), '(bath_local_dim)\n', (1660, 1676), False, 'from tmps.utils import pauli, fock\n'), ((3352, 3374), 'tmp... |
import numpy as np
class Material:
"""send color as list of 3 floats in range of 0-1"""
def __init__(self, color, reflection=0, transparency=0, emission=np.array((0, 0, 0)), refraction_ind=1):
self.color = np.array(color)
self.emission = emission # only for light sources
self.reflect... | [
"numpy.array"
] | [((164, 183), 'numpy.array', 'np.array', (['(0, 0, 0)'], {}), '((0, 0, 0))\n', (172, 183), True, 'import numpy as np\n'), ((225, 240), 'numpy.array', 'np.array', (['color'], {}), '(color)\n', (233, 240), True, 'import numpy as np\n')] |
import gym
from gym import error, spaces, utils
from gym.utils import seeding
from eplus.envs import pyEp
import socket
from eplus.envs.socket_builder import socket_builder
import numpy as np
import os
class DataCenterEnv(gym.Env):
def __init__(self, config):
#timestep=12, days=1, eplus_path=None,
... | [
"eplus.envs.pyEp.ep_process",
"numpy.clip",
"eplus.envs.socket_builder.socket_builder",
"os.path.dirname",
"numpy.array"
] | [((425, 450), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (440, 450), False, 'import os\n'), ((6761, 6822), 'numpy.array', 'np.array', (['[self.outputs[1], self.outputs[2], self.outputs[4]]'], {}), '([self.outputs[1], self.outputs[2], self.outputs[4]])\n', (6769, 6822), True, 'import numpy... |
# Copyright (c) 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
"numpy.clip",
"numpy.random.default_rng",
"math.cos",
"numpy.array",
"nvidia.dali.ops.readers.Caffe",
"numpy.linalg.norm",
"sequences_test_utils.ArgDesc",
"random.Random",
"numpy.max",
"math.sin",
"numpy.matmul",
"test_utils.compare_pipelines",
"sequences_test_utils.get_video_input_cases",
... | [((1055, 1097), 'os.path.join', 'os.path.join', (['test_data_root', '"""db"""', '"""lmdb"""'], {}), "(test_data_root, 'db', 'lmdb')\n", (1067, 1097), False, 'import os\n'), ((1829, 1849), 'numpy.linalg.norm', 'np.linalg.norm', (['axis'], {}), '(axis)\n', (1843, 1849), True, 'import numpy as np\n'), ((1919, 1934), 'math... |
#%%
import os
print(os.getcwd())
from Blocks import ReLU, SequentialNN, Dense, Hinge, SGD
from dataset_utils import load_mnist
import numpy as np
from convolution_layer import ConvLayer
from maxpool_layer import MaxPool2x2
from flatten_layer import FlattenLayer
import sys
def iterate_minibatches(x, y, batch_size=16, ... | [
"flatten_layer.FlattenLayer",
"numpy.mean",
"convolution_layer.ConvLayer",
"Blocks.SGD",
"Blocks.SequentialNN",
"maxpool_layer.MaxPool2x2",
"matplotlib.pyplot.twinx",
"os.getcwd",
"numpy.array",
"matplotlib.pyplot.figure",
"Blocks.Dense",
"Blocks.Hinge",
"Blocks.ReLU",
"sys.stdout.flush",
... | [((1357, 1364), 'Blocks.Hinge', 'Hinge', ([], {}), '()\n', (1362, 1364), False, 'from Blocks import ReLU, SequentialNN, Dense, Hinge, SGD\n'), ((1377, 1384), 'Blocks.SGD', 'SGD', (['nn'], {}), '(nn)\n', (1380, 1384), False, 'from Blocks import ReLU, SequentialNN, Dense, Hinge, SGD\n'), ((1456, 1489), 'numpy.array', 'np... |
# Normal-exponential using out-of-band probes
# normex: negative control probes
# noob: ‘out-of-band’ Infinium I probes
# Lib
import logging
import numpy as np
import pandas as pd
from statsmodels import robust
from scipy.stats import norm, lognorm
# App
from ..models import ControlType, ArrayType
from ..models.sketch... | [
"logging.getLogger",
"numpy.median",
"scipy.stats.norm",
"statsmodels.robust.mad",
"pandas.concat",
"pandas.DataFrame",
"numpy.maximum",
"numpy.seterr"
] | [((450, 477), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (467, 477), False, 'import logging\n'), ((3266, 3319), 'pandas.DataFrame', 'pd.DataFrame', (['(Rmeth + Runmeth)'], {'columns': "['mean_value']"}), "(Rmeth + Runmeth, columns=['mean_value'])\n", (3278, 3319), True, 'import pandas... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from typing import List
import numpy as np
from pydantic import BaseModel, validator
from ray.rllib.agents.dqn import ApexTrain... | [
"logging.getLogger",
"numpy.median",
"compiler_gym.util.timer.Timer",
"pydantic.validator"
] | [((596, 623), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (613, 623), False, 'import logging\n'), ((4873, 4905), 'pydantic.validator', 'validator', (['"""benchmark"""'], {'pre': '(True)'}), "('benchmark', pre=True)\n", (4882, 4905), False, 'from pydantic import BaseModel, validator\n')... |
"""
TO DO:
1. Lot of edge cases not accounted for
2. Could use some unit testing scripts for sanity check
3. What are the bounds for years?
"""
import mysql
from mysql.connector import Error
import re
import numpy as np
def reject_outliers(data, m = 6.):
d = np.abs(data - np.median(data))
... | [
"re.sub",
"re.findall",
"mysql.connector.connect",
"numpy.median"
] | [((330, 342), 'numpy.median', 'np.median', (['d'], {}), '(d)\n', (339, 342), True, 'import numpy as np\n'), ((438, 544), 'mysql.connector.connect', 'mysql.connector.connect', ([], {'host': '"""127.0.0.1"""', 'port': '(3307)', 'database': '"""explorer_db"""', 'user': '"""root"""', 'password': '""""""'}), "(host='127.0.0... |
"""
Implements Pseudo-outcome based Two-step Nets, namely the DR-learner, the PW-learner and the
RA-learner.
"""
# Author: <NAME>
from typing import Callable, Optional, Tuple
import jax.numpy as jnp
import numpy as onp
import pandas as pd
from sklearn.model_selection import StratifiedKFold
import catenets.logger as l... | [
"catenets.logger.debug",
"catenets.models.jax.model_utils.check_shape_1d_data",
"numpy.ones",
"catenets.models.jax.transformation_utils._get_transformation_function",
"sklearn.model_selection.StratifiedKFold",
"numpy.zeros",
"numpy.std",
"catenets.models.jax.base.train_output_net_only",
"numpy.round... | [((18080, 18124), 'catenets.models.jax.transformation_utils._get_transformation_function', '_get_transformation_function', (['transformation'], {}), '(transformation)\n', (18108, 18124), False, 'from catenets.models.jax.transformation_utils import DR_TRANSFORMATION, PW_TRANSFORMATION, RA_TRANSFORMATION, _get_transforma... |
from io import StringIO
import itertools
import numpy as np
import numpy.ma as ma
inputfile = './input/day9.txt'
# inputfile = StringIO('''2199943210
# 3987894921
# 9856789892
# 8767896789
# 9899965678''')
def neighbors(ar, i, j):
return {ar[i-1,j],
ar[i+1,j],
ar[i,j-1],
ar[i... | [
"numpy.pad",
"numpy.genfromtxt"
] | [((333, 381), 'numpy.genfromtxt', 'np.genfromtxt', (['inputfile'], {'dtype': '"""i"""', 'delimiter': '(1)'}), "(inputfile, dtype='i', delimiter=1)\n", (346, 381), True, 'import numpy as np\n'), ((409, 456), 'numpy.pad', 'np.pad', (['a', '((1, 1), (1, 1))'], {'constant_values': '(10)'}), '(a, ((1, 1), (1, 1)), constant_... |
"""Check the feasibility of a bipartite graph by using SSLAP's feasibility module"""
import numpy as np
from sslap import hopcroft_solve
# All 3 methods will use the same input bipartite graph:
# i = 0 connects to j = 0, 1
# i = 1 connects to j = 1, 2
# i = 2 connects to j = 1, 4
# i = 3 connects to j = 2
# i = 4 con... | [
"numpy.array",
"numpy.ones",
"sslap.hopcroft_solve"
] | [((494, 523), 'sslap.hopcroft_solve', 'hopcroft_solve', ([], {'lookup': 'lookup'}), '(lookup=lookup)\n', (508, 523), False, 'from sslap import hopcroft_solve\n'), ((690, 713), 'sslap.hopcroft_solve', 'hopcroft_solve', ([], {'mat': 'mat'}), '(mat=mat)\n', (704, 713), False, 'from sslap import hopcroft_solve\n'), ((752, ... |
import caffe
import torch
import numpy as np
import argparse
from collections import OrderedDict
from torch.autograd import Variable
import torch.nn as nn
def arg_parse():
parser = argparse.ArgumentParser()
parser.add_argument('--model', '-m', default='alexnet')
parser.add_argument('--decimal', '-d', defa... | [
"numpy.prod",
"collections.OrderedDict",
"torchvision.models.inception.inception_v3",
"argparse.ArgumentParser",
"torchvision.models.resnet.resnet18",
"torch.Tensor",
"numpy.testing.assert_almost_equal",
"caffe.Net",
"torchvision.models.alexnet.alexnet"
] | [((187, 212), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (210, 212), False, 'import argparse\n'), ((836, 849), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (847, 849), False, 'from collections import OrderedDict\n'), ((1695, 1708), 'collections.OrderedDict', 'OrderedDict', ([... |
# coding=utf-8
import logging
import numpy as np
import pandas as pd
from sklearn import metrics
from sklearn.linear_model import LogisticRegression
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import shuffle
logging.basicConfig(format='%(level... | [
"logging.basicConfig",
"sklearn.preprocessing.LabelBinarizer",
"pandas.read_csv",
"numpy.where",
"sklearn.utils.shuffle",
"numpy.argmax",
"numpy.isin",
"sklearn.linear_model.LogisticRegression",
"numpy.array",
"numpy.linalg.norm"
] | [((285, 361), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s:%(message)s"""', 'level': 'logging.ERROR'}), "(format='%(levelname)s:%(message)s', level=logging.ERROR)\n", (304, 361), False, 'import logging\n'), ((538, 581), 'pandas.read_csv', 'pd.read_csv', (['lbl_path'], {'header': 'None... |
import csv
import cv2
import numpy as np
import pandas as pd
import sys
from datetime import datetime
from numpy.random import RandomState
import keras
import tensorflow as tf
from keras.models import Sequential
from keras.callbacks import ModelCheckpoint
from keras.layers import Flatten, Dense, Lambda, Cropping2D, C... | [
"keras.optimizers.Adam",
"keras.layers.Conv2D",
"keras.layers.Flatten",
"pandas.read_csv",
"cv2.flip",
"keras.layers.Lambda",
"tensorflow.multiply",
"keras.callbacks.TensorBoard",
"keras.models.Sequential",
"numpy.array",
"keras.layers.Dropout",
"keras.layers.Dense",
"keras.layers.MaxPool2D"... | [((14357, 14369), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (14367, 14369), False, 'from keras.models import Sequential\n'), ((15282, 15386), 'pandas.read_csv', 'pd.read_csv', (['"""data/driving_log.csv"""'], {'names': "['center', 'left', 'right', 'measurement', '1', '2', '3']"}), "('data/driving_log.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.