code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import attr
import struct
import msprime
import tskit
import kastore
import json
from collections import OrderedDict
import warnings
import numpy as np
from .slim_metadata import *
from .provenance import *
from .slim_metadata import _decode_mutation_pre_nucleotides
INDIVIDUAL_ALIVE = 2**16
INDIVIDUAL_REMEMBERED = 2*... | [
"msprime.PopulationConfiguration",
"numpy.logical_and",
"numpy.argmax",
"tskit.load",
"numpy.zeros",
"json.dumps",
"tskit.pack_bytes",
"numpy.where",
"msprime.simulate",
"numpy.repeat",
"numpy.int32",
"tskit.unpack_bytes",
"warnings.warn",
"kastore.load"
] | [((27940, 27966), 'tskit.pack_bytes', 'tskit.pack_bytes', (['location'], {}), '(location)\n', (27956, 27966), False, 'import tskit\n'), ((29098, 29186), 'tskit.unpack_bytes', 'tskit.unpack_bytes', (['tables.individuals.metadata', 'tables.individuals.metadata_offset'], {}), '(tables.individuals.metadata, tables.individu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 25 20:02:19 2016
@author: technologos
Thanks to mewo2 and amitp for inspiration and tutorials.
Thanks particularly to mewo2 for the framework for the regularization.
"""
import numpy
from numpy import sqrt, dot, sign, mean, pi, cos, sin, array, as... | [
"os.mkdir",
"scipy.spatial.Voronoi",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.mean",
"numpy.linalg.norm",
"numpy.random.normal",
"numpy.sin",
"os.chdir",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.close",
"matplotlib.cm.ScalarMappable",
"matplotlib.is_interactive",
... | [((816, 832), 'matplotlib.is_interactive', 'is_interactive', ([], {}), '()\n', (830, 832), False, 'from matplotlib import pyplot, is_interactive\n'), ((838, 851), 'matplotlib.pyplot.ioff', 'pyplot.ioff', ([], {}), '()\n', (849, 851), False, 'from matplotlib import pyplot, is_interactive\n'), ((957, 984), 'numpy.concate... |
"""MiniMap widget.
"""
import math
import numpy as np
from qtpy.QtGui import QImage, QPixmap
from qtpy.QtWidgets import QLabel
from ....layers.image.experimental import OctreeIntersection
from ....layers.image.experimental.octree_image import OctreeImage
# Width of the map in the dockable widget.
MAP_WIDTH = 200
# ... | [
"qtpy.QtGui.QImage",
"qtpy.QtGui.QPixmap.fromImage",
"numpy.zeros",
"math.ceil"
] | [((2229, 2280), 'qtpy.QtGui.QImage', 'QImage', (['data', 'width', 'height', 'QImage.Format_RGBA8888'], {}), '(data, width, height, QImage.Format_RGBA8888)\n', (2235, 2280), False, 'from qtpy.QtGui import QImage, QPixmap\n'), ((2929, 2967), 'numpy.zeros', 'np.zeros', (['bitmap_shape'], {'dtype': 'np.uint8'}), '(bitmap_s... |
import cached_property
import numpy as np
from einops import rearrange
import pb_bss_eval
# TODO: Should mir_eval_sxr_selection stay in InputMetrics?
# TODO: Add SI-SDR even though there are arguments against it.
# TODO: Explain, why we compare BSS-Eval against source and not image.
# TODO: Explain, why invasive SX... | [
"numpy.sum",
"difflib.get_close_matches",
"pb_bss_eval.evaluation.stoi",
"pb_bss_eval.evaluation.si_sdr",
"einops.rearrange",
"pb_bss_eval.evaluation.mir_eval_sources",
"pb_bss_eval.evaluation.pesq"
] | [((16593, 16719), 'pb_bss_eval.evaluation.mir_eval_sources', 'pb_bss_eval.evaluation.mir_eval_sources', ([], {'reference': 'self.speech_source', 'estimation': 'self.speech_prediction', 'return_dict': '(True)'}), '(reference=self.speech_source,\n estimation=self.speech_prediction, return_dict=True)\n', (16632, 16719)... |
import pandas as pd
import numpy as np
import copy
import collections as clc
import math
from warnings import warn
from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
from sklearn.utils.multiclass import unique_labels
imp... | [
"pandas.DataFrame",
"numpy.log",
"sklearn.utils.validation.check_X_y",
"collections.Counter",
"copy.copy",
"sklearn.utils.validation.check_is_fitted",
"sklearn.utils.multiclass.unique_labels",
"warnings.warn",
"numpy.unique"
] | [((1573, 1588), 'sklearn.utils.validation.check_X_y', 'check_X_y', (['X', 'y'], {}), '(X, y)\n', (1582, 1588), False, 'from sklearn.utils.validation import check_X_y, check_array, check_is_fitted\n'), ((1613, 1629), 'sklearn.utils.multiclass.unique_labels', 'unique_labels', (['y'], {}), '(y)\n', (1626, 1629), False, 'f... |
import numpy as np
import matplotlib.pyplot as plt
PACKET_SIZE = 1500.0 # bytes
TIME_INTERVAL = 5.0
BITS_IN_BYTE = 8.0
MBITS_IN_BITS = 1000000.0
MILLISECONDS_IN_SECONDS = 1000.0
N = 100
LINK_FILE = './logs/report_bus_0010.log'
time_ms = []
bytes_recv = []
recv_time = []
with open(LINK_FILE, 'rb') as f:
for line i... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((463, 480), 'numpy.array', 'np.array', (['time_ms'], {}), '(time_ms)\n', (471, 480), True, 'import numpy as np\n'), ((494, 514), 'numpy.array', 'np.array', (['bytes_recv'], {}), '(bytes_recv)\n', (502, 514), True, 'import numpy as np\n'), ((527, 546), 'numpy.array', 'np.array', (['recv_time'], {}), '(recv_time)\n', (... |
# -*- coding: utf-8 -*-
import numpy as np
import operator
class KNN(object):
def __init__(self, k=3):
self.k = k
def fit(self, x, y):
self.x = x
self.y = y
def _square_distance(self, v1, v2):
return np.sum(np.square(v1-v2))
def _vote(self, ys):
ys_unique = ... | [
"numpy.square",
"numpy.argsort",
"numpy.array",
"operator.itemgetter",
"numpy.unique"
] | [((320, 333), 'numpy.unique', 'np.unique', (['ys'], {}), '(ys)\n', (329, 333), True, 'import numpy as np\n'), ((982, 998), 'numpy.array', 'np.array', (['y_pred'], {}), '(y_pred)\n', (990, 998), True, 'import numpy as np\n'), ((256, 274), 'numpy.square', 'np.square', (['(v1 - v2)'], {}), '(v1 - v2)\n', (265, 274), True,... |
import anndata
import dask.dataframe
import numpy as np
import os
import pandas as pd
import pickle
from typing import Dict, List, Tuple, Union
from sfaira.consts import AdataIdsSfaira
from sfaira.data.store.stores.base import StoreBase
from sfaira.data.store.stores.single import StoreSingleFeatureSpace, \
StoreDa... | [
"anndata.read_h5ad",
"pickle.dump",
"os.path.isdir",
"sfaira.data.store.stores.single.StoreDao",
"sfaira.data.store.carts.multi.CartMulti",
"os.path.isfile",
"pickle.load",
"numpy.arange",
"sfaira.consts.AdataIdsSfaira",
"sfaira.data.store.stores.single.StoreAnndata",
"sfaira.data.store.io.io_da... | [((8672, 8721), 'sfaira.data.store.carts.multi.CartMulti', 'CartMulti', ([], {'carts': 'carts', 'intercalated': 'intercalated'}), '(carts=carts, intercalated=intercalated)\n', (8681, 8721), False, 'from sfaira.data.store.carts.multi import CartMulti\n'), ((8973, 8989), 'sfaira.consts.AdataIdsSfaira', 'AdataIdsSfaira', ... |
"""
animated_plots.py
Author: <NAME> / git: bencottier
Produce and display animated data.
"""
from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
import math
def animate(i, anim, selections, results, values):
i_iter = i % anim.fra... | [
"matplotlib.pyplot.show",
"numpy.sum",
"agents.UCBAgent",
"matplotlib.pyplot.ylim",
"numpy.zeros",
"matplotlib.animation.FFMpegWriter",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.array",
"matplotlib.pyplot.gca",
"bandits.Bandit",
"matplotlib.pyplot.ylabel",
"math.log",
"matplotlib.... | [((4774, 4794), 'bandits.Bandit', 'Bandit', (['bandit_probs'], {}), '(bandit_probs)\n', (4780, 4794), False, 'from bandits import Bandit\n'), ((4807, 4828), 'agents.UCBAgent', 'UCBAgent', (['bandit', '(1.0)'], {}), '(bandit, 1.0)\n', (4815, 4828), False, 'from agents import EpsilonGreedyAgent, FPLAgent, Exp3Agent, UCBA... |
import numpy as np
from tqdm import tqdm
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
from utils import data_loader
from sklearn.cluster import KMeans
from utils import save_images, make_dirs, acc, nmi, ari
class Encoder(tf.ker... | [
"tensorflow.reduce_sum",
"tensorflow.keras.layers.Dense",
"numpy.argmax",
"tensorflow.keras.optimizers.SGD",
"utils.ari",
"tensorflow.Variable",
"tensorflow.math.square",
"tensorflow.keras.layers.Flatten",
"sklearn.cluster.KMeans",
"numpy.append",
"utils.nmi",
"utils.data_loader",
"tensorflo... | [((424, 449), 'tensorflow.keras.layers.Flatten', 'tf.keras.layers.Flatten', ([], {}), '()\n', (447, 449), True, 'import tensorflow as tf\n'), ((472, 521), 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['(500)'], {'activation': 'tf.nn.relu'}), '(500, activation=tf.nn.relu)\n', (493, 521), True, 'import tens... |
import tensorflow as tf
import pandas as pd
import trainSet as trainSet
import testSet as testSet
import numpy as np
import Encoder as Encoder
import encoder_lstm as encoder_lstm
import Decoder as Decoder
import matplotlib.pyplot as plt
import Decoder_lstm as Decoder_lstm
import encoder_gru as encodet_gru
import encode... | [
"matplotlib.pyplot.show",
"Encoder.encoder",
"tensorflow.train.Saver",
"matplotlib.pyplot.plot",
"Decoder_lstm.lstm",
"tensorflow.reset_default_graph",
"numpy.std",
"tensorflow.Session",
"tensorflow.placeholder",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.array",
"tensorflow.square",
... | [((367, 391), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (389, 391), True, 'import tensorflow as tf\n'), ((435, 459), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (457, 459), True, 'import tensorflow as tf\n'), ((5544, 5560), 'tensorflow.train.Saver', ... |
"""
A module for testing `amf.py`.
"""
from numpy.testing import assert_allclose
def test_Ɛ_bar(amf, 𝒫_bar, rtol, atol):
𝒫 = amf.𝒫
𝒫_bar_test = amf.Ɛ_bar(𝒫)
for actual, expected in zip(𝒫_bar_test, 𝒫_bar):
assert_allclose(actual, expected, rtol=rtol, atol=atol)
def test_Ɛ_tilde(amf, 𝒫_... | [
"numpy.testing.assert_allclose"
] | [((230, 285), 'numpy.testing.assert_allclose', 'assert_allclose', (['actual', 'expected'], {'rtol': 'rtol', 'atol': 'atol'}), '(actual, expected, rtol=rtol, atol=atol)\n', (245, 285), False, 'from numpy.testing import assert_allclose\n'), ((442, 497), 'numpy.testing.assert_allclose', 'assert_allclose', (['actual', 'exp... |
import numpy as np
def apply_foreground_mask(spots, mask, ratio):
"""
"""
# get spot locations in mask voxel coordinates
x = np.round(spots[:, :3] * ratio).astype(np.uint16)
# correct out of range rounding errors
for i in range(3):
x[x[:, i] >= mask.shape[i], i] = mask.shape[i] - 1
... | [
"numpy.round",
"numpy.copy"
] | [((538, 552), 'numpy.copy', 'np.copy', (['spots'], {}), '(spots)\n', (545, 552), True, 'import numpy as np\n'), ((144, 174), 'numpy.round', 'np.round', (['(spots[:, :3] * ratio)'], {}), '(spots[:, :3] * ratio)\n', (152, 174), True, 'import numpy as np\n')] |
# coding: utf-8
# # Apply vgg16 model and predict class for test data of https://www.kaggle.com/c/dogs-vs-cats-redux-kernels-edition and submit prediction results to Kaggle.
# In[1]:
# Module versions
import sys
import keras
import theano
import numpy
import pandas
print("Python version:" + sys.version)
print("Ker... | [
"vgg16.Vgg16",
"keras.backend.set_floatx",
"keras.backend.image_data_format",
"numpy.argmax",
"math.ceil",
"keras.backend.backend",
"keras.backend.epsilon",
"keras.backend.floatx",
"utils.set_keras_cache_dir",
"keras.backend.set_image_data_format",
"keras.backend.image_dim_ordering",
"pandas.S... | [((687, 740), 'keras.backend.set_image_data_format', 'keras.backend.set_image_data_format', (['"""channels_first"""'], {}), "('channels_first')\n", (722, 740), False, 'import keras\n'), ((1007, 1039), 'keras.backend.set_epsilon', 'keras.backend.set_epsilon', (['(1e-07)'], {}), '(1e-07)\n', (1032, 1039), False, 'import ... |
from tequila.simulators.simulator_base import BackendCircuit, QCircuit, BackendExpectationValue
from tequila.wavefunction.qubit_wavefunction import QubitWaveFunction
from tequila import TequilaException
from tequila import BitString, BitNumbering, BitStringLSB
from tequila.utils.keymap import KeyMapRegisterToSubregiste... | [
"qiskit.IBMQ.active_account",
"qiskit.Aer.get_backend",
"tequila.utils.keymap.KeyMapRegisterToSubregister",
"tequila.BitString.from_int",
"qiskit.test.mock.FakeProvider",
"qiskit.execute",
"tequila.BitStringLSB.from_binary",
"tequila.wavefunction.qubit_wavefunction.QubitWaveFunction",
"qiskit.IBMQ.l... | [((669, 728), 'qiskit.providers.aer.noise.pauli_error', 'qiskitnoise.pauli_error', ([], {'noise_ops': "[('X', p), ('I', 1 - p)]"}), "(noise_ops=[('X', p), ('I', 1 - p)])\n", (692, 728), True, 'import qiskit.providers.aer.noise as qiskitnoise\n'), ((951, 1010), 'qiskit.providers.aer.noise.pauli_error', 'qiskitnoise.paul... |
import numpy as np
from onehot import onehot
from util import softmax, cosine
import time
class word2vec:
def __init__(self, size, skip_gram=3, n_gram=5):
self.__hidden_size = size
self.__n_gram = n_gram
self.__skip_gram = skip_gram
def __loss(self, y_pred, y_true):
"... | [
"numpy.log",
"util.cosine",
"numpy.zeros",
"time.time",
"onehot.onehot",
"numpy.random.rand",
"numpy.mat"
] | [((587, 598), 'numpy.mat', 'np.mat', (['tmp'], {}), '(tmp)\n', (593, 598), True, 'import numpy as np\n'), ((1748, 1765), 'onehot.onehot', 'onehot', (['sentences'], {}), '(sentences)\n', (1754, 1765), False, 'from onehot import onehot\n'), ((3253, 3309), 'util.cosine', 'cosine', (['self.__W_weight[index1]', 'self.__W_we... |
# ! /usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under NVIDIA Simple Streamer License
import multiprocessing as mp
import numpy as np
import time
import socket
import cv2
import sys
if sys.version_info[0] < 3:
raise Exception("Only Python 3 s... | [
"cv2.waitKey",
"numpy.frombuffer",
"socket.socket",
"cv2.imdecode",
"time.time",
"cv2.VideoCapture",
"multiprocessing.Queue",
"cv2.imencode",
"multiprocessing.Process",
"cv2.imshow",
"numpy.fromstring"
] | [((651, 662), 'time.time', 'time.time', ([], {}), '()\n', (660, 662), False, 'import time\n'), ((808, 819), 'time.time', 'time.time', ([], {}), '()\n', (817, 819), False, 'import time\n'), ((1595, 1614), 'multiprocessing.Queue', 'mp.Queue', (['self.maxQ'], {}), '(self.maxQ)\n', (1603, 1614), True, 'import multiprocessi... |
import os
import sys
import numpy
import clint
import pickle
import zipfile
import requests
import subprocess
import matplotlib
matplotlib.use('Agg') #don't use X backend so headless servers don't die
from matplotlib import pyplot
def pickleload(filename):
"""
Does what it says. Loads a pickle (and returns... | [
"matplotlib.pyplot.loglog",
"os.mkdir",
"os.remove",
"numpy.abs",
"numpy.ones",
"matplotlib.pyplot.figure",
"pickle.load",
"os.path.join",
"matplotlib.pyplot.rc",
"requests.get",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.text",
"matplotlib.use",
"subprocess.call",
"matplotlib.pyplot... | [((129, 150), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (143, 150), False, 'import matplotlib\n'), ((2140, 2272), 'numpy.array', 'numpy.array', (['[97 * 65 * 97, 129 * 97 * 129, 161 * 129 * 161, 257 * 161 * 257, 385 * 257 *\n 385, 449 * 385 * 449, 513 * 449 * 513]'], {}), '([97 * 65 * 97,... |
# -*- coding: utf-8 -*-
import os
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from networkx.drawing.nx_pydot import graphviz_layout
if __name__ == "__main__":
os.environ["PATH"] += ":/usr/local/bin"
map = {
0: r"$\alpha_1$",
1: r"$\alpha_2$",
2: r"$\alpha_3... | [
"networkx.min_cost_flow",
"networkx.DiGraph",
"numpy.array",
"networkx.drawing.nx_pydot.graphviz_layout"
] | [((795, 1022), 'numpy.array', 'np.array', (['[[0, 0, 0, 1, 3, 0, 0, 0], [0, 0, 0, 2, 3, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, \n 4], [0, 0, 0, 0, 1, 2, 4, 0], [0, 0, 0, 0, 0, 3, 5, 2], [0, 0, 0, 0, 0,\n 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]'], {}), '([[0, 0, 0, 1, 3, 0, 0, 0], [0, 0, 0, 2, 3, 0,... |
"""
collection of useful miscellaneous functions
"""
def get_dim_exp(exp):
"""
outputs hard-coded data dimensions (lat-lon-lev-time)
for a given simulation
"""
if exp == "QSC5.TRACMIP.NH01.L.pos.Q0.300.lon0.150.lond.45.lat0.0.latd.30":
from ds21grl import dim_aqua_short as dim
else... | [
"numpy.sum",
"numpy.roll",
"time.time",
"numpy.array",
"numpy.arange",
"numpy.rollaxis"
] | [((613, 624), 'time.time', 'time.time', ([], {}), '()\n', (622, 624), False, 'import time\n'), ((3294, 3352), 'numpy.array', 'np.array', (['[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]'], {}), '([31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31])\n', (3302, 3352), True, 'import numpy as np\n'), ((3560, 3618), 'numpy.... |
# coding=utf-8
import numpy as np
from scipy.misc import logsumexp
from pybasicbayes.util.stats import sample_discrete
from pyhsmm.internals.hmm_states import HMMStatesEigen
from pyslds.states import _SLDSStatesCountData, _SLDSStatesMaskedData
from rslds.util import one_hot, logistic
class InputHMMStates(HMMStates... | [
"numpy.sum",
"numpy.argmax",
"numpy.empty",
"numpy.einsum",
"numpy.ones",
"numpy.random.randint",
"numpy.arange",
"numpy.exp",
"numpy.diag",
"pyslds.util.expected_hmm_logprob",
"pybasicbayes.util.stats.sample_discrete",
"numpy.isfinite",
"scipy.misc.logsumexp",
"numpy.random.choice",
"rs... | [((2803, 2835), 'numpy.empty', 'np.empty', (['(T, n)'], {'dtype': '"""double"""'}), "((T, n), dtype='double')\n", (2811, 2835), True, 'import numpy as np\n'), ((5349, 5391), 'numpy.ones', 'np.ones', (['(self.T - 1, self.num_states - 1)'], {}), '((self.T - 1, self.num_states - 1))\n', (5356, 5391), True, 'import numpy a... |
import numpy as np
from proteus import Domain, Context, Comm
from proteus.mprans import SpatialTools as st
import proteus.TwoPhaseFlow.TwoPhaseFlowProblem as TpFlow
import proteus.TwoPhaseFlow.utils.Parameters as Parameters
from proteus import WaveTools as wt
from proteus.Profiling import logEvent
from proteus.mbd impo... | [
"proteus.Domain.PiecewiseLinearComplexDomain",
"os.path.abspath",
"proteus.mprans.SpatialTools.Tank3D",
"proteus.mbd.CouplingFSI.ProtChSystem",
"proteus.mprans.SpatialTools.Cuboid",
"pychrono.ChVectorD",
"proteus.mprans.SpatialTools.assembleDomain",
"numpy.zeros",
"proteus.ctransportCoefficients.smo... | [((787, 824), 'proteus.Domain.PiecewiseLinearComplexDomain', 'Domain.PiecewiseLinearComplexDomain', ([], {}), '()\n', (822, 824), False, 'from proteus import Domain, Context, Comm\n'), ((864, 891), 'proteus.mprans.SpatialTools.Tank3D', 'st.Tank3D', (['domain', 'tank_dim'], {}), '(domain, tank_dim)\n', (873, 891), True,... |
def ImportData():
import numpy as np
import pandas as pd
mydata = pd.read_csv("u.csv")
#print(mydata.head())
#print(np.random.randn(6, 2)*10)
df1 = pd.DataFrame(np.random.randn(6, 2)*10, columns=list('xy'))
#print(df1)
df2 = pd.DataFrame(mydata.to_numpy(), columns=list('xy'))
... | [
"pandas.read_csv",
"numpy.random.randn"
] | [((81, 101), 'pandas.read_csv', 'pd.read_csv', (['"""u.csv"""'], {}), "('u.csv')\n", (92, 101), True, 'import pandas as pd\n'), ((192, 213), 'numpy.random.randn', 'np.random.randn', (['(6)', '(2)'], {}), '(6, 2)\n', (207, 213), True, 'import numpy as np\n')] |
import sys
print(sys.path)
# ['/home/lanhai/Projects/second.pytorch', '/home/lanhai/pycharm-community-2018.2.3/helpers/pydev', '/home/lanhai/Projects/second.pytorch', '/home/lanhai/pycharm-community-2018.2.3/helpers/pydev', '/home/lanhai/.PyCharmCE2018.2/system/cythonExtensions', '/home/lanhai/anaconda3/envs/pytorch/l... | [
"time.process_time",
"numpy.ones",
"numba.float32"
] | [((1298, 1326), 'numpy.ones', 'np.ones', (['N'], {'dtype': 'np.float32'}), '(N, dtype=np.float32)\n', (1305, 1326), True, 'import numpy as np\n'), ((1335, 1363), 'numpy.ones', 'np.ones', (['N'], {'dtype': 'np.float32'}), '(N, dtype=np.float32)\n', (1342, 1363), True, 'import numpy as np\n'), ((1374, 1393), 'time.proces... |
# MIT License
#
# Copyright (c) 2018 Capital One Services, LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... | [
"pandas.DataFrame",
"os.path.abspath",
"os.remove",
"pathlib.Path.home",
"boto3.Session",
"decimal.Decimal",
"locopy.utility.read_config_yaml",
"numpy.allclose",
"os.path.dirname",
"pytest.fixture",
"locopy.Snowflake",
"pandas.to_datetime",
"pytest.mark.parametrize",
"filecmp.cmp",
"os.p... | [((1497, 1544), 'os.path.join', 'os.path.join', (['CURR_DIR', '"""data"""', '"""mock_file.txt"""'], {}), "(CURR_DIR, 'data', 'mock_file.txt')\n", (1509, 1544), False, 'import os\n'), ((1563, 1611), 'os.path.join', 'os.path.join', (['CURR_DIR', '"""data"""', '"""mock_file.json"""'], {}), "(CURR_DIR, 'data', 'mock_file.j... |
#!/usr/bin/python3
"""
Copyright (c) 2019 <NAME>
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, ... | [
"numpy.sum",
"argparse.ArgumentParser",
"numpy.argmax",
"numpy.argmin",
"numpy.shape",
"cv2.boxPoints",
"numpy.exp",
"cv2.minAreaRect",
"cv2.imshow",
"numpy.zeros_like",
"cv2.dnn.blobFromImage",
"numpy.transpose",
"numpy.isfinite",
"cv2.drawContours",
"numpy.broadcast_arrays",
"cv2.des... | [((634, 659), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (657, 659), False, 'import argparse\n'), ((8143, 8170), 'cv2.imread', 'cv2.imread', (['args.image_path'], {}), '(args.image_path)\n', (8153, 8170), False, 'import cv2\n'), ((8182, 8224), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFromImage... |
# -*- coding: utf-8 -*-
import logging
import numpy as np
import utool as ut
import pandas as pd
import itertools as it
import networkx as nx
import vtool as vt
from os.path import join # NOQA
from wbia.algo.graph import nx_utils as nxu
from wbia.algo.graph.nx_utils import e_
from wbia.algo.graph.state import POSTV, N... | [
"utool.ichunks",
"numpy.maximum",
"utool.replace_nones",
"utool.compress",
"utool.dzip",
"utool.unique",
"utool.repr3",
"utool.ProgIter",
"wbia.algo.graph.nx_utils.ensure_multi_index",
"utool.printex",
"wbia.algo.graph.nx_utils.edges_cross",
"utool.ensure_iterable",
"utool.inject2",
"numpy... | [((414, 434), 'utool.inject2', 'ut.inject2', (['__name__'], {}), '(__name__)\n', (424, 434), True, 'import utool as ut\n'), ((444, 469), 'logging.getLogger', 'logging.getLogger', (['"""wbia"""'], {}), "('wbia')\n", (461, 469), False, 'import logging\n'), ((1817, 1841), 'wbia.opendb', 'wbia.opendb', ([], {'dbdir': 'dbdi... |
from dk_metric import image_metrics
import os
from multiprocessing import Process, Lock, Manager
import numpy as np
import time
import sys
'''python3 main.py gt_folder pre_folder output_folder [optional startt endt stepsize]'''
gt_folder = sys.argv[1]
prop_folder = sys.argv[2]
output_csv = os.path.join(sys.argv[3], '... | [
"os.getpid",
"multiprocessing.Lock",
"multiprocessing.Manager",
"dk_metric.image_metrics.get_TP_FP_FN",
"time.time",
"numpy.arange",
"numpy.array_split",
"dk_metric.image_metrics.get_mod_TP_FP_FN",
"os.path.join",
"os.listdir"
] | [((293, 332), 'os.path.join', 'os.path.join', (['sys.argv[3]', '"""scores.csv"""'], {}), "(sys.argv[3], 'scores.csv')\n", (305, 332), False, 'import os\n'), ((494, 517), 'os.listdir', 'os.listdir', (['prop_folder'], {}), '(prop_folder)\n', (504, 517), False, 'import os\n'), ((525, 531), 'multiprocessing.Lock', 'Lock', ... |
import numpy as np
import multiprocessing
from sklearn.base import BaseEstimator
from sklearn.utils.validation import check_array, column_or_1d as c1d
from sklearn.model_selection import ParameterGrid
import tbats.error as error
class Estimator(BaseEstimator):
"""Base estimator for BATS and TBATS models
Met... | [
"multiprocessing.pool.Pool",
"numpy.allclose",
"numpy.any",
"numpy.where",
"sklearn.model_selection.ParameterGrid",
"numpy.unique",
"sklearn.utils.validation.check_array"
] | [((3991, 4011), 'numpy.allclose', 'np.allclose', (['y', 'y[0]'], {}), '(y, y[0])\n', (4002, 4011), True, 'import numpy as np\n'), ((4838, 4852), 'numpy.any', 'np.any', (['(y <= 0)'], {}), '(y <= 0)\n', (4844, 4852), True, 'import numpy as np\n'), ((5840, 5888), 'multiprocessing.pool.Pool', 'multiprocessing.pool.Pool', ... |
# --------------------------------------------------------
# Fully Convolutional Instance-aware Semantic Segmentation
# Copyright (c) 2016 by Contributors
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Modified from py-faster-rcnn (https://github.com/rbgirshick/p... | [
"distutils.extension.Extension",
"numpy.get_numpy_include",
"numpy.get_include",
"setuptools.setup"
] | [((1212, 1299), 'setuptools.setup', 'setup', ([], {'name': '"""fast_rcnn"""', 'ext_modules': 'ext_modules', 'cmdclass': "{'build_ext': build_ext}"}), "(name='fast_rcnn', ext_modules=ext_modules, cmdclass={'build_ext':\n build_ext})\n", (1217, 1299), False, 'from setuptools import setup\n'), ((888, 904), 'numpy.get_i... |
import cv2
from dlr import DLRModel
import greengrasssdk
import logging
import numpy as np
import os
from threading import Timer
import time
import railController
import streamServer
import sys
import utils
WIDTH=640
HEIGHT=480
THRESH = 90
MODEL_PATH = os.environ.get("MODEL_PATH", "./model")
dlr_model = DLRModel(MODE... | [
"os.mkdir",
"threading.Timer",
"numpy.argmax",
"railController.RailController",
"cv2.medianBlur",
"numpy.around",
"cv2.rectangle",
"cv2.cvtColor",
"cv2.imwrite",
"os.path.exists",
"dlr.DLRModel",
"numpy.max",
"numpy.swapaxes",
"cv2.resize",
"railController.close_rail",
"greengrasssdk.c... | [((255, 294), 'os.environ.get', 'os.environ.get', (['"""MODEL_PATH"""', '"""./model"""'], {}), "('MODEL_PATH', './model')\n", (269, 294), False, 'import os\n'), ((307, 334), 'dlr.DLRModel', 'DLRModel', (['MODEL_PATH', '"""gpu"""'], {}), "(MODEL_PATH, 'gpu')\n", (315, 334), False, 'from dlr import DLRModel\n'), ((410, 4... |
#!/usr/bin/env python
"""
Test module for TwoPhaseFlow
"""
import pytest
import tables
import numpy as np
import proteus.defaults
from proteus import Context
from proteus import default_so
from proteus.iproteus import *
import os
import sys
Profiling.logLevel=1
Profiling.verbose=True
class TestTwoPhaseFlow(object):
... | [
"os.remove",
"os.path.dirname",
"os.system",
"os.path.isfile",
"numpy.array",
"tables.open_file",
"pytest.mark.skip",
"os.path.join"
] | [((2437, 2540), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""numerics are very sensitive, hashdist build doesn\'t pass but conda does"""'}), '(reason=\n "numerics are very sensitive, hashdist build doesn\'t pass but conda does")\n', (2453, 2540), False, 'import pytest\n'), ((3155, 3217), 'pytest.mark.... |
# coding: utf-8
# 2021/5/29 @ tongshiwei
import numpy as np
from pathlib import PurePath
from gensim.models import KeyedVectors, Word2Vec, FastText, Doc2Vec, TfidfModel
from gensim import corpora
import re
from .const import UNK, PAD
from .meta import Vector
class W2V(Vector):
def __init__(self, filepath, method... | [
"gensim.models.FastText.load",
"gensim.models.Doc2Vec.load",
"gensim.models.KeyedVectors.load",
"numpy.zeros",
"pathlib.PurePath",
"gensim.models.Word2Vec.load",
"gensim.corpora.Dictionary.load",
"gensim.models.TfidfModel.load",
"re.sub"
] | [((511, 529), 'pathlib.PurePath', 'PurePath', (['filepath'], {}), '(filepath)\n', (519, 529), False, 'from pathlib import PurePath\n'), ((2185, 2218), 'gensim.corpora.Dictionary.load', 'corpora.Dictionary.load', (['filepath'], {}), '(filepath)\n', (2208, 2218), False, 'from gensim import corpora\n'), ((2698, 2723), 'ge... |
import tensorflow as tf
import numpy as np
import math
from util import dataset
##### HyperParam Setting####
embedding_size = 50
batch_size = 5000
margin = 1
learning_rate = 0.001
epochs = 1000
############################
####tensorflow setting####
tf_config = tf.ConfigProto()
tf_config.gpu_opt... | [
"tensorflow.nn.relu",
"numpy.save",
"tensorflow.abs",
"tensorflow.train.Saver",
"math.sqrt",
"tensorflow.nn.embedding_lookup",
"tensorflow.device",
"tensorflow.Session",
"tensorflow.concat",
"tensorflow.ConfigProto",
"tensorflow.placeholder",
"util.dataset",
"tensorflow.initialize_all_variab... | [((286, 302), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (300, 302), True, 'import tensorflow as tf\n'), ((468, 481), 'util.dataset', 'dataset', (['path'], {}), '(path)\n', (475, 481), False, 'from util import dataset\n'), ((1148, 1212), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32'], {'sh... |
import queue
import time
from multiprocessing import Process, Queue
import cv2
import numpy as np
from joblib import Parallel, delayed
from stable_baselines import logger
class ExpertDataset(object):
EXCLUDED_KEYS = {'dataloader', 'train_loader', 'val_loader'}
def __init__(
self,
expert_path... | [
"numpy.load",
"matplotlib.pyplot.show",
"numpy.sum",
"matplotlib.pyplot.hist",
"numpy.concatenate",
"cv2.cvtColor",
"numpy.prod",
"time.sleep",
"cv2.imread",
"numpy.array",
"multiprocessing.Queue",
"joblib.Parallel",
"multiprocessing.Process",
"joblib.delayed",
"numpy.random.shuffle"
] | [((5217, 5239), 'matplotlib.pyplot.hist', 'plt.hist', (['self.returns'], {}), '(self.returns)\n', (5225, 5239), True, 'import matplotlib.pyplot as plt\n'), ((5248, 5258), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (5256, 5258), True, 'import matplotlib.pyplot as plt\n'), ((6130, 6150), 'multiprocessing.Que... |
# Copyright (c) 2018 <NAME>
# MIT License
"""
DDPGWithVAE inherits DDPG from stable-baselines
and reimplements learning method.
"""
import time
import os
import numpy as np
import pandas as pd
from mpi4py import MPI
from stable_baselines import logger
from stable_baselines.ddpg.ddpg import DDPG
class DDPGWithVAE(... | [
"pandas.DataFrame",
"stable_baselines.logger.record_tabular",
"numpy.abs",
"stable_baselines.logger.info",
"numpy.isscalar",
"mpi4py.MPI.COMM_WORLD.Get_rank",
"numpy.zeros",
"os.path.exists",
"time.time",
"numpy.mean",
"stable_baselines.logger.dump_tabular",
"mpi4py.MPI.COMM_WORLD.Get_size"
] | [((578, 603), 'mpi4py.MPI.COMM_WORLD.Get_rank', 'MPI.COMM_WORLD.Get_rank', ([], {}), '()\n', (601, 603), False, 'from mpi4py import MPI\n'), ((761, 775), 'numpy.zeros', 'np.zeros', (['(1,)'], {}), '((1,))\n', (769, 775), True, 'import numpy as np\n'), ((1059, 1070), 'time.time', 'time.time', ([], {}), '()\n', (1068, 10... |
import numpy as np
import scipy as sp
import scipy.constants
import cPickle
from bunch import Bunch
import echolect as el
import radarmodel
import prx
basefilename = 'head_and_flare'
with open(basefilename + '.pkl', 'rb') as f:
data = cPickle.load(f)
n = 128
m = data.vlt.shape[-1]
freqs = np.fft.fftfreq(int(n), ... | [
"numpy.zeros_like",
"numpy.abs",
"numpy.sum",
"bunch.Bunch",
"numpy.zeros",
"cPickle.load",
"numpy.searchsorted",
"cPickle.dump",
"numpy.timedelta64",
"radarmodel.point.fastest_adjoint",
"numpy.linalg.norm",
"numpy.sqrt",
"radarmodel.point.fastest_forward"
] | [((940, 991), 'numpy.zeros', 'np.zeros', (['(data.vlt.shape[0], n, m)', 'data.vlt.dtype'], {}), '((data.vlt.shape[0], n, m), data.vlt.dtype)\n', (948, 991), True, 'import numpy as np\n'), ((1004, 1026), 'numpy.zeros_like', 'np.zeros_like', (['vlt_sig'], {}), '(vlt_sig)\n', (1017, 1026), True, 'import numpy as np\n'), (... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import itertools
import numpy as np
import pytest
from common.onnx_layer_test_class import Caffe2OnnxLayerTest
class TestTranspose(Caffe2OnnxLayerTest):
def create_net(self, shape, perm, ir_version):
"""
ONNX n... | [
"onnx.helper.make_node",
"onnx.helper.make_model",
"onnx.helper.make_tensor_value_info",
"numpy.transpose",
"numpy.ones",
"numpy.random.randint",
"pytest.mark.parametrize",
"onnx.helper.make_graph"
] | [((4438, 4492), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""params"""', 'test_data_precommit'], {}), "('params', test_data_precommit)\n", (4461, 4492), False, 'import pytest\n'), ((4760, 4804), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""params"""', 'test_data'], {}), "('params', test_da... |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | [
"scipy.stats.norm",
"numpy.random.seed",
"numpy.random.randn",
"numpy.asarray",
"scipy.stats.multivariate_normal",
"numpy.atleast_1d",
"numpy.all"
] | [((902, 922), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (916, 922), True, 'import numpy as np\n'), ((1418, 1433), 'numpy.asarray', 'np.asarray', (['xin'], {}), '(xin)\n', (1428, 1433), True, 'import numpy as np\n'), ((1595, 1614), 'numpy.atleast_1d', 'np.atleast_1d', (['zout'], {}), '(zout)\n',... |
import unittest
from mltoolkit.mldp.steps.transformers.nlp import WindowSlider
from mltoolkit.mldp.steps.transformers.nlp.helpers import create_new_field_name
from mltoolkit.mldp.utils.tools import DataChunk
import numpy as np
class TestWindowSlider(unittest.TestCase):
def setUp(self):
self.field_name = "... | [
"unittest.main",
"numpy.empty",
"mltoolkit.mldp.utils.tools.DataChunk",
"numpy.array",
"mltoolkit.mldp.steps.transformers.nlp.helpers.create_new_field_name",
"mltoolkit.mldp.steps.transformers.nlp.WindowSlider"
] | [((4553, 4568), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4566, 4568), False, 'import unittest\n'), ((388, 446), 'mltoolkit.mldp.steps.transformers.nlp.helpers.create_new_field_name', 'create_new_field_name', (['self.field_name'], {'suffix': 'self.suffix'}), '(self.field_name, suffix=self.suffix)\n', (409, 4... |
#!/usr/bin/env python2
import ptvsd
# Allow other computers to attach to ptvsd at this IP address and port, using the secret
ptvsd.enable_attach("my_secret", address = ('0.0.0.0', 3000))
# Pause the program until a remote debugger is attached
ptvsd.wait_for_attach()
import time
start = time.time()
import argparse
i... | [
"openface.TorchNeuralNet",
"numpy.set_printoptions",
"ptvsd.enable_attach",
"argparse.ArgumentParser",
"os.path.basename",
"ptvsd.wait_for_attach",
"cv2.cvtColor",
"os.path.realpath",
"cv2.imwrite",
"time.time",
"openface.AlignDlib",
"cv2.imread",
"os.path.join"
] | [((126, 185), 'ptvsd.enable_attach', 'ptvsd.enable_attach', (['"""my_secret"""'], {'address': "('0.0.0.0', 3000)"}), "('my_secret', address=('0.0.0.0', 3000))\n", (145, 185), False, 'import ptvsd\n'), ((244, 267), 'ptvsd.wait_for_attach', 'ptvsd.wait_for_attach', ([], {}), '()\n', (265, 267), False, 'import ptvsd\n'), ... |
import numpy as np
from collections import defaultdict
import space
import scipy.linalg
import scipy.sparse
import scipy.sparse.linalg
from bc import Boundary
def ddx(f, dx):
return (f[1:-1,2:] - f[1:-1,:-2])/2.0/dx
def ddy(f, dy):
return (f[2:,1:-1] - f[:-2,1:-1])/2.0/dy
def laplacian(f, dx, dy):
re... | [
"numpy.zeros_like",
"numpy.sum",
"numpy.roll",
"numpy.zeros",
"numpy.ones",
"space.LatticeGrid",
"collections.defaultdict",
"numpy.append",
"numpy.linalg.norm",
"space.RegularGrid",
"numpy.copyto",
"space.StaggeredGrid"
] | [((2942, 2960), 'numpy.zeros', 'np.zeros', (['[ny, nx]'], {}), '([ny, nx])\n', (2950, 2960), True, 'import numpy as np\n'), ((3751, 3777), 'numpy.zeros', 'np.zeros', (['[ny + 2, nx + 2]'], {}), '([ny + 2, nx + 2])\n', (3759, 3777), True, 'import numpy as np\n'), ((2184, 2200), 'numpy.zeros_like', 'np.zeros_like', (['u'... |
import torch.utils.data as data
import torch
import pandas as pd
from PIL import Image
from glob import glob
import torchvision.transforms as transforms
import numpy as np
class ImageTensorFolder(data.Dataset):
def __init__(self, img_path, tensor_path, img_fmt="npy", tns_fmt="npy", transform=None):
self.i... | [
"numpy.load",
"numpy.uint8",
"pandas.read_csv",
"torch.load",
"torchvision.transforms.ToPILImage",
"PIL.Image.open",
"glob.glob",
"torchvision.transforms.ToTensor"
] | [((650, 671), 'torchvision.transforms.ToTensor', 'transforms.ToTensor', ([], {}), '()\n', (669, 671), True, 'import torchvision.transforms as transforms\n'), ((694, 717), 'torchvision.transforms.ToPILImage', 'transforms.ToPILImage', ([], {}), '()\n', (715, 717), True, 'import torchvision.transforms as transforms\n'), (... |
import numpy as np
import matplotlib.pyplot as plt
import xarray as xr
from scipy import interpolate, signal
from scipy.stats import linregress
from pyproj import Proj, transform
def calcR2(H,T,slope,igflag=0):
"""
%
% [R2,S,setup, Sinc, SIG, ir] = calcR2(H,T,slope,igflag);
%
% Calculated 2% runup ... | [
"matplotlib.pyplot.title",
"numpy.nanpercentile",
"numpy.abs",
"numpy.arctan2",
"numpy.sum",
"numpy.ones",
"numpy.isnan",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.convolve",
"numpy.nanmean",
"numpy.isfinite",
"numpy.cumsum",
"numpy.append",
"numpy.max",
"scipy.s... | [((1441, 1454), 'numpy.abs', 'np.abs', (['slope'], {}), '(slope)\n', (1447, 1454), True, 'import numpy as np\n'), ((1536, 1550), 'numpy.sqrt', 'np.sqrt', (['(H * L)'], {}), '(H * L)\n', (1543, 1550), True, 'import numpy as np\n'), ((2420, 2438), 'scipy.stats.linregress', 'linregress', (['xx', 'yy'], {}), '(xx, yy)\n', ... |
import numpy as np
import pandas as pd
import plotly.offline as py
import plotly.graph_objs as go
import time
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import recall_score, precision_score
from sklearn.preprocessing import MinMaxScaler
from sklearn.neighbors import RadiusNeighborsClassifie... | [
"pandas.DataFrame",
"sklearn.naive_bayes.GaussianNB",
"pandas.read_csv",
"numpy.array",
"plotly.offline.offline.plot",
"plotly.graph_objs.Figure"
] | [((3226, 3330), 'pandas.read_csv', 'pd.read_csv', (["(self.input_path + self.test_session + 'Bid_Ask_History.csv')"], {'header': 'None', 'delimiter': '""","""'}), "(self.input_path + self.test_session + 'Bid_Ask_History.csv',\n header=None, delimiter=',')\n", (3237, 3330), True, 'import pandas as pd\n'), ((3751, 377... |
import numpy as np
import pandas as pd
from ..Utils import getModel
from sklearn.svm import SVR
from sklearn import ensemble
from sklearn.tree import DecisionTreeRegressor
from sklearn.neighbors import KNeighborsRegressor
from sklearn.linear_model import LinearRegression
class StackingRegressor:
def __init__(sel... | [
"sklearn.svm.SVR",
"sklearn.neighbors.KNeighborsRegressor",
"sklearn.tree.DecisionTreeRegressor",
"numpy.std",
"sklearn.linear_model.LinearRegression",
"numpy.mean",
"sklearn.ensemble.StackingRegressor"
] | [((1738, 1756), 'numpy.mean', 'np.mean', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (1745, 1756), True, 'import numpy as np\n'), ((1776, 1793), 'numpy.std', 'np.std', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (1782, 1793), True, 'import numpy as np\n'), ((1939, 1957), 'sklearn.linear_model.LinearRegression', 'LinearRe... |
from sklearn.model_selection import train_test_split
from synthesizer.utils.text import text_to_sequence
from synthesizer.infolog import log
import tensorflow as tf
import numpy as np
import threading
import time
import os
_batches_per_group = 16
class Feeder:
"""
Feeds batches of data into queue on a bac... | [
"numpy.pad",
"threading.Thread",
"numpy.concatenate",
"sklearn.model_selection.train_test_split",
"numpy.asarray",
"os.path.dirname",
"tensorflow.device",
"synthesizer.utils.text.text_to_sequence",
"time.time",
"tensorflow.placeholder",
"numpy.array",
"tensorflow.FIFOQueue",
"os.path.join",
... | [((1632, 1732), 'sklearn.model_selection.train_test_split', 'train_test_split', (['indices'], {'test_size': 'test_size', 'random_state': 'hparams.tacotron_data_random_state'}), '(indices, test_size=test_size, random_state=hparams.\n tacotron_data_random_state)\n', (1648, 1732), False, 'from sklearn.model_selection i... |
import numpy as np
import re
import warnings
from .endf_data import reaction, atomic_relaxation
class endf_reader:
"""ENDF-6 format reader.
See https://www.nndc.bnl.gov/csewg/docs/endf-manual.pdf for the specification.
Only (MF=1, MT=451), MF=23, MF=26 are implemented.
Properties:
- MAT: Material identifier.
... | [
"numpy.zeros"
] | [((6382, 6395), 'numpy.zeros', 'np.zeros', (['NPL'], {}), '(NPL)\n', (6390, 6395), True, 'import numpy as np\n'), ((6729, 6752), 'numpy.zeros', 'np.zeros', (['NR'], {'dtype': 'int'}), '(NR, dtype=int)\n', (6737, 6752), True, 'import numpy as np\n'), ((6761, 6784), 'numpy.zeros', 'np.zeros', (['NR'], {'dtype': 'int'}), ... |
import jax
import jax.numpy as np
from jax import random, jit
import matplotlib.pyplot as plt
from jax.scipy.stats import norm
import pickle as pkl
import numpy as onp
from scipy.stats import norm as onorm
from jax.experimental.optimizers import adam
import argparse
class MSC:
def __init__(self, seed, n_latent):
... | [
"argparse.ArgumentParser",
"numpy.isnan",
"jax.random.PRNGKey",
"jax.experimental.optimizers.adam",
"jax.random.uniform",
"jax.random.normal",
"jax.numpy.cumsum",
"numpy.genfromtxt",
"numpy.insert",
"jax.scipy.stats.norm.logpdf",
"jax.numpy.sum",
"numpy.random.permutation",
"jax.numpy.array"... | [((5519, 5553), 'numpy.random.permutation', 'onp.random.permutation', (['n_examples'], {}), '(n_examples)\n', (5541, 5553), True, 'import numpy as onp\n'), ((6304, 6369), 'numpy.genfromtxt', 'onp.genfromtxt', (['args.file_path'], {'missing_values': '"""?"""', 'delimiter': '""","""'}), "(args.file_path, missing_values='... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 24 13:30:36 2018
@author: engelen
"""
from glob import glob
import numpy as np
import os, sys
import netCDF4 as nc4
from datetime import datetime
import re
#%%
def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
return [int(text) if text.isdigit() else text.low... | [
"re.split",
"os.path.isdir",
"netCDF4.date2num",
"numpy.array",
"numpy.loadtxt",
"re.search",
"glob.glob",
"os.path.join",
"re.compile"
] | [((242, 264), 're.compile', 're.compile', (['"""([0-9]+)"""'], {}), "('([0-9]+)')\n", (252, 264), False, 'import re\n'), ((1668, 1688), 'numpy.array', 'np.array', (['init_times'], {}), '(init_times)\n', (1676, 1688), True, 'import numpy as np\n'), ((410, 452), 'os.path.join', 'os.path.join', (['folder', '"""head_*_l1_p... |
import copy
import intprim
import matplotlib.pyplot as plt
import matplotlib.animation
import numpy as np
import numpy.random
import sklearn.metrics
try:
import IPython.display
except:
pass
animation_plots = []
def create_2d_handwriting_data(num_trajectories, translation_mean, translation_std, noise_std, len... | [
"copy.deepcopy",
"matplotlib.pyplot.show",
"numpy.random.binomial",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axes",
"intprim.basis.GaussianModel",
"matplotlib.pyplot.legend",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.array",
"numpy.tile",
"numpy.linspace",
"numpy.... | [((406, 1676), 'numpy.array', 'np.array', (['[2.52147861, 2.68261873, 2.84009521, 2.99269205, 3.13926385, 3.27876056, \n 3.41025573, 3.5329778, 3.64634321, 3.74998937, 3.8438048, 3.92795314, \n 4.00288777, 4.0693539, 4.12837543, 4.18122498, 4.22937664, 4.27444203, \n 4.31809201, 4.36196737, 4.40758299, 4.45623... |
#! /usr/bin/env python
import argparse
import os
import subprocess
import tempfile
import itertools
import numpy as np
from CMash import MinHash as MH
from scipy.sparse import csc_matrix, save_npz
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="Creates a y-vector (i.e. sample vect... | [
"subprocess.run",
"tempfile.NamedTemporaryFile",
"CMash.MinHash.import_multiple_from_single_hdf5",
"tempfile.TemporaryDirectory",
"argparse.ArgumentParser",
"numpy.sum",
"os.path.exists",
"numpy.array",
"itertools.chain.from_iterable"
] | [((238, 441), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Creates a y-vector (i.e. sample vector) when presented with a fasta or fastq input WGS metagenome."""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'Creates a y-vector (i.e. sample vector)... |
'''
TODO:
- warning ketika Id yg diinputkan sudah ada ✓
- simpan gambar user per folder dengan nama folder == Id ✓
- jika menggunakan kamera dengan resolusi kamera lebih besar,
perlu pencahayaan yang baik ✗
- jika inputan kosong, berikan error handle atau sediakan default
values untuk gender dan... | [
"imutils.video.VideoStream",
"cv2.putText",
"os.makedirs",
"cv2.waitKey",
"cv2.destroyAllWindows",
"os.path.exists",
"cv2.imshow",
"time.sleep",
"cv2.rectangle",
"numpy.array",
"cv2.dnn.readNetFromCaffe",
"imutils.resize",
"pymysql.connect",
"cv2.resize"
] | [((822, 871), 'pymysql.connect', 'psql.connect', (['"""localhost"""', '"""admin"""', '"""12345"""', '"""fr"""'], {}), "('localhost', 'admin', '12345', 'fr')\n", (834, 871), True, 'import pymysql as psql\n'), ((961, 997), 'os.path.exists', 'os.path.exists', (["('dataset/' + dirname)"], {}), "('dataset/' + dirname)\n", (... |
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "l... | [
"numpy.zeros",
"local_mode_utils.lock",
"local_mode_utils.assert_output_files_exist",
"test.integration.MODEL_SUCCESS_FILES.items",
"os.path.join"
] | [((858, 894), 'os.path.join', 'os.path.join', (['RESOURCE_PATH', '"""mnist"""'], {}), "(RESOURCE_PATH, 'mnist')\n", (870, 894), False, 'import os\n'), ((909, 945), 'os.path.join', 'os.path.join', (['MNIST_PATH', '"""mnist.py"""'], {}), "(MNIST_PATH, 'mnist.py')\n", (921, 945), False, 'import os\n'), ((980, 1013), 'os.p... |
"""General module to help train SBERT for NLI tasks."""
import datetime
import math
import os
import pickle
import shutil
import numpy as np
import torch
import torch.optim as optim
import wget
from sentence_transformers import SentenceTransformer, SentencesDataset
from sentence_transformers import losses, models
fr... | [
"numpy.abs",
"sentence_transformers.models.Transformer",
"sentence_transformers.evaluation.EmbeddingSimilarityEvaluator",
"torch.argmax",
"transformers.AutoModel.from_pretrained",
"torch.device",
"shutil.rmtree",
"torch.no_grad",
"os.path.join",
"torch.utils.data.DataLoader",
"os.path.exists",
... | [((6675, 6734), 'torch.utils.data.DataLoader', 'DataLoader', (['train_data'], {'shuffle': '(True)', 'batch_size': 'batch_size'}), '(train_data, shuffle=True, batch_size=batch_size)\n', (6685, 6734), False, 'from torch.utils.data import DataLoader\n'), ((7162, 7337), 'sentence_transformers.evaluation.EmbeddingSimilarity... |
# ------------------------------------------------------------------------------
# Copyright 2021 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.a... | [
"numpy.zeros",
"numpy.spacing",
"numpy.where",
"numpy.array",
"numpy.exp"
] | [((1192, 1212), 'numpy.zeros', 'np.zeros', (['d.shape[0]'], {}), '(d.shape[0])\n', (1200, 1212), True, 'import numpy as np\n'), ((970, 1086), 'numpy.array', 'np.array', (['[0.26, 0.25, 0.25, 0.35, 0.35, 0.79, 0.79, 0.72, 0.72, 0.62, 0.62, 1.07, \n 1.07, 0.87, 0.87, 0.89, 0.89]'], {}), '([0.26, 0.25, 0.25, 0.35, 0.35... |
#!/usr/bin/env python3
import argparse
import os
import sys
from collections import OrderedDict
from typing import Callable, Tuple
import cv2 as cv
import matplotlib.pyplot as plt
import numpy as np
IMAGE_DTYPES = OrderedDict([
('uint8', np.uint8),
('uint16', np.uint8),
('uint32', np.uint8),
('uint64... | [
"cv2.getTickCount",
"numpy.iinfo",
"numpy.random.randint",
"cv2.dft",
"matplotlib.pyplot.tight_layout",
"numpy.zeros_like",
"cv2.magnitude",
"cv2.filter2D",
"cv2.getTickFrequency",
"numpy.std",
"cv2.copyMakeBorder",
"numpy.finfo",
"cv2.split",
"matplotlib.pyplot.subplots",
"matplotlib.py... | [((217, 322), 'collections.OrderedDict', 'OrderedDict', (["[('uint8', np.uint8), ('uint16', np.uint8), ('uint32', np.uint8), ('uint64',\n np.uint8)]"], {}), "([('uint8', np.uint8), ('uint16', np.uint8), ('uint32', np.uint8\n ), ('uint64', np.uint8)])\n", (228, 322), False, 'from collections import OrderedDict\n')... |
"""Test charting functionality"""
import itertools
import platform
import matplotlib.pyplot as plt
import numpy as np
import pytest
import pyvista
from pyvista import examples
from pyvista.plotting import charts, system_supports_plotting
skip_mac = pytest.mark.skipif(platform.system() == 'Darwin',
... | [
"numpy.allclose",
"numpy.isclose",
"numpy.sin",
"numpy.arange",
"pytest.mark.parametrize",
"pyvista.Chart2D",
"pyvista.plotting.charts.BarPlot",
"pyvista.plotting.charts.Axis",
"pyvista.Plotter",
"pyvista._vtk.vtkPen",
"pyvista.examples.download_masonry_texture",
"pyvista.plotting.charts.Stack... | [((9497, 9588), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""chart_f"""', "('chart_2d', 'chart_box', 'chart_pie', 'chart_mpl')"], {}), "('chart_f', ('chart_2d', 'chart_box', 'chart_pie',\n 'chart_mpl'))\n", (9520, 9588), False, 'import pytest\n'), ((11874, 12011), 'pytest.mark.parametrize', 'pytest.ma... |
# _ __ _ _
# /\_/\ | '__| | | |
# [===] | | | |_| |
# \./ |_| \__,_|
#
# /***************//***************//***************/
# /* statspack.py *//* <NAME> *//* www.hakkeray.com */
# /***************//***************//***************/
# ________________________
# | hakkeray | Updated: |
# | v3.0.0... | [
"matplotlib.pyplot.title",
"matplotlib.rc",
"numpy.sum",
"matplotlib.style.use",
"IPython.display.Markdown",
"sklearn.metrics.r2_score",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure",
"statsmodels.graphics.tsaplots.plot_pacf",
"matplotlib.pyplot.tight_layout",
"pandas.set_option",
... | [((749, 780), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-bright"""'], {}), "('seaborn-bright')\n", (762, 780), True, 'import matplotlib.pyplot as plt\n'), ((781, 812), 'matplotlib.style.use', 'mpl.style.use', (['"""seaborn-bright"""'], {}), "('seaborn-bright')\n", (794, 812), True, 'import matplotlib... |
import os
from imageio import imread
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.patches as patches
def get_positive_features(train_path_pos, cell_size, window_size, block_size, nbins):
'''
'train_path_pos' is a string. This directory contains 36x36 images of
faces
... | [
"matplotlib.pyplot.title",
"numpy.arctan2",
"numpy.ceil",
"numpy.degrees",
"matplotlib.patches.Rectangle",
"math.ceil",
"matplotlib.pyplot.imshow",
"imageio.imread",
"numpy.floor",
"numpy.zeros",
"math.floor",
"matplotlib.pyplot.figure",
"numpy.linalg.norm",
"numpy.random.rand",
"os.path... | [((1537, 1562), 'numpy.zeros', 'np.zeros', (['(num_images, D)'], {}), '((num_images, D))\n', (1545, 1562), True, 'import numpy as np\n'), ((3575, 3621), 'numpy.zeros', 'np.zeros', (['(num_images * num_sample_per_img, D)'], {}), '((num_images * num_sample_per_img, D))\n', (3583, 3621), True, 'import numpy as np\n'), ((5... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 18:16:51 2021
@author: Enrique
"""
'''
Several tests for the graphicality of a degree sequence.
These are naive implementations. One can use instead the
functions of the NetworkX library.
'''
import numpy as np
def sequence_is_even(deg_seq):
... | [
"numpy.minimum",
"numpy.sum",
"numpy.cumsum",
"numpy.array",
"numpy.arange",
"networkx.is_graphical",
"numpy.all"
] | [((429, 444), 'numpy.sum', 'np.sum', (['deg_seq'], {}), '(deg_seq)\n', (435, 444), True, 'import numpy as np\n'), ((1058, 1076), 'numpy.cumsum', 'np.cumsum', (['deg_seq'], {}), '(deg_seq)\n', (1067, 1076), True, 'import numpy as np\n'), ((1110, 1122), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (1119, 1122), Tru... |
import robotoc
import pinocchio
from pinocchio.robot_wrapper import RobotWrapper
from os.path import abspath, dirname, join
import numpy as np
import math
import time
class TrajectoryViewer:
def __init__(self, path_to_urdf, path_to_pkg=None,
base_joint_type=robotoc.BaseJointType.FixedBase,
... | [
"os.path.abspath",
"pinocchio.JointModelFreeFlyer",
"robotoc.Robot",
"os.path.dirname",
"os.system",
"time.sleep",
"pinocchio.Quaternion",
"subprocess.getstatusoutput",
"numpy.array",
"pinocchio.visualize.MeshcatVisualizer",
"numpy.linalg.norm",
"pinocchio.visualize.GepettoVisualizer",
"pino... | [((384, 405), 'os.path.abspath', 'abspath', (['path_to_urdf'], {}), '(path_to_urdf)\n', (391, 405), False, 'from os.path import abspath, dirname, join\n'), ((1308, 1333), 'numpy.array', 'np.array', (['[1.0, 0.0, 0.0]'], {}), '([1.0, 0.0, 0.0])\n', (1316, 1333), True, 'import numpy as np\n'), ((777, 835), 'pinocchio.rob... |
# Copyright 2017 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.test.main",
"core.region_similarity_calculator.IouSimilarity",
"core.box_list.BoxList",
"core.region_similarity_calculator.NegSqDistSimilarity",
"box_coders.keypoint_box_coder.KeypointBoxCoder",
"core.target_assigner.create_target_assigner",
"numpy.zeros",
"tensorflow.constant",
"matcher... | [((43958, 43972), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (43970, 43972), True, 'import tensorflow as tf\n'), ((2114, 2210), 'numpy.array', 'np.array', (['[[0.0, 0.0, 0.5, 0.5], [0.5, 0.5, 1.0, 0.8], [0, 0.5, 0.5, 1.0]]'], {'dtype': 'np.float32'}), '([[0.0, 0.0, 0.5, 0.5], [0.5, 0.5, 1.0, 0.8], [0, 0.... |
from unittest import TestCase, main
from numpy import diag_indices, dot, finfo, float64
from numpy.random import random
from numpy.testing import assert_allclose
from cogent3.maths.matrix_exponentiation import PadeExponentiator
from cogent3.maths.matrix_logarithm import logm
from cogent3.maths.measure import (
js... | [
"unittest.main",
"cogent3.maths.measure.jsd",
"cogent3.maths.matrix_exponentiation.PadeExponentiator",
"numpy.testing.assert_allclose",
"numpy.diag_indices",
"cogent3.maths.matrix_logarithm.logm",
"cogent3.maths.measure.paralinear_continuous_time",
"numpy.finfo",
"numpy.random.random",
"cogent3.ma... | [((657, 671), 'numpy.random.random', 'random', (['(4, 4)'], {}), '((4, 4))\n', (663, 671), False, 'from numpy.random import random\n'), ((686, 701), 'numpy.diag_indices', 'diag_indices', (['(4)'], {}), '(4)\n', (698, 701), False, 'from numpy import diag_indices, dot, finfo, float64\n'), ((881, 892), 'numpy.dot', 'dot',... |
import numpy as np
from scipy.sparse import coo_matrix
from mrftools import MarkovNet, BeliefPropagator, MatrixBeliefPropagator
from .StagHuntModel import StagHuntModel
from .util import *
class MatrixStagHuntModel(StagHuntModel):
def __init__(self):
"""
MRF formulation of the game, using mrftool... | [
"numpy.full",
"mrftools.MarkovNet",
"numpy.argmax",
"mrftools.BeliefPropagator",
"numpy.zeros",
"numpy.ones",
"numpy.errstate",
"numpy.transpose",
"numpy.isclose",
"numpy.arange",
"numpy.exp",
"numpy.random.choice",
"numpy.nanargmax",
"mrftools.MatrixBeliefPropagator"
] | [((1958, 2011), 'numpy.full', 'np.full', (['(self.N, self.N)', 'self.MIN'], {'dtype': 'np.float64'}), '((self.N, self.N), self.MIN, dtype=np.float64)\n', (1965, 2011), True, 'import numpy as np\n'), ((2335, 2356), 'numpy.arange', 'np.arange', (['(self.N - 1)'], {}), '(self.N - 1)\n', (2344, 2356), True, 'import numpy a... |
import numpy as np
import scipy.sparse as sp
import pytest
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_warns_message
from sklearn.metrics.cluster import silhouette_score
from sklearn.metrics.cluster imp... | [
"sklearn.datasets.load_iris",
"numpy.ones",
"numpy.isnan",
"scipy.sparse.lil_matrix",
"numpy.arange",
"pytest.mark.parametrize",
"numpy.unique",
"sklearn.utils._testing.assert_array_equal",
"pytest.warns",
"sklearn.metrics.cluster.calinski_harabasz_score",
"numpy.random.RandomState",
"numpy.fi... | [((6414, 6472), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dtype"""', '(np.float32, np.float64)'], {}), "('dtype', (np.float32, np.float64))\n", (6437, 6472), False, 'import pytest\n'), ((645, 665), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (663, 665), False, 'from sklearn i... |
import uuid
import json
import numpy as np
import os
import matplotlib.pyplot as plt
import matplotlib
from utils import *
#def check_files(prefix, episodefiles):
# pathfiles = {}
# for ep_file in episodefiles:
# pathfile = prefix + str('/') + str(ep_file)
# ep_file_status = False
# try:
# ... | [
"matplotlib.pyplot.show",
"json.loads",
"numpy.array",
"matplotlib.pyplot.subplots",
"os.listdir",
"matplotlib.pyplot.errorbar"
] | [((1178, 1206), 'os.listdir', 'os.listdir', (['prefix_pathfiles'], {}), '(prefix_pathfiles)\n', (1188, 1206), False, 'import os\n'), ((8979, 8993), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (8991, 8993), True, 'import matplotlib.pyplot as plt\n'), ((9014, 9037), 'numpy.array', 'np.array', (['inter... |
# Copyright 2019 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.python.platform.test.main",
"tensorflow.python.ops.array_ops.ones",
"numpy.zeros",
"numpy.ones",
"tensorflow.python.framework.constant_op.constant",
"tensorflow.python.keras.callbacks.TensorBoard",
"tensorflow.python.data.ops.dataset_ops.DatasetV2.from_tensor_slices",
"tensorflow.python.ke... | [((3876, 3887), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (3885, 3887), False, 'from tensorflow.python.platform import test\n'), ((1716, 1734), 'numpy.zeros', 'np.zeros', (['(50, 10)'], {}), '((50, 10))\n', (1724, 1734), True, 'import numpy as np\n'), ((1759, 1770), 'numpy.ones', 'np.ones',... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Fixtures for QMT unit tests."""
import os
import pytest
import qmt
import sys
@pytest.fixture(scope="session")
def fix_exampleDir():
"""Return the example directory path."""
rootPath = os.path.join(os.path.dirna... | [
"FreeCAD.closeDocument",
"numpy.sum",
"os.path.dirname",
"pytest.fixture",
"FreeCAD.newDocument",
"numpy.linspace",
"os.path.join"
] | [((180, 211), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (194, 211), False, 'import pytest\n'), ((415, 447), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (429, 447), False, 'import pytest\n'), ((725, 757), 'pytest.fixtur... |
'''
MIT License
Copyright (c) 2017 <NAME>
'''
import numpy as np
def get_lookup_tables(text):
chars = tuple(set(text))
int2char = dict(enumerate(chars))
char2int = {ch: ii for ii, ch in int2char.items()}
return int2char, char2int
def get_batches(arr, n_seqs, n_steps):
'''Create a generator... | [
"numpy.zeros_like",
"numpy.multiply",
"numpy.arange"
] | [((790, 806), 'numpy.zeros_like', 'np.zeros_like', (['x'], {}), '(x)\n', (803, 806), True, 'import numpy as np\n'), ((1086, 1109), 'numpy.multiply', 'np.multiply', (['*arr.shape'], {}), '(*arr.shape)\n', (1097, 1109), True, 'import numpy as np\n'), ((1203, 1230), 'numpy.arange', 'np.arange', (['one_hot.shape[0]'], {}),... |
#!python3
'''This module provides all of the interaction with scikit-learn and
performs the logistic regressions'''
import numpy
from sklearn import linear_model
from sklearn.metrics import log_loss
def create_school_array(base_table):
'''Returns a numpy array that can be fed to the regression tool where
... | [
"sklearn.linear_model.LogisticRegression",
"numpy.mean",
"numpy.array"
] | [((529, 555), 'numpy.array', 'numpy.array', (['reduced_table'], {}), '(reduced_table)\n', (540, 555), False, 'import numpy\n'), ((1021, 1044), 'numpy.array', 'numpy.array', (['diff_table'], {}), '(diff_table)\n', (1032, 1044), False, 'import numpy\n'), ((1269, 1335), 'sklearn.linear_model.LogisticRegression', 'linear_m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Jul 1, 2019
@author: <NAME> <<EMAIL>>
@author: <NAME> <<EMAIL>>
@author: <NAME> <<EMAIL>>
"""
from math import pi
from typing import Union, Optional, Iterable
import numpy as np
from scipy import sparse
from sknetwork.utils import Bunch
from sknetwork.util... | [
"sknetwork.utils.parse.edgelist2adjacency",
"numpy.random.choice",
"numpy.random.seed",
"numpy.ones_like",
"scipy.sparse.random",
"numpy.zeros",
"scipy.sparse.bmat",
"scipy.sparse.lil_matrix",
"numpy.sin",
"numpy.array",
"numpy.arange",
"numpy.cos",
"scipy.sparse.csr_matrix",
"sknetwork.ut... | [((1535, 1563), 'numpy.random.seed', 'np.random.seed', (['random_state'], {}), '(random_state)\n', (1549, 1563), True, 'import numpy as np\n'), ((1576, 1591), 'numpy.array', 'np.array', (['sizes'], {}), '(sizes)\n', (1584, 1591), True, 'import numpy as np\n'), ((2142, 2161), 'scipy.sparse.bmat', 'sparse.bmat', (['matri... |
# -*- coding: utf-8 -*-
"""grab_worldbank retrieves global average temperatures from the Worldbank
https://data.worldbank.org/topic/climate-change
This python module contains a single function, grab_worldbank, that
retrieves the global average temperature estimates from the Worldbank dataset
(Celsius). This is the cli... | [
"pandas.DataFrame",
"wbpy.ClimateAPI",
"pandas.read_csv",
"numpy.array",
"sys.exit"
] | [((3173, 3190), 'wbpy.ClimateAPI', 'wbpy.ClimateAPI', ([], {}), '()\n', (3188, 3190), False, 'import wbpy\n'), ((3271, 3397), 'pandas.read_csv', 'pd.read_csv', (['"""https://raw.githubusercontent.com/datasets/country-codes/master/data/country-codes.csv"""'], {'delimiter': '""","""'}), "(\n 'https://raw.githubusercon... |
"""
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | [
"numpy.array",
"mo.ops.op.Op.get_op_class_by_name",
"mo.front.onnx.extractors.utils.onnx_attr"
] | [((1430, 1469), 'mo.front.onnx.extractors.utils.onnx_attr', 'onnx_attr', (['node', '"""flip"""', '"""i"""'], {'default': '(0)'}), "(node, 'flip', 'i', default=0)\n", (1439, 1469), False, 'from mo.front.onnx.extractors.utils import onnx_attr\n'), ((1491, 1530), 'mo.front.onnx.extractors.utils.onnx_attr', 'onnx_attr', ([... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 15 15:02:07 2019
@author: wangyf
"""
import os
import sys
#os.chdir('..')
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import pandas as pd
import json
import lattice_functions as lf
import pickle
import os
font = {'family' : 'normal', 'size' ... | [
"matplotlib.rc",
"json.load",
"matplotlib.pyplot.show",
"numpy.load",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylim",
"os.getcwd",
"lattice_functions.get_NPd_list",
"os.path.join",
"numpy.cumsum",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matp... | [((328, 357), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {}), "('font', **font)\n", (341, 357), False, 'import matplotlib\n'), ((585, 610), 'numpy.cumsum', 'np.cumsum', (['datasize_batch'], {}), '(datasize_batch)\n', (594, 610), True, 'import numpy as np\n'), ((1204, 1232), 'matplotlib.pyplot.subplots', 'plt.su... |
import bpy, os, sys, re, platform, subprocess
import numpy as np
class TLM_OIDN_Denoise:
image_array = []
image_output_destination = ""
denoised_array = []
def __init__(self, oidnProperties, img_array, dirpath):
self.oidnProperties = oidnProperties
self.image_array = img_array
... | [
"subprocess.Popen",
"bpy.path.abspath",
"numpy.fromfile",
"os.path.realpath",
"numpy.float32",
"numpy.zeros",
"numpy.ones",
"numpy.array",
"os.path.splitext",
"numpy.reshape",
"platform.system",
"bpy.data.images.load",
"os.path.join"
] | [((6400, 6431), 'numpy.fromfile', 'np.fromfile', (['file', "(endian + 'f')"], {}), "(file, endian + 'f')\n", (6411, 6431), True, 'import numpy as np\n'), ((610, 632), 'os.path.splitext', 'os.path.splitext', (['file'], {}), '(file)\n', (626, 632), False, 'import bpy, os, sys, re, platform, subprocess\n'), ((6583, 6606),... |
# Copyright (c) 2016-present, Facebook, Inc.
#
# 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... | [
"scipy.sparse.coo_matrix",
"caffe2.python.core.CreateOperator",
"numpy.random.rand",
"hypothesis.strategies.integers",
"hypothesis.strategies.floats"
] | [((1555, 1583), 'numpy.random.rand', 'np.random.rand', (['n_data', 'n_in'], {}), '(n_data, n_in)\n', (1569, 1583), True, 'import numpy as np\n'), ((1628, 1641), 'scipy.sparse.coo_matrix', 'coo_matrix', (['A'], {}), '(A)\n', (1638, 1641), False, 'from scipy.sparse import coo_matrix\n'), ((1941, 2046), 'caffe2.python.cor... |
import subprocess
import numpy as np
from pathlib import Path
import os, sys
import requests
supported_openvino_version = '2020.1'
def relative_to_abs_path(relative_path):
dirname = Path(__file__).parent
try:
return str((dirname / relative_path).resolve())
except FileNotFoundError:
return ... | [
"subprocess.run",
"argparse.ArgumentParser",
"sys.exit",
"pathlib.Path",
"requests.post",
"numpy.concatenate"
] | [((1013, 1043), 'subprocess.run', 'subprocess.run', (['downloader_cmd'], {}), '(downloader_cmd)\n', (1027, 1043), False, 'import subprocess\n'), ((1427, 1450), 'pathlib.Path', 'Path', (['ir_converter_path'], {}), '(ir_converter_path)\n', (1431, 1450), False, 'from pathlib import Path\n'), ((1846, 1875), 'subprocess.run... |
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"arch.api.utils.log_utils.getLogger",
"federatedml.model_selection.MiniBatch",
"federatedml.util.transfer_variable.HeteroLRTransferVariable",
"numpy.square",
"federatedml.optim.gradient.HeteroLogisticGradient",
"federatedml.statistic.data_overview.get_features_shape",
"federatedml.optim.activation.sigmo... | [((1117, 1138), 'arch.api.utils.log_utils.getLogger', 'log_utils.getLogger', ([], {}), '()\n', (1136, 1138), False, 'from arch.api.utils import log_utils\n'), ((1381, 1407), 'federatedml.util.transfer_variable.HeteroLRTransferVariable', 'HeteroLRTransferVariable', ([], {}), '()\n', (1405, 1407), False, 'from federatedm... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy import units as u
from astropy.coordinates.builtin_frames import ICRS, Galactic, Galactocentric
from astropy.coordinates import builtin_frames as bf
from astropy.units import allclose... | [
"numpy.random.uniform",
"astropy.coordinates.builtin_frames.ICRS",
"astropy.units.parallax",
"pytest.raises",
"numpy.random.normal",
"astropy.units.allclose",
"pytest.mark.parametrize",
"astropy.coordinates.builtin_frames.Galactocentric"
] | [((2767, 2812), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kwargs"""', 'all_kwargs'], {}), "('kwargs', all_kwargs)\n", (2790, 2812), False, 'import pytest\n'), ((3769, 4320), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""cls,lon,lat"""', "[[bf.ICRS, 'ra', 'dec'], [bf.FK4, 'ra', 'dec'], [b... |
"""Tests for colorspace functions."""
import pytest
import numpy as np
PRECISION = 1e-1
@pytest.fixture
def test_spectrum():
return colorimetry.prepare_illuminant_spectrum()
def test_can_prepare_cmf_1931_2deg():
''' Trusts observer is properly formed.
'''
obs = colorimetry.prepare_cmf('1931_2deg'... | [
"numpy.dstack",
"numpy.argmax",
"numpy.allclose",
"numpy.zeros",
"numpy.isfinite",
"numpy.searchsorted",
"pytest.raises",
"numpy.arange",
"pytest.mark.parametrize",
"pytest.approx"
] | [((1382, 1587), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""illuminant"""', "['A', 'B', 'C', 'E', 'D50', 'D55', 'D65', 'D75', 'F1', 'F2', 'F3', 'F4',\n 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12', 'HP1', 'HP2', 'HP3',\n 'HP4', 'HP5']"], {}), "('illuminant', ['A', 'B', 'C', 'E', 'D50', 'D55',... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (c) 2019 HERE Europe B.V.
#
# SPDX-License-Identifier: MIT
#
###############################################################################
import json
import random
import numpy as np
from test.util... | [
"qgis.testing.unittest.main",
"qgis.core.QgsVectorLayer",
"numpy.abs",
"json.loads",
"XYZHubConnector.xyz_qgis.layer.parser.normal_field_name",
"random.shuffle",
"test.utils.len_of_struct",
"XYZHubConnector.xyz_qgis.layer.parser.xyz_json_to_feature",
"test.utils.format_map_fields",
"test.utils.Tes... | [((22930, 22962), 'qgis.testing.unittest.main', 'unittest.main', ([], {'defaultTest': 'tests'}), '(defaultTest=tests)\n', (22943, 22962), False, 'from qgis.testing import unittest\n'), ((7007, 7025), 'test.utils.TestFolder', 'TestFolder', (['folder'], {}), '(folder)\n', (7017, 7025), False, 'from test.utils import Base... |
# -*- coding: utf-8 -*-
"""
Need to randomize drones and its locations
Need to iterate over different heuristics
Need to log each iteration
Need to keep track of success rate over iteration
"""
import sys
import numpy as np
import math
import random
from scipy import spatial
from queue import PriorityQueue
import m... | [
"numpy.sum",
"gc.collect",
"os.path.join",
"csv.DictWriter",
"random.randint",
"UTMDatabase.LandingDatabase",
"PathFinding.Astar",
"queue.PriorityQueue",
"math.sqrt",
"numpy.cross",
"time.sleep",
"gc.set_debug",
"UTMDatabase.OverallDatabase",
"os.getcwd",
"numpy.zeros",
"random.choice"... | [((33242, 33262), 'numpy.array', 'np.array', (['point_list'], {}), '(point_list)\n', (33250, 33262), True, 'import numpy as np\n'), ((33392, 33407), 'numpy.sum', 'np.sum', (['lengths'], {}), '(lengths)\n', (33398, 33407), True, 'import numpy as np\n'), ((33562, 33632), 'math.sqrt', 'math.sqrt', (['((position[0] - goal[... |
#
# An attempt to implement multiprocessing
#
# Importing the necessary modules.
import projectq
from projectq.ops import H,X,Y,Z,T,Tdagger,S,Sdagger,CNOT,Measure,All,Rx,Ry,Rz,SqrtX,Swap
import numpy as np
import copy, sys, getopt, os
from deap import creator, base, tools
from candidate import Candidate
from co... | [
"comparison.compare",
"new_evolution.geneticAlgorithm",
"argparse.ArgumentParser",
"deap.base.Toolbox",
"numpy.vdot",
"time.perf_counter",
"qiskit_transpiler.transpiled_initialization_circuits.getPermutation",
"deap.creator.create",
"qiskit.execute",
"datetime.datetime.now",
"os.listdir",
"qis... | [((3263, 3288), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3286, 3288), False, 'import argparse\n'), ((4058, 4072), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (4070, 4072), False, 'from datetime import datetime\n'), ((4451, 4517), 'deap.creator.create', 'creator.create', ([... |
# Copyright 2019 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.compat.v1.logging.info",
"tensorflow.math.top_k",
"numpy.array",
"tensorflow.lite.TFLiteConverter.from_keras_model",
"tensorflow.io.gfile.GFile"
] | [((4185, 4219), 'tensorflow.math.top_k', 'tf.math.top_k', (['predicted_prob'], {'k': 'k'}), '(predicted_prob, k=k)\n', (4198, 4219), True, 'import tensorflow as tf\n'), ((5455, 5507), 'tensorflow.lite.TFLiteConverter.from_keras_model', 'tf.lite.TFLiteConverter.from_keras_model', (['self.model'], {}), '(self.model)\n', ... |
import numpy as np
from lagom.transform import geometric_cumsum
from lagom.utils import numpify
def returns(gamma, rewards):
return geometric_cumsum(gamma, rewards)[0, :].astype(np.float32)
def bootstrapped_returns(gamma, rewards, last_V, reach_terminal):
r"""Return (discounted) accumulated returns with bo... | [
"numpy.append",
"lagom.utils.numpify",
"lagom.transform.geometric_cumsum"
] | [((696, 723), 'lagom.utils.numpify', 'numpify', (['last_V', 'np.float32'], {}), '(last_V, np.float32)\n', (703, 723), False, 'from lagom.utils import numpify\n'), ((797, 820), 'numpy.append', 'np.append', (['rewards', '(0.0)'], {}), '(rewards, 0.0)\n', (806, 820), True, 'import numpy as np\n'), ((870, 896), 'numpy.appe... |
import collections
import numpy
from .model import monthly_markov as gentrellis
from . import trellis
from . import markov_event
def make_hmm():
state_to_index = {s: i for i, s in enumerate(gentrellis.STATES)}
states = numpy.asarray([state_to_index[s] for s in gentrellis.STATES], dtype=int)
weighted_edg... | [
"collections.defaultdict",
"numpy.asarray"
] | [((230, 302), 'numpy.asarray', 'numpy.asarray', (['[state_to_index[s] for s in gentrellis.STATES]'], {'dtype': 'int'}), '([state_to_index[s] for s in gentrellis.STATES], dtype=int)\n', (243, 302), False, 'import numpy\n'), ((340, 369), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (3... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed May 29 18:34:24 2019
@author: philipp
"""
# z-Score plot of fold change
# =======================================================================
# Imports
from __future__ import division # floating point division by default
import sys
import time
impo... | [
"matplotlib.pyplot.title",
"numpy.mean",
"yaml.safe_load",
"glob.glob",
"matplotlib.pyplot.tick_params",
"pandas.read_table",
"matplotlib.pyplot.tight_layout",
"os.chdir",
"numpy.std",
"os.path.exists",
"numpy.log10",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.ylim",
"matplotlib.pypl... | [((358, 379), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (372, 379), False, 'import matplotlib\n'), ((852, 863), 'time.time', 'time.time', ([], {}), '()\n', (861, 863), False, 'import time\n'), ((1057, 1083), 'yaml.safe_load', 'yaml.safe_load', (['configFile'], {}), '(configFile)\n', (1071, 1... |
import csv
import pdb
from sklearn.metrics import accuracy_score, precision_score, recall_score, classification_report, confusion_matrix
import numpy as np
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
... | [
"numpy.zeros",
"numpy.array",
"csv.writer",
"numpy.linspace"
] | [((674, 715), 'csv.writer', 'csv.writer', (['self.log_file'], {'delimiter': '"""\t"""'}), "(self.log_file, delimiter='\\t')\n", (684, 715), False, 'import csv\n'), ((2077, 2113), 'numpy.array', 'np.array', (['self.queue[:self.max_size]'], {}), '(self.queue[:self.max_size])\n', (2085, 2113), True, 'import numpy as np\n'... |
# based on https://github.com/stelzner/monet
# License: MIT
# Author: <NAME>
import argparse
import torch
from torch import nn, optim
import torch.distributions as dists
import numpy as np
from PIL import Image
import os
from utils.os_utils import make_dir
this_file_dir = os.path.dirname(os.path.abspath(__file__)) + '... | [
"numpy.load",
"torch.distributions.Categorical",
"argparse.ArgumentParser",
"numpy.argmax",
"torch.cat",
"numpy.clip",
"numpy.random.randint",
"numpy.arange",
"torch.device",
"torch.no_grad",
"utils.os_utils.make_dir",
"os.path.abspath",
"numpy.zeros_like",
"torch.load",
"numpy.transpose... | [((10187, 10206), 'torch.cat', 'torch.cat', (['masks', '(1)'], {}), '(masks, 1)\n', (10196, 10206), False, 'import torch\n'), ((10222, 10250), 'torch.transpose', 'torch.transpose', (['masks', '(1)', '(3)'], {}), '(masks, 1, 3)\n', (10237, 10250), False, 'import torch\n'), ((10265, 10298), 'torch.distributions.Categoric... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 29 11:49:58 2016
"""
from __future__ import division
import numpy as np
#from sklearn.gaussian_process import GaussianProcess
from scipy.optimize import minimize
from acquisition_functions import AcquisitionFunction, unique_rows
#from visualization import Visu... | [
"acquisition_maximization.acq_max",
"numpy.random.seed",
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.asscalar",
"prada_gaussian_process.PradaGaussianProcess",
"numpy.std",
"numpy.append",
"numpy.max",
"numpy.reshape",
"numpy.divide",
"matplotlib.pyplot.ylim",
"numpy.asar... | [((6075, 6106), 'prada_gaussian_process.PradaGaussianProcess', 'PradaGaussianProcess', (['gp_params'], {}), '(gp_params)\n', (6095, 6106), False, 'from prada_gaussian_process import PradaGaussianProcess\n'), ((6360, 6376), 'numpy.zeros', 'np.zeros', (['(2, 1)'], {}), '((2, 1))\n', (6368, 6376), True, 'import numpy as n... |
import torch
import numpy as np
from logger import logger
from envs.babyai.utils.buffer import Buffer
import time
import psutil
import os
class Trainer(object):
def __init__(
self,
args=None,
collect_policy=None,
rl_policy=None,
il_policy=None,
relabel_policy=None,
... | [
"logger.logger.dumpkvs",
"torch.eq",
"os.getpid",
"logger.logger.save_itr_params",
"logger.logger.log",
"time.time",
"envs.babyai.utils.buffer.Buffer",
"numpy.mean",
"logger.logger.logkv"
] | [((2518, 2575), 'logger.logger.save_itr_params', 'logger.save_itr_params', (['self.itr', 'self.args.level', 'params'], {}), '(self.itr, self.args.level, params)\n', (2540, 2575), False, 'from logger import logger\n'), ((3137, 3148), 'time.time', 'time.time', ([], {}), '()\n', (3146, 3148), False, 'import time\n'), ((32... |
# -*- coding: utf-8 -*-
import numpy as np
from numpy import abs, asarray
from ..common import safe_import
with safe_import():
from scipy.special import factorial
class Benchmark:
"""
Defines a global optimization benchmark problem.
This abstract class defines the basic structure of a global
o... | [
"numpy.asfarray",
"numpy.random.uniform",
"numpy.asarray",
"numpy.abs"
] | [((5634, 5670), 'numpy.asarray', 'asarray', (['[b[0] for b in self.bounds]'], {}), '([b[0] for b in self.bounds])\n', (5641, 5670), False, 'from numpy import abs, asarray\n'), ((5888, 5924), 'numpy.asarray', 'asarray', (['[b[1] for b in self.bounds]'], {}), '([b[1] for b in self.bounds])\n', (5895, 5924), False, 'from ... |
from lenstronomy.SimulationAPI.observation_api import SingleBand
from lenstronomy.Data.imaging_data import ImageData
import lenstronomy.Util.util as util
import numpy as np
__all__ = ['DataAPI']
class DataAPI(SingleBand):
"""
This class is a wrapper of the general description of data in SingleBand() to trans... | [
"lenstronomy.SimulationAPI.observation_api.SingleBand.__init__",
"numpy.zeros",
"lenstronomy.Util.util.make_grid_with_coordtransform",
"lenstronomy.Data.imaging_data.ImageData"
] | [((950, 997), 'lenstronomy.SimulationAPI.observation_api.SingleBand.__init__', 'SingleBand.__init__', (['self'], {}), '(self, **kwargs_single_band)\n', (969, 997), False, 'from lenstronomy.SimulationAPI.observation_api import SingleBand\n'), ((1214, 1243), 'lenstronomy.Data.imaging_data.ImageData', 'ImageData', ([], {}... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import os
import warnings
import numpy as np
import scipy.sparse as sparse
from .default_constants import file_names_dict
from .exceptions import DirectoryDoesNotExistsError, FileDoesNotExistError
from .helpers import check_and_make_folder
# hf_data is HighFidelityDat... | [
"numpy.load",
"numpy.save",
"scipy.sparse.load_npz",
"os.path.isdir",
"os.path.isfile",
"numpy.min",
"numpy.array",
"numpy.max",
"warnings.warn",
"numpy.savez",
"os.path.join"
] | [((1389, 1434), 'os.path.join', 'os.path.join', (['directory_path', '"""high_fidelity"""'], {}), "(directory_path, 'high_fidelity')\n", (1401, 1434), False, 'import os\n'), ((1621, 1680), 'os.path.join', 'os.path.join', (['hf_folder_path', "default_file_names_dict['a1']"], {}), "(hf_folder_path, default_file_names_dict... |
# -*- coding: utf-8 -*-
"""
Defines the unit tests for the :mod:`colour.models.igpgtg` module.
"""
import numpy as np
import unittest
from itertools import permutations
from colour.models import XYZ_to_IgPgTg, IgPgTg_to_XYZ
from colour.utilities import domain_range_scale, ignore_numpy_errors
__author__ = 'Colour Dev... | [
"unittest.main",
"colour.utilities.domain_range_scale",
"itertools.permutations",
"colour.models.IgPgTg_to_XYZ",
"numpy.array",
"numpy.tile",
"numpy.reshape",
"colour.models.XYZ_to_IgPgTg"
] | [((5434, 5449), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5447, 5449), False, 'import unittest\n'), ((1676, 1722), 'numpy.array', 'np.array', (['[0.20654008, 0.12197225, 0.05136952]'], {}), '([0.20654008, 0.12197225, 0.05136952])\n', (1684, 1722), True, 'import numpy as np\n'), ((1740, 1758), 'colour.models.... |
import numpy as np
from typing import Dict, Any
from dataset.dataset import Dataset
from utils.constants import INPUT_SHAPE, INPUTS, OUTPUT, SAMPLE_ID, INPUT_NOISE, SMALL_NUMBER
from utils.constants import INPUT_SCALER, NUM_OUTPUT_FEATURES, NUM_CLASSES, LABEL_MAP
class SingleDataset(Dataset):
def tensorize(self... | [
"numpy.array",
"numpy.random.normal"
] | [((827, 915), 'numpy.random.normal', 'np.random.normal', ([], {'loc': '(0.0)', 'scale': 'metadata[INPUT_NOISE]', 'size': 'normalized_input.shape'}), '(loc=0.0, scale=metadata[INPUT_NOISE], size=\n normalized_input.shape)\n', (843, 915), True, 'import numpy as np\n'), ((509, 533), 'numpy.array', 'np.array', (['sample... |
# Step 0: Import the dependencies
import numpy as np
import gym
import random
def train_q(environment_var,
agent_var,
gamma_var,
lr_var,
total_episodes_var,
q_max_steps_var,
q_epsilon_var,... | [
"gym.make",
"numpy.argmax",
"random.uniform",
"numpy.zeros",
"numpy.max",
"numpy.exp"
] | [((504, 529), 'gym.make', 'gym.make', (['environment_var'], {}), '(environment_var)\n', (512, 529), False, 'import gym\n'), ((673, 708), 'numpy.zeros', 'np.zeros', (['(state_size, action_size)'], {}), '((state_size, action_size))\n', (681, 708), True, 'import numpy as np\n'), ((1805, 1825), 'random.uniform', 'random.un... |
#!/usr/bin/env python
# coding: utf-8
# # V3_P_RMSP
# In[ ]:
# Set the path to the root folder containing the training data.
# If you want to have access to the data please contact ...
basePath = ''
imgDir = basePath + 'images/Trainingsdatensatz_cropped_scaled/'
trainTsv = basePath + 'tsvDatein/final_dataset_s... | [
"keras.models.load_model",
"matplotlib.pyplot.title",
"csv.reader",
"keras.callbacks.CSVLogger",
"random.shuffle",
"keras.models.Model",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.figure",
"numpy.mean",
"matplotlib.pyplot.gca",
"numpy.unique",
"pandas.DataFrame",
"keras.util... | [((5887, 5911), 'random.shuffle', 'random.shuffle', (['combined'], {}), '(combined)\n', (5901, 5911), False, 'import random\n'), ((6016, 6040), 'random.shuffle', 'random.shuffle', (['combined'], {}), '(combined)\n', (6030, 6040), False, 'import random\n'), ((6143, 6167), 'random.shuffle', 'random.shuffle', (['combined'... |
import numpy as np
#Matriz Triangular Superior
A = np.array([[4,2,5],[2,5,8],[5,4,3]])
b = np.array([[60.7],[92.9],[56.3]])
def f(A, b):
Ab = np.concatenate((A,b),axis=1)
x = np.zeros(N)
for i in range(N-1,-1,-1):
xsum = 0
for j in range(i+1,N,1):
... | [
"numpy.zeros",
"numpy.transpose",
"numpy.array",
"numpy.linalg.solve",
"numpy.concatenate"
] | [((57, 100), 'numpy.array', 'np.array', (['[[4, 2, 5], [2, 5, 8], [5, 4, 3]]'], {}), '([[4, 2, 5], [2, 5, 8], [5, 4, 3]])\n', (65, 100), True, 'import numpy as np\n'), ((98, 132), 'numpy.array', 'np.array', (['[[60.7], [92.9], [56.3]]'], {}), '([[60.7], [92.9], [56.3]])\n', (106, 132), True, 'import numpy as np\n'), ((... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.