code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import ctypes import pathlib import numpy # load the shared library libfile = pathlib.Path(__file__).parent / 'lib' / 'distance.so' lib = ctypes.CDLL(str(libfile)) # == p distance lib.pDistance.restype = None lib.pDistance.argtypes = [ numpy.ctypeslib.ndpointer( # alignment: n * m matrix dtype=numpy.uin...
[ "pathlib.Path", "numpy.ascontiguousarray", "numpy.zeros", "numpy.ctypeslib.ndpointer" ]
[((243, 317), 'numpy.ctypeslib.ndpointer', 'numpy.ctypeslib.ndpointer', ([], {'dtype': 'numpy.uint8', 'ndim': '(2)', 'flags': '"""C_CONTIGUOUS"""'}), "(dtype=numpy.uint8, ndim=2, flags='C_CONTIGUOUS')\n", (268, 317), False, 'import numpy\n'), ((540, 615), 'numpy.ctypeslib.ndpointer', 'numpy.ctypeslib.ndpointer', ([], {...
import sys import os import logging from collections import Counter import datetime as dt import tqdm import fire import numpy as np from keras.optimizers import SGD, Adam, RMSprop from keras.preprocessing.image import ImageDataGenerator from keras.layers import Dropout, Flatten, Dense, Input from keras.models import ...
[ "keras.preprocessing.image.ImageDataGenerator", "numpy.load", "numpy.ones", "keras.models.Model", "keras.applications.VGG16", "keras.layers.Input", "os.path.join", "keras.applications.Xception", "keras.optimizers.SGD", "keras.layers.Flatten", "keras.applications.MobileNet", "datetime.datetime....
[((466, 499), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (487, 499), False, 'import logging\n'), ((500, 666), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)s [%(filename)s:%(funcName)s:%(lineno)d] %(levelname)s - %(me...
#!/usr/bin/env python # # test_vtk.py - # # Author: <NAME> <<EMAIL>> # import tempfile import shutil import os.path as op import numpy as np import pytest import fsl.data.vtk as fslvtk datadir = op.join(op.dirname(__file__), 'testdata') def test_create_vtkmesh(): # Test: # - cre...
[ "fsl.data.vtk.getFIRSTPrefix", "os.path.join", "os.path.dirname", "fsl.data.vtk.loadVTKPolydataFile", "fsl.data.vtk.findReferenceImage", "numpy.isclose", "tempfile.mkdtemp", "numpy.array", "pytest.raises", "shutil.rmtree", "fsl.data.vtk.VTKMesh", "numpy.all" ]
[((232, 252), 'os.path.dirname', 'op.dirname', (['__file__'], {}), '(__file__)\n', (242, 252), True, 'import os.path as op\n'), ((412, 438), 'os.path.join', 'op.join', (['datadir', 'testbase'], {}), '(datadir, testbase)\n', (419, 438), True, 'import os.path as op\n'), ((467, 503), 'fsl.data.vtk.loadVTKPolydataFile', 'f...
import numpy as np # integers i = 10 print(type(i)) a_i = np.zeros(i, dtype=int) print(type(a_i)) # ndarray print(type(a_i[0])) # int64 #floats x = 119.0 print(type(x)) # floating point num y = 1.19e2 print(type(y)) # 119 in scientific notation z = np.zeros(i, dtype=float) print(type...
[ "numpy.zeros" ]
[((61, 83), 'numpy.zeros', 'np.zeros', (['i'], {'dtype': 'int'}), '(i, dtype=int)\n', (69, 83), True, 'import numpy as np\n'), ((285, 309), 'numpy.zeros', 'np.zeros', (['i'], {'dtype': 'float'}), '(i, dtype=float)\n', (293, 309), True, 'import numpy as np\n')]
#!/usr/bin/env python3.7 """ The copyrights of this software are owned by Duke University. Please refer to the LICENSE and README.md files for licensing instructions. The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent """ # builtins import os import inspect import n...
[ "numpy.array", "inspect.stack", "os.path.join" ]
[((1222, 1273), 'os.path.join', 'os.path.join', (['"""config"""', '"""system"""', '"""exceptions.json"""'], {}), "('config', 'system', 'exceptions.json')\n", (1234, 1273), False, 'import os\n'), ((2338, 2353), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (2351, 2353), False, 'import inspect\n'), ((1828, 1846), '...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import numpy as np import tensorflow as tf from operator import mul import blocksparse.ewops as ew from tensorflow.python.framework import function ones = 0 out = 0 bench = ...
[ "tensorflow.test.main", "numpy.random.uniform", "numpy.abs", "tensorflow.gradients", "blocksparse.ewops.float_cast", "tensorflow.device", "numpy.square", "numpy.ones", "tensorflow.ConfigProto", "tensorflow.placeholder", "blocksparse.ewops.bias_relu", "tensorflow.name_scope" ]
[((4171, 4185), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (4183, 4185), True, 'import tensorflow as tf\n'), ((1476, 1554), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'intra_op_parallelism_threads': '(1)', 'inter_op_parallelism_threads': '(1)'}), '(intra_op_parallelism_threads=1, inter_op_parallel...
import os import numpy as np import pandas as pd import pytorch_lightning as pl import sklearn.metrics as metrics import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader, Dataset def compute_score(y_true, y_pred, round_digits=3): log_loss = round(metrics.log_los...
[ "torch.nn.ReLU", "torch.utils.data.DataLoader", "numpy.argmax", "pandas.read_csv", "torch.nn.Embedding", "sklearn.metrics.log_loss", "numpy.zeros", "torch.cat", "numpy.isnan", "sklearn.metrics.roc_auc_score", "sklearn.metrics.precision_recall_curve", "torch.nn.functional.binary_cross_entropy_w...
[((458, 504), 'sklearn.metrics.precision_recall_curve', 'metrics.precision_recall_curve', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (488, 504), True, 'import sklearn.metrics as metrics\n'), ((691, 704), 'numpy.argmax', 'np.argmax', (['f1'], {}), '(f1)\n', (700, 704), True, 'import numpy as np\n'), ((1310, 1344)...
import jax import jax.numpy as jnp import snow from collections import namedtuple import numpy as np Exploration = namedtuple("Exploration", ['type', 'param']) class ExplorationConfig: def __init__(self, type, N, interpolation_type, upsilon_t0, upsilon_tN, exploration_prob_t0, exploration_prob_tN, softm...
[ "jax.random.uniform", "numpy.random.uniform", "jax.numpy.where", "snow.reshape", "jax.numpy.cumsum", "jax.numpy.max", "jax.numpy.argmax", "numpy.clip", "jax.random.PRNGKey", "collections.namedtuple", "numpy.linspace", "jax.numpy.take_along_axis", "jax.nn.softmax" ]
[((117, 161), 'collections.namedtuple', 'namedtuple', (['"""Exploration"""', "['type', 'param']"], {}), "('Exploration', ['type', 'param'])\n", (127, 161), False, 'from collections import namedtuple\n'), ((2611, 2669), 'jax.nn.softmax', 'jax.nn.softmax', (['(returns / temperature)'], {'axis': '(0)', 'initial': '(0.0)'}...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Basic Python implementation of Threes! ''' import numpy as np __author__ = '<NAME> <<EMAIL>>' def to_val(x): x = np.asarray(x) return np.where(x < 3, x, 3*2.0**(x-3)) def to_score(x): x = np.asarray(x) return np.where(x < 3, 0, 3**(x-2)) def find_f...
[ "random.shuffle", "numpy.asarray", "numpy.zeros", "random.choice", "random.random", "numpy.where" ]
[((171, 184), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (181, 184), True, 'import numpy as np\n'), ((196, 234), 'numpy.where', 'np.where', (['(x < 3)', 'x', '(3 * 2.0 ** (x - 3))'], {}), '(x < 3, x, 3 * 2.0 ** (x - 3))\n', (204, 234), True, 'import numpy as np\n'), ((255, 268), 'numpy.asarray', 'np.asarray',...
import copy import numbers import warnings from abc import ABC, abstractmethod from typing import Optional, Union, Tuple, List import torch import numpy as np import nibabel as nib import SimpleITK as sitk from .. import TypeData, DATA, AFFINE, TypeNumber from ..data.subject import Subject from ..data.image import Im...
[ "warnings.warn", "copy.copy", "numpy.errstate", "torch.rand" ]
[((3460, 3477), 'copy.copy', 'copy.copy', (['sample'], {}), '(sample)\n', (3469, 3477), False, 'import copy\n'), ((3492, 3516), 'numpy.errstate', 'np.errstate', ([], {'all': '"""raise"""'}), "(all='raise')\n", (3503, 3516), True, 'import numpy as np\n'), ((11115, 11152), 'warnings.warn', 'warnings.warn', (['message', '...
from convex_adversarial.dual_network import robust_loss, RobustBounds import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable import numpy as np import time import copy import os DEBUG = False ## standard training def train_baseline(loader, model, opt, epoch, log1, log2, ve...
[ "numpy.sum", "torch.cat", "torch.no_grad", "torch.ones", "convex_adversarial.dual_network.robust_loss", "torch.FloatTensor", "torch.zeros", "torch.log", "copy.deepcopy", "torch.autograd.Variable", "torch.set_grad_enabled", "torch.sum", "convex_adversarial.dual_network.RobustBounds", "numpy...
[((510, 521), 'time.time', 'time.time', ([], {}), '()\n', (519, 521), False, 'import time\n'), ((1832, 1843), 'time.time', 'time.time', ([], {}), '()\n', (1841, 1843), False, 'import time\n'), ((3348, 3359), 'time.time', 'time.time', ([], {}), '()\n', (3357, 3359), False, 'import time\n'), ((5424, 5448), 'torch.cuda.em...
from common import transform_data import common.constants as cn from common.trinary_data import TrinaryData from common.data_provider import DataProvider from common_python.testing import helpers import numpy as np import os import pandas as pd import unittest IGNORE_TEST = False class TestDataTransformer(unittest...
[ "unittest.main", "pandas.DataFrame", "numpy.abs", "common_python.testing.helpers.isValidDataFrame", "common.transform_data.calcTrinaryComparison", "common.transform_data.makeTrinaryData", "common.data_provider.DataProvider", "pdb.set_trace", "common.trinary_data.TrinaryData", "common.transform_dat...
[((3235, 3250), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3248, 3250), False, 'import unittest\n'), ((442, 456), 'common.data_provider.DataProvider', 'DataProvider', ([], {}), '()\n', (454, 456), False, 'from common.data_provider import DataProvider\n'), ((556, 618), 'common.transform_data.makeTrinaryData', ...
from dearpygui.core import * from dearpygui.simple import* import numpy as np from lmfit import Model, Parameters from numpy.lib.function_base import delete class fun_callback(): #方程回调类 def __init__(self, po, abb, num, name): self.si = get_data('stored_i') self.panel_name = 'Left_Panel' + self....
[ "numpy.size", "numpy.log", "numpy.savetxt", "numpy.column_stack", "lmfit.Parameters" ]
[((11307, 11319), 'lmfit.Parameters', 'Parameters', ([], {}), '()\n', (11317, 11319), False, 'from lmfit import Model, Parameters\n'), ((16180, 16222), 'numpy.savetxt', 'np.savetxt', (['f"""data\\\\plot{pi}"""', 'fitted_data'], {}), "(f'data\\\\plot{pi}', fitted_data)\n", (16190, 16222), True, 'import numpy as np\n'), ...
import torch from torch import nn, optim import torch.nn.functional as F from make_env import make_env import numpy as np import random import argparse import os import math from model import * SCENAION_NAME = 'simple_tag' # choose scenario for training parser = argparse.ArgumentParser(description='Base init and se...
[ "numpy.random.uniform", "make_env.make_env", "os.makedirs", "argparse.ArgumentParser", "random.randint", "random.sample", "math.ceil", "os.path.exists", "random.random", "torch.cuda.is_available", "random.gauss" ]
[((267, 354), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Base init and setup for training or display"""'}), "(description=\n 'Base init and setup for training or display')\n", (290, 354), False, 'import argparse\n'), ((7600, 7618), 'make_env.make_env', 'make_env', (['env_name'], {...
###################################################### # # PyRAI2MD 2 module for creating trajectory objects # # Author <NAME> # Sep 6 2021 # ###################################################### import numpy as np from PyRAI2MD.Molecule.molecule import Molecule class Trajectory(Molecule): """ Trajectory propert...
[ "numpy.sum", "numpy.copy", "numpy.zeros", "numpy.array", "numpy.real" ]
[((9279, 9290), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (9287, 9290), True, 'import numpy as np\n'), ((9318, 9329), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (9326, 9329), True, 'import numpy as np\n'), ((9357, 9368), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (9365, 9368), True, 'import num...
# input_pipeline_individual_pedestrians_mix_all_data.py import os import torch import torch.utils.data import pickle import numpy as np import random from tqdm import tqdm class CustomDataPreprocessorForCNN(): def __init__(self, input_seq_length=5, pred_seq_length=5, datasets=[i for i in range(37)], dev_ratio=0.1,...
[ "numpy.radians", "tqdm.tqdm", "pickle.dump", "numpy.zeros_like", "random.shuffle", "os.path.exists", "numpy.zeros", "pickle.load", "random.seed", "numpy.array", "numpy.cos", "numpy.sin", "numpy.dot", "os.path.join", "torch.from_numpy" ]
[((3675, 3733), 'os.path.join', 'os.path.join', (['self.data_dir', '"""trajectories_cnn_train.cpkl"""'], {}), "(self.data_dir, 'trajectories_cnn_train.cpkl')\n", (3687, 3733), False, 'import os\n'), ((3773, 3829), 'os.path.join', 'os.path.join', (['self.data_dir', '"""trajectories_cnn_dev.cpkl"""'], {}), "(self.data_di...
# Copyright 2017 Battelle Energy Alliance, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
[ "numpy.sum", "utils.utils.find_crow", "utils.randomUtils.randomIntegers", "utils.randomUtils.randomSeed", "sys.path.append", "os.path.abspath", "utils.randomUtils.random", "warnings.simplefilter", "utils.randomUtils.randPointsInHypersphere", "numpy.std", "utils.randomUtils.randPointsOnHyperspher...
[((799, 851), 'warnings.simplefilter', 'warnings.simplefilter', (['"""default"""', 'DeprecationWarning'], {}), "('default', DeprecationWarning)\n", (820, 851), False, 'import warnings\n'), ((1030, 1059), 'sys.path.append', 'sys.path.append', (['frameworkDir'], {}), '(frameworkDir)\n', (1045, 1059), False, 'import os, s...
import os import glob import h5py import scipy.misc import scipy.ndimage import numpy as np import imageio from absl import app, flags, logging import matplotlib.pyplot as plt from PIL import Image # from absl.flags import FLAGS import tensorflow as tf def read_data(path): """ Read h5 form...
[ "h5py.File", "os.path.join", "os.getcwd", "numpy.asarray", "imageio.imread", "numpy.zeros", "numpy.mod", "glob.glob", "imageio.imsave", "os.listdir" ]
[((6256, 6286), 'numpy.asarray', 'np.asarray', (['sub_input_sequence'], {}), '(sub_input_sequence)\n', (6266, 6286), True, 'import numpy as np\n'), ((6321, 6351), 'numpy.asarray', 'np.asarray', (['sub_label_sequence'], {}), '(sub_label_sequence)\n', (6331, 6351), True, 'import numpy as np\n'), ((6506, 6533), 'imageio.i...
import os import sys import numpy as np sys.path.append(os.path.join(os.path.dirname(__file__), "../")) from jetbull.api import API # noqa from jetbull.threshold_estimator import ThresholdEstimator # noqa api = API(ThresholdEstimator, [np.arange(0.3, 0.9, 0.1)])
[ "os.path.dirname", "numpy.arange" ]
[((69, 94), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (84, 94), False, 'import os\n'), ((240, 264), 'numpy.arange', 'np.arange', (['(0.3)', '(0.9)', '(0.1)'], {}), '(0.3, 0.9, 0.1)\n', (249, 264), True, 'import numpy as np\n')]
from typing import Dict, List, Any, Optional, Callable, Tuple import numpy as np from tvm import relay, transform, ir from . import util from .work import Workload def fold(wl: Workload) -> Workload: """ Pre-compute graph nodes whose operands are already available in parameter set. The folding is perfor...
[ "numpy.pad", "tvm.relay.transform.function_pass", "numpy.diag_indices_from", "numpy.transpose", "numpy.expand_dims", "tvm.relay.analysis.free_vars", "numpy.concatenate" ]
[((1033, 1075), 'tvm.relay.transform.function_pass', 'relay.transform.function_pass', ([], {'opt_level': '(0)'}), '(opt_level=0)\n', (1062, 1075), False, 'from tvm import relay, transform, ir\n'), ((4706, 4741), 'numpy.pad', 'np.pad', (['args[0]', "attrs['pad_width']"], {}), "(args[0], attrs['pad_width'])\n", (4712, 47...
#!/usr/bin/env python """ xml2mask.py Generate masks from xml files, which are from LabelMe http://labelme.csail.mit.edu/ <NAME>, Nov 2018 <NAME> Copyright (c) 2018 Distributed Robotic Exploration and Mapping Systems Laboratory, ASU """ import os from lxml import etree import numpy as np from PIL import Image, Image...
[ "PIL.Image.new", "numpy.array", "numpy.swapaxes", "lxml.etree.parse", "PIL.ImageDraw.Draw", "os.listdir" ]
[((3018, 3052), 'PIL.Image.new', 'Image.new', (['"""L"""', '(width, height)', '(0)'], {}), "('L', (width, height), 0)\n", (3027, 3052), False, 'from PIL import Image, ImageDraw\n'), ((814, 835), 'os.listdir', 'os.listdir', (['self.path'], {}), '(self.path)\n', (824, 835), False, 'import os\n'), ((987, 1001), 'lxml.etre...
import torch.optim as optim import time import torch from model import TextRNN from cnews_loader import textData from torch import nn from torch.utils.data import DataLoader from sklearn import metrics import numpy as np import torch.nn.functional as F def evaluate(model, data_loader, test=False): model.eval() ...
[ "torch.utils.data.DataLoader", "cnews_loader.textData", "torch.argmax", "sklearn.metrics.accuracy_score", "torch.nn.CrossEntropyLoss", "torch.nn.functional.cross_entropy", "time.time", "numpy.append", "numpy.array", "model.TextRNN", "torch.cuda.is_available", "torch.max", "sklearn.metrics.co...
[((1392, 1412), 'cnews_loader.textData', 'textData', ([], {'train': '(True)'}), '(train=True)\n', (1400, 1412), False, 'from cnews_loader import textData\n'), ((1424, 1442), 'cnews_loader.textData', 'textData', ([], {'val': '(True)'}), '(val=True)\n', (1432, 1442), False, 'from cnews_loader import textData\n'), ((1455,...
import numpy as np import matplotlib.pyplot as plt from pymoo.operators.sampling.real_random_sampling import RealRandomSampling from pymoo.rand import random from pymop.griewank import Griewank from pymop.problem import Problem from pysamoo.ego.basis import calc_distance_matrix from pysamoo.ego.distance import eucl_d...
[ "numpy.sum", "pymop.problem.Problem.__init__", "numpy.ones", "matplotlib.pyplot.figure", "numpy.sin", "numpy.full", "pymoo.operators.sampling.real_random_sampling.RealRandomSampling", "pysamoo.ego.basis.calc_distance_matrix", "numpy.copy", "matplotlib.pyplot.close", "numpy.power", "numpy.resha...
[((705, 732), 'numpy.ones', 'np.ones', (['self.X.shape[0]', '(1)'], {}), '(self.X.shape[0], 1)\n', (712, 732), True, 'import numpy as np\n'), ((761, 788), 'numpy.ones', 'np.ones', (['self.X.shape[1]', '(1)'], {}), '(self.X.shape[1], 1)\n', (768, 788), True, 'import numpy as np\n'), ((842, 938), 'pysamoo.ego.basis.calc_...
# Layer implementing a Gaussian mixture model. # Implementation largely follows https://github.com/fchollet/keras/issues/1061. # In contrast to the original code, the loss was divided by sqrt(2 pi) to use the same Gaussian as in numpy.random.norm from keras.layers import Layer # TODO: This is only implemented for the...
[ "theano.tensor.exp", "theano.tensor.shape", "theano.scan", "theano.tensor.nnet.softmax", "theano.tensor.sqr", "theano.tensor.arange", "numpy.sqrt" ]
[((2272, 2283), 'theano.tensor.arange', 'T.arange', (['M'], {}), '(M)\n', (2280, 2283), True, 'import theano.tensor as T\n'), ((2300, 2396), 'theano.scan', 'theano.scan', ([], {'fn': 'loss', 'outputs_info': 'None', 'sequences': 'seq', 'non_sequences': '[M, D, y_true, y_pred]'}), '(fn=loss, outputs_info=None, sequences=...
# pylint: disable=unused-argument #pylint: disable=invalid-name from typing import Final, List, Tuple import numpy as np import tensorflow as tf def function_r( xs: tf.Tensor, fs: tf.Tensor, dfs: tf.Tensor, d2fs: tf.Tensor, ) -> List[tf.Tensor]: return [ 2*fs[:, 1]*d2fs[:, 1, 0, 1]*d2fs[:...
[ "tensorflow.ones", "tensorflow.reduce_sum", "tensorflow.convert_to_tensor", "numpy.array", "tensorflow.square", "tensorflow.GradientTape" ]
[((1482, 1512), 'numpy.array', 'np.array', (['[[-1, -2], [-2, -3]]'], {}), '([[-1, -2], [-2, -3]])\n', (1490, 1512), True, 'import numpy as np\n'), ((1562, 1623), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['EVALUATION_RANGE_NUMPY'], {'dtype': '"""float64"""'}), "(EVALUATION_RANGE_NUMPY, dtype='float64')\...
import os import pandas as pd from skimage import io import numpy as np class CellDensity: def __init__(self, input_dir, output_dir, cell_names, tissue_seg_dir): self.input_dir = input_dir self.output_dir = output_dir self.cell_names = cell_names self.tissue_seg_dir = tissue_seg_dir os.makedirs(self.outp...
[ "pandas.DataFrame", "numpy.sum", "os.makedirs", "os.path.basename", "os.path.join", "os.listdir" ]
[((299, 342), 'os.makedirs', 'os.makedirs', (['self.output_dir'], {'exist_ok': '(True)'}), '(self.output_dir, exist_ok=True)\n', (310, 342), False, 'import os\n'), ((675, 707), 'os.path.basename', 'os.path.basename', (['self.input_dir'], {}), '(self.input_dir)\n', (691, 707), False, 'import os\n'), ((846, 872), 'os.lis...
# __author__ = "<NAME>" # __email__= "<EMAIL>" # __date__= "02-05-19" import numpy as np from scipy.stats import gamma from scipy.stats import lognorm from scipy.stats import norm ## inverse CDF function ## def Finv_Normal(r, m, s): return norm.ppf(r, m, s) def Finv_Lognormal(r, m, s): sln, mln = p_Logno...
[ "scipy.stats.norm.ppf", "numpy.log", "numpy.savetxt", "scipy.stats.gamma.ppf", "numpy.exp", "numpy.linspace", "numpy.random.rand" ]
[((249, 266), 'scipy.stats.norm.ppf', 'norm.ppf', (['r', 'm', 's'], {}), '(r, m, s)\n', (257, 266), False, 'from scipy.stats import norm\n'), ((2287, 2313), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'samples'], {}), '(0, 1, samples)\n', (2298, 2313), True, 'import numpy as np\n'), ((2357, 2380), 'numpy.random.ra...
from __init__ import * import sys import os import ctypes import numpy as np import time from verify import verify_norm def calc_norm(V_, app_data): N = V_.shape[0] # lib function name norm2u3 = app_data['pipeline_norm'] rnm2 = np.zeros((1), np.float64) rnmu = np.zeros((1), np.float64) # l...
[ "time.time", "numpy.zeros", "ctypes.c_int", "ctypes.c_void_p" ]
[((249, 272), 'numpy.zeros', 'np.zeros', (['(1)', 'np.float64'], {}), '(1, np.float64)\n', (257, 272), True, 'import numpy as np\n'), ((286, 309), 'numpy.zeros', 'np.zeros', (['(1)', 'np.float64'], {}), '(1, np.float64)\n', (294, 309), True, 'import numpy as np\n'), ((374, 389), 'ctypes.c_int', 'ctypes.c_int', (['N'], ...
import nltk import numpy as np import os.path as op import json import h5py from tqdm import tqdm import argparse import torch import s3prl.hub as hub from utils import hubert_feature_extraction, setup_vg_hubert, vghubert_feature_extraction class SummaryJsonReader(object): def __init__(self, data_summary_json, ...
[ "utils.setup_vg_hubert", "tqdm.tqdm", "numpy.save", "json.load", "argparse.ArgumentParser", "numpy.load", "utils.hubert_feature_extraction", "numpy.concatenate", "h5py.File", "os.path.exists", "torch.cuda.is_available", "os.path.join", "utils.vghubert_feature_extraction" ]
[((8800, 8825), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (8823, 8825), False, 'import argparse\n'), ((673, 698), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (696, 698), False, 'import torch\n'), ((2687, 2716), 'tqdm.tqdm', 'tqdm', (['self.utt_image_key_list'], ...
""" This module provides several functions for calculating likelihood values. A 'likelihood' is an un-normalized probability, calculated from the pdf of a distribution. In this module, the pdf that is used is the Gaussian pdf. The main function is cum_corr_loglikelihood() in that it can stand in for any ...
[ "math.exp", "numpy.sum", "numpy.log", "math.sqrt", "numba.njit", "numpy.mean", "math.log", "numpy.ndarray", "numpy.sqrt" ]
[((713, 729), 'numba.njit', 'njit', ([], {'cache': '(True)'}), '(cache=True)\n', (717, 729), False, 'from numba import njit\n'), ((1991, 2007), 'numba.njit', 'njit', ([], {'cache': '(True)'}), '(cache=True)\n', (1995, 2007), False, 'from numba import njit\n'), ((2361, 2377), 'numba.njit', 'njit', ([], {'cache': '(True)...
import numpy as np import sys import csv # decodes the predictions during testing # loading data wt_array = np.load("../data/input/testing_2/centers_test.npy", allow_pickle = True) pred_array = np.load("../data/output/training_results/26.npy", allow_pickle = True) # dictionary that decodes the 20 amino acids aa_dict...
[ "numpy.load", "csv.writer" ]
[((110, 180), 'numpy.load', 'np.load', (['"""../data/input/testing_2/centers_test.npy"""'], {'allow_pickle': '(True)'}), "('../data/input/testing_2/centers_test.npy', allow_pickle=True)\n", (117, 180), True, 'import numpy as np\n'), ((196, 264), 'numpy.load', 'np.load', (['"""../data/output/training_results/26.npy"""']...
import cPickle import numpy as np import matplotlib.pyplot as plt root = '/data/adascale_output/rfcn/imagenet_vid/rfcn_testloss/' t_root = '/data/adascale_output/rfcn/imagenet_vid/resnet_v1_101_scalereg_1x1/' # t_root = '/data/adascale_output/rfcn/imagenet_vid/rfcn_vid_demo/' # datasets = ['DET_train_30classes', 'VID...
[ "numpy.sum", "numpy.abs", "numpy.zeros", "cPickle.load", "numpy.argmin", "numpy.argsort", "cPickle.dump", "numpy.min", "numpy.mean", "numpy.arange", "numpy.matmul" ]
[((1408, 1419), 'numpy.zeros', 'np.zeros', (['m'], {}), '(m)\n', (1416, 1419), True, 'import numpy as np\n'), ((1476, 1492), 'numpy.zeros', 'np.zeros', (['(N, m)'], {}), '((N, m))\n', (1484, 1492), True, 'import numpy as np\n'), ((1578, 1594), 'numpy.zeros', 'np.zeros', (['(N, m)'], {}), '((N, m))\n', (1586, 1594), Tru...
import numpy as np from collections import OrderedDict from GenPlayground import GenPlayground def init_cycle(cycle, IP_cycle, ind_src, ind_sel): assert len(ind_src) == len(ind_sel) Arr = (IP_cycle == cycle) Dict = OrderedDict() src = ['o_tsrc', 'o_rsrc'] sel = ['o_sel0', 'o_sel1', 'o_sel2'] ...
[ "collections.OrderedDict", "numpy.max", "numpy.set_printoptions", "GenPlayground.GenPlayground" ]
[((231, 244), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (242, 244), False, 'from collections import OrderedDict\n'), ((4041, 4075), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(200)'}), '(linewidth=200)\n', (4060, 4075), True, 'import numpy as np\n'), ((4103, 4118), 'GenPlaygr...
# @Time : 2020/3/26 23:32 # @Author : <NAME> # @File : show.py # @Software: PyCharm ''' .::::. .::::::::. ::::::::::: I && YOU ..:::::::::::' '::::::::::::' .:::::::::: '::::::::::::::.. ..::::::::::::. ...
[ "cv2.waitKey", "cv2.imshow", "numpy.zeros" ]
[((866, 889), 'numpy.zeros', 'np.zeros', (['[200, 200, 3]'], {}), '([200, 200, 3])\n', (874, 889), True, 'import numpy as np\n'), ((1105, 1127), 'cv2.imshow', 'cv2.imshow', (['"""te0"""', 'img'], {}), "('te0', img)\n", (1115, 1127), False, 'import cv2\n'), ((1128, 1142), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0...
__author__ = "<NAME>" __doc__ = """Utility functions to help with data logistics.""" import numpy as np import h5py as h5 import itertools as it import random import pykit as pyk # Function to load in a dataset from a h5file def fromh5(path, datapath=None, dataslice=None, asnumpy=True, preptrain=None): """ ...
[ "h5py.File", "pykit.obj2list", "random.shuffle", "numpy.asarray", "random.seed", "itertools.product" ]
[((892, 905), 'h5py.File', 'h5.File', (['path'], {}), '(path)\n', (899, 905), True, 'import h5py as h5\n'), ((4733, 4753), 'itertools.product', 'it.product', (['*nslices'], {}), '(*nslices)\n', (4743, 4753), True, 'import itertools as it\n'), ((1154, 1175), 'numpy.asarray', 'np.asarray', (['h5dataset'], {}), '(h5datase...
import numpy as np class LogisticRegression: def __init__(self, lr=0.1, n_iters=1000): self.lr = lr self.n_iters = n_iters self.weights = None self.bias = None def fit(self, X, y): n_samples, n_features = X.shape self.weights = np.zeros(n_features) sel...
[ "numpy.zeros", "numpy.exp" ]
[((288, 308), 'numpy.zeros', 'np.zeros', (['n_features'], {}), '(n_features)\n', (296, 308), True, 'import numpy as np\n'), ((934, 944), 'numpy.exp', 'np.exp', (['(-x)'], {}), '(-x)\n', (940, 944), True, 'import numpy as np\n')]
# tests.test_style.test_palettes # Tests the palettes module of the yellowbrick library. # # Author: <NAME> <<EMAIL>> # Created: Tue Oct 04 16:21:58 2016 -0400 # # Copyright (C) 2016 The scikit-yb developers # For license information, see LICENSE.txt # # ID: test_palettes.py [c6aff34] <EMAIL> $ """ Tests the palett...
[ "yellowbrick.style.palettes.PALETTES.items", "yellowbrick.style.palettes.color_palette", "yellowbrick.style.palettes.color_sequence", "matplotlib.colors.colorConverter.to_rgb", "yellowbrick.style.rcmod.set_aesthetic", "yellowbrick.style.rcmod.set_palette", "yellowbrick.style.palettes.PALETTES.values", ...
[((3375, 3421), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""not implemented yet"""'}), "(reason='not implemented yet')\n", (3391, 3421), False, 'import pytest\n'), ((7194, 7266), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""discovered this commented out, don\'t know why"""'}), '(reason="d...
# -*- coding: utf-8 -*- """ @author: "<NAME>" @credits: "<NAME> and <NAME>" @version: "4.8" @email: "<EMAIL>" @created: "20 May 2020" @modified: "10 Mar 2021" GI: Gradual Item (0, +) GP: Gradual Pattern {(0, +), (1, -), (3, +)} TGP: Temporal Gradual Pattern """ import numpy as np class GI: def __init__(self, a...
[ "numpy.array" ]
[((433, 476), 'numpy.array', 'np.array', (['(attr_col, symbol)'], {'dtype': '"""i, S1"""'}), "((attr_col, symbol), dtype='i, S1')\n", (441, 476), True, 'import numpy as np\n'), ((2626, 2643), 'numpy.array', 'np.array', (['pattern'], {}), '(pattern)\n', (2634, 2643), True, 'import numpy as np\n'), ((674, 724), 'numpy.ar...
#!/usr/bin/env python import base64 import pickle import sys import uuid import io import numpy as np import rospy from scipy.io.wavfile import read as wav_read from scipy.io.wavfile import write as wav_write import torch from babyrobot.emorec_pytorch import config as emorec_pytorch_config from babyrobot.speech_featu...
[ "sys.path.append", "babyrobot.speech_features.client.extract_speech_features", "io.BytesIO", "babyrobot_msgs.srv.SpeechEmotionRecognitionResponse", "rospy.Time.now", "numpy.argmax", "torch.autograd.Variable", "speech_features.frame_breaker.get_frames", "torch.load", "rospy.spin", "scipy.io.wavfi...
[((615, 663), 'sys.path.append', 'sys.path.append', (['emorec_pytorch_config.Paths.src'], {}), '(emorec_pytorch_config.Paths.src)\n', (630, 663), False, 'import sys\n'), ((1180, 1330), 'babyrobot.speech_features.client.extract_speech_features', 'speech_feat_client.extract_speech_features', (['s'], {'opensmile_config': ...
#!/usr/bin/env python import numpy as np import sklearn.datasets as datasets import sklearn.cross_validation as cv import pandas_ml as pdml import pandas_ml.util.testing as tm class TestCrossValidation(tm.TestCase): def test_objectmapper(self): df = pdml.ModelFrame([]) self.assert...
[ "sklearn.cross_validation.permutation_test_score", "sklearn.datasets.load_digits", "sklearn.datasets.load_iris", "sklearn.cross_validation.cross_val_score", "nose.runmodule", "pandas_ml.ModelFrame", "sklearn.cross_validation.StratifiedShuffleSplit", "numpy.array" ]
[((9697, 9784), 'nose.runmodule', 'nose.runmodule', ([], {'argv': "[__file__, '-vvs', '-x', '--pdb', '--pdb-failure']", 'exit': '(False)'}), "(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],\n exit=False)\n", (9711, 9784), False, 'import nose\n'), ((280, 299), 'pandas_ml.ModelFrame', 'pdml.ModelFrame', (['[...
import numpy as np import pyautogui import imutils import cv2 import pytesseract from pynput import mouse import time import easyocr import torch #from PIL import ImageGrab import pyscreenshot import pyscreenshot as ImageGrab #pytesseract.pytesseract.tesseract_cmd = r'C:\Users\adaptation\anaconda3\envs\Shaman-AI\Librar...
[ "cv2.GaussianBlur", "pynput.mouse.Listener", "cv2.imshow", "cv2.subtract", "cv2.cvtColor", "pyscreenshot.grab", "cv2.destroyAllWindows", "cv2.resize", "numpy.stack", "pyautogui.position", "numpy.save", "cv2.waitKey", "time.sleep", "easyocr.Reader", "numpy.concatenate", "cv2.threshold",...
[((851, 873), 'easyocr.Reader', 'easyocr.Reader', (["['en']"], {}), "(['en'])\n", (865, 873), False, 'import easyocr\n'), ((1552, 1590), 'pynput.mouse.Listener', 'mouse.Listener', ([], {'on_click': 'self.on_click'}), '(on_click=self.on_click)\n', (1566, 1590), False, 'from pynput import mouse\n'), ((1650, 1670), 'pyaut...
"""Class representing a model of and isotherm.""" import typing as t import numpy import pandas from pygaps import logger from pygaps.core.baseisotherm import BaseIsotherm from pygaps.modelling import _GUESS_MODELS from pygaps.modelling import get_isotherm_model from pygaps.modelling import is_model from pygaps.mode...
[ "pygaps.graphing.isotherm_graphs.plot_iso", "pygaps.units.converter_mode.c_loading", "pygaps.units.converter_mode.c_pressure", "pygaps.modelling.is_model", "numpy.asarray", "pygaps.units.converter_mode.c_material", "pygaps.utilities.exceptions.ParameterError", "pygaps.graphing.model_graphs.plot_model_...
[((19803, 19830), 'pygaps.graphing.isotherm_graphs.plot_iso', 'plot_iso', (['self'], {}), '(self, **plot_dict)\n', (19811, 19830), False, 'from pygaps.graphing.isotherm_graphs import plot_iso\n'), ((30279, 30301), 'numpy.asarray', 'numpy.asarray', (['loading'], {}), '(loading)\n', (30292, 30301), False, 'import numpy\n...
import ast import glob import inspect import os from collections import OrderedDict from datetime import datetime, timedelta import numpy as np from skopt import Optimizer from skopt import load, dump from skopt.space import check_dimension from skopt.utils import cook_estimator, normalize_dimensions from csrank.util...
[ "skopt.load", "skopt.space.check_dimension", "skopt.utils.normalize_dimensions", "csrank.util.print_dictionary", "numpy.argmin", "numpy.array", "datetime.timedelta", "skopt.utils.cook_estimator", "inspect.currentframe", "ast.literal_eval", "os.path.split", "os.path.join", "skopt.Optimizer", ...
[((1166, 1199), 'skopt.utils.normalize_dimensions', 'normalize_dimensions', (['transformed'], {}), '(transformed)\n', (1186, 1199), False, 'from skopt.utils import cook_estimator, normalize_dimensions\n'), ((1221, 1294), 'skopt.utils.cook_estimator', 'cook_estimator', (['"""GP"""'], {'space': 'space', 'random_state': '...
############################################################################### # Copyright (c) 2007-2018, National Research Foundation (Square Kilometre Array) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy # of the ...
[ "numpy.abs", "numpy.polyfit", "numpy.ones", "scikits.fitting.poly._stepwise_interp", "numpy.arange", "numpy.tile", "scikits.fitting.Polynomial1DFit", "numpy.diag", "builtins.range", "numpy.meshgrid", "numpy.random.randn", "numpy.polyval", "numpy.testing.run_module_suite", "numpy.testing.as...
[((9349, 9367), 'numpy.testing.run_module_suite', 'run_module_suite', ([], {}), '()\n', (9365, 9367), False, 'from numpy.testing import TestCase, assert_equal, assert_almost_equal, run_module_suite\n'), ((1414, 1440), 'numpy.array', 'np.array', (['[1.0, -2.0, 1.0]'], {}), '([1.0, -2.0, 1.0])\n', (1422, 1440), True, 'im...
################################################################################## ################################################################################## # Country Simulation (Python 3.7) ################################################################################## #####################################...
[ "timeit.default_timer", "numpy.array", "scipy.integrate.odeint" ]
[((1005, 1012), 'timeit.default_timer', 'timer', ([], {}), '()\n', (1010, 1012), True, 'from timeit import default_timer as timer\n'), ((1021, 1048), 'scipy.integrate.odeint', 'odeint', (['model', 'y0', 't', 'parms'], {}), '(model, y0, t, parms)\n', (1027, 1048), False, 'from scipy.integrate import odeint\n'), ((1060, ...
# convert images and labels to csv format import numpy as np import os import csv import cv2 import matplotlib.pyplot as plt class CreateDataset(object): """Converts images into csv format""" def __init__(self, path, color_channels, img_dim): """ """ self.path = path s...
[ "matplotlib.pyplot.show", "os.path.join", "cv2.cvtColor", "matplotlib.pyplot.close", "numpy.asarray", "numpy.savetxt", "os.walk", "matplotlib.pyplot.yticks", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplots", "cv2.resize" ]
[((582, 600), 'os.walk', 'os.walk', (['self.path'], {}), '(self.path)\n', (589, 600), False, 'import os\n'), ((3494, 3558), 'numpy.savetxt', 'np.savetxt', (['"""images.csv"""', 'loaded_images'], {'delimiter': '""","""', 'fmt': '"""%i"""'}), "('images.csv', loaded_images, delimiter=',', fmt='%i')\n", (3504, 3558), True,...
from collections import deque import numpy as np import torch import torch.nn.functional as F from collections import defaultdict from tracker import matching from tracking_utils.kalman_filter import KalmanFilter from tracking_utils.utils import * from tracking_utils.log import logger from utils.utils import map_to_...
[ "tracker.matching.iou_distance", "models.model.create_model", "tracker.matching.embedding_distance", "torch.where", "tracking_utils.kalman_filter.KalmanFilter", "numpy.asarray", "tracker.matching.linear_assignment", "models.model.load_model", "collections.defaultdict", "numpy.where", "numpy.lina...
[((556, 570), 'tracking_utils.kalman_filter.KalmanFilter', 'KalmanFilter', ([], {}), '()\n', (568, 570), False, 'from tracking_utils.kalman_filter import KalmanFilter\n'), ((6327, 6341), 'tracking_utils.kalman_filter.KalmanFilter', 'KalmanFilter', ([], {}), '()\n', (6339, 6341), False, 'from tracking_utils.kalman_filte...
# -*- coding: UTF-8 -*- import os import collections import random import numpy as np import six import pickle import multiprocessing import time import argparse from collections import Counter, defaultdict def data_partition(fname): usernum = 0 itemnum = 0 User = defaultdict(list) user_train = {} ...
[ "os.mkdir", "pickle.dump", "numpy.random.choice", "numpy.sum", "argparse.ArgumentParser", "multiprocessing.current_process", "random.randint", "os.path.isdir", "random.Random", "os.getcwd", "time.clock", "collections.defaultdict", "pickle.load", "numpy.array", "collections.namedtuple", ...
[((11934, 11996), 'collections.namedtuple', 'collections.namedtuple', (['"""MaskedLmInstance"""', "['index', 'label']"], {}), "('MaskedLmInstance', ['index', 'label'])\n", (11956, 11996), False, 'import collections\n'), ((279, 296), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (290, 296), False...
# !/usr/bin/env python # -*- coding: utf-8 -*- # File: Training script import os import math import argparse import torch import utils import net import numpy as np if __name__ == "__main__": parser = argparse.ArgumentParser(description="Training CVAE source model") parser.add_argument('--gpu', '-g', type=...
[ "numpy.load", "argparse.ArgumentParser", "torch.load", "numpy.asarray", "math.floor", "utils.prenorm", "net.CVAE", "numpy.linalg.norm", "net.Decoder", "utils.set_log", "torch.device", "numpy.random.permutation", "utils.dat_load_trunc", "net.Encoder", "os.path.join", "os.listdir" ]
[((209, 274), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Training CVAE source model"""'}), "(description='Training CVAE source model')\n", (232, 274), False, 'import argparse\n'), ((1327, 1364), 'os.path.join', 'os.path.join', (['config.save_root', '"""vcc"""'], {}), "(config.save_ro...
#!/usr/bin/env python3 import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import numpy as np import cv2 import tensorflow as tf from tensorflow.python.framework import meta_graph import picpac from gallery import Gallery class Model: def __init__ (self, X, path, name): mg = meta_graph.read_meta_graph_file(...
[ "gallery.Gallery", "tensorflow.python.framework.meta_graph.read_meta_graph_file", "tensorflow.train.Saver", "numpy.copy", "tensorflow.global_variables_initializer", "cv2.cvtColor", "tensorflow.Session", "numpy.expand_dims", "tensorflow.constant", "numpy.clip", "tensorflow.local_variables_initial...
[((1378, 1466), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, None, None, FLAGS.channels)', 'name': '"""images"""'}), "(tf.float32, shape=(None, None, None, FLAGS.channels), name=\n 'images')\n", (1392, 1466), True, 'import tensorflow as tf\n'), ((1516, 1532), 'tensorflow.ConfigProto...
import os import shutil from pathlib import Path from tqdm import tqdm from PIL import Image import numpy as np import torch import torchvision.transforms as T from torch.utils.data import Dataset, DataLoader from torch.utils.data.dataset import random_split import random from .base import check_image_folder_consist...
[ "numpy.random.seed", "pathlib.Path", "shutil.rmtree", "torchvision.transforms.Normalize", "os.path.join", "torch.utils.data.dataset.random_split", "torch.utils.data.DataLoader", "os.path.exists", "torchvision.transforms.Lambda", "torch.Tensor", "random.seed", "torch.zeros", "torch.random.man...
[((9761, 9791), 'torch.random.manual_seed', 'torch.random.manual_seed', (['seed'], {}), '(seed)\n', (9785, 9791), False, 'import torch\n'), ((9796, 9832), 'numpy.random.seed', 'np.random.seed', (['(seed % (2 ** 32 - 1))'], {}), '(seed % (2 ** 32 - 1))\n', (9810, 9832), True, 'import numpy as np\n'), ((9835, 9852), 'ran...
import hashlib import heapq import json import math import os import pprint import random import re import sys import traceback from dataclasses import dataclass, field from numbers import Number from typing import Any import matplotlib import matplotlib.lines as mlines import matplotlib as mpl import matplotlib.pyplo...
[ "SecretColors.cmaps.TableauMap", "matplotlib.rc", "numpy.random.seed", "matplotlib.cm.get_cmap", "sklearn.model_selection.train_test_split", "os.execv", "matplotlib.pyplot.figure", "xgboost.XGBRegressor", "pprint.pprint", "matplotlib.patches.Patch", "pandas.set_option", "pandas.DataFrame", "...
[((602, 621), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (616, 621), True, 'import numpy as np\n'), ((626, 642), 'random.seed', 'random.seed', (['(123)'], {}), '(123)\n', (637, 642), False, 'import random\n'), ((658, 685), 'os.getenv', 'os.getenv', (['"""PYTHONHASHSEED"""'], {}), "('PYTHONHASHSE...
# -*- coding: utf-8 -*- import numpy as np from matplotlib import pyplot as plt import seaborn as sns def get_cdf(data, mean = None): if mean == None: mean = np.mean(data) data = abs(data-mean) prob = ECDF(data[:,0]).y cdfx = ECDF(data[:,0]).x cdfy = ECDF(data[:,1])...
[ "seaborn.set", "numpy.mean", "numpy.array", "matplotlib.pyplot.subplots" ]
[((338, 366), 'numpy.array', 'np.array', (['[prob, cdfx, cdfy]'], {}), '([prob, cdfx, cdfy])\n', (346, 366), True, 'import numpy as np\n'), ((177, 190), 'numpy.mean', 'np.mean', (['data'], {}), '(data)\n', (184, 190), True, 'import numpy as np\n'), ((495, 504), 'seaborn.set', 'sns.set', ([], {}), '()\n', (502, 504), Tr...
import numpy as np from matplotlib import pyplot as plt import sys import os def run(seq='00',folder="/media/l/yp2/KITTI/odometry/dataset/poses/"): pose_file=os.path.join(folder,seq+".txt") poses=np.genfromtxt(pose_file) poses=poses[:,[3,11]] inner=2*np.matmul(poses,poses.T) xx=np.sum(poses**2,1,kee...
[ "matplotlib.pyplot.title", "numpy.sum", "matplotlib.pyplot.show", "numpy.abs", "numpy.genfromtxt", "matplotlib.pyplot.axis", "numpy.array", "numpy.matmul", "numpy.argwhere", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "os.path.join" ]
[((162, 196), 'os.path.join', 'os.path.join', (['folder', "(seq + '.txt')"], {}), "(folder, seq + '.txt')\n", (174, 196), False, 'import os\n'), ((204, 228), 'numpy.genfromtxt', 'np.genfromtxt', (['pose_file'], {}), '(pose_file)\n', (217, 228), True, 'import numpy as np\n'), ((299, 335), 'numpy.sum', 'np.sum', (['(pose...
import wx import wx.lib.newevent import numpy as np import logging import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx as NavigationToolbar from matplotlib.figure import Figure logger ...
[ "wx.Panel.__init__", "wx.lib.newevent.NewEvent", "wx.BoxSizer", "numpy.ones", "wx.PostEvent", "matplotlib.figure.Figure", "matplotlib.use", "matplotlib.backends.backend_wxagg.FigureCanvasWxAgg", "matplotlib.backends.backend_wx.NavigationToolbar2Wx", "logging.getLogger" ]
[((85, 108), 'matplotlib.use', 'matplotlib.use', (['"""WXAgg"""'], {}), "('WXAgg')\n", (99, 108), False, 'import matplotlib\n'), ((322, 366), 'logging.getLogger', 'logging.getLogger', (['"""ConeCounter.CanvasPanel"""'], {}), "('ConeCounter.CanvasPanel')\n", (339, 366), False, 'import logging\n'), ((537, 563), 'wx.lib.n...
from .draw import Draw from .rect import Rect from .window import Window from . import colors import time as tm import copy # For the camera only from pygame.locals import * import numpy as np import pygame import cv2 # For the camera only class Camera: """The camera relies on opencv, pygame and numpy.""" ...
[ "copy.deepcopy", "cv2.VideoWriter_fourcc", "cv2.cvtColor", "cv2.transpose", "time.time", "cv2.VideoCapture", "numpy.rot90", "pygame.surfarray.make_surface", "cv2.VideoWriter", "pygame.surfarray.array3d", "cv2.destroyAllWindows" ]
[((1391, 1410), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (1407, 1410), False, 'import cv2\n'), ((1760, 1791), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (['*fourcc'], {}), '(*fourcc)\n', (1782, 1791), False, 'import cv2\n'), ((1875, 1953), 'cv2.VideoWriter', 'cv2.VideoWriter', (['filenam...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import unidecode def preprocessingResidentData(fileName): """ Function for reading and preprocessing the resident numbers per town """ jarasok = pd.read_csv(fileName) # Delete unused columns toDeleteList = [ 'Unn...
[ "pandas.read_csv", "unidecode.unidecode", "numpy.zeros" ]
[((233, 254), 'pandas.read_csv', 'pd.read_csv', (['fileName'], {}), '(fileName)\n', (244, 254), True, 'import pandas as pd\n'), ((1030, 1052), 'numpy.zeros', 'np.zeros', ([], {'shape': '(2, 2)'}), '(shape=(2, 2))\n', (1038, 1052), True, 'import numpy as np\n'), ((3357, 3381), 'unidecode.unidecode', 'unidecode.unidecode...
# -*- coding: utf-8 -*- """ @author: <NAME> Refrence: https://github.com/moonl1ght/MDN/blob/master/MDN.ipynb for the no of parameters - sum(p.numel() for p in model.parameters() if p.requires_grad) """ import torch import numpy as np import torch.nn as nn import torch.nn.functional as F COEFS = 10 IN_DIM = 512 OUT_...
[ "numpy.log", "numpy.finfo", "torch.exp", "torch.clamp", "torch.nn.Linear", "torch.sum", "torch.tensor" ]
[((561, 601), 'torch.nn.Linear', 'nn.Linear', (['layer_size', 'coefs'], {'bias': '(False)'}), '(layer_size, coefs, bias=False)\n', (570, 601), True, 'import torch.nn as nn\n'), ((620, 670), 'torch.nn.Linear', 'nn.Linear', (['layer_size', '(out_dim * coefs)'], {'bias': '(False)'}), '(layer_size, out_dim * coefs, bias=Fa...
import os, sys import argparse import logging import json import random import numpy as np import PySimpleGUI as sg from PIL import Image, ImageColor, ImageTk import io import cv2 import pandas as pd import glob import ffmpeg import ffplayer def get_img_data(img, first=False): if img.shape[0] > 960: ...
[ "argparse.ArgumentParser", "pandas.read_csv", "numpy.histogram", "numpy.tile", "ffplayer.duratioin_format", "os.path.join", "cv2.cvtColor", "numpy.max", "PySimpleGUI.Window", "cv2.resize", "io.BytesIO", "os.path.basename", "PySimpleGUI.Graph", "PySimpleGUI.Column", "cv2.merge", "ffplay...
[((542, 578), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2RGB'], {}), '(img, cv2.COLOR_BGR2RGB)\n', (554, 578), False, 'import cv2\n'), ((589, 609), 'PIL.Image.fromarray', 'Image.fromarray', (['img'], {}), '(img)\n', (604, 609), False, 'from PIL import Image, ImageColor, ImageTk\n'), ((802, 825), 'PIL.Image...
import cv2 import numpy as np import dlib import time def extract_index_nparray(nparray): index = None for num in nparray[0]: index = num break return index img = cv2.imread("modifiche\\bradley_cooper.jpg") img2 = cv2.imread("modifiche\\volto.jpg") face_cascade = cv2.Cascad...
[ "cv2.bitwise_and", "cv2.warpAffine", "cv2.imshow", "dlib.shape_predictor", "numpy.zeros_like", "cv2.cvtColor", "cv2.boundingRect", "cv2.destroyAllWindows", "cv2.Subdiv2D", "cv2.bitwise_not", "cv2.waitKey", "cv2.convexHull", "dlib.get_frontal_face_detector", "cv2.fillConvexPoly", "cv2.add...
[((207, 250), 'cv2.imread', 'cv2.imread', (['"""modifiche\\\\bradley_cooper.jpg"""'], {}), "('modifiche\\\\bradley_cooper.jpg')\n", (217, 250), False, 'import cv2\n'), ((259, 293), 'cv2.imread', 'cv2.imread', (['"""modifiche\\\\volto.jpg"""'], {}), "('modifiche\\\\volto.jpg')\n", (269, 293), False, 'import cv2\n'), ((3...
import numpy as np def get_num_integer_in_layer(i, layer, image): return len(np.where(image[layer, ...] == i)[0]) def part2(shape, data): img_size = np.prod(shape) num_layers = len(data) // img_size # Get data as a contiguous array of ints i_data = np.asarray([int(s) for s in data], dtype=int)...
[ "numpy.ones", "numpy.where", "numpy.reshape", "numpy.printoptions", "numpy.prod" ]
[((162, 176), 'numpy.prod', 'np.prod', (['shape'], {}), '(shape)\n', (169, 176), True, 'import numpy as np\n'), ((393, 443), 'numpy.reshape', 'np.reshape', (['i_data'], {'newshape': '((num_layers,) + shape)'}), '(i_data, newshape=(num_layers,) + shape)\n', (403, 443), True, 'import numpy as np\n'), ((532, 557), 'numpy....
#!/usr/bin/env python3 # coding: utf-8 # ### Import required libraries import numpy as np import matplotlib.pyplot as plt from CartPole import CartPole # from CartPole_GPS import CartPole_GPS from ilqr.dynamics import constrain from copy import deepcopy from EstimateDynamics import local_estimate from GMM impor...
[ "CartPole.CartPole", "GMM.Estimated_Dynamics_Prior", "numpy.array", "numpy.arange", "numpy.eye" ]
[((1171, 1204), 'numpy.array', 'np.array', (['[0.1, 1, 1, 9.80665, 0]'], {}), '([0.1, 1, 1, 9.80665, 0])\n', (1179, 1204), True, 'import numpy as np\n'), ((1242, 1273), 'numpy.array', 'np.array', (['[0.0, 0.0, 3.14, 0.0]'], {}), '([0.0, 0.0, 3.14, 0.0])\n', (1250, 1273), True, 'import numpy as np\n'), ((1300, 1330), 'n...
import numpy as np from .exceptions import * def one_system(molecular_system=None, selection=None, structure_indices=None, form=None, syntaxis='MolSysMT'): from molsysmt.basic import convert, select atom_indices=None if form is not None: tmp_molecular_system=convert(molecular_system, form) e...
[ "numpy.asarray", "molsysmt.basic.convert", "molsysmt.basic.get", "molsysmt.basic.select" ]
[((283, 314), 'molsysmt.basic.convert', 'convert', (['molecular_system', 'form'], {}), '(molecular_system, form)\n', (290, 314), False, 'from molsysmt.basic import convert, select\n'), ((411, 465), 'molsysmt.basic.select', 'select', (['molecular_system', 'selection'], {'syntaxis': 'syntaxis'}), '(molecular_system, sele...
""" Copyright (c) 2022 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
[ "numpy.percentile", "numpy.moveaxis", "numpy.concatenate", "numpy.prod" ]
[((1165, 1204), 'numpy.moveaxis', 'np.moveaxis', (['input_', 'channel_dim_idx', '(0)'], {}), '(input_, channel_dim_idx, 0)\n', (1176, 1204), True, 'import numpy as np\n'), ((2528, 2553), 'numpy.prod', 'np.prod', (['ref_tensor_shape'], {}), '(ref_tensor_shape)\n', (2535, 2553), True, 'import numpy as np\n'), ((2740, 279...
# -*- coding: utf-8 -*- # # Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG), # acting on behalf of its Max Planck Institute for Intelligent Systems and the # Max Planck Institute for Biological Cybernetics. All rights reserved. # # Max-Planck-Gesellschaft zur Förderung der Wissens...
[ "json.dump", "json.load", "homogenus.tools.image_tools.cropout_openpose", "os.makedirs", "os.path.basename", "random.shuffle", "numpy.asarray", "os.path.exists", "PIL.Image.fromarray", "os.path.join" ]
[((3123, 3181), 'os.path.join', 'os.path.join', (['base_dir', 'dataset_name', '"""cropped_body_tight"""'], {}), "(base_dir, dataset_name, 'cropped_body_tight')\n", (3135, 3181), False, 'import os\n'), ((3199, 3245), 'os.path.join', 'os.path.join', (['base_dir', 'dataset_name', '"""images"""'], {}), "(base_dir, dataset_...
import os import shutil from unittest.mock import patch import PIL import numpy as np import torchvision import lightly from lightly.data.dataset import LightlyDataset from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup from lightly.openapi_generated.swagger_client.models.dataset_data ...
[ "lightly.openapi_generated.swagger_client.models.dataset_data.DatasetData", "tests.api_workflow.mocked_api_workflow_client.MockedApiWorkflowSetup.setUp", "numpy.zeros", "shutil.rmtree" ]
[((441, 502), 'tests.api_workflow.mocked_api_workflow_client.MockedApiWorkflowSetup.setUp', 'MockedApiWorkflowSetup.setUp', (['self'], {'dataset_id': '"""dataset_0_id"""'}), "(self, dataset_id='dataset_0_id')\n", (469, 502), False, 'from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup\n'), (...
"""RANSAC bad channel identification.""" import mne import numpy as np from mne.channels.interpolation import _make_interpolation_matrix from mne.utils import ProgressBar, check_random_state, logger from pyprep.utils import ( _correlate_arrays, _get_random_subset, _mat_round, _split_list, _verify_f...
[ "pyprep.utils._split_list", "numpy.floor", "numpy.ones", "numpy.around", "numpy.mean", "numpy.arange", "mne.utils.logger.info", "pyprep.utils._get_random_subset", "numpy.ceil", "pyprep.utils._verify_free_ram", "numpy.median", "numpy.argwhere", "numpy.concatenate", "numpy.zeros", "mne.cha...
[((7074, 7106), 'numpy.arange', 'np.arange', (['chn_pos_good.shape[0]'], {}), '(chn_pos_good.shape[0])\n', (7083, 7106), True, 'import numpy as np\n'), ((7117, 7149), 'mne.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (7135, 7149), False, 'from mne.utils import ProgressBar...
import pickle import numpy as np import torch.nn as nn from vegans.utils.utils import get_input_dim from vegans.utils.layers import LayerReshape, LayerPrintSize, LayerInception, LayerResidualConvBlock def preprocess_mnist(torch_data, normalize=True, pad=None): """Load the mnist data from root. Parameters ...
[ "numpy.pad", "torch.nn.ReLU", "vegans.utils.utils.get_input_dim", "torch.nn.ConvTranspose2d", "torch.nn.Sequential", "torch.nn.Flatten", "torch.nn.Conv2d", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Identity", "vegans.utils.layers.LayerRe...
[((869, 929), 'numpy.pad', 'np.pad', (['X', '[(0, 0), (pad, pad), (pad, pad)]'], {'mode': '"""constant"""'}), "(X, [(0, 0), (pad, pad), (pad, pad)], mode='constant')\n", (875, 929), True, 'import numpy as np\n'), ((3029, 3041), 'torch.nn.Sigmoid', 'nn.Sigmoid', ([], {}), '()\n', (3039, 3041), True, 'import torch.nn as ...
import numpy as np import scipy.linalg as la import networkx as nx import matplotlib.pyplot as plt import mdp.lmdps as lmdps import mdp.utils as utils import mdp.search_spaces as search_spaces def onehot(x, n): return np.eye(n)[x] def compare_mdp_lmdp(): n_states, n_actions = 2, 2 mdp = utils.build_rand...
[ "matplotlib.pyplot.title", "numpy.random.seed", "numpy.triu", "numpy.sum", "numpy.einsum", "numpy.ones", "mdp.search_spaces.policy_iteration", "mdp.lmdps.lmdp_decoder", "matplotlib.pyplot.figure", "numpy.random.randint", "numpy.linalg.norm", "numpy.exp", "numpy.isclose", "mdp.utils.polytop...
[((304, 352), 'mdp.utils.build_random_mdp', 'utils.build_random_mdp', (['n_states', 'n_actions', '(0.9)'], {}), '(n_states, n_actions, 0.9)\n', (326, 352), True, 'import mdp.utils as utils\n'), ((363, 389), 'mdp.utils.gen_grid_policies', 'utils.gen_grid_policies', (['(7)'], {}), '(7)\n', (386, 389), True, 'import mdp.u...
""" Demand Generator """ # ============================================================================== # Imports # ============================================================================== import collections.abc import numpy as np from .plottools import plot_histogram, plot_stairs from bokeh.plotting ...
[ "numpy.random.seed", "numpy.random.exponential", "numpy.clip", "numpy.cumsum", "numpy.array", "numpy.concatenate", "bokeh.layouts.row" ]
[((636, 654), 'numpy.random.seed', 'np.random.seed', (['(35)'], {}), '(35)\n', (650, 654), True, 'import numpy as np\n'), ((1310, 1342), 'numpy.clip', 'np.clip', (['(flow_vh / 60)', '(1)', '(C / 60)'], {}), '(flow_vh / 60, 1, C / 60)\n', (1317, 1342), True, 'import numpy as np\n'), ((1512, 1559), 'numpy.random.exponent...
# -*-coding:utf-8-*- """ Ce module sert d'exemple pour la récupération du corpus de Swadesh """ import re import numpy as np from nltk.corpus import swadesh __author__ = "besnier" langues_germaniques = ["en", "de", "nl"] langues_romanes = ["fr", "es", "it"] alphabet = list('azertyuiopqsdfghjklmwxcvbn') a_aligner_...
[ "nltk.corpus.swadesh.entries", "numpy.array" ]
[((326, 362), 'nltk.corpus.swadesh.entries', 'swadesh.entries', (['langues_germaniques'], {}), '(langues_germaniques)\n', (341, 362), False, 'from nltk.corpus import swadesh\n'), ((379, 411), 'nltk.corpus.swadesh.entries', 'swadesh.entries', (['langues_romanes'], {}), '(langues_romanes)\n', (394, 411), False, 'from nlt...
import numpy as np import pandas as pd from scipy import constants as const from models import util import sys # retorna parâmetros tabelados referenciados as coordenadas da estação terrena # lat/long em formato de graus class GroundStation: def __init__(self, site_lat, site_long): self.sit...
[ "numpy.abs", "pandas.read_csv", "numpy.cos", "models.util.curve_interpolation", "numpy.log10", "sys.exit" ]
[((1199, 1244), 'pandas.read_csv', 'pd.read_csv', (['"""R001.csv"""'], {'sep': '""";"""', 'index_col': '(0)'}), "('R001.csv', sep=';', index_col=0)\n", (1210, 1244), True, 'import pandas as pd\n'), ((1978, 2021), 'pandas.read_csv', 'pd.read_csv', (['"""h0.csv"""'], {'sep': '""";"""', 'index_col': '(0)'}), "('h0.csv', s...
import glob import gzip import sys import argparse import baseline from baseline.vectorizers import BPEVectorizer1D, WordpieceVectorizer1D from mead.api_examples.preproc_utils import * from eight_mile.utils import ( write_yaml, ) from typing import Optional import numpy as np import os try: import jsonlines ...
[ "gzip.open", "argparse.ArgumentParser", "os.makedirs", "zstandard.ZstdDecompressor", "os.path.isdir", "jsonlines.Reader", "os.path.dirname", "os.path.exists", "baseline.import_user_module", "baseline.revlut", "numpy.array", "os.path.join" ]
[((3884, 3910), 'os.path.isdir', 'os.path.isdir', (['input_files'], {}), '(input_files)\n', (3897, 3910), False, 'import os\n'), ((4975, 5008), 'baseline.revlut', 'baseline.revlut', (['vectorizer.vocab'], {}), '(vectorizer.vocab)\n', (4990, 5008), False, 'import baseline\n'), ((5024, 5047), 'os.path.dirname', 'os.path....
# Standard library import pickle from copy import deepcopy # Third-party import numpy as np from scipy import optimize from scipy.interpolate import interp1d from scipy.signal import fftconvolve from astropy.convolution import convolve_fft # Project from . import utils __all__ = [ 'measure', 'SBFResults' ] ...
[ "numpy.pad", "pickle.dump", "copy.deepcopy", "scipy.optimize.curve_fit", "numpy.product", "pickle.load", "scipy.interpolate.interp1d", "astropy.convolution.convolve_fft" ]
[((1502, 1567), 'numpy.pad', 'np.pad', (['psf', '((res_image.shape[0] - psf.shape[0]) // 2)', '"""constant"""'], {}), "(psf, (res_image.shape[0] - psf.shape[0]) // 2, 'constant')\n", (1508, 1567), True, 'import numpy as np\n'), ((2845, 2874), 'scipy.interpolate.interp1d', 'interp1d', (['wavenumbers', 'ps_psf'], {}), '(...
#!/usr/bin/env python """ Pure Python code for Poisson sparse deconvolution following 3DenseSTORM. As described in: Ovesny et al., "High density 3D localization microscopy using sparse support recovery", Optics Express, 2014. Hazen 11/19 """ import numpy import storm_analysis.sa_library.cs_algorithm as csAlgorithm ...
[ "storm_analysis.admm.admm_math.invL", "storm_analysis.admm.admm_math.lduG", "numpy.copy", "storm_analysis.admm.admm_math.invU", "storm_analysis.admm.admm_math.transpose", "storm_analysis.admm.admm_math.multiplyMatMat", "numpy.zeros", "storm_analysis.sa_library.recenter_psf.recenterPSF", "numpy.fft.f...
[((1460, 1481), 'storm_analysis.admm.admm_math.Cells', 'admmMath.Cells', (['nz', '(1)'], {}), '(nz, 1)\n', (1474, 1481), True, 'import storm_analysis.admm.admm_math as admmMath\n'), ((1663, 1689), 'storm_analysis.admm.admm_math.transpose', 'admmMath.transpose', (['self.A'], {}), '(self.A)\n', (1681, 1689), True, 'impor...
from typing import List import numpy as np from numpy.random import random_sample from manm_cs.prob_distributions.discrete.discrete_distribution import DiscreteDistribution class CustomDiscreteDistribution(DiscreteDistribution): probs: List[float] def __init__(self, probs: List[float]): if abs(sum(...
[ "numpy.add.accumulate", "numpy.random.random_sample" ]
[((768, 797), 'numpy.add.accumulate', 'np.add.accumulate', (['self.probs'], {}), '(self.probs)\n', (785, 797), True, 'import numpy as np\n'), ((951, 982), 'numpy.random.random_sample', 'random_sample', (['num_observations'], {}), '(num_observations)\n', (964, 982), False, 'from numpy.random import random_sample\n')]
import json from zerobnl.kernel import Node import numpy as np class MyNode(Node): def __init__(self): super().__init__() # Keep this line, it triggers the parent class __init__ method. # This is where you define the attribute of your model, this one is pretty basic. self.a = 0 ...
[ "numpy.random.choice" ]
[((1164, 1192), 'numpy.random.choice', 'np.random.choice', (['[-1, 0, 1]'], {}), '([-1, 0, 1])\n', (1180, 1192), True, 'import numpy as np\n')]
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE from __future__ import absolute_import import pytest # noqa: F401 import numpy as np # noqa: F401 import awkward as ak # noqa: F401 autograd = pytest.importorskip("autograd") def tanh(x): y = np.exp(-2.0 * x) return ...
[ "pytest.importorskip", "awkward.autograd.elementwise_grad", "awkward.Array", "numpy.exp", "numpy.linspace", "awkward.to_list", "pytest.approx" ]
[((237, 268), 'pytest.importorskip', 'pytest.importorskip', (['"""autograd"""'], {}), "('autograd')\n", (256, 268), False, 'import pytest\n'), ((292, 308), 'numpy.exp', 'np.exp', (['(-2.0 * x)'], {}), '(-2.0 * x)\n', (298, 308), True, 'import numpy as np\n'), ((377, 411), 'awkward.autograd.elementwise_grad', 'ak.autogr...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # author: bigfoolliu import numpy as np from PIL import ImageFont, ImageDraw, Image import cv2 import time # Make canvas and set the color img = np.zeros((200, 400, 3), np.uint8) b, g, r, a = 0, 255, 0, 0 # Use cv2.FONT_HERSHEY_XXX to write English. text = time.strftime...
[ "cv2.putText", "cv2.waitKey", "cv2.destroyAllWindows", "numpy.zeros", "PIL.ImageFont.truetype", "PIL.Image.fromarray", "numpy.array", "PIL.ImageDraw.Draw", "cv2.imshow", "time.localtime" ]
[((194, 227), 'numpy.zeros', 'np.zeros', (['(200, 400, 3)', 'np.uint8'], {}), '((200, 400, 3), np.uint8)\n', (202, 227), True, 'import numpy as np\n'), ((363, 458), 'cv2.putText', 'cv2.putText', (['img', 'text', '(50, 50)', 'cv2.FONT_HERSHEY_SIMPLEX', '(0.7)', '(b, g, r)', '(1)', 'cv2.LINE_AA'], {}), '(img, text, (50, ...
import numpy as np from scipy.interpolate import interp1d import random from procesos import * from visualizacion import * if __name__ == '__main__': datos_path = 'D:\mnustes_science\experimental_data' carpeta = select_directory(datos_path) #Z = zero_fix(carpeta, 20, 'mean') [X, T, Z] = cargar_txt(carp...
[ "numpy.sign" ]
[((490, 506), 'numpy.sign', 'np.sign', (['Z[i, j]'], {}), '(Z[i, j])\n', (497, 506), True, 'import numpy as np\n'), ((1170, 1188), 'numpy.sign', 'np.sign', (['POL[i, j]'], {}), '(POL[i, j])\n', (1177, 1188), True, 'import numpy as np\n')]
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # ME...
[ "argparse.Namespace", "lib.metrics.roc_auc", "lib.metrics.roc_aupr", "tempfile.gettempdir", "omegaconf.OmegaConf.create", "numpy.array", "dataclasses.fields", "omegaconf.OmegaConf.to_container", "lib.metrics.fpr_at_x_tpr", "numpy.unique", "torch.from_numpy" ]
[((1053, 1083), 'omegaconf.OmegaConf.to_container', 'OmegaConf.to_container', (['config'], {}), '(config)\n', (1075, 1083), False, 'from omegaconf import OmegaConf\n'), ((1552, 1568), 'argparse.Namespace', 'Namespace', ([], {}), '(**res)\n', (1561, 1568), False, 'from argparse import Namespace\n'), ((2153, 2174), 'omeg...
import numpy as np import tesuract from collections import defaultdict import time as T import warnings, pdb from sklearn.base import BaseEstimator, RegressorMixin, TransformerMixin from sklearn.utils.estimator_checks import check_estimator from sklearn.utils.validation import check_X_y, check_array from sklearn.model...
[ "sklearn.model_selection.GridSearchCV", "sklearn.preprocessing.FunctionTransformer", "numpy.sum", "numpy.argmax", "sklearn.model_selection.cross_val_score", "tesuract.PCEReg", "numpy.ones", "collections.defaultdict", "numpy.mean", "numpy.atleast_2d", "sklearn.gaussian_process.GaussianProcessRegr...
[((3078, 3100), 'numpy.zeros', 'np.zeros', (['n_regressors'], {}), '(n_regressors)\n', (3086, 3100), True, 'import numpy as np\n'), ((4566, 4594), 'numpy.argmax', 'np.argmax', (['self.best_scores_'], {}), '(self.best_scores_)\n', (4575, 4594), True, 'import numpy as np\n'), ((8667, 8676), 'numpy.var', 'np.var', (['Y'],...
# Classify test images import numpy as np import glob import sys import caffe import pickle #initial = 40000 #final = 79727 #Initialize transformers def initialize_transformer(image_mean, is_flow): shape = (1, 3, 227, 227) transformer = caffe.io.Transformer({'data': shape}) channel_mean = np.zeros((3,227,227)...
[ "caffe.io.load_image", "caffe.io.resize_image", "numpy.argmax", "numpy.zeros", "caffe.io.Transformer", "glob.glob", "caffe.Net" ]
[((648, 667), 'numpy.zeros', 'np.zeros', (['(3, 1, 1)'], {}), '((3, 1, 1))\n', (656, 667), True, 'import numpy as np\n'), ((878, 906), 'glob.glob', 'glob.glob', (["('%s/*.jpg' % test)"], {}), "('%s/*.jpg' % test)\n", (887, 906), False, 'import glob\n'), ((1798, 1855), 'caffe.Net', 'caffe.Net', (['singleFrame_model', 'R...
from sklearn.linear_model import LinearRegression, LogisticRegression from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from healthcareai.common.transformers import DataFrameImputer from healthcareai.common import model_eval from healthcareai.common import filters import numpy as np import pand...
[ "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "healthcareai.common.model_eval.clfreport", "pandas.get_dummies", "healthcareai.common.transformers.DataFrameImputer", "sklearn.ensemble.RandomForestRegressor", "numpy.shape", "healthcareai.common.filters.remove_datetime_columns", "healt...
[((1118, 1158), 'healthcareai.common.filters.remove_datetime_columns', 'filters.remove_datetime_columns', (['self.df'], {}), '(self.df)\n', (1149, 1158), False, 'from healthcareai.common import filters\n'), ((4479, 4530), 'pandas.to_numeric', 'pd.to_numeric', ([], {'arg': 'df[predictedcol]', 'errors': '"""raise"""'}), ...
""" Layer: FullyConnect Convolution """ import numpy as np import Initialization import Tool class FullyConnect: def __init__(self, name, feature_in, feature_out, mode='train', reg=1e-4, weight_init=None, bias_init=None): self.name = name self.input = feature_in self.output = feature_out ...
[ "Tool.padding", "numpy.sum", "Initialization.GaussionInitialize", "Initialization.Initialize", "Initialization.ConstantInitialize", "numpy.zeros", "numpy.matmul" ]
[((1162, 1275), 'Initialization.Initialize', 'Initialization.Initialize', ([], {'shape': '(self.input, self.output)', 'withgrad': 'with_grad', 'initializer': 'self.weight_init'}), '(shape=(self.input, self.output), withgrad=\n with_grad, initializer=self.weight_init)\n', (1187, 1275), False, 'import Initialization\n...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import copy import bookend.core.cython_utils._rnaseq_utils as ru from bookend.core.cython_utils._fasta_utils import longest_orf from bookend.core.cython_utils._assembly_utils import Locus from numpy import argsort from collections import Counter from math import cei...
[ "sys.path.append", "bookend.core.cython_utils._rnaseq_utils.AnnotationDataset", "copy.deepcopy", "argument_parsers.merge_parser.parse_args", "copy.copy", "argument_parsers.merge_parser.print_help", "numpy.argsort", "bookend.core.cython_utils._assembly_utils.Locus", "collections.Counter", "bookend....
[((353, 385), 'sys.path.append', 'sys.path.append', (['"""../../bookend"""'], {}), "('../../bookend')\n", (368, 385), False, 'import sys\n'), ((2482, 2666), 'bookend.core.cython_utils._rnaseq_utils.AnnotationDataset', 'ru.AnnotationDataset', ([], {'annotation_files': 'self.input', 'reference': 'self.reference', 'genome...
from feerci import feer from unittest import TestCase import numpy as np class TestFeer(TestCase): def test_feer_happy(self): genuines = np.linspace(0, 1, 100) impostors = np.linspace(-.5, .5, 100) eer = feer(impostors, genuines, is_sorted=True) assert eer == 0.2525252401828766 ...
[ "numpy.random.rand", "numpy.random.seed", "feerci.feer", "numpy.linspace" ]
[((153, 175), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(100)'], {}), '(0, 1, 100)\n', (164, 175), True, 'import numpy as np\n'), ((196, 223), 'numpy.linspace', 'np.linspace', (['(-0.5)', '(0.5)', '(100)'], {}), '(-0.5, 0.5, 100)\n', (207, 223), True, 'import numpy as np\n'), ((236, 277), 'feerci.feer', 'feer',...
import numpy as np import os import time import nrrd import matplotlib.pyplot as plt # generates gaussian function based on abscissa interval x, average mu and standard deviation sig def gaussian(x, mu, sig): return np.exp(-np.power(x - mu, 2.) / (2 * np.power(sig, 2.))) # generates equispaced gauss...
[ "os.makedirs", "numpy.log", "numpy.power", "numpy.asarray", "numpy.zeros", "os.path.exists", "time.time", "numpy.arange", "numpy.dot" ]
[((980, 1002), 'numpy.arange', 'np.arange', (['(400)', '(785)', '(5)'], {}), '(400, 785, 5)\n', (989, 1002), True, 'import numpy as np\n'), ((1031, 1042), 'time.time', 'time.time', ([], {}), '()\n', (1040, 1042), False, 'import time\n'), ((2572, 2591), 'numpy.zeros', 'np.zeros', (['sim_shape'], {}), '(sim_shape)\n', (2...
# -*- coding: utf-8 -*- """ Created on Wed Feb 21 21:20:10 2018 @author: smnbe """ import numpy as np import matplotlib.pyplot as plt from WineDataset import shuffling def to_one_hot(Y): nb_cl=11 targets = Y.reshape(-1) Y = np.eye(nb_cl)[targets] Y=Y.T Y=Y.astype(int) r...
[ "numpy.multiply", "numpy.maximum", "numpy.copy", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "numpy.eye", "numpy.sum", "WineDataset.shuffling", "matplotlib.pyplot.ylabel", "numpy.zeros", "numpy.random.randn", "numpy.abs", "numpy.power", "numpy.max", "numpy.where", "numpy.squeez...
[((1222, 1239), 'numpy.copy', 'np.copy', (['lay_size'], {}), '(lay_size)\n', (1229, 1239), True, 'import numpy as np\n'), ((2346, 2368), 'numpy.maximum', 'np.maximum', (['epsilon', 'Z'], {}), '(epsilon, Z)\n', (2356, 2368), True, 'import numpy as np\n'), ((4118, 4128), 'numpy.copy', 'np.copy', (['A'], {}), '(A)\n', (41...
# Plot the Szekeres Polynomials for the paper import sys sys.path.append('../py') import numpy as np import matplotlib.pyplot as pp import friterexp_szek as frit tightview = False width=6.0 # inches height=5.5 if tightview: urange=(-0.5, 0.5) yrange=(-0.12, 0.12) filename = 'szekpoly_tight.eps' else: urang...
[ "sys.path.append", "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylim", "numpy.polyval", "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig" ]
[((59, 83), 'sys.path.append', 'sys.path.append', (['"""../py"""'], {}), "('../py')\n", (74, 83), False, 'import sys\n'), ((529, 567), 'numpy.arange', 'np.arange', (['urange[0]', 'urange[1]', 'ustep'], {}), '(urange[0], urange[1], ustep)\n', (538, 567), True, 'import numpy as np\n'), ((569, 601), 'matplotlib.pyplot.tit...
import numpy as np def sig(z): return 1/(1 + np.exp(-z)) def sig_d(z): return np.exp(z)/(1 + np.exp(z))**2 num_inputs = 2 num_hiddens1 = 2 num_hiddens2 = 2 num_outputs = 2 learning_rate = 2.5 num_epochs = 200 xs = np.array([ [0,0], [0,1], [1,0], [1,1] ]) ts = np.array([ [0,0], [0,1], [1,0], [1,1] ]) W1...
[ "numpy.zeros", "numpy.array", "numpy.exp", "numpy.random.normal", "numpy.round" ]
[((230, 272), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 0], [1, 1]]'], {}), '([[0, 0], [0, 1], [1, 0], [1, 1]])\n', (238, 272), True, 'import numpy as np\n'), ((276, 318), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 0], [1, 1]]'], {}), '([[0, 0], [0, 1], [1, 0], [1, 1]])\n', (284, 318), True, 'import nu...
import pytest import numpy as np import pandapower as pp import pandapower.networks import pandapower.grid_equivalents try: from misc.groups import Group group_imported = True except ImportError: group_imported = False def create_test_net(): net = pp.create_empty_network() # buses pp.create_...
[ "pandapower.select_subnet", "pandapower.create_ext_grid", "pandapower.networks.example_multivoltage", "pandapower.replace_gen_by_sgen", "numpy.allclose", "pandapower.create_line", "pytest.main", "pytest.mark.skipif", "numpy.arange", "pandapower.networks.case9", "pandapower.create_empty_network",...
[((16492, 16563), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not group_imported)'], {'reason': '"""Group is not installed"""'}), "(not group_imported, reason='Group is not installed')\n", (16510, 16563), False, 'import pytest\n'), ((268, 293), 'pandapower.create_empty_network', 'pp.create_empty_network', ([], {}),...
#!/usr/bin/env python3 # Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,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://ww...
[ "argparse.ArgumentParser", "espnet.utils.cli_writers.KaldiWriter", "logging.warning", "numpy.empty", "espnet.utils.cli_readers.KaldiReader", "numpy.zeros", "logging.info", "kaldiio.save_mat" ]
[((1000, 1253), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Compute cepstral mean and variance normalization statisticsper-utterance by default, or per-speaker if spk2utt option provided,if wxfilename: global"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(descri...
import torch from torchvision import datasets, transforms import torch.utils.data.sampler as sampler import torch.utils.data as data import torchvision.models as models import numpy as np import argparse import random import os from custom_datasets import * import model import vgg from mnist_net import MNISTNet from...
[ "os.mkdir", "random.sample", "torch.cat", "numpy.mean", "numpy.arange", "torch.device", "os.path.join", "torch.isnan", "torch.ones", "solver.Solver", "torch.utils.data.DataLoader", "matplotlib.pyplot.close", "sklearn.cluster.KMeans", "os.path.exists", "random.seed", "arguments.get_args...
[((898, 927), 'torch.zeros', 'torch.zeros', (['(num_repeats, 1)'], {}), '((num_repeats, 1))\n', (909, 927), False, 'import torch\n'), ((956, 1000), 'torch.zeros', 'torch.zeros', (['(num_repeats, args.num_classes)'], {}), '((num_repeats, args.num_classes))\n', (967, 1000), False, 'import torch\n'), ((1025, 1069), 'torch...
#!/usr/bin/env python3 from math import sqrt from numpy import concatenate from sklearn.metrics import mean_squared_error from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.layers import LSTM from pandas import read_csv from pandas import DataFrame from panda...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "tensorflow.keras.layers.Dense", "pandas.read_csv", "random.shuffle", "matplotlib.pyplot.legend", "sklearn.preprocessing.MinMaxScaler", "sklearn.preprocessing.LabelEncoder", "sklearn.metrics.mean_a...
[((818, 962), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Individual plant temperature extraction"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'Individual plant temperature extraction', formatter_class=argparse.\n ArgumentDefaultsHelpForma...
import numpy as np import couplingmatrix as cp import CP import timeit normalizedFreq = np.arange(-2.5, 2.5, 0.5) M = np.array([[0.00000,0.44140,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000], [0.44140,0.75180,0.16820,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000], [0.00000,0.16820,0.78050,0.12880,0.00000,...
[ "CP.CM2S", "couplingmatrix.CM2S", "numpy.testing.assert_array_equal", "numpy.allclose", "numpy.array", "numpy.arange", "timeit.timeit" ]
[((89, 114), 'numpy.arange', 'np.arange', (['(-2.5)', '(2.5)', '(0.5)'], {}), '(-2.5, 2.5, 0.5)\n', (98, 114), True, 'import numpy as np\n'), ((119, 665), 'numpy.array', 'np.array', (['[[0.0, 0.4414, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.4414, 0.7518, 0.1682,\n 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.1682, 0.7805, 0...
from torch.utils.data import DataLoader import numpy as np from collections import deque import copy from typing import Union, Dict, Tuple from minerl.herobraine.hero import spaces from collections import Counter from memory.demo_memory import DemoReplayBuffer from memory.dataset_loader import ExpertDataset from utils...
[ "numpy.sum", "numpy.clip", "numpy.around", "numpy.mean", "numpy.arange", "collections.deque", "utils.minerl_wrappers.MyLazyFrames", "numpy.zeros_like", "torch.utils.data.DataLoader", "collections.Counter", "copy.deepcopy", "numpy.roll", "numpy.concatenate", "numpy.all", "utils.minerl_wra...
[((1367, 1513), 'memory.dataset_loader.ExpertDataset', 'ExpertDataset', ([], {'data_dir': 'data_dir', 'frame_skip': 'args.frame_skip', 'alternate_data': "('MineRLTreechop-v0' if 'Treechop' not in args.env_name else None)"}), "(data_dir=data_dir, frame_skip=args.frame_skip, alternate_data\n ='MineRLTreechop-v0' if 'T...
import os import dash import dash_table import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc import json import time import textwrap import urllib.parse import numpy as np import pandas as pd import plotly.express as px import plotly.graph_objects as go from pl...
[ "pandas.read_csv", "textwrap.wrap", "os.path.join", "numpy.round", "os.path.abspath", "dash_html_components.Div", "dash.dependencies.State", "numpy.linspace", "dash_core_components.Store", "app.app.css.append_css", "dash_core_components.Location", "time.sleep", "dash.dependencies.Input", "...
[((555, 591), 'os.path.join', 'os.path.join', (['DATA_DIR', '"""bycompany/"""'], {}), "(DATA_DIR, 'bycompany/')\n", (567, 591), False, 'import os\n'), ((705, 742), 'os.path.join', 'os.path.join', (['DATA_DIR', 'co_names_json'], {}), '(DATA_DIR, co_names_json)\n', (717, 742), False, 'import os\n'), ((1179, 1253), 'os.pa...
import tkinter as tk from tkinter import filedialog, ttk import numpy as np from display_an import MainDisplay class FileLoad(): def load_options(self): load_options = options = {} options['defaultextension'] = '.npz' options['filetypes'] = [ ('Numpy Files',('.npz','.npy')), ('Text Files', '...
[ "tkinter.filedialog.asksaveasfilename", "numpy.load", "numpy.savez", "display_an.MainDisplay.show_loaddata", "tkinter.filedialog.askopenfilename", "tkinter.ttk.Frame", "tkinter.Toplevel", "tkinter.IntVar", "tkinter.ttk.Checkbutton", "tkinter.ttk.LabelFrame" ]
[((475, 520), 'tkinter.filedialog.askopenfilename', 'tk.filedialog.askopenfilename', ([], {}), '(**load_options)\n', (504, 520), True, 'import tkinter as tk\n'), ((692, 728), 'numpy.load', 'np.load', (['filename'], {'allow_pickle': '(True)'}), '(filename, allow_pickle=True)\n', (699, 728), True, 'import numpy as np\n')...
import json import numpy as np class EmbeddingBatch(): def __init__(self, batchProgram, batch_size, dimension): self.A = np.zeros([batch_size] , dtype=np.float32) self.B = np.zeros([batch_size, dimension] , dtype=np.float32 ) self.js = [None for i in range(batch_size)] for j, pr...
[ "numpy.asarray", "json.load", "numpy.zeros" ]
[((137, 177), 'numpy.zeros', 'np.zeros', (['[batch_size]'], {'dtype': 'np.float32'}), '([batch_size], dtype=np.float32)\n', (145, 177), True, 'import numpy as np\n'), ((196, 247), 'numpy.zeros', 'np.zeros', (['[batch_size, dimension]'], {'dtype': 'np.float32'}), '([batch_size, dimension], dtype=np.float32)\n', (204, 24...