code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""Run this file generate a toy dataset."""
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
def gen_synthetic_dataset(data_count, time_count):
"""Signal-and-Noise HMM dataset
The generative process comes from two separate HMM processes. First,
a "signal"... | [
"os.mkdir",
"numpy.random.binomial",
"os.path.isdir",
"_pickle.dump",
"numpy.random.multinomial",
"numpy.zeros",
"numpy.hstack",
"numpy.array",
"numpy.arange",
"numpy.dot"
] | [((891, 905), 'numpy.array', 'np.array', (['[15]'], {}), '([15])\n', (899, 905), True, 'import numpy as np\n'), ((955, 1005), 'numpy.array', 'np.array', (['[[10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0]]'], {}), '([[10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0]])\n', (963, 1005), True, 'import numpy as np\n'), ((1114, 1143), 'numpy.a... |
import composeml as cp
import numpy as np
import pandas as pd
import pytest
from dask import dataframe as dd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import NaturalLanguage
from featuretools.computational_backends.calculate_feature_matrix import (
FEATURE_CALCULATION_PERCENTAGE
)... | [
"dask.dataframe.from_pandas",
"numpy.isclose",
"pandas.DataFrame",
"pytest.warns",
"composeml.LabelMaker",
"pandas.Timedelta",
"pandas.DateOffset",
"featuretools.entityset.Timedelta",
"featuretools.entityset.EntitySet",
"pandas.to_datetime",
"pandas.Series",
"featuretools.synthesis.dfs",
"pa... | [((780, 817), 'pandas.DataFrame', 'pd.DataFrame', (["{'id': [1, 2, 3, 4, 5]}"], {}), "({'id': [1, 2, 3, 4, 5]})\n", (792, 817), True, 'import pandas as pd\n'), ((1329, 1355), 'featuretools.entityset.EntitySet', 'EntitySet', ([], {'id': '"""fraud_data"""'}), "(id='fraud_data')\n", (1338, 1355), False, 'from featuretools... |
from __future__ import division
import numpy as np
from scipy.optimize import linear_sum_assignment
def euclidian_distance(x, y):
""" Euclidian distance function. """
return np.linalg.norm(x-y)
def check_gospa_parameters(c, p, alpha):
""" Check parameter bounds.
If the parameter values are outside th... | [
"numpy.zeros",
"numpy.min",
"numpy.linalg.norm",
"scipy.optimize.linear_sum_assignment"
] | [((183, 204), 'numpy.linalg.norm', 'np.linalg.norm', (['(x - y)'], {}), '(x - y)\n', (197, 204), True, 'import numpy as np\n'), ((3322, 3357), 'numpy.zeros', 'np.zeros', (['(num_targets, num_tracks)'], {}), '((num_targets, num_tracks))\n', (3330, 3357), True, 'import numpy as np\n'), ((3719, 3753), 'scipy.optimize.line... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable-msg=import-error
"""
data_util.py is writen for creating iterator and save field
"""
import logging
import hazm
import torch
import numpy as np
import pandas as pd
import pickle as pkl
from torchtext import data
from torchtext.vocab import Vectors
from ... | [
"logging.basicConfig",
"pandas.read_csv",
"torch.nn.init.xavier_uniform_",
"numpy.unique",
"torchtext.data.BucketIterator",
"torchtext.vocab.Vectors",
"torchtext.data.LabelField",
"logging.info",
"torch.save",
"hazm.Lemmatizer",
"torch.nn.init.normal_",
"pickle.load",
"torchtext.data.Example... | [((599, 694), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s : %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s : %(levelname)s : %(message)s',\n level=logging.INFO)\n", (618, 694), False, 'import logging\n'), ((1730, 1753), 'pandas.read_csv', 'pd.read_... |
# Copyright (c) Facebook, Inc. and its affiliates.
import math
import numpy as np
from enum import IntEnum, unique
from typing import List, Tuple, Union
import torch
from torch import device
_RawBoxType = Union[List[float], Tuple[float, ...], torch.Tensor, np.ndarray]
@unique
class BoxMode(IntEnum):
"""
Enum... | [
"torch.jit.is_scripting",
"numpy.asarray",
"torch.empty",
"torch.cat",
"torch.sin",
"torch.cos",
"torch.max",
"torch.isfinite",
"torch.device",
"torch.zeros",
"torch.as_tensor",
"torch.min",
"torch.tensor"
] | [((13944, 13979), 'torch.max', 'torch.max', (['box1[:, :2]', 'box2[:, :2]'], {}), '(box1[:, :2], box2[:, :2])\n', (13953, 13979), False, 'import torch\n'), ((13998, 14033), 'torch.min', 'torch.min', (['box1[:, 2:]', 'box2[:, 2:]'], {}), '(box1[:, 2:], box2[:, 2:])\n', (14007, 14033), False, 'import torch\n'), ((4990, 5... |
#!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('clustering', parent_package, top_path)
config.add_subpackage('tests')
# We need this because libcstat.a is linked to lapack, which can
# be a fort... | [
"numpy.distutils.system_info.get_info",
"numpy.distutils.misc_util.Configuration"
] | [((146, 199), 'numpy.distutils.misc_util.Configuration', 'Configuration', (['"""clustering"""', 'parent_package', 'top_path'], {}), "('clustering', parent_package, top_path)\n", (159, 199), False, 'from numpy.distutils.misc_util import Configuration\n'), ((443, 468), 'numpy.distutils.system_info.get_info', 'get_info', ... |
import math
import numpy as np
from numpy import linalg as la
from sklearn.preprocessing import normalize
class GraRep(object):
def __init__(self, graph, Kstep, dim):
self.g = graph
self.Kstep = Kstep
assert dim % Kstep == 0
self.dim = int(dim / Kstep)
self.train()
def... | [
"numpy.matrix",
"numpy.sum",
"numpy.log",
"numpy.power",
"numpy.ones",
"numpy.identity",
"numpy.linalg.svd",
"numpy.array",
"sklearn.preprocessing.normalize",
"numpy.dot"
] | [((522, 553), 'numpy.ones', 'np.ones', (['(node_size, node_size)'], {}), '((node_size, node_size))\n', (529, 553), True, 'import numpy as np\n'), ((902, 921), 'numpy.sum', 'np.sum', (['adj'], {'axis': '(1)'}), '(adj, axis=1)\n', (908, 921), True, 'import numpy as np\n'), ((937, 959), 'numpy.matrix', 'np.matrix', (['(ad... |
import numpy as np
from .utils import CheckDim, IsZero, InvalidSupportTypeError
class MemberType:
def __init__(self, a=1., e=1., density=1.):
self.a = float(a)
self.e = float(e)
self.density = float(density)
def __repr__(self):
return f"MemberType(a={self.a}, e... | [
"numpy.array"
] | [((1556, 1584), 'numpy.array', 'np.array', (['[True, True, True]'], {}), '([True, True, True])\n', (1564, 1584), True, 'import numpy as np\n'), ((2225, 2247), 'numpy.array', 'np.array', (['[True, True]'], {}), '([True, True])\n', (2233, 2247), True, 'import numpy as np\n'), ((1662, 1692), 'numpy.array', 'np.array', (['... |
import numpy as np
import h5py
import os
from uclahedp.tools import csv as csvtools
def grid(pos, attrs, strict_axes=False, strict_grid=False, grid_precision=0.1,
invert=False):
"""
This program is a high-level encapsulation of all of the gridding typically
used by one of the probe pr... | [
"uclahedp.tools.csv.missingKeys",
"h5py.File",
"numpy.abs",
"numpy.floor",
"numpy.zeros",
"numpy.ones",
"numpy.argmin",
"numpy.arange",
"numpy.array",
"numpy.round",
"os.path.join",
"numpy.unique",
"numpy.sqrt"
] | [((1996, 2051), 'uclahedp.tools.csv.missingKeys', 'csvtools.missingKeys', (['attrs', 'req_keys'], {'fatal_error': '(True)'}), '(attrs, req_keys, fatal_error=True)\n', (2016, 2051), True, 'from uclahedp.tools import csv as csvtools\n'), ((2235, 2246), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (2243, 2246), True... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from functools import partial
import os
import numpy as np
from scipy import sparse, linalg, stats
from numpy.testing import (assert_equal, assert_array_equal,
assert_array_almost_equal, assert_allclose)
imp... | [
"numpy.sum",
"scipy.stats.ttest_1samp",
"scipy.stats.f_oneway",
"numpy.random.default_rng",
"numpy.mean",
"mne.stats.cluster_level.spatio_temporal_cluster_test",
"numpy.arange",
"pytest.mark.parametrize",
"numpy.testing.assert_array_almost_equal",
"numpy.unique",
"numpy.zeros_like",
"mne.utils... | [((18917, 18966), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kind"""', "('1samp', 'ind')"], {}), "('kind', ('1samp', 'ind'))\n", (18940, 18966), False, 'import pytest\n'), ((25314, 25377), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kind"""', "('surface', 'volume', 'mixed')"], {}), "('k... |
from matplotlib import pyplot as plt
from scipy.cluster.hierarchy import dendrogram, linkage
import numpy as np
fname = "sent2.txt"
num_lines = sum(1 for line in open(fname));
embedded_vector = np.zeros((num_lines,100),dtype = np.float);
k = 0
with open(fname, "r") as ins:
for line in ins:
a =[float(i) f... | [
"numpy.zeros"
] | [((197, 239), 'numpy.zeros', 'np.zeros', (['(num_lines, 100)'], {'dtype': 'np.float'}), '((num_lines, 100), dtype=np.float)\n', (205, 239), True, 'import numpy as np\n')] |
# coding: utf-8
# python 3.5
from itertools import product
from sklearn.metrics import accuracy_score
from multiprocessing import Pool
from multiprocessing import freeze_support
import numpy as np
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath("__file__"))+'/../MLEM2')
#sys.path.append('/Users/ook... | [
"sklearn.metrics.accuracy_score",
"clustering.getRuleClusteringByConsistentSimilarityExceptMRule",
"os.path.isfile",
"numpy.mean",
"LERS.predictByLERS",
"mlem2.getColNames",
"mlem2.getRulesByMLEM2",
"os.path.abspath",
"clustering.getRuleClusteringBySimilarity",
"mlem2.getDecisionTable",
"numpy.s... | [((536, 559), 'importlib.reload', 'importlib.reload', (['mlem2'], {}), '(mlem2)\n', (552, 559), False, 'import importlib\n'), ((574, 596), 'importlib.reload', 'importlib.reload', (['LERS'], {}), '(LERS)\n', (590, 596), False, 'import importlib\n'), ((616, 644), 'importlib.reload', 'importlib.reload', (['clustering'], {... |
from keras.layers import Input
from yolo import YOLO
from PIL import Image
import numpy as np
import cv2
import time
import tkinter as tk
from tkinter import Label
yolo_net = YOLO()
capture_frame = cv2.VideoCapture("img/manynike.mp4")
fourcc_format = cv2.VideoWriter_fourcc(*'XVID')
output_frame = cv2.VideoWriter('out... | [
"cv2.resize",
"numpy.uint8",
"cv2.putText",
"cv2.VideoWriter_fourcc",
"tkinter.mainloop",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"time.time",
"cv2.VideoCapture",
"numpy.array",
"cv2.VideoWriter",
"cv2.destroyAllWindows",
"tkinter.Tk",
"yolo.YOLO"
] | [((176, 182), 'yolo.YOLO', 'YOLO', ([], {}), '()\n', (180, 182), False, 'from yolo import YOLO\n'), ((200, 236), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""img/manynike.mp4"""'], {}), "('img/manynike.mp4')\n", (216, 236), False, 'import cv2\n'), ((253, 284), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (["*'X... |
"""Transforms described in https://arxiv.org/abs/1512.02325."""
from __future__ import absolute_import
from __future__ import division
import random
import numpy as np
import mxnet as mx
from gluoncv.data.transforms import bbox as tbbox
from gluoncv.data.transforms import image as timage
from gluoncv.data.transforms im... | [
"mxnet.nd.image.to_tensor",
"gluoncv.utils.bbox_iou",
"numpy.random.randint",
"mxnet.image.resize_short",
"mxnet.nd.image.normalize",
"mxnet.image.fixed_crop",
"gluoncv.data.transforms.image.resize_long",
"gluoncv.data.transforms.bbox.flip",
"gluoncv.data.transforms.image.imresize",
"gluoncv.data.... | [((1804, 1822), 'mxnet.image.imread', 'mx.image.imread', (['f'], {}), '(f)\n', (1819, 1822), True, 'import mxnet as mx\n'), ((1837, 1870), 'mxnet.image.resize_short', 'mx.image.resize_short', (['img', 'short'], {}), '(img, short)\n', (1858, 1870), True, 'import mxnet as mx\n'), ((2054, 2080), 'mxnet.nd.image.to_tensor'... |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.nn.BatchNorm2d",
"mindspore.nn.Flatten",
"mindspore.ops.operations.Cast",
"numpy.ones",
"mindspore.ops.operations.DType",
"mindspore.ops.operations.ReLU",
"mindspore.ops.composite.GradOperation",
"mindspore.ops.operations.Fill",
"mindspore.nn.loss.SoftmaxCrossEntropyWithLogits",
"mindsp... | [((1386, 1430), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE'}), '(mode=context.GRAPH_MODE)\n', (1405, 1430), False, 'from mindspore import context\n'), ((1431, 1468), 'mindspore.context.reset_auto_parallel_context', 'context.reset_auto_parallel_context', ([], {}), '()\n', (... |
# MODIFIED FROM
# https://github.com/asyml/vision-transformer-pytorch/blob/92b8deb1ce99e83e0a182fefc866ab0485d76f1b/src/check_jax.py
import torch
import argparse
import numpy as np
from tensorflow.io import gfile
def load_jax(path):
""" Loads params from a npz checkpoint previously stored with `save()` in jax im... | [
"numpy.load",
"argparse.ArgumentParser",
"torch.save",
"torch.tensor",
"tensorflow.io.gfile.GFile"
] | [((4610, 4723), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Convert JAX model to PyTorch model and save for easier future loading"""'}), "(description=\n 'Convert JAX model to PyTorch model and save for easier future loading')\n", (4633, 4723), False, 'import argparse\n'), ((5171, ... |
import os
import numpy as np
import sys
datafolder="/home/jinyang.liu/lossycompression/turbulence_1024"
field=sys.argv[1]
ebs=[-x for x in range(0,20)]
idxlist=range(1,11)
cr=np.zeros((len(ebs)+1,len(idxlist)+1),dtype=np.float32)
psnr=np.zeros((len(ebs)+1,len(idxlist)+1),dtype=np.float32)
maxpwerr=np.zeros((len(ebs)+1... | [
"numpy.fromfile",
"numpy.savetxt",
"os.system",
"numpy.max",
"numpy.min",
"os.path.join"
] | [((1487, 1551), 'numpy.savetxt', 'np.savetxt', (["('zfp_turb1024_%s_cr.txt' % field)", 'cr'], {'delimiter': '"""\t"""'}), "('zfp_turb1024_%s_cr.txt' % field, cr, delimiter='\\t')\n", (1497, 1551), True, 'import numpy as np\n'), ((1550, 1618), 'numpy.savetxt', 'np.savetxt', (["('zfp_turb1024_%s_psnr.txt' % field)", 'psn... |
#! /usr/bin/env python
# Copyright 2021 <NAME>
#
# This file is part of WarpX.
#
# License: BSD-3-Clause-LBNL
"""
This script tests the plasma lens.
The input file sets up a series of plasma lens and propagates a particle through them.
The final position is compared to the analytic solution.
The motion is slow enoug... | [
"yt.funcs.mylog.setLevel",
"numpy.arctan2",
"numpy.abs",
"os.getcwd",
"sys.path.insert",
"checksumAPI.evaluate_checksum",
"numpy.argsort",
"numpy.sin",
"numpy.cos",
"yt.load",
"numpy.sqrt"
] | [((454, 480), 'yt.funcs.mylog.setLevel', 'yt.funcs.mylog.setLevel', (['(0)'], {}), '(0)\n', (477, 480), False, 'import yt\n'), ((481, 541), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../../../warpx/Regression/Checksum/"""'], {}), "(1, '../../../../warpx/Regression/Checksum/')\n", (496, 541), False, 'import s... |
import numpy as np
import tensorflow as tf
import tensorflow_estimator as tfe
import tensorflow_hub as hub
from tensorflow.compat.v1 import get_variable
from tensorflow.compat.v1 import logging
from tensorflow.compat.v1 import variable_scope
from tensorflow.compat.v1.nn.rnn_cell import LSTMCell
from tensorflow.contrib... | [
"tfnlp.layers.transformers.multihead_attention",
"tensorflow.gather_nd",
"tensorflow_hub.Module",
"tensorflow.reshape",
"tensorflow.python.layers.base.InputSpec",
"tensorflow.matmul",
"numpy.linalg.svd",
"tensorflow.nn.conv2d",
"numpy.random.normal",
"tensorflow.nn.leaky_relu",
"numpy.prod",
"... | [((8189, 8224), 'tensorflow.shape', 'tf.shape', (['inputs'], {'out_type': 'tf.int64'}), '(inputs, out_type=tf.int64)\n', (8197, 8224), True, 'import tensorflow as tf\n'), ((8254, 8325), 'tensorflow.compat.v1.get_variable', 'get_variable', ([], {'name': '"""sentinel"""', 'shape': '[inputs.shape[-1]]', 'trainable': '(Tru... |
"""Estimate flat field images"""
import numpy as np
import os
import micro_dl.utils.aux_utils as aux_utils
from micro_dl.utils.image_utils import fit_polynomial_surface_2D, read_image
class FlatFieldEstimator2D:
"""Estimates flat field image"""
def __init__(self,
input_dir,
... | [
"micro_dl.utils.aux_utils.get_row_idx",
"micro_dl.utils.image_utils.read_image",
"numpy.save",
"os.makedirs",
"micro_dl.utils.aux_utils.read_meta",
"micro_dl.utils.aux_utils.validate_metadata_indices",
"numpy.median",
"numpy.zeros",
"numpy.mean",
"micro_dl.utils.image_utils.fit_polynomial_surface_... | [((1035, 1085), 'os.path.join', 'os.path.join', (['self.output_dir', '"""flat_field_images"""'], {}), "(self.output_dir, 'flat_field_images')\n", (1047, 1085), False, 'import os\n'), ((1137, 1184), 'os.makedirs', 'os.makedirs', (['self.flat_field_dir'], {'exist_ok': '(True)'}), '(self.flat_field_dir, exist_ok=True)\n',... |
import contextlib
import glob
import os
import platform
import shutil
import subprocess
import sys
import tempfile
from concurrent.futures import ThreadPoolExecutor as Pool
from distutils import log
from distutils.ccompiler import CCompiler, new_compiler
from distutils.errors import CompileError, LinkError
from distuti... | [
"os.mkdir",
"pkg_resources.resource_filename",
"shutil.rmtree",
"os.path.join",
"os.chdir",
"os.path.abspath",
"os.path.dirname",
"tempfile.mkdtemp",
"distutils.sysconfig.customize_compiler",
"numpy.get_include",
"concurrent.futures.ThreadPoolExecutor",
"subprocess.Popen",
"distutils.version... | [((1805, 1819), 'distutils.ccompiler.new_compiler', 'new_compiler', ([], {}), '()\n', (1817, 1819), False, 'from distutils.ccompiler import CCompiler, new_compiler\n'), ((1824, 1853), 'distutils.sysconfig.customize_compiler', 'customize_compiler', (['ccompiler'], {}), '(ccompiler)\n', (1842, 1853), False, 'from distuti... |
import unittest
from acqdp import circuit
import numpy as np
from scipy.stats import unitary_group
from acqdp.circuit import noise
class CircuitTestCase(unittest.TestCase):
def test_basic(self):
c = circuit.Circuit()
c.append(circuit.ZeroState, [0])
c.append(circuit.ZeroMeas, [0... | [
"acqdp.circuit.State",
"acqdp.circuit.XGate.tensor_density.contract",
"acqdp.circuit.ImmutableOperation.operation_from_kraus",
"numpy.allclose",
"acqdp.circuit.XXRotation",
"acqdp.circuit.CNOTGate.tensor_pure.contract",
"acqdp.circuit.SuperPosition",
"acqdp.circuit.Controlled",
"acqdp.circuit.YGate.... | [((222, 239), 'acqdp.circuit.Circuit', 'circuit.Circuit', ([], {}), '()\n', (237, 239), False, 'from acqdp import circuit\n'), ((406, 423), 'acqdp.circuit.Circuit', 'circuit.Circuit', ([], {}), '()\n', (421, 423), False, 'from acqdp import circuit\n'), ((623, 640), 'acqdp.circuit.Circuit', 'circuit.Circuit', ([], {}), ... |
"""
Please read README.md for usage instructions.
Give a path to a .npy file which contains a dictionary of model parameters.
Creates a TensorFlow Variable for each parameter and saves the session in a .ckpt file to restore later.
"""
import argparse
import numpy as np
import os
import tensorflow as tf
slim = tf.contr... | [
"numpy.load",
"argparse.ArgumentParser",
"tensorflow.train.Saver",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.Variable",
"os.path.splitext"
] | [((359, 379), 'numpy.load', 'np.load', (['FLAGS.input'], {}), '(FLAGS.input)\n', (366, 379), True, 'import numpy as np\n'), ((709, 725), 'tensorflow.train.Saver', 'tf.train.Saver', ([], {}), '()\n', (723, 725), True, 'import tensorflow as tf\n'), ((1048, 1073), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([],... |
import numpy as np
from railrl.samplers.rollout_functions import tdm_rollout
class MultigoalSimplePathSampler(object):
def __init__(
self,
env,
policy,
max_samples,
max_path_length,
tau_sampling_function,
cycle_taus_for_rollout=Tr... | [
"railrl.samplers.rollout_functions.tdm_rollout",
"numpy.expand_dims",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.draw",
"numpy.array",
"matplotlib.pyplot.pause"
] | [((2317, 2327), 'matplotlib.pyplot.draw', 'plt.draw', ([], {}), '()\n', (2325, 2327), True, 'import matplotlib.pyplot as plt\n'), ((2332, 2348), 'matplotlib.pyplot.pause', 'plt.pause', (['(0.001)'], {}), '(0.001)\n', (2341, 2348), True, 'import matplotlib.pyplot as plt\n'), ((2435, 2463), 'railrl.samplers.rollout_funct... |
import numpy as np
import cv2 as cv
from util.csvUtil import CSVUtil
# K-Nearest Neighbors
class KNN:
def __init__(self):
self.knn = self.train()
def train(self):
labels = np.loadtxt("../base/recognition/labels.txt", np.float32)
labels = labels.reshape((labels.size, 1))
flatte... | [
"numpy.empty",
"cv2.ml.KNearest_create",
"numpy.savetxt",
"numpy.float32",
"cv2.imread",
"numpy.append",
"numpy.array",
"numpy.loadtxt",
"cv2.resize"
] | [((199, 255), 'numpy.loadtxt', 'np.loadtxt', (['"""../base/recognition/labels.txt"""', 'np.float32'], {}), "('../base/recognition/labels.txt', np.float32)\n", (209, 255), True, 'import numpy as np\n'), ((333, 399), 'numpy.loadtxt', 'np.loadtxt', (['"""../base/recognition/flattened_images.txt"""', 'np.float32'], {}), "(... |
#! /usr/bin/env python
"""Test the file name generation in terms of formatting.
Authors
-------
- <NAME>
Use
---
>>> pytest -s test_filename_generation.py
"""
import glob
import os
from astropy.table import Table
import numpy as np
import pytest
from mirage.yaml import generate_observationlist, yaml_gene... | [
"os.remove",
"astropy.table.Table",
"mirage.yaml.yaml_generator.SimInput",
"numpy.max",
"pytest.mark.skipif",
"os.path.join"
] | [((406, 530), 'pytest.mark.skipif', 'pytest.mark.skipif', (['ON_TRAVIS'], {'reason': '"""Cannot access mirage data in the central storage directory from Travis CI."""'}), "(ON_TRAVIS, reason=\n 'Cannot access mirage data in the central storage directory from Travis CI.'\n )\n", (424, 530), False, 'import pytest\n... |
from qcodes import MultiParameter
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
import lmfit
def lin_func(x, a, b):
return x*a + b
#TODO move to better location at later point
def get_phase_compentation_IQ_signal(param):
'''
Args:
param (Multiparameter) : parameter ... | [
"numpy.average",
"scipy.signal.filtfilt",
"projects.keysight_measurement.M3102A.SD_DIG",
"numpy.angle",
"numpy.empty",
"numpy.asarray",
"numpy.where",
"core_tools.utility.mk_digitizer_param.get_digitizer_param",
"numpy.exp",
"numpy.mean",
"numpy.intersect1d",
"scipy.signal.butter",
"numpy.un... | [((544, 565), 'lmfit.Model', 'lmfit.Model', (['lin_func'], {}), '(lin_func)\n', (555, 565), False, 'import lmfit\n'), ((748, 792), 'numpy.angle', 'np.angle', (["(1 + 1.0j * result.best_values['a'])"], {}), "(1 + 1.0j * result.best_values['a'])\n", (756, 792), True, 'import numpy as np\n'), ((9739, 9789), 'scipy.signal.... |
from types import MethodType
from typing import Union
import numpy as np
from beartype import beartype
from UQpy.distributions.baseclass import (
DistributionContinuous1D,
DistributionND,
DistributionDiscrete1D,
)
class JointIndependent(DistributionND):
@beartype
def __init__(
self,
... | [
"numpy.zeros",
"types.MethodType",
"numpy.ones"
] | [((3282, 3309), 'types.MethodType', 'MethodType', (['joint_cdf', 'self'], {}), '(joint_cdf, self)\n', (3292, 3309), False, 'from types import MethodType\n'), ((3810, 3837), 'types.MethodType', 'MethodType', (['joint_rvs', 'self'], {}), '(joint_rvs, self)\n', (3820, 3837), False, 'from types import MethodType\n'), ((467... |
from __future__ import absolute_import, division, print_function
from simdna.synthetic.core import DefaultNameMixin
from simdna.simdnautil import util, pwm
from collections import OrderedDict
import numpy as np
class AbstractLoadedMotifs(object):
"""Class representing loaded PWMs.
A class that contains instan... | [
"simdna.simdnautil.pwm.finalise",
"simdna.simdnautil.util.VariableWrapper",
"simdna.simdnautil.util.get_file_handle",
"simdna.simdnautil.pwm.PWM",
"simdna.simdnautil.util.perform_action_on_each_line_of_file",
"numpy.array",
"collections.OrderedDict"
] | [((1920, 1950), 'simdna.simdnautil.util.get_file_handle', 'util.get_file_handle', (['fileName'], {}), '(fileName)\n', (1940, 1950), False, 'from simdna.simdnautil import util, pwm\n'), ((2026, 2039), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2037, 2039), False, 'from collections import OrderedDict\n'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 22 13:16:21 2018
@author: thinkpad
"""
from envs.grid import GRID
from envs.wrapper import EnvWrapper
from collections import deque
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
import numpy as np
class test(obj... | [
"numpy.zeros",
"numpy.append",
"torch.cuda.is_available",
"numpy.array",
"envs.grid.GRID",
"collections.deque"
] | [((3023, 3039), 'collections.deque', 'deque', ([], {'maxlen': '(40)'}), '(maxlen=40)\n', (3028, 3039), False, 'from collections import deque\n'), ((3053, 3069), 'collections.deque', 'deque', ([], {'maxlen': '(40)'}), '(maxlen=40)\n', (3058, 3069), False, 'from collections import deque\n'), ((473, 523), 'envs.grid.GRID'... |
from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import multiprocessing
import threading
import six
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .. import backend as K
f... | [
"threading.Thread",
"numpy.random.seed",
"numpy.average",
"Queue.Queue",
"numpy.asarray",
"copy.copy",
"numpy.expand_dims",
"time.sleep",
"numpy.append",
"threading.Event",
"numpy.arange",
"multiprocessing.Queue",
"numpy.reshape",
"multiprocessing.Event",
"multiprocessing.Process",
"si... | [((11244, 11274), 'numpy.random.shuffle', 'np.random.shuffle', (['index_array'], {}), '(index_array)\n', (11261, 11274), True, 'import numpy as np\n'), ((11326, 11360), 'numpy.append', 'np.append', (['index_array', 'last_batch'], {}), '(index_array, last_batch)\n', (11335, 11360), True, 'import numpy as np\n'), ((16948... |
from pathlib import Path
import sys
import os
import numpy as np
root = Path(os.path.abspath(__file__)).parent
filename = "generated.gb"
file = root / filename
nintendo_logo = np.array([0xCE, 0xED, 0x66, 0x66, 0xCC, 0x0D, 0x00, 0x0B, 0x03, 0x73, 0x00, 0x83, 0x00, 0x0C, 0x00, 0x0D,
0x00, 0x08, 0x11, 0x1F, 0x88, 0x89,... | [
"numpy.zeros",
"os.path.abspath",
"numpy.array"
] | [((179, 431), 'numpy.array', 'np.array', (['[206, 237, 102, 102, 204, 13, 0, 11, 3, 115, 0, 131, 0, 12, 0, 13, 0, 8, 17,\n 31, 136, 137, 0, 14, 220, 204, 110, 230, 221, 221, 217, 153, 187, 187, \n 103, 99, 110, 14, 236, 204, 221, 220, 153, 159, 187, 185, 51, 62]'], {'dtype': 'np.uint8'}), '([206, 237, 102, 102, 2... |
import numpy as np
import functools
import sys
class DemographicModel:
'''Stores piecewise-exponential demographic models.'''
def __init__(self, filename=None):
# Number of epochs. Must equal the lengths of the following lists:
self.num_epochs = 0
# Epoch start times
self.times... | [
"sys.stdout.write",
"functools.partial",
"numpy.empty_like",
"numpy.exp",
"numpy.piecewise"
] | [((3380, 3403), 'sys.stdout.write', 'sys.stdout.write', (['flags'], {}), '(flags)\n', (3396, 3403), False, 'import sys\n'), ((3532, 3553), 'numpy.exp', 'np.exp', (['(-(T - t0) * r)'], {}), '(-(T - t0) * r)\n', (3538, 3553), True, 'import numpy as np\n'), ((2391, 2407), 'numpy.empty_like', 'np.empty_like', (['T'], {}), ... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.train.Coordinator",
"tensorflow.Variable",
"numpy.tile",
"tensorflow.contrib.training.python.training.sequence_queueing_state_saver._padding",
"os.path.join",
"tensorflow.test.main",
"tensorflow.train.start_queue_runners",
"tensorflow.test.get_temp_dir",
"tensorflow.equal",
"tensorflow... | [((11898, 11912), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (11910, 11912), True, 'import tensorflow as tf\n'), ((6095, 6185), 'numpy.tile', 'np.tile', (["self.sequences['seq1'][np.newaxis, 0:num_unroll, :]", '(self.batch_size, 1, 1)'], {}), "(self.sequences['seq1'][np.newaxis, 0:num_unroll, :], (self.\... |
#Windy grid world Environment-2
#Stochastic wind policy
#King's moves allowed
#Allowed actions-8 N,S,E,W,NW,SW,SE,NE
#importing modules
import numpy as np
import random
#Representing Windy-grid as a list with boundaries
#Using Programming assignment-2 grid world representation
grid=[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,... | [
"numpy.zeros",
"numpy.random.choice"
] | [((1847, 1875), 'numpy.zeros', 'np.zeros', (['(numS, numA, numS)'], {}), '((numS, numA, numS))\n', (1855, 1875), True, 'import numpy as np\n'), ((1887, 1915), 'numpy.zeros', 'np.zeros', (['(numS, numA, numS)'], {}), '((numS, numA, numS))\n', (1895, 1915), True, 'import numpy as np\n'), ((19498, 19542), 'numpy.random.ch... |
# Question 1 - Assignment 3 - due 07/12/2015
import math as m
from run_kut4 import *
from printSoln import *
import numpy as np
from pylab import *
# part a
# say T = theta, O = capital omega, w = lower case omega, B = beta, j = gamma
# d^2T/dt^2 = -(g/L)*sin(T)+C*cos(T)sin(Ot)
# = -w^2 * sin(T) + j*w*cos(T)sin(Bwt... | [
"math.sin",
"numpy.array",
"math.cos",
"math.sqrt"
] | [((468, 481), 'math.sqrt', 'm.sqrt', (['(g / L)'], {}), '(g / L)\n', (474, 481), True, 'import math as m\n'), ((660, 680), 'numpy.array', 'np.array', (['[0.0, 0.0]'], {}), '([0.0, 0.0])\n', (668, 680), True, 'import numpy as np\n'), ((526, 546), 'numpy.array', 'np.array', (['[0.0, 0.0]'], {}), '([0.0, 0.0])\n', (534, 5... |
from __future__ import division, print_function
from proximal.lin_ops import CompGraph, scale, vstack
from proximal.utils.timings_log import TimingsLog, TimingsEntry
from .invert import get_least_squares_inverse, get_diag_quads
import numpy as np
import numexpr as ne
def partition(prox_fns, try_diagonalize=True):
... | [
"proximal.lin_ops.scale",
"proximal.lin_ops.CompGraph",
"proximal.lin_ops.vstack",
"numpy.zeros",
"numexpr.evaluate",
"numpy.hstack",
"proximal.utils.timings_log.TimingsLog",
"numpy.linalg.norm",
"proximal.utils.timings_log.TimingsEntry",
"numpy.reshape",
"numpy.sqrt"
] | [((1403, 1440), 'proximal.lin_ops.vstack', 'vstack', (['[fn.lin_op for fn in psi_fns]'], {}), '([fn.lin_op for fn in psi_fns])\n', (1409, 1440), False, 'from proximal.lin_ops import CompGraph, scale, vstack\n'), ((1449, 1471), 'proximal.lin_ops.CompGraph', 'CompGraph', (['stacked_ops'], {}), '(stacked_ops)\n', (1458, 1... |
""" Like logistic_regression_tf_full.py but the subgraph for performing a step of the
gradient descent optimizer is added using a tensorflow function.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from load_mnist import load... | [
"tensorflow.log",
"tensorflow.argmax",
"tensorflow.global_variables_initializer",
"numpy.insert",
"tensorflow.train.GradientDescentOptimizer",
"numpy.apply_along_axis",
"tensorflow.placeholder",
"tensorflow.matmul",
"tensorflow.cast",
"tensorflow.zeros",
"numpy.random.permutation",
"tensorflow... | [((631, 668), 'numpy.apply_along_axis', 'np.apply_along_axis', (['helper_fun', '(1)', 'x'], {}), '(helper_fun, 1, x)\n', (650, 668), True, 'import numpy as np\n'), ((1799, 1825), 'load_mnist.load_mnist', 'load_mnist', (['"""mnist.pkl.gz"""'], {}), "('mnist.pkl.gz')\n", (1809, 1825), False, 'from load_mnist import load_... |
import matplotlib.pyplot as plt
import matplotlib.animation as ani
import numpy as np
GREY = (0.78, 0.78, 0.78) # uninfected
RED = (0.96, 0.15, 0.15) # infected
GREEN = (0, 0.86, 0.03) # recovered
BLACK = (0, 0, 0) # dead
COVID19_PARAMS = {
"r0": 2.28,
"incubation": 5,
"percent_mild": 0.8,
"mild_r... | [
"matplotlib.pyplot.show",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.arange",
"numpy.random.choice",
"numpy.sqrt"
] | [((9675, 9685), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (9683, 9685), True, 'import matplotlib.pyplot as plt\n'), ((573, 585), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (583, 585), True, 'import matplotlib.pyplot as plt\n'), ((3011, 3040), 'numpy.sqrt', 'np.sqrt', (['(indices / populat... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2018 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | [
"pyannote.generators.fragment.random_segment",
"pyannote.generators.fragment.random_subsegment",
"numpy.sum",
"pyannote.database.get_unique_identifier",
"pyannote.metrics.binary_classification.det_curve",
"collections.deque",
"pyannote.database.get_label_identifier",
"numpy.random.shuffle",
"torch.m... | [((6399, 6454), 'numpy.array', 'np.array', (["[self.data_[uri]['duration'] for uri in uris]"], {}), "([self.data_[uri]['duration'] for uri in uris])\n", (6407, 6454), True, 'import numpy as np\n'), ((7491, 7546), 'numpy.array', 'np.array', (["[self.data_[uri]['duration'] for uri in uris]"], {}), "([self.data_[uri]['dur... |
import argparse
import pickle
import os
import sys
from pdb import set_trace as bp
import numpy as np
import torch
#import gym
import my_pybullet_envs
import pybullet as p
import time
from a2c_ppo_acktr.envs import VecPyTorch, make_vec_envs
from a2c_ppo_acktr.utils import get_render_func, get_vec_normalize
import inspe... | [
"pybullet.resetSimulation",
"argparse.ArgumentParser",
"pybullet.connect",
"torch.no_grad",
"os.path.join",
"sys.path.append",
"pybullet.getQuaternionFromEuler",
"pybullet.setGravity",
"torch.load",
"pybullet.setTimeStep",
"pybullet.multiplyTransforms",
"torch.zeros",
"pybullet.changeDynamic... | [((633, 656), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (651, 656), False, 'import os\n'), ((1199, 1231), 'sys.path.append', 'sys.path.append', (['"""a2c_ppo_acktr"""'], {}), "('a2c_ppo_acktr')\n", (1214, 1231), False, 'import sys\n'), ((1241, 1282), 'argparse.ArgumentParser', 'argparse.... |
# Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
"netket.jax.PRNGSeq",
"numpy.asarray",
"numpy.random.rand",
"pytest.mark.parametrize",
"netket.jax.PRNGKey",
"netket.utils.HashableArray"
] | [((1135, 1178), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""numpy"""', '[np, jnp]'], {}), "('numpy', [np, jnp])\n", (1158, 1178), False, 'import pytest\n'), ((867, 878), 'netket.jax.PRNGKey', 'PRNGKey', (['(44)'], {}), '(44)\n', (874, 878), False, 'from netket.jax import PRNGKey, PRNGSeq\n'), ((889, 898... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 15:25:12 2020
@author: wantysal
"""
import sys
sys.path.append('..')
# Standard library import
import numpy as np
# import SciDataTool objects
from SciDataTool import Data1D, DataTime, DataFreq, DataLinspace
# import Mosqito functions
from mosqito.functions.shared.l... | [
"sys.path.append",
"mosqito.functions.sharpness.sharpness_fastl.comp_sharpness_fastl",
"SciDataTool.DataFreq",
"mosqito.functions.shared.cut.cut_signal",
"SciDataTool.DataTime",
"mosqito.functions.oct3filter.calc_third_octave_levels.calc_third_octave_levels",
"numpy.abs",
"mosqito.functions.sharpness.... | [((98, 119), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (113, 119), False, 'import sys\n'), ((2989, 3046), 'mosqito.functions.shared.load.load', 'load', (['self.is_stationary', 'file', 'calib', 'mat_signal', 'mat_fs'], {}), '(self.is_stationary, file, calib, mat_signal, mat_fs)\n', (2993, 304... |
# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
# www.apache.org/licenses/LICE... | [
"numpy.log2"
] | [((2222, 2238), 'numpy.log2', 'np.log2', (['macs_cc'], {}), '(macs_cc)\n', (2229, 2238), True, 'import numpy as np\n')] |
"""
SynthTIGER
Copyright (c) 2021-present NAVER Corp.
MIT license
"""
import argparse
import os
import pprint
import time
import traceback
from concurrent.futures import ProcessPoolExecutor, as_completed
import numpy as np
import scipy.cluster
from PIL import Image
def search_files(root, names=None, exts=None):
... | [
"argparse.ArgumentParser",
"numpy.std",
"concurrent.futures.ProcessPoolExecutor",
"os.path.dirname",
"os.walk",
"time.time",
"PIL.Image.open",
"numpy.array",
"os.path.splitext",
"traceback.format_exc",
"os.path.join",
"concurrent.futures.as_completed"
] | [((368, 381), 'os.walk', 'os.walk', (['root'], {}), '(root)\n', (375, 381), False, 'import os\n'), ((1840, 1884), 'concurrent.futures.ProcessPoolExecutor', 'ProcessPoolExecutor', ([], {'max_workers': 'args.worker'}), '(max_workers=args.worker)\n', (1859, 1884), False, 'from concurrent.futures import ProcessPoolExecutor... |
from pathlib import Path
from typing import Optional, Tuple
import numpy as np
import pandas as pd
from tqdm import tqdm
from matplotlib import pyplot as pl
from sklearn.linear_model import LinearRegression
from recodiv.model import rank_to_weight
from recodiv.triversity.graph import IndividualHerfindahlDiversities
... | [
"numpy.quantile",
"sklearn.linear_model.LinearRegression",
"pathlib.Path",
"numpy.mean",
"recodiv.model.rank_to_weight",
"recodiv.triversity.graph.IndividualHerfindahlDiversities",
"matplotlib.pyplot.subplots"
] | [((485, 543), 'pathlib.Path', 'Path', (['"""data/million_songs_dataset/extra/unique_tracks.txt"""'], {}), "('data/million_songs_dataset/extra/unique_tracks.txt')\n", (489, 543), False, 'from pathlib import Path\n'), ((6124, 6173), 'numpy.quantile', 'np.quantile', (['values', '[min_quantile, max_quantile]'], {}), '(valu... |
import numpy
from chainer.backends import cuda
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
class ELU(function_node.FunctionNode):
"""Exponential Linear Unit."""
def __init__(self, alpha=1.0):
self.alpha = float(alpha)
def check_type_forward(... | [
"numpy.expm1",
"chainer.utils.type_check.expect",
"chainer.utils.type_check._argname",
"chainer.backends.cuda.elementwise"
] | [((345, 382), 'chainer.utils.type_check._argname', 'type_check._argname', (['in_types', "('x',)"], {}), "(in_types, ('x',))\n", (364, 382), False, 'from chainer.utils import type_check\n'), ((419, 462), 'chainer.utils.type_check.expect', 'type_check.expect', (["(x_type.dtype.kind == 'f')"], {}), "(x_type.dtype.kind == ... |
from __future__ import division, absolute_import, print_function
__copyright__ = "Copyright (C) 2017 - 2018 <NAME>"
__doc__ = """
.. autoclass:: NearFieldInteractionTableManager
:members:
"""
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associ... | [
"sumpy.kernel.FactorizedBiharmonicKernel",
"h5py.File",
"volumential.nearfield_potential_table.get_laplace",
"volumential.nearfield_potential_table.NearFieldInteractionTable",
"sumpy.kernel.YukawaKernel",
"sumpy.kernel.LaplaceKernel",
"volumential.nearfield_potential_table.sumpy_kernel_to_lambda",
"nu... | [((1411, 1438), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1428, 1438), False, 'import logging\n'), ((13133, 13170), 'numpy.array', 'np.array', (['table.interaction_case_vecs'], {}), '(table.interaction_case_vecs)\n', (13141, 13170), True, 'import numpy as np\n'), ((19091, 19111), 'n... |
# -*- coding: utf-8 -*-
"""
Basically the same as 'reflectivity_method.py', but using Levin integration.
See <NAME>, ''Fast integration of rapidly oscillatory functions'', Journal of Computational and
Applied Mathematics (1996).
"""
import time
import numpy as np
import matplotlib.pyplot as plt
from scipy.special im... | [
"matplotlib.pyplot.title",
"numpy.abs",
"numpy.sum",
"numpy.argmax",
"numpy.ones",
"test_configure.TestrunConfig",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.exp",
"matplotlib.pyplot.gca",
"reflectivity_method.computeRminus",
"numpy.zeros_like",
"reflectivity_method.Q_slowness",
"u... | [((1365, 1406), 'numpy.zeros', 'np.zeros', (['(nF, nRec)'], {'dtype': 'np.complex128'}), '((nF, nRec), dtype=np.complex128)\n', (1373, 1406), True, 'import numpy as np\n'), ((1417, 1435), 'numpy.zeros_like', 'np.zeros_like', (['u_z'], {}), '(u_z)\n', (1430, 1435), True, 'import numpy as np\n'), ((2013, 2057), 'numpy.ze... |
import argparse
from PIL import Image
import numpy as np; np.random.seed(123)
import gym
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten, Convolution2D
from keras.optimizers import Adam
from rl.agents.dqn import DQNAgent
from rl.policy import LinearAnnealedPolicy, BoltzmannQPo... | [
"rl.callbacks.FileLogger",
"rl.memory.SequentialMemory",
"rl.agents.dqn.DQNAgent",
"numpy.random.seed",
"gym.make",
"argparse.ArgumentParser",
"keras.layers.Convolution2D",
"keras.layers.Activation",
"rl.policy.EpsGreedyQPolicy",
"keras.layers.Flatten",
"keras.optimizers.Adam",
"rl.callbacks.M... | [((59, 78), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (73, 78), True, 'import numpy as np\n'), ((1395, 1420), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1418, 1420), False, 'import argparse\n'), ((1710, 1733), 'gym.make', 'gym.make', (['args.env_name'], {}), '(args... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 18 14:53:04 2017
@author: crius
"""
import numpy as np
import scipy as sp
from TensorOps import spinops as so
import time
#create heisenberg hamilitonian with periodic/non-periodic boundary conditions
#and nearest neighbor and next nearest neighbor interactions
def H(N,S... | [
"TensorOps.spinops.sy",
"TensorOps.spinops.sz",
"scipy.sparse.identity",
"scipy.sparse.csr_matrix",
"TensorOps.spinops.sx",
"numpy.cos"
] | [((956, 964), 'TensorOps.spinops.sx', 'so.sx', (['S'], {}), '(S)\n', (961, 964), True, 'from TensorOps import spinops as so\n'), ((974, 982), 'TensorOps.spinops.sy', 'so.sy', (['S'], {}), '(S)\n', (979, 982), True, 'from TensorOps import spinops as so\n'), ((992, 1000), 'TensorOps.spinops.sz', 'so.sz', (['S'], {}), '(S... |
SEED=666
import torch
torch.manual_seed(SEED)
import random
random.seed(SEED)
import numpy as np
np.random.seed(SEED)
import platalea.analysis.phoneme as P
config = dict(directory = '../../../data/out/vgs/',
size = 793964 // 2,
layers=['conv'] + [ 'rnn{}'.format(i) for i in range(4) ],
... | [
"numpy.random.seed",
"torch.manual_seed",
"platalea.analysis.phoneme.local_rsa_plot",
"platalea.analysis.phoneme.local_rsa",
"random.seed"
] | [((22, 45), 'torch.manual_seed', 'torch.manual_seed', (['SEED'], {}), '(SEED)\n', (39, 45), False, 'import torch\n'), ((60, 77), 'random.seed', 'random.seed', (['SEED'], {}), '(SEED)\n', (71, 77), False, 'import random\n'), ((97, 117), 'numpy.random.seed', 'np.random.seed', (['SEED'], {}), '(SEED)\n', (111, 117), True,... |
'''
psl2wiggle.py - convert from psl to wiggle
==========================================
:Tags: Python
Purpose
-------
This script converts from a :term:`psl` formatted
file to a :term:`wiggle` formatted file by stacking
alignments on the target on top of each other.
This script uses the UCSC tools for bigwig/big... | [
"CGAT.Experiment.debug",
"os.path.abspath",
"CGAT.Experiment.Stop",
"CGAT.Experiment.Start",
"numpy.zeros",
"CGAT.IndexedFasta.IndexedFasta",
"CGAT.IOTools.openFile",
"CGAT.Experiment.info",
"tempfile.mkdtemp",
"CGAT.Blat.BlatIterator",
"shutil.rmtree",
"CGAT.IOTools.which",
"os.path.join"
] | [((1687, 1725), 'CGAT.Experiment.Start', 'E.Start', (['parser'], {'add_pipe_options': '(True)'}), '(parser, add_pipe_options=True)\n', (1694, 1725), True, 'import CGAT.Experiment as E\n'), ((3733, 3761), 'CGAT.Blat.BlatIterator', 'Blat.BlatIterator', (['sys.stdin'], {}), '(sys.stdin)\n', (3750, 3761), True, 'import CGA... |
import os
import logging
import pickle
import json
import numpy
from sklearn.externals import joblib
from sklearn.linear_model import Ridge
def init():
global model
# AZUREML_MODEL_DIR is an environment variable created during deployment.
# It is the path to the model folder (./azureml-models/$MODEL_NAME/... | [
"json.loads",
"logging.info",
"numpy.array",
"sklearn.externals.joblib.load",
"os.getenv"
] | [((610, 633), 'sklearn.externals.joblib.load', 'joblib.load', (['model_path'], {}), '(model_path)\n', (621, 633), False, 'from sklearn.externals import joblib\n'), ((638, 667), 'logging.info', 'logging.info', (['"""Init complete"""'], {}), "('Init complete')\n", (650, 667), False, 'import logging\n'), ((470, 500), 'os.... |
import os
import sys
import io
import time
import zipfile
import pydicom
import numpy as np
import scipy.interpolate
import numba_interpolate
import skimage.measure
import nrrd
c_out_pixel_spacing = np.array((2.23214293, 2.23214293, 3.))
c_resample_tolerance = 0.01 # Only interpolate voxels further off of the v... | [
"io.BytesIO",
"zipfile.ZipFile",
"numpy.flip",
"numpy.abs",
"numpy.zeros",
"os.path.exists",
"numpy.hstack",
"numpy.where",
"numpy.array",
"numpy.swapaxes",
"numpy.eye",
"numpy.unique"
] | [((207, 246), 'numpy.array', 'np.array', (['(2.23214293, 2.23214293, 3.0)'], {}), '((2.23214293, 2.23214293, 3.0))\n', (215, 246), True, 'import numpy as np\n'), ((7324, 7347), 'numpy.unique', 'np.unique', (['slice_series'], {}), '(slice_series)\n', (7333, 7347), True, 'import numpy as np\n'), ((9719, 9740), 'numpy.zer... |
import numpy as np
from modeler.rcnnmodel import RCNNModel
from trainer.tftrainer import TFTrainer
class RCNNTrainer(TFTrainer):
def __init__(self):
self.num_classes = 10
self.learning_rate = 0.01
self.batch_size = 8
self.decay_steps = 1000
self.decay_rate = 0.9
se... | [
"numpy.array",
"numpy.zeros",
"modeler.rcnnmodel.RCNNModel"
] | [((585, 767), 'modeler.rcnnmodel.RCNNModel', 'RCNNModel', (['self.num_classes', 'self.learning_rate', 'self.decay_steps', 'self.decay_rate', 'self.sequence_length', 'self.vocab_size', 'self.embed_size', 'self.is_training', 'self.batch_size'], {}), '(self.num_classes, self.learning_rate, self.decay_steps, self.\n dec... |
# Author: <NAME>
# License: BSD-2-Clause
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import check_random_state, check_array
from sklearn.utils.validation import check_is_fitted
from ..kernels import safe_power
from math import sqrt
from scipy.sparse import issparse
fr... | [
"sklearn.utils.check_random_state",
"math.sqrt",
"sklearn.utils.check_array",
"scipy.sparse.issparse",
"numpy.zeros",
"sklearn.utils.validation.check_is_fitted"
] | [((2205, 2242), 'sklearn.utils.check_random_state', 'check_random_state', (['self.random_state'], {}), '(self.random_state)\n', (2223, 2242), False, 'from sklearn.utils import check_random_state, check_array\n'), ((2255, 2289), 'sklearn.utils.check_array', 'check_array', (['X'], {'accept_sparse': '(True)'}), '(X, accep... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"paddle.fluid.is_compiled_with_cuda",
"paddle.fluid.regularizer.L2DecayRegularizer",
"numpy.allclose",
"paddle.fluid.dygraph.GRUUnit",
"paddle.fluid.load_dygraph",
"paddle.fluid.layers.mean",
"unittest.main",
"paddle.fluid.layers.concat",
"paddle.fluid.Executor",
"paddle.fluid.dygraph.ProgramTrans... | [((994, 1013), 'paddle.fluid.dygraph.ProgramTranslator', 'ProgramTranslator', ([], {}), '()\n', (1011, 1013), False, 'from paddle.fluid.dygraph import declarative, ProgramTranslator\n'), ((14185, 14212), 'numpy.random.RandomState', 'np.random.RandomState', (['SEED'], {}), '(SEED)\n', (14206, 14212), True, 'import numpy... |
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import random
from tqdm import tqdm
from inspect import signature
import sys
PRINT_WIDTH = 20
class Particle:
"""
Class to represent a particle of the particle swarm optimization (PSO)
algorithm. Each pa... | [
"numpy.around",
"matplotlib.pyplot.figure",
"numpy.round",
"matplotlib.pyplot.close",
"random.seed",
"inspect.signature",
"numpy.linspace",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"random.random",
"matplotlib.pyplot.ylabel"... | [((1653, 1670), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1664, 1670), False, 'import random\n'), ((12019, 12037), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {}), '(1, 1)\n', (12031, 12037), True, 'import matplotlib.pyplot as plt\n'), ((12067, 12091), 'matplotlib.pyplot.xlim', 'plt.... |
import os
import unittest
import numpy as np
from baseclasses import BaseRegTest
import commonUtils
from pygeo import DVGeometry, geo_utils
class RegTestPyGeo(unittest.TestCase):
N_PROCS = 1
def setUp(self):
# Store the path where this current script lives
# This all paths in the script are ... | [
"unittest.main",
"baseclasses.BaseRegTest",
"os.remove",
"os.path.abspath",
"numpy.random.seed",
"numpy.eye",
"pygeo.DVGeometry",
"numpy.zeros",
"commonUtils.totalSensitivityCS",
"commonUtils.totalSensitivityFD",
"numpy.random.random",
"numpy.array",
"numpy.testing.assert_allclose",
"pygeo... | [((11469, 11484), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11482, 11484), False, 'import unittest\n'), ((688, 901), 'numpy.array', 'np.array', (['[[[[x0, y0, z0], [x0 + dx, y0, z0]], [[x0, y0 + dy, z0], [x0 + dx, y0 + dy,\n z0]]], [[[x0, y0, z0 + dz], [x0 + dx, y0, z0 + dz]], [[x0, y0 + dy, z0 +\n dz]... |
import matplotlib.pyplot as plt
from mlxtend.plotting import plot_decision_regions
import numpy as np
import random
import statistics
"""
Predict object needed by the plot_decision_regions function of the mlxtend.plotting library
weight: The learned weight vector generalized for learning points
order:... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"statistics.stdev",
"matplotlib.pyplot.legend",
"numpy.transpose",
"matplotlib.pyplot.ylabel",
"numpy.linalg.inv",
"numpy.array",
"statistics.mean",
"numpy.arange",
"numpy.dot",
"matplo... | [((4125, 4139), 'numpy.array', 'np.array', (['phiX'], {}), '(phiX)\n', (4133, 4139), True, 'import numpy as np\n'), ((4552, 4567), 'numpy.transpose', 'np.transpose', (['Z'], {}), '(Z)\n', (4564, 4567), True, 'import numpy as np\n'), ((4587, 4608), 'numpy.dot', 'np.dot', (['transposeZ', 'Z'], {}), '(transposeZ, Z)\n', (... |
import numpy as np
lineage_colors_dict = {
"A": "#987200",
"A.1": "#987284",
"A.3": "#9872ff",
"B.1": "#385639",
"B.1.1": "#2855d1",
"B.1.1.1": "#dae7da",
"B.1.3": "#d13328",
"B.1.5": "#eac43f",
"B.1.26": "#eac435",
"B.2": "#f9b5ac",
"B.2.1": "#ee7674",
}
lineage_colors_dic... | [
"numpy.array"
] | [((341, 366), 'numpy.array', 'np.array', (['[152, 114, 132]'], {}), '([152, 114, 132])\n', (349, 366), True, 'import numpy as np\n'), ((377, 399), 'numpy.array', 'np.array', (['[56, 86, 57]'], {}), '([56, 86, 57])\n', (385, 399), True, 'import numpy as np\n'), ((412, 435), 'numpy.array', 'np.array', (['[40, 85, 209]'],... |
"""Command-line interface and corresponding API for CNVkit."""
# NB: argparse CLI definitions and API functions are interwoven:
# "_cmd_*" handles I/O and arguments processing for the command
# "do_*" runs the command's functionality as an API
from __future__ import absolute_import, division, print_function
import... | [
"matplotlib.pyplot.subplot",
"logging.warning",
"skgenome.rangelabel.unpack_range",
"numpy.median",
"logging.info",
"matplotlib.pyplot.GridSpec",
"matplotlib.pyplot.subplots"
] | [((11257, 11281), 'skgenome.rangelabel.unpack_range', 'unpack_range', (['show_range'], {}), '(show_range)\n', (11269, 11281), False, 'from skgenome.rangelabel import unpack_range\n'), ((2355, 2389), 'matplotlib.pyplot.GridSpec', 'pyplot.GridSpec', (['(5)', '(1)'], {'hspace': '(0.85)'}), '(5, 1, hspace=0.85)\n', (2370, ... |
#!/usr/bin/env python3
"""
@author: <NAME>
@email: <EMAIL>
* FORCE MODULE *
Contains force calculations (and potential energies) using known potentials:
- Gravitational
- Lennard-Jones
Latest update: May 21th 2021
"""
import numpy as np
import system
import matplotlib.pyplot as plt
from numba import jit, nji... | [
"numpy.power",
"numpy.asarray",
"numpy.cumsum",
"numpy.histogram",
"numpy.linspace",
"numpy.sign",
"numpy.sqrt"
] | [((2394, 2438), 'numpy.linspace', 'np.linspace', (['(0.0)', 'system.L[axis]'], {'num': 'n_bins'}), '(0.0, system.L[axis], num=n_bins)\n', (2405, 2438), True, 'import numpy as np\n'), ((2927, 2961), 'numpy.linspace', 'np.linspace', (['(0.0)', 'max_dist', 'n_bins'], {}), '(0.0, max_dist, n_bins)\n', (2938, 2961), True, '... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | [
"numpy.fromfile",
"mvpa2.datasets.Dataset.from_channeltimeseries",
"mvpa2.misc.io.DataReader.__init__"
] | [((1925, 2045), 'mvpa2.datasets.Dataset.from_channeltimeseries', 'Dataset.from_channeltimeseries', (['eb.data'], {'targets': 'targets', 'chunks': 'chunks', 't0': 'eb.t0', 'dt': 'eb.dt', 'channelids': 'eb.channels'}), '(eb.data, targets=targets, chunks=chunks, t0=\n eb.t0, dt=eb.dt, channelids=eb.channels)\n', (1955,... |
#!usr/bin/env python
"""Tune and evaluate TGAN models."""
import json
import os
import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.model_selection import train_test_split
from tensorpack.utils import logger
from tgan.model import TUNABLE_VARIABLES, TGANModel
from tgan.research.evaluation imp... | [
"json.dump",
"os.mkdir",
"json.load",
"tgan.model.TGANModel",
"os.path.isdir",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"tensorflow.reset_default_graph",
"tgan.research.evaluation.evaluate_classification",
"tgan.model.TUNABLE_VARIABLES.items",
"numpy.random.choice",
"os.r... | [((2687, 2706), 'os.path.isdir', 'os.path.isdir', (['name'], {}), '(name)\n', (2700, 2706), False, 'import os\n'), ((3073, 3106), 'pandas.read_csv', 'pd.read_csv', (['train_csv'], {'header': '(-1)'}), '(train_csv, header=-1)\n', (3084, 3106), True, 'import pandas as pd\n'), ((3135, 3173), 'sklearn.model_selection.train... |
from __future__ import division
import re
import numpy as np
import networkx as nx
from biom.table import Table
from datetime import datetime
from collections import OrderedDict
from numpy.random import multivariate_normal
from statsmodels.sandbox.stats.multicomp import multipletests
__author__ = 'shafferm'
"""fu... | [
"re.split",
"numpy.abs",
"biom.table.Table",
"statsmodels.sandbox.stats.multicomp.multipletests",
"numpy.square",
"numpy.transpose",
"datetime.datetime.now",
"networkx.Graph",
"numpy.array",
"numpy.random.multivariate_normal",
"numpy.round"
] | [((883, 920), 'statsmodels.sandbox.stats.multicomp.multipletests', 'multipletests', (['pvalues'], {'method': 'method'}), '(pvalues, method=method)\n', (896, 920), False, 'from statsmodels.sandbox.stats.multicomp import multipletests\n'), ((932, 961), 'numpy.array', 'np.array', (['res[1]'], {'dtype': 'float'}), '(res[1]... |
# -*- coding: utf-8 -*-
"""
rbf - Radial basis functions for interpolation/smoothing scattered Nd data.
Modified by <NAME>,
from the code written by <NAME>, and modified by <NAME> and
<NAME>.
The modifications are based on the interpolation method described by Rendall
and Allen on https://doi.org/10.1002/nme.2219
NO... | [
"numpy.log",
"scipy._lib.six.callable",
"numpy.asarray",
"numpy.transpose",
"numpy.all",
"numpy.ones",
"scipy.linalg.inv",
"new.instancemethod",
"numpy.exp",
"scipy._lib.six.get_function_code",
"scipy._lib.six.get_method_function",
"numpy.vstack",
"numpy.sqrt"
] | [((3054, 3093), 'numpy.sqrt', 'sqrt', (['((1.0 / self.epsilon * r) ** 2 + 1)'], {}), '((1.0 / self.epsilon * r) ** 2 + 1)\n', (3058, 3093), False, 'from numpy import sqrt, log, asarray, newaxis, all, dot, exp, eye, float_, vstack, hstack, ones, transpose, zeros\n'), ((3230, 3265), 'numpy.exp', 'exp', (['(-(1.0 / self.e... |
import os
import pytest
import numpy as np
import repack.utils as u
ROOT = os.path.realpath(os.path.dirname(__file__) + '/..') + '/'
os.chdir(ROOT+'tests')
@pytest.mark.parametrize('zip', ['', '.bz2'])
def test_parse_file_exomol(zip):
tfile = '1H2-16O__POKAZATEL__00400-00500.trans' + zip
info = u.parse_fil... | [
"repack.utils.get_exomol_mol",
"repack.utils.read_lbl",
"os.path.dirname",
"repack.utils.parse_file",
"numpy.testing.assert_approx_equal",
"repack.utils.read_pf",
"numpy.shape",
"numpy.array",
"numpy.linspace",
"pytest.mark.parametrize",
"os.chdir",
"numpy.unique"
] | [((136, 160), 'os.chdir', 'os.chdir', (["(ROOT + 'tests')"], {}), "(ROOT + 'tests')\n", (144, 160), False, 'import os\n'), ((162, 206), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""zip"""', "['', '.bz2']"], {}), "('zip', ['', '.bz2'])\n", (185, 206), False, 'import pytest\n'), ((2144, 2545), 'pytest.mark... |
"""Test quadrupole calculation."""
import shutil
from pathlib import Path
import numpy as np
from assertionlib import assertion
from qmflows.parsers import readXYZ
from nanoqm.integrals.multipole_matrices import compute_matrix_multipole
from nanoqm.workflows.input_validation import process_input
from .utilsTest imp... | [
"nanoqm.workflows.input_validation.process_input",
"numpy.allclose",
"assertionlib.assertion.shape_eq",
"pathlib.Path",
"nanoqm.integrals.multipole_matrices.compute_matrix_multipole",
"shutil.copyfile"
] | [((487, 528), 'nanoqm.workflows.input_validation.process_input', 'process_input', (['file_path', '"""single_points"""'], {}), "(file_path, 'single_points')\n", (500, 528), False, 'from nanoqm.workflows.input_validation import process_input\n'), ((698, 749), 'shutil.copyfile', 'shutil.copyfile', (['path_original_hdf5', ... |
import numpy as np
from properties_ecuations import Thermodynamic_correlations
class Correlations(object):
"""docstring for Correlations"""
def __init__(self, constantes, T, Tc):
self.A = constantes[0]
self.B = constantes[1]
self.C = constantes[2]
self.D = constantes[3]
self.E = constantes[4]
self.T ... | [
"numpy.log",
"numpy.array",
"numpy.exp",
"numpy.cosh",
"numpy.sinh"
] | [((3855, 3880), 'numpy.array', 'np.array', (['[A, B, C, D, E]'], {}), '([A, B, C, D, E])\n', (3863, 3880), True, 'import numpy as np\n'), ((928, 947), 'numpy.exp', 'np.exp', (['(VAR1 + VAR2)'], {}), '(VAR1 + VAR2)\n', (934, 947), True, 'import numpy as np\n'), ((865, 879), 'numpy.log', 'np.log', (['self.T'], {}), '(sel... |
import argparse
import tensorflow as tf
import numpy as np
from tfbldr.datasets import fetch_mnist
from collections import namedtuple
import sys
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from tfbldr.datasets import fetch_norvig_words
from tfbldr.datasets import list_iterator
parser = ar... | [
"argparse.ArgumentParser",
"tensorflow.train.import_meta_graph",
"tensorflow.get_collection",
"numpy.argmax",
"tensorflow.Session",
"numpy.zeros",
"numpy.random.RandomState",
"tensorflow.ConfigProto",
"tfbldr.datasets.list_iterator",
"matplotlib.use",
"collections.namedtuple",
"tfbldr.datasets... | [((163, 184), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (177, 184), False, 'import matplotlib\n'), ((318, 343), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (341, 343), False, 'import argparse\n'), ((876, 908), 'numpy.random.RandomState', 'np.random.RandomState', (... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from objetos import Poligono, Retangulo, Piramide, TroncoPiramide
from copy import copy
__author__ = "<NAME>/<NAME>"
def translacao_de_matrizes(vertices, matriz):
"""
Realiza translacao de matrizes 3x3 c... | [
"objetos.TroncoPiramide.from_arestas",
"matplotlib.pyplot.show",
"numpy.subtract",
"objetos.Retangulo.from_arestas",
"matplotlib.pyplot.plot",
"copy.copy",
"matplotlib.pyplot.ylabel",
"numpy.cross",
"mpl_toolkits.mplot3d.art3d.Poly3DCollection",
"matplotlib.pyplot.figure",
"numpy.array",
"obje... | [((351, 365), 'copy.copy', 'copy', (['vertices'], {}), '(vertices)\n', (355, 365), False, 'from copy import copy\n'), ((451, 476), 'numpy.dot', 'np.dot', (['m_entrada', 'matriz'], {}), '(m_entrada, matriz)\n', (457, 476), True, 'import numpy as np\n'), ((493, 524), 'numpy.delete', 'np.delete', (['m_entrada', '(3)'], {'... |
from datetime import datetime
from typing import Any, Dict, List, Optional
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from pytz import utc
from feast import utils
from feast.errors import (
FeatureNameCollisionError,
RequestDataNotFoundInEntityDfExceptio... | [
"pandas.DataFrame",
"tests.integration.feature_repos.universal.entities.customer",
"pandas.testing.assert_frame_equal",
"numpy.random.seed",
"feast.feature_service.FeatureService",
"tests.integration.feature_repos.universal.entities.location",
"tests.integration.feature_repos.repo_configuration.table_na... | [((764, 781), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (778, 781), True, 'import numpy as np\n'), ((6859, 6884), 'pandas.DataFrame', 'pd.DataFrame', (['entity_rows'], {}), '(entity_rows)\n', (6871, 6884), True, 'import pandas as pd\n'), ((8554, 8601), 'tests.integration.feature_repos.repo_configur... |
import sys
import numpy as np
from collections import Counter
from cuteSV.cuteSV_genotype import cal_GL, cal_CIPOS, threshold_ref_count, count_coverage
import time
'''
*******************************************
TO DO LIST
*******************************************
1. Identify DP with samfile pointer;
2. Add CI... | [
"numpy.std",
"pysam.AlignmentFile",
"numpy.min",
"numpy.mean",
"cuteSV.cuteSV_genotype.count_coverage"
] | [((11579, 11608), 'pysam.AlignmentFile', 'pysam.AlignmentFile', (['bam_path'], {}), '(bam_path)\n', (11598, 11608), False, 'import pysam\n'), ((11832, 11921), 'cuteSV.cuteSV_genotype.count_coverage', 'count_coverage', (['chr', 'search_start', 'search_end', 'bamfile', 'querydata', 'up_bound', 'gt_round'], {}), '(chr, se... |
# Copyright 2019 The Blueqat Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"math.sqrt",
"numba.njit",
"numpy.zeros",
"math.sin",
"random.random",
"numpy.array",
"math.cos",
"cmath.exp",
"collections.Counter",
"numpy.copyto",
"warnings.warn"
] | [((3013, 3076), 'numba.njit', 'njit', ([], {'locals': "{'lower_mask': _QSMask}", 'nogil': '(True)', 'parallel': '(True)'}), "(locals={'lower_mask': _QSMask}, nogil=True, parallel=True)\n", (3017, 3076), False, 'from numba import jit, njit, prange\n'), ((3265, 3328), 'numba.njit', 'njit', ([], {'locals': "{'lower_mask':... |
import os
import h5py
import librosa
import itertools
from copy import copy
import numpy as np
#import matplotlib.pyplot as plt
from collections import OrderedDict
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
import joblib
import tensorflow as tf
from tensorflow.ker... | [
"numpy.random.seed",
"tensorflow.keras.layers.MaxPooling2D",
"numpy.argmax",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"os.walk",
"numpy.random.randint",
"librosa.feature.melspectrogram",
"numpy.unique",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.reg... | [((1144, 1162), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1158, 1162), True, 'import numpy as np\n'), ((6834, 6967), 'tensorflow.keras.callbacks.ReduceLROnPlateau', 'ReduceLROnPlateau', ([], {'monitor': '"""val_loss"""', 'factor': '(0.95)', 'patience': '(3)', 'verbose': '(1)', 'mode': '"""min"""... |
# Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"numpy.random.uniform",
"tensorflow.convert_to_tensor",
"numpy.floor",
"tensorflow.reshape",
"numpy.zeros",
"tensorflow_graphics.geometry.transformation.rotation_matrix_3d.from_euler",
"absl.testing.parameterized.parameters",
"tensorflow.transpose",
"tensorflow_graphics.geometry.representation.grid.... | [((1971, 1995), 'numpy.array', 'np.array', (['(np.pi / 2.0,)'], {}), '((np.pi / 2.0,))\n', (1979, 1995), True, 'import numpy as np\n'), ((1230, 1291), 'tensorflow_graphics.geometry.representation.grid.generate', 'grid.generate', (['(-1.0, -1.0, -1.0)', '(1.0, 1.0, 1.0)', 'grid_size'], {}), '((-1.0, -1.0, -1.0), (1.0, 1... |
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | [
"aimet_tensorflow.keras.batch_norm_fold.fold_all_batch_norms",
"tensorflow.keras.applications.resnet50.ResNet50",
"numpy.random.randn",
"packaging.version.parse",
"aimet_tensorflow.keras.quantsim.QuantizationSimModel",
"aimet_tensorflow.keras.utils.common.parse_activation_layer",
"numpy.array_equal"
] | [((5462, 5495), 'packaging.version.parse', 'version.parse', (['tf.version.VERSION'], {}), '(tf.version.VERSION)\n', (5475, 5495), False, 'from packaging import version\n'), ((5499, 5520), 'packaging.version.parse', 'version.parse', (['"""2.00"""'], {}), "('2.00')\n", (5512, 5520), False, 'from packaging import version\... |
import tensorflow as tf
from tqdm import tqdm
import numpy as np
import os, joblib, re, sys
class MLP():
def __init__(self, static_data,rated, X_train, y_train, X_val, y_val, X_test, y_test, trial = 0, probabilistc=False):
self.static_data=static_data
self.probabilistic = probabilistc
self.... | [
"tensorflow.keras.layers.Dense",
"tensorflow.maximum",
"numpy.ones",
"tensorflow.matmul",
"tensorflow.Variable",
"os.path.join",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.abs",
"tensorflow.add_n",
"tensorflow.compat.v1.placeholder",
"tensorflow.config.experimental_list_dev... | [((598, 645), 'tensorflow.random.truncated_normal', 'tf.random.truncated_normal', (['shape'], {'stddev': '(0.001)'}), '(shape, stddev=0.001)\n', (624, 645), True, 'import tensorflow as tf\n'), ((661, 690), 'tensorflow.Variable', 'tf.Variable', (['init_random_dist'], {}), '(init_random_dist)\n', (672, 690), True, 'impor... |
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while True:
# _ means no return is used
_, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_pink = np.array([130,0,130])
upper_pink = np.array([255,255,255])
mask = cv2.inRange(hsv, lower_pink, upper_pink)
res... | [
"cv2.GaussianBlur",
"cv2.bitwise_and",
"cv2.filter2D",
"cv2.cvtColor",
"cv2.medianBlur",
"cv2.waitKey",
"cv2.imshow",
"numpy.ones",
"cv2.VideoCapture",
"cv2.bilateralFilter",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.inRange"
] | [((37, 56), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (53, 56), False, 'import cv2\n'), ((793, 816), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (814, 816), False, 'import cv2\n'), ((138, 176), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2HSV'], {}), '(frame, c... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#
import numpy as np
import torch
from fairseq import utils
from fairseq.data import data_utils, FairseqDataset
class MaskedLanguagePairDataset(FairseqDataset):
"""Masked Language Pair dataset (only support for single... | [
"fairseq.data.data_utils.collate_tokens",
"torch.multinomial",
"torch.LongTensor",
"numpy.argsort",
"numpy.random.random",
"numpy.array",
"numpy.random.randint"
] | [((795, 810), 'numpy.array', 'np.array', (['sizes'], {}), '(sizes)\n', (803, 810), True, 'import numpy as np\n'), ((2666, 2710), 'torch.LongTensor', 'torch.LongTensor', (["[s['id'] for s in samples]"], {}), "([s['id'] for s in samples])\n", (2682, 2710), False, 'import torch\n'), ((5348, 5366), 'numpy.random.random', '... |
# -*- coding: utf-8 -*-
"""
A simple script to view the results from the simulation
"""
import h5py
import numpy as np
import os
import pytz
from datetime import datetime
import matplotlib.pyplot as plt
import os, sys
import subprocess
import pandas as pd
sys.path.append("../../..")
from pycato import *
tz = pytz.ti... | [
"sys.path.append",
"matplotlib.pyplot.title",
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"subprocess.check_output",
"matplotlib.pyplot.axis",
"dask.diagnostics.ProgressBar",
"pytz.timezone",
"numpy.loadtxt",
"datetime.datetime.now",
"os.getenv",
"matplotlib.pyplot.savefig"
] | [((258, 285), 'sys.path.append', 'sys.path.append', (['"""../../.."""'], {}), "('../../..')\n", (273, 285), False, 'import os, sys\n'), ((313, 346), 'pytz.timezone', 'pytz.timezone', (['"""America/New_York"""'], {}), "('America/New_York')\n", (326, 346), False, 'import pytz\n'), ((353, 369), 'datetime.datetime.now', 'd... |
import cv2
import os
import glob
from sklearn.utils import shuffle
import numpy as np
def load_train(train_path, image_size, classes):
images = []
labels = []
img_names = []
cls = []
print('Going to read training images')
for fields in classes:
index = classes.index(fields)
... | [
"numpy.multiply",
"os.path.basename",
"cv2.imread",
"numpy.array",
"glob.glob",
"sklearn.utils.shuffle",
"os.path.join",
"cv2.resize"
] | [((983, 999), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (991, 999), True, 'import numpy as np\n'), ((1013, 1029), 'numpy.array', 'np.array', (['labels'], {}), '(labels)\n', (1021, 1029), True, 'import numpy as np\n'), ((1046, 1065), 'numpy.array', 'np.array', (['img_names'], {}), '(img_names)\n', (1054... |
__version__ = "0.0.5"
__author__ = "Josh!"
from numpy import array
def run(*args):
return array(args).sum()
| [
"numpy.array"
] | [((96, 107), 'numpy.array', 'array', (['args'], {}), '(args)\n', (101, 107), False, 'from numpy import array\n')] |
import pandas as pd
import numpy as np
from scipy.optimize import minimize
def pseudo_obs(data):
"""
take dataframe as argument and returns
Pseudo-observations from real data X
"""
pseudo_obs = data
for i in range(len(data.columns)):
order = pseudo_obs.iloc[:,i].argsort()
... | [
"scipy.optimize.minimize",
"numpy.sqrt"
] | [((1203, 1300), 'scipy.optimize.minimize', 'minimize', (['log_likelihood', 'copula.theta_start'], {'method': 'opti_method', 'bounds': 'copula.bounds_param'}), '(log_likelihood, copula.theta_start, method=opti_method, bounds=\n copula.bounds_param)\n', (1211, 1300), False, 'from scipy.optimize import minimize\n'), ((... |
# -*- coding: utf-8 -*-
"""
Connectome-informed reservoir - Echo-State Network
=================================================
This example demonstrates how to use the conn2res toolbox to
perform a memory task using a human connectomed-informed
Echo-State network while playing with the dynamics of the reservoir
(Jaeg... | [
"matplotlib.pyplot.title",
"conn2res.iodata.fetch_dataset",
"matplotlib.pyplot.figure",
"numpy.arange",
"os.path.join",
"numpy.round",
"os.path.abspath",
"numpy.max",
"scipy.linalg.eigh",
"numpy.linspace",
"numpy.random.choice",
"seaborn.set",
"pandas.concat",
"conn2res.iodata.split_datase... | [((792, 834), 'os.path.join', 'os.path.join', (['PROJ_DIR', '"""examples"""', '"""data"""'], {}), "(PROJ_DIR, 'examples', 'data')\n", (804, 834), False, 'import os\n'), ((1383, 1409), 'conn2res.iodata.fetch_dataset', 'iodata.fetch_dataset', (['task'], {}), '(task)\n', (1403, 1409), False, 'from conn2res import iodata\n... |
#!/usr/bin/env python3
import argparse
import glob
import json
import os
import cv2 as cv
import numpy as np
KEY_YES = 121
KEY_NO = 110
KEY_B = 98
KEY_ESCAPE = 27
KEY_Q = 113
WINDOW_NAME = 'background_subtraction'
def get_label_dict(image_filename, width, height):
label_dict = {
'fillColor': [255, 0, 0... | [
"argparse.ArgumentParser",
"numpy.clip",
"glob.glob",
"cv2.rectangle",
"cv2.contourArea",
"cv2.dilate",
"cv2.cvtColor",
"cv2.imwrite",
"os.path.exists",
"cv2.namedWindow",
"cv2.boundingRect",
"json.dump",
"os.path.basename",
"cv2.createBackgroundSubtractorKNN",
"cv2.waitKeyEx",
"numpy.... | [((1088, 1167), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n', (1111, 1167), False, 'import argparse\n'), ((2563, 2653), 'cv2.createBackgroundSubtractorKNN', 'cv.createBackgroundSubt... |
import numpy as np
from tqdm import tqdm
import os
from sklearn.cluster import MiniBatchKMeans
def minibatch_kmeans(root, prefix, k, batch_size, epochs):
"""
docstring
"""
paths = []
for root, dirs, files in tqdm(os.walk(root)):
for name in files:
if name.find(prefix) != -1:
... | [
"sklearn.cluster.MiniBatchKMeans",
"tqdm.tqdm",
"numpy.load",
"os.walk",
"numpy.expand_dims",
"os.path.join",
"numpy.concatenate"
] | [((387, 439), 'sklearn.cluster.MiniBatchKMeans', 'MiniBatchKMeans', ([], {'n_clusters': 'k', 'batch_size': 'batch_size'}), '(n_clusters=k, batch_size=batch_size)\n', (402, 439), False, 'from sklearn.cluster import MiniBatchKMeans\n'), ((1100, 1111), 'tqdm.tqdm', 'tqdm', (['paths'], {}), '(paths)\n', (1104, 1111), False... |
""" Visualization of :mod:`time series <pySPACE.resources.data_types.time_series>` based on EEG signals to combine it with mapping to real sensor positions """
import logging
import os, pylab, numpy, warnings
from pySPACE.missions.nodes.visualization.base import VisualizationBase
from pySPACE.resources.dataset_defs.s... | [
"numpy.clip",
"pylab.axes",
"pylab.figure",
"numpy.arange",
"pylab.bar",
"pylab.contour",
"pylab.subplots_adjust",
"pylab.title",
"pySPACE.resources.dataset_defs.stream.StreamDataset.project2d",
"pylab.contourf",
"pylab.draw",
"numpy.append",
"pylab.get_backend",
"pylab.ylim",
"numpy.lin... | [((4749, 4779), 'numpy.linspace', 'numpy.linspace', (['(-125)', '(125)', '(200)'], {}), '(-125, 125, 200)\n', (4763, 4779), False, 'import os, pylab, numpy, warnings\n'), ((4793, 4823), 'numpy.linspace', 'numpy.linspace', (['(-100)', '(100)', '(200)'], {}), '(-100, 100, 200)\n', (4807, 4823), False, 'import os, pylab, ... |
# pylint: disable=invalid-name, redefined-outer-name, missing-docstring, non-parent-init-called, trailing-whitespace, line-too-long
import cv2
import numpy as np
import sys
class Label:
def __init__(self, cl=-1, tl=np.array([0., 0.]), br=np.array([0., 0.]), prob=None):
self.__tl = tl
self.__br = ... | [
"cv2.resize",
"numpy.matrix",
"cv2.warpPerspective",
"numpy.minimum",
"numpy.maximum",
"numpy.amin",
"numpy.zeros",
"numpy.ones",
"numpy.amax",
"numpy.linalg.svd",
"numpy.where",
"numpy.array",
"numpy.reshape",
"numpy.squeeze",
"numpy.prod"
] | [((1866, 1890), 'numpy.prod', 'np.prod', (['intersection_wh'], {}), '(intersection_wh)\n', (1873, 1890), True, 'import numpy as np\n'), ((2821, 2837), 'numpy.zeros', 'np.zeros', (['(8, 9)'], {}), '((8, 9))\n', (2829, 2837), True, 'import numpy as np\n'), ((3080, 3096), 'numpy.linalg.svd', 'np.linalg.svd', (['A'], {}), ... |
import os
import sys
import numpy as np
from datetime import datetime, timedelta
from tools_AIP import read_obs_grads, read_nc_topo, read_mask_full, read_obs_grads_latlon, read_fcst_grads, read_nc_lonlat, dist, get_cfeature, setup_grids_cartopy, prep_proj_multi_cartopy, read_fcst_grads_all
import matplotlib.pyplot as ... | [
"matplotlib.pyplot.savefig",
"tools_AIP.read_nc_topo",
"matplotlib.pyplot.show",
"numpy.abs",
"numpy.resize",
"tools_AIP.read_fcst_grads_all",
"matplotlib.pyplot.clf",
"tools_AIP.read_nc_lonlat",
"datetime.datetime",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.arange",
"numpy.nanmean",... | [((5621, 5652), 'datetime.datetime', 'datetime', (['(2019)', '(8)', '(24)', '(15)', '(0)', '(0)'], {}), '(2019, 8, 24, 15, 0, 0)\n', (5629, 5652), False, 'from datetime import datetime, timedelta\n'), ((5695, 5718), 'tools_AIP.read_obs_grads_latlon', 'read_obs_grads_latlon', ([], {}), '()\n', (5716, 5718), False, 'from... |
# Copyright 2019, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | [
"tensorflow.test.main",
"unittest.mock.create_autospec",
"utils.datasets.stackoverflow_word_prediction.batch_and_split",
"tensorflow.config.list_logical_devices",
"utils.datasets.stackoverflow_word_prediction.get_federated_datasets",
"utils.datasets.stackoverflow_word_prediction.build_to_ids_fn",
"unitt... | [((7663, 7717), 'unittest.mock.patch', 'mock.patch', (["(STACKOVERFLOW_MODULE + '.load_word_counts')"], {}), "(STACKOVERFLOW_MODULE + '.load_word_counts')\n", (7673, 7717), False, 'from unittest import mock\n'), ((7721, 7768), 'unittest.mock.patch', 'mock.patch', (["(STACKOVERFLOW_MODULE + '.load_data')"], {}), "(STACK... |
"""
The generalized load definitions
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from utils import skew, Adjoint
class Load(metaclass=ABCMeta):
"""
The general class for dealing with loads
need to implement distributed load that gives both A_bar and B_bar
need to implement tip load
... | [
"utils.skew",
"utils.Adjoint",
"numpy.array",
"numpy.linalg.norm"
] | [((2108, 2127), 'numpy.array', 'np.array', (['[0, 0, 1]'], {}), '([0, 0, 1])\n', (2116, 2127), True, 'import numpy as np\n'), ((2972, 2982), 'utils.Adjoint', 'Adjoint', (['g'], {}), '(g)\n', (2979, 2982), False, 'from utils import skew, Adjoint\n'), ((950, 969), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, ... |
import os
import numpy as np
import torch
from PIL import Image
import torchvision
import matplotlib.pyplot as plt
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from torchvision.models.detection.mask_rcnn import MaskRCNNPredictor
import utils
import transforms as T
from engine import train_one... | [
"cv2.putText",
"cv2.cvtColor",
"torch.load",
"train.get_model_instance_segmentation",
"cv2.rectangle",
"torch.cuda.is_available",
"numpy.array",
"train.get_transform",
"torch.device",
"cv2.drawContours",
"torch.no_grad",
"cv2.findContours"
] | [((1131, 1144), 'numpy.array', 'np.array', (['img'], {}), '(img)\n', (1139, 1144), True, 'import numpy as np\n'), ((1175, 1211), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_RGB2BGR'], {}), '(img, cv2.COLOR_RGB2BGR)\n', (1187, 1211), False, 'import cv2\n'), ((2469, 2505), 'cv2.cvtColor', 'cv2.cvtColor', (['img',... |
import pytest
import torch
import numpy as np
import torch.nn as nn
from numpy import isclose
from neurodiffeq.function_basis import LegendrePolynomial
from neurodiffeq.function_basis import LegendreBasis
from neurodiffeq.function_basis import ZonalSphericalHarmonics
from neurodiffeq.function_basis import ZonalSpherica... | [
"scipy.special.sph_harm",
"numpy.random.uniform",
"neurodiffeq.function_basis.LegendreBasis",
"scipy.special.legendre",
"neurodiffeq.function_basis.LegendrePolynomial",
"torch.nn.Tanh",
"neurodiffeq.neurodiffeq.safe_diff",
"torch.isclose",
"numpy.isclose",
"neurodiffeq.function_basis.ZonalSpherica... | [((737, 759), 'numpy.random.rand', 'np.random.rand', (['*shape'], {}), '(*shape)\n', (751, 759), True, 'import numpy as np\n'), ((769, 805), 'torch.tensor', 'torch.tensor', (['x1'], {'requires_grad': '(True)'}), '(x1, requires_grad=True)\n', (781, 805), False, 'import torch\n'), ((1191, 1213), 'numpy.random.rand', 'np.... |
import numpy as np
from .numeric import uint8, ndarray, dtype
from numpy.compat import (
os_fspath, contextlib_nullcontext, is_pathlib_path
)
from numpy.core.overrides import set_module
__all__ = ['memmap']
dtypedescr = dtype
valid_filemodes = ["r", "c", "r+", "w+"]
writeable_filemodes = ["r+", "w+"]
mode_equiva... | [
"numpy.may_share_memory",
"numpy.intp",
"numpy.compat.contextlib_nullcontext",
"numpy.core.overrides.set_module",
"numpy.compat.os_fspath",
"numpy.compat.is_pathlib_path"
] | [((421, 440), 'numpy.core.overrides.set_module', 'set_module', (['"""numpy"""'], {}), "('numpy')\n", (431, 440), False, 'from numpy.core.overrides import set_module\n'), ((7955, 7987), 'numpy.compat.contextlib_nullcontext', 'contextlib_nullcontext', (['filename'], {}), '(filename)\n', (7977, 7987), False, 'from numpy.c... |
import numpy as np
from time import time
from scipy.stats import entropy
from threading import Thread
import random
class ML_DTM(object):
def __init__(self, documents, dictionary, alpha=1.0, beta=0.5, psi=1.0, sigma=1.0, n_topics=10, n_iter=1000):
print("- initializing parameters -")
self.n_iterations = n_iter
... | [
"threading.Thread",
"numpy.sum",
"numpy.copy",
"numpy.empty",
"numpy.asarray",
"scipy.stats.entropy",
"numpy.random.multinomial",
"numpy.identity",
"time.time",
"numpy.mean",
"numpy.linalg.inv",
"numpy.exp",
"numpy.random.normal",
"numpy.random.multivariate_normal",
"random.randrange",
... | [((591, 614), 'numpy.sum', 'np.sum', (['self.timeslices'], {}), '(self.timeslices)\n', (597, 614), True, 'import numpy as np\n'), ((2018, 2031), 'numpy.asarray', 'np.asarray', (['p'], {}), '(p)\n', (2028, 2031), True, 'import numpy as np\n'), ((2038, 2051), 'numpy.asarray', 'np.asarray', (['q'], {}), '(q)\n', (2048, 20... |
from azureml.core.run import Run, _OfflineRun
from azureml.core import Workspace
from sklearn.datasets import load_diabetes
import numpy as np
import argparse
import os
"""
$ python -m src.steps.01_prep_data \
--data_X=outputs/diabetes_X.csv \
--data_y=outputs/diabetes_y.csv
"""
# Get context
run = Run.get_co... | [
"azureml.core.Workspace.from_config",
"argparse.ArgumentParser",
"os.path.dirname",
"numpy.savetxt",
"azureml.core.run.Run.get_context",
"sklearn.datasets.load_diabetes"
] | [((310, 327), 'azureml.core.run.Run.get_context', 'Run.get_context', ([], {}), '()\n', (325, 327), False, 'from azureml.core.run import Run, _OfflineRun\n'), ((333, 356), 'azureml.core.Workspace.from_config', 'Workspace.from_config', ([], {}), '()\n', (354, 356), False, 'from azureml.core import Workspace\n'), ((473, 4... |
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
"""Adaptive RF Izhikevich neuron."""
import numpy as np
import torch
from . import base
from .dynamics import resonator, adaptive_phase_th
from ..spike import complex
from ..utils import quantize
# These are tuned heuristically so that ... | [
"torch.ones",
"numpy.arctan2",
"numpy.log",
"torch.sqrt",
"numpy.isscalar",
"torch.FloatTensor",
"numpy.prod",
"torch.cos",
"numpy.sin",
"numpy.cos",
"torch.rand",
"torch.zeros",
"numpy.log10",
"torch.no_grad",
"torch.sin",
"torch.tensor",
"numpy.sqrt"
] | [((1155, 1195), 'numpy.sqrt', 'np.sqrt', (['(sin_decay ** 2 + cos_decay ** 2)'], {}), '(sin_decay ** 2 + cos_decay ** 2)\n', (1162, 1195), True, 'import numpy as np\n'), ((1212, 1244), 'numpy.arctan2', 'np.arctan2', (['sin_decay', 'cos_decay'], {}), '(sin_decay, cos_decay)\n', (1222, 1244), True, 'import numpy as np\n'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.