code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import random import gym import numpy as np from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten, BatchNormalization,Activation from tensorflow.keras.optimizers import Adam from scores.score_logger import ScoreLogger ENV_NAME = "TimePilot-ram-v0" GAMMA = 0.95 LEARNING_RATE...
[ "gym.make", "tensorflow.keras.layers.BatchNormalization", "numpy.argmax", "random.sample", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Activation", "random.randrange", "tensorflow.keras.models.Sequential", "tensorflow.keras.optimizers.Adam", "numpy.random.rand", "scores.score_logge...
[((3202, 3220), 'gym.make', 'gym.make', (['ENV_NAME'], {}), '(ENV_NAME)\n', (3210, 3220), False, 'import gym\n'), ((3693, 3714), 'scores.score_logger.ScoreLogger', 'ScoreLogger', (['ENV_NAME'], {}), '(ENV_NAME)\n', (3704, 3714), False, 'from scores.score_logger import ScoreLogger\n'), ((4919, 4937), 'gym.make', 'gym.ma...
import os import numpy as np, pandas as pd, matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib.colors as colors from matplotlib import cm from datetime import datetime kerneldir ='../data/kernels/' testkernel = os.path.join(kerneldir, 'rsub-d2...
[ "mpl_toolkits.axes_grid1.make_axes_locatable", "os.remove", "os.path.abspath", "matplotlib.colors.Normalize", "pandas.read_csv", "matplotlib.pyplot.close", "numpy.floor", "numpy.zeros", "matplotlib.pyplot.subplots", "datetime.datetime.utcnow", "os.path.join" ]
[((262, 378), 'os.path.join', 'os.path.join', (['kerneldir', '"""rsub-d2f9343c-tess2018360042939-s0006-1-1-0126_cal_img_bkgdsub-xtrns.fits-kernel"""'], {}), "(kerneldir,\n 'rsub-d2f9343c-tess2018360042939-s0006-1-1-0126_cal_img_bkgdsub-xtrns.fits-kernel'\n )\n", (274, 378), False, 'import os\n'), ((948, 983), 'pa...
# /usr/bin/env python3.5 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2019-2020, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifica...
[ "numpy.random.seed", "tensorflow.keras.layers.Dense", "tensorflow.reset_default_graph", "numpy.allclose", "numpy.ones", "aimet_tensorflow.examples.test_models.model_with_multiple_training_tensors", "aimet_tensorflow.utils.op.fusedbatchnorm.BNUtils.get_beta_as_numpy_data", "aimet_common.utils.AimetLogg...
[((2746, 2800), 'aimet_common.utils.AimetLogger.get_area_logger', 'AimetLogger.get_area_logger', (['AimetLogger.LogAreas.Test'], {}), '(AimetLogger.LogAreas.Test)\n', (2773, 2800), False, 'from aimet_common.utils import AimetLogger\n'), ((3135, 3164), 'aimet_tensorflow.utils.graph_saver.wrapper_func', 'wrapper_func', (...
#!/usr/bin/env python """ Class for creating trimmed received noise files to estimate H """ import numpy as np import matplotlib.pyplot as plt import matplotlib class Trimmer(object): data_path = "../data/" @staticmethod def trim_both(fname, output_name, noise_length=100000, gap=10000, offset=10): ...
[ "matplotlib.pyplot.title", "numpy.absolute", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.argmax", "numpy.fromfile", "numpy.amax" ]
[((899, 966), 'numpy.fromfile', 'np.fromfile', (["(Trimmer.data_path + fname + '.bin')"], {'dtype': 'np.complex64'}), "(Trimmer.data_path + fname + '.bin', dtype=np.complex64)\n", (910, 966), True, 'import numpy as np\n'), ((1036, 1057), 'numpy.absolute', 'np.absolute', (['received'], {}), '(received)\n', (1047, 1057),...
# -*- coding: utf-8 -*- """ Created on 2017-4-25 @author: cheng.li """ import numpy as np from alphamind.utilities import aggregate from alphamind.utilities import array_index from alphamind.utilities import group_mapping from alphamind.utilities import simple_mean from alphamind.utilities import simple_sqrsum from ...
[ "numpy.maximum", "alphamind.utilities.array_index", "alphamind.utilities.group_mapping", "alphamind.utilities.transform", "alphamind.utilities.simple_mean", "alphamind.utilities.simple_sqrsum", "alphamind.utilities.simple_std", "alphamind.utilities.aggregate", "numpy.unique" ]
[((527, 548), 'alphamind.utilities.group_mapping', 'group_mapping', (['groups'], {}), '(groups)\n', (540, 548), False, 'from alphamind.utilities import group_mapping\n'), ((571, 599), 'alphamind.utilities.transform', 'transform', (['groups', 'x', '"""mean"""'], {}), "(groups, x, 'mean')\n", (580, 599), False, 'from alp...
######################################################################### # 2020 # Author: <NAME> ######################################################################### import numpy as np import cv2 from dataset.types import Sample class Flip: def __init__(self, prob_to_apply=0.5): self.prob = prob_...
[ "numpy.random.uniform", "numpy.zeros_like", "cv2.cvtColor", "numpy.float32", "cv2.warpAffine", "numpy.random.randint", "cv2.randn", "cv2.split", "numpy.dot", "cv2.flip", "cv2.merge", "cv2.getRotationMatrix2D" ]
[((391, 410), 'numpy.random.uniform', 'np.random.uniform', ([], {}), '()\n', (408, 410), True, 'import numpy as np\n'), ((454, 482), 'cv2.flip', 'cv2.flip', (["sample['image']", '(1)'], {}), "(sample['image'], 1)\n", (462, 482), False, 'import cv2\n'), ((935, 954), 'numpy.random.uniform', 'np.random.uniform', ([], {}),...
import tensorflow as tf import numpy as np from baselines.common.mpi_adam_optimizer import MpiAdamOptimizer from baselines.common.tf_util import get_session, save_variables, load_variables from mpi4py import MPI from baselines.common.tf_util import initialize from baselines.common.mpi_util import sync_from_root from b...
[ "tensorflow.trainable_variables", "tensorflow.get_collection", "baselines.common.tf_util.get_session", "baselines.common.tf_util.initialize", "tensorflow.get_variable_scope", "numpy.shape", "tensorflow.clip_by_global_norm", "tensorflow.nn.softmax", "tensorflow.subtract", "tensorflow.concat", "te...
[((475, 601), 'tensorflow.layers.conv2d', 'tf.layers.conv2d', ([], {'inputs': 'inputs', 'filters': 'filters', 'kernel_size': '(kernel_size, kernel_size)', 'strides': 'strides', 'padding': 'padding'}), '(inputs=inputs, filters=filters, kernel_size=(kernel_size,\n kernel_size), strides=strides, padding=padding)\n', (4...
import numpy as np from knn import KNN ############################################################################ # DO NOT MODIFY ABOVE CODES ############################################################################ # TODO: implement F1 score def f1_score(real_labels, predicted_labels): """ Information ...
[ "numpy.sum", "numpy.amin", "numpy.subtract", "numpy.multiply", "numpy.amax", "knn.KNN", "numpy.array", "numpy.reshape", "numpy.inner", "numpy.dot" ]
[((2508, 2524), 'numpy.array', 'np.array', (['point1'], {}), '(point1)\n', (2516, 2524), True, 'import numpy as np\n'), ((2542, 2558), 'numpy.array', 'np.array', (['point2'], {}), '(point2)\n', (2550, 2558), True, 'import numpy as np\n'), ((3231, 3247), 'numpy.array', 'np.array', (['point1'], {}), '(point1)\n', (3239, ...
import numpy as np import math from scipy.spatial.distance import mahalanobis class homie_particle: def __init__(self, xpos, ypos, orientation): self._x = xpos self._y = ypos self._theta = orientation # in radians wrt positive x-axis self._land_mu = [] # list of landmark mean p...
[ "numpy.abs", "numpy.deg2rad", "scipy.spatial.distance.mahalanobis", "math.sin", "numpy.identity", "numpy.linalg.inv", "numpy.array", "math.cos", "numpy.linalg.det" ]
[((2138, 2157), 'numpy.deg2rad', 'np.deg2rad', (['bearing'], {}), '(bearing)\n', (2148, 2157), True, 'import numpy as np\n'), ((2740, 2761), 'math.cos', 'math.cos', (['self._theta'], {}), '(self._theta)\n', (2748, 2761), False, 'import math\n'), ((2783, 2804), 'math.sin', 'math.sin', (['self._theta'], {}), '(self._thet...
""" Pre-processing functions for the ST Analysis packages. Mainly function to aggregate datasets and filtering functions (noisy spots and noisy genes) """ import numpy as np import pandas as pd import math import os from stanalysis.normalization import * def merge_datasets(counts_tableA, counts_tableB, merging_action...
[ "pandas.DataFrame", "math.isnan", "numpy.isinf", "numpy.isnan", "numpy.any", "os.path.isfile", "numpy.mean", "pandas.read_table", "numpy.all" ]
[((2883, 2897), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (2895, 2897), True, 'import pandas as pd\n'), ((9304, 9331), 'numpy.any', 'np.any', (['(size_factors <= 0.0)'], {}), '(size_factors <= 0.0)\n', (9310, 9331), True, 'import numpy as np\n'), ((10353, 10380), 'numpy.all', 'np.all', (['(size_factors == 1...
import tensorflow as tf import numpy as np class QCriticFF(tf.keras.Model): def __init__(self, state_shape, action_shape, name='critic'): super(QCriticFF, self).__init__(name=name) self.state_shape = state_shape self.state_size = np.prod(state_shape) self.action_shape = action_shap...
[ "tensorflow.random_uniform_initializer", "tensorflow.contrib.layers.layer_norm", "tensorflow.concat", "tensorflow.variable_scope", "tensorflow.keras.layers.Activation", "tensorflow.keras.initializers.glorot_uniform", "numpy.prod" ]
[((260, 280), 'numpy.prod', 'np.prod', (['state_shape'], {}), '(state_shape)\n', (267, 280), True, 'import numpy as np\n'), ((349, 375), 'numpy.prod', 'np.prod', (['self.action_shape'], {}), '(self.action_shape)\n', (356, 375), True, 'import numpy as np\n'), ((528, 562), 'tensorflow.keras.layers.Activation', 'tf.keras....
# -*- coding: utf-8 -*- from __future__ import print_function as _ from __future__ import division as _ from __future__ import absolute_import as _ import os, sys import tensorflow.compat.v1 as tf import numpy as np import pytest import unittest import shutil, tempfile from tensorflow.python.tools.freeze_graph import ...
[ "coremltools.models.neural_network.quantization_utils.quantize_weights", "test_utils.generate_data", "tensorflow.compat.v1.train.write_graph", "tensorflow.compat.v1.Graph", "shutil.rmtree", "os.path.join", "tensorflow.compat.v1.import_graph_def", "tensorflow.compat.v1.global_variables_initializer", ...
[((1511, 1809), 'tensorflow.python.tools.freeze_graph.freeze_graph', 'freeze_graph', ([], {'input_graph': 'input_graph', 'input_saver': '""""""', 'input_binary': '(True)', 'input_checkpoint': 'input_checkpoint', 'output_node_names': 'output_node_names', 'restore_op_name': '"""save/restore_all"""', 'filename_tensor_name...
""" select_top This file is a part of BdPy. """ __all__ = ['select_top'] import numpy as np from .util import print_start_msg, print_finish_msg def select_top(data, value, num, axis=0, verbose=True): """ Select top `num` features of `value` from `data` Parameters ---------- data : array ...
[ "numpy.argsort", "numpy.zeros" ]
[((709, 741), 'numpy.zeros', 'np.zeros', (['num_elem'], {'dtype': 'np.int'}), '(num_elem, dtype=np.int)\n', (717, 741), True, 'import numpy as np\n'), ((673, 690), 'numpy.argsort', 'np.argsort', (['value'], {}), '(value)\n', (683, 690), True, 'import numpy as np\n')]
"""Implements a GymAdapter that converts Gym envs into SoftlearningEnv.""" import numpy as np import gym from gym import spaces, wrappers from .softlearning_env import SoftlearningEnv from softlearning.environments.gym import register_environments from softlearning.environments.gym.wrappers import NormalizeActionWrap...
[ "gym.envs.make", "softlearning.environments.gym.register_environments", "gym.envs.registry.env_specs.keys", "numpy.prod", "collections.defaultdict", "softlearning.environments.gym.wrappers.NormalizeActionWrapper", "numpy.concatenate" ]
[((579, 602), 'softlearning.environments.gym.register_environments', 'register_environments', ([], {}), '()\n', (600, 602), False, 'from softlearning.environments.gym import register_environments\n'), ((629, 646), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (640, 646), False, 'from collections...
""" Copyright (c) 2018-2022 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...
[ "numpy.pad", "cv2.resize", "cv2.contourArea", "numpy.maximum", "numpy.float32", "numpy.zeros", "numpy.clip", "cv2.warpAffine", "numpy.array", "cv2.getAffineTransform", "cv2.minAreaRect", "numpy.ascontiguousarray", "cv2.findContours" ]
[((4341, 4399), 'numpy.array', 'np.array', (['[im_scale_x, im_scale_y, im_scale_x, im_scale_y]'], {}), '([im_scale_x, im_scale_y, im_scale_x, im_scale_y])\n', (4349, 4399), True, 'import numpy as np\n'), ((4430, 4468), 'numpy.clip', 'np.clip', (['boxes[:, 0:4:2]', '(0)', '(img_w - 1)'], {}), '(boxes[:, 0:4:2], 0, img_w...
import os from typing import Tuple import cv2 import numpy as np from keras.utils import Sequence from pycocotools import mask from pycocotools.coco import COCO from util.array_utils import down_size_batch class DataLoader(Sequence): """Loads data/labels from a coco annotated dataset. The images are stored...
[ "numpy.load", "pycocotools.mask.decode", "numpy.empty", "numpy.zeros", "numpy.flipud", "numpy.random.RandomState", "numpy.fliplr", "util.array_utils.down_size_batch", "numpy.arange", "numpy.logical_or", "numpy.rot90", "pycocotools.mask.frPyObjects", "os.path.join", "os.listdir" ]
[((1502, 1540), 'os.path.join', 'os.path.join', (['data_directory', '"""images"""'], {}), "(data_directory, 'images')\n", (1514, 1540), False, 'import os\n'), ((2689, 2734), 'numpy.empty', 'np.empty', (['(self.batch_size, *self.data_shape)'], {}), '((self.batch_size, *self.data_shape))\n', (2697, 2734), True, 'import n...
import numpy as np from mean_average_precision import MetricBuilder # print list of available metrics print(MetricBuilder.get_metrics_list()) num_classes = 5 # create metric_fn metric_fn = MetricBuilder.build_evaluation_metric( "map_2d", async_mode=True, num_classes=num_classes ) # add some samples to evaluation...
[ "numpy.array", "mean_average_precision.MetricBuilder.get_metrics_list", "mean_average_precision.MetricBuilder.build_evaluation_metric", "numpy.arange" ]
[((191, 284), 'mean_average_precision.MetricBuilder.build_evaluation_metric', 'MetricBuilder.build_evaluation_metric', (['"""map_2d"""'], {'async_mode': '(True)', 'num_classes': 'num_classes'}), "('map_2d', async_mode=True,\n num_classes=num_classes)\n", (228, 284), False, 'from mean_average_precision import MetricB...
"""Core functions.""" import os import nibabel as nb import numpy as np from matplotlib.cm import get_cmap from imageio import mimwrite from skimage.transform import resize def parse_filename(filepath): """Parse input file path into directory, basename and extension. Parameters ---------- filepath: str...
[ "numpy.flip", "matplotlib.cm.get_cmap", "nibabel.load", "os.path.dirname", "numpy.zeros", "numpy.max", "numpy.array", "os.path.normpath", "numpy.delete" ]
[((594, 620), 'os.path.normpath', 'os.path.normpath', (['filepath'], {}), '(filepath)\n', (610, 620), False, 'import os\n'), ((635, 656), 'os.path.dirname', 'os.path.dirname', (['path'], {}), '(path)\n', (650, 656), False, 'import os\n'), ((1203, 1221), 'numpy.max', 'np.max', (['data.shape'], {}), '(data.shape)\n', (12...
import copy import importlib import itertools from typing import Tuple, Dict, Callable import numpy as np from highway_env.types import Vector, Interval def do_every(duration: float, timer: float) -> bool: return duration < timer def lmap(v: float, x: Interval, y: Interval) -> float: """Linear map of valu...
[ "numpy.abs", "numpy.amin", "numpy.clip", "numpy.sin", "numpy.linalg.norm", "numpy.transpose", "numpy.identity", "numpy.linalg.eig", "itertools.product", "numpy.linalg.det", "copy.deepcopy", "importlib.import_module", "numpy.tensordot", "numpy.linalg.inv", "numpy.cos", "numpy.squeeze", ...
[((690, 706), 'numpy.clip', 'np.clip', (['x', 'a', 'b'], {}), '(x, a, b)\n', (697, 706), True, 'import numpy as np\n'), ((1756, 1783), 'numpy.array', 'np.array', (['[[c, -s], [s, c]]'], {}), '([[c, -s], [s, c]])\n', (1764, 1783), True, 'import numpy as np\n'), ((2326, 2354), 'numpy.matrix', 'np.matrix', (['[[c, -s], [s...
# -*- coding: utf-8 -*- """This module contains the pyposmat engine for parameterization""" __author__ = "<NAME>" __copyright__ = "Copyright (C) 2016,2017,2018" __license__ = "Simplified BSD License" __version__ = "1.0" import time,sys,os,copy,shutil,importlib from collections import OrderedDict import numpy as np imp...
[ "copy.deepcopy", "importlib.import_module", "pypospack.pyposmat.engines.PyposmatEngine.read_configuration_file", "pypospack.exceptions.PypospackBadKdeBandwidthType", "numpy.interp", "pypospack.pyposmat.data.PyposmatLogFile", "pypospack.kde.Chiu1999_h", "pypospack.pyposmat.engines.PyposmatEngine.__init...
[((2493, 2626), 'pypospack.pyposmat.engines.PyposmatEngine.__init__', 'PyposmatEngine.__init__', (['self'], {'filename_in': 'filename_in', 'filename_out': 'filename_out', 'base_directory': 'base_directory', 'fullauto': '(False)'}), '(self, filename_in=filename_in, filename_out=\n filename_out, base_directory=base_di...
import matplotlib from matplotlib import rc import matplotlib.pyplot as plt import numpy as np from numpy import loadtxt from scipy.interpolate import interp1d from operator import add from operator import sub from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes rc('text',usetex=True) font={'family' : ...
[ "matplotlib.pyplot.tight_layout", "matplotlib.rc", "matplotlib.pyplot.show", "mpl_toolkits.axes_grid1.inset_locator.zoomed_inset_axes", "matplotlib.pyplot.yticks", "numpy.loadtxt", "numpy.linspace", "matplotlib.pyplot.ticklabel_format", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel", "mp...
[((280, 303), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (282, 303), False, 'from matplotlib import rc\n'), ((370, 399), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {}), "('font', **font)\n", (383, 399), False, 'import matplotlib\n'), ((710, 741), 'numpy.loadtxt', '...
from __future__ import print_function, absolute_import from reid.models import model_utils as mu from reid.utils.data import data_process as dp from reid.utils.serialization import save_checkpoint from reid import datasets from reid import models from reid.config import Config import torch import numpy as np import os ...
[ "reid.config.Config", "argparse.ArgumentParser", "numpy.argmax", "os.getcwd", "torch.manual_seed", "reid.models.model_utils.predict_prob", "torch.cuda.manual_seed", "reid.models.model_utils.train", "reid.utils.data.data_process.split_dataset", "reid.datasets.create", "torch.cuda.is_available", ...
[((346, 397), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Cotrain args"""'}), "(description='Cotrain args')\n", (369, 397), False, 'import argparse\n'), ((483, 511), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (500, 511), False, 'import torch\n'), (...
# # Raster Fairy v1.0.3, # released 22.01.2016 # # The purpose of Raster Fairy is to transform any kind of 2D point cloud into # a regular raster whilst trying to preserve the neighborhood relations that # were present in the original cloud. If you feel the name is a bit silly and # you can also call it "RF-Transform"...
[ "numpy.sum", "math.sqrt", "numpy.zeros", "numpy.ones", "math.floor", "numpy.argmin", "numpy.nonzero", "numpy.max", "numpy.array", "numpy.arange", "numpy.random.shuffle" ]
[((12550, 12576), 'numpy.ones', 'np.ones', (['(d, d)'], {'dtype': 'int'}), '((d, d), dtype=int)\n', (12557, 12576), True, 'import numpy as np\n'), ((15969, 15989), 'math.sqrt', 'math.sqrt', (['(8 * n + 1)'], {}), '(8 * n + 1)\n', (15978, 15989), False, 'import math\n'), ((17432, 17444), 'math.sqrt', 'math.sqrt', (['n']...
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.utils import shuffle from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_raises_regex from s...
[ "sklearn.datasets.load_iris", "sklearn.ensemble.GradientBoostingRegressor", "sklearn.utils.testing.assert_equal", "sklearn.base.clone", "numpy.unique", "sklearn.utils.testing.assert_raises", "numpy.zeros_like", "sklearn.linear_model.SGDClassifier", "sklearn.datasets.make_regression", "numpy.random...
[((4786, 4806), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (4804, 4806), False, 'from sklearn import datasets\n'), ((4916, 4943), 'sklearn.utils.shuffle', 'shuffle', (['y1'], {'random_state': '(1)'}), '(y1, random_state=1)\n', (4923, 4943), False, 'from sklearn.utils import shuffle\n'), ((494...
"""Provide a thead-direction turning curve analysis""" import numpy as np import opexebo import opexebo.defaults as default def tuning_curve(angular_occupancy, spike_angles, **kwargs): """Analogous to a RateMap - i.e. mapping spike activity to spatial position map spike rate as a function of angle Param...
[ "numpy.radians", "numpy.spacing", "opexebo.general.accumulate_spatial", "opexebo.general.bin_width_to_bin_number", "numpy.nanmax" ]
[((2228, 2285), 'opexebo.general.bin_width_to_bin_number', 'opexebo.general.bin_width_to_bin_number', (['(360.0)', 'bin_width'], {}), '(360.0, bin_width)\n', (2267, 2285), False, 'import opexebo\n'), ((2777, 2798), 'numpy.radians', 'np.radians', (['bin_width'], {}), '(bin_width)\n', (2787, 2798), True, 'import numpy as...
import sys from os import path sys.path.append(path.dirname(__file__)) import numpy as np import pandas as pd from nltk.tokenize import word_tokenize from Stopwords import Stopwords from Ylabeler import Ylabeler from gensim.models import Word2Vec from sklearn.model_selection import train_test_split from sklearn.me...
[ "numpy.argmax", "pandas.read_csv", "sklearn.model_selection.train_test_split", "tensorflow.keras.layers.Dense", "sklearn.metrics.r2_score", "sklearn.metrics.classification_report", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Flatten", "pandas.DataFrame", "Stopwords.Stopwords", ...
[((47, 69), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (59, 69), False, 'from os import path\n'), ((1257, 1268), 'Stopwords.Stopwords', 'Stopwords', ([], {}), '()\n', (1266, 1268), False, 'from Stopwords import Stopwords\n'), ((1294, 1304), 'Ylabeler.Ylabeler', 'Ylabeler', ([], {}), '()\n', ...
import numpy as np import torch class PointCloudShuffle(object): def __init__(self, num_point): self.num_point = num_point def __call__(self, sample): pt_idxs = np.arange(0, self.num_point) np.random.shuffle(pt_idxs) sample['point_clouds'] = sample['point_clouds'][p...
[ "numpy.random.standard_normal", "numpy.arange", "numpy.random.shuffle", "torch.from_numpy" ]
[((195, 223), 'numpy.arange', 'np.arange', (['(0)', 'self.num_point'], {}), '(0, self.num_point)\n', (204, 223), True, 'import numpy as np\n'), ((233, 259), 'numpy.random.shuffle', 'np.random.shuffle', (['pt_idxs'], {}), '(pt_idxs)\n', (250, 259), True, 'import numpy as np\n'), ((1128, 1168), 'torch.from_numpy', 'torch...
# -*- coding: utf-8 -*- # Author: <NAME> <<EMAIL>> # (mostly translation, see implementation details) # License: BSD 3 clause """ The built-in correlation models submodule for the gaussian_process module. """ import numpy as np def absolute_exponential(theta, d): """ Absolute exponential autocorre...
[ "numpy.abs", "numpy.sum", "numpy.asarray", "numpy.zeros", "numpy.prod", "numpy.all", "numpy.repeat" ]
[((1063, 1098), 'numpy.asarray', 'np.asarray', (['theta'], {'dtype': 'np.float64'}), '(theta, dtype=np.float64)\n', (1073, 1098), True, 'import numpy as np\n'), ((2367, 2402), 'numpy.asarray', 'np.asarray', (['theta'], {'dtype': 'np.float64'}), '(theta, dtype=np.float64)\n', (2377, 2402), True, 'import numpy as np\n'),...
""" /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *----------------------------------------------------------...
[ "pandas.DataFrame", "os.mkdir", "argparse.ArgumentParser", "numpy.std", "os.path.exists", "numpy.mean", "configparser.ExtendedInterpolation", "configparser.ConfigParser", "datetime.datetime.now", "scaleapi.ScaleClient", "numpy.sqrt" ]
[((534, 548), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (546, 548), False, 'from datetime import datetime\n'), ((644, 679), 'scaleapi.ScaleClient', 'scaleapi.ScaleClient', (['scale_api_key'], {}), '(scale_api_key)\n', (664, 679), False, 'import scaleapi\n'), ((3652, 3677), 'pandas.DataFrame', 'pd.DataF...
import numpy as np import torch import torch.utils.data import config as c verts = [ (-2.4142, 1.), (-1., 2.4142), ( 1., 2.4142), ( 2.4142, 1.), ( 2.4142, -1.), ( 1., -2.4142), (-1., -2.4142), (-2.4142, -1.) ] label_maps = { ...
[ "numpy.random.seed", "train.main", "numpy.zeros", "visdom.Visdom", "torch.Tensor", "numpy.arange", "torch.utils.data.TensorDataset", "numpy.random.normal", "numpy.random.permutation" ]
[((1377, 1385), 'visdom.Visdom', 'Visdom', ([], {}), '()\n', (1383, 1385), False, 'from visdom import Visdom\n'), ((498, 515), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (512, 515), True, 'import numpy as np\n'), ((606, 646), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(N, 2)', 'scale'...
""" Computation of the demagnetising field using the Fredkin-Koehler technique and the infamous magpar method. Rationale: The previous implementation in FemBemFKSolver (child class of FemBemDeMagSolver) was kind of a mess. This does the same thing in the same time with less code. Should be more conducive to further op...
[ "finmag.util.configuration.get_config_option", "dolfin.grad", "dolfin.LUSolver", "dolfin.TrialFunction", "dolfin.TestFunction", "dolfin.DomainBoundary", "dolfin.Function", "dolfin.Constant", "finmag.util.meshes.nodal_volume", "numpy.array", "aeon.Timer", "numpy.dot", "dolfin.KrylovSolver", ...
[((721, 748), 'logging.getLogger', 'logging.getLogger', (['"""finmag"""'], {}), "('finmag')\n", (738, 748), False, 'import logging\n'), ((760, 767), 'aeon.Timer', 'Timer', ([], {}), '()\n', (765, 767), False, 'from aeon import timer, Timer\n'), ((4786, 4810), 'dolfin.TestFunction', 'df.TestFunction', (['self.S1'], {}),...
# -*- coding: utf-8 -*- """ Root module of tanuna package. @author: <NAME> """ # ignore warning 'line break after binary operator' # as line break *before* binary operator *also* creates a warning ... # flake8: noqa: W504 # XXX refactor to use numpy arrays with "@" multiplication instead of matrices # XXX have to de...
[ "matplotlib.pyplot.title", "numpy.roots", "numpy.abs", "tanuna.CT_LTI.LowPass", "numpy.angle", "numpy.ones", "matplotlib.pyplot.figure", "numpy.imag", "numpy.arange", "matplotlib.pyplot.axvline", "matplotlib.pyplot.close", "numpy.linalg.matrix_rank", "numpy.real", "numpy.log10", "matplot...
[((1598, 1629), 'numpy.zeros', 'np.zeros', (['A.shape'], {'dtype': 'object'}), '(A.shape, dtype=object)\n', (1606, 1629), True, 'import numpy as np\n'), ((34085, 34096), 'numpy.array', 'np.array', (['a'], {}), '(a)\n', (34093, 34096), True, 'import numpy as np\n'), ((34157, 34168), 'numpy.array', 'np.array', (['b'], {}...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np class PointNetCls(nn.Module): def __init__(self, output_classes, input_dims=3, conv1_dim=64, dropout_prob=0.5, use_transform=True): super(PointNetCls, self).__init__() ...
[ "torch.nn.Dropout", "torch.bmm", "numpy.eye", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.MaxPool1d", "torch.nn.BatchNorm1d", "torch.nn.Linear", "torch.nn.functional.relu" ]
[((378, 393), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (391, 393), True, 'import torch.nn as nn\n'), ((601, 616), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (614, 616), True, 'import torch.nn as nn\n'), ((792, 807), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (805, 807), Tr...
""" A collection of function handling faces. """ import cv2 import dlib import numpy PREDICTOR_PATH = "predictor_data\\shape_predictor_68_face_landmarks.dat" SCALE_FACTOR = 1 FEATHER_AMOUNT = 11 FACE_POINTS = list(range(17, 68)) MOUTH_POINTS = list(range(48, 61)) RIGHT_BROW_POINTS = list(range(17, 22)) LEFT_BROW_PO...
[ "cv2.GaussianBlur", "numpy.matrix", "cv2.circle", "numpy.std", "numpy.zeros", "cv2.blur", "numpy.hstack", "cv2.warpAffine", "cv2.imread", "numpy.mean", "numpy.linalg.svd", "cv2.convexHull", "dlib.get_frontal_face_detector", "numpy.array", "numpy.array_equal", "cv2.fillConvexPoly", "d...
[((1328, 1360), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (1358, 1360), False, 'import dlib\n'), ((1796, 1832), 'dlib.shape_predictor', 'dlib.shape_predictor', (['PREDICTOR_PATH'], {}), '(PREDICTOR_PATH)\n', (1816, 1832), False, 'import dlib\n'), ((3041, 3063), 'cv2.convexHul...
from __future__ import division # ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ---------------...
[ "skbio.io.util._is_string_or_bytes", "h5py.File", "heapq.heappush", "future.utils.viewitems", "heapq.heappop", "collections.defaultdict", "numpy.random.randint", "h5py.is_hdf5", "natsort.natsorted" ]
[((2067, 2116), 'numpy.random.randint', 'np.random.randint', (['(0)', 'sys.maxint', 'random_buf_size'], {}), '(0, sys.maxint, random_buf_size)\n', (2084, 2116), True, 'import numpy as np\n'), ((2150, 2167), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2161, 2167), False, 'from collections impo...
import os import glob import torch import numpy as np import pandas as pd import torch.nn as nn from PIL import Image import torch.optim as optim import matplotlib.pyplot as plt from torch.utils.data import DataLoader from torch.utils.data.dataset import Dataset from torchvision import datasets, transforms from util.to...
[ "matplotlib.pyplot.show", "torch.utils.data.DataLoader", "numpy.asarray", "torch.empty", "numpy.transpose", "PIL.Image.open", "numpy.random.randint", "torch.zeros", "torchvision.transforms.Normalize", "torchvision.transforms.Resize", "numpy.concatenate", "torchvision.transforms.ToTensor" ]
[((6136, 6251), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['train_set'], {'batch_size': '(8)', 'shuffle': '(True)', 'num_workers': '(0)', 'collate_fn': 'custom_collate_fn'}), '(train_set, batch_size=8, shuffle=True,\n num_workers=0, collate_fn=custom_collate_fn)\n', (6163, 6251), False, 'import ...
import os import numpy as np if not os.path.exists('../npydata'): os.makedirs('../npydata') '''please set your dataset path''' try: VisDrone_train_path='../dataset/VisDrone/train_data_class8/images/' VisDrone_test_path='../dataset/VisDrone/test_data_class8/images/' train_list = [] for...
[ "os.listdir", "numpy.save", "os.path.exists", "os.makedirs" ]
[((40, 68), 'os.path.exists', 'os.path.exists', (['"""../npydata"""'], {}), "('../npydata')\n", (54, 68), False, 'import os\n'), ((75, 100), 'os.makedirs', 'os.makedirs', (['"""../npydata"""'], {}), "('../npydata')\n", (86, 100), False, 'import os\n'), ((333, 364), 'os.listdir', 'os.listdir', (['VisDrone_train_path'], ...
import pyarrow as pa import pandas as pd import pyarrow.plasma as plasma import numpy as np client = plasma.connect('/tmp/plasma.db', '', 3) # Create a Pandas DataFrame d = {'one' : pd.Series([1., 2., 3.], index=['a', 'b', 'c']), 'two' : pd.Series([1., 2., 3., 4.], index=['a', 'b', 'c', 'd'])} df = pd.DataFrame...
[ "pandas.DataFrame", "pyarrow.RecordBatchStreamWriter", "pyarrow.RecordBatch.from_pandas", "pyarrow.RecordBatchStreamReader", "pyarrow.MockOutputStream", "pyarrow.FixedSizeBufferWriter", "pandas.Series", "numpy.random.bytes", "pyarrow.BufferReader", "pyarrow.plasma.connect" ]
[((102, 141), 'pyarrow.plasma.connect', 'plasma.connect', (['"""/tmp/plasma.db"""', '""""""', '(3)'], {}), "('/tmp/plasma.db', '', 3)\n", (116, 141), True, 'import pyarrow.plasma as plasma\n'), ((308, 323), 'pandas.DataFrame', 'pd.DataFrame', (['d'], {}), '(d)\n', (320, 323), True, 'import pandas as pd\n'), ((398, 428)...
import pytest import adlib27.elem_function as ef from adlib27.autodiff import AutoDiff as AD import numpy as np import math def test_sin0(): x = 1 assert ef.sin(x) == pytest.approx(np.sin(x)) # one value for one variable def test_sin1(): # default AD object with .val=[0.0] x = AD() y = ef.sin(x) ...
[ "adlib27.elem_function.sinh", "adlib27.elem_function.arccos", "adlib27.elem_function.log10", "numpy.sin", "numpy.exp", "adlib27.elem_function.sqrt", "adlib27.elem_function.log", "adlib27.elem_function.exp", "numpy.arcsin", "adlib27.elem_function.cos", "numpy.tan", "adlib27.autodiff.AutoDiff", ...
[((297, 301), 'adlib27.autodiff.AutoDiff', 'AD', ([], {}), '()\n', (299, 301), True, 'from adlib27.autodiff import AutoDiff as AD\n'), ((310, 319), 'adlib27.elem_function.sin', 'ef.sin', (['x'], {}), '(x)\n', (316, 319), True, 'import adlib27.elem_function as ef\n'), ((506, 542), 'adlib27.autodiff.AutoDiff', 'AD', ([],...
from unittest.mock import patch, Mock import numpy as np from numpy.testing import assert_allclose import pytest from pyqumo.chains import DiscreteTimeMarkovChain, ContinuousTimeMarkovChain from pyqumo.errors import CellValueError, RowSumError, MatrixShapeError # ####################################################...
[ "numpy.asarray", "numpy.testing.assert_allclose", "numpy.zeros", "unittest.mock.Mock", "pyqumo.chains.ContinuousTimeMarkovChain", "unittest.mock.patch", "pytest.raises", "pyqumo.chains.DiscreteTimeMarkovChain", "pytest.mark.parametrize" ]
[((456, 616), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""matrix, order, string"""', "[([[1.0]], 1, '(DTMC: t=[[1]])'), ([[0.5, 0.5], [0.8, 0.2]], 2,\n '(DTMC: t=[[0.5, 0.5], [0.8, 0.2]])')]"], {}), "('matrix, order, string', [([[1.0]], 1,\n '(DTMC: t=[[1]])'), ([[0.5, 0.5], [0.8, 0.2]], 2,\n '...
""" Synthetic test 1 A Python program to compute the Synthetic test 1 Distinct SIs and strong nonlinear magnetic base level This code is released from the paper: Reliable Euler deconvolution estimates throughout the vertical derivatives of the total-field anomaly The program is under the conditions term...
[ "plot_functions.plot_input_data", "euler_python.euler_deconv", "estimates_statistics.classic", "plot_functions.plot_classic", "numpy.loadtxt" ]
[((1558, 1596), 'numpy.loadtxt', 'np.loadtxt', (['"""input/synthetic_data.dat"""'], {}), "('input/synthetic_data.dat')\n", (1568, 1596), True, 'import numpy as np\n'), ((1770, 1817), 'plot_functions.plot_input_data', 'plt_fc.plot_input_data', (['data', 'xi', 'yi', 'zi', 'shape'], {}), '(data, xi, yi, zi, shape)\n', (17...
################################################################################ # Numba-DPPY # # Copyright 2020-2021 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 ...
[ "numba_dppy.tests.skip_tests.skip_test", "numpy.empty", "dpctl.device_context", "pytest.fixture", "pytest.skip", "numpy.random.random", "numpy.testing.assert_allclose" ]
[((1004, 1046), 'pytest.fixture', 'pytest.fixture', ([], {'params': 'list_of_filter_strs'}), '(params=list_of_filter_strs)\n', (1018, 1046), False, 'import pytest\n'), ((1220, 1261), 'pytest.fixture', 'pytest.fixture', ([], {'params': 'list_of_binary_ops'}), '(params=list_of_binary_ops)\n', (1234, 1261), False, 'import...
# -*- coding: utf-8 -*- # Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is # holder of all proprietary rights on this computer program. # You can only use this computer program if you have closed # a license agreement with MPG or you get the right to use the computer # program from someone who is...
[ "torch.index_select", "numpy.array", "torch.cat", "numpy.concatenate" ]
[((1193, 1323), 'numpy.array', 'np.array', (["[vertex_ids['nose'], vertex_ids['reye'], vertex_ids['leye'], vertex_ids[\n 'rear'], vertex_ids['lear']]"], {'dtype': 'np.int64'}), "([vertex_ids['nose'], vertex_ids['reye'], vertex_ids['leye'],\n vertex_ids['rear'], vertex_ids['lear']], dtype=np.int64)\n", (1201, 1323...
# -*- coding: utf-8 -*- """ RSR Algorithm by <NAME> <<EMAIL>> Adapted from DCGAN and E2GAN """ import sys, os import imageio import cfg import models_search # from functions import validate from utils.utils import set_log_dir, create_logger # if not os.path.isfile('gan-vae-pretrained-pytorch'): # os.system('git ...
[ "numpy.load", "torch.randn", "torch.cat", "os.path.isfile", "numpy.random.randint", "torchvision.transforms.Normalize", "torch.no_grad", "sys.path.append", "torch.utils.data.DataLoader", "torch.load", "os.path.exists", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.zeros", "numpy.lin...
[((590, 632), 'sys.path.append', 'sys.path.append', (['"""pytorch-fid/pytorch_fid"""'], {}), "('pytorch-fid/pytorch_fid')\n", (605, 632), False, 'import sys, os\n'), ((748, 795), 'inception.InceptionV3', 'InceptionV3', (['[block_idx]'], {'normalize_input': '(False)'}), '([block_idx], normalize_input=False)\n', (759, 79...
import numpy as np import spiderman def spiderman_rock(params, t, etc = []): """ This function generates the Kreidberg & Loeb 2016 phase curve model Parameters ---------- t0: time of conjunction per: orbital period a_abs: semi-major axis (AU) cos(i): cosine of the orbital inclination e...
[ "spiderman.ModelParams", "numpy.interp", "spiderman.web.lightcurve", "numpy.arccos", "numpy.round" ]
[((1104, 1182), 'spiderman.ModelParams', 'spiderman.ModelParams', ([], {'brightness_model': '"""kreidberg"""', 'stellar_model': '"""blackbody"""'}), "(brightness_model='kreidberg', stellar_model='blackbody')\n", (1125, 1182), False, 'import spiderman\n'), ((1956, 1971), 'numpy.round', 'np.round', (['phase'], {}), '(pha...
""" test scalar indexing, including at and iat """ from datetime import ( datetime, timedelta, ) import numpy as np import pytest from pandas import ( DataFrame, Series, Timedelta, Timestamp, date_range, ) import pandas._testing as tm from pandas.tests.indexing.common import Base class T...
[ "pandas.DataFrame", "pandas.Timestamp", "pandas.date_range", "pandas._testing.assert_almost_equal", "numpy.random.randn", "pandas._testing.assert_series_equal", "pytest.raises", "pandas.Series", "pandas._testing.assert_frame_equal", "pandas.Timedelta", "pytest.mark.parametrize" ]
[((342, 394), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kind"""', "['series', 'frame']"], {}), "('kind', ['series', 'frame'])\n", (365, 394), False, 'import pytest\n'), ((1302, 1354), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kind"""', "['series', 'frame']"], {}), "('kind', ['series'...
import argparse import time import cv2 import torch import pandas as pd import numpy as np from conda.exports import get_index from torch import optim from torch.utils.data import DataLoader from torchvision.transforms import transforms from tqdm import tqdm from model import * dice_total_list = [] rvd_total_list = ...
[ "argparse.ArgumentParser", "torch.no_grad", "pandas.DataFrame", "torch.nn.BCELoss", "torch.utils.data.DataLoader", "cv2.cvtColor", "matplotlib.pyplot.imshow", "torch.load", "cv2.imwrite", "torch.squeeze", "numpy.max", "cv2.drawContours", "matplotlib.pyplot.pause", "tqdm.tqdm", "matplotli...
[((467, 534), 'dataset.make_dataset', 'dataset.make_dataset', (["('E:/LITS/tumour/%d-%d/test' % (center, width))"], {}), "('E:/LITS/tumour/%d-%d/test' % (center, width))\n", (487, 534), False, 'import dataset\n'), ((2210, 2228), 'torch.nn.BCELoss', 'torch.nn.BCELoss', ([], {}), '()\n', (2226, 2228), False, 'import torc...
import os import sys import pickle import argparse import numpy as np from numpy.lib.format import open_memmap from utils.ntu_read_skeleton import read_xyz os.environ['CUDA_VISIBLE_DEVICES'] = '2' # training_subjects = [ # 1, 2, 4, 5, 8, 9, 13, 14, 15, 16, 17, 18, 19, 25, 27, 28, 31, 34, 35, 38 # ] t...
[ "sys.stdout.write", "pickle.dump", "argparse.ArgumentParser", "os.makedirs", "numpy.asarray", "numpy.cross", "os.path.exists", "numpy.hstack", "numpy.linalg.norm", "numpy.reshape", "sys.stdout.flush", "numpy.linalg.inv", "numpy.squeeze", "numpy.dot", "os.path.join", "os.listdir", "nu...
[((950, 966), 'numpy.asarray', 'np.asarray', (['test'], {}), '(test)\n', (960, 966), True, 'import numpy as np\n'), ((1816, 1838), 'numpy.reshape', 'np.reshape', (['v1', '(3, 1)'], {}), '(v1, (3, 1))\n', (1826, 1838), True, 'import numpy as np\n'), ((1847, 1869), 'numpy.reshape', 'np.reshape', (['v2', '(3, 1)'], {}), '...
import os import pickle from datetime import datetime from json import dumps from typing import Dict, List, NamedTuple, Union import numpy as np import pandas as pd from fastapi import FastAPI from kafka import KafkaProducer from pydantic import BaseModel from gamma import BayesianGaussianMixture, GaussianMixture fro...
[ "pandas.DataFrame", "gamma.utils.convert_picks_csv", "pandas.read_csv", "os.path.dirname", "json.dumps", "datetime.datetime.strptime", "numpy.mean", "numpy.array", "os.path.join", "gamma.utils.from_seconds", "fastapi.FastAPI" ]
[((1350, 1359), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (1357, 1359), False, 'from fastapi import FastAPI\n'), ((1454, 1509), 'os.path.join', 'os.path.join', (['PROJECT_ROOT', '"""tests/stations_hawaii.csv"""'], {}), "(PROJECT_ROOT, 'tests/stations_hawaii.csv')\n", (1466, 1509), False, 'import os\n'), ((2965, 3...
import array import numpy as np from sys import getsizeof ############################################################################### # EXAMPLES OF THE ARRAY LIBRARY AND NUMPY ARRAYS. ############################################################################### my_python_array = array.array('i') # creates em...
[ "numpy.array", "array.array", "numpy.linspace", "sys.getsizeof" ]
[((290, 306), 'array.array', 'array.array', (['"""i"""'], {}), "('i')\n", (301, 306), False, 'import array\n'), ((848, 882), 'array.array', 'array.array', (['"""i"""', '[10, 9, 8, 7, 5]'], {}), "('i', [10, 9, 8, 7, 5])\n", (859, 882), False, 'import array\n'), ((1066, 1092), 'numpy.array', 'np.array', (['[10, 9, 8, 7, ...
import random import numpy as np from codit.outbreak import Outbreak from codit.outbreak_recorder import WardComponent, MorbidityComponent from codit.society import TestingTracingSociety from codit.society.alternatives import StrategicTester from codit.society.strategic import TwoTrackTester from codit.society.lateral...
[ "numpy.random.seed", "codit.society.strategic.TwoTrackTester", "codit.outbreak_recorder.WardComponent", "codit.disease.Covid", "codit.outbreak_recorder.MorbidityComponent", "random.seed", "codit.society.alternatives.StrategicTester", "numpy.testing.assert_allclose" ]
[((664, 679), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (675, 679), False, 'import random\n'), ((695, 794), 'codit.disease.Covid', 'Covid', ([], {'pr_transmission_per_day': "CFG.PROB_INFECT_IF_TOGETHER_ON_A_DAY['B.1.1.7']", 'name': '"""B.1.1.7"""'}), "(pr_transmission_per_day=CFG.PROB_INFECT_IF_TOGETHER_O...
#!/usr/bin/env python # coding=utf-8 """ Copyright (c) 2020 Baidu.com, Inc. All Rights Reserved File: pooling.py func: 用于特征描述的池化操作 refer https://github.com/filipradenovic/cnnimageretrieval-pytorch/blob/master/cirtorch/layers/pooling.py Author: yuwei09(<EMAIL>) Date: 2021/06/15 """ import numpy as np import paddle impo...
[ "numpy.ones", "paddle.nn.functional.avg_pool2d", "paddle.randn", "paddle.nn.functional.max_pool2d" ]
[((1719, 1751), 'paddle.randn', 'paddle.randn', (['(10, 2048, 14, 14)'], {}), '((10, 2048, 14, 14))\n', (1731, 1751), False, 'import paddle\n'), ((544, 587), 'paddle.nn.functional.max_pool2d', 'F.max_pool2d', (['x', '(x.shape[-2], x.shape[-1])'], {}), '(x, (x.shape[-2], x.shape[-1]))\n', (556, 587), True, 'import paddl...
import numpy as np import scipy as sp import scipy.ndimage as spim from scipy.sparse import csgraph from scipy.spatial import ConvexHull from openpnm.utils import logging, Workspace logger = logging.getLogger(__name__) ws = Workspace() def isoutside(coords, shape): r""" Identifies points that lie outside the ...
[ "numpy.absolute", "numpy.sum", "numpy.amin", "numpy.empty", "openpnm.network.Delaunay", "numpy.ones", "numpy.shape", "numpy.sin", "numpy.arange", "scipy.sparse.csgraph.connected_components", "numpy.tile", "numpy.inner", "numpy.unique", "scipy.spatial.Delaunay", "numpy.atleast_2d", "sci...
[((191, 218), 'openpnm.utils.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (208, 218), False, 'from openpnm.utils import logging, Workspace\n'), ((224, 235), 'openpnm.utils.Workspace', 'Workspace', ([], {}), '()\n', (233, 235), False, 'from openpnm.utils import logging, Workspace\n'), ((6...
import torch import torch.nn as nn from sklearn.metrics import jaccard_similarity_score, roc_auc_score, precision_score, f1_score, average_precision_score, average_precision_score import numpy as np from models import GMNN from util import llprint, multi_label_metric import dill import time from torch.nn import...
[ "models.GMNN", "numpy.full", "torch.LongTensor", "torch.manual_seed", "numpy.zeros", "torch.FloatTensor", "time.time", "numpy.argsort", "numpy.max", "numpy.mean", "numpy.array", "torch.nn.functional.sigmoid", "torch.device", "os.path.join" ]
[((413, 436), 'torch.manual_seed', 'torch.manual_seed', (['(1203)'], {}), '(1203)\n', (430, 436), False, 'import torch\n'), ((2843, 2865), 'torch.device', 'torch.device', (['"""cuda:0"""'], {}), "('cuda:0')\n", (2855, 2865), False, 'import torch\n'), ((3528, 3587), 'models.GMNN', 'GMNN', (['voc_size', 'ehr_adj', 'ddi_a...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
[ "pytest.warns", "pytest.raises", "networkx.Graph", "numpy.array", "pytest.mark.parametrize", "bokeh.plotting.graph.from_networkx" ]
[((3056, 3101), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""typ"""', '[list, tuple]'], {}), "('typ', [list, tuple])\n", (3079, 3101), False, 'import pytest\n'), ((1256, 1266), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (1264, 1266), True, 'import networkx as nx\n'), ((1359, 1399), 'bokeh.plotting.g...
# Copyright (c) 2019-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
[ "nvidia.dali.ops.readers.Caffe", "nvidia.dali.fn.cast", "nvidia.dali.ops.decoders.Image", "nvidia.dali.fn.resize", "nvidia.dali.fn.random.coin_flip", "nvidia.dali.ops.Water", "numpy.zeros", "cv2.remap", "numpy.sin", "numpy.arange", "numpy.cos", "nvidia.dali.ops.PythonFunction", "test_utils.g...
[((943, 964), 'test_utils.get_dali_extra_path', 'get_dali_extra_path', ([], {}), '()\n', (962, 964), False, 'from test_utils import get_dali_extra_path\n'), ((983, 1025), 'os.path.join', 'os.path.join', (['test_data_root', '"""db"""', '"""lmdb"""'], {}), "(test_data_root, 'db', 'lmdb')\n", (995, 1025), False, 'import o...
import os import numpy as np import warnings from keras.callbacks import Callback from keras import backend as K # Code is ported from https://github.com/fastai/fastai class OneCycleLR(Callback): def __init__(self, num_samples, batch_size, max_lr, ...
[ "matplotlib.pyplot.title", "numpy.load", "keras.backend.set_value", "matplotlib.pyplot.style.use", "os.path.join", "warnings.simplefilter", "os.path.exists", "numpy.linspace", "numpy.random.choice", "numpy.log10", "numpy.save", "matplotlib.pyplot.show", "keras.backend.get_value", "matplotl...
[((7833, 7877), 'keras.backend.set_value', 'K.set_value', (['self.model.optimizer.lr', 'new_lr'], {}), '(self.model.optimizer.lr, new_lr)\n', (7844, 7877), True, 'from keras import backend as K\n'), ((14445, 14498), 'keras.backend.set_value', 'K.set_value', (['self.model.optimizer.lr', 'self.initial_lr'], {}), '(self.m...
import numpy as np class RunningStat(object): def __init__(self, shape): """ calulates the running mean and std of a data stream http://www.johndcook.com/blog/standard_deviation/ :param shape: (tuple) the shape of the data stream's output """ self._step = 0 ...
[ "numpy.asarray", "numpy.square", "numpy.zeros", "numpy.sqrt" ]
[((334, 349), 'numpy.zeros', 'np.zeros', (['shape'], {}), '(shape)\n', (342, 349), True, 'import numpy as np\n'), ((370, 385), 'numpy.zeros', 'np.zeros', (['shape'], {}), '(shape)\n', (378, 385), True, 'import numpy as np\n'), ((541, 558), 'numpy.asarray', 'np.asarray', (['value'], {}), '(value)\n', (551, 558), True, '...
#!/usr/bin/python ''' numpy2geotiff.py <NAME> ---------------- Input: - ASCII file where spaces, line separate numeric 2D array values. Such as that generated by numpy.savetxt() with default formatting. - Geotiff raster with target extent, coordinate system. - File to save output raster Outp...
[ "osgeo.gdal.Open", "osgeo.gdal.GetDriverByName", "numpy.loadtxt", "optparse.OptionParser" ]
[((640, 654), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (652, 654), False, 'from optparse import OptionParser\n'), ((1306, 1335), 'osgeo.gdal.Open', 'gdal.Open', (['options.geotiff_in'], {}), '(options.geotiff_in)\n', (1315, 1335), False, 'from osgeo import gdal\n'), ((1432, 1457), 'numpy.loadtxt', 'np...
from .CoderBase import CoderBase import numpy as np class TBR(CoderBase): def __init__(self, f_factor): self.f_factor = f_factor self.threshold = None self.start_point = None self.previous_signal = None self.enc_N = 0 self.M = 0 self.V = 0 self.dec_is...
[ "numpy.abs", "numpy.sum", "numpy.roll", "numpy.zeros", "numpy.mean", "numpy.sign", "numpy.sqrt" ]
[((3421, 3442), 'numpy.zeros', 'np.zeros', (['self.window'], {}), '(self.window)\n', (3429, 3442), True, 'import numpy as np\n'), ((5718, 5743), 'numpy.roll', 'np.roll', (['self.sig_hist', '(1)'], {}), '(self.sig_hist, 1)\n', (5725, 5743), True, 'import numpy as np\n'), ((6443, 6468), 'numpy.roll', 'np.roll', (['self.s...
import struct from abc import abstractclassmethod import numpy as np import scipy.sparse as sparse import h5py def load_sparse_data(fname): with open(fname, 'rb') as fd: magic = b'' for b in struct.unpack('4c', fd.read(4)): magic += b if magic != b'\x00\x00\xae\xfd': ...
[ "h5py.File", "numpy.amin", "numpy.ravel", "numpy.amax", "scipy.sparse.coo_matrix", "numpy.product", "numpy.all" ]
[((855, 871), 'numpy.product', 'np.product', (['size'], {}), '(size)\n', (865, 871), True, 'import numpy as np\n'), ((2865, 2881), 'numpy.all', 'np.all', (['(vol == 0)'], {}), '(vol == 0)\n', (2871, 2881), True, 'import numpy as np\n'), ((3739, 3829), 'scipy.sparse.coo_matrix', 'sparse.coo_matrix', (['(self.data, (self...
# -*- coding: utf-8 -*- # File generated according to Generator/ClassesRef/Slot/VentilationPolar.csv # WARNING! All changes made in this file will be lost! """Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Slot/VentilationPolar """ from os import linesep from sys import ...
[ "numpy.isnan", "sys.getsizeof" ]
[((10487, 10505), 'sys.getsizeof', 'getsizeof', (['self.D0'], {}), '(self.D0)\n', (10496, 10505), False, 'from sys import getsizeof\n'), ((10520, 10538), 'sys.getsizeof', 'getsizeof', (['self.H0'], {}), '(self.H0)\n', (10529, 10538), False, 'from sys import getsizeof\n'), ((10553, 10571), 'sys.getsizeof', 'getsizeof', ...
import os import numpy as np import pandas as pd data_path = "" data_dir = data_path+os.sep+"GeneNetworks" HiNTfile = data_dir+os.sep+"HomoSapiens_htb_hq.txt" def generate_HiNT_adjacency(): hint_df = pd.read_csv(HiNTfile, sep="\t") total_genes = set(hint_df['Gene_A'].tolist()).union(set(hint_df['Gene_B'].toli...
[ "pandas.read_csv", "numpy.fill_diagonal", "pandas.DataFrame" ]
[((206, 237), 'pandas.read_csv', 'pd.read_csv', (['HiNTfile'], {'sep': '"""\t"""'}), "(HiNTfile, sep='\\t')\n", (217, 237), True, 'import pandas as pd\n'), ((407, 435), 'numpy.fill_diagonal', 'np.fill_diagonal', (['adj_mat', '(1)'], {}), '(adj_mat, 1)\n', (423, 435), True, 'import numpy as np\n'), ((449, 510), 'pandas....
# Test of subplot plotting direction # Plots from: https://matplotlib.org/3.2.1/gallery/images_contours_and_fields/plot_streamplot.html#sphx-glr-gallery-images-contours-and-fields-plot-streamplot-py import os import numpy as np from figpager import FigPager # Reference: # https://matplotlib.org/devdocs/ga...
[ "numpy.linspace", "numpy.sin", "figpager.FigPager" ]
[((620, 706), 'figpager.FigPager', 'FigPager', (['"""letter"""', '(2)', '(2)'], {'outfile': 'outfile', 'orientation': '"""portrait"""', 'overwrite': '(True)'}), "('letter', 2, 2, outfile=outfile, orientation='portrait', overwrite\n =True)\n", (628, 706), False, 'from figpager import FigPager\n'), ((764, 794), 'numpy...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Purpose: # Status: Developing # Dependence: Python 3.6 # Version: ALPHA # Created Date: 10:21h, 20/12/2018 # Usage: # # # Author: <NAME>, https://github.com/SeisPider # Email...
[ "matplotlib.pyplot.switch_backend", "numpy.random.choice", "scipy.optimize.minimize", "numpy.abs", "os.path.basename", "matplotlib.pyplot.close", "numpy.zeros", "numpy.arcsin", "numpy.isnan", "numpy.rad2deg", "multiprocessing.Pool", "numpy.loadtxt", "glob.glob", "matplotlib.pyplot.subplots...
[((559, 612), 'numpy.loadtxt', 'np.loadtxt', (['logfile'], {'skiprows': '(2)', 'usecols': '(1, 2, 3, 4)'}), '(logfile, skiprows=2, usecols=(1, 2, 3, 4))\n', (569, 612), True, 'import numpy as np\n'), ((1690, 1783), 'scipy.optimize.minimize', 'minimize', (['misfit', '(3)'], {'args': '(meas_p, meas_ang, meas_wt)', 'metho...
import numpy as np from pymoo.model.individual import Individual def interleaving_args(*args, kwargs=None): if len(args) % 2 != 0: raise Exception(f"Even number of arguments are required but {len(args)} arguments were provided.") if kwargs is None: kwargs = {} for i in range(int(len(arg...
[ "numpy.array", "pymoo.model.individual.Individual", "numpy.concatenate", "numpy.atleast_2d" ]
[((646, 658), 'pymoo.model.individual.Individual', 'Individual', ([], {}), '()\n', (656, 658), False, 'from pymoo.model.individual import Individual\n'), ((1110, 1123), 'numpy.array', 'np.array', (['val'], {}), '(val)\n', (1118, 1123), True, 'import numpy as np\n'), ((2390, 2401), 'numpy.array', 'np.array', (['e'], {})...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import json from ..builder import LOSSES from .accuracy import accuracy ''' Adaptive Class Supression Loss Author: changewt Source: https://github.com/CASIA-IVA-Lab/ACSL Paper: https://openaccess.thecvf.com/content/CVPR2021/papers/Wa...
[ "torch.unique", "torch.erf", "torch.nonzero", "torch.softmax", "torch.index_select", "torch.sigmoid", "torch.exp", "torch.clamp", "torch.arange", "numpy.random.choice", "torch.no_grad", "torch.sum", "torch.tensor" ]
[((3461, 3511), 'torch.index_select', 'torch.index_select', (['cls_logits', '(1)', 'index_inversion'], {}), '(cls_logits, 1, index_inversion)\n', (3479, 3511), False, 'import torch\n'), ((3581, 3601), 'torch.unique', 'torch.unique', (['labels'], {}), '(labels)\n', (3593, 3601), False, 'import torch\n'), ((4357, 4408), ...
# Once for All: Train One Network and Specialize it for Efficient Deployment # <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # International Conference on Learning Representations (ICLR), 2020. import numpy as np import os import sys import torch try: from urllib import urlretrieve except ImportError: from urllib.re...
[ "numpy.sum", "os.makedirs", "os.path.join", "numpy.argmax", "horovod.torch.allreduce", "numpy.ndarray", "os.path.exists", "urllib.request.urlretrieve", "numpy.random.randint", "torch.zeros", "os.path.expanduser" ]
[((2985, 3014), 'os.path.expanduser', 'os.path.expanduser', (['model_dir'], {}), '(model_dir)\n', (3003, 3014), False, 'import os\n'), ((3121, 3156), 'os.path.join', 'os.path.join', (['model_dir', 'target_dir'], {}), '(model_dir, target_dir)\n', (3133, 3156), False, 'import os\n'), ((3752, 3777), 'os.path.exists', 'os....
import sys import numpy as np class BFGS: """ Class to execute a BFGS optimization to a local minimum """ def __init__(self, step_tol=1E-7, grad_tol=1E-7, line_tol=1E-10, inhess=None, max_step=100, max_lin_step=1000, use_grad_tol=1, use_step_tol=1): """ ...
[ "numpy.outer", "numpy.power", "numpy.linalg.inv", "numpy.linalg.norm", "numpy.dot", "sys.exit" ]
[((2287, 2303), 'numpy.linalg.inv', 'np.linalg.inv', (['H'], {}), '(H)\n', (2300, 2303), True, 'import numpy as np\n'), ((1439, 1549), 'sys.exit', 'sys.exit', (["('Cannot execute an optimization if neither the step ' +\n 'nor the gradient tolerance can be used')"], {}), "('Cannot execute an optimization if neither t...
""" A script to assess model precision, accuracy, recall, and f1 score via cross validation """ import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier from xgboost import XGBClassifier from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import make_scorer, accuracy_s...
[ "argparse.ArgumentParser", "numpy.argmax", "sklearn.model_selection.cross_validate", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score", "sklearn.preprocessing.MinMaxScaler", "pandas.read_csv", "sklearn.metrics.f1_score", "keras.optimizers.adam", "sklearn.preprocessing.La...
[((736, 761), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (759, 761), False, 'import argparse\n'), ((1925, 1939), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {}), '()\n', (1937, 1939), False, 'from sklearn.preprocessing import MinMaxScaler\n'), ((2665, 2696), 'sklearn.model_se...
import numpy as np import matplotlib.pyplot as plt import scipy.optimize as opt # Definirajmo funkcijo, ki jo fitamo f = lambda x, A, B: A * np.exp(B * x) data = np.loadtxt('../data/boltz.dat', skiprows=1, delimiter=',') # Klicemo curve_fit, kjer je # - sigma: seznam napak y koordinate # - p0: zacetni priblizki pa...
[ "matplotlib.pyplot.show", "scipy.optimize.curve_fit", "numpy.loadtxt", "numpy.exp", "numpy.diag", "matplotlib.pyplot.errorbar" ]
[((164, 222), 'numpy.loadtxt', 'np.loadtxt', (['"""../data/boltz.dat"""'], {'skiprows': '(1)', 'delimiter': '""","""'}), "('../data/boltz.dat', skiprows=1, delimiter=',')\n", (174, 222), True, 'import numpy as np\n'), ((378, 451), 'scipy.optimize.curve_fit', 'opt.curve_fit', (['f', 'data[:, 0]', 'data[:, 1]'], {'sigma'...
from opts import opts import h5py import json import numpy as np from vocab import vocabulary import cPickle import random import os class DataLoader(object): ''' dataloader for loading data ''' def __init__(self,opt,phase): assert isinstance(opt,opts) self.opt = opt # new at...
[ "h5py.File", "json.load", "random.shuffle", "numpy.zeros", "numpy.random.randint", "numpy.reshape", "numpy.int32", "numpy.repeat" ]
[((473, 495), 'h5py.File', 'h5py.File', (['opt.data_h5'], {}), '(opt.data_h5)\n', (482, 495), False, 'import h5py\n'), ((420, 448), 'h5py.File', 'h5py.File', (['opt.attributes_h5'], {}), '(opt.attributes_h5)\n', (429, 448), False, 'import h5py\n'), ((558, 570), 'json.load', 'json.load', (['f'], {}), '(f)\n', (567, 570)...
# general imports import pickle import random import mdtraj as md import numpy as np # Imports from the openff toolkit import openff.toolkit import torch from mdtraj import Trajectory from openff.toolkit.typing.engines.smirnoff import ForceField from torchani.models import ANI2x from tqdm import tqdm forcefield = For...
[ "mdtraj.load", "numpy.linalg.norm", "openmm.Platform.getPlatformByName", "numpy.exp", "numpy.random.randn", "openff.toolkit.typing.engines.smirnoff.ForceField", "numpy.isfinite", "torchani.models.ANI2x", "numpy.linspace", "functools.partial", "tqdm.tqdm", "openmm.unit.sqrt", "openmm.app.Simu...
[((317, 364), 'openff.toolkit.typing.engines.smirnoff.ForceField', 'ForceField', (['"""openff_unconstrained-2.0.0.offxml"""'], {}), "('openff_unconstrained-2.0.0.offxml')\n", (327, 364), False, 'from openff.toolkit.typing.engines.smirnoff import ForceField\n'), ((7870, 7903), 'mdtraj.Trajectory', 'Trajectory', (['sampl...
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # import numpy from pyscf import gto, scf, ao2mo ''' Customizing Hamiltonian for SCF module. Three steps to define Hamiltonian for SCF: 1. Specify the number of electrons. (Note mole object must be "built" before doing this step) 2. Overwrite three attributes of scf...
[ "pyscf.ao2mo.restore", "numpy.zeros", "pyscf.gto.M", "pyscf.scf.RHF", "numpy.eye" ]
[((582, 589), 'pyscf.gto.M', 'gto.M', ([], {}), '()\n', (587, 589), False, 'from pyscf import gto, scf, ao2mo\n'), ((621, 633), 'pyscf.scf.RHF', 'scf.RHF', (['mol'], {}), '(mol)\n', (628, 633), False, 'from pyscf import gto, scf, ao2mo\n'), ((639, 658), 'numpy.zeros', 'numpy.zeros', (['(n, n)'], {}), '((n, n))\n', (650...
import time import warnings from collections import deque from enum import IntEnum import numpy as np from numpy import array from recordtype import recordtype from flatland.envs.agent_utils import RailAgentStatus from flatland.utils.graphics_pil import PILGL, PILSVG from flatland.utils.graphics_pgl import PGLGL #...
[ "numpy.sum", "flatland.utils.graphics_pgl.PGLGL", "flatland.utils.graphics_pil.PILGL", "recordtype.recordtype", "time.time", "flatland.utils.graphics_pil.PILSVG", "numpy.where", "numpy.array", "numpy.arange", "numpy.linspace", "numpy.matmul", "numpy.cos", "warnings.warn", "numpy.sin", "n...
[((4619, 4672), 'recordtype.recordtype', 'recordtype', (['"""visit"""', "['rc', 'iDir', 'iDepth', 'prev']"], {}), "('visit', ['rc', 'iDir', 'iDepth', 'prev'])\n", (4629, 4672), False, 'from recordtype import recordtype\n'), ((4758, 4802), 'numpy.array', 'np.array', (['[[-1, 0], [0, 1], [1, 0], [0, -1]]'], {}), '([[-1, ...
""" Figure 3 Plot source patterns """ # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import numpy as np import mne from mne import EvokedArray from config import path_data from sklearn.decomposition import PCA from jr.plot.base import alpha_cmap, LinearSegmentedColormap from surfe...
[ "surfer.Brain", "numpy.abs", "webcolors.hex_to_rgb", "mne.read_source_estimate", "sklearn.decomposition.PCA", "jr.plot.base.LinearSegmentedColormap.from_list", "numpy.concatenate" ]
[((545, 644), 'mne.read_source_estimate', 'mne.read_source_estimate', (["(path_data + 'morph_source_patterns/Target_left_sfreq_patterns-rh.stc')"], {}), "(path_data +\n 'morph_source_patterns/Target_left_sfreq_patterns-rh.stc')\n", (569, 644), False, 'import mne\n'), ((1019, 1056), 'numpy.concatenate', 'np.concatena...
import numpy as np import cv2 def translate(image, x, y): M = np.float32([[1,0,x], [0,1,y]]) shiftedImage = cv2.warpAffine(image, M, (image.shape[1], image.shape[0])) return shiftedImage def rotate(image, angle, center=None, scale=1.0): (h, w) = image.shape[:2] if center is None: cent...
[ "cv2.warpAffine", "numpy.float32", "cv2.getRotationMatrix2D", "cv2.resize" ]
[((67, 101), 'numpy.float32', 'np.float32', (['[[1, 0, x], [0, 1, y]]'], {}), '([[1, 0, x], [0, 1, y]])\n', (77, 101), True, 'import numpy as np\n'), ((117, 175), 'cv2.warpAffine', 'cv2.warpAffine', (['image', 'M', '(image.shape[1], image.shape[0])'], {}), '(image, M, (image.shape[1], image.shape[0]))\n', (131, 175), F...
# code-checked # server-checked import os import torch import torch.nn.parallel import torch.optim import torch.utils.data from torch.autograd import Variable from model import DepthCompletionNet from datasets import DatasetVirtualKITTIValSeq from criterion import MaskedL2Gauss, RMSE import numpy a...
[ "cv2.VideoWriter_fourcc", "numpy.mean", "torch.no_grad", "torch.utils.data.DataLoader", "cv2.imwrite", "torch.load", "os.path.exists", "torch.exp", "numpy.linspace", "model.DepthCompletionNet", "torch.log", "datasets.DatasetVirtualKITTIValSeq", "torch.pow", "cv2.applyColorMap", "os.maked...
[((832, 860), 'torch.nn.DataParallel', 'torch.nn.DataParallel', (['model'], {}), '(model)\n', (853, 860), False, 'import torch\n'), ((888, 912), 'torch.load', 'torch.load', (['restore_from'], {}), '(restore_from)\n', (898, 912), False, 'import torch\n'), ((1010, 1025), 'criterion.MaskedL2Gauss', 'MaskedL2Gauss', ([], {...
import csv from pymatgen.core.structure import Structure from pymatgen.io.ase import AseAtomsAdaptor import os import dscribe from dscribe.descriptors import SineMatrix import argparse import sys import numpy as np import time parser = argparse.ArgumentParser(description='generate 1d sine matrix description of materia...
[ "numpy.save", "csv.reader", "argparse.ArgumentParser", "time.time", "pymatgen.io.ase.AseAtomsAdaptor", "dscribe.descriptors.SineMatrix", "os.path.join" ]
[((237, 329), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""generate 1d sine matrix description of materials"""'}), "(description=\n 'generate 1d sine matrix description of materials')\n", (260, 329), False, 'import argparse\n'), ((449, 460), 'time.time', 'time.time', ([], {}), '()\n...
# -*- coding: utf-8 -*- """ Created on Sat Apr 4 16:48:26 2020 @author: Hooooaaanng """ from Bio.Seq import Seq import time from Bio.Alphabet import IUPAC from Bio import SeqIO import itertools import random import numpy as np import numpy.linalg as linalg import scipy.linalg as la import pickle imp...
[ "Bio.SeqIO.parse", "numpy.argmax", "random.sample", "numpy.zeros", "copy.copy", "time.time", "numpy.max", "random.seed", "numpy.linalg.norm", "itertools.product" ]
[((1168, 1207), 'Bio.SeqIO.parse', 'SeqIO.parse', (["(bacteria + '.fna')", '"""fasta"""'], {}), "(bacteria + '.fna', 'fasta')\n", (1179, 1207), False, 'from Bio import SeqIO\n'), ((1818, 1835), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1829, 1835), False, 'import random\n'), ((1982, 2009), 'numpy.zeros...
import logging import numpy as np import pandas as pd from scipy import sparse from sklearn import base logger = logging.getLogger("causalml") NAN_INT = -98765 # A random integer to impute missing values with class LabelEncoder(base.BaseEstimator): """Label Encoder that groups infrequent values into one labe...
[ "numpy.ones_like", "numpy.hstack", "numpy.arange", "scipy.sparse.hstack", "logging.getLogger" ]
[((115, 144), 'logging.getLogger', 'logging.getLogger', (['"""causalml"""'], {}), "('causalml')\n", (132, 144), False, 'import logging\n'), ((7998, 8037), 'numpy.hstack', 'np.hstack', (['[df[num_cols].values, X_cat]'], {}), '([df[num_cols].values, X_cat])\n', (8007, 8037), True, 'import numpy as np\n'), ((1905, 1926), ...
import theano import theano.tensor as T import numpy from Logistic_Regression import LogisticRegression, load_data import os import sys import timeit from six.moves import cPickle as pickle # This program will focus on a single-hidden-layer MLP. # We start off by implementing a class that will represent a hidden layer....
[ "six.moves.cPickle.dump", "Logistic_Regression.load_data", "theano.function", "theano.tensor.lscalar", "timeit.default_timer", "theano.tensor.dot", "os.path.split", "theano.tensor.ivector", "numpy.zeros", "numpy.random.RandomState", "theano.tensor.grad", "theano.shared", "numpy.mean", "Log...
[((4632, 4650), 'Logistic_Regression.load_data', 'load_data', (['dataset'], {}), '(dataset)\n', (4641, 4650), False, 'from Logistic_Regression import LogisticRegression, load_data\n'), ((5283, 5294), 'theano.tensor.lscalar', 'T.lscalar', ([], {}), '()\n', (5292, 5294), True, 'import theano.tensor as T\n'), ((5367, 5380...
import scipy.misc import numpy as np import os from glob import glob import tensorflow as tf import tensorflow.contrib.slim as slim from keras.datasets import cifar10, mnist class ImageData: def __init__(self, load_size, channels, custom_dataset): self.load_size = load_size self.channels = channe...
[ "tensorflow.trainable_variables", "tensorflow.reshape", "tensorflow.matmul", "os.path.join", "keras.datasets.cifar10.load_data", "tensorflow.subtract", "os.path.exists", "tensorflow.cast", "tensorflow.image.resize_images", "tensorflow.eye", "tensorflow.transpose", "tensorflow.contrib.slim.mode...
[((916, 933), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (931, 933), False, 'from keras.datasets import cifar10, mnist\n'), ((942, 989), 'numpy.concatenate', 'np.concatenate', (['(train_data, test_data)'], {'axis': '(0)'}), '((train_data, test_data), axis=0)\n', (956, 989), True, 'import num...
"""Save the number of trainable parameter and inference speed of all available models.""" # ============================================================================= # Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the...
[ "tqdm.tqdm", "ptlflow.utils.utils.make_divisible", "argparse.ArgumentParser", "ptlflow.utils.utils.get_list_of_available_models_list", "pandas.read_csv", "ptlflow.models_dict.keys", "ptlflow.get_model", "pathlib.Path", "ptlflow.utils.timer.Timer", "torch.cuda.is_available", "ptlflow.utils.utils....
[((3420, 3435), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3433, 3435), False, 'import torch\n'), ((1308, 1333), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1331, 1333), False, 'import argparse\n'), ((2626, 2648), 'pathlib.Path', 'Path', (['args.output_path'], {}), '(args.output_p...
# coding: utf-8 # @Author: oliver # @Date: 2019-11-25 20:52:44 import os import sys import numpy as np from shapely.geometry import * labels_path = 'origin_labels' output_dir = 'gt_labels' labels_list = os.listdir(labels_path) for file in labels_list: file_name = os.path.join(labels_path, file) with open(f...
[ "numpy.asarray", "numpy.savetxt", "numpy.int", "numpy.array", "os.path.join", "os.listdir" ]
[((208, 231), 'os.listdir', 'os.listdir', (['labels_path'], {}), '(labels_path)\n', (218, 231), False, 'import os\n'), ((273, 304), 'os.path.join', 'os.path.join', (['labels_path', 'file'], {}), '(labels_path, file)\n', (285, 304), False, 'import os\n'), ((1300, 1330), 'os.path.join', 'os.path.join', (['output_dir', 'f...
import cv2 import numpy as np def Three_element_add(array): array0 = array[:] array1 = np.append(array[1:],np.array([0])) array2 = np.append(array[2:],np.array([0, 0])) arr_sum = array0 + array1 + array2 return arr_sum[:-2] def VThin(image, array): NEXT = 1 height, width = image.shape[:2...
[ "cv2.GaussianBlur", "cv2.Canny", "cv2.subtract", "numpy.sum", "cv2.filter2D", "cv2.dilate", "cv2.cvtColor", "cv2.imwrite", "cv2.copyMakeBorder", "numpy.ones", "numpy.clip", "numpy.zeros", "cv2.imread", "numpy.where", "numpy.array", "cv2.Sobel" ]
[((2132, 2206), 'cv2.copyMakeBorder', 'cv2.copyMakeBorder', (['binary_image', '(1)', '(0)', '(1)', '(0)', 'cv2.BORDER_CONSTANT'], {'value': '(0)'}), '(binary_image, 1, 0, 1, 0, cv2.BORDER_CONSTANT, value=0)\n', (2150, 2206), False, 'import cv2\n'), ((3270, 3304), 'cv2.GaussianBlur', 'cv2.GaussianBlur', (['image', '(3, ...
# plots.py import numpy as np import pandas as pd import datetime from bokeh.layouts import layout from bokeh.models import (Range1d, ColumnDataSource, RangeTool, LinearColorMapper, BasicTicker, ColorBar, HoverTool, BoxSelectTool, Span, Paragraph, ...
[ "bokeh.models.ColumnDataSource", "numpy.polyfit", "numpy.isnan", "bokeh.models.RangeTool", "logging.NullHandler", "bokeh.models.widgets.tables.DateFormatter", "bokeh.models.widgets.tables.TableColumn", "itertools.zip_longest", "pandas.notnull", "numpy.linspace", "pandas.api.types.is_datetime64_a...
[((1289, 1302), 'logging.NullHandler', 'NullHandler', ([], {}), '()\n', (1300, 1302), False, 'from logging import getLogger, NullHandler\n'), ((6390, 6402), 'bokeh.layouts.layout', 'layout', (['grid'], {}), '(grid)\n', (6396, 6402), False, 'from bokeh.layouts import layout\n'), ((8489, 8549), 'bokeh.models.LinearColorM...
## Python 3 import logging import math import numpy as np import numpy.linalg import numpy.random from collections import defaultdict from collections import Counter from utility import * import inside RIGHT_ARROW = "->" START_SYMBOL = "S" UNARY_SYMBOL = "<A>" SAMPLE_MAX_DEPTH=100 SAMPLE_CACHE_SIZE=1000 PARTITIO...
[ "math.exp", "numpy.sum", "numpy.eye", "inside.InsideComputation", "numpy.zeros", "collections.defaultdict", "numpy.array", "collections.Counter", "math.log" ]
[((19495, 19504), 'collections.Counter', 'Counter', ([], {}), '()\n', (19502, 19504), False, 'from collections import Counter\n'), ((4405, 4423), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (4416, 4423), False, 'from collections import defaultdict\n'), ((4775, 4793), 'collections.defaultdict...
import tensorflow as tf tf_version = int((tf.__version__).split('.')[0]) if tf_version >= 2: import tensorflow.compat.v1 as tf tf.disable_v2_behavior() #trying to fix the cuDNN issue config = tf.compat.v1.ConfigProto() config.gpu_options.allow_growth = True sess = tf.compat.v1.Session(config=config) gpu_devi...
[ "numpy.moveaxis", "numpy.sum", "numpy.ones", "tensorflow.compat.v1.__version__.split", "numpy.arange", "scipy.sparse.csgraph.connected_components", "mrcnn.model.MaskRCNN", "numpy.unique", "tensorflow.compat.v1.config.experimental.set_memory_growth", "numpy.max", "numpy.linspace", "tensorflow.c...
[((202, 228), 'tensorflow.compat.v1.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ([], {}), '()\n', (226, 228), True, 'import tensorflow.compat.v1 as tf\n'), ((275, 310), 'tensorflow.compat.v1.compat.v1.Session', 'tf.compat.v1.Session', ([], {'config': 'config'}), '(config=config)\n', (295, 310), True, 'import te...
""" Unit tests for visibility operations """ import sys import unittest import logging import numpy from data_models.parameters import arl_path from data_models.polarisation import PolarisationFrame from processing_components.visibility.base import create_blockvisibility_from_uvfits, create_visibility_f...
[ "unittest.main", "processing_components.image.operations.export_image_to_fits", "matplotlib.pyplot.show", "numpy.abs", "data_models.polarisation.PolarisationFrame", "data_models.parameters.arl_path", "logging.StreamHandler", "processing_components.visibility.coalesce.convert_blockvisibility_to_visibil...
[((723, 750), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (740, 750), False, 'import logging\n'), ((795, 828), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (816, 828), False, 'import logging\n'), ((845, 878), 'logging.StreamHandler', 'loggin...
from comet_ml import Experiment import torch import torchvision import torchvision.transforms as transforms import matplotlib.pyplot as plt import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import torch.optim as optim transform = transforms.Compose( [...
[ "matplotlib.pyplot.show", "torch.utils.data.DataLoader", "torch.load", "torch.nn.Conv2d", "torch.nn.CrossEntropyLoss", "numpy.transpose", "torch.zeros", "torchvision.datasets.CIFAR10", "torchvision.utils.make_grid", "torch.max", "torch.cuda.is_available", "torch.autograd.set_detect_anomaly", ...
[((417, 512), 'torchvision.datasets.CIFAR10', 'torchvision.datasets.CIFAR10', ([], {'root': '"""./data"""', 'train': '(True)', 'download': '(True)', 'transform': 'transform'}), "(root='./data', train=True, download=True,\n transform=transform)\n", (445, 512), False, 'import torchvision\n'), ((563, 628), 'torch.utils...
import unittest from ..utils import check_for_sklearn_backend class IoSklearnTest(unittest.TestCase): @unittest.skipUnless(check_for_sklearn_backend(), "Test should be only executed if sklearn backend is " "installed and specified") def test_load_save(self):...
[ "unittest.main", "sklearn.tree.DecisionTreeRegressor", "numpy.random.rand", "delira.io.sklearn.save_checkpoint", "delira.io.sklearn.load_checkpoint" ]
[((800, 815), 'unittest.main', 'unittest.main', ([], {}), '()\n', (813, 815), False, 'import unittest\n'), ((653, 702), 'delira.io.sklearn.save_checkpoint', 'save_checkpoint', (['"""./model_sklearn.pkl"""'], {'model': 'net'}), "('./model_sklearn.pkl', model=net)\n", (668, 702), False, 'from delira.io.sklearn import loa...
#! /usr/bin/env python import os import time import datetime import sys import shutil import glob import data_utils as utils import tensorflow as tf import numpy as np import pandas as pd import pickle from ekphrasis.classes.preprocessor import TextPreProcessor from ekphrasis.classes.tokenizer import SocialTokenizer ...
[ "os.remove", "tensorflow.nn.zero_fraction", "tensorflow.local_variables_initializer", "tensorflow.ConfigProto", "tensorflow.global_variables", "pickle.load", "tensorflow.Variable", "glob.glob", "tensorflow.summary.merge", "os.path.join", "data_utils.load_embeddings", "ekphrasis.classes.tokeniz...
[((523, 635), 'tensorflow.flags.DEFINE_float', 'tf.flags.DEFINE_float', (['"""dev_sample_percentage"""', '(0.2)', '"""Percentage of the training data to use for validation"""'], {}), "('dev_sample_percentage', 0.2,\n 'Percentage of the training data to use for validation')\n", (544, 635), True, 'import tensorflow as...
import numpy as np, os, sys import torch import matplotlib as mpl #patch-wise similarities, droi images def datagen2d(w1,w2,eps,num): x=np.random.normal(size=(num,2)) y=x[:,0]*w1+x[:,1]*w2+eps*np.random.normal(size=(num)) #x.shape=(numdata,dims) dims=2 here #y.shape=(numdata) print(x.shape,y.shape) ret...
[ "numpy.eye", "numpy.asarray", "numpy.zeros", "numpy.mean", "numpy.arange", "numpy.random.normal", "numpy.dot", "numpy.random.shuffle" ]
[((141, 172), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(num, 2)'}), '(size=(num, 2))\n', (157, 172), True, 'import numpy as np, os, sys\n'), ((362, 379), 'numpy.arange', 'np.arange', (['y.size'], {}), '(y.size)\n', (371, 379), True, 'import numpy as np, os, sys\n'), ((382, 405), 'numpy.random.shuffle',...
''' Fvtk module implements simple visualization functions using VTK. The main idea is the following: A window can have one or more renderers. A renderer can have none, one or more actors. Examples of actors are a sphere, line, point etc. You basically add actors in a renderer and in that way you can visualize the fore...
[ "numpy.ndindex", "dipy.data.get_cmap", "numpy.asarray", "dipy.data.get_sphere", "numpy.zeros", "numpy.clip", "dipy.utils.six.moves.xrange", "dipy.core.ndindex.ndindex", "numpy.array", "numpy.interp", "numpy.dot", "dipy.reconst.dti.fractional_anisotropy", "numpy.vstack" ]
[((4708, 4744), 'numpy.asarray', 'np.asarray', (['colors'], {'dtype': 'np.float32'}), '(colors, dtype=np.float32)\n', (4718, 4744), True, 'import numpy as np\n'), ((6770, 6788), 'numpy.asarray', 'np.asarray', (['colors'], {}), '(colors)\n', (6780, 6788), True, 'import numpy as np\n'), ((10094, 10112), 'numpy.asarray', ...
import os import time from itertools import product import argparse import json import numpy as np from matplotlib import pyplot as plt import tensorflow as tf import strawberryfields as sf from strawberryfields.ops import * from learner.circuits import variational_quantum_circuit from learner.gates import (cubic_phase...
[ "tensorflow.reduce_sum", "argparse.ArgumentParser", "numpy.einsum", "numpy.mean", "learner.gates.get_modes", "numpy.arange", "learner.gates.average_fidelity", "learner.gates.sample_average_fidelity", "os.path.join", "numpy.round", "tensorflow.abs", "learner.gates.unitary_state_fidelity", "le...
[((971, 1033), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Quantum gate synthesis."""'}), "(description='Quantum gate synthesis.')\n", (994, 1033), False, 'import argparse\n'), ((2661, 2710), 'os.path.join', 'os.path.join', (['args.out_dir', "hyperparams['ID']", '""""""'], {}), "(args...
# Copyright 2020 The Flax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
[ "jax.numpy.array", "numpy.log", "jax.numpy.where", "jax.numpy.einsum", "jax.numpy.take", "numpy.zeros", "flax.nn.initializers.normal", "flax.nn.dropout", "flax.nn.initializers.xavier_uniform", "numpy.sin", "flax.nn.gelu", "flax.nn.LayerNorm", "numpy.cos", "numpy.arange", "flax.nn.Dense" ...
[((1358, 1392), 'flax.nn.initializers.normal', 'nn.initializers.normal', ([], {'stddev': '(1.0)'}), '(stddev=1.0)\n', (1380, 1392), False, 'from flax import nn\n'), ((2472, 2520), 'numpy.zeros', 'np.zeros', (['(max_len, d_feature)'], {'dtype': 'np.float32'}), '((max_len, d_feature), dtype=np.float32)\n', (2480, 2520), ...
from VESIcal import calibration_checks from VESIcal import core from scipy.optimize import root_scalar from abc import abstractmethod import numpy as np class FugacityModel(object): """ The fugacity model object is for implementations of fugacity models for individual volatile species, though it may depend on...
[ "numpy.log", "numpy.double", "scipy.optimize.root_scalar", "numpy.fabs", "numpy.array", "numpy.exp", "numpy.cos", "numpy.arctan", "VESIcal.core.InputError", "VESIcal.calibration_checks.CalibrationRange", "numpy.sqrt" ]
[((22146, 22423), 'numpy.array', 'np.array', (['[0.0, 0.029517729893, -6337.56452413, -275265.428882, 0.00129128089283, -\n 145.797416153, 76593.8947237, 2.58661493537e-06, 0.52126532146, -\n 139.839523753, -2.36335007175e-08, 0.00535026383543, -0.27110649951, \n 25038.7836486, 0.73226726041, 0.015483335997]']...
from numpy import arcsin, cos, exp, angle, pi, sin, tan, array from ....Functions.Geometry.inter_line_line import inter_line_line def _comp_point_coordinate(self): """Compute the point coordinates needed to plot the Slot. Parameters ---------- self : HoleM53 A HoleM53 object Returns ...
[ "numpy.angle", "numpy.arcsin", "numpy.sin", "numpy.tan", "numpy.exp", "numpy.cos" ]
[((473, 513), 'numpy.arcsin', 'arcsin', (['(self.W3 / (2 * (Rext - self.H1)))'], {}), '(self.W3 / (2 * (Rext - self.H1)))\n', (479, 513), False, 'from numpy import arcsin, cos, exp, angle, pi, sin, tan, array\n'), ((745, 769), 'numpy.exp', 'exp', (['(-1.0j * alpha_S / 2)'], {}), '(-1.0j * alpha_S / 2)\n', (748, 769), F...
#! /usr/bin/env python # coding=utf-8 #================================================================ # Copyright (C) 2019 * Ltd. All rights reserved. # # Editor : VIM # File name : kmeans.py # Author : YunYang1994 # Created date: 2019-01-25 11:08:15 # Description : # #========================...
[ "matplotlib.pyplot.title", "numpy.random.seed", "argparse.ArgumentParser", "numpy.sum", "numpy.empty", "numpy.argmin", "numpy.argsort", "numpy.arange", "matplotlib.pyplot.tight_layout", "seaborn.xkcd_rgb.values", "numpy.unique", "matplotlib.pyplot.rc", "numpy.random.choice", "numpy.minimum...
[((485, 506), 'seaborn.xkcd_rgb.values', 'sns.xkcd_rgb.values', ([], {}), '()\n', (504, 506), True, 'import seaborn as sns\n'), ((885, 919), 'numpy.minimum', 'np.minimum', (['clusters[:, 0]', 'box[0]'], {}), '(clusters[:, 0], box[0])\n', (895, 919), True, 'import numpy as np\n'), ((928, 962), 'numpy.minimum', 'np.minim...