code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python ############################################################################### # Copyright Kitware Inc. and Contributors # Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0) # See accompanying Copyright.txt and LICENSE files for details ##################################...
[ "os.remove", "argparse.ArgumentParser", "numpy.ones", "danesfield.gdal_utils.ogr_open", "ogr.Feature", "danesfield.gdal_utils.gdal_open", "cv2.cvtColor", "danesfield.gdal_utils.ogr_get_layer", "shutil.copyfile", "cv2.resize", "cv2.Canny", "os.path.basename", "ogr.GetDriverByName", "gdal.Ap...
[((717, 754), 'ogr.GetDriverByName', 'ogr.GetDriverByName', (['"""ESRI Shapefile"""'], {}), "('ESRI Shapefile')\n", (736, 754), False, 'import ogr\n'), ((907, 942), 'osr.SpatialReference', 'osr.SpatialReference', (['outProjection'], {}), '(outProjection)\n', (927, 942), False, 'import osr\n'), ((6512, 6673), 'argparse....
import numpy as np from scipy.stats import rankdata from sklearn.datasets import load_iris from utilities.rank_data import rank_data def test_rank_data(): data = load_iris().data # rank the data all at once output = rank_data(data) # check each column versus scipy equivalent for i in range(data...
[ "sklearn.datasets.load_iris", "numpy.allclose", "scipy.stats.rankdata", "pytest.main", "utilities.rank_data.rank_data" ]
[((232, 247), 'utilities.rank_data.rank_data', 'rank_data', (['data'], {}), '(data)\n', (241, 247), False, 'from utilities.rank_data import rank_data\n'), ((500, 513), 'pytest.main', 'pytest.main', ([], {}), '()\n', (511, 513), False, 'import pytest\n'), ((169, 180), 'sklearn.datasets.load_iris', 'load_iris', ([], {}),...
# -*- coding: utf-8 -*- '''Example 01 Shows how to create simple geometry from splines and ellipse arcs, and how to mesh a quad mesh in GmshMesher. Also demonstrates drawGeometry(), drawMesh, and drawing texts and labels in a figure. ''' import numpy as np import calfem.geometry as cfg import calfem.mesh as cfm imp...
[ "calfem.vis_mpl.figure", "calfem.vis_mpl.draw_nodal_values_contourf", "calfem.vis_mpl.draw_nodal_values_contour", "calfem.vis_mpl.draw_mesh", "calfem.core.coordxtr", "numpy.shape", "calfem.core.flw2i8s", "calfem.core.solveq", "calfem.geometry.Geometry", "calfem.vis_mpl.draw_geometry", "calfem.me...
[((400, 419), 'calfem.utils.enableLogging', 'cfu.enableLogging', ([], {}), '()\n', (417, 419), True, 'import calfem.utils as cfu\n'), ((590, 625), 'numpy.matrix', 'np.matrix', (['[[kx1, 0.0], [0.0, ky1]]'], {}), '([[kx1, 0.0], [0.0, ky1]])\n', (599, 625), True, 'import numpy as np\n'), ((718, 732), 'calfem.geometry.Geo...
#%% import time import math import sys import argparse import cPickle as pickle import codecs import numpy as np from chainer import cuda, Variable, FunctionSet import chainer.functions as F from CharRNN import CharRNN, make_initial_state sys.stdout = codecs.getwriter('utf_8')(sys.stdout) #%% arguments parser = argp...
[ "sys.stdout.write", "numpy.random.seed", "argparse.ArgumentParser", "numpy.sum", "chainer.cuda.get_device", "codecs.getwriter", "numpy.ones", "chainer.cuda.to_cpu", "numpy.array", "chainer.cuda.to_gpu", "CharRNN.make_initial_state" ]
[((316, 341), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (339, 341), False, 'import argparse\n'), ((801, 826), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (815, 826), True, 'import numpy as np\n'), ((1154, 1207), 'CharRNN.make_initial_state', 'make_initial_s...
import numpy as np def dichoto(function, p0, max_depth=10, eps=1e-10): a,b=p0 i=0 while i < max_depth: c=0.5*(a+b) if np.abs(function(c))<=eps: return c if(function(c)<0): a=c if(function(c)>0): b=c i=i+1 return c # Find ...
[ "numpy.tan" ]
[((472, 481), 'numpy.tan', 'np.tan', (['x'], {}), '(x)\n', (478, 481), True, 'import numpy as np\n')]
import unittest import pandas as pd import numpy as np from dask import dataframe as dd from .normalize_functions import ( encode_objects_general, normalize_general, normalize_chex, ) class NormalizeTests(unittest.TestCase): def test_encode_objects_general(self): strings_feats = "alpha bravo ...
[ "unittest.main", "pandas.DataFrame", "pandas.DataFrame.from_dict", "numpy.arange", "numpy.column_stack", "dask.dataframe.from_array" ]
[((2737, 2752), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2750, 2752), False, 'import unittest\n'), ((690, 705), 'numpy.arange', 'np.arange', (['(0)', '(5)'], {}), '(0, 5)\n', (699, 705), True, 'import numpy as np\n'), ((727, 786), 'numpy.column_stack', 'np.column_stack', (['(sequence.T, sequence[::-1].T, se...
import os import numpy as np import h5py as h5 import tensorflow as tf def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) def _bytes_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) def _floats_feature(value): return tf.train....
[ "tensorflow.train.BytesList", "h5py.File", "tensorflow.python_io.TFRecordWriter", "tensorflow.train.Int64List", "tensorflow.train.Example", "numpy.asarray", "tensorflow.train.Features", "tensorflow.train.FloatList", "os.path.join" ]
[((590, 613), 'h5py.File', 'h5.File', (['this_file', '"""r"""'], {}), "(this_file, 'r')\n", (597, 613), True, 'import h5py as h5\n'), ((633, 655), 'numpy.asarray', 'np.asarray', (["hf['data']"], {}), "(hf['data'])\n", (643, 655), True, 'import numpy as np\n'), ((668, 692), 'numpy.asarray', 'np.asarray', (["hf['params']...
# This implementation is based on codes of <NAME> & <NAME> import time import random import numpy as np import tensorflow as tf import tensorflow_probability as tfp from tqdm import tqdm import pickle from base.rl import ActorCriticRLAlgorithm from base.replay_buffer import ReplayBuffer @tf.function def clip_with_grad...
[ "tensorflow.random.set_seed", "tensorflow.keras.backend.set_value", "tensorflow.reduce_sum", "numpy.random.seed", "numpy.nan_to_num", "tensorflow.keras.layers.Dense", "tensorflow.reshape", "pickle.load", "numpy.mean", "base.replay_buffer.ReplayBuffer", "numpy.prod", "tensorflow.math.log", "t...
[((361, 390), 'tensorflow.cast', 'tf.cast', (['(x > high)', 'tf.float32'], {}), '(x > high, tf.float32)\n', (368, 390), True, 'import tensorflow as tf\n'), ((406, 434), 'tensorflow.cast', 'tf.cast', (['(x < low)', 'tf.float32'], {}), '(x < low, tf.float32)\n', (413, 434), True, 'import tensorflow as tf\n'), ((860, 875)...
import time import picamera import numpy as np import cv2 with picamera.PiCamera() as camera: camera.resolution = (320, 240) camera.framerate = 24 time.sleep(2) image = np.empty((240 * 320 * 3,), dtype=np.uint8) camera.capture(image, 'bgr') image = image.reshape((240, 320, 3))
[ "numpy.empty", "time.sleep", "picamera.PiCamera" ]
[((64, 83), 'picamera.PiCamera', 'picamera.PiCamera', ([], {}), '()\n', (81, 83), False, 'import picamera\n'), ((160, 173), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (170, 173), False, 'import time\n'), ((186, 228), 'numpy.empty', 'np.empty', (['(240 * 320 * 3,)'], {'dtype': 'np.uint8'}), '((240 * 320 * 3,), ...
# -*- coding:UTF-8 -*- # Copyright 2017 The TensorFlow 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 # # Unl...
[ "argparse.ArgumentParser", "logging.Formatter", "os.path.isfile", "os.path.join", "sys.path.append", "logging.FileHandler", "tensorflow.subtract", "os.path.exists", "tensorflow.placeholder", "tensorflow.cast", "shutil.copyfile", "tensorflow.GraphDef", "os.rename", "logging.StreamHandler", ...
[((980, 1000), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (995, 1000), False, 'import sys, os\n'), ((1120, 1130), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (1128, 1130), True, 'import tensorflow as tf\n'), ((1145, 1158), 'tensorflow.GraphDef', 'tf.GraphDef', ([], {}), '()\n', (1156, 115...
import multiprocessing import numpy from smqtk.representation import DescriptorElement from smqtk.utils.postgres import norm_psql_cmd_string, PsqlConnectionHelper # Try to import required modules try: import psycopg2 except ImportError: psycopg2 = None PSQL_TABLE_CREATE_RLOCK = multiprocessing.RLock() # ...
[ "smqtk.utils.postgres.PsqlConnectionHelper", "numpy.copy", "numpy.frombuffer", "smqtk.utils.postgres.norm_psql_cmd_string", "psycopg2.Binary", "multiprocessing.RLock" ]
[((292, 315), 'multiprocessing.RLock', 'multiprocessing.RLock', ([], {}), '()\n', (313, 315), False, 'import multiprocessing\n'), ((748, 1022), 'smqtk.utils.postgres.norm_psql_cmd_string', 'norm_psql_cmd_string', (['"""\n CREATE TABLE IF NOT EXISTS {table_name:s} (\n {type_col:s} TEXT NOT NULL,\n ...
#!/usr/bin/env python2 # This file is part of the OpenMV project. # # Copyright (c) 2013-2021 <NAME> <<EMAIL>> # Copyright (c) 2013-2021 <NAME> <<EMAIL>> # # This work is licensed under the MIT license, see the file LICENSE for details. # # This script creates smaller patches from images. import os, sys import argpars...
[ "argparse.ArgumentParser", "random.shuffle", "numpy.random.RandomState", "sys.exit", "skimage.exposure.is_low_contrast", "skimage.io.imsave", "os.listdir", "skimage.io.imread" ]
[((500, 575), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate smaller patches from images"""'}), "(description='Generate smaller patches from images')\n", (523, 575), False, 'import argparse\n'), ((1243, 1265), 'os.listdir', 'os.listdir', (['args.input'], {}), '(args.input)\n', (...
""" Unit tests for pointing """ import logging import unittest import astropy.units as u import numpy from astropy.coordinates import SkyCoord from rascil.data_models.memory_data_models import Skycomponent from rascil.data_models.polarisation import PolarisationFrame from rascil.processing_components.calibration.po...
[ "matplotlib.pyplot.title", "numpy.random.seed", "matplotlib.pyplot.clf", "rascil.data_models.parameters.rascil_path", "unittest.main", "rascil.processing_components.simulation.create_named_configuration", "numpy.real", "rascil.data_models.polarisation.PolarisationFrame", "matplotlib.pyplot.show", ...
[((868, 895), 'logging.getLogger', 'logging.getLogger', (['"""logger"""'], {}), "('logger')\n", (885, 895), False, 'import logging\n'), ((4527, 4542), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4540, 4542), False, 'import unittest\n'), ((1128, 1173), 'rascil.processing_components.simulation.create_named_confi...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """Test lvmutil.funcfits. """ from __future__ import (absolute_import, division, print_function, unicode_literals) # The line above will help with 2to3 support. import unittest import numpy as np from warning...
[ "numpy.ones_like", "numpy.sin", "numpy.array", "numpy.arange", "numpy.linspace", "warnings.catch_warnings", "numpy.testing.assert_allclose", "unittest.defaultTestLoader.loadTestsFromName" ]
[((4444, 4498), 'unittest.defaultTestLoader.loadTestsFromName', 'unittest.defaultTestLoader.loadTestsFromName', (['__name__'], {}), '(__name__)\n', (4488, 4498), False, 'import unittest\n'), ((890, 915), 'numpy.linspace', 'np.linspace', (['(0)', 'np.pi', '(50)'], {}), '(0, np.pi, 50)\n', (901, 915), True, 'import numpy...
import numpy as np import pytest from numpy.testing import assert_array_equal, assert_array_almost_equal from ManipulatorCore import Joint, ManipulatorCore def test_arm_1(): ph = np.pi / 2 bot = ManipulatorCore([ Joint('prismatic', -ph, 10, 0, ph), Joint('prismatic', -ph, 20, 0, ph), ...
[ "ManipulatorCore.Joint", "numpy.array" ]
[((441, 511), 'numpy.array', 'np.array', (['[[0, 1, 0, -20], [0, 0, 1, 30], [1, 0, 0, 10], [0, 0, 0, 1]]'], {}), '([[0, 1, 0, -20], [0, 0, 1, 30], [1, 0, 0, 10], [0, 0, 0, 1]])\n', (449, 511), True, 'import numpy as np\n'), ((911, 981), 'numpy.array', 'np.array', (['[[0, 1, 0, 20], [1, 0, 0, 0], [0, 0, -1, 200], [0, 0,...
import re import pandas as pd import numpy as np import argparse def tlgHistoryRecall(table, pointID): init = table[table.pointID == pointID] track = ":"+str(init.frameNumber.values[0])+"-"+str(init.pointID.values[0]) parental = init.parentID.values[0] while (parental>0) : init = table[table.p...
[ "pandas.DataFrame", "argparse.ArgumentParser", "pandas.read_csv", "pandas.merge", "re.sub", "numpy.concatenate" ]
[((922, 1014), 'pandas.DataFrame', 'pd.DataFrame', (["{'pointID': [pointID], 'timefromDiv': [ttLast], 'lcAncest': [lcAncestor]}"], {}), "({'pointID': [pointID], 'timefromDiv': [ttLast], 'lcAncest': [\n lcAncestor]})\n", (934, 1014), True, 'import pandas as pd\n'), ((1140, 1154), 'pandas.DataFrame', 'pd.DataFrame', (...
#!/usr/bin/env python import argparse import codecs import os import re import shutil import warnings from collections import defaultdict from pathlib import Path from typing import Dict, Generator, List, Optional, Tuple import keyboardlayout as kl import keyboardlayout.pygame as klp import librosa import numpy impor...
[ "os.mkdir", "argparse.ArgumentParser", "keyboardlayout.KeyboardInfo", "keyboardlayout.pygame.KeyboardLayout", "pygame.event.get", "pygame.mixer.init", "collections.defaultdict", "pathlib.Path", "pygame.font.init", "pygame.display.update", "shutil.rmtree", "os.path.join", "codecs.open", "wa...
[((396, 423), 're.compile', 're.compile', (['"""\\\\s[abcdefg]$"""'], {}), "('\\\\s[abcdefg]$')\n", (406, 423), False, 'import re\n'), ((926, 974), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'DESCRIPTION'}), '(description=DESCRIPTION)\n', (949, 974), False, 'import argparse\n'), ((2045, ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np import pandas as pd import random import json IMAGE_SIZE = 24 NUM_CLASSES = 5 NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 2046 NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = 512 NUM_PREP...
[ "tensorflow.image.flip_left_right", "tensorflow.image.rgb_to_grayscale", "tensorflow.image.flip_up_down", "tensorflow.train.shuffle_batch", "pandas.read_csv", "tensorflow.convert_to_tensor", "tensorflow.reduce_max", "tensorflow.divide", "random.seed", "numpy.array", "tensorflow.image.per_image_s...
[((401, 418), 'random.seed', 'random.seed', (['(1337)'], {}), '(1337)\n', (412, 418), False, 'import random\n'), ((445, 502), 'pandas.read_csv', 'pd.read_csv', (['fn'], {'keep_default_na': '(False)', 'na_values': "['NaN']"}), "(fn, keep_default_na=False, na_values=['NaN'])\n", (456, 502), True, 'import pandas as pd\n')...
""" Allocate apertures to targets. Contains code originally written by 2021 Akamai intern, <NAME>. .. include:: ../include/links.rst """ from pathlib import Path from IPython import embed import numpy def random_targets(r, n=None, density=5., rng=None): r""" Draw a set of random x and y coordinates within...
[ "numpy.full", "numpy.ceil", "numpy.empty", "numpy.random.default_rng", "pathlib.Path", "numpy.array" ]
[((1457, 1489), 'numpy.empty', 'numpy.empty', (['(0, 2)'], {'dtype': 'float'}), '((0, 2), dtype=float)\n', (1468, 1489), False, 'import numpy\n'), ((1421, 1447), 'numpy.random.default_rng', 'numpy.random.default_rng', ([], {}), '()\n', (1445, 1447), False, 'import numpy\n'), ((3919, 3961), 'numpy.full', 'numpy.full', (...
import tensorflow as tf import numpy as np from tensorflow.keras import backend as K from sklearn.linear_model import LassoLars from timeit import default_timer as timer from sklearn.linear_model import LinearRegression from compression_tools.pruning.helper_functions import rel_error, get_layer_index, load_model_param ...
[ "numpy.stack", "numpy.sum", "numpy.abs", "timeit.default_timer", "sklearn.linear_model.LassoLars", "compression_tools.pruning.helper_functions.get_layer_index", "numpy.transpose", "compression_tools.pruning.delete_filters.delete_filter_before", "sklearn.linear_model.LinearRegression", "tensorflow....
[((657, 696), 'compression_tools.pruning.helper_functions.get_layer_index', 'get_layer_index', (['layer_index_dic', 'layer'], {}), '(layer_index_dic, layer)\n', (672, 696), False, 'from compression_tools.pruning.helper_functions import rel_error, get_layer_index, load_model_param\n'), ((3399, 3470), 'sklearn.linear_mod...
from typing import Optional, Tuple import numpy as np from scipy import integrate from scipy.optimize import minimize from paramak import ExtrudeMixedShape from paramak.utils import add_thickness class ToroidalFieldCoilPrincetonD(ExtrudeMixedShape): """Toroidal field coil based on Princeton-D curve Args: ...
[ "scipy.optimize.minimize", "numpy.flip", "numpy.log", "scipy.integrate.odeint", "numpy.append", "paramak.utils.add_thickness", "numpy.diff", "numpy.linspace", "numpy.vstack" ]
[((3059, 3094), 'scipy.optimize.minimize', 'minimize', (['error', 'z_0'], {'args': '(R0, R2)'}), '(error, z_0, args=(R0, R2))\n', (3067, 3094), False, 'from scipy.optimize import minimize\n'), ((4188, 4248), 'paramak.utils.add_thickness', 'add_thickness', (['r_inner', 'z_inner', 'self.thickness'], {'dy_dx': 'dz_dr'}), ...
import numpy as np import pytest from packaging import version import qcodes as qc from qcodes import load_or_create_experiment, initialise_or_create_database_at from plottr.data.datadict import DataDict from plottr.utils import testdata from plottr.node.tools import linearFlowchart from plottr.data.qcodes_dataset im...
[ "qcodes.Measurement", "plottr.data.qcodes_dataset.get_ds_info", "qcodes.load_or_create_experiment", "packaging.version.parse", "numpy.allclose", "pytest.fixture", "plottr.data.qcodes_dataset.get_ds_structure", "plottr.data.qcodes_dataset.ds_to_datadict", "plottr.data.qcodes_dataset.get_runs_from_db"...
[((431, 463), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (445, 463), False, 'import pytest\n'), ((537, 578), 'qcodes.initialise_or_create_database_at', 'initialise_or_create_database_at', (['db_path'], {}), '(db_path)\n', (569, 578), False, 'from qcodes import load_or...
import random from collections import deque import numpy as np import torch from flatland.envs.malfunction_generators import malfunction_from_params from flatland.envs.observations import TreeObsForRailEnv from flatland.envs.predictions import ShortestPathPredictorForRailEnv from flatland.envs.rail_env import RailEnv ...
[ "numpy.random.seed", "flatland.envs.predictions.ShortestPathPredictorForRailEnv", "numpy.power", "torch.load", "torch_training.dueling_double_dqn.Agent", "utils.observation_utils.normalize_observation", "flatland.envs.malfunction_generators.malfunction_from_params", "importlib_resources.path", "flat...
[((682, 696), 'random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (693, 696), False, 'import random\n'), ((697, 714), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (711, 714), True, 'import numpy as np\n'), ((1177, 1207), 'flatland.envs.observations.TreeObsForRailEnv', 'TreeObsForRailEnv', ([], {'max...
import os import numpy as np import esutil as eu import fitsio import meds import piff import pixmappy import desmeds import ngmix import scipy from .._pizza_cutter import _build_metadata from .._constants import MAGZP_REF from meds.maker import MEDS_FMT_VERSION from ... import __version__ def test_pizza_cutter_bui...
[ "numpy.all" ]
[((636, 687), 'numpy.all', 'np.all', (["(metadata['numpy_version'] == np.__version__)"], {}), "(metadata['numpy_version'] == np.__version__)\n", (642, 687), True, 'import numpy as np\n'), ((699, 753), 'numpy.all', 'np.all', (["(metadata['scipy_version'] == scipy.__version__)"], {}), "(metadata['scipy_version'] == scipy...
# -*- coding: utf-8 -*- import os import glob import random import numpy as np from multiprocessing import Pool from dvs_utils.prepareData import prepareData NUM_CLASSES = 4 NUM_POINTS = 2**14 DATASET_TRAIN_DIR = "/bigdata_hdd/klein/FrKlein_PoC/data/TrainFiles/" DATASET_PREP_TRAIN_DIR = "/bigdata_hdd/klein/FrKlein_P...
[ "random.shuffle", "numpy.asarray", "dvs_utils.prepareData.prepareData", "random.seed", "numpy.array", "multiprocessing.Pool", "os.path.join" ]
[((1248, 1282), 'numpy.array', 'np.array', (['points'], {'dtype': 'np.float32'}), '(points, dtype=np.float32)\n', (1256, 1282), True, 'import numpy as np\n'), ((1295, 1327), 'numpy.array', 'np.array', (['labels'], {'dtype': 'np.uint8'}), '(labels, dtype=np.uint8)\n', (1303, 1327), True, 'import numpy as np\n'), ((1340,...
""" Based on: https://github.com/openai/baselines/blob/master/baselines/deepq/replay_buffer.py """ import random from typing import List, Tuple import numpy as np from pyderl.utils.data_structures import SumSegmentTree, MinSegmentTree class PrioritizedReplayBuffer: """ Prioritized replay buffer. Args: ...
[ "numpy.array", "random.random", "pyderl.utils.data_structures.SumSegmentTree", "pyderl.utils.data_structures.MinSegmentTree" ]
[((895, 922), 'pyderl.utils.data_structures.SumSegmentTree', 'SumSegmentTree', (['it_capacity'], {}), '(it_capacity)\n', (909, 922), False, 'from pyderl.utils.data_structures import SumSegmentTree, MinSegmentTree\n'), ((946, 973), 'pyderl.utils.data_structures.MinSegmentTree', 'MinSegmentTree', (['it_capacity'], {}), '...
import numpy as np import scipy.sparse as sp import SimPEG from SimPEG import Utils from SimPEG.EM.Utils import omega from SimPEG.Utils import Zero, Identity class Fields(SimPEG.Problem.Fields): """ Fancy Field Storage for a FDEM survey. Only one field type is stored for each problem, the rest are co...
[ "numpy.zeros_like", "SimPEG.Utils.mkvc", "numpy.zeros", "SimPEG.Utils.Identity", "SimPEG.Utils.Zero", "SimPEG.EM.Utils.omega" ]
[((1924, 1948), 'numpy.zeros_like', 'np.zeros_like', (['eSolution'], {}), '(eSolution)\n', (1937, 1948), True, 'import numpy as np\n'), ((3926, 3932), 'SimPEG.Utils.Zero', 'Zero', ([], {}), '()\n', (3930, 3932), False, 'from SimPEG.Utils import Zero, Identity\n'), ((4282, 4352), 'numpy.zeros', 'np.zeros', (['[self._edg...
import numpy as np from numpy.testing import assert_equal, assert_allclose from scipy import linalg from ..dmd import get_dmd, exact_dmd, get_amplitude_spectrum class TestDMD: """Unit tests for the `dmd` module.""" def test__synthetic_example_1__should_find_two_eigenvalues(self): t = np.linspace(0,...
[ "numpy.abs", "numpy.empty", "numpy.sin", "numpy.array", "numpy.exp", "numpy.linspace", "numpy.cos", "scipy.linalg.norm", "numpy.testing.assert_allclose" ]
[((306, 331), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': '(11)'}), '(0, 1, num=11)\n', (317, 331), True, 'import numpy as np\n'), ((405, 433), 'numpy.array', 'np.array', (['[[1, -2], [0, +3]]'], {}), '([[1, -2], [0, +3]])\n', (413, 433), True, 'import numpy as np\n'), ((493, 509), 'numpy.array', 'np.arra...
import numpy as np class RollingCircularMean(object): def __init__(self, size=800): self.size = size self.data = [] def insert_data(self,item): self.data.append(np.deg2rad(item)) if len(self.data) > self.size: self.data.pop(0) def value(self): if self....
[ "numpy.sin", "numpy.cos", "numpy.deg2rad" ]
[((196, 212), 'numpy.deg2rad', 'np.deg2rad', (['item'], {}), '(item)\n', (206, 212), True, 'import numpy as np\n'), ((582, 595), 'numpy.sin', 'np.sin', (['alpha'], {}), '(alpha)\n', (588, 595), True, 'import numpy as np\n'), ((610, 623), 'numpy.cos', 'np.cos', (['alpha'], {}), '(alpha)\n', (616, 623), True, 'import num...
import os import cv2 import numpy as np start_idx = 1 PREDEFINE_LEN = 6 anno_num = 0 total_anno = 0 class generating: def __init__(self, path, label_path, dst_dir): self.Path = path #####视频路径 self.base_name = os.path.basename(self.Path) self.base_name = os.path.splitext(self.base_name)[0]...
[ "os.makedirs", "cv2.VideoWriter_fourcc", "os.path.basename", "os.path.exists", "numpy.ones", "numpy.argsort", "cv2.VideoCapture", "numpy.where", "os.path.splitext", "numpy.loadtxt", "cv2.VideoWriter", "os.path.join", "os.listdir", "numpy.concatenate" ]
[((232, 259), 'os.path.basename', 'os.path.basename', (['self.Path'], {}), '(self.Path)\n', (248, 259), False, 'import os\n'), ((347, 396), 'os.path.join', 'os.path.join', (['label_path', "(self.base_name + '.txt')"], {}), "(label_path, self.base_name + '.txt')\n", (359, 396), False, 'import os\n'), ((477, 517), 'os.ma...
import numpy as np import matplotlib.pyplot as plt from .source_pos import gauss def lc_nodriftcorr(meta, wave_1d, optspec, log): '''Plot a 2D light curve without drift correction. Parameters ---------- meta: MetaClass The metadata object. wave_1d: Wavelength array with t...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.clf", "matplotlib.pyplot.suptitle", "numpy.ma.mean", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "numpy.round", "matplotlib.pyplot.axvline", "numpy.std", "matplotlib.pyplot.imshow", "matplotlib.pyplot.colorbar", "numpy.max", "nu...
[((605, 634), 'numpy.ma.masked_invalid', 'np.ma.masked_invalid', (['optspec'], {}), '(optspec)\n', (625, 634), True, 'import numpy as np\n'), ((639, 671), 'matplotlib.pyplot.figure', 'plt.figure', (['(3101)'], {'figsize': '(8, 8)'}), '(3101, figsize=(8, 8))\n', (649, 671), True, 'import matplotlib.pyplot as plt\n'), ((...
from typing import Dict import pytest import numpy as np import string from hyperminhash.perf import estimate_error from hyperminhash.hyperminhash import HyperMinHash def rnd_str(size: int): arr = np.random.choice([_ for _ in string.ascii_letters], size) return "".join(list(arr)) def test_zeros(exp: float = 0....
[ "hyperminhash.perf.estimate_error", "hyperminhash.hyperminhash.HyperMinHash", "numpy.iinfo", "numpy.random.choice", "numpy.float64" ]
[((203, 260), 'numpy.random.choice', 'np.random.choice', (['[_ for _ in string.ascii_letters]', 'size'], {}), '([_ for _ in string.ascii_letters], size)\n', (219, 260), True, 'import numpy as np\n'), ((331, 345), 'hyperminhash.hyperminhash.HyperMinHash', 'HyperMinHash', ([], {}), '()\n', (343, 345), False, 'from hyperm...
# # Copyright © 2020 <NAME> <<EMAIL>> # # Distributed under terms of the GPLv3 license. """ """ import numpy as np import pytest import pyronn_torch def test_init(): assert pyronn_torch.cpp_extension @pytest.mark.parametrize('with_texture', ('with_texture', False)) @pytest.mark.parametrize('with_backward', (...
[ "pyronn_torch.ConeBeamProjector.from_conrad_config", "pytest.mark.parametrize", "pytest.importorskip", "numpy.array" ]
[((212, 276), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""with_texture"""', "('with_texture', False)"], {}), "('with_texture', ('with_texture', False))\n", (235, 276), False, 'import pytest\n'), ((278, 344), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""with_backward"""', "('with_backward'...
# coding: utf-8 # In[1]: import sys import os import numpy as np import matplotlib.pyplot as plt # In[25]: HEIGHT = 96 WIDTH = 96 DEPTH = 3 SIZE = HEIGHT*WIDTH*DEPTH # In[26]: DATA_PATH = '../dataset/stl10_binary/train_X.bin' LABEL_PATH = '../dataset/stl10_binary/train_y.bin' # In[27]: def read_labels(path...
[ "matplotlib.pyplot.show", "numpy.fromfile", "matplotlib.pyplot.imshow", "numpy.transpose", "numpy.reshape" ]
[((1002, 1053), 'numpy.fromfile', 'np.fromfile', (['image_file'], {'dtype': 'np.uint8', 'count': 'SIZE'}), '(image_file, dtype=np.uint8, count=SIZE)\n', (1013, 1053), True, 'import numpy as np\n'), ((1070, 1107), 'numpy.reshape', 'np.reshape', (['image', '(3, HEIGHT, WIDTH)'], {}), '(image, (3, HEIGHT, WIDTH))\n', (108...
import contextlib import matplotlib.lines as lines import matplotlib.patches as patches import matplotlib.pyplot as plt import numpy as np class MPLBoss: def __init__(self, settings): self.outf_dirname = settings._temp_r_dirname self.png_dirname = settings.output_dirname self.png_fname_b...
[ "matplotlib.lines.Line2D", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "numpy.array", "matplotlib.pyplot.subplots" ]
[((1443, 1513), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(self.out_width, self.out_height)', 'dpi': 'self._dpi'}), '(figsize=(self.out_width, self.out_height), dpi=self._dpi)\n', (1455, 1513), True, 'import matplotlib.pyplot as plt\n'), ((1544, 1559), 'matplotlib.pyplot.axis', 'plt.axis', (['"""o...
import numpy as np from engine.optimizers.base_sgd import BaseSGD def square_loss(x, y, w, c): return c * np.sum([(np.dot(w.T, x[i]) - y[i]) ** 2 for i in range(x.shape[0])]) + np.dot(w, w) / 2 def square_increment(x_i, y_i, w, c, eps): return - eps * (c * 2 * x_i * (np.dot(w.T, x_i) - y_i) + w) class Squ...
[ "numpy.dot" ]
[((183, 195), 'numpy.dot', 'np.dot', (['w', 'w'], {}), '(w, w)\n', (189, 195), True, 'import numpy as np\n'), ((280, 296), 'numpy.dot', 'np.dot', (['w.T', 'x_i'], {}), '(w.T, x_i)\n', (286, 296), True, 'import numpy as np\n'), ((121, 138), 'numpy.dot', 'np.dot', (['w.T', 'x[i]'], {}), '(w.T, x[i])\n', (127, 138), True,...
from collections import defaultdict from copy import deepcopy import time import pandas as pd import pickle import os from sklearn.preprocessing import MinMaxScaler from tqdm import tqdm from xgboost import XGBRegressor import numpy as np CIRCUIT_LIST = ["circuitId_1", "circuitId_2", "circuitId_3", "circuitId_4", "ci...
[ "pandas.DataFrame", "copy.deepcopy", "pickle.dump", "pandas.read_csv", "numpy.std", "pandas.get_dummies", "sklearn.preprocessing.MinMaxScaler", "collections.defaultdict", "os.path.isfile", "numpy.mean", "pickle.load", "xgboost.XGBRegressor", "numpy.random.choice" ]
[((1230, 1315), 'pandas.read_csv', 'pd.read_csv', (['"""./envs/race_strategy_model/dataset/finalDataset.csv"""'], {'delimiter': '""","""'}), "('./envs/race_strategy_model/dataset/finalDataset.csv',\n delimiter=',')\n", (1241, 1315), True, 'import pandas as pd\n'), ((3206, 3234), 'xgboost.XGBRegressor', 'XGBRegressor...
from control import lqr import numpy as np # ------------------------------------------------------------------------------------------------- def Correction2D(K): for i in range(len(K)): for j in range(len(K[0])): if abs(K[i][j]) < 1e-6: K[i][j] = 0 return K # ---------------------------------------------...
[ "control.lqr", "numpy.zeros", "numpy.arcsin", "numpy.tan", "numpy.sin", "numpy.cos" ]
[((2379, 2394), 'control.lqr', 'lqr', (['A', 'B', 'Q', 'R'], {}), '(A, B, Q, R)\n', (2382, 2394), False, 'from control import lqr\n'), ((2641, 2661), 'numpy.zeros', 'np.zeros', (['(10, 4, 9)'], {}), '((10, 4, 9))\n', (2649, 2661), True, 'import numpy as np\n'), ((2714, 2747), 'numpy.arcsin', 'np.arcsin', (['(-Cd * u **...
"""PMSG_disc.py Created by <NAME>, <NAME>. Copyright (c) NREL. All rights reserved. Electromagnetic design based on conventional magnetic circuit laws Structural design based on McDonald's thesis """ from openmdao.api import Group, Problem, Component,ExecComp,IndepVarComp,ScipyOptimizer,pyOptSparseDriver from ...
[ "openmdao.api.IndepVarComp", "openmdao.api.ExecComp", "math.atan", "math.sqrt", "math.tan", "math.sin", "math.cosh", "math.log", "numpy.array", "math.cos", "math.sinh", "openmdao.drivers.pyoptsparse_driver.pyOptSparseDriver" ]
[((28444, 28463), 'openmdao.drivers.pyoptsparse_driver.pyOptSparseDriver', 'pyOptSparseDriver', ([], {}), '()\n', (28461, 28463), False, 'from openmdao.drivers.pyoptsparse_driver import pyOptSparseDriver\n'), ((32459, 32484), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (32467, 32484), T...
import unittest import numpy as np from decouple import config from pysony.graph import GraphDistance class TestGraphDistance(unittest.TestCase): def testGraphDistance(self): myGraphDistance = GraphDistance( threshold = 20 ) X = np.random.rand(10,2) / 2 X[:,0] += -0.172...
[ "unittest.main", "numpy.random.rand", "pysony.graph.GraphDistance" ]
[((523, 549), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (536, 549), False, 'import unittest\n'), ((207, 234), 'pysony.graph.GraphDistance', 'GraphDistance', ([], {'threshold': '(20)'}), '(threshold=20)\n', (220, 234), False, 'from pysony.graph import GraphDistance\n'), ((271, 292)...
import argparse import json from pathlib import Path import numpy as np from model import MultiTaskModel import parse import create_data import asyncio import websockets import logging import logging.handlers class QueryModel: def __init__(self,model_file,identifier): self.config = None self.model...
[ "json.load", "websockets.serve", "argparse.ArgumentParser", "asyncio.get_event_loop", "logging.StreamHandler", "numpy.zeros", "logging.handlers.RotatingFileHandler", "json.dumps", "logging.Formatter", "parse.parse_json_file_with_index", "pathlib.Path", "create_data.DataProcessor", "logging.g...
[((11317, 11419), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Perform NL classification with pre-trained neural networks"""'}), "(description=\n 'Perform NL classification with pre-trained neural networks')\n", (11340, 11419), False, 'import argparse\n'), ((509, 525), 'pathlib.Path...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from unittest import mock import numpy as np from ax.core.metric import Metric from ax.core.objective import Objective from ax.core.observation import Observation, ObservationData, ObservationFeatures from ax.core.optimizat...
[ "ax.core.observation.ObservationFeatures", "unittest.mock.create_autospec", "ax.core.parameter.RangeParameter", "unittest.mock.MagicMock", "ax.modelbridge.discrete.DiscreteModelBridge", "ax.core.metric.Metric", "ax.core.parameter.FixedParameter", "unittest.mock.patch", "numpy.array", "ax.modelbrid...
[((2469, 2558), 'unittest.mock.patch', 'mock.patch', (['"""ax.modelbridge.discrete.DiscreteModelBridge.__init__"""'], {'return_value': 'None'}), "('ax.modelbridge.discrete.DiscreteModelBridge.__init__',\n return_value=None)\n", (2479, 2558), False, 'from unittest import mock\n'), ((4115, 4204), 'unittest.mock.patch'...
import numpy as np import scipy.stats as sts class Correlation: """ Given a dataframe of the automatic metric scores of some candidates along with human DA scores, it computes the Pearson correlation coefficient (as a default choice) of each candidate, and make a cluster of their ranks with t...
[ "numpy.argsort", "numpy.zeros", "numpy.where", "numpy.array" ]
[((582, 625), 'numpy.array', 'np.array', (['self.frame[col]'], {'dtype': 'np.float64'}), '(self.frame[col], dtype=np.float64)\n', (590, 625), True, 'import numpy as np\n'), ((1228, 1246), 'numpy.argsort', 'np.argsort', (['values'], {}), '(values)\n', (1238, 1246), True, 'import numpy as np\n'), ((1344, 1372), 'numpy.wh...
"""Module implementing point transformations and their matrices.""" import numpy as np def axis_angle_rotation(axis, angle, point=None, deg=True): r"""Return a 4x4 matrix for rotation about any axis by given angle. Rotations around an axis that contains the origin can easily be computed using Rodrigues' ...
[ "numpy.outer", "numpy.asarray", "numpy.zeros", "numpy.isclose", "numpy.sin", "numpy.linalg.norm", "numpy.cos", "numpy.eye" ]
[((2953, 2986), 'numpy.asarray', 'np.asarray', (['axis'], {'dtype': '"""float64"""'}), "(axis, dtype='float64')\n", (2963, 2986), True, 'import numpy as np\n'), ((3292, 3312), 'numpy.linalg.norm', 'np.linalg.norm', (['axis'], {}), '(axis)\n', (3306, 3312), True, 'import numpy as np\n'), ((3320, 3344), 'numpy.isclose', ...
import numpy as np import scipy as sp import scipy.linalg import scipy.sparse import numba import time from .tree import Tree from .misc.mkl_sparse import SpMV_viaMKL def get_level_information(node_width, theta): # get information for this level dd = 0.01 r1 = 0.5*node_width*(np.sqrt(2)+dd) r2 = 0.5*no...
[ "numpy.empty", "numba.njit", "numpy.argsort", "numpy.sin", "numpy.arange", "numba.prange", "numpy.zeros_like", "numpy.logical_not", "scipy.sparse.coo_matrix", "numpy.linspace", "numpy.cos", "numpy.dot", "numpy.concatenate", "numpy.logical_and", "scipy.linalg.lu_solve", "numpy.zeros", ...
[((17713, 17802), 'numba.njit', 'numba.njit', (['"""(b1[:],i8[:],i8[:,:],f8[:],f8[:],f8[:,:],f8[:,:,:,:],i8)"""'], {'parallel': '(True)'}), "('(b1[:],i8[:],i8[:,:],f8[:],f8[:],f8[:,:],f8[:,:,:,:],i8)',\n parallel=True)\n", (17723, 17802), False, 'import numba\n'), ((31306, 31359), 'numba.njit', 'numba.njit', (['"""i...
import numpy as np import properties from .... import survey from ....utils import Zero class BaseSrc(survey.BaseSrc): """ Base DC source """ _q = None def __init__(self, receiver_list, location, current=1.0, **kwargs): super().__init__(receiver_list=receiver_list, **kwargs) sel...
[ "numpy.full_like", "numpy.sum", "numpy.asarray", "numpy.zeros", "numpy.atleast_2d" ]
[((559, 589), 'numpy.asarray', 'np.asarray', (['other'], {'dtype': 'float'}), '(other, dtype=float)\n', (569, 589), True, 'import numpy as np\n'), ((606, 626), 'numpy.atleast_2d', 'np.atleast_2d', (['other'], {}), '(other)\n', (619, 626), True, 'import numpy as np\n'), ((2354, 2389), 'numpy.full_like', 'np.full_like', ...
# -*- coding: utf-8 -*- # adapted from https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/transforms/augmentation.py import sys import inspect import random import numpy as np import pprint from abc import ABCMeta, abstractmethod from typing import List, Optional, Tuple, Union from PIL import Im...
[ "numpy.pad", "numpy.random.uniform", "pprint.pformat", "numpy.ceil", "numpy.asarray", "numpy.floor", "random.choice", "numpy.random.randint", "numpy.array", "inspect.signature", "numpy.random.normal", "numpy.random.choice", "numpy.random.rand" ]
[((28939, 28963), 'random.choice', 'random.choice', (['instances'], {}), '(instances)\n', (28952, 28963), False, 'import random\n'), ((28980, 29017), 'numpy.asarray', 'np.asarray', (['crop_size'], {'dtype': 'np.int32'}), '(crop_size, dtype=np.int32)\n', (28990, 29017), True, 'import numpy as np\n'), ((29601, 29644), 'n...
# Copyright 2020 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[ "scipy.linalg.expm", "numpy.abs", "numpy.argmax", "numpy.linalg.eigh", "openfermion.prepare_one_body_squared_evolution", "numpy.real", "openfermion.low_rank_two_body_decomposition" ]
[((2905, 3032), 'openfermion.low_rank_two_body_decomposition', 'low_rank_two_body_decomposition', (['self.tei'], {'truncation_threshold': 'threshold', 'final_rank': 'self.lmax', 'spin_basis': 'self.spin_basis'}), '(self.tei, truncation_threshold=threshold,\n final_rank=self.lmax, spin_basis=self.spin_basis)\n', (293...
""" G R A D I E N T - E N H A N C E D N E U R A L N E T W O R K S (G E N N) Author: <NAME> <<EMAIL>> This package is distributed under New BSD license. """ import numpy as np def compute_precision(Y_pred, Y_true): """ Compute precision = True positives / Total Number of Predicted Positives ...
[ "numpy.std", "numpy.mean", "numpy.square" ]
[((3429, 3452), 'numpy.std', 'np.std', (['(Y_pred - Y_true)'], {}), '(Y_pred - Y_true)\n', (3435, 3452), True, 'import numpy as np\n'), ((3462, 3486), 'numpy.mean', 'np.mean', (['(Y_pred - Y_true)'], {}), '(Y_pred - Y_true)\n', (3469, 3486), True, 'import numpy as np\n'), ((4215, 4230), 'numpy.mean', 'np.mean', (['Y_tr...
import numpy as np import pickle import tensorflow as tf def DataNormalisationZeroCentred(InputData, AverageData=None): if AverageData is None: AverageData = np.mean(InputData, axis=0) NormalisedData = InputData - AverageData else: NormalisedData = InputData - AverageData return N...
[ "numpy.mean", "pickle.load", "tensorflow.keras.models.load_model" ]
[((399, 486), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (["(model_folder + 'BinaryClassification/saved_model.model')"], {}), "(model_folder +\n 'BinaryClassification/saved_model.model')\n", (425, 486), True, 'import tensorflow as tf\n'), ((611, 634), 'pickle.load', 'pickle.load', (['reader_...
# -*- coding: utf-8 -*- """Plot module for Seispy Toolbox """ import numpy as np import matplotlib.pyplot as plt import pyqtgraph as pg from pyqtgraph.Qt import QtGui __all__ = ['wiggle', 'traces', 'show'] def insert_zeros(trace, tt=None): """Insert zero locations in data trace and tt vector based on linear ...
[ "pyqtgraph.setConfigOption", "pyqtgraph.Qt.QtGui.QApplication.instance", "numpy.random.randn", "numpy.std", "numpy.zeros", "numpy.split", "numpy.min", "numpy.diff", "numpy.arange", "numpy.array", "numpy.signbit", "matplotlib.pyplot.gca", "numpy.max", "pyqtgraph.plot", "pyqtgraph.setConfi...
[((651, 675), 'numpy.split', 'np.split', (['tt', '(zc_idx + 1)'], {}), '(tt, zc_idx + 1)\n', (659, 675), True, 'import numpy as np\n'), ((694, 721), 'numpy.split', 'np.split', (['trace', '(zc_idx + 1)'], {}), '(trace, zc_idx + 1)\n', (702, 721), True, 'import numpy as np\n'), ((3781, 3790), 'matplotlib.pyplot.gca', 'pl...
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to us...
[ "numpy.asarray", "numpy.array", "numpy.arange", "numpy.linalg.norm", "itertools.product", "random.gauss", "psutil.cpu_count" ]
[((1629, 1660), 'psutil.cpu_count', 'psutil.cpu_count', ([], {'logical': '(False)'}), '(logical=False)\n', (1645, 1660), False, 'import psutil\n'), ((2594, 2638), 'numpy.array', 'np.array', (['static_lidar_noise'], {'dtype': 'np.float'}), '(static_lidar_noise, dtype=np.float)\n', (2602, 2638), True, 'import numpy as np...
import array import random import numpy as np from deap import algorithms from deap import base from deap import creator from deap import tools # パラメータ定義テーブル(Ax仕様) PARAMETERS = [ { "name": "x1", "type": "range", "bounds": [-10.0, 10.0], "value_type": "float", }, { ...
[ "deap.base.Toolbox", "deap.tools.Statistics", "deap.creator.create", "numpy.array", "deap.algorithms.eaSimple", "deap.tools.HallOfFame" ]
[((441, 480), 'numpy.array', 'np.array', (['[128, 64, 32, 16, 8, 4, 2, 1]'], {}), '([128, 64, 32, 16, 8, 4, 2, 1])\n', (449, 480), True, 'import numpy as np\n'), ((900, 959), 'deap.creator.create', 'creator.create', (['"""FitnessMin"""', 'base.Fitness'], {'weights': '(-1.0,)'}), "('FitnessMin', base.Fitness, weights=(-...
""" Module to process and analyse rheology data containing stress ramps Created: March 24th, 2020 Author: <NAME> """ import pandas as pd import numpy as np import matplotlib.pyplot as plt class Rstressramp(): """ Class with the functions relevant to stress ramps Main focus on extracting data from .csv f...
[ "matplotlib.pyplot.loglog", "pandas.read_csv", "numpy.logspace", "numpy.isnan", "matplotlib.pyplot.figure", "numpy.mean", "numpy.interp", "matplotlib.pyplot.fill_between", "pandas.DataFrame", "numpy.std", "numpy.max", "numpy.log10", "matplotlib.pyplot.pause", "numpy.min", "matplotlib.pyp...
[((2099, 2142), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'sep': 'sep', 'decimal': 'dec'}), '(filename, sep=sep, decimal=dec)\n', (2110, 2142), True, 'import pandas as pd\n'), ((5868, 5884), 'numpy.array', 'np.array', (['stress'], {}), '(stress)\n', (5876, 5884), True, 'import numpy as np\n'), ((5902, 5918), 'n...
import numpy as np import matplotlib.pyplot as plt from copy import deepcopy from numpy.linalg import inv from scipy.linalg import schur, sqrtm import numpy as np def invSqrt(a,b,c): eps = 1e-12 mask = (b != 0) r1 = mask * (c - a) / (2. * b + eps) t1 = np.sign(r1) / (np.abs(r1) + np.sqrt(1. + r1...
[ "copy.deepcopy", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.plot", "matplotlib.pyplot.imshow", "numpy.zeros", "numpy.ones", "matplotlib.pyplot.figure", "numpy.linalg.svd", "numpy.array", "numpy.sin", "numpy.linspace", "numpy.sign", "numpy.matmul", "numpy.cos", "numpy.dia...
[((550, 564), 'numpy.sqrt', 'np.sqrt', (['(x * z)'], {}), '(x * z)\n', (557, 564), True, 'import numpy as np\n'), ((748, 764), 'numpy.zeros', 'np.zeros', (['(2, 3)'], {}), '((2, 3))\n', (756, 764), True, 'import numpy as np\n'), ((974, 1020), 'numpy.sqrt', 'np.sqrt', (['(A[0, 0] * A[1, 1] - A[1, 0] * A[0, 1])'], {}), '...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "sys.path.append", "functools.partial", "program_config.OpConfig", "hypothesis.strategies.sampled_from", "numpy.random.random", "numpy.random.randint", "hypothesis.strategies.integers", "hypothesis.strategies.floats" ]
[((622, 643), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (637, 643), False, 'import sys\n'), ((1647, 1769), 'program_config.OpConfig', 'OpConfig', ([], {'type': '"""increment"""', 'inputs': "{'X': ['input_data']}", 'outputs': "{'Out': ['output_data']}", 'attrs': "{'step': step_data}"}), "(typ...
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "paddle.fluid.layers.reduce_min", "paddle.fluid.initializer.Constant", "numpy.sin", "numpy.arange", "paddle.fluid.layers.transpose", "paddle.fluid.layers.softmax_with_cross_entropy", "paddle.fluid.layers.concat", "paddle.fluid.layers.reduce_sum", "paddle.fluid.layers.greater_than", "paddle.fluid.l...
[((1145, 1166), 'numpy.arange', 'np.arange', (['n_position'], {}), '(n_position)\n', (1154, 1166), True, 'import numpy as np\n'), ((1427, 1454), 'numpy.expand_dims', 'np.expand_dims', (['position', '(1)'], {}), '(position, 1)\n', (1441, 1454), True, 'import numpy as np\n'), ((1457, 1490), 'numpy.expand_dims', 'np.expan...
import numpy as np from scipy import optimize import logging logger = logging.getLogger(__name__) def scipyFit(x, y, method,p0 = None,boundaries = (-np.inf, np.inf),sigma = None): if boundaries is not None and len(boundaries) != 2: raise ValueError("Boundaries need to be a two 2D tuple") if p0 is not...
[ "numpy.sum", "numpy.zeros", "scipy.optimize.curve_fit", "numpy.append", "numpy.sinc", "numpy.sin", "numpy.arange", "numpy.exp", "numpy.diag", "logging.getLogger", "numpy.sqrt" ]
[((71, 98), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (88, 98), False, 'import logging\n'), ((519, 590), 'scipy.optimize.curve_fit', 'optimize.curve_fit', (['method', 'x', 'y'], {'p0': 'p0', 'bounds': 'boundaries', 'sigma': 'sigma'}), '(method, x, y, p0=p0, bounds=boundaries, sigma=s...
# Copyright 2008-2018 pydicom authors. See LICENSE file for details. """ Use the jpeg_ls (CharPyLS) python package to decode pixel transfer syntaxes. """ try: import numpy HAVE_NP = True except ImportError: HAVE_NP = False try: import jpeg_ls HAVE_JPEGLS = True except ImportError: HAVE_JPEGLS ...
[ "numpy.frombuffer", "numpy.dtype", "pydicom.pixel_data_handlers.util.dtype_corrected_for_endianness" ]
[((3358, 3434), 'pydicom.pixel_data_handlers.util.dtype_corrected_for_endianness', 'dtype_corrected_for_endianness', (['dicom_dataset.is_little_endian', 'numpy_format'], {}), '(dicom_dataset.is_little_endian, numpy_format)\n', (3388, 3434), False, 'from pydicom.pixel_data_handlers.util import dtype_corrected_for_endian...
import importlib from hydroDL.master import basins from hydroDL.app import waterQuality from hydroDL import kPath from hydroDL.model import trainTS from hydroDL.data import gageII, usgs from hydroDL.post import axplot, figplot import torch import os import json import numpy as np import pandas as pd import matplotlib....
[ "hydroDL.post.axplot.plotTS", "hydroDL.app.waterQuality.calErrSeq", "hydroDL.post.figplot.clickMap", "numpy.datetime64", "hydroDL.master.basins.testModel", "hydroDL.app.waterQuality.DataModelWQ", "hydroDL.master.basins.loadSeq", "importlib.reload", "hydroDL.master.basins.loadMaster", "numpy.array"...
[((389, 415), 'hydroDL.master.basins.loadMaster', 'basins.loadMaster', (['outName'], {}), '(outName)\n', (406, 415), False, 'from hydroDL.master import basins\n'), ((455, 489), 'hydroDL.app.waterQuality.DataModelWQ', 'waterQuality.DataModelWQ', (['dataName'], {}), '(dataName)\n', (479, 489), False, 'from hydroDL.app im...
import os import typing import numpy as np from aocd import get_data from dotenv import load_dotenv from utils import timeit def get_session() -> str: load_dotenv() return os.getenv('SESSION_COOKIE') def get_list(data: str = None, day: int = None, year: int = None) -> typing.List: if not data: ...
[ "numpy.sum", "numpy.roll", "numpy.zeros", "dotenv.load_dotenv", "os.getenv" ]
[((159, 172), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (170, 172), False, 'from dotenv import load_dotenv\n'), ((184, 211), 'os.getenv', 'os.getenv', (['"""SESSION_COOKIE"""'], {}), "('SESSION_COOKIE')\n", (193, 211), False, 'import os\n'), ((1342, 1371), 'numpy.zeros', 'np.zeros', (['(9)'], {'dtype': 'np...
import pickle from keras.models import load_model from sklearn.preprocessing import MultiLabelBinarizer from gensim import models from nltk.tokenize import RegexpTokenizer from stop_words import get_stop_words import numpy as np import subprocess subprocess.call(['sh', 'src/models/get_word2vec.sh']) with open('data/p...
[ "keras.models.load_model", "nltk.tokenize.RegexpTokenizer", "stop_words.get_stop_words", "numpy.zeros", "numpy.argsort", "pickle.load", "subprocess.call", "gensim.models.KeyedVectors.load_word2vec_format" ]
[((248, 301), 'subprocess.call', 'subprocess.call', (["['sh', 'src/models/get_word2vec.sh']"], {}), "(['sh', 'src/models/get_word2vec.sh'])\n", (263, 301), False, 'import subprocess\n'), ((413, 448), 'keras.models.load_model', 'load_model', (['"""models/overview_nn.h5"""'], {}), "('models/overview_nn.h5')\n", (423, 448...
# -*- coding: utf-8 -*- """ Created on Mon Dec 17 02:27:29 2018 @author: james """ # -*- coding: utf-8 -*- """ Created on Thu Nov 29 15:00:40 2018 @author: JamesChiou """ import os import random import time import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F impo...
[ "os.mkdir", "numpy.random.seed", "numpy.argmax", "pandas.read_csv", "torch.nn.functional.dropout", "torch.cat", "torch.nn.Softmax", "torch.device", "torchvision.transforms.Normalize", "pandas.DataFrame", "torch.utils.data.DataLoader", "torch.nn.functional.avg_pool2d", "torch.load", "torchv...
[((5450, 5475), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (5473, 5475), False, 'import torch\n'), ((5609, 5632), 'random.seed', 'random.seed', (['randomSeed'], {}), '(randomSeed)\n', (5620, 5632), False, 'import random\n'), ((5633, 5662), 'torch.manual_seed', 'torch.manual_seed', (['random...
import pathlib import matplotlib.pyplot as plt import numpy as np import imageio def correct_line_shift(img: np.ndarray, value: int): """Corrects the lineshift of a given image.""" rolled = np.roll(img[::2, :], value, axis=1) img[::2, :] = rolled return img def show_corrected_image(img: np.ndarray)...
[ "imageio.imread", "pathlib.Path", "matplotlib.pyplot.subplots", "numpy.roll" ]
[((201, 236), 'numpy.roll', 'np.roll', (['img[::2, :]', 'value'], {'axis': '(1)'}), '(img[::2, :], value, axis=1)\n', (208, 236), True, 'import numpy as np\n'), ((336, 350), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (348, 350), True, 'import matplotlib.pyplot as plt\n'), ((468, 516), 'pathlib.Path...
from collections import defaultdict from typing import Any, Callable, Dict, Iterable, Sequence import numpy as np import pandas as pd import scipy.optimize from invoice_net.parsers import ( parses_as_full_date, parses_as_amount, parses_as_invoice_number, ) from invoice_net.data_handler import DataHandler ...
[ "pandas.DataFrame", "pandas.pivot_table", "collections.defaultdict", "numpy.where", "numpy.array", "pandas.DataFrame.from_records", "pandas.concat" ]
[((723, 737), 'numpy.array', 'np.array', (['mask'], {}), '(mask)\n', (731, 737), True, 'import numpy as np\n'), ((939, 972), 'collections.defaultdict', 'defaultdict', (['(lambda : lambda x: x)'], {}), '(lambda : lambda x: x)\n', (950, 972), False, 'from collections import defaultdict\n'), ((1434, 1451), 'pandas.concat'...
# Copyright 2019 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...
[ "tests.common.tensorio.compare_tensor", "tests.common.gen_random.random_gaussian", "akg.utils.kernel_exec.op_build_test", "numpy.broadcast_to", "akg.topi.util.get_const_tuple", "akg.utils.kernel_exec.mod_launch" ]
[((1025, 1143), 'akg.utils.kernel_exec.op_build_test', 'utils.op_build_test', (['prelu.prelu', '[shape, w_shape]', '[dtype, dtype]'], {'kernel_name': 'kernel_name', 'attrs': 'attrs', 'tuning': 't'}), '(prelu.prelu, [shape, w_shape], [dtype, dtype],\n kernel_name=kernel_name, attrs=attrs, tuning=t)\n', (1044, 1143), ...
import gensim import pandas as pd import numpy as np from gensim.models.wrappers import LdaMallet import sys """ This class is creates a list of n recommendations that are the most similar to a list of paintings liked by the user. It uses a Latent Dirichlet Allocation approach which expresses the paintings as ...
[ "pandas.read_csv", "numpy.load", "numpy.sum", "gensim.models.wrappers.LdaMallet.load" ]
[((636, 684), 'pandas.read_csv', 'pd.read_csv', (['"""resources/datasets/ng-dataset.csv"""'], {}), "('resources/datasets/ng-dataset.csv')\n", (647, 684), True, 'import pandas as pd\n'), ((943, 972), 'gensim.models.wrappers.LdaMallet.load', 'LdaMallet.load', (['path_to_model'], {}), '(path_to_model)\n', (957, 972), Fals...
#!/usr/bin/python """ Write random data to the data.txt file takes in a universe size M, writes n random digits to the universe M """ import argparse import numpy as np def main(): parser = argparse.ArgumentParser() parser.add_argument('--M', metavar='M', type=int, default=100, help='The size of the unive...
[ "numpy.random.randint", "argparse.ArgumentParser" ]
[((196, 221), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (219, 221), False, 'import argparse\n'), ((603, 633), 'numpy.random.randint', 'np.random.randint', (['(0)', '(M - 1)', 'n'], {}), '(0, M - 1, n)\n', (620, 633), True, 'import numpy as np\n')]
import os from collections import Counter from itertools import islice, combinations from multiprocessing import Pool, cpu_count from tqdm import tqdm import numpy as np import pandas as pd import nltk try: nltk.pos_tag(nltk.word_tokenize('This is a test sentence.')) except LookupError: print('Installing nltk ...
[ "tqdm.tqdm", "os.remove", "nltk.pos_tag", "collections.Counter", "nltk.ngrams", "os.path.isfile", "itertools.combinations", "itertools.islice", "multiprocessing.Pool", "nltk.download", "pandas.concat", "nltk.word_tokenize", "numpy.prod", "multiprocessing.cpu_count" ]
[((225, 271), 'nltk.word_tokenize', 'nltk.word_tokenize', (['"""This is a test sentence."""'], {}), "('This is a test sentence.')\n", (243, 271), False, 'import nltk\n'), ((345, 388), 'nltk.download', 'nltk.download', (['"""averaged_perceptron_tagger"""'], {}), "('averaged_perceptron_tagger')\n", (358, 388), False, 'im...
#!/usr/bin/env python # coding: utf-8 # <img style="float: left;" src="earth-lab-logo-rgb.png" width="150" height="150" /> # # # Earth Analytics Education - EA Python Course Spring 2021 # ## Important - Assignment Guidelines # # 1. Before you submit your assignment to GitHub, make sure to run the entire notebook ...
[ "pandas.DataFrame", "earthpy.data.get_data", "rioxarray.open_rasterio", "os.getcwd", "numpy.allclose", "matplotcheck.notebook.convert_axes", "datetime.datetime.now", "matplotlib.pyplot.subplots", "datetime.datetime.strptime", "matplotlib.dates.DateFormatter", "numpy.nanmean", "xarray.where", ...
[((9028, 9063), 'earthpy.data.get_data', 'et.data.get_data', (['"""ndvi-automation"""'], {}), "('ndvi-automation')\n", (9044, 9063), True, 'import earthpy as et\n'), ((9115, 9166), 'os.path.join', 'os.path.join', (['et.io.HOME', '"""earth-analytics"""', '"""data"""'], {}), "(et.io.HOME, 'earth-analytics', 'data')\n", (...
# -*- coding: utf-8 -*- # @Time : 2018/8/23 22:21 # @Author : zhoujun import os import cv2 import numpy as np import torch from utils import CTCLabelConverter,AttnLabelConverter from data_loader import get_transforms class PytorchNet: def __init__(self, model_path, gpu_id=None): """ 初始化模型 ...
[ "torch.jit.trace", "matplotlib.font_manager.FontProperties", "cv2.cvtColor", "torch.load", "data_loader.get_transforms", "os.path.exists", "utils.CTCLabelConverter", "numpy.zeros", "time.time", "numpy.column_stack", "cv2.imread", "utils.AttnLabelConverter", "torch.cuda.is_available", "torc...
[((4020, 4047), 'torch.jit.trace', 'torch.jit.trace', (['net', 'input'], {}), '(net, input)\n', (4035, 4047), False, 'import torch\n'), ((4277, 4318), 'matplotlib.font_manager.FontProperties', 'FontProperties', ([], {'fname': '"""msyh.ttc"""', 'size': '(14)'}), "(fname='msyh.ttc', size=14)\n", (4291, 4318), False, 'fro...
# -*- coding: utf-8 -*- """ Created on Tue Nov 24 20:37:03 2020 @author: Shiro """ import pandas as pd import copy import numpy as np ## put inside listes the csv file representing the prediction of a model listes = ["model_pl_A-5folds-CV-seed42-bs16-mixup.csv", "model_pl_B-5folds-CV-seed42-bs16-mi...
[ "pandas.read_csv", "copy.deepcopy", "numpy.stack" ]
[((460, 480), 'copy.deepcopy', 'copy.deepcopy', (['df[0]'], {}), '(df[0])\n', (473, 480), False, 'import copy\n'), ((337, 351), 'pandas.read_csv', 'pd.read_csv', (['l'], {}), '(l)\n', (348, 351), True, 'import pandas as pd\n'), ((402, 440), 'numpy.stack', 'np.stack', (['[d[cols].values for d in df]'], {}), '([d[cols].v...
import numpy as np import pandas as pd import matplotlib.pyplot as plt # true parameters c = { 'one': 0.0, 'x1': 0.6, 'x2': 0.2, 'id1': 0.2, 'id2': 0.5, 'pz': 0.2 } # poisson dampening pfact = 100 def dataset(N=1_000_000, K1=10, K2=100, seed=89320432): # init random st = np.random.Ran...
[ "numpy.linspace", "matplotlib.pyplot.subplots", "numpy.exp", "numpy.random.RandomState" ]
[((307, 334), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (328, 334), True, 'import numpy as np\n'), ((844, 863), 'numpy.exp', 'np.exp', (["df['yhat0']"], {}), "(df['yhat0'])\n", (850, 863), True, 'import numpy as np\n'), ((879, 897), 'numpy.exp', 'np.exp', (["df['yhat']"], {}), "(d...
import h5py import numpy as np import uuid import yaml import os, sys class SaveData: def __init__(self, logger, data_dir, timestamp): self.logger = logger self.data_dir = data_dir self.timestamp = timestamp self.dirs = self.data_dir + '/' + timestamp if not os.path.exists(s...
[ "h5py.File", "os.makedirs", "yaml.dump", "os.path.exists", "numpy.array", "sys.exit" ]
[((304, 329), 'os.path.exists', 'os.path.exists', (['self.dirs'], {}), '(self.dirs)\n', (318, 329), False, 'import os, sys\n'), ((343, 365), 'os.makedirs', 'os.makedirs', (['self.dirs'], {}), '(self.dirs)\n', (354, 365), False, 'import os, sys\n'), ((381, 417), 'os.path.exists', 'os.path.exists', (["(self.dirs + '/yaml...
#!/usr/bin/env python import argparse import os.path as osp import re import chainer from chainer import cuda import fcn import numpy as np import tqdm def main(): parser = argparse.ArgumentParser() parser.add_argument('model_file') parser.add_argument('-g', '--gpu', default=0, type=int, ...
[ "fcn.utils.label_accuracy_score", "chainer.Variable", "argparse.ArgumentParser", "chainer.serializers.load_npz", "os.path.basename", "chainer.cuda.get_device", "chainer.functions.argmax", "re.match", "numpy.expand_dims", "chainer.cuda.to_cpu", "chainer.no_backprop_mode", "chainer.cuda.to_gpu",...
[((181, 206), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (204, 206), False, 'import argparse\n'), ((416, 458), 'fcn.datasets.VOC2011ClassSeg', 'fcn.datasets.VOC2011ClassSeg', (['"""seg11valid"""'], {}), "('seg11valid')\n", (444, 458), False, 'import fcn\n'), ((1010, 1062), 'chainer.serializ...
import numpy as np import matplotlib.pyplot as plt if __name__ == '__main__': fig = plt.figure() ax = fig.gca(projection='3d') x = np.arange(-10, 10, 0.1) y = np.arange(-10, 10, 0.1) x, y = np.meshgrid(x, y) res = 0 for i in range(3): res = res + np.abs(x * np.sin(x) + 0.1 * x + y *...
[ "matplotlib.pyplot.title", "numpy.meshgrid", "matplotlib.pyplot.show", "matplotlib.pyplot.figure", "numpy.sin", "numpy.arange", "matplotlib.pyplot.contour", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((89, 101), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (99, 101), True, 'import matplotlib.pyplot as plt\n'), ((144, 167), 'numpy.arange', 'np.arange', (['(-10)', '(10)', '(0.1)'], {}), '(-10, 10, 0.1)\n', (153, 167), True, 'import numpy as np\n'), ((176, 199), 'numpy.arange', 'np.arange', (['(-10)', ...
# SPDX-FileCopyrightText: 2014-2020 <NAME> # # SPDX-License-Identifier: MIT from __future__ import division, print_function import pytest import pickle from collections import OrderedDict import numpy as np from symfit import ( Variable, Parameter, Fit, FitResults, Eq, Ge, CallableNumericalModel, Model ) from sym...
[ "pickle.loads", "numpy.meshgrid", "symfit.Parameter", "symfit.Model", "numpy.random.seed", "symfit.Eq", "symfit.CallableNumericalModel.as_constraint", "numpy.histogram2d", "symfit.Fit", "symfit.distributions.BivariateGaussian", "numpy.random.multivariate_normal", "numpy.linspace", "pytest.ap...
[((761, 783), 'numpy.linspace', 'np.linspace', (['(1)', '(10)', '(10)'], {}), '(1, 10, 10)\n', (772, 783), True, 'import numpy as np\n'), ((832, 846), 'symfit.Parameter', 'Parameter', (['"""a"""'], {}), "('a')\n", (841, 846), False, 'from symfit import Variable, Parameter, Fit, FitResults, Eq, Ge, CallableNumericalMode...
# coding: utf-8 import os import numpy as np import matplotlib.pyplot as plt from scipy.misc import toimage import pandas as pd import time #from sklearn.model_selection import KFold #from sklearn.model_selection import train_test_split from keras.datasets import cifar10 from keras.models import Sequential from keras...
[ "matplotlib.pyplot.title", "keras.preprocessing.image.ImageDataGenerator", "pandas.read_csv", "matplotlib.pyplot.figure", "os.path.join", "pandas.DataFrame", "scipy.misc.toimage", "keras.datasets.cifar10.load_data", "matplotlib.pyplot.imshow", "os.path.exists", "keras.layers.Flatten", "time.cl...
[((1581, 1593), 'time.clock', 'time.clock', ([], {}), '()\n', (1591, 1593), False, 'import time\n'), ((1915, 1934), 'keras.datasets.cifar10.load_data', 'cifar10.load_data', ([], {}), '()\n', (1932, 1934), False, 'from keras.datasets import cifar10\n'), ((2142, 2183), 'keras.utils.np_utils.to_categorical', 'np_utils.to_...
# coding=utf-8 from __future__ import division from pprint import pprint import logging import numpy as np import onnx import onnxruntime import torch import torch.onnx import cv2 from utils.image import get_affine_transform from utils.post_process import ctdet_post_process from models.decode import mot_decode device...
[ "onnxruntime.InferenceSession", "cv2.warpAffine", "cv2.imread", "numpy.array", "torch.cuda.is_available", "utils.image.get_affine_transform", "torch.device", "onnx.checker.check_model", "models.decode.mot_decode", "onnx.load", "cv2.resize", "torch.from_numpy" ]
[((347, 372), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (370, 372), False, 'import torch\n'), ((323, 343), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (335, 343), False, 'import torch\n'), ((378, 397), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n"...
import argparse import logging import sys from faker import Faker import numpy as np import pandas as pd import user_agents from ndc.utils import get_device_class, DEVICE_CLASS_NAMES logger = logging.getLogger(__name__) def fake_data(n=1000): fake = Faker() df = pd.DataFrame( columns=('device_class...
[ "pandas.DataFrame", "user_agents.parse", "argparse.ArgumentParser", "faker.Faker", "ndc.utils.get_device_class", "numpy.random.RandomState", "argparse.FileType", "logging.getLogger" ]
[((195, 222), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (212, 222), False, 'import logging\n'), ((259, 266), 'faker.Faker', 'Faker', ([], {}), '()\n', (264, 266), False, 'from faker import Faker\n'), ((276, 352), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "('device_class', ...
################################################################################ # Copyright (c) 2009-2019, National Research Foundation (Square Kilometre Array) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy # of the...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.clf", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figtext", "matplotlib.pyplot.figure", "numpy.arange", "numpy.log10", "matplotlib.pyplot.xticks", "katpoint.Antenna" ]
[((858, 921), 'katpoint.Antenna', 'katpoint.Antenna', (['"""KAT7, -30:43:17.34, 21:24:38.46, 1038, 12.0"""'], {}), "('KAT7, -30:43:17.34, 21:24:38.46, 1038, 12.0')\n", (874, 921), False, 'import katpoint\n'), ((949, 979), 'numpy.arange', 'np.arange', (['(900.0)', '(2100.0)', '(10.0)'], {}), '(900.0, 2100.0, 10.0)\n', (...
""" pso.py This code is part of Optimization of Hardware Parameters on a Real-Time Sound Localization System paper It contains the implementation of Particle Swarm Optimization, the strategy of finding the best configuration Authors: <NAME> <NAME> <NAME> <NAME> """ import numpy as np import matplotl...
[ "pickle.dump", "numpy.sum", "numpy.array_str", "numpy.ones", "mle.mle_hls", "pickle.load", "numpy.mean", "numpy.round", "numpy.zeros_like", "numpy.random.randn", "numpy.std", "os.path.exists", "mle.randParticle", "numpy.max", "mle.arrayMatrix", "numpy.reshape", "numpy.linspace", "i...
[((946, 968), 'numpy.linspace', 'np.linspace', (['(1)', '(10)', '(10)'], {}), '(1, 10, 10)\n', (957, 968), True, 'import numpy as np\n'), ((976, 1021), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(10)'], {'endpoint': '(False)'}), '(0, 2 * np.pi, 10, endpoint=False)\n', (987, 1021), True, 'import numpy as ...
import numpy as np # KERAS: neural network lib import keras.backend as K from keras.layers import Input, Dense, Embedding, LSTM, SimpleRNN from keras.layers import GlobalAveragePooling1D, merge, Flatten from keras.layers import TimeDistributed from keras.optimizers import RMSprop, Nadam from keras.models import Model...
[ "keras.layers.SimpleRNN", "keras.utils.visualize_util.plot", "numpy.atleast_3d", "keras.layers.GlobalAveragePooling1D", "keras.backend.expand_dims", "keras.layers.LSTM", "keras.models.Model", "keras.optimizers.Nadam", "numpy.random.randint", "keras.layers.Dense", "keras.layers.Embedding", "ker...
[((1110, 1169), 'keras.utils.visualize_util.plot', 'plot', (['self.model'], {'show_shapes': '(True)', 'to_file': "(exp_id + '.png')"}), "(self.model, show_shapes=True, to_file=exp_id + '.png')\n", (1114, 1169), False, 'from keras.utils.visualize_util import plot\n'), ((1209, 1270), 'keras.layers.Input', 'Input', ([], {...
import numpy as np import h5py import matplotlib from matplotlib import colors import matplotlib.pyplot as plt import matplotlib.patches as ptch from matplotlib.artist import setp from matplotlib.collections import PatchCollection from matplotlib.lines import Line2D import os from shapely.geometry import Point, Polygon...
[ "numpy.sum", "matplotlib.patches.Rectangle", "matplotlib.colors.BoundaryNorm", "os.path.exists", "matplotlib.patches.Circle", "matplotlib.pyplot.figure", "numpy.where", "numpy.arange", "numpy.loadtxt", "matplotlib.pyplot.gca", "matplotlib.collections.PatchCollection", "matplotlib.colors.Listed...
[((553, 566), 'matplotlib.pyplot.figure', 'plt.figure', (['(0)'], {}), '(0)\n', (563, 566), True, 'import matplotlib.pyplot as plt\n'), ((612, 650), 'matplotlib.colors.ListedColormap', 'colors.ListedColormap', (["['red', 'blue']"], {}), "(['red', 'blue'])\n", (633, 650), False, 'from matplotlib import colors\n'), ((675...
#!/usr/bin/env python3 # -*-coding: utf-8 -*- # help = 'モデルとモデルパラメータを利用して推論実行する' # import logging # basicConfig()は、 debug()やinfo()を最初に呼び出す"前"に呼び出すこと logging.basicConfig(format='%(message)s') level = logging.INFO logging.getLogger('Tools').setLevel(level=level) import cv2 import time import argparse import numpy as np...
[ "traceback.print_exc", "chainer.functions.classification_summary", "argparse.ArgumentParser", "logging.basicConfig", "chainer.serializers.load_npz", "cv2.cvtColor", "chainer.cuda.get_device_from_id", "Tools.func.argsPrint", "Tools.func.checkModelType", "time.time", "Tools.getfunc.jsonData", "n...
[((150, 191), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(message)s"""'}), "(format='%(message)s')\n", (169, 191), False, 'import logging\n'), ((657, 698), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'help'}), '(description=help)\n', (680, 698), False, 'import argp...
# -*- coding: utf-8 -*- """ @author: <EMAIL> """ import numpy as np class FibonacciCalculator: """ The class calculates Fibonacci series using varies dynamic programming algorithms. """ def __init__(self): self.number_of_sum = 0 self.number_of_mul = 0 self.number_of_dict_q...
[ "numpy.dot", "numpy.array" ]
[((2090, 2116), 'numpy.array', 'np.array', (['[[0, 1], [1, 1]]'], {}), '([[0, 1], [1, 1]])\n', (2098, 2116), True, 'import numpy as np\n'), ((2284, 2354), 'numpy.dot', 'np.dot', (['self.fibonacci_log_dict[n / 2]', 'self.fibonacci_log_dict[n / 2]'], {}), '(self.fibonacci_log_dict[n / 2], self.fibonacci_log_dict[n / 2])\...
import itertools import torch from scipy.stats import describe import numpy as np from src import CONFIG from src.train import MetaOptimizer WEIGHT_DECAY = 1e-3 def test(): update_params = False meta_learner = MetaOptimizer() model = CONFIG.model_class() state = None results = [] for...
[ "matplotlib.pyplot.title", "scipy.signal.savgol_filter", "main.proc_flags", "matplotlib.pyplot.show", "src.CONFIG.model_class", "ipdb.set_trace", "itertools.count", "src.train.MetaOptimizer", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "torch.isnan", "numpy.prod" ]
[((226, 241), 'src.train.MetaOptimizer', 'MetaOptimizer', ([], {}), '()\n', (239, 241), False, 'from src.train import MetaOptimizer\n'), ((255, 275), 'src.CONFIG.model_class', 'CONFIG.model_class', ([], {}), '()\n', (273, 275), False, 'from src import CONFIG\n'), ((326, 343), 'itertools.count', 'itertools.count', ([], ...
import os import unittest import numpy as np import shutil from pylipid.plot import plot_koff from pylipid.func import cal_koff from pylipid.util import check_dir class TestPlot(unittest.TestCase): def setUp(self): file_dir = os.path.dirname(os.path.abspath(__file__)) self.save_dir = os.path.join(...
[ "unittest.main", "os.path.abspath", "numpy.std", "pylipid.util.check_dir", "pylipid.func.cal_koff", "numpy.mean", "numpy.random.normal", "shutil.rmtree", "os.path.join" ]
[((2479, 2494), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2492, 2494), False, 'import unittest\n'), ((307, 342), 'os.path.join', 'os.path.join', (['file_dir', '"""test_plot"""'], {}), "(file_dir, 'test_plot')\n", (319, 342), False, 'import os\n'), ((351, 375), 'pylipid.util.check_dir', 'check_dir', (['self.s...
# -*- coding: utf-8 -*- # import six import numpy as np import pytest import sksurgerycore.algorithms.pivot as p from glob import glob def test_empty_matrices(): with pytest.raises(TypeError): p.pivot_calibration(None) def test_rank_lt_six(): with pytest.raises(ValueError): file_names = ...
[ "sksurgerycore.algorithms.pivot.pivot_calibration", "pytest.raises", "numpy.arange", "numpy.loadtxt", "glob.glob", "numpy.concatenate", "sksurgerycore.algorithms.pivot.pivot_calibration_with_ransac" ]
[((966, 1003), 'glob.glob', 'glob', (['"""tests/data/PivotCalibration/*"""'], {}), "('tests/data/PivotCalibration/*')\n", (970, 1003), False, 'from glob import glob\n'), ((1068, 1090), 'numpy.concatenate', 'np.concatenate', (['arrays'], {}), '(arrays)\n', (1082, 1090), True, 'import numpy as np\n'), ((1226, 1255), 'sks...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np import astropy.units as u from numpy.testing import assert_allclose from astropy.tests.helper import pytest, assert_quantity_allclose from ...datasets imp...
[ "numpy.nonzero", "numpy.testing.assert_allclose", "astropy.units.Unit" ]
[((1759, 1813), 'numpy.testing.assert_allclose', 'assert_allclose', (['npred_stacked.data', 'npred_summed.data'], {}), '(npred_stacked.data, npred_summed.data)\n', (1774, 1813), False, 'from numpy.testing import assert_allclose\n'), ((1622, 1656), 'numpy.nonzero', 'np.nonzero', (['obs1.on_vector.quality'], {}), '(obs1....
import math import numpy as np from parameter import * if using_salome: from parameter_salome import * else: from parameter_gmsh import * if workpiece_type_id == 1: disc_H = 0.01; #same with cutter now length_scale = disc_R; #if is_straight_chip: # mesh_file = meshfolder + "/metal_cut_st...
[ "math.tan", "math.sin", "numpy.array", "math.cos", "numpy.dot" ]
[((921, 961), 'math.sin', 'math.sin', (['(cutter_angle_v * math.pi / 180)'], {}), '(cutter_angle_v * math.pi / 180)\n', (929, 961), False, 'import math\n'), ((990, 1030), 'math.cos', 'math.cos', (['(cutter_angle_v * math.pi / 180)'], {}), '(cutter_angle_v * math.pi / 180)\n', (998, 1030), False, 'import math\n'), ((129...
import torch from acquisition.acquisition_functions import expected_improvement from acquisition.acquisition_marginalization import acquisition_expectation import numpy as np import cma import time import scipy.optimize as spo from functools import partial def continuous_acquisition_expectation(x_continuous, discre...
[ "numpy.concatenate", "cma.CMAEvolutionStrategy", "torch.cat", "time.time", "numpy.array", "acquisition.acquisition_marginalization.acquisition_expectation", "torch.tensor", "torch.from_numpy" ]
[((1589, 1600), 'time.time', 'time.time', ([], {}), '()\n', (1598, 1600), False, 'import time\n'), ((1610, 1733), 'cma.CMAEvolutionStrategy', 'cma.CMAEvolutionStrategy', ([], {'x0': 'x_init[objective.num_discrete:]', 'sigma0': '(0.1)', 'inopts': "{'bounds': cont_bounds, 'popsize': 50}"}), "(x0=x_init[objective.num_disc...
import os import math import numpy as np from PIL import Image import skimage.transform as trans import cv2 import torch from data import dataset_info from data.base_dataset import BaseDataset import util.util as util dataset_info = dataset_info() class AllFaceDataset(BaseDataset): @staticmethod def modify_co...
[ "data.dataset_info", "os.path.basename", "cv2.cvtColor", "numpy.frombuffer", "math.ceil", "cv2.imdecode", "skimage.transform.SimilarityTransform", "data.dataset_info.get_dataset", "cv2.warpAffine", "numpy.random.randint", "numpy.array", "cv2.imread", "os.path.splitext", "os.path.join", "...
[((234, 248), 'data.dataset_info', 'dataset_info', ([], {}), '()\n', (246, 248), False, 'from data import dataset_info\n'), ((610, 648), 'numpy.frombuffer', 'np.frombuffer', (['img_str'], {'dtype': 'np.uint8'}), '(img_str, dtype=np.uint8)\n', (623, 648), True, 'import numpy as np\n'), ((664, 705), 'cv2.imdecode', 'cv2....
# -*- coding: utf-8 -*- """ Read gslib file format Created on Wen Sep 5th 2018 """ from __future__ import absolute_import, division, print_function __author__ = "yuhao" import numpy as np import pandas as pd from scipy.spatial.distance import pdist from mpl_toolkits.mplot3d import Axes3D class SpatialData(object):...
[ "pandas.read_csv", "numpy.sort", "numpy.histogram", "numpy.median" ]
[((955, 1046), 'pandas.read_csv', 'pd.read_csv', (['self.datafl'], {'sep': '"""\t"""', 'header': 'None', 'names': 'column_name', 'skiprows': '(ncols + 2)'}), "(self.datafl, sep='\\t', header=None, names=column_name, skiprows\n =ncols + 2)\n", (966, 1046), True, 'import pandas as pd\n'), ((1542, 1597), 'numpy.histogr...
# 数据处理 # pickle是一个将任意复杂的对象转成对象的文本或二进制表示的过程 # 也可以将这些字符串、文件或任何类似于文件的对象 unpickle 成原来的对象 import pickle import os import random import numpy as np # 标签字典 tag2label = {"O": 0, "B-PER": 1, "I-PER": 2, "B-LOC": 3, "I-LOC": 4, "B-ORG": 5, "I-ORG": 6 } def read_corpus(corpu...
[ "pickle.dump", "random.shuffle", "numpy.float32", "pickle.load", "os.path.join" ]
[((2661, 2685), 'os.path.join', 'os.path.join', (['vocab_path'], {}), '(vocab_path)\n', (2673, 2685), False, 'import os\n'), ((3015, 3040), 'numpy.float32', 'np.float32', (['embedding_mat'], {}), '(embedding_mat)\n', (3025, 3040), True, 'import numpy as np\n'), ((2085, 2109), 'pickle.dump', 'pickle.dump', (['word2id', ...
import cv2 import numpy as np import argparse # we are not going to bother with objects less than 30% probability THRESHOLD = 0.3 # the lower the value: the fewer bounding boxes will remain SUPPRESSION_THRESHOLD = 0.3 YOLO_IMAGE_SIZE = 320 DATA_FOLDER = './data/' CFG_FOLDER = './cfg/' MODEL_FOLDER = './mo...
[ "cv2.putText", "cv2.dnn.NMSBoxes", "argparse.ArgumentParser", "numpy.argmax", "cv2.waitKey", "cv2.dnn.blobFromImage", "cv2.imshow", "cv2.dnn.readNetFromDarknet", "cv2.VideoCapture", "cv2.rectangle", "cv2.destroyAllWindows" ]
[((2191, 2288), 'cv2.dnn.NMSBoxes', 'cv2.dnn.NMSBoxes', (['bounding_box_locations', 'confidence_values', 'THRESHOLD', 'SUPPRESSION_THRESHOLD'], {}), '(bounding_box_locations, confidence_values, THRESHOLD,\n SUPPRESSION_THRESHOLD)\n', (2207, 2288), False, 'import cv2\n'), ((4244, 4269), 'argparse.ArgumentParser', 'ar...
# ---------------------------------------------------- # Generate a random correlations # ---------------------------------------------------- import numpy as np def randCorr(size, lower=-1, upper=1): """ Create a random matrix T from uniform distribution of dimensions size x m (assumed to be 10000) normal...
[ "numpy.random.uniform", "numpy.sum", "numpy.diag_indices", "numpy.dot", "numpy.sqrt" ]
[((704, 746), 'numpy.random.uniform', 'np.random.uniform', (['lower', 'upper', '(size, m)'], {}), '(lower, upper, (size, m))\n', (721, 746), True, 'import numpy as np\n'), ((759, 792), 'numpy.sum', 'np.sum', (['(randomMatrix ** 2)'], {'axis': '(1)'}), '(randomMatrix ** 2, axis=1)\n', (765, 792), True, 'import numpy as ...
# Copyright (c) 2020, Huawei Technologies.All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/BSD-3-Clause # # Unless required by applicable law...
[ "numpy.random.uniform", "torch.bitwise_not", "numpy.random.randint", "common_utils.run_tests", "torch.from_numpy" ]
[((4174, 4185), 'common_utils.run_tests', 'run_tests', ([], {}), '()\n', (4183, 4185), False, 'from common_utils import TestCase, run_tests\n'), ((998, 1022), 'torch.from_numpy', 'torch.from_numpy', (['input1'], {}), '(input1)\n', (1014, 1022), False, 'import torch\n'), ((1178, 1202), 'torch.from_numpy', 'torch.from_nu...
import numpy as np from cyvcf2 import VCF, Variant, Writer import os.path HERE = os.path.dirname(__file__) HEM_PATH = os.path.join(HERE, "test-hemi.vcf") VCF_PATH = os.path.join(HERE, "test.vcf.gz") def check_var(v): s = [x.split(":")[0] for x in str(v).split("\t")[9:]] lookup = {'0/0': 0, '0/1': 1, './1': ...
[ "cyvcf2.VCF", "numpy.array", "numpy.all" ]
[((396, 430), 'numpy.array', 'np.array', (['[lookup[ss] for ss in s]'], {}), '([lookup[ss] for ss in s])\n', (404, 430), True, 'import numpy as np\n'), ((463, 486), 'numpy.all', 'np.all', (['(expected == obs)'], {}), '(expected == obs)\n', (469, 486), True, 'import numpy as np\n'), ((675, 681), 'cyvcf2.VCF', 'VCF', (['...
import random import numpy as np import torch from torch.utils import data from torch.utils.data.dataset import Dataset """ Example of how to make your own dataset """ class ToyDataSet(Dataset): """ class that defines what a data-sample looks like In the __init__ you could for example load in the data f...
[ "numpy.random.normal", "random.choice", "torch.tensor", "torch.from_numpy" ]
[((981, 1019), 'torch.tensor', 'torch.tensor', (['self.classes[item_index]'], {}), '(self.classes[item_index])\n', (993, 1019), False, 'import torch\n'), ((1070, 1109), 'torch.from_numpy', 'torch.from_numpy', (['self.data[item_index]'], {}), '(self.data[item_index])\n', (1086, 1109), False, 'import torch\n'), ((701, 72...