code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import pytest import numpy as np import torch.nn as nn from skorch import NeuralNetRegressor from mltome.skorch.lr_finder import lr_find class MyModule(nn.Module): def __init__(self): super().__init__() self.layer1 = nn.Linear(1, 2) self.layer2 = nn.Linear(2, 1) def forward(self, x):...
[ "mltome.skorch.lr_finder.lr_find", "numpy.ones", "torch.nn.Linear" ]
[((402, 437), 'numpy.ones', 'np.ones', (['(1000, 1)'], {'dtype': '"""float32"""'}), "((1000, 1), dtype='float32')\n", (409, 437), True, 'import numpy as np\n'), ((446, 481), 'numpy.ones', 'np.ones', (['(1000, 1)'], {'dtype': '"""float32"""'}), "((1000, 1), dtype='float32')\n", (453, 481), True, 'import numpy as np\n'),...
from .version import __version__ import pyopencl as cl import pyopencl.clmath as cl_math import pyopencl.array as cl_array import numpy as np ctx = None queue = None from . import ops, regularizers, solvers def create_ctx_queue(): global ctx, queue ctx = cl.create_some_context(interactive=False) queue =...
[ "pyopencl.array.empty_like", "pyopencl.array.zeros_like", "pyopencl.array.empty", "pyopencl.create_some_context", "pyopencl.CommandQueue", "numpy.require", "pyopencl.array.zeros" ]
[((267, 308), 'pyopencl.create_some_context', 'cl.create_some_context', ([], {'interactive': '(False)'}), '(interactive=False)\n', (289, 308), True, 'import pyopencl as cl\n'), ((321, 341), 'pyopencl.CommandQueue', 'cl.CommandQueue', (['ctx'], {}), '(ctx)\n', (336, 341), True, 'import pyopencl as cl\n'), ((576, 611), '...
''' ''' import os import sys import resource import numpy as np import mpi4py.MPI as MPI sys.path.append(os.getcwd()) try: import BaryTreeInterface as BT except ImportError: print('Unable to import BaryTreeInterface due to ImportError') except OSError: print('Unable to import BaryTreeInterface due to OSEr...
[ "numpy.random.seed", "numpy.copy", "os.getcwd", "numpy.ones", "numpy.array", "numpy.random.rand" ]
[((107, 118), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (116, 118), False, 'import os\n'), ((798, 813), 'numpy.array', 'np.array', (['[0.5]'], {}), '([0.5])\n', (806, 813), True, 'import numpy as np\n'), ((854, 871), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (868, 871), True, 'import numpy as np\...
import torch import models.archs.discriminator_vgg_arch as SRGAN_arch import models.archs.unet_arch as unet_arch # Generator def define_G(opt): opt_net = opt['network_G'] which_model = opt_net['which_model_G'] # image restoration if which_model == 'unet': netG = unet_arch.Unet(in_ch=opt_net['...
[ "models.archs.unet_arch.Condition", "numpy.ceil", "torch.nn.Sequential", "models.archs.discriminator_vgg_arch.VGGFeatureExtractor", "torch.nn.Conv2d", "torch.cat", "models.archs.unet_arch.UnetSimpleCondMerge", "models.archs.unet_arch.Unet", "torch.nn.Linear", "torch.device", "models.archs.discri...
[((2992, 3034), 'torch.device', 'torch.device', (["('cuda' if gpu_ids else 'cpu')"], {}), "('cuda' if gpu_ids else 'cpu')\n", (3004, 3034), False, 'import torch\n'), ((3173, 3287), 'models.archs.discriminator_vgg_arch.VGGFeatureExtractor', 'SRGAN_arch.VGGFeatureExtractor', ([], {'feature_layer': 'feature_layer', 'use_b...
import ghost.sigtools import numpy as np def test_hilbert(): siglen = 30000*60 x = np.random.rand(siglen) analytic_scipy = ghost.sigtools.analytic_signal_scipy(x) analytic_fftw = ghost.sigtools.analytic_signal_fftw(x) assert np.allclose(analytic_scipy, analytic_fftw)
[ "numpy.random.rand", "numpy.allclose" ]
[((94, 116), 'numpy.random.rand', 'np.random.rand', (['siglen'], {}), '(siglen)\n', (108, 116), True, 'import numpy as np\n'), ((249, 291), 'numpy.allclose', 'np.allclose', (['analytic_scipy', 'analytic_fftw'], {}), '(analytic_scipy, analytic_fftw)\n', (260, 291), True, 'import numpy as np\n')]
""" Mixed-integer programming using the CPLEX """ import cplex # import the cplex solver package from numpy import ones, nonzero, zeros, concatenate from cplex.exceptions import CplexError def mixed_integer_linear_programming(c, Aeq=None, beq=None, A=None, b=None, xmin=None, xmax=None, vtypes=None, ...
[ "cplex.Cplex", "numpy.zeros", "numpy.ones", "numpy.nonzero", "numpy.array", "numpy.concatenate" ]
[((5754, 5767), 'numpy.array', 'array', (['[1, 1]'], {}), '([1, 1])\n', (5759, 5767), False, 'from numpy import array, zeros\n'), ((5776, 5791), 'numpy.array', 'array', (['[[1, 1]]'], {}), '([[1, 1]])\n', (5781, 5791), False, 'from numpy import array, zeros\n'), ((5800, 5811), 'numpy.array', 'array', (['[11]'], {}), '(...
import collections import copy import entrypoints import event_model from datetime import datetime import dask import dask.bag import functools import heapq import importlib import itertools import logging import cachetools from dask.base import tokenize import intake.catalog.base import intake.catalog.local import int...
[ "heapq.heappush", "collections.defaultdict", "entrypoints.get_group_named", "event_model.rechunk_datum_pages", "msgpack.packb", "collections.deque", "event_model.unpack_event_page", "event_model.pack_datum_page", "cachetools.LRUCache", "bluesky_live.conversion.documents_to_xarray", "dask.base.no...
[((993, 1020), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1010, 1020), False, 'import logging\n'), ((5401, 5435), 'dask.base.normalize_token.register', 'normalize_token.register', (['Document'], {}), '(Document)\n', (5425, 5435), False, 'from dask.base import normalize_token\n'), ((7...
import numpy as np from scipy.optimize import curve_fit def fit_hyperbola(x_arr, y_arr, y_err): """Fit a hyperbola Args: x_arr: X data y_arr: Y data y_err: Y errors Returns: Minimum of hyperbola and its uncertainty """ # initial guess ic = np.argmin(y_arr) ...
[ "numpy.sqrt", "numpy.abs", "numpy.argmin", "numpy.argmax" ]
[((301, 317), 'numpy.argmin', 'np.argmin', (['y_arr'], {}), '(y_arr)\n', (310, 317), True, 'import numpy as np\n'), ((327, 343), 'numpy.argmax', 'np.argmax', (['y_arr'], {}), '(y_arr)\n', (336, 343), True, 'import numpy as np\n'), ((410, 451), 'numpy.abs', 'np.abs', (['((y_arr[ic] - y_arr[ix]) / (c - x))'], {}), '((y_a...
import numpy as np from autumn.core.utils.utils import get_apply_odds_ratio_to_prop def test_apply_odds_ratio_to_prop(n_props_to_test=100, n_ratios_to_test=100, error=1e-6): """ Test that the results makes sense when we apply an odds ratio to a proportion. """ # Get some raw proportions and some odd...
[ "autumn.core.utils.utils.get_apply_odds_ratio_to_prop", "numpy.random.uniform" ]
[((356, 395), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': 'n_props_to_test'}), '(size=n_props_to_test)\n', (373, 395), True, 'import numpy as np\n'), ((414, 454), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': 'n_ratios_to_test'}), '(size=n_ratios_to_test)\n', (431, 454), True, 'import numpy ...
import logging import os import pickle import numpy as np from tqdm import * import math import numbers import numpy as np import torch logger = logging.getLogger(__name__) class Meter(object): def reset(self): pass def add(self): pass def value(self): pass class AUCMeter(Meter)...
[ "numpy.asarray", "numpy.zeros", "numpy.ndim", "torch.LongStorage", "numpy.equal", "numpy.append", "torch.DoubleStorage", "torch.is_tensor", "os.path.join", "logging.getLogger", "torch.from_numpy" ]
[((147, 174), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (164, 174), False, 'import logging\n'), ((622, 645), 'torch.is_tensor', 'torch.is_tensor', (['output'], {}), '(output)\n', (637, 645), False, 'import torch\n'), ((710, 733), 'torch.is_tensor', 'torch.is_tensor', (['target'], {})...
import matplotlib.pyplot as plt import numpy as np def main(): fig2, ax2 = plt.subplots(2, 2, sharex=True) x = np.linspace(-2, 2, 100) y1 = np.sin(4*x) y2 = np.cos(x)*np.sin(x) y3 = x**4 y4 = np.cos(x) + np.sin(x) # first subplot ax2[0,0].plot(x,y1,"red",label="$sin(4x)$") ax2[0,0...
[ "matplotlib.pyplot.show", "numpy.sin", "numpy.cos", "numpy.linspace", "matplotlib.pyplot.subplots" ]
[((81, 112), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(2)'], {'sharex': '(True)'}), '(2, 2, sharex=True)\n', (93, 112), True, 'import matplotlib.pyplot as plt\n'), ((121, 144), 'numpy.linspace', 'np.linspace', (['(-2)', '(2)', '(100)'], {}), '(-2, 2, 100)\n', (132, 144), True, 'import numpy as np\n'), ((...
import numpy as np import pandas as pd from imgaug import augmenters as iaa points = [ (2, 0, 0, 0), (0, 2, 0, 0), (0, 0, 2, 0), (0, 0, 0, 2) ] AUGMENTERS = [iaa.Crop(px=p) for p in points] AUGMENTERS += [iaa.Sequential([ iaa.Affine(scale={"x": 1.05, "y": 1.05}, rotate=(5, 0)), iaa.Crop(px=p) ...
[ "numpy.dstack", "numpy.save", "pandas.read_csv", "imgaug.augmenters.Affine", "numpy.array", "imgaug.augmenters.Crop", "numpy.fromstring" ]
[((176, 190), 'imgaug.augmenters.Crop', 'iaa.Crop', ([], {'px': 'p'}), '(px=p)\n', (184, 190), True, 'from imgaug import augmenters as iaa\n'), ((887, 926), 'pandas.read_csv', 'pd.read_csv', (['"""data/dataset/fer2013.csv"""'], {}), "('data/dataset/fer2013.csv')\n", (898, 926), True, 'import pandas as pd\n'), ((979, 10...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 8 14:34:31 2018 @author: nelson """ from __future__ import absolute_import, division, print_function import argparse import base64 import json import os import os.path as osp import warnings import numpy as np import glob from sklearn.model_select...
[ "argparse.ArgumentParser", "sklearn.model_selection.train_test_split", "glob.glob", "os.path.join", "imgaug.augmenters.GaussianBlur", "os.path.dirname", "numpy.max", "imgaug.augmenters.Crop", "labelme.utils.shapes_to_label", "labelme.utils.img_b64_to_arr", "numpy.uint8", "os.path.basename", ...
[((2188, 2263), 'imgaug.SegmentationMapOnImage', 'ia.SegmentationMapOnImage', (['depth_map'], {'shape': 'depth_map.shape', 'nb_classes': '(256)'}), '(depth_map, shape=depth_map.shape, nb_classes=256)\n', (2213, 2263), True, 'import imgaug as ia\n'), ((7664, 7689), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (...
import json from logging import warning from typing import Iterable, Union import numpy as np import tensorflow as tf from tensorflow.keras import activations, regularizers, initializers from tensorflow.keras.layers import Layer from tensorflow.keras.models import model_from_json from tensorflow.keras.utils import get...
[ "tensorflow.einsum", "tensorflow.keras.utils.get_custom_objects", "tensorflow.zeros_like", "json.dumps", "tensorflow.keras.initializers.zeros", "tensorflow.sqrt", "tensorflow.keras.activations.get", "tensorflow.keras.regularizers.l2", "json.loads", "tensorflow.TensorShape", "tensorflow.concat", ...
[((16894, 16913), 'numpy.zeros', 'np.zeros', (['(3, 3, 3)'], {}), '((3, 3, 3))\n', (16902, 16913), True, 'import numpy as np\n'), ((17056, 17087), 'tensorflow.constant', 'tf.constant', (['eijk_'], {'dtype': 'dtype'}), '(eijk_, dtype=dtype)\n', (17067, 17087), True, 'import tensorflow as tf\n'), ((21321, 21346), 'tensor...
import cv2 import numpy as np class Compose(object): def __init__(self, transforms): self.transforms = transforms def __call__(self, image, label=None): for t in self.transforms: image, label = t(image, label) return image, label class Normalize(object): def __init__(s...
[ "numpy.flip", "cv2.imwrite", "cv2.copyMakeBorder", "cv2.imread", "numpy.array", "numpy.random.rand", "cv2.resize" ]
[((5616, 5690), 'cv2.imread', 'cv2.imread', (['"""work/dummy_data/JPEGImages/2008_000064.jpg"""', 'cv2.IMREAD_COLOR'], {}), "('work/dummy_data/JPEGImages/2008_000064.jpg', cv2.IMREAD_COLOR)\n", (5626, 5690), False, 'import cv2\n'), ((5702, 5799), 'cv2.imread', 'cv2.imread', (['"""work/dummy_data/GroundTruth_trainval_pn...
from keras.models import load_model import string from numpy import array import keras from keras.preprocessing.text import Tokenizer from keras.utils import to_categorical from keras.callbacks import LambdaCallback from keras.preprocessing.sequence import pad_sequences from keras.models import Sequential from keras.l...
[ "keras.models.load_model", "getopt.getopt", "keras.preprocessing.sequence.pad_sequences", "keras.layers.LSTM", "keras.callbacks.LambdaCallback", "keras.preprocessing.text.Tokenizer", "numpy.array", "keras.layers.Embedding", "keras.layers.Dense", "ast.literal_eval", "keras.models.Sequential", "...
[((8191, 8207), 'numpy.array', 'array', (['sequences'], {}), '(sequences)\n', (8196, 8207), False, 'from numpy import array\n'), ((8254, 8295), 'keras.utils.to_categorical', 'to_categorical', (['y'], {'num_classes': 'vocab_size'}), '(y, num_classes=vocab_size)\n', (8268, 8295), False, 'from keras.utils import to_catego...
from __future__ import print_function import os import sys import argparse import time import math import csv from numpy.core.arrayprint import _void_scalar_repr import tensorboard_logger as tb_logger import torch import torch.backends.cudnn as cudnn import numpy as np from torchvision import transforms, datasets fro...
[ "pytorch_grad_cam.AblationCAM", "datasets.general_dataset.GeneralDataset", "sklearn.metrics.accuracy_score", "torch.cuda.device_count", "torchvision.datasets.CIFAR10", "sklearn.metrics.f1_score", "torch.nn.Softmax", "sys.stdout.flush", "util.AverageMeter", "torchvision.transforms.Normalize", "ut...
[((1483, 1523), 'torchvision.transforms.Normalize', 'transforms.Normalize', ([], {'mean': 'mean', 'std': 'std'}), '(mean=mean, std=std)\n', (1503, 1523), False, 'from torchvision import transforms, datasets\n'), ((1547, 1602), 'util.get_transform', 'get_transform', ([], {'opt': 'opt', 'mean': 'mean', 'std': 'std', 'sca...
from numpy.random import choice from random import choice as c2 from random import randint, getrandbits import json import sys password = ( "<PASSWORD>=" ) MG = ["Male", "Other"] FG = ["Female", "Other"] PREF = ["straight", "gay", "bisexual"] with open("raw.json", "r") as f: raw = json.load(f) def email_...
[ "json.dump", "json.load", "random.randint", "random.choice", "numpy.random.choice" ]
[((295, 307), 'json.load', 'json.load', (['f'], {}), '(f)\n', (304, 307), False, 'import json\n'), ((579, 594), 'random.randint', 'randint', (['(1)', '(999)'], {}), '(1, 999)\n', (586, 594), False, 'from random import randint, getrandbits\n'), ((1086, 1113), 'json.dump', 'json.dump', (['raw', 'f'], {'indent': '(4)'}), ...
# BayesFactorFMRI: This is a GUI-aided tool to perform Bayesian meta-analysis of fMRI data and Bayesian second-level analysis of fMRI contrast files (one-sample t-test) with multiprocessing. # author: <NAME>, University of Alabama (<EMAIL>) # BayesFactorFMRI is licensed under MIT License. # Citations # In addition to ...
[ "bayes_correction_modlist.bayes_correction_modlist", "nibabel.load", "math.sqrt", "os.cpu_count", "datetime.datetime.now", "bayes_correction_split.bayes_correction_split", "numpy.prod" ]
[((1351, 1365), 'os.cpu_count', 'os.cpu_count', ([], {}), '()\n', (1363, 1365), False, 'import os\n'), ((1661, 1675), 'nibabel.load', 'nib.load', (['mask'], {}), '(mask)\n', (1669, 1675), True, 'import nibabel as nib\n'), ((1799, 1842), 'bayes_correction_split.bayes_correction_split', 'bcs.bayes_correction_split', (['m...
## The plotter service validates the given min and max x-values, generates ## x-values and uses the given expression tree to generate the y-values. It is ## part of the application domain model in the MVP architecture. import numpy as np class XRangeError(Exception): pass class Plotter(object): """ Rep...
[ "numpy.linspace" ]
[((1747, 1778), 'numpy.linspace', 'np.linspace', (['x_min', 'x_max', '(1000)'], {}), '(x_min, x_max, 1000)\n', (1758, 1778), True, 'import numpy as np\n')]
import argparse from tqdm import tqdm import numpy as np def _get_density(bar_word): assert _is_bar_word(bar_word) if len(bar_word) == 10: return bar_word[2] - 1 elif len(bar_word) == 6: return bar_word[1] - 1 else: raise NotImplementedError def _get_strength_and_tick(beat_wo...
[ "tqdm.tqdm", "numpy.asarray", "numpy.load", "argparse.ArgumentParser" ]
[((2459, 2484), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2482, 2484), False, 'import argparse\n'), ((2790, 2832), 'numpy.load', 'np.load', (['args.music_lib'], {'allow_pickle': '(True)'}), '(args.music_lib, allow_pickle=True)\n', (2797, 2832), True, 'import numpy as np\n'), ((1349, 1370)...
"""Benchmark classes for calibration methods.""" # Standard library imports import os import time import glob import re import h5py # Numerics and plotting import numpy as np import pandas as pd import scipy.special from matplotlib import pyplot as plt from matplotlib.cm import get_cmap from collections import Ordere...
[ "numpy.maximum", "numpy.sum", "matplotlib.cm.get_cmap", "numpy.argmax", "pandas.read_csv", "sklearn.model_selection.cross_validate", "numpy.abs", "pretrainedmodels.utils.LoadImage", "time.strftime", "numpy.isnan", "numpy.shape", "os.path.isfile", "numpy.mean", "matplotlib.pyplot.gca", "t...
[((2226, 2250), 'os.path.abspath', 'os.path.abspath', (['run_dir'], {}), '(run_dir)\n', (2241, 2250), False, 'import os\n'), ((2259, 2299), 'os.makedirs', 'os.makedirs', (['self.run_dir'], {'exist_ok': '(True)'}), '(self.run_dir, exist_ok=True)\n', (2270, 2299), False, 'import os\n'), ((3876, 3890), 'pandas.DataFrame',...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 22 18:59:06 2020 @author: daiwei """ """ This is the seperated Hydrosphere script Runs once every call """ import numpy as np import seafreeze as sf from pynverse import inversefunc as inv from scipy.optimize import root # Ice Ih conductivity (...
[ "numpy.abs", "numpy.sum", "numpy.flip", "numpy.empty", "numpy.zeros", "seafreeze.whichphase", "numpy.mean", "numpy.exp", "numpy.linspace", "seafreeze.seafreeze", "numpy.sqrt" ]
[((846, 871), 'numpy.linspace', 'np.linspace', (['P0', 'P', 'scale'], {}), '(P0, P, scale)\n', (857, 871), True, 'import numpy as np\n'), ((1660, 1675), 'numpy.zeros', 'np.zeros', (['scale'], {}), '(scale)\n', (1668, 1675), True, 'import numpy as np\n'), ((4196, 4226), 'numpy.linspace', 'np.linspace', (['(0)', 'depth']...
import numpy as np from torchvision import transforms from tqdm import tqdm import pickle as pkl import torch import pickle import time import torchvision from torch.utils.data import DataLoader from model import * from layers import AdamGD, SGD from torchvision import datasets, transforms import torch imp...
[ "os.mkdir", "tqdm.tqdm", "numpy.sum", "torch.utils.data.DataLoader", "torch.argmax", "os.path.exists", "torch.cat", "time.time", "numpy.mean", "torchvision.datasets.MNIST", "torch.log", "torchvision.transforms.ToTensor" ]
[((593, 612), 'numpy.sum', 'np.sum', (['(_y == _pred)'], {}), '(_y == _pred)\n', (599, 612), True, 'import numpy as np\n'), ((714, 791), 'torchvision.datasets.MNIST', 'datasets.MNIST', ([], {'root': 'root', 'train': '(True)', 'transform': 'transform', 'download': 'download'}), '(root=root, train=True, transform=transfo...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals from numpy.testing import assert_allclose from ..testing import requires_data from ..modeling import Parameter, SourceLibrary def test_parameter(): data = dict(name='s...
[ "numpy.testing.assert_allclose" ]
[((791, 861), 'numpy.testing.assert_allclose', 'assert_allclose', (["source.spectral_model.parameters['Index'].value", '(2.48)'], {}), "(source.spectral_model.parameters['Index'].value, 2.48)\n", (806, 861), False, 'from numpy.testing import assert_allclose\n'), ((1260, 1350), 'numpy.testing.assert_allclose', 'assert_a...
from bokeh.embed import file_html from bokeh.layouts import row, column from bokeh.models import BoxZoomTool, ColumnDataSource, DatetimeTickFormatter, Div, HoverTool, PanTool, ResetTool, SaveTool from bokeh.plotting import figure from bokeh.resources import CDN from bokeh.transform import factor_cmap import src.amhair...
[ "bokeh.models.BoxZoomTool", "bokeh.models.ColumnDataSource", "pandas.DataFrame", "bokeh.plotting.figure", "bokeh.models.ResetTool", "numpy.quantile", "bokeh.models.Div", "bokeh.models.SaveTool", "bokeh.models.DatetimeTickFormatter", "bokeh.transform.factor_cmap", "bokeh.embed.file_html", "boke...
[((8793, 8938), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': 'self.plot_width', 'plot_height': 'self.plot_height', 'title': 'title_text', 'tools': "['pan', 'box_zoom', 'save', 'reset']", 'x_range': 'cats'}), "(plot_width=self.plot_width, plot_height=self.plot_height, title=\n title_text, tools=['pan', 'box...
import numpy as np import scipy.spatial as ssp from PyQt4 import QtGui, QtCore class Connect(object): """docstring for Export""" def __init__(self): super(Connect, self).__init__() # get MainWindow instance here (overcomes handling parents) self.mainwindow = QtCore.QCoreA...
[ "PyQt4.QtGui.QProgressDialog", "PyQt4.QtCore.QCoreApplication.instance", "numpy.random.random_sample", "numpy.array", "scipy.spatial.cKDTree" ]
[((986, 1004), 'numpy.array', 'np.array', (['vertices'], {}), '(vertices)\n', (994, 1004), True, 'import numpy as np\n'), ((1021, 1035), 'scipy.spatial.cKDTree', 'ssp.cKDTree', (['V'], {}), '(V)\n', (1032, 1035), True, 'import scipy.spatial as ssp\n'), ((1180, 1238), 'PyQt4.QtGui.QProgressDialog', 'QtGui.QProgressDialo...
# pangadfs/tests/test_mutate.py # -*- coding: utf-8 -*- # Copyright (C) 2020 <NAME> # Licensed under the MIT License import numpy as np import pytest from pangadfs.mutate import MutateDefault def test_mutate_default(pop): mpop = MutateDefault().mutate(population=pop) assert pop.shape == mpop.shape asser...
[ "numpy.array_equal", "pangadfs.mutate.MutateDefault" ]
[((326, 351), 'numpy.array_equal', 'np.array_equal', (['pop', 'mpop'], {}), '(pop, mpop)\n', (340, 351), True, 'import numpy as np\n'), ((237, 252), 'pangadfs.mutate.MutateDefault', 'MutateDefault', ([], {}), '()\n', (250, 252), False, 'from pangadfs.mutate import MutateDefault\n')]
from evaluation.metric.Metric import Metric from evaluation.metric.MetricResult import MetricResult import numpy as np EPSILON = 1e-7 # Use same epsilon as Keras backend default class BinaryCrossEntropy(Metric): def compute(self, first: np.ndarray, second: np.ndarray) -> MetricResult: firstFlattened = f...
[ "evaluation.metric.MetricResult.MetricResult", "numpy.sum", "numpy.log", "numpy.clip" ]
[((435, 481), 'numpy.clip', 'np.clip', (['secondFlattened', 'EPSILON', '(1 - EPSILON)'], {}), '(secondFlattened, EPSILON, 1 - EPSILON)\n', (442, 481), True, 'import numpy as np\n'), ((619, 653), 'numpy.sum', 'np.sum', (['binaryCrossentropy'], {'axis': '(1)'}), '(binaryCrossentropy, axis=1)\n', (625, 653), True, 'import...
import numpy as np import cv2 as cv class TreeNode: def __init__(self, name, height=0): self.name = name self.height = height self.left = None self.right = None def length(self): ret = 0 if self.left is not None: ret = max(ret, self.le...
[ "cv2.line", "cv2.putText", "numpy.copy", "cv2.waitKey", "cv2.imshow", "numpy.ones", "numpy.argmin", "numpy.array", "cv2.destroyAllWindows", "numpy.delete" ]
[((6763, 6998), 'numpy.array', 'np.array', (['[[np.inf, 6.0, 8.0, 1.0, 2.0, 6.0], [6.0, np.inf, 8.0, 6.0, 6.0, 4.0], [8.0,\n 8.0, np.inf, 8.0, 8.0, 8.0], [1.0, 6.0, 8.0, np.inf, 2.0, 6.0], [2.0, \n 6.0, 8.0, 2.0, np.inf, 6.0], [6.0, 4.0, 8.0, 6.0, 6.0, np.inf]]'], {}), '([[np.inf, 6.0, 8.0, 1.0, 2.0, 6.0], [6.0, ...
from Peeves.TestUtils import * from unittest import TestCase from McUtils.Data import UnitsData, PotentialData from McUtils.Zachary import Interpolator import McUtils.Plots as plt from Psience.DVR import * from Psience.Molecools import Molecule import numpy as np class DVRTests(TestCase): #region setup def...
[ "numpy.abs", "McUtils.Zachary.Interpolator", "numpy.power", "numpy.allclose", "numpy.argmin", "McUtils.Data.UnitsData.convert", "numpy.sin", "numpy.min", "numpy.max", "numpy.cos", "numpy.arange", "numpy.diag", "McUtils.Plots.GraphicsGrid" ]
[((11949, 11981), 'McUtils.Zachary.Interpolator', 'Interpolator', (['a_vals', 'g[:, 2, 2]'], {}), '(a_vals, g[:, 2, 2])\n', (11961, 11981), False, 'from McUtils.Zachary import Interpolator\n'), ((12142, 12176), 'numpy.argmin', 'np.argmin', (['pot.base.interp_data[1]'], {}), '(pot.base.interp_data[1])\n', (12151, 12176)...
import os import numpy as np import cv2 import argparse import shutil import pandas as pd import logging from sklearn.model_selection import train_test_split class WashingtonRGBD(object): """ Data Wrapper class for WashingtonRGBD dataset Attributes ----------- root_dir: root directory until the r...
[ "numpy.random.seed", "argparse.ArgumentParser", "pandas.read_csv", "sklearn.model_selection.train_test_split", "os.walk", "os.path.isfile", "numpy.random.randint", "os.path.join", "numpy.unique", "pandas.DataFrame", "numpy.max", "cv2.resize", "pandas.Series", "numpy.concatenate", "os.mak...
[((21350, 21389), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (21369, 21389), False, 'import logging\n'), ((21404, 21429), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (21427, 21429), False, 'import argparse\n'), ((754, 781), 'loggi...
from scipy import signal import numpy as np import os try: from scipy.signal import sosfilt from scipy.signal import zpk2sos except ImportError: from ._sosfilt import _sosfilt as sosfilt from ._sosfilt import _zpk2sos as zpk2sos from matplotlib import mlab from matplotlib.colors import Normalize import...
[ "scipy.signal.zpk2sos", "matplotlib.mlab.specgram", "matplotlib.colors.Normalize", "scipy.signal.sosfilt", "numpy.log2", "os.walk", "numpy.flipud", "scipy.signal.iirfilter", "matplotlib.pyplot.figure", "numpy.arange", "numpy.log10", "numpy.concatenate", "numpy.sqrt" ]
[((985, 1072), 'scipy.signal.iirfilter', 'signal.iirfilter', (['corners', '[low, high]'], {'btype': '"""band"""', 'ftype': '"""butter"""', 'output': '"""zpk"""'}), "(corners, [low, high], btype='band', ftype='butter', output\n ='zpk')\n", (1001, 1072), False, 'from scipy import signal\n'), ((1073, 1089), 'scipy.sign...
from scipy import stats #from sklearn_wrapper import ClfWrapper import numpy as np from parse import yamlobj @yamlobj("!PercentileRankOneFeature") class PercentileRankOneFeature: def __init__(self, feature, descend=False): self.feature = feature # which feature to rank on self.descend = ( ...
[ "numpy.stack", "parse.yamlobj", "numpy.array", "scipy.stats.rankdata" ]
[((113, 149), 'parse.yamlobj', 'yamlobj', (['"""!PercentileRankOneFeature"""'], {}), "('!PercentileRankOneFeature')\n", (120, 149), False, 'from parse import yamlobj\n'), ((806, 835), 'numpy.array', 'np.array', (['feature_importances'], {}), '(feature_importances)\n', (814, 835), True, 'import numpy as np\n'), ((3564, ...
""" Created on Wed Apr 24 10:23:22 2019 In this example it is used the prediction error method to estimate a general MISO black box transfer function system given as: A(q)y(t) = (B(q)/F(q))u(t) + (C(q)/D(q))e(t) @author: edumapurunga """ #%% Example 1: Everythning is unknown #Import Libraries from numpy import ar...
[ "numpy.diag", "pysid.pem", "numpy.absolute", "numpy.random.randn", "scipy.signal.lfilter", "numpy.zeros", "numpy.mean", "numpy.linalg.norm", "numpy.random.random", "numpy.convolve", "numpy.cov", "numpy.concatenate", "numpy.sqrt" ]
[((1536, 1555), 'numpy.convolve', 'convolve', (['Ao', 'Fo[0]'], {}), '(Ao, Fo[0])\n', (1544, 1555), False, 'from numpy import array, absolute, convolve, concatenate, cov, diag, sqrt, zeros, mean\n'), ((1563, 1582), 'numpy.convolve', 'convolve', (['Ao', 'Fo[1]'], {}), '(Ao, Fo[1])\n', (1571, 1582), False, 'from numpy im...
from random import randint import numpy as np import time from .worker import Worker class Selector: """Selector class manages all selection operations for the viewer. Parameters ---------- app: :class:`compas_view2.app.App` The parent application. Attributes ---------- app: :cla...
[ "numpy.array", "numpy.zeros", "random.randint", "time.sleep" ]
[((2115, 2137), 'numpy.zeros', 'np.zeros', (['(4,)', 'np.int'], {}), '((4,), np.int)\n', (2123, 2137), True, 'import numpy as np\n'), ((2474, 2496), 'numpy.zeros', 'np.zeros', (['(4,)', 'np.int'], {}), '((4,), np.int)\n', (2482, 2496), True, 'import numpy as np\n'), ((5188, 5205), 'numpy.array', 'np.array', (['rgb_key'...
import warnings from datetime import time, datetime import numpy as np import SimpleITK as sitk import pydicom as pdcm from pydicom.tag import Tag def convert_dicom_to_nifty_pt( input_filepaths, output_filepath, modality="PT", sitk_writer=None, patient_weight_from_...
[ "numpy.stack", "numpy.asarray", "numpy.transpose", "datetime.datetime", "datetime.datetime.strptime", "pydicom.tag.Tag", "numpy.where", "warnings.warn", "numpy.concatenate" ]
[((4176, 4231), 'numpy.asarray', 'np.asarray', (['[k.ImagePositionPatient[2] for k in slices]'], {}), '([k.ImagePositionPatient[2] for k in slices])\n', (4186, 4231), True, 'import numpy as np\n'), ((4802, 4887), 'numpy.asarray', 'np.asarray', (['[slices[0].PixelSpacing[0], slices[0].PixelSpacing[1], slice_spacing]'], ...
import gym import numpy as np from gym import wrappers env = gym.make('CartPole-v0') best_length = 0 episode_lengths = [] best_weights = np.zeros(4) for i in range(100): new_weights = np.random.uniform(-1.0, 1.0, 4) length = [] for j in range(100): observation = env.reset() done = False...
[ "numpy.dot", "numpy.random.uniform", "numpy.zeros", "gym.make" ]
[((62, 85), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (70, 85), False, 'import gym\n'), ((140, 151), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (148, 151), True, 'import numpy as np\n'), ((192, 223), 'numpy.random.uniform', 'np.random.uniform', (['(-1.0)', '(1.0)', '(4)'], {}), '...
# coding:utf-8 import os import gc import numpy as np import pandas as pd from scipy.special import expit from lightgbm import LGBMClassifier from sklearn.metrics import roc_auc_score from bayes_opt import BayesianOptimization from category_encoders import TargetEncoder from sklearn.compose import ColumnTransformer fr...
[ "numpy.random.seed", "os.path.join", "bayes_opt.BayesianOptimization", "numpy.zeros", "gc.collect", "sklearn.model_selection.StratifiedKFold", "category_encoders.TargetEncoder", "numpy.round", "pandas.set_option", "sklearn.preprocessing.OrdinalEncoder" ]
[((419, 436), 'numpy.random.seed', 'np.random.seed', (['(7)'], {}), '(7)\n', (433, 436), True, 'import numpy as np\n'), ((437, 467), 'pandas.set_option', 'pd.set_option', (['"""max_row"""', 'None'], {}), "('max_row', None)\n", (450, 467), True, 'import pandas as pd\n'), ((468, 502), 'pandas.set_option', 'pd.set_option'...
""" Copyright 2017-2018 Fizyr (https://fizyr.com) 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 w...
[ "tensorflow.unstack", "tensorflow.clip_by_value", "tensorflow.keras.backend.floatx", "tensorflow.keras.backend.shape", "tensorflow.transpose", "tensorflow.keras.backend.stack", "tensorflow.keras.backend.expand_dims", "numpy.array", "tensorflow.keras.backend.image_data_format", "numpy.prod" ]
[((1724, 1751), 'tensorflow.keras.backend.shape', 'keras.backend.shape', (['inputs'], {}), '(inputs)\n', (1743, 1751), False, 'from tensorflow import keras\n'), ((3090, 3117), 'tensorflow.keras.backend.shape', 'keras.backend.shape', (['target'], {}), '(target)\n', (3109, 3117), False, 'from tensorflow import keras\n'),...
# AUTOGENERATED! DO NOT EDIT! File to edit: 07_permutations.ipynb (unless otherwise specified). __all__ = ['PermuteOddsRatio'] # Cell import pandas as pd import numpy as np from typing import Any, Dict, List, Optional, Literal, Union from .odds_ratio import reconstruct_genetic_info, odds_ratio_df_single_combined, Cas...
[ "copy.deepcopy", "numpy.append", "numpy.where", "numpy.random.permutation", "fastcore.basics.store_attr" ]
[((820, 832), 'fastcore.basics.store_attr', 'store_attr', ([], {}), '()\n', (830, 832), False, 'from fastcore.basics import basic_repr, store_attr\n'), ((992, 1028), 'copy.deepcopy', 'deepcopy', (['self.geno_each_sample_dict'], {}), '(self.geno_each_sample_dict)\n', (1000, 1028), False, 'from copy import deepcopy\n'), ...
import sys sys.path.append('/Users/kb/bin/opencv-3.1.0/build/lib/') import cv2 import numpy as np def cross_correlation_2d(img, kernel): '''Given a kernel of arbitrary m x n dimensions, with both m and n being odd, compute the cross correlation of the given image with the given kernel, such that the outpu...
[ "sys.path.append", "numpy.amin", "cv2.waitKey", "numpy.zeros", "numpy.hstack", "numpy.amax", "cv2.imread", "numpy.fliplr", "numpy.array", "cv2.imshow", "numpy.vstack" ]
[((11, 67), 'sys.path.append', 'sys.path.append', (['"""/Users/kb/bin/opencv-3.1.0/build/lib/"""'], {}), "('/Users/kb/bin/opencv-3.1.0/build/lib/')\n", (26, 67), False, 'import sys\n'), ((6529, 6567), 'cv2.imread', 'cv2.imread', (['"""D:/2017/Project1/cat.jpg"""'], {}), "('D:/2017/Project1/cat.jpg')\n", (6539, 6567), F...
from CHECLabPy.plotting.setup import Plotter from CHECLabPy.core.io import HDF5Reader from sstcam_sandbox import get_data, get_plot from sstcam_sandbox.d190918_alpha import * import numpy as np import pandas as pd from matplotlib.colors import LogNorm from numpy.polynomial.polynomial import polyfit from os.path import ...
[ "CHECLabPy.core.io.HDF5Reader", "numpy.log", "sstcam_sandbox.get_plot", "sstcam_sandbox.get_data", "numpy.histogram", "matplotlib.colors.LogNorm", "os.path.join" ]
[((903, 954), 'numpy.histogram', 'np.histogram', (['values_gamma'], {'bins': 'bins', 'density': '(True)'}), '(values_gamma, bins=bins, density=True)\n', (915, 954), True, 'import numpy as np\n'), ((976, 1029), 'numpy.histogram', 'np.histogram', (['values_proton'], {'bins': 'edges', 'density': '(True)'}), '(values_proto...
# encoding=utf8 import numpy as np import tensorflow as tf import sys sys.path.append('../') from tensorflow.contrib.crf import crf_log_likelihood from tensorflow.contrib.crf import viterbi_decode from tensorflow.contrib.layers.python.layers import initializers import layers.rnncell as rnn from utils.utils import resu...
[ "bert.modeling.get_assignment_map_from_checkpoint", "tensorflow.reduce_sum", "tensorflow.trainable_variables", "tensorflow.reshape", "numpy.ones", "tensorflow.global_variables", "tensorflow.Variable", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.contrib.layers.python.layers.initializers.xa...
[((70, 92), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (85, 92), False, 'import sys\n'), ((697, 728), 'tensorflow.Variable', 'tf.Variable', (['(0)'], {'trainable': '(False)'}), '(0, trainable=False)\n', (708, 728), True, 'import tensorflow as tf\n'), ((756, 789), 'tensorflow.Variable', 'tf....
# import the necessary packages import numpy as np import cv2 import countDots import masks import sledenje_pshero as ss import allMasksMatrix as aMM import astar import math import sphero import agolMegu3Tocki from math import degrees import time import imutils import tsp2 import pygame.camera from skimage.measure imp...
[ "math.atan2", "numpy.ones", "cv2.imshow", "agolMegu3Tocki.findAngle", "cv2.dilate", "cv2.cvtColor", "matplotlib.pyplot.imshow", "imutils.rotate_bound", "allMasksMatrix.finalMatrix", "matplotlib.pyplot.show", "math.sqrt", "sphero.Sphero", "cv2.waitKey", "cv2.morphologyEx", "time.sleep", ...
[((404, 438), 'sphero.Sphero', 'sphero.Sphero', (['"""68:86:E7:07:1F:F8"""'], {}), "('68:86:E7:07:1F:F8')\n", (417, 438), False, 'import sphero\n'), ((495, 508), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (505, 508), False, 'import time\n'), ((867, 880), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (877...
"""Module containing velocity fields to test the preliminary model """ from __future__ import division import numpy as np import pylab as plb import matplotlib.pyplot as plt from math import pi def zero(nz, nx, ny): """ Produce a matrix of zeros on the input grid :arg nx: number of points in x dimension :arg nz: n...
[ "numpy.meshgrid", "numpy.zeros", "numpy.max", "numpy.sin", "numpy.exp", "numpy.linspace", "numpy.sqrt" ]
[((395, 420), 'numpy.zeros', 'np.zeros', (['[3, nz, ny, nx]'], {}), '([3, nz, ny, nx])\n', (403, 420), True, 'import numpy as np\n'), ((1002, 1032), 'numpy.linspace', 'np.linspace', (['(-a / 2)', '(a / 2)', 'nx'], {}), '(-a / 2, a / 2, nx)\n', (1013, 1032), True, 'import numpy as np\n'), ((1041, 1071), 'numpy.linspace'...
import numpy as np import copy import os import json from .tree_selector import TreeSelector # For `OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.` os.environ["KMP_DUPLICATE_LIB_OK"] = "True" def hard_sigmoid(x): y = 0.2 * x + 0.5 return np.clip(y, 0.0, 1.0) def...
[ "numpy.maximum", "numpy.argmax", "numpy.polyfit", "numpy.clip", "numpy.argsort", "numpy.mean", "numpy.linalg.norm", "os.path.join", "numpy.std", "numpy.max", "numpy.random.choice", "json.dump", "copy.deepcopy", "numpy.minimum", "numpy.square", "numpy.concatenate", "numpy.zeros", "n...
[((294, 314), 'numpy.clip', 'np.clip', (['y', '(0.0)', '(1.0)'], {}), '(y, 0.0, 1.0)\n', (301, 314), True, 'import numpy as np\n'), ((1388, 1424), 'numpy.zeros', 'np.zeros', (['self.dim'], {'dtype': 'np.float32'}), '(self.dim, dtype=np.float32)\n', (1396, 1424), True, 'import numpy as np\n'), ((1442, 1478), 'numpy.zero...
import numpy as np def add_halo(data, halo=1, halo_value=None): """Add a halo of no data value to data. Parameters ---------- data : array-like Array to add the halo to. halo : int, optional The size of the halo. halo_value : float, optional Value to fill the halo with...
[ "numpy.empty" ]
[((812, 880), 'numpy.empty', 'np.empty', (['[(dim + 2 * halo) for dim in data.shape]'], {'dtype': 'data.dtype'}), '([(dim + 2 * halo) for dim in data.shape], dtype=data.dtype)\n', (820, 880), True, 'import numpy as np\n')]
import argparse import datetime from genericpath import exists import gym import numpy as np import itertools import torch import os from sac import SAC from torch.utils.tensorboard import SummaryWriter from replay_memory import ReplayMemory from tqdm import tqdm from hsh import HashTable parser = argparse.ArgumentPar...
[ "hsh.HashTable", "replay_memory.ReplayMemory", "numpy.random.seed", "os.makedirs", "argparse.ArgumentParser", "gym.make", "os.getcwd", "torch.manual_seed", "os.path.exists", "numpy.mean", "sac.SAC", "numpy.round", "os.path.join" ]
[((300, 369), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Soft Actor-Critic Args"""'}), "(description='PyTorch Soft Actor-Critic Args')\n", (323, 369), False, 'import argparse\n'), ((4854, 4878), 'os.path.exists', 'os.path.exists', (['save_dir'], {}), '(save_dir)\n', (4868, 48...
# coding: utf-8 # Copyright 2019 Sinovation Ventures AI Institute # # 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 app...
[ "numpy.random.seed", "argparse.ArgumentParser", "apex.optimizers.FusedLAMB", "torch.utils.data.RandomSampler", "torch.cuda.device_count", "ZEN2.ZenNgramDict", "torch.device", "os.path.join", "torch.ones", "ZEN2.ZenForPreTraining.from_pretrained", "ZEN2.PolyWarmUpScheduler", "torch.utils.data.D...
[((4240, 4295), 'logging.info', 'logging.info', (['"""** ** * Saving pre-train model ** ** * """'], {}), "('** ** * Saving pre-train model ** ** * ')\n", (4252, 4295), False, 'import logging\n'), ((4424, 4463), 'os.path.join', 'os.path.join', (['saving_path', 'WEIGHTS_NAME'], {}), '(saving_path, WEIGHTS_NAME)\n', (4436...
# Script designed to visulize the working time distribution from your time logger. # Copyright © 2020 <NAME> # Licensed under MIT License import sys import pandas as pd import numpy as np from matplotlib import pyplot as plt f_name = sys.argv[1] precision = str(sys.argv[2]) df = pd.read_csv(f_name) # create timestam...
[ "matplotlib.pyplot.xlim", "pandas.DatetimeIndex.to_frame", "pandas.date_range", "pandas.read_csv", "matplotlib.pyplot.bar", "matplotlib.pyplot.yticks", "pandas.merge", "matplotlib.pyplot.figure", "numpy.arange", "pandas.to_datetime", "pandas.Grouper", "matplotlib.pyplot.gca", "matplotlib.pyp...
[((282, 301), 'pandas.read_csv', 'pd.read_csv', (['f_name'], {}), '(f_name)\n', (293, 301), True, 'import pandas as pd\n'), ((493, 524), 'pandas.concat', 'pd.concat', (['[start, end]'], {'axis': '(1)'}), '([start, end], axis=1)\n', (502, 524), True, 'import pandas as pd\n'), ((593, 640), 'pandas.date_range', 'pd.date_r...
# -*- coding: utf-8 -*- """ Created on Wed May 11 13:31:47 2016 cgw_raster_utils.py Collection of functions to aid Modflow grid creation and manipulation from spatial datasets @author: kbefus """ from __future__ import print_function import os,sys import netCDF4 from osgeo import gdal, osr, gdalnumeric...
[ "astropy.convolution.Gaussian2DKernel", "astropy.convolution.convolve", "PIL.Image.new", "numpy.arctan2", "scipy.stats.binned_statistic_2d", "numpy.abs", "numpy.argmax", "osgeo.gdal.ErrorReset", "scipy.ndimage.measurements.label", "numpy.floor", "scipy.ndimage.filters.minimum_filter", "numpy.i...
[((1861, 1902), 'osgeo.gdal.PushErrorHandler', 'gdal.PushErrorHandler', (['gdal_error_handler'], {}), '(gdal_error_handler)\n', (1882, 1902), False, 'from osgeo import gdal, osr, gdalnumeric, ogr\n'), ((1926, 1948), 'osgeo.osr.SpatialReference', 'osr.SpatialReference', ([], {}), '()\n', (1946, 1948), False, 'from osgeo...
""" @brief test log(time=2s) """ import unittest from logging import getLogger import numpy from scipy.spatial.distance import squareform, pdist, cdist as scipy_cdist from pyquickhelper.pycode import ExtTestCase from sklearn.datasets import load_iris from skl2onnx.algebra.onnx_ops import ( # pylint: disable=E0611...
[ "unittest.main", "scipy.spatial.distance.cdist", "sklearn.datasets.load_iris", "mlprodict.tools.get_opset_number_from_onnx", "skl2onnx.common.data_types.FloatTensorType", "numpy.array", "mlprodict.onnxrt.OnnxInference", "scipy.spatial.distance.pdist", "logging.getLogger" ]
[((5495, 5510), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5508, 5510), False, 'import unittest\n'), ((650, 671), 'logging.getLogger', 'getLogger', (['"""skl2onnx"""'], {}), "('skl2onnx')\n", (659, 671), False, 'from logging import getLogger\n'), ((1452, 1476), 'mlprodict.onnxrt.OnnxInference', 'OnnxInference...
""" Unit tests for skymodel """ import logging import unittest import astropy.units as u import numpy from astropy.coordinates import SkyCoord from data_models.memory_data_models import SkyModel from data_models.polarisation import PolarisationFrame from processing_components.skycomponent.operations import create_...
[ "processing_components.simulation.testing_support.create_named_configuration", "numpy.abs", "processing_components.simulation.testing_support.create_test_image", "data_models.polarisation.PolarisationFrame", "data_models.parameters.arl_path", "numpy.array", "numpy.linspace", "data_models.memory_data_m...
[((588, 615), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (605, 615), False, 'import logging\n'), ((753, 801), 'processing_components.simulation.testing_support.create_named_configuration', 'create_named_configuration', (['"""LOWBD2"""'], {'rmax': '(300.0)'}), "('LOWBD2', rmax=300.0)\n...
import os, sys, time import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib.colorbar import Colorbar import matplotlib.colors as mcolors from matplotlib.patches import Ellipse from astropy.visualization import (LinearStretch, AsinhStretch, ImageNormalize) from razmap i...
[ "sys.path.append", "numpy.radians", "matplotlib.colorbar.Colorbar", "razmap.razmap", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "numpy.sin", "matplotlib.pyplot.rc", "numpy.linspace", "numpy.cos", "astropy.visualization.LinearStretch", "numpy.diff", "matplotlib.gridspec.GridSp...
[((333, 355), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (348, 355), False, 'import os, sys, time\n'), ((495, 519), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""classic"""'], {}), "('classic')\n", (508, 519), True, 'import matplotlib.pyplot as plt\n'), ((520, 542), 'matplotlib.pypl...
import pdb from diff_mpc import mpc from diff_mpc.mpc import QuadCost, LinDx import numpy as np import pandas as pd import torch import torch.optim as optim from torch.distributions import MultivariateNormal, Normal class PPOLearner: def __init__(self, memory, T, n_ctrl, n_state, target, disturbance, eta, u_upp...
[ "torch.mean", "torch.ones", "torch.ones_like", "torch.eye", "torch.stack", "numpy.random.rand", "torch.cat", "torch.diag", "torch.mm", "torch.clamp", "numpy.array", "torch.distributions.MultivariateNormal", "pandas.Timedelta", "torch.zeros", "torch.optim.RMSprop", "torch.min", "torch...
[((1547, 1599), 'torch.optim.RMSprop', 'optim.RMSprop', (['[self.F_hat, self.Bd_hat]'], {'lr': 'self.lr'}), '([self.F_hat, self.Bd_hat], lr=self.lr)\n', (1560, 1599), True, 'import torch.optim as optim\n'), ((5901, 5948), 'torch.zeros', 'torch.zeros', (['self.T', '(self.n_state + self.n_ctrl)'], {}), '(self.T, self.n_s...
import pandas as pd import re import numpy as np import os import sys from collections import OrderedDict # parent_path = os.path.realpath(os.pardir) # if sys.platform.startswith('win') or sys.platform.startswith('cygwin'): # seseds_path = os.path.join(parent_path, 'MCM-ICM-2018-Problem-C\\data\\csv\\seseds.csv'...
[ "pandas.DataFrame", "pandas.read_csv", "numpy.std", "numpy.zeros", "numpy.mean", "collections.OrderedDict" ]
[((713, 866), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\Users\\\\THINKPAD\\\\PycharmProjects\\\\MCM-ICM-2018-Problem-C\\\\code\\\\PCR\\\\nm_data.csv"""'], {'skiprows': 'None', 'engine': '"""c"""', 'low_memory': '(True)'}), "(\n 'C:\\\\Users\\\\THINKPAD\\\\PycharmProjects\\\\MCM-ICM-2018-Problem-C\\\\code\\\\PCR\...
import time import torch import numpy as np from torch.nn import * import matplotlib.pyplot as plt from torch.autograd import Variable from torchvision import datasets, transforms from torch.utils.tensorboard import SummaryWriter from deep_beamline_simulation.neuralnet import Neural_Net writer = SummaryWriter() model ...
[ "matplotlib.pyplot.title", "torch.nn.MSELoss", "matplotlib.pyplot.show", "deep_beamline_simulation.neuralnet.Neural_Net", "matplotlib.pyplot.plot", "torch.autograd.Variable", "matplotlib.pyplot.legend", "time.time", "matplotlib.pyplot.text", "matplotlib.pyplot.cla", "numpy.array", "torch.utils...
[((298, 313), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', ([], {}), '()\n', (311, 313), False, 'from torch.utils.tensorboard import SummaryWriter\n'), ((322, 339), 'deep_beamline_simulation.neuralnet.Neural_Net', 'Neural_Net', (['(3)', '(70)'], {}), '(3, 70)\n', (332, 339), False, 'from deep_beamline_simu...
from gym import Env from gym.spaces import Discrete, Box import numpy as np import matplotlib.pyplot as plt import mplfinance as mpf from atgym.atutils import generate_indicator plt.style.use('seaborn-dark') plt.rcParams["figure.figsize"] = (8, 6) class TradingEnv(Env): """ Reinforcement learning trading e...
[ "gym.spaces.Discrete", "numpy.isnan", "atgym.atutils.generate_indicator", "matplotlib.pyplot.style.use", "mplfinance.make_addplot", "numpy.array", "gym.spaces.Box", "numpy.random.choice", "mplfinance.plot", "mplfinance.make_mpf_style" ]
[((181, 210), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-dark"""'], {}), "('seaborn-dark')\n", (194, 210), True, 'import matplotlib.pyplot as plt\n'), ((1565, 1576), 'gym.spaces.Discrete', 'Discrete', (['(3)'], {}), '(3)\n', (1573, 1576), False, 'from gym.spaces import Discrete, Box\n'), ((1832, 1855...
from astropy.cosmology import Planck13 as cosmo import numpy as np import scipy import george import extinction # Putting in Miles code from scipy.stats import wasserstein_distance from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import RBF, ConstantKernel, PairwiseKe...
[ "numpy.abs", "numpy.argmin", "numpy.isnan", "numpy.argsort", "numpy.exp", "numpy.linspace", "numpy.log10", "sklearn.gaussian_process.GaussianProcessRegressor", "numpy.var", "sklearn.gaussian_process.kernels.PairwiseKernel", "numpy.dstack", "numpy.stack", "numpy.average", "extinction.fm07",...
[((1075, 1102), 'numpy.average', 'np.average', (['distance_matrix'], {}), '(distance_matrix)\n', (1085, 1102), True, 'import numpy as np\n'), ((608, 643), 'numpy.linspace', 'np.linspace', (['(3000)', '(11000)'], {'num': '(10000)'}), '(3000, 11000, num=10000)\n', (619, 643), True, 'import numpy as np\n'), ((791, 931), '...
from unittest import TestCase import numpy as np from phi.app import App, EditableFloat, EditableBool, EditableString, EditableInt class TestApp(TestCase): def test_app(self): app = App('test') app.add_field("Random Scalar", np.random.rand(1, 16, 16, 1)) app.add_field("Random Vector", n...
[ "phi.app.EditableString", "phi.app.EditableBool", "phi.app.App", "phi.app.EditableInt", "phi.app.EditableFloat", "numpy.random.rand" ]
[((199, 210), 'phi.app.App', 'App', (['"""test"""'], {}), "('test')\n", (202, 210), False, 'from phi.app import App, EditableFloat, EditableBool, EditableString, EditableInt\n'), ((604, 638), 'phi.app.EditableFloat', 'EditableFloat', (['"""Temperature"""', '(40.2)'], {}), "('Temperature', 40.2)\n", (617, 638), False, '...
import numpy as np import pandas as pd def predicate_degree( D, edge_labels=np.empty(0), stats=dict(), print_stats=False ): """""" if edge_labels is None or edge_labels.size == 0: edge_labels = [ D.ep.c0[p] for p in D.get_edges() ] # number of triples of graph G, in which p occurs as predicate ...
[ "numpy.empty", "numpy.unique", "numpy.max", "numpy.mean", "numpy.nanmax", "numpy.nanmean" ]
[((77, 88), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (85, 88), True, 'import numpy as np\n'), ((329, 371), 'numpy.unique', 'np.unique', (['edge_labels'], {'return_counts': '(True)'}), '(edge_labels, return_counts=True)\n', (338, 371), True, 'import numpy as np\n'), ((640, 651), 'numpy.empty', 'np.empty', (['(...
import matplotlib.pyplot as plt import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint from matplotlib.animation import FuncAnimation """ Get trajectory of n-body system attracted by gravitational force in 3D (x,y,z) through solving system of 2n 2nd-order ODEs. """ cl...
[ "matplotlib.pyplot.show", "scipy.integrate.odeint", "matplotlib.animation.FuncAnimation", "numpy.hstack", "matplotlib.pyplot.figure", "numpy.arange", "numpy.exp", "numpy.array", "numpy.sqrt" ]
[((3738, 3764), 'numpy.arange', 'np.arange', (['(0)', 'last_t', 'step'], {}), '(0, last_t, step)\n', (3747, 3764), True, 'import numpy as np\n'), ((4021, 4092), 'scipy.integrate.odeint', 'odeint', (['motion_nbody', 'init', 'time'], {'args': '(masses, G, I, dimensions, True)'}), '(motion_nbody, init, time, args=(masses,...
import os.path as op import pandas as pd import numpy as np import cooler import bioframe import click from . import cli from ..lib.common import assign_regions from .. import dotfinder from . import util @cli.command() @click.argument( "cool_path", metavar="COOL_PATH", type=str, nargs=1, ) @click.ar...
[ "click.argument", "os.path.basename", "pandas.read_csv", "numpy.logspace", "os.path.dirname", "click.option", "cooler.Cooler", "click.Path", "pandas.read_table", "bioframe.parse_regions" ]
[((224, 291), 'click.argument', 'click.argument', (['"""cool_path"""'], {'metavar': '"""COOL_PATH"""', 'type': 'str', 'nargs': '(1)'}), "('cool_path', metavar='COOL_PATH', type=str, nargs=1)\n", (238, 291), False, 'import click\n'), ((914, 1054), 'click.option', 'click.option', (['"""--expected-name"""'], {'help': '"""...
import re import os # import git import numpy as np from autils.constants import BINARIES_PATH, LayerType def convert_adj_to_edge_index(adjacency_matrix): """ Handles both adjacency matrices as well as connectivity masks used in softmax (check out Imp2 of the GAT model) Connectivity masks are equivale...
[ "re.fullmatch", "numpy.asarray", "numpy.isinf", "os.listdir", "re.compile" ]
[((2859, 2899), 're.compile', 're.compile', (['f"""{prefix}_[0-9]{{6}}\\\\.pth"""'], {}), "(f'{prefix}_[0-9]{{6}}\\\\.pth')\n", (2869, 2899), False, 'import re\n'), ((1310, 1332), 'numpy.asarray', 'np.asarray', (['edge_index'], {}), '(edge_index)\n', (1320, 1332), True, 'import numpy as np\n'), ((2915, 2949), 're.fullm...
# -*- coding: utf-8 -*- """ Test programmatically setting log transformation modes. """ import initExample ## Add path to library (just for examples; you do not need this) import numpy as np from pyqtgraph.Qt import QtGui, QtCore import pyqtgraph as pg app = QtGui.QApplication([]) w = pg.GraphicsLayout...
[ "pyqtgraph.Qt.QtGui.QApplication.instance", "pyqtgraph.Qt.QtGui.QApplication", "numpy.linspace", "numpy.random.normal", "pyqtgraph.GraphicsLayoutWidget" ]
[((273, 295), 'pyqtgraph.Qt.QtGui.QApplication', 'QtGui.QApplication', (['[]'], {}), '([])\n', (291, 295), False, 'from pyqtgraph.Qt import QtGui, QtCore\n'), ((303, 337), 'pyqtgraph.GraphicsLayoutWidget', 'pg.GraphicsLayoutWidget', ([], {'show': '(True)'}), '(show=True)\n', (326, 337), True, 'import pyqtgraph as pg\n'...
# This file will contain the object used for running simple CG MC simulations # Will require : # 1) ScoreFucntion object # 2) Pose # 3) Set of Movers (SequenceMover object) # 4) kT # 5) n_steps # 6) output_freq? import numpy as np import copy from abc import ABC, abstractmethod import os import sys import warnings impo...
[ "os.path.abspath", "copy.deepcopy", "pyrosetta.ScoreFunction", "os.remove", "pyrosetta.rosetta.protocols.canonical_sampling.PDBTrajectoryRecorder", "numpy.abs", "numpy.log", "pyrosetta.SequenceMover", "pyrosetta.MonteCarlo", "pyrosetta.TrialMover", "os.path.isfile", "warnings.warn", "pyroset...
[((379, 404), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (394, 404), False, 'import os\n'), ((425, 482), 'os.path.abspath', 'os.path.abspath', (["(current_path + '/../PyRosetta4.modified')"], {}), "(current_path + '/../PyRosetta4.modified')\n", (440, 482), False, 'import os\n'), ((1178, 1...
import os import unittest import numpy as np from baseclasses import BaseRegTest from pygeo import DVGeometry, DVConstraints from stl import mesh from parameterized import parameterized_class try: import geograd # noqa missing_geograd = False except ImportError: missing_geograd = True def evalFunctions...
[ "unittest.main", "unittest.skipIf", "os.path.abspath", "baseclasses.BaseRegTest", "numpy.random.seed", "os.path.join", "pygeo.DVGeometry", "numpy.sum", "numpy.zeros", "stl.mesh.Mesh.from_file", "numpy.ones", "numpy.array", "numpy.linspace", "parameterized.parameterized_class", "pygeo.DVC...
[((3145, 3242), 'parameterized.parameterized_class', 'parameterized_class', (["[{'name': 'standard', 'child': False}, {'name': 'child', 'child': True}]"], {}), "([{'name': 'standard', 'child': False}, {'name': 'child',\n 'child': True}])\n", (3164, 3242), False, 'from parameterized import parameterized_class\n'), ((...
""" Python re-implementation of "Discriminative Correlation Filter with Channel and Spatial Reliability" @inproceedings{Lukezic2017Discriminative, title={Discriminative Correlation Filter with Channel and Spatial Reliability}, author={<NAME> and <NAME> and <NAME>}, booktitle={IEEE Conference on Computer Vision & ...
[ "numpy.sum", "cftracker.scale_estimator.LPScaleEstimator", "numpy.argmax", "numpy.floor", "numpy.ones", "numpy.clip", "numpy.isnan", "numpy.arange", "numpy.exp", "numpy.round", "numpy.zeros_like", "lib.fft_tools.fft2", "numpy.meshgrid", "cv2.filter2D", "cv2.dilate", "cv2.cvtColor", "...
[((751, 767), 'numpy.zeros_like', 'np.zeros_like', (['x'], {}), '(x)\n', (764, 767), True, 'import numpy as np\n'), ((776, 792), 'numpy.where', 'np.where', (['(x <= 1)'], {}), '(x <= 1)\n', (784, 792), True, 'import numpy as np\n'), ((1651, 1682), 'numpy.ones', 'np.ones', (['(h, w)'], {'dtype': 'np.uint8'}), '((h, w), ...
""" Plots for the data reducer to examine to check that everything is as expected. Each is accessed by a three-letter code that corresponds to the flags the manager puts in fits files. Note that the 2dfdr reduction steps (other than combined calibration files) are not covered here, but are done by loading the 2dfdr GU...
[ "numpy.ravel", "matplotlib.pyplot.figure", "numpy.arange", "glob.glob", "itertools.cycle", "os.path.join", "numpy.unique", "astropy.io.fits.getdata", "matplotlib.pyplot.imshow", "numpy.isfinite", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.isinteractive", "numpy.nansum", "matplotlib.p...
[((970, 985), 'functools.wraps', 'wraps', (['function'], {}), '(function)\n', (975, 985), False, 'from functools import wraps\n'), ((2182, 2207), 'astropy.io.fits.getdata', 'pf.getdata', (['combined_path'], {}), '(combined_path)\n', (2192, 2207), True, 'import astropy.io.fits as pf\n'), ((2227, 2242), 'numpy.ravel', 'n...
##%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## Soft Sensing via Random Forests in Concrete Construction Industry ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #%% import required packages import numpy as np import matplotlib.pyplot as pl...
[ "matplotlib.pyplot.plot", "sklearn.model_selection.train_test_split", "sklearn.metrics.r2_score", "sklearn.ensemble.RandomForestRegressor", "matplotlib.pyplot.barh", "matplotlib.pyplot.figure", "numpy.loadtxt", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((347, 407), 'numpy.loadtxt', 'np.loadtxt', (['"""cement_strength.txt"""'], {'delimiter': '""","""', 'skiprows': '(1)'}), "('cement_strength.txt', delimiter=',', skiprows=1)\n", (357, 407), True, 'import numpy as np\n'), ((471, 483), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (481, 483), True, 'import...
from scipy.ndimage import gaussian_filter1d import torch import numpy as np import argparse from tqdm import tqdm import os import cv2 import imageio from dataset import get_meanpose from model import get_autoencoder from functional.visualization import hex2rgb, joints2image, interpolate_color from functional.motion im...
[ "argparse.ArgumentParser", "functional.motion.openpose2motion", "torch.cat", "dataset.get_meanpose", "torch.load", "functional.motion.postprocess_motion2d", "cv2.resize", "functional.visualization.interpolate_color", "functional.utils.pad_to_height", "model.get_autoencoder", "functional.motion.p...
[((3178, 3203), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3201, 3203), False, 'import argparse\n'), ((4954, 4977), 'common.config.initialize', 'config.initialize', (['args'], {}), '(args)\n', (4971, 4977), False, 'from common import config\n'), ((5166, 5234), 'functional.utils.pad_to_heig...
import os import numpy as np import torch import sys from .member import Member from .neural_predictor import Neural_Predictor import numpy as np from .member import Member from .member import Mutation from baselines import nDS_index, crowdingDist import math from datetime import datetime class BANANAS_SH: """ ...
[ "numpy.random.seed", "math.ceil", "baselines.crowdingDist", "numpy.array", "datetime.datetime.fromtimestamp" ]
[((923, 940), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (937, 940), True, 'import numpy as np\n'), ((4112, 4146), 'baselines.crowdingDist', 'crowdingDist', (['a', 'index_return_list'], {}), '(a, index_return_list)\n', (4124, 4146), False, 'from baselines import nDS_index, crowdingDist\n'), ((4734, ...
# Confidential, Copyright 2020, Sony Corporation of America, All rights reserved. from collections import defaultdict from typing import DefaultDict, Dict, List, Optional, Sequence, cast from functools import lru_cache import numpy as np from .interfaces import ContactRate, ContactTracer, PandemicRegulation, Pandemi...
[ "typing.cast", "numpy.asarray", "numpy.triu_indices", "numpy.random.RandomState", "collections.defaultdict", "functools.lru_cache", "numpy.concatenate" ]
[((17484, 17507), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (17493, 17507), False, 'from functools import lru_cache\n'), ((17410, 17436), 'numpy.triu_indices', 'np.triu_indices', (['l.size', '(1)'], {}), '(l.size, 1)\n', (17425, 17436), True, 'import numpy as np\n'), ((3204, 322...
from collections import deque import heapq import numpy as np import matplotlib.pyplot as plt class Node: def __init__(self, state, parent=None, pathcost=0, value=0): self.state = state self.pathcost = pathcost self.value = value self.parent = parent self.removed = False ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "heapq.heappush", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.asarray", "heapq.heappop", "numpy.amax", "matplotlib.pyplot.figure", "numpy.lib.stride_tricks.as_strided", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel",...
[((3191, 3218), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(13, 6)'}), '(figsize=(13, 6))\n', (3201, 3218), True, 'import matplotlib.pyplot as plt\n'), ((3307, 3325), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['xlabel'], {}), '(xlabel)\n', (3317, 3325), True, 'import matplotlib.pyplot as plt\n'), ((33...
#!/usr/bin/env python from subprocess import call import numpy as np import sys import argparse """ This script will create 'nprocs' parallel processes and on each one calculate the speed distribution at the detector for a range of values of gamma (using CalcVelDist.py). It will then calculate the number of events ...
[ "numpy.logspace", "numpy.log10", "subprocess.call", "argparse.ArgumentParser" ]
[((751, 793), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""..."""'}), "(description='...')\n", (774, 793), False, 'import argparse\n'), ((1637, 1686), 'numpy.logspace', 'np.logspace', (['args.lsigstart', 'args.lsigend', 'nprocs'], {}), '(args.lsigstart, args.lsigend, nprocs)\n', (1648,...
import time import sqlalchemy as sa import numpy as np from sqlalchemy.orm import relationship from sqlalchemy.dialects import postgresql as psql from copy import deepcopy from .crossmatch import xmatch from .core import Base, DBSession from .utils import print_time from .constants import MJD_TO_JD __all__ = ['Aler...
[ "sqlalchemy.Index", "copy.deepcopy", "numpy.sum", "numpy.median", "sqlalchemy.ForeignKey", "time.time", "sqlalchemy.orm.relationship", "sqlalchemy.func.min", "sqlalchemy.Column", "sqlalchemy.func.count", "sqlalchemy.func.max" ]
[((359, 380), 'sqlalchemy.Column', 'sa.Column', (['psql.JSONB'], {}), '(psql.JSONB)\n', (368, 380), True, 'import sqlalchemy as sa\n'), ((402, 444), 'sqlalchemy.Index', 'sa.Index', (['"""created_at_index"""', '"""created_at"""'], {}), "('created_at_index', 'created_at')\n", (410, 444), True, 'import sqlalchemy as sa\n'...
import os import glob import collections import numpy as np import matplotlib.pyplot as plt from llff.poses.colmap_read_model import rotmat2qvec from colmap_wrapper import run_colmap Camera = collections.namedtuple( "Camera", ["id", "model", "width", "height", "params"]) BaseImage = collections.namedtuple( "I...
[ "llff.poses.colmap_read_model.rotmat2qvec", "os.makedirs", "numpy.asarray", "colmap_wrapper.run_colmap", "os.path.exists", "numpy.array", "collections.namedtuple", "numpy.eye", "matplotlib.pyplot.imread", "os.path.join", "os.path.split" ]
[((194, 272), 'collections.namedtuple', 'collections.namedtuple', (['"""Camera"""', "['id', 'model', 'width', 'height', 'params']"], {}), "('Camera', ['id', 'model', 'width', 'height', 'params'])\n", (216, 272), False, 'import collections\n'), ((290, 392), 'collections.namedtuple', 'collections.namedtuple', (['"""Image...
import requests import zipfile import os import glob import tqdm import scipy.io import numpy as np def download_data(data_dir, url, unpack=True, block_size=10 * 1024): filename = os.path.join(data_dir, os.path.basename(url)) os.makedirs(data_dir, exist_ok=True) if os.path.exists(filename): prin...
[ "numpy.stack", "tqdm.tqdm", "zipfile.ZipFile", "os.makedirs", "os.path.basename", "os.path.exists", "numpy.array", "requests.get", "os.path.join" ]
[((237, 273), 'os.makedirs', 'os.makedirs', (['data_dir'], {'exist_ok': '(True)'}), '(data_dir, exist_ok=True)\n', (248, 273), False, 'import os\n'), ((282, 306), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (296, 306), False, 'import os\n'), ((468, 498), 'requests.get', 'requests.get', (['ur...
''' Fast gradient and background estimation ''' import numpy as np from numpy.polynomial import polynomial from loguru import logger from jocular.utils import percentile_clip def estimate_background(im): # requires about .7ms for Lodestar image on MacBook Pro 2020 # fit at random pixels and remove outliers...
[ "numpy.linalg.lstsq", "numpy.std", "numpy.asarray", "numpy.polynomial.polynomial.polyvander2d", "numpy.zeros", "jocular.utils.percentile_clip", "numpy.percentile", "numpy.min", "numpy.mean", "numpy.max", "numpy.arange", "numpy.random.random_integers" ]
[((365, 416), 'numpy.random.random_integers', 'np.random.random_integers', (['(0)'], {'high': '(c - 1)', 'size': 'npts'}), '(0, high=c - 1, size=npts)\n', (390, 416), True, 'import numpy as np\n'), ((425, 476), 'numpy.random.random_integers', 'np.random.random_integers', (['(0)'], {'high': '(r - 1)', 'size': 'npts'}), ...
""" StrainGE utility functions ========================== """ # Copyright (c) 2016-2019, Broad Institute, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source co...
[ "math.exp", "numpy.diff", "collections.namedtuple", "numpy.where" ]
[((1710, 1754), 'collections.namedtuple', 'namedtuple', (['"""Group"""', '"""data start end length"""'], {}), "('Group', 'data start end length')\n", (1720, 1754), False, 'from collections import namedtuple\n'), ((3348, 3367), 'math.exp', 'math.exp', (['(-coverage)'], {}), '(-coverage)\n', (3356, 3367), False, 'import ...
"""pymoku example: Automated Test Demonstration Script This script demonstrates how the Moku could be utilised in an automated test application. (c) 2019 Liquid Instruments Pty. Ltd. """ from pymoku import Moku from pymoku.instruments import Oscilloscope, SpectrumAnalyzer from pymoku import _utils from automation_de...
[ "pymoku.instruments.Oscilloscope", "matplotlib.get_backend", "automation_demo_helpers.calculate_risetime", "matplotlib.pyplot.close", "pymoku.Moku.get_by_name", "matplotlib.pyplot.get_current_fig_manager", "seaborn.tsplot", "datetime.datetime.now", "time.sleep", "pymoku._utils.formatted_timestamp"...
[((688, 712), 'pymoku.Moku.get_by_name', 'Moku.get_by_name', (['"""Moku"""'], {}), "('Moku')\n", (704, 712), False, 'from pymoku import Moku\n'), ((1732, 1746), 'pymoku.instruments.Oscilloscope', 'Oscilloscope', ([], {}), '()\n', (1744, 1746), False, 'from pymoku.instruments import Oscilloscope, SpectrumAnalyzer\n'), (...
''' Script to generate the table to display Figure 1e and Extended Figure 1XXX Input, raw Source data: -- discovery.tsv: raw output from boostdm with discovery index and other stats for each tumor-type gene pair -- drivers.tsv: driver genes annotations from intOGen. -- ttype,f"{gene}.eval.pickle.gz": Evaluation stat...
[ "os.path.join", "numpy.nanmedian", "pandas.read_csv", "numpy.percentile", "oncotree.get_ttypes", "pickle.load", "oncotree.Oncotree", "conf.config_params" ]
[((732, 751), 'oncotree.Oncotree', 'oncotree.Oncotree', ([], {}), '()\n', (749, 751), True, 'import oncotree as oncotree\n'), ((752, 772), 'conf.config_params', 'conf.config_params', ([], {}), '()\n', (770, 772), True, 'import conf as conf\n'), ((815, 878), 'os.path.join', 'os.path.join', (['conf.output_boostdm', '"""d...
# *************************************************************** # Copyright (c) 2020 Jittor. Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>>. # All Rights Reserved. # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this source code package. # ***************...
[ "unittest.main", "unittest.skipIf", "jittor.array", "jittor.dirty_fix_pytorch_runtime_error", "torch.cumprod", "numpy.random.rand", "jittor.flag_scope", "jittor.cumprod", "torch.from_numpy" ]
[((605, 654), 'unittest.skipIf', 'unittest.skipIf', (['skip_this_test', '"""No Torch found"""'], {}), "(skip_this_test, 'No Torch found')\n", (620, 654), False, 'import unittest\n'), ((457, 493), 'jittor.dirty_fix_pytorch_runtime_error', 'jt.dirty_fix_pytorch_runtime_error', ([], {}), '()\n', (491, 493), True, 'import ...
# Copyright 2019 The Texar 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 applicable ...
[ "horovod.tensorflow.broadcast_global_variables", "tensorflow.logging.info", "horovod.tensorflow.size", "texar.data.FeedableDataIterator", "tensorflow.print", "texar.utils.maybe_create_dir", "tensorflow.logging.set_verbosity", "tensorflow.local_variables_initializer", "tensorflow.ConfigProto", "ten...
[((895, 934), 'sys.path.append', 'sys.path.append', (['"""../comet-commonsense"""'], {}), "('../comet-commonsense')\n", (910, 934), False, 'import os, sys\n'), ((1485, 1539), 'tensorflow.RunOptions', 'tf.RunOptions', ([], {'report_tensor_allocations_upon_oom': '(True)'}), '(report_tensor_allocations_upon_oom=True)\n', ...
import numpy as np import mahotas import sys def test_watershed(): S = np.array([ [0,0,0,0], [0,1,2,1], [1,1,1,1], [0,0,1,0], [1,1,1,1], [1,2,2,1], [1,1,2,2] ]) M = np.array([ [0,0,0,0], [0,0,1,0], [0,0,0,0], [0,0,0...
[ "numpy.zeros_like", "numpy.zeros", "sys.getrefcount", "numpy.indices", "numpy.array", "mahotas.cwatershed", "numpy.all" ]
[((76, 188), 'numpy.array', 'np.array', (['[[0, 0, 0, 0], [0, 1, 2, 1], [1, 1, 1, 1], [0, 0, 1, 0], [1, 1, 1, 1], [1, \n 2, 2, 1], [1, 1, 2, 2]]'], {}), '([[0, 0, 0, 0], [0, 1, 2, 1], [1, 1, 1, 1], [0, 0, 1, 0], [1, 1, 1,\n 1], [1, 2, 2, 1], [1, 1, 2, 2]])\n', (84, 188), True, 'import numpy as np\n'), ((238, 350)...
import time import numpy as np import pandas as pd from pandas.api.types import is_categorical_dtype from scipy.sparse import csr_matrix from statsmodels.stats.multitest import fdrcorrection as fdr from joblib import Parallel, delayed, parallel_backend from typing import List, Tuple, Dict, Union, Optional import log...
[ "pegasusio.write_output", "numpy.isin", "pegasus.cylib.de_utils.calc_stat", "numpy.ones", "logging.getLogger", "numpy.argsort", "joblib.parallel_backend", "collections.defaultdict", "numpy.unique", "pandas.DataFrame", "pegasus.cylib.de_utils.calc_mwu", "pegasus.cylib.cfisher.fisher_exact", "...
[((334, 361), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (351, 361), False, 'import logging\n'), ((15747, 15767), 'pegasusio.timer', 'timer', ([], {'logger': 'logger'}), '(logger=logger)\n', (15752, 15767), False, 'from pegasusio import timer, MultimodalData, UnimodalData\n'), ((25115...
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) from __future__ import print_function import numpy as np from ..core.parameterization.param import Param from ..core.sparse_gp import SparseGP from ..core.gp import GP from ..inference.latent_function_infer...
[ "numpy.zeros", "GPy.inference.optimization.stochastics.SparseGPMissing", "GPy.inference.latent_function_inference.posterior.Posterior", "GPy.inference.optimization.stochastics.SparseGPStochastics", "logging.getLogger" ]
[((751, 781), 'logging.getLogger', 'logging.getLogger', (['"""sparse gp"""'], {}), "('sparse gp')\n", (768, 781), False, 'import logging\n'), ((2842, 2897), 'GPy.inference.optimization.stochastics.SparseGPStochastics', 'SparseGPStochastics', (['self', 'batchsize', 'self.missing_data'], {}), '(self, batchsize, self.miss...
import matplotlib.pyplot as plt import numpy as np from PIL import Image def save_imagegrid(image_grid, file_name): image_grid *= 255 image_grid = image_grid.astype(np.uint8) image_grid = image_grid.transpose(1, 2, 0) img = Image.fromarray(image_grid) img.save(file_name) def save_oscillating_vid...
[ "numpy.concatenate", "matplotlib.pyplot.close", "numpy.unique", "matplotlib.pyplot.figure", "numpy.tile", "matplotlib.pyplot.gca", "PIL.Image.fromarray", "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.savefig" ]
[((242, 269), 'PIL.Image.fromarray', 'Image.fromarray', (['image_grid'], {}), '(image_grid)\n', (257, 269), False, 'from PIL import Image\n'), ((861, 914), 'numpy.tile', 'np.tile', (['start_frame', '(num_still_fames // 2, 1, 1, 1)'], {}), '(start_frame, (num_still_fames // 2, 1, 1, 1))\n', (868, 914), True, 'import num...
import h5py import numpy as np from collections import Counter import os import pandas as pd from multiprocessing import Pool import time def read_loom(loom_path): assert os.path.exists(loom_path) with h5py.File(loom_path, "r", libver='latest', swmr=True) as f: gene_name = f["row_attrs/Gene"][...].ast...
[ "numpy.isin", "numpy.sum", "argparse.ArgumentParser", "numpy.maximum", "numpy.mean", "numpy.arange", "pandas.DataFrame", "numpy.zeros_like", "os.path.exists", "collections.Counter", "numpy.log1p", "h5py.File", "numpy.minimum", "numpy.ones_like", "numpy.ceil", "numpy.median", "multipr...
[((177, 202), 'os.path.exists', 'os.path.exists', (['loom_path'], {}), '(loom_path)\n', (191, 202), False, 'import os\n'), ((728, 787), 'pandas.DataFrame', 'pd.DataFrame', (['bc_gene_mat'], {'columns': 'gene_name', 'index': 'cell_id'}), '(bc_gene_mat, columns=gene_name, index=cell_id)\n', (740, 787), True, 'import pand...
####### # This plots 100 random data points (set the seed to 42 to # obtain the same points we do!) between 1 and 100 in both # vertical and horizontal directions. ###### import plotly.offline as pyo import plotly.graph_objs as go import numpy as np np.random.seed(42) random_x = np.random.randint(1,101,100) random_y =...
[ "plotly.graph_objs.Scatter", "numpy.random.randint", "numpy.random.seed", "plotly.offline.plot" ]
[((251, 269), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (265, 269), True, 'import numpy as np\n'), ((281, 311), 'numpy.random.randint', 'np.random.randint', (['(1)', '(101)', '(100)'], {}), '(1, 101, 100)\n', (298, 311), True, 'import numpy as np\n'), ((321, 351), 'numpy.random.randint', 'np.rand...
#!/usr/bin/env python # -*- coding: utf-8 -*- # License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised)) # Copyright (c) 2016-2021, <NAME>; <NAME> # Copyright (c) 2022, QuatroPe # All rights reserved. # ============================================================================= # DOCS # ========...
[ "pandas.DataFrame", "pyquery.PyQuery", "pandas.get_option", "pandas.option_context", "numpy.asarray", "numpy.asanyarray", "numpy.ndim", "numpy.ones", "numpy.allclose", "numpy.hstack", "numpy.shape", "pandas.io.formats.format.format_array", "pandas.Series", "functools.wraps", "numpy.array...
[((24592, 24638), 'functools.wraps', 'functools.wraps', (['DecisionMatrix.from_mcda_data'], {}), '(DecisionMatrix.from_mcda_data)\n', (24607, 24638), False, 'import functools\n'), ((14630, 14663), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (14649, 14663), False, 'import...
import unittest import numpy as np import pytest import cova.motion.object_crop as crop @pytest.fixture def boxes(): return [ [0, 0, 100, 100], [0, 0, 100, 100], [0, 0, 10, 10], ] @pytest.fixture def border(): return [10] * 4 @pytest.fixture def widths(boxes, border): ret...
[ "unittest.main", "cova.motion.object_crop.prediction_to_object", "cova.motion.object_crop.combine_boxes", "cova.motion.object_crop.translate_to_object_coordinates", "cova.motion.object_crop.MovingObject", "numpy.zeros", "cova.motion.object_crop.translate_to_frame_coordinates", "pytest.mark.parametrize...
[((2364, 2506), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""example"""', '[[1, [0, 0, 120, 120]], [1, [100, 100, 120, 120]], [2, [140, 10, 200, 100]],\n [3, [10, 130, 20, 140]]]'], {}), "('example', [[1, [0, 0, 120, 120]], [1, [100, 100, \n 120, 120]], [2, [140, 10, 200, 100]], [3, [10, 130, 20, 1...
import pytest from scirpy.ir_dist.metrics import DistanceCalculator from scirpy.ir_dist._clonotype_neighbors import ClonotypeNeighbors import numpy as np import numpy.testing as npt import scirpy as ir import scipy.sparse from .fixtures import adata_cdr3, adata_cdr3_2 # NOQA from .util import _squarify from scirpy.uti...
[ "pandas.DataFrame", "numpy.isin", "pandas.testing.assert_frame_equal", "numpy.testing.assert_array_equal", "scirpy.pp.ir_dist", "numpy.zeros", "numpy.identity", "pytest.raises", "scirpy.util._is_symmetric", "numpy.array", "numpy.testing.assert_equal", "pytest.mark.parametrize", "scirpy.ir_di...
[((4725, 4766), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_jobs"""', '[1, 2]'], {}), "('n_jobs', [1, 2])\n", (4748, 4766), False, 'import pytest\n'), ((5518, 5559), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_jobs"""', '[1, 2]'], {}), "('n_jobs', [1, 2])\n", (5541, 5559), False, 'im...
import leboard import numpy as np def test_leboard(): letask = leboard.TaskBoard("__TEST_LEBOARD_TASK") # prevent error from any malformed test execution letask.delete() entries = {} for layer in range(1, 6): # run an experiment board_entry = letask.Entry() board_entry....
[ "leboard.TaskBoard", "numpy.random.random" ]
[((70, 110), 'leboard.TaskBoard', 'leboard.TaskBoard', (['"""__TEST_LEBOARD_TASK"""'], {}), "('__TEST_LEBOARD_TASK')\n", (87, 110), False, 'import leboard\n'), ((336, 354), 'numpy.random.random', 'np.random.random', ([], {}), '()\n', (352, 354), True, 'import numpy as np\n'), ((388, 406), 'numpy.random.random', 'np.ran...
import argparse import os import glob from collections import defaultdict import numpy as np import matplotlib.pyplot as plt is_encoded = True def analyze_labels(path: str): char_count_dict = defaultdict(int) with open(path, mode='r', encoding='utf-8') as f: data = f.readlines() # 移除换行符、首尾空格 ...
[ "matplotlib.pyplot.yscale", "matplotlib.pyplot.show", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "numpy.std", "os.path.isdir", "matplotlib.pyplot.legend", "collections.defaultdict", "os.path.isfile", "numpy.mean", "glob.glob", "matplotlib.pyplot.ylabel" ]
[((198, 214), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (209, 214), False, 'from collections import defaultdict\n'), ((918, 932), 'numpy.mean', 'np.mean', (['freqs'], {}), '(freqs)\n', (925, 932), True, 'import numpy as np\n'), ((943, 956), 'numpy.std', 'np.std', (['freqs'], {}), '(freqs)\n', ...
from typing import List, Dict import datetime import numpy as np from hft.dataloader.callbacks.connectors import Connector from hft.utils.data import OrderBook from hft.utils.logger import setup_logger from hft.dataloader.callbacks.message import TradeMessage, MetaMessage from abc import ABC, abstractmethod logger = ...
[ "hft.dataloader.callbacks.message.TradeMessage.unwrap_data", "hft.dataloader.callbacks.message.MetaMessage", "hft.utils.data.OrderBook.from_bitmex_orderbook", "datetime.datetime.utcnow", "numpy.array", "hft.utils.logger.setup_logger" ]
[((320, 357), 'hft.utils.logger.setup_logger', 'setup_logger', (['"""<data-loader>"""', '"""INFO"""'], {}), "('<data-loader>', 'INFO')\n", (332, 357), False, 'from hft.utils.logger import setup_logger\n'), ((2109, 2134), 'numpy.array', 'np.array', (['self.data[0:50]'], {}), '(self.data[0:50])\n', (2117, 2134), True, 'i...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Perform different statistical data analysis in log files produced by simulation and create visualizations of the input space @author: ucaiado Created on 09/18/2016 """ from collections import defaultdict import csv import numpy as np import matplotlib.pyplot as plt import...
[ "pandas.DataFrame", "zipfile.ZipFile", "numpy.log", "matplotlib.ticker.MaxNLocator", "seaborn.barplot", "numpy.zeros", "collections.defaultdict", "matplotlib.dates.DateFormatter", "numpy.array", "pandas.Series", "seaborn.color_palette", "pandas.to_datetime", "numpy.round", "matplotlib.pypl...
[((1548, 1568), 'pandas.DataFrame', 'pd.DataFrame', (['d_data'], {}), '(d_data)\n', (1560, 1568), True, 'import pandas as pd\n'), ((1585, 1625), 'pandas.Series', 'pd.Series', (['[x.day for x in df_aux.index]'], {}), '([x.day for x in df_aux.index])\n', (1594, 1625), True, 'import pandas as pd\n'), ((2408, 2437), 'zipfi...
# coding=utf-8 import os import numpy as np from snntoolbox.datasets.utils import get_dataset class TestGetDataset: """Test obtaining the dataset from disk in correct format.""" def test_get_dataset_from_npz(self, _config): normset, testset = get_dataset(_config) assert all([normset, testse...
[ "os.mkdir", "os.path.join", "numpy.random.random_sample", "snntoolbox.datasets.utils.get_dataset" ]
[((264, 284), 'snntoolbox.datasets.utils.get_dataset', 'get_dataset', (['_config'], {}), '(_config)\n', (275, 284), False, 'from snntoolbox.datasets.utils import get_dataset\n'), ((556, 589), 'os.path.join', 'os.path.join', (['datapath', '"""class_0"""'], {}), "(datapath, 'class_0')\n", (568, 589), False, 'import os\n'...
"""SeFa.""" import os import argparse from tqdm import tqdm import numpy as np from sklearn.decomposition import FastICA import numpy as np import random import torch from models import parse_gan_type from utils import to_tensor from utils import postprocess from utils import load_generator from utils import factori...
[ "numpy.random.seed", "argparse.ArgumentParser", "utils.load_generator", "torch.cat", "torch.randn", "utils.postprocess", "numpy.linalg.norm", "os.path.join", "utils.factorize_weight", "numpy.linspace", "torch.manual_seed", "utils.parse_indices", "utils.to_tensor", "numpy.concatenate", "t...
[((477, 511), 'sklearn.decomposition.FastICA', 'FastICA', ([], {'n_components': 'n_components'}), '(n_components=n_components)\n', (484, 511), False, 'from sklearn.decomposition import FastICA\n'), ((1271, 1296), 'models.parse_gan_type', 'parse_gan_type', (['generator'], {}), '(generator)\n', (1285, 1296), False, 'from...