code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python # -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology. # SPDX-FileCopyrightText: © 2021 <NAME> <<EMAIL>> # NOTICE: authors should document their contributions in concisely in NOTICE # with details inline in source files...
[ "numpy.argsort", "numpy.copy" ]
[((526, 560), 'numpy.argsort', 'np.argsort', (['[r[0] for r in ranges]'], {}), '([r[0] for r in ranges])\n', (536, 560), True, 'import numpy as np\n'), ((581, 602), 'numpy.argsort', 'np.argsort', (['argranges'], {}), '(argranges)\n', (591, 602), True, 'import numpy as np\n'), ((815, 835), 'numpy.copy', 'np.copy', (['ma...
#!/usr/bin/env python # -*- coding: utf-8 -*- # 2020, <NAME> import numpy as np import pandas as pd from unittest import TestCase, mock, main from ..core.io import load_image, ImageBatchGenerator def _mock_imread(image_file_path): """ Mocks `cv2.imread`. :param image_file_path: mock path to the image, ...
[ "unittest.main", "numpy.random.seed", "numpy.testing.assert_array_equal", "numpy.zeros", "pandas.isnull", "unittest.mock.patch", "numpy.array", "numpy.testing.assert_array_almost_equal" ]
[((486, 513), 'numpy.zeros', 'np.zeros', ([], {'shape': '(16, 16, 3)'}), '(shape=(16, 16, 3))\n', (494, 513), True, 'import numpy as np\n'), ((653, 693), 'unittest.mock.patch', 'mock.patch', (['"""cv2.imread"""', '(lambda _: None)'], {}), "('cv2.imread', lambda _: None)\n", (663, 693), False, 'from unittest import Test...
# q learning from pyqlearning.qlearning.boltzmann_q_learning import BoltzmannQLearning from pyqlearning.qlearning.greedy_q_learning import GreedyQLearning # testing import unittest # data import numpy as np # package from utils import FIFOQueue, EPSILON class AdaptiveBetaQLearning(BoltzmannQLearning): def __init...
[ "unittest.main", "numpy.abs", "utils.FIFOQueue" ]
[((3456, 3471), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3469, 3471), False, 'import unittest\n'), ((790, 821), 'utils.FIFOQueue', 'FIFOQueue', ([], {'capacity': 'buffer_size'}), '(capacity=buffer_size)\n', (799, 821), False, 'from utils import FIFOQueue, EPSILON\n'), ((3206, 3222), 'numpy.abs', 'np.abs', (...
import numpy as np import pytest import pymodaq.daq_utils from pymodaq.daq_utils import scanner from pymodaq.daq_utils import exceptions as exceptions class TestScanInfo: def test_ScanInfo(self): Nsteps = 10 axes_indexes = np.array([]) axes_unique = np.array([]) positions = np.arr...
[ "numpy.unique", "numpy.expand_dims", "pytest.approx", "pymodaq.daq_utils.scanner.ScanInfo", "pytest.raises", "numpy.rint", "pymodaq.daq_utils.scanner.ScanParameters", "numpy.array", "numpy.array_equal", "pymodaq.daq_utils.scanner.set_scan_spiral", "numpy.all" ]
[((246, 258), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (254, 258), True, 'import numpy as np\n'), ((281, 293), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (289, 293), True, 'import numpy as np\n'), ((314, 326), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (322, 326), True, 'import numpy as np\n')...
import torch from torch.autograd import Variable import numpy as np import time, math import matplotlib.pyplot as plt import time, math import matplotlib.pyplot as plt import os import torch.nn as nn from skimage import data,io import cv2 torch.backends.cudnn.enabled = True def PSNR(pred, gt):#this fu...
[ "os.mkdir", "matplotlib.pyplot.show", "torch._C._cuda_emptyCache", "os.getcwd", "matplotlib.pyplot.imshow", "torch.load", "numpy.asarray", "numpy.zeros", "os.path.exists", "torch.autograd.Variable", "math.log10", "numpy.mean", "torch.Tensor", "skimage.io.imread_collection" ]
[((2297, 2318), 'numpy.zeros', 'np.zeros', (['(num, h, w)'], {}), '((num, h, w))\n', (2305, 2318), True, 'import numpy as np\n'), ((1028, 1062), 'matplotlib.pyplot.imshow', 'plt.imshow', (['image_array'], {'cmap': 'mode'}), '(image_array, cmap=mode)\n', (1038, 1062), True, 'import matplotlib.pyplot as plt\n'), ((1067, ...
# Author: <NAME> # Warsaw University of Technology # Modified by: <NAME>, <NAME>, <NAME> (Poznan University of Technology 2021) import torch from torch.utils.data import DataLoader import MinkowskiEngine as ME from numba import njit, jit import numpy as np from datasets.oxford import OxfordDataset, IntensityDataset, ...
[ "torch.ones", "datasets.oxford.IntensityDataset", "datasets.oxford.OxfordDataset", "torch.tensor", "torch.stack", "torch.utils.data.DataLoader", "numpy.arctan2", "numpy.abs", "datasets.oxford.TrainSetTransform", "MinkowskiEngine.utils.sparse_quantize", "torch.cat", "numpy.linalg.norm", "Mink...
[((577, 608), 'datasets.oxford.TrainTransform', 'TrainTransform', (['params.aug_mode'], {}), '(params.aug_mode)\n', (591, 608), False, 'from datasets.oxford import OxfordDataset, IntensityDataset, TrainTransform, TrainSetTransform\n'), ((635, 669), 'datasets.oxford.TrainSetTransform', 'TrainSetTransform', (['params.aug...
#!/usr/bin/env python """ quick_plot 9 Oct 2013 <NAME> (dent.earl a gmail.com) A quick plotting program for creating fast sketches of data. """ ############################## # Copyright (C) 2013-2014 by # <NAME> (<EMAIL>, <EMAIL>) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of ...
[ "matplotlib.backends.backend_pdf.PdfPages", "numpy.random.seed", "argparse.ArgumentParser", "random.sample", "numpy.logspace", "matplotlib.pyplot.box", "numpy.isnan", "matplotlib.pyplot.figure", "matplotlib.colors.Normalize", "matplotlib.pyplot.imshow", "matplotlib.pyplot.matshow", "os.path.ex...
[((1376, 1397), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (1390, 1397), False, 'import matplotlib\n'), ((23013, 23087), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(args.width, args.height)', 'dpi': 'args.dpi', 'facecolor': '"""w"""'}), "(figsize=(args.width, args.height), dp...
import torch import numpy as np import os import time def search(dataset, batch_size=1, shuffle=False, sampler=None, batch_sampler=None, collate_fn=None, pin_memory=False, drop_last=False, timeout=0, worker_init_fn=None, *, prefetch_factor=2, persistent_workers=False, thresh...
[ "torch.utils.data.DataLoader", "time.time", "os.cpu_count", "numpy.sort", "numpy.finfo", "numpy.array", "numpy.arange", "numpy.unique" ]
[((494, 508), 'os.cpu_count', 'os.cpu_count', ([], {}), '()\n', (506, 508), False, 'import os\n'), ((885, 911), 'numpy.array', 'np.array', (['num_workers_list'], {}), '(num_workers_list)\n', (893, 911), True, 'import numpy as np\n'), ((999, 1045), 'numpy.unique', 'np.unique', (['num_workers_list'], {'return_index': '(T...
import time import sys import argparse # import image and DL processing import cv2 import numpy as np import dlib from random import randrange # from edgetpu.detection.engine import DetectionEngine from pycoral.adapters import common from pycoral.adapters import detect from pycoral.utils.edgetpu import make_interprete...
[ "pycoral.utils.edgetpu.make_interpreter", "argparse.ArgumentParser", "faceextractor.FaceDataExtractor", "dlib.rectangle", "cv2.imshow", "dlib.shape_predictor", "recognizer.FaceRecognizer", "cv2.cvtColor", "scipy.interpolate.UnivariateSpline", "cv2.split", "cv2.LUT", "PIL.ImageDraw.Draw", "cv...
[((616, 641), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (639, 641), False, 'import argparse\n'), ((1027, 1132), 'pycoral.utils.edgetpu.make_interpreter', 'make_interpreter', (['"""/home/pi/coral-dalek/mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite"""'], {}), "(\n '/home/pi/coral...
from datetime import datetime import numpy as np from keras.callbacks import EarlyStopping from keras.layers import Conv2D, MaxPooling2D, Flatten from keras.layers import Dense, Dropout, LSTM from keras.layers.wrappers import TimeDistributed from keras.models import Sequential from keras.utils import to_categorical f...
[ "helpers.metrics.confusion_metric_vis", "numpy.argmax", "keras.layers.LSTM", "keras.layers.Dropout", "keras.layers.Flatten", "keras.callbacks.EarlyStopping", "keras.layers.Dense", "keras.layers.Conv2D", "keras.models.Sequential", "datetime.datetime.now", "keras.layers.MaxPooling2D" ]
[((654, 666), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (664, 666), False, 'from keras.models import Sequential\n'), ((2868, 2967), 'keras.callbacks.EarlyStopping', 'EarlyStopping', ([], {'monitor': '"""val_accuracy"""', 'min_delta': '(0.0)', 'patience': 'patience', 'verbose': '(2)', 'mode': '"""auto""...
""" Home Work 5 <NAME> Exercise 8b 15863 """ from math import sqrt from time import perf_counter import matplotlib.pyplot as plt import numpy as np start = perf_counter() M = 1.989 * 10 ** 30 vx = 0 vy = 15768000 G = 6.6375 * 10 ** -5 x0 = 4 * 10 ** 9 y0 = 0 def f(solution, t): x = solution[0] y = solutio...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "math.sqrt", "time.perf_counter", "numpy.array", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((159, 173), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (171, 173), False, 'from time import perf_counter\n'), ((562, 582), 'numpy.arange', 'np.arange', (['ti', 'tf', 'h'], {}), '(ti, tf, h)\n', (571, 582), True, 'import numpy as np\n'), ((594, 627), 'numpy.array', 'np.array', (['[x0, y0, vx, vy]', 'float'...
#!/usr/bin/env python # (C) Copyright 2018-2020 # Faculty of Applied Sciences # Delft University of Technology # <NAME>, November 2020. # 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 # h...
[ "test_expdist_ref.bhatdist_python_reference", "numpy.ones_like", "numpy.sum", "test_utils.get_kernel_path", "numpy.deg2rad", "numpy.ceil", "numpy.random.randn", "numpy.allclose", "test_utils.generate_inputs", "numpy.zeros", "test_utils.call_reference_function", "numpy.isclose", "numpy.sin", ...
[((2250, 2388), 'kernel_tuner.run_kernel', 'run_kernel', (['"""reduce_cross_term"""', 'kernel_string', '(1)', 'arguments', "{'block_size_x': 128}"], {'compiler_options': 'compiler_options', 'grid_div_x': '[]'}), "('reduce_cross_term', kernel_string, 1, arguments, {\n 'block_size_x': 128}, compiler_options=compiler_o...
import dask import numpy as np import tqdm import time import sys import pandas as pd import metod_alg as mt from metod_alg import objective_functions as mt_obj from metod_alg import metod_analysis as mt_ays from metod_alg import check_metod_class as prev_mt_alg def check_sp_fp(starting_points, store_minimizer_des, ...
[ "pandas.DataFrame", "numpy.random.uniform", "metod_alg.objective_functions.calculate_rotation_matrix", "numpy.random.seed", "metod_alg.check_metod_class.metod_class", "metod_alg.objective_functions.check_minimizers_mult_metod", "metod_alg.check_metod_class.check_classification_sd_metod", "numpy.savetx...
[((11755, 11766), 'time.time', 'time.time', ([], {}), '()\n', (11764, 11766), False, 'import time\n'), ((12024, 12183), 'metod_alg.check_metod_class.metod_class', 'prev_mt_alg.metod_class', (['f', 'g', 'func_args', 'd', 'num_p', 'beta', 'tolerance', 'projection', 'const', 'm', 'option', 'met', 'initial_guess', 'set_x',...
import unittest import numpy as np from pykrev import diversity_indices, ordination_matrix, bray_curtis_matrix, compound_class, normalise_intensity class TestDIVERSITY(unittest.TestCase): def setUp(self): pass def test_sum_relative_intensity(self): z = np.array([100,200,300]) correct ...
[ "unittest.main", "pykrev.diversity_indices", "numpy.std", "numpy.median", "pykrev.compound_class", "numpy.round", "numpy.around", "numpy.mean", "numpy.array", "pykrev.normalise_intensity", "pykrev.ordination_matrix" ]
[((8426, 8441), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8439, 8441), False, 'import unittest\n'), ((280, 305), 'numpy.array', 'np.array', (['[100, 200, 300]'], {}), '([100, 200, 300])\n', (288, 305), True, 'import numpy as np\n'), ((322, 365), 'numpy.array', 'np.array', (['[100 / 600, 200 / 600, 300 / 600]...
class Grams: def __init__(self, text): '''Takes in a list of words representing a document and returns a list of ngrams or skipgrams. text : list A list of words representing a document. ''' self._text = text self._counter = len(text) def ngrams(...
[ "random.sample", "itertools.combinations", "numpy.array" ]
[((1320, 1362), 'itertools.combinations', 'itertools.combinations', (['self._text', 'length'], {}), '(self._text, length)\n', (1342, 1362), False, 'import itertools\n'), ((1909, 1951), 'itertools.combinations', 'itertools.combinations', (['self._text', 'length'], {}), '(self._text, length)\n', (1931, 1951), False, 'imp...
import argparse import itertools import logging import multiprocessing import os import random import sys import networkit as nk import networkx as nx import numpy as np from utils import np_output_filename parser = argparse.ArgumentParser( description='Compute graph sectional curvatures') parser.add_argumen...
[ "numpy.save", "argparse.ArgumentParser", "logging.warning", "os.path.isfile", "networkx.connected_components", "logging.fatal", "networkx.convert_node_labels_to_integers", "numpy.mean", "multiprocessing.Pool", "networkit.nxadapter.nx2nk", "networkx.read_edgelist", "networkit.distance.APSP", ...
[((219, 292), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Compute graph sectional curvatures"""'}), "(description='Compute graph sectional curvatures')\n", (242, 292), False, 'import argparse\n'), ((1374, 1439), 'utils.np_output_filename', 'np_output_filename', (['args.input', '"""sec...
import numpy as np from numba import jit from scipy.interpolate import interp1d from scipy.stats import pearsonr from matplotlib import gridspec from zestipy.data_structures import waveform, redshift_data, load_sdss_templatefiles from zestipy.plotting_tools import plot_skylines import matplotlib.pyplot as plt from as...
[ "numpy.abs", "matplotlib.pyplot.axes", "numpy.greater", "matplotlib.pyplot.figure", "numpy.arange", "scipy.interpolate.interp1d", "matplotlib.widgets.RadioButtons", "matplotlib.pyplot.close", "numpy.isfinite", "zestipy.data_structures.load_sdss_templatefiles", "matplotlib.pyplot.draw", "numpy....
[((920, 932), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (928, 932), True, 'import numpy as np\n'), ((1082, 1131), 'numpy.arange', 'np.arange', (['self.lower_z', 'self.upper_z', 'self.z_res'], {}), '(self.lower_z, self.upper_z, self.z_res)\n', (1091, 1131), True, 'import numpy as np\n'), ((1156, 1181), 'numpy.z...
# Copyright 2020 AstroLab Software # Author: <NAME> # # 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...
[ "app.clientS.setReversed", "app.clientT.setRangeScan", "app.clientP.setLimit", "pandas.read_csv", "dash_bootstrap_components.CardBody", "app.client.setLimit", "app.clientS.setRangeScan", "app.clientS.setLimit", "dash_html_components.Table", "dash_bootstrap_components.Label", "dash.dependencies.S...
[((2881, 2902), 'numpy.sort', 'np.sort', (['simbad_types'], {}), '(simbad_types)\n', (2888, 2902), True, 'import numpy as np\n'), ((5289, 5402), 'dash_bootstrap_components.Button', 'dbc.Button', (['"""Submit Query"""'], {'id': '"""submit_query"""', 'style': "{'width': '100%', 'display': 'inline-block'}", 'block': '(Tru...
# Copyright 2020 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """Space To Batch ND tests.""" from absl import app from iree.tf.support import tf_test_utils from ire...
[ "iree.tf.support.tf_test_utils.compile_tf_module", "tensorflow.compat.v2.test.main", "tensorflow.compat.v2.enable_v2_behavior", "tensorflow.compat.v2.TensorSpec", "absl.app.run", "numpy.reshape", "tensorflow.compat.v2.space_to_batch_nd", "numpy.linspace" ]
[((1247, 1261), 'tensorflow.compat.v2.test.main', 'tf.test.main', ([], {}), '()\n', (1259, 1261), True, 'import tensorflow.compat.v2 as tf\n'), ((1293, 1306), 'absl.app.run', 'app.run', (['main'], {}), '(main)\n', (1300, 1306), False, 'from absl import app\n'), ((604, 650), 'tensorflow.compat.v2.space_to_batch_nd', 'tf...
import os import sys import shutil import numpy as np import config import utils import csv import torch import torchvision.models as models from torch import nn from time import sleep from tqdm import tqdm, trange from utils import h5_save, data_transforms, image_pair_generator, image_pair_length, get_prefix def ren...
[ "numpy.random.seed", "sys.stdout.flush", "torchvision.models.resnet34", "os.path.join", "utils.h5_save", "shutil.copyfile", "torch.nn.AvgPool2d", "tqdm.tqdm", "csv.writer", "tqdm.trange", "utils.image_pair_length", "os.system", "time.sleep", "torch.cuda.is_available", "numpy.random.permu...
[((583, 603), 'tqdm.trange', 'trange', (['beg', '(end + 1)'], {}), '(beg, end + 1)\n', (589, 603), False, 'from tqdm import tqdm, trange\n'), ((2094, 2101), 'tqdm.tqdm', 'tqdm', (['l'], {}), '(l)\n', (2098, 2101), False, 'from tqdm import tqdm, trange\n'), ((2714, 2741), 'utils.name_list', 'utils.name_list', (['n'], {'...
# Licence Apache-2.0 import feature_gen_dt from ..util import util from ..transformers import Transformer from typing import List, Union import numpy as np import pandas as pd import databricks.koalas as ks class DeltaTime(Transformer): """Create new columns based on the time difference in sec. between two column...
[ "feature_gen_dt.deltatime", "numpy.issubdtype" ]
[((6708, 6775), 'feature_gen_dt.deltatime', 'feature_gen_dt.deltatime', (['X', 'self.idx_columns_a', 'self.idx_columns_b'], {}), '(X, self.idx_columns_a, self.idx_columns_b)\n', (6732, 6775), False, 'import feature_gen_dt\n'), ((4893, 4947), 'numpy.issubdtype', 'np.issubdtype', (['X_datetime_dtype[column]', 'np.datetim...
# # 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, software # distri...
[ "numpy.absolute", "random.randint", "projectq.meta.get_control_count", "projectq.cengines.BasicEngine.__init__", "projectq.ops.FlushGate", "projectq.types.WeakQubitRef" ]
[((3600, 3626), 'projectq.cengines.BasicEngine.__init__', 'BasicEngine.__init__', (['self'], {}), '(self)\n', (3620, 3626), False, 'from projectq.cengines import BasicEngine\n'), ((3562, 3591), 'random.randint', 'random.randint', (['(0)', '(4294967295)'], {}), '(0, 4294967295)\n', (3576, 3591), False, 'import random\n'...
import numpy as np import matplotlib.pyplot as plt from hmmlearn import hmm from sklearn.preprocessing import LabelEncoder def generate_p_matrix(num_states): p = np.zeros([num_states, num_states]) for i in range(num_states): row_sum = 0 for j in range(num_states): p[i][j] = np.random.rand(1) ro...
[ "matplotlib.pyplot.title", "numpy.random.seed", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.sum", "numpy.random.rand", "numpy.zeros", "sklearn.preprocessing.LabelEncoder", "matplotlib.pyplot.figure", "hmmlearn.hmm.MultinomialHMM", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.x...
[((1347, 1372), 'numpy.random.seed', 'np.random.seed', (['(200321513)'], {}), '(200321513)\n', (1361, 1372), True, 'import numpy as np\n'), ((2575, 2626), 'hmmlearn.hmm.MultinomialHMM', 'hmm.MultinomialHMM', ([], {'n_components': '(4)', 'random_state': '(10)'}), '(n_components=4, random_state=10)\n', (2593, 2626), Fals...
import numpy as np import matplotlib as mpl from seaborn.external.version import Version def MarkerStyle(marker=None, fillstyle=None): """ Allow MarkerStyle to accept a MarkerStyle object as parameter. Supports matplotlib < 3.3.0 https://github.com/matplotlib/matplotlib/pull/16692 """ if isi...
[ "matplotlib.scale.scale_factory", "numpy.full_like", "numpy.ma.masked_invalid", "numpy.clip", "numpy.isfinite", "numpy.shape", "matplotlib.markers.MarkerStyle", "seaborn.external.version.Version" ]
[((484, 526), 'matplotlib.markers.MarkerStyle', 'mpl.markers.MarkerStyle', (['marker', 'fillstyle'], {}), '(marker, fillstyle)\n', (507, 526), True, 'import matplotlib as mpl\n'), ((3250, 3296), 'matplotlib.scale.scale_factory', 'mpl.scale.scale_factory', (['scale', 'axis'], {}), '(scale, axis, **kwargs)\n', (3273, 329...
from __future__ import (absolute_import, print_function, unicode_literals, division) import pytest import pandas as pd import numpy as np from .context import gragrapy as gg from . import assert_data_equal def test_stat_identity(): stat = gg.stat.identity() iris = gg.data.iris ass...
[ "pandas.DataFrame", "pytest.mark.parametrize", "numpy.random.randn" ]
[((365, 407), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""window"""', '[5, 25]'], {}), "('window', [5, 25])\n", (388, 407), False, 'import pytest\n'), ((526, 556), 'pandas.DataFrame', 'pd.DataFrame', (["{'x': x, 'y': y}"], {}), "({'x': x, 'y': y})\n", (538, 556), True, 'import pandas as pd\n'), ((1253, ...
import numpy as np import matplotlib.pyplot as plt #Set variables Clk = 0 Reset = 0 shift_reg = np.array([1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]) Semilla = np.array([0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1]) Lon...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.append", "numpy.array", "matplotlib.pyplot.grid" ]
[((103, 207), 'numpy.array', 'np.array', (['[1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0,\n 1, 0, 1, 0, 0]'], {}), '([1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1,\n 1, 0, 0, 1, 0, 1, 0, 0])\n', (111, 207), True, 'import numpy as np\n'), ((215, 319), 'numpy.array'...
from sklearn.decomposition import IncrementalPCA import numpy as np class IPCAEstimator: def __init__(self, n_components): self.n_components = n_components self.whiten = False self.transformer = IncrementalPCA( n_components, whiten=self.whiten, batch_size=max(100, 5 * n_compone...
[ "numpy.sqrt" ]
[((937, 982), 'numpy.sqrt', 'np.sqrt', (['self.transformer.explained_variance_'], {}), '(self.transformer.explained_variance_)\n', (944, 982), True, 'import numpy as np\n')]
hlp = """ Datasets available at http://sci2s.ugr.es/keel/category.php?cat=reg """ import gzip from glob import glob from numpy import genfromtxt from os.path import join, realpath, dirname, basename KEEL_PATH = join(dirname(realpath(__file__)), "keel") KEEL_DATASETS = map(lambda p: basename(p), glob(join(KEEL...
[ "os.path.realpath", "os.path.join", "numpy.genfromtxt", "os.path.basename" ]
[((601, 672), 'numpy.genfromtxt', 'genfromtxt', (['fp'], {'delimiter': '""","""', 'skip_header': '(1)', 'dtype': 'float', 'comments': '"""@"""'}), "(fp, delimiter=',', skip_header=1, dtype=float, comments='@')\n", (611, 672), False, 'from numpy import genfromtxt\n'), ((234, 252), 'os.path.realpath', 'realpath', (['__fi...
import numpy as N from pebl import data from pebl.test import testfile class TestFileParsing: def setUp(self): self.data = data.fromfile(testfile('testdata1.txt')) self.expected_observations = N.array([[ 2.5, 0. , 1.7], [ 1.1, 1.7, 2.3]...
[ "numpy.dtype", "pebl.test.testfile", "pebl.data.Sample", "numpy.where", "numpy.array", "pebl.data.Variable" ]
[((215, 278), 'numpy.array', 'N.array', (['[[2.5, 0.0, 1.7], [1.1, 1.7, 2.3], [4.2, 999.3, 12.0]]'], {}), '([[2.5, 0.0, 1.7], [1.1, 1.7, 2.3], [4.2, 999.3, 12.0]])\n', (222, 278), True, 'import numpy as N\n'), ((425, 439), 'numpy.dtype', 'N.dtype', (['float'], {}), '(float)\n', (432, 439), True, 'import numpy as N\n'),...
#coding=utf-8 """Module for statistical test The function of this Module is served for statistical test. """ from scipy import stats import numpy as np import math import pandas as pd def Hosmer_Lemeshow_Test(bins_true, bins_pred, bins_tot, n_bins=10, in_sample=False): """Hosmer-Lemeshow Test for testing calibra...
[ "scipy.stats.chi2.sf", "numpy.abs", "statsmodels.stats.outliers_influence.variance_inflation_factor", "numpy.array", "numpy.dot", "statsmodels.tools.tools.add_constant" ]
[((1024, 1064), 'scipy.stats.chi2.sf', 'stats.chi2.sf', (['v_chi2', 'degree_of_freedom'], {}), '(v_chi2, degree_of_freedom)\n', (1037, 1064), False, 'from scipy import stats\n'), ((3104, 3127), 'numpy.array', 'np.array', (['[[1.0, -1.0]]'], {}), '([[1.0, -1.0]])\n', (3112, 3127), True, 'import numpy as np\n'), ((3876, ...
from sklearn.utils import check_random_state import numpy as np import logging __all__=['bootstrap'] #everything that will be imported by import *, like in __init__ def bootstrap(data, n_bootstraps=10000, user_statistic=lambda x:np.mean(x,axis=1), kwargs=None, pass_indices=False, random_state=1): """Compute boots...
[ "numpy.mean", "numpy.asarray", "sklearn.utils.check_random_state", "logging.warning" ]
[((1732, 1764), 'sklearn.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (1750, 1764), False, 'from sklearn.utils import check_random_state\n'), ((1776, 1792), 'numpy.asarray', 'np.asarray', (['data'], {}), '(data)\n', (1786, 1792), True, 'import numpy as np\n'), ((231, 249)...
import numpy as np import cv2 # ffttools async def fftd(img, backwards=False): # shape of img can be (m,n), (m,n,1) or (m,n,2) # in my test, fft provided by numpy and scipy are slower than cv2.dft return cv2.dft(np.float32(img), flags = ((cv2.DFT_INVERSE | cv2.DFT_SCALE) if backwards else cv2.DFT_COMPLEX_OUTPUT)) ...
[ "numpy.sum", "cv2.cvtColor", "numpy.float32", "numpy.zeros", "cv2.copyMakeBorder", "numpy.array", "numpy.exp", "cv2.minMaxLoc", "numpy.sqrt" ]
[((477, 503), 'numpy.zeros', 'np.zeros', (['a.shape', 'a.dtype'], {}), '(a.shape, a.dtype)\n', (485, 503), True, 'import numpy as np\n'), ((662, 688), 'numpy.zeros', 'np.zeros', (['a.shape', 'a.dtype'], {}), '(a.shape, a.dtype)\n', (670, 688), True, 'import numpy as np\n'), ((972, 1002), 'numpy.zeros', 'np.zeros', (['i...
import numpy as np from divHretention import DEFAULT_TIME, compute_c_max, compute_inventory, \ compute_surface_temperature class Exposition: """Object containing information regarding the exposure conditions based on an input file. An input file for **ITER** must have the following columns: "x" (...
[ "numpy.nan_to_num", "divHretention.compute_c_max", "numpy.genfromtxt", "numpy.ones", "divHretention.compute_inventory", "divHretention.compute_surface_temperature" ]
[((2094, 2141), 'divHretention.compute_surface_temperature', 'compute_surface_temperature', (['self.net_heat_flux'], {}), '(self.net_heat_flux)\n', (2121, 2141), False, 'from divHretention import DEFAULT_TIME, compute_c_max, compute_inventory, compute_surface_temperature\n'), ((2277, 2405), 'divHretention.compute_c_max...
# Copyright (c) Facebook, Inc. and its affiliates. from minihack.tiles import glyph2tile, MAXOTHTILE from nle.nethack import MAX_GLYPH import numpy as np import pkg_resources import pickle import os class GlyphMapper: """This class is used to map glyphs to rgb pixels.""" def __init__(self): self.til...
[ "numpy.concatenate", "pkg_resources.resource_filename" ]
[((546, 598), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""minihack"""', '"""tiles"""'], {}), "('minihack', 'tiles')\n", (577, 598), False, 'import pkg_resources\n'), ((1363, 1398), 'numpy.concatenate', 'np.concatenate', (['(cols, col)'], {'axis': '(1)'}), '((cols, col), axis=1)\n', (1377...
#!/usr/bin/python import sys # import nwb from nwb import nwb_file from nwb import nwb_utils as utils import numpy as np import h5py from sys import version_info import re import numpy as np # test creation of arrays with different number of dimensions. # This test made many to ensure consistency between data files #...
[ "nwb.nwb_file.open", "h5py.File", "numpy.array", "nwb.nwb_utils.create_identifier" ]
[((802, 840), 'nwb.nwb_utils.create_identifier', 'utils.create_identifier', (['"""String test"""'], {}), "('String test')\n", (825, 840), True, 'from nwb import nwb_utils as utils\n'), ((1024, 1049), 'nwb.nwb_file.open', 'nwb_file.open', ([], {}), '(**settings)\n', (1037, 1049), False, 'from nwb import nwb_file\n'), ((...
""" Class and functions for scene node """ from enum import Enum, unique import numpy as np from ..math.matrix import Matrix44 from ..math.transform import rotation_btw_vectors from ..geometry.colour import Colour from ..geometry.primitive import create_sphere, create_plane, create_cuboid from ..geometry.mesh import Bo...
[ "numpy.minimum", "numpy.maximum", "numpy.random.seed", "numpy.random.random", "numpy.arange", "numpy.array", "numpy.column_stack", "numpy.dot" ]
[((11974, 11999), 'numpy.array', 'np.array', (['[0.0, 1.0, 0.0]'], {}), '([0.0, 1.0, 0.0])\n', (11982, 11999), True, 'import numpy as np\n'), ((12014, 12062), 'numpy.dot', 'np.dot', (['(bounds.max - beam_source)', 'beam_direction'], {}), '(bounds.max - beam_source, beam_direction)\n', (12020, 12062), True, 'import nump...
import numpy as np from scipy import spatial class FormationControl(): """ Formation control primitive using region based shape control. Coded by: <NAME>, Date: 18/9/2019 """ def __init__(self): # Initialise the parameters return None def get_vel(self, j, curr_pos, min_dis, centro...
[ "numpy.maximum", "numpy.zeros", "numpy.max", "numpy.array", "numpy.linalg.norm", "scipy.spatial.KDTree", "numpy.dot" ]
[((820, 871), 'numpy.linalg.norm', 'np.linalg.norm', (['(curr_loc - peers_pos)'], {'axis': '(1)', 'ord': '(2)'}), '(curr_loc - peers_pos, axis=1, ord=2)\n', (834, 871), True, 'import numpy as np\n'), ((946, 981), 'numpy.maximum', 'np.maximum', (['(0)', '(g_lij / min_dis ** 2)'], {}), '(0, g_lij / min_dis ** 2)\n', (956...
import os import sys import json import datetime import numpy as np import skimage.draw from pathlib import Path import skimage.io import tensorflow as tf # os.environ["TF_MIN_GPU_MULTIPROCESSOR_COUNT"] = "4" os.environ["CUDA_VISIBLE_DEVICES"] = "0" with open('../../settings.json') as f: setting = json.load(f) #...
[ "sys.path.append", "json.load", "os.getcwd", "imgaug.augmenters.Fliplr", "numpy.array", "imgaug.augmenters.Multiply", "os.path.join" ]
[((362, 373), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (371, 373), False, 'import os\n'), ((394, 419), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (409, 419), False, 'import sys\n'), ((440, 483), 'os.path.join', 'os.path.join', (['"""../../"""', "setting['LOGS_DIR']"], {}), "('../../', ...
""" Author: <NAME> (<EMAIL>) Copyright © 2021, United States Government, as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved. The HybridQ: A Hybrid Simulator for Quantum Circuits platform is licensed under the Apache License, Version 2.0 (the "License"); you m...
[ "numpy.isin", "psutil.virtual_memory", "numpy.abs", "hybridq.circuit.Circuit", "hybridq.gate.Gate", "numpy.allclose", "numba.njit", "hybridq.circuit.utils.simplify", "collections.defaultdict", "hybridq.utils.globalize", "numpy.eye", "numpy.copy", "hybridq.circuit.utils.compress", "numpy.re...
[((1994, 2031), 'numba.njit', 'numba.njit', ([], {'fastmath': '(True)', 'cache': '(True)'}), '(fastmath=True, cache=True)\n', (2004, 2031), False, 'import numba\n'), ((34379, 34385), 'time.time', 'time', ([], {}), '()\n', (34383, 34385), False, 'from time import sleep, time\n'), ((38794, 38883), 'functools.partial', 'p...
#!/usr/bin/env python # -*- coding: utf-8 -*- #------------------------------------------------------ # @ File : mixup.py # @ Description: # @ Author : <NAME> # @ Contact : <EMAIL> # @ License : Copyright (c) 2017-2018 # @ Time : 2020/11/10 下午3:21 # @ Software : PyCharm #----------------------...
[ "torch.distributions.beta.Beta", "torch.randint", "numpy.random.beta", "torch.randn", "torch.randperm" ]
[((816, 864), 'torch.randperm', 'torch.randperm', (['batch_size'], {'device': 'images.device'}), '(batch_size, device=images.device)\n', (830, 864), False, 'import torch\n'), ((1168, 1211), 'torch.distributions.beta.Beta', 'torch.distributions.beta.Beta', (['alpha', 'alpha'], {}), '(alpha, alpha)\n', (1197, 1211), Fals...
from load import ROOT as R import gna.constructors as C import numpy as N from collections import OrderedDict from gna.bundle import * from scipy.interpolate import interp1d class reactor_anu_uncorr_v01(TransformationBundleLegacy): debug = False def __init__(self, *args, **kwargs): super(reactor_anu_u...
[ "collections.OrderedDict", "scipy.interpolate.interp1d", "gna.constructors.VarArray", "numpy.loadtxt" ]
[((445, 467), 'collections.OrderedDict', 'OrderedDict', ([], {'self': 'self'}), '(self=self)\n', (456, 467), False, 'from collections import OrderedDict\n'), ((536, 549), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (547, 549), False, 'from collections import OrderedDict\n'), ((1081, 1094), 'collections....
import numpy as np import pandas as pd from os import system, listdir from time import time from sys import exit from wikipedia import summary from re import sub from keras.models import load_model from keras.preprocessing.image import load_img, img_to_array from keras.applications.imagenet_utils import preprocess_inpu...
[ "keras.models.load_model", "pandas.DataFrame", "numpy.argmax", "pandas.read_csv", "os.system", "numpy.expand_dims", "keras.preprocessing.image.img_to_array", "keras.preprocessing.image.load_img", "numpy.max", "keras.applications.imagenet_utils.preprocess_input", "wikipedia.summary", "os.listdi...
[((508, 526), 'os.listdir', 'listdir', (['base_path'], {}), '(base_path)\n', (515, 526), False, 'from os import system, listdir\n'), ((626, 684), 'pandas.read_csv', 'pd.read_csv', (["(base_path + 'all_data_info.csv')"], {'dtype': 'object'}), "(base_path + 'all_data_info.csv', dtype=object)\n", (637, 684), True, 'import...
import cv2 from utils import helpers import numpy as np class Processing(object): # 输入一个config,image返回一个mask @staticmethod def process(image,config): def nms(input_image): ''' 非极大值抑制用于找寻mask连通区域最大的一块 输入: 原始图像 输出: 连通区域...
[ "cv2.contourArea", "numpy.uint8", "utils.helpers.reverse_one_hot", "cv2.cvtColor", "cv2.morphologyEx", "cv2.threshold", "numpy.zeros", "numpy.ones", "cv2.findContours" ]
[((1272, 1302), 'utils.helpers.reverse_one_hot', 'helpers.reverse_one_hot', (['image'], {}), '(image)\n', (1295, 1302), False, 'from utils import helpers\n'), ((515, 554), 'cv2.threshold', 'cv2.threshold', (['input_image', '(127)', '(255)', '(0)'], {}), '(input_image, 127, 255, 0)\n', (528, 554), False, 'import cv2\n')...
#!/usr/bin/env python # coding: utf8 # # Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES). # # This file is part of PANDORA # # https://github.com/CNES/Pandora_pandora # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. #...
[ "numpy.setdiff1d", "numpy.flip", "xarray.align", "numpy.argmax", "numpy.zeros", "pandora.img_tools.compute_std_raster", "numpy.isnan", "xarray.Dataset", "numpy.mod", "numpy.ones", "numpy.min", "numpy.where", "numpy.arange", "numpy.argmin", "xarray.where" ]
[((2230, 2262), 'numpy.isnan', 'np.isnan', (["cv['cost_volume'].data"], {}), "(cv['cost_volume'].data)\n", (2238, 2262), True, 'import numpy as np\n'), ((2829, 2919), 'xarray.Dataset', 'xr.Dataset', (["{'disparity_map': (['row', 'col'], disp)}"], {'coords': "{'row': row, 'col': col}"}), "({'disparity_map': (['row', 'co...
# =============================================================================================================== # Copyright (c) 2019, Cornell University. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that # the following conditions...
[ "os.mkdir", "lib.solve_perspective.solve_perspective", "lib.solve_affine.solve_affine", "os.path.join", "lib.gen_grid.gen_grid", "os.path.exists", "numpy.max", "pyquaternion.Quaternion", "numpy.linspace", "json.dump", "numpy.hstack", "numpy.min", "os.listdir", "json.load", "numpy.logical...
[((2617, 2651), 'os.path.join', 'os.path.join', (['work_dir', '"""aoi.json"""'], {}), "(work_dir, 'aoi.json')\n", (2629, 2651), False, 'import os\n'), ((3218, 3276), 'numpy.linspace', 'np.linspace', (['ul_northing', 'lr_northing', 'xy_axis_grid_points'], {}), '(ul_northing, lr_northing, xy_axis_grid_points)\n', (3229, ...
# -*- coding: utf-8 -*- r"""Data handling """ import copy import numbers import warnings import numpy as np from collections import OrderedDict from multiprocessing import cpu_count, Pool # @UnresolvedImport from .analysis import Analysis from .plot import PlotData def _call_bin_parallel(arg, **kwarg): r"""Wra...
[ "numpy.abs", "numpy.empty", "numpy.ones", "numpy.isnan", "multiprocessing.cpu_count", "numpy.meshgrid", "numpy.max", "numpy.linspace", "copy.deepcopy", "numpy.average", "scipy.interpolate.griddata", "multiprocessing.Pool", "numpy.delete", "numpy.concatenate", "numpy.all", "numpy.nanmax...
[((2328, 2341), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2339, 2341), False, 'from collections import OrderedDict\n'), ((3512, 3535), 'numpy.nanmax', 'np.nanmax', (['self.monitor'], {}), '(self.monitor)\n', (3521, 3535), True, 'import numpy as np\n'), ((3554, 3574), 'numpy.nanmax', 'np.nanmax', (['s...
import numpy as np import medpy.metric.binary as mmb import io_utils as io import data_utils import os def evaluate_mmwhs(data_dir, data_list, model, label_ids, id_to_ignore = 0): # Evaluation function # Instead of re-training the model and reporting mean/std based on different random seeds, instead we just...
[ "numpy.moveaxis", "numpy.random.seed", "numpy.copy", "io_utils.sample_batch", "numpy.std", "numpy.unique", "medpy.metric.binary.dc", "data_utils.preprocess_abdomen_ct", "numpy.mean", "numpy.array", "medpy.metric.binary.assd", "io_utils.get_consecutive_slices", "os.listdir", "numpy.vstack" ...
[((2717, 2739), 'numpy.mean', 'np.mean', (['dice_total_mu'], {}), '(dice_total_mu)\n', (2724, 2739), True, 'import numpy as np\n'), ((2760, 2782), 'numpy.mean', 'np.mean', (['assd_total_mu'], {}), '(assd_total_mu)\n', (2767, 2782), True, 'import numpy as np\n'), ((3080, 3105), 'numpy.random.seed', 'np.random.seed', (['...
""" Reads in current year's Arctic sea ice extent from Sea Ice Index 3 (NSIDC) and calculates the anomaly from the 1981-2010 median Website : ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/north/daily/data/ Author : <NAME> Date : 5 September 2016 """ ### Import modules import numpy as np import urllib.requ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylim", "numpy.ma.masked_less_equal", "numpy.genfromtxt", "urllib.request.urlopen", "matplotlib.pyplot.text", "numpy.append", "matplotlib.pyplot.figure", "numpy.where", "numpy.arange", "numpy....
[((453, 476), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (474, 476), False, 'import datetime\n'), ((804, 827), 'urllib.request.urlopen', 'UL.request.urlopen', (['url'], {}), '(url)\n', (822, 827), True, 'import urllib as UL\n'), ((838, 916), 'numpy.genfromtxt', 'np.genfromtxt', (['raw_data'], {...
#!/usr/bin/env python # coding: utf-8 # In[17]: from IPython.display import display, HTML import matplotlib.pyplot as plt import plotly import plotly.graph_objs as go from plotly.subplots import make_subplots from plotly.offline import init_notebook_mode,iplot import plotly.express as px from kaleido.scopes.plotly i...
[ "os.mkdir", "os.path.abspath", "numpy.copy", "warnings.filterwarnings", "plotly.graph_objs.Scatter", "pandas.merge", "kaleido.scopes.plotly.PlotlyScope", "os.path.exists", "IPython.display.display", "numpy.any", "numpy.arange", "re.search", "plotly.subplots.make_subplots", "plotly.graph_ob...
[((349, 383), 'plotly.offline.init_notebook_mode', 'init_notebook_mode', ([], {'connected': '(True)'}), '(connected=True)\n', (367, 383), False, 'from plotly.offline import init_notebook_mode, iplot\n'), ((400, 433), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (423, 433...
import pandas as pd import numpy as np import itertools import warnings import sys try: import matplotlib.pyplot as plt import seaborn as sns except ImportError: print('Importing hier_diff without matplotlib.') import scipy.cluster.hierarchy as sch from scipy.spatial import distance from scipy import stat...
[ "pandas.DataFrame", "numpy.sum", "adjustwithin.adjustnonnan", "numpy.random.seed", "warnings.simplefilter", "matplotlib.pyplot.axes", "scipy.spatial.distance.squareform", "numpy.asarray", "scipy.cluster.hierarchy.linkage", "numpy.zeros", "numpy.isnan", "matplotlib.pyplot.Rectangle", "numpy.a...
[((3972, 3993), 'pandas.DataFrame', 'pd.DataFrame', (['results'], {}), '(results)\n', (3984, 3993), True, 'import pandas as pd\n'), ((6762, 6809), 'matplotlib.pyplot.axes', 'plt.axes', (['(0.05, 0.07, 0.8, 0.8)'], {'facecolor': '"""w"""'}), "((0.05, 0.07, 0.8, 0.8), facecolor='w')\n", (6770, 6809), True, 'import matplo...
# Created byMartin.cz # Copyright (c) <NAME>. All rights reserved. import unittest import pero import numpy class TestCase(unittest.TestCase): """Test case for linear interpolator.""" def test_positive(self): """Tests whether interpolator works correctly for positive range.""" ...
[ "unittest.main", "pero.LinInterpol", "numpy.array" ]
[((7840, 7866), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (7853, 7866), False, 'import unittest\n'), ((337, 355), 'pero.LinInterpol', 'pero.LinInterpol', ([], {}), '()\n', (353, 355), False, 'import pero\n'), ((1121, 1139), 'pero.LinInterpol', 'pero.LinInterpol', ([], {}), '()\n',...
# utils.py # Author: <NAME> <<EMAIL>> """ This code contains utility functions that support the main functionality of the yuzu codebase. """ import time import numpy import torch import itertools as it try: import tensorflow as tf except: pass def perturbations(X_0): """Produce all edit-distance-one pe...
[ "numpy.zeros", "torch.tile", "numpy.array", "numpy.arange", "torch.no_grad", "torch.tensor", "torch.from_numpy" ]
[((1209, 1230), 'torch.from_numpy', 'torch.from_numpy', (['X_0'], {}), '(X_0)\n', (1225, 1230), False, 'import torch\n'), ((1270, 1296), 'torch.tile', 'torch.tile', (['X_0', '(n, 1, 1)'], {}), '(X_0, (n, 1, 1))\n', (1280, 1296), False, 'import torch\n'), ((2633, 2706), 'numpy.zeros', 'numpy.zeros', (['(n_seqs, n_choice...
import theano import theano.tensor as T import numpy as np from lasagne.updates import get_or_compute_grads from collections import OrderedDict def graves_rmsprop(loss_or_grads, params, learning_rate=1e-4, chi=0.95, alpha=0.9, epsilon=1e-4): r""" <NAME>' RMSProp [1]_. .. math :: n_{i} &= \chi * n...
[ "collections.OrderedDict", "theano.tensor.sqrt", "numpy.zeros", "lasagne.updates.get_or_compute_grads" ]
[((739, 782), 'lasagne.updates.get_or_compute_grads', 'get_or_compute_grads', (['loss_or_grads', 'params'], {}), '(loss_or_grads, params)\n', (759, 782), False, 'from lasagne.updates import get_or_compute_grads\n'), ((797, 810), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (808, 810), False, 'from collec...
# FitLib/Function.py # ---------------- # Module Docstring # ---------------- """ Core representations of functions and function parameters used by the Fitter class in the Fitter module. """ # ------- # Imports # ------- import warnings import numpy as np # --------------- # Parameter Class # --------------- ...
[ "numpy.shape", "warnings.warn", "numpy.asarray" ]
[((5306, 5337), 'numpy.asarray', 'np.asarray', (['x'], {'dtype': 'np.float64'}), '(x, dtype=np.float64)\n', (5316, 5337), True, 'import numpy as np\n'), ((5364, 5375), 'numpy.shape', 'np.shape', (['x'], {}), '(x)\n', (5372, 5375), True, 'import numpy as np\n'), ((2526, 2592), 'warnings.warn', 'warnings.warn', (['"""Par...
""" Copyright (c) 2019 Intel Corporation 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 wri...
[ "json.load", "numpy.maximum", "os.makedirs", "argparse.ArgumentParser", "numpy.minimum", "numpy.random.shuffle", "cv2.imwrite", "os.path.basename", "os.path.exists", "cv2.VideoCapture", "numpy.percentile", "numpy.min", "numpy.max", "numpy.round", "os.path.join", "os.listdir", "cv2.re...
[((7578, 7631), 'cv2.resize', 'cv2.resize', (['cropped_image', '(trg_size[1], trg_size[0])'], {}), '(cropped_image, (trg_size[1], trg_size[0]))\n', (7588, 7631), False, 'import cv2\n'), ((11313, 11329), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (11327, 11329), False, 'from argparse import ArgumentP...
## IMPORT PACKAGES print("---------------------------------------------------") print("Importing packages:\n") import os # Used to manipulate and create directory with python. print("os loaded") import tifffile # Save .tif files from numpy arrays print("tiffle loaded") from sk...
[ "matplotlib.pyplot.title", "os.mkdir", "numpy.meshgrid", "matplotlib.pyplot.show", "os.getcwd", "matplotlib.pyplot.imshow", "tifffile.imwrite", "numpy.shape", "imagej.init", "pathlib.Path", "numpy.arange", "matplotlib.pyplot.subplots", "skimage.io.imread" ]
[((722, 792), 'imagej.init', 'imagej.init', (["['sc.fiji:fiji:2.0.0-pre-10', 'net.imagej:imagej-legacy']"], {}), "(['sc.fiji:fiji:2.0.0-pre-10', 'net.imagej:imagej-legacy'])\n", (733, 792), False, 'import imagej\n'), ((1823, 1834), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1832, 1834), False, 'import os\n'), ((13063...
""" Dependencies: pip install opencv - python pip install astropy --no-deps fits_to_png.py Converts FITS files into PNGs. Can also make the PNGs into a video and delete the FITS after processing into PNGs. usage: fits_to_png.py [-h] [--video] [-d] [-v] fits_dir Author: <NAME> and <NAME> """ import matplotlib...
[ "os.remove", "cv2.VideoWriter", "argparse.ArgumentParser", "os.path.isdir", "astropy.io.fits.getdata", "matplotlib.pyplot.close", "os.path.dirname", "sys.exit", "numpy.shape", "cv2.imread", "matplotlib.pyplot.figure", "glob.glob", "matplotlib.pyplot.Axes", "os.path.join", "matplotlib.pyp...
[((842, 870), 'astropy.io.fits.getdata', 'fits.getdata', (['fits_fn'], {'ext': '(0)'}), '(fits_fn, ext=0)\n', (854, 870), False, 'from astropy.io import fits\n'), ((884, 898), 'numpy.shape', 'np.shape', (['data'], {}), '(data)\n', (892, 898), True, 'import numpy as np\n'), ((967, 979), 'matplotlib.pyplot.figure', 'plt....
#!/usr/bin/env python __author__ = '<NAME>' __date__ = '2020-03-13' __version__ = '0.0.1' import argparse import os import csv import random import numpy as np import pandas as pd import scrublet as scr import skimage.filters as skif import scanpy as sc import matplotlib.pyplot as plt import matplotlib.colors as col...
[ "numpy.random.seed", "argparse.ArgumentParser", "scanpy.read_10x_mtx", "plotnine.labs", "scanpy.read_10x_h5", "plotnine.aes", "pandas.DataFrame", "matplotlib.colors.to_rgba", "plotnine.geom_histogram", "skimage.filters.threshold_otsu", "matplotlib.pyplot.close", "plotnine.geom_vline", "plotn...
[((640, 663), 'random.seed', 'random.seed', (['seed_value'], {}), '(seed_value)\n', (651, 663), False, 'import random\n'), ((722, 748), 'numpy.random.seed', 'np.random.seed', (['seed_value'], {}), '(seed_value)\n', (736, 748), True, 'import numpy as np\n'), ((750, 776), 'seaborn.set', 'sns.set', ([], {'style': '"""whit...
# 091 # Create an array which contains five numbers (two of which # should be repeated). Display the whole array to the user. # Ask the user to enter one of the numbers from the array # and then display a message saying how many times that # number appears in the list. import array as ar import random import numpy as ...
[ "random.randint", "numpy.array", "array.array" ]
[((912, 925), 'array.array', 'ar.array', (['"""i"""'], {}), "('i')\n", (920, 925), True, 'import array as ar\n'), ((1412, 1440), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.int32'}), '([], dtype=np.int32)\n', (1420, 1440), True, 'import numpy as np\n'), ((992, 1014), 'random.randint', 'random.randint', (['(1)', '...
import numpy as np np.random.seed(777) import chainer from chainer import cuda from chainer import optimizers from chainer import serializers from tqdm import tqdm import argparse import csv import sys import os parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group() group.add_argument('--or...
[ "numpy.random.seed", "argparse.ArgumentParser", "numpy.clip", "numpy.random.randint", "sys.stdout.flush", "chainer.optimizers.NesterovAG", "chainer.serializers.save_hdf5", "numpy.identity", "sys.stderr.flush", "datetime.datetime.now", "chainer.datasets.get_mnist", "tqdm.tqdm", "csv.writer", ...
[((19, 38), 'numpy.random.seed', 'np.random.seed', (['(777)'], {}), '(777)\n', (33, 38), True, 'import numpy as np\n'), ((224, 249), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (247, 249), False, 'import argparse\n'), ((1585, 1613), 'chainer.datasets.get_mnist', 'chainer.datasets.get_mnist',...
''' Train PredNet on KITTI sequences. (Geiger et al. 2013, http://www.cvlibs.net/datasets/kitti/) ''' import os import numpy as np np.random.seed(123) from six.moves import cPickle from keras import backend as K from keras.models import Model from keras.layers import Input, Dense, Flatten from keras.layers import LST...
[ "os.mkdir", "numpy.random.seed", "keras.callbacks.LearningRateScheduler", "keras.backend.image_data_format", "keras.callbacks.ModelCheckpoint", "data_utils.SequenceGenerator", "keras.layers.Flatten", "numpy.expand_dims", "keras.models.Model", "numpy.ones", "prednet.PredNet", "os.path.exists", ...
[((132, 151), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (146, 151), True, 'import numpy as np\n'), ((880, 935), 'os.path.join', 'os.path.join', (['WEIGHTS_DIR', '"""prednet_kitti_weights.hdf5"""'], {}), "(WEIGHTS_DIR, 'prednet_kitti_weights.hdf5')\n", (892, 935), False, 'import os\n'), ((979, 1...
import matplotlib.pyplot as plt import numpy as np data_dir = '/home/abel/Documents/graphics/ADL/efficiency/' #num_frames_train = [1567, 2323, 3041, 3727, 4376, 4982, 5541, 6050, 6525, 6971] num_frames_train = [1.567, 2.323, 3.041, 3.727, 4.376, 4.982, 5.541, 6.050, 6.525, 6.971] num_frames_eval = [118, 112, 106,...
[ "matplotlib.pyplot.show", "numpy.arange", "numpy.linspace", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((490, 511), 'numpy.linspace', 'np.linspace', (['(5)', '(4)', '(10)'], {}), '(5, 4, 10)\n', (501, 511), True, 'import numpy as np\n'), ((591, 612), 'numpy.arange', 'np.arange', (['num_cycles'], {}), '(num_cycles)\n', (600, 612), True, 'import numpy as np\n'), ((653, 667), 'matplotlib.pyplot.subplots', 'plt.subplots', ...
from controller import read_metric, read_knob, set_knob, knob_set, init_knobs, load_workload, run_workload, calc_metric, restart_beaver_datanode from gpmodel import configuration_recommendation from datamodel import GPDataSet from settings import beaver_broker_ip, beaver_broker_port, target_knob_set, target_metric_name...
[ "pickle.dump", "controller.read_knob", "numpy.zeros", "datamodel.GPDataSet", "time.time", "controller.set_knob", "gpmodel.configuration_recommendation", "controller.restart_beaver_datanode", "controller.init_knobs", "controller.read_metric", "controller.calc_metric" ]
[((419, 430), 'datamodel.GPDataSet', 'GPDataSet', ([], {}), '()\n', (428, 430), False, 'from datamodel import GPDataSet\n'), ((449, 461), 'controller.init_knobs', 'init_knobs', ([], {}), '()\n', (459, 461), False, 'from controller import read_metric, read_knob, set_knob, knob_set, init_knobs, load_workload, run_workloa...
import numpy as np dummy_points = np.array([ [4, -1, 3], # 0 [1, -3, 0], # 1 [-2, 0, -6], # 2 [0, 0, 0], # 3 [-3, -2, -5], # 4 [-3, -1, 8], # 5 [-4, -2, 3], # 6 [4, 0, 1], # 7 [-2, 1, 1], # 8 [4, 1, 6], # 9 [-4, 4, -1], # 10 [-5, 3, 3], # 11 [-1, 3, 2], # ...
[ "numpy.array" ]
[((36, 244), 'numpy.array', 'np.array', (['[[4, -1, 3], [1, -3, 0], [-2, 0, -6], [0, 0, 0], [-3, -2, -5], [-3, -1, 8],\n [-4, -2, 3], [4, 0, 1], [-2, 1, 1], [4, 1, 6], [-4, 4, -1], [-5, 3, 3],\n [-1, 3, 2], [2, -3, -5]]'], {'dtype': 'np.float64'}), '([[4, -1, 3], [1, -3, 0], [-2, 0, -6], [0, 0, 0], [-3, -2, -5], ...
#! /usr/bin/python3 import sys import argparse import logging import numpy as np def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("--exp", type=float, help="Exponent for smoothing", required=True) args = parser.parse_args() return args def main(): args = parse_args(...
[ "sys.stdout.write", "logging.debug", "argparse.ArgumentParser", "logging.basicConfig", "numpy.asarray" ]
[((116, 141), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (139, 141), False, 'import argparse\n'), ((327, 367), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (346, 367), False, 'import logging\n'), ((372, 391), 'logging.debug', 'lo...
""" sepp_base ~~~~~~~~~ A more abstract approach to SEPP type algorithms. """ from . import predictors from . import logger as _ocp_logger from . import data as _ocp_data import numpy as _np import datetime as _datetime import logging as _logging _logger = _logging.getLogger(__name__) class ModelBase(): """Inte...
[ "numpy.sum", "numpy.empty", "numpy.argsort", "numpy.mean", "numpy.arange", "numpy.cumsum", "numpy.max", "datetime.timedelta", "numpy.linspace", "numpy.random.choice", "numpy.ceil", "numpy.floor_divide", "numpy.asarray", "numpy.diag_indices", "numpy.sort", "numpy.all", "numpy.log", ...
[((260, 288), 'logging.getLogger', '_logging.getLogger', (['__name__'], {}), '(__name__)\n', (278, 288), True, 'import logging as _logging\n'), ((12869, 12886), 'numpy.zeros', '_np.zeros', (['(d, d)'], {}), '((d, d))\n', (12878, 12886), True, 'import numpy as _np\n'), ((13427, 13445), 'numpy.any', '_np.any', (['(norm =...
#!/usr/bin/env python import argparse import numpy as np import csv import time import sys import glob import os import matplotlib.pyplot as plt import datetime """IMPORTANT""" # NOTE: this script assumes it is run in Diagnostics/python/ # So it does NOT need to be in carla's PythonAPI, but it DOES need # the CARLA_...
[ "matplotlib.pyplot.title", "argparse.ArgumentParser", "matplotlib.pyplot.figure", "numpy.mean", "carla.Client", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.tight_layout", "os.path.join", "sys.path.append", "matplotlib.pyplot.close", "matplotlib.pyplot.yticks", "os.path.exists", "matp...
[((440, 464), 'os.path.exists', 'os.path.exists', (['dir_path'], {}), '(dir_path)\n', (454, 464), False, 'import os\n'), ((1153, 1191), 'numpy.array', 'np.array', (['x[trim[0]:max_len - trim[1]]'], {}), '(x[trim[0]:max_len - trim[1]])\n', (1161, 1191), True, 'import numpy as np\n'), ((1202, 1240), 'numpy.array', 'np.ar...
import numpy as np from sklearn import linear_model from dowhy.causal_estimator import CausalEstimate from dowhy.causal_estimator import CausalEstimator class LinearRegressionEstimator(CausalEstimator): """Compute effect of treatment using linear regression. The coefficient of the treatment variable in the ...
[ "sklearn.linear_model.LinearRegression", "dowhy.causal_estimator.CausalEstimate", "numpy.concatenate" ]
[((1185, 1253), 'numpy.concatenate', 'np.concatenate', (['(treatment_2d, self._observed_common_causes)'], {'axis': '(1)'}), '((treatment_2d, self._observed_common_causes), axis=1)\n', (1199, 1253), True, 'import numpy as np\n'), ((1304, 1335), 'sklearn.linear_model.LinearRegression', 'linear_model.LinearRegression', ([...
from .enums import CitySize, AreaKind import numpy as np class OkumuraHata: def __init__( self, frequency, transmitter_height, receiver_height, city_size, area_kind, ): self.frequency = frequency self.transmitter_height = transmitter_height self.receiver_height = ...
[ "numpy.log10" ]
[((924, 948), 'numpy.log10', 'np.log10', (['self.frequency'], {}), '(self.frequency)\n', (932, 948), True, 'import numpy as np\n'), ((982, 1015), 'numpy.log10', 'np.log10', (['self.transmitter_height'], {}), '(self.transmitter_height)\n', (990, 1015), True, 'import numpy as np\n'), ((1090, 1108), 'numpy.log10', 'np.log...
"""Hourly temperature frequencies.""" import datetime import calendar from collections import OrderedDict import numpy as np from pandas.io.sql import read_sql import matplotlib.colors as mpcolors from pyiem.plot.use_agg import plt from pyiem.util import get_autoplot_context, get_dbconn from pyiem.exceptions import No...
[ "pandas.io.sql.read_sql", "pyiem.plot.use_agg.plt.get_cmap", "matplotlib.colors.BoundaryNorm", "numpy.zeros", "datetime.datetime.now", "datetime.datetime", "pyiem.exceptions.NoDataFound", "numpy.arange", "collections.OrderedDict", "pyiem.plot.use_agg.plt.subplots", "pyiem.util.get_dbconn" ]
[((420, 555), 'collections.OrderedDict', 'OrderedDict', (["(('tmpf', 'Air Temperature'), ('dwpf', 'Dew Point Temp'), ('feel',\n 'Feels Like Temp'), ('relh', 'Relative Humidity'))"], {}), "((('tmpf', 'Air Temperature'), ('dwpf', 'Dew Point Temp'), (\n 'feel', 'Feels Like Temp'), ('relh', 'Relative Humidity')))\n",...
import torch import pymesh import numpy as np import torch.nn as nn from torch.autograd import Variable from neuralnet_pytorch.metrics import emd_loss '''Utility Classes''' def emd_wrapper(pc1, pc2): return emd_loss(pc1, pc2, reduce='sum', sinkhorn=True) class Template(object): def get_random_points(self):...
[ "torch.from_numpy", "pymesh.form_mesh", "pymesh.generate_icosphere", "torch.autograd.Variable", "torch.cuda.FloatTensor", "torch.mm", "neuralnet_pytorch.metrics.emd_loss", "numpy.array", "torch.pow", "torch.sum", "numpy.sqrt" ]
[((215, 262), 'neuralnet_pytorch.metrics.emd_loss', 'emd_loss', (['pc1', 'pc2'], {'reduce': '"""sum"""', 'sinkhorn': '(True)'}), "(pc1, pc2, reduce='sum', sinkhorn=True)\n", (223, 262), False, 'from neuralnet_pytorch.metrics import emd_loss\n'), ((3936, 3963), 'torch.mm', 'torch.mm', (['ans', 'pc_proto_mat'], {}), '(an...
import argparse import json import numpy as np import os import pickle from imagernn.imagernn_utils import decodeGenerator """ This script is used to predict sentences for arbitrary images that are located in a folder we call root_folder. It is assumed that the root_folder contains: - the raw images - a file tasks.tx...
[ "numpy.load", "argparse.ArgumentParser", "json.dumps", "imagernn.imagernn_utils.decodeGenerator", "os.path.join" ]
[((1415, 1464), 'os.path.join', 'os.path.join', (['root_path', '"""self_img_vgg_feats.npy"""'], {}), "(root_path, 'self_img_vgg_feats.npy')\n", (1427, 1464), False, 'import os\n'), ((1532, 1554), 'numpy.load', 'np.load', (['features_path'], {}), '(features_path)\n', (1539, 1554), True, 'import numpy as np\n'), ((1717, ...
#! /usr/bin/env python3 # Copyright (c) 2021 Grumpy Cat Software S.L. # # This Source Code is licensed under the MIT 2.0 license. # the terms can be found in LICENSE.md at the root of # this project, or at http://mozilla.org/MPL/2.0/. # %% from entsoe import EntsoePandasClient, Area import pandas as pd import numpy a...
[ "pandas.Timestamp", "numpy.savetxt", "entsoe.EntsoePandasClient", "os.path.join" ]
[((345, 380), 'entsoe.EntsoePandasClient', 'EntsoePandasClient', ([], {'api_key': '"""<KEY>"""'}), "(api_key='<KEY>')\n", (363, 380), False, 'from entsoe import EntsoePandasClient, Area\n'), ((563, 612), 'pandas.Timestamp', 'pd.Timestamp', (['f"""{year}0101"""'], {'tz': '"""Europe/Brussels"""'}), "(f'{year}0101', tz='E...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
[ "logging.FileHandler", "os.makedirs", "random.uniform", "random.randint", "logging.StreamHandler", "tinyms.Tensor", "os.path.exists", "datetime.datetime.now", "time.time", "logging.Formatter", "numpy.array", "mindspore.train.serialization.load_checkpoint", "os.path.join", "mindspore.train....
[((1406, 1443), 'os.path.join', 'os.path.join', (['args.outputs_dir', '"""log"""'], {}), "(args.outputs_dir, 'log')\n", (1418, 1443), False, 'import os\n'), ((1468, 1506), 'os.path.join', 'os.path.join', (['args.outputs_dir', '"""imgs"""'], {}), "(args.outputs_dir, 'imgs')\n", (1480, 1506), False, 'import os\n'), ((153...
# -*- coding: utf-8 -*- """ Created on Fri Oct 23 17:34:29 2020 @author: <NAME> """ import numpy as np from scipy.stats import beta import matplotlib.pyplot as plt import Organization as og fig, ax = plt.subplots(1, 1,dpi=300) mu = np.arange(0.1,1,0.2) phi = 15 n = 1000 a = np.zeros(len(mu)) b = np.zeros(len(mu)) ...
[ "matplotlib.pyplot.show", "numpy.arange", "numpy.linspace", "Organization.beta", "matplotlib.pyplot.subplots", "scipy.stats.beta.pdf" ]
[((204, 231), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {'dpi': '(300)'}), '(1, 1, dpi=300)\n', (216, 231), True, 'import matplotlib.pyplot as plt\n'), ((236, 258), 'numpy.arange', 'np.arange', (['(0.1)', '(1)', '(0.2)'], {}), '(0.1, 1, 0.2)\n', (245, 258), True, 'import numpy as np\n'), ((324, 352...
import hes_inference import numpy as np protein_at_observations = np.zeros((50,2)) protein_at_observations[:,0] = np.arange(0,15*50,15) protein_at_observations[:,1] = np.arange(0,500*50,500) model_parameters = np.array([10000,4,np.log(2)/30,np.log(2)/90,1,1,15]) measurement_variance = 100**2 hes_inference.kalman_fil...
[ "numpy.log", "numpy.zeros", "numpy.arange", "hes_inference.kalman_filter" ]
[((67, 84), 'numpy.zeros', 'np.zeros', (['(50, 2)'], {}), '((50, 2))\n', (75, 84), True, 'import numpy as np\n'), ((115, 140), 'numpy.arange', 'np.arange', (['(0)', '(15 * 50)', '(15)'], {}), '(0, 15 * 50, 15)\n', (124, 140), True, 'import numpy as np\n'), ((168, 195), 'numpy.arange', 'np.arange', (['(0)', '(500 * 50)'...
import numpy as np from gate import * from layer import * from output import * class Model: def __init__(self, layers_dim): self.b = [] self.W = [] for i in range(len(layers_dim)-1): self.W.append(np.random.randn(layers_dim[i], layers_dim[i+1]) / np.sqrt(layers_dim[i])) ...
[ "numpy.random.randn", "numpy.sqrt", "numpy.argmax" ]
[((1201, 1225), 'numpy.argmax', 'np.argmax', (['probs'], {'axis': '(1)'}), '(probs, axis=1)\n', (1210, 1225), True, 'import numpy as np\n'), ((239, 288), 'numpy.random.randn', 'np.random.randn', (['layers_dim[i]', 'layers_dim[i + 1]'], {}), '(layers_dim[i], layers_dim[i + 1])\n', (254, 288), True, 'import numpy as np\n...
import cv2 import numpy as np from Functions import imgproc_func as fnc img = np.zeros((300,512,3), np.uint8) fnc.define_trackbar('R', 'colors', (0, 255)) fnc.define_trackbar('G', 'colors', (0, 255)) fnc.define_trackbar('B', 'colors', (0, 255)) while (1): cv2.imshow('image', img) k = cv2.waitKey(1) if k...
[ "cv2.waitKey", "Functions.imgproc_func.retrieve_trackbar", "numpy.zeros", "Functions.imgproc_func.define_trackbar", "cv2.imshow" ]
[((80, 113), 'numpy.zeros', 'np.zeros', (['(300, 512, 3)', 'np.uint8'], {}), '((300, 512, 3), np.uint8)\n', (88, 113), True, 'import numpy as np\n'), ((113, 157), 'Functions.imgproc_func.define_trackbar', 'fnc.define_trackbar', (['"""R"""', '"""colors"""', '(0, 255)'], {}), "('R', 'colors', (0, 255))\n", (132, 157), Tr...
# -*- coding:utf-8 -*- import numpy as np import random class SVM: def __init__(self, kernel='rbf', C=10.0, gamma=0.5, p=2): ''' kernel: rbf 高斯核函数 linear 线性核函数 polynomial 多项式 C: penalty term 惩罚因子 gammar: hyperparameter of rbf/polynomial kernel 用于 rbf/polynomial 的超参数 p:...
[ "numpy.sum", "numpy.multiply", "numpy.argmax", "numpy.asarray", "numpy.zeros", "numpy.argmin", "numpy.shape", "numpy.where", "numpy.asmatrix", "numpy.arange", "numpy.linalg.norm", "numpy.dot", "numpy.random.shuffle" ]
[((1151, 1165), 'numpy.asmatrix', 'np.asmatrix', (['x'], {}), '(x)\n', (1162, 1165), True, 'import numpy as np\n'), ((1189, 1202), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (1199, 1202), True, 'import numpy as np\n'), ((1240, 1262), 'numpy.shape', 'np.shape', (['self.train_x'], {}), '(self.train_x)\n', (1248...
import numpy as np import tensorflow as tf import FilterDetections as fd # dimension of this array is # (batch size, num boxes, 4) boxes = np.array( # boxes [ # 4 coords [0, 0, 1, 1], [0.5, 0.5, 0.6, 0.6], [0.1, 0.1, 0.6, 0.6], ], "float32" ) scores = np...
[ "FilterDetections.filter_by_score_and_nms", "numpy.array", "tensorflow.compat.v1.Session" ]
[((141, 220), 'numpy.array', 'np.array', (['[[0, 0, 1, 1], [0.5, 0.5, 0.6, 0.6], [0.1, 0.1, 0.6, 0.6]]', '"""float32"""'], {}), "([[0, 0, 1, 1], [0.5, 0.5, 0.6, 0.6], [0.1, 0.1, 0.6, 0.6]], 'float32')\n", (149, 220), True, 'import numpy as np\n'), ((318, 354), 'numpy.array', 'np.array', (['[0.6, 0.2, 0.1]', '"""float32...
# Collection of scripts developed to implent the # Dressler-Schectamn Test (Dressler & Shectman, 1988) # in a cluster of galaxies # Section dedicated to import python modules import numpy as np from astropy.stats import biweight_scale # Section dedicated to importing the modules from CALSAGOS from . import utils fro...
[ "numpy.sum", "numpy.std", "numpy.zeros", "numpy.argsort", "numpy.random.randint", "numpy.array", "numpy.where", "astropy.stats.biweight_scale", "numpy.sqrt" ]
[((3454, 3467), 'numpy.zeros', 'np.zeros', (['dim'], {}), '(dim)\n', (3462, 3467), True, 'import numpy as np\n'), ((3514, 3527), 'numpy.zeros', 'np.zeros', (['dim'], {}), '(dim)\n', (3522, 3527), True, 'import numpy as np\n'), ((3576, 3589), 'numpy.zeros', 'np.zeros', (['dim'], {}), '(dim)\n', (3584, 3589), True, 'impo...
import numpy as np from skimage.io import imread, imsave import glob, os, tqdm from imagej_fun import imagej_metadata_tags, make_lut from skimage.filters import threshold_otsu from skimage.measure import label from skimage import img_as_uint import pandas as pd import matplotlib.pyplot as plt #########################...
[ "pandas.DataFrame", "tqdm.tqdm", "numpy.sum", "os.path.basename", "os.path.dirname", "numpy.zeros", "numpy.max", "numpy.array", "os.path.splitext", "os.path.join", "numpy.prod" ]
[((675, 701), 'os.path.basename', 'os.path.basename', (['flist[0]'], {}), '(flist[0])\n', (691, 701), False, 'import glob, os, tqdm\n'), ((718, 743), 'os.path.dirname', 'os.path.dirname', (['flist[0]'], {}), '(flist[0])\n', (733, 743), False, 'import glob, os, tqdm\n'), ((1004, 1036), 'numpy.array', 'np.array', (['[(0....
""" Generic tools for distributing computationally intensive tasks across multiple threads. """ import os import numpy as np import shutil from tempfile import mkdtemp import multiprocessing as mp from tqdm import tqdm from hylite import HyCloud, HyImage from hylite import io def _split(data, nchunks): """ S...
[ "hylite.io.loadCloudPLY", "os.path.join", "numpy.floor", "hylite.io.loadWithGDAL", "os.cpu_count", "tempfile.mkdtemp", "shutil.rmtree", "multiprocessing.Process", "hylite.io.saveWithGDAL", "hylite.io.saveCloudPLY", "numpy.vstack" ]
[((2673, 2708), 'numpy.vstack', 'np.vstack', (['[c.data for c in chunks]'], {}), '([c.data for c in chunks])\n', (2682, 2708), True, 'import numpy as np\n'), ((5899, 5908), 'tempfile.mkdtemp', 'mkdtemp', ([], {}), '()\n', (5906, 5908), False, 'from tempfile import mkdtemp\n'), ((2975, 3009), 'numpy.vstack', 'np.vstack'...
from pyspark import SparkContext,SparkConf import numpy as np conf = SparkConf() conf.set('master','spark://hadoop-maste:7077') context = SparkContext(conf=conf) acc = context.accumulator(0) print(type(acc),acc.value) rdd = context.parallelize(np.arange(101),5) def acc_add(a): acc.add(a) return a rdd2 = rdd.map(acc_a...
[ "pyspark.SparkContext", "pyspark.SparkConf", "numpy.arange" ]
[((69, 80), 'pyspark.SparkConf', 'SparkConf', ([], {}), '()\n', (78, 80), False, 'from pyspark import SparkContext, SparkConf\n'), ((138, 161), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(conf=conf)\n', (150, 161), False, 'from pyspark import SparkContext, SparkConf\n'), ((244, 258), 'numpy.arange...
#!/usr/bin/env python # -*- coding: utf-8 -*- # <NAME> <<EMAIL>> <https://hanxiao.github.io> import multiprocessing import os import sys import threading import time import uuid from collections import defaultdict from datetime import datetime from multiprocessing import Process from multiprocessing.pool import Pool i...
[ "GPUtil.getGPUs", "tensorflow.__version__.split", "collections.defaultdict", "tensorflow.ConfigProto", "zmq.Poller", "os.path.join", "zmq.Context", "tensorflow.python.estimator.model_fn.EstimatorSpec", "os.path.exists", "zmq.utils.jsonapi.loads", "multiprocessing.pool.Pool", "multiprocessing.E...
[((711, 736), 'tensorflow.__version__.split', 'tf.__version__.split', (['"""."""'], {}), "('.')\n", (731, 736), True, 'import tensorflow as tf\n'), ((2665, 2678), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (2676, 2678), False, 'import zmq\n'), ((8432, 8455), 'multiprocessing.Event', 'multiprocessing.Event', ([], {...
import keras from resnet152 import Scale from keras.models import load_model from keras.utils.generic_utils import CustomObjectScope import math import sys import argparse import numpy as np import scipy.io as sio import os import glob import h5py import cv2 import gc ''' This code is based on <NAME>., <NAME>., & Arg...
[ "math.isnan", "numpy.zeros_like", "cv2.cartToPolar", "argparse.ArgumentParser", "math.isinf", "cv2.cvtColor", "cv2.VideoCapture", "cv2.calcOpticalFlowFarneback", "cv2.normalize", "cv2.destroyAllWindows", "os.path.join", "os.listdir" ]
[((4997, 5063), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Do feature extraction tasks"""'}), "(description='Do feature extraction tasks')\n", (5020, 5063), False, 'import argparse\n'), ((1734, 1757), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video'], {}), '(video)\n', (1750, 1757),...
import numpy as np def load_data(): data = np.loadtxt('input.csv', dtype='int32', delimiter=',') return data def main(): data = load_data() data[1] = 12 data[2] = 2 index = 0 while(True): cmd = data[index * 4] if cmd == 99: break else: in1 = data[index*4 + 1] val1 = data[in...
[ "numpy.loadtxt" ]
[((46, 99), 'numpy.loadtxt', 'np.loadtxt', (['"""input.csv"""'], {'dtype': '"""int32"""', 'delimiter': '""","""'}), "('input.csv', dtype='int32', delimiter=',')\n", (56, 99), True, 'import numpy as np\n')]
import numpy as np from numpy.linalg import inv import matplotlib.pyplot as plt def x_to_phi(x): # get x and generate the corresponding 6-dim vector phi(x) phi = np.array([1, x, x**2, x**3, x**4, x**5]) return phi def generate_y(x, th, s_n, m_n): # generate a y for a specific x # use the true mod...
[ "matplotlib.pyplot.title", "numpy.random.uniform", "numpy.random.seed", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "numpy.zeros", "numpy.identity", "numpy.array", "numpy.linalg.inv", "numpy.random.normal", "numpy.linspace", "matplotlib.pyplot.errorbar" ]
[((997, 1014), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1011, 1014), True, 'import numpy as np\n'), ((1028, 1066), 'numpy.array', 'np.array', (['[0.2, -1, 0.9, 0.7, 0, -0.2]'], {}), '([0.2, -1, 0.9, 0.7, 0, -0.2])\n', (1036, 1066), True, 'import numpy as np\n'), ((172, 220), 'numpy.array', 'np.ar...
"""Furcifar Utility Modul This module contains functions for visualisation, logging and progress output during the preprocessing of whole-slide images of the CAMELYON data sets. """ from collections import namedtuple from datetime import datetime import fnmatch import logging import numpy as np import os from PIL imp...
[ "numpy.dstack", "PIL.Image.new", "numpy.count_nonzero", "os.path.join", "numpy.asarray", "os.walk", "PIL.Image.fromarray", "PIL.ImageFont.truetype", "collections.namedtuple", "PIL.ImageDraw.Draw", "datetime.datetime.now", "fnmatch.fnmatch", "numpy.unique" ]
[((426, 452), 'collections.namedtuple', 'namedtuple', (['"""Point"""', '"""x y"""'], {}), "('Point', 'x y')\n", (436, 452), False, 'from collections import namedtuple\n'), ((1662, 1675), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (1669, 1675), False, 'import os\n'), ((2688, 2720), 'PIL.Image.new', 'Image.new', (...
import matplotlib.pyplot as plt from matplotlib import rc import numpy as np import os import seaborn if __name__ == "__main__": seaborn.set() seaborn.set_style("ticks") seaborn.set_context("paper") rc('text', usetex=True) rc('font', **{'family':'serif', 'serif':['Times New Roman]']}) # Train...
[ "os.listdir", "seaborn.set_style", "matplotlib.rc", "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "seaborn.despine", "seaborn.set", "seaborn.set_context", "matplotlib.pyplot.savefig" ]
[((135, 148), 'seaborn.set', 'seaborn.set', ([], {}), '()\n', (146, 148), False, 'import seaborn\n'), ((153, 179), 'seaborn.set_style', 'seaborn.set_style', (['"""ticks"""'], {}), "('ticks')\n", (170, 179), False, 'import seaborn\n'), ((184, 212), 'seaborn.set_context', 'seaborn.set_context', (['"""paper"""'], {}), "('...
import os import cv2 import numpy as np from enum import Enum import pickle from tfci import compress, decompress from functools import partial from statistics import mean from skimage.metrics import structural_similarity as ssim from skimage.metrics import mean_squared_error as mse from skimage.metrics import peak_sig...
[ "functools.partial", "tfci.decompress", "numpy.abs", "cv2.imwrite", "numpy.float32", "skimage.metrics.mean_squared_error", "cv2.imread", "numpy.min", "skimage.metrics.structural_similarity", "numpy.mean", "numpy.max", "statistics.mean", "tfci.compress", "cv2.normalize", "skimage.metrics....
[((451, 490), 'skimage.metrics.structural_similarity', 'ssim', (['imageA', 'imageB'], {'multichannel': '(True)'}), '(imageA, imageB, multichannel=True)\n', (455, 490), True, 'from skimage.metrics import structural_similarity as ssim\n'), ((505, 524), 'skimage.metrics.mean_squared_error', 'mse', (['imageA', 'imageB'], {...
##################### ##################### ## ## ## Copyright (C) ## ## <NAME> ## ## 2017-2018 ## ## ## ##################### ##################### """ Here are the notes referenced by the code. 1. To retrieve the original score, use the logit (inverse sigmoi...
[ "keras.models.load_model", "math.exp", "keras.optimizers.SGD", "chess.pgn.read_game", "keras.layers.Activation", "keras.layers.Dropout", "time.time", "keras.backend.log", "keras.layers.Dense", "sys.stdout.flush", "numpy.array", "evalp.evaluate" ]
[((4865, 4941), 'keras.optimizers.SGD', 'SGD', ([], {'lr': 'LEARNING_RATE', 'decay': 'DECAY', 'momentum': 'MOMENTUM', 'nesterov': 'USE_NESTEROV'}), '(lr=LEARNING_RATE, decay=DECAY, momentum=MOMENTUM, nesterov=USE_NESTEROV)\n', (4868, 4941), False, 'from keras.optimizers import SGD\n'), ((2118, 2144), 'keras.models.load...
# Template by <NAME> # Spring 2015 # CS 251 Project 8 # # Classifier class and child definitions import sys import data import analysis as an import numpy as np import scipy.cluster.vq as vq import sklearn.metrics as cm class Classifier: def __init__(self, type): '''The parent Classifier class stores on...
[ "numpy.matrix", "numpy.sum", "numpy.argmax", "numpy.square", "numpy.zeros", "numpy.argmin", "numpy.sort", "numpy.mean", "numpy.array", "numpy.arange", "scipy.cluster.vq.kmeans2", "sklearn.metrics.confusion_matrix", "numpy.var" ]
[((912, 952), 'sklearn.metrics.confusion_matrix', 'cm.confusion_matrix', (['truecats', 'classcats'], {}), '(truecats, classcats)\n', (931, 952), True, 'import sklearn.metrics as cm\n'), ((3192, 3239), 'numpy.zeros', 'np.zeros', (['(self.num_classes, self.num_features)'], {}), '((self.num_classes, self.num_features))\n'...
''' 本库用于科学计算和快速建模 maysics主要包括十三个模块: 1、algorithm 封装了几种模拟方法,用于简易模拟; 2、calculus 封装了部分常见的算符算子和积分方法,辅助数学运算; 3、constant 储存了部分常数; 4、equation 封装了部分方程求解运算; 5、explainer 用于评估和解释模型; 6、graph 用于图论分析; 7、imageprocess 用于数字图像处理; 8、models 封装了几种常用的模型以便快速构建数理模型; 9、preprocess 用于数据预处理; 10、stats 用于统计分析; 11、tprocess 用于处理时间数据; 12、transformati...
[ "pickle.dump", "numpy.save", "numpy.load", "csv.reader", "csv.writer", "numpy.zeros", "numpy.flipud", "numpy.fliplr", "pickle.load", "numpy.array" ]
[((1947, 1958), 'numpy.array', 'np.array', (['a'], {}), '(a)\n', (1955, 1958), True, 'import numpy as np\n'), ((1999, 2010), 'numpy.array', 'np.array', (['b'], {}), '(b)\n', (2007, 2010), True, 'import numpy as np\n'), ((2785, 2796), 'numpy.array', 'np.array', (['a'], {}), '(a)\n', (2793, 2796), True, 'import numpy as ...
import numpy as np from unittest import TestCase from diffprivlib.tools.histograms import histogramdd from diffprivlib.utils import global_seed, PrivacyLeakWarning class TestHistogramdd(TestCase): def test_no_params(self): a = np.array([1, 2, 3, 4, 5]) with self.assertWarns(PrivacyLeakWarning): ...
[ "diffprivlib.utils.global_seed", "numpy.histogramdd", "numpy.array", "diffprivlib.tools.histograms.histogramdd" ]
[((242, 267), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (250, 267), True, 'import numpy as np\n'), ((428, 453), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (436, 453), True, 'import numpy as np\n'), ((627, 652), 'numpy.array', 'np.array', (['[1, 2, 3, ...
import numpy as np from periodicity.core import TSeries from periodicity.spectral import GLS def test_gls_default_frequency_grid(): t0 = 2.5 ts = 0.1 fs = 1 / ts f0 = 1 / t0 time = np.arange(0, t0 + ts, ts) signal = TSeries(time) gls = GLS(n=1) ls = gls(signal) freq = ls.frequency...
[ "periodicity.spectral.GLS", "numpy.diff", "numpy.arange", "periodicity.core.TSeries", "numpy.round" ]
[((204, 229), 'numpy.arange', 'np.arange', (['(0)', '(t0 + ts)', 'ts'], {}), '(0, t0 + ts, ts)\n', (213, 229), True, 'import numpy as np\n'), ((243, 256), 'periodicity.core.TSeries', 'TSeries', (['time'], {}), '(time)\n', (250, 256), False, 'from periodicity.core import TSeries\n'), ((267, 275), 'periodicity.spectral.G...
import os import glob import tensorflow as tf from sklearn.model_selection import KFold from sklearn.metrics import accuracy_score from sklearn.linear_model import LogisticRegression from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.metrics import precision_recall_fsco...
[ "numpy.stack", "numpy.random.seed", "sklearn.preprocessing.StandardScaler", "numpy.sum", "numpy.argmax", "numpy.std", "tensorflow.keras.models.load_model", "numpy.expand_dims", "sklearn.model_selection.KFold", "sklearn.linear_model.LogisticRegression", "numpy.mean", "sklearn.decomposition.PCA"...
[((370, 387), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (384, 387), True, 'import numpy as np\n'), ((4517, 4542), 'numpy.argmax', 'np.argmax', (['preds'], {'axis': '(-1)'}), '(preds, axis=-1)\n', (4526, 4542), True, 'import numpy as np\n'), ((5328, 5351), 'numpy.stack', 'np.stack', (['probs'], {'ax...
from configs import general_config,stacking_config,modelDict from sklearn.model_selection import KFold,GridSearchCV from sklearn.linear_model import LogisticRegression from sklearn.externals import joblib from models.TextCNN import model as TextCNN from models.TextRNN import model as TextRNN from models.CRNN import mod...
[ "pandas.DataFrame", "sklearn.model_selection.GridSearchCV", "sklearn.externals.joblib.dump", "models.TextCNN.model", "models.CRNN.model", "pandas.read_csv", "numpy.allclose", "data_helpers.utils.readNewFile", "os.path.exists", "sklearn.model_selection.KFold", "sklearn.linear_model.LogisticRegres...
[((848, 903), 'sklearn.model_selection.KFold', 'KFold', (['num_cv'], {'random_state': '(1234 + num_cv)', 'shuffle': '(True)'}), '(num_cv, random_state=1234 + num_cv, shuffle=True)\n', (853, 903), False, 'from sklearn.model_selection import KFold, GridSearchCV\n'), ((2967, 2987), 'sklearn.linear_model.LogisticRegression...
import sys import numpy as np import scipy.optimize as op import math MAX = sys.float_info.max # def wd(a): return 0 if a > MAX else np.abs(a - MAX) def wd(a): return 0 if a == math.inf else np.log(MAX) - np.log(np.abs(a)) def average(X): x = X[0] y = X[1] ret = (x + y) / 2.0 return wd(ret) if...
[ "numpy.log", "numpy.abs", "scipy.optimize.basinhopping" ]
[((364, 471), 'scipy.optimize.basinhopping', 'op.basinhopping', (['average', '[1, 1]'], {'niter': '(100)', 'stepsize': '(100.0)', 'minimizer_kwargs': "{'method': 'nelder-mead'}"}), "(average, [1, 1], niter=100, stepsize=100.0,\n minimizer_kwargs={'method': 'nelder-mead'})\n", (379, 471), True, 'import scipy.optimize...
# Neural Networks and Deep Learning with TensorFlow (1.12) import tensorflow as tf import numpy as np if __name__ == "__main__": # Create TF session # sesh = tf.Session() # sesh.run(tf.constant(100)) # Operations x = tf.constant(2) y = tf.constant(3) with tf.Session() as sesh: pr...
[ "numpy.array", "tensorflow.matmul", "tensorflow.Session", "tensorflow.constant" ]
[((241, 255), 'tensorflow.constant', 'tf.constant', (['(2)'], {}), '(2)\n', (252, 255), True, 'import tensorflow as tf\n'), ((264, 278), 'tensorflow.constant', 'tf.constant', (['(3)'], {}), '(3)\n', (275, 278), True, 'import tensorflow as tf\n'), ((1051, 1072), 'tensorflow.matmul', 'tf.matmul', (['mat1', 'mat2'], {}), ...