code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#Prediction model using an instance of the Monte Carlo simulation and Brownian Motion equation
#import of libraries
import numpy as np
import pandas as pd
from pandas_datareader import data as wb
import matplotlib.pyplot as plt
from scipy.stats import norm
#ticker selection
def mainFunction(tradingSymbol):
data ... | [
"numpy.random.rand",
"pandas_datareader.data.DataReader",
"matplotlib.pyplot.plot",
"scipy.stats.norm.ppf",
"numpy.array",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"numpy.zeros_like",
"matplotlib.pyplot.show"
] | [((322, 336), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (334, 336), True, 'import pandas as pd\n'), ((621, 631), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (629, 631), True, 'import matplotlib.pyplot as plt\n'), ((782, 792), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (790, 792), Tr... |
import os
import csv
import numpy as np
from sklearn.utils import shuffle
## Read in frame data
samples = []
with open('/../opt/carnd_p3/data/driving_log.csv') as csvfile: #open the log file
reader = csv.reader(csvfile) #as a readable csv
for line in reader:
samples.append(line) #add each line of th... | [
"keras.layers.core.Flatten",
"keras.layers.convolutional.Cropping2D",
"sklearn.model_selection.train_test_split",
"sklearn.utils.shuffle",
"keras.layers.core.Lambda",
"keras.models.Sequential",
"numpy.array",
"keras.layers.convolutional.Conv2D",
"csv.reader",
"keras.layers.core.Dense"
] | [((399, 415), 'sklearn.utils.shuffle', 'shuffle', (['samples'], {}), '(samples)\n', (406, 415), False, 'from sklearn.utils import shuffle\n'), ((610, 650), 'sklearn.model_selection.train_test_split', 'train_test_split', (['samples'], {'test_size': '(0.2)'}), '(samples, test_size=0.2)\n', (626, 650), False, 'from sklear... |
import numpy as np
from visual_dynamics.policies import CameraTargetPolicy
class RandomOffsetCameraTargetPolicy(CameraTargetPolicy):
def __init__(self, env, target_env, camera_node_name, agent_node_name, target_node_name,
height=12.0, radius=16.0, angle=(-np.pi/4, np.pi/4), tightness=0.1, hra_in... | [
"numpy.sin",
"numpy.cos",
"numpy.random.uniform"
] | [((1027, 1058), 'numpy.random.uniform', 'np.random.uniform', (['*self.height'], {}), '(*self.height)\n', (1044, 1058), True, 'import numpy as np\n'), ((1135, 1166), 'numpy.random.uniform', 'np.random.uniform', (['*self.radius'], {}), '(*self.radius)\n', (1152, 1166), True, 'import numpy as np\n'), ((1242, 1272), 'numpy... |
"""
Area Weighted Interpolation
"""
import numpy as np
import geopandas as gpd
from ._vectorized_raster_interpolation import _fast_append_profile_in_gdf
import warnings
from scipy.sparse import dok_matrix, diags, coo_matrix
import pandas as pd
from tobler.util.util import _check_crs, _nan_check, _inf_check, _check_p... | [
"scipy.sparse.diags",
"tobler.util.util._check_crs",
"pandas.DataFrame",
"numpy.asarray",
"numpy.diag",
"numpy.array",
"numpy.zeros",
"numpy.dot",
"tobler.util.util._nan_check",
"numpy.isnan",
"geopandas.overlay",
"scipy.sparse.coo_matrix",
"warnings.warn",
"tobler.util.util._inf_check",
... | [((1390, 1422), 'tobler.util.util._check_crs', '_check_crs', (['source_df', 'target_df'], {}), '(source_df, target_df)\n', (1400, 1422), False, 'from tobler.util.util import _check_crs, _nan_check, _inf_check, _check_presence_of_crs\n'), ((2243, 2340), 'scipy.sparse.coo_matrix', 'coo_matrix', (['(areas, (ids_src, ids_t... |
import numpy as np
import pytest
import apexpy
import tempfile
import os
import h5py
from ttools import create_dataset, config, io, utils
map_periods = [np.timedelta64(10, 'm'), np.timedelta64(30, 'm'), np.timedelta64(1, 'h'), np.timedelta64(2, 'h')]
@pytest.fixture
def times():
yield np.datetime64('2010-01-01T... | [
"numpy.random.rand",
"numpy.array",
"numpy.arange",
"os.path.exists",
"numpy.datetime64",
"numpy.meshgrid",
"ttools.create_dataset.process_file",
"numpy.ceil",
"numpy.ones",
"h5py.File",
"numpy.isnan",
"ttools.io.open_tec_file",
"numpy.timedelta64",
"apexpy.Apex",
"tempfile.TemporaryDire... | [((376, 426), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""map_period"""', 'map_periods'], {}), "('map_period', map_periods)\n", (399, 426), False, 'import pytest\n'), ((1278, 1328), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""map_period"""', 'map_periods'], {}), "('map_period', map_perio... |
"""Randomize the minitaur_gym_alternating_leg_env when reset() is called.
The randomization include swing_offset, extension_offset of all legs that mimics
bent legs, desired_pitch from user input, battery voltage and motor damping.
"""
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(in... | [
"os.path.dirname",
"inspect.currentframe",
"os.sys.path.insert",
"numpy.random.uniform"
] | [((457, 489), 'os.sys.path.insert', 'os.sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (475, 489), False, 'import os, inspect\n'), ((372, 399), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (387, 399), False, 'import os, inspect\n'), ((429, 455), 'os.path.dirname', 'os... |
"""
The TensorProductState class and supporting functionality.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.... | [
"numpy.product",
"itertools.product",
"pygsti.modelmembers.states.state.State.__init__",
"numpy.take",
"numpy.kron",
"numpy.zeros",
"numpy.array",
"numpy.empty",
"pygsti.baseobjs.statespace.QubitSpace",
"numpy.concatenate",
"pygsti.modelmembers.term.RankOnePolynomialPrepTerm.create_from",
"num... | [((1791, 1826), 'pygsti.modelmembers.states.state.State.__init__', '_State.__init__', (['self', 'rep', 'evotype'], {}), '(self, rep, evotype)\n', (1806, 1826), True, 'from pygsti.modelmembers.states.state import State as _State\n'), ((2134, 2204), 'pygsti.baseobjs.statespace.StateSpace.from_nice_serialization', '_state... |
"""Treadmill hierarchical scheduler.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import collections
import datetime
import heapq
import itertools
import logging
import operator
import sys
import tim... | [
"logging.getLogger",
"itertools.chain",
"six.itervalues",
"heapq.merge",
"numpy.array",
"datetime.date.fromtimestamp",
"six.moves.xrange",
"datetime.timedelta",
"numpy.subtract",
"numpy.maximum",
"six.moves.zip",
"six.viewvalues",
"numpy.finfo",
"datetime.date.today",
"time.time",
"tim... | [((377, 404), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (394, 404), False, 'import logging\n'), ((551, 594), 'time.mktime', 'time.mktime', (['(2014, 1, 1, 0, 0, 0, 0, 0, 0)'], {}), '((2014, 1, 1, 0, 0, 0, 0, 0, 0))\n', (562, 594), False, 'import time\n'), ((8874, 8904), 'six.add_meta... |
#! /usr/bin/env python
import tensorflow as tf
import numpy as np
import os
import time
import datetime
from tensorflow.contrib import learn
from input_helpers import InputHelper
# Parameters
# ==================================================
# Eval Parameters
tf.flags.DEFINE_integer("batch_size", 64, "Batch Size (... | [
"tensorflow.flags.DEFINE_string",
"tensorflow.Graph",
"tensorflow.ConfigProto",
"tensorflow.initialize_all_variables",
"numpy.mean",
"tensorflow.flags.DEFINE_boolean",
"tensorflow.Session",
"numpy.concatenate",
"tensorflow.flags.DEFINE_integer",
"input_helpers.InputHelper"
] | [((265, 334), 'tensorflow.flags.DEFINE_integer', 'tf.flags.DEFINE_integer', (['"""batch_size"""', '(64)', '"""Batch Size (default: 64)"""'], {}), "('batch_size', 64, 'Batch Size (default: 64)')\n", (288, 334), True, 'import tensorflow as tf\n'), ((335, 425), 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (... |
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from keras import regularizers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D
from tensorflow.keras.preprocessing.image import Ima... | [
"matplotlib.pyplot.imshow",
"os.listdir",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Flatten",
"matplotlib.pyplot.plot",
"os.path.join",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"keras.preprocessing.image.load_img",
"tensorf... | [((834, 861), 'os.path.join', 'os.path.join', (['PATH', '"""train"""'], {}), "(PATH, 'train')\n", (846, 861), False, 'import os\n'), ((879, 911), 'os.path.join', 'os.path.join', (['PATH', '"""validation"""'], {}), "(PATH, 'validation')\n", (891, 911), False, 'import os\n'), ((923, 949), 'os.path.join', 'os.path.join', ... |
"""Machine Learning"""
import importlib
import numpy as np
import pandas as pd
import json
from jsonschema import validate
from sklearn.pipeline import make_pipeline
from timeflux.core.node import Node
from timeflux.core.exceptions import ValidationError, WorkerInterrupt
from timeflux.helpers.background import Task
fr... | [
"timeflux.core.exceptions.WorkerInterrupt",
"timeflux.helpers.clock.max_time",
"pandas.infer_freq",
"numpy.array",
"timeflux.helpers.clock.now",
"timeflux.core.exceptions.ValidationError",
"pandas.date_range",
"timeflux.helpers.background.Task",
"timeflux.helpers.port.make_event",
"numpy.asarray",... | [((3357, 3382), 'pandas.Timedelta', 'pd.Timedelta', (['buffer_size'], {}), '(buffer_size)\n', (3369, 3382), True, 'import pandas as pd\n'), ((8422, 8455), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.datetime64'}), '([], dtype=np.datetime64)\n', (8430, 8455), True, 'import numpy as np\n'), ((10524, 10576), 'sklear... |
# Copyright 2020 by <NAME>, Solis-Lemus Lab, WID.
# All rights reserved.
# This file is part of the BioKlustering Website.
import pandas as pd
from Bio import SeqIO
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.cluster ... | [
"pandas.Series",
"sklearn.cluster.KMeans",
"sklearn.decomposition.PCA",
"os.path.join",
"warnings.catch_warnings",
"numpy.array",
"sklearn.feature_extraction.text.TfidfVectorizer",
"warnings.simplefilter",
"Bio.SeqIO.parse",
"pandas.DataFrame",
"sklearn.cluster.MeanShift",
"sklearn.preprocessi... | [((546, 563), 'pandas.DataFrame', 'pd.DataFrame', (['[d]'], {}), '([d])\n', (558, 563), True, 'import pandas as pd\n'), ((573, 602), 'pandas.Series', 'pd.Series', (['d'], {'name': '"""Sequence"""'}), "(d, name='Sequence')\n", (582, 602), True, 'import pandas as pd\n'), ((658, 673), 'pandas.DataFrame', 'pd.DataFrame', (... |
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
concat,
)
import pandas._testing as tm
@pytest.mark.parametrize("func", ["cov", "corr"])
def test_ewm_pairwise_cov_corr(func, frame):
result = getattr(frame.ewm(span=10, min_periods=5), func)()
result = result.loc[(slice(Non... | [
"pandas.Series",
"pandas._testing.assert_series_equal",
"pytest.mark.parametrize",
"pandas._testing.assert_equal",
"pytest.raises",
"numpy.isnan",
"pandas.DataFrame",
"numpy.random.randn",
"numpy.arange"
] | [((128, 176), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""func"""', "['cov', 'corr']"], {}), "('func', ['cov', 'corr'])\n", (151, 176), False, 'import pytest\n'), ((520, 568), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""name"""', "['cov', 'corr']"], {}), "('name', ['cov', 'corr'])\n", (5... |
import math
import warnings
import numpy as np
import pandas as pd
from scipy.optimize import minimize
import scipy.stats
from scipy.stats import norm # edit
from scipy.special import log_ndtr
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, mean_absolute_error
def sp... | [
"scipy.special.log_ndtr",
"numpy.sqrt",
"numpy.squeeze",
"numpy.append",
"numpy.exp",
"numpy.dot",
"numpy.square",
"numpy.concatenate",
"numpy.finfo",
"warnings.warn",
"sklearn.linear_model.LinearRegression",
"numpy.var"
] | [((3180, 3214), 'numpy.append', 'np.append', (['beta_jac', '(sigma_jac / s)'], {}), '(beta_jac, sigma_jac / s)\n', (3189, 3214), True, 'import numpy as np\n'), ((443, 533), 'warnings.warn', 'warnings.warn', (['"""No censored observations; use regression methods for uncensored data"""'], {}), "(\n 'No censored observ... |
#Writing MOOG parameter file for the parameter, abundance, and error calculations.
#The parameter file only needs to be written once, at beginning of the routine, because the output
#files are overwritten with each itereation of the routine, only minimal output data are needed.
#
#The user can choose to have the param... | [
"numpy.array",
"numpy.core.records.fromarrays"
] | [((4833, 4850), 'numpy.array', 'np.array', (['new_arr'], {}), '(new_arr)\n', (4841, 4850), True, 'import numpy as np\n'), ((4881, 4931), 'numpy.core.records.fromarrays', 'np.core.records.fromarrays', (['new_arr.T'], {'dtype': 'dtype'}), '(new_arr.T, dtype=dtype)\n', (4907, 4931), True, 'import numpy as np\n')] |
import argparse
import numpy as np
from scipy.stats import linregress
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser()
parser.add_argument("--plot", action="store_const", default=False, const=True)
args = parser.parse_args()
data = np.loadtxt("../data/data.csv", skiprows=1, usecols=list(range(1,8)),... | [
"scipy.stats.linregress",
"numpy.mean",
"argparse.ArgumentParser",
"matplotlib.pyplot.gca",
"numpy.log",
"matplotlib.pyplot.plot",
"numpy.exp",
"numpy.sum",
"matplotlib.pyplot.show"
] | [((112, 137), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (135, 137), False, 'import argparse\n'), ((435, 449), 'numpy.log', 'np.log', (['deaths'], {}), '(deaths)\n', (441, 449), True, 'import numpy as np\n'), ((487, 515), 'scipy.stats.linregress', 'linregress', (['xdays', 'logdeaths'], {}),... |
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
if len(sys.argv) != 3:
print('usage: python plot_performances.py <group_csv> <indiv_csv>')
exit()
group_file = sys.argv[1]
indiv_file = sys.argv[2]
# Load the data
df_group = pd.read_csv(group_file)
df_i... | [
"seaborn.set",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"seaborn.boxplot",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"pandas.concat",
"numpy.arange",
"matp... | [((292, 315), 'pandas.read_csv', 'pd.read_csv', (['group_file'], {}), '(group_file)\n', (303, 315), True, 'import pandas as pd\n'), ((327, 350), 'pandas.read_csv', 'pd.read_csv', (['indiv_file'], {}), '(indiv_file)\n', (338, 350), True, 'import pandas as pd\n'), ((356, 398), 'pandas.concat', 'pd.concat', (['[df_group, ... |
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import flopy
def run():
workspace = os.path.join("lake")
# make sure workspace directory exists
if not os.path.exists(workspace):
os.makedirs(workspace)
fext = "png"
narg = len(sys.argv)
iarg = 0
if narg > 1:... | [
"os.path.exists",
"numpy.ones",
"flopy.modflow.ModflowPcg",
"os.makedirs",
"matplotlib.pyplot.clabel",
"matplotlib.pyplot.gcf",
"os.path.join",
"flopy.modflow.ModflowDis",
"os.getcwd",
"os.chdir",
"numpy.linspace",
"flopy.modflow.ModflowBas",
"numpy.savetxt",
"flopy.modflow.ModflowLpf",
... | [((115, 135), 'os.path.join', 'os.path.join', (['"""lake"""'], {}), "('lake')\n", (127, 135), False, 'import os\n'), ((526, 537), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (535, 537), False, 'import os\n'), ((581, 600), 'os.chdir', 'os.chdir', (['workspace'], {}), '(workspace)\n', (589, 600), False, 'import os\n'), (... |
"""
preprocess of (single lead) ecg signal:
band pass --> remove baseline --> find rpeaks --> denoise (mainly deal with motion artefact)
TODO:
1. motion artefact detection,
and slice the signal into continuous (no motion artefact within) segments
2. to add
References:
-----------
[1] https://github... | [
"scipy.ndimage.filters.median_filter",
"os.makedirs",
"numpy.where",
"os.path.join",
"multiprocessing.cpu_count",
"numpy.append",
"easydict.EasyDict",
"numpy.array",
"multiprocessing.Pool",
"copy.deepcopy",
"time.time"
] | [((2371, 2391), 'copy.deepcopy', 'deepcopy', (['PreprocCfg'], {}), '(PreprocCfg)\n', (2379, 2391), False, 'from copy import deepcopy\n'), ((3534, 3586), 'easydict.EasyDict', 'ED', (["{'filtered_ecg': filtered_ecg, 'rpeaks': rpeaks}"], {}), "({'filtered_ecg': filtered_ecg, 'rpeaks': rpeaks})\n", (3536, 3586), True, 'fro... |
import numpy as np
class ProjectionMatrix():
"""This matrix provides projection distortion.
Projection distortion is when things that are far away
appear smaller and things that are close appear bigger.
This works flawlessly so far. Takes in screen-size and
provides near- and far clipping. fov is f... | [
"numpy.sqrt",
"numpy.tan",
"numpy.array",
"numpy.cos",
"numpy.sin",
"numpy.matrix"
] | [((648, 673), 'numpy.tan', 'np.tan', (['(fov * np.pi / 2.0)'], {}), '(fov * np.pi / 2.0)\n', (654, 673), True, 'import numpy as np\n'), ((746, 948), 'numpy.array', 'np.array', (['[[screen_size[1] / (tanHalfFOV * screen_size[0]), 0, 0, 0], [0, 1.0 /\n tanHalfFOV, 0, 0], [0, 0, (-zNear - zFar) / zRange, 2.0 * zFar * z... |
import os
from functools import partial
from io import BytesIO
import numpy as np
import PIL.Image
import scipy.misc
import tensorflow as tf
graph = tf.Graph()
sess = tf.InteractiveSession(graph=graph)
model_fn = "./models/tensorflow_inception_graph.pb"
with tf.gfile.FastGFile(model_fn, 'rb') as f:
graph_def = tf... | [
"tensorflow.shape",
"tensorflow.gfile.FastGFile",
"tensorflow.gradients",
"tensorflow.reduce_mean",
"tensorflow.Graph",
"tensorflow.placeholder",
"tensorflow.GraphDef",
"tensorflow.maximum",
"tensorflow.square",
"tensorflow.nn.conv2d",
"numpy.abs",
"numpy.eye",
"tensorflow.InteractiveSession... | [((151, 161), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (159, 161), True, 'import tensorflow as tf\n'), ((169, 203), 'tensorflow.InteractiveSession', 'tf.InteractiveSession', ([], {'graph': 'graph'}), '(graph=graph)\n', (190, 203), True, 'import tensorflow as tf\n'), ((383, 423), 'tensorflow.placeholder', 'tf.p... |
from dataclasses import dataclass
from itertools import cycle
from typing import Dict, Union
import numpy as np
from ...layers.utils.color_transformations import (
transform_color,
transform_color_cycle,
)
@dataclass(eq=False)
class ColorCycle:
"""A dataclass to hold a color cycle for the fallback_color... | [
"numpy.array_equal",
"numpy.allclose",
"dataclasses.dataclass"
] | [((219, 238), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(False)'}), '(eq=False)\n', (228, 238), False, 'from dataclasses import dataclass\n'), ((1165, 1206), 'numpy.array_equal', 'np.array_equal', (['self.values', 'other.values'], {}), '(self.values, other.values)\n', (1179, 1206), True, 'import numpy as np\n'... |
# run local models given a path, default to './mxnet_models/'
import os
import argparse
import time
import mxnet as mx
import numpy as np
file_path = os.path.realpath(__file__)
dir_name = os.path.dirname(file_path)
os.environ["MXNET_CUDNN_AUTOTUNE_DEFAULT"] = "0"
class cuda_profiler_start():
import numba.cuda ... | [
"numpy.multiply",
"argparse.ArgumentParser",
"mxnet.nd.waitall",
"mxnet.random.uniform",
"mxnet.cpu",
"numpy.average",
"numba.cuda.profile_stop",
"numpy.min",
"numpy.max",
"os.path.realpath",
"os.path.dirname",
"numba.cuda.profile_start",
"mxnet.gpu",
"mxnet.mod.Module",
"mxnet.model.loa... | [((152, 178), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (168, 178), False, 'import os\n'), ((190, 216), 'os.path.dirname', 'os.path.dirname', (['file_path'], {}), '(file_path)\n', (205, 216), False, 'import os\n'), ((474, 561), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([],... |
# Copyright 2022 IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
"matplotlib.pyplot.ylabel",
"cl.orderZ",
"matplotlib.ticker.FuncFormatter",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.dot",
"itertools.permutations",
"cl.create_basic_problem",
"cl.Tableau",
"matplotlib.pyplot.savefig",
"cl.zeroX_algorithm1_cz",
... | [((2046, 2071), 'cl.ensureDirExists', 'cl.ensureDirExists', (['"""fig"""'], {}), "('fig')\n", (2064, 2071), False, 'import cl\n'), ((2103, 2132), 'cl.create_basic_problem', 'cl.create_basic_problem', (['(7)', '(0)'], {}), '(7, 0)\n', (2126, 2132), False, 'import cl\n'), ((2136, 2180), 'cl.generate_full_rank_weights', '... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | [
"copy.deepcopy",
"numpy.cross",
"math.sqrt",
"numpy.array",
"numpy.dot",
"numpy.linalg.norm"
] | [((1104, 1111), 'math.sqrt', 'sqrt', (['(3)'], {}), '(3)\n', (1108, 1111), False, 'from math import sqrt\n'), ((6940, 7002), 'copy.deepcopy', 'deepcopy', (['self._NthNeighbors[layer - 1][self._typeDict[PType]]'], {}), '(self._NthNeighbors[layer - 1][self._typeDict[PType]])\n', (6948, 7002), False, 'from copy import dee... |
import os, sys
import numpy as np
from sedflow import obs as Obs
from sedflow import train as Train
from provabgs import infer as Infer
from provabgs import models as Models
####################################################
# input
####################################################
sample = sys.argv[1]
itrain... | [
"provabgs.models.NMF",
"sedflow.train.mag2flux",
"provabgs.infer.nsaMCMC",
"provabgs.infer.LogUniformPrior",
"provabgs.infer.UniformPrior",
"sedflow.obs.load_nsa_data",
"os.path.join",
"sedflow.train.sigma_mag2flux",
"os.path.isfile",
"provabgs.infer.FlatDirichletPrior",
"numpy.isfinite",
"os.... | [((689, 722), 'sedflow.obs.load_nsa_data', 'Obs.load_nsa_data', ([], {'test_set': '(False)'}), '(test_set=False)\n', (706, 722), True, 'from sedflow import obs as Obs\n'), ((732, 798), 'numpy.load', 'np.load', (['"""/scratch/network/chhahn/sedflow/nsa_fail/fail.igals.npy"""'], {}), "('/scratch/network/chhahn/sedflow/ns... |
import os
from tqdm import tqdm
import cv2
import numpy as np
#pre process test data:
path = "raw_test_data/"
list_width = []
list_height = []
list_image = []
def pre_process():
print("analyze images")
for Files in tqdm(os.listdir(path)):
if "jpg" in Files:
#print(Files)
img = ... | [
"cv2.imwrite",
"os.listdir",
"cv2.copyMakeBorder",
"numpy.max",
"cv2.imread"
] | [((539, 557), 'numpy.max', 'np.max', (['list_width'], {}), '(list_width)\n', (545, 557), True, 'import numpy as np\n'), ((575, 594), 'numpy.max', 'np.max', (['list_height'], {}), '(list_height)\n', (581, 594), True, 'import numpy as np\n'), ((230, 246), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (240, 246)... |
# 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.ClusterSpec",
"tensorflow.device",
"numpy.median",
"tensorflow.train.Server",
"tensorflow.Variable",
"tensorflow.Session",
"tensorflow.test.main",
"tensorflow.global_variables_initializer",
"tensorflow.variable_axis_size_partitioner",
"tensorflow.train.replica_device_setter",
"... | [((1362, 1396), 'tensorflow.train.ClusterSpec', 'tf.train.ClusterSpec', (['cluster_dict'], {}), '(cluster_dict)\n', (1382, 1396), True, 'import tensorflow as tf\n'), ((4919, 4933), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (4931, 4933), True, 'import tensorflow as tf\n'), ((1085, 1114), 'portpicker.pick... |
import os
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
def read_dataset_from_npy(path):
""" Read dataset from .npy file
"""
data = np.load(path, allow_pickle=True)
return data[()]['X'], data[()]['y'], data[()]['train_idx'], data[()]['test_idx']
def read_dataset... | [
"sklearn.preprocessing.LabelEncoder",
"numpy.unique",
"os.path.join",
"numpy.array",
"numpy.zeros",
"numpy.isnan",
"numpy.concatenate",
"numpy.load",
"numpy.random.shuffle"
] | [((185, 217), 'numpy.load', 'np.load', (['path'], {'allow_pickle': '(True)'}), '(path, allow_pickle=True)\n', (192, 217), True, 'import numpy as np\n'), ((423, 463), 'os.path.join', 'os.path.join', (['ucr_root_dir', 'dataset_name'], {}), '(ucr_root_dir, dataset_name)\n', (435, 463), False, 'import os\n'), ((783, 816), ... |
import numpy as np
def denormalize(x, x_min, x_max):
if x_max is None:
_range = 1
else:
_range = (x_max - x_min)
return x * _range + x_min
def normalize(x, x_min=None, x_max=None, return_bounds=False, estimate_bounds_if_none=True):
# if the bounds should be estimated if none do it... | [
"numpy.mean",
"numpy.ones",
"numpy.std",
"numpy.max",
"numpy.zeros",
"numpy.min"
] | [((1035, 1053), 'numpy.mean', 'np.mean', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (1042, 1053), True, 'import numpy as np\n'), ((1064, 1081), 'numpy.std', 'np.std', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (1070, 1081), True, 'import numpy as np\n'), ((396, 413), 'numpy.min', 'np.min', (['x'], {'axis': '(0)'}), '(x... |
import glob
import os
import sys
from tempfile import TemporaryDirectory
import netCDF4
import numpy as np
import numpy.ma as ma
from all_products_fun import Check
from lidar_fun import LidarFun
from cloudnetpy import concat_lib
from cloudnetpy.instruments import ceilo2nc
SCRIPT_PATH = os.path.dirname(os.path.realpa... | [
"tempfile.TemporaryDirectory",
"numpy.ma.max",
"lidar_fun.LidarFun.__dict__.items",
"netCDF4.Dataset",
"numpy.ma.min",
"numpy.diff",
"os.path.realpath",
"cloudnetpy.instruments.ceilo2nc",
"lidar_fun.LidarFun",
"sys.path.append",
"cloudnetpy.concat_lib.concatenate_files",
"glob.glob"
] | [((334, 362), 'sys.path.append', 'sys.path.append', (['SCRIPT_PATH'], {}), '(SCRIPT_PATH)\n', (349, 362), False, 'import sys\n'), ((372, 415), 'glob.glob', 'glob.glob', (['f"""{SCRIPT_PATH}/data/cl61d/*.nc"""'], {}), "(f'{SCRIPT_PATH}/data/cl61d/*.nc')\n", (381, 415), False, 'import glob\n'), ((306, 332), 'os.path.real... |
# -*- coding: utf-8 -*-
import matplotlib as mpl
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from cell2cell.clustering import compute_linkage
from cell2cell.preprocessing.manipulate_dataframes import check_symmetry
from cell2cell.plotting.aesthetics import map_col... | [
"matplotlib.pyplot.savefig",
"numpy.ones",
"cell2cell.preprocessing.manipulate_dataframes.check_symmetry",
"seaborn.clustermap",
"cell2cell.clustering.compute_linkage",
"matplotlib.pyplot.close",
"numpy.zeros",
"cell2cell.plotting.aesthetics.map_colors_to_metadata",
"matplotlib.transforms.ScaledTran... | [((4765, 4783), 'cell2cell.preprocessing.manipulate_dataframes.check_symmetry', 'check_symmetry', (['df'], {}), '(df)\n', (4779, 4783), False, 'from cell2cell.preprocessing.manipulate_dataframes import check_symmetry\n'), ((12729, 12860), 'seaborn.clustermap', 'sns.clustermap', (['df'], {'col_linkage': 'linkage', 'row_... |
#! /usr/bin/env python
from __future__ import print_function
import pandas as pd
import numpy as np
import argparse
def generate_csv(start_index, fname):
cols = [
str('A' + str(i)) for i in range(start_index, NUM_COLS + start_index)
]
data = []
for i in range(NUM_ROWS):
vals = (np.ra... | [
"pandas.DataFrame",
"numpy.random.choice",
"argparse.ArgumentParser",
"sys.exit"
] | [((413, 450), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'data', 'columns': 'cols'}), '(data=data, columns=cols)\n', (425, 450), True, 'import pandas as pd\n'), ((540, 616), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate sample tables to test joins."""'}), "(description='... |
"""
Neighborhood Components Analysis (NCA)
Ported to Python from https://github.com/vomjom/nca
"""
from __future__ import absolute_import
import numpy as np
from six.moves import xrange
from sklearn.utils.validation import check_X_y
from .base_metric import BaseMetricLearner
EPS = np.finfo(float).eps
class NCA(Bas... | [
"numpy.zeros",
"six.moves.xrange",
"numpy.einsum",
"numpy.finfo",
"sklearn.utils.validation.check_X_y"
] | [((285, 300), 'numpy.finfo', 'np.finfo', (['float'], {}), '(float)\n', (293, 300), True, 'import numpy as np\n'), ((660, 675), 'sklearn.utils.validation.check_X_y', 'check_X_y', (['X', 'y'], {}), '(X, y)\n', (669, 675), False, 'from sklearn.utils.validation import check_X_y\n'), ((817, 840), 'numpy.zeros', 'np.zeros', ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import pandas as pd
from aif360.datasets import BinaryLabelDataset
from aif360.metrics import ClassificationMetric
def test_generalized_entropy_inde... | [
"numpy.log",
"numpy.array",
"numpy.sum",
"pandas.DataFrame",
"aif360.datasets.BinaryLabelDataset",
"aif360.metrics.ClassificationMetric"
] | [((336, 431), 'numpy.array', 'np.array', (['[[0, 1], [0, 0], [1, 0], [1, 1], [1, 0], [1, 0], [2, 1], [2, 0], [2, 1], [2, 1]\n ]'], {}), '([[0, 1], [0, 0], [1, 0], [1, 1], [1, 0], [1, 0], [2, 1], [2, 0], [\n 2, 1], [2, 1]])\n', (344, 431), True, 'import numpy as np\n'), ((698, 743), 'pandas.DataFrame', 'pd.DataFra... |
import sys
import numpy as np
import shutil
import time
import itertools as it
import collections
import ctypes as ct
import os
import copy
sys.path.append(os.path.dirname(__file__))
from ThreadStoppable import ThreadStoppable
class Idq801(object):
def __init__(
self,
deviceId=-1,
timesta... | [
"ctypes.c_int32",
"numpy.iinfo",
"time.sleep",
"numpy.array",
"copy.deepcopy",
"ctypes.CDLL",
"ThreadStoppable.ThreadStoppable",
"os.path.exists",
"numpy.searchsorted",
"numpy.where",
"numpy.max",
"os.path.isdir",
"os.mkdir",
"numpy.vstack",
"numpy.min",
"numpy.frombuffer",
"numpy.ab... | [((157, 182), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (172, 182), False, 'import os\n'), ((2118, 2129), 'time.time', 'time.time', ([], {}), '()\n', (2127, 2129), False, 'import time\n'), ((3264, 3276), 'ctypes.c_int32', 'ct.c_int32', ([], {}), '()\n', (3274, 3276), True, 'import ctypes... |
import numpy as np
import matplotlib.pyplot as plt
TOTAL = 200
STEP = 0.25
EPS = 0.1
INITIAL_THETA = [9, 14]
def func(x):
return 0.2 * x + 3
def generate_sample(total=TOTAL):
x = 0
while x < total * STEP:
yield func(x) + np.random.uniform(-1, 1) * np.random.uniform(2, 8)
x += STEP
def... | [
"numpy.abs",
"numpy.linalg.pinv",
"time.clock",
"matplotlib.pyplot.plot",
"numpy.empty",
"numpy.random.uniform",
"numpy.arange"
] | [((2136, 2168), 'numpy.arange', 'np.arange', (['(0)', '(TOTAL * STEP)', 'STEP'], {}), '(0, TOTAL * STEP, STEP)\n', (2145, 2168), True, 'import numpy as np\n'), ((2319, 2339), 'numpy.empty', 'np.empty', (['(TOTAL, 2)'], {}), '((TOTAL, 2))\n', (2327, 2339), True, 'import numpy as np\n'), ((2460, 2472), 'time.clock', 'tim... |
import random
import numpy as np
import itertools
import re
from collections import defaultdict
import os
def get_tags(s, open_delim='<', close_delim='/>'):
"""Iterator to spit out the xml style disfluency tags in a given string.
Keyword arguments:
s -- input string
"""
while True:
# Sear... | [
"itertools.chain",
"os.listdir",
"random.shuffle",
"numpy.asarray",
"random.seed",
"numpy.load",
"collections.defaultdict",
"re.findall",
"numpy.matrix",
"re.search"
] | [((3680, 3697), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3691, 3697), False, 'from collections import defaultdict\n'), ((12142, 12159), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (12153, 12159), False, 'from collections import defaultdict\n'), ((16551, 16568), 'c... |
from __future__ import print_function, division, absolute_import
import copy
import numpy as np
import skimage.draw
import skimage.measure
from .. import imgaug as ia
from .utils import normalize_shape, project_coords
# TODO functions: square(), to_aspect_ratio(), contains_point()
class BoundingBox(object):
""... | [
"numpy.clip",
"numpy.copy",
"numpy.uint8",
"numpy.allclose",
"copy.deepcopy",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"numpy.min",
"numpy.finfo",
"copy.copy",
"imgaug.augmentables.kps.Keypoint",
"numpy.round"
] | [((1845, 1879), 'numpy.empty', 'np.empty', (['(2, 2)'], {'dtype': 'np.float32'}), '((2, 2), dtype=np.float32)\n', (1853, 1879), True, 'import numpy as np\n'), ((14585, 14617), 'numpy.clip', 'np.clip', (['self.x1', '(0)', '(width - eps)'], {}), '(self.x1, 0, width - eps)\n', (14592, 14617), True, 'import numpy as np\n')... |
from typing import Callable, Tuple
import numpy as np
def posterior_factory(y: np.ndarray, sigma_y: float, sigma_theta: float) -> Tuple[Callable]:
"""The banana distribution is a distribution that exhibits a characteristic
banana-shaped ridge that resembles the posterior that can emerge from
models that ... | [
"numpy.random.normal",
"numpy.sqrt",
"numpy.hstack",
"numpy.square",
"numpy.sum",
"numpy.array"
] | [((1187, 1205), 'numpy.square', 'np.square', (['sigma_y'], {}), '(sigma_y)\n', (1196, 1205), True, 'import numpy as np\n'), ((1227, 1249), 'numpy.square', 'np.square', (['sigma_theta'], {}), '(sigma_theta)\n', (1236, 1249), True, 'import numpy as np\n'), ((2141, 2154), 'numpy.sum', 'np.sum', (['(y - p)'], {}), '(y - p)... |
import unittest
import numpy as np
from openmdao.utils.assert_utils import assert_near_equal
from wisdem.optimization_drivers.dakota_driver import DakotaOptimizer
try:
import dakota
except ImportError:
dakota = None
@unittest.skipIf(dakota is None, "only run if Dakota is installed.")
class Te... | [
"unittest.main",
"numpy.array",
"unittest.skipIf",
"wisdem.optimization_drivers.dakota_driver.DakotaOptimizer"
] | [((243, 310), 'unittest.skipIf', 'unittest.skipIf', (['(dakota is None)', '"""only run if Dakota is installed."""'], {}), "(dakota is None, 'only run if Dakota is installed.')\n", (258, 310), False, 'import unittest\n'), ((3093, 3108), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3106, 3108), False, 'import uni... |
#-*- coding: utf-8 -*-
#! /usr/bin/env python
'''
#------------------------------------------------------------
filename: lab4_runTFCurveFitting.py
This is an example for linear regression in tensorflow
Which is a curve fitting example
written by <NAME> @ Aug 2017
#---------------------------------------------... | [
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"tensorflow.cast",
"tensorflow.placeholder",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"tensorflow.Session",
"numpy.linspace",
"tensorflow.square",
"tensorflow.train.AdamOptimizer",
"tensorflow.cos",
"tensorflow.Variable",
"numpy.cos",
... | [((989, 1018), 'numpy.zeros', 'np.zeros', (['[xsize, total_size]'], {}), '([xsize, total_size])\n', (997, 1018), True, 'import numpy as np\n'), ((1028, 1057), 'numpy.zeros', 'np.zeros', (['[xsize, total_size]'], {}), '([xsize, total_size])\n', (1036, 1057), True, 'import numpy as np\n'), ((1197, 1234), 'numpy.cos', 'np... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
"os.makedirs",
"re.compile",
"aiida.manage.configuration.get_profile",
"os.path.join",
"numpy.load",
"numpy.save",
"os.remove"
] | [((903, 991), 're.compile', 're.compile', (['"""^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d+(\\\\+\\\\d{2}:\\\\d{2})?$"""'], {}), "(\n '^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d+(\\\\+\\\\d{2}:\\\\d{2})?$')\n", (913, 991), False, 'import re\n'), ((2693, 2766), 'os.path.joi... |
"""
matmul autotvm
[batch,in_dim] x [in_dim,out_dim]
search_matmul_config(batch,in_dim,out_dim,num_trials):
input: batch,in_dim,out_dim,num_trials
[batch,in_dim] x [in_dim,out_dim]
num_trials: num of trials, default: 1000
output: log (json format)
use autotvm to search configs for the matm... | [
"logging.getLogger",
"logging.StreamHandler",
"tvm.autotvm.apply_history_best",
"tvm.context",
"os.remove",
"tvm.autotvm.tuner.XGBTuner",
"os.path.exists",
"tvm.create_schedule",
"tvm.autotvm.LocalRunner",
"tvm.target.create",
"tvm.autotvm.get_config",
"tvm.nd.array",
"json.loads",
"tvm.su... | [((10268, 10299), 'os.path.exists', 'os.path.exists', (['output_log_file'], {}), '(output_log_file)\n', (10282, 10299), False, 'import os\n'), ((13700, 13726), 'os.remove', 'os.remove', (['output_log_file'], {}), '(output_log_file)\n', (13709, 13726), False, 'import os\n'), ((1554, 1613), 'tvm.placeholder', 'tvm.placeh... |
#!/usr/bin/env python
#
# This file is part of the Emotions project. The complete source code is
# available at https://github.com/luigivieira/emotions.
#
# Copyright (c) 2016-2017, <NAME> (http://www.luiz.vieira.nom.br)
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | [
"gabor.GaborBank",
"cv2.rectangle",
"cv2.imshow",
"cv2.destroyAllWindows",
"sys.exit",
"datetime.timedelta",
"faces.FaceDetector",
"argparse.ArgumentParser",
"cv2.line",
"data.FaceData",
"cv2.waitKey",
"collections.OrderedDict",
"numpy.ones",
"cv2.putText",
"cv2.getTextSize",
"datetime... | [((9815, 9838), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (9836, 9838), False, 'import cv2\n'), ((11030, 11071), 'cv2.getTextSize', 'cv2.getTextSize', (['text', 'font', 'scale', 'thick'], {}), '(text, font, scale, thick)\n', (11045, 11071), False, 'import cv2\n'), ((11123, 11181), 'cv2.putText... |
"""Semi continuous unit operations.
Unit operations that accept constant or box-shaped flow rate profile
and provide periodic flow rate profile.
"""
__all__ = ['AlternatingChromatography', 'ACC', 'PCC', 'PCCWithWashDesorption']
__version__ = '0.7.1'
__author__ = '<NAME>'
import typing as _typing
import numpy as _np
... | [
"numpy.ones_like",
"bio_rtd.utils.vectors.true_start",
"bio_rtd.utils.convolution.time_conv",
"numpy.ones",
"bio_rtd.utils.vectors.true_end",
"numpy.log",
"numpy.zeros_like",
"bio_rtd.utils.vectors.true_start_and_end",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.pad",
"numpy.zeros",
... | [((16197, 16210), 'numpy.array', '_np.array', (['[]'], {}), '([])\n', (16206, 16210), True, 'import numpy as _np\n'), ((54794, 54840), 'bio_rtd.utils.vectors.true_start_and_end', '_utils.vectors.true_start_and_end', (['(self._f > 0)'], {}), '(self._f > 0)\n', (54827, 54840), True, 'import bio_rtd.utils as _utils\n'), (... |
import os
import sys
import argparse
import copy
import numpy as np
import scipy.special
sys.path.append(os.getcwd())
def log_gaussian_pdf(theta, sigma=1, mu=0, ndim=None):
if ndim is None:
try:
ndim = len(theta)
except TypeError:
assert isinstance(theta, (float, int)), t... | [
"argparse.ArgumentParser",
"numpy.log",
"numpy.asarray",
"nnest.NestedSampler",
"os.getcwd",
"numpy.sum",
"copy.deepcopy"
] | [((107, 118), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (116, 118), False, 'import os\n'), ((2136, 2395), 'nnest.NestedSampler', 'NestedSampler', (['args.x_dim', 'loglike'], {'transform': 'transform', 'log_dir': 'args.log_dir', 'num_live_points': 'args.num_live_points', 'hidden_dim': 'args.hidden_dim', 'num_layers': ... |
from typing import Dict, Tuple
import numpy as np
def einsum(expr: str, *args: Tuple[np.ndarray, ...], **kwargs) -> np.ndarray:
(a, b) = map(str.strip, expr.split("->"))
a_ = list(
map(lambda s: list(map(str.strip, s.split(","))), map(str.strip, a.split(";")))
)
b_ = list(map(str.strip, b.spli... | [
"numpy.einsum"
] | [((846, 879), 'numpy.einsum', 'np.einsum', (['expr_', '*args'], {}), '(expr_, *args, **kwargs)\n', (855, 879), True, 'import numpy as np\n')] |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
class _LinearModel(object):
def __init__(self):
self.w = None
def fit(self, x, y):
pass
def predict(self, x):
return np.dot(x, self.w)
def cost(self, x... | [
"numpy.mean",
"numpy.abs",
"numpy.eye",
"numpy.linalg.pinv",
"scipy.stats.multivariate_normal.pdf",
"numpy.argmax",
"numpy.argsort",
"numpy.sum",
"numpy.dot",
"numpy.zeros",
"numpy.vstack",
"numpy.cov",
"numpy.transpose"
] | [((277, 294), 'numpy.dot', 'np.dot', (['x', 'self.w'], {}), '(x, self.w)\n', (283, 294), True, 'import numpy as np\n'), ((798, 813), 'numpy.transpose', 'np.transpose', (['r'], {}), '(r)\n', (810, 813), True, 'import numpy as np\n'), ((1976, 1991), 'numpy.transpose', 'np.transpose', (['x'], {}), '(x)\n', (1988, 1991), T... |
import pandas as pd
import numpy as np
from copy import *
from bisect import *
from scipy.optimize import curve_fit
from sklearn.metrics import *
from collections import defaultdict as defd
import datetime,pickle
from DemandHelper import *
import warnings
warnings.filterwarnings("ignore")
####################... | [
"pandas.DataFrame",
"numpy.array",
"numpy.linspace",
"datetime.datetime.today",
"numpy.cumsum",
"warnings.filterwarnings"
] | [((265, 298), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (288, 298), False, 'import warnings\n'), ((2092, 2117), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (2115, 2117), False, 'import datetime, pickle\n'), ((4079, 4093), 'pandas.DataFrame'... |
import numpy as np
import spikemetrics.metrics as metrics
from .utils.thresholdcurator import ThresholdCurator
from .quality_metric import QualityMetric
import spiketoolkit as st
from spikemetrics.utils import Epoch, printProgressBar
from collections import OrderedDict
from .parameter_dictionaries import get_recording_... | [
"numpy.abs",
"collections.OrderedDict",
"spiketoolkit.postprocessing.get_unit_templates",
"numpy.asarray",
"numpy.std",
"spiketoolkit.postprocessing.get_unit_max_channels",
"numpy.random.RandomState"
] | [((2688, 2896), 'collections.OrderedDict', 'OrderedDict', (["[('snr_mode', 'mad'), ('snr_noise_duration', 10.0), (\n 'max_spikes_per_unit_for_snr', 1000), ('template_mode', 'median'), (\n 'max_channel_peak', 'both'), ('seed', None), ('verbose', False)]"], {}), "([('snr_mode', 'mad'), ('snr_noise_duration', 10.0),... |
# -*- coding:utf-8 -*-
# author: Xinge
# @file: spconv_unet.py
# @time: 2020/06/22 15:01
import time
import numpy as np
import spconv
import torch
import torch.nn.functional as F
from torch import nn
def conv3x3(in_planes, out_planes, stride=1, indice_key=None):
return spconv.SubMConv3d(in_planes, out_planes, ker... | [
"torch.nn.Sigmoid",
"torch.nn.ReLU",
"torch.nn.LeakyReLU",
"spconv.SparseInverseConv3d",
"torch.from_numpy",
"spconv.SubMConv3d",
"torch.nn.BatchNorm1d",
"numpy.array",
"spconv.SparseConvTensor",
"spconv.SparseConv3d",
"torch.nn.Linear",
"pdb.set_trace",
"torch.cat"
] | [((276, 396), 'spconv.SubMConv3d', 'spconv.SubMConv3d', (['in_planes', 'out_planes'], {'kernel_size': '(3)', 'stride': 'stride', 'padding': '(1)', 'bias': '(False)', 'indice_key': 'indice_key'}), '(in_planes, out_planes, kernel_size=3, stride=stride,\n padding=1, bias=False, indice_key=indice_key)\n', (293, 396), Fa... |
import numpy as np
from prml.dimreduction.pca import PCA
class BayesianPCA(PCA):
def fit(self, X, iter_max=100, initial="random"):
"""
empirical bayes estimation of pca parameters
Parameters
----------
X : (sample_size, n_features) ndarray
input data
i... | [
"numpy.mean",
"numpy.eye",
"numpy.copy",
"numpy.trace",
"numpy.size",
"numpy.diag",
"numpy.sum",
"numpy.linalg.inv"
] | [((699, 717), 'numpy.mean', 'np.mean', (['X'], {'axis': '(0)'}), '(X, axis=0)\n', (706, 717), True, 'import numpy as np\n'), ((735, 760), 'numpy.eye', 'np.eye', (['self.n_components'], {}), '(self.n_components)\n', (741, 760), True, 'import numpy as np\n'), ((1650, 1671), 'numpy.linalg.inv', 'np.linalg.inv', (['self.C'... |
""" Testing array utilities
"""
import sys
import numpy as np
from ..arrfuncs import as_native_array, pinv, eigh
from numpy.testing import (assert_array_almost_equal,
assert_array_equal)
from nose.tools import assert_true, assert_false, assert_equal, assert_raises
NATIVE_ORDER = '<' if ... | [
"numpy.testing.assert_array_almost_equal",
"numpy.linalg.pinv",
"numpy.arange",
"nose.tools.assert_true",
"numpy.linalg.eigh",
"nose.tools.assert_equal",
"nose.tools.assert_false",
"numpy.random.randn",
"numpy.testing.assert_array_equal"
] | [((447, 459), 'numpy.arange', 'np.arange', (['(5)'], {}), '(5)\n', (456, 459), True, 'import numpy as np\n'), ((474, 512), 'nose.tools.assert_equal', 'assert_equal', (['arr.dtype.byteorder', '"""="""'], {}), "(arr.dtype.byteorder, '=')\n", (486, 512), False, 'from nose.tools import assert_true, assert_false, assert_equ... |
"""Define the CSRmatrix class."""
import numpy as np
from scipy.sparse import coo_matrix
from six import iteritems
from openmdao.matrices.coo_matrix import COOMatrix
class CSRMatrix(COOMatrix):
"""
Sparse matrix in Compressed Row Storage format.
"""
def _build(self, num_rows, num_cols):
"""... | [
"numpy.argsort",
"numpy.lexsort",
"six.iteritems",
"scipy.sparse.coo_matrix"
] | [((679, 703), 'numpy.lexsort', 'np.lexsort', (['(cols, rows)'], {}), '((cols, rows))\n', (689, 703), True, 'import numpy as np\n'), ((1037, 1056), 'numpy.argsort', 'np.argsort', (['srtidxs'], {}), '(srtidxs)\n', (1047, 1056), True, 'import numpy as np\n'), ((1149, 1168), 'six.iteritems', 'iteritems', (['metadata'], {})... |
import math
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
class SimpleMLP(nn.Module):
"""Simple MLP function approximator for Q-Learning."""
def __init__(self, in_dim, out_dim, hidden_units=256, num_hidden_layers=1):
super().__init__()
self.input_layer... | [
"torch.nn.functional.linear",
"numpy.prod",
"torch.nn.functional.softmax",
"torch.nn.ReLU",
"math.sqrt",
"torch.sum",
"torch.nn.Linear",
"torch.empty",
"torch.randn",
"torch.flatten"
] | [((580, 612), 'torch.nn.Linear', 'nn.Linear', (['hidden_units', 'out_dim'], {}), '(hidden_units, out_dim)\n', (589, 612), False, 'from torch import nn\n'), ((1877, 1894), 'torch.randn', 'torch.randn', (['size'], {}), '(size)\n', (1888, 1894), False, 'import torch\n'), ((3022, 3037), 'numpy.prod', 'np.prod', (['in_dim']... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 <NAME>
# MIT License (https://opensource.org/licenses/MIT)
import logging
import numpy as np
import torch
from parallel_wavegan.layers import Conv1d
from parallel_wavegan.layers import Conv1d1x1
from parallel_wavegan.layers import Conv2d
from parallel... | [
"logging.basicConfig",
"parallel_wavegan.layers.UpsampleNetwork",
"numpy.prod",
"parallel_wavegan.layers.Conv1d1x1",
"parallel_wavegan.layers.Conv1d",
"parallel_wavegan.layers.Conv2d",
"torch.randn"
] | [((418, 536), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s')\n", (437, 536), False, 'import logging\n')... |
# Copyright 2020 The Tilt Brush Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | [
"numpy.array",
"numpy.linalg.norm",
"sys.exit",
"numpy.cov",
"numpy.mean",
"os.path.exists",
"numpy.histogram",
"argparse.ArgumentParser",
"tiltbrush.export.iter_meshes",
"tiltbrush.export.TiltBrushMesh.from_meshes",
"numpy.dot",
"os.unlink",
"io.StringIO",
"sys.stdout.flush",
"tiltbrush... | [((2232, 2271), 'sys.stdout.write', 'sys.stdout.write', (["('%-79s\\r' % text[:79])"], {}), "('%-79s\\r' % text[:79])\n", (2248, 2271), False, 'import sys\n'), ((2274, 2292), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (2290, 2292), False, 'import sys\n'), ((2314, 2353), 'sys.stdout.write', 'sys.stdout.wr... |
import h5py
import numpy as np
import os, pdb
import tensorflow as tf
from rllab.envs.base import EnvSpec
from rllab.envs.normalized_env import normalize as normalize_env
import rllab.misc.logger as logger
from sandbox.rocky.tf.algos.trpo import TRPO
from sandbox.rocky.tf.policies.gaussian_mlp_policy import Gaussian... | [
"numpy.clip",
"rllab.misc.logger.add_text_output",
"numpy.array",
"hgail.misc.datasets.RecognitionDataset",
"rllab.misc.logger.set_snapshot_mode",
"rllab.misc.logger.set_snapshot_dir",
"numpy.mean",
"numpy.savez",
"os.path.exists",
"hgail.algos.hgail_impl.Level",
"numpy.where",
"hgail.policies... | [((2367, 2398), 'numpy.savez', 'np.savez', (['filepath'], {'trajs': 'trajs'}), '(filepath, trajs=trajs)\n', (2375, 2398), True, 'import numpy as np\n'), ((4357, 4403), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.julia/v0.6/NGSIM/data"""'], {}), "('~/.julia/v0.6/NGSIM/data')\n", (4375, 4403), False, 'import os,... |
from __future__ import print_function, unicode_literals, absolute_import, division
from six.moves import range, zip, map, reduce, filter
from keras.layers import Input, Conv2D, Conv3D, Activation, Lambda
from keras.models import Model
from keras.layers.merge import Add, Concatenate
import tensorflow as tf
from keras i... | [
"keras.layers.merge.Concatenate",
"numpy.abs",
"six.moves.range",
"numpy.float32",
"re.compile",
"keras.layers.merge.Add",
"keras.layers.Lambda",
"numpy.max",
"keras.layers.Input",
"numpy.zeros",
"keras.layers.Activation",
"keras.models.Model",
"numpy.min",
"six.moves.zip"
] | [((11943, 12140), 're.compile', 're.compile', (['"""^(?P<model>resunet|unet)(?P<n_dim>\\\\d)(?P<prob_out>p)?_(?P<n_depth>\\\\d+)_(?P<kern_size>\\\\d+)_(?P<n_first>\\\\d+)(_(?P<n_channel_out>\\\\d+)out)?(_(?P<last_activation>.+)-last)?$"""'], {}), "(\n '^(?P<model>resunet|unet)(?P<n_dim>\\\\d)(?P<prob_out>p)?_(?P<n_d... |
r"""Train a neural network to predict feedback for a program string."""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import random
import numpy as np
from tqdm import tqdm
import torch
import torch.optim as optim
import torch.utils.... | [
"torch.manual_seed",
"argparse.ArgumentParser",
"os.makedirs",
"torch.nn.functional.binary_cross_entropy",
"os.path.join",
"numpy.zeros",
"torch.cuda.is_available",
"os.path.isdir",
"numpy.random.seed",
"torch.round",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.device"
] | [((677, 702), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (700, 702), False, 'import argparse\n'), ((1216, 1260), 'torch.device', 'torch.device', (["('cuda' if args.cuda else 'cpu')"], {}), "('cuda' if args.cuda else 'cpu')\n", (1228, 1260), False, 'import torch\n'), ((1407, 1435), 'torch.ma... |
"""
Sparse Poisson Recovery (SPoRe) module for solving Multiple Measurement Vector
problem with Poisson signals (MMVP) by batch stochastic gradient ascent and
Monte Carlo integration
Authors: <NAME>, <NAME>
Reference:
[1] <NAME>, <NAME>, <NAME>, and <NAME>, "Extreme Compressed
Sensing of Poisson Rates from Multip... | [
"numpy.mean",
"numpy.random.default_rng",
"numpy.ones",
"numpy.random.choice",
"numpy.size",
"numpy.log",
"numpy.any",
"numpy.max",
"numpy.sum",
"numpy.zeros",
"numpy.array",
"numpy.isnan",
"numpy.random.seed",
"numpy.einsum",
"numpy.linalg.norm",
"numpy.shape",
"time.time"
] | [((5468, 5479), 'numpy.shape', 'np.shape', (['Y'], {}), '(Y)\n', (5476, 5479), True, 'import numpy as np\n'), ((5488, 5508), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (5502, 5508), True, 'import numpy as np\n'), ((5530, 5563), 'numpy.zeros', 'np.zeros', (['(self.N, self.max_iter)'], {}), '((sel... |
#! /usr/bin/env python
# -*- coding:utf8 -*-
#
# pw_classes.py
#
# This file is part of pyplanes, a software distributed under the MIT license.
# For any question, please contact one of the authors cited below.
#
# Copyright (c) 2020
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# Permission is hereby g... | [
"pyPLANES.core.multilayer.MultiLayer.__init__",
"numpy.linalg.solve",
"pyPLANES.core.multilayer.MultiLayer.update_frequency",
"numpy.delete",
"pyPLANES.core.calculus.PwCalculus.update_frequency",
"mediapack.Air",
"numpy.exp",
"numpy.zeros",
"pyPLANES.core.calculus.PwCalculus.__init__",
"pyPLANES.p... | [((1311, 1316), 'mediapack.Air', 'Air', ([], {}), '()\n', (1314, 1316), False, 'from mediapack import Air, PEM, EqFluidJCA\n'), ((2063, 2098), 'pyPLANES.core.calculus.PwCalculus.__init__', 'PwCalculus.__init__', (['self'], {}), '(self, **kwargs)\n', (2082, 2098), False, 'from pyPLANES.core.calculus import PwCalculus\n'... |
from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType
import numpy as np
import unittest
class testPerfForesightConsumerType(unittest.TestCase):
def setUp(self):
self.agent = PerfForesightConsumerType()
self.agent_infinite = PerfForesightConsumerType(cycles=0)
PF_... | [
"numpy.mean",
"HARK.ConsumptionSaving.ConsIndShockModel.PerfForesightConsumerType"
] | [((214, 241), 'HARK.ConsumptionSaving.ConsIndShockModel.PerfForesightConsumerType', 'PerfForesightConsumerType', ([], {}), '()\n', (239, 241), False, 'from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType\n'), ((272, 307), 'HARK.ConsumptionSaving.ConsIndShockModel.PerfForesightConsumerType', 'P... |
from PIL import Image
from math import sqrt
import numpy as np
import time
import matplotlib.backends.backend_tkagg
import matplotlib.pyplot as plt
class Point:
x: float
y: float
f: float
h: float
g: float
def __init__(self, x, y, f):
self.x = x
self.y = y
... | [
"PIL.Image.open",
"matplotlib.pyplot.savefig",
"math.sqrt",
"numpy.zeros",
"time.time",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((2189, 2234), 'math.sqrt', 'sqrt', (['((point.x - x) ** 2 + (point.y - y) ** 2)'], {}), '((point.x - x) ** 2 + (point.y - y) ** 2)\n', (2193, 2234), False, 'from math import sqrt\n'), ((6777, 6788), 'time.time', 'time.time', ([], {}), '()\n', (6786, 6788), False, 'import time\n'), ((7223, 7248), 'numpy.zeros', 'np.ze... |
#Author <NAME>
import time
import rnnoise
import numpy as np
def time_rnnoise(rounds=1000):
a = rnnoise.RNNoise()
timer = 0.0
st = time.time()
for i in range(rounds):
inp = np.random.bytes(960)
timer = (time.time() - st)
print(timer)
st = time.time()
for i in range(rounds):
inp = np.random.bytes(960)
va,o... | [
"rnnoise.RNNoise",
"time.time",
"numpy.random.bytes"
] | [((97, 114), 'rnnoise.RNNoise', 'rnnoise.RNNoise', ([], {}), '()\n', (112, 114), False, 'import rnnoise\n'), ((134, 145), 'time.time', 'time.time', ([], {}), '()\n', (143, 145), False, 'import time\n'), ((248, 259), 'time.time', 'time.time', ([], {}), '()\n', (257, 259), False, 'import time\n'), ((179, 199), 'numpy.ran... |
# Copyright (c) 2009-2020, quasardb SAS. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice,... | [
"numpy.amax",
"numpy.amin",
"numpy.unique",
"sys.exit",
"quasardb.ColumnInfo",
"quasardb.Cluster",
"numpy.random.randint",
"numpy.random.uniform",
"quasardb.BatchColumnInfo",
"os.getpid",
"numpy.datetime64",
"numpy.timedelta64",
"builtins.int",
"socket.gethostname",
"traceback.print_exc"... | [((2039, 2050), 'time.time', 'time.time', ([], {}), '()\n', (2048, 2050), False, 'import time\n'), ((2085, 2096), 'time.time', 'time.time', ([], {}), '()\n', (2094, 2096), False, 'import time\n'), ((2928, 2973), 'numpy.random.uniform', 'np.random.uniform', (['(-100.0)', '(100.0)', 'price_count'], {}), '(-100.0, 100.0, ... |
import numpy as np
import ROOT
from dummy_distributions import dummy_pt_eta
counts, test_in1, test_in2 = dummy_pt_eta()
f = ROOT.TFile.Open("samples/testSF2d.root")
sf = f.Get("scalefactors_Tight_Electron")
xmin, xmax = sf.GetXaxis().GetXmin(), sf.GetXaxis().GetXmax()
ymin, ymax = sf.GetYaxis().GetXmin(), sf.GetYax... | [
"numpy.empty_like",
"dummy_distributions.dummy_pt_eta",
"ROOT.TFile.Open"
] | [((107, 121), 'dummy_distributions.dummy_pt_eta', 'dummy_pt_eta', ([], {}), '()\n', (119, 121), False, 'from dummy_distributions import dummy_pt_eta\n'), ((127, 167), 'ROOT.TFile.Open', 'ROOT.TFile.Open', (['"""samples/testSF2d.root"""'], {}), "('samples/testSF2d.root')\n", (142, 167), False, 'import ROOT\n'), ((347, 3... |
"""
Totally untested file. Will be removed in subsequent commits
"""
import tensorflow as tf
import matplotlib.image as mpimg
import numpy as np
from math import ceil, floor
import os
IMAGE_SIZE = 720
def central_scale_images(X_imgs, scales):
# Various settings needed for Tensorflow operation
boxes = np.zeros... | [
"tensorflow.image.transpose_image",
"os.listdir",
"tensorflow.reset_default_graph",
"tensorflow.image.rot90",
"math.ceil",
"math.floor",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.image.flip_up_down",
"tensorflow.global_variables_initializer",
"numpy.array",
"tensorflow.image.... | [((4951, 5006), 'os.listdir', 'os.listdir', (['"""/home/pallab/gestures-cnn/images/resized/"""'], {}), "('/home/pallab/gestures-cnn/images/resized/')\n", (4961, 5006), False, 'import os\n'), ((637, 687), 'numpy.array', 'np.array', (['[IMAGE_SIZE, IMAGE_SIZE]'], {'dtype': 'np.int32'}), '([IMAGE_SIZE, IMAGE_SIZE], dtype=... |
import unittest
import numpy as np
from astroNN.lamost import wavelength_solution, pseudo_continuum
class LamostToolsTestCase(unittest.TestCase):
def test_wavelength_solution(self):
wavelength_solution()
wavelength_solution(dr=5)
self.assertRaises(ValueError, wavelength_solution, dr=1)
... | [
"unittest.main",
"astroNN.lamost.wavelength_solution",
"numpy.ones"
] | [((432, 447), 'unittest.main', 'unittest.main', ([], {}), '()\n', (445, 447), False, 'import unittest\n'), ((197, 218), 'astroNN.lamost.wavelength_solution', 'wavelength_solution', ([], {}), '()\n', (216, 218), False, 'from astroNN.lamost import wavelength_solution, pseudo_continuum\n'), ((227, 252), 'astroNN.lamost.wa... |
from django.http import HttpResponse
from rest_framework.decorators import api_view
from rest_framework.decorators import parser_classes
from rest_framework.parsers import JSONParser
import numpy as np
import json
import os
from .utils.spectrogram_utils import SpectrogramUtils
from .utils.feature_extraction_utils impor... | [
"numpy.mean",
"os.listdir",
"numpy.ones",
"numpy.std",
"json.dumps",
"numpy.max",
"numpy.array",
"numpy.empty",
"rest_framework.decorators.parser_classes",
"numpy.min",
"json.load",
"rest_framework.decorators.api_view",
"json.dump"
] | [((626, 643), 'rest_framework.decorators.api_view', 'api_view', (["['GET']"], {}), "(['GET'])\n", (634, 643), False, 'from rest_framework.decorators import api_view\n'), ((645, 674), 'rest_framework.decorators.parser_classes', 'parser_classes', (['(JSONParser,)'], {}), '((JSONParser,))\n', (659, 674), False, 'from rest... |
#!/usr/bin/env python3
#
# base.py
"""
Base functionality.
"""
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
#
# Based on cyberpandas
# https://github.com/ContinuumIO/cyberpandas
# Copyright (c) 2018, Anaconda, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pr... | [
"numpy.unique",
"numpy.sort",
"numpy.asarray",
"numpy.isnan",
"numpy.concatenate",
"typing.TypeVar"
] | [((5872, 5885), 'typing.TypeVar', 'TypeVar', (['"""_A"""'], {}), "('_A')\n", (5879, 5885), False, 'from typing import Dict, Iterable, List, Optional, Sequence, SupportsFloat, Tuple, Type, TypeVar, Union, overload\n'), ((9643, 9675), 'typing.TypeVar', 'TypeVar', (['"""_F"""'], {'bound': '"""UserFloat"""'}), "('_F', boun... |
"""
view predication for point cloud,
Run valid_one_point_cloud first
"""
import torch
import numpy as np
import sys
import os
import pptk
# ------ Configurations ------
# path to pth file
pth_file = "../tmp/scene0015_00_vh_clean_2.pth.Random.100"
show_gt = False # show groundtruth or not; groudtruth draw ... | [
"numpy.array",
"torch.load",
"pptk.viewer"
] | [((2278, 2299), 'numpy.array', 'np.array', (['CLASS_COLOR'], {}), '(CLASS_COLOR)\n', (2286, 2299), True, 'import numpy as np\n'), ((2370, 2390), 'torch.load', 'torch.load', (['pth_file'], {}), '(pth_file)\n', (2380, 2390), False, 'import torch\n'), ((2987, 3018), 'pptk.viewer', 'pptk.viewer', (['coords', 'pred_color'],... |
import datetime
from pymongo import MongoClient
import pymongo
import pprint
try:
db = MongoClient("mongodb://localhost:27017")["hkust"]
f=0.05
try:
print("Querying Documents...")
listOfCourseWithWaitingListSize = db.course.aggregate([
{ "$unwind": "$sections" },
# { "$project": { "newProduct": {"$multi... | [
"datetime.datetime.strptime",
"keras.models.Sequential",
"keras.layers.Dense",
"pymongo.MongoClient",
"numpy.loadtxt",
"time.time",
"pprint.pprint"
] | [((4443, 4493), 'numpy.loadtxt', 'numpy.loadtxt', (['trainingDataFilename'], {'delimiter': '""","""'}), "(trainingDataFilename, delimiter=',')\n", (4456, 4493), False, 'import numpy\n'), ((4702, 4714), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (4712, 4714), False, 'from keras.models import Sequential\n... |
# encoding: utf-8
from __future__ import print_function
import os
import json
from collections import OrderedDict
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import Formatter
from jaqs.trade.analyze.report import Report
from jaqs.data import ... | [
"numpy.sqrt",
"numpy.logical_not",
"numpy.array",
"jaqs.data.basic.instrument.InstManager",
"pandas.to_datetime",
"numpy.arange",
"jaqs.util.group_df_to_dict",
"jaqs.trade.analyze.report.Report",
"numpy.zeros_like",
"numpy.max",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"jaqs.... | [((462, 510), 'jaqs.util.join_relative_path', 'jutil.join_relative_path', (['"""trade/analyze/static"""'], {}), "('trade/analyze/static')\n", (486, 510), True, 'import jaqs.util as jutil\n'), ((31059, 31071), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (31068, 31071), True, 'import numpy as np\n'), ((31104, 3115... |
# 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... | [
"tests.common.gen_random.random_gaussian",
"akg.utils.kernel_exec.mod_launch",
"numpy.zeros",
"numpy.full",
"akg.utils.kernel_exec.op_build_test",
"tests.common.tensorio.compare_tensor"
] | [((1566, 1602), 'numpy.full', 'np.full', (['output_shape', 'np.nan', 'dtype'], {}), '(output_shape, np.nan, dtype)\n', (1573, 1602), True, 'import numpy as np\n'), ((1616, 1673), 'akg.utils.kernel_exec.mod_launch', 'utils.mod_launch', (['mod', '(input, output)'], {'expect': 'bench_mark'}), '(mod, (input, output), expec... |
# LSTM with Variable Length Input Sequences to One Character Output
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.utils import np_utils
from keras.preprocessing.sequence import pad_sequences
from theano.tensor.shared_randomstreams import ... | [
"numpy.reshape",
"numpy.argmax",
"keras.models.Sequential",
"keras.layers.LSTM",
"keras.utils.np_utils.to_categorical",
"numpy.random.seed",
"keras.layers.Dense",
"keras.preprocessing.sequence.pad_sequences"
] | [((374, 394), 'numpy.random.seed', 'numpy.random.seed', (['(7)'], {}), '(7)\n', (391, 394), False, 'import numpy\n'), ((1226, 1279), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['dataX'], {'maxlen': 'max_len', 'dtype': '"""float32"""'}), "(dataX, maxlen=max_len, dtype='float32')\n", (1239, 1279), Fa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>.
@mail: <EMAIL>
"""
# from qc.__version__ import __version__
import georinex as gr
import numpy as np
from matplotlib.pyplot import figure, show
import matplotlib.pyplot as plt
obs = gr.load(
'tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_1... | [
"numpy.abs",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"georinex.load",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.figure",
"numpy.std",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((254, 377), 'georinex.load', 'gr.load', (['"""tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_15S_MO.rnx"""'], {'tlim': "['2021-11-03T05:30', '2021-11-03T07:30']"}), "('tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_15S_MO.rnx',\n tlim=['2021-11-03T05:30', '2021-11-03T07:30'])\n", (261, 377), True, 'import ... |
from copy import deepcopy
import numpy as np
import pybullet as p
import gym
from gym import spaces
from env.robot import Manipulator
from env.work import Work
class Env():
def __init__(self, reward,
step_max_pos = 0.002,
step_max_orn = 0.02,
initial_pos_noise = 0.0... | [
"env.work.Work",
"pybullet.resetSimulation",
"copy.deepcopy",
"pybullet.connect",
"numpy.linalg.norm",
"pybullet.setGravity",
"gym.spaces.Box",
"numpy.array",
"pybullet.setPhysicsEngineParameter",
"pybullet.configureDebugVisualizer",
"numpy.zeros",
"pybullet.disconnect",
"numpy.concatenate",... | [((458, 474), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (467, 474), True, 'import pybullet as p\n'), ((483, 531), 'pybullet.setPhysicsEngineParameter', 'p.setPhysicsEngineParameter', ([], {'enableFileCaching': '(0)'}), '(enableFileCaching=0)\n', (510, 531), True, 'import pybullet as p\n'), ((540, 5... |
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
nstep=200
nx=400
nv=3
u=np.zeros((nx,nv))
prim=np.zeros((nx,nv))
gam=5./3.
dx=1./nx
dt=1e-3
time=0
x=np.linspace(0,1,num=nx)
def ptou(pri):
u=np.zeros((nx,nv))
rho=pri[:,0]
v=pri[:,1]
prs=pri[:,2]
mom=rho*v
... | [
"numpy.sqrt",
"numpy.roll",
"matplotlib.pyplot.close",
"numpy.zeros",
"numpy.linspace",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec"
] | [((118, 136), 'numpy.zeros', 'np.zeros', (['(nx, nv)'], {}), '((nx, nv))\n', (126, 136), True, 'import numpy as np\n'), ((141, 159), 'numpy.zeros', 'np.zeros', (['(nx, nv)'], {}), '((nx, nv))\n', (149, 159), True, 'import numpy as np\n'), ((195, 220), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': 'nx'}), '(... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #To suppress warnings thrown by tensorflow
from time import sleep
import numpy as np
from cv2 import cv2
import pyautogui as pg
import Sudoku_Core as SC
import OCR
s = 513//9 #Size of board//9
fs = 25 #Size of the final image
def getBoard():
pg.click(266, 740)
sl... | [
"cv2.cv2.threshold",
"pyautogui.moveTo",
"pyautogui.screenshot",
"cv2.cv2.findContours",
"numpy.asarray",
"time.sleep",
"pyautogui.click",
"Sudoku_Core.solve",
"cv2.cv2.resize",
"numpy.zeros",
"Sudoku_Core.moves.items",
"cv2.cv2.boundingRect"
] | [((298, 316), 'pyautogui.click', 'pg.click', (['(266)', '(740)'], {}), '(266, 740)\n', (306, 316), True, 'import pyautogui as pg\n'), ((318, 326), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (323, 326), False, 'from time import sleep\n'), ((328, 346), 'pyautogui.click', 'pg.click', (['(266)', '(930)'], {}), '(266, 9... |
import argparse
import json
import numpy as np
import os
import torch
import data_
import models
import utils
from matplotlib import cm, pyplot as plt
from tensorboardX import SummaryWriter
from torch import optim
from torch.utils import data
from tqdm import tqdm
from utils import io
parser = argparse.ArgumentPars... | [
"numpy.array",
"utils.io.get_checkpoint_root",
"torch.cuda.is_available",
"data_.TestGridDataset",
"os.path.exists",
"tensorboardX.SummaryWriter",
"argparse.ArgumentParser",
"torch.mean",
"torch.set_default_tensor_type",
"matplotlib.pyplot.close",
"numpy.exp",
"utils.parse_activation",
"nump... | [((299, 324), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (322, 324), False, 'import argparse\n'), ((4721, 4749), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (4738, 4749), False, 'import torch\n'), ((4750, 4775), 'numpy.random.seed', 'np.random.seed', (['a... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"absl.gfile.Open",
"numpy.random.rand",
"scipy.io.loadmat",
"numpy.array",
"numpy.arange",
"re.search",
"numpy.reshape",
"tensorflow.Session",
"tensorflow.placeholder",
"absl.gfile.IsDirectory",
"absl.app.run",
"numpy.max",
"numpy.random.seed",
"numpy.min",
"matplotlib.pyplot.ylim",
"t... | [((836, 859), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (850, 859), False, 'import matplotlib\n'), ((1072, 1163), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""folder_name"""', '"""experiment4"""', '"""folder where to store all the data"""'], {}), "('folder_name', 'experiment4... |
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"numpy.ones",
"jax.nn.gelu",
"haiku.initializers.VarianceScaling",
"haiku.next_rng_key",
"haiku.LayerNorm",
"haiku.Linear"
] | [((1964, 2013), 'haiku.initializers.VarianceScaling', 'hk.initializers.VarianceScaling', (['self._init_scale'], {}), '(self._init_scale)\n', (1995, 2013), True, 'import haiku as hk\n'), ((2096, 2110), 'jax.nn.gelu', 'jax.nn.gelu', (['x'], {}), '(x)\n', (2107, 2110), False, 'import jax\n'), ((3945, 4016), 'haiku.LayerNo... |
from __future__ import absolute_import, division, print_function
import json
import logging
import os
import time
import importlib
import multiprocessing
import cv2
import fire
import logzero
from logzero import logger
import numpy as np
from rmexp import config, cvutils, dbutils, gabriel_pb2, client
from rmexp.sche... | [
"time.clock",
"fire.Fire",
"cv2.imdecode",
"logzero.logger.debug",
"rmexp.gabriel_pb2.Message",
"rmexp.dbutils.insert",
"rmexp.dbutils.get_or_create",
"os.getpid",
"numpy.frombuffer",
"importlib.import_module",
"os.path.dirname",
"time.time",
"rmexp.client.VideoClient",
"os.makedirs",
"l... | [((460, 491), 'logzero.loglevel', 'logzero.loglevel', (['logging.DEBUG'], {}), '(logging.DEBUG)\n', (476, 491), False, 'import logzero\n'), ((356, 458), 'logging.Formatter', 'logging.Formatter', ([], {'fmt': '"""%(asctime)s.%(msecs)03d - %(levelname)s: %(message)s"""', 'datefmt': '"""%H:%M:%S"""'}), "(fmt=\n '%(asct... |
import os
import numpy as np
from montepython.likelihood_class import Likelihood
import montepython.io_mp as io_mp
import warnings
import ccl_tools as tools
import pyccl as ccl
class covfefe(Likelihood):
# initialization routine
def __init__(self, path, data, command_line):
Likelihood.__init__(sel... | [
"montepython.likelihood_class.Likelihood.__init__",
"ccl_tools.get_cls_ccl",
"os.path.join",
"ccl_tools.get_cosmo_ccl",
"numpy.linalg.inv",
"ccl_tools.get_tracers_ccl"
] | [((297, 348), 'montepython.likelihood_class.Likelihood.__init__', 'Likelihood.__init__', (['self', 'path', 'data', 'command_line'], {}), '(self, path, data, command_line)\n', (316, 348), False, 'from montepython.likelihood_class import Likelihood\n'), ((1625, 1656), 'ccl_tools.get_cosmo_ccl', 'tools.get_cosmo_ccl', (['... |
from flask import Flask, render_template, request
# from .recommendation import *
# import pickle
import pandas as pd
import numpy as np
# import keras
# from keras.models import load_model
import pickle
def create_app():
# initializes our app
APP = Flask(__name__)
@APP.route('/')
def form():
... | [
"flask.render_template",
"flask.Flask",
"flask.request.form.get",
"numpy.array",
"pandas.DataFrame"
] | [((259, 274), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (264, 274), False, 'from flask import Flask, render_template, request\n'), ((327, 355), 'flask.render_template', 'render_template', (['"""base.html"""'], {}), "('base.html')\n", (342, 355), False, 'from flask import Flask, render_template, reques... |
'''See the shared Google Drive documentation for an inheritance diagram that
shows the relationships between the classes defined in this file.
'''
import numpy as np
import socket
import time
from riglib import source
from ismore import settings, udp_feedback_client
import ismore_bmi_lib
from utils.constants import *... | [
"numpy.abs",
"time.ctime",
"socket.socket",
"numpy.hstack",
"os.path.expandvars",
"ismore.filter.Filter",
"numpy.logical_and",
"scipy.signal.butter",
"riglib.sink.sinks.register",
"numpy.array",
"numpy.zeros",
"numpy.isnan",
"numpy.sign",
"numpy.nonzero",
"time.time",
"riglib.source.Da... | [((12073, 12115), 'numpy.array', 'np.array', (['[cm_to_mm, cm_to_mm, rad_to_deg]'], {}), '([cm_to_mm, cm_to_mm, rad_to_deg])\n', (12081, 12115), True, 'import numpy as np\n'), ((12180, 12214), 'numpy.array', 'np.array', (['[np.inf, np.inf, np.inf]'], {}), '([np.inf, np.inf, np.inf])\n', (12188, 12214), True, 'import nu... |
import argparse
import numpy as np
import glob
import re
from log import print_to_file
from scipy.fftpack import fftn, ifftn
from skimage.feature import peak_local_max, canny
from skimage.transform import hough_circle
import pickle as pickle
from paths import TRAIN_DATA_PATH, LOGS_PATH, PKL_TRAIN_DATA_PATH, PK... | [
"numpy.sqrt",
"scipy.fftpack.fftn",
"numpy.array",
"numpy.argsort",
"numpy.arange",
"re.search",
"numpy.mean",
"argparse.ArgumentParser",
"numpy.max",
"numpy.exp",
"log.print_to_file",
"glob.glob",
"numpy.abs",
"numpy.float32",
"pickle.dump",
"numpy.sum",
"numpy.zeros",
"skimage.fe... | [((482, 558), 'numpy.array', 'np.array', (['[[percentual_coordinate[0]], [percentual_coordinate[1]], [0], [1]]'], {}), '([[percentual_coordinate[0]], [percentual_coordinate[1]], [0], [1]])\n', (490, 558), True, 'import numpy as np\n'), ((3780, 3814), 'numpy.zeros', 'np.zeros', (['(ximagesize, yimagesize)'], {}), '((xim... |
import numpy as np
pos = []
normals = []
p = [[-0.4722227, -0.24517583, -0.6370031]]
n = [[2.02215104e-04, -3.23903880e-05, 9.99999979e-01]]
pos.append(p)
normals.append(n)
p = [[-0.2549828, -0.24587737, -0.63704705]]
n = [[2.02215104e-04, -3.23903880e-05, 9.99999979e-01]]
pos.append(p)
normals.append(n)
p = [[-0.2... | [
"numpy.array"
] | [((1222, 1234), 'numpy.array', 'np.array', (['px'], {}), '(px)\n', (1230, 1234), True, 'import numpy as np\n'), ((1295, 1307), 'numpy.array', 'np.array', (['nx'], {}), '(nx)\n', (1303, 1307), True, 'import numpy as np\n')] |
import numpy
with open ("dic.txt", "w", encoding="utf-8") as dic:
for x in range(5, 790, 1):
if 92 < x <= 113:
dic.write('"'+str(x)+'"'+":"+ '"'+'1'+'",')
elif 113 < x <= 133:
dic.write('"'+str(x)+'"'+":"+ '"'+'2'+'",')
elif 133 < x <= 153:
dic.w... | [
"numpy.arange"
] | [((4023, 4049), 'numpy.arange', 'numpy.arange', (['(0)', '(1.7)', '(0.01)'], {}), '(0, 1.7, 0.01)\n', (4035, 4049), False, 'import numpy\n')] |
#!/usr/bin/env python
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Lidar/BB check for CARLA
This script obtains the LiDAR's point cloud cor... | [
"numpy.dtype",
"numpy.ones",
"carla.Transform",
"carla.Vector3D",
"carla.Location",
"numpy.any",
"numpy.array",
"carla.Client",
"numpy.savetxt",
"queue.Queue",
"carla.Rotation",
"glob.glob"
] | [((7225, 7278), 'carla.Transform', 'carla.Transform', (['actor_tr.location', 'actor_tr.rotation'], {}), '(actor_tr.location, actor_tr.rotation)\n', (7240, 7278), False, 'import carla\n'), ((12931, 12962), 'carla.Client', 'carla.Client', (['"""localhost"""', '(2000)'], {}), "('localhost', 2000)\n", (12943, 12962), False... |
"""Loading MNIST dataset.
"""
import struct
import numpy as np
class MNIST:
"""
Loading MNIST dataset.
In the directory of MNIST dataset, there should be the following files:
- Training set:
- train-images-idx3-ubyte
- train-labels-idx1-ubyte
- Test set:
... | [
"matplotlib.pyplot.imshow",
"numpy.reshape",
"random.randrange",
"struct.unpack_from",
"numpy.asarray",
"numpy.zeros",
"numpy.vectorize",
"numpy.moveaxis",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((7734, 7766), 'random.randrange', 'random.randrange', (['data.batch_num'], {}), '(data.batch_num)\n', (7750, 7766), False, 'import random\n'), ((8294, 8304), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (8302, 8304), True, 'import matplotlib.pyplot as plt\n'), ((7475, 7507), 'random.randrange', 'random.ran... |
import threading, queue, time, os, pickle
# from queue import Queue
import numpy as np
import tensorflow as tf
import sarnet_td3.common.tf_util as U
from tensorflow.python.keras.backend import set_session
lock = threading.Lock()
class MultiTrainTD3(threading.Thread):
def __init__(self, input_queue, output_queue, ... | [
"threading.Thread.__init__",
"os.path.exists",
"numpy.mean",
"pickle.dump",
"sarnet_td3.common.tf_util.save_state",
"threading.Lock",
"tensorflow.compat.v1.get_default_session",
"os.path.join",
"time.sleep",
"numpy.stack",
"numpy.zeros",
"numpy.array",
"os.mkdir",
"numpy.expand_dims",
"q... | [((212, 228), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (226, 228), False, 'import threading, queue, time, os, pickle\n'), ((23871, 23905), 'tensorflow.compat.v1.get_default_session', 'tf.compat.v1.get_default_session', ([], {}), '()\n', (23903, 23905), True, 'import tensorflow as tf\n'), ((351, 404), 'thre... |
#
# Copyright 2018, 2020 <NAME>
# 2019-2020 <NAME>
# 2015-2016 <NAME>
#
# ### MIT license
#
# 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 ... | [
"PyCo.Tools.CharacterisePeriodicSurface",
"scipy.optimize.fminbound",
"numpy.log",
"PyCo.Tools.RandomSurfaceGaussian",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.isfinite",
"numpy.zeros_like",
"matplotlib.pyplot.show"
] | [((1421, 1433), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1431, 1433), True, 'import matplotlib.pyplot as plt\n'), ((1524, 1566), 'PyCo.Tools.CharacterisePeriodicSurface', 'Tools.CharacterisePeriodicSurface', (['surface'], {}), '(surface)\n', (1557, 1566), True, 'import PyCo.Tools as Tools\n'), ((181... |
import numpy as np
from stable_baselines import PPO2
from stable_baselines.common.policies import CnnPolicy
from stable_baselines.a2c.utils import conv, linear, conv_to_fc
from src.envs import CMDP, FrozenLakeEnvCustomMap
from src.envs.frozen_lake.frozen_maps import MAPS
from src.students import LagrangianStudent, i... | [
"stable_baselines.a2c.utils.conv_to_fc",
"numpy.sqrt",
"src.envs.FrozenLakeEnvCustomMap",
"stable_baselines.a2c.utils.conv",
"src.teacher.create_intervention",
"tensorflow.compat.v1.logging.set_verbosity",
"src.envs.frozen_lake.utils.add_teacher"
] | [((741, 803), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (775, 803), True, 'import tensorflow as tf\n'), ((1242, 1278), 'src.envs.FrozenLakeEnvCustomMap', 'FrozenLakeEnvCustomMap', ([], {}), '(**env_kwargs)\... |
import numpy as np
import os
from scanorama import *
from scipy.sparse import vstack
from process import load_names
from experiments import *
from utils import *
NAMESPACE = 'zeisel'
METHOD = 'svd'
DIMRED = 100
data_names = [
'data/mouse_brain/zeisel/amygdala',
'data/mouse_brain/zeisel/cerebellum',
'data... | [
"scipy.sparse.vstack",
"ample.srs",
"process.load_names",
"numpy.array",
"differential_entropies.differential_entropies",
"mouse_brain_astrocyte.astro_oligo_violin"
] | [((1047, 1081), 'process.load_names', 'load_names', (['data_names'], {'norm': '(False)'}), '(data_names, norm=False)\n', (1057, 1081), False, 'from process import load_names\n'), ((1149, 1165), 'scipy.sparse.vstack', 'vstack', (['datasets'], {}), '(datasets)\n', (1155, 1165), False, 'from scipy.sparse import vstack\n')... |
import numpy
import pytest
import os
from shutil import rmtree
from numpy.testing import assert_allclose
import scipy.stats
import scipy.integrate
import scipy.special
from fgivenx.mass import PMF, compute_pmf
def gaussian_pmf(y, mu=0, sigma=1):
return scipy.special.erfc(numpy.abs(y-mu)/numpy.sqrt(2)/sigma)
def... | [
"numpy.random.normal",
"numpy.abs",
"fgivenx.mass.compute_pmf",
"fgivenx.mass.PMF",
"numpy.sqrt",
"numpy.testing.assert_allclose",
"numpy.zeros_like",
"shutil.rmtree",
"os.path.isfile",
"numpy.linspace",
"numpy.outer",
"pytest.raises",
"numpy.random.seed",
"numpy.random.uniform",
"numpy.... | [((342, 362), 'numpy.random.seed', 'numpy.random.seed', (['(0)'], {}), '(0)\n', (359, 362), False, 'import numpy\n'), ((394, 419), 'numpy.random.randn', 'numpy.random.randn', (['nsamp'], {}), '(nsamp)\n', (412, 419), False, 'import numpy\n'), ((428, 459), 'numpy.random.uniform', 'numpy.random.uniform', (['(-3)', '(3)',... |
from builtins import str
from builtins import range
from robust.simulations.simulate import filter_gamma_result_dict
from SimPleAC_save import load_obj
import pickle as pickle
import numpy as np
import matplotlib.pyplot as plt
from SimPleAC_pof_simulate import pof_parameters
if __name__ == "__main__":
# Retrieving... | [
"matplotlib.pyplot.show",
"SimPleAC_pof_simulate.pof_parameters",
"builtins.str",
"numpy.max",
"builtins.range",
"numpy.min",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"robust.simulations.simulate.filter_gamma_result_dict",
"SimPleAC_save.load_obj"
] | [((659, 675), 'SimPleAC_pof_simulate.pof_parameters', 'pof_parameters', ([], {}), '()\n', (673, 675), False, 'from SimPleAC_pof_simulate import pof_parameters\n'), ((868, 883), 'builtins.range', 'range', (['nmargins'], {}), '(nmargins)\n', (873, 883), False, 'from builtins import range\n'), ((1093, 1149), 'SimPleAC_sav... |
#!/usr/bin/env python
from __future__ import absolute_import
import numpy as np
import os
import pytest
import tempfile
import training_data
class TestTrainingData():
def test_add(self):
td = training_data.training_data()
assert np.array_equal(td.get_x(), np.empty([0, 4, 4], dtype=np.int))
... | [
"pytest.approx",
"numpy.allclose",
"numpy.ones",
"os.path.join",
"pytest.main",
"training_data.training_data",
"numpy.array",
"os.rmdir",
"tempfile.mkdtemp",
"numpy.empty",
"numpy.zeros",
"numpy.full",
"numpy.dtype",
"os.remove"
] | [((22956, 22969), 'pytest.main', 'pytest.main', ([], {}), '()\n', (22967, 22969), False, 'import pytest\n'), ((208, 237), 'training_data.training_data', 'training_data.training_data', ([], {}), '()\n', (235, 237), False, 'import training_data\n'), ((1140, 1169), 'training_data.training_data', 'training_data.training_da... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.