code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import awkward as ak import numpy as np import pytest from pytest_lazyfixture import lazy_fixture from fast_carpenter.testing import FakeBEEvent import fast_carpenter.tree_adapter as tree_adapter from fast_carpenter.tree_adapter import ArrayMethods ####################################################################...
[ "fast_carpenter.tree_adapter.ArrayMethods.to_pandas", "awkward.count_nonzero", "fast_carpenter.tree_adapter.ArrayMethods.filtered_len", "pytest_lazyfixture.lazy_fixture", "fast_carpenter.tree_adapter.ArrayMethods.arrays_as_np_array", "fast_carpenter.tree_adapter.create", "awkward.all", "awkward.num", ...
[((492, 557), 'fast_carpenter.tree_adapter.create', 'tree_adapter.create', (["{'adapter': 'uproot3', 'tree': uproot3_tree}"], {}), "({'adapter': 'uproot3', 'tree': uproot3_tree})\n", (511, 557), True, 'import fast_carpenter.tree_adapter as tree_adapter\n'), ((1068, 1133), 'fast_carpenter.tree_adapter.create', 'tree_ada...
# coding: utf8 import numpy as np class FootTrajectoryGenerator: """A foot trajectory generator that handles the generation of a 3D trajectory with a 5th order polynomial to lead each foot from its location at the start of its swing phase to its final location that has been decided by the FootstepPlanner...
[ "numpy.tile", "numpy.where", "numpy.array", "numpy.zeros", "numpy.dot", "numpy.cos", "numpy.sin" ]
[((575, 666), 'numpy.array', 'np.array', (['[[0.1946, 0.1946, -0.1946, -0.1946], [0.14695, -0.14695, 0.14695, -0.14695]]'], {}), '([[0.1946, 0.1946, -0.1946, -0.1946], [0.14695, -0.14695, 0.14695, \n -0.14695]])\n', (583, 666), True, 'import numpy as np\n'), ((1017, 1052), 'numpy.array', 'np.array', (['[[0.0, -1.0],...
import numpy as np class Trajectory: def __init__(self): pass @classmethod def LSPB(cls, q0, qf, tf, tb, t_step=0.07): q0 = np.array(q0) qf = np.array(qf) if np.allclose(q0, qf): t = [0.0] q_pos = [qf] return q_pos, t # Define c...
[ "numpy.allclose", "numpy.array", "numpy.linalg.inv", "numpy.isnan", "numpy.concatenate", "numpy.zeros_like", "numpy.arange" ]
[((155, 167), 'numpy.array', 'np.array', (['q0'], {}), '(q0)\n', (163, 167), True, 'import numpy as np\n'), ((181, 193), 'numpy.array', 'np.array', (['qf'], {}), '(qf)\n', (189, 193), True, 'import numpy as np\n'), ((205, 224), 'numpy.allclose', 'np.allclose', (['q0', 'qf'], {}), '(q0, qf)\n', (216, 224), True, 'import...
import torch import torch.nn as nn from torch.utils.data import DataLoader, Dataset, Subset from torch.cuda import amp import numpy as np import logging import time import os from os import mkdir, listdir, getcwd from os.path import join, exists from copy import deepcopy class EarlyStopping(object): ''' Per...
[ "logging.getLogger", "logging.StreamHandler", "copy.deepcopy", "os.path.exists", "torch.cuda.amp.GradScaler", "time.perf_counter", "torch.cuda.amp.autocast", "numpy.ceil", "logging.getLevelName", "torch.cuda.get_device_name", "logging.Formatter", "torch.load", "os.path.join", "os.getcwd", ...
[((8088, 8138), 'os.path.join', 'join', (["self._config['output_folder']", '"""checkpoints"""'], {}), "(self._config['output_folder'], 'checkpoints')\n", (8092, 8138), False, 'from os.path import join, exists\n'), ((8732, 8756), 'torch.zeros', 'torch.zeros', ([], {'size': '(bpe,)'}), '(size=(bpe,))\n', (8743, 8756), Fa...
# -*- coding: utf-8 -*- """ Created on Fri Sep 10 15:49:49 2021 @author: <NAME> """ import matplotlib.pyplot as plt import cv2 import tensorflow_hub as hub import tensorflow as tf import numpy as np import file_path as f # Load the model from tensorflow hub model = hub.load('https://tfhub.dev/google/magenta/arbitrar...
[ "tensorflow.image.convert_image_dtype", "tensorflow.io.read_file", "tensorflow_hub.load", "numpy.squeeze", "tensorflow.constant", "tensorflow.image.decode_image", "matplotlib.pyplot.show" ]
[((269, 355), 'tensorflow_hub.load', 'hub.load', (['"""https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2"""'], {}), "(\n 'https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2')\n", (277, 355), True, 'import tensorflow_hub as hub\n'), ((1019, 1029), 'matplotlib.pyplot.show', 'plt....
import numpy as np from harmonic_equation import harmonic_equation from equation import equation import low_level_tools as llt ################################################################################ def eq_11_bc(current): N, M = current[0].shape z = np.linspace(0, 1, N) x, y = np.meshgrid(z, z, i...
[ "numpy.sqrt", "numpy.log", "numpy.sinh", "numpy.array", "low_level_tools.dx_forward", "numpy.sin", "harmonic_equation.harmonic_equation", "low_level_tools.d2y", "low_level_tools.dy_forward", "low_level_tools.dxdy", "numpy.exp", "numpy.linspace", "low_level_tools.dx", "numpy.meshgrid", "n...
[((269, 289), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'N'], {}), '(0, 1, N)\n', (280, 289), True, 'import numpy as np\n'), ((301, 333), 'numpy.meshgrid', 'np.meshgrid', (['z', 'z'], {'indexing': '"""ij"""'}), "(z, z, indexing='ij')\n", (312, 333), True, 'import numpy as np\n'), ((348, 361), 'numpy.exp', 'np.ex...
import numpy as np import torch import utils if __name__ == '__main__': args = utils.parse_args() print(f'Running baseline for ALRS testing...\nArgs:\n{utils.args_to_str(args)}\n') displayed_rendering_error = False best_config = None best_info_list = None best_val_loss = np.inf ini...
[ "utils.save_baseline", "utils.step_decay_action", "numpy.log", "utils.make_alrs_env", "utils.args_to_str", "utils.parse_args", "utils.dict_to_file" ]
[((86, 104), 'utils.parse_args', 'utils.parse_args', ([], {}), '()\n', (102, 104), False, 'import utils\n'), ((2439, 2504), 'utils.dict_to_file', 'utils.dict_to_file', (['best_config', 'filename'], {'path': '"""data/baselines/"""'}), "(best_config, filename, path='data/baselines/')\n", (2457, 2504), False, 'import util...
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. """ Implementation of the performance instrumentation report. """ import json import numpy as np import re class InstrumentationReport(object): @staticmethod def get_event_uuid(event): uuid = (-1, -1, -1) if 'args' in...
[ "numpy.mean", "numpy.median", "re.match", "numpy.max", "numpy.array", "numpy.min", "json.load" ]
[((830, 874), 're.match', 're.match', (['""".*report-(\\\\d+)\\\\.json"""', 'filename'], {}), "('.*report-(\\\\d+)\\\\.json', filename)\n", (838, 874), False, 'import re\n'), ((6740, 6756), 'numpy.array', 'np.array', (['result'], {}), '(result)\n', (6748, 6756), True, 'import numpy as np\n'), ((1122, 1135), 'json.load'...
import numpy import matplotlib.pylab as plt class LinearHeadHead(object): """ Solves the system: \div \frac{\rho}{\mu} k \grad (p + \rho g z) = 0 on the domain [x_0, x_1] \cross [z_0,z_1] Boundary conditions are given by: h(x_0,z,t) = h_0 [m] => p(x_0,z,t)=(h_0-z) \rho g h(x_1,...
[ "amanzi_xml.utils.search.find_tag_path", "matplotlib.pylab.xlabel", "numpy.linspace", "numpy.zeros", "matplotlib.pylab.plot", "matplotlib.pylab.ylabel" ]
[((3622, 3658), 'numpy.linspace', 'numpy.linspace', (['lhh.x_0', 'lhh.x_1', '(11)'], {}), '(lhh.x_0, lhh.x_1, 11)\n', (3636, 3658), False, 'import numpy\n'), ((3716, 3736), 'numpy.zeros', 'numpy.zeros', (['(11, 2)'], {}), '((11, 2))\n', (3727, 3736), False, 'import numpy\n'), ((4033, 4048), 'matplotlib.pylab.plot', 'pl...
"""Test the build_featurizer code.""" import os import random import warnings import logging import keras.backend as K import numpy as np import pytest from keras.layers import Dense, Activation, Input from keras.layers.merge import add from keras.models import Sequential, Model from pic2vec.build_featurizer import (...
[ "pic2vec.build_featurizer._decapitate_model", "numpy.array", "keras.layers.Activation", "pytest.fixture", "keras.layers.Dense", "logging.error", "os.remove", "keras.backend.constant", "keras.layers.merge.add", "keras.models.Model", "pic2vec.build_featurizer._find_pooling_constant", "pic2vec.bu...
[((670, 690), 'random.seed', 'random.seed', (['(5102020)'], {}), '(5102020)\n', (681, 690), False, 'import random\n'), ((739, 767), 'keras.backend.constant', 'K.constant', (['(3)'], {'shape': '(3, 12)'}), '(3, shape=(3, 12))\n', (749, 767), True, 'import keras.backend as K\n'), ((844, 872), 'keras.backend.constant', 'K...
# -*- coding: utf-8 -*-# """ ------------------------------------------------------------------- Copyright (c) 2019-2022 Snow Lake Inc. All rights reserved. Description : File Name: __init__.py.py Author : <EMAIL> create date: 2021/7/8 --------------------------------------------------------...
[ "numpy.fromfile", "cv2.imshow", "numpy.swapaxes", "numpy.zeros", "numba.jit", "cv2.waitKey", "numpy.full", "cv2.resize", "cv2.imread" ]
[((382, 406), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (391, 406), False, 'import numba\n'), ((587, 637), 'numpy.zeros', 'np.zeros', (['(h, w, image.shape[2])'], {'dtype': 'np.float32'}), '((h, w, image.shape[2]), dtype=np.float32)\n', (595, 637), True, 'import numpy as np\n'), ((649...
# -*- coding: utf-8 -*- """ Created on Mon May 11 14:34:08 2020 @author: <NAME> (<EMAIL>), Finnish Meteorological Institute) Olli's python implementation of ESA SNAP s2toolbox biophysical processor and computation of vegetation indices. See ATBD at https://step.esa.int/docs/extra/ATBD_S2ToolBox_L2B_V1.1.pdf And java...
[ "numpy.radians", "numpy.copy", "numpy.shape", "numpy.ones_like", "numpy.log", "numpy.any", "xarray.concat", "os.path.dirname", "numpy.array", "xarray.DataArray", "numpy.loadtxt", "xarray.apply_ufunc", "numpy.zeros_like" ]
[((1240, 1265), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1255, 1265), False, 'import os\n'), ((1393, 1470), 'numpy.loadtxt', 'np.loadtxt', (["(snap_bio_path + '%s/%s_Normalisation' % (var, var))"], {'delimiter': '""","""'}), "(snap_bio_path + '%s/%s_Normalisation' % (var, var), delimit...
import extract as extract import numpy as np from nltk.tokenize import word_tokenize from sklearn import svm import matplotlib.pyplot as plt from sklearn.metrics import f1_score import seaborn as sns from sklearn import metrics def build_train(filename): extracted = extract.extract(filename) train_x = [] train_y = ...
[ "sklearn.metrics.f1_score", "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "seaborn.heatmap", "nltk.tokenize.word_tokenize", "numpy.array", "extract.extract", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "sklearn....
[((269, 294), 'extract.extract', 'extract.extract', (['filename'], {}), '(filename)\n', (284, 294), True, 'import extract as extract\n'), ((627, 652), 'extract.extract', 'extract.extract', (['filename'], {}), '(filename)\n', (642, 652), True, 'import extract as extract\n'), ((995, 1011), 'nltk.tokenize.word_tokenize', ...
# -*- coding: utf-8 -*- #!/usr/bin/env python3 """ Created on Tue Jan 8 20:03:12 2019 @author: yansl Target: 1. due to discreteness of image, the boundaries of two circles need to repair. 2. The core resolution is that the median filtering technique will be executed. """ import cv2 import numpy...
[ "cv2.circle", "numpy.zeros", "cv2.inpaint" ]
[((630, 680), 'cv2.inpaint', 'cv2.inpaint', (['temp', 'mask', 'radius', 'cv2.INPAINT_TELEA'], {}), '(temp, mask, radius, cv2.INPAINT_TELEA)\n', (641, 680), False, 'import cv2\n'), ((1409, 1437), 'numpy.zeros', 'np.zeros', (['sp'], {'dtype': 'np.uint8'}), '(sp, dtype=np.uint8)\n', (1417, 1437), True, 'import numpy as np...
import pandas as pd import os from tqdm import tqdm from model.bert_things.pytorch_pretrained_bert.tokenization import BertTokenizer from model.bert_things.pytorch_pretrained_bert import BertConfig, BertModel, BertPreTrainedModel from model.bert_text_model import BertTextModel from data_loader.utils.vocab import Vocab ...
[ "logging.getLogger", "pandas.to_timedelta", "torch.cuda.device_count", "pandas.read_pickle", "os.path.exists", "argparse.ArgumentParser", "model.bert_text_model.BertTextModel", "model.bert_things.pytorch_pretrained_bert.tokenization.BertTokenizer", "model.bert_things.pytorch_pretrained_bert.BertConf...
[((1252, 1318), 'torch.zeros', 'torch.zeros', (['(bert_seq_length, max_seq_len_text)'], {'dtype': 'torch.long'}), '((bert_seq_length, max_seq_len_text), dtype=torch.long)\n', (1263, 1318), False, 'import torch\n'), ((1332, 1380), 'torch.zeros', 'torch.zeros', (['(bert_seq_length, max_seq_len_text)'], {}), '((bert_seq_l...
import os import torch from torch import nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np VERBOSE = True USE_CUDA = True def model_summary(model): for idx, m in enumerate(model.modules()): print(idx, '->', m) def save_checkpoint(state, loss, prefix, ckptpat...
[ "numpy.mean", "torch.nn.functional.cosine_similarity", "os.path.join", "torch.nn.functional.cosine_embedding_loss", "torch.nn.MSELoss", "torch.is_tensor", "torch.save", "numpy.arange", "numpy.random.shuffle" ]
[((344, 398), 'os.path.join', 'os.path.join', (['ckptpath', "('%s_%.5f.tar' % (prefix, loss))"], {}), "(ckptpath, '%s_%.5f.tar' % (prefix, loss))\n", (356, 398), False, 'import os\n'), ((403, 435), 'torch.save', 'torch.save', (['state', 'filename_late'], {}), '(state, filename_late)\n', (413, 435), False, 'import torch...
def generateTable(data,k=4): T = {} for i in range(len(data)-k): X = data[i:i+k] Y = data[i+k] #print("X %s and Y %s "%(X,Y)) if T.get(X) is None: T[X] = {} T[X][Y] = 1 else: if T[X].get(Y) is None: ...
[ "numpy.random.choice", "numpy.random.seed" ]
[((1078, 1093), 'numpy.random.seed', 'random.seed', (['(11)'], {}), '(11)\n', (1089, 1093), False, 'from numpy import random\n'), ((1371, 1422), 'numpy.random.choice', 'np.random.choice', (['possible_Chars'], {'p': 'possible_values'}), '(possible_Chars, p=possible_values)\n', (1387, 1422), True, 'import numpy as np\n')...
import cv2 from matplotlib import pyplot as plt import numpy as np import glob import pickle images = glob.glob('images/*.jpg') keypoints = [] scale_percent = 5 width = 300 height = 200 dim = (width, height) objectpoints = [] path_image_founds = [] for im_name in images: im = cv2.cvtColor(cv2.imread(im_name), cv2...
[ "matplotlib.pyplot.imshow", "cv2.projectPoints", "matplotlib.pyplot.plot", "numpy.squeeze", "numpy.zeros", "cv2.calibrateCamera", "cv2.findChessboardCorners", "cv2.resize", "cv2.imread", "glob.glob", "matplotlib.pyplot.show" ]
[((103, 128), 'glob.glob', 'glob.glob', (['"""images/*.jpg"""'], {}), "('images/*.jpg')\n", (112, 128), False, 'import glob\n'), ((780, 841), 'cv2.calibrateCamera', 'cv2.calibrateCamera', (['objectpoints', 'keypoints', 'dim', 'None', 'None'], {}), '(objectpoints, keypoints, dim, None, None)\n', (799, 841), False, 'impo...
#coding: UTF-8 # 信息利用率低:不同的机器学习算法和模型对数据中信息的利用是不同的,之前提到在线性模型中,使用对定性特征哑编码可以达到非线性的效果。类似地,对定量变量多项式化,或者进行其他的转换,都能达到非线性的效果。 from sklearn.preprocessing import PolynomialFeatures import numpy as np X = np.arange(6).reshape(3, 2) print(X) poly = PolynomialFeatures(2) print(poly.fit_transform(X)) poly = PolynomialFeatures(int...
[ "sklearn.preprocessing.PolynomialFeatures", "numpy.arange" ]
[((239, 260), 'sklearn.preprocessing.PolynomialFeatures', 'PolynomialFeatures', (['(2)'], {}), '(2)\n', (257, 260), False, 'from sklearn.preprocessing import PolynomialFeatures\n'), ((298, 339), 'sklearn.preprocessing.PolynomialFeatures', 'PolynomialFeatures', ([], {'interaction_only': '(True)'}), '(interaction_only=Tr...
import re import torch from torch import nn import pandas as pd import numpy as np from torch._six import container_abcs, string_classes, int_classes from torch.nn.utils import rnn as rnn_utils from typing import TypeVar, Dict, List, Tuple from ..typing import SocSeqList, SocSeqBatch, SocSeqPolicyBatch, SocSeqPolicyLis...
[ "torch.ones_like", "torch.as_tensor", "numpy.sqrt", "re.compile", "torch.utils.data.get_worker_info", "numpy.round", "torch.stack", "torch.sqrt", "torch.nn.utils.rnn.pad_sequence", "torch.tensor", "torch.round", "numpy.concatenate", "pandas.DataFrame", "torch.no_grad", "torch.zeros_like"...
[((390, 437), 'typing.TypeVar', 'TypeVar', (['"""DataTensor"""', 'np.ndarray', 'torch.Tensor'], {}), "('DataTensor', np.ndarray, torch.Tensor)\n", (397, 437), False, 'from typing import TypeVar, Dict, List, Tuple\n'), ((465, 485), 're.compile', 're.compile', (['"""[SaUO]"""'], {}), "('[SaUO]')\n", (475, 485), False, 'i...
# model.py import torch from torch import nn from torch import Tensor from torch.autograd import Variable import numpy as np from sklearn.metrics import accuracy_score class CNNText(nn.Module): def __init__(self, config): super(CNNText, self).__init__() self.config = config # Conv...
[ "torch.nn.MaxPool1d", "torch.cuda.LongTensor", "torch.nn.ReLU", "torch.nn.Dropout", "numpy.mean", "torch.nn.Softmax", "torch.Tensor", "torch.nn.Conv2d", "numpy.array", "torch.cat" ]
[((465, 647), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': 'self.config.in_channels', 'out_channels': 'self.config.num_channels', 'kernel_size': '(self.config.kernel_size[0], self.config.embed_size)', 'stride': '(1)', 'padding': '(0)'}), '(in_channels=self.config.in_channels, out_channels=self.config.\n num_...
# Copyright (c) 2014, 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: # # * Redistributions of source co...
[ "numpy.ma.average", "numpy.sqrt", "pandas.DataFrame", "numpy.array", "poets.timedate.dekad.get_dekad_period", "numpy.ma.masked_invalid", "numpy.nansum", "numpy.choose" ]
[((2499, 2519), 'numpy.array', 'np.array', (['data[cols]'], {}), '(data[cols])\n', (2507, 2519), True, 'import numpy as np\n'), ((2530, 2555), 'numpy.ma.masked_invalid', 'np.ma.masked_invalid', (['dat'], {}), '(dat)\n', (2550, 2555), True, 'import numpy as np\n'), ((2750, 2802), 'pandas.DataFrame', 'pd.DataFrame', (['a...
import numpy as np from scipy import fft from scipy.io import wavfile from sklearn.linear_model import LogisticRegression import pickle import pprint # 准备音乐数据 def create_fft(g, n): rad = "d:/tmp/genres/" + g + "/converted/" + g + "." + str(n).zfill(5) + ".au.wav" (sample_rate, X) = wavfile.read(rad) fft_f...
[ "scipy.fft", "scipy.io.wavfile.read", "numpy.save" ]
[((293, 310), 'scipy.io.wavfile.read', 'wavfile.read', (['rad'], {}), '(rad)\n', (305, 310), False, 'from scipy.io import wavfile\n'), ((419, 445), 'numpy.save', 'np.save', (['sad', 'fft_features'], {}), '(sad, fft_features)\n', (426, 445), True, 'import numpy as np\n'), ((334, 340), 'scipy.fft', 'fft', (['X'], {}), '(...
import torch import numpy as np import time import tempfile import random from itertools import count import gc import os import glob import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import utils default_variables_dict = utils.get_default_variable_dict() LEAVE_PRINT_EVERY_N_SECS = d...
[ "torch.distributions.Categorical", "numpy.array", "numpy.mean", "torch.nn.ModuleList", "numpy.linspace", "numpy.empty", "numpy.random.seed", "os.unlink", "numpy.logspace", "utils.get_gif_html", "tempfile.mkdtemp", "gc.collect", "numpy.std", "utils.get_default_variable_dict", "time.time",...
[((258, 291), 'utils.get_default_variable_dict', 'utils.get_default_variable_dict', ([], {}), '()\n', (289, 291), False, 'import utils\n'), ((761, 818), 'numpy.logspace', 'np.logspace', (['(0)', 'T'], {'num': 'T', 'base': 'self.gamma', 'endpoint': '(False)'}), '(0, T, num=T, base=self.gamma, endpoint=False)\n', (772, 8...
# ***************************************************************************** # Copyright (c) 2019, Intel Corporation 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 sou...
[ "numpy.random.ranf", "numpy.sqrt", "time.time", "pandas.DataFrame" ]
[((1617, 1628), 'time.time', 'time.time', ([], {}), '()\n', (1626, 1628), False, 'import time\n'), ((1637, 1654), 'numpy.random.ranf', 'np.random.ranf', (['n'], {}), '(n)\n', (1651, 1654), True, 'import numpy as np\n'), ((1663, 1680), 'numpy.random.ranf', 'np.random.ranf', (['n'], {}), '(n)\n', (1677, 1680), True, 'imp...
# -*- coding: utf-8 -*- ''' Module for defining the classes related to the :math:`\\mathrm{A}^\\ast` algorithm. :math:`\\mathrm{A}^\\ast` algorithm (pronounced as "A star") is a search algorithm proposed in 1968 by `<NAME> & Raphael (1968) <https://doi.org/10.1109/TSSC.1968.300136>`_. It optimally finds the minimum co...
[ "matplotlib.pyplot.gca", "matplotlib.pyplot.colorbar", "numpy.any", "shapely.geometry.Point", "numpy.array", "matplotlib.pyplot.figure", "shapely.geometry.LineString", "numpy.empty", "numpy.isinf", "matplotlib.colors.LinearSegmentedColormap.from_list" ]
[((3406, 3422), 'numpy.array', 'array', (['coordsIdx'], {}), '(coordsIdx)\n', (3411, 3422), False, 'from numpy import array\n'), ((14228, 14276), 'numpy.empty', 'np.empty', (['(numberRows, numberCols)'], {'dtype': 'object'}), '((numberRows, numberCols), dtype=object)\n', (14236, 14276), True, 'import numpy as np\n'), (...
import json import numpy as np import pandas as pd from pyplan_engine.classes.evaluators.BaseEvaluator import BaseEvaluator from pyplan_engine.common.classes.filterChoices import filterChoices from pyplan_engine.common.classes.indexValuesReq import IndexValuesReq from cubepy.cube import kindToString class PandasEva...
[ "numpy.prod", "cubepy.cube.kindToString", "json.dumps", "numpy.concatenate", "pandas.DataFrame", "numpy.isinf", "pandas.DataFrame.pivot_table" ]
[((20206, 20221), 'json.dumps', 'json.dumps', (['res'], {}), '(res)\n', (20216, 20221), False, 'import json\n'), ((2670, 2799), 'pandas.DataFrame.pivot_table', 'pd.DataFrame.pivot_table', (['_filteredDataFrame'], {'index': '_rows', 'columns': '_columns', 'aggfunc': 'sby', 'margins': '(False)', 'margins_name': '"""Total...
from Hw.H5_CNN_Explaination.data import ImgDataset from Hw.H5_CNN_Explaination.utils import * from Hw.H5_CNN_Explaination.model import Classifier from Hw.H3_CNN.model import CNN5 from Hw.H3_CNN.utils import get_best_checkpoint_path, test, evaluate import copy import matplotlib.pyplot as plt import numpy as np from lime...
[ "torch.nn.CrossEntropyLoss", "argparse.ArgumentParser", "matplotlib.pyplot.show", "torch.load", "lime.lime_image.LimeImageExplainer", "matplotlib.pyplot.close", "Hw.H5_CNN_Explaination.data.ImgDataset", "Hw.H3_CNN.utils.get_best_checkpoint_path", "torch.cuda.is_available", "os.path.isdir", "os.m...
[((449, 527), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""it\'s usage tip."""', 'description': '"""--h help info."""'}), '(usage="it\'s usage tip.", description=\'--h help info.\')\n', (472, 527), False, 'import argparse\n'), ((1744, 1769), 'torch.cuda.is_available', 'torch.cuda.is_availabl...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 9/13/20 4:53 PM # @Author : joshon # @Site : hsae # @File : test.py # @Software: PyCharm from tensorflow.keras.layers import Lambda ,Input import tensorflow as tf import numpy as np import keras.backend as K import cv2 # @tf.function def f(): a = tf...
[ "tensorflow.Variable", "numpy.array", "tensorflow.constant", "tensorflow.matmul", "tensorflow.print", "keras.backend.concatenate" ]
[((829, 862), 'keras.backend.concatenate', 'K.concatenate', (['[tt1, tt2]'], {'axis': '(0)'}), '([tt1, tt2], axis=0)\n', (842, 862), True, 'import keras.backend as K\n'), ((318, 354), 'tensorflow.constant', 'tf.constant', (['[[10, 10], [11.0, 1.0]]'], {}), '([[10, 10], [11.0, 1.0]])\n', (329, 354), True, 'import tensor...
import io import json import requests from pathlib import Path import joblib import numpy as np import zipfile def format_neurovault_metadata_url(collection_id): return f"https://neurovault.org/api/collections/{collection_id}" def format_neurovault_download_url(collection_id): return f"https://neurovault.o...
[ "pathlib.Path", "io.BytesIO", "requests.get", "numpy.array_split", "joblib.Parallel", "joblib.delayed" ]
[((667, 693), 'requests.get', 'requests.get', (['metadata_url'], {}), '(metadata_url)\n', (679, 693), False, 'import requests\n'), ((987, 1009), 'requests.get', 'requests.get', (['data_url'], {}), '(data_url)\n', (999, 1009), False, 'import requests\n'), ((1736, 1774), 'numpy.array_split', 'np.array_split', (['collecti...
# import the necessary packages import sys sys.path.append("../") from pyimagesearch.utils.captchahelper import preprocess from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.models import load_model from imutils.contours import sort_contours from imutils import grab_contours from imuti...
[ "cv2.rectangle", "cv2.imshow", "tensorflow.keras.models.load_model", "imutils.paths.list_images", "sys.path.append", "argparse.ArgumentParser", "cv2.threshold", "imutils.grab_contours", "tensorflow.keras.preprocessing.image.img_to_array", "cv2.waitKey", "pyimagesearch.utils.captchahelper.preproc...
[((43, 65), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (58, 65), False, 'import sys\n'), ((436, 461), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (459, 461), False, 'import argparse\n'), ((717, 742), 'tensorflow.keras.models.load_model', 'load_model', (["args['mo...
import numpy as np from scipy.stats import linregress import json import sys import getopt try: from matplotlib import pyplot as plt except Exception: import matplotlib matplotlib.use('pdf') from matplotlib import pyplot as plt def save_plot(alg_name, file_suffix, y_label, legend_list, title_prefix, ...
[ "scipy.stats.linregress", "getopt.getopt", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "json.loads", "matplotlib.pyplot.ylabel", "matplotlib.use", "matplotlib.pyplot.clf", "matplotlib.pyplot.plot", "matplotlib.pyplot.axes", "matplotlib.pyplot.ticklabel_format", "numpy.around", "nu...
[((559, 600), 'matplotlib.pyplot.legend', 'plt.legend', (['legend_list'], {'loc': '"""upper left"""'}), "(legend_list, loc='upper left')\n", (569, 600), True, 'from matplotlib import pyplot as plt\n'), ((770, 789), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['y_label'], {}), '(y_label)\n', (780, 789), True, 'from matpl...
import pytest def test_import_vdjtools_beta_w_validation(): import pandas as pd import numpy as np import os from tcrdist.paths import path_to_base from tcrdist.vdjtools_funcs import import_vdjtools from tcrdist.repertoire import TCRrep # Reformat vdj_tools input format for tcrdist3 ...
[ "tcrdist.repertoire.TCRrep", "tcrdist.vdjtools_funcs.import_vdjtools", "numpy.all", "os.path.join" ]
[((342, 445), 'os.path.join', 'os.path.join', (['path_to_base', '"""tcrdist"""', '"""data"""', '"""formats"""', '"""vdj.M_15_CD8_beta.clonotypes.TRB.txt.gz"""'], {}), "(path_to_base, 'tcrdist', 'data', 'formats',\n 'vdj.M_15_CD8_beta.clonotypes.TRB.txt.gz')\n", (354, 445), False, 'import os\n'), ((453, 595), 'tcrdis...
import rdkit.Chem as Chem import numpy as np import os ''' This script is meant to split the Tox21 train dataset into the individual target datasets for training single-task models. ''' if __name__ == '__main__': # Read SDF suppl = Chem.SDMolSupplier( os.path.join( os.path.dirname(os.path.dirname(__file__)...
[ "os.path.dirname", "numpy.isnan", "rdkit.Chem.MolToSmiles", "numpy.concatenate" ]
[((661, 682), 'rdkit.Chem.MolToSmiles', 'Chem.MolToSmiles', (['mol'], {}), '(mol)\n', (677, 682), True, 'import rdkit.Chem as Chem\n'), ((911, 934), 'numpy.concatenate', 'np.concatenate', (['(ys, y)'], {}), '((ys, y))\n', (925, 934), True, 'import numpy as np\n'), ((295, 320), 'os.path.dirname', 'os.path.dirname', (['_...
# imports import pickle import cv2 import glob import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg # Helper functions for camera calibration # Directory for calibration images image_dir = glob.glob('camera_cal/calibration*.jpg') # Directory to Save objpoints and imgpoints on pickle c...
[ "cv2.imwrite", "numpy.array", "numpy.zeros", "cv2.destroyAllWindows", "cv2.cvtColor", "cv2.calibrateCamera", "cv2.findChessboardCorners", "cv2.drawChessboardCorners", "cv2.imread", "glob.glob" ]
[((224, 264), 'glob.glob', 'glob.glob', (['"""camera_cal/calibration*.jpg"""'], {}), "('camera_cal/calibration*.jpg')\n", (233, 264), False, 'import glob\n'), ((897, 929), 'numpy.zeros', 'np.zeros', (['(6 * 9, 3)', 'np.float32'], {}), '((6 * 9, 3), np.float32)\n', (905, 929), True, 'import numpy as np\n'), ((1980, 2003...
### code from the notebook pycocoEvalDemo.ipynb from pycocotools.coco import COCO import cocoeval_modif import numpy as np import pandas as pd from os.path import join import logging logging.basicConfig(format='%(levelname)s: %(filename)s L.%(lineno)d - %(message)s', level=logging.INFO) ### Validation File: # ...
[ "logging.basicConfig", "tabulate.tabulate", "pycocotools.coco.COCO", "os.path.join", "numpy.random.randint", "pandas.DataFrame", "cocoeval_modif.COCOeval" ]
[((185, 301), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s: %(filename)s L.%(lineno)d - %(message)s"""', 'level': 'logging.INFO'}), "(format=\n '%(levelname)s: %(filename)s L.%(lineno)d - %(message)s', level=\n logging.INFO)\n", (204, 301), False, 'import logging\n'), ((1572...
""" datasets used for integration testing This is just a collection of useful datasets which seemed useful for testing purposes. The classes in here should not be relied upon in production mode. """ import numpy as np import vigra from tsdl.tools import OpArrayPiperWithAccessCount from tsdl.tools import OpReorderAxe...
[ "numpy.random.choice", "numpy.where", "vigra.defaultAxistags", "tsdl.tools.OutputSlot", "numpy.square", "numpy.linspace", "numpy.sin", "vigra.taggedView" ]
[((2385, 2397), 'tsdl.tools.OutputSlot', 'OutputSlot', ([], {}), '()\n', (2395, 2397), False, 'from tsdl.tools import OutputSlot\n'), ((3185, 3197), 'tsdl.tools.OutputSlot', 'OutputSlot', ([], {}), '()\n', (3195, 3197), False, 'from tsdl.tools import OutputSlot\n'), ((4064, 4076), 'tsdl.tools.OutputSlot', 'OutputSlot',...
import lsh_partition import models import torch import pandas as pd import numpy as np import math from distributed_rep import embeding from models import core from lsh_partition import lsh from torch import nn import time class MatchingModel(): def __init__(self, embeding_style, embeding_src, schema, train_src=No...
[ "torch.jit.script", "models.core.DMFormatDataset", "numpy.reshape", "torch.nn.CrossEntropyLoss", "pandas.read_csv", "torch.jit.load", "torch.max", "lsh_partition.lsh.LSH", "torch.reshape", "torch.reshprediction_l_src.numpy", "torch.tensor", "models.core.ERModel", "numpy.concatenate", "dist...
[((9655, 9666), 'time.time', 'time.time', ([], {}), '()\n', (9664, 9666), False, 'import time\n'), ((10127, 10138), 'time.time', 'time.time', ([], {}), '()\n', (10136, 10138), False, 'import time\n'), ((449, 466), 'torch.nn.SmoothL1Loss', 'nn.SmoothL1Loss', ([], {}), '()\n', (464, 466), False, 'from torch import nn\n')...
""" This module handles the selection of image regions, the second stage of processing. """ import re from typing import Callable, Any, Sequence, Tuple import numpy as np import cv2 import matplotlib.pyplot as plt import pytesseract from fuzzywuzzy import process from .text_row_extractors import RowExtraction def ...
[ "matplotlib.pyplot.imshow", "matplotlib.pyplot.waitforbuttonpress", "numpy.repeat", "matplotlib.pyplot.connect", "matplotlib.pyplot.xlabel", "re.match", "matplotlib.pyplot.close", "numpy.array", "fuzzywuzzy.process.extractOne", "numpy.concatenate", "pytesseract.image_to_string", "matplotlib.py...
[((454, 499), 'numpy.repeat', 'np.repeat', (['whitespace_element', 'image.shape[1]'], {}), '(whitespace_element, image.shape[1])\n', (463, 499), True, 'import numpy as np\n'), ((522, 563), 'numpy.array', 'np.array', (['whitespace_line'], {'dtype': 'np.uint8'}), '(whitespace_line, dtype=np.uint8)\n', (530, 563), True, '...
import numpy as np class Stencil: ''' Initialise a Stencil instance with relative cell indices where -1 and 0 are the adjacent cells upwind and downwind of the target face respectively. ''' def __init__(self, indices): self.indices = np.array(indices) def cellCentres(self, mesh, in...
[ "numpy.append", "numpy.array" ]
[((267, 284), 'numpy.array', 'np.array', (['indices'], {}), '(indices)\n', (275, 284), True, 'import numpy as np\n'), ((618, 630), 'numpy.array', 'np.array', (['Cs'], {}), '(Cs)\n', (626, 630), True, 'import numpy as np\n'), ((1119, 1164), 'numpy.append', 'np.append', (['self.indices', '(self.indices[-1] + 1)'], {}), '...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import gzip import numpy from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.contrib.learn.python.learn.datasets import base from tensorflow.python.framework ...
[ "numpy.multiply", "tensorflow.python.framework.dtypes.as_dtype", "six.moves.xrange", "tensorflow.contrib.learn.python.learn.datasets.base.Datasets", "numpy.random.seed", "numpy.concatenate", "tensorflow.python.framework.random_seed.get_seed", "numpy.load", "numpy.arange", "numpy.random.shuffle" ]
[((4669, 4687), 'numpy.load', 'np.load', (['train_dir'], {}), '(train_dir)\n', (4676, 4687), True, 'import numpy as np\n'), ((5143, 5203), 'tensorflow.contrib.learn.python.learn.datasets.base.Datasets', 'base.Datasets', ([], {'train': 'train', 'validation': 'validation', 'test': 'test'}), '(train=train, validation=vali...
import utils from os import path import numpy as np from scipy import stats, sparse from paris_cluster import ParisClusterer from sklearn.linear_model import LogisticRegression from tqdm import tqdm import pandas as pd ##Set a random seed to make it reproducible! np.random.seed(utils.getSeed()) #load up data: x, y = ...
[ "numpy.unique", "utils.getSeed", "utils.get_subset", "numpy.random.choice", "utils.calc_AVE_quick", "utils.trim", "numpy.memmap", "utils.evaluate_split", "utils.split_clusters", "numpy.isin", "numpy.random.randint", "utils.get_four_matrices", "pandas.DataFrame", "utils.cut_balanced", "ut...
[((320, 372), 'utils.load_feature_and_label_matrices', 'utils.load_feature_and_label_matrices', ([], {'type': '"""morgan"""'}), "(type='morgan')\n", (357, 372), False, 'import utils\n'), ((511, 552), 'numpy.random.choice', 'np.random.choice', (['(226)', '(100)'], {'replace': '(False)'}), '(226, 100, replace=False)\n', ...
# import sys # sys.path.append('..') # sys.path.append('../..') import numpy as np from pulse2percept import electrode2currentmap as e2cm from pulse2percept import effectivecurrent2brightness as ec2b from pulse2percept import utils from pulse2percept import files as n2sf # import npy2savedformats as n2sf import matpl...
[ "pulse2percept.electrode2currentmap.Retina", "pulse2percept.effectivecurrent2brightness.onoffRecombine", "pulse2percept.effectivecurrent2brightness.TemporalModel", "numpy.array", "pulse2percept.electrode2currentmap.retinalmovie2electrodtimeseries", "numpy.sin", "pulse2percept.electrode2currentmap.Movie2...
[((1756, 1789), 'numpy.arange', 'np.arange', (['(-2362)', '(2364)', 'e_spacing'], {}), '(-2362, 2364, e_spacing)\n', (1765, 1789), True, 'import numpy as np\n'), ((2176, 2243), 'pulse2percept.electrode2currentmap.ElectrodeArray', 'e2cm.ElectrodeArray', (['rlist', 'xlist', 'ylist', 'hlist'], {'ptype': '"""subretinal"""'...
#!/usr/bin/env python """ @package ion.agents.data.test.test_external_dataset_agent_slocum @file ion/agents/data/test/test_external_dataset_agent_slocum.py @author <NAME> @brief """ # Import pyon first for monkey patching. from pyon.public import log, IonObject from pyon.ion.resource import PRED, RT from interface.se...
[ "numpy.dtype", "interface.objects.ExternalDatasetAgentInstance", "interface.services.sa.idata_product_management_service.DataProductManagementServiceClient", "interface.objects.ContactInformation", "interface.services.dm.idataset_management_service.DatasetManagementServiceClient", "interface.services.sa.i...
[((2049, 2081), 'interface.services.dm.idataset_management_service.DatasetManagementServiceClient', 'DatasetManagementServiceClient', ([], {}), '()\n', (2079, 2081), False, 'from interface.services.dm.idataset_management_service import DatasetManagementServiceClient\n'), ((2101, 2141), 'interface.services.sa.idata_acqu...
from typing import Dict, Optional, Union import numpy as np from werkzeug import ImmutableMultiDict from .endpoint import Endpoint def predict(model, input_data: Union[Dict, ImmutableMultiDict], config: Endpoint): # new model if hasattr(model, "public_inputs"): sample = {} for k, v in dict(i...
[ "numpy.array" ]
[((780, 796), 'numpy.array', 'np.array', (['sample'], {}), '(sample)\n', (788, 796), True, 'import numpy as np\n')]
import numpy as np import math from scipy import special import matplotlib.pyplot as plt import sys def pdf(x, a, b): return math.gamma(a + b) / (math.gamma(a) * math.gamma(b)) * x**(a - 1) * (1 - x)**(b-1) args = sys.argv[1:] if len(args) != 2: print("Invalid arguments. Example: main.py 2 5") sys.exit(1) a = ...
[ "math.gamma", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.linspace", "sys.exit", "numpy.vectorize", "matplotlib.pyplot.show" ]
[((393, 417), 'numpy.linspace', 'np.linspace', (['(0)', '(1.0)', '(100)'], {}), '(0, 1.0, 100)\n', (404, 417), True, 'import numpy as np\n'), ((425, 442), 'numpy.vectorize', 'np.vectorize', (['pdf'], {}), '(pdf)\n', (437, 442), True, 'import numpy as np\n'), ((462, 487), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'...
import numpy as np from ....constants import DATA from .normalization_transform import NormalizationTransform from .histogram_standardization import normalize class HistogramRandomChange(NormalizationTransform): """ Same thins as HistogramStandardization but the landmarks is a random curve """ def __i...
[ "numpy.convolve", "numpy.ones", "numpy.random.rand", "numpy.sort", "numpy.squeeze", "numpy.max", "numpy.random.randint", "numpy.linspace", "numpy.interp", "numpy.min" ]
[((985, 1021), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'self.nb_point_ini'], {}), '(0, 1, self.nb_point_ini)\n', (996, 1021), True, 'import numpy as np\n'), ((1035, 1057), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(100)'], {}), '(0, 1, 100)\n', (1046, 1057), True, 'import numpy as np\n'), ((1071, 1091)...
# By: <NAME>, 2018 # Ported to Keras from the official Tensorflow implementation by Magenta # Most utilities in 'utils' remained the same as in the official implementation """ SketchRNN data loading, callbacks and image manipulation utilities. """ from __future__ import absolute_import from __future__ import division...
[ "numpy.random.rand", "numpy.argsort", "numpy.array", "copy.deepcopy", "numpy.linalg.norm", "numpy.sin", "numpy.random.random", "numpy.concatenate", "numpy.maximum", "six.moves.cStringIO", "random.choice", "keras.backend.set_value", "requests.get", "numpy.std", "numpy.copy", "numpy.mini...
[((3132, 3192), 'numpy.concatenate', 'np.concatenate', (['(train_strokes, valid_strokes, test_strokes)'], {}), '((train_strokes, valid_strokes, test_strokes))\n', (3146, 3192), True, 'import numpy as np\n'), ((8890, 8903), 'numpy.sin', 'np.sin', (['omega'], {}), '(omega)\n', (8896, 8903), True, 'import numpy as np\n'),...
import numpy as np def load_swirls(): with np.load('a1_data.npz') as data: x = data['swirls_x'] y = data['swirls_y'] return x, y def load_noisy_circles(): with np.load('a1_data.npz') as data: x = data['circles_x'] y = data['circles_y'] return x, y def load_noisy_moo...
[ "numpy.exp", "numpy.mean", "numpy.load" ]
[((1325, 1350), 'numpy.mean', 'np.mean', (['(Y_predicted == Y)'], {}), '(Y_predicted == Y)\n', (1332, 1350), True, 'import numpy as np\n'), ((49, 71), 'numpy.load', 'np.load', (['"""a1_data.npz"""'], {}), "('a1_data.npz')\n", (56, 71), True, 'import numpy as np\n'), ((192, 214), 'numpy.load', 'np.load', (['"""a1_data.n...
import numpy as np n = int(input()) t, a = map(int, input().split()) h = list(map(int, input().split())) h = np.array(h) dift = abs((t - h * 0.006) - a) ans = np.argmin(dift) + 1 print(ans)
[ "numpy.argmin", "numpy.array" ]
[((115, 126), 'numpy.array', 'np.array', (['h'], {}), '(h)\n', (123, 126), True, 'import numpy as np\n'), ((171, 186), 'numpy.argmin', 'np.argmin', (['dift'], {}), '(dift)\n', (180, 186), True, 'import numpy as np\n')]
import torch from timm.models import vision_transformer from PIL import Image from torch import nn import os import tarfile import numpy as np import random import io import torch from torchvision import transforms STRIDE = 1 EXTRACTION_FPS = 25 NUM_FRAMES = 4 def _sample_video_idx(vlen): frame_stride = STRIDE * E...
[ "torchvision.transforms.CenterCrop", "tarfile.open", "timm.models.vision_transformer.timesformer_base_patch16_224", "random.choice", "PIL.Image.new", "torch.load", "torch.stack", "os.path.join", "io.BytesIO", "numpy.linspace", "torchvision.transforms.Normalize", "pdb.set_trace", "torchvision...
[((907, 977), 'timm.models.vision_transformer.timesformer_base_patch16_224', 'vision_transformer.timesformer_base_patch16_224', ([], {'num_frames': 'NUM_FRAMES'}), '(num_frames=NUM_FRAMES)\n', (954, 977), False, 'from timm.models import vision_transformer\n'), ((991, 1004), 'torch.nn.Identity', 'nn.Identity', ([], {}),...
# coding: utf-8 # DMUtils.py # Dark Matter rate calculator as part of WIMpy_NREFT # # Author: <NAME> # Email: <EMAIL> # Last updated: 02/03/2018 import numpy as np from numpy import pi, cos, sin from scipy.integrate import trapz, cumtrapz, quad from scipy.interpolate import interp1d from numpy.random import rand fro...
[ "numpy.clip", "numpy.sqrt", "numpy.minimum", "scipy.integrate.quad", "numpy.exp", "os.path.realpath", "numpy.zeros", "scipy.special.erf", "numpy.cos", "numpy.sin", "numpy.vectorize" ]
[((1890, 1921), 'numpy.clip', 'np.clip', (['vel_integral', '(0)', '(1e+30)'], {}), '(vel_integral, 0, 1e+30)\n', (1897, 1921), True, 'import numpy as np\n'), ((3912, 3938), 'numpy.sqrt', 'np.sqrt', (['(2 * m_N * amu * E)'], {}), '(2 * m_N * amu * E)\n', (3919, 3938), True, 'import numpy as np\n'), ((4098, 4152), 'numpy...
import numpy as np from cgn import LinearConstraint, Parameter from cgn.translator.get_sub_matrix import get_sub_matrix def test_get_sub_matrix(): n1 = 13 n2 = 1 n3 = 3 c = 10 x1 = Parameter(start=np.zeros(n1), name="x1") x2 = Parameter(start=np.zeros(n2), name="x2") x3 = Parameter(start...
[ "cgn.LinearConstraint", "numpy.isclose", "cgn.translator.get_sub_matrix.get_sub_matrix", "numpy.zeros", "numpy.concatenate", "numpy.random.randn" ]
[((355, 377), 'numpy.random.randn', 'np.random.randn', (['c', 'n1'], {}), '(c, n1)\n', (370, 377), True, 'import numpy as np\n'), ((387, 409), 'numpy.random.randn', 'np.random.randn', (['c', 'n2'], {}), '(c, n2)\n', (402, 409), True, 'import numpy as np\n'), ((419, 441), 'numpy.random.randn', 'np.random.randn', (['c', ...
from mechanism import Vector, get_joints, Mechanism import numpy as np import matplotlib.pyplot as plt O2, O4, O6, A, B, C, D, E, F, G = get_joints('O2 O4 O6 A B C D E F G') a = Vector((O4, B), r=2.5) b = Vector((B, A), r=8.4) c = Vector((O4, O2), r=12.5, theta=0, style='ground') d = Vector((O2, A), r=5) e = Vector((C...
[ "numpy.array", "mechanism.Vector", "numpy.zeros", "numpy.deg2rad", "mechanism.get_joints", "matplotlib.pyplot.show" ]
[((138, 174), 'mechanism.get_joints', 'get_joints', (['"""O2 O4 O6 A B C D E F G"""'], {}), "('O2 O4 O6 A B C D E F G')\n", (148, 174), False, 'from mechanism import Vector, get_joints, Mechanism\n'), ((179, 201), 'mechanism.Vector', 'Vector', (['(O4, B)'], {'r': '(2.5)'}), '((O4, B), r=2.5)\n', (185, 201), False, 'fro...
# coding=utf-8 from sklearn import preprocessing import numpy as np import os import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # import tensorflow as tf from helper import linear_regression as lr # my own module from helper import general as general data = pd.read_csv('ex1data1.txt', names=['...
[ "seaborn.lmplot", "pandas.read_csv", "helper.general.get_y", "numpy.zeros", "helper.linear_regression.cost", "helper.linear_regression.batch_gradient_decent", "sklearn.preprocessing.MaxAbsScaler", "helper.general.get_X" ]
[((284, 343), 'pandas.read_csv', 'pd.read_csv', (['"""ex1data1.txt"""'], {'names': "['population', 'profit']"}), "('ex1data1.txt', names=['population', 'profit'])\n", (295, 343), True, 'import pandas as pd\n'), ((385, 449), 'seaborn.lmplot', 'sns.lmplot', (['"""population"""', '"""profit"""', 'data'], {'size': '(10)', ...
#Simple script which crawls a folder containing several sequence roots #and loads all background frames in sequence names containing "empty" #then reports scatterplot graphs of Hue vs. Value, Hue vs. Saturation, #and Saturation vs. Value import sys import numpy as np from FrameManager import * from RGBTrainingTFWriter...
[ "matplotlib.colors.rgb_to_hsv", "numpy.random.choice", "numpy.array", "matplotlib.pyplot.scatter", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show" ]
[((1637, 1676), 'matplotlib.colors.rgb_to_hsv', 'matplotlib.colors.rgb_to_hsv', (['rgbFrames'], {}), '(rgbFrames)\n', (1665, 1676), False, 'import matplotlib\n'), ((1693, 1744), 'numpy.array', 'np.array', (['[[179.0, 255.0, 255.0]]'], {'dtype': 'np.float32'}), '([[179.0, 255.0, 255.0]], dtype=np.float32)\n', (1701, 174...
import numpy as np from skimage import util, exposure, io, color # from matplotlib import pyplot as plt import cv2 def view_histogram_bw(image): """ Args: View the histogram of a black and white image image: Float array of the image Returns: Hist and its bin array """ hist, bins = np.histo...
[ "cv2.merge", "skimage.util.invert", "skimage.exposure.adjust_log", "skimage.exposure.adjust_gamma", "skimage.io.imread", "cv2.equalizeHist", "skimage.exposure.rescale_intensity", "cv2.cvtColor", "cv2.split", "numpy.percentile", "skimage.color.gray2rgb" ]
[((2188, 2217), 'numpy.percentile', 'np.percentile', (['image', '(2, 98)'], {}), '(image, (2, 98))\n', (2201, 2217), True, 'import numpy as np\n'), ((2236, 2289), 'skimage.exposure.rescale_intensity', 'exposure.rescale_intensity', (['image'], {'in_range': '(p2, p98)'}), '(image, in_range=(p2, p98))\n', (2262, 2289), Fa...
import numpy as np import pytest from skimage.measure import approximate_polygon, subdivide_polygon from skimage.measure._polygon import _SUBDIVISION_MASKS square = np.array([ [0, 0], [0, 1], [0, 2], [0, 3], [1, 3], [2, 3], [3, 3], [3, 2], [3, 1], [3, 0], [2, 0], [1, 0], [0, 0] ]) def test_approximat...
[ "numpy.testing.assert_equal", "skimage.measure.approximate_polygon", "skimage.measure.subdivide_polygon", "numpy.array", "pytest.raises", "numpy.testing.run_module_suite", "numpy.testing.assert_array_equal" ]
[((166, 285), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [0, 2], [0, 3], [1, 3], [2, 3], [3, 3], [3, 2], [3, 1], [3,\n 0], [2, 0], [1, 0], [0, 0]]'], {}), '([[0, 0], [0, 1], [0, 2], [0, 3], [1, 3], [2, 3], [3, 3], [3, 2], [\n 3, 1], [3, 0], [2, 0], [1, 0], [0, 0]])\n', (174, 285), True, 'import numpy as np\n'...
import numpy as np # the type of float to use throughout the session. _FLOATX = 'float32' _EPSILON = 10e-8 _UID_PREFIXES = {} def epsilon(): return _EPSILON def set_epsilon(e): global _EPSILON _EPSILON = e def floatx(): '''Returns the default float type, as a string (e.g. 'float16', 'float32'...
[ "numpy.asarray" ]
[((652, 680), 'numpy.asarray', 'np.asarray', (['x'], {'dtype': '_FLOATX'}), '(x, dtype=_FLOATX)\n', (662, 680), True, 'import numpy as np\n')]
import logging import os import signal import subprocess import tempfile from typing import List, Sequence, Optional, Tuple, Union import numpy as np import pandas as pd import prctl import soundfile as sf from d3m import container, utils from d3m.base import utils as base_utils from d3m.metadata import base as metada...
[ "logging.getLogger", "soundfile.info", "d3m.primitive_interfaces.base.CallResult", "d3m.metadata.base.DataMetadata", "d3m.container.DataFrame", "d3m.base.utils.get_tabular_resource", "os.path.join", "joblib.Parallel", "os.path.dirname", "numpy.zeros", "prctl.set_pdeathsig", "tempfile.NamedTemp...
[((560, 587), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (577, 587), False, 'import logging\n'), ((1610, 1648), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'mode': '"""rb"""'}), "(mode='rb')\n", (1637, 1648), False, 'import tempfile\n'), ((2820, 2845), 'soundfi...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as tick from statistics import mean from tqdm import tqdm import multiprocessing as mp from . import model as dymod class Filter: """誤ベクトル数の確認,誤ベクトル数によるフィルタリング処理""" @classmethod def get_incorrect_vector_examp...
[ "statistics.mean", "matplotlib.pyplot.grid", "pandas.read_csv", "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.gca", "tqdm.tqdm", "multiprocessing.cpu_count", "matplotlib.pyplot.axhline", "numpy.sum", "multiprocessing.Pool", "matplotlib.pyplot.title", "matplotlib.pyplot.show" ]
[((1637, 1664), 'statistics.mean', 'mean', (['incorrect_vector_list'], {}), '(incorrect_vector_list)\n', (1641, 1664), False, 'from statistics import mean\n'), ((1849, 1898), 'matplotlib.pyplot.axhline', 'plt.axhline', (['incorrect_vector_mean'], {'color': '"""black"""'}), "(incorrect_vector_mean, color='black')\n", (1...
from scannerpy import Database, Job, ColumnType, DeviceType import os import sys import math import numpy as np from tqdm import tqdm import six.moves.urllib as urllib import kernels # What model to download. MODEL_TEMPLATE_URL = 'http://download.tensorflow.org/models/object_detection/{:s}.tar.gz' if __name__ == '__...
[ "scannerpy.Database", "os.path.basename", "sys.exit", "kernels.smooth_box", "numpy.fromstring", "kernels.nms_bulk" ]
[((622, 632), 'scannerpy.Database', 'Database', ([], {}), '()\n', (630, 632), False, 'from scannerpy import Database, Job, ColumnType, DeviceType\n'), ((1991, 2026), 'kernels.nms_bulk', 'kernels.nms_bulk', (['bundled_data_list'], {}), '(bundled_data_list)\n', (2007, 2026), False, 'import kernels\n'), ((2049, 2106), 'ke...
import fiona import numpy as np import os import pytest import rasterio import mapchete from mapchete.index import zoom_index_gen from mapchete.io import get_boto3_bucket @pytest.mark.remote def test_remote_indexes(mp_s3_tmpdir, gtiff_s3): zoom = 7 gtiff_s3.dict.update(zoom_levels=zoom) def gen_indexes...
[ "mapchete.index.zoom_index_gen", "rasterio.open", "os.path.join", "numpy.array_equal", "os.system", "mapchete.open" ]
[((2545, 2597), 'os.path.join', 'os.path.join', (['mp.config.output.path', "('%s.vrt' % zoom)"], {}), "(mp.config.output.path, '%s.vrt' % zoom)\n", (2557, 2597), False, 'import os\n'), ((2978, 3017), 'os.path.join', 'os.path.join', (['mp_tmpdir', '"""cleantopo_br"""'], {}), "(mp_tmpdir, 'cleantopo_br')\n", (2990, 3017)...
# %% """ This module contains copies of the classes SOMToolBox_Parse and SomViz provided by the lecturers. """ import pandas as pd import numpy as np import gzip from scipy.spatial import distance_matrix, distance from ipywidgets import Layout, HBox, Box, widgets, interact import plotly.graph_objects as go class SOM...
[ "sklearn.datasets.load_iris", "plotly.graph_objects.Heatmap", "plotly.graph_objects.Layout", "gzip.open", "numpy.power", "scipy.spatial.distance_matrix", "src.NeighbourhoodGraph.NeighbourhoodGraph", "numpy.zeros", "plotly.graph_objects.Scatter", "plotly.graph_objects.FigureWidget", "numpy.array"...
[((8420, 8490), 'src.NeighbourhoodGraph.NeighbourhoodGraph', 'NeighbourhoodGraph', (['s_weights', 'smap_x_dim', 'smap_y_dim'], {'input_data': 'iris'}), '(s_weights, smap_x_dim, smap_y_dim, input_data=iris)\n', (8438, 8490), False, 'from src.NeighbourhoodGraph import NeighbourhoodGraph\n'), ((9079, 9186), 'plotly.graph_...
#!/usr/bin/env python # pylint: disable=W0201 import sys import argparse import yaml import numpy as np import random import os.path as osp # torch import torch import torch.nn as nn import torch.optim as optim # torchlight import torchlight from torchlight import str2bool from torchlight import DictAction from torchl...
[ "matplotlib.pyplot.ylabel", "torchlight.import_class", "numpy.mean", "argparse.ArgumentParser", "matplotlib.pyplot.xlabel", "numpy.random.seed", "numpy.concatenate", "sklearn.metrics.confusion_matrix", "subprocess.check_output", "matplotlib.use", "matplotlib.pyplot.title", "matplotlib.pyplot.m...
[((365, 386), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (379, 386), False, 'import matplotlib\n'), ((1391, 1512), 'subprocess.check_output', 'subprocess.check_output', (["['nvidia-smi', '--query-gpu=memory.used', '--format=csv,nounits,noheader']"], {'encoding': '"""utf-8"""'}), "(['nvidia-sm...
from pyridge.generic.scaler import Scaler import numpy as np class LogScaler(Scaler): """ Scaler for that transform the values in a logaritmic scaler. """ def __init__(self): self.min_: np.float def get_params(self): return {'min_': self.min_} def fit(self, values): ...
[ "numpy.exp", "numpy.log", "numpy.min" ]
[((335, 357), 'numpy.min', 'np.min', (['values'], {'axis': '(0)'}), '(values, axis=0)\n', (341, 357), True, 'import numpy as np\n'), ((407, 441), 'numpy.log', 'np.log', (['(values + (1.0 - self.min_))'], {}), '(values + (1.0 - self.min_))\n', (413, 441), True, 'import numpy as np\n'), ((600, 614), 'numpy.exp', 'np.exp'...
#! /usr/bin/env python # title : TurboTest.py # description : This script tests the turbo decoding for parallel concatenated convolutional codes # author : <NAME> # python_version : 3.5.2 import numpy as np from numpy.random import rand, randn from scipy.stats import norm import matplotlib.pypl...
[ "ConvEncoder.TurboEncoder", "matplotlib.pyplot.grid", "numpy.sqrt", "numpy.random.rand", "matplotlib.pyplot.xscale", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "ConvTrellisDef.ConvTrellisDef", "Interleaver.Interleaver", "matplotlib.pyplot.plot", "matplotlib.pyplot.yscale", "numpy....
[((782, 795), 'Interleaver.Interleaver', 'Interleaver', ([], {}), '()\n', (793, 795), False, 'from Interleaver import Interleaver\n'), ((1012, 1034), 'SisoDecoder.SisoDecoder', 'SisoDecoder', (['trellis_p'], {}), '(trellis_p)\n', (1023, 1034), False, 'from SisoDecoder import SisoDecoder\n'), ((1139, 1166), 'ConvEncoder...
## GROUP import numpy as np import cv2 from PIL import Image import os from options.test_options import TestOptions from options.train_options import TrainOptions from data import create_dataset from models import create_model from util.visualizer import save_images from util import html import torch i...
[ "torchvision.transforms.CenterCrop", "numpy.tile", "PIL.Image.fromarray", "data.create_dataset", "PIL.Image.new", "options.train_options.TrainOptions", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.cvtColor", "torchvision.transforms.Normalize", "torchvision.utils.make_grid", "cv2.resize", ...
[((419, 438), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (435, 438), False, 'import cv2\n'), ((1283, 1300), 'models.create_model', 'create_model', (['opt'], {}), '(opt)\n', (1295, 1300), False, 'from models import create_model\n'), ((1513, 1532), 'data.create_dataset', 'create_dataset', (['opt'], {...
# -------------- import pandas as pd import scipy.stats as stats import math import numpy as np import warnings warnings.filterwarnings('ignore') #Sample_Size sample_size=2000 #Z_Critical Score z_critical = stats.norm.ppf(q = 0.95) # path [File location variable] data=pd.read_csv(path) #Cod...
[ "warnings.filterwarnings", "pandas.Series", "pandas.read_csv", "scipy.stats.chi2_contingency", "scipy.stats.norm.ppf", "numpy.array", "scipy.stats.chi2.ppf", "statsmodels.stats.weightstats.ztest", "pandas.concat", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((119, 152), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (142, 152), False, 'import warnings\n'), ((220, 242), 'scipy.stats.norm.ppf', 'stats.norm.ppf', ([], {'q': '(0.95)'}), '(q=0.95)\n', (234, 242), True, 'import scipy.stats as stats\n'), ((297, 314), 'pandas.read_c...
import numpy as np from pysal.lib.common import requires @requires('matplotlib') def shift_colormap(cmap, start=0, midpoint=0.5, stop=1.0, name='shiftedcmap'): ''' Function to offset the "center" of a colormap. Useful for data with a negative min and positive max and you want the middle of the colormap...
[ "matplotlib.pyplot.savefig", "matplotlib.colors.LinearSegmentedColormap", "matplotlib.pyplot.Normalize", "numpy.max", "numpy.linspace", "pysal.lib.common.requires", "numpy.min", "matplotlib.pyplot.register_cmap", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((59, 81), 'pysal.lib.common.requires', 'requires', (['"""matplotlib"""'], {}), "('matplotlib')\n", (67, 81), False, 'from pysal.lib.common import requires\n'), ((1974, 1996), 'pysal.lib.common.requires', 'requires', (['"""matplotlib"""'], {}), "('matplotlib')\n", (1982, 1996), False, 'from pysal.lib.common import req...
import scipy import numpy as np import unittest as ut from qfactor import get_distance from qfactor.gates import RxGate class TestRxGateConstructor ( ut.TestCase ): def test_rxgate_constructor_invalid ( self ): self.assertRaises( TypeError, RxGate, 1, 0 ) self.assertRaises( TypeError, RxGate, ...
[ "qfactor.get_distance", "numpy.array", "qfactor.gates.RxGate", "scipy.linalg.expm", "numpy.array_equal", "unittest.main" ]
[((1137, 1146), 'unittest.main', 'ut.main', ([], {}), '()\n', (1144, 1146), True, 'import unittest as ut\n'), ((767, 789), 'qfactor.gates.RxGate', 'RxGate', (['np.pi', '(0)', '(True)'], {}), '(np.pi, 0, True)\n', (773, 789), False, 'from qfactor.gates import RxGate\n'), ((804, 830), 'numpy.array', 'np.array', (['[[0, 1...
from __future__ import absolute_import from __future__ import print_function import pylab as plt import sys sys.path.insert(0, r'c:\work\dist\git\camb') import camb from cosmomc_to_camb import get_camb_params import planckStyle as s import numpy as np from planck import SN import os g = s.getSinglePlotter() like = S...
[ "sys.path.insert", "pylab.subplots_adjust", "numpy.log10", "pylab.savefig", "planckStyle.plotBands", "numpy.log", "numpy.argsort", "numpy.array", "camb.get_background", "numpy.mean", "numpy.ix_", "numpy.max", "cosmomc_to_camb.get_camb_params", "numpy.min", "pylab.subplots", "numpy.logs...
[((109, 156), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""c:\\\\work\\\\dist\\\\git\\\\camb"""'], {}), "(0, 'c:\\\\work\\\\dist\\\\git\\\\camb')\n", (124, 156), False, 'import sys\n'), ((290, 310), 'planckStyle.getSinglePlotter', 's.getSinglePlotter', ([], {}), '()\n', (308, 310), True, 'import planckStyle as s\...
import math import numpy as np from scipy.signal import convolve2d from skimage.morphology import dilation, disk def generate_cross(size, lw): assert size % 2 == 1 center = math.floor(size/2.) cross = np.zeros([size, size]) cross[center, :] = np.ones(size) cross[:, center] = np.ones(size) ...
[ "scipy.signal.convolve2d", "numpy.ones", "math.floor", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.linalg.norm", "math.exp", "skimage.morphology.disk", "skimage.measure.label" ]
[((187, 209), 'math.floor', 'math.floor', (['(size / 2.0)'], {}), '(size / 2.0)\n', (197, 209), False, 'import math\n'), ((219, 241), 'numpy.zeros', 'np.zeros', (['[size, size]'], {}), '([size, size])\n', (227, 241), True, 'import numpy as np\n'), ((265, 278), 'numpy.ones', 'np.ones', (['size'], {}), '(size)\n', (272, ...
"""Unit tests for echo_classification.py.""" import copy import unittest import numpy from gewittergefahr.gg_utils import grids from gewittergefahr.gg_utils import radar_utils from gewittergefahr.gg_utils import echo_classification as echo_classifn TOLERANCE = 1e-6 # The following constants are used to test _estimat...
[ "gewittergefahr.gg_utils.echo_classification._apply_convective_criterion1", "gewittergefahr.gg_utils.echo_classification._apply_convective_criterion5", "gewittergefahr.gg_utils.echo_classification._get_peakedness", "gewittergefahr.gg_utils.echo_classification._apply_convective_criterion4", "numpy.array", ...
[((368, 403), 'numpy.linspace', 'numpy.linspace', (['(-90.0)', '(90.0)'], {'num': '(19)'}), '(-90.0, 90.0, num=19)\n', (382, 403), False, 'import numpy\n'), ((758, 868), 'gewittergefahr.gg_utils.radar_utils.get_valid_heights', 'radar_utils.get_valid_heights', ([], {'data_source': 'radar_utils.MYRORSS_SOURCE_ID', 'field...
""" Sets ligth-related constants """ import yaml import numpy as np LUT_VOX_DIV = np.zeros(0) N_OP_CHANNEL = 0 LIGHT_SIMULATED = True OP_CHANNEL_EFFICIENCY = np.zeros(0) #: Prescale factor analogous to ScintPreScale in LArSoft FIXME SCINT_PRESCALE = 1 #: Ion + excitation work function in `MeV` W_PH = 19.5e-6 # MeV de...
[ "numpy.array", "numpy.zeros", "yaml.load" ]
[((83, 94), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (91, 94), True, 'import numpy as np\n'), ((159, 170), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (167, 170), True, 'import numpy as np\n'), ((729, 766), 'yaml.load', 'yaml.load', (['df'], {'Loader': 'yaml.FullLoader'}), '(df, Loader=yaml.FullLoader)...
import numpy as np import random import cv2 import os def Draw(image, result): # output 저장을 위한 경로 설정 output_path = os.path.dirname(image) + "/ocred_" + os.path.basename(image) # Draw TextBox with opencv img = cv2.imread(image) np.random.seed(42) COLORS = np.random.randint(0, 255, size=(255,...
[ "cv2.rectangle", "cv2.imwrite", "os.path.dirname", "numpy.random.randint", "os.path.basename", "numpy.random.seed", "cv2.imread", "random.randint" ]
[((230, 247), 'cv2.imread', 'cv2.imread', (['image'], {}), '(image)\n', (240, 247), False, 'import cv2\n'), ((252, 270), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (266, 270), True, 'import numpy as np\n'), ((284, 339), 'numpy.random.randint', 'np.random.randint', (['(0)', '(255)'], {'size': '(255...
import matplotlib.pyplot as plt import numpy as np import json if __name__ == '__main__': x = np.arange(100) y = x*x z = x*x + 10*x with open("example.json") as json_file: s = json.load(json_file) plt.rcParams.update(s) plt.plot(x,y,label='Y=x*x'); plt.plot(x,z,label='Y=x*x+10*x'); plt.title('Nice JSON...
[ "matplotlib.pyplot.savefig", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.rcParams.update", "json.load", "matplotlib.pyplot.title", "matplotlib.pyplot.legend" ]
[((98, 112), 'numpy.arange', 'np.arange', (['(100)'], {}), '(100)\n', (107, 112), True, 'import numpy as np\n'), ((210, 232), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['s'], {}), '(s)\n', (229, 232), True, 'import matplotlib.pyplot as plt\n'), ((235, 264), 'matplotlib.pyplot.plot', 'plt.plot', (['x'...
import ROOT as root import numpy as np import uncertainties.unumpy as unp from uncertainties import ufloat from uncertainties.unumpy import nominal_values as noms from uncertainties.unumpy import std_devs as stds from array import array import sys ############### Readout command line argument try: name_of_folder ...
[ "numpy.mean", "sys.path.insert", "ROOT.gStyle.SetStatFontSize", "array.array", "ROOT.TCanvas", "ROOT.gStyle.SetLabelSize", "ROOT.TLegend", "ROOT.gStyle.SetOptTitle", "ROOT.gStyle.SetTitleOffset", "numpy.array", "uncertainties.unumpy.nominal_values", "uncertainties.unumpy.std_devs", "ROOT.gSt...
[((511, 558), 'sys.path.insert', 'sys.path.insert', (['(0)', "('./' + name_of_folder + '/')"], {}), "(0, './' + name_of_folder + '/')\n", (526, 558), False, 'import sys\n'), ((771, 797), 'ROOT.gStyle.SetOptTitle', 'root.gStyle.SetOptTitle', (['(0)'], {}), '(0)\n', (794, 797), True, 'import ROOT as root\n'), ((798, 822)...
import torch as th import math import numpy as np from video_loader import VideoLoader from torch.utils.data import DataLoader import argparse from preprocessing import Preprocessing from random_sequence_shuffler import RandomSequenceSampler import torch.nn.functional as F from tqdm import tqdm import os import clip ...
[ "os.path.exists", "random_sequence_shuffler.RandomSequenceSampler", "numpy.savez", "torch.cuda.FloatTensor", "argparse.ArgumentParser", "preprocessing.Preprocessing", "os.makedirs", "tqdm.tqdm", "video_loader.VideoLoader", "os.path.isfile", "os.path.dirname", "torch.utils.data.DataLoader", "...
[((329, 396), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Easy video feature extractor"""'}), "(description='Easy video feature extractor')\n", (352, 396), False, 'import argparse\n'), ((1414, 1606), 'video_loader.VideoLoader', 'VideoLoader', (['args.csv'], {'framerate': '(1 / args.cl...
# Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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 app...
[ "numpy.allclose", "projectq.cengines.DecompositionRule", "projectq.ops.Ph", "projectq.ops.Ry", "itertools.product", "math.cos", "cmath.exp", "cmath.phase", "projectq.meta.Control", "math.sin", "projectq.ops.Rz", "projectq.meta.get_control_count" ]
[((2586, 2648), 'numpy.allclose', 'numpy.allclose', (['U', 'matrix'], {'rtol': '(10 * TOLERANCE)', 'atol': 'TOLERANCE'}), '(U, matrix, rtol=10 * TOLERANCE, atol=TOLERANCE)\n', (2600, 2648), False, 'import numpy\n'), ((8659, 8731), 'projectq.cengines.DecompositionRule', 'DecompositionRule', (['BasicGate', '_decompose_ar...
import minifemlib from minifemlib import Elements import triangulation from triangulation import Triangulation import dmsh import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Delaunay from scipy.sparse import csc_matrix, linalg as sla import scipy.linalg from matplotlib import rcParams from mat...
[ "triangulation.Triangulation", "scipy.sparse.linalg.splu", "dmsh.Circle", "numpy.ix_", "matplotlib.animation.ArtistAnimation", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.dot", "dmsh.generate", "minifemlib.Elements", "scipy.sparse.csc_matrix", "matplotlib.pyplot.tripcolor", "numpy.aran...
[((3475, 3497), 'dmsh.Circle', 'dmsh.Circle', (['[0, 0]', '(1)'], {}), '([0, 0], 1)\n', (3486, 3497), False, 'import dmsh\n'), ((3514, 3536), 'dmsh.generate', 'dmsh.generate', (['c', '(0.05)'], {}), '(c, 0.05)\n', (3527, 3536), False, 'import dmsh\n'), ((3539, 3567), 'triangulation.Triangulation', 'Triangulation', (['p...
import numpy as np from patterns.pattern import Pattern class ThreeBlackCrows(Pattern): def __init__(self, data, lower_shadow_threshold: float = 0.5): """Constructor of ThreeBlackCrows class Parameters ---------- data : pandas dataframe A pandas dataframe, expected to...
[ "numpy.abs", "numpy.logical_and" ]
[((1973, 2018), 'numpy.logical_and', 'np.logical_and', (['three_negative', 'lower_shadows'], {}), '(three_negative, lower_shadows)\n', (1987, 2018), True, 'import numpy as np\n'), ((1591, 1613), 'numpy.abs', 'np.abs', (['self.real_body'], {}), '(self.real_body)\n', (1597, 1613), True, 'import numpy as np\n')]
import numpy as np def ornstein_uhlenbeck(input, theta=0.1, sigma=0.2): """Ornstein-Uhlembeck perturbation. Using Gaussian Wiener process.""" noise_perturb = -theta*input + sigma*np.random.normal() return input + noise_perturb noise = 0 for _ in range(20): noise = ornstein_uhlenbeck(noise) ...
[ "numpy.random.normal" ]
[((192, 210), 'numpy.random.normal', 'np.random.normal', ([], {}), '()\n', (208, 210), True, 'import numpy as np\n')]
# Copyright (C) 2020 NumS Development Team. # # 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 ...
[ "numpy.median", "numpy.ones", "nums.core.application_manager.instance", "itertools.product", "numpy.partition", "numpy.array", "numpy.quantile", "numpy.percentile", "numpy.cov", "numpy.arange" ]
[((925, 939), 'numpy.ones', 'np.ones', (['(10,)'], {}), '((10,))\n', (932, 939), True, 'import numpy as np\n'), ((1032, 1078), 'itertools.product', 'itertools.product', (['qs', 'methods', 'interpolations'], {}), '(qs, methods, interpolations)\n', (1049, 1078), False, 'import itertools\n'), ((1384, 1420), 'numpy.array',...
# -- coding: utf-8 -- # -- coding: utf-8 -- import tensorflow as tf import numpy as np import argparse from model.hyparameter import parameter import pandas as pd class DataIterator(): def __init__(self, site_id=0, pollutant_id=4, is_training=True, ...
[ "argparse.ArgumentParser", "pandas.read_csv", "tensorflow.Session", "tensorflow.data.Dataset.from_generator", "numpy.array", "numpy.concatenate" ]
[((1590, 1647), 'numpy.concatenate', 'np.concatenate', (['[self.train_data, self.test_data]'], {'axis': '(0)'}), '([self.train_data, self.test_data], axis=0)\n', (1604, 1647), True, 'import numpy as np\n'), ((3958, 4048), 'tensorflow.data.Dataset.from_generator', 'tf.data.Dataset.from_generator', (['self.generator'], {...
'''BernoulliNB gave slightly better results than MultinomialNB on just TF-IDF feature vector.''' import numpy as np #Load the binary files of sarcastic and non-sarcastic tweets sarcasm=np.load("posproc.npy") neutral=np.load("negproc.npy") #Print sample data print ("10 sample sarcastic lines:") print (sarcasm[:10]) p...
[ "sklearn.metrics.f1_score", "sklearn.model_selection.train_test_split", "sklearn.svm.LinearSVC", "sklearn.metrics.precision_score", "sklearn.metrics.recall_score", "numpy.array", "sklearn.feature_extraction.text.TfidfVectorizer", "numpy.concatenate", "sklearn.preprocessing.FunctionTransformer", "n...
[((187, 209), 'numpy.load', 'np.load', (['"""posproc.npy"""'], {}), "('posproc.npy')\n", (194, 209), True, 'import numpy as np\n'), ((218, 240), 'numpy.load', 'np.load', (['"""negproc.npy"""'], {}), "('negproc.npy')\n", (225, 240), True, 'import numpy as np\n'), ((2439, 2473), 'numpy.concatenate', 'np.concatenate', (['...
from enn import * import numpy as np from grid_LSTM import netLSTM, netLSTM_full from grid_data_v2 import TextDataset import grid_data_v2 as grid_data from grid_configuration import config from util import Record, save_var, get_file_list, Regeneralize, list_to_csv from torch.autograd import Variable from torch.utils.da...
[ "grid_LSTM.netLSTM", "util.Record", "torch.nn.MSELoss", "numpy.array", "grid_LSTM.netLSTM_full", "torch.random.manual_seed", "os.path.exists", "matplotlib.pyplot.plot", "pandas.DataFrame.from_dict", "numpy.random.seed", "os.mkdir", "util.get_file_list", "matplotlib.pyplot.ion", "numpy.shap...
[((442, 451), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (449, 451), True, 'import matplotlib.pyplot as plt\n'), ((472, 502), 'torch.random.manual_seed', 'torch.random.manual_seed', (['seed'], {}), '(seed)\n', (496, 502), False, 'import torch\n'), ((503, 523), 'numpy.random.seed', 'np.random.seed', (['seed']...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Nipype translation of ANTs' workflows.""" import numpy as np # general purpose from pkg_resources import resource_filename as pkgr_fn # nipype from nipype.pipeline import engine as pe from nipype.interf...
[ "niworkflows.interfaces.fixes.FixHeaderApplyTransforms", "nibabel.load", "numpy.array", "nipype.interfaces.utility.IdentityInterface", "niworkflows.interfaces.nibabel.Binarize", "nipype.pipeline.engine.Workflow", "nipype.interfaces.utility.Select", "nipype.interfaces.ants.N4BiasFieldCorrection", "te...
[((2147, 2209), 'templateflow.api.get', 'get_template', (['in_template'], {'suffix': 'mri_scheme'}), '(in_template, suffix=mri_scheme, **template_specs)\n', (2159, 2209), True, 'from templateflow.api import get as get_template\n'), ((2642, 2714), 'templateflow.api.get', 'get_template', (['in_template'], {'desc': '"""br...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest import hypothesis.strategies as st from hypothesis import given import numpy as np from caffe2.python import core, workspace import caffe2.pytho...
[ "numpy.random.rand", "hypothesis.strategies.integers", "unittest.skipIf", "numpy.random.randint", "hypothesis.strategies.booleans", "caffe2.python.core.CreateOperator", "unittest.main" ]
[((399, 464), 'unittest.skipIf', 'unittest.skipIf', (['(not workspace.C.use_mkldnn)', '"""No MKLDNN support."""'], {}), "(not workspace.C.use_mkldnn, 'No MKLDNN support.')\n", (414, 464), False, 'import unittest\n'), ((1104, 1119), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1117, 1119), False, 'import unittes...
from __future__ import print_function path = '/network/aopp/cirrus/pred/kloewer/swm_bf_cntrl/data/' dpath = '/network/aopp/cirrus/pred/kloewer/swm_back_ronew/' outpath = '/network/home/aopp/kloewer/swm/paperplot/' import os; os.chdir(path) # change working directory import numpy as np from scipy import sparse import ...
[ "matplotlib.pyplot.text", "matplotlib.pyplot.savefig", "os.chdir", "numpy.array", "numpy.linspace", "matplotlib.pyplot.close", "numpy.sign", "matplotlib.pyplot.tight_layout", "numpy.load", "matplotlib.pyplot.subplots", "numpy.round" ]
[((227, 241), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (235, 241), False, 'import os\n'), ((2573, 2635), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)', '(3)'], {'figsize': '(8.8, 9)', 'sharex': '(True)', 'sharey': '(True)'}), '(3, 3, figsize=(8.8, 9), sharex=True, sharey=True)\n', (2585, 2635), True,...
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # @Author: dbirman # @Date: 2017-06-14 16:51:24 import sys import csv import random import webbrowser import os import numpy as np # other functions def n...
[ "random.shuffle", "csv.writer", "webbrowser.open", "os.getcwd", "os.path.isfile", "numpy.sum", "sys.exit", "csv.reader", "numpy.divide" ]
[((559, 578), 'csv.reader', 'csv.reader', (['csvfile'], {}), '(csvfile)\n', (569, 578), False, 'import csv\n'), ((1304, 1325), 'random.shuffle', 'random.shuffle', (['order'], {}), '(order)\n', (1318, 1325), False, 'import random\n'), ((2391, 2410), 'csv.writer', 'csv.writer', (['outfile'], {}), '(outfile)\n', (2401, 24...
""" Logic for wavefunction evaluation. """ import logging import time import jax import functools import numpy as np from jax import numpy as jnp from deeperwin.configuration import EvaluationConfig from deeperwin.hamiltonian import get_local_energy, calculate_forces from deeperwin.loggers import DataLogger from dee...
[ "logging.getLogger", "deeperwin.hamiltonian.get_local_energy", "numpy.linalg.solve", "numpy.reshape", "jax.numpy.array", "functools.partial", "jax.jit", "jax.numpy.nanmean", "deeperwin.mcmc.calculate_metrics", "deeperwin.hamiltonian.calculate_forces", "time.time", "numpy.arange" ]
[((408, 432), 'logging.getLogger', 'logging.getLogger', (['"""dpe"""'], {}), "('dpe')\n", (425, 432), False, 'import logging\n'), ((436, 485), 'functools.partial', 'functools.partial', (['jax.jit'], {'static_argnums': '(0, 1)'}), '(jax.jit, static_argnums=(0, 1))\n', (453, 485), False, 'import functools\n'), ((646, 712...
import numpy as np import matplotlib.pyplot as plt import barnes as bn def gr_to_bv(g, r): """ From https://www.sdss3.org/dr8/algorithms/sdssUBVRITransform.php Returns the B-V value and the RMS error. """ return .62*(g - r) + .15, .07 def random_stars(fname, N): """ Randomly draw stellar...
[ "matplotlib.pyplot.hist", "matplotlib.pyplot.savefig", "matplotlib.pyplot.clf", "barnes.period", "numpy.genfromtxt" ]
[((1313, 1332), 'barnes.period', 'bn.period', (['age', 'bvs'], {}), '(age, bvs)\n', (1322, 1332), True, 'import barnes as bn\n'), ((1338, 1347), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (1345, 1347), True, 'import matplotlib.pyplot as plt\n'), ((1352, 1364), 'matplotlib.pyplot.hist', 'plt.hist', (['ps'], {...
from subprocess import STDOUT import sys from tf.transformations import rotation_matrix sys.path.insert(0, './yolov5') from yolov5.utils.datasets import LoadImages, LoadStreams,LoadWebcam,LoadRealsense from yolov5.utils.general import check_img_size, non_max_suppression, scale_coords from yolov5.utils.torch_utils impo...
[ "cv2.rectangle", "sys.path.insert", "visualization_msgs.msg.Marker", "APF_BASE_utils.BASE_TOOLS_for_car.Vis_and_deside", "visualization_msgs.msg.MarkerArray", "rospy.init_node", "torch.from_numpy", "cv2.imshow", "numpy.array", "rospy.Rate", "tf.TransformListener", "yolov5.utils.general.check_i...
[((88, 118), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./yolov5"""'], {}), "(0, './yolov5')\n", (103, 118), False, 'import sys\n'), ((16647, 16672), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (16670, 16672), False, 'import argparse\n'), ((18469, 18498), 'yolov5.utils.general.check_...
#! /usr/bin/env python """ This node publishes the joint states to make a square trajectory with the SCARA's end-effector @author: <NAME> (<EMAIL>) """ import rospy import rospkg rospack = rospkg.RosPack() import sys sys.path.insert(0, rospack.get_path('first_assignment')+"/scripts") from sensor_msgs.msg imp...
[ "rospy.is_shutdown", "rospy.init_node", "rospy.get_param", "sensor_msgs.msg.JointState", "numpy.absolute", "IK_function.scara_IK", "numpy.array", "rospkg.RosPack", "rospy.Rate", "geometry_msgs.msg.Pose", "rospy.Publisher", "geometry_msgs.msg.PoseArray" ]
[((200, 216), 'rospkg.RosPack', 'rospkg.RosPack', ([], {}), '()\n', (214, 216), False, 'import rospkg\n'), ((3964, 4003), 'rospy.init_node', 'rospy.init_node', (['"""trajectory_publisher"""'], {}), "('trajectory_publisher')\n", (3979, 4003), False, 'import rospy\n'), ((4021, 4077), 'rospy.get_param', 'rospy.get_param',...
import numpy from PyQt5 import QtWidgets from PyQt5.QtWidgets import QMessageBox, QApplication from PyQt5.QtCore import QRect from PyQt5.QtGui import QTextCursor from orangewidget import gui from orangewidget.settings import Setting from oasys.widgets import gui as oasysgui from oasys.widgets.widget import Automatic...
[ "oasys.widgets.gui.widgetBox", "numpy.abs", "orangecontrib.wofry.widgets.gui.python_script.PythonScript", "oasys.widgets.gui.plotWindow", "orangewidget.gui.comboBox", "oasys.widgets.gui.createTabPage", "orangewidget.gui.widgetBox", "orangewidget.settings.Setting", "numpy.array", "oasys.widgets.gui...
[((787, 797), 'orangewidget.settings.Setting', 'Setting', (['(1)'], {}), '(1)\n', (794, 797), False, 'from orangewidget.settings import Setting\n'), ((1462, 1495), 'oasys.widgets.gui.tabWidget', 'oasysgui.tabWidget', (['self.mainArea'], {}), '(self.mainArea)\n', (1480, 1495), True, 'from oasys.widgets import gui as oas...
import numpy from scipy.ndimage.filters import gaussian_filter as gf from scipy.special import expit import sys import os import matplotlib.pyplot as plt import imageio.core #config rootDir = 'd:/projects/astronomy/tgas/' #code number_of_bins = 2 w = 800//number_of_bins argv = sys.argv hotSlice...
[ "scipy.ndimage.filters.gaussian_filter", "scipy.special.expit", "numpy.dsplit", "numpy.zeros", "os.path.isdir", "os.mkdir" ]
[((568, 608), 'numpy.zeros', 'numpy.zeros', ([], {'shape': '(w * 2, w * 2, w * 2)'}), '(shape=(w * 2, w * 2, w * 2))\n', (579, 608), False, 'import numpy\n'), ((1273, 1303), 'scipy.ndimage.filters.gaussian_filter', 'gf', (['a'], {'sigma': 'sigma', 'truncate': '(3)'}), '(a, sigma=sigma, truncate=3)\n', (1275, 1303), Tru...
from functools import reduce from operator import mul from quantecon import cartesian import numpy as np from numpy import zeros def prod(l): return reduce(mul, l, 1.0) from dolo.numeric.misc import mlinspace class Grid: def nodes(self): return self.__nodes__ def n_nodes(self): return self...
[ "functools.reduce", "dolo.numeric.misc.mlinspace", "interpolation.smolyak.SmolyakGrid", "numpy.array", "numpy.zeros", "numpy.concatenate", "quantecon.cartesian" ]
[((151, 170), 'functools.reduce', 'reduce', (['mul', 'l', '(1.0)'], {}), '(mul, l, 1.0)\n', (157, 170), False, 'from functools import reduce\n'), ((665, 680), 'numpy.array', 'np.array', (['point'], {}), '(point)\n', (673, 680), True, 'import numpy as np\n'), ((912, 940), 'numpy.array', 'np.array', (['nodes'], {'dtype':...
import numpy as np from gym import utils, spaces from gym.envs.mujoco import mujoco_env from gym.envs.robotics.rotations import quat2euler, euler2quat, mat2euler import os # import random from random import uniform, randint, randrange from mjremote import mjremote import time from doorenv2.envs.doorenv import DoorEnv ...
[ "random.uniform", "numpy.array", "numpy.zeros", "gym.utils.EzPickle.__init__", "numpy.random.randint", "numpy.concatenate", "numpy.random.uniform" ]
[((845, 874), 'gym.utils.EzPickle.__init__', 'utils.EzPickle.__init__', (['self'], {}), '(self)\n', (868, 874), False, 'from gym import utils, spaces\n'), ((947, 987), 'numpy.array', 'np.array', (['[a[-1], -a[-1], a[-1], -a[-1]]'], {}), '([a[-1], -a[-1], a[-1], -a[-1]])\n', (955, 987), True, 'import numpy as np\n'), ((...
import numpy as np from BDMesh.Mesh1D import Mesh1D MyMesh = Mesh1D(0.0, 10.0, 0.0, 0.0) print(MyMesh) print(MyMesh.physical_boundary_1) MyMesh.physical_boundary_1 = 2 print(MyMesh.physical_boundary_1) MyMesh2 = Mesh1D(2.0, 10.0, 0.0, 0.0) print(MyMesh) print(MyMesh2) print(MyMesh == MyMesh2) print(MyMesh == 2) ...
[ "BDMesh.Mesh1D.Mesh1D", "numpy.linspace" ]
[((63, 90), 'BDMesh.Mesh1D.Mesh1D', 'Mesh1D', (['(0.0)', '(10.0)', '(0.0)', '(0.0)'], {}), '(0.0, 10.0, 0.0, 0.0)\n', (69, 90), False, 'from BDMesh.Mesh1D import Mesh1D\n'), ((217, 244), 'BDMesh.Mesh1D.Mesh1D', 'Mesh1D', (['(2.0)', '(10.0)', '(0.0)', '(0.0)'], {}), '(2.0, 10.0, 0.0, 0.0)\n', (223, 244), False, 'from BD...