code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import pickle from unittest import mock from nose2.tools.params import params import numpy as np import tensorflow as tf from garage.tf.envs import TfEnv from garage.tf.policies import GaussianMLPPolicyWithModel from tests.fixtures import TfGraphTestCase from tests.fixtures.envs.dummy import DummyBoxEnv from tests.fi...
[ "tensorflow.Graph", "pickle.dumps", "tensorflow.placeholder", "numpy.array_equal", "nose2.tools.params.params", "tests.fixtures.envs.dummy.DummyBoxEnv", "pickle.loads", "numpy.full", "garage.tf.policies.GaussianMLPPolicyWithModel", "unittest.mock.patch" ]
[((426, 532), 'nose2.tools.params.params', 'params', (['((1,), (1,))', '((1,), (2,))', '((2,), (2,))', '((1, 1), (1, 1))', '((1, 1), (2, 2))', '((2, 2), (2, 2))'], {}), '(((1,), (1,)), ((1,), (2,)), ((2,), (2,)), ((1, 1), (1, 1)), ((1, 1),\n (2, 2)), ((2, 2), (2, 2)))\n', (432, 532), False, 'from nose2.tools.params ...
from cinebot_mini import SERVERS import requests import numpy as np import json def base_url(): blender_dict = SERVERS["blender"] url = "http://{}:{}".format( blender_dict["host"], blender_dict["port"]) return url def handshake(): url = base_url() + "/api/ping" for i in range(5): ...
[ "numpy.array", "json.dumps", "requests.get", "requests.delete" ]
[((2923, 2940), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (2935, 2940), False, 'import requests\n'), ((4368, 4385), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (4380, 4385), False, 'import requests\n'), ((4714, 4731), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (4726, 4731), ...
from __future__ import print_function import tensorflow as tf import numpy as np from collections import namedtuple, OrderedDict from subprocess import call import scipy.io.wavfile as wavfile import argparse import codecs import timeit import struct import toml import re import sys import os def _int64_feature(value)...
[ "os.path.exists", "os.listdir", "argparse.ArgumentParser", "os.makedirs", "timeit.default_timer", "os.path.join", "os.path.splitext", "tensorflow.train.Int64List", "os.path.split", "tensorflow.train.BytesList", "numpy.array", "scipy.io.wavfile.read", "os.unlink", "tensorflow.python_io.TFRe...
[((1126, 1158), 'numpy.array', 'np.array', (['slices'], {'dtype': 'np.int32'}), '(slices, dtype=np.int32)\n', (1134, 1158), True, 'import numpy as np\n'), ((1238, 1260), 'scipy.io.wavfile.read', 'wavfile.read', (['filename'], {}), '(filename)\n', (1250, 1260), True, 'import scipy.io.wavfile as wavfile\n'), ((1660, 1687...
import argparse import math import matplotlib.pyplot as plt import os import numpy as np import shutil import pandas as pd import seaborn as sns sns.set() sns.set_context("talk") NUM_BINS = 100 path = '../Data/Video_Info/Pensieve_Info/PenieveVideo_video_info' video_mappings = {} video_mappings['300'] = '320x180x30_v...
[ "numpy.mean", "seaborn.set", "os.path.exists", "pandas.read_csv", "matplotlib.pyplot.ylabel", "argparse.ArgumentParser", "os.makedirs", "matplotlib.pyplot.xlabel", "seaborn.set_context", "os.path.join", "os.path.getmtime", "os.path.dirname", "matplotlib.pyplot.figure", "shutil.rmtree", "...
[((146, 155), 'seaborn.set', 'sns.set', ([], {}), '()\n', (153, 155), True, 'import seaborn as sns\n'), ((156, 179), 'seaborn.set_context', 'sns.set_context', (['"""talk"""'], {}), "('talk')\n", (171, 179), True, 'import seaborn as sns\n'), ((798, 815), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (809...
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acco...
[ "numpy.iinfo", "numpy.isin", "numpy.ascontiguousarray", "numpy.argsort", "numpy.array", "scipy.sparse.sputils.get_index_dtype", "numpy.save", "numpy.arange", "scipy.sparse.sputils.upcast", "numpy.empty", "scipy.sparse.coo_matrix", "scipy.sparse.csr_matrix", "sklearn.utils.extmath.randomized_...
[((33975, 34028), 'collections.namedtuple', 'collections.namedtuple', (['"""Metrics"""', "['prec', 'recall']"], {}), "('Metrics', ['prec', 'recall'])\n", (33997, 34028), False, 'import collections\n'), ((1542, 1610), 'scipy.sparse.sputils.get_index_dtype', 'smat.sputils.get_index_dtype', (['indices'], {'check_contents'...
import numpy as np import csv import cv2 from keras.models import Sequential from keras.layers import Dense, Flatten def load_data(): lines = [] with open('Data/driving_log.csv') as csvfile: reader = csv.reader(csvfile) for line in reader: lines.append(line) images = [] mea...
[ "keras.layers.Flatten", "keras.models.Sequential", "numpy.array", "csv.reader", "keras.layers.Dense", "cv2.imread" ]
[((645, 661), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (653, 661), True, 'import numpy as np\n'), ((676, 698), 'numpy.array', 'np.array', (['measurements'], {}), '(measurements)\n', (684, 698), True, 'import numpy as np\n'), ((769, 781), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (779,...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ "tensorflow.compat.v2.distribute.OneDeviceStrategy", "tensorflow.compat.v2.compat.v1.distribute.experimental.ParameterServerStrategy", "six.moves.range", "json.dumps", "numpy.log", "numpy.argmax", "numpy.equal", "absl.logging.info", "numpy.square", "numpy.stack", "tensorflow.compat.v2.keras.mode...
[((1132, 1179), 'json.dumps', 'json.dumps', (['x'], {'indent': '(2)', 'cls': '_SimpleJsonEncoder'}), '(x, indent=2, cls=_SimpleJsonEncoder)\n', (1142, 1179), False, 'import json\n'), ((1244, 1301), 'absl.logging.info', 'logging.info', (['"""Recording config to %s\n %s"""', 'path', 'out'], {}), '("""Recording config to ...
from __future__ import division, print_function, absolute_import from .core import SeqletCoordinates from modisco import util import numpy as np from collections import defaultdict, Counter, OrderedDict import itertools import sys import time from .value_provider import ( AbstractValTransformer, AbsPercentileValTra...
[ "matplotlib.pyplot.ylabel", "numpy.log", "numpy.array", "numpy.percentile", "numpy.random.RandomState", "numpy.histogram", "matplotlib.pyplot.xlabel", "numpy.concatenate", "numpy.maximum", "sys.stdout.flush", "modisco.util.load_string_list", "numpy.abs", "numpy.ceil", "numpy.floor", "num...
[((33997, 34011), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (34009, 34011), True, 'from matplotlib import pyplot as plt\n'), ((5463, 5513), 'modisco.util.load_string_list', 'util.load_string_list', ([], {'dset_name': '"""coords"""', 'grp': 'grp'}), "(dset_name='coords', grp=grp)\n", (5484, 5513), ...
import unittest from sys import argv import numpy as np import torch from objective.ridge import Ridge, Ridge_ClosedForm, Ridge_Gradient from .utils import Container, assert_all_close, assert_all_close_dict def _init_ridge(cls): np.random.seed(1234) torch.manual_seed(1234) n_features = 3 n_samples ...
[ "torch.manual_seed", "objective.ridge.Ridge_Gradient", "torch.tensor", "numpy.random.seed", "objective.ridge.Ridge_ClosedForm", "unittest.main", "torch.randn" ]
[((237, 257), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (251, 257), True, 'import numpy as np\n'), ((262, 285), 'torch.manual_seed', 'torch.manual_seed', (['(1234)'], {}), '(1234)\n', (279, 285), False, 'import torch\n'), ((486, 532), 'torch.randn', 'torch.randn', (['n_features', '(1)'], {'re...
""" Train shadow net script """ import argparse import functools import itertools import os import os.path as ops import sys import time import numpy as np import tensorflow as tf import pprint import shadownet import six from six.moves import xrange # pylint: disable=redefined-builtin sys.path.append('/data/') fr...
[ "itertools.chain", "tensorflow.image.resize_images", "tensorflow.shape", "tensorflow.split", "tensorflow.estimator.EstimatorSpec", "tensorflow.gradients", "tensorflow.group", "local_utils.log_utils.init_logger", "tensorflow.reduce_mean", "tensorflow.cast", "sys.path.append", "shadownet.build_s...
[((291, 316), 'sys.path.append', 'sys.path.append', (['"""/data/"""'], {}), "('/data/')\n", (306, 316), False, 'import sys\n'), ((692, 770), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""dataset_dir"""', '"""/data/data/tfrecords"""', '"""data path"""'], {}), "('dataset_dir', '/data/data/tfre...
from common import small_buffer import pytest import numpy as np import pyarrow as pa import vaex def test_unique_arrow(df_factory): ds = df_factory(x=vaex.string_column(['a', 'b', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'a'])) with small_buffer(ds, 2): assert set(ds.unique(ds.x)) == {'a', 'b'} v...
[ "common.small_buffer", "pytest.mark.parametrize", "numpy.array", "vaex.string_column", "numpy.isnan" ]
[((2694, 2742), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""future"""', '[False, True]'], {}), "('future', [False, True])\n", (2717, 2742), False, 'import pytest\n'), ((1088, 1143), 'numpy.array', 'np.array', (['[np.nan, 0, 1, np.nan, 2, np.nan]'], {'dtype': '"""f4"""'}), "([np.nan, 0, 1, np.nan, 2, np....
# utility functions for frequency related stuff import numpy as np import numpy.fft as fft import math def getFrequencyArray(fs, samples): # frequencies go from to nyquist nyquist = fs/2 return np.linspace(0, nyquist, samples) # use this function for all FFT calculations # then if change FFT later (i.e. FFTW), j...
[ "numpy.fft.rfft", "numpy.linspace", "numpy.fft.irfft", "math.log" ]
[((200, 232), 'numpy.linspace', 'np.linspace', (['(0)', 'nyquist', 'samples'], {}), '(0, nyquist, samples)\n', (211, 232), True, 'import numpy as np\n'), ((462, 498), 'numpy.fft.rfft', 'fft.rfft', (['data'], {'norm': '"""ortho"""', 'axis': '(0)'}), "(data, norm='ortho', axis=0)\n", (470, 498), True, 'import numpy.fft a...
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import time import cv2 from real.camera import Camera from robot import Robot from subprocess import Popen, PIPE def get_camera_to_robot_transformation(camera): color_img, depth_img = camera.get_data() cv2.imwrite("real/temp.jpg", color...
[ "cv2.setMouseCallback", "cv2.imwrite", "numpy.float32", "robot.Robot", "subprocess.Popen", "numpy.asarray", "cv2.imshow", "numpy.array", "numpy.dot", "cv2.circle", "cv2.destroyAllWindows", "cv2.cvtColor", "cv2.waitKey", "cv2.namedWindow" ]
[((1585, 1644), 'numpy.asarray', 'np.asarray', (['[[0.3, 0.748], [-0.224, 0.224], [-0.255, -0.1]]'], {}), '([[0.3, 0.748], [-0.224, 0.224], [-0.255, -0.1]])\n', (1595, 1644), True, 'import numpy as np\n'), ((1664, 1724), 'numpy.asarray', 'np.asarray', (['[[-0.237, 0.211], [-0.683, -0.235], [0.18, 0.4]]'], {}), '([[-0.2...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
[ "improver.calibration.ensemble_calibration.CalibratedForecastDistributionParameters", "numpy.testing.assert_array_almost_equal", "iris.cube.CubeList", "numpy.ones", "improver.synthetic_data.set_up_test_cubes.set_up_variable_cube", "improver.calibration.ensemble_calibration.EstimateCoefficientsForEnsembleC...
[((2638, 2799), 'improver.utilities.warnings_handler.ManageWarnings', 'ManageWarnings', ([], {'ignored_messages': "['Collapsing a non-contiguous coordinate.', 'invalid escape sequence']", 'warning_types': '[UserWarning, DeprecationWarning]'}), "(ignored_messages=['Collapsing a non-contiguous coordinate.',\n 'invalid...
import os import numpy as np import torch import torch.nn as nn import torch.optim as optim import argparse from tqdm import tqdm import sys import distributed as dist import utils from models.vqvae import VQVAE, VQVAE_Blob2Full from models.discriminator import discriminator visual_folder = '/home2/bipasha31/python_...
[ "os.getuid", "torch.cuda.device_count", "torch.nn.MSELoss", "models.vqvae.VQVAE", "numpy.mean", "models.discriminator.discriminator", "argparse.ArgumentParser", "torch.mean", "utils.load_data_and_data_loaders", "utils.readable_timestamp", "utils.save_model_and_results", "os.makedirs", "distr...
[((356, 397), 'os.makedirs', 'os.makedirs', (['visual_folder'], {'exist_ok': '(True)'}), '(visual_folder, exist_ok=True)\n', (367, 397), False, 'import os\n'), ((783, 916), 'models.vqvae.VQVAE', 'VQVAE', (['args.n_hiddens', 'args.n_residual_hiddens', 'args.n_residual_layers', 'args.n_embeddings', 'args.embedding_dim', ...
import numpy as np import scipy.stats as stats from UQpy.Distributions.baseclass.Distribution import Distribution class DistributionContinuous1D(Distribution): """ Parent class for univariate continuous probability distributions. """ def __init__(self, **kwargs): super().__init__(**kwargs) ...
[ "numpy.atleast_1d" ]
[((499, 515), 'numpy.atleast_1d', 'np.atleast_1d', (['x'], {}), '(x)\n', (512, 515), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ test_util_matrix @author: jdiedrichsen """ import unittest import pyrsa.util as rsu import numpy as np class TestIndicator(unittest.TestCase): def test_indicator(self): a = np.array(range(0, 5)) a = np.concatenate((a, a)) X = rsu.matrix...
[ "pyrsa.util.matrix.indicator", "pyrsa.util.matrix.pairwise_contrast", "numpy.concatenate", "unittest.main", "pyrsa.util.matrix.centering" ]
[((1224, 1239), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1237, 1239), False, 'import unittest\n'), ((275, 297), 'numpy.concatenate', 'np.concatenate', (['(a, a)'], {}), '((a, a))\n', (289, 297), True, 'import numpy as np\n'), ((310, 333), 'pyrsa.util.matrix.indicator', 'rsu.matrix.indicator', (['a'], {}), '...
from tensorflow.keras import Sequential from tensorflow.keras.layers import Conv2D, Flatten, Dense, Dropout import tensorflow.keras as keras import os import cv2 import numpy as np from sklearn.model_selection import train_test_split def data_prep(path, img_rows, img_cols, color): """ A function to preprocess ...
[ "os.listdir", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.Sequential", "sklearn.model_selection.train_test_split", "os.path.join", "numpy.argmax", "numpy.array", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.load_model", "tensorflow.keras.layers.Flatten", "cv2.resize", "cv2...
[((1704, 1720), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1714, 1720), False, 'import os\n'), ((2245, 2268), 'numpy.random.shuffle', 'np.random.shuffle', (['data'], {}), '(data)\n', (2262, 2268), True, 'import numpy as np\n'), ((2773, 2785), 'tensorflow.keras.Sequential', 'Sequential', ([], {}), '()\n', ...
# STL imports import random import logging import string import time import datetime import random import struct import sys from functools import wraps # Third party imports import numpy as np import faker from faker.providers import BaseProvider logging.getLogger('faker').setLevel(logging.ERROR) sys.path.append('.'...
[ "logging.getLogger", "random.choice", "random.randrange", "time.perf_counter", "functools.wraps", "datetime.timedelta", "faker.Faker", "datetime.datetime.now", "random.random", "time.localtime", "sys.path.append", "random.randint", "numpy.random.RandomState" ]
[((301, 321), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (316, 321), False, 'import sys\n'), ((2030, 2043), 'faker.Faker', 'faker.Faker', ([], {}), '()\n', (2041, 2043), False, 'import faker\n'), ((578, 605), 'numpy.random.RandomState', 'np.random.RandomState', (['(1234)'], {}), '(1234)\n', (59...
import os import sys cwd = os.getcwd() sys.path.append(cwd) import pickle import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from plot.helper import plot_task, plot_weights, plot_rf_z_max, plot_rf_quad, plot_vector_traj tasks = [ 'com_pos', 'com_vel', 'chassis_quat', 'ch...
[ "matplotlib.use", "plot.helper.plot_rf_z_max", "pickle.load", "os.getcwd", "numpy.stack", "plot.helper.plot_weights", "plot.helper.plot_task", "sys.path.append", "plot.helper.plot_rf_quad", "matplotlib.pyplot.show" ]
[((27, 38), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (36, 38), False, 'import os\n'), ((39, 59), 'sys.path.append', 'sys.path.append', (['cwd'], {}), '(cwd)\n', (54, 59), False, 'import sys\n'), ((112, 135), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (126, 135), False, 'import matplotl...
import numpy as np import matplotlib.pyplot as plt from tqdm import trange class CFG: n = 10 mean = 0.0 variance = 1.0 t = 1000 esp = [0, 0.01, 0.05, 0.1, 0.15, 0.2] n_try = 2000 class bandit(): def __init__(self, m, v): self.m = m self.v = v self.mean = 0.0 ...
[ "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "numpy.random.random", "numpy.random.choice", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.argmax", "matplotlib.pyplot.figure", "numpy.zeros", "numpy.random.randn", "tqdm.trange", "matplotlib.pyplot.legend", "matplotlib...
[((1088, 1116), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 10)'}), '(figsize=(20, 10))\n', (1098, 1116), True, 'import matplotlib.pyplot as plt\n'), ((1336, 1354), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""step"""'], {}), "('step')\n", (1346, 1354), True, 'import matplotlib.pyplot as plt\n')...
__description__ = \ """ Fitter subclass for performing bayesian (MCMC) fits. """ __author__ = "<NAME>" __date__ = "2017-05-10" from .base import Fitter import emcee, corner import numpy as np import scipy.optimize as optimize import multiprocessing class BayesianFitter(Fitter): """ """ def __init__(sel...
[ "numpy.mean", "numpy.copy", "scipy.optimize.least_squares", "numpy.sort", "multiprocessing.cpu_count", "emcee.EnsembleSampler", "numpy.array", "numpy.sum", "numpy.isfinite", "numpy.std", "numpy.random.randn" ]
[((4549, 4565), 'numpy.array', 'np.array', (['bounds'], {}), '(bounds)\n', (4557, 4565), True, 'import numpy as np\n'), ((5769, 5861), 'emcee.EnsembleSampler', 'emcee.EnsembleSampler', (['self._num_walkers', 'ndim', 'self.ln_prob'], {'threads': 'self._num_threads'}), '(self._num_walkers, ndim, self.ln_prob, threads=sel...
# -*- coding: utf-8 -*- # We must always import the relevant libraries for our problem at hand. NumPy and TensorFlow are required for this example. # https://www.kaggle.com/c/costa-rican-household-poverty-prediction/data#_=_ import numpy as np np.set_printoptions(threshold='nan') import matplotlib.pyplot as plt import...
[ "tensorflow.feature_column.crossed_column", "tensorflow.estimator.DNNClassifier", "pandas.read_csv", "sklearn.model_selection.train_test_split", "tensorflow.estimator.LinearClassifier", "tensorflow.feature_column.numeric_column", "tensorflow.estimator.inputs.pandas_input_fn", "numpy.set_printoptions" ...
[((245, 281), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': '"""nan"""'}), "(threshold='nan')\n", (264, 281), True, 'import numpy as np\n'), ((521, 550), 'pandas.read_csv', 'pd.read_csv', (['"""data/train.csv"""'], {}), "('data/train.csv')\n", (532, 550), True, 'import pandas as pd\n'), ((6250, 63...
# Adapted by <NAME>, 2019 # # Based on Detectron.pytorch/lib/roi_data/fast_rcnn.py # Original license text: # -------------------------------------------------------- # Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in co...
[ "logging.getLogger", "numpy.minimum", "numpy.ones", "numpy.hstack", "numpy.where", "utils_rel.boxes_rel.get_spt_features", "numpy.unique", "numpy.random.choice", "utils_rel.boxes_rel.rois_union", "numpy.append", "numpy.array", "numpy.zeros", "utils.fpn.add_multilevel_roi_blobs", "numpy.con...
[((1404, 1431), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1421, 1431), False, 'import logging\n'), ((8692, 8741), 'numpy.hstack', 'np.hstack', (['(repeated_batch_idx, sampled_sbj_rois)'], {}), '((repeated_batch_idx, sampled_sbj_rois))\n', (8701, 8741), True, 'import numpy as np\n'),...
# encoding: utf-8 import torch import cv2 import numpy as np import pdb def detection_collate(batch): """Custom collate fn for dealing with batches of images that have a different number of associated object annotations (bounding boxes). Arguments: batch: (tuple) A tuple of tensor images and lists...
[ "torch.stack", "numpy.array", "numpy.zeros", "cv2.resize", "torch.FloatTensor" ]
[((948, 989), 'numpy.zeros', 'np.zeros', (['aug_size'], {'dtype': 'sample[1].dtype'}), '(aug_size, dtype=sample[1].dtype)\n', (956, 989), True, 'import numpy as np\n'), ((1087, 1107), 'torch.stack', 'torch.stack', (['imgs', '(0)'], {}), '(imgs, 0)\n', (1098, 1107), False, 'import torch\n'), ((1109, 1132), 'torch.stack'...
# Copyright (c) 2018 Copyright holder of the paper Generative Adversarial Model Learning # submitted to NeurIPS 2019 for review # All rights reserved. import numpy as np import torch class Optimizer(object): def __init__(self, policy, use_gpu=False): self.networks = self._init_networks(policy.input_dim, ...
[ "numpy.array" ]
[((1868, 1911), 'numpy.array', 'np.array', (["batch['states']"], {'dtype': 'np.float32'}), "(batch['states'], dtype=np.float32)\n", (1876, 1911), True, 'import numpy as np\n'), ((1944, 1988), 'numpy.array', 'np.array', (["batch['rewards']"], {'dtype': 'np.float32'}), "(batch['rewards'], dtype=np.float32)\n", (1952, 198...
from attempt.ddpg import HERDDPG, DDPG import gym import os import matplotlib.pyplot as plt import numpy as np from tqdm import tqdm if __name__ == "__main__": os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' env = gym.make('FetchReach-v1') agent = HERDDPG(env) for epoch in range(2): for cycle in tq...
[ "attempt.ddpg.HERDDPG", "numpy.vstack", "matplotlib.pyplot.title", "gym.make", "matplotlib.pyplot.show" ]
[((219, 244), 'gym.make', 'gym.make', (['"""FetchReach-v1"""'], {}), "('FetchReach-v1')\n", (227, 244), False, 'import gym\n'), ((257, 269), 'attempt.ddpg.HERDDPG', 'HERDDPG', (['env'], {}), '(env)\n', (264, 269), False, 'from attempt.ddpg import HERDDPG, DDPG\n'), ((488, 508), 'matplotlib.pyplot.title', 'plt.title', (...
import sys import numpy as np import scipy.integrate import scipy.special from ._dblquad import dblquad HAVE_PYGSL = False try: import pygsl.integrate import pygsl.sf HAVE_PYGSL = True except ImportError: pass class BinEB(object): def __init__( self, tmin, tmax, Nb, windows=None, linear...
[ "numpy.power", "numpy.log", "numpy.array", "numpy.dot", "numpy.zeros", "numpy.sum", "sys.stdout.flush", "numpy.logspace", "numpy.arange", "sys.stdout.write" ]
[((15257, 15284), 'numpy.logspace', 'np.logspace', (['(0.0)', '(5.5)', '(1500)'], {}), '(0.0, 5.5, 1500)\n', (15268, 15284), True, 'import numpy as np\n'), ((17918, 17940), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (17934, 17940), False, 'import sys\n'), ((22001, 22020), 'numpy.dot', 'np....
import batoid import numpy as np import math from test_helpers import timer, do_pickle, all_obj_diff @timer def test_properties(): import random random.seed(5) for i in range(100): R = random.gauss(0.7, 0.8) sphere = batoid.Sphere(R) assert sphere.R == R do_pickle(sphere) ...
[ "batoid.Ray", "batoid.Plane", "random.uniform", "numpy.sqrt", "test_helpers.do_pickle", "numpy.testing.assert_allclose", "batoid.RayVector", "math.sqrt", "random.seed", "test_helpers.all_obj_diff", "numpy.random.uniform", "batoid.Sphere", "random.gauss" ]
[((155, 169), 'random.seed', 'random.seed', (['(5)'], {}), '(5)\n', (166, 169), False, 'import random\n'), ((366, 381), 'random.seed', 'random.seed', (['(57)'], {}), '(57)\n', (377, 381), False, 'import random\n'), ((1331, 1347), 'random.seed', 'random.seed', (['(577)'], {}), '(577)\n', (1342, 1347), False, 'import ran...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 12 18:28:54 2020 @author: Dr <NAME> (CIMAT-CONACYT, Mexico) jac at cimat.mx Instantaneous reproduction numbers calculations. Rts_P, Implementation of Cori et al (2013) Rts_AR, new filtering version using an autoregressive linear model of Capistrá...
[ "scipy.stats.erlang", "scipy.stats.gamma.rvs", "numpy.sqrt", "plotfrozen.PlotFrozenDist", "numpy.log", "scipy.stats.beta.logcdf", "numpy.array", "datetime.timedelta", "scipy.stats.uniform.rvs", "numpy.arange", "numpy.flip", "numpy.where", "matplotlib.pyplot.close", "numpy.exp", "numpy.li...
[((1114, 1138), 'scipy.stats.erlang', 'erlang', ([], {'a': '(3)', 'scale': '(8 / 3)'}), '(a=3, scale=8 / 3)\n', (1120, 1138), False, 'from scipy.stats import erlang, gamma, nbinom, uniform, beta\n'), ((2711, 2718), 'numpy.flip', 'flip', (['w'], {}), '(w)\n', (2715, 2718), False, 'from numpy import arange, diff, loadtxt...
import numpy as np from numpy.core.fromnumeric import mean from numpy.core.numeric import True_ from numpy.testing._private.utils import rand from polynomial_regression import PolynomialRegression from generate_regression_data import generate_regression_data from metrics import mean_squared_error # mse from math impor...
[ "generate_regression_data.generate_regression_data", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "numpy.reshape", "matplotlib.pyplot.ylabel", "numpy.random.choice", "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.clf", "polynomial_regression.PolynomialRegression", "nu...
[((637, 693), 'generate_regression_data.generate_regression_data', 'generate_regression_data', (['degree', 'N'], {'amount_of_noise': '(0.1)'}), '(degree, N, amount_of_noise=0.1)\n', (661, 693), False, 'from generate_regression_data import generate_regression_data\n'), ((712, 749), 'numpy.random.choice', 'np.random.choi...
# # Solver class using Scipy's adaptive time stepper # import casadi import pybamm import scipy.integrate as it import numpy as np class ScipySolver(pybamm.BaseSolver): """Solve a discretised model, using scipy._integrate.solve_ivp. Parameters ---------- method : str, optional The method to ...
[ "pybamm.SolverError", "pybamm.citations.register", "numpy.any", "numpy.max", "numpy.array", "pybamm.Solution" ]
[((748, 794), 'pybamm.citations.register', 'pybamm.citations.register', (['"""virtanen2020scipy"""'], {}), "('virtanen2020scipy')\n", (773, 794), False, 'import pybamm\n'), ((1734, 1775), 'numpy.any', 'np.any', (['[self.method in implicit_methods]'], {}), '([self.method in implicit_methods])\n', (1740, 1775), True, 'im...
import sys, os import nltk import numpy as np class Patch(): def __init__(self): self.id = -1 self.parent_code = '' self.child_code = '' self.patches = [] self.verdict = False self.distance = 0 self.verdict_token = False pass def __repr__(self): ...
[ "numpy.sum", "numpy.asarray" ]
[((1726, 1745), 'numpy.asarray', 'np.asarray', (['patches'], {}), '(patches)\n', (1736, 1745), True, 'import numpy as np\n'), ((3701, 3759), 'numpy.sum', 'np.sum', (['[(1 if p.verdict else 0) for p in unified_patches]'], {}), '([(1 if p.verdict else 0) for p in unified_patches])\n', (3707, 3759), True, 'import numpy as...
import numpy as np import matplotlib.pyplot as plt #Dahlquist test #sol1ex = lambda t: np.exp(-t) #sol2ex = lambda t: np.exp(-2*t) #oscillator 1 sol1ex = lambda t: np.cos(t**2/2) sol2ex = lambda t: np.sin(t**2/2) #oscillator 2 #sol1ex = lambda t: np.exp(np.sin(t**2)) #sol2ex = lambda t: np.exp(np.cos(t**2)) name = 'O...
[ "numpy.fromfile", "numpy.zeros", "numpy.cos", "matplotlib.pyplot.tight_layout", "numpy.sin", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((329, 367), 'numpy.fromfile', 'np.fromfile', (["('../out/%s_snap_t' % name)"], {}), "('../out/%s_snap_t' % name)\n", (340, 367), True, 'import numpy as np\n'), ((390, 408), 'numpy.zeros', 'np.zeros', (['(nsnap,)'], {}), '((nsnap,))\n', (398, 408), True, 'import numpy as np\n'), ((553, 588), 'matplotlib.pyplot.subplot...
""" @author: yuboya """ ### pins position to be sent to robot ## from TransformationCalculation: import numpy as np import math def PointsToRobot(alpha, deltax,deltay,deltaz,xyzc): sina = math.sin(alpha) cosa = math.cos(alpha) pointrs = [] for pointc in xyzc: # ...
[ "math.cos", "numpy.array", "numpy.transpose", "math.sin" ]
[((222, 237), 'math.sin', 'math.sin', (['alpha'], {}), '(alpha)\n', (230, 237), False, 'import math\n'), ((250, 265), 'math.cos', 'math.cos', (['alpha'], {}), '(alpha)\n', (258, 265), False, 'import math\n'), ((396, 446), 'numpy.array', 'np.array', (['[cosa, -sina, 0, sina, cosa, 0, 0, 0, 1]'], {}), '([cosa, -sina, 0, ...
""" This is the script containing the calibration module, basically calculating homography matrix. This code and data is released under the Creative Commons Attribution-NonCommercial 4.0 International license (CC BY-NC.) In a nutshell: # The license is only for non-commercial use (commercial licenses can be obtain...
[ "cv2.findCirclesGrid", "cv2.SimpleBlobDetector_create", "cv2.findHomography", "cv2.medianBlur", "cv2.morphologyEx", "cv2.adaptiveThreshold", "cv2.SimpleBlobDetector_Params", "numpy.array", "numpy.zeros", "cv2.cvtColor", "matplotlib.pyplot.figure", "cv2.drawChessboardCorners", "cv2.getStructu...
[((1681, 1704), 'cv2.medianBlur', 'cv2.medianBlur', (['img', '(15)'], {}), '(img, 15)\n', (1695, 1704), False, 'import cv2\n'), ((1742, 1837), 'cv2.adaptiveThreshold', 'cv2.adaptiveThreshold', (['img', '(255)', 'cv2.ADAPTIVE_THRESH_GAUSSIAN_C', 'cv2.THRESH_BINARY', '(121)', '(0)'], {}), '(img, 255, cv2.ADAPTIVE_THRESH_...
"""Learn ideal points with the text-based ideal point model (TBIP). Let y_{dv} denote the counts of word v in document d. Let x_d refer to the ideal point of the author of document d. Then we model: theta, beta ~ Gamma(alpha, alpha) x, eta ~ N(0, 1) y_{dv} ~ Pois(sum_k theta_dk beta_kv exp(x_d * eta_kv). We perform...
[ "numpy.sqrt", "tensorflow.get_variable", "tensorflow.initializers.random_normal", "tensorflow.reduce_sum", "numpy.int32", "numpy.log", "numpy.argsort", "numpy.array", "tensorflow.nn.softplus", "tensorflow.gfile.MakeDirs", "tensorflow.reduce_mean", "tensorflow.sparse.to_dense", "tensorflow.se...
[((1743, 1820), 'absl.flags.DEFINE_float', 'flags.DEFINE_float', (['"""learning_rate"""'], {'default': '(0.01)', 'help': '"""Adam learning rate."""'}), "('learning_rate', default=0.01, help='Adam learning rate.')\n", (1761, 1820), False, 'from absl import flags\n'), ((1859, 1955), 'absl.flags.DEFINE_integer', 'flags.DE...
import copy import logging import numpy as np import six import tensorflow as tf from functools import wraps from contextlib import contextmanager from .backend_base import BackendBase, FunctionBase, DeviceDecorator try: from tensorflow.contrib.distributions import fill_triangular except: print("Cannot find fi...
[ "tensorflow.tile", "tensorflow.matrix_diag_part", "tensorflow.multiply", "tensorflow.einsum", "tensorflow.gradients", "tensorflow.nn.softplus", "tensorflow.nn.conv2d_transpose", "tensorflow.while_loop", "tensorflow.scan", "tensorflow.pow", "tensorflow.Session", "functools.wraps", "tensorflow...
[((899, 933), 'six.add_metaclass', 'six.add_metaclass', (['DeviceDecorator'], {}), '(DeviceDecorator)\n', (916, 933), False, 'import six\n'), ((1297, 1310), 'functools.wraps', 'wraps', (['method'], {}), '(method)\n', (1302, 1310), False, 'from functools import wraps\n'), ((1545, 1572), 'tensorflow.enable_eager_executio...
from __future__ import absolute_import, division, print_function import cv2 import pandas as pd import numpy as np import six import ubelt as ub from six.moves import zip_longest from os.path import join, dirname import warnings def multi_plot(xdata=None, ydata=[], **kwargs): r""" plots multiple lines, bars, ...
[ "numpy.sqrt", "sys.platform.startswith", "io.BytesIO", "colorsys.hsv_to_rgb", "matplotlib.collections.LineCollection", "numpy.array", "matplotlib.colors.CSS4_COLORS.keys", "numpy.isfinite", "cv2.imdecode", "matplotlib.pyplot.switch_backend", "netharn.util.imutil.ensure_float01", "netharn.util....
[((8034, 8054), 'numpy.array', 'np.array', (['ydata_list'], {}), '(ydata_list)\n', (8042, 8054), True, 'import numpy as np\n'), ((12667, 12686), 'matplotlib.rcParams.copy', 'mpl.rcParams.copy', ([], {}), '()\n', (12684, 12686), True, 'import matplotlib as mpl\n'), ((14038, 14099), 'matplotlib.font_manager.FontPropertie...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun Oct 30 20:11:19 2016 @author: stephen """ from __future__ import print_function from keras.models import Model from keras.utils import np_utils import numpy as np import os from keras.callbacks import ModelCheckpoint import pandas as pd import sys i...
[ "keras.optimizers.Adam", "keras.layers.pooling.GlobalAveragePooling1D", "numpy.unique", "keras.callbacks.ModelCheckpoint", "keras.layers.normalization.BatchNormalization", "keras.callbacks.ReduceLROnPlateau", "keras.layers.Dense", "keras.layers.Input", "keras.utils.np_utils.to_categorical", "keras...
[((420, 455), 'numpy.loadtxt', 'np.loadtxt', (['filename'], {'delimiter': '""","""'}), "(filename, delimiter=',')\n", (430, 455), True, 'import numpy as np\n'), ((1683, 1727), 'keras.utils.np_utils.to_categorical', 'np_utils.to_categorical', (['y_train', 'nb_classes'], {}), '(y_train, nb_classes)\n', (1706, 1727), Fals...
#!/usr/bin/env python from __future__ import division """MODULE_DESCRIPTION""" __author__ = "<NAME>" __copyright__ = "Copyright 2015, Cohrint" __credits__ = ["<NAME>", "<NAME>"] __license__ = "GPL" __version__ = "1.0.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Development" import logging from cop...
[ "matplotlib.pyplot.gcf", "matplotlib.pyplot.gca", "matplotlib.pyplot.colorbar", "numpy.log", "numpy.linspace", "mpl_toolkits.axes_grid1.make_axes_locatable", "copy.deepcopy", "matplotlib.pyplot.axis" ]
[((6354, 6372), 'matplotlib.pyplot.axis', 'plt.axis', (['"""scaled"""'], {}), "('scaled')\n", (6362, 6372), True, 'import matplotlib.pyplot as plt\n'), ((7099, 7113), 'copy.deepcopy', 'deepcopy', (['self'], {}), '(self)\n', (7107, 7113), False, 'from copy import deepcopy\n'), ((4944, 4972), 'mpl_toolkits.axes_grid1.mak...
from __future__ import print_function import numpy as np import pandas as pd from sklearn import metrics class Options(object): """Options used by the model.""" def __init__(self): # Model options. # Embedding dimension. self.embedding_size = 32 # The initial learning rate. ...
[ "pandas.read_csv", "numpy.random.choice", "sklearn.metrics.auc", "numpy.random.random", "numpy.array", "numpy.random.randint", "sklearn.metrics.log_loss", "sklearn.metrics.roc_curve", "numpy.ndarray" ]
[((2763, 2802), 'numpy.random.randint', 'np.random.randint', (['temp_sequence_length'], {}), '(temp_sequence_length)\n', (2780, 2802), True, 'import numpy as np\n'), ((5627, 5666), 'sklearn.metrics.roc_curve', 'metrics.roc_curve', (['y', 'pred'], {'pos_label': '(1)'}), '(y, pred, pos_label=1)\n', (5644, 5666), False, '...
from __future__ import division import pandas as pd import numpy as np import calendar import os.path as op import sys from datetime import datetime from dateutil.relativedelta import relativedelta from scipy.stats import percentileofscore from scipy.stats import scoreatpercentile, pearsonr from math import * import t...
[ "numpy.ones" ]
[((598, 667), 'numpy.ones', 'np.ones', (['(TARGET_FCST_EYR - TARGET_FCST_SYR + 1, LEAD_FINAL, ENS_NUM)'], {}), '((TARGET_FCST_EYR - TARGET_FCST_SYR + 1, LEAD_FINAL, ENS_NUM))\n', (605, 667), True, 'import numpy as np\n'), ((4583, 4670), 'numpy.ones', 'np.ones', (['(TARGET_FCST_EYR - TARGET_FCST_SYR + 1, LEAD_FINAL, ENS...
# -*- coding: utf-8 -*- """ obspy.io.nied.knet - K-NET/KiK-net read support for ObsPy ========================================================= Reading of the K-NET and KiK-net ASCII format as defined on http://www.kyoshin.bosai.go.jp. """ from __future__ import (absolute_import, division, print_function, ...
[ "obspy.Stream", "obspy.UTCDateTime.strptime", "numpy.array", "doctest.testmod", "obspy.Trace", "obspy.core.trace.Stats", "re.search" ]
[((3927, 3972), 'obspy.UTCDateTime.strptime', 'UTCDateTime.strptime', (['dt', '"""%Y/%m/%d %H:%M:%S"""'], {}), "(dt, '%Y/%m/%d %H:%M:%S')\n", (3947, 3972), False, 'from obspy import UTCDateTime, Stream, Trace\n'), ((6132, 6160), 're.search', 're.search', (['"""[0-9]*"""', 'freqstr'], {}), "('[0-9]*', freqstr)\n", (6141...
from sweeps.sweepFunctions import * import numpy as np def SMTBFSweep(SMTBFSweepInput,ourInput): myRange = SMTBFSweepInput["range"] if dictHasKey(SMTBFSweepInput,"range") else False myStickyRange=SMTBFSweepInput["sticky-range"] if dictHasKey(SMTBFSweepInput,"sticky-range") else False sticky=False if type(...
[ "numpy.arange" ]
[((926, 966), 'numpy.arange', 'np.arange', (['minimum', '(maximum + step)', 'step'], {}), '(minimum, maximum + step, step)\n', (935, 966), True, 'import numpy as np\n'), ((1074, 1114), 'numpy.arange', 'np.arange', (['minimum', '(maximum + step)', 'step'], {}), '(minimum, maximum + step, step)\n', (1083, 1114), True, 'i...
#!/usr/bin/env python3 # coding: utf-8 # author: <NAME> <<EMAIL>> import pandas as pd import numpy as np from itertools import islice from sklearn.utils.validation import check_X_y class KTopScoringPair: """ K-Top Scoring Pair classifier. This classifier evaluate maximum-likelihood estimation for P(X_i <...
[ "pandas.Series", "numpy.unique", "numpy.argmax", "multiprocessing.Pool", "copy.deepcopy", "pandas.DataFrame", "pandas.concat", "sklearn.utils.validation.check_X_y" ]
[((2475, 2490), 'sklearn.utils.validation.check_X_y', 'check_X_y', (['X', 'y'], {}), '(X, y)\n', (2484, 2490), False, 'from sklearn.utils.validation import check_X_y\n'), ((2594, 2627), 'numpy.unique', 'np.unique', (['y'], {'return_inverse': '(True)'}), '(y, return_inverse=True)\n', (2603, 2627), True, 'import numpy as...
# -*- coding: utf-8 -*- """ A data clustering widget for the Orange3. This is a data clustering widget for Orange3, that implements the OPTICS algorithm. OPTICS stands for "Ordering Points To Identify the Clustering Structure". This is a very useful algorithm for clustering data when the dataset is unlabel...
[ "Orange.widgets.utils.signals.Input", "numpy.hstack", "numpy.array", "Orange.widgets.utils.widgetpreview.WidgetPreview", "numpy.arange", "Orange.widgets.utils.slidergraph.SliderGraph", "Orange.widgets.utils.signals.Output", "pyqtgraph.functions.intColor", "Orange.widgets.settings.Setting", "Orange...
[((3836, 3855), 'Orange.widgets.settings.Setting', 'settings.Setting', (['(5)'], {}), '(5)\n', (3852, 3855), False, 'from Orange.widgets import settings\n'), ((3877, 3897), 'Orange.widgets.settings.Setting', 'settings.Setting', (['(11)'], {}), '(11)\n', (3893, 3897), False, 'from Orange.widgets import settings\n'), ((3...
# LSTM(GRU) 예시 : KODEX200 주가 (2010 ~ 현재)를 예측해 본다. # KODEX200의 종가와, 10일, 40일 이동평균을 이용하여 향후 10일 동안의 종가를 예측해 본다. # 과거 20일 (step = 20) 종가, 이동평균 패턴을 학습하여 예측한다. # 일일 주가에 대해 예측이 가능할까 ?? # # 2018.11.22, 아마추어퀀트 (조성현) # -------------------------------------------------------------------------- import tensorflow as tf import nump...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "numpy.array", "numpy.reshape", "tensorflow.placeholder", "tensorflow.contrib.layers.fully_connected", "tensorflow.Session", "matplotlib.pyplot.plot", "tensorflow.nn.rnn_cell.LSTMCell", "tensorflow.nn.dynamic_rnn", "matplotlib.pyplot.xlabel", "num...
[((1239, 1304), 'pandas.read_csv', 'pd.read_csv', (['"""StockData/^KS11.csv"""'], {'index_col': '(0)', 'parse_dates': '(True)'}), "('StockData/^KS11.csv', index_col=0, parse_dates=True)\n", (1250, 1304), True, 'import pandas as pd\n'), ((1310, 1335), 'pandas.DataFrame', 'pd.DataFrame', (["df['Close']"], {}), "(df['Clos...
import torch import torchvision import torchvision.transforms as transforms import torch.optim as optim import torch.nn as nn import torch.nn.functional as F import numpy as np from model_utils import * class down(nn.Module): """ A class for creating neural network blocks containing layers: Average P...
[ "torch.nn.functional.grid_sample", "torch.nn.ReflectionPad2d", "torch.load", "torch.stack", "torch.Tensor", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d", "torch.nn.functional.sigmoid", "torch.tensor", "numpy.linspace", "torch.cat", "torch.sum", "torch.nn.functional.interpolate", "nu...
[((9659, 9687), 'numpy.linspace', 'np.linspace', (['(0.125)', '(0.875)', '(7)'], {}), '(0.125, 0.875, 7)\n', (9670, 9687), True, 'import numpy as np\n'), ((2256, 2274), 'torch.nn.functional.avg_pool2d', 'F.avg_pool2d', (['x', '(2)'], {}), '(x, 2)\n', (2268, 2274), True, 'import torch.nn.functional as F\n'), ((4759, 480...
# -*- coding: utf-8 -*- """ In this file are all the needed functions to calculate an adaptive fractionation treatment plan. The value_eval and the result_calc function are the only ones that should be used This file requires all sparing factors to be known, therefore, it isnt suited to do active treatment planning ...
[ "numpy.mean", "numpy.sqrt", "scipy.stats.invgamma.fit", "numpy.delete", "numpy.argmax", "numpy.exp", "numpy.zeros", "numpy.outer", "numpy.var", "scipy.stats.truncnorm", "numpy.meshgrid", "time.time", "numpy.arange" ]
[((1290, 1357), 'scipy.stats.truncnorm', 'truncnorm', (['((low - mean) / sd)', '((upp - mean) / sd)'], {'loc': 'mean', 'scale': 'sd'}), '((low - mean) / sd, (upp - mean) / sd, loc=mean, scale=sd)\n', (1299, 1357), False, 'from scipy.stats import truncnorm\n'), ((1803, 1832), 'numpy.arange', 'np.arange', (['(1e-05)', '(...
import numpy as np np.deprecate(1) # E: No overload variant np.deprecate_with_doc(1) # E: incompatible type np.byte_bounds(1) # E: incompatible type np.who(1) # E: incompatible type np.lookfor(None) # E: incompatible type np.safe_eval(None) # E: incompatible type
[ "numpy.deprecate_with_doc", "numpy.deprecate", "numpy.lookfor", "numpy.who", "numpy.byte_bounds", "numpy.safe_eval" ]
[((20, 35), 'numpy.deprecate', 'np.deprecate', (['(1)'], {}), '(1)\n', (32, 35), True, 'import numpy as np\n'), ((63, 87), 'numpy.deprecate_with_doc', 'np.deprecate_with_doc', (['(1)'], {}), '(1)\n', (84, 87), True, 'import numpy as np\n'), ((113, 130), 'numpy.byte_bounds', 'np.byte_bounds', (['(1)'], {}), '(1)\n', (12...
import argparse from pathlib import Path import numpy as np import yaml # this script takes in a folder path and then recursively collects all # results.yaml files in that directory. It averages them and prints # summary statistics parser = argparse.ArgumentParser(description="Analyze the results") parser.add_argume...
[ "numpy.mean", "argparse.ArgumentParser", "pathlib.Path", "yaml.dump", "yaml.safe_load", "numpy.std" ]
[((244, 302), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Analyze the results"""'}), "(description='Analyze the results')\n", (267, 302), False, 'import argparse\n'), ((988, 1005), 'yaml.dump', 'yaml.dump', (['output'], {}), '(output)\n', (997, 1005), False, 'import yaml\n'), ((459, 4...
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # <NAME> <<EMAIL>> # Mon 18 Nov 21:38:19 2013 """Extension building for using this package """ import numpy from pkg_resources import resource_filename from bob.extension import Extension as BobExtension # forward the build_ext command from bob.extension from bob....
[ "bob.extension.Extension.__init__", "bob.extension.Library.__init__", "pkg_resources.resource_filename", "numpy.get_include", "distutils.version.LooseVersion" ]
[((1037, 1075), 'pkg_resources.resource_filename', 'resource_filename', (['__name__', '"""include"""'], {}), "(__name__, 'include')\n", (1054, 1075), False, 'from pkg_resources import resource_filename\n'), ((1584, 1628), 'bob.extension.Extension.__init__', 'BobExtension.__init__', (['self', '*args'], {}), '(self, *arg...
import numpy as np import math import time class PulsedProgramming: """ This class contains all the parameters for the Pulsed programming on a memristor model. After initializing the parameters values, start the simulation with self.simulate() Parameters ---------- max_voltage : float ...
[ "numpy.random.normal", "numpy.sum", "numpy.array", "time.time" ]
[((2523, 2564), 'numpy.random.normal', 'np.random.normal', (['(0)', 'variance_write', '(1000)'], {}), '(0, variance_write, 1000)\n', (2539, 2564), True, 'import numpy as np\n'), ((5167, 5178), 'time.time', 'time.time', ([], {}), '()\n', (5176, 5178), False, 'import time\n'), ((8053, 8095), 'numpy.sum', 'np.sum', (['[(1...
# Copyright (c) OpenMMLab. All rights reserved. import argparse import cv2 import mmcv import numpy as np import torch from torchvision.transforms import functional as F from mmdet.apis import init_detector from mmdet.datasets.pipelines import Compose try: import ffmpegcv except ImportError: raise ImportErro...
[ "mmcv.track_iter_progress", "argparse.ArgumentParser", "mmdet.apis.init_detector", "ffmpegcv.VideoWriter", "torch.from_numpy", "mmdet.datasets.pipelines.Compose", "mmcv.imshow", "numpy.zeros", "cv2.destroyAllWindows", "torch.no_grad", "torchvision.transforms.functional.normalize", "cv2.namedWi...
[((425, 513), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MMDetection video demo with GPU acceleration"""'}), "(description=\n 'MMDetection video demo with GPU acceleration')\n", (448, 513), False, 'import argparse\n'), ((1446, 1477), 'mmdet.datasets.pipelines.Compose', 'Compose', ...
import numpy as np import torch import matplotlib.pyplot as plt from icecream import ic def visualize_vector_field(policy, device, min_max = [[-1,-1],[1,1]], fig_number=1): min_x = min_max[0][0] max_x = min_max[1][0] min_y = min_max[0][1] max_y = min_max[1][1] n_sample = 100 x = np.linspace(m...
[ "icecream.ic", "numpy.reshape", "numpy.sqrt", "numpy.max", "numpy.stack", "matplotlib.pyplot.figure", "matplotlib.pyplot.streamplot", "numpy.linspace", "numpy.concatenate", "numpy.meshgrid", "numpy.shape", "numpy.nan_to_num", "matplotlib.pyplot.show" ]
[((947, 952), 'icecream.ic', 'ic', (['Y'], {}), '(Y)\n', (949, 952), False, 'from icecream import ic\n'), ((953, 958), 'icecream.ic', 'ic', (['X'], {}), '(X)\n', (955, 958), False, 'from icecream import ic\n'), ((1714, 1741), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 7)'}), '(figsize=(12, 7))\n',...
from __future__ import annotations from copy import copy, deepcopy from types import MappingProxyType from typing import ( Any, Union, Mapping, TypeVar, Callable, Iterable, Iterator, Sequence, TYPE_CHECKING, ) from pathlib import Path from functools import partial from itertools imp...
[ "squidpy.gr._utils._assert_spatial_basis", "skimage.util.img_as_float", "squidpy.pl.Interactive", "scanpy.logging.debug", "re.compile", "squidpy._docs.d.get_sections", "types.MappingProxyType", "squidpy.im._io._infer_dimensions", "dask.array.map_blocks", "xarray.concat", "numpy.array", "copy.d...
[((1741, 1763), 'typing.TypeVar', 'TypeVar', (['"""Interactive"""'], {}), "('Interactive')\n", (1748, 1763), False, 'from typing import Any, Union, Mapping, TypeVar, Callable, Iterable, Iterator, Sequence, TYPE_CHECKING\n'), ((7609, 7674), 'squidpy._docs.d.get_sections', 'd.get_sections', ([], {'base': '"""add_img"""',...
# -*- coding: utf-8 -*- # python3 make.py -loc "data/lines/1.csv" -width 3840 -height 2160 -overwrite # python3 make.py -loc "data/lines/1.csv" -width 3840 -height 2160 -rtl -overwrite # python3 combine.py # python3 make.py -data "data/lines/A_LEF.csv" -width 3840 -height 2160 -loc "data/lines/C.csv" -img "img/A.png" ...
[ "PIL.Image.fromarray", "PIL.Image.open", "argparse.ArgumentParser", "PIL.Image.new", "matplotlib.pyplot.plot", "PIL.ImageFont.truetype", "os.path.isfile", "PIL.ImageDraw.Draw", "numpy.linspace", "gizeh.Surface", "sys.exit", "matplotlib.pyplot.show" ]
[((1123, 1148), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1146, 1148), False, 'import argparse\n'), ((23531, 23580), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(a.WIDTH, a.HEIGHT)', 'a.BG_COLOR'], {}), "('RGB', (a.WIDTH, a.HEIGHT), a.BG_COLOR)\n", (23540, 23580), False, 'from PIL impor...
# -*- coding: utf-8 -*- """ Created on Mon Aug 10 14:31:17 2015 @author: <NAME>. Description: This script does CPU and GPU matrix element time complexity profiling. It has a function which applies the matrix element analysis for a given set of parameters, profiles the code and ...
[ "scipy.optimize.curve_fit", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.tick_params", "numpy.asarray", "math.log", "matplotlib.pyplot.figure", "numpy.linspace", "matplotlib.pyplot.tight_layout", "my_timer.timer", "...
[((496, 517), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (510, 517), False, 'import matplotlib\n'), ((1829, 1842), 'numpy.asarray', 'np.asarray', (['n'], {}), '(n)\n', (1839, 1842), True, 'import numpy as np\n'), ((1859, 1880), 'numpy.asarray', 'np.asarray', (['time_data'], {}), '(time_data)\...
# -*- coding: utf-8 -*- import os import numpy as np import sys import logging import csv # Setup logging logger = logging.getLogger(__name__) console_handle = logging.StreamHandler() console_handle.setLevel(logging.INFO) formatter = logging.Formatter('%(asctime)s: %(message)s', datefmt='%m-%d %H:%M') cons...
[ "logging.getLogger", "logging.StreamHandler", "csv.DictReader", "logging.Formatter", "numpy.array" ]
[((124, 151), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (141, 151), False, 'import logging\n'), ((170, 193), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (191, 193), False, 'import logging\n'), ((246, 314), 'logging.Formatter', 'logging.Formatter', (['"""%(asct...
# coding=utf-8 """ Script to generate city object. """ from __future__ import division import os import numpy as np import pickle import warnings import random import datetime import shapely.geometry.point as point import pycity_base.classes.Weather as weath import pycity_base.classes.demand.SpaceHeating as SpaceHeati...
[ "pycity_calc.environments.environment.EnvironmentExtended", "pycity_calc.toolbox.teaser_usage.teaser_use.create_teaser_typecity", "pycity_base.classes.demand.Occupancy.Occupancy", "pycity_calc.toolbox.mc_helpers.user.user_unc_sampling.calc_sampling_dhw_per_apartment", "pycity_calc.toolbox.modifiers.slp_th_m...
[((2465, 2541), 'os.path.join', 'os.path.join', (['src_path', '"""data"""', '"""BaseData"""', '"""Specific_Demand_Data"""', 'filename'], {}), "(src_path, 'data', 'BaseData', 'Specific_Demand_Data', filename)\n", (2477, 2541), False, 'import os\n'), ((2592, 2653), 'numpy.genfromtxt', 'np.genfromtxt', (['input_data_path'...
# <NAME>, March 2020 # Common code for PyTorch implementation of Copy-Pasting GAN import copy import itertools import matplotlib.pyplot as plt import numpy as np import os, platform, time import torch import torch.nn as nn import torch.nn.functional as F import torchvision import torchvision.transforms as transforms f...
[ "torchvision.transforms.CenterCrop", "os.listdir", "PIL.Image.open", "numpy.random.rand", "torchvision.transforms.ToPILImage", "numpy.random.choice", "PIL.Image.new", "numpy.sin", "os.path.join", "os.path.isfile", "numpy.array", "numpy.random.randint", "numpy.zeros", "PIL.ImageDraw.Draw", ...
[((1671, 1694), 'numpy.random.randint', 'np.random.randint', (['(1)', '(5)'], {}), '(1, 5)\n', (1688, 1694), True, 'import numpy as np\n'), ((1726, 1777), 'numpy.zeros', 'np.zeros', (['(height, width, channels)'], {'dtype': 'np.uint8'}), '((height, width, channels), dtype=np.uint8)\n', (1734, 1777), True, 'import numpy...
# -*- coding: utf-8 -*- """Richardson-Extrapolation.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1oNlSL2Vztk9Fc7tMBgPcL82WGaUuCY-A Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the me...
[ "numpy.array", "numpy.linspace", "numpy.polynomial.Polynomial", "pandas.DataFrame", "matplotlib.pyplot.subplots" ]
[((6212, 6226), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (6224, 6226), True, 'import matplotlib.pyplot as plt\n'), ((6259, 6303), 'numpy.polynomial.Polynomial', 'Polynomial', (['[2.0, 1.0, -6.0, -2.0, 2.5, 1.0]'], {}), '([2.0, 1.0, -6.0, -2.0, 2.5, 1.0])\n', (6269, 6303), False, 'from numpy.polyn...
"""The :mod:`mlshell.pipeline.steps` contains unified pipeline steps.""" import inspect import mlshell import numpy as np import pandas as pd import sklearn import sklearn.impute import sklearn.compose __all__ = ['Steps'] class Steps(object): """Unified pipeline steps. Parameters ---------- estim...
[ "sklearn.preprocessing.PolynomialFeatures", "mlshell.decomposition.PCA", "mlshell.preprocessing.FunctionTransformer", "sklearn.base.is_classifier", "inspect.stack", "mlshell.preprocessing.OneHotEncoder", "sklearn.preprocessing.KBinsDiscretizer", "mlshell.model_selection.ThresholdClassifier", "mlshel...
[((8958, 8991), 'numpy.full', 'np.full', (['x.shape[1]'], {'fill_value': '(1)'}), '(x.shape[1], fill_value=1)\n', (8965, 8991), True, 'import numpy as np\n'), ((5627, 5690), 'sklearn.compose.TransformedTargetRegressor', 'sklearn.compose.TransformedTargetRegressor', ([], {'regressor': 'estimator'}), '(regressor=estimato...
""" Sliding Window Matching ======================= Find recurring patterns in neural signals using Sliding Window Matching. This tutorial primarily covers the :func:`~.sliding_window_matching` function. """ ################################################################################################### # Overvie...
[ "numpy.mean", "neurodsp.utils.set_random_seed", "neurodsp.rhythm.sliding_window_matching", "neurodsp.plts.time_series.plot_time_series", "neurodsp.plts.rhythm.plot_swm_pattern", "neurodsp.utils.download.load_ndsp_data", "neurodsp.utils.norm.normalize_sig" ]
[((2026, 2044), 'neurodsp.utils.set_random_seed', 'set_random_seed', (['(0)'], {}), '(0)\n', (2041, 2044), False, 'from neurodsp.utils import set_random_seed, create_times\n'), ((2424, 2474), 'neurodsp.utils.download.load_ndsp_data', 'load_ndsp_data', (['"""sample_data_1.npy"""'], {'folder': '"""data"""'}), "('sample_d...
from __future__ import division from __future__ import print_function from __future__ import absolute_import import tensorflow as tf import numpy as np EPS = 1e-10 def get_required_argument(dotmap, key, message, default=None): val = dotmap.get(key, default) if val is default: raise ValueError(message)...
[ "numpy.clip", "numpy.mean", "numpy.median", "tensorflow.variable_scope", "numpy.ones", "numpy.log", "numpy.square", "numpy.exp", "numpy.zeros", "tensorflow.sqrt", "tensorflow.constant_initializer", "numpy.var" ]
[((724, 752), 'numpy.clip', 'np.clip', (['all_kls', '(0)', '(1 / EPS)'], {}), '(all_kls, 0, 1 / EPS)\n', (731, 752), True, 'import numpy as np\n'), ((1366, 1377), 'numpy.log', 'np.log', (['std'], {}), '(std)\n', (1372, 1377), True, 'import numpy as np\n'), ((1392, 1427), 'numpy.clip', 'np.clip', (['log_std', '(-100)', ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from numpy import array from numpy import isnan from numpy import isinf from numpy import ones from numpy import zeros from scipy.linalg import norm from scipy.sparse import diags from compas.numerical import ...
[ "numpy.ones", "numpy.array", "numpy.zeros", "compas.numerical.connectivity_matrix", "scipy.linalg.norm", "numpy.isnan", "scipy.sparse.diags", "numpy.isinf", "compas.numerical.normrow" ]
[((4682, 4715), 'compas.numerical.connectivity_matrix', 'connectivity_matrix', (['edges', '"""csr"""'], {}), "(edges, 'csr')\n", (4701, 4715), False, 'from compas.numerical import connectivity_matrix\n'), ((5333, 5362), 'numpy.ones', 'ones', (['(num_e, 1)'], {'dtype': 'float'}), '((num_e, 1), dtype=float)\n', (5337, 53...
# Built-in import os from glob import glob # Libs import numpy as np from tqdm import tqdm from natsort import natsorted # Own modules from data import data_utils from mrs_utils import misc_utils, process_block # Settings DS_NAME = 'spca' def get_images(data_dir, valid_percent=0.5, split=False): rgb_files = na...
[ "mrs_utils.misc_utils.float2str", "mrs_utils.misc_utils.make_dir_if_not_exist", "data.data_utils.patch_tile", "tqdm.tqdm", "os.path.join", "mrs_utils.vis_utils.compare_figures", "numpy.stack", "os.path.dirname", "numpy.random.seed", "os.path.basename", "data.data_utils.get_ds_stats" ]
[((1428, 1461), 'os.path.join', 'os.path.join', (['save_dir', '"""patches"""'], {}), "(save_dir, 'patches')\n", (1440, 1461), False, 'import os\n'), ((1466, 1509), 'mrs_utils.misc_utils.make_dir_if_not_exist', 'misc_utils.make_dir_if_not_exist', (['patch_dir'], {}), '(patch_dir)\n', (1498, 1509), False, 'from mrs_utils...
"""Solution of the exercises of Optimization of compute bound Python code""" import math import cmath import numpy as np import numexpr as ne import numba as nb # Needed here since it is used as global variables # Maximum strain at surface e0 = 0.01 # Width of the strain profile below the surface w = 5.0 # Python: C...
[ "numpy.sqrt", "math.sqrt", "numpy.tanh", "numpy.exp", "numpy.zeros", "numba.jit", "cmath.exp", "math.tanh", "numexpr.evaluate", "numba.prange", "numpy.arange" ]
[((4845, 4866), 'numba.jit', 'nb.jit', ([], {'parallel': '(True)'}), '(parallel=True)\n', (4851, 4866), True, 'import numba as nb\n'), ((517, 543), 'numpy.zeros', 'np.zeros', (['(h.size, k.size)'], {}), '((h.size, k.size))\n', (525, 543), True, 'import numpy as np\n'), ((1293, 1319), 'numpy.zeros', 'np.zeros', (['(h.si...
#!/usr/bin/env python # @author <NAME> <<EMAIL>>, Interactive Robotics Lab, Arizona State University from __future__ import absolute_import, division, print_function, unicode_literals import sys import rclpy from policy_translation.srv import NetworkPT, TuneNetwork from model_src.model import PolicyTranslationModel ...
[ "cv2.rectangle", "re.compile", "rclpy.spin_once", "rclpy.init", "rclpy.create_node", "numpy.save", "matplotlib.pyplot.imshow", "rclpy.ok", "cv_bridge.CvBridgeError", "model_src.model.PolicyTranslationModel", "numpy.asarray", "cv_bridge.boost.cv_bridge_boost.cvtColor2", "cv_bridge.CvBridge", ...
[((1287, 1366), 'model_src.model.PolicyTranslationModel', 'PolicyTranslationModel', ([], {'od_path': 'FRCNN_PATH', 'glove_path': 'GLOVE_PATH', 'special': 'None'}), '(od_path=FRCNN_PATH, glove_path=GLOVE_PATH, special=None)\n', (1309, 1366), False, 'from model_src.model import PolicyTranslationModel\n'), ((1196, 1208), ...
import time import queue import sys import numpy as np from scipy import optimize as sci_opt from .node import Node from .utilities import branch, is_integral class BNBTree: def __init__(self, x, y, inttol=1e-4, reltol=1e-4): """ Initiate a BnB Tree to solve the least squares regression problem ...
[ "numpy.sqrt", "numpy.ones", "numpy.sum", "queue.LifoQueue", "numpy.zeros", "scipy.optimize.lsq_linear", "numpy.concatenate", "numpy.nonzero", "queue.Queue", "time.time" ]
[((776, 797), 'numpy.sum', 'np.sum', (['(x * x)'], {'axis': '(0)'}), '(x * x, axis=0)\n', (782, 797), True, 'import numpy as np\n'), ((919, 932), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (930, 932), False, 'import queue\n'), ((963, 980), 'queue.LifoQueue', 'queue.LifoQueue', ([], {}), '()\n', (978, 980), False, ...
import argparse import cv2 import time import numpy as np from tf_pose.estimator import TfPoseEstimator from tf_pose.networks import get_graph_path, model_wh """ 封装并调用tf-openpose项目所提供的骨架信息识别接口 """ class TFPOSE: def __init__(self): # 0. 参数 self.fps_time = 0 self.frame_count = 0 # 1....
[ "argparse.ArgumentParser", "tf_pose.networks.get_graph_path", "tf_pose.estimator.TfPoseEstimator.draw_humans", "cv2.VideoWriter", "numpy.array", "numpy.zeros", "cv2.VideoCapture", "cv2.VideoWriter_fourcc", "tf_pose.networks.model_wh", "time.time" ]
[((443, 469), 'tf_pose.networks.model_wh', 'model_wh', (['self.args.resize'], {}), '(self.args.resize)\n', (451, 469), False, 'from tf_pose.networks import get_graph_path, model_wh\n'), ((628, 701), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""tf-pose-estimation realtime webcam"""'}), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Description: Choose a set of data points as weights and calculate RBF nodes for the first layer. Those are then used as inputs for a one-layer perceptron, which gives the output """ import numpy as np import pcn class rbf: """ radial basic function """ d...
[ "numpy.sqrt", "pcn.pcn", "numpy.array", "numpy.shape", "numpy.transpose", "numpy.random.shuffle" ]
[((1237, 1263), 'numpy.random.shuffle', 'np.random.shuffle', (['indices'], {}), '(indices)\n', (1254, 1263), True, 'import numpy as np\n'), ((1552, 1627), 'pcn.pcn', 'pcn.pcn', (['self.hidden', 'self.targets', 'self.eta', 'self.functype', 'self.traintype'], {}), '(self.hidden, self.targets, self.eta, self.functype, sel...
""" Convert data and then visualize Data Manupulation 1. Save metrics for validation and test data Save figures 1. Loss curve 2. plume dispersion and errors 3. metrics """ import pathlib import numpy as np import xarray as xr from numpy import ma import matplotlib as mpl import matplotlib.pyplot as plt import matplo...
[ "matplotlib.style.use", "numpy.arange", "matplotlib.colors.LogNorm", "pathlib.Path", "numpy.where", "numpy.asarray", "numpy.ma.masked_where", "matplotlib.pyplot.close", "numpy.linspace", "numpy.abs", "matplotlib.pyplot.savefig", "xarray.Dataset", "numpy.squeeze", "xarray.open_dataset", "...
[((1179, 1203), 'matplotlib.style.use', 'mpl.style.use', (['"""classic"""'], {}), "('classic')\n", (1192, 1203), True, 'import matplotlib as mpl\n'), ((1304, 1339), 'matplotlib.pyplot.rc', 'plt.rc', (['"""xtick"""'], {'labelsize': 'fontsize'}), "('xtick', labelsize=fontsize)\n", (1310, 1339), True, 'import matplotlib.p...
""" Copyright (c) 2018, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disc...
[ "numpy.sqrt", "actionlib.SimpleActionServer", "rospy.Service", "time.sleep", "cflib.positioning.motion_commander.MotionCommander", "pickle.loads", "rospy.Publisher" ]
[((2066, 2091), 'cflib.positioning.motion_commander.MotionCommander', 'MotionCommander', (['self._cf'], {}), '(self._cf)\n', (2081, 2091), False, 'from cflib.positioning.motion_commander import MotionCommander\n'), ((2158, 2232), 'rospy.Publisher', 'rospy.Publisher', (["(self._name + '/velocity_setpoint')", 'Vector3'],...
import os import numpy from numpy import * import math from scipy import integrate, linalg from matplotlib import pyplot from pylab import * from .integral import * def get_velocity_field(panels, freestream, X, Y): """ Computes the velocity field on a given 2D mesh. Parameters --------- panel...
[ "math.cos", "numpy.ones_like", "math.sin", "numpy.vectorize" ]
[((1089, 1114), 'numpy.vectorize', 'numpy.vectorize', (['integral'], {}), '(integral)\n', (1104, 1114), False, 'import numpy\n'), ((879, 910), 'numpy.ones_like', 'numpy.ones_like', (['X'], {'dtype': 'float'}), '(X, dtype=float)\n', (894, 910), False, 'import numpy\n'), ((967, 998), 'numpy.ones_like', 'numpy.ones_like',...
import sys import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D # NOQA import seaborn # NOQA from spherecluster import sample_vMF plt.ion() n_clusters = 3 mus = np.random.randn(3, n_clusters) mus, r = np.linalg.qr(mus, mode='reduced') kappas = [15, 15, 15] num_points_per...
[ "numpy.linalg.qr", "matplotlib.pyplot.figure", "matplotlib.pyplot.ion", "matplotlib.pyplot.axis", "numpy.random.randn", "spherecluster.sample_vMF", "matplotlib.pyplot.show" ]
[((177, 186), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (184, 186), True, 'from matplotlib import pyplot as plt\n'), ((209, 239), 'numpy.random.randn', 'np.random.randn', (['(3)', 'n_clusters'], {}), '(3, n_clusters)\n', (224, 239), True, 'import numpy as np\n'), ((249, 282), 'numpy.linalg.qr', 'np.linalg.q...
from typing import Optional import napari import napari.layers import numpy as np from napari.utils.geometry import project_point_onto_plane def point_in_bounding_box(point: np.ndarray, bounding_box: np.ndarray) -> bool: """Determine whether an nD point is inside an nD bounding box. Parameters ---------...
[ "numpy.atleast_2d", "numpy.cross", "numpy.asarray", "numpy.any", "numpy.squeeze", "numpy.array", "numpy.zeros", "numpy.einsum", "numpy.empty", "numpy.cos", "numpy.sin", "numpy.all", "napari.utils.geometry.project_point_onto_plane" ]
[((1901, 1922), 'numpy.atleast_2d', 'np.atleast_2d', (['vector'], {}), '(vector)\n', (1914, 1922), True, 'import numpy as np\n'), ((2006, 2030), 'numpy.array', 'np.array', (['start_position'], {}), '(start_position)\n', (2014, 2030), True, 'import numpy as np\n'), ((2050, 2072), 'numpy.array', 'np.array', (['end_positi...
import os import argparse import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm def plot_1d(X_train, Y_train, X_test, Y_test, mean=None, std=None, str_figure=None, show_fig=True): plt.rc('text', usetex=True) fig = plt.figure(figsize=(8, 6)) ax = fig.gca() ax.plot(X_test, Y_...
[ "os.path.exists", "numpy.abs", "argparse.ArgumentParser", "numpy.log", "os.path.join", "numpy.max", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "scipy.stats.norm.logpdf", "matplotlib.pyplot.tight_layout", "numpy.min", "os.mkdir", "matplotlib.pyplot.rc", "matplotlib.pyplot.show" ...
[((212, 239), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (218, 239), True, 'import matplotlib.pyplot as plt\n'), ((251, 277), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 6)'}), '(figsize=(8, 6))\n', (261, 277), True, 'import matplotlib.pyplot...
import collections import functools import json import logging import multiprocessing import os import time from collections import OrderedDict from queue import PriorityQueue, Empty from typing import List, Tuple, Any from itertools import cycle, islice import minerl.herobraine.env_spec from minerl.herobraine.hero imp...
[ "logging.getLogger", "numpy.clip", "numpy.asanyarray", "numpy.array", "copy.deepcopy", "minerl.data.version.assert_prefix", "os.listdir", "os.path.isdir", "minerl.data.util.forever", "collections.OrderedDict", "os.path.isfile", "cv2.cvtColor", "itertools.islice", "gym.envs.registration.spe...
[((393, 420), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (410, 420), False, 'import logging\n'), ((1962, 2006), 'multiprocessing.Pool', 'multiprocessing.Pool', (['self.number_of_workers'], {}), '(self.number_of_workers)\n', (1982, 2006), False, 'import multiprocessing\n'), ((4271, 431...
# -*- coding: utf-8 -*- import sys import numpy as np import torch from torch.autograd import Variable from pytorch2keras.converter import pytorch_to_keras import torchvision import os.path as osp import os os.environ['KERAS_BACKEND'] = 'tensorflow' from keras import backend as K K.clear_session() K.set_image_dim_or...
[ "tensorflow.gfile.GFile", "os.path.exists", "os.listdir", "tensorflow.Session", "numpy.asarray", "numpy.subtract", "numpy.max", "numpy.exp", "tensorflow.python.keras.backend.get_session", "tensorflow.GraphDef", "keras.backend.clear_session", "tensorflow.python.keras.models.load_model", "nump...
[((284, 301), 'keras.backend.clear_session', 'K.clear_session', ([], {}), '()\n', (299, 301), True, 'from keras import backend as K\n'), ((302, 332), 'keras.backend.set_image_dim_ordering', 'K.set_image_dim_ordering', (['"""tf"""'], {}), "('tf')\n", (326, 332), True, 'from keras import backend as K\n'), ((828, 837), 'n...
# -*- coding: utf-8 -*- """.. moduleauthor:: <NAME>""" import abc from copy import copy from dataclasses import dataclass from multiprocessing.managers import SharedMemoryManager from multiprocessing.shared_memory import SharedMemory from typing import Tuple, List, Optional, final, TypeVar, Generic from torch.utils.da...
[ "bann.b_data_functions.errors.custom_erors.KnownErrorBannData", "copy.copy", "numpy.array", "multiprocessing.managers.SharedMemoryManager", "numpy.ndarray", "numpy.dtype", "typing.TypeVar" ]
[((1243, 1259), 'typing.TypeVar', 'TypeVar', (['"""_TypD"""'], {}), "('_TypD')\n", (1250, 1259), False, 'from typing import Tuple, List, Optional, final, TypeVar, Generic\n'), ((509, 526), 'numpy.dtype', 'np.dtype', (['"""float"""'], {}), "('float')\n", (517, 526), True, 'import numpy as np\n'), ((3903, 3967), 'numpy.n...
import os import tensorflow as tf import numpy as np import mcubes from ops import * class ZGenerator: def __init__(self, sess, z_dim=128, ef_dim=32, gf_dim=128, dataset_name=None): self.sess = sess self.input_size = 64 self.z_dim = z_dim self.ef_dim = ef_dim self...
[ "tensorflow.tile", "numpy.reshape", "tensorflow.variable_scope", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.train.Saver", "os.path.join", "mcubes.marching_cubes", "tensorflow.train.get_checkpoint_state", "tensorflow.concat", "numpy.zeros", "os.path.basename", "re.finditer", ...
[((587, 642), 'tensorflow.placeholder', 'tf.placeholder', ([], {'shape': '[1, self.z_dim]', 'dtype': 'tf.float32'}), '(shape=[1, self.z_dim], dtype=tf.float32)\n', (601, 642), True, 'import tensorflow as tf\n'), ((669, 729), 'tensorflow.placeholder', 'tf.placeholder', ([], {'shape': '[self.batch_size, 3]', 'dtype': 'tf...
#/bin/python3 import numpy as np from scipy import signal as sig class pySparSDRCompress(): ''' Implementation of the SparSDR Compressor based on <NAME>., <NAME>., <NAME>., <NAME>., <NAME>., <NAME>. and <NAME>., 2019, June. Sparsdr: Sparsity-proportional backhaul and compute for sdrs. In Proceedings of ...
[ "numpy.abs", "numpy.fft.fft", "scipy.signal.windows.hann", "numpy.zeros", "numpy.empty", "numpy.concatenate", "numpy.expand_dims" ]
[((718, 756), 'scipy.signal.windows.hann', 'sig.windows.hann', (['self.nfft'], {'sym': '(False)'}), '(self.nfft, sym=False)\n', (734, 756), True, 'from scipy import signal as sig\n'), ((782, 820), 'numpy.expand_dims', 'np.expand_dims', (['self.windowVec'], {'axis': '(1)'}), '(self.windowVec, axis=1)\n', (796, 820), Tru...
from typing import Dict from numba import njit import numpy as np import matplotlib.pyplot as plt plt.rcParams['image.cmap'] = 'binary' def read_parameters(filename: str) -> Dict[str, float]: """Read parameters from a file to a dictionary and return it.""" parameters = {} with open(filename, "r") as file:...
[ "numpy.random.choice", "numpy.random.permutation", "numpy.random.random", "matplotlib.pyplot.tick_params", "numpy.argmax", "numpy.any", "numpy.max", "numpy.argsort", "numpy.sum", "numpy.zeros", "numpy.random.randint", "numpy.empty_like", "numpy.empty", "numpy.min", "matplotlib.pyplot.sub...
[((1140, 1187), 'numpy.empty', 'np.empty', (['population.shape[0]'], {'dtype': 'np.float32'}), '(population.shape[0], dtype=np.float32)\n', (1148, 1187), True, 'import numpy as np\n'), ((2136, 2189), 'numpy.empty', 'np.empty', (['(population.shape[0] // 2,)'], {'dtype': 'np.int32'}), '((population.shape[0] // 2,), dtyp...
#!/usr/bin/env python u""" radial_basis.py Written by <NAME> (01/2022) Interpolates data using radial basis functions CALLING SEQUENCE: ZI = radial_basis(xs, ys, zs, XI, YI, polynomial=0, smooth=smooth, epsilon=epsilon, method='inverse') INPUTS: xs: scaled input X data ys: scaled input Y data ...
[ "numpy.mean", "numpy.eye", "numpy.sqrt", "numpy.ones", "numpy.log", "numpy.ndim", "numpy.squeeze", "numpy.exp", "numpy.array", "numpy.zeros", "numpy.dot", "numpy.linalg.lstsq", "numpy.concatenate", "numpy.shape", "numpy.tri" ]
[((3345, 3359), 'numpy.squeeze', 'np.squeeze', (['xs'], {}), '(xs)\n', (3355, 3359), True, 'import numpy as np\n'), ((3369, 3383), 'numpy.squeeze', 'np.squeeze', (['ys'], {}), '(ys)\n', (3379, 3383), True, 'import numpy as np\n'), ((3393, 3407), 'numpy.squeeze', 'np.squeeze', (['zs'], {}), '(zs)\n', (3403, 3407), True,...
import os import sys import glob import time import copy import random import numpy as np import utils import logging import argparse import tensorflow as tf import tensorflow.keras as keras from model import NASNetworkCIFAR os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # os.environ['CUDA_VISIBLE_DEVICES'] = '1' # Basic m...
[ "tensorflow.train.Checkpoint", "model.NASNetworkCIFAR", "tensorflow.GradientTape", "tensorflow.nn.softmax", "tensorflow.keras.losses.CategoricalCrossentropy", "utils.AvgMeter", "utils.count_parameters_in_MB", "logging.info", "tensorflow.clip_by_global_norm", "argparse.ArgumentParser", "tensorflo...
[((346, 371), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (369, 371), False, 'import argparse\n'), ((1616, 1652), 'utils.create_exp_dir', 'utils.create_exp_dir', (['args.model_dir'], {}), '(args.model_dir)\n', (1636, 1652), False, 'import utils\n'), ((1692, 1803), 'logging.basicConfig', 'log...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : live_visualisation.py # Author : <NAME> <<EMAIL>> # Date : 10.04.2020 # Last Modified By: <NAME> <<EMAIL>> from djitellopy.realtime_plot.RealtimePlotter import * import redis import numpy as np import traceback import matplotlib #...
[ "numpy.array", "redis.StrictRedis" ]
[((484, 536), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'host': '"""localhost"""', 'port': '(6379)', 'db': '(0)'}), "(host='localhost', port=6379, db=0)\n", (501, 536), False, 'import redis\n'), ((2214, 2253), 'numpy.array', 'np.array', (['new_data[:-1]'], {'dtype': 'np.float'}), '(new_data[:-1], dtype=np.float)\...
import numpy as np from matplotlib.patches import Ellipse import matplotlib.pyplot as plt import matplotlib from matplotlib import cm from scipy import signal import matplotlib.image as mpimg # matplotlib.use('Agg') # define normalized 2D gaussian def gaus2d(x, y, mx, my, sx, sy): return 1. / (2. * np.pi * sx *...
[ "numpy.max", "numpy.exp", "numpy.linspace", "matplotlib.pyplot.figure", "numpy.dot", "numpy.meshgrid", "matplotlib.patches.Ellipse", "matplotlib.pyplot.show" ]
[((487, 572), 'matplotlib.patches.Ellipse', 'Ellipse', ([], {'xy': '(0, 0)', 'width': '(3.6)', 'height': '(1.8)', 'edgecolor': '"""r"""', 'lw': '(2)', 'facecolor': '"""none"""'}), "(xy=(0, 0), width=3.6, height=1.8, edgecolor='r', lw=2, facecolor='none'\n )\n", (494, 572), False, 'from matplotlib.patches import Elli...
# -*- coding: utf-8 -* """ :py:class:`GenerateLabelFieldReader` """ import numpy as np from senta.common.register import RegisterSet from senta.common.rule import DataShape, FieldLength, InstanceName from senta.data.field_reader.base_field_reader import BaseFieldReader from senta.data.util_helper import generate_pad_...
[ "senta.data.field_reader.base_field_reader.BaseFieldReader.__init__", "senta.data.util_helper.generate_pad_batch_data", "numpy.reshape", "senta.common.register.RegisterSet.tokenizer.__getitem__" ]
[((652, 709), 'senta.data.field_reader.base_field_reader.BaseFieldReader.__init__', 'BaseFieldReader.__init__', (['self'], {'field_config': 'field_config'}), '(self, field_config=field_config)\n', (676, 709), False, 'from senta.data.field_reader.base_field_reader import BaseFieldReader\n'), ((3848, 4025), 'senta.data.u...
import argparse,time,os,pickle import matplotlib.pyplot as plt import numpy as np from player import * plt.switch_backend('agg') np.set_printoptions(precision=2) class lemon: def __init__(self, std, num_sellers, num_actions, unit, minx): self.std = std self.unit = unit self.num_sellers = num_sellers self.nu...
[ "os.path.exists", "matplotlib.pyplot.savefig", "pickle.dump", "argparse.ArgumentParser", "os.makedirs", "matplotlib.pyplot.clf", "pickle.load", "numpy.asarray", "numpy.sum", "numpy.zeros", "numpy.random.randn", "matplotlib.pyplot.switch_backend", "time.time", "matplotlib.pyplot.subplots", ...
[((103, 128), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (121, 128), True, 'import matplotlib.pyplot as plt\n'), ((131, 163), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)'}), '(precision=2)\n', (150, 163), True, 'import numpy as np\n'), ((3454...
import pytest import gpmap from epistasis import models import numpy as np import pandas as pd import os def test__genotypes_to_X(test_data): # Make sure function catches bad genotype passes d = test_data[0] gpm = gpmap.GenotypePhenotypeMap(genotype=d["genotype"], p...
[ "os.path.exists", "gpmap.GenotypePhenotypeMap", "numpy.ones", "pandas.read_csv", "numpy.unique", "os.path.join", "numpy.min", "numpy.array", "numpy.array_equal", "pytest.raises", "epistasis.models.base._genotypes_to_X", "pandas.read_excel", "pandas.DataFrame", "epistasis.models.linear.Epis...
[((231, 307), 'gpmap.GenotypePhenotypeMap', 'gpmap.GenotypePhenotypeMap', ([], {'genotype': "d['genotype']", 'phenotype': "d['phenotype']"}), "(genotype=d['genotype'], phenotype=d['phenotype'])\n", (257, 307), False, 'import gpmap\n'), ((2639, 2680), 'epistasis.models.linear.EpistasisLinearRegression', 'models.linear.E...
# File name: spyview.py # # This example should be run with "execfile('spyview.py')" from numpy import pi, linspace, sinc, sqrt from lib.file_support.spyview import SpyView x_vec = linspace(-2 * pi, 2 * pi, 100) y_vec = linspace(-2 * pi, 2 * pi, 100) qt.mstart() data = qt.Data(name='testmeasurement') # to make the...
[ "numpy.sqrt", "numpy.linspace", "lib.file_support.spyview.SpyView" ]
[((183, 213), 'numpy.linspace', 'linspace', (['(-2 * pi)', '(2 * pi)', '(100)'], {}), '(-2 * pi, 2 * pi, 100)\n', (191, 213), False, 'from numpy import pi, linspace, sinc, sqrt\n'), ((222, 252), 'numpy.linspace', 'linspace', (['(-2 * pi)', '(2 * pi)', '(100)'], {}), '(-2 * pi, 2 * pi, 100)\n', (230, 252), False, 'from ...
import tensorflow as tf from tensorflow import keras import matplotlib.pyplot as plt import numpy as np import h5py import copy import time import os from whacc import utils def isnotebook(): try: c = str(get_ipython().__class__) shell = get_ipython().__class__.__name__ if 'colab' in c: ...
[ "whacc.utils.make_list", "matplotlib.pyplot.grid", "numpy.hstack", "time.sleep", "numpy.array", "whacc.utils.loop_segments", "tensorflow.keras.models.load_model", "copy.deepcopy", "tensorflow.cast", "os.remove", "matplotlib.pyplot.imshow", "numpy.mean", "numpy.repeat", "numpy.where", "nu...
[((950, 979), 'whacc.utils.loop_segments', 'utils.loop_segments', (['frames_1'], {}), '(frames_1)\n', (969, 979), False, 'from whacc import utils\n'), ((1494, 1517), 'numpy.asarray', 'np.asarray', (['array_group'], {}), '(array_group)\n', (1504, 1517), True, 'import numpy as np\n'), ((1989, 2036), 'whacc.utils.make_lis...
import numpy as np import apm_id as arx ###################################################### # Configuration ###################################################### # number of terms ny = 2 # output coefficients nu = 1 # input coefficients # number of inputs ni = 1 # number of outputs no = 1 # load data ...
[ "numpy.loadtxt", "apm_id.apm_id" ]
[((351, 398), 'numpy.loadtxt', 'np.loadtxt', (['"""data_step_test.csv"""'], {'delimiter': '""","""'}), "('data_step_test.csv', delimiter=',')\n", (361, 398), True, 'import numpy as np\n'), ((487, 515), 'apm_id.apm_id', 'arx.apm_id', (['data', 'ni', 'nu', 'ny'], {}), '(data, ni, nu, ny)\n', (497, 515), True, 'import apm...
import numpy as np import matplotlib.pyplot as plt import scipy.signal as signal plt.ion() bands = [2,3] single_channel_readout = 2 nsamp = 2**25 new_chans = False def etaPhaseModDegree(etaPhase): return (etaPhase+180)%360-180 #For resonator I/Q high sampled data use eta_mag + eta_phase found in eta scans for Q...
[ "scipy.signal.welch", "numpy.sqrt", "matplotlib.pyplot.ylabel", "numpy.round", "matplotlib.pyplot.xlabel", "numpy.asarray", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.ion", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((81, 90), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (88, 90), True, 'import matplotlib.pyplot as plt\n'), ((1465, 1488), 'numpy.asarray', 'np.asarray', (['freqs[band]'], {}), '(freqs[band])\n', (1475, 1488), True, 'import numpy as np\n'), ((1509, 1530), 'numpy.asarray', 'np.asarray', (['sbs[band]'], {}), ...
from typing import List, Tuple import numpy as np import pymeshfix import trimesh.voxel.creation from skimage.measure import marching_cubes from trimesh import Trimesh from trimesh.smoothing import filter_taubin from ..types import BinaryImage, LabelImage def _round_to_pitch(coordinate: np.ndarray, pitch: float) ->...
[ "numpy.mean", "numpy.ceil", "numpy.asarray", "numpy.min", "numpy.max", "numpy.array", "numpy.zeros", "trimesh.smoothing.filter_taubin", "numpy.argwhere", "trimesh.Trimesh", "skimage.measure.marching_cubes", "numpy.concatenate", "pymeshfix.clean_from_arrays", "numpy.round" ]
[((994, 1019), 'numpy.asarray', 'np.asarray', (['mesh.vertices'], {}), '(mesh.vertices)\n', (1004, 1019), True, 'import numpy as np\n'), ((1032, 1054), 'numpy.asarray', 'np.asarray', (['mesh.faces'], {}), '(mesh.faces)\n', (1042, 1054), True, 'import numpy as np\n'), ((1090, 1134), 'pymeshfix.clean_from_arrays', 'pymes...
# -*- coding: utf-8 -*- # Copyright 2018 The Blueoil 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 # # Unles...
[ "functools.lru_cache", "numpy.concatenate" ]
[((1271, 1304), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (1290, 1304), False, 'import functools\n'), ((1585, 1615), 'numpy.concatenate', 'np.concatenate', (['images'], {'axis': '(0)'}), '(images, axis=0)\n', (1599, 1615), True, 'import numpy as np\n'), ((1687, 1717), ...
import numpy as np import cv2 from matplotlib import pyplot as plt image = cv2.imread('champaigneditedcompressed.png') kernel = np.ones((20, 20), np.float32) / 25 img = cv2.filter2D(image, -1, kernel) gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) corners = cv2.goodFeaturesToTrack(gray,10,0.01,10) corners = np.int0(cor...
[ "matplotlib.pyplot.imshow", "numpy.ones", "cv2.goodFeaturesToTrack", "numpy.int0", "cv2.filter2D", "cv2.circle", "cv2.cvtColor", "cv2.imread", "matplotlib.pyplot.show" ]
[((77, 120), 'cv2.imread', 'cv2.imread', (['"""champaigneditedcompressed.png"""'], {}), "('champaigneditedcompressed.png')\n", (87, 120), False, 'import cv2\n'), ((171, 202), 'cv2.filter2D', 'cv2.filter2D', (['image', '(-1)', 'kernel'], {}), '(image, -1, kernel)\n', (183, 202), False, 'import cv2\n'), ((210, 247), 'cv2...
# -*- coding: utf-8 -*- """ Auto Encoder Example. Using an auto encoder on MNIST handwritten digits. References: <NAME>, <NAME>, <NAME>, and <NAME>. "Gradient-based learning applied to document recognition." Proceedings of the IEEE, 86(11):2278-2324, November 1998. Links: [MNIST Dataset] http://yann...
[ "matplotlib.pyplot.draw", "matplotlib.pyplot.waitforbuttonpress", "numpy.reshape", "tflearn.data_utils.shuffle", "tflearn.datasets.mnist.load_data", "tflearn.DNN", "matplotlib.pyplot.subplots", "tflearn.regression", "tflearn.fully_connected", "tflearn.input_data" ]
[((574, 603), 'tflearn.datasets.mnist.load_data', 'mnist.load_data', ([], {'one_hot': '(True)'}), '(one_hot=True)\n', (589, 603), True, 'import tflearn.datasets.mnist as mnist\n'), ((638, 675), 'tflearn.input_data', 'tflearn.input_data', ([], {'shape': '[None, 784]'}), '(shape=[None, 784])\n', (656, 675), False, 'impor...