code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"qiskit.quantum_info.operators.predicates.is_identity_matrix",
"numpy.allclose",
"numpy.sqrt",
"numpy.conj",
"qiskit.quantum_info.operators.mixins.generate_apidocs",
"qiskit.quantum_info.operators.op_shape.OpShape.auto",
"numpy.asarray",
"qiskit.quantum_info.operators.channel.transformations._to_kraus... | [((12941, 12964), 'qiskit.quantum_info.operators.mixins.generate_apidocs', 'generate_apidocs', (['Kraus'], {}), '(Kraus)\n', (12957, 12964), False, 'from qiskit.quantum_info.operators.mixins import generate_apidocs\n'), ((8055, 8102), 'qiskit.quantum_info.operators.predicates.is_identity_matrix', 'is_identity_matrix', ... |
'''Train DCENet with PyTorch'''
# from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import os
import json
import neptune
import argparse
import numpy as np
from loader import *
from utils.plots import *
from utils.utils impor... | [
"utils.ranking.gauss_rank",
"neptune.init",
"numpy.reshape",
"neptune.log_metric",
"argparse.ArgumentParser",
"neptune.create_experiment",
"numpy.argmax",
"models.DCENet",
"torch.cuda.is_available",
"numpy.random.seed",
"utils.datainfo.DataInfo",
"torch.utils.data.DataLoader",
"json.load",
... | [((7920, 7935), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (7933, 7935), False, 'import torch\n'), ((564, 633), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Knowledge Distillation"""'}), "(description='PyTorch Knowledge Distillation')\n", (587, 633), False, 'import arg... |
from unittest import TestCase
import os.path as osp
import numpy as np
from datumaro.components.annotation import Label, Points
from datumaro.components.dataset import Dataset
from datumaro.components.extractor import DatasetItem
from datumaro.plugins.lfw_format import LfwConverter, LfwImporter
from datumaro.util.ima... | [
"numpy.ones",
"datumaro.util.test_utils.compare_datasets",
"datumaro.util.test_utils.TestDir",
"datumaro.plugins.lfw_format.LfwConverter.convert",
"datumaro.components.annotation.Label",
"datumaro.plugins.lfw_format.LfwImporter.detect",
"os.path.dirname",
"numpy.zeros",
"datumaro.components.annotati... | [((7684, 7705), 'os.path.dirname', 'osp.dirname', (['__file__'], {}), '(__file__)\n', (7695, 7705), True, 'import os.path as osp\n'), ((9112, 9157), 'datumaro.components.dataset.Dataset.import_from', 'Dataset.import_from', (['DUMMY_DATASET_DIR', '"""lfw"""'], {}), "(DUMMY_DATASET_DIR, 'lfw')\n", (9131, 9157), False, 'f... |
import numpy as np
import pandas as pd
from collections import Counter
import re
import string
import itertools
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.linear_model impor... | [
"itertools.chain",
"sklearn.feature_extraction.text.TfidfTransformer",
"pandas.read_csv",
"numpy.array",
"nltk.stem.porter.PorterStemmer",
"numpy.divide",
"imblearn.under_sampling.RandomUnderSampler",
"nltk.corpus.stopwords.words",
"sklearn.feature_extraction.text.CountVectorizer",
"pandas.concat"... | [((849, 867), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (863, 867), True, 'import numpy as np\n'), ((1320, 1362), 'pandas.read_csv', 'pd.read_csv', (['filepath'], {'index_col': 'index_col'}), '(filepath, index_col=index_col)\n', (1331, 1362), True, 'import pandas as pd\n'), ((1553, 1638), 'sklear... |
#!/usr/bin/env python
from TurbAn.Utilities.subs import *
def pgmultiplt(rc,variables,bs,fs,step,pgcmp,smooth,numsmooth):
import numpy as np
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
rcd=rc.__dict__
if smooth == 'y':
from scipy.ndimage import gaussian_filter as gf
... | [
"scipy.ndimage.gaussian_filter",
"pyqtgraph.setConfigOptions",
"pyqtgraph.Qt.QtGui.QApplication",
"pyqtgraph.QtGui.QApplication.processEvents",
"pyqtgraph.GraphicsWindow",
"numpy.mod"
] | [((350, 372), 'pyqtgraph.Qt.QtGui.QApplication', 'QtGui.QApplication', (['[]'], {}), '([])\n', (368, 372), False, 'from pyqtgraph.Qt import QtGui, QtCore\n'), ((381, 422), 'pyqtgraph.GraphicsWindow', 'pg.GraphicsWindow', ([], {'title': '"""Multiplot-Test"""'}), "(title='Multiplot-Test')\n", (398, 422), True, 'import py... |
#!/usr/bin/env python3
import os
import logging
#logging.basicConfig(level=logging.DEBUG)
from time import sleep
from keithley2600 import Keithley2600
import numpy as np
import saleae
np.set_printoptions(precision=2)
instrument_serial = 'USB0::fc00:db20:35b:7399::5::4309410\x00::0::INSTR'
dirname = os.path.abspath("t... | [
"os.path.exists",
"os.makedirs",
"numpy.set_printoptions",
"saleae.Saleae",
"os.path.abspath",
"numpy.save",
"numpy.arange",
"keithley2600.Keithley2600"
] | [((185, 217), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)'}), '(precision=2)\n', (204, 217), True, 'import numpy as np\n'), ((302, 328), 'os.path.abspath', 'os.path.abspath', (['"""traces/"""'], {}), "('traces/')\n", (317, 328), False, 'import os\n'), ((526, 552), 'numpy.arange', 'np.arange... |
from numpy import full, nan
from pandas import DataFrame, concat
from .call_function_with_multiprocess import call_function_with_multiprocess
from .compute_1d_array_context import compute_1d_array_context
from .split_dataframe import split_dataframe
def _make_context_matrix(
dataframe,
skew_t_pdf_fit_paramet... | [
"pandas.DataFrame",
"numpy.full"
] | [((535, 561), 'numpy.full', 'full', (['dataframe.shape', 'nan'], {}), '(dataframe.shape, nan)\n', (539, 561), False, 'from numpy import full, nan\n'), ((1788, 1863), 'pandas.DataFrame', 'DataFrame', (['context_matrix'], {'index': 'dataframe.index', 'columns': 'dataframe.columns'}), '(context_matrix, index=dataframe.ind... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"paddle.fluid.layers.square",
"paddle.fluid.layers.create_global_var",
"paddle.fluid.layers.gather",
"paddle.fluid.layers.reduce_sum",
"numpy.array",
"paddle.fluid.layers.elementwise_add",
"paddle.fluid.layers.assign",
"paddle.fluid.layers.matmul",
"numpy.arange",
"paddle.fluid.layers.reshape"
] | [((865, 902), 'numpy.arange', 'np.arange', (['(0)', '(batch_size * batch_size)'], {}), '(0, batch_size * batch_size)\n', (874, 902), True, 'import numpy as np\n'), ((1675, 1728), 'paddle.fluid.layers.reshape', 'fluid.layers.reshape', (['feature'], {'shape': '[batch_size, -1]'}), '(feature, shape=[batch_size, -1])\n', (... |
"""
Routines for solving the KS equations via Numerov's method
"""
# standard libs
import os
import shutil
# external libs
import numpy as np
from scipy.sparse.linalg import eigsh, eigs
from scipy.linalg import eigh, eig
from joblib import Parallel, delayed, dump, load
# from staticKS import Orbitals
# internal lib... | [
"numpy.argsort",
"numpy.array",
"numpy.exp",
"os.mkdir",
"joblib.load",
"joblib.dump",
"numpy.eye",
"numpy.size",
"numpy.fill_diagonal",
"numpy.shape",
"numpy.transpose",
"scipy.sparse.linalg.eigs",
"mathtools.normalize_orbs",
"os.path.join",
"joblib.Parallel",
"numpy.zeros",
"shutil... | [((1744, 1759), 'numpy.eye', 'np.eye', (['N'], {'k': '(-1)'}), '(N, k=-1)\n', (1750, 1759), True, 'import numpy as np\n'), ((1773, 1782), 'numpy.eye', 'np.eye', (['N'], {}), '(N)\n', (1779, 1782), True, 'import numpy as np\n'), ((1796, 1810), 'numpy.eye', 'np.eye', (['N'], {'k': '(1)'}), '(N, k=1)\n', (1802, 1810), Tru... |
#!/usr/bin/env python
from __future__ import division
from past.utils import old_div
import unittest
import os.path
import sys
from anuga.utilities.system_tools import get_pathname_from_package
from anuga.culvert_flows.culvert_routines import boyd_generalised_culvert_model
import numpy as num
class Test_culvert_ro... | [
"numpy.allclose",
"anuga.culvert_flows.culvert_routines.boyd_generalised_culvert_model",
"unittest.makeSuite",
"past.utils.old_div",
"unittest.TextTestRunner"
] | [((13929, 13988), 'unittest.makeSuite', 'unittest.makeSuite', (['Test_culvert_routines_box_10pct', '"""test"""'], {}), "(Test_culvert_routines_box_10pct, 'test')\n", (13947, 13988), False, 'import unittest\n'), ((14002, 14027), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '()\n', (14025, 14027), Fals... |
from numpy import linalg
import numpy as np
from loguru import logger
class Regression:
def __init__(self, intercept=True):
self.beta = None
self.intercept = intercept
def fit(self, features, labels):
features = self._add_bias(features)
self._fit(features, labels)
def pre... | [
"numpy.identity",
"numpy.abs",
"numpy.linalg.solve",
"numpy.ones",
"numpy.hstack",
"numpy.linalg.inv",
"numpy.random.randn"
] | [((990, 1010), 'numpy.linalg.solve', 'linalg.solve', (['xx', 'xy'], {}), '(xx, xy)\n', (1002, 1010), False, 'from numpy import linalg\n'), ((555, 582), 'numpy.hstack', 'np.hstack', (['[ones, features]'], {}), '([ones, features])\n', (564, 582), True, 'import numpy as np\n'), ((1233, 1263), 'numpy.identity', 'np.identit... |
"""
This module provides functions to get the dimensionality of a structure.
A number of different algorithms are implemented. These are based on the
following publications:
get_dimensionality_larsen:
- <NAME>, <NAME>, <NAME>, <NAME>. Definition of a
scoring parameter to identify low-dimensional materials compo... | [
"numpy.linalg.matrix_rank",
"pymatgen.core.structure.Molecule",
"numpy.argsort",
"numpy.array",
"networkx.weakly_connected_components",
"numpy.linalg.norm",
"copy.copy",
"numpy.repeat",
"numpy.where",
"pymatgen.core.periodic_table.Specie.from_string",
"itertools.product",
"numpy.dot",
"pymat... | [((8654, 8670), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (8665, 8670), False, 'from collections import defaultdict\n'), ((11037, 11077), 'numpy.argsort', 'np.argsort', (['[x[0] for x in seen_indices]'], {}), '([x[0] for x in seen_indices])\n', (11047, 11077), True, 'import numpy as np\n'), ((... |
import numpy as np
from deepscratch.dataloader.dataloader import DataLoader
class XOR(DataLoader):
def __init__(self):
self.x = np.array([[0, 0], [0, 1], [1, 0], [1, 1]])
self.y = np.array([[0], [1], [1], [0]]) | [
"numpy.array"
] | [((143, 185), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 0], [1, 1]]'], {}), '([[0, 0], [0, 1], [1, 0], [1, 1]])\n', (151, 185), True, 'import numpy as np\n'), ((203, 233), 'numpy.array', 'np.array', (['[[0], [1], [1], [0]]'], {}), '([[0], [1], [1], [0]])\n', (211, 233), True, 'import numpy as np\n')] |
import numpy as np
import pandas as pd
import os
reps = [ 1 , 2 , 3 , 4 , 5 ]
#reps = [ 1 ]
pwd = os.getcwd()
pkas = {}
for rep in reps:
allfiles = os.listdir(pwd+'/'+str(rep))
path = pwd + '/' + str(rep) + '/'
for filename in allfiles:
if( filename.split('.')[-1] == 'xvg' ):
fullpath = path + filename... | [
"numpy.array",
"pandas.read_csv",
"os.getcwd"
] | [((101, 112), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (110, 112), False, 'import os\n'), ((978, 1001), 'numpy.array', 'np.array', (['pkas[residue]'], {}), '(pkas[residue])\n', (986, 1001), True, 'import numpy as np\n'), ((650, 694), 'pandas.read_csv', 'pd.read_csv', (['fullpath'], {'sep': '"""\t"""', 'header': 'Non... |
from __future__ import absolute_import
from sklearn import neural_network
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random
import argparse
from sklearn.metrics import accuracy_score
class MLPModel():
def __init__(self, filename, stock_filename, company, activation='logistic',
... | [
"sklearn.neural_network.MLPRegressor",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.asarray",
"pandas.to_datetime"
] | [((1466, 1491), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1489, 1491), False, 'import argparse\n'), ((386, 407), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (397, 407), True, 'import pandas as pd\n'), ((424, 451), 'pandas.read_csv', 'pd.read_csv', (['stock_filena... |
import sampling_methods
import numpy as np
__all__ = ['Supervised', 'ActiveLearning']
class _Trainer():
def __init__(self, name, epoch, batch_size):
self.name = name
self.epoch = epoch
self.batch_size = batch_size
assert (type(epoch) is int and epoch > 0)
... | [
"numpy.concatenate"
] | [((3482, 3534), 'numpy.concatenate', 'np.concatenate', (['(learned_data, not_learned_data[:n])'], {}), '((learned_data, not_learned_data[:n]))\n', (3496, 3534), True, 'import numpy as np\n'), ((3570, 3626), 'numpy.concatenate', 'np.concatenate', (['(learned_labels, not_learned_labels[:n])'], {}), '((learned_labels, not... |
import numpy as np
from krippendorff import alpha
# Example from: <NAME>. "Content Analysis: An Introduction to Its Methodology".
# Fourth Edition. 2019. SAGE Publishing.
# Chapter 12, page 290.
# 4 observers (rows). 11 units (columns)
# np.nan is missing data (observer did not code unit)
reliability_data = np.array([... | [
"numpy.array",
"numpy.isclose",
"krippendorff.alpha"
] | [((310, 573), 'numpy.array', 'np.array', (['[[1.0, 2.0, 3.0, 3.0, 2.0, 1.0, 4.0, 1.0, 2.0, np.nan, np.nan], [1.0, 2.0, \n 3.0, 3.0, 2.0, 2.0, 4.0, 1.0, 2.0, 5.0, np.nan], [np.nan, 3.0, 3.0, 3.0,\n 2.0, 3.0, 4.0, 2.0, 2.0, 5.0, 1.0], [1.0, 2.0, 3.0, 3.0, 2.0, 4.0, 4.0,\n 1.0, 2.0, 5.0, 1.0]]'], {}), '([[1.0, 2.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# <NAME> <<EMAIL>> 40819903
#
# Plotting script.
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy
import os
def main(args):
myStuff = []
for i in range(0, 20):
myStuff.append( [i, i*2, i*3] )
filename = "testfile.txt"
prin... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"numpy.array",
"matplotlib.pyplot.figure",
"os.system"
] | [((637, 654), 'os.system', 'os.system', (['"""sync"""'], {}), "('sync')\n", (646, 654), False, 'import os\n'), ((656, 690), 'os.system', 'os.system', (['"""optipng ../pics/*.png"""'], {}), "('optipng ../pics/*.png')\n", (665, 690), False, 'import os\n'), ((808, 843), 'numpy.array', 'numpy.array', (['M'], {'dtype': 'num... |
"""Module providing high-level tools for linearizing and finding chi^2 minimizing
solutions to systems of equations.
Solvers: LinearSolver, LogProductSolver, and LinProductSolver.
These generally follow the form:
> data = {'a1*x+b1*y': np.array([5.,7]), 'a2*x+b2*y': np.array([4.,6])}
> ls = LinearSolver(data, a1=1., ... | [
"tensorflow.math.imag",
"tensorflow.transpose",
"numpy.log",
"tensorflow.linalg.pinv",
"numpy.array",
"copy.deepcopy",
"numpy.linalg.norm",
"tensorflow.math.real",
"numpy.complex64",
"numpy.exp",
"numpy.issubdtype",
"numpy.empty",
"tensorflow.matmul",
"tensorflow.convert_to_tensor",
"ast... | [((11258, 11289), 'functools.reduce', 'reduce', (['np.promote_types', 'types'], {}), '(np.promote_types, types)\n', (11264, 11289), False, 'from functools import reduce\n'), ((28760, 28793), 'functools.reduce', 'reduce', (['(lambda x, y: x + y)', 'terms'], {}), '(lambda x, y: x + y, terms)\n', (28766, 28793), False, 'f... |
# -*- coding: utf-8 -*-
import cv2
import numpy as np
from scipy.sparse.linalg import spsolve
def fix_source(source, mask, shape, offset):
mydict = {}
counter = 0
for i in range(mask.shape[0]):
for j in range(mask.shape[1]):
if mask[i][j]>127:
mydict[(i+offset[0], j+off... | [
"numpy.uint8",
"scipy.sparse.linalg.spsolve",
"numpy.zeros"
] | [((387, 413), 'numpy.zeros', 'np.zeros', (['shape'], {'dtype': 'int'}), '(shape, dtype=int)\n', (395, 413), True, 'import numpy as np\n'), ((2100, 2113), 'scipy.sparse.linalg.spsolve', 'spsolve', (['A', 'b'], {}), '(A, b)\n', (2107, 2113), False, 'from scipy.sparse.linalg import spsolve\n'), ((2202, 2215), 'numpy.uint8... |
import sys
import time
import imageio
import tensorflow as tf
import numpy as np
image_path = sys.argv[1]
image = imageio.imread(image_path)
input_data = np.array([image])
print(input_data.shape)
saver = tf.train.import_meta_graph('./model.meta', clear_devices=True)
gpu_options = tf.GPUOptions(per_process_gpu_memo... | [
"numpy.array",
"tensorflow.train.import_meta_graph",
"imageio.imread",
"tensorflow.ConfigProto",
"tensorflow.GPUOptions",
"tensorflow.get_collection"
] | [((116, 142), 'imageio.imread', 'imageio.imread', (['image_path'], {}), '(image_path)\n', (130, 142), False, 'import imageio\n'), ((156, 173), 'numpy.array', 'np.array', (['[image]'], {}), '([image])\n', (164, 173), True, 'import numpy as np\n'), ((208, 270), 'tensorflow.train.import_meta_graph', 'tf.train.import_meta_... |
'''
## Replay Memory ##
# Adapted from: https://github.com/tambetm/simple_dqn/blob/master/src/replay_memory.py
# Creates replay memory buffer to add experiences to and sample batches of experiences from
'''
import numpy as np
import random
class ReplayMemory:
def __init__(self, args):
self.buffer_size = a... | [
"argparse.ArgumentParser",
"numpy.random.choice",
"numpy.random.randint",
"numpy.empty",
"random.randint"
] | [((4041, 4066), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4064, 4066), False, 'import argparse\n'), ((452, 494), 'numpy.empty', 'np.empty', (['self.buffer_size'], {'dtype': 'np.uint8'}), '(self.buffer_size, dtype=np.uint8)\n', (460, 494), True, 'import numpy as np\n'), ((520, 564), 'numpy... |
import numpy as np
# Local Modules
from object import *
import utils
rng = np.random.default_rng()
def reflect_ray(n, eye, ph, roughness, diffuse=False):
if diffuse:
phi = rng.random() * 2 * np.pi
z = rng.random()
theta = np.arccos(z)
x = np.sin(theta) * np.cos(phi)
y = n... | [
"numpy.arccos",
"numpy.random.default_rng",
"utils.normalize",
"numpy.sqrt",
"numpy.random.random_sample",
"numpy.array",
"numpy.dot",
"numpy.cos",
"numpy.sin"
] | [((77, 100), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}), '()\n', (98, 100), True, 'import numpy as np\n'), ((254, 266), 'numpy.arccos', 'np.arccos', (['z'], {}), '(z)\n', (263, 266), True, 'import numpy as np\n'), ((359, 372), 'numpy.cos', 'np.cos', (['theta'], {}), '(theta)\n', (365, 372), True, 'im... |
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"numpy.abs",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"numpy.power",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.argmax",
"sklearn.metrics.mean_squared_error",
"sklearn.metrics.roc_auc_score",
"numpy.sum",
"numpy.zeros",
"matplotlib.pyplot.figure",
"sklearn.metr... | [((5113, 5133), 'numpy.zeros', 'np.zeros', (['[division]'], {}), '([division])\n', (5121, 5133), True, 'import numpy as np\n'), ((5747, 5773), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 4)'}), '(figsize=(6, 4))\n', (5757, 5773), True, 'import matplotlib.pyplot as plt\n'), ((5776, 5801), 'matplotlib... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding 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-... | [
"numpy.prod",
"numpy.random.rand",
"numpy.testing.assert_equal",
"mars.tensor.indexing.compress",
"numpy.array",
"mars.tensor.indexing.nonzero",
"mars.tensor.indexing.unravel_index",
"numpy.arange",
"numpy.mod",
"mars.tensor.indexing.take",
"numpy.random.random",
"numpy.sort",
"numpy.take",
... | [((1053, 1070), 'mars.executor.Executor', 'Executor', (['"""numpy"""'], {}), "('numpy')\n", (1061, 1070), False, 'from mars.executor import Executor\n'), ((1293, 1326), 'numpy.random.random', 'np.random.random', (['(11, 8, 12, 14)'], {}), '((11, 8, 12, 14))\n', (1309, 1326), True, 'import numpy as np\n'), ((1341, 1366)... |
"""Shortest-Path graph kernel.
Python implementation based on: "Shortest-path kernels on graphs", by
<NAME>.; <NAME>., in Data Mining, Fifth IEEE
International Conference on , vol., no., pp.8 pp.-, 27-30 Nov. 2005
doi: 10.1109/ICDM.2005.132
Author : <NAME>, <NAME>
"""
import numpy as np
import networkx as nx
class... | [
"numpy.sqrt",
"numpy.where",
"networkx.floyd_warshall_numpy",
"numpy.sum",
"numpy.zeros",
"numpy.triu"
] | [((889, 922), 'numpy.where', 'np.where', (['(fwm1 == np.inf)', '(0)', 'fwm1'], {}), '(fwm1 == np.inf, 0, fwm1)\n', (897, 922), True, 'import numpy as np\n'), ((938, 971), 'numpy.where', 'np.where', (['(fwm1 == np.nan)', '(0)', 'fwm1'], {}), '(fwm1 == np.nan, 0, fwm1)\n', (946, 971), True, 'import numpy as np\n'), ((987... |
# -*- coding: utf-8 -*-
"""
CalcCohx
function: calculate the longitudinal coherence
------------------------------------------------------------------------------------
Usage
Cohx,ConfigParameters = CalcCohx(ConfigParameters)
-----------------------------------------------------------------------------------
In... | [
"numpy.sqrt",
"numpy.reshape",
"scipy.spatial.distance.cdist",
"math.sqrt",
"numpy.exp",
"numpy.concatenate"
] | [((2602, 2687), 'numpy.reshape', 'np.reshape', (["ConfigParameters['Xpos']", "(ConfigParameters['Nplanes'], 1)"], {'order': '"""F"""'}), "(ConfigParameters['Xpos'], (ConfigParameters['Nplanes'], 1),\n order='F')\n", (2612, 2687), True, 'import numpy as np\n'), ((2690, 2724), 'numpy.concatenate', 'np.concatenate', ([... |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
# License: BSD 3 clause
"""
Functions to simulate background noise.
"""
import numpy as np
import bigfish.stack as stack
# TODO add illumination bias
def add_white_noise(image, noise_level, random_noise=0.05):
"""Generate and add white noise to an image.
... | [
"numpy.random.normal",
"bigfish.stack.check_array",
"numpy.reshape",
"numpy.iinfo",
"bigfish.stack.check_parameter"
] | [((855, 921), 'bigfish.stack.check_array', 'stack.check_array', (['image'], {'ndim': '[2, 3]', 'dtype': '[np.uint8, np.uint16]'}), '(image, ndim=[2, 3], dtype=[np.uint8, np.uint16])\n', (872, 921), True, 'import bigfish.stack as stack\n'), ((970, 1044), 'bigfish.stack.check_parameter', 'stack.check_parameter', ([], {'n... |
import numpy as np
def get_fft_harmonics(samples_per_window, sample_rate, one_sided=True):
"""
Works for odd and even number of points.
Does not return Nyquist, does return DC component
Could be midified with kwargs to support one_sided, two_sided, ignore_dc
ignore_nyquist, and etc. Could actally... | [
"numpy.fft.fftfreq"
] | [((585, 640), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['samples_per_window'], {'d': '(1.0 / sample_rate)'}), '(samples_per_window, d=1.0 / sample_rate)\n', (599, 640), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 11 20:01:02 2020
@author: Isaac
"""
import timeit
import numba
import numpy as np
from numba import njit
import time
@njit
def question_1(x):
"""
Solution to question 1 goes here
"""
A = np.array([[1.0, 3.0, 4.0], [4.0, 5.0, 6.0],... | [
"numpy.array",
"numpy.linalg.matrix_power"
] | [((277, 338), 'numpy.array', 'np.array', (['[[1.0, 3.0, 4.0], [4.0, 5.0, 6.0], [1.0, 2.0, 3.0]]'], {}), '([[1.0, 3.0, 4.0], [4.0, 5.0, 6.0], [1.0, 2.0, 3.0]])\n', (285, 338), True, 'import numpy as np\n'), ((351, 379), 'numpy.linalg.matrix_power', 'np.linalg.matrix_power', (['A', 'x'], {}), '(A, x)\n', (373, 379), True... |
import argparse
import os
import pdb
import shutil
from timeit import default_timer as timer
import numpy as np
import pandas as pd
from tqdm import tqdm
from evaluation import write_submission
def iters_ensemble(args):
'''
Ensemble on different iterations and generate ensembled files in fusioned folder
... | [
"os.listdir",
"argparse.ArgumentParser",
"os.makedirs",
"pandas.read_csv",
"timeit.default_timer",
"os.path.join",
"numpy.zeros",
"pandas.DataFrame",
"evaluation.write_submission"
] | [((1360, 1367), 'timeit.default_timer', 'timer', ([], {}), '()\n', (1365, 1367), True, 'from timeit import default_timer as timer\n'), ((4391, 4436), 'os.makedirs', 'os.makedirs', (['test_fusioned_dir'], {'exist_ok': '(True)'}), '(test_fusioned_dir, exist_ok=True)\n', (4402, 4436), False, 'import os\n'), ((7067, 7074),... |
"""
Artificial Intelligence for Humans
Volume 1: Fundamental Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you... | [
"numpy.zeros",
"rbf.RbfGaussian",
"numpy.random.uniform"
] | [((2117, 2193), 'numpy.zeros', 'np.zeros', (['(input_weight_count + output_weight_count + rbf_params)'], {'dtype': 'float'}), '(input_weight_count + output_weight_count + rbf_params, dtype=float)\n', (2125, 2193), True, 'import numpy as np\n'), ((2500, 2558), 'rbf.RbfGaussian', 'RbfGaussian', (['input_count', 'self.lon... |
# 用于推断
from config import MaskRcnnConfig
import modelibe
import tensorflow as tf
import skimage.io as io
import scipy.misc
import os
import numpy as np
import keras.backend.tensorflow_backend as KTF
from tqdm import tqdm
import cv2
import colorsys
from skimage.measure import find_contours
import argparse
class OurCo... | [
"cv2.rectangle",
"tensorflow.Graph",
"cv2.imwrite",
"argparse.ArgumentParser",
"numpy.where",
"cv2.polylines",
"numpy.fliplr",
"colorsys.hsv_to_rgb",
"cv2.imshow",
"modelibe.MaskRcnn",
"cv2.putText",
"numpy.zeros",
"numpy.any",
"cv2.destroyAllWindows",
"cv2.cvtColor",
"skimage.measure.... | [((4275, 4334), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Mask R-CNN influence"""'}), "(description='Mask R-CNN influence')\n", (4298, 4334), False, 'import argparse\n'), ((975, 1069), 'numpy.where', 'np.where', (['(mask == 1)', '(image[:, :, c] * (1 - alpha) + alpha * color[c] * 25... |
from __future__ import annotations
import logging
from pathlib import Path
from typing import Generator, List, Set, Union
import numpy as np
from apscheduler.executors.pool import ThreadPoolExecutor
from apscheduler.jobstores.memory import MemoryJobStore
from apscheduler.schedulers.background import BackgroundSchedul... | [
"logging.getLogger",
"card_live_dashboard.model.data_modifiers.AddGeographicNamesModifier.AddGeographicNamesModifier",
"apscheduler.executors.pool.ThreadPoolExecutor",
"apscheduler.jobstores.memory.MemoryJobStore",
"numpy.datetime64",
"card_live_dashboard.service.CardLiveDataLoader.CardLiveDataLoader",
... | [((824, 851), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (841, 851), False, 'import logging\n'), ((1102, 1140), 'card_live_dashboard.service.CardLiveDataLoader.CardLiveDataLoader', 'CardLiveDataLoader', (['card_live_data_dir'], {}), '(card_live_data_dir)\n', (1120, 1140), False, 'from... |
from copy import deepcopy
import random
from typing import Optional
import numpy as np
import torch
import torch.nn.functional as F
from tqdm import trange
from dataset_helpers import get_dataloaders
from experiment_config import (
Config,
DatasetSubsetType,
HParams,
State,
EvaluationMetrics,
... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"numpy.random.get_state",
"measures.get_all_measures",
"models.NiN",
"random.seed",
"dataset_helpers.get_dataloaders",
"torch.get_rng_state",
"numpy.random.seed",
"logs.Printer",
"copy.deepcopy",
"torch.nn.functional.cross_entropy",
"torch.n... | [((8040, 8055), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (8053, 8055), False, 'import torch\n'), ((9074, 9089), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (9087, 9089), False, 'import torch\n'), ((10064, 10079), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (10077, 10079), False, 'import torch... |
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.animation as animation
import numpy as np
import utils
def plot_glimpse(config, images, locations, preds, labels, step, animate):
"""
For each image in images, draws bounding boxes
corresponding to glimpse locations.
... | [
"matplotlib.patches.Rectangle",
"numpy.argmax",
"numpy.squeeze",
"matplotlib.pyplot.close",
"matplotlib.animation.ArtistAnimation",
"matplotlib.pyplot.figure",
"matplotlib.animation.ImageMagickWriter",
"utils.truncate",
"matplotlib.pyplot.subplots"
] | [((832, 881), 'matplotlib.animation.ImageMagickWriter', 'animation.ImageMagickWriter', ([], {'fps': '(15)', 'bitrate': '(1800)'}), '(fps=15, bitrate=1800)\n', (859, 881), True, 'import matplotlib.animation as animation\n'), ((3713, 3817), 'matplotlib.patches.Rectangle', 'patches.Rectangle', (['xy', 'width', 'height'], ... |
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by <NAME> <<EMAIL>>
#
# This file is part of CBI Toolbox.
#
# CBI Toolbox is free software: you can redistribute it and/or modify
# it under the terms of the 3-Clause BSD License.
#
# CBI Toolbox is distributed in the hope that it will be use... | [
"cbi_toolbox.reconstruct.psnr",
"json.dump",
"os.path.join",
"numpy.arange"
] | [((795, 816), 'numpy.arange', 'np.arange', (['(10)', '(101)', '(5)'], {}), '(10, 101, 5)\n', (804, 816), True, 'import numpy as np\n'), ((870, 897), 'os.path.join', 'os.path.join', (['path', '"""noise"""'], {}), "(path, 'noise')\n", (882, 897), False, 'import os\n'), ((906, 933), 'os.path.join', 'os.path.join', (['path... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A Python implementation of the method described in [#a]_ and [#b]_ for
calculating Fourier coefficients for characterizing
closed contours.
References
----------
.. [#a] <NAME> and <NAME>, “Elliptic Fourier Features of a
Closed Contour," Computer Vision, Graphics ... | [
"numpy.insert",
"numpy.abs",
"numpy.ceil",
"numpy.ones",
"numpy.delete",
"numpy.diff",
"numpy.append",
"numpy.stack",
"numpy.linspace",
"numpy.sum",
"numpy.arctan2",
"numpy.cos",
"numpy.array",
"numpy.sin",
"numpy.cumsum",
"matplotlib.pyplot.subplot2grid",
"numpy.arange",
"matplotl... | [((1317, 1341), 'numpy.diff', 'np.diff', (['contour'], {'axis': '(0)'}), '(contour, axis=0)\n', (1324, 1341), True, 'import numpy as np\n'), ((1490, 1513), 'numpy.arange', 'np.arange', (['(1)', '(order + 1)'], {}), '(1, order + 1)\n', (1499, 1513), True, 'import numpy as np\n'), ((3806, 3844), 'numpy.arctan2', 'np.arct... |
import sys
_str = sys.argv[1]
import coopihc
from coopihc.space import StateElement, Space, State
import numpy
x = StateElement(
values=1,
spaces=Space([numpy.array([-1.0]).reshape(1, 1), numpy.array([1.0]).reshape(1, 1)]),
)
y = StateElement(values=2, spaces=Space(numpy.array([1, 2, 3], dtype=numpy.int)))... | [
"collections.OrderedDict",
"numpy.ones",
"coopihc.space.State",
"numpy.array",
"numpy.zeros",
"copy.deepcopy",
"copy.copy",
"time.time"
] | [((430, 477), 'coopihc.space.State', 'State', ([], {'substate_x': 'x', 'substate_y': 'y', 'substate_z': 'z'}), '(substate_x=x, substate_y=y, substate_z=z)\n', (435, 477), False, 'from coopihc.space import StateElement, Space, State\n'), ((882, 929), 'coopihc.space.State', 'State', ([], {}), "(**{'substate_xx': xx, 'sub... |
import numpy as np
from linear_models.logistic_regression import LogisticRegression
class Perceptron(LogisticRegression):
"""A simple (binary classification) perceptron. Uses binary cross-entropy loss for updating weights.
>>NOTE: it inherits most of the code from logistic regression for simplicity.<<
Pa... | [
"numpy.dot"
] | [((1468, 1488), 'numpy.dot', 'np.dot', (['x', 'self.coef'], {}), '(x, self.coef)\n', (1474, 1488), True, 'import numpy as np\n')] |
if '__file__' in globals():
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import dezero as dz
import numpy as np
_NUM_ITER = 10
def f(x: dz.Variable) -> dz.Variable:
y = x ** 4 - 2 * x ** 2
return y
def gx2(x: np.ndarray) -> np.ndarray:
return 12 * x *... | [
"os.path.dirname",
"numpy.array"
] | [((377, 390), 'numpy.array', 'np.array', (['(2.0)'], {}), '(2.0)\n', (385, 390), True, 'import numpy as np\n'), ((90, 115), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (105, 115), False, 'import os\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # S_Di... | [
"matplotlib.pyplot.grid",
"numpy.sqrt",
"numpy.log",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.imshow",
"numpy.atleast_2d",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.yticks",
"ConditionalFP.ConditionalFP",
"matplotlib.pyplot.ylim",
"numpy.abs",
"collections.namedtuple",
"nu... | [((1037, 1061), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (1050, 1061), True, 'import matplotlib.pyplot as plt\n'), ((1414, 1440), 'ARPM_utils.struct_to_dict', 'struct_to_dict', (["db['Data']"], {}), "(db['Data'])\n", (1428, 1440), False, 'from ARPM_utils import struct_to... |
import numpy as np
from .utils import memo, validate_tuple
__all__ = ['binary_mask', 'r_squared_mask', 'cosmask', 'sinmask',
'theta_mask']
@memo
def binary_mask(radius, ndim):
"Elliptical mask in a rectangular array"
radius = validate_tuple(radius, ndim)
points = [np.arange(-rad, rad + 1) for ... | [
"numpy.atleast_2d",
"numpy.fromfunction",
"numpy.round",
"numpy.asarray",
"numpy.any",
"numpy.indices",
"numpy.exp",
"numpy.array",
"numpy.sum",
"numpy.arctan2",
"numpy.meshgrid",
"numpy.all",
"numpy.arange"
] | [((1551, 1585), 'numpy.asarray', 'np.asarray', (['(coords ** 2)'], {'dtype': 'int'}), '(coords ** 2, dtype=int)\n', (1561, 1585), True, 'import numpy as np\n'), ((2371, 2431), 'numpy.fromfunction', 'np.fromfunction', (['tan_of_coord', '[(r * 2 + 1) for r in radius]'], {}), '(tan_of_coord, [(r * 2 + 1) for r in radius])... |
# Uses the encoder to search for input images matching the encoded features
from tensorflow.keras.models import load_model
from tensorflow.keras.models import Model
from tensorflow.keras.preprocessing.image import load_img
from tensorflow.keras.preprocessing.image import img_to_array
from imutils import build_montages... | [
"tensorflow.keras.preprocessing.image.load_img",
"argparse.ArgumentParser",
"sklearn.model_selection.train_test_split",
"numpy.random.choice",
"numpy.asarray",
"tensorflow.keras.models.load_model",
"imutils.paths.list_images",
"numpy.linalg.norm",
"imutils.build_montages",
"tensorflow.keras.prepro... | [((549, 570), 'numpy.linalg.norm', 'np.linalg.norm', (['(a - b)'], {}), '(a - b)\n', (563, 570), True, 'import numpy as np\n'), ((874, 899), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (897, 899), False, 'import argparse\n'), ((1511, 1527), 'numpy.asarray', 'np.asarray', (['data'], {}), '(da... |
# coding=UTF-8
"""
--------------------------------------------------------
Copyright (c) ****-2018 ESR, Inc. All rights reserved.
--------------------------------------------------------
Author: <NAME>
Date: 2018/10/29
Design Name: The user interface of the DDS software
Purpose: Design an interface softwar... | [
"ctypes.c_byte",
"ctypes.c_long",
"os.path.exists",
"random.choice",
"ctypes.cdll.LoadLibrary",
"ctypes.c_ubyte",
"time.sleep",
"numpy.array",
"platform.architecture",
"ctypes.pointer",
"ctypes.c_char_p",
"traceback.print_exc"
] | [((26491, 26508), 'ctypes.c_ubyte', 'ctypes.c_ubyte', (['(0)'], {}), '(0)\n', (26505, 26508), False, 'import ctypes\n'), ((27284, 27300), 'time.sleep', 'time.sleep', (['(0.01)'], {}), '(0.01)\n', (27294, 27300), False, 'import time\n'), ((27343, 27359), 'time.sleep', 'time.sleep', (['(0.01)'], {}), '(0.01)\n', (27353, ... |
# uniform content loss + adaptive threshold + per_class_input + recursive G
# improvement upon cqf37
from __future__ import division
import os, scipy.io, scipy.misc, cv2
import torch
import numpy as np
import glob
import utils
from unet import UNet
from torch.utils.data import DataLoader
from dataset.SID import SIDFuj... | [
"os.makedirs",
"unet.UNet",
"dataset.SID.SIDFujiTestDataset",
"torch.load",
"os.path.isdir",
"torch.cuda.is_available",
"os.path.basename",
"torch.utils.data.DataLoader",
"numpy.maximum",
"torch.no_grad",
"cv2.resize",
"glob.glob"
] | [((633, 665), 'glob.glob', 'glob.glob', (["(test_gt_dir + '*.png')"], {}), "(test_gt_dir + '*.png')\n", (642, 665), False, 'import glob\n'), ((819, 825), 'unet.UNet', 'UNet', ([], {}), '()\n', (823, 825), False, 'from unet import UNet\n'), ((897, 968), 'dataset.SID.SIDFujiTestDataset', 'SIDFujiTestDataset', ([], {'list... |
from torch.nn.functional import fractional_max_pool2d
from similar_words import similar
from visualize import display_pca_scatterplot
from PIL import Image
from gensim.models import KeyedVectors
import numpy as np
import moviepy.editor as mpe
import os
import cv2
import glob
def add_audio(path, theme, m... | [
"moviepy.editor.AudioFileClip",
"moviepy.editor.CompositeAudioClip",
"os.listdir",
"PIL.Image.open",
"similar_words.similar",
"os.path.join",
"cv2.VideoWriter",
"os.chdir",
"cv2.destroyAllWindows",
"cv2.VideoWriter_fourcc",
"numpy.concatenate",
"moviepy.editor.VideoFileClip"
] | [((629, 658), 'moviepy.editor.VideoFileClip', 'mpe.VideoFileClip', (['video_name'], {}), '(video_name)\n', (646, 658), True, 'import moviepy.editor as mpe\n'), ((683, 712), 'moviepy.editor.AudioFileClip', 'mpe.AudioFileClip', (['audio_name'], {}), '(audio_name)\n', (700, 712), True, 'import moviepy.editor as mpe\n'), (... |
import os
import numpy as np
import pandas as pd
import geopandas as gpd
from shapely.geometry import Point
from S2TruckDetect.src.S2TD.array_utils.points import rasterize
from OSMPythonTools.overpass import Overpass
from OSMPythonTools.overpass import overpassQueryBuilder
def buffer_bbox(bbox_osm):
"""
Buffe... | [
"os.path.exists",
"numpy.int8",
"S2TruckDetect.src.S2TD.array_utils.points.rasterize",
"geopandas.read_file",
"os.path.join",
"shapely.geometry.Point",
"OSMPythonTools.overpass.overpassQueryBuilder",
"numpy.isfinite",
"pandas.concat",
"OSMPythonTools.overpass.Overpass",
"geopandas.GeoDataFrame",... | [((3513, 3554), 'os.path.join', 'os.path.join', (['dir_out', "(filename + '.gpkg')"], {}), "(dir_out, filename + '.gpkg')\n", (3525, 3554), False, 'import os\n'), ((3570, 3603), 'os.path.join', 'os.path.join', (['dir_out', '"""tmp.gpkg"""'], {}), "(dir_out, 'tmp.gpkg')\n", (3582, 3603), False, 'import os\n'), ((3647, 3... |
from ScopeFoundry import Measurement
from ScopeFoundry.scanning.base_raster_scan import BaseRaster2DScan
import time
import numpy as np
class BaseNonRaster2DScan(BaseRaster2DScan):
name = "base_non_raster_2Dscan"
def gen_raster_scan(self, gen_arrays=True):
self.Npixels = self.Nh.val*self.Nv.val
... | [
"numpy.cos",
"numpy.sin",
"numpy.meshgrid",
"time.time",
"numpy.arange"
] | [((1151, 1162), 'time.time', 'time.time', ([], {}), '()\n', (1160, 1162), False, 'import time\n'), ((1196, 1235), 'numpy.meshgrid', 'np.meshgrid', (['self.h_array', 'self.v_array'], {}), '(self.h_array, self.v_array)\n', (1207, 1235), True, 'import numpy as np\n'), ((2636, 2647), 'time.time', 'time.time', ([], {}), '()... |
import copy
import pytest
import math
import numpy as np
import pandas as pd
from hyperactive import Hyperactive
search_space = {
"x1": list(np.arange(-100, 100, 1)),
}
def test_catch_0():
def objective_function(access):
x = y
return 0
hyper = Hyperactive()
hyper.add_search(
... | [
"math.isnan",
"math.sqrt",
"numpy.arange",
"hyperactive.Hyperactive"
] | [((279, 292), 'hyperactive.Hyperactive', 'Hyperactive', ([], {}), '()\n', (290, 292), False, 'from hyperactive import Hyperactive\n'), ((553, 566), 'hyperactive.Hyperactive', 'Hyperactive', ([], {}), '()\n', (564, 566), False, 'from hyperactive import Hyperactive\n'), ((828, 841), 'hyperactive.Hyperactive', 'Hyperactiv... |
import numpy as np
from config import clusters # from . = problem in archivedir
cluster = clusters.vsc # change cluster configuration here
class ExperimentConfiguration(object):
def __init__(self):
pass
exp = ExperimentConfiguration()
exp.expname = "exp_v1.19_wb-random_Radar_zero"
exp.model_dx = 2000
ex... | [
"numpy.arange"
] | [((2156, 2184), 'numpy.arange', 'np.arange', (['(1000)', '(15001)', '(1000)'], {}), '(1000, 15001, 1000)\n', (2165, 2184), True, 'import numpy as np\n'), ((2393, 2420), 'numpy.arange', 'np.arange', (['(1000)', '(15001)', '(500)'], {}), '(1000, 15001, 500)\n', (2402, 2420), True, 'import numpy as np\n')] |
#!/usr/bin/python
__author__ = '<NAME>'
import sys
#sys.path.insert(0, '../lib')
import numpy as np
import dynesty
class CustomNestedSampler(dynesty.NestedSampler):
def convert_to_samples(self):
self.samples = self.results.samples
def unique_rows(self):
'''
Given an arr... | [
"numpy.mean",
"numpy.hstack",
"numpy.where",
"numpy.diff",
"numpy.argmax",
"numpy.lexsort",
"numpy.fmod",
"numpy.mod"
] | [((467, 495), 'numpy.lexsort', 'np.lexsort', (['self.flatchain.T'], {}), '(self.flatchain.T)\n', (477, 495), True, 'import numpy as np\n'), ((801, 830), 'numpy.hstack', 'np.hstack', (['self.lnprobability'], {}), '(self.lnprobability)\n', (810, 830), True, 'import numpy as np\n'), ((967, 986), 'numpy.argmax', 'np.argmax... |
from collections import defaultdict
from contextlib import closing
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Optional
import numpy as np # type: ignore
import pandas as pd # type: ignore
from tables import Filters # type: ignore
from tables import open_file
from pullfram... | [
"pandas.DataFrame",
"numpy.searchsorted",
"tables.open_file",
"collections.defaultdict",
"tables.Filters",
"pandas.concat",
"pandas.to_datetime"
] | [((3939, 3960), 'pandas.to_datetime', 'pd.to_datetime', (['index'], {}), '(index)\n', (3953, 3960), True, 'import pandas as pd\n'), ((5189, 5206), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (5200, 5206), False, 'from collections import defaultdict\n'), ((2383, 2438), 'tables.Filters', 'Filter... |
"""Test module for model-based class metafeatures."""
import pytest
from pymfe.mfe import MFE
from tests.utils import load_xy
import numpy as np
GNAME = "model-based"
class TestModelBased:
"""TestClass dedicated to test model-based metafeatures."""
@pytest.mark.parametrize(
"dt_id, ft_name, exp_val... | [
"pymfe.mfe.MFE",
"pytest.mark.parametrize",
"numpy.allclose",
"tests.utils.load_xy"
] | [((263, 4535), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dt_id, ft_name, exp_value, precompute"""', "[(0, 'leaves', 13, True), (0, 'leaves_branch', [4.6153846, 1.4455945], True\n ), (0, 'leaves_corrob', [0.07692308, 0.058791243], True), (0,\n 'leaves_homo', [84.933334, 41.648125], True), (0, 'le... |
# pulse_sequence.py
# <NAME>
# <EMAIL>
# Last Edited: Mon 28 Feb 2022 11:17:58 GMT
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import numpy as np
PULSE_WIDTH = 1
PULSE_HEIGHT = 0.3 # fraction of height of figure
TAU_WIDTH = 0.05
HORIZOTAL_PADS = (0.05, 0.01)
# --- horizontal dimensions... | [
"matplotlib.pyplot.figure",
"matplotlib.patches.Rectangle",
"numpy.linspace",
"numpy.cos"
] | [((2047, 2073), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 2)'}), '(figsize=(6, 2))\n', (2057, 2073), True, 'import matplotlib.pyplot as plt\n'), ((5177, 5230), 'numpy.linspace', 'np.linspace', (['acquisition', '(acquisition + T2_WIDTH)', '(256)'], {}), '(acquisition, acquisition + T2_WIDTH, 256)\n... |
#!/usr/bin/python3
# test_numpy.py
# testing script for writing various numpy tensors to QG8 files using
# python -m pytest -rP tests/test_numpy.py
#
# Author : <NAME> <<EMAIL>>
# Date created : 18 July 2021
#
# Copyright 2021 University of Strasbourg
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | [
"qg8.from_numpy",
"numpy.count_nonzero",
"numpy.array",
"numpy.zeros",
"numpy.random.randint",
"numpy.atleast_1d"
] | [((2377, 2403), 'numpy.zeros', 'np.zeros', (['(2 ** 8, 2 ** 8)'], {}), '((2 ** 8, 2 ** 8))\n', (2385, 2403), True, 'import numpy as np\n'), ((3101, 3159), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2 ** 16 - 1)'], {'size': '(1, 2, 3, 4, 5, 6)'}), '(0, 2 ** 16 - 1, size=(1, 2, 3, 4, 5, 6))\n', (3118, 3159),... |
import nhpp
import math
import numpy as np
import pandas as pd
import pytest
@pytest.mark.parametrize("test_input,expected", [
({0: 1, 2: 1, 1: 0}, ([0, 1, 2], [1, 0, 1])),
({0: 1, 3: 1, 2: 2}, ([0, 2, 3], [1, 2, 1])),
])
def test_sorting(test_input, expected):
assert nhpp.nhpp._get_sorted_pairs(test_input) == ex... | [
"numpy.histogram",
"nhpp.nhpp._get_piecewise_val",
"nhpp.get_arrivals",
"numpy.sin",
"pytest.mark.parametrize",
"numpy.sum",
"nhpp.nhpp._get_rate_slopes",
"pytest.raises",
"numpy.array",
"numpy.linspace",
"pandas.DataFrame",
"nhpp.nhpp._get_sorted_pairs"
] | [((80, 241), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_input,expected"""', '[({(0): 1, (2): 1, (1): 0}, ([0, 1, 2], [1, 0, 1])), ({(0): 1, (3): 1, (2):\n 2}, ([0, 2, 3], [1, 2, 1]))]'], {}), "('test_input,expected', [({(0): 1, (2): 1, (1): 0},\n ([0, 1, 2], [1, 0, 1])), ({(0): 1, (3): 1, (2... |
# -*-coding:utf-8 -*-
# Reference:**********************************************
# @Time : 2019-08-22 21:30
# @Author : <NAME>
# @File : cv2_test.py
# @User : liyihao
# @Software: PyCharm
# @Description: line regression
# Reference:**********************************************
import numpy as np
import ... | [
"numpy.random.choice",
"random.random",
"random.randint"
] | [((1482, 1523), 'numpy.random.choice', 'np.random.choice', (['num_samples', 'batch_size'], {}), '(num_samples, batch_size)\n', (1498, 1523), True, 'import numpy as np\n'), ((1840, 1861), 'random.randint', 'random.randint', (['(0)', '(10)'], {}), '(0, 10)\n', (1854, 1861), False, 'import random\n'), ((1864, 1879), 'rand... |
import numpy as np
#import pickle
#A = np.loadtxt("Rock_Paper_Scissors_Raw.txt", dtype = list, comments = '#', delimiter = ',', usecols = (0,1,2,3))
#A = np.loadtxt("Rock_Paper_Scissors_Raw.txt", dtype = int, comments = '#', delimiter = ',', usecols = (2), ndmin = 1)
#B = np.loadtxt("Rock_Paper_Scissors_Raw.txt", dtyp... | [
"itertools.product",
"numpy.genfromtxt"
] | [((4403, 4522), 'numpy.genfromtxt', 'np.genfromtxt', (['"""Rock_Paper_Scissors_Raw.txt"""'], {'dtype': 'int', 'comments': '"""#"""', 'delimiter': '""","""', 'usecols': '(0, 2)', 'max_rows': '(5000)'}), "('Rock_Paper_Scissors_Raw.txt', dtype=int, comments='#',\n delimiter=',', usecols=(0, 2), max_rows=5000)\n", (4416... |
#!/usr/bin/env python3
# test_conv2d.py
#
# Copyright (c) 2010-2018 Wave Computing, Inc. and its applicable licensors.
# All rights reserved; provided, that any files identified as open source shall
# be governed by the specific open source license(s) applicable to such files.
#
# For any files associated with d... | [
"tensorflow.nn.conv2d",
"progressbar.Bar",
"numpy.allclose",
"tensorflow.reset_default_graph",
"numpy.isclose",
"numpy.where",
"waveflow.wavecomp_ops_module.wave_conv2d",
"tensorflow.Session",
"tensorflow.truncated_normal_initializer",
"tensorflow.global_variables_initializer",
"progressbar.Perc... | [((2939, 2963), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (2961, 2963), True, 'import tensorflow as tf\n'), ((3255, 3305), 'progressbar.ProgressBar', 'pb.ProgressBar', ([], {'widgets': 'widgets', 'maxval': 'iterations'}), '(widgets=widgets, maxval=iterations)\n', (3269, 3305), True, ... |
# Copyright 2019 SAP SE
# 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, software
#... | [
"os.path.exists",
"datetime.datetime.fromtimestamp",
"argparse.ArgumentParser",
"os.makedirs",
"functools.reduce",
"cfg.load_config.cfg_from_file",
"networks.net_DGMa.netD",
"random.seed",
"numpy.random.seed",
"shutil.rmtree",
"networks.net_DGMa.parameters",
"time.time",
"random.randint",
... | [((785, 796), 'time.time', 'time.time', ([], {}), '()\n', (794, 796), False, 'import time\n'), ((819, 861), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""xxx"""'}), "(description='xxx')\n", (842, 861), False, 'import argparse\n'), ((1874, 1897), 'cfg.load_config.cfg_from_file', 'cfg_fro... |
import torch
from scipy.misc import imread, imsave, imresize
import matplotlib.pyplot as plt
import numpy as np
from path import Path
import argparse
from tqdm import tqdm
from models import DispResNet6
from utils import tensor2array
parser = argparse.ArgumentParser(description='Inference script for DispNet learned ... | [
"argparse.ArgumentParser",
"utils.tensor2array",
"torch.load",
"tqdm.tqdm",
"torch.from_numpy",
"path.Path",
"scipy.misc.imread",
"scipy.misc.imresize",
"models.DispResNet6",
"numpy.transpose"
] | [((246, 497), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Inference script for DispNet learned with Structure from Motion Learner inference on KITTI and CityScapes Dataset"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(descriptio... |
import pickle
from PIL import Image
import numpy as np
from dlib import cnn_face_detection_model_v1
from controller import Camera
from flockai.PyCatascopia.Metrics import *
from flockai.interfaces.flockai_ml import FlockAIClassifier
from flockai.models.probes.flockai_probe import FlockAIProbe, ProcessCpuUtilizationMet... | [
"flockai.models.devices.device_enums.Devices",
"PIL.Image.open",
"flockai.models.probes.flockai_probe.ProcessCpuTimeMetric",
"flockai.models.probes.flockai_probe.FlockAIProbe",
"flockai.models.probes.flockai_probe.ProbeAliveTimeMetric",
"flockai.models.devices.device_enums.Relative2DPosition",
"dlib.cnn... | [((1903, 1969), 'flockai.models.devices.device_enums.Devices', 'Devices', (['enableable_devices', 'non_enableable_devices', 'motor_devices'], {}), '(enableable_devices, non_enableable_devices, motor_devices)\n', (1910, 1969), False, 'from flockai.models.devices.device_enums import EnableableDevice, NonEnableableDevice,... |
#!/usr/bin/env python
# coding: utf-8
"""Demo of different plot API styles: procedural test_widget and OO test_plot
"""
from __future__ import print_function
import logging
import sys
import numpy
from PyQt4 import QtGui
logging.basicConfig()
logger = logging.getLogger(__name__)
app = QtGui.QApplication([])
def ... | [
"logging.basicConfig",
"PyQt4.QtGui.QApplication",
"logging.getLogger",
"plot.PlotWidget.PlotWidget",
"plot.BackendMPL",
"numpy.arange"
] | [((225, 246), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (244, 246), False, 'import logging\n'), ((256, 283), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (273, 283), False, 'import logging\n'), ((291, 313), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['[]'],... |
import cv2
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
# imagenet
imagenet_mean = [0.485, 0.456, 0.406]
imagenet_std = [0.229, 0.224, 0.225]
class CustomDataset(Dataset):
def __init__(self, all_img_path_list, transform, ):
self.all_img_paths = all_img_path_list
s... | [
"PIL.Image.fromarray",
"numpy.fromfile"
] | [((625, 645), 'PIL.Image.fromarray', 'Image.fromarray', (['img'], {}), '(img)\n', (640, 645), False, 'from PIL import Image\n'), ((554, 591), 'numpy.fromfile', 'np.fromfile', (['img_path'], {'dtype': 'np.uint8'}), '(img_path, dtype=np.uint8)\n', (565, 591), True, 'import numpy as np\n')] |
import warnings
import pickle
import pandas as pd
import numpy as np
import random
from math import ceil, floor
from copy import deepcopy
from functions import *
warnings.filterwarnings('ignore')
minicolumns = 10
hypercolumns = 15
sequence_length = 2
number_of_sequences = 20
desired_root = 0.9
verbose = True
# Do ... | [
"numpy.random.randint",
"warnings.filterwarnings",
"pandas.read_csv"
] | [((164, 197), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (187, 197), False, 'import warnings\n'), ((503, 527), 'numpy.random.randint', 'np.random.randint', (['(0)', '(20)'], {}), '(0, 20)\n', (520, 527), True, 'import numpy as np\n'), ((729, 785), 'pandas.read_csv', 'p... |
# -*- coding: utf-8 -*-
"""
author: <NAME> (github Boyne272)
Last updated on Wed Aug 28 08:46:31 2019
"""
import sys
import time as tm
import random
import torch
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
def percent_print(i, i_max, interval=1, length=50):
"""
... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"PIL.Image.open",
"time.clock",
"random.seed",
"numpy.random.seed",
"sys.stdout.flush",
"matplotlib.pyplot.subplots",
"sys.stdout.write"
] | [((1336, 1352), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (1346, 1352), False, 'from PIL import Image\n'), ((1586, 1603), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1597, 1603), False, 'import random\n'), ((1609, 1629), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n',... |
import torch
import numpy as np
import pandas as pd
import torch.nn as nn
from sklearn.neighbors import KernelDensity
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestRegressor
# Estimate the distribusion of P{A|Y}
def density_estimation(Y, A, Y_test=[]):
bandwidth = np.sq... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.max",
"torch.from_numpy",
"torch.nn.MSELoss",
"numpy.arange",
"numpy.mean",
"torch.nn.Sigmoid",
"sklearn.ensemble.RandomForestRegressor",
"sklearn.neighbors.KernelDensity",
"numpy.concatenate",
"numpy.abs",
"pandas.get_dummies",
"sklearn.preproce... | [((3896, 3917), 'torch.max', 'torch.max', (['outputs', '(1)'], {}), '(outputs, 1)\n', (3905, 3917), False, 'import torch\n'), ((4057, 4075), 'torch.max', 'torch.max', (['Yhat', '(1)'], {}), '(Yhat, 1)\n', (4066, 4075), False, 'import torch\n'), ((4224, 4246), 'torch.from_numpy', 'torch.from_numpy', (['Yhat'], {}), '(Yh... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 <NAME> <<EMAIL>>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Run with:
sudo python ./setup.py install
"""
import os
import sys
import warnings
import ez_setup
from setuptools import setup, find_packages, Extensio... | [
"ez_setup.use_setuptools",
"setuptools.find_packages",
"setuptools.Extension",
"os.path.dirname",
"sys.exc_info",
"setuptools.command.build_ext.build_ext.run",
"setuptools.command.build_ext.build_ext.build_extension",
"numpy.get_include",
"warnings.warn",
"setuptools.command.build_ext.build_ext.fi... | [((552, 577), 'ez_setup.use_setuptools', 'ez_setup.use_setuptools', ([], {}), '()\n', (575, 577), False, 'import ez_setup\n'), ((3384, 3409), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (3399, 3409), False, 'import os\n'), ((3457, 3482), 'os.path.dirname', 'os.path.dirname', (['__file__'],... |
import copy
import itertools
import os
import uuid
from typing import Callable, List, Tuple
import numpy as np
import ray
from gym import Env
from gym.spaces import Box
from interact.environments.vector_env import VectorEnv
from interact.experience.episode_batch import EpisodeBatch
from interact.experience.sample_bat... | [
"numpy.clip",
"interact.experience.episode_batch.EpisodeBatch.from_episodes",
"interact.environments.vector_env.VectorEnv",
"os.urandom",
"interact.experience.sample_batch.SampleBatch",
"numpy.asarray",
"copy.copy",
"uuid.uuid4",
"itertools.chain.from_iterable",
"ray.remote"
] | [((1157, 1187), 'interact.environments.vector_env.VectorEnv', 'VectorEnv', (['([env_fn] * num_envs)'], {}), '([env_fn] * num_envs)\n', (1166, 1187), False, 'from interact.environments.vector_env import VectorEnv\n'), ((2307, 2320), 'interact.experience.sample_batch.SampleBatch', 'SampleBatch', ([], {}), '()\n', (2318, ... |
# Imports
from __future__ import print_function
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import Ridge, Lasso, SGDRegressor, ElasticNet, LinearRegression
from sklearn.multioutput import MultiOutputRegressor
from sklearn.metrics import mean_squared_error
import matplot... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.collections.LineCollection",
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.errorbar",
"numpy.concatenate",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.legend",... | [((1539, 1574), 'numpy.concatenate', 'np.concatenate', (['masses_pred'], {'axis': '(0)'}), '(masses_pred, axis=0)\n', (1553, 1574), True, 'import numpy as np\n'), ((1576, 1615), 'numpy.concatenate', 'np.concatenate', (['amplitudes_pred'], {'axis': '(0)'}), '(amplitudes_pred, axis=0)\n', (1590, 1615), True, 'import nump... |
import time
import math
import datetime
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter, date2num
import numpy as np
import subprocess as sp
import time
import sys
import os
from itertools import groupby
from sklearn.neighbors import KernelDensity
from ... | [
"matplotlib.pyplot.hist",
"math.floor",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"os.listdir",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"sklearn.neighbors.KernelDensity",
"matplotlib.pyplot.close",
"numpy.linspace",
"subprocess.call",
"matplotlib.pyplot.ylim",
"subprocess.che... | [((58, 79), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (72, 79), False, 'import matplotlib\n'), ((369, 425), 'subprocess.check_output', 'sp.check_output', (["['date', '--date', '-1 day', '+%Y%m%d']"], {}), "(['date', '--date', '-1 day', '+%Y%m%d'])\n", (384, 425), True, 'import subprocess as ... |
import json
import sys
import numpy
import copy
#extractors = {0: {"precision": 0.5, "recall": 0.5}}
#sources = {0: {"KBT": 0.5, "triples": [[0,0,0], [0,1,None]]}}
#Correct triples have a value of 0, incorrect triples have a value of 1 through 25
#format = {0: {0: [], 1: [], 2: []} }
def generateTriples(quantity):
... | [
"numpy.cbrt",
"numpy.random.default_rng",
"json.dump",
"copy.deepcopy"
] | [((516, 541), 'copy.deepcopy', 'copy.deepcopy', (['allTriples'], {}), '(allTriples)\n', (529, 541), False, 'import copy\n'), ((2898, 2939), 'json.dump', 'json.dump', (['triples', 'triplesFile'], {'indent': '(2)'}), '(triples, triplesFile, indent=2)\n', (2907, 2939), False, 'import json\n'), ((2950, 2991), 'json.dump', ... |
# Add this project to the path
import os; import sys; currDir = os.path.dirname(os.path.realpath("__file__"))
rootDir = os.path.abspath(os.path.join(currDir, '..')); sys.path.insert(1, rootDir)
# Warnings
import warnings
warnings.filterwarnings("ignore")
# My modules
from features.build_features import *
# Public mo... | [
"sklearn.model_selection.GridSearchCV",
"sys.path.insert",
"pandas.read_csv",
"sklearn.metrics.precision_recall_curve",
"os.path.join",
"lightgbm.LGBMClassifier",
"sklearn.metrics.precision_score",
"os.path.realpath",
"sklearn.metrics.recall_score",
"numpy.random.seed",
"warnings.simplefilter",
... | [((166, 193), 'sys.path.insert', 'sys.path.insert', (['(1)', 'rootDir'], {}), '(1, rootDir)\n', (181, 193), False, 'import sys\n'), ((222, 255), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (245, 255), False, 'import warnings\n'), ((897, 905), 'numpy.random.seed', 'seed'... |
# coding: utf-8
# # Broadcasting a spectrum - Two spectral Components model
# In[ ]:
from astropy.io import fits
import numpy as np
import scipy as sp
from scipy.interpolate import interp1d
from scipy.stats import chisquare
from PyAstronomy.pyasl import dopplerShift
import matplotlib.pyplot as plt
get_ipython().ma... | [
"matplotlib.pyplot.contourf",
"numpy.arange",
"scipy.stats.chisquare",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.colorbar",
"numpy.asarray",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.close",
"numpy.array",
"astropy.io.fits.getdata",
"numpy.linspace",
"matplotlib.pyplot.figure",
"nu... | [((2235, 2253), 'astropy.io.fits.getdata', 'fits.getdata', (['host'], {}), '(host)\n', (2247, 2253), False, 'from astropy.io import fits\n'), ((2258, 2276), 'astropy.io.fits.getdata', 'fits.getdata', (['comp'], {}), '(comp)\n', (2270, 2276), False, 'from astropy.io import fits\n'), ((2508, 2523), 'numpy.array', 'np.arr... |
"""
MOST OF THIS CODE IS NOT USED
ITS COPY/PASTED AND LEFT HERE FOR CONVENIENCE
"""
import os
import sys
# in case our module isn't installed (running from this folder)
thisPath=os.path.abspath('../../../')
print(thisPath)
if not thisPath in sys.path:
sys.path.append(thisPath)
import swhlab
import matplotlib.pyp... | [
"matplotlib.pyplot.grid",
"numpy.convolve",
"matplotlib.pyplot.ylabel",
"sys.path.append",
"matplotlib.pyplot.margins",
"numpy.arange",
"os.listdir",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.diff",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.close",
"... | [((180, 208), 'os.path.abspath', 'os.path.abspath', (['"""../../../"""'], {}), "('../../../')\n", (195, 208), False, 'import os\n'), ((258, 283), 'sys.path.append', 'sys.path.append', (['thisPath'], {}), '(thisPath)\n', (273, 283), False, 'import sys\n'), ((797, 823), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'fi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 2 16:15:32 2021
@author: furqanafzal
"""
#%%modules
import os
path='/Users/furqanafzal/Documents/furqan/MountSinai/Research/Code/trakr'
os.chdir(path)
import numpy as np
import matplotlib.pylab as plt
import modules
import importlib
importlib.reloa... | [
"pickle.dump",
"modules.cross_val_metrics_naiveB",
"modules.add_noise",
"os.chdir",
"numpy.linspace",
"importlib.reload",
"numpy.load"
] | [((208, 222), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (216, 222), False, 'import os\n'), ((305, 330), 'importlib.reload', 'importlib.reload', (['modules'], {}), '(modules)\n', (321, 330), False, 'import importlib\n'), ((661, 675), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (669, 675), False, 'impor... |
from tkinter import N
import os
import numpy as np
from .main import DataLoader
from .timeseriesDLs import GridDataGenPyTorch
class TimeSeriesDataLoader(DataLoader):
def __init__(
self,
path: str,
file_ext: str,
recursive: bool,
iw_params: dict,
ow_params=None,
... | [
"os.listdir",
"numpy.arange"
] | [((512, 528), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (522, 528), False, 'import os\n'), ((1580, 1602), 'numpy.arange', 'np.arange', (['window_size'], {}), '(window_size)\n', (1589, 1602), True, 'import numpy as np\n'), ((1639, 1717), 'numpy.arange', 'np.arange', (['((n_rows - window_size - leave_last -... |
##%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
## ICA model for TE data
## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% import required packages
import numpy as np
from sklearn.preprocessing import StandardScaler
from ... | [
"numpy.hstack",
"matplotlib.pyplot.ylabel",
"numpy.column_stack",
"numpy.argsort",
"numpy.cumsum",
"numpy.linalg.norm",
"sklearn.decomposition.FastICA",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axhline",
"numpy.dot",
"numpy.argmax"... | [((669, 692), 'numpy.hstack', 'np.hstack', (['(xmeas, xmv)'], {}), '((xmeas, xmv))\n', (678, 692), True, 'import numpy as np\n'), ((730, 746), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (744, 746), False, 'from sklearn.preprocessing import StandardScaler\n'), ((1137, 1166), 'numpy.cumsu... |
import numpy as np
import cv2
import matplotlib.image as mpimg
from skimage.feature import hog
def bin_spatial(img, size=(32, 32)):
color1 = cv2.resize(img[:,:,0], size).ravel()
color2 = cv2.resize(img[:,:,1], size).ravel()
color3 = cv2.resize(img[:,:,2], size).ravel()
return np.hstack((color1, color... | [
"numpy.copy",
"numpy.histogram",
"cv2.resize",
"numpy.hstack",
"matplotlib.image.imread",
"numpy.concatenate",
"cv2.cvtColor",
"numpy.ravel",
"skimage.feature.hog"
] | [((296, 331), 'numpy.hstack', 'np.hstack', (['(color1, color2, color3)'], {}), '((color1, color2, color3))\n', (305, 331), True, 'import numpy as np\n'), ((490, 546), 'numpy.histogram', 'np.histogram', (['img[:, :, 0]'], {'bins': 'nbins', 'range': 'bins_range'}), '(img[:, :, 0], bins=nbins, range=bins_range)\n', (502, ... |
import cv2
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from PIL import Image
from numpy.random import random
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense, Flatten... | [
"keras.layers.Conv2D",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"numpy.array",
"keras.layers.Dense",
"keras.layers.Cropping2D",
"numpy.random.random",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.savefig",
"keras.layers.Flatten",
"... | [((2615, 2650), 'numpy.array', 'np.array', (['augmented_images'], {'ndmin': '(4)'}), '(augmented_images, ndmin=4)\n', (2623, 2650), True, 'import numpy as np\n'), ((2654, 2686), 'numpy.array', 'np.array', (['augmented_measurements'], {}), '(augmented_measurements)\n', (2662, 2686), True, 'import numpy as np\n'), ((3618... |
#!/usr/bin/python3
"""
similarity_mapper2
"""
import sys
import pandas as pd
import numpy as np
big_data = pd.read_csv('ratings.csv')
all_films = np.unique(big_data.movieId)
for line in sys.stdin:
film, film_statistics = line.strip().split('\t', 1)
for f in all_films:
if int(film) < f:
... | [
"numpy.unique",
"pandas.read_csv"
] | [((111, 137), 'pandas.read_csv', 'pd.read_csv', (['"""ratings.csv"""'], {}), "('ratings.csv')\n", (122, 137), True, 'import pandas as pd\n'), ((150, 177), 'numpy.unique', 'np.unique', (['big_data.movieId'], {}), '(big_data.movieId)\n', (159, 177), True, 'import numpy as np\n')] |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> and <NAME>
# --------------------------------------------------------
"""Compute minibatch blobs for training a Fast R-CNN network."""
fr... | [
"numpy.random.normal",
"cv2.imwrite",
"utils.blob.prep_noise_for_blob",
"numpy.where",
"numpy.array",
"utils.blob.prep_im_for_blob",
"utils.blob.im_list_to_blob",
"cv2.imread"
] | [((2179, 2264), 'numpy.array', 'np.array', (['[[im_blob.shape[1], im_blob.shape[2], im_scales[0]]]'], {'dtype': 'np.float32'}), '([[im_blob.shape[1], im_blob.shape[2], im_scales[0]]], dtype=np.float32\n )\n', (2187, 2264), True, 'import numpy as np\n'), ((4255, 4285), 'utils.blob.im_list_to_blob', 'im_list_to_blob',... |
#!/usr/bin/env python
import os
import numpy as np
from scipy.io import loadmat
print('Loading movie ratings dataset.\n\n')
os.chdir("/home/mgaber/Workbench/ML/Week9/exercise/ex8/")
# % Load movie data
load_data = loadmat('ex8_movies.mat')
Y = load_data['Y']
R = load_data['R']
# We should try to plot
# imagesc(Y);
... | [
"os.chdir",
"numpy.transpose",
"scipy.io.loadmat",
"numpy.square"
] | [((126, 183), 'os.chdir', 'os.chdir', (['"""/home/mgaber/Workbench/ML/Week9/exercise/ex8/"""'], {}), "('/home/mgaber/Workbench/ML/Week9/exercise/ex8/')\n", (134, 183), False, 'import os\n'), ((217, 242), 'scipy.io.loadmat', 'loadmat', (['"""ex8_movies.mat"""'], {}), "('ex8_movies.mat')\n", (224, 242), False, 'from scip... |
import inspect
import logging
from numpy import exp, log, average
from .metric_directionality import greater_is_better, best_in_series, idxbest
def random_model_group(df, train_end_time, n=1):
"""Pick a random model group (as a baseline)
Arguments:
train_end_time (Timestamp) -- current train end ti... | [
"numpy.log",
"inspect.getargspec",
"logging.info",
"numpy.average"
] | [((5345, 5456), 'logging.info', 'logging.info', (['"""Null metric variances for %s %s at %s; picking at random"""', 'metric', 'parameter', 'train_end_time'], {}), "('Null metric variances for %s %s at %s; picking at random',\n metric, parameter, train_end_time)\n", (5357, 5456), False, 'import logging\n'), ((12099, ... |
import talib
import numpy as np
import jtrade.core.instrument.equity as Equity
# ========== TECH OVERLAP INDICATORS **START** ==========
def BBANDS(equity, start=None, end=None, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0):
"""Bollinger Bands
:param timeperiod:
:param nbdevup:
:param nbdevdn:
... | [
"talib.HT_TRENDLINE",
"talib.CDLTAKURI",
"talib.CDLXSIDEGAP3METHODS",
"talib.TYPPRICE",
"talib.CDLBREAKAWAY",
"talib.CDLMATCHINGLOW",
"talib.CDLIDENTICAL3CROWS",
"talib.ROCR",
"talib.DEMA",
"talib.CDLONNECK",
"talib.CDLRICKSHAWMAN",
"talib.CDL3INSIDE",
"talib.CDL3STARSINSOUTH",
"talib.MOM"... | [((368, 423), 'numpy.array', 'np.array', (["equity.hp.loc[start:end, 'close']"], {'dtype': '"""f8"""'}), "(equity.hp.loc[start:end, 'close'], dtype='f8')\n", (376, 423), True, 'import numpy as np\n'), ((463, 558), 'talib.BBANDS', 'talib.BBANDS', (['close'], {'timeperiod': 'timeperiod', 'nbdevup': 'nbdevup', 'nbdevdn': ... |
import numpy as np
def thresholding(scores, labels):
"""
Args:
scores: Type:ndarray
shape: N * Nc
N - Number of training examples
Nc - Number of classes
labels: Type: ndarray
shape: N * Nc
N - Number of training examples
... | [
"numpy.argsort",
"numpy.array",
"numpy.sort",
"numpy.where"
] | [((2879, 2892), 'numpy.array', 'np.array', (['tms'], {}), '(tms)\n', (2887, 2892), True, 'import numpy as np\n'), ((543, 567), 'numpy.sort', 'np.sort', (['scores_'], {'axis': '(1)'}), '(scores_, axis=1)\n', (550, 567), True, 'import numpy as np\n'), ((672, 698), 'numpy.argsort', 'np.argsort', (['scores'], {'axis': '(1)... |
from __future__ import division
import numpy as np
from loss import Loss
from npai_stats import NpaiStats
from sigmoid import Sigmoid
class CrossEntropy(Loss):
def __init__(self): pass
def loss(self, y, p):
# Avoid division by zero
p = np.clip(p, 1e-15, 1 - 1e-15)
return - y * np.log(p... | [
"numpy.clip",
"numpy.log",
"numpy.argmax"
] | [((262, 290), 'numpy.clip', 'np.clip', (['p', '(1e-15)', '(1 - 1e-15)'], {}), '(p, 1e-15, 1 - 1e-15)\n', (269, 290), True, 'import numpy as np\n'), ((508, 536), 'numpy.clip', 'np.clip', (['p', '(1e-15)', '(1 - 1e-15)'], {}), '(p, 1e-15, 1 - 1e-15)\n', (515, 536), True, 'import numpy as np\n'), ((312, 321), 'numpy.log',... |
import IMLearn.learners.regressors.linear_regression
from IMLearn.learners.regressors import PolynomialFitting
from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
from typing import NoReturn
import plotly.express as px
import plotly.io as pio
import plotly.graph_objects as go
pio.templat... | [
"plotly.graph_objects.Layout",
"pandas.read_csv",
"plotly.express.bar",
"IMLearn.utils.split_train_test",
"numpy.array",
"plotly.graph_objects.Scatter",
"numpy.random.seed",
"IMLearn.learners.regressors.PolynomialFitting"
] | [((1425, 1468), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'parse_dates': "['Date']"}), "(filename, parse_dates=['Date'])\n", (1436, 1468), True, 'import pandas as pd\n'), ((3676, 3733), 'IMLearn.utils.split_train_test', 'split_train_test', (["isr_data['DayOfYear']", "isr_data['Temp']"], {}), "(isr_data['DayOfYe... |
#!/usr/bin/env python
"""Bayesian linear regression using variational inference.
This version directly regresses on the data X, rather than regressing
on a placeholder X. Note this prevents the model from conditioning on
other values of X.
References
----------
http://edwardlib.org/tutorials/supervised-regression
"""... | [
"numpy.random.normal",
"tensorflow.random_normal",
"tensorflow.ones",
"edward.KLqp",
"edward.set_seed",
"numpy.linspace",
"tensorflow.cast",
"edward.dot",
"tensorflow.zeros"
] | [((771, 786), 'edward.set_seed', 'ed.set_seed', (['(42)'], {}), '(42)\n', (782, 786), True, 'import edward as ed\n'), ((895, 922), 'tensorflow.cast', 'tf.cast', (['X_data', 'tf.float32'], {}), '(X_data, tf.float32)\n', (902, 922), True, 'import tensorflow as tf\n'), ((1336, 1377), 'edward.KLqp', 'ed.KLqp', (['{w: qw, b... |
import time
from pyscf import scf
import os, time
import numpy as np
from mldftdat.lowmem_analyzers import RHFAnalyzer, UHFAnalyzer
from mldftdat.workflow_utils import get_save_dir, SAVE_ROOT, load_mol_ids
from mldftdat.density import get_exchange_descriptors2, LDA_FACTOR, GG_AMIN
from mldftdat.data import get_unique_c... | [
"logging.basicConfig",
"mldftdat.density.get_exchange_descriptors2",
"argparse.ArgumentParser",
"os.makedirs",
"yaml.dump",
"time.monotonic",
"os.path.join",
"numpy.append",
"numpy.array",
"os.path.isdir",
"mldftdat.workflow_utils.load_mol_ids",
"os.path.basename",
"mldftdat.data.get_unique_... | [((4283, 4313), 'os.path.basename', 'os.path.basename', (['DATASET_NAME'], {}), '(DATASET_NAME)\n', (4299, 4313), False, 'import os, time\n'), ((4329, 4406), 'os.path.join', 'os.path.join', (['SAVE_ROOT', '"""DATASETS"""', 'FUNCTIONAL', 'BASIS', 'version', 'DATASET_NAME'], {}), "(SAVE_ROOT, 'DATASETS', FUNCTIONAL, BASI... |
from __future__ import print_function
import os
import random
import signal
import numpy as np
from robolearn.old_utils.sampler import Sampler
from robolearn.old_agents import GPSAgent
from robolearn.old_algos.gps.gps import GPS
from robolearn.old_costs.cost_action import CostAction
from robolearn.old_costs.cost_fk ... | [
"robolearn.old_utils.print_utils.change_print_color.change",
"robolearn.old_utils.tasks.bigman.lift_box_utils.load_task_space_torque_control_demos",
"numpy.array",
"robolearn.old_utils.tasks.bigman.lift_box_utils.Reset_condition_bigman_box_gazebo",
"robolearn.old_utils.tasks.bigman.lift_box_utils.spawn_box_... | [((1814, 1877), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(4)', 'suppress': '(True)', 'linewidth': '(1000)'}), '(precision=4, suppress=True, linewidth=1000)\n', (1833, 1877), True, 'import numpy as np\n'), ((2009, 2054), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'kill_everything'],... |
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D, proj3d
import matplotlib.pyplot as plt
import numpy as np
import itertools
import oloid.circle
fig = plt.figure()
ax = fig.gca(projection='3d')
# #dibujar cubo
r = [-1, 1]
for s, e in itertools.combination... | [
"numpy.abs",
"itertools.product",
"matplotlib.pyplot.figure",
"matplotlib.patches.FancyArrowPatch.__init__",
"matplotlib.patches.FancyArrowPatch.draw",
"mpl_toolkits.mplot3d.proj3d.proj_transform",
"matplotlib.pyplot.show"
] | [((215, 227), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (225, 227), True, 'import matplotlib.pyplot as plt\n'), ((1806, 1816), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1814, 1816), True, 'import matplotlib.pyplot as plt\n'), ((609, 681), 'matplotlib.patches.FancyArrowPatch.__init__', '... |
import numpy as np
import dnplab as dnp
def get_gauss_3d(std_noise=0.0):
x = np.r_[0:100]
y = np.r_[0:100]
z = np.r_[0:100]
noise = std_noise * np.random.randn(len(x), len(y), len(z))
gauss = np.exp(-1.0 * (x - 50) ** 2.0 / (10.0 ** 2))
gauss_3d = (
gauss.reshape(-1, 1, 1) * gauss.res... | [
"numpy.exp",
"dnplab.DNPData"
] | [((215, 257), 'numpy.exp', 'np.exp', (['(-1.0 * (x - 50) ** 2.0 / 10.0 ** 2)'], {}), '(-1.0 * (x - 50) ** 2.0 / 10.0 ** 2)\n', (221, 257), True, 'import numpy as np\n'), ((511, 560), 'dnplab.DNPData', 'dnp.DNPData', (['gauss_3d', "['x', 'y', 'z']", '[x, y, z]'], {}), "(gauss_3d, ['x', 'y', 'z'], [x, y, z])\n", (522, 56... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 26 18:30:06 2018
@author: malopez
"""
import numpy as np
from numpy import random_intel
def computeCollisions(alpha, N, rem, dt, rv_max, vel):
# First we have to determine the maximum number of candidate collisions
n_cols_max = (N * rv_max * dt /2) + rem
... | [
"numpy.random_intel.uniform",
"numpy.sqrt",
"numpy.random_intel.choice",
"numpy.floor",
"numpy.stack",
"numpy.sum",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"numpy.random_intel.seed"
] | [((571, 603), 'numpy.random_intel.seed', 'random_intel.seed', ([], {'brng': '"""MT2203"""'}), "(brng='MT2203')\n", (588, 603), False, 'from numpy import random_intel\n'), ((687, 731), 'numpy.random_intel.choice', 'random_intel.choice', (['N'], {'size': '(n_cols_max, 2)'}), '(N, size=(n_cols_max, 2))\n', (706, 731), Fal... |
from pathlib import Path
from typing import Tuple
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
import torchaudio
from constants import INPUT_SAMPLE_RATE, TARGET_SAMPLE_RATE
from torch.utils.data import DataLoader, Dataset
from tqdm import tqdm
class SegmentationDataset(Dataset)... | [
"pandas.read_csv",
"torchaudio.backend.sox_io_backend.load",
"numpy.arange",
"pathlib.Path",
"torch.mean",
"numpy.where",
"torchaudio.info",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.round",
"torch.std",
"numpy.insert",
"numpy.append",
"torch.tensor",
"numpy.zeros",
"numpy.random... | [((26545, 26586), 'torch.ones', 'torch.ones', (['audio.shape'], {'dtype': 'torch.long'}), '(audio.shape, dtype=torch.long)\n', (26555, 26586), False, 'import torch\n'), ((788, 809), 'pathlib.Path', 'Path', (['path_to_dataset'], {}), '(path_to_dataset)\n', (792, 809), False, 'from pathlib import Path\n'), ((1117, 1210),... |
import numpy as np
from pylab import imshow, plot, show, gray
N = 1000 # the number of the divisions on the axis
NIT = 10 # f(z) precision
real = np.linspace(-2, 2, N) # Real axis
imaginario = np.linspace(-2, 2, N) # Imaginary axis
matriz_c = np.zeros((N, N), dtype=complex) ... | [
"pylab.gray",
"numpy.linspace",
"numpy.zeros",
"pylab.show"
] | [((164, 185), 'numpy.linspace', 'np.linspace', (['(-2)', '(2)', 'N'], {}), '(-2, 2, N)\n', (175, 185), True, 'import numpy as np\n'), ((227, 248), 'numpy.linspace', 'np.linspace', (['(-2)', '(2)', 'N'], {}), '(-2, 2, N)\n', (238, 248), True, 'import numpy as np\n'), ((287, 318), 'numpy.zeros', 'np.zeros', (['(N, N)'], ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 9 22:04:01 2022
@author: lukepinkel
"""
import numpy as np
import scipy as sp
import scipy.linalg
import pandas as pd
from ..utilities.random import r_lkj, exact_rmvnorm
class FactorModelSim(object):
def __init__(self, n_vars=12, n_facs=... | [
"numpy.random.default_rng",
"numpy.sort",
"numpy.diag",
"numpy.zeros",
"numpy.linspace",
"scipy.linalg.block_diag",
"numpy.arange"
] | [((666, 702), 'numpy.zeros', 'np.zeros', (['(self.n_vars, self.n_facs)'], {}), '((self.n_vars, self.n_facs))\n', (674, 702), True, 'import numpy as np\n'), ((2016, 2028), 'numpy.diag', 'np.diag', (['psi'], {}), '(psi)\n', (2023, 2028), True, 'import numpy as np\n'), ((2606, 2646), 'scipy.linalg.block_diag', 'sp.linalg.... |
"""Plot match's mod* files
usage:
cd matchX.X/Model/data
e.g.,
python -m match.makemod.plot_mods -p 'mod*'
"""
from __future__ import print_function
import glob
import os
import sys
import argparse
import numpy as np
import matplotlib.pylab as plt
from ..scripts.config import EXT
def plot_mods(sub=None, pref='mod1_*... | [
"matplotlib.pylab.subplots",
"matplotlib.pylab.savefig",
"os.listdir",
"numpy.log10",
"argparse.ArgumentParser",
"matplotlib.pylab.colorbar",
"os.getcwd",
"os.chdir",
"os.path.isfile",
"os.path.isdir",
"numpy.loadtxt",
"matplotlib.pylab.close",
"glob.glob"
] | [((1045, 1056), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1054, 1056), False, 'import os\n'), ((1462, 1477), 'glob.glob', 'glob.glob', (['pref'], {}), '(pref)\n', (1471, 1477), False, 'import glob\n'), ((2529, 2543), 'os.chdir', 'os.chdir', (['here'], {}), '(here)\n', (2537, 2543), False, 'import os\n'), ((2612, 267... |
import numpy as np
import cPickle as pickle
from classifier import Classifier
from util.layers import *
from util.dump import dump_big_matrix
class NNClassifier(Classifier):
def __init__(self, D, H, W, K, iternum):
Classifier.__init__(self, D, H, W, K, iternum)
self.L = 100 # size of hidden layer
""" La... | [
"classifier.Classifier.__init__",
"util.dump.dump_big_matrix",
"numpy.sum",
"numpy.zeros",
"numpy.random.randn"
] | [((222, 268), 'classifier.Classifier.__init__', 'Classifier.__init__', (['self', 'D', 'H', 'W', 'K', 'iternum'], {}), '(self, D, H, W, K, iternum)\n', (241, 268), False, 'from classifier import Classifier\n'), ((457, 478), 'numpy.zeros', 'np.zeros', (['(1, self.L)'], {}), '((1, self.L))\n', (465, 478), True, 'import nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.