code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#! /usr/bin/env python3
"""
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 wri... | [
"os.makedirs",
"os.path.isdir",
"absl.flags.mark_flag_as_required",
"yacos.info.compy.LLVMIR2VecBuilder",
"absl.flags.DEFINE_string",
"numpy.savez_compressed",
"absl.app.run",
"yacos.info.compy.extractors.LLVMDriver",
"os.path.join",
"os.listdir",
"sys.exit"
] | [((1023, 1037), 'yacos.info.compy.extractors.LLVMDriver', 'LLVMDriver', (['[]'], {}), '([])\n', (1033, 1037), False, 'from yacos.info.compy.extractors import LLVMDriver\n'), ((1083, 1110), 'yacos.info.compy.LLVMIR2VecBuilder', 'R.LLVMIR2VecBuilder', (['driver'], {}), '(driver)\n', (1102, 1110), True, 'from yacos.info i... |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# Author <NAME>
# E-mail <EMAIL>
# License MIT
# Created 03/11/2016
# Updated 11/12/2016
# Version 1.0.0
#
"""
Description of classify.py
======================
save train & test in files
read train & test
for list of classifier
train/test
gather resul... | [
"sys.stdout.write",
"matplotlib.pyplot.title",
"utils.print_info",
"argparse.ArgumentParser",
"sklearn.metrics.accuracy_score",
"joblib.dump",
"sklearn.tree.DecisionTreeClassifier",
"matplotlib.pyplot.figure",
"sklearn.metrics.f1_score",
"numpy.arange",
"matplotlib.pyplot.gca",
"sklearn.svm.SV... | [((3293, 3309), 'sklearn.utils.testing.all_estimators', 'all_estimators', ([], {}), '()\n', (3307, 3309), False, 'from sklearn.utils.testing import all_estimators\n'), ((3757, 3786), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(10, 6)'}), '(figsize=(10, 6))\n', (3769, 3786), True, 'import matplotlib... |
import numpy as np
import pandas as pd
from .nlp_utils.classifier import NaiveBayesClassifier
from .nlp_utils.tokenizer import NGramTokenizer
DATASET_PATH = 'spam_filter/data/spam.csv'
def preprocess_data():
dataset = pd.read_csv(DATASET_PATH, encoding='latin-1')
dataset.rename(columns={'v1': 'labels', 'v2'... | [
"pandas.read_csv",
"numpy.random.uniform"
] | [((226, 271), 'pandas.read_csv', 'pd.read_csv', (['DATASET_PATH'], {'encoding': '"""latin-1"""'}), "(DATASET_PATH, encoding='latin-1')\n", (237, 271), True, 'import pandas as pd\n'), ((558, 581), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (575, 581), True, 'import numpy as np\n')] |
import numpy as np
import cv2
# Translation is the shifting of objects location. If you know the shift in
# (x,y) direction, let it be (t_x,t_y), you can create the transformation matrix
# M as follows:
#
# M = | 1 0 t_x |
# | 0 1 t_y |
#
# You'll need to make it into a Numpy array of type np.floa... | [
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.float32",
"cv2.imread",
"cv2.warpAffine",
"cv2.imshow"
] | [((377, 411), 'cv2.imread', 'cv2.imread', (['"""images/saturn.png"""', '(0)'], {}), "('images/saturn.png', 0)\n", (387, 411), False, 'import cv2\n'), ((475, 529), 'numpy.float32', 'np.float32', (['[[1, 0, translate_x], [0, 1, translate_y]]'], {}), '([[1, 0, translate_x], [0, 1, translate_y]])\n', (485, 529), True, 'imp... |
import os
import pandas as pd
import pdb
import seaborn as sns
import matplotlib.pyplot as plt
#import pymrmr
from scipy.stats import kendalltau, pearsonr, spearmanr
from sklearn.feature_selection import SelectKBest, mutual_info_classif, chi2, f_classif, RFE
import numpy as np
# Feature Importance Sklearn
# https://ma... | [
"pandas.DataFrame",
"numpy.sum",
"seaborn.heatmap",
"matplotlib.pyplot.show",
"sklearn.feature_selection.RFE",
"scipy.stats.spearmanr",
"scipy.stats.pearsonr",
"matplotlib.pyplot.figure",
"pdb.set_trace",
"scipy.stats.kendalltau",
"sklearn.feature_selection.SelectKBest",
"pandas.concat"
] | [((804, 881), 'pandas.DataFrame', 'pd.DataFrame', (["{'column_name': df.columns, 'percent_missing': percent_missing}"], {}), "({'column_name': df.columns, 'percent_missing': percent_missing})\n", (816, 881), True, 'import pandas as pd\n'), ((1598, 1665), 'sklearn.feature_selection.SelectKBest', 'SelectKBest', ([], {'sc... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 30 07:05:07 2018
@author: massimo
"""
from brightway2 import *
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from scipy import stats
projects
projects.set_current('bw2_import_ecoinvent_3.4')
databases
db = Database("... | [
"pandas.DataFrame",
"numpy.log",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.hist",
"scipy.stats.ttest_rel",
"scipy.stats.shapiro",
"matplotlib.pyplot.ylabel",
"scipy.stats.wilcoxon",
"matplotlib.pyplot.xlabel"
] | [((646, 680), 'matplotlib.pyplot.hist', 'plt.hist', (['mc_results'], {'density': '(True)'}), '(mc_results, density=True)\n', (654, 680), True, 'from matplotlib import pyplot as plt\n'), ((681, 706), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""Probability"""'], {}), "('Probability')\n", (691, 706), True, 'from matpl... |
from network import Regressor, Loss_gamma_0_6
import numpy as np
import skorch
from skorch import NeuralNetRegressor
from torch import optim
def load_model(load_cp, n_in=106,device='cuda'):
cp = skorch.callbacks.Checkpoint(dirname=load_cp)
net = NeuralNetRegressor(
Regressor(n_in=n_in),
criter... | [
"skorch.callbacks.Checkpoint",
"numpy.save",
"network.Regressor"
] | [((201, 245), 'skorch.callbacks.Checkpoint', 'skorch.callbacks.Checkpoint', ([], {'dirname': 'load_cp'}), '(dirname=load_cp)\n', (228, 245), False, 'import skorch\n'), ((1112, 1145), 'numpy.save', 'np.save', (['"""model_paras.npy"""', 'paras'], {}), "('model_paras.npy', paras)\n", (1119, 1145), True, 'import numpy as n... |
import numpy as np
from gensim.models import Word2Vec
from src.utils import io
def run(
random_walk_files, output_file, dimensions=128, context_size=10, epochs=1, workers=1
):
"""Generates node vector embeddings from a list of files containing random
walks performed on different layers of a multilayer net... | [
"src.utils.io.read_random_walks",
"gensim.models.Word2Vec",
"numpy.split"
] | [((1109, 1140), 'numpy.split', 'np.split', (['walks', 'walks.shape[0]'], {}), '(walks, walks.shape[0])\n', (1117, 1140), True, 'import numpy as np\n'), ((1248, 1360), 'gensim.models.Word2Vec', 'Word2Vec', (['walks_trim'], {'size': 'dimensions', 'window': 'context_size', 'min_count': '(0)', 'sg': '(1)', 'workers': 'work... |
import numpy as np
import abc
class ProbabilityDistribution(abc.ABC):
"""
Class representing the interface for a probability distribution
"""
@abc.abstractmethod
def sample(self, size):
"""
This method must return an array with length "size", sampling the distribution
# A... | [
"numpy.random.normal",
"numpy.fromiter"
] | [((987, 1032), 'numpy.random.normal', 'np.random.normal', (['self._mean', 'self._std', 'size'], {}), '(self._mean, self._std, size)\n', (1003, 1032), True, 'import numpy as np\n'), ((2570, 2607), 'numpy.fromiter', 'np.fromiter', (['values'], {'dtype': 'np.float64'}), '(values, dtype=np.float64)\n', (2581, 2607), True, ... |
import tensorflow as tf
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import copy
from morphodynamics.landscapes.utils import get_meshgrid
from morphodynamics.landscapes.analysis.get_fields import *
from morphodynamics.landscapes.analy... | [
"copy.deepcopy",
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"numpy.log10",
"matplotlib.pyplot.figure",
"matplotlib.use",
"numpy.array",
"morphodynamics.landscapes.utils.get_meshgrid",
"numpy.reshape",
"numpy.linspace",
"numpy.max",
"matplotlib.gridspec.GridSpec",
"numpy.gradient",
... | [((61, 82), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (75, 82), False, 'import matplotlib\n'), ((725, 790), 'morphodynamics.landscapes.utils.get_meshgrid', 'get_meshgrid', (['model.xlims', 'model.ylims', 'model.dims'], {'flatBool': '(True)'}), '(model.xlims, model.ylims, model.dims, flatBool... |
import numpy as np
import inspect
from scipy.linalg import qr as qr_factorization
from copy import deepcopy
from pyapprox.utilities import cartesian_product, outer_product
from pyapprox.univariate_polynomials.quadrature import gauss_jacobi_pts_wts_1D
from pyapprox.barycentric_interpolation import (
compute_barycen... | [
"numpy.empty",
"pyapprox.utilities.qr_solve",
"numpy.ones",
"numpy.linalg.cond",
"pyapprox.barycentric_interpolation.compute_barycentric_weights_1d",
"numpy.arange",
"pyapprox.utilities.cartesian_product",
"numpy.linalg.solve",
"numpy.atleast_2d",
"pylab.plot",
"numpy.kron",
"numpy.linspace",
... | [((807, 858), 'numpy.empty', 'np.empty', (['(matrix_num_rows, matrix_num_rows)', 'float'], {}), '((matrix_num_rows, matrix_num_rows), float)\n', (815, 858), True, 'import numpy as np\n'), ((1327, 1347), 'numpy.array', 'np.array', (['[1]', 'float'], {}), '([1], float)\n', (1335, 1347), True, 'import numpy as np\n'), ((1... |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as img
from sklearn.decomposition import TruncatedSVD
"""
打个比方说一张女人图片,我们如何判定这个女人是不是美女呢。我们会看比较关键的一些特征,比如说脸好不好看,胸好不好看,屁股怎么样,腿怎么样,至于衣服上是某个花纹还是手臂上有一个小痔还是,这些特征我们都是不关心的,就可以过滤掉。我们关心的是主成分,也就是对结果贡献系数较大的特征。SVD算法的作用就是来告诉你哪些特征是重要的,... | [
"numpy.dstack",
"matplotlib.image.imread",
"matplotlib.pyplot.show",
"sklearn.decomposition.TruncatedSVD",
"matplotlib.pyplot.imshow",
"numpy.array",
"numpy.reshape"
] | [((511, 534), 'matplotlib.image.imread', 'img.imread', (['"""test2.png"""'], {}), "('test2.png')\n", (521, 534), True, 'import matplotlib.image as img\n'), ((676, 695), 'numpy.array', 'np.array', (['img_array'], {}), '(img_array)\n', (684, 695), True, 'import numpy as np\n'), ((1170, 1187), 'numpy.dstack', 'np.dstack',... |
from scipy.stats import uniform
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
from scipy.stats import exponweib
def calculate_parameters(interarrivals):
sample = np.array(interarrivals)
x = np.linspace(0, 1 - 1 / sample.shape[0], sample.shape[0])
x = x[sample > 0... | [
"matplotlib.pyplot.show",
"numpy.log",
"matplotlib.pyplot.twinx",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"scipy.stats.exponweib",
"matplotlib.pyplot.subplots"
] | [((211, 234), 'numpy.array', 'np.array', (['interarrivals'], {}), '(interarrivals)\n', (219, 234), True, 'import numpy as np\n'), ((243, 299), 'numpy.linspace', 'np.linspace', (['(0)', '(1 - 1 / sample.shape[0])', 'sample.shape[0]'], {}), '(0, 1 - 1 / sample.shape[0], sample.shape[0])\n', (254, 299), True, 'import nump... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
import time
# In[2]:
def createGraph(depotNodes ,requiredEdges, numNodes, show=True):
G = nx.Graph()
edges = []
pos = {}
reqPos = {}
s = [1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 6, 7]... | [
"matplotlib.pyplot.show",
"networkx.draw_networkx_edges",
"networkx.dijkstra_path_length",
"matplotlib.pyplot.legend",
"networkx.get_edge_attributes",
"networkx.draw_networkx",
"time.time",
"numpy.argmin",
"networkx.dijkstra_path",
"matplotlib.pyplot.figure",
"networkx.Graph",
"numpy.array",
... | [((221, 231), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (229, 231), True, 'import networkx as nx\n'), ((979, 1014), 'networkx.get_edge_attributes', 'nx.get_edge_attributes', (['G', '"""weight"""'], {}), "(G, 'weight')\n", (1001, 1014), True, 'import networkx as nx\n'), ((1018, 1065), 'networkx.draw_networkx', 'nx... |
import numpy as np
import pandas as pd
import xarray as xr
from shape import BBox
from .mot import Mot
class BboxMot(Mot):
def __init__(self, **kwargs):
"""
Ground truth stored in xarray.Dataset with frame and id coordinates (frames are 0-indexed).
Example:
<xarray.Dataset>
... | [
"shape.BBox.from_xywh",
"os.rename",
"os.path.exists",
"numpy.isnan",
"datetime.datetime.now"
] | [((2848, 2872), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (2862, 2872), False, 'import os\n'), ((2957, 3011), 'os.rename', 'os.rename', (['filename', "(filename[:-4] + '_' + dt + '.txt')"], {}), "(filename, filename[:-4] + '_' + dt + '.txt')\n", (2966, 3011), False, 'import os\n'), ((3730,... |
from __future__ import print_function
from __future__ import division
from builtins import range
from past.utils import old_div
import os
import numpy as num
from anuga.file.netcdf import NetCDFFile
import pylab as P
import anuga
from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular
from anuga.shallow_... | [
"builtins.range",
"anuga.utilities.numerical_tools.ensure_numeric",
"past.utils.old_div",
"numpy.empty",
"anuga.file.sww.Write_sww",
"numpy.zeros",
"numpy.array",
"anuga.pmesh.mesh.Mesh",
"anuga.file.netcdf.NetCDFFile"
] | [((1240, 1274), 'anuga.file.netcdf.NetCDFFile', 'NetCDFFile', (['stsname', 'netcdf_mode_r'], {}), '(stsname, netcdf_mode_r)\n', (1250, 1274), False, 'from anuga.file.netcdf import NetCDFFile\n'), ((1488, 1519), 'numpy.array', 'num.array', (['[x_origin, y_origin]'], {}), '([x_origin, y_origin])\n', (1497, 1519), True, '... |
import pathlib
import pandas as pd
from palmnet.visualization.utils import get_palminized_model_and_df, get_df
import matplotlib.pyplot as plt
import numpy as np
import logging
import plotly.graph_objects as go
import plotly.io as pio
from pprint import pprint as pprint
mpl_logger = logging.getLogger('matplotlib')
mpl... | [
"pandas.read_csv",
"plotly.graph_objects.Figure",
"numpy.isnan",
"pathlib.Path",
"numpy.isclose",
"pprint.pprint",
"pandas.concat",
"logging.getLogger"
] | [((285, 316), 'logging.getLogger', 'logging.getLogger', (['"""matplotlib"""'], {}), "('matplotlib')\n", (302, 316), False, 'import logging\n'), ((1573, 1612), 'pandas.read_csv', 'pd.read_csv', (['src_results_path'], {'header': '(0)'}), '(src_results_path, header=0)\n', (1584, 1612), True, 'import pandas as pd\n'), ((16... |
#****************************************************#
# This file is part of OPTALG. #
# #
# Copyright (c) 2019, <NAME>. #
# #
# OPTALG is released under the BSD 2-clause license. #
#*****... | [
"xml.etree.ElementTree.parse",
"tempfile._get_candidate_names",
"os.remove",
"numpy.zeros",
"os.path.isfile",
"subprocess.call",
"multiprocessing.cpu_count"
] | [((1648, 1672), 'numpy.zeros', 'np.zeros', (['problem.c.size'], {}), '(problem.c.size)\n', (1656, 1672), True, 'import numpy as np\n'), ((1687, 1715), 'numpy.zeros', 'np.zeros', (['problem.A.shape[0]'], {}), '(problem.A.shape[0])\n', (1695, 1715), True, 'import numpy as np\n'), ((1729, 1740), 'numpy.zeros', 'np.zeros',... |
import copy
import os
from functools import reduce
from pathlib import Path
import chainer
import chainer.functions as F
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import six
from chainer import configuration, cuda, function
from chainer import report... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.clf",
"numpy.argmax",
"chainer.reporter.Reporter",
"pathlib.Path",
"chainer.no_backprop_mode",
"numpy.mean",
"six.iteritems",
"pandas.DataFrame",
"chainer.functions.softmax_cross_entropy",
"chainer.functions.sigmoid_cross_entropy",
"chainer.cuda.to... | [((140, 161), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (154, 161), False, 'import matplotlib\n'), ((855, 904), 'sklearn.metrics.roc_curve', 'metrics.roc_curve', ([], {'y_true': 'y_true', 'y_score': 'y_score'}), '(y_true=y_true, y_score=y_score)\n', (872, 904), False, 'from sklearn import me... |
from __future__ import print_function
import numpy
OPENOPT = SCIPY = True
try:
from openopt import NLP
except ImportError:
OPENOPT = False
try:
from scipy.optimize import minimize
except ImportError:
SCIPY = False
SCIPY_LOCAL_SOLVERS = ['Nelder-Mead', 'Powell', 'L-BFGS-B', 'TNC', ... | [
"numpy.random.uniform",
"scipy.optimize.minimize",
"numpy.sum",
"numpy.abs",
"numpy.argmax",
"numpy.asarray",
"os.system",
"numpy.where",
"numpy.linalg.norm",
"numpy.atleast_1d",
"numpy.sqrt"
] | [((4282, 4302), 'numpy.atleast_1d', 'numpy.atleast_1d', (['x0'], {}), '(x0)\n', (4298, 4302), False, 'import numpy\n'), ((5366, 5384), 'numpy.asarray', 'numpy.asarray', (['low'], {}), '(low)\n', (5379, 5384), False, 'import numpy\n'), ((5395, 5412), 'numpy.asarray', 'numpy.asarray', (['up'], {}), '(up)\n', (5408, 5412)... |
# @PascalPuchtler
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# dis... | [
"Controller.MoveController.CarModel.CarModel",
"numpy.clip"
] | [((1120, 1130), 'Controller.MoveController.CarModel.CarModel', 'CarModel', ([], {}), '()\n', (1128, 1130), False, 'from Controller.MoveController.CarModel import CarModel\n'), ((3953, 4012), 'numpy.clip', 'np.clip', (['m', '(-self.maxDriveableSlope)', 'self.maxDriveableSlope'], {}), '(m, -self.maxDriveableSlope, self.m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 27 00:52:19 2018
@author: xavier.qiu
"""
from common.load import *
from common.pd_util import *
from common.preprocess import *
from common.util import *
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_se... | [
"pickle.dump",
"keras.preprocessing.sequence.pad_sequences",
"gc.collect",
"keras.preprocessing.text.Tokenizer",
"pickle.load",
"numpy.random.normal"
] | [((2340, 2352), 'gc.collect', 'gc.collect', ([], {}), '()\n', (2350, 2352), False, 'import gc\n'), ((3345, 3403), 'numpy.random.normal', 'np.random.normal', (['emb_mean', 'emb_std', '(len_voc, embed_size)'], {}), '(emb_mean, emb_std, (len_voc, embed_size))\n', (3361, 3403), True, 'import numpy as np\n'), ((3741, 3786),... |
import numpy as np
# Sizes relevant to default camera frame
ASPECT_RATIO = 16.0 / 9.0
FRAME_HEIGHT = 8.0
FRAME_WIDTH = FRAME_HEIGHT * ASPECT_RATIO
FRAME_Y_RADIUS = FRAME_HEIGHT / 2
FRAME_X_RADIUS = FRAME_WIDTH / 2
DEFAULT_PIXEL_HEIGHT = 1080
DEFAULT_PIXEL_WIDTH = 1920
DEFAULT_FRAME_RATE = 30
SMALL_BUFF = 0.1
MED_SMA... | [
"numpy.array"
] | [((567, 592), 'numpy.array', 'np.array', (['(0.0, 0.0, 0.0)'], {}), '((0.0, 0.0, 0.0))\n', (575, 592), True, 'import numpy as np\n'), ((595, 620), 'numpy.array', 'np.array', (['(0.0, 1.0, 0.0)'], {}), '((0.0, 1.0, 0.0))\n', (603, 620), True, 'import numpy as np\n'), ((625, 651), 'numpy.array', 'np.array', (['(0.0, -1.0... |
import numpy as np
from net import Net
from functional import *
from os import remove
temp_path = "./model/param"
def save_model(net: Net, name: str):
'''
将网络信息保存
parameters
----------
net : 神经网络类
name : 文件名,文件将被保存到model文件夹中的指定名称文件中
return
------
1 : 表示保存成功
'''
path = ".... | [
"os.remove",
"numpy.load",
"numpy.savetxt",
"numpy.zeros",
"net.Net",
"numpy.loadtxt"
] | [((1013, 1030), 'os.remove', 'remove', (['temp_path'], {}), '(temp_path)\n', (1019, 1030), False, 'from os import remove\n'), ((2430, 2447), 'os.remove', 'remove', (['temp_path'], {}), '(temp_path)\n', (2436, 2447), False, 'from os import remove\n'), ((1754, 1828), 'net.Net', 'Net', (['*layer_info'], {'criterion': 'cri... |
import unittest
import numpy as np
from gradient_checker import GradientChecker, create_op
from op_test_util import OpTestMeta
class MinusOpTest(unittest.TestCase):
__metaclass__ = OpTestMeta
def setUp(self):
self.type = "minus"
self.inputs = {
'X': np.random.random((32, 84)).asty... | [
"unittest.main",
"numpy.random.random",
"gradient_checker.create_op"
] | [((816, 831), 'unittest.main', 'unittest.main', ([], {}), '()\n', (829, 831), False, 'import unittest\n'), ((555, 573), 'gradient_checker.create_op', 'create_op', (['"""minus"""'], {}), "('minus')\n", (564, 573), False, 'from gradient_checker import GradientChecker, create_op\n'), ((289, 315), 'numpy.random.random', 'n... |
"""Seek behaviour in Pygame"""
import pygame
import numpy as np
import math
WIDTH,HEIGHT = 700,400
screen = pygame.display.set_mode((WIDTH,HEIGHT))
class Seeker():
def __init__(self,x,y):
super().__init__()
self.pos=np.array([x,y])
self.vel=np.array([0,0])
self.acc=n... | [
"numpy.multiply",
"pygame.draw.circle",
"numpy.subtract",
"math.sqrt",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.init",
"pygame.mouse.get_pos",
"pygame.display.update",
"numpy.array",
"numpy.add"
] | [((117, 157), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(WIDTH, HEIGHT)'], {}), '((WIDTH, HEIGHT))\n', (140, 157), False, 'import pygame\n'), ((1196, 1209), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1207, 1209), False, 'import pygame\n'), ((1145, 1195), 'pygame.draw.circle', 'pygame.draw.circle', ... |
import os
import collections
import pdb
import gym
import gym.envs.mujoco
import time
import csv
import json
import shutil
import numpy as np
import random
from . import ant_env
from . import proprioceptive_humanoid_env
from . import maze_ant
from . import maze_humanoid
# Wrapper that records everything we might care ... | [
"numpy.zeros",
"json.dumps",
"time.time",
"numpy.mean",
"collections.OrderedDict",
"shutil.copyfile",
"os.path.join",
"csv.DictWriter"
] | [((702, 713), 'time.time', 'time.time', ([], {}), '()\n', (711, 713), False, 'import time\n'), ((3162, 3187), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (3185, 3187), False, 'import collections\n'), ((5319, 5366), 'csv.DictWriter', 'csv.DictWriter', (['self.ep_f'], {'fieldnames': 'ep_fields... |
import json
from sklearn.metrics import mean_squared_error, mean_absolute_error
import numpy as np
from model import Dfembeding
from sklearn.kernel_ridge import KernelRidge
import torch
from PIL import Image
from utils import *
import csv
import torch.utils.data as data
import pandas as pd
def mean_absol... | [
"json.load",
"numpy.abs",
"csv.writer",
"torch.utils.data.DataLoader",
"numpy.std",
"sklearn.kernel_ridge.KernelRidge",
"pandas.read_csv",
"torch.load",
"model.Dfembeding",
"sklearn.metrics.mean_absolute_error",
"numpy.append",
"numpy.mean",
"numpy.array",
"torch.device"
] | [((5043, 5061), 'numpy.mean', 'np.mean', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (5050, 5061), True, 'import numpy as np\n'), ((5073, 5090), 'numpy.std', 'np.std', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (5079, 5090), True, 'import numpy as np\n'), ((5374, 5472), 'pandas.read_csv', 'pd.read_csv', (['"""/home/benk... |
import numpy as np
from scipy import sparse
def fit_glove_bias(A, emb):
N = A.shape[0]
row_sum = np.array(A.sum(axis=1)).reshape(-1).astype(float)
col_sum = np.array(A.sum(axis=0)).reshape(-1).astype(float)
emb_sum = np.array(emb @ np.array(np.sum(emb, axis=0)).reshape((-1, 1))).reshape(-1)
row_s... | [
"numpy.multiply",
"numpy.sum",
"numpy.abs",
"numpy.power",
"numpy.zeros",
"numpy.sign",
"numpy.sqrt"
] | [((366, 377), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (374, 377), True, 'import numpy as np\n'), ((386, 397), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (394, 397), True, 'import numpy as np\n'), ((1272, 1292), 'numpy.zeros', 'np.zeros', (['grad.shape'], {}), '(grad.shape)\n', (1280, 1292), True, 'import... |
import numpy as np
from scipy.linalg import cho_solve, inv
from scipy.stats import norm
from scipy.interpolate import InterpolatedUnivariateSpline
from sklearn.mixture import GaussianMixture as GMM
from .utils import custom_KDE
import time
class Acq(object):
'''
The base acq class.
'''
def ... | [
"numpy.sum",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.average",
"numpy.empty",
"sklearn.mixture.GaussianMixture",
"numpy.random.default_rng",
"numpy.append",
"numpy.loadtxt",
"numpy.sign",
"numpy.array_split",
"numpy.dot",
"numpy.concatenate",
"numpy.atleast_2d"
] | [((2119, 2143), 'numpy.append', 'np.append', (['pos', 'fidelity'], {}), '(pos, fidelity)\n', (2128, 2143), True, 'import numpy as np\n'), ((2464, 2480), 'numpy.atleast_2d', 'np.atleast_2d', (['x'], {}), '(x)\n', (2477, 2480), True, 'import numpy as np\n'), ((8341, 8354), 'numpy.sum', 'np.sum', (['w_raw'], {}), '(w_raw)... |
import numpy as np
# class for 3D points in an image frame
class Point(object):
# class constructor
def __init__(self, img_map, location, color):
self.point = location
self.frames = []
self.idx = []
self.color = np.copy(color)
self.id = img_map.max_point
img_map... | [
"numpy.array",
"numpy.copy"
] | [((253, 267), 'numpy.copy', 'np.copy', (['color'], {}), '(color)\n', (260, 267), True, 'import numpy as np\n'), ((948, 1008), 'numpy.array', 'np.array', (['[self.point[0], self.point[1], self.point[2], 1.0]'], {}), '([self.point[0], self.point[1], self.point[2], 1.0])\n', (956, 1008), True, 'import numpy as np\n')] |
# -*- coding:utf-8 -*-
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Remove unnecessary information
import numpy as np
# cpu_count = 4
# 因为服务器没有图形界面,所以必须这样弄
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
# 好看的打印格式
def fancy_print(n = None, c = None, s... | [
"keras.preprocessing.image.ImageDataGenerator",
"numpy.load",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.legend",
"tensorflow.config.experimental.set_memory_growth",
"matplotlib.pyplot.figure",
"matplotlib.use",
"keras.callbacks.EarlyStopping",
"tensorflow.config.experimental.list_physical_devices"... | [((205, 226), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (219, 226), False, 'import matplotlib\n'), ((1274, 1334), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)', 'validation_split': '(0.11)'}), '(rescale=1.0 / 255, validation_split=0.11)\... |
import numpy as np
import cv2
import pdb
# https://github.com/zju3dv/clean-pvnet/blob/master/lib/datasets/augmentation.py
def debug_visualize(image, mask, pts2d, sym_cor, name_prefix='debug'):
from random import sample
cv2.imwrite('{}_image.png'.format(name_prefix), image * 255)
cv2.imwrite('{}_mask.png'.... | [
"numpy.ones",
"cv2.warpAffine",
"numpy.random.randint",
"numpy.mean",
"numpy.round",
"cv2.line",
"numpy.zeros_like",
"numpy.max",
"cv2.resize",
"numpy.stack",
"cv2.circle",
"numpy.asarray",
"numpy.min",
"numpy.concatenate",
"numpy.random.uniform",
"numpy.float32",
"numpy.zeros",
"n... | [((675, 691), 'numpy.nonzero', 'np.nonzero', (['mask'], {}), '(mask)\n', (685, 691), True, 'import numpy as np\n'), ((1159, 1175), 'numpy.nonzero', 'np.nonzero', (['mask'], {}), '(mask)\n', (1169, 1175), True, 'import numpy as np\n'), ((1241, 1268), 'numpy.float32', 'np.float32', (['sym_cor[ys, xs]'], {}), '(sym_cor[ys... |
import numpy as np
import os
import gym
import torch
import torch.nn as nn
import collections
import copy
import random
# hype-params
learn_freq = 5 #经验池攒一些经验再开启训练
buffer_size = 20000 #经验池大小
buffer_init_size = 200 #开启训练最低经验条数
batch_size = 32 #每次sample的数量
learning_rate = 0.001 #学习率
GAMMA = 0.99 # reward折扣因子
class Mode... | [
"copy.deepcopy",
"torch.nn.MSELoss",
"gym.make",
"numpy.argmax",
"random.sample",
"torch.save",
"numpy.mean",
"numpy.random.randint",
"numpy.array",
"torch.nn.Linear",
"numpy.random.rand",
"torch.tensor",
"numpy.squeeze",
"collections.deque",
"torch.from_numpy"
] | [((5045, 5065), 'numpy.mean', 'np.mean', (['eval_reward'], {}), '(eval_reward)\n', (5052, 5065), True, 'import numpy as np\n'), ((5104, 5127), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (5112, 5127), False, 'import gym\n'), ((6878, 6925), 'torch.save', 'torch.save', (['agent.dqn.target_mo... |
##
# @file electric_overflow.py
# @author <NAME>
# @date Aug 2018
#
import math
import numpy as np
import torch
from torch import nn
from torch.autograd import Function
from torch.nn import functional as F
import dreamplace.ops.electric_potential.electric_potential_cpp as electric_potential_cpp
import dreamplace.... | [
"torch.ones",
"numpy.meshgrid",
"math.sqrt",
"math.ceil",
"numpy.argmax",
"matplotlib.pyplot.close",
"numpy.amax",
"matplotlib.pyplot.figure",
"matplotlib.use",
"numpy.arange",
"numpy.mean",
"torch.zeros",
"matplotlib.pyplot.savefig"
] | [((530, 551), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (544, 551), False, 'import matplotlib\n'), ((12631, 12643), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (12641, 12643), True, 'import matplotlib.pyplot as plt\n'), ((12687, 12718), 'numpy.arange', 'np.arange', (['density... |
"""
Dependencies:
tensorflow: 1.2.0
matplotlib
numpy
"""
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
tf.set_random_seed(1)
np.random.seed(1)
#fake data
n_data = np.ones((100,2))
x0 = np.random.normal(2*n_data, 1) #class0 x shape = (100, 2))
y0 = np.zeros(100) ... | [
"numpy.random.seed",
"numpy.ones",
"tensorflow.local_variables_initializer",
"numpy.random.normal",
"tensorflow.set_random_seed",
"tensorflow.placeholder",
"matplotlib.pyplot.cla",
"tensorflow.squeeze",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.show",
"tensorflow.global_variables_initializer... | [((134, 155), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1)'], {}), '(1)\n', (152, 155), True, 'import tensorflow as tf\n'), ((156, 173), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (170, 173), True, 'import numpy as np\n'), ((195, 212), 'numpy.ones', 'np.ones', (['(100, 2)'], {}), '((10... |
import numpy as N
import win32com.client
# generate and import apogee ActiveX module
apogee_module = win32com.client.gencache.EnsureModule(
'{A2882C73-7CFB-11D4-9155-0060676644C1}', 0, 1, 0)
if apogee_module is None:
raise ImportError # prevent plugin from being imported
from win32com.client import constants ... | [
"traits.api.Float",
"Camera.CameraError",
"numpy.copy",
"traits.api.Int",
"numpy.zeros",
"traits.api.Bool",
"traits.api.Str",
"traitsui.api.Item",
"traits.api.Enum"
] | [((715, 721), 'traits.api.Int', 'Int', (['(0)'], {}), '(0)\n', (718, 721), False, 'from traits.api import Str, Int, Enum, Float, Bool\n'), ((741, 746), 'traits.api.Str', 'Str', ([], {}), '()\n', (744, 746), False, 'from traits.api import Str, Int, Enum, Float, Bool\n'), ((768, 773), 'traits.api.Str', 'Str', ([], {}), '... |
"""
The pypositioning.system.load_files.py module contains functions allowing to load measurement results from various
types of files. The currently available functions allow to load **.psd** files collected with TI Packet Sniffer and
results obtained using IONIS localization system.
Copyright (C) 2020 <NAME>
"""
impo... | [
"pandas.DataFrame",
"pandas.cut",
"numpy.rint",
"numpy.array",
"numpy.linalg.norm",
"numpy.log10",
"pandas.concat",
"numpy.nanmean"
] | [((1886, 1903), 'numpy.array', 'np.array', (['ble_res'], {}), '(ble_res)\n', (1894, 1903), True, 'import numpy as np\n'), ((1918, 1935), 'numpy.array', 'np.array', (['uwb_res'], {}), '(uwb_res)\n', (1926, 1935), True, 'import numpy as np\n'), ((7188, 7201), 'numpy.array', 'np.array', (['tse'], {}), '(tse)\n', (7196, 72... |
# A collection of various tools to help estimate and analyze the tail exponent.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from FatTailedTools.plotting import plot_survival_function
from FatTailedTools.survival import get_survival_function
def fit_alpha_linear(series, tail_start_mad=2.5,... | [
"numpy.poly1d",
"seaborn.histplot",
"matplotlib.pyplot.show",
"numpy.polyfit",
"FatTailedTools.survival.get_survival_function",
"numpy.hstack",
"pandas.MultiIndex.from_product",
"FatTailedTools.plotting.plot_survival_function",
"numpy.random.normal",
"numpy.log10",
"matplotlib.pyplot.subplots"
] | [((1093, 1159), 'numpy.log10', 'np.log10', (["survival.loc[survival['Values'] >= tail_start].iloc[:-1]"], {}), "(survival.loc[survival['Values'] >= tail_start].iloc[:-1])\n", (1101, 1159), True, 'import numpy as np\n'), ((1199, 1257), 'numpy.polyfit', 'np.polyfit', (["survival_tail['Values']", "survival_tail['P']", '(1... |
import types
import warnings
from collections.abc import Iterable
from inspect import getfullargspec
import numpy as np
class _DatasetApply:
"""
Helper class to apply function to
`pysprint.core.bases.dataset.Dataset` objects.
"""
def __init__(
self,
obj,
func,
... | [
"numpy.vectorize",
"inspect.getfullargspec",
"numpy.concatenate",
"numpy.asarray",
"warnings.warn",
"numpy.unique"
] | [((1015, 1035), 'inspect.getfullargspec', 'getfullargspec', (['func'], {}), '(func)\n', (1029, 1035), False, 'from inspect import getfullargspec\n'), ((2363, 2396), 'numpy.asarray', 'np.asarray', (['val'], {'dtype': 'np.float64'}), '(val, dtype=np.float64)\n', (2373, 2396), True, 'import numpy as np\n'), ((2494, 2547),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 13:22:41 2022
@author: sampasmann
"""
import numpy as np
from time import process_time
def reeds_data(Nx=1000, LB=-8.0, RB=8.0):
G = 1 # number of energy groups
sigt = np.empty((Nx,G))
sigs = np.empty((Nx,G,G))
source = np.empty(... | [
"numpy.empty",
"time.process_time",
"numpy.linspace"
] | [((251, 268), 'numpy.empty', 'np.empty', (['(Nx, G)'], {}), '((Nx, G))\n', (259, 268), True, 'import numpy as np\n'), ((279, 299), 'numpy.empty', 'np.empty', (['(Nx, G, G)'], {}), '((Nx, G, G))\n', (287, 299), True, 'import numpy as np\n'), ((311, 328), 'numpy.empty', 'np.empty', (['(Nx, G)'], {}), '((Nx, G))\n', (319,... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 6 21:52:54 2019
@author: USER
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sklearn as sk
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import accuracy_scor... | [
"torch.tensor",
"sklearn.preprocessing.StandardScaler",
"sklearn.model_selection.train_test_split",
"utilities.load_census_data",
"sklearn.metrics.roc_auc_score",
"DNN_model.training_fair_model",
"sklearn.metrics.f1_score",
"fairness_metrics.computeEDFforData",
"sklearn.utils.shuffle",
"torch.no_g... | [((971, 1009), 'utilities.load_census_data', 'load_census_data', (['"""data/adult.data"""', '(1)'], {}), "('data/adult.data', 1)\n", (987, 1009), False, 'from utilities import load_census_data\n'), ((1148, 1168), 'numpy.unique', 'np.unique', (['S'], {'axis': '(0)'}), '(S, axis=0)\n', (1157, 1168), True, 'import numpy a... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 2 13:42:37 2019
@author: <NAME>
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.cm as cm
from mpl_toolkits.mplot3d import Axes3D
import cycler
def spectral_decay(case = 4,
vname = 'example_0',
... | [
"matplotlib.pyplot.subplot",
"numpy.load",
"matplotlib.pyplot.show",
"numpy.amin",
"numpy.asarray",
"numpy.amax",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((1133, 1149), 'numpy.arange', 'np.arange', (['(2)', '(12)'], {}), '(2, 12)\n', (1142, 1149), True, 'import numpy as np\n'), ((6195, 6205), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (6203, 6205), True, 'import matplotlib.pyplot as plt\n'), ((2010, 2028), 'numpy.load', 'np.load', (['iter_name'], {}), '(it... |
import cv2
import numpy as np
import mediapipe as mp
import glob
import os
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_face_mesh = mp.solutions.face_mesh
#import os
os.environ['JOBLIB_TEMP_FOLDER'] = '/tmp'
# wait for process: "W016","W017","W018","W019","W023","W024","W... | [
"cv2.line",
"numpy.save",
"cv2.cvtColor",
"cv2.VideoCapture",
"numpy.array",
"os.path.splitext",
"glob.glob",
"os.path.split"
] | [((612, 670), 'glob.glob', 'glob.glob', (['"""/data3/MEAD/W036/video/front/*/level_*/0*.mp4"""'], {}), "('/data3/MEAD/W036/video/front/*/level_*/0*.mp4')\n", (621, 670), False, 'import glob\n'), ((891, 910), 'os.path.split', 'os.path.split', (['path'], {}), '(path)\n', (904, 910), False, 'import os\n'), ((924, 943), 'o... |
"""
Performance Comparision with Commercial APIs like Face++, Google, MS and Amazon
"""
import sys
import os
import requests
import numpy as np
import pandas as pd
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
sys.path.append('../')
from config.cfg import cfg
def prepare_te... | [
"sys.path.append",
"sklearn.metrics.accuracy_score",
"numpy.array",
"numpy.loadtxt",
"requests.post",
"os.path.join",
"os.listdir"
] | [((254, 276), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (269, 276), False, 'import sys\n'), ((481, 568), 'os.path.join', 'os.path.join', (["cfg['root']", '"""RAF-Face"""', "('%s/EmoLabel/list_patition_label.txt' % type)"], {}), "(cfg['root'], 'RAF-Face', '%s/EmoLabel/list_patition_label.tx... |
from scipy.signal import find_peaks
import numpy as np
import math
def search_peaks(x_data, y_data, height=0.1, distance=10):
prominence = np.mean(y_data)
peak_list = find_peaks(y_data, height=height, prominence=prominence, distance=distance)
peaks = []
for i in peak_list[0]:
peak = (x_data[i]... | [
"numpy.mean",
"scipy.signal.find_peaks",
"math.isclose"
] | [((144, 159), 'numpy.mean', 'np.mean', (['y_data'], {}), '(y_data)\n', (151, 159), True, 'import numpy as np\n'), ((176, 251), 'scipy.signal.find_peaks', 'find_peaks', (['y_data'], {'height': 'height', 'prominence': 'prominence', 'distance': 'distance'}), '(y_data, height=height, prominence=prominence, distance=distanc... |
import pandas as pd
from transformers import BertTokenizer, RobertaTokenizer, AutoTokenizer
import os
import numpy as np
import re
import glob
from nltk import sent_tokenize
from utils import num_tokens
import math
def read_generic_file(filepath):
""" reads any generic text file into
list conta... | [
"pandas.DataFrame",
"utils.num_tokens",
"numpy.random.seed",
"os.path.join",
"nltk.sent_tokenize",
"math.floor",
"transformers.AutoTokenizer.from_pretrained",
"re.search",
"numpy.random.choice",
"re.sub",
"os.listdir"
] | [((5885, 5908), 'nltk.sent_tokenize', 'sent_tokenize', (['document'], {}), '(document)\n', (5898, 5908), False, 'from nltk import sent_tokenize\n'), ((15283, 15314), 'math.floor', 'math.floor', (['augmentation_factor'], {}), '(augmentation_factor)\n', (15293, 15314), False, 'import math\n'), ((17416, 17434), 'numpy.ran... |
# Copyright 2021 DeepMind Technologies Limited.
#
# 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... | [
"tensorflow.compat.v2.reshape",
"rdkit.Chem.RemoveHs",
"rdkit.Chem.AllChem.UFFGetMoleculeForceField",
"absl.logging.exception",
"tensorflow.compat.v2.matmul",
"copy.deepcopy",
"rdkit.Chem.AllChem.ETKDGv3",
"tensorflow.compat.v2.zeros_like",
"tensorflow.compat.v2.stack",
"tensorflow.compat.v2.linal... | [((1968, 1991), 'copy.deepcopy', 'copy.deepcopy', (['molecule'], {}), '(molecule)\n', (1981, 1991), False, 'import copy\n'), ((2000, 2015), 'rdkit.Chem.AddHs', 'Chem.AddHs', (['mol'], {}), '(mol)\n', (2010, 2015), False, 'from rdkit import Chem\n'), ((2492, 2539), 'rdkit.Chem.AllChem.AlignMolConformers', 'AllChem.Align... |
"""Module for handling plotting functions
This module contains plotting classes to plot :class:`.Binning` objects.
Examples
--------
::
plt = plotting.get_plotter(binning)
plt.plot_values()
plt.savefig('output.png')
"""
from itertools import cycle
import numpy as np
from matplotlib import pyplot as ... | [
"numpy.random.uniform",
"numpy.quantile",
"numpy.sum",
"numpy.ceil",
"numpy.zeros_like",
"matplotlib.pyplot.close",
"numpy.asarray",
"numpy.asfarray",
"matplotlib.ticker.MaxNLocator",
"numpy.isfinite",
"numpy.ones",
"numpy.append",
"numpy.min",
"numpy.max",
"numpy.array",
"numpy.arange... | [((1942, 1973), 'itertools.cycle', 'cycle', (["['//', '\\\\\\\\', 'O', '*']"], {}), "(['//', '\\\\\\\\', 'O', '*'])\n", (1947, 1973), False, 'from itertools import cycle\n'), ((4113, 4126), 'numpy.array', 'np.array', (['ret'], {}), '(ret)\n', (4121, 4126), True, 'import numpy as np\n'), ((4253, 4276), 'numpy.arange', '... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as img
import h5py #s a common package to interact with
# a dataset that is stored on an H5 file.
#from lr_utils import load_dataset
#load datasets
#Load lr_utils for loading train and testinng datasets
def load_dataset():
t... | [
"h5py.File",
"matplotlib.pyplot.show",
"numpy.dot",
"matplotlib.pyplot.plot",
"numpy.sum",
"numpy.log",
"matplotlib.pyplot.imshow",
"numpy.abs",
"numpy.zeros",
"numpy.array",
"numpy.exp",
"numpy.squeeze",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((1383, 1418), 'matplotlib.pyplot.imshow', 'plt.imshow', (['train_set_x_orig[index]'], {}), '(train_set_x_orig[index])\n', (1393, 1418), True, 'import matplotlib.pyplot as plt\n'), ((1420, 1430), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1428, 1430), True, 'import matplotlib.pyplot as plt\n'), ((12747, ... |
import os
import unittest
import torch
import numpy as np
from PIL import Image
from embryovision import util
from embryovision.tests.common import get_loadable_filenames
class TestReadImage(unittest.TestCase):
def test_read_image_returns_numpy(self):
filename = get_loadable_filenames()[0]
image... | [
"unittest.main",
"embryovision.util.augment_focus",
"numpy.random.seed",
"numpy.random.randn",
"embryovision.util.read_image",
"os.path.exists",
"embryovision.util.split_all",
"PIL.Image.open",
"embryovision.util.ImageTransformingCollection",
"embryovision.util.TransformingCollection",
"numpy.ar... | [((4960, 4984), 'embryovision.tests.common.get_loadable_filenames', 'get_loadable_filenames', ([], {}), '()\n', (4982, 4984), False, 'from embryovision.tests.common import get_loadable_filenames\n'), ((4996, 5039), 'embryovision.util.ImageTransformingCollection', 'util.ImageTransformingCollection', (['filenames'], {}),... |
import tensorflow as tf
import numpy as np
import helper
import problem_unittests as tests
# Number of Epochs
num_epochs = 2
# Batch Size
batch_size = 64
# RNN Size
rnn_size = 256
# Embedding Dimension Size
embed_dim = 300
# Sequence Length
seq_length = 100
# Learning Rate
learning_rate = 0.001
# Show stats for every ... | [
"helper.save_params",
"tensorflow.train.import_meta_graph",
"helper.load_params",
"tensorflow.Session",
"problem_unittests.test_pick_word",
"problem_unittests.test_get_tensors",
"helper.load_preprocess",
"numpy.array",
"tensorflow.Graph"
] | [((531, 573), 'helper.save_params', 'helper.save_params', (['(seq_length, save_dir)'], {}), '((seq_length, save_dir))\n', (549, 573), False, 'import helper\n'), ((839, 863), 'helper.load_preprocess', 'helper.load_preprocess', ([], {}), '()\n', (861, 863), False, 'import helper\n'), ((887, 907), 'helper.load_params', 'h... |
from os import listdir
from os.path import isdir, isfile, join
from itertools import chain
import numpy as np
import matplotlib.pyplot as plt
from utils import shelf
def dlist(key, dat):
r"""Runs over a list of dictionaries and outputs a list of values corresponding to `key`
Short version (no checks): ret... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.figure",
"numpy.array",
"utils.shelf",
"os.path.join",
"os.listdir"
] | [((554, 567), 'numpy.array', 'np.array', (['ret'], {}), '(ret)\n', (562, 567), True, 'import numpy as np\n'), ((4199, 4225), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 3)'}), '(figsize=(8, 3))\n', (4209, 4225), True, 'import matplotlib.pyplot as plt\n'), ((4235, 4251), 'matplotlib.pyplot.subplot', ... |
""" Lower level layer for slicer.
Mom's spaghetti.
"""
# TODO: Consider boolean array indexing.
from typing import Any, AnyStr, Union, List, Tuple
from abc import abstractmethod
import numbers
class AtomicSlicer:
""" Wrapping object that will unify slicing across data structures.
What we support:
Ba... | [
"scipy.sparse.vstack",
"numpy.array",
"torch.stack",
"torch.tensor"
] | [((14349, 14387), 'numpy.array', 'numpy.array', (['inner'], {'dtype': 'numpy.object'}), '(inner, dtype=numpy.object)\n', (14360, 14387), False, 'import numpy\n'), ((14437, 14455), 'numpy.array', 'numpy.array', (['inner'], {}), '(inner)\n', (14448, 14455), False, 'import numpy\n'), ((14644, 14662), 'torch.stack', 'torch... |
# coding=utf-8
"""
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from copy import deepcopy
import warnings as warnings
from collections import OrderedDict
import numpy as np
from pypint.solvers.i_iterative_time_solver import IIterativeTimeSolver
from pypint.solvers.i_parallel_solver import IParallelSolver
from pypint.commu... | [
"pypint.solvers.diagnosis.norms.supremum_norm",
"copy.deepcopy",
"pypint.solvers.states.sdc_solver_state.SdcSolverState",
"pypint.solvers.i_parallel_solver.IParallelSolver.__init__",
"pypint.plugins.timers.timer_base.TimerBase",
"pypint.utilities.assert_is_instance",
"numpy.zeros",
"pypint.utilities.a... | [((3328, 3368), 'pypint.solvers.i_parallel_solver.IParallelSolver.__init__', 'IParallelSolver.__init__', (['self'], {}), '(self, **kwargs)\n', (3352, 3368), False, 'from pypint.solvers.i_parallel_solver import IParallelSolver\n'), ((3419, 3516), 'pypint.utilities.threshold_check.ThresholdCheck', 'ThresholdCheck', ([], ... |
"""
Get the timestamps of all claims and plot the cumulative number vs. time!
"""
import datetime
import json
import matplotlib.pyplot as plt
import numpy as np
import os
import requests
import sqlite3
import time
def make_graph(mode, show=True):
"""
mode must be "claims" or "channels"
"""
if mode != ... | [
"numpy.sum",
"numpy.argmax",
"json.dumps",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.close",
"numpy.max",
"requests.get",
"matplotlib.pyplot.show",
"matplotlib.pyplot.yli... | [((373, 389), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (382, 389), True, 'import matplotlib.pyplot as plt\n'), ((491, 515), 'sqlite3.connect', 'sqlite3.connect', (['db_file'], {}), '(db_file)\n', (506, 515), False, 'import sqlite3\n'), ((1203, 1214), 'time.time', 'time.time', ([], {}), ... |
import numpy as np
import scipy.sparse as sp
import datasets
import utils
import argparse
# argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', default='cora', help='Datasets: cora, email, ssets')
parser.add_argument('--version', default='1', help='version for ssets, default 1 for others')
a... | [
"numpy.save",
"argparse.ArgumentParser",
"datasets.load_graph",
"scipy.sparse.csr_matrix",
"utils.laplacian",
"utils.normalized_laplacian"
] | [((113, 138), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (136, 138), False, 'import argparse\n'), ((390, 437), 'datasets.load_graph', 'datasets.load_graph', (['args.dataset', 'args.version'], {}), '(args.dataset, args.version)\n', (409, 437), False, 'import datasets\n'), ((531, 549), 'utils... |
from scipy.stats import multivariate_normal
from scipy.signal import convolve2d
import matplotlib
try:
matplotlib.pyplot.figure()
matplotlib.pyplot.close()
except Exception:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
# the colormap should assign light colors to low ... | [
"scipy.stats.multivariate_normal.rvs",
"scipy.signal.convolve2d",
"os.makedirs",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.empty",
"os.path.exists",
"scipy.stats.multivariate_normal",
"numpy.ones",
"matplotlib.pyplot.figure",
"matplotlib.use",
"matplotlib.pyplot.contourf",
... | [((107, 133), 'matplotlib.pyplot.figure', 'matplotlib.pyplot.figure', ([], {}), '()\n', (131, 133), False, 'import matplotlib\n'), ((138, 163), 'matplotlib.pyplot.close', 'matplotlib.pyplot.close', ([], {}), '()\n', (161, 163), False, 'import matplotlib\n'), ((789, 813), 'numpy.empty', 'np.empty', (['(x.shape + (2,))']... |
from datetime import datetime, timedelta
from pyclarify import APIClient
import orchest
import pandas as pd
import numpy as np
from merlion.utils import TimeSeries
from merlion.models.forecast.prophet import Prophet, ProphetConfig
from merlion.transform.base import Identity
def pipeline_data(times, values, new_id,new... | [
"pandas.DataFrame",
"orchest.output",
"orchest.get_inputs",
"merlion.utils.TimeSeries.from_pd",
"datetime.datetime.now",
"merlion.models.forecast.prophet.Prophet",
"numpy.mean",
"datetime.timedelta",
"merlion.transform.base.Identity",
"pyclarify.APIClient"
] | [((1072, 1111), 'pyclarify.APIClient', 'APIClient', (['"""./clarify-credentials.json"""'], {}), "('./clarify-credentials.json')\n", (1081, 1111), False, 'from pyclarify import APIClient\n'), ((1122, 1142), 'orchest.get_inputs', 'orchest.get_inputs', ([], {}), '()\n', (1140, 1142), False, 'import orchest\n'), ((3609, 36... |
import tensorflow as tf
import numpy as np
class RBFolution(tf.keras.layers.Layer):
def __init__(self, filters, kernel_size=(1, 3, 3, 1), padding="VALID", strides=(1, 1, 1, 1), name="RBFolution",
dilation_rate=(1,1),
ccs_initializer=tf.keras.initializers.RandomUniform(0,1),
... | [
"tensorflow.einsum",
"tensorflow.reshape",
"tensorflow.multiply",
"tensorflow.keras.initializers.RandomUniform",
"tensorflow.shape",
"tensorflow.square",
"numpy.prod"
] | [((273, 314), 'tensorflow.keras.initializers.RandomUniform', 'tf.keras.initializers.RandomUniform', (['(0)', '(1)'], {}), '(0, 1)\n', (308, 314), True, 'import tensorflow as tf\n'), ((348, 389), 'tensorflow.keras.initializers.RandomUniform', 'tf.keras.initializers.RandomUniform', (['(0)', '(1)'], {}), '(0, 1)\n', (383,... |
'''
Action policy methods to sampling actions
Algorithm provides a `calc_pdparam` which takes a state and do a forward pass through its net,
and the pdparam is used to construct an action probability distribution as appropriate per the action type as indicated by the body
Then the prob. dist. is used to sample action.
... | [
"slm_lab.lib.util.get_class_name",
"torch.distributions.Categorical",
"slm_lab.lib.logger.debug",
"numpy.sum",
"torch.argmax",
"torch.cat",
"numpy.isnan",
"numpy.clip",
"slm_lab.lib.util.set_attr",
"torch.isnan",
"torch.ones",
"pydash.is_list",
"slm_lab.lib.logger.get_logger",
"torch.exp",... | [((824, 851), 'slm_lab.lib.logger.get_logger', 'logger.get_logger', (['__name__'], {}), '(__name__)\n', (841, 851), False, 'from slm_lab.lib import logger, math_util, util\n'), ((7960, 8009), 'torch.tensor', 'torch.tensor', (['sample'], {'device': 'algorithm.net.device'}), '(sample, device=algorithm.net.device)\n', (79... |
"""Example case for particle travel times in a straight channel."""
import numpy as np
import matplotlib.pyplot as plt
import dorado.particle_track as pt
# fix the random seed so it stays the same as weights change
np.random.seed(1)
# create synthetic domain and flow field
domain = np.zeros((100, 50))
depth = np.zero... | [
"matplotlib.pyplot.title",
"numpy.random.seed",
"dorado.particle_track.Particles",
"numpy.ones",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"numpy.zeros_like",
"matplotlib.pyplot.colorbar",
"numpy.max",
"numpy.linspace",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
... | [((216, 233), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (230, 233), True, 'import numpy as np\n'), ((285, 304), 'numpy.zeros', 'np.zeros', (['(100, 50)'], {}), '((100, 50))\n', (293, 304), True, 'import numpy as np\n'), ((313, 334), 'numpy.zeros_like', 'np.zeros_like', (['domain'], {}), '(domain)\n... |
import numpy as np
import esutil as eu
def randcap(*,
rng,
nrand,
ra,
dec,
radius,
get_radius=False,
dorot=False):
"""
Generate random points in a sherical cap
parameters
----------
nrand:
The number of r... | [
"numpy.radians",
"esutil.coords.rotate",
"numpy.degrees",
"numpy.deg2rad",
"numpy.clip",
"numpy.rad2deg",
"numpy.sin",
"numpy.array",
"numpy.where",
"numpy.cos",
"esutil.coords.atbound",
"numpy.arccos",
"numpy.sqrt"
] | [((3910, 3934), 'numpy.clip', 'np.clip', (['v', '(-1.0)', '(1.0)', 'v'], {}), '(v, -1.0, 1.0, v)\n', (3917, 3934), True, 'import numpy as np\n'), ((3981, 3993), 'numpy.arccos', 'np.arccos', (['v'], {}), '(v)\n', (3990, 3993), True, 'import numpy as np\n'), ((4024, 4044), 'numpy.degrees', 'np.degrees', (['dec', 'dec'], ... |
import os
from datetime import datetime, timedelta
import numpy as np
import xarray as xr
import parcels
import matplotlib
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import cartopy
import cartopy.util
import cartopy.crs as ccrs
from cartopy.mpl.gridliner import LONG... | [
"cartopy.feature.NaturalEarthFeature",
"matplotlib.pyplot.figure",
"parcels.field.Field",
"numpy.arange",
"matplotlib.pyplot.close",
"matplotlib.rcParams.update",
"matplotlib.ticker.FixedLocator",
"datetime.timedelta",
"numpy.reshape",
"numpy.linspace",
"parcels.ParticleSet.from_list",
"dateti... | [((1328, 1343), 'numpy.array', 'np.array', (['[0.0]'], {}), '([0.0])\n', (1336, 1343), True, 'import numpy as np\n'), ((1355, 1452), 'parcels.field.Field', 'parcels.field.Field', ([], {'name': '"""U"""', 'data': 'u_data', 'lon': 'lons', 'lat': 'lats', 'depth': 'depth', 'mesh': '"""spherical"""'}), "(name='U', data=u_da... |
'''
GraphPy: Python Module for Graph-based learning algorithms. Efficient implementations of modern methods for graph-based semi-supervised learning, and graph clustering.
See README.md file for usage.
Author: <NAME>, 2020
'''
import numpy as np
import datetime
import matplotlib.pyplot as plt
import matplotlib
import... | [
"numpy.sum",
"scipy.sparse.linalg.cg",
"numpy.ones",
"numpy.argmin",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.exp",
"numpy.diag",
"matplotlib.rcParams.update",
"torch.FloatTensor",
"numpy.max",
"datetime.datetime.now",
"numpy.minimum",
"matplotlib.pyplot.show",... | [((2665, 2718), 'os.path.join', 'os.path.join', (['location', '"""LabelPermutations"""', 'dataFile'], {}), "(location, 'LabelPermutations', dataFile)\n", (2677, 2718), False, 'import sys, getopt, time, csv, torch, os, multiprocessing\n'), ((3545, 3585), 'os.path.join', 'os.path.join', (['location', '"""Data"""', 'dataF... |
import datetime
import numpy as np
import garminmanager.utils.JsonEncDecC
import garminmanager.utils.FileWriterC
from garminmanager.enumerators.EnumHealthTypeC import EnumHealtTypeC
def test_encode_decode():
raw_data = garminmanager.RawDataC.RawDataC()
my_dates1 = {
datetime.datetime(2019,4,11,1,0... | [
"numpy.isnan",
"datetime.datetime"
] | [((289, 325), 'datetime.datetime', 'datetime.datetime', (['(2019)', '(4)', '(11)', '(1)', '(0)'], {}), '(2019, 4, 11, 1, 0)\n', (306, 325), False, 'import datetime\n'), ((338, 374), 'datetime.datetime', 'datetime.datetime', (['(2019)', '(4)', '(11)', '(2)', '(0)'], {}), '(2019, 4, 11, 2, 0)\n', (355, 374), False, 'impo... |
# -*- coding: utf-8 -*-
"""
@date: 2020/2/29 下午7:31
@file: util.py
@author: zj
@description:
"""
import numpy as np
import torch
import sys
def error(msg):
print(msg)
sys.exit(0)
def get_device():
return torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def iou(pred_box, target_box):
... | [
"numpy.minimum",
"numpy.maximum",
"torch.argmax",
"numpy.zeros",
"numpy.argsort",
"numpy.where",
"numpy.array",
"torch.cuda.is_available",
"sys.exit"
] | [((180, 191), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (188, 191), False, 'import sys\n'), ((526, 567), 'numpy.maximum', 'np.maximum', (['pred_box[0]', 'target_box[:, 0]'], {}), '(pred_box[0], target_box[:, 0])\n', (536, 567), True, 'import numpy as np\n'), ((577, 618), 'numpy.maximum', 'np.maximum', (['pred_box... |
'''
Module to preprocess filckr8k image data
'''
import cv2
import numpy as np
import os
from _pickle import dump, load
from keras.applications.inception_v3 import InceptionV3
from keras.layers import Flatten
from keras.models import load_model
from keras.preprocessing import image
from keras.applications.inception_v3... | [
"keras.models.load_model",
"numpy.expand_dims",
"PIL.Image.open",
"keras.applications.inception_v3.preprocess_input",
"keras.preprocessing.image.img_to_array",
"keras.preprocessing.image.load_img",
"cv2.imread",
"numpy.array",
"os.path.splitext",
"numpy.vstack",
"os.listdir",
"cv2.resize"
] | [((483, 504), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (493, 504), False, 'import os\n'), ((1130, 1151), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (1140, 1151), False, 'import os\n'), ((1693, 1715), 'numpy.array', 'np.array', (['img_matrices'], {}), '(img_matrices)\n', (... |
# Omid55
# Test module for network_utils.
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import networkx as nx
import pandas as pd
import numpy as np
import unittest
import datetime
import re
from parameterized import parameterized
import utils
import net... | [
"network_utils.generate_converted_graphs",
"network_utils.is_fullyconnected_cartwright_harary_balance",
"numpy.testing.assert_array_almost_equal",
"numpy.round",
"network_utils.compute_vanderijt_edge_balance",
"network_utils.get_just_periods",
"numpy.unique",
"unittest.main",
"pandas.DataFrame",
"... | [((865, 972), 'parameterized.parameterized.expand', 'parameterized.expand', (["[['latest_multiple_edge_weight', False], ['sum_of_multiple_edge_weights', True]\n ]"], {}), "([['latest_multiple_edge_weight', False], [\n 'sum_of_multiple_edge_weights', True]])\n", (885, 972), False, 'from parameterized import parame... |
import numpy as np
n = 300
serial = int(input())
grid = np.array([[int(str(((x+10)*y+serial)*(x+10))[-3])-5 for y in range(1, n+1)] for x in range(1, n+1)])
coord = (0, 0)
mVal, dim = 0, 0
for d in range(4, 2, -1):
squares = sum(grid[x:x-d+1 or None, y:y-d+1 or None] for x in range(d) for y in range(d))
val = ... | [
"numpy.where"
] | [((374, 398), 'numpy.where', 'np.where', (['(squares == val)'], {}), '(squares == val)\n', (382, 398), True, 'import numpy as np\n')] |
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import numpy as np
def rmovie_basicvar(cdf,
var = 'tg1',
Mm = False,
km = False,
savefig = False,
figname = 'radynvar.html',
... | [
"pandas.DataFrame",
"pandas.concat",
"numpy.arange",
"plotly.express.line"
] | [((4737, 4890), 'plotly.express.line', 'px.line', (['df'], {'x': 'df.columns[1]', 'y': 'df.columns[0]', 'animation_frame': '"""Time [s]"""', 'log_x': 'xlog', 'log_y': 'ylog', 'template': 'template', 'color_discrete_sequence': '[color]'}), "(df, x=df.columns[1], y=df.columns[0], animation_frame='Time [s]',\n log_x=xl... |
import numpy as np
from numba import njit
from snapshot_functions import read_particles_filter
from scipy.linalg import eigh
def run(argv):
if len(argv) < 5:
print('python script.py <IC-file> <preIC-file> <ID> <radius>')
return 1
ID = int(argv[3])
r = float(argv[4])
print('getting ID... | [
"numpy.stack",
"numpy.trace",
"numpy.polyfit",
"numpy.savetxt",
"numpy.zeros",
"numpy.argsort",
"scipy.linalg.eigh",
"snapshot_functions.read_particles_filter",
"numpy.array_equal",
"numpy.diag",
"numpy.printoptions"
] | [((361, 425), 'snapshot_functions.read_particles_filter', 'read_particles_filter', (['argv[2]'], {'ID_list': '[ID]', 'opts': "{'pos': True}"}), "(argv[2], ID_list=[ID], opts={'pos': True})\n", (382, 425), False, 'from snapshot_functions import read_particles_filter\n'), ((440, 514), 'snapshot_functions.read_particles_f... |
from collections import deque
import numpy as np
import cv2
import chainer
from chainer import links as L
import chainerrl
from chainerrl import agents
from chainerrl.action_value import DiscreteActionValue
from chainerrl import explorers
from chainerrl import links
from chainerrl import replay_buffer
def infer(... | [
"cv2.resize",
"chainerrl.links.NatureDQNHead",
"chainerrl.replay_buffer.ReplayBuffer",
"chainer.optimizers.RMSpropGraves",
"cv2.cvtColor",
"numpy.asarray",
"numpy.random.randint",
"numpy.array",
"collections.deque",
"chainer.links.Linear"
] | [((353, 388), 'cv2.cvtColor', 'cv2.cvtColor', (['s', 'cv2.COLOR_RGB2GRAY'], {}), '(s, cv2.COLOR_RGB2GRAY)\n', (365, 388), False, 'import cv2\n'), ((422, 475), 'cv2.resize', 'cv2.resize', (['s', '(84, 84)'], {'interpolation': 'cv2.INTER_AREA'}), '(s, (84, 84), interpolation=cv2.INTER_AREA)\n', (432, 475), False, 'import... |
import pytest
import time
import numpy as np
from spotify_confidence.analysis.frequentist.confidence_computers.z_test_computer import sequential_bounds
@pytest.mark.skip(reason="Skipping because this test is very slow")
def test_many_days():
"""
This input (based on a real experiment) is very long, which can ... | [
"numpy.allclose",
"pytest.mark.skip",
"numpy.array",
"time.time"
] | [((155, 221), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Skipping because this test is very slow"""'}), "(reason='Skipping because this test is very slow')\n", (171, 221), False, 'import pytest\n'), ((10635, 10701), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Skipping because this test ... |
import networkx as nx
import numpy as np
def gen_graph(graph_type, n, mean_deg):
"""Generates and returns a nx.Digraph and its adjacency matrix. Nodes are randomly permutated.
Arguments:
graph_type (string): type of graph Erdos-Renyi, scale-free, sachs or any graph in BNRepo
n (int): number o... | [
"numpy.random.gumbel",
"numpy.random.uniform",
"numpy.float32",
"numpy.random.exponential",
"numpy.zeros",
"networkx.from_numpy_array",
"numpy.random.random",
"numpy.random.normal",
"numpy.eye",
"numpy.cov"
] | [((1068, 1124), 'networkx.from_numpy_array', 'nx.from_numpy_array', (['adj_matrix'], {'create_using': 'nx.DiGraph'}), '(adj_matrix, create_using=nx.DiGraph)\n', (1087, 1124), True, 'import networkx as nx\n'), ((1497, 1513), 'numpy.float32', 'np.float32', (['beta'], {}), '(beta)\n', (1507, 1513), True, 'import numpy as ... |
#!/bin/env python
"""
Implements Python interface to NRL NAAPS files
"""
import os
import sys
from types import *
from pyhdf import SD
from glob import glob
from numpy import ones, concatenate, array,linspace,arange, transpose
from datetime import date, datetime, timedelta
from .config import strTem... | [
"binObs_.binobs3dh",
"os.path.isdir",
"gfio.GFIO",
"numpy.transpose",
"numpy.ones",
"datetime.datetime",
"os.path.isfile",
"datetime.timedelta",
"numpy.arange",
"numpy.linspace",
"pyhdf.SD.SD",
"glob.glob",
"os.path.split",
"os.listdir",
"numpy.concatenate"
] | [((10722, 10766), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(12.0 * 60.0 * 60.0 / nsyn)'}), '(seconds=12.0 * 60.0 * 60.0 / nsyn)\n', (10731, 10766), False, 'from datetime import date, datetime, timedelta\n'), ((12181, 12204), 'datetime.datetime', 'datetime', (['(2007)', '(4)', '(1)', '(0)'], {}), '(2007, 4, ... |
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from __future__ import unicode_literals
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('sknano', parent_package, top_path)
config.add_subp... | [
"numpy.distutils.misc_util.Configuration"
] | [((251, 300), 'numpy.distutils.misc_util.Configuration', 'Configuration', (['"""sknano"""', 'parent_package', 'top_path'], {}), "('sknano', parent_package, top_path)\n", (264, 300), False, 'from numpy.distutils.misc_util import Configuration\n')] |
# -*- coding: utf-8 -*-
"""
Transmission Line helper functions
"""
import numpy as np
def ZL_2_Zin(L,Z0,gamma,ZL):
"""
Returns the input impedance seen through a lossy transmission line of
characteristic impedance Z0 and complex wavenumber gamma=alpha+j*beta
Zin = ZL_2_Zin(L,Z0,gamma,ZL)
... | [
"numpy.tanh",
"numpy.array",
"numpy.exp",
"numpy.cosh",
"numpy.sinh"
] | [((1595, 1613), 'numpy.array', 'np.array', (['[V0, I0]'], {}), '([V0, I0])\n', (1603, 1613), True, 'import numpy as np\n'), ((2315, 2333), 'numpy.exp', 'np.exp', (['(-gamma * L)'], {}), '(-gamma * L)\n', (2321, 2333), True, 'import numpy as np\n'), ((686, 704), 'numpy.tanh', 'np.tanh', (['(gamma * L)'], {}), '(gamma * ... |
from __future__ import print_function
import numpy as np
from sklearn.preprocessing import Normalizer
# For reproducibility
np.random.seed(1000)
if __name__ == '__main__':
# Create a dummy dataset
data = np.array([1.0, 2.0])
print(data)
# Max normalization
n_max = Normalizer(norm... | [
"numpy.array",
"sklearn.preprocessing.Normalizer",
"numpy.random.seed"
] | [((134, 154), 'numpy.random.seed', 'np.random.seed', (['(1000)'], {}), '(1000)\n', (148, 154), True, 'import numpy as np\n'), ((227, 247), 'numpy.array', 'np.array', (['[1.0, 2.0]'], {}), '([1.0, 2.0])\n', (235, 247), True, 'import numpy as np\n'), ((305, 327), 'sklearn.preprocessing.Normalizer', 'Normalizer', ([], {'n... |
# -*- coding: utf-8 -*-
import biapol_utilities as biau
import numpy as np
def test_suppression():
a = np.random.rand(100).reshape(10, -1)
threshold = 0.5
a_sup = biau.label.suppressed_similarity(a, threshold=threshold)
assert(all(a_sup[a < threshold].ravel() == 0))
if __name__ == "__main__":
... | [
"numpy.random.rand",
"biapol_utilities.label.suppressed_similarity"
] | [((180, 236), 'biapol_utilities.label.suppressed_similarity', 'biau.label.suppressed_similarity', (['a'], {'threshold': 'threshold'}), '(a, threshold=threshold)\n', (212, 236), True, 'import biapol_utilities as biau\n'), ((111, 130), 'numpy.random.rand', 'np.random.rand', (['(100)'], {}), '(100)\n', (125, 130), True, '... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 6 09:59:14 2021
@author: ll17354
"""
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.linear_model._logistic import LogisticRegression
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
import sys
import warnings
import math
... | [
"scipy.stats.chi2.sf",
"numpy.multiply",
"statsmodels.api.Logit",
"sklearn.utils.validation.check_X_y",
"numpy.zeros",
"numpy.transpose",
"sklearn.utils.validation.check_is_fitted",
"numpy.diagonal",
"numpy.linalg.norm",
"numpy.matmul",
"numpy.dot",
"sys.stderr.write",
"numpy.delete",
"num... | [((1714, 1729), 'statsmodels.api.Logit', 'smf.Logit', (['y', 'X'], {}), '(y, X)\n', (1723, 1729), True, 'import statsmodels.api as smf\n'), ((1781, 1801), 'numpy.zeros', 'np.zeros', (['X.shape[1]'], {}), '(X.shape[1])\n', (1789, 1801), True, 'import numpy as np\n'), ((2130, 2140), 'numpy.sqrt', 'np.sqrt', (['W'], {}), ... |
from avgn.utils.audio import get_samplerate
from avgn.utils.json import NoIndent, NoIndentEncoder
import numpy as np
from avgn.utils.paths import DATA_DIR
import librosa
from datetime import datetime
import pandas as pd
import avgn
import json
DATASET_ID = 'mobysound_humpback_whale'
def load_labs(labels):
all_lab... | [
"numpy.argmax",
"avgn.utils.paths.ensure_dir",
"json.dumps",
"datetime.datetime.strptime",
"numpy.array",
"avgn.utils.general.seconds_to_str",
"librosa.load",
"librosa.output.write_wav",
"pandas.concat",
"librosa.get_duration"
] | [((1087, 1158), 'numpy.argmax', 'np.argmax', (['(file_df.start_time.values[1:] - file_df.end_time.values[:-1])'], {}), '(file_df.start_time.values[1:] - file_df.end_time.values[:-1])\n', (1096, 1158), True, 'import numpy as np\n'), ((1407, 1476), 'numpy.array', 'np.array', (['[noise_end_time - noise_start_time, start_n... |
#
# Copyright 2019 The FATE 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",
"federatedml.ftl.plain_ftl.PlainFTLGuestModel",
"numpy.random.seed",
"federatedml.util.transfer_variable.HeteroFTLTransferVariable",
"federatedml.feature.instance.Instance",
"numpy.zeros",
"numpy.ones",
"federatedml.ftl.test.fake_models.FakeAutoencoder",
"federatedml.ftl.plain_ftl.P... | [((4080, 4086), 'arch.api.eggroll.init', 'init', ([], {}), '()\n', (4084, 4086), False, 'from arch.api.eggroll import init\n'), ((4091, 4106), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4104, 4106), False, 'import unittest\n'), ((1417, 1496), 'numpy.array', 'np.array', (['[[4, 2, 3, 1, 2], [6, 5, 1, 4, 5], [7... |
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__version__= '1.8'
__status__ = "Research"
__date__ = "2/1/2020"
__license__= "MIT License"
import os
import sys
import numpy as np
import time
import glob
from torchvision.utils import make_grid
from tensorboardX import SummaryWriter
import imageio
import skimage
from para... | [
"tensorboardX.SummaryWriter",
"os.makedirs",
"sys_utils.tohms",
"numpy.floor",
"parameters.Params",
"numpy.zeros",
"os.system",
"numpy.ones",
"time.time",
"torchvision.utils.make_grid",
"os.path.isfile",
"skimage.transform.resize",
"glob.glob",
"os.path.join",
"numpy.sqrt"
] | [((2599, 2622), 'glob.glob', 'glob.glob', (['cfg_filename'], {}), '(cfg_filename)\n', (2608, 2622), False, 'import glob\n'), ((2765, 2773), 'parameters.Params', 'Params', ([], {}), '()\n', (2771, 2773), False, 'from parameters import Params\n'), ((3307, 3336), 'os.path.join', 'os.path.join', (['experiment_name'], {}), ... |
import scipy.spatial as sci_spatial
import skimage.draw as ski_draw
import shapely.geometry as shapely_geom
import numpy as np
import os, sys
def create_landscape(no_of_circles, radius):
# create the middle points of the ponds (the ponds should not overlap)
x,y = np.random.randint(0,400), np.random.randi... | [
"numpy.sum",
"numpy.shape",
"numpy.random.randint",
"os.chdir",
"numpy.full",
"numpy.full_like",
"numpy.zeros_like",
"shapely.geometry.Point",
"shapely.geometry.MultiPoint",
"shapely.geometry.Polygon",
"shapely.geometry.LineString",
"numpy.swapaxes",
"scipy.spatial.distance.cdist",
"skimag... | [((1304, 1355), 'numpy.full', 'np.full', (['(1200 + 2 * radius, 1200 + 2 * radius)', '(55)'], {}), '((1200 + 2 * radius, 1200 + 2 * radius), 55)\n', (1311, 1355), True, 'import numpy as np\n'), ((1632, 1685), 'numpy.full', 'np.full', (['(1200 + 2 * radius, 1200 + 2 * radius)', '(-999)'], {}), '((1200 + 2 * radius, 1200... |
import math
from random import randint
from numpy import sqrt
def GCD(a, b):
if b == 0:
return a
return GCD(b, a % b)
#######################################
def ExtendedEuclid(a, b):
if b == 0:
return (1, 0)
(x, y) = ExtendedEuclid(b, a % b)
k = a // b
return (y, x - k * y)
... | [
"numpy.sqrt"
] | [((2985, 2992), 'numpy.sqrt', 'sqrt', (['n'], {}), '(n)\n', (2989, 2992), False, 'from numpy import sqrt\n'), ((2967, 2974), 'numpy.sqrt', 'sqrt', (['n'], {}), '(n)\n', (2971, 2974), False, 'from numpy import sqrt\n')] |
from __future__ import absolute_import
from __future__ import division
from __future__ import with_statement
import abc
import json
import logging
import numpy as np
import os
import keras
from keras.optimizers import Adadelta, SGD, RMSprop, Adam
from nlplingo.nn.constants import supported_pytorch_models
from nlplin... | [
"keras.models.load_model",
"keras.optimizers.Adadelta",
"numpy.random.seed",
"keras.optimizers.SGD",
"torch.manual_seed",
"torch.cuda.manual_seed",
"data.loader.DataLoader",
"json.dumps",
"keras.optimizers.Adam",
"random.seed",
"torch.cuda.is_available",
"numpy.vstack",
"keras.optimizers.RMS... | [((544, 571), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (561, 571), False, 'import logging\n'), ((8820, 8875), 'keras.models.load_model', 'keras.models.load_model', (['filename', 'keras_custom_objects'], {}), '(filename, keras_custom_objects)\n', (8843, 8875), False, 'import keras\n'... |
from pydub import AudioSegment
import parselmouth
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def draw_pitch(pitch):
# Extract selected pitch contour, and
# replace unvoiced samples by NaN to not plot
pitch_values = pitch.selected_array['frequency']
pitch_values[pitch_va... | [
"matplotlib.pyplot.xlim",
"parselmouth.Sound",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.twinx",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.log10",
"matplotlib.pyplot.xlabel",
"seaborn.set",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.grid"
] | [((471, 486), 'matplotlib.pyplot.grid', 'plt.grid', (['(False)'], {}), '(False)\n', (479, 486), True, 'import matplotlib.pyplot as plt\n'), ((491, 517), 'matplotlib.pyplot.ylim', 'plt.ylim', (['(0)', 'pitch.ceiling'], {}), '(0, pitch.ceiling)\n', (499, 517), True, 'import matplotlib.pyplot as plt\n'), ((522, 562), 'mat... |
import sys
sys.path.append('/Users/kolbt/Desktop/compiled/hoomd-blue/build')
import hoomd
from hoomd import md
from hoomd import dem
from hoomd import deprecated
import numpy as np
# Simulation box mesh into grid delimit by particle diameter
# list of mesh indices random number generator to select index
# remove index... | [
"hoomd.md.nlist.cell",
"hoomd.group.type",
"numpy.sin",
"hoomd.dump.gsd",
"sys.path.append",
"numpy.zeros_like",
"hoomd.run",
"hoomd.data.boxdim",
"hoomd.init.read_snapshot",
"hoomd.group.all",
"hoomd.md.pair.lj",
"hoomd.context.initialize",
"hoomd.md.integrate.mode_minimize_fire",
"numpy.... | [((11, 76), 'sys.path.append', 'sys.path.append', (['"""/Users/kolbt/Desktop/compiled/hoomd-blue/build"""'], {}), "('/Users/kolbt/Desktop/compiled/hoomd-blue/build')\n", (26, 76), False, 'import sys\n'), ((880, 906), 'hoomd.context.initialize', 'hoomd.context.initialize', ([], {}), '()\n', (904, 906), False, 'import ho... |
import matplotlib.pyplot as plt
plt.rcParams['toolbar'] = 'None'
import numpy as np # importando numpy
def genera_montecarlo(N=100000):
plt.figure(figsize=(6,6))
x, y = np.random.uniform(-1, 1, size=(2, N))
interior = (x**2 + y**2) <= 1
pi = interior.sum() * 4 / N
error = abs((pi - np.pi) / ... | [
"numpy.random.uniform",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.invert",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
] | [((143, 169), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 6)'}), '(figsize=(6, 6))\n', (153, 169), True, 'import matplotlib.pyplot as plt\n'), ((185, 222), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(1)'], {'size': '(2, N)'}), '(-1, 1, size=(2, N))\n', (202, 222), True, 'import numpy as... |
"""
The MIT License (MIT)
Copyright (c) 2017 <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 rights
to use, copy, modify, merge, publis... | [
"tensorflow.trace",
"tensorflow.matrix_band_part",
"tensorflow.reduce_sum",
"tensorflow.maximum",
"numpy.ones",
"tensorflow.diag_part",
"tensorflow.matmul",
"tensorflow.sqrt",
"tensorflow.contrib.keras.backend.floatx",
"tensorflow.abs",
"tensorflow.diag",
"tensorflow.exp",
"tensorflow.consta... | [((1930, 1967), 'tensorflow.random_normal_initializer', 'tf.random_normal_initializer', (['(0)', '(0.01)'], {}), '(0, 0.01)\n', (1958, 1967), True, 'import tensorflow as tf\n'), ((3970, 4002), 'tensorflow.expand_dims', 'tf.expand_dims', (['self.batch_u', '(-1)'], {}), '(self.batch_u, -1)\n', (3984, 4002), True, 'import... |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: <NAME> (<EMAIL>)
#
from __future__ import absolute_import, division, unicode_literals
... | [
"mo_dots.Data.__init__",
"math.sqrt",
"math.ceil",
"mo_math.vendor.strangman.stats.chisquare",
"math.floor",
"mo_testing.fuzzytestcase.assertAlmostEqualValue",
"mo_math.almost_equal",
"mo_dots.coalesce",
"numpy.array",
"mo_future.text",
"mo_logs.Log.error",
"mo_math.OR"
] | [((9098, 9127), 'mo_math.OR', 'OR', (['(v == None for v in values)'], {}), '(v == None for v in values)\n', (9100, 9127), False, 'from mo_math import OR, almost_equal\n'), ((877, 916), 'mo_math.vendor.strangman.stats.chisquare', 'strangman.stats.chisquare', (['f_obs', 'f_exp'], {}), '(f_obs, f_exp)\n', (902, 916), Fals... |
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterable,
List,
Optional,
Sequence,
Tuple,
Union,
)
import numpy as np
import scipy.sparse as sps
from irspack.definitions import DenseScoreArray, UserIndexArray
from irspack.utils._util_cpp import retrieve_recommend_from_score
from ir... | [
"irspack.utils.threading.get_n_threads",
"numpy.asarray",
"irspack.utils._util_cpp.retrieve_recommend_from_score",
"numpy.isinf"
] | [((4405, 4465), 'numpy.asarray', 'np.asarray', (['[self.user_id_to_index[user_id]]'], {'dtype': 'np.int64'}), '([self.user_id_to_index[user_id]], dtype=np.int64)\n', (4415, 4465), True, 'import numpy as np\n'), ((10426, 10517), 'irspack.utils._util_cpp.retrieve_recommend_from_score', 'retrieve_recommend_from_score', ([... |
"""
Example to read a FITS file.
Created on Jul 9, 2019
Be aware that hdus.close () needs to be called to limit the number of open files at a given time.
@author: skwok
"""
import astropy.io.fits as pf
from astropy.utils.exceptions import AstropyWarning
import warnings
import numpy as np
from keckdrpframework.mode... | [
"warnings.simplefilter",
"keckdrpframework.primitives.base_primitive.BasePrimitive.__init__",
"keckdrpframework.models.arguments.Arguments",
"warnings.catch_warnings",
"astropy.io.fits.open",
"numpy.concatenate"
] | [((460, 485), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {}), '()\n', (483, 485), False, 'import warnings\n'), ((495, 542), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'AstropyWarning'], {}), "('ignore', AstropyWarning)\n", (516, 542), False, 'import warnings\n'), ((558, 589), 'a... |
""" timg_denoise.py
"""
import numpy as np
import torch
import torch.nn as nn
class Timg_DenoiseNet_LinT_1Layer(nn.Module):
def __init__(self):
super(Timg_DenoiseNet_LinT_1Layer, self).__init__()
self.C = 64
self.K = 13
self.centre = 3/255.0
self.scale = 2.0
self.c... | [
"torch.nn.ReLU",
"numpy.log",
"torch.nn.Conv2d",
"torch.nn.Threshold",
"torch.exp",
"torch.nn.BatchNorm2d",
"torch.pow",
"torch.log",
"torch.nn.Hardtanh"
] | [((327, 376), 'torch.nn.Conv2d', 'nn.Conv2d', (['(1)', 'self.C', 'self.K'], {'padding': '(self.K // 2)'}), '(1, self.C, self.K, padding=self.K // 2)\n', (336, 376), True, 'import torch.nn as nn\n'), ((396, 418), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['self.C'], {}), '(self.C)\n', (410, 418), True, 'import torch.nn... |
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import numpy as np
import jams.const as const
def tcherkez(Rstar, Phi=0.3, T=0.056,
a2=1.0012, a3=1.0058, a4=1.0161,
t1=0.9924, t2=1.0008, g=20e-3,
RG=False, Rchl=False, Rcyt=False, fullmodel=T... | [
"numpy.array",
"doctest.testmod"
] | [((6383, 6440), 'doctest.testmod', 'doctest.testmod', ([], {'optionflags': 'doctest.NORMALIZE_WHITESPACE'}), '(optionflags=doctest.NORMALIZE_WHITESPACE)\n', (6398, 6440), False, 'import doctest\n'), ((5918, 5933), 'numpy.array', 'np.array', (['Rstar'], {}), '(Rstar)\n', (5926, 5933), True, 'import numpy as np\n')] |
import random
import numpy as np
import cv2
import torch
import torch.utils.data as data
import logging
from . import util
class LQGTDataset3D(data.Dataset):
'''
Read LQ (Low Quality, here is LR) and GT vti file pairs.
If only GT image is provided, generate LQ vti on-the-fly.
The pair is ensured by '... | [
"numpy.copy",
"numpy.ascontiguousarray",
"logging.getLogger"
] | [((396, 421), 'logging.getLogger', 'logging.getLogger', (['"""base"""'], {}), "('base')\n", (413, 421), False, 'import logging\n'), ((3340, 3355), 'numpy.copy', 'np.copy', (['vti_GT'], {}), '(vti_GT)\n', (3347, 3355), True, 'import numpy as np\n'), ((4421, 4449), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['vt... |
import multiprocessing
import threading
import numpy as np
import os
import shutil
import matplotlib.pyplot as plt
import sys
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.multiprocessing as mp
from shared_adam import SharedAdam
import math, os
import cv2
import torchvi... | [
"numpy.random.seed",
"torch.nn.init.constant_",
"torch.device",
"pybullet.connect",
"torch.nn.functional.tanh",
"os.path.join",
"imageio.mimsave",
"numpy.set_printoptions",
"os.path.exists",
"Wrench_Manipulation_Env.RobotEnv",
"numpy.reshape",
"torch.nn.Linear",
"math.log",
"torch.log",
... | [((410, 430), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (422, 430), False, 'import torch\n'), ((432, 479), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(4)', 'suppress': '(True)'}), '(precision=4, suppress=True)\n', (451, 479), True, 'import numpy as np\n'), ((512, 546)... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... | [
"numpy.dot",
"numpy.matmul"
] | [((2452, 2490), 'numpy.dot', 'np.dot', (['img', '[24.966, 128.553, 65.481]'], {}), '(img, [24.966, 128.553, 65.481])\n', (2458, 2490), True, 'import numpy as np\n'), ((2526, 2628), 'numpy.matmul', 'np.matmul', (['img', '[[24.966, 112.0, -18.214], [128.553, -74.203, -93.786], [65.481, -37.797, \n 112.0]]'], {}), '(im... |
import os
import pytest
import numpy as np
import easy_dna as dna
def test_extract_from_input(tmpdir):
parts = []
for i in range(10):
part_id = "part_%s" % ("ABCDEFGHAB"[i]) # id is nonunique on purpose
alias = "part_%d" % i # alias is unique
part_length = np.random.randint(1000, 150... | [
"easy_dna.annotate_record",
"easy_dna.sequence_to_biopython_record",
"easy_dna.random_dna_sequence",
"pytest.raises",
"numpy.random.randint",
"easy_dna.extract_from_input"
] | [((1009, 1082), 'easy_dna.extract_from_input', 'dna.extract_from_input', ([], {'construct_list': 'constructs', 'output_path': 'target_dir'}), '(construct_list=constructs, output_path=target_dir)\n', (1031, 1082), True, 'import easy_dna as dna\n'), ((293, 322), 'numpy.random.randint', 'np.random.randint', (['(1000)', '(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.