code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import datetime
import numpy as np
import pandas as pd
from dbnd import output, pipeline, task
from dbnd.utils import period_dates
from dbnd_examples.data import demo_data_repo, partner_data_file
@pipeline
def generate_partner_data(
seed: pd.DataFrame = demo_data_repo.seed,
task_target_date=datetime.datetim... | [
"dbnd_examples.data.demo_data_repo.partner_a_file",
"dbnd_examples.data.partner_data_file",
"dbnd.utils.period_dates",
"datetime.datetime.strptime",
"numpy.random.randint",
"numpy.arange",
"datetime.timedelta",
"numpy.exp",
"numpy.random.normal",
"numpy.dot",
"datetime.datetime.now",
"dbnd_exa... | [((347, 373), 'datetime.timedelta', 'datetime.timedelta', ([], {'days': '(7)'}), '(days=7)\n', (365, 373), False, 'import datetime\n'), ((576, 614), 'dbnd.utils.period_dates', 'period_dates', (['task_target_date', 'period'], {}), '(task_target_date, period)\n', (588, 614), False, 'from dbnd.utils import period_dates\n'... |
#!/usr/bin/env python3
"""
script including
functions for easy usage in main scripts
"""
import numpy as np
from scipy.interpolate import interp1d
import tqdm
from os.path import join
import logging
from configuration import CONFIG
from .in_out import metrics_load, metrics_dump, get_indices
def concatenate_metrics(... | [
"numpy.concatenate",
"numpy.std",
"numpy.asarray",
"numpy.transpose",
"numpy.zeros",
"numpy.max",
"numpy.mean",
"numpy.squeeze",
"scipy.interpolate.interp1d",
"os.path.join",
"logging.getLogger"
] | [((366, 406), 'logging.getLogger', 'logging.getLogger', (['"""concatenate_metrics"""'], {}), "('concatenate_metrics')\n", (383, 406), False, 'import logging\n'), ((2565, 2580), 'numpy.squeeze', 'np.squeeze', (['M.T'], {}), '(M.T)\n', (2575, 2580), True, 'import numpy as np\n'), ((2660, 2715), 'numpy.zeros', 'np.zeros',... |
import numpy as np
from Bio import SeqIO, pairwise2
from prody import parsePDB
import prody.atomic.atomgroup
class ReadSeq:
@staticmethod
def mol2seq(mol: prody.atomic.atomgroup.AtomGroup,
insert_gap: bool = True) -> (str, np.ndarray):
"""Convert mol (prody.atomic.atomgroup.AtomGroup)... | [
"Bio.SeqIO.parse",
"prody.parsePDB",
"numpy.min",
"numpy.where",
"numpy.array",
"numpy.arange",
"numpy.max",
"Bio.pairwise2.align.globalms",
"numpy.delete",
"numpy.unique"
] | [((4507, 4583), 'Bio.pairwise2.align.globalms', 'pairwise2.align.globalms', (['seqA', 'seqB', 'match', 'mismatch', 'gap_start', 'gap_extend'], {}), '(seqA, seqB, match, mismatch, gap_start, gap_extend)\n', (4531, 4583), False, 'from Bio import SeqIO, pairwise2\n'), ((7118, 7160), 'numpy.delete', 'np.delete', (['align_f... |
import naacl.framework.prepare_data as data
import naacl.framework.util as util
from sklearn.model_selection import train_test_split as split
import scipy.stats as st
import naacl.framework.util as util
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold
embs=data.get_google_sgns(vocab_lim... | [
"pandas.DataFrame",
"naacl.framework.util.save_tsv",
"naacl.framework.reference_methods.densifier.Densifier",
"naacl.framework.prepare_data.load_anew99",
"sklearn.model_selection.KFold",
"numpy.arange",
"naacl.framework.util.eval",
"naacl.framework.prepare_data.get_google_sgns",
"naacl.framework.uti... | [((290, 328), 'naacl.framework.prepare_data.get_google_sgns', 'data.get_google_sgns', ([], {'vocab_limit': 'None'}), '(vocab_limit=None)\n', (310, 328), True, 'import naacl.framework.prepare_data as data\n'), ((336, 354), 'naacl.framework.prepare_data.load_anew99', 'data.load_anew99', ([], {}), '()\n', (352, 354), True... |
import numpy as np
import pandas as pd
# read data from .csv file
np.set_printoptions(threshold=np.nan)
terror = pd.read_csv('GTD.csv', encoding='ISO-8859-1', usecols=[1, 2, 3, 8, 35, 58, 84, 100, 103])
terror.rename(
columns={'eventid': 'ID', 'iyear': 'Year', 'imonth': 'Month', 'iday': 'Day', 'country_txt': ... | [
"pandas.read_csv",
"numpy.append",
"numpy.set_printoptions",
"numpy.array"
] | [((69, 106), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.nan'}), '(threshold=np.nan)\n', (88, 106), True, 'import numpy as np\n'), ((117, 211), 'pandas.read_csv', 'pd.read_csv', (['"""GTD.csv"""'], {'encoding': '"""ISO-8859-1"""', 'usecols': '[1, 2, 3, 8, 35, 58, 84, 100, 103]'}), "('GTD.csv... |
import argparse
from collections import defaultdict
import logging
import random
import sys
import numpy as np
from prettytable import PrettyTable
import torch
from transformers import AutoTokenizer
import msr
from msr.data.dataloader import DataLoader
from msr.data.datasets import BertDataset
from msr.data.datasets.... | [
"msr.reranker.ranking_model.NeuralRanker",
"numpy.load",
"argparse.ArgumentParser",
"random.choices",
"msr.utils.Timer",
"torch.empty",
"msr.reformulation.query_reformulation.QueryReformulator",
"collections.defaultdict",
"logging.Formatter",
"msr.reformulation.sampling.rank_sampling",
"msr.data... | [((1009, 1028), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1026, 1028), False, 'import logging\n'), ((1153, 1191), 'prettytable.PrettyTable', 'PrettyTable', (["['Modules', 'Parameters']"], {}), "(['Modules', 'Parameters'])\n", (1164, 1191), False, 'from prettytable import PrettyTable\n'), ((8006, 8013... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 20 11:14:34 2021
@author: maout
"""
import numpy as np
from scipy.spatial.distance import cdist
from score_function_estimators import my_cdist
def K(x,y,l,multil=False):
if multil:
res = np.ones((x.shape[0],y.shape[0]))
#... | [
"scipy.spatial.distance.cdist",
"numpy.zeros",
"numpy.ones",
"score_function_estimators.my_cdist",
"numpy.random.random",
"numpy.exp",
"numpy.random.normal",
"numpy.testing.assert_allclose"
] | [((1423, 1452), 'numpy.random.random', 'np.random.random', ([], {'size': '(4, 2)'}), '(size=(4, 2))\n', (1439, 1452), True, 'import numpy as np\n'), ((1456, 1485), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(4, 2)'}), '(size=(4, 2))\n', (1472, 1485), True, 'import numpy as np\n'), ((1573, 1607), 'numpy.t... |
import os.path as osp
import time
from collections import OrderedDict
from os import makedirs
from pathlib import Path
import neat
import numpy as np
import torch
from progressbar import ProgressBar, Bar, AdaptiveETA, Percentage, SimpleProgress, FileTransferSpeed
from pytorch_neat.cppn import create_cppn
from .mesh i... | [
"torch.sqrt",
"progressbar.Percentage",
"pathlib.Path",
"progressbar.FileTransferSpeed",
"numpy.prod",
"os.path.dirname",
"progressbar.Bar",
"neat.Checkpointer",
"torch.zeros_like",
"neat.species.Species",
"numpy.indices",
"progressbar.ProgressBar",
"os.makedirs",
"neat.config.Config",
"... | [((575, 608), 'numpy.indices', 'np.indices', (['(x_vox, y_vox, z_vox)'], {}), '((x_vox, y_vox, z_vox))\n', (585, 608), True, 'import numpy as np\n'), ((856, 909), 'torch.sqrt', 'torch.sqrt', (['(input_tensor_x ** 2 + input_tensor_y ** 2)'], {}), '(input_tensor_x ** 2 + input_tensor_y ** 2)\n', (866, 909), False, 'impor... |
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"numpy.maximum",
"numpy.array_equal",
"random.sample",
"random.shuffle",
"six.moves.zip",
"six.iteritems",
"mathematics_dataset.util.combinatorics.uniform_non_negative_integers_with_sum",
"mathematics_dataset.sample.polynomials.coefficients_to_polynomial",
"random.randint",
"six.moves.range",
"m... | [((1369, 1421), 'collections.namedtuple', 'collections.namedtuple', (['"""Polynomial"""', '"""coefficients"""'], {}), "('Polynomial', 'coefficients')\n", (1391, 1421), False, 'import collections\n'), ((2669, 2733), 'collections.namedtuple', 'collections.namedtuple', (['"""SampleArgs"""', "('num_modules', 'entropy')"], ... |
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from .db_model import User
from .twitter import nlp, tweet_vector
def predict_user(user_1, user_2, tweet_text):
user1 = User.query.filter(User.username == user_1).one()
user2 = User.query.filter(User.username == user_2).one()
user1_emb... | [
"sklearn.neighbors.KNeighborsClassifier",
"numpy.array",
"numpy.vstack"
] | [((325, 373), 'numpy.array', 'np.array', (['[tweet.embed for tweet in user1.tweet]'], {}), '([tweet.embed for tweet in user1.tweet])\n', (333, 373), True, 'import numpy as np\n'), ((392, 440), 'numpy.array', 'np.array', (['[tweet.embed for tweet in user2.tweet]'], {}), '([tweet.embed for tweet in user2.tweet])\n', (400... |
#!/usr/bin/env python3
import os
import glob
#os.environ['CUDA_VISIBLE_DEVICES'] = '2'
import numpy as np
import fid
from scipy.misc import imread
import tensorflow as tf
########
# PATHS
########
base_path = '/home/lz01a008/git/learning-object-representations-by-mixing-scenes/src/datasets/coco/2017_test/version/v1/'... | [
"fid.create_inception_graph",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"fid.check_or_download_inception",
"numpy.savez_compressed",
"fid.calculate_activation_statistics",
"os.path.join"
] | [((333, 364), 'os.path.join', 'os.path.join', (['base_path', '"""full"""'], {}), "(base_path, 'full')\n", (345, 364), False, 'import os\n'), ((413, 466), 'os.path.join', 'os.path.join', (['base_path', '"""fid"""', '"""te_v1_fid_stats.npz"""'], {}), "(base_path, 'fid', 'te_v1_fid_stats.npz')\n", (425, 466), False, 'impo... |
# -*- coding: utf-8 -*-
from bcipy.helpers.stimuli import best_case_rsvp_seq_gen
from bcipy.helpers.task import SPACE_CHAR
from typing import Dict, List
import logging
import numpy as np
import string
log = logging.getLogger(__name__)
class EvidenceFusion(object):
""" Fuses likelihood evidences provided by the ... | [
"bcipy.helpers.stimuli.best_case_rsvp_seq_gen",
"numpy.sum",
"numpy.argmax",
"numpy.ones",
"numpy.max",
"numpy.where",
"logging.getLogger"
] | [((209, 236), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (226, 236), False, 'import logging\n'), ((14905, 15099), 'bcipy.helpers.stimuli.best_case_rsvp_seq_gen', 'best_case_rsvp_seq_gen', (['self.alphabet', "self.list_epoch[-1]['list_distribution'][-1]"], {'stim_number': '(1)', 'is_tx... |
# Distributed under the terms of the BSD 3-Clause License.
# The full license is in the file LICENSE, distributed with this software.
#
# Author: <NAME> <<EMAIL>>
# Copyright (c) 2020, European X-Ray Free-Electron Laser Facility GmbH.
# All rights reserved.
import numpy as np
from .functor import Functor
class Map... | [
"numpy.dtype",
"numpy.zeros",
"threading.local",
"multiprocessing.get_context",
"os.cpu_count",
"mmap.mmap",
"queue.Queue"
] | [((1919, 1947), 'numpy.zeros', 'np.zeros', (['shape'], {'dtype': 'dtype'}), '(shape, dtype=dtype)\n', (1927, 1947), True, 'import numpy as np\n'), ((6476, 6483), 'queue.Queue', 'Queue', ([], {}), '()\n', (6481, 6483), False, 'from queue import Queue\n'), ((6514, 6521), 'threading.local', 'local', ([], {}), '()\n', (651... |
'''
Code for the implementation of
"Spatially-Variant CNN-based Point Spread Function Estimation for Blind Deconvolution and Depth Estimation in Optical Microscopy"
Copyright (c) 2020 Idiap Research Institute, https://www.idiap.ch/
Written by <NAME> <<EMAIL>>,
All rights reserved.
This file is part of Spatially-Varia... | [
"h5py.File",
"numpy.sum",
"argparse.ArgumentParser",
"random.randint",
"random.shuffle",
"numpy.dtype",
"numpy.zeros",
"random.choice",
"numpy.var",
"numpy.min",
"glob.glob",
"imageio.imsave",
"numpy.fromstring",
"skimage.io.imread"
] | [((2794, 2824), 'glob.glob', 'glob.glob', (['"""../input_images/*"""'], {}), "('../input_images/*')\n", (2803, 2824), False, 'import glob\n'), ((2825, 2850), 'random.shuffle', 'random.shuffle', (['file_list'], {}), '(file_list)\n', (2839, 2850), False, 'import random\n'), ((2007, 2083), 'argparse.ArgumentParser', 'argp... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import pickle
from Checkboard import Options, Instance, checkboardHelper
__author__ = 'spacegoing'
root_path = '/Users/spacegoing/macCodeLab-MBP2015/HonoursDoc/ExperimentsLatex/temp/'
checkboard_image_path = root_path + 'checkboard_images/'
sy... | [
"matplotlib.pyplot.title",
"numpy.sum",
"Checkboard.Instance",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.close",
"numpy.asarray",
"numpy.zeros",
"Checkboard.checkboardHelper",
"pickle.load",
"matplotlib.pyplot.savefig"
] | [((1154, 1164), 'Checkboard.Instance', 'Instance', ([], {}), '()\n', (1162, 1164), False, 'from Checkboard import Options, Instance, checkboardHelper\n'), ((1169, 1230), 'matplotlib.pyplot.imshow', 'plt.imshow', (['instance.y'], {'cmap': '"""Greys"""', 'interpolation': '"""nearest"""'}), "(instance.y, cmap='Greys', int... |
import numpy as np
import scipy.linalg as la
## Descompunere LU
# Matricea dată la intrare
A = np.array([
[2, -1, -2],
[4, 2, 0],
[0, -2, -1],
], dtype=np.float64)
A = np.array([
[1, 2, 3],
[4, 5, 6],
[7, 8, 10],
], dtype=np.float64)
N = A.shape[0]
P = np.eye(N)
L = np.zeros((N, N))
U = n... | [
"numpy.outer",
"numpy.abs",
"numpy.copy",
"numpy.zeros",
"numpy.array",
"numpy.eye"
] | [((98, 163), 'numpy.array', 'np.array', (['[[2, -1, -2], [4, 2, 0], [0, -2, -1]]'], {'dtype': 'np.float64'}), '([[2, -1, -2], [4, 2, 0], [0, -2, -1]], dtype=np.float64)\n', (106, 163), True, 'import numpy as np\n'), ((185, 247), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6], [7, 8, 10]]'], {'dtype': 'np.float64'}... |
"""Visualizations of historical data, flooding zones, and stations."""
import numpy as np
from plotly.subplots import make_subplots
import plotly.graph_objects as go
from plotly.offline import plot
from floodsystem.analysis import polyfit
from floodsystem.warning import SeverityLevel
def create_water_levels_plot(lis... | [
"plotly.graph_objects.Scatter",
"plotly.graph_objects.Figure",
"floodsystem.analysis.polyfit",
"plotly.offline.plot",
"numpy.linspace"
] | [((3214, 3239), 'plotly.offline.plot', 'plot', (['fig'], {'auto_open': '(True)'}), '(fig, auto_open=True)\n', (3218, 3239), False, 'from plotly.offline import plot\n'), ((4474, 4499), 'plotly.offline.plot', 'plot', (['fig'], {'auto_open': '(True)'}), '(fig, auto_open=True)\n', (4478, 4499), False, 'from plotly.offline ... |
from keras.applications.vgg16 import preprocess_input,VGG16
from keras.layers import Dense
from keras.models import Model
import numpy as np
from PIL import Image
##编译模型,以较小的学习参数进行训练
from keras.optimizers import SGD
sgd = SGD(lr=0.00001, momentum=0.9)
def load_model():
"""加载模型"""
model = VGG16(weights=None,clas... | [
"keras.optimizers.SGD",
"numpy.argmax",
"PIL.Image.open",
"PIL.Image.fromarray",
"numpy.array",
"keras.applications.vgg16.VGG16"
] | [((222, 249), 'keras.optimizers.SGD', 'SGD', ([], {'lr': '(1e-05)', 'momentum': '(0.9)'}), '(lr=1e-05, momentum=0.9)\n', (225, 249), False, 'from keras.optimizers import SGD\n'), ((297, 327), 'keras.applications.vgg16.VGG16', 'VGG16', ([], {'weights': 'None', 'classes': '(4)'}), '(weights=None, classes=4)\n', (302, 327... |
"""State of a Bayesian quadrature method."""
from typing import Optional, Tuple
import numpy as np
from probnum.quad._integration_measures import IntegrationMeasure
from probnum.quad.kernel_embeddings import KernelEmbedding
from probnum.randprocs.kernels import Kernel
from probnum.random_variables import Normal
# p... | [
"probnum.quad.kernel_embeddings.KernelEmbedding",
"numpy.empty",
"numpy.array"
] | [((2208, 2222), 'numpy.array', 'np.array', (['[[]]'], {}), '([[]])\n', (2216, 2222), True, 'import numpy as np\n'), ((2259, 2271), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2267, 2271), True, 'import numpy as np\n'), ((2372, 2404), 'probnum.quad.kernel_embeddings.KernelEmbedding', 'KernelEmbedding', (['kernel... |
import logging
import numpy as np
import alibi
from alibi.api.interfaces import Explanation
from alibiexplainer.explainer_wrapper import ExplainerWrapper
from alibiexplainer.constants import SELDON_LOGLEVEL
from typing import Callable, List, Optional
logging.basicConfig(level=SELDON_LOGLEVEL)
class KernelShap(Explai... | [
"logging.info",
"numpy.array",
"logging.basicConfig"
] | [((252, 294), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'SELDON_LOGLEVEL'}), '(level=SELDON_LOGLEVEL)\n', (271, 294), False, 'import logging\n'), ((747, 763), 'numpy.array', 'np.array', (['inputs'], {}), '(inputs)\n', (755, 763), True, 'import numpy as np\n'), ((825, 878), 'logging.info', 'logging.in... |
import collections
import os
import shutil
import struct
import unittest
import numpy as np
import aspecd.io
import trepr.io
import trepr.dataset
ROOTPATH = os.path.split(os.path.abspath(__file__))[0]
class TestDatasetImporterFactory(unittest.TestCase):
def setUp(self):
self.factory = trepr.io.DatasetI... | [
"os.path.abspath",
"os.remove",
"os.path.exists",
"struct.pack",
"numpy.random.random",
"numpy.arange",
"shutil.rmtree",
"os.path.split",
"os.path.join",
"os.listdir"
] | [((174, 199), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (189, 199), False, 'import os\n'), ((467, 512), 'os.path.join', 'os.path.join', (['ROOTPATH', '"""testdata"""', '"""speksim"""'], {}), "(ROOTPATH, 'testdata', 'speksim')\n", (479, 512), False, 'import os\n'), ((936, 990), 'os.path.j... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology.
# SPDX-FileCopyrightText: © 2021 <NAME> <<EMAIL>>
# NOTICE: authors should document their contributions in concisely in NOTICE
# with details inline in source files... | [
"numpy.asarray",
"numpy.concatenate",
"numpy.exp",
"numpy.all"
] | [((11789, 11806), 'numpy.asarray', 'np.asarray', (['roots'], {}), '(roots)\n', (11799, 11806), True, 'import numpy as np\n'), ((3490, 3537), 'numpy.exp', 'np.exp', (['(1.0j * np.pi * F_Hz / self.F_nyquist_Hz)'], {}), '(1.0j * np.pi * F_Hz / self.F_nyquist_Hz)\n', (3496, 3537), True, 'import numpy as np\n'), ((11921, 11... |
"""
Mask RCNN
Configurations and data loading code for disease dataset from airport.
Copyright (c) 2020 <NAME>
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
--------------------------------------------------
Usage:
run from the command line as such:
# Train a new model starting ... | [
"sys.path.append",
"mrcnn.utils.download_trained_weights",
"os.path.abspath",
"argparse.ArgumentParser",
"imgaug.augmenters.LinearContrast",
"os.path.exists",
"imgaug.augmenters.Fliplr",
"imgaug.augmenters.Affine",
"imgaug.augmenters.Flipud",
"numpy.array",
"imgaug.augmenters.Crop",
"imgaug.au... | [((958, 983), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (973, 983), False, 'import os\n'), ((1004, 1029), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (1019, 1029), False, 'import sys\n'), ((1201, 1231), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""l... |
import numpy
import time
def Test(function, data_size):
amount = 50
elapsed_sum = 0
for i in range(0, amount):
random_int_array = numpy.random.randint(100, size=data_size)
start_time = time.clock()
result = function(random_int_array)
elapsed = time.clock() - start_time
elapsed_sum += elapsed
average ... | [
"numpy.random.randint",
"time.clock"
] | [((137, 178), 'numpy.random.randint', 'numpy.random.randint', (['(100)'], {'size': 'data_size'}), '(100, size=data_size)\n', (157, 178), False, 'import numpy\n'), ((195, 207), 'time.clock', 'time.clock', ([], {}), '()\n', (205, 207), False, 'import time\n'), ((258, 270), 'time.clock', 'time.clock', ([], {}), '()\n', (2... |
import pandas as pd
import numpy as np
import struct
import random
def SCIDReaderGen(scid):
s_IntradayHeader = '=4sIIHHI36s'
s_IntradayRecord = '=qffffIIII'
header = scid.read(struct.calcsize(s_IntradayHeader))
yield header
while True:
buf = scid.read(struct.calcsize(s_IntradayRecord))
... | [
"pandas.DataFrame",
"numpy.roll",
"struct.unpack",
"random.choice",
"struct.calcsize",
"numpy.array",
"numpy.repeat"
] | [((604, 755), 'pandas.DataFrame', 'pd.DataFrame', (['reader'], {'columns': "['StartDateTime', 'OpenPrice', 'HighPrice', 'LowPrice', 'LastPrice',\n 'NumTrades', 'Volume', 'BidVolume', 'AskVolume']"}), "(reader, columns=['StartDateTime', 'OpenPrice', 'HighPrice',\n 'LowPrice', 'LastPrice', 'NumTrades', 'Volume', 'B... |
""" converted from Matlab code
source: http://www.robots.ox.ac.uk/~fwood/teaching/AIMS_CDT_ML_2015/homework/HW_2_em/
"""
import numpy as np
import scipy.stats
def e_step_gaussian_mixture(data, pi, mu, sigma):
""" Returns a matrix of responsibilities.
%
% @param data : data matrix n x d with rows as el... | [
"numpy.zeros",
"numpy.sum"
] | [((672, 688), 'numpy.zeros', 'np.zeros', (['(n, k)'], {}), '((n, k))\n', (680, 688), True, 'import numpy as np\n'), ((1027, 1048), 'numpy.sum', 'np.sum', (['gamma'], {'axis': '(1)'}), '(gamma, axis=1)\n', (1033, 1048), True, 'import numpy as np\n')] |
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
## we want to create a video of images
images_names = np.array([
"5.jpg",
... | [
"cv2.putText",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"cv2.rectangle",
"pip._internal.main",
"numpy.array",
"cv2.CascadeClassifier",
"cv2.destroyAllWindows"
] | [((296, 432), 'numpy.array', 'np.array', (["['5.jpg', 'avatar.jpg', 'blog-post-1.jpg', 'person_1.jpg', 'person_2.jpg',\n 'person_3.jpg', 'person_4.jpg', 'person_5.jpg']"], {}), "(['5.jpg', 'avatar.jpg', 'blog-post-1.jpg', 'person_1.jpg',\n 'person_2.jpg', 'person_3.jpg', 'person_4.jpg', 'person_5.jpg'])\n", (304,... |
# Copyright 2019 The FastEstimator 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 appl... | [
"torch.utils.data.dataloader.default_collate",
"fastestimator.op.op.get_inputs_by_op",
"fastestimator.util.util.pad_batch",
"fastestimator.util.traceability_util.traceable",
"fastestimator.util.data.FilteredData",
"fastestimator.op.op.write_outputs_by_op",
"fastestimator.backend._to_tensor.to_tensor",
... | [((1196, 1250), 'typing.TypeVar', 'TypeVar', (['"""Tensor"""', 'tf.Tensor', 'torch.Tensor', 'np.ndarray'], {}), "('Tensor', tf.Tensor, torch.Tensor, np.ndarray)\n", (1203, 1250), False, 'from typing import Any, Callable, Dict, Iterable, List, MutableMapping, Optional, TypeVar, Union\n'), ((1254, 1265), 'fastestimator.u... |
import ad_path
import numpy as np
from antenna_diversity import diversity_technique
ad_path.nop()
#
# contruct a channel h
h = np.array([0.8, 1.2, 1])
# create signal
x = np.matrix('1 2 3 ; 4 5 6 ; 7 8 9')
print('x:', x)
# selection from h example
y, index = diversity_technique.selection_from_h(x, h)
# selection f... | [
"numpy.matrix",
"ad_path.nop",
"antenna_diversity.diversity_technique.selection_from_power",
"numpy.array",
"antenna_diversity.diversity_technique.selection_from_h"
] | [((85, 98), 'ad_path.nop', 'ad_path.nop', ([], {}), '()\n', (96, 98), False, 'import ad_path\n'), ((130, 153), 'numpy.array', 'np.array', (['[0.8, 1.2, 1]'], {}), '([0.8, 1.2, 1])\n', (138, 153), True, 'import numpy as np\n'), ((174, 208), 'numpy.matrix', 'np.matrix', (['"""1 2 3 ; 4 5 6 ; 7 8 9"""'], {}), "('1 2 3 ; 4... |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"keras.Input",
"keras.Model",
"keras.layers.preprocessing.reduction.Reduction",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.ragged.constant",
"numpy.array",
"absl.testing.parameterized.named_parameters"
] | [((1037, 1576), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["{'testcase_name': 'max', 'reduction_str': 'max', 'expected_output': [[3.0, \n 3.0], [3.0, 2.0]]}", "{'testcase_name': 'mean', 'reduction_str': 'mean', 'expected_output': [[2.0,\n 2.0], [2.0, 1.5]]}", "{'testcase_na... |
# index to i and j conversion
# ind: index
# m: height of image
# i, j: image coordinates
import numpy as np
def ind2ij(ind, m):
i = np.mod(ind, m)
j = np.uint(np.floor(ind/m))
return i, j
| [
"numpy.floor",
"numpy.mod"
] | [((154, 168), 'numpy.mod', 'np.mod', (['ind', 'm'], {}), '(ind, m)\n', (160, 168), True, 'import numpy as np\n'), ((186, 203), 'numpy.floor', 'np.floor', (['(ind / m)'], {}), '(ind / m)\n', (194, 203), True, 'import numpy as np\n')] |
import pandas as pd
import numpy as np
import requests
import json
import pickle
import os
from sklearn.preprocessing import OneHotEncoder
from sklearn.neighbors import NearestNeighbors
from sklearn.base import BaseEstimator, TransformerMixin
from flask import Blueprint, request, jsonify, render_template, Flask, redi... | [
"numpy.array",
"pandas.DataFrame",
"flask.Blueprint",
"flask.render_template"
] | [((386, 414), 'flask.Blueprint', 'Blueprint', (['"""appli"""', '__name__'], {}), "('appli', __name__)\n", (395, 414), False, 'from flask import Blueprint, request, jsonify, render_template, Flask, redirect, url_for\n'), ((1261, 1293), 'flask.render_template', 'render_template', (['"""track_id.html"""'], {}), "('track_i... |
# The training codes of the dummy model
import os
import argparse
import dgl
import torch
import torch as th
import torch.nn as nn
import torch.nn.functional as F
from dgl import save_graphs
from models import dummy_gnn_model, GCNII, GAT
from gengraph import gen_syn1, gen_syn2, gen_syn3, gen_syn4, gen_syn... | [
"models.GCNII",
"numpy.random.seed",
"argparse.ArgumentParser",
"gengraph.gen_syn4",
"torch.manual_seed",
"gengraph.gen_syn1",
"torch.cuda.manual_seed",
"torch.nn.CrossEntropyLoss",
"dgl.from_networkx",
"gengraph.gen_syn5",
"torch.save",
"gengraph.gen_syn2",
"torch.optim.Adam",
"random.see... | [((851, 873), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (862, 873), False, 'import random\n'), ((879, 904), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (893, 904), True, 'import numpy as np\n'), ((910, 938), 'torch.manual_seed', 'torch.manual_seed', (['args.see... |
"""
Copyright (c) 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | [
"mo.front.common.partial_infer.utils.mark_input_bins",
"numpy.array",
"numpy.maximum",
"numpy.prod"
] | [((989, 1013), 'numpy.prod', 'np.prod', (['input_shape[1:]'], {}), '(input_shape[1:])\n', (996, 1013), True, 'import numpy as np\n'), ((1207, 1266), 'numpy.array', 'np.array', (['[output_channels, input_channels]'], {'dtype': 'np.int64'}), '([output_channels, input_channels], dtype=np.int64)\n', (1215, 1266), True, 'im... |
import numpy as np
# discount rewards used by Karpathy (cf. https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5)
def discount_rewards(r, gamma, y_pred):
""" take 1D float array of rewards and compute discounted reward """
r = np.array(r)
y_pred = np.array(y_pred)
discounted_r = np.zeros_like(r).a... | [
"numpy.zeros_like",
"numpy.array"
] | [((245, 256), 'numpy.array', 'np.array', (['r'], {}), '(r)\n', (253, 256), True, 'import numpy as np\n'), ((268, 284), 'numpy.array', 'np.array', (['y_pred'], {}), '(y_pred)\n', (276, 284), True, 'import numpy as np\n'), ((302, 318), 'numpy.zeros_like', 'np.zeros_like', (['r'], {}), '(r)\n', (315, 318), True, 'import n... |
import argparse
import h5py
import os
import numpy as np
def run():
parser = argparse.ArgumentParser()
parser.add_argument('input', type=str, help='Input file or input directory')
parser.add_argument('-o', '--output', type=str, help='Output file name')
parser.add_argument('-b_halo', type=float, hel... | [
"numpy.absolute",
"h5py.File",
"argparse.ArgumentParser",
"pygadgetreader.readsnap",
"os.path.isdir",
"IPython.embed",
"os.path.isfile",
"glob.glob",
"yt.load"
] | [((84, 109), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (107, 109), False, 'import argparse\n'), ((2359, 2384), 'os.path.isdir', 'os.path.isdir', (['args.input'], {}), '(args.input)\n', (2372, 2384), False, 'import os\n'), ((3076, 3142), 'IPython.embed', 'IPython.embed', ([], {'header': '""... |
# Copyright 2020 DeepMind Technologies Limited. 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 ... | [
"absl.testing.absltest.main",
"jax.random.PRNGKey",
"numpy.prod",
"haiku.transform_with_state",
"jax.random.uniform",
"haiku.scan",
"jax.jit",
"jax.remat",
"haiku._src.integration.descriptors.module_type",
"haiku.remat",
"jax.numpy.broadcast_to",
"functools.partial",
"jax.vmap",
"jax.lax.s... | [((4924, 4985), 'haiku._src.test_utils.combined_named_parameters', 'test_utils.combined_named_parameters', (['descriptors.ALL_MODULES'], {}), '(descriptors.ALL_MODULES)\n', (4960, 4985), False, 'from haiku._src import test_utils\n'), ((5840, 5901), 'haiku._src.test_utils.combined_named_parameters', 'test_utils.combined... |
import numpy as np
class Sgd:
def __init__(self, lr, batch_size):
self.lr = lr
self.batch_size = batch_size
def update(self, weights, biases, grad_w, grad_b):
for i, (w, gw) in enumerate(zip(weights, grad_w)):
weights[i] = w - self.lr * gw / self.batch_size
for i, ... | [
"numpy.zeros",
"numpy.sqrt"
] | [((769, 786), 'numpy.zeros', 'np.zeros', (['w.shape'], {}), '(w.shape)\n', (777, 786), True, 'import numpy as np\n'), ((839, 856), 'numpy.zeros', 'np.zeros', (['b.shape'], {}), '(b.shape)\n', (847, 856), True, 'import numpy as np\n'), ((2224, 2241), 'numpy.zeros', 'np.zeros', (['w.shape'], {}), '(w.shape)\n', (2232, 22... |
def test_TextSnake(config_file):
import sys
sys.path.append('./detection_model/TextSnake_pytorch')
import os
import time
import numpy as np
import torch
import json
import torch.backends.cudnn as cudnn
import torch.utils.data as data
import torch.nn.functional as func
from... | [
"os.mkdir",
"numpy.sum",
"numpy.greater",
"util.config.update_config",
"os.path.join",
"sys.path.append",
"cv2.contourArea",
"util.misc.to_device",
"torch.utils.data.DataLoader",
"cv2.imwrite",
"torch.load",
"os.path.exists",
"util.config.print_config",
"torch.cuda.set_device",
"cv2.resi... | [((52, 106), 'sys.path.append', 'sys.path.append', (['"""./detection_model/TextSnake_pytorch"""'], {}), "('./detection_model/TextSnake_pytorch')\n", (67, 106), False, 'import sys\n'), ((11091, 11128), 'torch.cuda.set_device', 'torch.cuda.set_device', (['opt.num_device'], {}), '(opt.num_device)\n', (11112, 11128), False... |
import cv2
import numpy as np
# Load the cascade
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
# To capture video from webcam.
cap = cv2.VideoCapture(0)
cap.set(3,640)
cap.set(4,480)
cap.set(10,100)
# To use a video file as input
# cap = cv2.VideoCapture('filename.mp4')
while True:
... | [
"cv2.HoughCircles",
"cv2.circle",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.VideoCapture",
"cv2.rectangle",
"numpy.around",
"cv2.CascadeClassifier",
"cv2.imshow"
] | [((65, 125), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_frontalface_default.xml"""'], {}), "('haarcascade_frontalface_default.xml')\n", (86, 125), False, 'import cv2\n'), ((165, 184), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (181, 184), False, 'import cv2\n'), ((405, 442)... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import scipy as sp
from scipy.stats import chi2
from sklearn import datasets
from scipy.stats import chi2
import statsmodels.api as sm
from adjustText import adjust_text
from .utils import *
def missing_bars(data,figsize=(10,... | [
"matplotlib.pyplot.title",
"seaborn.lineplot",
"seaborn.heatmap",
"numpy.argmax",
"adjustText.adjust_text",
"matplotlib.pyplot.figure",
"numpy.mean",
"pandas.DataFrame",
"numpy.zeros_like",
"scipy.linalg.inv",
"numpy.linspace",
"numpy.triu_indices_from",
"numpy.cov",
"matplotlib.pyplot.sub... | [((2046, 2056), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2054, 2056), True, 'import matplotlib.pyplot as plt\n'), ((3022, 3045), 'numpy.zeros_like', 'np.zeros_like', (['corr_mat'], {}), '(corr_mat)\n', (3035, 3045), True, 'import numpy as np\n'), ((3330, 3340), 'matplotlib.pyplot.show', 'plt.show', ([],... |
# BSD 3-Clause License
# Copyright (c) 2019, regain authors
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# lis... | [
"numpy.zeros_like",
"numpy.random.shuffle",
"numpy.unique",
"numpy.argmin",
"numpy.max",
"numpy.where",
"numpy.array",
"sklearn.clusters.AgglomerativeClustering",
"warnings.warn",
"numpy.all"
] | [((1820, 1840), 'numpy.zeros_like', 'np.zeros_like', (['g_bin'], {}), '(g_bin)\n', (1833, 1840), True, 'import numpy as np\n'), ((3162, 3184), 'numpy.random.shuffle', 'np.random.shuffle', (['ixs'], {}), '(ixs)\n', (3179, 3184), True, 'import numpy as np\n'), ((3198, 3214), 'numpy.array', 'np.array', (['graphs'], {}), '... |
"""
ic_tools.py: Useful functions for checking or working with internal coordinates
Copyright 2016-2020 Regents of the University of California and the Authors
Authors: <NAME>, <NAME>
Contributors: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>
Redistribution and use in source and binary forms, with or with... | [
"numpy.linalg.eigh",
"numpy.zeros_like",
"numpy.zeros",
"numpy.linspace"
] | [((2349, 2366), 'numpy.zeros_like', 'np.zeros_like', (['Gq'], {}), '(Gq)\n', (2362, 2366), True, 'import numpy as np\n'), ((3365, 3396), 'numpy.zeros', 'np.zeros', (['(nc, nc)'], {'dtype': 'float'}), '((nc, nc), dtype=float)\n', (3373, 3396), True, 'import numpy as np\n'), ((2409, 2426), 'numpy.zeros_like', 'np.zeros_l... |
import pygame
import os
from OpenGL.GL import *
from OpenGL.GL.VERSION.GL_1_0 import glLoadMatrixd
from OpenGL.GL.exceptional import glBegin, glEnd
from OpenGL.GL.images import glDrawPixels
from OpenGL.raw.GL.VERSION.GL_1_0 import glViewport, glMatrixMode, glLoadIdentity, glEnable, glShadeModel, \
glClearColor, glC... | [
"pygame.event.get",
"OpenGL.raw.GL.VERSION.GL_1_0.glEnable",
"OpenGL.raw.GL.VERSION.GL_1_0.glPushMatrix",
"OpenGL.raw.GL.VERSION.GL_1_0.glOrtho",
"OpenGL.raw.GL.VERSION.GL_1_0.glViewport",
"threading.Thread.__init__",
"pygame.font.SysFont",
"OpenGL.GL.exceptional.glEnd",
"pygame.display.set_mode",
... | [((1473, 1492), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (1490, 1492), False, 'import pygame\n'), ((1647, 1663), 'transform.Transformation', 'Transformation', ([], {}), '()\n', (1661, 1663), False, 'from transform import Transformation\n'), ((1811, 1824), 'pygame.init', 'pygame.init', ([], {}), '()\n... |
import torch
import numpy as np
from stochastic import LDAF_Stochastic
from distributions import UpdatedNormal
import pytorch_lightning as pl
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
from pytorch_lightning.callbacks import ModelCheckpoint
from torchvision.datasets import FashionMNIST
import... | [
"torch.utils.data.Subset",
"numpy.load",
"pytorch_lightning.Trainer",
"torchvision.datasets.FashionMNIST",
"torch.utils.data.DataLoader",
"distributions.UpdatedNormal",
"stochastic.LDAF_Stochastic.load_from_checkpoint",
"torchvision.transforms.Grayscale",
"torchvision.transforms.Normalize",
"torch... | [((843, 929), 'torchvision.datasets.FashionMNIST', 'FashionMNIST', ([], {'root': 'dset_path', 'train': '(True)', 'transform': 'transform_basic', 'download': '(True)'}), '(root=dset_path, train=True, transform=transform_basic,\n download=True)\n', (855, 929), False, 'from torchvision.datasets import FashionMNIST\n'),... |
import numpy as np
def pathloss_bs_users(d):
"""
d: distance between user and bs in km
returns the pathloss, in magnitude
"""
pathloss = 15.3+37.6*np.log10(d) # pathloss in db
pathloss = 10**(pathloss/10)
return pathloss
def pathloss_bs_users_db(d):
"""
d: distance between user ... | [
"numpy.log10"
] | [((169, 180), 'numpy.log10', 'np.log10', (['d'], {}), '(d)\n', (177, 180), True, 'import numpy as np\n'), ((398, 409), 'numpy.log10', 'np.log10', (['d'], {}), '(d)\n', (406, 409), True, 'import numpy as np\n'), ((585, 596), 'numpy.log10', 'np.log10', (['d'], {}), '(d)\n', (593, 596), True, 'import numpy as np\n'), ((80... |
# -*- coding: utf-8 -*-
import numpy as np
from net import Controller
from director import vtkAll as vtk
from director.debugVis import DebugData
from director import ioUtils, filterUtils
class MovingObject(object):
"""Moving object."""
def __init__(self, velocity, polydata):
"""Constructs a MovingO... | [
"numpy.random.choice",
"numpy.zeros_like",
"numpy.arctan2",
"director.debugVis.DebugData",
"numpy.degrees",
"numpy.argmax",
"director.ioUtils.readPolyData",
"numpy.hstack",
"director.vtkAll.vtkTransform",
"net.Controller",
"numpy.array",
"numpy.sin",
"numpy.cos",
"numpy.random.random",
"... | [((440, 465), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (448, 465), True, 'import numpy as np\n'), ((2172, 2192), 'numpy.zeros_like', 'np.zeros_like', (['state'], {}), '(state)\n', (2185, 2192), True, 'import numpy as np\n'), ((3196, 3214), 'director.vtkAll.vtkTransform', 'vtk.vtkTran... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import unittest
from pathlib import Path
import sys
import numpy as np
import tensorflow as tf
sys.path.append(str(Path(__file__).absolute().parent.parent))
from model.model_factory import ModelFactory
from model.cifar_resnet_models import CifarResNet8, CifarRe... | [
"tensorflow.random.set_seed",
"numpy.random.seed",
"model.model_factory.ModelFactory.create_model",
"model.cifar_resnet_models.CifarResNet44",
"numpy.allclose",
"model.cifar_resnet_models.CifarResNet20",
"numpy.zeros",
"numpy.ones",
"pathlib.Path",
"model.cifar_resnet_models.CifarResNet8",
"nump... | [((2062, 2083), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(1)'], {}), '(1)\n', (2080, 2083), True, 'import tensorflow as tf\n'), ((2092, 2109), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (2106, 2109), True, 'import numpy as np\n'), ((2127, 2151), 'numpy.zeros', 'np.zeros', (['(1, 32, 32... |
import os
import pandas as pd
import numpy as np
from itertools import chain
from codifyComplexes.CodifyComplexException import CodifyComplexException
from .DataLoaderClass import DataLoader
class AbstractProtocol(DataLoader):
'''
This class is a template for codification protocols
'''
DESIRED_ORDER=["L",... | [
"pandas.DataFrame",
"os.listdir",
"numpy.sum",
"os.path.join",
"numpy.std",
"pandas.merge",
"numpy.ones",
"numpy.max",
"numpy.mean",
"numpy.min",
"codifyComplexes.CodifyComplexException.CodifyComplexException",
"itertools.chain.from_iterable",
"pandas.concat"
] | [((22670, 22701), 'pandas.DataFrame', 'pd.DataFrame', (['aggregatedResults'], {}), '(aggregatedResults)\n', (22682, 22701), True, 'import pandas as pd\n'), ((23924, 23955), 'pandas.DataFrame', 'pd.DataFrame', (['aggregatedResults'], {}), '(aggregatedResults)\n', (23936, 23955), True, 'import pandas as pd\n'), ((15051, ... |
import numpy as np
target_R=np.linspace(1.01,1.6,num=100)
file_directory="./"
flicks_file="flicks.0441995"
frames_per_step=10
frames_per_sec=20
pad_start_frames=10
pad_end_frames=10
plot_field_lines=True
R_start =[+1.000,+1.000,+1.000,+1.000,+1.000,+1.000,+1.000,+1.000,+1.000,+1.000,+1.000,+1.000,+1.000,+1.000... | [
"mayavi.mlab.mesh",
"numpy.meshgrid",
"mayavi.mlab.figure",
"mayavi.mlab.colorbar",
"scipy.interpolate.griddata",
"mayavi.mlab.clf",
"mayavi.mlab.plot3d",
"numpy.sin",
"subprocess.call",
"numpy.array",
"numpy.cos",
"numpy.linspace",
"mayavi.mlab.view",
"numpy.delete",
"numpy.sqrt"
] | [((30, 61), 'numpy.linspace', 'np.linspace', (['(1.01)', '(1.6)'], {'num': '(100)'}), '(1.01, 1.6, num=100)\n', (41, 61), True, 'import numpy as np\n'), ((1066, 1098), 'numpy.linspace', 'np.linspace', (['(0.0)', 'np.pi'], {'num': '(400)'}), '(0.0, np.pi, num=400)\n', (1077, 1098), True, 'import numpy as np\n'), ((1106,... |
# -*- coding: utf-8 -*-
"""
@author: JulienWuthrich
"""
import os
import json
import requests
import logging
import time
import datetime
import numpy as np
from textblob import TextBlob
from bitcoinpred.config.settings import raw_data_path
from bitcoinpred.config.settings import logger
from bitcoinpred.config.logger... | [
"bitcoinpred.config.logger.logged",
"datetime.datetime.today",
"json.loads",
"datetime.datetime.now",
"bitcoinpred.config.settings.logger.log",
"time.sleep",
"numpy.mean",
"datetime.timedelta",
"textblob.TextBlob",
"requests.get",
"os.path.join",
"bitcoinpred.features.twitter.TweetCollector"
] | [((813, 852), 'bitcoinpred.config.logger.logged', 'logged', ([], {'level': 'logging.INFO', 'name': 'logger'}), '(level=logging.INFO, name=logger)\n', (819, 852), False, 'from bitcoinpred.config.logger import logged\n'), ((5233, 5272), 'bitcoinpred.config.logger.logged', 'logged', ([], {'level': 'logging.INFO', 'name': ... |
# coding=utf-8
# Copyright 2021 The init2winit Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
"absl.testing.absltest.main",
"numpy.random.seed",
"pandas.read_csv",
"tensorflow.compat.v1.io.gfile.listdir",
"numpy.ones",
"numpy.random.randint",
"numpy.tile",
"init2winit.trainer.train",
"init2winit.init_lib.initializers.get_initializer",
"shutil.rmtree",
"ml_collections.config_dict.config_d... | [((17711, 17726), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (17724, 17726), False, 'from absl.testing import absltest\n'), ((2329, 2400), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(0)', 'high': '_VOCAB_SIZE', 'size': '(batch_size, _MAX_LEN)'}), '(low=0, high=_VOCAB_SIZE, size=(ba... |
import numpy as np #数値計算用モジュール
import scipy.linalg #SciPyの線形計算ライブラリ
mat_A1 = np.array([
[ 2.0, 1.0, 1.0],
[ 1.0, 2.0, 1.0],
[ 1.0, 1.0, 2.0]
])
vec_b1 = np.array(
[ 7.0, 8.0, 9.0]
)
vec_x1 = scipy.linalg.solve(mat_A1,vec_b1)
print("vec_x1 = ", vec_x1)
print()
mat_A2 = np.array([
[ 1.0, 2.0, 3.... | [
"numpy.array"
] | [((81, 142), 'numpy.array', 'np.array', (['[[2.0, 1.0, 1.0], [1.0, 2.0, 1.0], [1.0, 1.0, 2.0]]'], {}), '([[2.0, 1.0, 1.0], [1.0, 2.0, 1.0], [1.0, 1.0, 2.0]])\n', (89, 142), True, 'import numpy as np\n'), ((169, 194), 'numpy.array', 'np.array', (['[7.0, 8.0, 9.0]'], {}), '([7.0, 8.0, 9.0])\n', (177, 194), True, 'import ... |
import numpy as np
import gym
import pickle
import os
SEED = 500 # 500 for halfcheetah, 600 for hopper, 700 for walker
num_tasks = 20
job_name_mtl = 'results/halfcheetah_mtl_gravity_exp'
os.makedirs(job_name_mtl, exist_ok=True)
np.random.seed(SEED)
gravity_factors = []
env_ids = []
for task_id in range(num_tasks)... | [
"numpy.random.rand",
"numpy.random.seed",
"os.makedirs"
] | [((192, 232), 'os.makedirs', 'os.makedirs', (['job_name_mtl'], {'exist_ok': '(True)'}), '(job_name_mtl, exist_ok=True)\n', (203, 232), False, 'import os\n'), ((234, 254), 'numpy.random.seed', 'np.random.seed', (['SEED'], {}), '(SEED)\n', (248, 254), True, 'import numpy as np\n'), ((397, 413), 'numpy.random.rand', 'np.r... |
"""
Implementation of CS-based quantizer with error feedback
Note that the seed of the graph must be set as well (tf.set_random_seed(.))
Because of limitatiosn of the shuffle oeprator
1- transpsoe of T is applied to the buckets
2- all buckets use the same shuffled T
"""
import numpy a... | [
"tensorflow.abs",
"tensorflow_probability.math.random_rademacher",
"tensorflow.control_dependencies",
"tensorflow.random.uniform",
"tensorflow.reshape",
"tensorflow.constant",
"tensorflow.transpose",
"tensorflow.no_op",
"tensorflow.matmul",
"tensorflow.multiply",
"tensorflow.cast",
"tensorflow... | [((1118, 1150), 'tensorflow.constant', 'tf.constant', (['T'], {'dtype': 'tf.float32'}), '(T, dtype=tf.float32)\n', (1129, 1150), True, 'import tensorflow as tf\n'), ((1205, 1290), 'tensorflow.random.uniform', 'tf.random.uniform', (['u_shape'], {'minval': '(-0.5)', 'maxval': '(0.5)', 'dtype': 'tf.float32', 'seed': 'seed... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"tensorflow.test.main",
"numpy.asarray",
"numpy.zeros",
"tensorflow.cast",
"tensorflow.zeros"
] | [((2810, 2824), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (2822, 2824), True, 'import tensorflow as tf\n'), ((1836, 2006), 'numpy.asarray', 'np.asarray', (['[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, \n 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]'... |
OIMI_R10_txt = '''
0.3293
0.3901
0.4874
0.5700
0.6859
0.7265
0.7550
0.7710
'''
OIMI_T_txt = '''
1.29
1.37
1.47
1.96
2.99
4.33
8.7
12.9
'''
IVF2M_R10_txt = '''
0.3836
0.4689
0.5886
0.6623
0.7564
0.7861
0.8108
0.8193
'''
IVF2M_T_txt = '''
0.33
0.34
0.45
0.55
1.01
1.52
2.67
3.85
'''
IVF4M_R10_txt = '''
0.4326
0.5213
0.6... | [
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.axis",
"seaborn.despine",
"matplotlib.pyplot.figure",
"re.findall",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"seaborn.set"
] | [((836, 874), 'seaborn.set', 'sns.set', ([], {'style': '"""ticks"""', 'palette': '"""Set2"""'}), "(style='ticks', palette='Set2')\n", (843, 874), True, 'import seaborn as sns\n'), ((875, 888), 'seaborn.despine', 'sns.despine', ([], {}), '()\n', (886, 888), True, 'import seaborn as sns\n'), ((944, 979), 're.findall', 'r... |
# nuScenes dev-kit.
# Code written by <NAME>, 2018.
import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from pyquaternion import Quaternion
from nuscenes.eval.detection.data_classes import EvalBox
from nuscenes.eval.detection.utils import attr_acc, scale_iou, yaw_diff, angle_diff, ... | [
"unittest.main",
"nuscenes.eval.detection.utils.center_distance",
"nuscenes.eval.detection.utils.cummean",
"nuscenes.eval.detection.utils.velocity_l2",
"nuscenes.eval.detection.utils.scale_iou",
"pyquaternion.Quaternion",
"numpy.array",
"numpy.linspace",
"nuscenes.eval.detection.utils.attr_acc",
"... | [((7644, 7659), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7657, 7659), False, 'import unittest\n'), ((533, 556), 'nuscenes.eval.detection.data_classes.EvalBox', 'EvalBox', ([], {'size': '(4, 4, 4)'}), '(size=(4, 4, 4))\n', (540, 556), False, 'from nuscenes.eval.detection.data_classes import EvalBox\n'), ((57... |
# -*- coding: utf-8 -*-
from os import listdir, remove
from os.path import join
from boto3 import Session
from moto import mock_s3
import numpy as np
import pandas as pd
import pytest
@pytest.fixture(scope="session")
def clean_receiving_dir():
# Clean receiving directory
for fname in listdir("receiving"):
... | [
"pandas.DataFrame",
"pytest.fixture",
"pandas.to_datetime",
"os.path.join",
"os.listdir",
"numpy.sqrt"
] | [((188, 219), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (202, 219), False, 'import pytest\n'), ((296, 316), 'os.listdir', 'listdir', (['"""receiving"""'], {}), "('receiving')\n", (303, 316), False, 'from os import listdir, remove\n'), ((3398, 3433), 'pandas.DataFrame',... |
#!/usr/bin/env python
##
# <NAME>, Plymouth University 2016
#
# In this example I show you how to train a Deep Neural Network (DNN)
# for the head pose estimation. It requires a pickle file containing
# some numpy matrix, representing the images and the labels necessary
# for the training (see ex_aflw_parser.py). I ca... | [
"tensorflow.square",
"numpy.copy",
"tensorflow.train.Saver",
"numpy.square",
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.truncated_normal",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.placeholder",
"tensorflow.matmul",
"tensorflow.Variable",
"tensorflow.zeros",
"ten... | [((4091, 4101), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (4099, 4101), True, 'import tensorflow as tf\n'), ((1187, 1201), 'six.moves.cPickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1198, 1201), True, 'from six.moves import cPickle as pickle\n'), ((1899, 1925), 'numpy.copy', 'np.copy', (['predictions[:, 0]... |
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import numpy as np
import math
import cmath
import pytest
from qupy.qubit import Qubits
from qupy.operator import I, X, Y, Z, rx, ry, rz, swap
def test_init():
q = Qubits(1)
assert q.data[0] == 1
assert q.data[1]... | [
"numpy.allclose",
"qupy.operator.ry",
"qupy.qubit.Qubits",
"numpy.array",
"numpy.kron",
"qupy.operator.rz"
] | [((264, 273), 'qupy.qubit.Qubits', 'Qubits', (['(1)'], {}), '(1)\n', (270, 273), False, 'from qupy.qubit import Qubits\n'), ((416, 425), 'qupy.qubit.Qubits', 'Qubits', (['(2)'], {}), '(2)\n', (422, 425), False, 'from qupy.qubit import Qubits\n'), ((661, 670), 'qupy.qubit.Qubits', 'Qubits', (['(2)'], {}), '(2)\n', (667,... |
# Refactored and Modified by @PrajjuS
import asyncio
import os
import shlex
import base64
import textwrap
import random
import numpy as np
from typing import Optional, Tuple
from PIL import Image, ImageDraw, ImageFont
import PIL.ImageOps
from userbot import CMD_HELP, LOGS, TEMP_DOWNLOAD_DIRECTORY, SUDO_USERS
from use... | [
"os.mkdir",
"os.remove",
"PIL.Image.new",
"textwrap.wrap",
"base64.b64decode",
"os.path.join",
"userbot.utils.media_to_pic",
"userbot.LOGS.info",
"os.path.lexists",
"os.path.exists",
"PIL.ImageDraw.Draw",
"userbot.events.register",
"os.path.basename",
"numpy.asarray",
"userbot.CMD_HELP.u... | [((7192, 7241), 'userbot.events.register', 'register', ([], {'outgoing': '(True)', 'pattern': '"""^\\\\.ascii (.*)"""'}), "(outgoing=True, pattern='^\\\\.ascii (.*)')\n", (7200, 7241), False, 'from userbot.events import register\n'), ((8710, 8752), 'userbot.events.register', 'register', ([], {'outgoing': '(True)', 'pat... |
import math
import os
import random
import time
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import backend, callbacks
from tensorflow.python.keras import backend as K
from tensorflow.python.keras import layers
from model_zoo import BaseModel
from utils import tool
class PCGrad(object):
... | [
"numpy.sum",
"random.sample",
"random.shuffle",
"tensorflow.python.keras.backend.moving_average_update",
"tensorflow.python.keras.backend.batch_get_value",
"tensorflow.zeros_like",
"tensorflow.python.keras.backend.get_session",
"numpy.linalg.norm",
"tensorflow.get_default_graph",
"os.path.dirname"... | [((8015, 8051), 'utils.tool.SetVarOp', 'tool.SetVarOp', (['self.model_meta_parms'], {}), '(self.model_meta_parms)\n', (8028, 8051), False, 'from utils import tool\n'), ((8436, 8476), 'tensorflow.python.keras.backend.batch_get_value', 'K.batch_get_value', (['self.model_meta_parms'], {}), '(self.model_meta_parms)\n', (84... |
# ==============================================================================
# This file is part of the SPNC project under the Apache License v2.0 by the
# Embedded Systems and Applications Group, TU Darmstadt.
# For the full copyright and license information, please view the LICENSE
# file that was distributed... | [
"spnc.cpu.CPUCompiler",
"spn.structure.leaves.histogram.Histograms.Histogram",
"numpy.isclose",
"numpy.random.randint",
"spn.algorithms.Inference.log_likelihood",
"numpy.exp",
"spn.structure.Base.Sum",
"spn.structure.Base.Product"
] | [((747, 804), 'spn.structure.leaves.histogram.Histograms.Histogram', 'Histogram', (['[0.0, 1.0, 2.0]', '[0.25, 0.75]', '[1, 1]'], {'scope': '(0)'}), '([0.0, 1.0, 2.0], [0.25, 0.75], [1, 1], scope=0)\n', (756, 804), False, 'from spn.structure.leaves.histogram.Histograms import Histogram\n'), ((811, 878), 'spn.structure.... |
import math
from collections import defaultdict
from typing import TextIO, Tuple
import numpy # type: ignore
def read_asteroids(data: TextIO) -> Tuple[numpy.array, numpy.array]:
xs = []
ys = []
for y, line in enumerate(data):
for x, c in enumerate(line):
if c == '#':
... | [
"numpy.arctan2",
"numpy.abs",
"numpy.gcd",
"collections.defaultdict",
"numpy.array"
] | [((1074, 1095), 'numpy.arctan2', 'numpy.arctan2', (['dy', 'dx'], {}), '(dy, dx)\n', (1087, 1095), False, 'import numpy\n'), ((1158, 1175), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1169, 1175), False, 'from collections import defaultdict\n'), ((374, 389), 'numpy.array', 'numpy.array', (['xs... |
# A high-level class for easily conducting
# convergence scans.
##################################################
import numpy as np
from . import DREAMIO
from . import runiface
from DREAM.DREAMSettings import DREAMSettings
from DREAM.DREAMOutput import DREAMOutput
class ConvergenceScan:
def __init__(self, s... | [
"numpy.isscalar",
"numpy.abs",
"numpy.float_power",
"DREAM.DREAMSettings.DREAMSettings"
] | [((7443, 7459), 'numpy.isscalar', 'np.isscalar', (['obj'], {}), '(obj)\n', (7454, 7459), True, 'import numpy as np\n'), ((12105, 12146), 'DREAM.DREAMSettings.DREAMSettings', 'DREAMSettings', (['self.settings'], {'chain': '(False)'}), '(self.settings, chain=False)\n', (12118, 12146), False, 'from DREAM.DREAMSettings imp... |
import numpy
import six
import cupy
def _prepend_const(narray, pad_amount, value, axis=-1):
if pad_amount == 0:
return narray
padshape = tuple([x if i != axis else pad_amount
for i, x in enumerate(narray.shape)])
return cupy.concatenate((cupy.full(padshape, value, narray.dty... | [
"cupy.concatenate",
"numpy.asarray",
"cupy.array",
"six.moves.zip",
"numpy.rint",
"numpy.tile",
"cupy.full",
"numpy.repeat"
] | [((5781, 5839), 'cupy.concatenate', 'cupy.concatenate', (['(ref_chunk1, arr, ref_chunk2)'], {'axis': 'axis'}), '((ref_chunk1, arr, ref_chunk2), axis=axis)\n', (5797, 5839), False, 'import cupy\n'), ((5999, 6019), 'numpy.asarray', 'numpy.asarray', (['shape'], {}), '(shape)\n', (6012, 6019), False, 'import numpy\n'), ((9... |
# -*- coding: utf-8 -*-
#******************************************************************************************
# Copyright (c) 2019
# School of Electronics and Computer Science, University of Southampton and Hitachi, Ltd.
# All rights reserved. This program and the accompanying materials are made available under
#... | [
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"structutil.NetworkStruct",
"tensorflow.placeholder",
"pathlib.Path",
"numpy.array",
"tensorflow.zeros",
"tensorflow.matmul",
"tensorflow.log",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.truncated_normal"
] | [((1532, 1547), 'structutil.NetworkStruct', 'NetworkStruct', ([], {}), '()\n', (1545, 1547), False, 'from structutil import NetworkStruct\n'), ((1561, 1663), 'numpy.array', 'np.array', (['[[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 1], [1, 0, 0], [1, 0, 1], [1, 1, 0\n ], [1, 1, 1]]'], {}), '([[0, 0, 0], [0, 0, 1], [0, ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | [
"paddle.fluid.io.save_inference_model",
"numpy.random.seed",
"paddle.fluid.ExecutionStrategy",
"paddle.fluid.layers.data",
"paddle.fluid.program_guard",
"paddle.fluid.layers.transpose",
"shutil.rmtree",
"options.Options",
"paddle.fluid.layers.mean",
"multiprocessing.cpu_count",
"paddle.fluid.Exe... | [((1273, 1294), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (1287, 1294), False, 'import matplotlib\n'), ((1330, 1521), 'danet.DANet', 'DANet', (['"""DANet"""'], {'backbone': 'args.backbone', 'num_classes': 'args.num_classes', 'batch_size': 'args.batch_size', 'dilated': 'args.dilated', 'multi_... |
import logging
from collections import defaultdict
from math import floor
from time import time
import cplex
import networkx as nx
import numpy as np
from utils import cartesian_product, check_clique, time_it
class CliqueSolver:
def __init__(self, graph, solve_type, time_limit, debug=False):
assert solv... | [
"cplex.Cplex",
"utils.cartesian_product",
"logging.warning",
"numpy.asarray",
"numpy.unique",
"math.floor",
"networkx.complement",
"time.time",
"collections.defaultdict",
"logging.info",
"numpy.isclose",
"numpy.where",
"networkx.coloring.greedy_color",
"utils.check_clique",
"numpy.all"
] | [((549, 555), 'time.time', 'time', ([], {}), '()\n', (553, 555), False, 'from time import time\n'), ((746, 759), 'cplex.Cplex', 'cplex.Cplex', ([], {}), '()\n', (757, 759), False, 'import cplex\n'), ((7355, 7399), 'numpy.isclose', 'np.isclose', (['solution', '(1.0)'], {'atol': 'self.epsilon'}), '(solution, 1.0, atol=se... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 19 04:46:49 2022
@author: jerry
"""
from Scheme import Scheme
import numpy as np
def test_benchmark():
scheme = Scheme()
ct0, ct1 = scheme.encrypt([1,2,3,6,1,5,3,4])
plain = scheme.decrypt(ct0, ct1)
def correctness_test():
# x = 819600
while True:
... | [
"Scheme.Scheme",
"numpy.random.randint"
] | [((166, 174), 'Scheme.Scheme', 'Scheme', ([], {}), '()\n', (172, 174), False, 'from Scheme import Scheme\n'), ((721, 750), 'Scheme.Scheme', 'Scheme', ([], {'q': '(1874)', 't': '(7)', 'd': '(4)', 'B': '(2)'}), '(q=1874, t=7, d=4, B=2)\n', (727, 750), False, 'from Scheme import Scheme\n'), ((765, 792), 'numpy.random.rand... |
from overcooked_ai_py.agents.agent import AgentPair
from overcooked_ai_py.mdp.overcooked_mdp import OvercookedGridworld
from overcooked_ai_py.mdp.overcooked_env import OvercookedEnv
import copy
import numpy as np
from overcooked_ai_py.planning.planners import MediumLevelPlanner
from human_aware_rl.ppo.ppo_pop import m... | [
"human_aware_rl.ppo.ppo_pop.make_tom_agent",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"overcooked_ai_py.mdp.overcooked_env.OvercookedEnv",
"numpy.median",
"numpy.std",
"matplotlib.pyplot.subplots",
"human.process_dataframes.get_human_human_trajectories",
"overcooked_ai_py.agents.agent.Ag... | [((5438, 5455), 'numpy.median', 'np.median', (['scores'], {}), '(scores)\n', (5447, 5455), True, 'import numpy as np\n'), ((5481, 5496), 'numpy.mean', 'np.mean', (['scores'], {}), '(scores)\n', (5488, 5496), True, 'import numpy as np\n'), ((5521, 5535), 'numpy.std', 'np.std', (['scores'], {}), '(scores)\n', (5527, 5535... |
import numpy as np
import pandas as pd
import plotly.io as pio
from matplotlib import pyplot as plt
from IMLearn.learners.regressors import PolynomialFitting
from IMLearn.utils import split_train_test
pio.templates.default = "simple_white"
def load_data(filename: str) -> pd.DataFrame:
"""
Load city daily te... | [
"pandas.DataFrame",
"numpy.random.seed",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.bar",
"IMLearn.learners.regressors.PolynomialFitting",
"numpy.min",
"numpy.arange",
"numpy.round"
] | [((822, 839), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (836, 839), True, 'import numpy as np\n'), ((1719, 1731), 'matplotlib.pyplot.legend', 'plt.legend', ([], {}), '()\n', (1729, 1731), True, 'from matplotlib import pyplot as plt\n'), ((1736, 1746), 'matplotlib.pyplot.show', 'plt.show', ([], {}),... |
# Copyright (c) 2015, Vienna University of Technology (TU Wien), Department of
# Geodesy and Geoinformation (GEO).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source ... | [
"tempfile.NamedTemporaryFile",
"equi7grid.image2equi7grid.call_gdal_util",
"os.remove",
"numpy.abs",
"os.path.abspath",
"equi7grid.equi7grid.Equi7Grid",
"osgeo.osr.CoordinateTransformation",
"equi7grid.image2equi7grid._find_gdal_path",
"equi7grid.image2equi7grid.open_image",
"numpy.where",
"os.p... | [((2443, 2465), 'osgeo.osr.SpatialReference', 'osr.SpatialReference', ([], {}), '()\n', (2463, 2465), False, 'from osgeo import osr\n'), ((3019, 3041), 'osgeo.osr.SpatialReference', 'osr.SpatialReference', ([], {}), '()\n', (3039, 3041), False, 'from osgeo import osr\n'), ((3176, 3221), 'osgeo.osr.CoordinateTransformat... |
# import sys so we can use packages outside of this folder in
# either python 2 or python 3
import sys
import os
from pathlib import Path
#insert parent directory into the path
sys.path.insert(0,str(Path(os.path.abspath(__file__)).parent.parent))
from input_output.hdf5datasetwriter import HDF5DatasetWriter
import con... | [
"os.path.abspath",
"progressbar.Bar",
"sklearn.preprocessing.LabelEncoder",
"json.dumps",
"progressbar.Percentage",
"progressbar.ETA",
"cv2.imread",
"numpy.mean",
"preprocessing.utils.ImageUtils",
"cv2.mean",
"sklearn.utils.shuffle",
"preprocessing.aspectawarepreprocessor.AspectAwarePreprocess... | [((881, 893), 'preprocessing.utils.ImageUtils', 'ImageUtils', ([], {}), '()\n', (891, 893), False, 'from preprocessing.utils import ImageUtils\n'), ((1002, 1016), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (1014, 1016), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((1089, 111... |
import numpy as np
import os
import sys
from matplotlib.pyplot import imread
import tensorflow as tf
import lipitk
# The MNIST images are always 28x28 pixels.
IMAGE_SIZE = 28
IMAGE_PIXELS = IMAGE_SIZE * IMAGE_SIZE
slim = tf.contrib.slim
FLAGS = tf.app.flags.FLAGS
def set_num_classes(data_fldr):
global NUM_CLASSES... | [
"numpy.random.seed",
"matplotlib.pyplot.imread",
"numpy.unique",
"numpy.shape",
"numpy.min",
"tensorflow.Variable",
"numpy.array",
"numpy.max",
"sys.stderr.write",
"tensorflow.train.AdamOptimizer",
"os.path.join",
"os.listdir",
"numpy.random.shuffle"
] | [((838, 869), 'sys.stderr.write', 'sys.stderr.write', (["('%s\\n' % _str)"], {}), "('%s\\n' % _str)\n", (854, 869), False, 'import sys\n'), ((1795, 1812), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (1809, 1812), True, 'import numpy as np\n'), ((2197, 2212), 'numpy.unique', 'np.unique', (['uids'], {}... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# <NAME> | UNIVERSITY OF CAMBRIDGE
# <NAME>
# <NAME>
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
import matplotlib.lines as mlines
import matplotlib.patheffects as path_... | [
"matplotlib.pyplot.show",
"numpy.log",
"warnings.filterwarnings",
"pandas.read_csv",
"pandas.merge",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"pyproj.Proj",
"networkx.from_pandas_edgelist",
"matplotlib.patches.Patch",
"pandas.concat",
"geopandas.read_file"
] | [((213, 246), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (236, 246), False, 'import warnings\n'), ((791, 812), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (802, 812), True, 'import pandas as pd\n'), ((1050, 1068), 'pyproj.Proj', 'Proj', ([], {... |
import pandas as pd
import numpy as np
import sklearn
from sklearn.linear_model import LogisticRegression
import pickle
data = pd.read_csv("processed.cleveland.data")
data = data[
["age", "sex", "cp", "trestbps", "chol", "fbs", "restecg", "thalach", "exang", "oldpeak", "slope", "ca", "thal",
"num"]]
predict... | [
"pickle.dump",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LogisticRegression",
"pickle.load",
"numpy.array"
] | [((128, 167), 'pandas.read_csv', 'pd.read_csv', (['"""processed.cleveland.data"""'], {}), "('processed.cleveland.data')\n", (139, 167), True, 'import pandas as pd\n'), ((372, 395), 'numpy.array', 'np.array', (['data[predict]'], {}), '(data[predict])\n', (380, 395), True, 'import numpy as np\n'), ((432, 493), 'sklearn.m... |
from __future__ import absolute_import, division, print_function
from scitbx.stdlib import math, random
from libtbx.utils import frange
from libtbx.test_utils import approx_equal, is_below_limit
from scitbx.array_family import flex
import scitbx.math.curve_fitting
import scitbx.random
from scitbx.smoothing import savit... | [
"scitbx.smoothing.savitzky_golay_coefficients",
"matplotlib.pyplot.show",
"scitbx.array_family.flex.max_absolute",
"six.moves.range",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.scatter",
"libtbx.test_utils.approx_equal",
"scitbx.stdlib.random.randint",
"scitbx.array_family.flex.pow2",
"scitbx.ar... | [((486, 500), 'scitbx.stdlib.random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (497, 500), False, 'from scitbx.stdlib import math, random\n'), ((503, 526), 'scitbx.array_family.flex.set_random_seed', 'flex.set_random_seed', (['(0)'], {}), '(0)\n', (523, 526), False, 'from scitbx.array_family import flex\n'), ((598, ... |
import numpy as np
from scipy.stats import norm
from scipy.optimize import minimize
def gram_matrix(X, k1, k2):
dim = len(X)
K = np.zeros((dim, dim))
for i in range(0, dim):
for j in range(0, dim):
K[i, j] = k1*np.exp(-1/(2*k2**2)*np.linalg.norm(X[i]-X[j])**2)
return K
# Compute... | [
"numpy.divide",
"numpy.random.uniform",
"numpy.ravel",
"numpy.asarray",
"numpy.square",
"numpy.zeros",
"numpy.expand_dims",
"numpy.clip",
"numpy.transpose",
"scipy.stats.norm.cdf",
"numpy.apply_along_axis",
"scipy.stats.norm.pdf",
"numpy.max",
"numpy.linalg.norm",
"numpy.matmul",
"nump... | [((139, 159), 'numpy.zeros', 'np.zeros', (['(dim, dim)'], {}), '((dim, dim))\n', (147, 159), True, 'import numpy as np\n'), ((397, 415), 'numpy.zeros', 'np.zeros', (['(dim, 1)'], {}), '((dim, 1))\n', (405, 415), True, 'import numpy as np\n'), ((1307, 1344), 'numpy.divide', 'np.divide', (['(y_mean - y_max - xi)', 'y_std... |
import numpy as np
import os
import inspect
import sys
LOCATION = "/".join(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))).split("/")[:-1])
sys.path.insert(0, LOCATION)
from powerbox import PowerBox, get_power
def test_power1d():
p = [0]*40
for i in range(40):
pb = PowerBox(... | [
"numpy.allclose",
"sys.path.insert",
"numpy.array",
"inspect.currentframe",
"powerbox.PowerBox"
] | [((167, 195), 'sys.path.insert', 'sys.path.insert', (['(0)', 'LOCATION'], {}), '(0, LOCATION)\n', (182, 195), False, 'import sys\n'), ((2368, 2437), 'powerbox.PowerBox', 'PowerBox', (['(50)'], {'dim': '(2)', 'pk': '(lambda k: 1.0 * k ** -2.0)', 'boxlength': '(1.0)', 'b': '(1)'}), '(50, dim=2, pk=lambda k: 1.0 * k ** -2... |
#!/usr/bin/env python
"""
Example script to train (unconditional) template creation.
"""
import os
import random
import argparse
import glob
import numpy as np
import tensorflow as tf
import voxelmorph as vxm
# parse the commandline
parser = argparse.ArgumentParser()
# data organization parameters
parser.add_argum... | [
"os.makedirs",
"voxelmorph.generators.template_creation",
"argparse.ArgumentParser",
"random.shuffle",
"voxelmorph.py.utils.load_volfile",
"tensorflow.device",
"voxelmorph.networks.TemplateCreation",
"numpy.mod",
"tensorflow.keras.callbacks.ModelCheckpoint",
"voxelmorph.losses.Grad",
"tensorflow... | [((246, 271), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (269, 271), False, 'import argparse\n'), ((2229, 2260), 'random.shuffle', 'random.shuffle', (['train_vol_names'], {}), '(train_vol_names)\n', (2243, 2260), False, 'import random\n'), ((2403, 2440), 'os.makedirs', 'os.makedirs', (['mod... |
#!/usr/bin/env python3
# -*-coding: utf-8 -*-
#
help = 'WAVファイルを読み込み、ランダムに推論実行テストを実行する'
#
import os
import argparse
import numpy as np
import chainer
import chainer.links as L
from chainer.cuda import to_cpu
from Lib.network import KBT
from Tools.func import argsPrint, fileFuncLine
import Lib.wavefunc as W
def com... | [
"Lib.wavefunc.norm",
"Lib.wavefunc.fileFuncLine",
"Lib.wavefunc.wav2arr",
"traceback.print_exc",
"argparse.ArgumentParser",
"chainer.serializers.load_npz",
"os.path.basename",
"Lib.wavefunc.waveCut",
"numpy.asarray",
"Tools.func.argsPrint",
"chainer.cuda.to_cpu",
"numpy.array",
"Lib.network.... | [((341, 382), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'help'}), '(description=help)\n', (364, 382), False, 'import argparse\n'), ((1285, 1316), 'numpy.asarray', 'np.asarray', (['x'], {'dtype': 'np.float32'}), '(x, dtype=np.float32)\n', (1295, 1316), True, 'import numpy as np\n'), ((13... |
# -*- coding: utf-8 -*-
import numpy as np
from vispy.visuals.transforms import STTransform
from vispy.scene.visuals import Histogram
from vispy.testing import (requires_application, TestingCanvas,
assert_image_equal, run_tests_if_main)
@requires_application()
def test_histogram():
"""... | [
"vispy.visuals.transforms.STTransform",
"vispy.scene.visuals.Histogram",
"numpy.zeros",
"vispy.testing.run_tests_if_main",
"vispy.testing.TestingCanvas",
"numpy.array",
"vispy.testing.requires_application",
"vispy.testing.assert_image_equal"
] | [((268, 290), 'vispy.testing.requires_application', 'requires_application', ([], {}), '()\n', (288, 290), False, 'from vispy.testing import requires_application, TestingCanvas, assert_image_equal, run_tests_if_main\n'), ((869, 888), 'vispy.testing.run_tests_if_main', 'run_tests_if_main', ([], {}), '()\n', (886, 888), F... |
import warnings
from abc import abstractmethod
from typing import (
Iterable,
Sequence,
TYPE_CHECKING,
Optional,
Generator,
Callable,
Union,
)
import numpy as np
if TYPE_CHECKING:
from .document import DocumentArray
from ..document import Document
def _check_traversal_path_type(tp... | [
"warnings.warn",
"numpy.arange",
"numpy.ceil",
"numpy.random.shuffle"
] | [((6404, 6587), 'warnings.warn', 'warnings.warn', (['"""using `traversal_paths` as an argument inside `.batch()` is deprecated. please use `.traverse_flat(traversal_paths=...).batch()` instead"""', 'DeprecationWarning'], {}), "(\n 'using `traversal_paths` as an argument inside `.batch()` is deprecated. please use `.... |
r"""
Meta Trainer module for building all trainer class.
"""
import json
import torch
import numpy as np
from pathlib import Path
from datetime import datetime
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from utils.log import LOGGER, logging_initialize, logging_start_finish, log_loss
... | [
"json.dump",
"torch.inference_mode",
"utils.log.log_loss",
"numpy.asarray",
"utils.log.logging_start_finish",
"pycocotools.coco.COCO",
"pathlib.Path",
"pycocotools.cocoeval.COCOeval",
"utils.log.logging_initialize",
"torch.cuda.empty_cache",
"torch.no_grad",
"utils.log.LOGGER.info"
] | [((750, 779), 'utils.log.logging_initialize', 'logging_initialize', (['"""trainer"""'], {}), "('trainer')\n", (768, 779), False, 'from utils.log import LOGGER, logging_initialize, logging_start_finish, log_loss\n'), ((3604, 3636), 'utils.log.logging_start_finish', 'logging_start_finish', (['"""Training"""'], {}), "('Tr... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.context.set_context",
"numpy.random.randn",
"mindspore.ops.operations.StridedSlice",
"mindspore.common.tensor.Tensor",
"mindspore.train.model.Model"
] | [((874, 942), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE', 'device_target': '"""Ascend"""'}), "(mode=context.GRAPH_MODE, device_target='Ascend')\n", (893, 942), True, 'import mindspore.context as context\n'), ((1356, 1370), 'mindspore.common.tensor.Tensor', 'Tensor', (['in... |
import numpy as np
import sklearn.neighbors
import sklearn.pipeline
import sklearn.svm
import sklearn.decomposition
import sklearn.gaussian_process
import logging
import pickle
import joblib
import time
import heapq
import inspect
from . import loggin
from . import TLS_models
import functools
import collections
import ... | [
"heapq.nsmallest",
"functools.partial",
"numpy.abs",
"numpy.std",
"numpy.zeros",
"scipy.stats.norm.pdf",
"numpy.max",
"numpy.mean",
"numpy.arange",
"numpy.sqrt"
] | [((845, 868), 'numpy.sqrt', 'np.sqrt', (['((x1 - x2) ** 2)'], {}), '((x1 - x2) ** 2)\n', (852, 868), True, 'import numpy as np\n'), ((553, 574), 'numpy.arange', 'np.arange', (['X.shape[0]'], {}), '(X.shape[0])\n', (562, 574), True, 'import numpy as np\n'), ((899, 910), 'numpy.mean', 'np.mean', (['dd'], {}), '(dd)\n', (... |
import keras
import tensorflow as tf
from keras_retinanet import models
from keras_retinanet.utils.image import read_image_bgr, preprocess_image, resize_image
from keras_retinanet.utils.visualization import draw_box
from keras_retinanet.utils.colors import label_color
# import miscellaneous modules
# import matplotli... | [
"keras_retinanet.utils.image.preprocess_image",
"cv2.putText",
"cv2.VideoWriter_fourcc",
"numpy.multiply",
"keras_retinanet.utils.visualization.draw_box",
"cv2.waitKey",
"tensorflow.Session",
"numpy.expand_dims",
"keras_retinanet.models.load_model",
"cv2.VideoCapture",
"tensorflow.ConfigProto",
... | [((422, 438), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (436, 438), True, 'import tensorflow as tf\n'), ((493, 518), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (503, 518), True, 'import tensorflow as tf\n'), ((1227, 1282), 'keras_retinanet.models.load_model'... |
from typing import Callable
from nonebot.adapters.onebot.v11 import Message
from nonebot.params import CommandArg
import numpy
import nonebot
import heapq
import random
import re
CONFIG = {
"limit": 10000,
"binomial_limit": 10 ** 15,
"faces": 100,
"max_lines": 10,
}
def dice_simulation(count: int, faces: int)... | [
"nonebot.params.CommandArg",
"nonebot.on_command",
"numpy.random.binomial",
"random.randint",
"random.randrange",
"re.compile"
] | [((1379, 1414), 're.compile', 're.compile', (['"""^(\\\\d+)?(?:d(\\\\d+))?$"""'], {}), "('^(\\\\d+)?(?:d(\\\\d+))?$')\n", (1389, 1414), False, 'import re\n'), ((1422, 1470), 'nonebot.on_command', 'nonebot.on_command', (['"""骰子"""'], {'aliases': "{'色子', 'dice'}"}), "('骰子', aliases={'色子', 'dice'})\n", (1440, 1470), False... |
# AUTHORS
# <NAME>, EURECOM, Sophia-Antipolis, France, 2019
# http://www.eurecom.fr/en/people/patino-jose
# Contact: patino[at]eurecom[dot]fr, josempatinovillar[at]gmail[dot]com
# DIARIZATION FUNCTIONS
import numpy as np
def extractFeatures(audioFile,framelength,frameshift,nfilters,ncoeff):
import librosa
... | [
"numpy.sum",
"numpy.abs",
"numpy.random.seed",
"numpy.maximum",
"numpy.argmax",
"numpy.empty",
"numpy.floor",
"scipy.cluster.hierarchy.linkage",
"numpy.ones",
"numpy.argmin",
"sklearn.mixture.GaussianMixture",
"numpy.argsort",
"numpy.around",
"numpy.mean",
"numpy.arange",
"numpy.round"... | [((330, 362), 'librosa.load', 'librosa.load', (['audioFile'], {'sr': 'None'}), '(audioFile, sr=None)\n', (342, 362), False, 'import librosa\n'), ((767, 791), 'numpy.zeros', 'np.zeros', (['[1, nFeatures]'], {}), '([1, nFeatures])\n', (775, 791), True, 'import numpy as np\n'), ((1894, 1918), 'numpy.zeros', 'np.zeros', ([... |
#! /bin/python
# This script plots the stars over time and the star growth rate of a GitHub
# repository.
# This is useful to assess the popularity of a repository.
#
# Note: getting the stargazers takes a ton of time (hours). The script will
# save all stargazers that it already retreived and only get the missing one... | [
"cycler.cycler",
"pickle.dump",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"datetime.date",
"datetime.date.today",
"numpy.cumsum",
"matplotlib.pyplot.figure",
"pickle.load",
"datetime.datetime.strptime",
"datetime.timedelta",
"requests.get",
"matplotlib... | [((7936, 7949), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (7946, 7949), True, 'from matplotlib import pyplot as plt\n'), ((7950, 7965), 'matplotlib.pyplot.legend', 'plt.legend', (['leg'], {}), '(leg)\n', (7960, 7965), True, 'from matplotlib import pyplot as plt\n'), ((7966, 7979), 'matplotlib.py... |
# Copyright 2019 DeepMind Technologies Ltd. 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 appl... | [
"open_spiel.python.utils.lru_cache.LRUCache",
"numpy.array"
] | [((2141, 2171), 'open_spiel.python.utils.lru_cache.LRUCache', 'lru_cache.LRUCache', (['cache_size'], {}), '(cache_size)\n', (2159, 2171), False, 'from open_spiel.python.utils import lru_cache\n'), ((2805, 2830), 'numpy.array', 'np.array', (['[value, -value]'], {}), '([value, -value])\n', (2813, 2830), True, 'import num... |
import numpy as np
import cv2
from model.detection_model.TextSnake_pytorch.util.misc import fill_hole, regularize_sin_cos
from model.detection_model.TextSnake_pytorch.util.misc import norm2
import random
class TextDetector(object):
"""
"""
def __init__(self, tcl_conf_thresh=0.5, tr_conf_thresh=0.3):
... | [
"numpy.abs",
"numpy.ones",
"numpy.argsort",
"numpy.mean",
"numpy.arange",
"numpy.linalg.norm",
"cv2.minAreaRect",
"cv2.line",
"cv2.contourArea",
"model.detection_model.TextSnake_pytorch.util.misc.norm2",
"cv2.dilate",
"model.detection_model.TextSnake_pytorch.util.misc.fill_hole",
"cv2.pointP... | [((2043, 2077), 'numpy.arange', 'np.arange', (['(ymin - 1)', '(ymax + 1)', '(0.5)'], {}), '(ymin - 1, ymax + 1, 0.5)\n', (2052, 2077), True, 'import numpy as np\n'), ((3027, 3055), 'numpy.zeros', 'np.zeros', (['tcl_pred.shape[:2]'], {}), '(tcl_pred.shape[:2])\n', (3035, 3055), True, 'import numpy as np\n'), ((3071, 313... |
import scipy
from scipy.io import wavfile
from scipy import signal
from scipy.fft import fft, fftfreq
from scipy.signal import butter, lfilter, freqz, filtfilt
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['agg.path.chunksize'] = 10000
import numpy as np
import streamlit as st
import os
import... | [
"numpy.abs",
"os.unlink",
"streamlit.title",
"scipy.io.wavfile.read",
"os.path.isfile",
"os.path.islink",
"shutil.rmtree",
"os.path.join",
"streamlit.stop",
"streamlit.audio",
"os.path.exists",
"streamlit.info",
"matplotlib.pyplot.subplots",
"scipy.signal.butter",
"scipy.fft.fft",
"str... | [((329, 384), 'streamlit.set_option', 'st.set_option', (['"""deprecation.showPyplotGlobalUse"""', '(False)'], {}), "('deprecation.showPyplotGlobalUse', False)\n", (342, 384), True, 'import streamlit as st\n'), ((457, 475), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (467, 475), False, 'import os\n'), ((... |
import numpy as np
from src.features.build_features import Scaler
from scipy.spatial.distance import cdist
from scipy.stats import mode
import pandas as pd
class KNN():
def __init__(self, n, metric='euclidean'):
self.n = n
self.xs_ = None
self.y_ = None
self.scaler_ = None
... | [
"scipy.spatial.distance.cdist",
"pandas.DataFrame",
"numpy.sum",
"numpy.log",
"scipy.stats.mode",
"src.features.build_features.Scaler",
"numpy.argsort",
"numpy.finfo",
"numpy.max",
"numpy.where",
"numpy.array",
"numpy.argwhere"
] | [((394, 402), 'src.features.build_features.Scaler', 'Scaler', ([], {}), '()\n', (400, 402), False, 'from src.features.build_features import Scaler\n'), ((885, 917), 'scipy.spatial.distance.cdist', 'cdist', (['self.xs_', 'xs', 'self.metric'], {}), '(self.xs_, xs, self.metric)\n', (890, 917), False, 'from scipy.spatial.d... |
import os
import click
import string
import numpy as np
from tqdm import tqdm
from models.model_loader import load_model
from torchvision.transforms import Compose
from dataset.data_transform import Resize, Rotation, Translation, Scale
from dataset.test_data import TestDataset
from dataset.text_data import TextDataset
... | [
"tqdm.tqdm",
"dataset.test_data.TestDataset",
"torch.utils.data.DataLoader",
"torch.manual_seed",
"torch.autograd.Variable",
"click.option",
"torch.cuda.manual_seed",
"dataset.text_data.TextDataset",
"click.command",
"time.time",
"warpctc_pytorch.CTCLoss",
"numpy.mean",
"lr_policy.StepLR",
... | [((625, 640), 'click.command', 'click.command', ([], {}), '()\n', (638, 640), False, 'import click\n'), ((642, 717), 'click.option', 'click.option', (['"""--data-path"""'], {'type': 'str', 'default': 'None', 'help': '"""Path to dataset"""'}), "('--data-path', type=str, default=None, help='Path to dataset')\n", (654, 71... |
import porespy as ps
import numpy as np
import pytest
class DNSTest():
def setup_class(self):
np.random.seed(10)
def test_tortuosity_2D_lattice_spheres_axis_1(self):
im = ps.generators.lattice_spheres(shape=[200, 200], radius=8, offset=5)
t = ps.dns.tortuosity(im=im, axis=1)
... | [
"porespy.dns.tortuosity",
"numpy.random.seed",
"porespy.generators.lattice_spheres",
"numpy.around",
"pytest.raises"
] | [((109, 127), 'numpy.random.seed', 'np.random.seed', (['(10)'], {}), '(10)\n', (123, 127), True, 'import numpy as np\n'), ((199, 266), 'porespy.generators.lattice_spheres', 'ps.generators.lattice_spheres', ([], {'shape': '[200, 200]', 'radius': '(8)', 'offset': '(5)'}), '(shape=[200, 200], radius=8, offset=5)\n', (228,... |
import sys
import os
from multiprocessing import Pool
import csv
import datetime
import numpy as np
from numpy import genfromtxt
import h5py
import ndio
import ndio.remote.neurodata as neurodata
def chan(TOKEN):
nd = neurodata()
### Pull channel names
channels = nd.get_channels(TOKEN)
## Filter ch... | [
"h5py.File",
"numpy.empty",
"numpy.asarray",
"ndio.remote.neurodata",
"numpy.savetxt",
"numpy.genfromtxt",
"numpy.transpose",
"numpy.array",
"multiprocessing.Pool"
] | [((222, 233), 'ndio.remote.neurodata', 'neurodata', ([], {}), '()\n', (231, 233), True, 'import ndio.remote.neurodata as neurodata\n'), ((643, 654), 'ndio.remote.neurodata', 'neurodata', ([], {}), '()\n', (652, 654), True, 'import ndio.remote.neurodata as neurodata\n'), ((1566, 1582), 'numpy.asarray', 'np.asarray', (['... |
import numpy as np
import os
import fcs
import time
#调库计算距离
from scipy.spatial.distance import cdist
import binascii
import hashlib
import donna25519 as curve25519
def to_bytes(x):
return bytes(str(x), 'utf8')
def to_string(x):
random_seed = 233
result = ''
while x > 0:
result = chr(x % random... | [
"scipy.spatial.distance.cdist",
"binascii.hexlify",
"fcs.FCS",
"os.walk",
"numpy.genfromtxt",
"time.time",
"numpy.argsort",
"numpy.max",
"binascii.unhexlify",
"donna25519.PrivateKey",
"numpy.linalg.norm",
"numpy.dot",
"numpy.arccos",
"os.path.join"
] | [((3537, 3555), 'fcs.FCS', 'fcs.FCS', (['(32 * 8)', 'k'], {}), '(32 * 8, k)\n', (3544, 3555), False, 'import fcs\n'), ((4454, 4474), 'os.walk', 'os.walk', (['"""minutiaes"""'], {}), "('minutiaes')\n", (4461, 4474), False, 'import os\n'), ((669, 703), 'numpy.genfromtxt', 'np.genfromtxt', (['file'], {'delimiter': '""",""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.