code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#========================================= #We need to implement a class with two functions including #train() and get_basis(), where train() function is to #train the deep model and get_basis() function is to get #the basis (or called embedding, latent representation) of x_test #=====================================...
[ "tensorflow.glorot_uniform_initializer", "tensorflow.reduce_sum", "tensorflow.square", "graph_nets.utils_tf.placeholders_from_networkxs", "tensorflow.get_collection", "tensorflow.reset_default_graph", "tensorflow.global_variables_initializer", "graph_nets.utils_np.networkxs_to_graphs_tuple", "tensor...
[((801, 817), 'seaborn.reset_orig', 'sns.reset_orig', ([], {}), '()\n', (815, 817), True, 'import seaborn as sns\n'), ((7613, 7703), 'graph_nets.utils_tf.placeholders_from_networkxs', 'utils_tf.placeholders_from_networkxs', (['[input_graphs[0]]'], {'force_dynamic_num_graphs': '(True)'}), '([input_graphs[0]],\n force...
import tensorflow as tf from tensorflow.contrib import slim import os import numpy as np import cv2 import pickle class Image_data: def __init__(self, img_height, img_width, channels, dataset_path, augment_flag): self.img_height = img_height self.img_width = img_width self.channels = chann...
[ "tensorflow.trainable_variables", "numpy.clip", "numpy.random.randint", "pickle.load", "os.path.join", "cv2.cvtColor", "cv2.imwrite", "os.path.exists", "tensorflow.cast", "numpy.reshape", "tensorflow.random_crop", "cv2.resize", "tensorflow.image.resize_images", "tensorflow.image.random_fli...
[((3590, 3636), 'cv2.resize', 'cv2.resize', (['img'], {'dsize': '(img_width, img_height)'}), '(img, dsize=(img_width, img_height))\n', (3600, 3636), False, 'import cv2\n'), ((3912, 4001), 'tensorflow.image.resize', 'tf.image.resize', (['images'], {'size': '[height, width]', 'method': 'tf.image.ResizeMethod.BILINEAR'}),...
# Proximal import sys sys.path.append('../../') from proximal.utils.utils import * from proximal.halide.halide import * from proximal.lin_ops import * from proximal.prox_fns import * from proximal.algorithms import * import numpy as np from scipy import ndimage import matplotlib.pyplot as plt import cv2 ###########...
[ "sys.path.append", "matplotlib.pyplot.subplot", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "numpy.maximum", "matplotlib.pyplot.imshow", "numpy.float32", "scipy.ndimage.convolve", "numpy.amax", "matplotlib.pyplot.figure", "numpy.random.poisson" ]
[((22, 47), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (37, 47), False, 'import sys\n'), ((557, 592), 'scipy.ndimage.convolve', 'ndimage.convolve', (['x', 'K'], {'mode': '"""wrap"""'}), "(x, K, mode='wrap')\n", (573, 592), False, 'from scipy import ndimage\n'), ((649, 678), 'numpy.flo...
from pdb import set_trace as T import numpy as np from forge.blade import core from forge.blade.lib import enums from forge.blade.lib import material import os #<<<<<<< HEAD import time def loadTiled(tiles, fPath, materials, config, map_arr=None): if map_arr is not None: idxMap = map_arr else: idxM...
[ "numpy.array", "numpy.load", "numpy.zeros", "forge.blade.core.Tile" ]
[((325, 339), 'numpy.load', 'np.load', (['fPath'], {}), '(fPath)\n', (332, 339), True, 'import numpy as np\n'), ((1290, 1322), 'numpy.zeros', 'np.zeros', (['(sz, sz)'], {'dtype': 'object'}), '((sz, sz), dtype=object)\n', (1298, 1322), True, 'import numpy as np\n'), ((2789, 2845), 'numpy.array', 'np.array', (['[[j.index...
import glob import pandas as pd import numpy as np import os import matplotlib.pyplot as plt import matplotlib.dates as mdates from matplotlib.collections import PatchCollection # from pandas.plotting import lag_plot import logging logger = logging.getLogger(__name__) def ensemble_BG(BG, ax=None, plot_var=False, nst...
[ "pandas.read_csv", "logging.Formatter", "matplotlib.pyplot.figure", "matplotlib.dates.HourLocator", "glob.glob", "os.path.join", "os.chdir", "pandas.DataFrame", "logging.FileHandler", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.subplots", "pandas.concat", "matplotlib.pyplot.show", ...
[((242, 269), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (259, 269), False, 'import logging\n'), ((534, 558), 'pandas.to_datetime', 'pd.to_datetime', (['BG.index'], {}), '(BG.index)\n', (548, 558), True, 'import pandas as pd\n'), ((1671, 1683), 'matplotlib.pyplot.figure', 'plt.figure'...
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # '''radii grids''' import numpy from pyscf.lib.parameters import BOHR ######################### # JCP 41 3199 (1964). BRAGG_RADII = 1/BOHR * numpy.array((0, # Ghost atom 0.35, 1.40, # 1s 1.45, 1.05, 0...
[ "numpy.diag_indices_from", "numpy.log", "numpy.empty", "numpy.sin", "numpy.array", "numpy.arange", "numpy.cos", "numpy.dot", "numpy.sqrt" ]
[((3250, 3415), 'numpy.array', 'numpy.array', (['(0, 1.0, 0.5882, 3.0769, 2.0513, 1.5385, 1.2308, 1.0256, 0.8791, 0.7692, \n 0.6838, 4.0909, 3.1579, 2.5714, 2.1687, 1.875, 1.6514, 1.4754, 1.3333)'], {}), '((0, 1.0, 0.5882, 3.0769, 2.0513, 1.5385, 1.2308, 1.0256, 0.8791,\n 0.7692, 0.6838, 4.0909, 3.1579, 2.5714, 2...
# import the necessary packages import numpy as np import cv2 import imutils # load the Tetris block image, convert it to grayscale, and threshold # the image image = cv2.imread("../img/more_shapes_example.png") gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) thresh = cv2.threshold(gray, 10, 255, cv2.THRESH_BINARY)[1] ...
[ "cv2.boundingRect", "cv2.contourArea", "cv2.putText", "cv2.cvtColor", "cv2.waitKey", "cv2.threshold", "numpy.zeros", "cv2.imread", "cv2.convexHull", "imutils.grab_contours", "cv2.drawContours", "cv2.imshow" ]
[((168, 212), 'cv2.imread', 'cv2.imread', (['"""../img/more_shapes_example.png"""'], {}), "('../img/more_shapes_example.png')\n", (178, 212), False, 'import cv2\n'), ((220, 259), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (232, 259), False, 'import cv2\n'), (...
import numpy as np import joblib from copy import deepcopy, copy from os import system, path from astropy.table import Table import matplotlib.pyplot as plt from astropy.modeling import models, fitting data_dir = '/shared/data-camelot/cotar/Asiago_binaries_programme/RV_disentangle_results_newonly_renorm_noremovalfit/'...
[ "matplotlib.pyplot.show", "numpy.median", "matplotlib.pyplot.scatter", "matplotlib.pyplot.close", "numpy.isfinite", "astropy.modeling.fitting.LevMarLSQFitter", "numpy.arange", "astropy.modeling.models.Sine1D", "astropy.table.Table.read" ]
[((331, 374), 'astropy.table.Table.read', 'Table.read', (["(data_dir + 'final_results.fits')"], {}), "(data_dir + 'final_results.fits')\n", (341, 374), False, 'from astropy.table import Table\n'), ((685, 710), 'astropy.modeling.fitting.LevMarLSQFitter', 'fitting.LevMarLSQFitter', ([], {}), '()\n', (708, 710), False, 'f...
""" Copyright (c) 2018-2020 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.zeros" ]
[((3679, 3702), 'numpy.zeros', 'np.zeros', (['num_landmarks'], {}), '(num_landmarks)\n', (3687, 3702), True, 'import numpy as np\n'), ((3704, 3727), 'numpy.zeros', 'np.zeros', (['num_landmarks'], {}), '(num_landmarks)\n', (3712, 3727), True, 'import numpy as np\n')]
import os from typing import Iterable from tqdm import tqdm import pandas as pd from joblib import Parallel, delayed from lost_ds.functional.filter import label_selection, selection_mask import numpy as np from lost_ds.functional.transform import to_abs, polygon_to_bbox from lost_ds.io.file_man import FileMan from l...
[ "lost_ds.functional.validation.validate_empty_images", "lost_ds.util.get_fs", "numpy.setdiff1d", "lost_ds.functional.transform.to_abs", "numpy.clip", "lost_ds.functional.filter.selection_mask", "lost_ds.functional.filter.label_selection", "joblib.Parallel", "joblib.delayed", "os.path.join", "pan...
[((1131, 1163), 'lost_ds.cropping.ds_cropper.DSCropper', 'DSCropper', ([], {'filesystem': 'filesystem'}), '(filesystem=filesystem)\n', (1140, 1163), False, 'from lost_ds.cropping.ds_cropper import DSCropper\n'), ((2000, 2018), 'lost_ds.util.get_fs', 'get_fs', (['filesystem'], {}), '(filesystem)\n', (2006, 2018), False,...
# Copyright (c) 2020 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. import copy import numpy as np import pandas as pd import pytest import pandapipes fr...
[ "pandapipes.create_heat_exchanger", "pytest.main", "pandapipes.reindex_junctions", "pandapipes.fuse_junctions", "pandapipes.create_empty_network", "pandapipes.create_sink", "pandapipes.create_continuous_elements_index", "pandapipes.create_ext_grid", "pandapipes.create_pump_from_parameters", "panda...
[((417, 462), 'pandapipes.create_empty_network', 'pandapipes.create_empty_network', ([], {'fluid': '"""lgas"""'}), "(fluid='lgas')\n", (448, 462), False, 'import pandapipes\n'), ((578, 716), 'pandapipes.create_junction', 'pandapipes.create_junction', (['net'], {'pn_bar': '(1.05)', 'tfluid_k': '(293.15)', 'in_service': ...
from __future__ import print_function from sklearn.externals import joblib import rpc import os import sys import numpy as np np.set_printoptions(threshold=np.nan) class SklearnCifarContainer(rpc.ModelContainerBase): def __init__(self, path): self.model = joblib.load(path) print("Loaded %s model" ...
[ "numpy.set_printoptions", "rpc.RPCService", "os.path.splitext", "sklearn.externals.joblib.load", "os.path.join", "os.listdir", "sys.exit" ]
[((126, 163), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.nan'}), '(threshold=np.nan)\n', (145, 163), True, 'import numpy as np\n'), ((1695, 1733), 'os.path.join', 'os.path.join', (['model_path', 'pkl_names[0]'], {}), '(model_path, pkl_names[0])\n', (1707, 1733), False, 'import os\n'), ((183...
"""Simple single threaded simulation.""" import os import time import logging from collections import defaultdict from contextlib import contextmanager import click import numpy as np import pandas as pd import pyarrow as pa from .simple_behavior import SimpleBehaviorModel from .simple_behavior_java import SimpleJav...
[ "xactor.current_rank", "xactor.nodes", "pandas.read_csv", "collections.defaultdict", "xactor.start", "xactor.stop", "pandas.DataFrame", "xactor.getLogger", "click.command", "pandas.concat", "time.perf_counter", "time.sleep", "numpy.hstack", "xactor.ActorProxy", "pyarrow.record_batch", ...
[((633, 657), 'xactor.getLogger', 'asys.getLogger', (['__name__'], {}), '(__name__)\n', (647, 657), True, 'import xactor as asys\n'), ((680, 699), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (697, 699), False, 'import time\n'), ((17633, 17648), 'click.command', 'click.command', ([], {}), '()\n', (17646,...
import sys from os.path import abspath, dirname, join sys.path.insert(1, abspath(join(dirname(dirname(__file__)), 'src'))) import random import unittest import numpy as np import face class TestFace(unittest.TestCase): def setUp(self) -> None: self.dims = (640, 480) self.frame = np.rand...
[ "os.path.dirname", "random.random", "numpy.random.random", "face.get_face_from_frame", "face.face_detection._normalized_to_pixel_coordinates" ]
[((440, 455), 'random.random', 'random.random', ([], {}), '()\n', (453, 455), False, 'import random\n'), ((479, 494), 'random.random', 'random.random', ([], {}), '()\n', (492, 494), False, 'import random\n'), ((718, 813), 'face.get_face_from_frame', 'face.get_face_from_frame', ([], {'frame': 'self.frame', 'model_select...
# environment import argparse import datetime import dateutil import numpy as np import matplotlib.pyplot as plt import pickle from time import sleep from typing import Tuple, Dict, Any, List, Optional from collections import defaultdict from .stats import Stats from .discrete import Discrete from .plotting import bu...
[ "pickle.dump", "numpy.sum", "argparse.ArgumentParser", "numpy.argmax", "numpy.zeros", "numpy.ones", "dateutil.tz.tzlocal", "collections.defaultdict", "time.sleep", "numpy.max", "pickle.load", "numpy.random.randint", "numpy.random.random", "matplotlib.pyplot.savefig" ]
[((9092, 9185), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Perform the training and running Q-learning model"""'}), "(description=\n 'Perform the training and running Q-learning model')\n", (9115, 9185), False, 'import argparse\n'), ((7668, 7701), 'numpy.zeros', 'np.zeros', (['sel...
import numpy as np import pandas as pd def GetDataset(name, base_path): """ Load a dataset Parameters ---------- name : string, dataset name base_path : string, e.g. "path/to/datasets/directory/" Returns ------- X : features (nXp) y : labels (n) """ if name=="m...
[ "pandas.read_csv", "pandas.get_dummies", "sklearn.preprocessing.Imputer", "pandas.DatetimeIndex", "pandas.concat", "numpy.concatenate" ]
[((342, 388), 'pandas.read_csv', 'pd.read_csv', (["(base_path + 'meps_19_reg_fix.csv')"], {}), "(base_path + 'meps_19_reg_fix.csv')\n", (353, 388), True, 'import pandas as pd\n'), ((2925, 2971), 'pandas.read_csv', 'pd.read_csv', (["(base_path + 'meps_20_reg_fix.csv')"], {}), "(base_path + 'meps_20_reg_fix.csv')\n", (29...
import cv2 import numpy as np import matplotlib.pyplot as plt img = cv2.imread(r"..\lena.jpg", 0) dft = cv2.dft(np.float32(img), flags=cv2.DFT_COMPLEX_OUTPUT) dftShift = np.fft.fftshift(dft) ishift = np.fft.ifftshift(dftShift) iImg = cv2.idft(ishift) iImg = cv2.magnitude(iImg[:, :, 0], iImg[:, :, 1]) plt.subplot(1, 2...
[ "matplotlib.pyplot.title", "numpy.fft.ifftshift", "matplotlib.pyplot.subplot", "cv2.magnitude", "matplotlib.pyplot.show", "cv2.idft", "matplotlib.pyplot.imshow", "numpy.float32", "matplotlib.pyplot.axis", "cv2.imread", "numpy.fft.fftshift" ]
[((69, 98), 'cv2.imread', 'cv2.imread', (['"""..\\\\lena.jpg"""', '(0)'], {}), "('..\\\\lena.jpg', 0)\n", (79, 98), False, 'import cv2\n'), ((171, 191), 'numpy.fft.fftshift', 'np.fft.fftshift', (['dft'], {}), '(dft)\n', (186, 191), True, 'import numpy as np\n'), ((201, 227), 'numpy.fft.ifftshift', 'np.fft.ifftshift', (...
from setuptools import setup, Extension from Cython.Build import cythonize import numpy exts = [Extension(name='skrrf.tree._tree', sources=['skrrf/tree/_tree.pyx']), Extension(name='skrrf.tree._criterion', sources=['skrrf/tree/_criterion.pyx']), Extension(name='skrrf.tree._splitter', sources=['skrrf/tr...
[ "setuptools.Extension", "Cython.Build.cythonize", "numpy.get_include" ]
[((97, 165), 'setuptools.Extension', 'Extension', ([], {'name': '"""skrrf.tree._tree"""', 'sources': "['skrrf/tree/_tree.pyx']"}), "(name='skrrf.tree._tree', sources=['skrrf/tree/_tree.pyx'])\n", (106, 165), False, 'from setuptools import setup, Extension\n'), ((175, 253), 'setuptools.Extension', 'Extension', ([], {'na...
#!/usr/bin/env python3 -u # -*- coding: utf-8 -*- __author__ = ["<NAME>"] __all__ = [] import numpy as np import pandas as pd import pytest from sktime.tests._config import VALID_TRANSFORMER_TYPES from sktime.transformations.base import BaseTransformer from sktime.transformations.base import _PanelToPanelTransformer...
[ "sktime.utils.data_processing.is_nested_dataframe", "sktime.utils._testing.estimator_checks._make_args", "numpy.testing.assert_array_equal", "pytest.raises", "sktime.utils._testing.estimator_checks._has_tag", "sktime.utils._testing.estimator_checks._construct_instance", "pytest.mark.parametrize", "skt...
[((918, 983), 'sktime.utils.all_estimators', 'all_estimators', ([], {'estimator_types': '"""transformer"""', 'return_names': '(False)'}), "(estimator_types='transformer', return_names=False)\n", (932, 983), False, 'from sktime.utils import all_estimators\n'), ((987, 1041), 'pytest.mark.parametrize', 'pytest.mark.parame...
from brainrender import Scene from brainrender.actors import Points, Point, PointsDensity import numpy as np from brainrender.actor import Actor import random import pytest def get_n_random_points_in_region(region, N): """ Gets N random points inside (or on the surface) of a mes """ region_bounds = ...
[ "numpy.load", "brainrender.Scene", "random.choices", "brainrender.actors.Point", "pytest.raises", "numpy.random.randint", "brainrender.actors.PointsDensity", "brainrender.actors.Points" ]
[((349, 414), 'numpy.random.randint', 'np.random.randint', (['region_bounds[0]', 'region_bounds[1]'], {'size': '(10000)'}), '(region_bounds[0], region_bounds[1], size=10000)\n', (366, 414), True, 'import numpy as np\n'), ((423, 488), 'numpy.random.randint', 'np.random.randint', (['region_bounds[2]', 'region_bounds[3]']...
import os import logging import time import argparse import datetime from PIL import Image import numpy as np import cv2 import torch from torch.backends import cudnn import torchvision.transforms as transforms from network import get_net from optimizer import restore_snapshot from datasets import cityscapes from co...
[ "argparse.ArgumentParser", "numpy.argmax", "torchvision.transforms.Normalize", "torch.no_grad", "os.path.join", "utils.misc.save_log", "os.path.exists", "datetime.datetime.now", "network.get_net", "config.assert_and_infer_cfg", "os.listdir", "os.makedirs", "time.time", "PIL.Image.open", ...
[((395, 438), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""demo"""'}), "(description='demo')\n", (418, 438), False, 'import argparse\n'), ((939, 983), 'config.assert_and_infer_cfg', 'assert_and_infer_cfg', (['args'], {'train_mode': '(False)'}), '(args, train_mode=False)\n', (959, 983),...
""" __author__ = <NAME> __name__ = sbm.py __description__ = Spectral analysis on the eigenvalues of the adjacency matrix (for estimating number of distinct accounts) """ import copy import numpy as np import matplotlib.pyplot as plt import networkx as nx from sklearn.cluster import KMeans, SpectralCluster...
[ "matplotlib.pyplot.axhline", "sklearn.cluster.SpectralClustering", "scipy.sparse.linalg.svds", "matplotlib.pyplot.close", "numpy.std", "sklearn.cluster.KMeans", "networkx.normalized_laplacian_matrix", "networkx.laplacian_matrix", "numpy.max", "numpy.array", "networkx.compose" ]
[((1667, 1683), 'matplotlib.pyplot.axhline', 'plt.axhline', (['(0.1)'], {}), '(0.1)\n', (1678, 1683), True, 'import matplotlib.pyplot as plt\n'), ((1730, 1741), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (1739, 1741), True, 'import matplotlib.pyplot as plt\n'), ((2026, 2037), 'matplotlib.pyplot.close', '...
# -*- coding: utf8 from gb.sorting.binsearch import _searchsorted import numpy as np def test_searchsorted_size0(): x = np.zeros(shape=(0, ), dtype='d') p = _searchsorted(x, 1) assert p == 0 p = _searchsorted(x, 0) assert p == 0 p = _searchsorted(x, -1) assert p == 0 def test_searchs...
[ "numpy.array", "numpy.zeros", "numpy.searchsorted", "gb.sorting.binsearch._searchsorted" ]
[((128, 159), 'numpy.zeros', 'np.zeros', ([], {'shape': '(0,)', 'dtype': '"""d"""'}), "(shape=(0,), dtype='d')\n", (136, 159), True, 'import numpy as np\n'), ((169, 188), 'gb.sorting.binsearch._searchsorted', '_searchsorted', (['x', '(1)'], {}), '(x, 1)\n', (182, 188), False, 'from gb.sorting.binsearch import _searchso...
""" This module contains functionality for creating an mdtraj-object capable of reading VASP formats This module contains functions for reading vasp input to be inherited by an mdtraj object """ import os, subprocess import numpy as np from copy import deepcopy from shutil import copyfile from ase.io import read, wr...
[ "numpy.absolute", "simsoliq.io.utils._unpack_files", "os.path.isfile", "numpy.mean", "numpy.unique", "simsoliq.geometry_utils.find_max_empty_space", "numpy.genfromtxt", "numpy.reshape", "shutil.copyfile", "copy.deepcopy", "subprocess.Popen", "numpy.cross", "numpy.hstack", "ase.io.read", ...
[((725, 768), 'simsoliq.mdtraj.MDtraj', 'MDtraj', ([], {'bpath': 'fpath', 'fident': 'fname'}), '(bpath=fpath, fident=fname, **kwargs)\n', (731, 768), False, 'from simsoliq.mdtraj import MDtraj\n'), ((1801, 1904), 'subprocess.Popen', 'subprocess.Popen', (['("grep \'%s\' -B 4 %s" % (\'"kinetic"\', filename))'], {'shell':...
import numpy as np def err(FARs, FRRs): # find eer min_abs_diff = 5 min_abs_diff_id = -1 for i in range(0, FARs.__len__()): abs_diff = np.abs(FARs[i] - FRRs[i]) if abs_diff < min_abs_diff: min_abs_diff = abs_diff min_abs_diff_id = i # print(min_abs_diff_id, ...
[ "numpy.abs", "numpy.linspace" ]
[((751, 776), 'numpy.linspace', 'np.linspace', (['(1)', '(0)'], {'num': '(50)'}), '(1, 0, num=50)\n', (762, 776), True, 'import numpy as np\n'), ((161, 186), 'numpy.abs', 'np.abs', (['(FARs[i] - FRRs[i])'], {}), '(FARs[i] - FRRs[i])\n', (167, 186), True, 'import numpy as np\n')]
import numpy as np from scipy.io import loadmat import lasagne from lasagne.layers import * from theano import tensor as T import theano import math # Set hte directory path dir = '/data1/jogendra/eotd2/' def build_theanocnn(net_path): dnet = loadmat(net_path) input_var = T.tensor4('inputs') l_in = I...
[ "theano.tensor.tensor4", "theano.function", "scipy.io.loadmat", "math.ceil", "numpy.dtype", "lasagne.layers.get_output", "numpy.reshape", "numpy.rollaxis" ]
[((258, 275), 'scipy.io.loadmat', 'loadmat', (['net_path'], {}), '(net_path)\n', (265, 275), False, 'from scipy.io import loadmat\n'), ((290, 309), 'theano.tensor.tensor4', 'T.tensor4', (['"""inputs"""'], {}), "('inputs')\n", (299, 309), True, 'from theano import tensor as T\n'), ((1980, 2017), 'theano.function', 'thea...
import math as m import warnings import numpy as nu from scipy import integrate import galpy.util.bovy_symplecticode as symplecticode from galpy.util.bovy_conversion import physical_conversion from .OrbitTop import OrbitTop from galpy.potential.planarPotential import _evaluateplanarRforces,\ RZToplanarPotential, to...
[ "galpy.potential.planarPotential.toPlanarPotential", "numpy.amin", "galpy.potential.planarPotential.RZToplanarPotential", "scipy.integrate.odeint", "galpy.util.bovy_conversion.physical_conversion", "galpy.potential.planarPotential._evaluateplanarRforces", "galpy.potential.planarPotential._evaluateplanar...
[((2465, 2494), 'galpy.util.bovy_conversion.physical_conversion', 'physical_conversion', (['"""energy"""'], {}), "('energy')\n", (2484, 2494), False, 'from galpy.util.bovy_conversion import physical_conversion\n'), ((4079, 4110), 'galpy.util.bovy_conversion.physical_conversion', 'physical_conversion', (['"""position"""...
# /usr/bin/env python3.5 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2020, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
[ "aimet_tensorflow.examples.test_models.model_with_upsample2d", "tensorflow.keras.layers.Dense", "tensorflow.get_collection", "tensorflow.reset_default_graph", "aimet_tensorflow.examples.test_models.model_with_leaky_relu", "numpy.allclose", "aimet_tensorflow.examples.test_models.concat_model", "aimet_t...
[((3006, 3060), 'aimet_common.utils.AimetLogger.get_area_logger', 'AimetLogger.get_area_logger', (['AimetLogger.LogAreas.Test'], {}), '(AimetLogger.LogAreas.Test)\n', (3033, 3060), False, 'from aimet_common.utils import AimetLogger\n'), ((3061, 3136), 'aimet_common.utils.AimetLogger.set_area_logger_level', 'AimetLogger...
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
[ "PIL.ExifTags.TAGS.keys", "os.path.join", "os.path.isdir", "os.path.getsize", "cv2.VideoCapture", "cv2.imread", "utils.torch_utils.torch_distributed_zero_first", "os.path.isfile", "os.cpu_count", "pathlib.Path", "glob.glob", "numpy.ascontiguousarray", "logging.getLogger" ]
[((909, 936), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (926, 936), False, 'import logging\n'), ((984, 1004), 'PIL.ExifTags.TAGS.keys', 'ExifTags.TAGS.keys', ([], {}), '()\n', (1002, 1004), False, 'from PIL import Image, ExifTags\n'), ((1914, 1948), 'utils.torch_utils.torch_distribut...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2018 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
[ "openquake.hazardlib.stats.set_rlzs_stats", "openquake.calculators.base.RiskCalculator.pre_execute", "openquake.baselib.parallel.Starmap", "openquake.risklib.riskinput.hazard_getter.init", "collections.defaultdict", "numpy.fromiter", "openquake.calculators.getters.LossRatiosGetter", "openquake.baselib...
[((1373, 1402), 'operator.attrgetter', 'operator.attrgetter', (['"""weight"""'], {}), "('weight')\n", (1392, 1402), False, 'import operator\n'), ((1416, 1460), 'numpy.dtype', 'numpy.dtype', (["[('start', U32), ('stop', U32)]"], {}), "([('start', U32), ('stop', U32)])\n", (1427, 1460), False, 'import numpy\n'), ((6645, ...
import numpy as np def find_potential_match_regions(template, transformed_array, method='correlation', raw_tolerance=0.666): """To prevent prohibitively slow calculation of normalisation coefficient at each point in image find potential match points, and normalise these only these. This function use...
[ "numpy.round", "numpy.mean", "numpy.linalg.norm", "numpy.sum" ]
[((2618, 2642), 'numpy.linalg.norm', 'np.linalg.norm', (['template'], {}), '(template)\n', (2632, 2642), True, 'import numpy as np\n'), ((3619, 3636), 'numpy.mean', 'np.mean', (['template'], {}), '(template)\n', (3626, 3636), True, 'import numpy as np\n'), ((3708, 3743), 'numpy.linalg.norm', 'np.linalg.norm', (['templa...
# -*- coding: utf-8 -*- ########################################################################### # we have searched for keywords in the original news # for stemmed keywords in the stemmed news # for lemmatized keywords int the lemmatized news # now, want to merge...
[ "pandas.DataFrame", "pandas.read_csv", "pandas.merge", "pandas.read_excel", "numpy.where", "functions.add_stem", "numpy.concatenate" ]
[((539, 597), 'pandas.read_csv', 'pd.read_csv', (['"""output/file1_keywords_original_keywords.csv"""'], {}), "('output/file1_keywords_original_keywords.csv')\n", (550, 597), True, 'import pandas as pd\n'), ((705, 762), 'pandas.read_csv', 'pd.read_csv', (['"""output/file1_keywords_stemmed_keywords.csv"""'], {}), "('outp...
import numpy as np def _built_state_mats(inp): vel = np.zeros((4, 3), dtype=int) pos = np.zeros((4, 3), dtype=int) inp = inp.replace('x=', '') inp = inp.replace('y=', '') inp = inp.replace('z=', '') inp = inp.replace('<', '') inp = inp.replace('>', '') inp = inp.replace(',', '') ...
[ "numpy.abs", "numpy.asarray", "numpy.zeros", "numpy.sum" ]
[((59, 86), 'numpy.zeros', 'np.zeros', (['(4, 3)'], {'dtype': 'int'}), '((4, 3), dtype=int)\n', (67, 86), True, 'import numpy as np\n'), ((97, 124), 'numpy.zeros', 'np.zeros', (['(4, 3)'], {'dtype': 'int'}), '((4, 3), dtype=int)\n', (105, 124), True, 'import numpy as np\n'), ((529, 551), 'numpy.zeros', 'np.zeros', (['(...
## helper functions used in the top level AutoQC.py import json, os, glob, time, pandas, csv, sys, fnmatch, sqlite3, io, pickle, math import numpy as np from wodpy import wod from netCDF4 import Dataset from . import testingProfile from numbers import Number import tempfile import oceansdb def importQC(dir): ''' ...
[ "io.BytesIO", "json.load", "numpy.sum", "wodpy.wod.WodProfile", "numpy.logical_and", "pickle.dump", "oceansdb.ETOPO", "math.sin", "tempfile.TemporaryFile", "os.path.isfile", "numpy.array", "sqlite3.connect", "sys.exc_info", "glob.glob", "fnmatch.fnmatch" ]
[((388, 416), 'glob.glob', 'glob.glob', (["(dir + '/[!_]*.py')"], {}), "(dir + '/[!_]*.py')\n", (397, 416), False, 'import json, os, glob, time, pandas, csv, sys, fnmatch, sqlite3, io, pickle, math\n'), ((4169, 4190), 'numpy.array', 'np.array', (['testResults'], {}), '(testResults)\n', (4177, 4190), True, 'import numpy...
################################################## ### import ### ################################################## # basic lib from ast import literal_eval from collections import Counter import json import numpy as np import os import pandas as pd # logging lib import logging impo...
[ "src.get_test_score.get_test_score", "pandas.read_csv", "src.represent.CLSR", "os.path.isfile", "src.cal_score.f1", "pandas.DataFrame", "src.utils.make_dir", "pandas.merge", "src.analysis.vary_around_params", "collections.Counter", "src.log.get_logger", "pandas.concat", "src.utils.get_experi...
[((1147, 1171), 'src.log.get_logger', 'log.get_logger', (['__name__'], {}), '(__name__)\n', (1161, 1171), True, 'import src.log as log\n'), ((6524, 6548), 'src.log.get_logger', 'log.get_logger', (['__name__'], {}), '(__name__)\n', (6538, 6548), True, 'import src.log as log\n'), ((6741, 6783), 'src.utils.get_experiment_...
import cv2, os, json, itertools, h5py, time import numpy as np from jsmin import jsmin import matplotlib.pyplot as plt def show_images(f, axes, imgs): axes = axes.flatten() assert len(imgs) <= len(axes) for i in range(len(imgs)): axes[i].imshow(imgs[i], cmap='gray') f.show() def load_image...
[ "json.dump", "h5py.File", "os.makedirs", "os.path.join", "cv2.cvtColor", "os.path.isdir", "os.path.dirname", "numpy.asarray", "os.path.exists", "time.time", "cv2.imread", "os.path.normpath", "itertools.chain.from_iterable" ]
[((354, 370), 'cv2.imread', 'cv2.imread', (['path'], {}), '(path)\n', (364, 370), False, 'import cv2, os, json, itertools, h5py, time\n'), ((381, 418), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (393, 418), False, 'import cv2, os, json, itertools, h5py, time\n'),...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 4 18:13:18 2018 @author: matteo """ """References PGPE: Sehnke, Frank, et al. "Policy gradients with parameter-based exploration for control." International Conference on Artificial Neural Networks. Springer, Berlin, Heidelberg,...
[ "baselines.common.colorize", "numpy.sum", "numpy.std", "numpy.isnan", "time.time", "numpy.max", "numpy.mean", "numpy.array", "numpy.min", "numpy.linalg.norm", "numpy.exp", "numpy.dot", "warnings.warn", "baselines.logger.dump_tabular", "baselines.logger.record_tabular", "baselines.logge...
[((633, 644), 'time.time', 'time.time', ([], {}), '()\n', (642, 644), False, 'import time\n'), ((8389, 8400), 'time.time', 'time.time', ([], {}), '()\n', (8398, 8400), False, 'import time\n'), ((2091, 2106), 'numpy.isnan', 'np.isnan', (['bound'], {}), '(bound)\n', (2099, 2106), True, 'import numpy as np\n'), ((3581, 35...
import numpy as np from numpy.linalg import norm from sklearn.metrics import pairwise as pw from scipy.spatial import distance # Following class is adapted from Hibrja, Vascon, Stadelmann and Pelillo (Speaker Clustering # Using Dominant Sets) with code at https://github.com/feliksh/SCDS class DominantSetClustering: ...
[ "numpy.random.seed", "numpy.sum", "numpy.ones", "numpy.mean", "numpy.arange", "numpy.exp", "scipy.spatial.distance.pdist", "numpy.linalg.norm", "numpy.prod", "sklearn.metrics.pairwise.cosine_similarity", "numpy.identity", "numpy.max", "numpy.arccos", "scipy.spatial.distance.squareform", ...
[((16310, 16326), 'numpy.array', 'np.array', (['inputs'], {}), '(inputs)\n', (16318, 16326), True, 'import numpy as np\n'), ((4492, 4533), 'numpy.array', 'np.array', (['feature_vectors'], {'dtype': 'np.float'}), '(feature_vectors, dtype=np.float)\n', (4500, 4533), True, 'import numpy as np\n'), ((4908, 4942), 'numpy.ze...
import numpy as np from rlbox.core import AgentProgram from rlbox.core.space import Spec class TestAgent(AgentProgram): def __init__(self, act_spec: Spec, obs_spec: Spec, pi): AgentProgram.__init__(self, act_spec, obs_spec) self.pi = pi self.actions = np.arange(act_spec.size()) def ...
[ "rlbox.core.AgentProgram.__init__", "numpy.random.choice" ]
[((192, 239), 'rlbox.core.AgentProgram.__init__', 'AgentProgram.__init__', (['self', 'act_spec', 'obs_spec'], {}), '(self, act_spec, obs_spec)\n', (213, 239), False, 'from rlbox.core import AgentProgram\n'), ((364, 415), 'numpy.random.choice', 'np.random.choice', ([], {'a': 'self.actions', 'p': 'self.pi[obs, :]'}), '(a...
import kornia import numpy as np from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.models import ModelCatalog from ray.rllib.utils.annotations import override from ray.rllib.utils import try_import_torch torch, nn = try_import_torch() class ResidualBlock(nn.Module): def __init__(self, ...
[ "matplotlib.pyplot.tight_layout", "ray.rllib.utils.try_import_torch", "ray.rllib.models.torch.torch_modelv2.TorchModelV2.__init__", "matplotlib.pyplot.show", "ray.rllib.utils.annotations.override", "numpy.asarray", "kornia.augmentation.RandomCrop", "ray.rllib.models.ModelCatalog.register_custom_model"...
[((244, 262), 'ray.rllib.utils.try_import_torch', 'try_import_torch', ([], {}), '()\n', (260, 262), False, 'from ray.rllib.utils import try_import_torch\n'), ((13259, 13337), 'ray.rllib.models.ModelCatalog.register_custom_model', 'ModelCatalog.register_custom_model', (['"""custom_impala_cnn_torch"""', 'CustomImpalaCNN'...
import pandas as pd import numpy as np class Investor: def __init__(self): self.cash = 0. self.invested = 0. self.history = [] self.invested_history = [] self.shares = [] self.rebalances = 0 self.rank = 0. self.ror_history = [] self.vol = [] ...
[ "numpy.divide", "numpy.multiply", "numpy.subtract", "numpy.sum", "numpy.floor", "numpy.isnan", "numpy.array", "numpy.dot" ]
[((4687, 4723), 'numpy.multiply', 'np.multiply', (['investor.shares', 'prices'], {}), '(investor.shares, prices)\n', (4698, 4723), True, 'import numpy as np\n'), ((4052, 4067), 'numpy.array', 'np.array', (['[0.5]'], {}), '([0.5])\n', (4060, 4067), True, 'import numpy as np\n'), ((1073, 1092), 'numpy.isnan', 'np.isnan',...
import cv2 import numpy as np cap = cv2.VideoCapture("") # işlenecek olan videonun adresini girip videoyu okuyoruz while True: # videoda her bir frame'in en ve boy bilgisini almalıyız ret, frame = cap.read() #frame okuma frame_width = frame.shape[1] frame_height = frame.shape[0] frame_b...
[ "cv2.putText", "numpy.argmax", "cv2.waitKey", "cv2.dnn.blobFromImage", "cv2.imshow", "cv2.dnn.readNetFromDarknet", "cv2.VideoCapture", "numpy.array", "numpy.tile", "cv2.rectangle", "cv2.destroyAllWindows" ]
[((42, 62), 'cv2.VideoCapture', 'cv2.VideoCapture', (['""""""'], {}), "('')\n", (58, 62), False, 'import cv2\n'), ((2844, 2867), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (2865, 2867), False, 'import cv2\n'), ((326, 400), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFromImage', (['frame', '(1 / 255)'...
"""Fit a stacking classifier from an ensemble of estimators""" import warnings from inspect import signature from math import log import numpy as np from joblib import delayed, Parallel import itertools from scipy.special import expit from scipy.special import xlogy from scipy.optimize import fmin_bfgs from sklearn....
[ "sklearn.model_selection.check_cv", "sklearn.preprocessing.LabelBinarizer", "numpy.sum", "sklearn.utils.check_array", "sklearn.utils.check_X_y", "sklearn.utils.validation.check_is_fitted", "sklearn.linear_model.LogisticRegression", "sklearn.utils.indexable", "joblib.Parallel", "joblib.delayed", ...
[((1570, 1665), 'sklearn.utils.check_X_y', 'check_X_y', (['X', 'y'], {'accept_sparse': "['csc', 'csr', 'coo']", 'force_all_finite': '(False)', 'allow_nd': '(True)'}), "(X, y, accept_sparse=['csc', 'csr', 'coo'], force_all_finite=False,\n allow_nd=True)\n", (1579, 1665), False, 'from sklearn.utils import check_X_y, c...
import numpy as np from numpy.linalg import norm from sim_problem import SimProblem, SPDController, JTController, STR class SimJumpController(object): def __init__(self, _world): self.world = _world self.spd = SPDController(self.skel(), 250.0, 20.0, self.world.dt) self.spd.target = self.sk...
[ "sim_problem.STR", "numpy.linalg.norm", "numpy.array", "numpy.linspace", "numpy.random.rand" ]
[((863, 904), 'numpy.array', 'np.array', (['[-3.0, 0.0, -3.0, -300.0, -0.5]'], {}), '([-3.0, 0.0, -3.0, -300.0, -0.5])\n', (871, 904), True, 'import numpy as np\n'), ((918, 956), 'numpy.array', 'np.array', (['[3.0, -3.0, 3.0, 300.0, 0.5]'], {}), '([3.0, -3.0, 3.0, 300.0, 0.5])\n', (926, 956), True, 'import numpy as np\...
# Copyright 2019 FMR LLC <<EMAIL>> # SPDX-License-Identifer: Apache-2.0 import numpy as np import torch from textwiser.base import BaseFeaturizer from textwiser.utils import convert, OutputType class _BaseTransformation(BaseFeaturizer): def __init__(self, wrap_list_input=True): """Initializes a Transfor...
[ "textwiser.utils.convert", "numpy.cumsum", "torch.cat" ]
[((989, 1020), 'textwiser.utils.convert', 'convert', (['x', 'self.input_types[0]'], {}), '(x, self.input_types[0])\n', (996, 1020), False, 'from textwiser.utils import convert, OutputType\n'), ((1671, 1686), 'torch.cat', 'torch.cat', (['x', '(0)'], {}), '(x, 0)\n', (1680, 1686), False, 'import torch\n'), ((1766, 1782),...
"""Wrapper for matplotlib plotting functions. BSD 3-Clause License Copyright (c) 2020-2021, <NAME> All rights reserved. """ # ~~~ IMPORT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import warnings from os import path import numpy as np from matplotlib import legend as mlegend from matplotlib i...
[ "mpl_toolkits.axes_grid1.make_axes_locatable", "matplotlib.legend._get_legend_handles_labels", "prettypyplot.tools.invert_sign", "warnings.filterwarnings", "prettypyplot.tools.gca", "matplotlib.pyplot.colorbar", "prettypyplot.tools.parse_axes", "warnings.catch_warnings", "numpy.array", "matplotlib...
[((1110, 1140), 'prettypyplot.tools.parse_axes', 'tools.parse_axes', (['*args'], {'ax': 'ax'}), '(*args, ax=ax)\n', (1126, 1140), False, 'from prettypyplot import tools\n'), ((1836, 1866), 'prettypyplot.tools.parse_axes', 'tools.parse_axes', (['*args'], {'ax': 'ax'}), '(*args, ax=ax)\n', (1852, 1866), False, 'from pret...
import argparse import os import pickle from types import SimpleNamespace from typing import OrderedDict from pytorch_lightning import callbacks from torch._C import device from utils.vocab import build_vocab, load_vocab from utils.data_loader import get_loader from utils import NLGEval from torchvision.transforms imp...
[ "argparse.ArgumentParser", "math.tanh", "utils.NLGEval", "numpy.mean", "os.path.join", "models.IQ", "torch.nn.MSELoss", "torch.multiprocessing.set_sharing_strategy", "os.path.exists", "copy.deepcopy", "math.sqrt", "torchvision.transforms.transforms.ToPILImage", "torchvision.transforms.transf...
[((638, 695), 'torch.multiprocessing.set_sharing_strategy', 'torch.multiprocessing.set_sharing_strategy', (['"""file_system"""'], {}), "('file_system')\n", (680, 695), False, 'import torch\n'), ((11895, 11920), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (11918, 11920), False, 'import argpar...
case = 'fiducial' import pandas as pd import numpy as np import pystan import os from resspect.salt3_utils import get_distances import pickle import time from shutil import copyfile fit_lightcurves = False restart_master = True # number of bins for SALT2mu nbins = 70 # rather to re-write fitres file replace_z = T...
[ "pandas.DataFrame", "os.makedirs", "pandas.read_csv", "os.path.isdir", "pystan.check_hmc_diagnostics", "numpy.unique", "os.system", "time.time", "numpy.argsort", "numpy.array", "arviz.plot_trace", "pystan.StanModel", "shutil.copyfile", "pandas.concat", "matplotlib.pyplot.savefig", "res...
[((1271, 1300), 'pandas.read_csv', 'pd.read_csv', (['test_zenodo_meta'], {}), '(test_zenodo_meta)\n', (1282, 1300), True, 'import pandas as pd\n'), ((1411, 1429), 'pandas.read_csv', 'pd.read_csv', (['fname'], {}), '(fname)\n', (1422, 1429), True, 'import pandas as pd\n'), ((2300, 2322), 'pandas.DataFrame', 'pd.DataFram...
from utils.compute import get_landmark_3d, get_vector_intersection from utils.visualize import HumanPoseVisualizer from utils.OakRunner import OakRunner from utils.pose import getKeypoints from utils.draw import displayFPS from pathlib import Path import depthai as dai import numpy as np import cv2 fps_limit = 3 fra...
[ "cv2.line", "utils.compute.get_landmark_3d", "cv2.circle", "numpy.concatenate", "utils.visualize.HumanPoseVisualizer", "utils.pose.getKeypoints", "utils.compute.get_vector_intersection", "utils.OakRunner.OakRunner", "pathlib.Path", "cv2.imshow", "cv2.resize" ]
[((4064, 4075), 'utils.OakRunner.OakRunner', 'OakRunner', ([], {}), '()\n', (4073, 4075), False, 'from utils.OakRunner import OakRunner\n'), ((1447, 1570), 'utils.visualize.HumanPoseVisualizer', 'HumanPoseVisualizer', (['(300)', '(300)', '[runner.left_camera_location, runner.right_camera_location]'], {'colors': 'colors...
import numpy as np def get_day5(infile="./aoc2020/day5_input.txt", part2=False): with open(infile, 'r') as f: data = f.read().split("\n") seats = [] for each in data: seats.append( [int(each[0:7].replace("F","0").replace("B","1"), 2), int(each[7...
[ "numpy.max" ]
[((529, 544), 'numpy.max', 'np.max', (['seat_id'], {}), '(seat_id)\n', (535, 544), True, 'import numpy as np\n'), ((596, 611), 'numpy.max', 'np.max', (['seat_id'], {}), '(seat_id)\n', (602, 611), True, 'import numpy as np\n')]
# Confidential, Copyright 2020, Sony Corporation of America, All rights reserved. from typing import Sequence, Type, Optional import numpy as np from ..environment import LocationID, PersonRoutine, Registry, SimTimeInterval, GroceryStore, \ RetailStore, BarberShop, Retired, Restaurant, Bar __all__ = ['get_minor_...
[ "numpy.random.RandomState" ]
[((2396, 2419), 'numpy.random.RandomState', 'np.random.RandomState', ([], {}), '()\n', (2417, 2419), True, 'import numpy as np\n'), ((3160, 3183), 'numpy.random.RandomState', 'np.random.RandomState', ([], {}), '()\n', (3181, 3183), True, 'import numpy as np\n'), ((5604, 5627), 'numpy.random.RandomState', 'np.random.Ran...
#!/usr/bin/env python """Train a DeepCpG model to predict DNA methylation. Trains a DeepCpG model on DNA (DNA model), neighboring methylation states (CpG model), or both (Joint model) to predict CpG methylation of multiple cells. Allows to fine-tune individual models or to train them from scratch. Examples -------- ...
[ "numpy.sum", "argparse.ArgumentParser", "numpy.random.seed", "keras.models.Model", "os.path.isfile", "numpy.mean", "deepcpg.models.dna.list_models", "deepcpg.models.utils.is_input_layer", "deepcpg.models.utils.is_output_layer", "deepcpg.models.data_reader_from_model", "keras.callbacks.LearningRa...
[((2013, 2053), 'deepcpg.models.utils.is_output_layer', 'is_output_layer', (['model.layers[-1]', 'model'], {}), '(model.layers[-1], model)\n', (2028, 2053), False, 'from deepcpg.models.utils import is_input_layer, is_output_layer\n'), ((2499, 2512), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2510, 251...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 24 07:52:25 2020 Generate, Plot, and write all data needed for ball drop example 1 @author: granthutchings """ #%% Imports import numpy as np #import pyDOE # Latin Hypercube import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec fro...
[ "matplotlib.pyplot.title", "numpy.abs", "matplotlib.pyplot.figure", "mpl_toolkits.axes_grid1.inset_locator.inset_axes", "numpy.arange", "invertH.invertHtrue", "numpy.savetxt", "numpy.transpose", "numpy.max", "numpy.loadtxt", "numpy.linspace", "matplotlib.pyplot.show", "invertH.invertHsim", ...
[((1637, 1672), 'numpy.linspace', 'np.linspace', (['(5)', '(20)', 'n_field_heights'], {}), '(5, 20, n_field_heights)\n', (1648, 1672), True, 'import numpy as np\n'), ((1728, 1751), 'numpy.arange', 'np.arange', (['(1.5)', '(25)', '(1.5)'], {}), '(1.5, 25, 1.5)\n', (1737, 1751), True, 'import numpy as np\n'), ((2354, 283...
# -*- coding: utf-8 -*- """ Created on Tue Feb 14 15:59:11 2017 @author: af5u13 """ # Usage for debugging from raw Python console #exec(open("/Users/af5u13/dev/visr/src/python/scripts/rsao/reverbObjectBinauralisation.py").read()) import visr import signalflows import panning import pml import rbbl import rcl im...
[ "pml.MatrixParameterFloat", "h5py.File", "visr.AudioInputFloat", "rcl.FirFilterMatrix", "signalflows.BaselineRenderer", "os.getcwd", "visr.SignalFlowContext", "pml.EmptyParameterConfig", "numpy.arange", "visr.AudioOutputFloat", "pml.MatrixParameterFloat.fromAudioFile", "rrl.AudioSignalFlow", ...
[((3743, 3795), 'visr.SignalFlowContext', 'visr.SignalFlowContext', (['blockSize', 'samplingFrequency'], {}), '(blockSize, samplingFrequency)\n', (3765, 3795), False, 'import visr\n'), ((4006, 4045), 'panning.LoudspeakerArray', 'panning.LoudspeakerArray', (['lspConfigFile'], {}), '(lspConfigFile)\n', (4030, 4045), Fals...
import numpy as np import copy import logging from IPython.display import display, clear_output from collections import defaultdict import pailab.analysis.plot as paiplot import pailab.analysis.plot_helper as plt_helper import ipywidgets as widgets from pailab import MLObjectType, RepoInfoKey, FIRST_VERSION, LAST_VERS...
[ "pailab.tools.checker.Data.run", "pailab.tools.interpretation.compute_ice", "ipywidgets.Output", "collections.defaultdict", "matplotlib.pyplot.figure", "pandas.set_option", "pailab.analysis.plot.ice_clusters", "matplotlib.pyplot.xlabel", "pandas.DataFrame", "ipywidgets.Button", "IPython.display....
[((598, 625), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (615, 625), False, 'import logging\n'), ((676, 717), 'pandas.set_option', 'pd.set_option', (['"""display.max_colwidth"""', '(-1)'], {}), "('display.max_colwidth', -1)\n", (689, 717), True, 'import pandas as pd\n'), ((1019, 1030)...
import numpy as np import torch import random import matplotlib.pyplot as plt import os __all__ = [ "seed_everything", "AverageMeter", "accuracy", "EarlyStopping", "matplotlib_imshow", "print_size_of_model", ] def seed_everything(seed): """ Makes code deterministic using a given seed....
[ "os.remove", "numpy.random.seed", "torch.manual_seed", "matplotlib.pyplot.imshow", "os.path.getsize", "torch.cuda.manual_seed", "numpy.transpose", "random.seed" ]
[((387, 404), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (398, 404), False, 'import random\n'), ((454, 474), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (468, 474), True, 'import numpy as np\n'), ((479, 502), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (49...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import numpy as np import os import pickle from mmpt.utils import ShardedTensor class Shard(object): def __init__( self, ...
[ "pickle.dump", "mmpt.utils.ShardedTensor.from_list", "os.path.join", "numpy.load" ]
[((1722, 1768), 'os.path.join', 'os.path.join', (['self.target_dir', "(split + '_meta')"], {}), "(self.target_dir, split + '_meta')\n", (1734, 1768), False, 'import os\n'), ((1501, 1537), 'mmpt.utils.ShardedTensor.from_list', 'ShardedTensor.from_list', (['video_shard'], {}), '(video_shard)\n', (1524, 1537), False, 'fro...
# Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
[ "tensorflow.random.set_seed", "iwildcamlib.CategoryMap", "numpy.random.seed", "sklearn.metrics.accuracy_score", "os.path.join", "absl.flags.DEFINE_bool", "absl.flags.mark_flag_as_required", "tensorflow.compat.v1.logging.info", "absl.flags.DEFINE_integer", "random.seed", "bags.BalancedGroupSoftma...
[((1112, 1215), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""model_name"""'], {'default': '"""efficientnet-b0"""', 'help': '"""Model name of the archtecture"""'}), "('model_name', default='efficientnet-b0', help=\n 'Model name of the archtecture')\n", (1131, 1215), False, 'from absl import flags\n'), ((1...
import unittest import numpy as np from RyStats.inferential import (unequal_variance_ttest, equal_variance_ttest, one_sample_ttest, repeated_ttest) from RyStats.inferential.ttests import _p_value_and_confidence_intervals class TestEqualVariance(uni...
[ "unittest.main", "RyStats.inferential.one_sample_ttest", "RyStats.inferential.equal_variance_ttest", "numpy.isinf", "numpy.ones", "numpy.random.default_rng", "RyStats.inferential.unequal_variance_ttest", "numpy.testing.assert_allclose", "RyStats.inferential.ttests._p_value_and_confidence_intervals",...
[((7988, 8003), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8001, 8003), False, 'import unittest\n'), ((485, 519), 'numpy.random.default_rng', 'np.random.default_rng', (['(49045463547)'], {}), '(49045463547)\n', (506, 519), True, 'import numpy as np\n'), ((975, 1007), 'numpy.random.default_rng', 'np.random.def...
''' An interactive plot of the ``sin`` function. This example demonstrates adding widgets and ``CustomJS`` callbacks that can update a plot. .. bokeh-example-metadata:: :apis: bokeh.plotting.Figure.line, bokeh.layouts.column, bokeh.layouts.row, bokeh.models.callbacks.CustomJS, bokeh.models.widgets.sliders.Slider ...
[ "bokeh.plotting.figure", "bokeh.models.Slider", "numpy.sin", "bokeh.plotting.show", "numpy.linspace", "bokeh.layouts.column" ]
[((626, 649), 'numpy.linspace', 'np.linspace', (['(0)', '(10)', '(500)'], {}), '(0, 10, 500)\n', (637, 649), True, 'import numpy as np\n'), ((654, 663), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (660, 663), True, 'import numpy as np\n'), ((720, 768), 'bokeh.plotting.figure', 'figure', ([], {'y_range': '(-10, 10)', '...
from datetime import datetime as dt, timedelta import numpy as np import os import torch from torch.nn import MSELoss from torch.optim import LBFGS, Adam from adabelief_pytorch import AdaBelief from torch_cpo_utils import * # from cpo_torch import CPO from buffer_torch import * from models_torch import MLP_DiagGaussi...
[ "wandb.log", "utils.setup_logger_kwargs", "numpy.sum", "argparse.ArgumentParser", "wandb.finish", "torch.sqrt", "torch.cat", "numpy.mean", "torch.arange", "torch.no_grad", "os.path.join", "models_torch.MLP", "torch.nn.MSELoss", "torch.load", "datetime.timedelta", "torch.zeros", "torc...
[((395, 408), 'wandb.login', 'wandb.login', ([], {}), '()\n', (406, 408), False, 'import wandb\n'), ((456, 511), 'wandb.init', 'wandb.init', ([], {'project': '"""cpo-agent-test"""', 'name': 'PROJECT_NAME'}), "(project='cpo-agent-test', name=PROJECT_NAME)\n", (466, 511), False, 'import wandb\n'), ((1304, 1331), 'torch.a...
from tensorflow.keras.preprocessing.text import Tokenizer import numpy as np # Loading all the captions data into a dictionary with the image_name as key # Enter the path of "Flickr8k.token.txt" present in Dataset in "caps_path" variable caps_path = "../input/flickr8k/Flickr_Data/Flickr_Data/Flickr_TextData/Flickr8k....
[ "tensorflow.keras.preprocessing.text.Tokenizer", "numpy.random.choice" ]
[((1573, 1665), 'tensorflow.keras.preprocessing.text.Tokenizer', 'Tokenizer', ([], {'num_words': '(5000)', 'oov_token': '"""<unk>"""', 'filters': '"""!"#$%&()*+.,-/:;=?@[\\\\]^_`{|}~ """'}), '(num_words=5000, oov_token=\'<unk>\', filters=\n \'!"#$%&()*+.,-/:;=?@[\\\\]^_`{|}~ \')\n', (1582, 1665), False, 'from tensor...
''' .. codeauthor:: <NAME> <<EMAIL>> ''' import tempfile import numpy as np import pytest from .test_generic import iter_grids from ..scalar import ScalarField from ..base import FieldBase from ...grids import UnitGrid, CartesianGrid, PolarGrid from ...grids.tests.test_cartesian import _get_cartesian_grid from ...to...
[ "numpy.full", "numpy.random.uniform", "tempfile.NamedTemporaryFile", "numpy.random.random", "numpy.sin", "numpy.array", "numpy.testing.assert_equal", "numpy.cos", "matplotlib.pyplot.imsave", "numpy.testing.assert_allclose", "numpy.testing.assert_array_almost_equal", "pytest.approx", "numpy.l...
[((1253, 1303), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['pf.data.shape', 'grid.shape'], {}), '(pf.data.shape, grid.shape)\n', (1276, 1303), True, 'import numpy as np\n'), ((1343, 1397), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['pf_lap.data.shape', 'grid.shape'], {}), '(pf_lap.data.s...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ from __future__ import absolute_import from __future__ import divis...
[ "torch.nn.MSELoss", "pycocotools.cocoeval.COCOeval.__init__", "numpy.random.shuffle", "numpy.concatenate", "torch.autograd.Variable", "torch.load", "numpy.float", "numpy.isnan", "numpy.argsort", "numpy.array", "numpy.arange", "torch.nn.DataParallel", "torch.tensor" ]
[((1517, 1531), 'numpy.array', 'np.array', (['posx'], {}), '(posx)\n', (1525, 1531), True, 'import numpy as np\n'), ((1540, 1554), 'numpy.array', 'np.array', (['posy'], {}), '(posy)\n', (1548, 1554), True, 'import numpy as np\n'), ((2694, 2725), 'numpy.concatenate', 'np.concatenate', (['feature'], {'axis': '(1)'}), '(f...
#!/usr/bin/env python import sys import os import os.path import warnings try: from setuptools import setup, Extension from setuptools.dist import Distribution requires = { "install_requires": ["numpy"], "setup_requires": ["numpy"] } except ImportError: from distutils.core import s...
[ "distutils.core.setup", "os.path.dirname", "distutils.extension.Extension", "numpy.get_include", "warnings.warn", "os.path.join", "os.listdir" ]
[((4336, 5774), 'distutils.core.setup', 'setup', ([], {'name': '"""TA-Lib"""', 'version': '"""0.4.25"""', 'description': '"""Python wrapper for TA-Lib"""', 'long_description': 'long_description', 'long_description_content_type': '"""text/markdown"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"...
# -*- coding: utf-8 -*- import itertools from collections import Counter from math import factorial import numpy as np import pytest from adaptive.learner.triangulation import Triangulation with_dimension = pytest.mark.parametrize('dim', [2, 3, 4]) def _make_triangulation(points): num_vertices = points.shape[...
[ "numpy.multiply", "numpy.average", "numpy.sum", "numpy.eye", "numpy.zeros", "adaptive.learner.triangulation.Triangulation", "pytest.raises", "numpy.random.random", "numpy.linalg.det", "math.factorial", "itertools.combinations", "pytest.mark.parametrize", "numpy.vstack" ]
[((211, 252), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dim"""', '[2, 3, 4]'], {}), "('dim', [2, 3, 4])\n", (234, 252), False, 'import pytest\n'), ((5314, 5371), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""provide_simplex"""', '[True, False]'], {}), "('provide_simplex', [True, False])\...
# -*- coding: utf-8 -*- import os import subprocess import time from os.path import join, exists import numpy as np import pytest OVERFIT_PATH = './tests/test_results/overfit_test/' SMALLDATA_PATH = './tests/test_results/smalldata_test/' # if you add a model here, you need the data in the format of: # test_data/dat...
[ "os.makedirs", "subprocess.check_output", "numpy.allclose", "os.path.exists", "time.strftime", "numpy.float32", "time.time", "pytest.mark.parametrize", "os.path.join" ]
[((1921, 2015), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""reader_name, epochs, use_small_data, dataset"""', 'testdata'], {'ids': 'ids'}), "('reader_name, epochs, use_small_data, dataset',\n testdata, ids=ids)\n", (1944, 2015), False, 'import pytest\n'), ((2810, 2888), 'os.path.join', 'join', (['(SM...
from __future__ import annotations import numpy as np from great_expectations.core import ExpectationSuite, ExpectationConfiguration from great_expectations.dataset import PandasDataset from pandas.io.json import json_normalize from collections import defaultdict from quality_inspection.abstract_schema_parser import S...
[ "numpy.sum", "great_expectations.dataset.PandasDataset", "quality_inspection.quality_metrics.QualityMetrics.without_schema", "pandas.io.json.json_normalize", "quality_inspection.quality_metrics.QualityMetrics.create", "quality_inspection.quality_metrics.QualityMetrics.for_inferred_schema", "great_expect...
[((2206, 2269), 'quality_inspection.quality_metrics.QualityMetrics.create', 'QualityMetrics.create', (['integrity_details', 'specification_details'], {}), '(integrity_details, specification_details)\n', (2227, 2269), False, 'from quality_inspection.quality_metrics import QualityMetrics\n'), ((2560, 2605), 'quality_insp...
# Implements a Neural Network for extracting features from single images for BBRL that can be used as the visual backbone # for training button behaviours, e.g. behaviour.py. This script includes train and test functions, # and can be used as standalone. Remember to first generate a dataset with "gencsv_fe.py" to crea...
[ "plot.tick_vt", "numpy.random.seed", "torch.optim.lr_scheduler.StepLR", "torch.cat", "torch.no_grad", "plot.plot", "torch.nn.MSELoss", "torch.utils.data.DataLoader", "plot.tick", "mariodataloader.DatasetMario", "torch.utils.data.random_split", "plot.flush_vt", "torch.nn.Tanh", "torch.manua...
[((3795, 3806), 'time.time', 'time.time', ([], {}), '()\n', (3804, 3806), False, 'import time\n'), ((3867, 3909), 'torch.optim.lr_scheduler.StepLR', 'StepLR', (['optimizer'], {'step_size': '(8)', 'gamma': '(0.96)'}), '(optimizer, step_size=8, gamma=0.96)\n', (3873, 3909), False, 'from torch.optim.lr_scheduler import St...
import numpy as np # import os import tensorflow as tf # from PIL import Image # import utility as Utility # import argparse class BiGAN(): def __init__(self, noise_unit_num, img_channel, seed, base_channel, keep_prob): self.NOISE_UNIT_NUM = noise_unit_num # 200 self.IMG_CHANNEL = img_channel # 1 ...
[ "tensorflow.nn.batch_normalization", "tensorflow.nn.relu", "numpy.random.seed", "tensorflow.nn.moments", "tensorflow.constant_initializer", "tensorflow.reshape", "tensorflow.layers.dropout", "tensorflow.variable_scope", "tensorflow.constant", "tensorflow.concat", "tensorflow.matmul", "tensorfl...
[((353, 383), 'numpy.random.seed', 'np.random.seed', ([], {'seed': 'self.SEED'}), '(seed=self.SEED)\n', (367, 383), True, 'import numpy as np\n'), ((2399, 2424), 'tensorflow.nn.moments', 'tf.nn.moments', (['input', '[0]'], {}), '(input, [0])\n', (2412, 2424), True, 'import tensorflow as tf\n'), ((2438, 2537), 'tensorfl...
# ------------------------------------------------------------------------------ # Copyright (c) <NAME> 3.3.2021. # ------------------------------------------------------------------------------ from indexes.single_indexes.hnsw_hnswlib import HnswHnswlib from indexes.testers.TimeStats import QueryTimeStats, BuildTime...
[ "random.randint", "numpy.argmax", "numpy.zeros", "time.time", "indexes.utils.dataset.BasicDataset", "numpy.random.randint", "numpy.array", "numpy.min", "indexes.testers.TimeStats.BuildTimeStats", "numpy.max", "numpy.linalg.norm" ]
[((1800, 1864), 'numpy.array', 'np.array', (['[[x[0] for x in vector] for vector in vectors_with_id]'], {}), '([[x[0] for x in vector] for vector in vectors_with_id])\n', (1808, 1864), True, 'import numpy as np\n'), ((1884, 1948), 'numpy.array', 'np.array', (['[[x[1] for x in vector] for vector in vectors_with_id]'], {...
'Re-estimate a unigram LM.' import argparse import logging import os import pickle import sys import numpy as np import torch import beer log_format = "%(asctime)s %(levelname)s: %(message)s" logging.basicConfig(level=logging.INFO, format=log_format) def main(): parser = argparse.ArgumentParser() parser...
[ "numpy.load", "beer.evidence_lower_bound", "pickle.dump", "beer.BayesianModelCoordinateAscentOptimizer", "argparse.ArgumentParser", "logging.basicConfig", "pickle.load", "torch.from_numpy" ]
[((198, 256), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': 'log_format'}), '(level=logging.INFO, format=log_format)\n', (217, 256), False, 'import logging\n'), ((284, 309), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (307, 309), False, 'import argpar...
# Logistic Regression Model training # %matplotlib inline import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (12,8) import numpy as np import tensorflow as tf import keras import pandas as pd from keras_tqdm import TQDMNotebookCallback from keras.models import Sequential from keras.layers import Dense,...
[ "matplotlib.pyplot.plot", "keras.models.Sequential", "matplotlib.pyplot.legend", "numpy.asarray", "keras.optimizers.Adam", "keras.layers.Flatten", "numpy.zeros", "numpy.frombuffer", "keras_tqdm.TQDMNotebookCallback", "keras.layers.Dense", "numpy.array", "tensorflow.train.SequenceExample.FromSt...
[((3328, 3340), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (3338, 3340), False, 'from keras.models import Sequential\n'), ((3490, 3518), 'keras.optimizers.Adam', 'optimizers.Adam', ([], {'lr': 'train_lr'}), '(lr=train_lr)\n', (3505, 3518), False, 'from keras import optimizers\n'), ((5018, 5072), 'matplo...
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ @Author : <NAME> @Contact : <EMAIL> @File : evaluate.py.py @Time : 8/30/19 8:59 PM @Desc : Evaluation Scripts @License : This source code is licensed under the license found in the LICENSE file in the root directory of this source ...
[ "datasets.SCHPDataset", "numpy.save", "argparse.ArgumentParser", "torch.utils.data.DataLoader", "os.makedirs", "numpy.argmax", "torch.load", "torchvision.transforms.Normalize", "os.walk", "numpy.asarray", "model.network", "torch.nn.Upsample", "torch.nn.DataParallel", "torch.no_grad", "os...
[((1652, 1724), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Self Correction for Human Parsing"""'}), "(description='Self Correction for Human Parsing')\n", (1675, 1724), False, 'import argparse\n'), ((3689, 3711), 'torch.nn.DataParallel', 'nn.DataParallel', (['model'], {}), '(model)\n...
# Copyright 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import print...
[ "bpy.ops.wm.save_as_mainfile", "os.remove", "utils.delete_object", "argparse.ArgumentParser", "bpy.ops.material.new", "utils.add_material", "collections.defaultdict", "bpy.ops.mesh.primitive_plane_add", "bpy.context.scene.update", "os.path.join", "utils.load_materials", "random.randint", "ut...
[((1755, 1780), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1778, 1780), False, 'import math, sys, random, argparse, json, os, tempfile\n'), ((10565, 10614), 'os.path.join', 'os.path.join', (['args.output_image_dir', 'img_template'], {}), '(args.output_image_dir, img_template)\n', (10577, 1...
import numpy as np __all__ = ["sparse_to_dense"] def sparse_to_dense(sparse_bm): """Converts a sparse boundary matrix to a dense boundary matrix. This is used for visualization and debugging as dense boundary matrices can be easier to read to small matrices. Dense boundary matrices are the default filtration...
[ "numpy.zeros" ]
[((589, 605), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (597, 605), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019-05-22 17:45 # @Author : erwin import datetime import time import pandas as pd from component.demo_opentsdb.opentsdb_conn import OpenTSDBClient from machine_learning.similarity.dtw.hierarchical_helper import HierarchicalHelper from common.pickle_helper imp...
[ "time.strptime", "numpy.matrix", "pandas.DataFrame", "sklearn.preprocessing.StandardScaler", "component.demo_opentsdb.opentsdb_conn.OpenTSDBClient", "machine_learning.similarity.dtw.hierarchical_helper.HierarchicalHelper", "datetime.datetime.now", "dtaidistance.clustering.LinkageTree", "datetime.tim...
[((337, 379), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', '(1000)'], {}), "('display.max_columns', 1000)\n", (350, 379), True, 'import pandas as pd\n'), ((380, 416), 'pandas.set_option', 'pd.set_option', (['"""display.width"""', '(1000)'], {}), "('display.width', 1000)\n", (393, 416), True, 'im...
""" desispec.pixflat ======================== Routines for pixel flat fielding """ import numpy as np import scipy.ndimage,scipy.signal def convolve2d(image,k,weight=None) : """ Return a 2D convolution of image with kernel k, optionally with a weight image Args: image : 2D np.array image k ...
[ "numpy.median", "numpy.zeros" ]
[((1200, 1260), 'numpy.zeros', 'np.zeros', (['(image.shape[0] + 2 * m0, image.shape[1] + 2 * m1)'], {}), '((image.shape[0] + 2 * m0, image.shape[1] + 2 * m1))\n', (1208, 1260), True, 'import numpy as np\n'), ((1598, 1621), 'numpy.median', 'np.median', (['tmp[:m0, m1]'], {}), '(tmp[:m0, m1])\n', (1607, 1621), True, 'imp...
from .dfsummary_helpers import return_df_summary, return_heatmap_data from matplotlib import cm, pyplot as plt import pandas as pd import numpy as np import seaborn as sns class DfSummary(object): """The DfSummary object is a dataframe object with methods to provide descriptive statistics and formatted visual...
[ "pandas.DataFrame", "numpy.zeros_like", "matplotlib.cm.get_cmap", "matplotlib.pyplot.close", "numpy.triu_indices_from", "matplotlib.pyplot.gcf", "matplotlib.pyplot.subplots" ]
[((493, 513), 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""tab10"""'], {}), "('tab10')\n", (504, 513), False, 'from matplotlib import cm, pyplot as plt\n'), ((2962, 3040), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': 'self.nrows', 'ncols': 'self.ncols', 'figsize': '(15, self.nrows * 4)'}), '(nrows=sel...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : hotrgScale.py # Author : Xinliang(Bruce) Lyu <<EMAIL>> # Date : 11.03.2021 # Last Modified Date: 11.03.2021 # Last Modified By : Xinliang(Bruce) Lyu <<EMAIL>> # -*- coding: utf-8 -*- """ Created on Tue Aug 18 10:56:25 2020 Cal...
[ "pickle.dump", "argparse.ArgumentParser", "HOTRG.diffGiltHOTRG", "HOTRG.scDimWen", "time.time", "pickle.load", "numpy.printoptions" ]
[((547, 689), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (["('Test calculation of scaling dimensions of 2d-Ising using differentiation' +\n 'techniques applied on HOTRG.')"], {}), "(\n 'Test calculation of scaling dimensions of 2d-Ising using differentiation'\n + 'techniques applied on HOTRG.')\n",...
from sklearn.model_selection import train_test_split import numpy as np import os import random import shutil train_ratio = 0.75 val_ratio = 1 - train_ratio num = np.random.randint(100) # 生成一个0~99的随机数 image_path = '/gdata1/zhuqi/Darkface_coco_MF/val' lable_path = '/gdata1/zhuqi/DarkFace_coco_0.666/val_lab...
[ "os.mkdir", "random.shuffle", "numpy.random.randint", "shutil.move", "shutil.copytree", "os.listdir" ]
[((174, 196), 'numpy.random.randint', 'np.random.randint', (['(100)'], {}), '(100)\n', (191, 196), True, 'import numpy as np\n'), ((573, 591), 'os.mkdir', 'os.mkdir', (['goal_dir'], {}), '(goal_dir)\n', (581, 591), False, 'import os\n'), ((593, 611), 'os.mkdir', 'os.mkdir', (['goal_val'], {}), '(goal_val)\n', (601, 611...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Oct 9 23:08:52 2021 @author: talkhiami """ import numpy as np from code.util import LIST_ENGAGEMENT_KEYWORDS from code.feature_extraction.feature_extractor import FeatureExtractor import ast # class for extracting the hashtag count as a feature class...
[ "ast.literal_eval", "numpy.array" ]
[((1410, 1444), 'numpy.array', 'np.array', (['has_engage_keywords_list'], {}), '(has_engage_keywords_list)\n', (1418, 1444), True, 'import numpy as np\n'), ((1081, 1104), 'ast.literal_eval', 'ast.literal_eval', (['tweet'], {}), '(tweet)\n', (1097, 1104), False, 'import ast\n')]
#!/usr/bin/env python # # Written by <NAME> and <NAME>, Jet Propulsion Laboratory 2018 # # Load libraries import os import sys import h5py import pyproj import pandas as pd import numpy as np from gdalconst import * from osgeo import gdal, osr from scipy.ndimage import map_coordinates # # FYI! # Somet...
[ "numpy.abs", "numpy.invert", "numpy.empty", "os.walk", "numpy.ones", "numpy.isnan", "numpy.arange", "os.path.join", "numpy.unique", "numpy.meshgrid", "numpy.isfinite", "joblib.Parallel", "h5py.File", "numpy.size", "os.stat", "os.path.basename", "numpy.flipud", "numpy.mod", "osgeo...
[((5110, 5140), 'pyproj.Proj', 'pyproj.Proj', (['"""+init=EPSG:4326"""'], {}), "('+init=EPSG:4326')\n", (5121, 5140), False, 'import pyproj\n'), ((5245, 5268), 'pyproj.Proj', 'pyproj.Proj', (['projection'], {}), '(projection)\n', (5256, 5268), False, 'import pyproj\n'), ((646, 675), 'osgeo.gdal.Open', 'gdal.Open', (['i...
#!/usr/bin/python import numpy as np #------------------------------------------------------------------------------- def compute_subsets(elements, size): result = [] stack = [0] backtrack = False while len(stack) > 0: # backtracking: go back to the last element that can still be used ...
[ "numpy.array_equal" ]
[((3938, 4002), 'numpy.array_equal', 'np.array_equal', (['unique_values[output_index]', 'values[input_index]'], {}), '(unique_values[output_index], values[input_index])\n', (3952, 4002), True, 'import numpy as np\n')]
import os os.environ['KMP_DUPLICATE_LIB_OK']='True' os.environ["CUDA_VISIBLE_DEVICES"] = "0" import pygame as pg from pygame.compat import geterror import math import cv2 import paddlehub as hub import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg img_dir = "tmpimg" module = hub.Module(...
[ "pygame.draw.line", "pygame.event.get", "numpy.rot90", "cv2.compareHist", "cv2.imshow", "os.path.join", "cv2.cvtColor", "pygame.display.set_mode", "pygame.transform.scale", "math.cos", "pygame.display.set_caption", "cv2.destroyAllWindows", "paddlehub.Module", "cv2.resize", "pygame.transf...
[((309, 354), 'paddlehub.Module', 'hub.Module', ([], {'name': '"""face_landmark_localization"""'}), "(name='face_landmark_localization')\n", (319, 354), True, 'import paddlehub as hub\n'), ((408, 435), 'os.path.join', 'os.path.join', (['img_dir', 'name'], {}), '(img_dir, name)\n', (420, 435), False, 'import os\n'), ((7...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from ph_plotter.points_sf_plotter import PointsSFPlotter __author__ = "<NAME>" class PointsSFE1Plotter(PointsSFPlotter): def plot_q(self, ...
[ "numpy.zeros_like", "numpy.sum", "numpy.where" ]
[((947, 978), 'numpy.sum', 'np.sum', (['partial_sf'], {'axis': '(1, 3)'}), '(partial_sf, axis=(1, 3))\n', (953, 978), True, 'import numpy as np\n'), ((1829, 1847), 'numpy.zeros_like', 'np.zeros_like', (['tmp'], {}), '(tmp)\n', (1842, 1847), True, 'import numpy as np\n'), ((2937, 2955), 'numpy.zeros_like', 'np.zeros_lik...
import numpy as np from archmm.maxent import MEMM if __name__ == '__main__': X1 = np.random.rand(150, 10) X1[:50, 2] += np.arange(0, 50) * 0.2 + 78 X1[50:100, 7] -= np.arange(50, 0, -1) * 0.2 + 98 X1[100:, 3] += np.arange(0, 50) * 0.2 + 2 X_s = [X1] Y1 = np.zeros(150, dtype=np.int) Y1[:5...
[ "numpy.random.rand", "numpy.zeros", "numpy.arange", "archmm.maxent.MEMM" ]
[((90, 113), 'numpy.random.rand', 'np.random.rand', (['(150)', '(10)'], {}), '(150, 10)\n', (104, 113), True, 'import numpy as np\n'), ((283, 310), 'numpy.zeros', 'np.zeros', (['(150)'], {'dtype': 'np.int'}), '(150, dtype=np.int)\n', (291, 310), True, 'import numpy as np\n'), ((373, 380), 'archmm.maxent.MEMM', 'MEMM', ...
# main.py import time import RPi.GPIO as GPIO import numpy as np from adafruit_motorkit import MotorKit import cv2 from car import car from camera_specific import camera, rgbtohsv, rgbtohsl, test_color, find_green def main(index_designated=2): car_ = car() car_.straight() time.sleep(1) car_.forward() ...
[ "numpy.uint8", "cv2.filter2D", "cv2.cvtColor", "cv2.imwrite", "numpy.float32", "cv2.waitKey", "numpy.zeros", "numpy.ones", "time.sleep", "car.car", "camera_specific.camera", "cv2.kmeans", "camera_specific.rgbtohsl", "cv2.destroyAllWindows", "cv2.resize" ]
[((257, 262), 'car.car', 'car', ([], {}), '()\n', (260, 262), False, 'from car import car\n'), ((287, 300), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (297, 300), False, 'import time\n'), ((324, 337), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (334, 337), False, 'import time\n'), ((352, 360), 'camera_...
from collections.abc import Mapping from pathlib import Path import numpy as np from ..utils import iteritemsdeep, getdeep def parse_gen_param_name(name): """ Convert ``'J'`` to ``('J', None)`` and ``'J_EI'`` to ``('J', (0, 1))``. >>> parse_gen_param_name('J') ('J', None) >>> parse_gen_param_na...
[ "numpy.asarray", "pathlib.Path", "numpy.array" ]
[((1038, 1055), 'pathlib.Path', 'Path', (['script_file'], {}), '(script_file)\n', (1042, 1055), False, 'from pathlib import Path\n'), ((3168, 3183), 'numpy.asarray', 'np.asarray', (['val'], {}), '(val)\n', (3178, 3183), True, 'import numpy as np\n'), ((5697, 5753), 'numpy.array', 'np.array', (['[0, 0.0625, 0.125, 0.187...
#!/usr/bin/python """ Octree implementation """ # From: https://code.google.com/p/pynastran/source/browse/trunk/pyNastran/general/octree.py?r=949 # http://code.activestate.com/recipes/498121-python-octree-implementation/ # UPDATED: # Is now more like a true octree (ie: partitions space containing objects) # Imp...
[ "numpy.any", "random.randrange", "time.time" ]
[((13627, 13638), 'time.time', 'time.time', ([], {}), '()\n', (13636, 13638), False, 'import time\n'), ((14630, 14641), 'time.time', 'time.time', ([], {}), '()\n', (14639, 14641), False, 'import time\n'), ((4238, 4272), 'numpy.any', 'np.any', (['(position < self.root.lower)'], {}), '(position < self.root.lower)\n', (42...
import tensorflow as tf import subprocess import os import cv2 import keras.backend as K import tarfile import glob import numpy as np from tensorflow.python.framework import graph_util from tensorflow.python.framework import graph_io import urllib.request from keras.utils import get_file from keras.models import load_...
[ "keras.models.load_model", "keras.utils.get_file", "subprocess.getstatusoutput", "axelerate.networks.common_utils.feature.create_feature_extractor", "glob.glob", "cv2.cvtColor", "os.path.dirname", "os.path.exists", "tensorflow.lite.TFLiteConverter.from_keras_model_file", "tarfile.open", "cv2.res...
[((360, 385), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (375, 385), False, 'import os\n'), ((441, 466), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (456, 466), False, 'import os\n'), ((769, 795), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(...
import os import sys import argparse from multiprocessing import Pool import yaml dname = os.path.dirname(__file__) module_dir = os.path.abspath("{}/deeplio".format(dname)) content_dir = os.path.abspath("{}/..".format(dname)) sys.path.append(dname) sys.path.append(module_dir) sys.path.append(content_dir) import tqdm...
[ "sys.path.append", "numpy.set_printoptions", "numpy.sum", "argparse.ArgumentParser", "matplotlib.pyplot.ioff", "tqdm.trange", "deeplio.datasets.KittiRawData", "tqdm.tqdm.get_lock", "os.path.dirname", "numpy.square", "numpy.zeros", "numpy.array", "yaml.safe_load", "matplotlib.pyplot.subplot...
[((92, 117), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (107, 117), False, 'import os\n'), ((228, 250), 'sys.path.append', 'sys.path.append', (['dname'], {}), '(dname)\n', (243, 250), False, 'import sys\n'), ((251, 278), 'sys.path.append', 'sys.path.append', (['module_dir'], {}), '(module...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020-07-19 18:37:17 # @Author : helingjie-maskmind (<EMAIL>) # @Link : ${link} # @Version : $Id$ import os import numpy as np a=np.arange(5) print(a) # clip 设置阈值 print(a.clip(1,2)) # compress 根据条件进行筛选 print(a.compress(a>2))
[ "numpy.arange" ]
[((192, 204), 'numpy.arange', 'np.arange', (['(5)'], {}), '(5)\n', (201, 204), True, 'import numpy as np\n')]
import typing as tp from itertools import zip_longest from itertools import chain import numpy as np from static_frame.core.util import NULL_SLICE from static_frame.core.util import _UNIT_SLICE from static_frame.core.util import INT_TYPES from static_frame.core.util import KEY_ITERABLE_TYPES from static_frame.cor...
[ "static_frame.core.util._dtype_to_na", "numpy.empty", "static_frame.core.util.immutable_filter", "static_frame.core.util.column_2d_filter", "static_frame.core.util.mloc", "static_frame.core.util.full_for_fill", "static_frame.core.util._array_to_groups_and_locations", "numpy.full", "static_frame.core...
[((6070, 6097), 'static_frame.core.util.GetItem', 'GetItem', (['self._extract_iloc'], {}), '(self._extract_iloc)\n', (6077, 6097), False, 'from static_frame.core.util import GetItem\n'), ((7159, 7197), 'numpy.array', 'np.array', (['self._dtypes'], {'dtype': 'np.dtype'}), '(self._dtypes, dtype=np.dtype)\n', (7167, 7197)...
# -*- coding: utf-8 -*- # # File : examples/timeserie_prediction/switch_attractor_esn # Description : NARMA 30 prediction with ESN. # Date : 26th of January, 2018 # # This file is part of EchoTorch. EchoTorch is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # Licen...
[ "echotorch.datasets.NARMADataset.NARMADataset", "numpy.random.seed", "torch.manual_seed", "torch.autograd.Variable", "torch.cuda.is_available", "mdp.numx.random.seed", "torch.utils.data.dataloader.DataLoader", "echotorch.nn.StackedESN" ]
[((1440, 1463), 'mdp.numx.random.seed', 'mdp.numx.random.seed', (['(1)'], {}), '(1)\n', (1460, 1463), False, 'import mdp\n'), ((1464, 1481), 'numpy.random.seed', 'np.random.seed', (['(2)'], {}), '(2)\n', (1478, 1481), True, 'import numpy as np\n'), ((1482, 1502), 'torch.manual_seed', 'torch.manual_seed', (['(1)'], {}),...
import os import torch import numpy as np from perceiver_io.language_perceiver import LanguagePerceiver from utils.bytes_tokenizer import BytesTokenizer def pad(max_sequence_length: int, inputs, input_mask, pad_token): input_len = inputs.shape[1] assert input_len <= max_sequence_length pad_len = max_seq...
[ "numpy.pad", "perceiver_io.language_perceiver.LanguagePerceiver", "numpy.ones_like", "torch.inference_mode", "torch.load", "os.path.isfile", "utils.bytes_tokenizer.BytesTokenizer", "torch.cuda.is_available", "torch.from_numpy" ]
[((365, 440), 'numpy.pad', 'np.pad', (['inputs'], {'pad_width': '((0, 0), (0, pad_len))', 'constant_values': 'pad_token'}), '(inputs, pad_width=((0, 0), (0, pad_len)), constant_values=pad_token)\n', (371, 440), True, 'import numpy as np\n'), ((484, 555), 'numpy.pad', 'np.pad', (['input_mask'], {'pad_width': '((0, 0), (...
import numpy as np from old_http.agent import Agent import time import matplotlib.pyplot as plt from scipy.stats import sem, t confidence = 0.95 total = 20 sizes = [ (100, 75), (200, 150), (400, 300), (600, 450), (800, 600), (1000, 750), (1200, 900) ] if __name__ == "__main__": main...
[ "old_http.agent.Agent", "matplotlib.pyplot.legend", "time.time", "matplotlib.pyplot.figure", "numpy.mean", "scipy.stats.sem", "matplotlib.pyplot.ylabel", "scipy.stats.t.ppf", "matplotlib.pyplot.errorbar" ]
[((3669, 3682), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (3679, 3682), True, 'import matplotlib.pyplot as plt\n'), ((3739, 3788), 'matplotlib.pyplot.errorbar', 'plt.errorbar', ([], {'y': 'data_list', 'x': 'y_axis', 'yerr': 'ci_list'}), '(y=data_list, x=y_axis, yerr=ci_list)\n', (3751, 3788), Tr...
""" MNIST Dataset Programmer: <NAME> Date: 2021.1 """ import os import gzip import copy import numpy as np from dl_toolbox_cwm.dataset.classification.base_dataset_cls import BaseDataset_CLS class MNIST(BaseDataset_CLS): CLASSES = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ] train_i...
[ "copy.deepcopy", "numpy.array", "os.path.join" ]
[((1435, 1479), 'copy.deepcopy', 'copy.deepcopy', (["self.data_infos['image'][idx]"], {}), "(self.data_infos['image'][idx])\n", (1448, 1479), False, 'import copy\n'), ((1506, 1531), 'numpy.array', 'np.array', (['[img, img, img]'], {}), '([img, img, img])\n', (1514, 1531), True, 'import numpy as np\n'), ((1699, 1743), '...
import json import cv2 import random import numpy as np import tensorflow as tf from simple_tensor.tensor_operations import * from simple_tensor.networks.inception_utils import * from simple_tensor.networks.inception_v4 import * from simple_tensor.networks.resnet_v2 import * import simple_tensor.networks.densenet as de...
[ "tensorflow.nn.softmax", "simple_tensor.networks.densenet.densenet121", "numpy.argmax", "tensorflow.get_collection", "simple_tensor.networks.densenet.densenet_arg_scope", "random.shuffle", "sklearn.metrics.accuracy_score", "cv2.cvtColor", "tensorflow.variable_scope", "tensorflow.placeholder", "t...
[((1130, 1231), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, self.input_height, self.input_width, self.input_channel)'}), '(tf.float32, shape=(None, self.input_height, self.input_width,\n self.input_channel))\n', (1144, 1231), True, 'import tensorflow as tf\n'), ((6813, 6842), 'simp...
import numpy as np class HinfFilter: def __init__(self, x, P): """ Args: x (numpy.array): state to estimate: [x_, y_, theta]^T P (numpy.array): estimation error covariance = error covariance """ self.x = x # [3,] self.P = P # [3, 3] def update...
[ "numpy.sin", "numpy.linalg.inv", "numpy.array", "numpy.linalg.norm", "numpy.cos", "numpy.eye" ]
[((368, 377), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (374, 377), True, 'import numpy as np\n'), ((437, 446), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (443, 446), True, 'import numpy as np\n'), ((492, 553), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 0.0]]'], {}), '([[1.0, 0...