code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
""" Filename: matching.py Author: <NAME> Matching algorithms. """ import numpy as np from numba import jit @jit def deferred_acceptance(prop_prefs, resp_prefs, caps=None): """ Compute a stable matching by the deferred acceptance (Gale-Shapley) algorithm. Support both one-to-one (marriage) and many-to-o...
[ "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.cumsum", "numba.jit", "numpy.arange" ]
[((5002, 5020), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (5005, 5020), False, 'from numba import jit\n'), ((2024, 2046), 'numpy.asarray', 'np.asarray', (['prop_prefs'], {}), '(prop_prefs)\n', (2034, 2046), True, 'import numpy as np\n'), ((2064, 2086), 'numpy.asarray', 'np.asarray', (['resp...
import os import numpy as np from matplotlib import pyplot as plt import sys sys.path.append("../utilities") import constants import utils import data def plot_histograms(run_dir, metadata_sig, metadata_bg): #trim to even size if metadata_bg.shape[0] > metadata_sig.shape[0]: metadata_bg = metadata_bg[:metada...
[ "sys.path.append", "matplotlib.pyplot.title", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "data.get_pixels_metadata", "matplotlib.pyplot.legend", "numpy.histogram", "utils.make_run_dir", "numpy.array", "matplotlib.pyplot.savefig" ]
[((78, 109), 'sys.path.append', 'sys.path.append', (['"""../utilities"""'], {}), "('../utilities')\n", (93, 109), False, 'import sys\n'), ((1026, 1095), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Plot histograms on given data."""'}), "(description='Plot histograms on given data.')\n"...
import numpy as np import pandas as pd from sklearn.cluster import KMeans import matplotlib.pyplot as plt from matplotlib.pyplot import plot, show, draw, figure, cm import seaborn as sns from sklearn.manifold import TSNE import umap from sklearn.datasets import load_iris from mpl_toolkits.mplot3d import Axes3D sns.set_...
[ "matplotlib.pyplot.title", "seaborn.set_style", "numpy.load", "pandas.DataFrame", "matplotlib.pyplot.show", "mpl_toolkits.mplot3d.Axes3D", "numpy.save", "seaborn.scatterplot", "pandas.read_csv", "sklearn.manifold.TSNE", "umap.UMAP", "numpy.shape", "matplotlib.pyplot.figure", "matplotlib.py...
[((312, 360), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""', "{'axes.grid': False}"], {}), "('whitegrid', {'axes.grid': False})\n", (325, 360), True, 'import seaborn as sns\n'), ((563, 595), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Number of clusters"""'], {}), "('Number of clusters')\n", (573, 595),...
import chainer import chainer.functions as F import chainer.links as L import chainer.serializers from chainer.datasets import tuple_dataset from chainer import Chain, Variable, optimizers from chainer import training from chainer.training import extensions from PIL import Image import argparse import numpy as np impor...
[ "chainer.Variable", "cv2.putText", "argparse.ArgumentParser", "chainer.serializers.load_npz", "cv2.cvtColor", "alexLike.AlexLike", "numpy.asarray", "numpy.float32", "PIL.Image.open", "numpy.swapaxes", "glob.glob", "numpy.round", "cv2.resize" ]
[((442, 510), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""test human position detection"""'}), "(description='test human position detection')\n", (465, 510), False, 'import argparse\n'), ((1806, 1853), 'chainer.serializers.load_npz', 'chainer.serializers.load_npz', (['args.model', 'mo...
import os import os.path from PIL import Image import numpy as np from numpy import asarray import pandas as pd import tensorflow as tf from tensorflow import keras import tensorflow.keras.layers as kl from tensorflow.keras.models import Model import matplotlib.pyplot as plt #%% path_ = 'I:\\Empresas\\2stars\\IA\\Diag...
[ "matplotlib.pyplot.title", "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "tensorflow.keras.layers.Dense", "matplotlib.pyplot.legend", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.models.Model", "matplotlib.pyplot.figure", "tensorflow.keras.applications.densen...
[((396, 443), 'numpy.load', 'np.load', (["(path_ + 'numpy_files/train_labels.npy')"], {}), "(path_ + 'numpy_files/train_labels.npy')\n", (403, 443), True, 'import numpy as np\n'), ((485, 532), 'numpy.load', 'np.load', (["(path_ + 'numpy_files/train_images.npy')"], {}), "(path_ + 'numpy_files/train_images.npy')\n", (492...
# Copyright 2020 University of Groningen # # 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 i...
[ "polyply.src.topology.Topology.from_gmx_topfile", "polyply.src.linalg_functions.norm_sphere", "networkx.set_node_attributes", "polyply.src.random_walk.pbc_complete", "polyply.src.random_walk.is_restricted", "numpy.array", "numpy.linalg.norm", "polyply.src.random_walk.not_exceeds_max_dimensions", "po...
[((3920, 3945), 'numpy.array', 'np.array', (['[1.0, 1.0, 1.0]'], {}), '([1.0, 1.0, 1.0])\n', (3928, 3945), True, 'import numpy as np\n'), ((3982, 4026), 'polyply.src.linalg_functions.norm_sphere', 'polyply.src.linalg_functions.norm_sphere', (['(50)'], {}), '(50)\n', (4022, 4026), False, 'import polyply\n'), ((4291, 434...
################################################################ # module to convert data files from Huygens mission into # z-dependent functions ################################################################ import numpy as np from scipy.interpolate import interp1d import pandas as pd import datetime def getz2xfunc...
[ "pandas.read_csv", "numpy.datetime64", "numpy.genfromtxt", "numpy.timedelta64", "numpy.array", "scipy.interpolate.interp1d" ]
[((1483, 1518), 'numpy.genfromtxt', 'np.genfromtxt', (['ppi_f'], {'delimiter': '""";"""'}), "(ppi_f, delimiter=';')\n", (1496, 1518), True, 'import numpy as np\n'), ((1533, 1568), 'numpy.genfromtxt', 'np.genfromtxt', (['tem_f'], {'delimiter': '""";"""'}), "(tem_f, delimiter=';')\n", (1546, 1568), True, 'import numpy as...
#!/usr/bin/python3 """ A Psi4 input script to compute CIS energy from a SCF reference Algorithms were developed for ilustrative purposes. """ __authors__ = "<NAME>" __copyright__ = "(c) 2019" __license__ = "BSD-3-Clause" __date__ = "2019-07-23" import time import numpy import psi4 from abc import ABC, abstr...
[ "numpy.zeros", "numpy.einsum", "psi4.energy", "time.time", "abc.ABC.__init__", "numpy.linalg.eigh", "psi4.core.set_global_option" ]
[((695, 713), 'abc.ABC.__init__', 'ABC.__init__', (['self'], {}), '(self)\n', (707, 713), False, 'from abc import ABC, abstractmethod\n'), ((2670, 2723), 'psi4.energy', 'psi4.energy', (['"""HF"""'], {'molecule': 'self.mol', 'return_wfn': '(True)'}), "('HF', molecule=self.mol, return_wfn=True)\n", (2681, 2723), False, '...
#!/usr/bin/env python import rospy from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBridge from light_classification.tl_classifier import TLCla...
[ "yaml.load", "rospy.logerr", "rospy.Subscriber", "light_classification.tl_classifier.TLClassifier", "tf.transformations.quaternion_matrix", "cv2.imwrite", "rospy.init_node", "cv2.circle", "std_msgs.msg.Int32", "numpy.linalg.inv", "tf.TransformListener", "cv_bridge.CvBridge", "numpy.deg2rad",...
[((938, 968), 'rospy.init_node', 'rospy.init_node', (['"""tl_detector"""'], {}), "('tl_detector')\n", (953, 968), False, 'import rospy\n'), ((1099, 1159), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/current_pose"""', 'PoseStamped', 'self.pose_cb'], {}), "('/current_pose', PoseStamped, self.pose_cb)\n", (1115, 1159),...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `crossdispersion` module.""" import unittest import numpy as np from hotsoss import crossdispersion as xd class TestCrossDiespersion(unittest.TestCase): """Test crossdispersion.py functions""" def setUp(self): """Test instance setup""" ...
[ "hotsoss.crossdispersion.batman", "hotsoss.crossdispersion.batmen", "hotsoss.crossdispersion.gaussian", "hotsoss.crossdispersion.bimodal", "numpy.linspace", "hotsoss.crossdispersion.trimodal" ]
[((389, 416), 'numpy.linspace', 'np.linspace', (['(0)', '(100)', 'self.n'], {}), '(0, 100, self.n)\n', (400, 416), True, 'import numpy as np\n'), ((644, 729), 'hotsoss.crossdispersion.batman', 'xd.batman', (['self.x', 'self.mu0', 'self.sigma0', 'self.A0', 'self.sigma1', 'self.A1', 'self.sep'], {}), '(self.x, self.mu0, ...
# -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, <NAME>, based on code from <NAME> # -------------------------------------------------------- from __future__ import absolute_import from __future__ import ...
[ "cv2.imwrite", "cv2.imread", "numpy.array", "os.path.join", "cv2.resize" ]
[((2211, 2301), 'os.path.join', 'os.path.join', (['"""/media/rgh/rgh-data/PycharmProjects/cvpr2018/deeplab"""', '"""detections.pkl"""'], {}), "('/media/rgh/rgh-data/PycharmProjects/cvpr2018/deeplab',\n 'detections.pkl')\n", (2223, 2301), False, 'import time, os, sys\n'), ((1174, 1233), 'cv2.imread', 'cv2.imread', ([...
""" Module for Magellan/MAGE specific codes """ import numpy as np from pypeit import msgs from pypeit import telescopes from pypeit.core import framematch from pypeit.core import parse from pypeit.par import pypeitpar from pypeit.spectrographs import spectrograph from pypeit.core import pixels from pypeit import debu...
[ "numpy.full", "pypeit.par.pypeitpar.ScienceImagePar", "pypeit.core.pixels.slit_pixels", "pypeit.telescopes.MagellanTelescopePar", "pypeit.par.pypeitpar.DetectorPar", "pypeit.core.parse.binning2string", "pypeit.core.framematch.check_frame_exptime", "pypeit.core.parse.parse_binning", "numpy.ones", "...
[((624, 657), 'pypeit.telescopes.MagellanTelescopePar', 'telescopes.MagellanTelescopePar', ([], {}), '()\n', (655, 657), False, 'from pypeit import telescopes\n'), ((2457, 2478), 'pypeit.par.pypeitpar.PypeItPar', 'pypeitpar.PypeItPar', ([], {}), '()\n', (2476, 2478), False, 'from pypeit.par import pypeitpar\n'), ((3967...
import os import os.path as osp from glob import glob import numpy as np import pickle METType = { 'MET_CHAR': np.char, 'MET_SHORT': np.int16, 'MET_LONG': np.int32, 'MET_INT': np.int32, 'MET_UCHAR': np.uint8, 'MET_USHORT': np.uint16, 'MET_ULONG': np.uint32, 'MET_UINT': np.uint32, 'M...
[ "pickle.dump", "numpy.frombuffer", "os.path.dirname", "os.path.exists", "os.system", "numpy.min", "numpy.where", "numpy.max", "pickle.load", "numpy.squeeze", "os.path.join", "os.listdir" ]
[((772, 790), 'os.listdir', 'os.listdir', (['SrcDir'], {}), '(SrcDir)\n', (782, 790), False, 'import os\n'), ((3432, 3449), 'numpy.squeeze', 'np.squeeze', (['image'], {}), '(image)\n', (3442, 3449), True, 'import numpy as np\n'), ((3758, 3783), 'numpy.where', 'np.where', (['(mask > bk_value)'], {}), '(mask > bk_value)\...
import numpy as np import matplotlib import matplotlib.pyplot as plt plt.rcParams['axes.labelsize'] = 14 plt.rcParams['xtick.labelsize'] = 12 plt.rcParams['ytick.labelsize'] = 12 plt.rcParams['font.family'] = 'sans-serif' plt.rcParams['font.sans-serif'] = 'Arial' # Where to save the figures PROJECT_ROOT_DIR = "." PROJ...
[ "os.mkdir", "numpy.random.seed", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.clf", "sklearn.metrics.mean_absolute_error", "pickle.load", "numpy.mean", "matplotlib.pyplot.tight_layout", "pandas.DataFrame", "torch.utils.data.DataLoader", "torchvision.transforms.ToPILImage", "matpl...
[((628, 690), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (651, 690), False, 'import warnings\n'), ((691, 746), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'UserWarnin...
import math import numpy as np def inverse_quaternion(quaternion): result = np.copy(quaternion) result[1:4] = -result[1:4] return result def quaternion_product(q1, q2): result = np.zeros(4) result[0] = q1[0]*q2[0]-q1[1]*q2[1]-q1[2]*q2[2]-q1[3]*q2[3] result[1] = q1[0]*q2[1]+q2[0]*q1[1]+q1[2]*q2[3]-q1[3]*q2[2] r...
[ "math.asin", "numpy.copy", "math.atan2", "numpy.zeros", "math.sin", "numpy.array", "math.cos" ]
[((78, 97), 'numpy.copy', 'np.copy', (['quaternion'], {}), '(quaternion)\n', (85, 97), True, 'import numpy as np\n'), ((184, 195), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (192, 195), True, 'import numpy as np\n'), ((508, 527), 'numpy.copy', 'np.copy', (['quaternion'], {}), '(quaternion)\n', (515, 527), True,...
from numpy.testing._private.utils import assert_array_almost_equal from quara.protocol.qtomography.standard.standard_qpt import StandardQpt from quara.protocol.qtomography.standard.standard_povmt import StandardPovmt from quara.interface.qiskit.api import ( estimate_standard_povmt_from_qiskit, estimate_sta...
[ "quara.protocol.qtomography.standard.standard_qst.StandardQst", "quara.protocol.qtomography.standard.standard_qpt.StandardQpt", "pytest.mark.parametrize", "numpy.testing.assert_array_almost_equal", "quara.interface.qiskit.conversion.convert_povm_quara_to_qiskit", "quara.interface.qiskit.api.estimate_stand...
[((1261, 1361), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('mode', 'num', 'true_state_name', 'decimal')", "[('qubit', 1, 'z0', 4)]"], {}), "(('mode', 'num', 'true_state_name', 'decimal'), [(\n 'qubit', 1, 'z0', 4)])\n", (1284, 1361), False, 'import pytest\n'), ((3186, 3284), 'pytest.mark.parametrize',...
import tensorflow as tf import numpy as np from ionotomo.settings import TFSettings from ionotomo.tomography.interpolation import RegularGridInterpolator from ionotomo.tomography.integrate import simps class RayOp(object): r"""Linear operator that performs for any v(x) h[i1,...,ir] = \int_R[i1,...,ir]...
[ "numpy.random.uniform", "tensorflow.square", "ionotomo.tomography.interpolation.RegularGridInterpolator", "tensorflow.reshape", "tensorflow.Session", "tensorflow.zeros_like", "tensorflow.cast", "tensorflow.shape", "ionotomo.tomography.integrate.simps", "numpy.random.normal", "numpy.linspace", ...
[((4016, 4054), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(100, 100, 100)'}), '(size=(100, 100, 100))\n', (4032, 4054), True, 'import numpy as np\n'), ((4143, 4181), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(100, 100, 100)'}), '(size=(100, 100, 100))\n', (4159, 4181), True, 'import nump...
# -*- coding: utf-8 -*- """ Created on Tue Apr 25 11:46:31 2017 @author: lansford """ from __future__ import absolute_import, division, print_function import os import numpy as np import matplotlib.pyplot as plt from jl_spectra_2_structure.cross_validation import LOAD_CROSS_VALIDATION from jl_spectra_2_structure.plot...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xscale", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "jl_spectra_2_structure.cross_validation.LOAD_CROSS_VALIDATION", "matplotlib.pyplot.legend", "numpy.all", "matplotlib.pyplot.figure", "numpy.array", "jl_spectra_2_structure.plotting_tools.set...
[((901, 929), 'jl_spectra_2_structure.plotting_tools.set_figure_settings', 'set_figure_settings', (['"""paper"""'], {}), "('paper')\n", (920, 929), False, 'from jl_spectra_2_structure.plotting_tools import set_figure_settings\n'), ((941, 1028), 'jl_spectra_2_structure.cross_validation.LOAD_CROSS_VALIDATION', 'LOAD_CROS...
####################################################################################### # # Copyright (c) 2018, Wiphoo (Terng) Methachawalit, All rights reserved. # ####################################################################################### #################################################################...
[ "numpy.power", "ActivationFuncs.ActivationFuncs.activationFuncDerivative" ]
[((2666, 2756), 'ActivationFuncs.ActivationFuncs.activationFuncDerivative', 'ActivationFuncs.activationFuncDerivative', (['forwardPropagator.outputsMatrixOutputsLayer'], {}), '(forwardPropagator.\n outputsMatrixOutputsLayer)\n', (2706, 2756), False, 'from ActivationFuncs import ActivationFuncs\n'), ((3381, 3477), 'A...
import h5py import numpy as np with h5py.File('./Galaxy10.h5', 'r') as F: images = np.array(F['images']) labels = np.array(F['ans']) labels = labels.astype(np.float32) images = images.astype(np.float32) / 255.0 data = np.transpose(images[np.where(labels==6.0)], (0,3,1,2)) # save data np.save('./data_all.npy'...
[ "h5py.File", "numpy.save", "numpy.mean", "numpy.array", "numpy.where" ]
[((296, 327), 'numpy.save', 'np.save', (['"""./data_all.npy"""', 'data'], {}), "('./data_all.npy', data)\n", (303, 327), True, 'import numpy as np\n'), ((37, 68), 'h5py.File', 'h5py.File', (['"""./Galaxy10.h5"""', '"""r"""'], {}), "('./Galaxy10.h5', 'r')\n", (46, 68), False, 'import h5py\n'), ((88, 109), 'numpy.array',...
import os import numpy as np from scipy import interpolate import pylab as pl from perimysium.dataman import TRCFile, storage2numpy, dict2storage from perimysium.postprocessing import filter_critically_damped from collections import OrderedDict # Create motion capture data. # =========================== # Load in for...
[ "perimysium.dataman.dict2storage", "perimysium.postprocessing.filter_critically_damped", "numpy.empty", "numpy.interp", "scipy.interpolate.splev", "os.system", "numpy.linspace", "collections.OrderedDict", "perimysium.dataman.storage2numpy", "scipy.interpolate.splrep" ]
[((1146, 1185), 'numpy.linspace', 'np.linspace', (['(0)', 't_max', '(t_max * trc_rate)'], {}), '(0, t_max, t_max * trc_rate)\n', (1157, 1185), True, 'import numpy as np\n'), ((2081, 2122), 'perimysium.dataman.storage2numpy', 'storage2numpy', (['"""dynhop_forces_forces.sto"""'], {}), "('dynhop_forces_forces.sto')\n", (2...
import logging import os import pickle import time from concurrent.futures import ThreadPoolExecutor import numpy as np import scipy.io import tensorflow as tf def int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) def int64_list_feature(value): return tf.train.Feat...
[ "tensorflow.train.Int64List", "tensorflow.image.decode_png", "tensorflow.ConfigProto", "tensorflow.train.FloatList", "os.path.join", "tensorflow.placeholder", "concurrent.futures.ThreadPoolExecutor", "numpy.random.shuffle", "tensorflow.train.BytesList", "tensorflow.gfile.FastGFile", "tensorflow....
[((5905, 5942), 'tensorflow.python_io.TFRecordWriter', 'tf.python_io.TFRecordWriter', (['out_file'], {}), '(out_file)\n', (5932, 5942), True, 'import tensorflow as tf\n'), ((8150, 8177), 'os.path.expandvars', 'os.path.expandvars', (['out_dir'], {}), '(out_dir)\n', (8168, 8177), False, 'import os\n'), ((8192, 8219), 'os...
# coding: utf-8 import numpy as np import torchvision import time import os import copy import pdb import time import argparse import sys import cv2 import torch from torch.utils.data import Dataset, DataLoader from torchvision import datasets, models, transforms from retinanet.dataloader import Coc...
[ "argparse.ArgumentParser", "cv2.rectangle", "cv2.imshow", "torch.no_grad", "os.path.join", "retinanet.dataloader.Normalizer", "torch.utils.data.DataLoader", "torch.__version__.split", "cv2.imwrite", "torch.load", "retinanet.dataloader.Resizer", "os.path.dirname", "os.path.exists", "retinan...
[((692, 792), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Simple training script for training a RetinaNet network."""'}), "(description=\n 'Simple training script for training a RetinaNet network.')\n", (715, 792), False, 'import argparse\n'), ((2118, 2185), 'retinanet.dataloader.A...
import os import numpy as np import pandas as pd from sklearn import metrics from sklearn.externals import joblib from sklearn.preprocessing import MinMaxScaler from sklearn.feature_selection import chi2, SelectKBest import seaborn as sns sns.set_style("white") def load_model_from_pkl(pkl): return joblib.load(os....
[ "numpy.full", "seaborn.set_style", "os.path.abspath", "sklearn.metrics.roc_curve", "sklearn.metrics.accuracy_score", "sklearn.preprocessing.MinMaxScaler", "sklearn.metrics.classification_report", "sklearn.metrics.roc_auc_score", "sklearn.metrics.precision_recall_fscore_support", "numpy.array", "...
[((240, 262), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (253, 262), True, 'import seaborn as sns\n'), ((707, 721), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {}), '()\n', (719, 721), False, 'from sklearn.preprocessing import MinMaxScaler\n'), ((1847, 1873), 'sklearn.fea...
# -*- coding: utf-8 -*- """ Created on Mon Jan 31 22:11:31 2022 Author: <NAME> Course: CSE 598: Bio-Inspired AI and Optimization Date: 2/10/21 """ import numpy as np import matplotlib.pyplot as plt import math import pandas as pd """ Assignment: Genetic Algorithmn implementation: - optimizaiton function: ...
[ "matplotlib.pyplot.title", "numpy.random.uniform", "matplotlib.pyplot.show", "pandas.DataFrame.from_dict", "matplotlib.pyplot.plot", "numpy.empty", "matplotlib.pyplot.scatter", "matplotlib.pyplot.figure", "numpy.random.randint", "numpy.arange", "numpy.max", "numpy.sin", "numpy.array", "mat...
[((401, 425), 'numpy.arange', 'np.arange', (['(-0.5)', '(1)', '(0.01)'], {}), '(-0.5, 1, 0.01)\n', (410, 425), True, 'import numpy as np\n'), ((892, 916), 'numpy.empty', 'np.empty', (['(1, num_genes)'], {}), '((1, num_genes))\n', (900, 916), True, 'import numpy as np\n'), ((930, 954), 'numpy.random.uniform', 'np.random...
#!/usr/bin/env python3 import multiprocessing import numpy as np import os import re import subprocess import sys class colors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' ...
[ "os.path.dirname", "re.match", "numpy.min", "numpy.mean", "multiprocessing.Pool", "os.path.join", "os.listdir", "sys.exit" ]
[((1171, 1194), 'multiprocessing.Pool', 'multiprocessing.Pool', (['(1)'], {}), '(1)\n', (1191, 1194), False, 'import multiprocessing\n'), ((1131, 1160), 'os.listdir', 'os.listdir', (['problem_file_path'], {}), '(problem_file_path)\n', (1141, 1160), False, 'import os\n'), ((2493, 2548), 'numpy.min', 'np.min', (['makespa...
#Made by <NAME> #Made by following the exercise 5 from MolStat # ":" is used to generate subplots, so data after ":" is in same subplot #------------Package--------------------------- import numpy as np import sys import matplotlib as mpl import matplotlib.pyplot as plt #------------Parameters------------------------...
[ "matplotlib.pyplot.show", "numpy.log", "matplotlib.pyplot.close", "sys.argv.count", "numpy.linspace", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.ticker.ScalarFormatter" ]
[((413, 440), 'numpy.linspace', 'np.linspace', (['(200)', '(700)', '(1002)'], {}), '(200, 700, 1002)\n', (424, 440), True, 'import numpy as np\n'), ((2179, 2207), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(8, 6)'}), '(figsize=(8, 6))\n', (2191, 2207), True, 'import matplotlib.pyplot as plt\n'), ((...
import cdutil import numpy as np import MV2 as MV ############################################################################################### def bony_sorting_part1(w500,binedges): A,B,C = w500.shape dx=np.diff(binedges)[0] # Compute composite: OKwaps=nanarray((A,B,C,2+len(binedges))) # add 2 ...
[ "MV2.masked_where", "MV2.zeros", "numpy.ma.sum", "numpy.sum", "cdutil.averager", "numpy.allclose", "MV2.masked_less", "numpy.diff", "MV2.masked_greater_equal" ]
[((535, 577), 'MV2.masked_greater_equal', 'MV.masked_greater_equal', (['w500', 'binedges[0]'], {}), '(w500, binedges[0])\n', (558, 577), True, 'import MV2 as MV\n'), ((623, 662), 'MV2.masked_less', 'MV.masked_less', (['w500', '(binedges[-1] + dx)'], {}), '(w500, binedges[-1] + dx)\n', (637, 662), True, 'import MV2 as M...
import matplotlib.pyplot as plt import numpy as np f=np.load("output.npz",allow_pickle=True) x=f["x"] y=f["y"] plt.plot(x,y) plt.xlabel("thesis grade") plt.ylabel("final grade") plt.savefig("grades.png",format="png") plt.savefig("grades.pdf",format="pdf") plt.show()
[ "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig" ]
[((55, 95), 'numpy.load', 'np.load', (['"""output.npz"""'], {'allow_pickle': '(True)'}), "('output.npz', allow_pickle=True)\n", (62, 95), True, 'import numpy as np\n'), ((115, 129), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (123, 129), True, 'import matplotlib.pyplot as plt\n'), ((129, 155), '...
"""Code for parameter and function fitting of risk based approximate model to simulation data.""" import pdb import copy import itertools import os import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy.optimize import minimize from sklearn.linear_model im...
[ "simulation.Simulator", "numpy.sum", "numpy.nan_to_num", "numpy.clip", "os.path.join", "numpy.prod", "scipy.optimize.minimize", "numpy.meshgrid", "numpy.zeros_like", "matplotlib.pyplot.close", "numpy.max", "fitting.randomise_infection", "numpy.linspace", "matplotlib.pyplot.subplots", "si...
[((2893, 2935), 'risk_model.RiskModel', 'risk_model.RiskModel', (['model_params', 'fitter'], {}), '(model_params, fitter)\n', (2913, 2935), False, 'import risk_model\n'), ((3731, 3742), 'numpy.zeros', 'np.zeros', (['(6)'], {}), '(6)\n', (3739, 3742), True, 'import numpy as np\n'), ((4521, 4563), 'risk_model.RiskModel',...
# Remove nans from textfile output of dmstack and only extract few columns # Author: <NAME> # # Filtering: # 1. flag calib_psfCandidate==False # 2. column deblend_nChild==0 # 3. ellipticity e = sqrt(e1^2 + e2^2) < 1.5 # 4. choose only few columns given below # 5. remove nans from all these columns # 6. change delim...
[ "pandas.read_csv", "numpy.savetxt", "pandas.to_numeric", "glob.glob" ]
[((1505, 1550), 'pandas.read_csv', 'pd.read_csv', (['ifile'], {'sep': '""","""', 'low_memory': '(False)'}), "(ifile, sep=',', low_memory=False)\n", (1516, 1550), True, 'import pandas as pd\n'), ((2581, 2660), 'numpy.savetxt', 'np.savetxt', (["(ifile[0:-4] + '.txt')", 'df.values'], {'header': 'header_line', 'delimiter':...
import re import random import torch from omegaconf import OmegaConf import torchaudio import struct from io import BytesIO, FileIO import wave import numpy as np from nltk import sent_tokenize import nltk try: nltk.data.find('tokenizers/punkt') except LookupError: nltk.download('punkt') def _make_wav(data,...
[ "wave.open", "io.BytesIO", "numpy.abs", "nltk.sent_tokenize", "omegaconf.OmegaConf.load", "nltk.data.find", "struct.pack", "numpy.array", "torch.device", "nltk.download", "torch.hub.load", "re.compile" ]
[((1884, 1926), 'omegaconf.OmegaConf.load', 'OmegaConf.load', (['"""latest_silero_models.yml"""'], {}), "('latest_silero_models.yml')\n", (1898, 1926), False, 'from omegaconf import OmegaConf\n'), ((218, 252), 'nltk.data.find', 'nltk.data.find', (['"""tokenizers/punkt"""'], {}), "('tokenizers/punkt')\n", (232, 252), Fa...
import os import numpy as np import pandas as pd from contextlib import closing from itertools import combinations from itertools import product import tensorflow as tf import matplotlib from matplotlib import gridspec from matplotlib import pyplot as plt from matplotlib.ticker import MaxNLocator from interpret.gla...
[ "matplotlib.pyplot.title", "numpy.maximum", "matplotlib.pyplot.axes", "numpy.argmin", "numpy.argsort", "matplotlib.pyplot.figure", "interpret.glassbox.ebm.ebm.EBMPreprocessor", "numpy.round", "matplotlib.ticker.ScalarFormatter", "pandas.DataFrame", "interpret.glassbox.ebm.internal.NativeEBM", ...
[((1239, 1263), 'numpy.vstack', 'np.vstack', (['[tr_x, val_x]'], {}), '([tr_x, val_x])\n', (1248, 1263), True, 'import numpy as np\n'), ((1391, 1422), 'interpret.glassbox.ebm.ebm.EBMPreprocessor', 'EBMPreprocessor', ([], {'schema': 'schema_'}), '(schema=schema_)\n', (1406, 1422), False, 'from interpret.glassbox.ebm.ebm...
''' Algorithm for testing trained model ''' import numpy as np import pandas as pd from keras.layers import Input from keras import backend as K from keras.models import load_model, Model from dataset import load_dataset def test_model(): testData, testLabels = load_dataset() # DEFINE MODEL PARAMETERS ...
[ "keras.models.load_model", "dataset.load_dataset", "numpy.argmax" ]
[((272, 286), 'dataset.load_dataset', 'load_dataset', ([], {}), '()\n', (284, 286), False, 'from dataset import load_dataset\n'), ((330, 352), 'keras.models.load_model', 'load_model', (['MODEL_PATH'], {}), '(MODEL_PATH)\n', (340, 352), False, 'from keras.models import load_model, Model\n'), ((543, 555), 'numpy.argmax',...
# Stiffness matrix calculation. import numpy as np import scipy import sys, os sys.path.append(os.path.dirname(sys.path[0])) from otherFunctions import numericalIntegration from elementLibrary import shapeFunction,invShapeFunction def triFE(coord,Dmat): nInt=1 (pos,wei)=numericalIntegration.gaussTri(nInt) ...
[ "otherFunctions.numericalIntegration.gaussTri", "elementLibrary.invShapeFunction.invTri", "os.path.dirname", "elementLibrary.shapeFunction.shapeTriFE2", "numpy.zeros", "elementLibrary.invShapeFunction.invQuadQuad", "elementLibrary.shapeFunction.shapeTriFE", "otherFunctions.numericalIntegration.gaussQu...
[((96, 124), 'os.path.dirname', 'os.path.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (111, 124), False, 'import sys, os\n'), ((282, 317), 'otherFunctions.numericalIntegration.gaussTri', 'numericalIntegration.gaussTri', (['nInt'], {}), '(nInt)\n', (311, 317), False, 'from otherFunctions import numericalIntegrati...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
[ "plot_utils.set_styles", "matplotlib.pyplot.close", "numpy.asfortranarray", "plot_utils.get_path", "bezier.Surface", "bezier.Surface.from_nodes", "matplotlib.pyplot.subplots" ]
[((708, 726), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {}), '(1, 2)\n', (720, 726), True, 'import matplotlib.pyplot as plt\n'), ((740, 793), 'numpy.asfortranarray', 'np.asfortranarray', (['[[0.0, 3.0, 7.0], [5.0, 0.0, 8.0]]'], {}), '([[0.0, 3.0, 7.0], [5.0, 0.0, 8.0]])\n', (757, 793), True, 'impor...
# -*- coding: utf-8 -*- """ Created on Tue Jan 23 16:00:33 2018 @author: tcmorgan2 Reads in wind speed data from tab delimited text files. The first portion of the file contains header information. The second portion contains average and standard deviation in wind speed of some time interval. Imported files are passe...
[ "pandas.DataFrame", "netCDF4.Dataset", "os.remove", "numpy.random.randn", "os.path.basename", "os.walk", "numpy.zeros", "logging.info", "pandas.to_datetime", "MiGRIDS.InputHandler.processInputDataFrame.processInputDataFrame", "numpy.array", "sqlite3.connect", "pandas.read_sql_query", "pand...
[((6882, 6896), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (6894, 6896), True, 'import pandas as pd\n'), ((6931, 6965), 'os.walk', 'os.walk', (["inputDict['fileLocation']"], {}), "(inputDict['fileLocation'])\n", (6938, 6965), False, 'import os\n'), ((12320, 12352), 'MiGRIDS.InputHandler.processInputDataFrame...
import numpy as np import scipy.optimize as opt def OneStep(des,ndes,nfaces): i=np.random.randint(0,ndes) j=i while (j==i): j=np.random.randint(0,ndes) destrial=np.copy(des) destrial[i]-=1 destrial[j]+=1 if (destrial[i]>0) and (destrial[j]<nfaces+1): return destrial ...
[ "numpy.sum", "numpy.log", "numpy.copy", "scipy.optimize.root_scalar", "numpy.zeros", "numpy.ones", "numpy.random.randint", "numpy.int" ]
[((87, 113), 'numpy.random.randint', 'np.random.randint', (['(0)', 'ndes'], {}), '(0, ndes)\n', (104, 113), True, 'import numpy as np\n'), ((189, 201), 'numpy.copy', 'np.copy', (['des'], {}), '(des)\n', (196, 201), True, 'import numpy as np\n'), ((745, 785), 'numpy.zeros', 'np.zeros', (['(ndes, ntirages)'], {'dtype': '...
import numpy as np import os import re from sys import argv, exit import cv2 from tqdm import tqdm def natural_sort(l): convert = lambda text: int(text) if text.isdigit() else text.lower() alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] return sorted(l, key = alphanum_key) def get...
[ "cv2.warpPerspective", "numpy.load", "re.split", "cv2.imwrite", "cv2.imread", "numpy.array", "os.path.join", "os.listdir" ]
[((345, 364), 'cv2.imread', 'cv2.imread', (['imgFile'], {}), '(imgFile)\n', (355, 364), False, 'import cv2\n'), ((437, 476), 'cv2.warpPerspective', 'cv2.warpPerspective', (['im1', 'H', '(800, 800)'], {}), '(im1, H, (800, 800))\n', (456, 476), False, 'import cv2\n'), ((730, 744), 'numpy.load', 'np.load', (['HFile'], {})...
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2013, 2014 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the righ...
[ "microanalyst.model.welladdr.names", "microanalyst.model.commons.slice_or_index", "microanalyst.model.welladdr.indexof", "microanalyst.model.commons.flatten", "numpy.array" ]
[((5143, 5167), 'numpy.array', 'numpy.array', (['microplates'], {}), '(microplates)\n', (5154, 5167), False, 'import numpy\n'), ((3668, 3688), 'microanalyst.model.commons.slice_or_index', 'slice_or_index', (['None'], {}), '(None)\n', (3682, 3688), False, 'from microanalyst.model.commons import flatten, slice_or_index\n...
import itertools from pathlib import Path from typing import ( Any, Callable, Dict, Generator, Iterable, List, NamedTuple, Optional, Tuple, ) import bootstraphistogram import matplotlib.pyplot as plt import numpy as np from bootstraphistogram.bootstraphistogram import BootstrapHisto...
[ "watchopticalanalysis.category.Category.fromAnalysisEventTuple", "numpy.average", "matplotlib.pyplot.close", "watchopticalutils.histoutils.categorybootstraphistogram.CategoryBootstrapHistogram", "watchopticalutils.collectionutils.summap", "matplotlib.pyplot.figure", "numpy.array", "tabulate.tabulate",...
[((2504, 2568), 'itertools.product', 'itertools.product', (['SelectionDefs', '_BONSAIVARIABLES', '(None, 0, 1)'], {}), '(SelectionDefs, _BONSAIVARIABLES, (None, 0, 1))\n', (2521, 2568), False, 'import itertools\n'), ((2952, 3018), 'itertools.product', 'itertools.product', (['SelectionDefs', '_ANALYSISVARIABLES', '(None...
import os from pathlib import Path import astropy import numpy as np from astropy import constants from astropy import units as u from astropy.io import ascii from astropy.time import Time from .constants import * jitter = True # Do this to infer w/ jitter # get the root datadir from environment variables p = Path...
[ "numpy.load", "astropy.io.ascii.read", "numpy.sum", "numpy.std", "numpy.mean", "numpy.cov", "numpy.ascontiguousarray", "os.getenv" ]
[((1585, 1617), 'astropy.io.ascii.read', 'ascii.read', (["(closedir / 'cfa.dat')"], {}), "(closedir / 'cfa.dat')\n", (1595, 1617), False, 'from astropy.io import ascii\n'), ((1715, 1786), 'astropy.io.ascii.read', 'ascii.read', (["(closedir / 'keck.dat')"], {'format': '"""tab"""', 'fill_values': "[('X', 0)]"}), "(closed...
import os import sys import numpy as np # import tensorflow as tf sys.path.append('./fastfiz/fastfiz/') # sys.path.append('./fastfiz/') from fastfiz import fz as f # from fastfiz import rules as r game_type = 1 #'GT_EIGHTBALL' """ Parse the Gamestate from string to ball positions. GameState format: GameType, T...
[ "sys.path.append", "fastfiz.fz.GameShot", "numpy.array", "fastfiz.fz.ShotParams", "fastfiz.fz.GameState.RackedState" ]
[((67, 104), 'sys.path.append', 'sys.path.append', (['"""./fastfiz/fastfiz/"""'], {}), "('./fastfiz/fastfiz/')\n", (82, 104), False, 'import sys\n'), ((1023, 1049), 'fastfiz.fz.GameState.RackedState', 'f.GameState.RackedState', (['(1)'], {}), '(1)\n', (1046, 1049), True, 'from fastfiz import fz as f\n'), ((1164, 1203),...
try: import cv2 import numpy as np except ImportError as e: from pip._internal import main as install packages = ["numpy", "opencv-python"] for package in packages: install(["install", package]) finally: pass from stackimages import stackImages def horizontalStack(images): horizontal...
[ "stackimages.stackImages", "cv2.waitKey", "numpy.hstack", "cv2.imread", "pip._internal.main", "cv2.imshow", "numpy.vstack" ]
[((755, 788), 'cv2.imread', 'cv2.imread', (['"""images/person_1.jpg"""'], {}), "('images/person_1.jpg')\n", (765, 788), False, 'import cv2\n'), ((799, 835), 'cv2.imread', 'cv2.imread', (['"""images/person_1.jpg"""', '(0)'], {}), "('images/person_1.jpg', 0)\n", (809, 835), False, 'import cv2\n'), ((849, 905), 'stackimag...
#!/usr/bin/env python import rospy import cv2 import duckietown_msgs.msg #from virtual_mirror_nbuckman import util from std_msgs.msg import String,UInt8 import numpy as np from sensor_msgs.msg import CompressedImage,Image from cv_bridge import CvBridge, CvBridgeError # Initialize the node with rospy class ImageAvera...
[ "cv_bridge.CvBridge", "rospy.Subscriber", "cv2.imdecode", "rospy.Publisher", "cv2.addWeighted", "cv2.flip", "rospy.init_node", "sensor_msgs.msg.CompressedImage", "cv2.imencode", "rospy.spin", "numpy.fromstring" ]
[((2286, 2323), 'rospy.init_node', 'rospy.init_node', (['"""image_average_node"""'], {}), "('image_average_node')\n", (2301, 2323), False, 'import rospy\n'), ((2367, 2379), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (2377, 2379), False, 'import rospy\n'), ((411, 502), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/e...
"""Tests for optimization module.""" import numpy as np from hypothesis import given from hypothesis.extra.numpy import arrays from hypothesis.strategies import floats from hypothesis.strategies import integers from temfpy.optimization import ackley from temfpy.optimization import carlberg from temfpy.optimiz...
[ "temfpy.optimization.ackley", "hypothesis.extra.numpy.arrays", "temfpy.optimization.rosenbrock", "temfpy.optimization.carlberg", "numpy.random.randint", "temfpy.optimization.rastrigin", "hypothesis.strategies.integers", "hypothesis.strategies.floats" ]
[((1843, 1861), 'temfpy.optimization.ackley', 'ackley', (['x', 'a', 'b', 'c'], {}), '(x, a, b, c)\n', (1849, 1861), False, 'from temfpy.optimization import ackley\n'), ((1937, 1954), 'temfpy.optimization.carlberg', 'carlberg', (['x', 'a', 'b'], {}), '(x, a, b)\n', (1945, 1954), False, 'from temfpy.optimization import c...
""" Copyright (c) 2020 <NAME> Centrum Wiskunde & Informatica, Amsterdam, the Netherlands. Code is available via LINKXXXX. Reference paper: XXXXX """ import numpy as np import astra import odl import os from skimage.transform import resize import tifffile import sys, getopt # create parallel beam geometry in ODL # num...
[ "odl.tomo.RayTransform", "getopt.getopt", "os.makedirs", "odl.uniform_discr", "odl.phantom.white_noise", "odl.tomo.parallel_beam_geometry", "skimage.transform.resize", "numpy.mean", "tifffile.imread", "os.listdir" ]
[((648, 739), 'odl.uniform_discr', 'odl.uniform_discr', ([], {'min_pt': 'MIN_PT', 'max_pt': 'MAX_PT', 'shape': 'RECO_IM_SHAPE', 'dtype': 'np.float32'}), '(min_pt=MIN_PT, max_pt=MAX_PT, shape=RECO_IM_SHAPE, dtype=\n np.float32)\n', (665, 739), False, 'import odl\n'), ((743, 829), 'odl.uniform_discr', 'odl.uniform_dis...
import torch import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec device = torch.device("cuda" if torch.cuda.is_available() else "cpu") def get_prediction(net, data): output = net.fw_over_time(data) _, am = torch.max(output, 1) # argmax over output units return...
[ "matplotlib.pyplot.subplot", "torch.tensor", "torch.LongTensor", "numpy.prod", "numpy.mean", "numpy.array", "torch.max", "numpy.linspace", "torch.cuda.is_available", "torch.Size", "matplotlib.gridspec.GridSpec", "numpy.digitize", "numpy.random.shuffle" ]
[((257, 277), 'torch.max', 'torch.max', (['output', '(1)'], {}), '(output, 1)\n', (266, 277), False, 'import torch\n'), ((935, 948), 'numpy.mean', 'np.mean', (['accs'], {}), '(accs)\n', (942, 948), True, 'import numpy as np\n'), ((1305, 1327), 'numpy.array', 'np.array', (['y'], {'dtype': 'int'}), '(y, dtype=int)\n', (1...
import numpy as np from .qac import Register, block_copy # takes a qac with no inputs, returns the output state vector def get_qac_state(qac): assert len(qac.scope_inputs) == 0 assert len(qac.scope_outputs) == 0 # purification simulation: state is stored as state vector # state = np.array of complex ...
[ "numpy.abs", "numpy.allclose", "numpy.zeros", "numpy.random.random", "numpy.array", "numpy.exp", "numpy.sqrt" ]
[((18040, 18061), 'numpy.allclose', 'np.allclose', (['total', '(1)'], {}), '(total, 1)\n', (18051, 18061), True, 'import numpy as np\n'), ((18202, 18220), 'numpy.random.random', 'np.random.random', ([], {}), '()\n', (18218, 18220), True, 'import numpy as np\n'), ((894, 907), 'numpy.array', 'np.array', (['[1]'], {}), '(...
import unittest import numpy.testing as np_test from scripts.algorithms.holtwinters_predictor import HoltWintersPredictor class HoltWintersTests(unittest.TestCase): def test_negatives_in_sequence(self): time_series = [1, 1, -1, 1, 1] num_predicted_periods = 3 expected_prediction = [0.8]...
[ "numpy.testing.assert_almost_equal", "scripts.algorithms.holtwinters_predictor.HoltWintersPredictor" ]
[((358, 414), 'scripts.algorithms.holtwinters_predictor.HoltWintersPredictor', 'HoltWintersPredictor', (['time_series', 'num_predicted_periods'], {}), '(time_series, num_predicted_periods)\n', (378, 414), False, 'from scripts.algorithms.holtwinters_predictor import HoltWintersPredictor\n'), ((473, 551), 'numpy.testing....
from keras.models import Sequential # basic class for specifying and training a neural network from keras.layers import Convolution2D, MaxPooling2D, Dense, Dropout, Flatten, Activation, BatchNormalization, Input from keras.utils import np_utils # utilities for one-hot encoding of ground truth values from keras.callba...
[ "keras.regularizers.l2", "gzip.open", "keras.layers.Activation", "numpy.random.get_state", "keras.layers.Dropout", "numpy.unique", "keras.layers.Flatten", "time.strftime", "numpy.random.set_state", "numpy.max", "keras.callbacks.TensorBoard", "keras.utils.np_utils.to_categorical", "pickle.loa...
[((923, 951), 'time.strftime', 'time.strftime', (['"""%Y%m%d_%H%M"""'], {}), "('%Y%m%d_%H%M')\n", (936, 951), False, 'import time\n'), ((1910, 1925), 'numpy.max', 'np.max', (['X_train'], {}), '(X_train)\n', (1916, 1925), True, 'import numpy as np\n'), ((1970, 1984), 'numpy.max', 'np.max', (['X_test'], {}), '(X_test)\n'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ BSD 3-Clause License Copyright (c) 2020 Okinawa Institute of Science and Technology (OIST). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ...
[ "numpy.frombuffer", "numpy.zeros", "numpy.hstack", "time.sleep", "time.time", "ctypes.c_float", "NRL.NRL", "collections.deque" ]
[((7784, 7789), 'NRL.NRL', 'NRL', ([], {}), '()\n', (7787, 7789), False, 'from NRL import NRL\n'), ((2762, 2783), 'collections.deque', 'deque', ([], {'maxlen': 'winSize'}), '(maxlen=winSize)\n', (2767, 2783), False, 'from collections import deque\n'), ((3889, 3919), 'numpy.zeros', 'np.zeros', (['(nDof,)'], {'dtype': 'f...
import numpy as np import os import sys import plaidml2 import plaidml2.edsl as edsl import plaidml2.exec as pld_exec import plaidml2.op as op import unittest import numpy.testing as npt def matmul_2_2(A, B): I, J, K = edsl.TensorDims(3) i, j, k = edsl.TensorIndexes(3) A.bind_dims(I, J) B.bind_dims(...
[ "plaidml2.edsl.TensorDims", "unittest.main", "plaidml2.edsl.LogicalShape", "plaidml2.edsl.TensorIndexes", "plaidml2.exec.Binder", "numpy.testing.assert_allclose", "numpy.zeros", "plaidml2.edsl.jacobian", "numpy.array", "plaidml2.op.square", "numpy.eye", "plaidml2.edsl.Program", "plaidml2.eds...
[((227, 245), 'plaidml2.edsl.TensorDims', 'edsl.TensorDims', (['(3)'], {}), '(3)\n', (242, 245), True, 'import plaidml2.edsl as edsl\n'), ((260, 281), 'plaidml2.edsl.TensorIndexes', 'edsl.TensorIndexes', (['(3)'], {}), '(3)\n', (278, 281), True, 'import plaidml2.edsl as edsl\n'), ((334, 357), 'plaidml2.edsl.TensorOutpu...
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "unittest.main", "numpy.random.seed", "numpy.sum", "paddle.incubate.sparse.nn.Softmax", "numpy.max", "scipy.sparse.csr_matrix", "numpy.array", "numpy.exp", "numpy.random.rand", "paddle.fluid.framework._test_eager_guard", "paddle.to_tensor", "numpy.concatenate" ]
[((786, 806), 'numpy.random.seed', 'np.random.seed', (['(2022)'], {}), '(2022)\n', (800, 806), True, 'import numpy as np\n'), ((2771, 2786), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2784, 2786), False, 'import unittest\n'), ((892, 911), 'paddle.fluid.framework._test_eager_guard', '_test_eager_guard', ([], {...
"""Bot class.""" import action import config_stat import debug from drifter_db import DataManager import numpy as np class Bot(object): def __init__(self, username, bot_id=None): self.username = username self.db_manager = DataManager(username, bot_id=bot_id) self.db_manager.SaveBackground() def actio...
[ "action.Retweet", "action.Like", "drifter_db.DataManager", "action.Unfollow", "action.PostTweet", "numpy.random.choice", "action.ReplyMention", "action.Follow" ]
[((234, 270), 'drifter_db.DataManager', 'DataManager', (['username'], {'bot_id': 'bot_id'}), '(username, bot_id=bot_id)\n', (245, 270), False, 'from drifter_db import DataManager\n'), ((449, 486), 'numpy.random.choice', 'np.random.choice', (['keys', '(1)'], {'p': 'prob_lst'}), '(keys, 1, p=prob_lst)\n', (465, 486), Tru...
import numpy as np import pandas as pd import sklearn as scikit import tensorflow as tf from preprocessing import Preprocessing from evaluation import EvaluationClient from sklearn.model_selection import train_test_split # ###############################################################################################...
[ "tensorflow.keras.utils.to_categorical", "numpy.abs", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "pandas.read_csv", "sklearn.model_selection.train_test_split", "tensorflow.keras.layers.Dense", "tensorflow.keras.optimizers.SGD", "tensorflow.keras.losses.CategoricalCross...
[((1147, 1189), 'pandas.read_csv', 'pd.read_csv', (['"""../../data/source/mnist.csv"""'], {}), "('../../data/source/mnist.csv')\n", (1158, 1189), True, 'import pandas as pd\n'), ((1261, 1319), 'sklearn.model_selection.train_test_split', 'train_test_split', (['mnist_data.values[:7000]'], {'train_size': '(0.8)'}), '(mnis...
"""Evaluate Baseline. Baseline results are saved in the ```./baseline``` folder. Examples -------- python baseline.py --problem=conv_train --optimizer=adam Arguments --------- --vgpu : int >= 1 (debug) Number of virtual GPUs to create for testing. If 1, no virtual GPUs are created, and a mirrored strategy is...
[ "numpy.stack", "tensorflow.keras.optimizers.get", "gpu_setup.create_distribute", "l2o.deserialize.policy", "config.get_eval_problem", "os.path.join", "config.ArgParser" ]
[((952, 975), 'config.ArgParser', 'ArgParser', (['sys.argv[1:]'], {}), '(sys.argv[1:])\n', (961, 975), False, 'from config import ArgParser, get_eval_problem\n'), ((1203, 1256), 'gpu_setup.create_distribute', 'create_distribute', ([], {'vgpus': 'vgpus', 'do_cpu': 'cpu', 'gpus': 'gpus'}), '(vgpus=vgpus, do_cpu=cpu, gpus...
import itertools import math import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import pandas as pd mpl.rcParams['pdf.fonttype'] = 42 plt.style.use('fivethirtyeight') mpl.rcParams['savefig.transparent'] = True mpl.rcParams['savefig.pad_inches'] = 0.1 # mpl.rcParams['figure.facecolor'] = 'whi...
[ "numpy.load", "matplotlib.pyplot.clf", "math.floor", "matplotlib.pyplot.style.use", "matplotlib.pyplot.xticks", "pandas.Series", "matplotlib.pyplot.gca", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig" ]
[((161, 193), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (174, 193), True, 'import matplotlib.pyplot as plt\n'), ((2405, 2437), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""loss (regularized)"""'], {}), "('loss (regularized)')\n", (2415, 2437), True, 'im...
import os import time import imageio import numpy as np import torch from torch.utils.data import DataLoader from torch.utils.data.distributed import DistributedSampler from data import set_up_data from dciknn_cuda.dciknn_cuda import DCI from train_helpers import set_up_hyperparams, load_vaes, load_opt, accumulate_st...
[ "numpy.load", "train_helpers.set_up_hyperparams", "train_helpers.load_vaes", "numpy.empty", "train_helpers.update_ema", "os.path.isfile", "numpy.mean", "torch.no_grad", "os.path.join", "torch.isnan", "torch.nn.MSELoss", "torch.utils.data.DataLoader", "os.path.exists", "numpy.isfinite", "...
[((498, 509), 'time.time', 'time.time', ([], {}), '()\n', (507, 509), False, 'import time\n'), ((921, 952), 'utils.get_cpu_stats_over_ranks', 'get_cpu_stats_over_ranks', (['stats'], {}), '(stats)\n', (945, 952), False, 'from utils import get_cpu_stats_over_ranks\n'), ((1303, 1314), 'time.time', 'time.time', ([], {}), '...
import numpy as np import collections import copy class VectorVar: # W is weights matrix, b is bias vector, dim is dimensions of vector def __init__(self, name, dim, W=None, b=None, cf=1): self.name = name self.dim = dim if W is None: self.W = np.identity(dim) else:...
[ "copy.deepcopy", "numpy.copy", "numpy.zeros", "numpy.identity", "numpy.array", "numpy.delete", "numpy.vstack" ]
[((8256, 8304), 'numpy.zeros', 'np.zeros', (['(inputDim[0] * i12, inputDim[0] * i12)'], {}), '((inputDim[0] * i12, inputDim[0] * i12))\n', (8264, 8304), True, 'import numpy as np\n'), ((290, 306), 'numpy.identity', 'np.identity', (['dim'], {}), '(dim)\n', (301, 306), True, 'import numpy as np\n'), ((387, 400), 'numpy.z...
import cv2 from functools import lru_cache import numpy as np from typing import List from urllib.request import urlopen from app.cv.openpose import get_openpose_engine from app.schemas.pose import Keypoint, Person from app.cv.engine import Engine BLACK = (0, 0, 0) GREY = (127, 127, 127) WHITE = (255, 200, 200) BLUE ...
[ "cv2.line", "app.cv.openpose.get_openpose_engine", "cv2.imdecode", "urllib.request.urlopen", "numpy.isnan", "numpy.shape", "cv2.rectangle", "numpy.array", "cv2.imencode", "functools.lru_cache", "numpy.fromstring" ]
[((3708, 3719), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (3717, 3719), False, 'from functools import lru_cache\n'), ((1117, 1129), 'urllib.request.urlopen', 'urlopen', (['url'], {}), '(url)\n', (1124, 1129), False, 'from urllib.request import urlopen\n'), ((1204, 1241), 'cv2.imdecode', 'cv2.imdecode', (['i...
import matplotlib.pyplot as plt import numpy as np plt.style.use('_mpl-gallery-nogrid') # make data X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256)) Z = (1 - X/2 + X**5 + Y**3) * np.exp(-X**2 - Y**2) levels = np.linspace(Z.min(), Z.max(), 7) # plot fig, ax = plt.subplots() ax.contourf(X, Y, Z, l...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.style.use", "numpy.exp", "numpy.linspace", "matplotlib.pyplot.subplots" ]
[((52, 88), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""_mpl-gallery-nogrid"""'], {}), "('_mpl-gallery-nogrid')\n", (65, 88), True, 'import matplotlib.pyplot as plt\n'), ((282, 296), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (294, 296), True, 'import matplotlib.pyplot as plt\n'), ((335, ...
import asyncio import concurrent.futures import datetime import json import os from collections import Counter from typing import Optional import discord import matplotlib.pyplot as plt import numpy as np import pandas as pd from discord.ext import commands from discord_slash import cog_ext, SlashContext, ComponentCon...
[ "discord_slash.utils.manage_components.create_select_option", "os.remove", "ElevatorBot.backendNetworking.slashCommandFunctions.verify_time_input", "ElevatorBot.backendNetworking.dataLoading.searchForItem", "ElevatorBot.backendNetworking.miscFunctions.check_if_mutually_exclusive", "ElevatorBot.backendNetw...
[((9385, 9488), 'discord_slash.cog_ext.cog_slash', 'cog_ext.cog_slash', ([], {'name': '"""poptimeline"""', 'description': '"""Shows the Destiny 2 steam population timeline"""'}), "(name='poptimeline', description=\n 'Shows the Destiny 2 steam population timeline')\n", (9402, 9488), False, 'from discord_slash import ...
# -*- coding: utf-8 -*- import pandas import torch # import horovod.torch as hvd import time import numpy as np import sklearn import deepctr_torch as deepctr import argparse parser = argparse.ArgumentParser() parser.add_argument('--data', required=True) parser.add_argument('--optimizer', default='Adagrad', choices=['...
[ "argparse.ArgumentParser", "torch.utils.data.DataLoader", "pandas.read_csv", "onnxruntime.training.ortmodule.ORTModule", "deepctr_torch.inputs.DenseFeat", "numpy.expand_dims", "time.time", "torch.utils.data.TensorDataset", "numpy.concatenate", "torch.from_numpy" ]
[((185, 210), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (208, 210), False, 'import argparse\n'), ((1085, 1104), 'torch.from_numpy', 'torch.from_numpy', (['y'], {}), '(y)\n', (1101, 1104), False, 'import torch\n'), ((1129, 1165), 'torch.utils.data.TensorDataset', 'torch.utils.data.TensorDat...
# 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 importlib import json import pathlib from typing import Dict, Tuple import numpy as np import skimage.metrics import torch def get_u...
[ "torch.mean", "pathlib.Path.exists", "json.dump", "json.load", "torch.ones", "torch.stack", "importlib.import_module", "torch.nn.functional.mse_loss", "torch.nn.functional.conv2d", "torch.exp", "numpy.array", "numpy.linalg.norm", "torch.linalg.norm", "torch.log10", "pathlib.Path.cwd" ]
[((1329, 1364), 'importlib.import_module', 'importlib.import_module', (['the_module'], {}), '(the_module)\n', (1352, 1364), False, 'import importlib\n'), ((1740, 1773), 'numpy.array', 'np.array', (['ssims'], {'dtype': 'np.float32'}), '(ssims, dtype=np.float32)\n', (1748, 1773), True, 'import numpy as np\n'), ((2112, 21...
from jupyterworkflow.data import get_fremont_data import pandas as pd import numpy as np def test_fremont_data(): data=get_fremont_data() assert all(data.columns==['Total', 'West', 'East']) assert isinstance(data.index, pd.DatetimeIndex) assert len(np.unique(data.index.time)==36)
[ "jupyterworkflow.data.get_fremont_data", "numpy.unique" ]
[((123, 141), 'jupyterworkflow.data.get_fremont_data', 'get_fremont_data', ([], {}), '()\n', (139, 141), False, 'from jupyterworkflow.data import get_fremont_data\n'), ((265, 291), 'numpy.unique', 'np.unique', (['data.index.time'], {}), '(data.index.time)\n', (274, 291), True, 'import numpy as np\n')]
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. import numpy as np from pathlib import Path import matplotlib.pyplot as plt train_data_name = "../../data/ch08.train.npz" test_data_name = "../../data/ch08.test.npz" de...
[ "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "pathlib.Path", "numpy.sin", "numpy.random.random", "numpy.linspace", "numpy.savez" ]
[((350, 366), 'numpy.sin', 'np.sin', (['(6.28 * x)'], {}), '(6.28 * x)\n', (356, 366), True, 'import numpy as np\n'), ((466, 498), 'numpy.random.random', 'np.random.random', (['(num_train, 1)'], {}), '((num_train, 1))\n', (482, 498), True, 'import numpy as np\n'), ((572, 616), 'numpy.savez', 'np.savez', (['train_data_n...
from functools import reduce class Node(): def __init__(self, layer_index, node_index): self.layer_index = layer_index self.node_index = node_index self.downstream =[] self.upstream = [] self.output = 0 self.delta = 0 def set_out_put(self, output): se...
[ "functools.reduce", "numpy.exp" ]
[((627, 718), 'functools.reduce', 'reduce', (['(lambda ret, cnn: ret + cnn.upstream_node.output * cnn.weight)', 'self.upstream', '(0)'], {}), '(lambda ret, cnn: ret + cnn.upstream_node.output * cnn.weight, self.\n upstream, 0)\n', (633, 718), False, 'from functools import reduce\n'), ((816, 911), 'functools.reduce',...
import poseconnect.utils import poseconnect.defaults import smc_kalman import pandas as pd import numpy as np import matplotlib.pyplot as plt import tqdm from uuid import uuid4 import logging import time import itertools import functools import copy logger = logging.getLogger(__name__) def track_poses_3d( poses_3...
[ "tqdm.notebook.tqdm", "pandas.DatetimeIndex", "numpy.nanmean", "pandas.DataFrame", "itertools.product", "matplotlib.pyplot.subplots", "pandas.concat", "numpy.repeat", "numpy.stack", "copy.deepcopy", "tqdm.tqdm", "matplotlib.pyplot.show", "numpy.asarray", "pandas.to_datetime", "pandas.Ser...
[((260, 287), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'import logging\n'), ((4869, 4897), 'pandas.concat', 'pd.concat', (['poses_3d_new_list'], {}), '(poses_3d_new_list)\n', (4878, 4897), True, 'import pandas as pd\n'), ((4937, 4984), 'pandas.concat', 'pd.concat'...
import random import unittest import os import Bio.Seq import Bio.Data.CodonTable import pyoma.browser.db as pyomadb import tables import numpy class DatabaseChecks(unittest.TestCase): @classmethod def setUpClass(cls): try: path = os.environ['PYOMA_DB2CHECK'] except KeyError: ...
[ "pyoma.browser.db.Database", "numpy.where", "unittest.SkipTest" ]
[((413, 435), 'pyoma.browser.db.Database', 'pyomadb.Database', (['path'], {}), '(path)\n', (429, 435), True, 'import pyoma.browser.db as pyomadb\n'), ((3453, 3478), 'numpy.where', 'numpy.where', (['(syn_col >= 0)'], {}), '(syn_col >= 0)\n', (3464, 3478), False, 'import numpy\n'), ((334, 394), 'unittest.SkipTest', 'unit...
import png import os import sys import pydicom import numpy as np ROOT_DIR = os.getcwd() IN_DIR = ROOT_DIR + "/data" PNG_IN_DIR = ROOT_DIR + "output/pix2pix/inputs" PNG_OUT_DIR = ROOT_DIR + "output/pix2pix/outputs" INPUT = "Features" OUTPUT = "Labels" def convert(mri_path, mri_filename): """ Function to convert a...
[ "numpy.uint8", "os.makedirs", "pydicom.read_file", "os.getcwd", "os.walk", "os.path.exists", "os.path.splitext", "png.Writer", "os.path.join" ]
[((78, 89), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (87, 89), False, 'import os\n'), ((540, 567), 'pydicom.read_file', 'pydicom.read_file', (['mri_file'], {}), '(mri_file)\n', (557, 567), False, 'import pydicom\n'), ((1166, 1184), 'numpy.uint8', 'np.uint8', (['image_2d'], {}), '(image_2d)\n', (1174, 1184), True, 'i...
from ScopeFoundry.data_browser import DataBrowserView import pyqtgraph as pg import numpy as np import h5py from collections import namedtuple, OrderedDict import json from qtpy import QtWidgets from .scalebars import SEMScaleBar AvailChan = namedtuple('AvailChan', ['type_', 'index', 'phys_chan', ...
[ "h5py.File", "json.loads", "pyqtgraph.TextItem", "qtpy.QtWidgets.QLabel", "numpy.zeros", "pyqtgraph.ImageView", "qtpy.QtWidgets.QVBoxLayout", "numpy.percentile", "qtpy.QtWidgets.QWidget", "collections.namedtuple", "collections.OrderedDict", "pyqtgraph.ImageItem" ]
[((244, 321), 'collections.namedtuple', 'namedtuple', (['"""AvailChan"""', "['type_', 'index', 'phys_chan', 'chan_name', 'term']"], {}), "('AvailChan', ['type_', 'index', 'phys_chan', 'chan_name', 'term'])\n", (254, 321), False, 'from collections import namedtuple, OrderedDict\n'), ((976, 995), 'qtpy.QtWidgets.QWidget'...
# -*- coding: utf-8 -*- """ GripIt - UCF, Edge Base Gripper Implementation """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from builtins import super from builtins import range from builtins import int from builtins...
[ "gripit.gui.ImageViewerQt.ImageViewerQt", "PyQt5.QtGui.QColor", "PyQt5.QtWidgets.QGridLayout", "future.standard_library.install_aliases", "PyQt5.QtGui.QWidget", "pyqtgraph.ImageView", "PyQt5.QtWidgets.QVBoxLayout", "PyQt5.QtCore.QLineF", "PyQt5.QtGui.QScrollArea", "builtins.range", "gripit.core....
[((368, 402), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (400, 402), False, 'from future import standard_library\n'), ((33435, 33463), 'PyQt5.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (33453, 33463), True, 'import PyQt5.QtGui as ...
''' Wrapper for gender recognition model ''' import cv2 import mxnet as mx import numpy as np class GenderClassifier: ''' Interface for gender classification model. Must implement the predict() method. predict() must accept an image (np.ndarray) as argument. ''' def __init__(self): ...
[ "numpy.transpose", "mxnet.mod.Module", "numpy.expand_dims", "mxnet.cpu", "mxnet.nd.array", "mxnet.model.load_checkpoint", "cv2.resize" ]
[((1049, 1057), 'mxnet.cpu', 'mx.cpu', ([], {}), '()\n', (1055, 1057), True, 'import mxnet as mx\n'), ((1325, 1364), 'mxnet.model.load_checkpoint', 'mx.model.load_checkpoint', (['prefix', 'epoch'], {}), '(prefix, epoch)\n', (1349, 1364), True, 'import mxnet as mx\n'), ((1479, 1614), 'mxnet.mod.Module', 'mx.mod.Module',...
from typing import List import modelkit import numpy as np class Vectorizer(modelkit.Model[List[str], List[int]]): CONFIGURATIONS = { "imdb_vectorizer": {"asset": "imdb/vectorizer:0.0[/vocabulary.txt]"} } TEST_CASES = [ {"item": [], "result": []}, {"item": [], "keyword_args": {"le...
[ "numpy.array", "numpy.zeros", "numpy.delete" ]
[((1903, 1919), 'numpy.zeros', 'np.zeros', (['length'], {}), '(length)\n', (1911, 1919), True, 'import numpy as np\n'), ((1685, 1708), 'numpy.array', 'np.array', (['[]'], {'dtype': 'int'}), '([], dtype=int)\n', (1693, 1708), True, 'import numpy as np\n'), ((1785, 1823), 'numpy.delete', 'np.delete', (['vectorized', '(ve...
# -*- coding: utf-8 -*- import shutil from functools import lru_cache import numpy as np from ncc.data.constants import DEFAULT_MAX_TARGET_POSITIONS from ncc.utils.file_ops import file_io from ncc.utils.path_manager import PathManager from .mmap_indexed_dataset import MMapIndexedDatasetBuilder from ..ncc_dataset impo...
[ "numpy.frombuffer", "numpy.clip", "numpy.array", "functools.lru_cache", "shutil.copyfileobj", "numpy.concatenate" ]
[((1099, 1119), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(8)'}), '(maxsize=8)\n', (1108, 1119), False, 'from functools import lru_cache\n'), ((1647, 1691), 'numpy.concatenate', 'np.concatenate', (['[self._data, new_data._data]'], {}), '([self._data, new_data._data])\n', (1661, 1691), True, 'import numpy as...
from torch.utils.data import Dataset from imgaug.augmentables.kps import Keypoint, KeypointsOnImage import numpy as np from Utils import * import imgaug.augmenters as iaa import imgaug.augmentables.kps import cv2 import random import yaml import torchfile import scipy.io from pathlib import Path class Database(Datase...
[ "imgaug.augmentables.kps.Keypoint", "yaml.load", "cv2.cvtColor", "torchfile.load", "numpy.ones", "imgaug.augmenters.Resize", "numpy.expand_dims", "numpy.argsort", "imgaug.augmenters.Affine", "random.random", "pathlib.Path", "numpy.array", "imgaug.augmentables.kps.KeypointsOnImage", "cv2.re...
[((835, 873), 'imgaug.augmenters.Affine', 'iaa.Affine', ([], {'scale': "{'x': 1.3, 'y': 1.3}"}), "(scale={'x': 1.3, 'y': 1.3})\n", (845, 873), True, 'import imgaug.augmenters as iaa\n'), ((913, 951), 'imgaug.augmenters.Affine', 'iaa.Affine', ([], {'scale': "{'x': 1.6, 'y': 1.6}"}), "(scale={'x': 1.6, 'y': 1.6})\n", (92...
from resnap.benchmark.structure import Structure from pymatgen.io.lammps.outputs import parse_lammps_log import numpy as np import argparse import os import sys import shutil import time import math """ This module implements a core class ElasticJob that support lammps data/imput/log files i/o for calculating elastic...
[ "os.mkdir", "argparse.ArgumentParser", "math.sqrt", "os.getcwd", "os.system", "time.sleep", "numpy.arange", "pymatgen.io.lammps.outputs.parse_lammps_log", "numpy.eye", "resnap.benchmark.structure.Structure", "os.chdir", "shutil.copy" ]
[((5548, 5573), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5571, 5573), False, 'import argparse\n'), ((827, 861), 'numpy.arange', 'np.arange', (['etamin', 'etamax', 'etastep'], {}), '(etamin, etamax, etastep)\n', (836, 861), True, 'import numpy as np\n'), ((1022, 1046), 'os.chdir', 'os.chd...
import torch from torch._C import device import torch.nn as nn import numpy as np import random BATCH_SIZE = 256 GAMMA = 0.99 INITIAL_EPSILON = 1 DECAY_RATE = 1 REPLAY_SIZE = 50000 TAU = 0.02 TARGET_NETWORK_REPLACE_FREQ = 100 # 网络更新频率 np.random.seed(2) torch.manual_seed(2) random.seed(2) class NET(nn.Module): # 神经...
[ "torch.nn.MSELoss", "numpy.random.seed", "torch.nn.ReLU", "random.randint", "numpy.argmax", "random.sample", "torch.manual_seed", "torch.load", "random.random", "random.seed", "numpy.array", "torch.nn.Linear", "torch.device", "torch.tensor", "torch.from_numpy" ]
[((237, 254), 'numpy.random.seed', 'np.random.seed', (['(2)'], {}), '(2)\n', (251, 254), True, 'import numpy as np\n'), ((255, 275), 'torch.manual_seed', 'torch.manual_seed', (['(2)'], {}), '(2)\n', (272, 275), False, 'import torch\n'), ((276, 290), 'random.seed', 'random.seed', (['(2)'], {}), '(2)\n', (287, 290), Fals...
"""Module for global optimization using the Neighbourhood algorithm. """ from pytomo.inversion.inversionresult import InversionResult from pytomo.inversion import modelutils from pytomo.inversion.umcutils import UniformMonteCarlo from pytomo.inversion.umcutils import get_best_models, process_outputs import pytomo.inv...
[ "os.mkdir", "numpy.abs", "numpy.empty", "numpy.allclose", "numpy.random.default_rng", "os.path.join", "dsmpy.windowmaker.WindowMaker.windows_from_dataset", "numpy.zeros_like", "matplotlib.pyplot.close", "pytomo.utilities.get_temporary_str", "dsmpy.dsm.compute_models_parallel", "pytomo.inversio...
[((7853, 7880), 'numpy.random.default_rng', 'np.random.default_rng', (['seed'], {}), '(seed)\n', (7874, 7880), True, 'import numpy as np\n'), ((8129, 8168), 'os.path.join', 'os.path.join', (['self.out_dir', 'result_path'], {}), '(self.out_dir, result_path)\n', (8141, 8168), False, 'import os\n'), ((12129, 12239), 'pyto...
import numpy as np def calc_optimal_grid(n): # Try to distribute n images as best as possible # For now: simple overestimation sides = int(np.ceil(np.sqrt(n))) return sides, sides
[ "numpy.sqrt" ]
[((160, 170), 'numpy.sqrt', 'np.sqrt', (['n'], {}), '(n)\n', (167, 170), True, 'import numpy as np\n')]
#!/usr/bin/python # nlantau, 2021-11-01 import numpy as np def snail(m): f=[] if len(m) < 1: return [[]] m = np.array(m) f.extend(m[0]) while True: if len(m[0]) < 1: break m = np.rot90(np.delete(m, 0, 0)) f.extend(m[0]) return f a = [ ...
[ "numpy.array", "numpy.delete" ]
[((131, 142), 'numpy.array', 'np.array', (['m'], {}), '(m)\n', (139, 142), True, 'import numpy as np\n'), ((244, 262), 'numpy.delete', 'np.delete', (['m', '(0)', '(0)'], {}), '(m, 0, 0)\n', (253, 262), True, 'import numpy as np\n')]
import sys sys.path.append("../src") import numpy as np import tensorflow as tf from sklearn.model_selection import cross_val_score from sklearn.linear_model import LogisticRegression from sklearn.neural_network import MLPClassifier import h5py import os from draw import DRAW from counter import * print("PID :",...
[ "sys.path.append", "numpy.load", "h5py.File", "os.getpid", "draw.DRAW", "sklearn.model_selection.cross_val_score", "numpy.zeros", "numpy.isnan", "sklearn.linear_model.LogisticRegression", "numpy.arange", "numpy.array", "numpy.linspace", "sklearn.neural_network.MLPClassifier", "tensorflow.I...
[((12, 37), 'sys.path.append', 'sys.path.append', (['"""../src"""'], {}), "('../src')\n", (27, 37), False, 'import sys\n'), ((1227, 1268), 'numpy.load', 'np.load', (['"""../data/processed/all_0130.npy"""'], {}), "('../data/processed/all_0130.npy')\n", (1234, 1268), True, 'import numpy as np\n'), ((1282, 1320), 'numpy.l...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : Nov-20-20 16:16 # @Author : <NAME> (<EMAIL>) # @RefLink : https://www.tensorflow.org/api_docs/python/tf/keras/metrics/Metric?version=nightly import tensorflow as tf class ClassTruePositives(tf.keras.metrics.Metric): def __init__(self, name='binary_tru...
[ "tensorflow.reduce_sum", "numpy.asarray", "tensorflow.cast", "tensorflow.multiply", "tensorflow.broadcast_to", "tensorflow.equal" ]
[((2148, 2172), 'numpy.asarray', 'np.asarray', (['[1, 1, 0, 0]'], {}), '([1, 1, 0, 0])\n', (2158, 2172), True, 'import numpy as np\n'), ((2186, 2216), 'numpy.asarray', 'np.asarray', (['[0.981, 1, 0, 0.6]'], {}), '([0.981, 1, 0, 0.6])\n', (2196, 2216), True, 'import numpy as np\n'), ((576, 600), 'tensorflow.cast', 'tf.c...
import os import glob import numpy as np import xarray as xr from ..archive import archive from ..core.remo_ds import preprocess as remo_preprocess from ..core import codes soil_temps = ['TS', 'TSL', 'TEMP2', 'TSN', 'TD3', 'TD4', 'TD5'] def open_mfdataset(files, use_cftime=True, parallel=True, data_vars='minimal'...
[ "xarray.decode_cf", "xesmf.Regridder", "numpy.deg2rad", "xarray.open_dataset", "xarray.concat", "xarray.merge", "xarray.DataArray", "glob.glob", "xarray.open_mfdataset", "os.path.join" ]
[((648, 862), 'xarray.open_mfdataset', 'xr.open_mfdataset', (['files'], {'parallel': 'parallel', 'decode_times': '(False)', 'combine': '"""by_coords"""', 'preprocess': 'drop_all_coords', 'decode_cf': '(False)', 'chunks': 'chunks', 'data_vars': 'data_vars', 'coords': 'coords', 'compat': 'compat'}), "(files, parallel=par...
"""Implemenets helpers for analtyical solution.""" import numpy as np import torch from gaussian_sharing.model.analytical_model import AnalyticStructBiasModel from gaussian_sharing.model.build import StructBiasModel from struct_discovery.solver.hypergrad import implicit_function from gaussian_sharing.data import hel...
[ "numpy.zeros", "struct_discovery.solver.hypergrad.implicit_function.compute_hypergrad", "gaussian_sharing.model.build.StructBiasModel", "numpy.arange", "gaussian_sharing.model.analytical_model.AnalyticStructBiasModel", "torch.zeros", "numpy.eye", "torch.reshape", "torch.no_grad", "torch.log", "n...
[((1611, 1623), 'numpy.eye', 'np.eye', (['kdim'], {}), '(kdim)\n', (1617, 1623), True, 'import numpy as np\n'), ((1645, 1686), 'numpy.concatenate', 'np.concatenate', (['[train_data, val_data]', '(0)'], {}), '([train_data, val_data], 0)\n', (1659, 1686), True, 'import numpy as np\n'), ((1731, 1807), 'gaussian_sharing.mo...
from collections import namedtuple import pickle import gym import ptan from ptan.agent import float32_preprocessor import torch import numpy as np from util import PGN GAMMA = 0.99 NUM_TRAJS = 100 EpisodeStep = namedtuple('EpisodeStep', field_names=['state', 'action', 'reward', 'next_state']) Trajecto...
[ "pickle.dump", "gym.make", "ptan.agent.float32_preprocessor", "torch.load", "util.PGN", "numpy.prod", "collections.namedtuple", "ptan.agent.PolicyAgent", "ptan.experience.ExperienceSourceFirstLast" ]
[((228, 314), 'collections.namedtuple', 'namedtuple', (['"""EpisodeStep"""'], {'field_names': "['state', 'action', 'reward', 'next_state']"}), "('EpisodeStep', field_names=['state', 'action', 'reward',\n 'next_state'])\n", (238, 314), False, 'from collections import namedtuple\n'), ((325, 388), 'collections.namedtup...
import sys sys.path.insert(0, '..') import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder from config.config import * from utils.common_util import * def fill_targets(row): row.Target = np.array(row.Target.split(" ")).astype(np.int) for num in row.Target: name = LABEL_N...
[ "numpy.unique", "sys.path.insert", "sklearn.preprocessing.LabelEncoder" ]
[((11, 35), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (26, 35), False, 'import sys\n'), ((895, 909), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (907, 909), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((395, 416), 'numpy.unique', 'np.uniq...
import numba as nb import numpy as np import pandas as pd from sid.shared import boolean_choices from sid.time import get_date from src.shared import from_epochs_to_timestamps IS_POSITIVE_CASE = ( "knows_infectious | (knows_immune & symptomatic) " "| (knows_immune & (cd_received_test_result_true >= -13))" ) ...
[ "numpy.random.uniform", "numpy.random.seed", "sid.time.get_date", "numpy.zeros", "pandas.CategoricalDtype", "src.shared.from_epochs_to_timestamps", "pandas.Series", "sid.shared.boolean_choices" ]
[((1205, 1221), 'sid.time.get_date', 'get_date', (['states'], {}), '(states)\n', (1213, 1221), False, 'from sid.time import get_date\n'), ((2460, 2476), 'sid.time.get_date', 'get_date', (['states'], {}), '(states)\n', (2468, 2476), False, 'from sid.time import get_date\n'), ((4781, 4797), 'sid.time.get_date', 'get_date...
""" The :mod:'atml.measure' module contains a set of common evaluation measures for predictive machine learning tasks. """ # Author: <NAME> (<EMAIL>) # License: BSD-3 import numpy import scipy.integrate tiny = numpy.finfo('float64').tiny class Measure: """ The base measure class, and specifies...
[ "numpy.sum", "numpy.log", "numpy.argmax", "numpy.zeros", "numpy.shape", "numpy.finfo", "numpy.histogram", "numpy.cumsum", "numpy.unique" ]
[((221, 243), 'numpy.finfo', 'numpy.finfo', (['"""float64"""'], {}), "('float64')\n", (232, 243), False, 'import numpy\n'), ((1229, 1273), 'numpy.unique', 'numpy.unique', (['(1 - s[:, self.target_positive])'], {}), '(1 - s[:, self.target_positive])\n', (1241, 1273), False, 'import numpy\n'), ((3039, 3058), 'numpy.zeros...
import argparse as ap import numpy as np import os """ python match_labels.py --data_source_path /media/data_0/fra/gctd/Data_Sources/ramsey_nj/seed_data_source """ parser = ap.ArgumentParser() parser.add_argument('--data_source_path', default='C:/Users/Public/fra-gctd-project/Data_Sources/' ...
[ "numpy.load", "argparse.ArgumentParser", "os.path.basename", "numpy.bitwise_not", "numpy.equal", "os.path.join", "os.listdir", "numpy.all" ]
[((175, 194), 'argparse.ArgumentParser', 'ap.ArgumentParser', ([], {}), '()\n', (192, 194), True, 'import argparse as ap\n'), ((421, 466), 'os.path.join', 'os.path.join', (['args.data_source_path', '"""labels"""'], {}), "(args.data_source_path, 'labels')\n", (433, 466), False, 'import os\n'), ((487, 533), 'os.path.join...
# Example for numObsInSurveyTimeOverlap # <NAME> - Lehigh University # Last edited : 10/21/2020 # Calculates number of observations during simultaneous windows of another survey. # SurveyObsWin is the list of the survey observing window/inter-seasonal gap intervals. It should be in the format: # SurveyObsWin = [ [YYYY-...
[ "astropy.time.Time", "numpy.size", "numpy.where" ]
[((1109, 1140), 'astropy.time.Time', 'Time', (["(interval[0] + ' 00:00:00')"], {}), "(interval[0] + ' 00:00:00')\n", (1113, 1140), False, 'from astropy.time import Time\n'), ((1166, 1197), 'astropy.time.Time', 'Time', (["(interval[1] + ' 00:00:00')"], {}), "(interval[1] + ' 00:00:00')\n", (1170, 1197), False, 'from ast...
import pysam from math import ceil import pandas as pd import numpy as np from collections import Counter from scipy.stats import entropy class Phaser: def __init__(self,splitter,sampleName, aggressive=False,log=None): self.sampleName = sampleName #sample name self.aggressive = a...
[ "numpy.all" ]
[((9664, 9700), 'numpy.all', 'np.all', (["[(s == '.') for p, s in spl]"], {}), "([(s == '.') for p, s in spl])\n", (9670, 9700), True, 'import numpy as np\n')]
import numpy as np class Initializer(): def fill(self, layer_dims): raise NotImplementedError() class RandomInit(Initializer): def fill(self, layer_dims): np.random.seed(1) parameters = {} L = len(layer_dims) # number of layers in the network for l in range(1, L): ...
[ "numpy.zeros", "numpy.sqrt", "numpy.random.seed", "numpy.random.randn" ]
[((184, 201), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (198, 201), True, 'import numpy as np\n'), ((744, 761), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (758, 761), True, 'import numpy as np\n'), ((1335, 1352), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (13...
"""Exponential distribution """ import numpy as np from scipy.stats import expon from xgboost_distribution.distributions.base import BaseDistribution from xgboost_distribution.distributions.utils import check_is_ge_zero class Exponential(BaseDistribution): """Exponential distribution with log score Definiti...
[ "scipy.stats.expon.logpdf", "numpy.mean", "numpy.exp", "xgboost_distribution.distributions.utils.check_is_ge_zero", "numpy.linalg.solve" ]
[((855, 874), 'xgboost_distribution.distributions.utils.check_is_ge_zero', 'check_is_ge_zero', (['y'], {}), '(y)\n', (871, 874), False, 'from xgboost_distribution.distributions.utils import check_is_ge_zero\n'), ((1620, 1637), 'numpy.exp', 'np.exp', (['log_scale'], {}), '(log_scale)\n', (1626, 1637), True, 'import nump...
import numpy arrayIn = numpy.arange(6) print(arrayIn) it = numpy.nditer(arrayIn, op_flags=['readwrite']) my_sum = 0 for num in it: my_sum = my_sum + num num[...] = my_sum print(arrayIn)
[ "numpy.nditer", "numpy.arange" ]
[((24, 39), 'numpy.arange', 'numpy.arange', (['(6)'], {}), '(6)\n', (36, 39), False, 'import numpy\n'), ((60, 105), 'numpy.nditer', 'numpy.nditer', (['arrayIn'], {'op_flags': "['readwrite']"}), "(arrayIn, op_flags=['readwrite'])\n", (72, 105), False, 'import numpy\n')]
# -------------- #Importing header files import pandas as pd import scipy.stats as stats import math import numpy as np import matplotlib.pyplot as plt from statsmodels.stats.weightstats import ztest from statsmodels.stats.weightstats import ztest from scipy.stats import chi2_contingency import warnings w...
[ "scipy.stats.norm.ppf", "matplotlib.pyplot.title", "matplotlib.pyplot.hist", "warnings.filterwarnings", "pandas.read_csv", "scipy.stats.chi2.ppf", "numpy.mean", "scipy.stats.chi2_contingency", "statsmodels.stats.weightstats.ztest", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy...
[((319, 352), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (342, 352), False, 'import warnings\n'), ((420, 442), 'scipy.stats.norm.ppf', 'stats.norm.ppf', ([], {'q': '(0.95)'}), '(q=0.95)\n', (434, 442), True, 'import scipy.stats as stats\n'), ((485, 513), 'scipy.stats.c...
# # Copyright (c) Microsoft Corporation. # # # Methods for compressing a network using an ensemble of interpolants # import sys import numpy as np from .model_mgr import DataModel from .bayesitp import interpolant, params as itp_params from .error import BadParameter,Error, filter_params from .itp import output_categ...
[ "numpy.compress", "numpy.count_nonzero" ]
[((1653, 1686), 'numpy.compress', 'np.compress', (['pred', 'inputs'], {'axis': '(0)'}), '(pred, inputs, axis=0)\n', (1664, 1686), True, 'import numpy as np\n'), ((1612, 1634), 'numpy.count_nonzero', 'np.count_nonzero', (['pred'], {}), '(pred)\n', (1628, 1634), True, 'import numpy as np\n'), ((1319, 1341), 'numpy.count_...
from __future__ import print_function, division import re import sys import os import gensim.models from gensim.test.utils import datapath, get_tmpfile from gensim.scripts.glove2word2vec import glove2word2vec import argparse import json import numpy as np import scipy.sparse import warnings from sklearn.decomposition i...
[ "json.load", "argparse.ArgumentParser", "warnings.filterwarnings", "numpy.array", "numpy.linalg.norm", "sklearn.decomposition.PCA", "re.search" ]
[((3649, 3681), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': 'num_components'}), '(n_components=num_components)\n', (3652, 3681), False, 'from sklearn.decomposition import PCA\n'), ((8021, 8046), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (8044, 8046), False, 'import argparse\n...
# coding: utf-8 # In[1]: "Get Packages" import numpy as np #numpy package import pandas as pd #pandas package import matplotlib.pyplot as plt #matplotlib for plotting from sklearn import preprocessing #preprocessing get_ipython().magic('matplotlib inline') # In[11]: "Get Data" train = pd.read_csv("train.csv") tra...
[ "pandas.read_csv", "numpy.cumsum", "matplotlib.pyplot.figure", "numpy.isnan" ]
[((292, 316), 'pandas.read_csv', 'pd.read_csv', (['"""train.csv"""'], {}), "('train.csv')\n", (303, 316), True, 'import pandas as pd\n'), ((358, 381), 'pandas.read_csv', 'pd.read_csv', (['"""test.csv"""'], {}), "('test.csv')\n", (369, 381), True, 'import pandas as pd\n'), ((1577, 1604), 'matplotlib.pyplot.figure', 'plt...