code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np
from nnCostFunction import nnCostFunction
from trainNN import trainNN
def learningCurveLambda(X, y, X_CV, y_CV, INPUT_LAYER_SIZE, HIDDEN_LAYER_SIZE, OUTPUT_LAYER_SIZE):
"""Calculates the training set error and cross validation set error w.r.t a set of lambda values for use in plotting the learni... | [
"numpy.zeros",
"numpy.isfinite",
"numpy.array",
"trainNN.trainNN",
"nnCostFunction.nnCostFunction"
] | [((371, 450), 'numpy.array', 'np.array', (['[[0], [0.001], [0.003], [0.01], [0.03], [0.1], [0.3], [1], [3], [10]]'], {}), '([[0], [0.001], [0.003], [0.01], [0.03], [0.1], [0.3], [1], [3], [10]])\n', (379, 450), True, 'import numpy as np\n'), ((469, 505), 'numpy.zeros', 'np.zeros', (['(lmbda_values.shape[0], 1)'], {}), ... |
# tensoRF video model
# TODO: 1. support time coarse to fine
# TODO: 2. verify that it can run well with crop image
# TODO: 3. try harder dataset
import torch
import torch.nn.functional as F
import numpy as np
from utils import printlog
from .tensoRF import TensorVMSplit
from .tensorBase import raw2alpha, AlphaGridMas... | [
"numpy.floor",
"torch.cat",
"torch.randn",
"torch.rand_like",
"torch.no_grad",
"torch.nn.functional.grid_sample",
"torch.exp",
"torch.nn.functional.softplus",
"torch.nn.ParameterList",
"torch.nn.functional.relu",
"torch.zeros",
"torch.zeros_like",
"torch.norm",
"torch.rand",
"torch.nn.fu... | [((11569, 11584), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (11582, 11584), False, 'import torch\n'), ((12456, 12471), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (12469, 12471), False, 'import torch\n'), ((12942, 12957), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (12955, 12957), False, 'impo... |
# -*- coding: utf-8 -*-
import codecs
import numpy as np
# load data of zhihu
import word2vec
import os
import pickle
PAD_ID = 0
_GO = "_GO"
_END = "_END"
_PAD = "_PAD"
def create_voabulary(simple=None, word2vec_model_path='zhihu-word2vec-title-desc.bin-100',
name_scope=''): # zhihu-word2vec-m... | [
"pickle.dump",
"codecs.open",
"numpy.zeros",
"os.path.exists",
"pickle.load",
"word2vec.load"
] | [((510, 536), 'os.path.exists', 'os.path.exists', (['cache_path'], {}), '(cache_path)\n', (524, 536), False, 'import os\n'), ((2366, 2392), 'os.path.exists', 'os.path.exists', (['cache_path'], {}), '(cache_path)\n', (2380, 2392), False, 'import os\n'), ((6049, 6092), 'codecs.open', 'codecs.open', (['traning_data_path',... |
#!/usr/bin/env python
# Copyright 2014 Open Connectome Project (http://openconnecto.me)
#
# 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
#
#... | [
"csv.reader",
"warnings.simplefilter",
"networkx.from_numpy_matrix",
"os.path.basename",
"networkx.read_weighted_edgelist",
"numpy.genfromtxt",
"networkx.relabel_nodes",
"collections.OrderedDict"
] | [((745, 776), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (766, 776), False, 'import warnings\n'), ((1298, 1311), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1309, 1311), False, 'from collections import OrderedDict\n'), ((1507, 1530), 'os.path.basename', 'o... |
from intake.source import base
import numpy as np
from . import __version__
class ODBCSource(base.DataSource):
"""
One-shot ODBC to dataframe reader
Parameters
----------
uri: str or None
Full connection string for TurbODBC. If using keyword parameters, this
should be ``None``
... | [
"intake.source.base.Schema",
"turbodbc.connect",
"numpy.linspace"
] | [((2156, 2247), 'intake.source.base.Schema', 'base.Schema', ([], {'datashape': 'None', 'dtype': 'dtype', 'shape': 'shape', 'npartitions': '(1)', 'extra_metadata': '{}'}), '(datashape=None, dtype=dtype, shape=shape, npartitions=1,\n extra_metadata={})\n', (2167, 2247), False, 'from intake.source import base\n'), ((51... |
import os
import tensorflow as tf
import numpy as np
from . import generator
from . import critic
from . import helpers
class UGATIT:
def __init__(self, **kwargs):
self._base_ch = kwargs.get('base_ch', 64)
self._gan_weight = kwargs.get('gan_weight', 1.)
self._rec_weight = kwargs.get('rec_weight', 10.)
... | [
"tensorflow.summary.scalar",
"tensorflow.train.Saver",
"tensorflow.trainable_variables",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"numpy.clip",
"tensorflow.placeholder",
"tensorflow.train.AdamOptimizer",
"os.path.join",
"tensorflow.summary.merge_all"
] | [((3327, 3349), 'tensorflow.summary.merge_all', 'tf.summary.merge_all', ([], {}), '()\n', (3347, 3349), True, 'import tensorflow as tf\n'), ((7442, 7495), 'tensorflow.summary.scalar', 'tf.summary.scalar', (['"""gen_a2b_loss"""', 'self._gen_a2b_loss'], {}), "('gen_a2b_loss', self._gen_a2b_loss)\n", (7459, 7495), True, '... |
from collections import defaultdict
import os
import pickle
import sys
import numpy as np
from rdkit import Chem
def pad(x_list, p):
"""Pad x_list with p."""
len_max = max(map(len, x_list))
pad_list = []
for x in x_list:
len_x = len(x)
if (len_x < len_max):
x += [p] * (le... | [
"os.mkdir",
"numpy.save",
"os.path.isdir",
"collections.defaultdict",
"numpy.where",
"numpy.array",
"rdkit.Chem.MolFromSmiles",
"rdkit.Chem.GetAdjacencyMatrix"
] | [((376, 394), 'numpy.array', 'np.array', (['pad_list'], {}), '(pad_list)\n', (384, 394), True, 'import numpy as np\n'), ((669, 698), 'numpy.array', 'np.array', (['atom_list', 'np.int32'], {}), '(atom_list, np.int32)\n', (677, 698), True, 'import numpy as np\n'), ((746, 770), 'collections.defaultdict', 'defaultdict', ([... |
import tensorflow as tf
import os
import matplotlib.pyplot as plt
import numpy as np
from sklearn.utils import shuffle
from utils import load_sample
tf.compat.v1.disable_v2_behavior()
def get_batches(image, label, resize_w, resize_h, channels, batch_size):
queue = tf.compat.v1.train.slice_input_producer([image,... | [
"tensorflow.image.resize_with_crop_or_pad",
"matplotlib.pyplot.subplot",
"tensorflow.train.Coordinator",
"matplotlib.pyplot.show",
"tensorflow.compat.v1.train.slice_input_producer",
"matplotlib.pyplot.axis",
"tensorflow.cast",
"matplotlib.pyplot.figure",
"tensorflow.compat.v1.Session",
"utils.load... | [((152, 186), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.compat.v1.disable_v2_behavior', ([], {}), '()\n', (184, 186), True, 'import tensorflow as tf\n'), ((273, 328), 'tensorflow.compat.v1.train.slice_input_producer', 'tf.compat.v1.train.slice_input_producer', (['[image, label]'], {}), '([image, label])\n', (312,... |
import numpy as np
import scipy.interpolate as interp
import cffi, glob, os
fastcorr_dir = os.path.dirname(__file__)
include_dir = os.path.join(fastcorr_dir,'include')
lib_file = os.path.join(fastcorr_dir,'_fastcorr.so')
# Some installation (e.g. Travis with python 3.x)
# name this e.g. _fastcorr.cpython-34m.so,
# so ... | [
"numpy.zeros_like",
"numpy.log",
"cffi.FFI",
"numpy.asarray",
"os.path.dirname",
"os.path.exists",
"numpy.min",
"numpy.max",
"numpy.squeeze",
"os.path.join"
] | [((92, 117), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (107, 117), False, 'import cffi, glob, os\n'), ((132, 169), 'os.path.join', 'os.path.join', (['fastcorr_dir', '"""include"""'], {}), "(fastcorr_dir, 'include')\n", (144, 169), False, 'import cffi, glob, os\n'), ((180, 222), 'os.path.... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 4 04:05:02 2018
@author: Kezhong
"""
from torch import nn
import torch
import torch as t
from torch.nn import functional as F
from torch.utils.data import DataLoader
# import torchvision as tv
# import torchvision.transforms as transforms
# from torch.utils import data
#... | [
"loader.trainingmyImageFloder",
"torch.nn.ReLU",
"torch.utils.data.DataLoader",
"torch.nn.Sequential",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.nn.CrossEntropyLoss",
"torch.randn",
"numpy.transpose",
"torch.empty",
"loader.testmyImageFloder",
"torch.nn.Linear",
"torch.nn.B... | [((3149, 3191), 'torchvision.models.resnet34', 'torchvision.models.resnet34', ([], {'num_classes': '(2)'}), '(num_classes=2)\n', (3176, 3191), False, 'import torchvision\n'), ((3282, 3303), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (3301, 3303), False, 'from torch import nn\n'), ((3400, 3437... |
"""HEARSAY.
This module contains tools to compute and analyze numerical simulations of
a Galaxy with constrained causally connected nodes. It simulates a 2D
simplified version of a disk galaxy and perform discrete event simulations
to explore three parameters:
1. the mean time for the appeareance of new nodes,
2. the ... | [
"sys.stdout.write",
"numpy.random.seed",
"hearsay.olists.OrderedList",
"pandas.read_csv",
"numpy.random.exponential",
"os.path.isfile",
"numpy.sin",
"sys.stdout.flush",
"scipy.spatial.cKDTree",
"pandas.DataFrame",
"numpy.transpose",
"random.seed",
"numpy.linspace",
"itertools.product",
"... | [((4576, 4601), 'collections.namedtuple', 'namedtuple', (['"""pars"""', 'names'], {}), "('pars', names)\n", (4586, 4601), False, 'from collections import namedtuple\n'), ((8838, 8863), 'collections.namedtuple', 'namedtuple', (['"""pars"""', 'names'], {}), "('pars', names)\n", (8848, 8863), False, 'from collections impo... |
import numpy as np
class LinProgBaseClass():
# Consider standard form:
# min c'x
# s.t. Ax = b, x>=0
def __init__(self, A, b, c, x, trace=False):
(m, n) = A.shape
# Input shape check:
if A.shape != (b.shape[0], c.shape[0]):
raise RuntimeError("Input shape incorrect!... | [
"numpy.empty",
"numpy.allclose",
"numpy.zeros",
"numpy.eye",
"numpy.greater_equal",
"numpy.concatenate"
] | [((977, 986), 'numpy.eye', 'np.eye', (['m'], {}), '(m)\n', (983, 986), True, 'import numpy as np\n'), ((995, 1042), 'numpy.concatenate', 'np.concatenate', (['(A_origin, A_auxiliary)'], {'axis': '(1)'}), '((A_origin, A_auxiliary), axis=1)\n', (1009, 1042), True, 'import numpy as np\n'), ((1093, 1140), 'numpy.concatenate... |
import numpy as np
import threading
import queue
import imageio
import os,time
import math
import visual_words
import multiprocessing as mp
def build_recognition_system(num_workers=2):
'''
Creates a trained recognition system by generating training features from all training images.
[input]
* num_wo... | [
"numpy.load",
"numpy.minimum",
"numpy.sum",
"visual_words.get_visual_words",
"numpy.argmax",
"numpy.asarray",
"imageio.imread",
"numpy.zeros",
"numpy.histogram",
"numpy.linalg.norm",
"numpy.arange",
"multiprocessing.Pool",
"numpy.diag",
"numpy.savez",
"numpy.unique"
] | [((583, 616), 'numpy.load', 'np.load', (['"""../data/train_data.npz"""'], {}), "('../data/train_data.npz')\n", (590, 616), True, 'import numpy as np\n'), ((632, 668), 'numpy.load', 'np.load', (['"""../outputs/dictionary.npy"""'], {}), "('../outputs/dictionary.npy')\n", (639, 668), True, 'import numpy as np\n'), ((800, ... |
import numpy as np
import cifParsing as cPrs
import matrices_new as mat
from anytree import NodeMixin
# from itertools import combinations as combinations
# from bisect import bisect_right
def check_symmetries_in_cell(cell, matrices=mat.all_matrices):
# def func(cell: numpy2d_array(float),
# matrices: numpy3d... | [
"numpy.full",
"cifParsing.get_super_cell3",
"numpy.ma.masked_where",
"numpy.arange",
"numpy.array",
"numpy.array_equal",
"numpy.unique"
] | [((2215, 2257), 'cifParsing.get_super_cell3', 'cPrs.get_super_cell3', (['self.file', 'self.size'], {}), '(self.file, self.size)\n', (2235, 2257), True, 'import cifParsing as cPrs\n'), ((2286, 2315), 'numpy.arange', 'np.arange', (['self.cell.shape[0]'], {}), '(self.cell.shape[0])\n', (2295, 2315), True, 'import numpy as... |
import os
from math import sqrt
import pytest
import numpy as np
from dotenv import load_dotenv
from wce.data_preprocessing.feature_extraction import FeatureExtraction
from wce.data_preprocessing.batch import Batch
from wce.envelope_estimation.envelope_estimator import EnvelopeEstimator
from wce.word_count_estimation.... | [
"wce.data_preprocessing.feature_extraction.FeatureExtraction",
"wce.envelope_estimation.envelope_estimator.EnvelopeEstimator",
"wce.word_count_estimation.word_count_estimator.WordCountEstimator",
"dotenv.load_dotenv",
"wce.data_preprocessing.batch.Batch",
"numpy.where",
"numpy.array",
"numpy.mean",
... | [((369, 390), 'dotenv.load_dotenv', 'load_dotenv', (['"""./.env"""'], {}), "('./.env')\n", (380, 390), False, 'from dotenv import load_dotenv\n'), ((402, 426), 'os.getenv', 'os.getenv', (['"""DEFAULT_ENV"""'], {}), "('DEFAULT_ENV')\n", (411, 426), False, 'import os\n'), ((446, 470), 'os.getenv', 'os.getenv', (['"""DEFA... |
import numpy as np
from scipy.sparse import csr_matrix
foo=np.array([[1,2,3],[4,5,6]])
print(foo)
# Sparse
foo_sparse=csr_matrix(foo)
print(foo_sparse)
# Info
print("Sparse Size: ", foo_sparse.size)
print("Sprase Shape: ", foo_sparse.shape)
print("Number of sparse dimensions: ", foo_sparse.ndim)
| [
"scipy.sparse.csr_matrix",
"numpy.array"
] | [((60, 92), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6]]'], {}), '([[1, 2, 3], [4, 5, 6]])\n', (68, 92), True, 'import numpy as np\n'), ((120, 135), 'scipy.sparse.csr_matrix', 'csr_matrix', (['foo'], {}), '(foo)\n', (130, 135), False, 'from scipy.sparse import csr_matrix\n')] |
"""
Tests for k-prototypes clustering algorithm
"""
import pickle
import unittest
import numpy as np
from kmodes import kprototypes
from kmodes.tests.test_kmodes import assert_cluster_splits_equal
from kmodes.util.dissim import ng_dissim
STOCKS = np.array([
[738.5, 'tech', 'USA'],
[369.5, 'nrg', 'USA'],
... | [
"pickle.loads",
"numpy.dtype",
"numpy.zeros",
"numpy.array",
"kmodes.tests.test_kmodes.assert_cluster_splits_equal",
"kmodes.kprototypes.KPrototypes",
"pickle.dumps"
] | [((251, 557), 'numpy.array', 'np.array', (["[[738.5, 'tech', 'USA'], [369.5, 'nrg', 'USA'], [368.2, 'tech', 'USA'], [\n 346.7, 'tech', 'USA'], [343.5, 'fin', 'USA'], [282.4, 'fin', 'USA'], [\n 282.1, 'tel', 'CN'], [279.7, 'cons', 'USA'], [257.2, 'cons', 'USA'], [\n 205.2, 'tel', 'USA'], [192.1, 'tech', 'USA'],... |
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import numpy as np
#####################
# Generate data
#####################
np.random.seed(0)
seq_len = 20
noise = 1
coeffs = np.random.randn(seq_len)
num_datapoints = 2000
data_x = np.random.randn(num_datapoints + seq_len)
data_X = np.reshape([da... | [
"torch.nn.MSELoss",
"numpy.random.seed",
"matplotlib.pyplot.show",
"numpy.random.randn",
"matplotlib.pyplot.legend",
"numpy.zeros",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.zeros",
"numpy.dot",
"matplotlib.pyplot.semilogy",
"torch.nn.LSTM",
"torch.from_numpy"
] | [((147, 164), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (161, 164), True, 'import numpy as np\n'), ((198, 222), 'numpy.random.randn', 'np.random.randn', (['seq_len'], {}), '(seq_len)\n', (213, 222), True, 'import numpy as np\n'), ((255, 296), 'numpy.random.randn', 'np.random.randn', (['(num_datapoi... |
import gym
import torch
import torch.multiprocessing as mp
import numpy as np
from model import LocalModel
from memory import Memory
from config import env_name, n_step, max_episode, log_interval
class Worker(mp.Process):
def __init__(self, global_model, global_optimizer, global_ep, global_ep_r, res_queue, name):
... | [
"gym.make",
"model.LocalModel",
"torch.Tensor",
"numpy.random.choice",
"torch.zeros",
"memory.Memory"
] | [((379, 397), 'gym.make', 'gym.make', (['env_name'], {}), '(env_name)\n', (387, 397), False, 'import gym\n'), ((661, 733), 'model.LocalModel', 'LocalModel', (['self.env.observation_space.shape[0]', 'self.env.action_space.n'], {}), '(self.env.observation_space.shape[0], self.env.action_space.n)\n', (671, 733), False, 'f... |
import os
import spacy
from spacy.lang.en import English
import networkx as nx
import matplotlib.pyplot as plt
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
import numpy as np
import sys,os
sys.path.appe... | [
"os.makedirs",
"time.time",
"spacy.load",
"spacy.lang.en.English",
"numpy.array",
"nltk.pos_tag",
"operator.itemgetter",
"os.path.join",
"nltk.word_tokenize",
"nltk.tokenize.word_tokenize"
] | [((493, 516), 'nltk.tokenize.word_tokenize', 'word_tokenize', (['strInput'], {}), '(strInput)\n', (506, 516), False, 'from nltk.tokenize import word_tokenize\n'), ((640, 662), 'nltk.tokenize.word_tokenize', 'word_tokenize', (['strTemp'], {}), '(strTemp)\n', (653, 662), False, 'from nltk.tokenize import word_tokenize\n'... |
#!/usr/bin/env python
import os
import sys
import argparse
from data_tools.lib.files import findNumber,ParameterParser
from data_tools.lib.group import Group,run_grouping
from decimal import Decimal
from numpy import convolve as np_convolve
class ConvolveGroup(Group):
def __init__(self, tup):
super(Convol... | [
"decimal.Decimal",
"data_tools.lib.files.ParameterParser",
"data_tools.lib.files.findNumber",
"data_tools.lib.group.run_grouping",
"numpy.convolve"
] | [((1028, 1107), 'data_tools.lib.files.ParameterParser', 'ParameterParser', (['"""Convolve on a column"""'], {'columns': '(1)', 'labels': '[None]', 'append': '(False)'}), "('Convolve on a column', columns=1, labels=[None], append=False)\n", (1043, 1107), False, 'from data_tools.lib.files import findNumber, ParameterPars... |
"""Various utilities."""
import os
import csv
import torch
import random
import numpy as np
import socket
import datetime
def system_startup(args=None, defs=None):
"""Print useful system information."""
# Choose GPU device and print status information:
device = torch.device('cuda:0') if torch.cuda.is_a... | [
"numpy.random.seed",
"csv.reader",
"numpy.ones",
"numpy.clip",
"torch.cuda.device_count",
"numpy.random.randint",
"torch.device",
"os.path.join",
"csv.DictWriter",
"socket.gethostname",
"random.seed",
"datetime.datetime.now",
"torch.cuda.get_device_name",
"torch.manual_seed",
"torch.cuda... | [((783, 808), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (806, 808), False, 'import torch\n'), ((1109, 1151), 'os.path.join', 'os.path.join', (['out_dir', 'f"""table_{name}.csv"""'], {}), "(out_dir, f'table_{name}.csv')\n", (1121, 1151), False, 'import os\n'), ((2039, 2066), 'torch.manual_s... |
import matplotlib.pyplot as plt, numpy as np, os
data_file = 'search_compare_data.txt'
if not os.path.exists(data_file):
exit()
data = np.loadtxt(data_file, delimiter=',', skiprows=1)
# Get columns
astar_path_costs = data[:,1]
gbfs_path_costs = data[:,2]
best_distances = data[:,0]
# First figure, A* best_distance x... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"os.path.exists",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((137, 185), 'numpy.loadtxt', 'np.loadtxt', (['data_file'], {'delimiter': '""","""', 'skiprows': '(1)'}), "(data_file, delimiter=',', skiprows=1)\n", (147, 185), True, 'import matplotlib.pyplot as plt, numpy as np, os\n'), ((337, 350), 'matplotlib.pyplot.figure', 'plt.figure', (['(0)'], {}), '(0)\n', (347, 350), True,... |
import pandas as pd
from assignment1 import exp_runner
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier
from sklearn.tree import export_graphviz
from sklearn import tree
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
import ... | [
"pandas.DataFrame",
"sklearn.datasets.load_iris",
"assignment1.exp_runner.get_insurance_train_test_data",
"sklearn.tree.DecisionTreeRegressor",
"sklearn.model_selection.train_test_split",
"timeit.default_timer",
"sklearn.model_selection.cross_val_score",
"sklearn.tree.DecisionTreeClassifier",
"numpy... | [((482, 493), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (491, 493), False, 'from sklearn.datasets import load_iris\n'), ((506, 566), 'pandas.DataFrame', 'pd.DataFrame', (['iris.data[:, :]'], {'columns': 'iris.feature_names[:]'}), '(iris.data[:, :], columns=iris.feature_names[:])\n', (518, 566), True,... |
import torch
import numpy as np
import anomalytransfer as at
from typing import Sequence, Dict, Tuple, Optional
from sklearn.metrics import precision_recall_curve, precision_recall_fscore_support
def adjust_scores(labels: np.ndarray,
scores: np.ndarray,
delay: Optional[int] = No... | [
"traceback.print_exc",
"numpy.maximum",
"numpy.copy",
"numpy.argmax",
"numpy.clip",
"sklearn.metrics.precision_recall_curve",
"numpy.shape",
"numpy.max",
"torch.set_num_threads",
"numpy.where",
"anomalytransfer.transfer.SPOT",
"sklearn.metrics.precision_recall_fscore_support"
] | [((1583, 1655), 'sklearn.metrics.precision_recall_curve', 'precision_recall_curve', ([], {'y_true': 'labels', 'probas_pred': 'scores', 'pos_label': '(1.0)'}), '(y_true=labels, probas_pred=scores, pos_label=1.0)\n', (1605, 1655), False, 'from sklearn.metrics import precision_recall_curve, precision_recall_fscore_support... |
import numpy as np
from scipy.linalg import det
#import mayavi.mlab as mlab
from .quaternion import Quaternion
from .rot3 import Rot3
# original file in python_modules/js/geometry/rotations.py
def plotCosy(fig,R,t,scale,name='',col=None):
pts = np.zeros((3,6))
for i in range(0,3):
pts[:,i*2] = np.zeros(3)
... | [
"numpy.array",
"numpy.zeros",
"numpy.linspace"
] | [((248, 264), 'numpy.zeros', 'np.zeros', (['(3, 6)'], {}), '((3, 6))\n', (256, 264), True, 'import numpy as np\n'), ((1358, 1479), 'numpy.array', 'np.array', (['[[0.0, -x[0], -x[1], -x[2]], [x[0], 0.0, x[2], -x[1]], [x[1], -x[2], 0.0, x\n [0]], [x[2], x[1], -x[0], 0.0]]'], {}), '([[0.0, -x[0], -x[1], -x[2]], [x[0], ... |
from xml.etree.ElementTree import parse
from os import listdir
from os.path import join, isfile, exists, splitext
import numpy as np
#from openslide import OpenSlide
import collections
def make_list_of_contour_from_xml(fn_xml,downsample):
"""
make the list of contour from xml(annotation file)
... | [
"xml.etree.ElementTree.parse",
"numpy.zeros",
"numpy.array",
"pdb.set_trace",
"numpy.unique"
] | [((612, 625), 'xml.etree.ElementTree.parse', 'parse', (['fn_xml'], {}), '(fn_xml)\n', (617, 625), False, 'from xml.etree.ElementTree import parse\n'), ((3474, 3508), 'numpy.zeros', 'np.zeros', (['(slid_lev_h, slid_lev_w)'], {}), '((slid_lev_h, slid_lev_w))\n', (3482, 3508), True, 'import numpy as np\n'), ((1838, 1876),... |
import sys, time, os
import numpy as np
#sys.path.append(os.path.join(os.path.dirname(__file__), '../../examples/gen_funcs'))
import libensemble.gen_funcs.aposmm as al
#sys.path.append(os.path.join(os.path.dirname(__file__), '../../src'))
import libensemble.tests.unit_tests.setup as setup
n = 2
#alloc = {'out':[]}
... | [
"numpy.random.uniform",
"libensemble.gen_funcs.aposmm.advance_localopt_method",
"numpy.zeros",
"numpy.isinf",
"libensemble.gen_funcs.aposmm.calc_rk",
"libensemble.gen_funcs.aposmm.queue_update_function",
"libensemble.gen_funcs.aposmm.initialize_APOSMM",
"numpy.arange",
"libensemble.tests.unit_tests.... | [((959, 978), 'libensemble.tests.unit_tests.setup.hist_setup1', 'setup.hist_setup1', ([], {}), '()\n', (976, 978), True, 'import libensemble.tests.unit_tests.setup as setup\n'), ((1368, 1387), 'libensemble.tests.unit_tests.setup.hist_setup1', 'setup.hist_setup1', ([], {}), '()\n', (1385, 1387), True, 'import libensembl... |
import numpy as np
import math
##These functions relate to the initiation of the code and mesh
##building.
def StaggeredSpatialMesh(N):
#This function creates a pair of staggered mesh of [-1,1]
#It takes the number of subpartitions and returns the
#two grids alongside with the mesh size dx.
if N == in... | [
"math.exp",
"numpy.array",
"math.cos",
"math.sin"
] | [((1020, 1050), 'numpy.array', 'np.array', (['[(0) for x in xplus]'], {}), '([(0) for x in xplus])\n', (1028, 1050), True, 'import numpy as np\n'), ((675, 696), 'math.sin', 'math.sin', (['(math.pi * x)'], {}), '(math.pi * x)\n', (683, 696), False, 'import math\n'), ((866, 887), 'math.cos', 'math.cos', (['(math.pi * x)'... |
####################################################
####################################################
####### #######
####### Patches Labeling System #######
####### #######
####################################################
##... | [
"numpy.load",
"matplotlib.pyplot.show",
"random.randint",
"matplotlib.pyplot.close",
"os.path.exists",
"matplotlib.pyplot.subplots",
"pathlib.Path",
"numpy.array",
"matplotlib.pyplot.imread",
"os.path.join",
"os.listdir",
"cv2.resize"
] | [((749, 777), 'os.path.exists', 'os.path.exists', (['input_folder'], {}), '(input_folder)\n', (763, 777), False, 'import os\n'), ((864, 894), 'os.path.exists', 'os.path.exists', (['outputs_folder'], {}), '(outputs_folder)\n', (878, 894), False, 'import os\n'), ((1063, 1092), 'os.path.join', 'os.path.join', (['input_fol... |
import pandas as pd
import numpy as np
import scipy
import os, sys
import matplotlib.pyplot as plt
import pylab
import matplotlib as mpl
import seaborn as sns
sys.path.append("../utils/")
from utils import *
from stats import *
from parse import *
#in_dirs = {'data':'../../processed/','social':'../../simulations/','... | [
"sys.path.append",
"pandas.DataFrame",
"pandas.io.parsers.read_csv",
"seaborn.despine",
"numpy.mean",
"matplotlib.pyplot.gcf",
"seaborn.set",
"os.listdir"
] | [((161, 189), 'sys.path.append', 'sys.path.append', (['"""../utils/"""'], {}), "('../utils/')\n", (176, 189), False, 'import os, sys\n'), ((1094, 1159), 'pandas.DataFrame', 'pd.DataFrame', (["{'model': models, 'n_players': ns, 'score': scores}"], {}), "({'model': models, 'n_players': ns, 'score': scores})\n", (1106, 11... |
from pathlib import Path
import shutil
import tempfile
from helpers.example_store import ExampleStore
from helpers.sqlite3_container import Sqlite3Container
import numpy as np
from precisely import assert_that, equal_to
from pytest import fail
from tanuki.data_store.index.database_index import DatabaseIndex
from tanu... | [
"helpers.example_store.ExampleStore.link",
"tanuki.data_store.index.pandas_index.PIndex",
"tanuki.database.sqlite3_database.Sqlite3Database",
"tanuki.data_store.index.pandas_index.PandasIndex",
"helpers.example_store.ExampleStore",
"helpers.sqlite3_container.Sqlite3Container",
"tanuki.data_store.index.d... | [((722, 750), 'helpers.sqlite3_container.Sqlite3Container', 'Sqlite3Container', (['tmp_db_dir'], {}), '(tmp_db_dir)\n', (738, 750), False, 'from helpers.sqlite3_container import Sqlite3Container\n'), ((895, 962), 'helpers.example_store.ExampleStore', 'ExampleStore', ([], {'a': "['a', 'b', 'c']", 'b': '[1, 2, 3]', 'c': ... |
"""Reconstruct current density distribution of Maryland multigate device.
Device ID: JS311_2HB-2JJ-5MGJJ-MD-001_MG2.
Scan ID: JS311-BHENL001-2JJ-2HB-5MGJJ-MG2-060.
Fridge: vector9
This scan contains Fraunhofer data for a linear multigate -1-2-3-4-5-
Gates 1 and 5 are grounded; gates 2 and 4 are shorted.
Both Vg3 and ... | [
"matplotlib.pyplot.get_cmap",
"shabanipy.labber.get_data_dir",
"numpy.empty",
"shabanipy.labber.LabberData",
"matplotlib.pyplot.close",
"numpy.transpose",
"pathlib.Path",
"numpy.tile",
"shabanipy.jj.fraunhofer.utils.find_fraunhofer_center",
"shabanipy.jj.fraunhofer.utils.symmetrize_fraunhofer",
... | [((798, 812), 'shabanipy.labber.get_data_dir', 'get_data_dir', ([], {}), '()\n', (810, 812), False, 'from shabanipy.labber import LabberData, get_data_dir\n'), ((3358, 3399), 'numpy.empty', 'np.empty', ([], {'shape': '(ic.shape[:-1] + (POINTS,))'}), '(shape=ic.shape[:-1] + (POINTS,))\n', (3366, 3399), True, 'import num... |
import numpy as np
# from scipy.optimize import minimize, Bounds
class SVM(object):
def __init__(self, num_input, sigma):
self.num_input = num_input
self.sigma = sigma
self.num_sample = 0
self.core = lambda x1, x2: np.exp(-np.linalg.norm(x1 - x2) / (2 * self.sigma ** 2))
... | [
"numpy.linalg.norm",
"numpy.linalg.inv",
"numpy.zeros",
"numpy.ones"
] | [((1268, 1312), 'numpy.zeros', 'np.zeros', (['[self.num_sample, self.num_sample]'], {}), '([self.num_sample, self.num_sample])\n', (1276, 1312), True, 'import numpy as np\n'), ((1682, 1708), 'numpy.linalg.inv', 'np.linalg.inv', (['core_matrix'], {}), '(core_matrix)\n', (1695, 1708), True, 'import numpy as np\n'), ((172... |
import os
import cv2
import numpy as np
import pandas as pd
from picamera.array import PiRGBArray
from picamera import PiCamera
import tensorflow as tf
import argparse
import sys
import time
import csv
######## BOILERPLATE CODE #######
# Set up camera constants
#IM_WIDTH = 1280
#IM_HEIGHT = 720
IM_WIDT... | [
"argparse.ArgumentParser",
"time.ctime",
"picamera.array.PiRGBArray",
"os.path.join",
"sys.path.append",
"numpy.copy",
"cv2.getTickFrequency",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.GraphDef",
"cv2.destroyAllWindows",
"object_detection.utils.label_map_util.load_labelmap",
"picam... | [((546, 571), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (569, 571), False, 'import argparse\n'), ((843, 864), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (858, 864), False, 'import sys\n'), ((1192, 1203), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1201, 1203), F... |
import os
import numpy as np
from barkgram import *
from Sample import Sample
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pyrubberband as pyrb
# Data Augmentation Functions
def pitch_shift(data, sampling_rate, pitch_semitones):
return pyrb.pitch_shift(data, sampling_rat... | [
"numpy.random.uniform",
"numpy.save",
"pyrubberband.pitch_shift",
"pyrubberband.time_stretch",
"os.walk",
"numpy.zeros",
"numpy.expand_dims",
"matplotlib.use",
"numpy.array",
"numpy.random.randint",
"Sample.Sample",
"os.path.join"
] | [((98, 119), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (112, 119), False, 'import matplotlib\n'), ((889, 908), 'os.walk', 'os.walk', (['path_audio'], {}), '(path_audio)\n', (896, 908), False, 'import os\n'), ((3047, 3082), 'numpy.zeros', 'np.zeros', (['(1, num_spec, num_frames)'], {}), '((1,... |
import cv2
import numpy as np
from matplotlib import pyplot as plt
import argparse
import glob
import os
from PIL import Image
import matplotlib.pyplot as plt
from astropy.visualization import (MinMaxInterval, SqrtStretch,
ImageNormalize)
kernel = np.ones((5,5),np.float3... | [
"cv2.boundingRect",
"cv2.Canny",
"cv2.HoughCircles",
"os.path.abspath",
"argparse.ArgumentParser",
"cv2.bitwise_and",
"os.path.basename",
"cv2.waitKey",
"cv2.circle",
"cv2.threshold",
"numpy.zeros",
"numpy.ones",
"cv2.imshow",
"cv2.imread",
"numpy.array",
"cv2.destroyAllWindows",
"cv... | [((380, 439), 'numpy.array', 'np.array', (['[[0, -1, 0], [-1, 5, -1], [0, -1, 0]]', 'np.float32'], {}), '([[0, -1, 0], [-1, 5, -1], [0, -1, 0]], np.float32)\n', (388, 439), True, 'import numpy as np\n'), ((468, 493), 'numpy.ones', 'np.ones', (['(5, 5)', 'np.uint8'], {}), '((5, 5), np.uint8)\n', (475, 493), True, 'impor... |
import logging
import sys
from ConfigParser import ConfigParser
from calendar import monthrange
from datetime import datetime
from glob import glob
from itertools import combinations
from os.path import join, basename, splitext, dirname
import numpy as np
import pandas as pd
from scipy.interpolate import griddata
fro... | [
"logging.exception",
"numpy.zeros_like",
"numpy.sum",
"scipy.interpolate.griddata",
"os.path.basename",
"pandas.read_csv",
"numpy.ma.masked_where",
"os.path.dirname",
"numpy.unique",
"itertools.combinations",
"logging.info",
"numpy.where",
"numpy.array",
"calendar.monthrange",
"ConfigPar... | [((503, 545), 'logging.info', 'logging.info', (['"""Start parsing weather data"""'], {}), "('Start parsing weather data')\n", (515, 545), False, 'import logging\n'), ((559, 573), 'ConfigParser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (571, 573), False, 'from ConfigParser import ConfigParser\n'), ((911, 949), 'o... |
import numpy as np
import scipy.stats
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from sklearn.utils.validation import check_is_fitted, check_X_y
class ClassifierOptimization(BaseEstimator, ClassifierMixin):
"""
Fit own approach into s... | [
"sklearn.utils.validation.check_X_y",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.preprocessing.StandardScaler",
"numpy.copy"
] | [((956, 980), 'sklearn.utils.validation.check_X_y', 'check_X_y', (['data', 'targets'], {}), '(data, targets)\n', (965, 980), False, 'from sklearn.utils.validation import check_is_fitted, check_X_y\n'), ((1001, 1014), 'numpy.copy', 'np.copy', (['data'], {}), '(data)\n', (1008, 1014), True, 'import numpy as np\n'), ((103... |
from __future__ import division
import torch
import numpy as np
from .look import look
def vis(vertices):
import open3d as o3d
pcd = o3d.geometry.PointCloud()
points = vertices[0, :, :3].detach().cpu().numpy()
pcd.points = o3d.utility.Vector3dVector(points)
viewer = o3d.visualization.Visualizer(... | [
"torch.ones_like",
"open3d.visualization.Visualizer",
"torch.stack",
"torch.sqrt",
"numpy.asarray",
"open3d.geometry.PointCloud",
"open3d.utility.Vector3dVector"
] | [((144, 169), 'open3d.geometry.PointCloud', 'o3d.geometry.PointCloud', ([], {}), '()\n', (167, 169), True, 'import open3d as o3d\n'), ((242, 276), 'open3d.utility.Vector3dVector', 'o3d.utility.Vector3dVector', (['points'], {}), '(points)\n', (268, 276), True, 'import open3d as o3d\n'), ((291, 321), 'open3d.visualizatio... |
import logging
import os
import cv2 as cv
import numpy as np
import sys
import getopt
from glob import glob
from stereoids import mkdir_p
def splitfn(fn):
path, fn = os.path.split(fn)
name, ext = os.path.splitext(fn)
return path, name, ext
class Calibrator:
def __init__(self, pattern_size=(7, 6),... | [
"getopt.getopt",
"cv2.stereoRectify",
"logging.getLogger",
"cv2.remap",
"stereoids.mkdir_p",
"glob.glob",
"cv2.imshow",
"os.path.join",
"numpy.prod",
"cv2.cvtColor",
"cv2.imwrite",
"numpy.savetxt",
"cv2.destroyAllWindows",
"cv2.calibrationMatrixValues",
"numpy.save",
"cv2.waitKey",
"... | [((175, 192), 'os.path.split', 'os.path.split', (['fn'], {}), '(fn)\n', (188, 192), False, 'import os\n'), ((209, 229), 'os.path.splitext', 'os.path.splitext', (['fn'], {}), '(fn)\n', (225, 229), False, 'import os\n'), ((7494, 7565), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '""""""', "['debug=', 'square_size... |
# -*- coding: utf-8 -*-
## @package ivf.core.sparse_interpolation.bilateral_smoothing
#
# ivf.core.sparse_interpolation.bilateral_smoothing utility package.
# @author tody
# @date 2016/02/03
import numpy as np
from sklearn.utils import shuffle
from ivf.core.image_features.image_features import positi... | [
"scipy.interpolate.rbf.Rbf",
"numpy.float32",
"ivf.cv.image.to8U",
"numpy.array",
"ivf.core.image_features.image_features.foreGroundFeatures",
"ivf.core.image_features.image_features.LabFeatures",
"ivf.core.image_features.image_features.positionFeatures",
"sklearn.utils.shuffle",
"ivf.cv.image.alpha... | [((564, 582), 'ivf.core.image_features.image_features.LabFeatures', 'LabFeatures', (['image'], {}), '(image)\n', (575, 582), False, 'from ivf.core.image_features.image_features import positionFeatures, LabFeatures, foreGroundFeatures\n'), ((600, 625), 'ivf.core.image_features.image_features.foreGroundFeatures', 'foreGr... |
import numpy as np
def delta_vector(P, Q):
'''
create a vector with a 1 corresponding to the 0th order
#input P = 2*(num_ord_specified)+1
'''
fourier_grid = np.zeros((P,Q))
fourier_grid[int(P/2), int(Q/2)] = 1;
# vector = np.zeros((P*Q,));
#
# #the index of the (0,0) element... | [
"numpy.matrix",
"numpy.cross",
"numpy.zeros",
"numpy.hstack",
"numpy.array",
"numpy.linalg.norm"
] | [((186, 202), 'numpy.zeros', 'np.zeros', (['(P, Q)'], {}), '((P, Q))\n', (194, 202), True, 'import numpy as np\n'), ((608, 622), 'numpy.zeros', 'np.zeros', (['(P,)'], {}), '((P,))\n', (616, 622), True, 'import numpy as np\n'), ((2046, 2080), 'numpy.cross', 'np.cross', (['ate_vector', 'K_inc_vector'], {}), '(ate_vector,... |
import numpy as np
import pandas as pd
import sklearn.neighbors as neg
import data_utils as ut
np.random.seed(777)
def unpickle(file):
import pickle
with open(file, 'rb') as fo:
dict1 = pickle.load(fo, encoding='bytes')
return dict1
Xtr, Ytr, Xte, Yte = ut.load_CIFAR10('e:/CS231n/data/')
Xtr_row... | [
"data_utils.load_CIFAR10",
"numpy.random.seed",
"numpy.abs",
"numpy.square",
"numpy.zeros",
"numpy.argmin",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.mean",
"pickle.load"
] | [((96, 115), 'numpy.random.seed', 'np.random.seed', (['(777)'], {}), '(777)\n', (110, 115), True, 'import numpy as np\n'), ((278, 312), 'data_utils.load_CIFAR10', 'ut.load_CIFAR10', (['"""e:/CS231n/data/"""'], {}), "('e:/CS231n/data/')\n", (293, 312), True, 'import data_utils as ut\n'), ((506, 570), 'sklearn.neighbors.... |
"""
Plot results
Author(s): <NAME> (<EMAIL>)
"""
import os
import sys
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import pandas as pd
import datasets
import functions
from models import GAN
from run_experiment import read_config
from visualization import plot_data... | [
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.linalg.norm",
"matplotlib.pyplot.tight_layout",
"sys.path.append",
"pandas.DataFrame",
"numpy.std",
"matplotlib.pyplot.close",
"os.path.exists",
"matplotlib.pyplot.rcParams.update",
"evaluation.overall_... | [((110, 131), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (124, 131), False, 'import matplotlib\n'), ((336, 357), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (351, 357), False, 'import sys\n'), ((1300, 1338), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update',... |
from datetime import datetime
from unittest import mock
import numpy as np
import pytest
import astropy.units as u
import sunpy
from sunpy.net import Fido
from sunpy.net import attrs as a
from radiospectra.net.sources.wind import WAVESClient
MOCK_PATH = "sunpy.net.scraper.urlopen" if sunpy.__version__ >= "3.1.0" el... | [
"sunpy.net.attrs.Instrument",
"unittest.mock.MagicMock",
"radiospectra.net.sources.wind.WAVESClient",
"datetime.datetime",
"unittest.mock.patch",
"sunpy.net.attrs.Time",
"numpy.array_equal",
"sunpy.net.attrs.Wavelength"
] | [((3313, 3334), 'unittest.mock.patch', 'mock.patch', (['MOCK_PATH'], {}), '(MOCK_PATH)\n', (3323, 3334), False, 'from unittest import mock\n'), ((395, 408), 'radiospectra.net.sources.wind.WAVESClient', 'WAVESClient', ([], {}), '()\n', (406, 408), False, 'from radiospectra.net.sources.wind import WAVESClient\n'), ((463,... |
import pandas as pd
import numpy as np
start = pd.Timestamp.utcnow()
end = start + pd.DateOffset(days=30)
TOTAL_SAMPLES = 10000
t = pd.to_datetime(np.linspace(start.value, end.value, TOTAL_SAMPLES))
# build the DataFrame
df = pd.DataFrame()
df['ts_seed'] = t
df['ts_seed'] = df.ts_seed.astype('datetime64[ms]')
df['ts_... | [
"pandas.DataFrame",
"pandas.Timestamp.utcnow",
"numpy.random.randint",
"numpy.linspace",
"numpy.random.normal",
"pandas.DateOffset"
] | [((48, 69), 'pandas.Timestamp.utcnow', 'pd.Timestamp.utcnow', ([], {}), '()\n', (67, 69), True, 'import pandas as pd\n'), ((228, 242), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (240, 242), True, 'import pandas as pd\n'), ((84, 106), 'pandas.DateOffset', 'pd.DateOffset', ([], {'days': '(30)'}), '(days=30)\n'... |
import numpy as np
import cv2
import time
from Stimulator import Customer, mx
from a_star import find_path, Node
import random
NEW_CUSTOMERS_PER_MINUTE = 0.02 # lambda of poisson distribution
SIMULATE_MINUTES = 15*60 # one day
POSSIBLE_MOVES = [(0,1),(0,-1),(1,0),(-1,0)]
TILE_SIZE = 32
OFS = 50
MARKET = """
######... | [
"random.randint",
"a_star.find_path",
"cv2.waitKey",
"cv2.imwrite",
"numpy.zeros",
"cv2.imshow",
"time.sleep",
"cv2.imread",
"numpy.array",
"numpy.random.poisson",
"cv2.destroyAllWindows",
"Stimulator.Customer"
] | [((6414, 6447), 'numpy.zeros', 'np.zeros', (['(500, 700, 3)', 'np.uint8'], {}), '((500, 700, 3), np.uint8)\n', (6422, 6447), True, 'import numpy as np\n'), ((6460, 6483), 'cv2.imread', 'cv2.imread', (['"""tiles.png"""'], {}), "('tiles.png')\n", (6470, 6483), False, 'import cv2\n'), ((7076, 7099), 'cv2.destroyAllWindows... |
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
# This software is licensed to you under the Universal Permissive License (UPL) 1.0 as shown at
# https://oss.oracle.com/licenses/upl
import numpy as np
from macest.model_selection import KFoldConfidenceSplit
def test_kfold_init():
kfold =... | [
"macest.model_selection.KFoldConfidenceSplit",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_",
"numpy.arange",
"numpy.concatenate"
] | [((321, 343), 'macest.model_selection.KFoldConfidenceSplit', 'KFoldConfidenceSplit', ([], {}), '()\n', (341, 343), False, 'from macest.model_selection import KFoldConfidenceSplit\n'), ((349, 387), 'numpy.testing.assert_', 'np.testing.assert_', (['(10)', 'kfold.n_splits'], {}), '(10, kfold.n_splits)\n', (367, 387), True... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from keras.utils import to_categorical
from keras import backend as K
from keras.layers import Dense, Dropout, Flatten, BatchNormalization
from keras.layers.convolutional import Conv2D, MaxPooling2D
from keras.models import Sequential
from keras.lay... | [
"keras.layers.Dropout",
"keras.layers.convolutional.MaxPooling2D",
"keras.layers.Flatten",
"tensorflow.config.experimental.set_memory_growth",
"cv2.imread",
"keras.layers.convolutional.Conv2D",
"numpy.array",
"keras.layers.Dense",
"tensorflow.config.experimental.list_logical_devices",
"keras.model... | [((491, 542), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (535, 542), True, 'import tensorflow as tf\n'), ((3081, 3093), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (3091, 3093), False, 'from keras.models import... |
from Model_Tuner.Supervised.utils import tuner_utils as tu
from Model_Tuner.Supervised.utils import plot_utils as pu
from Model_Tuner.Supervised.utils import logger_utils as lu
from sklearn.ensemble import (
RandomForestClassifier,
GradientBoostingClassifier,
AdaBoostClassifier,
)
from sklearn.tre... | [
"sklearn.model_selection.GridSearchCV",
"sklearn.preprocessing.StandardScaler",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.tree.DecisionTreeClassifier",
"Model_Tuner.Supervised.utils.plot_utils.plot_roc_curve",
"Model_Tuner.Supervised.utils.tuner_utils.select_features",
"Model_Tuner.Supervised.utils... | [((8771, 8833), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': 'num_cv', 'shuffle': '(True)', 'random_state': 'random_seed'}), '(n_splits=num_cv, shuffle=True, random_state=random_seed)\n', (8776, 8833), False, 'from sklearn.model_selection import KFold\n'), ((8937, 8975), 'Model_Tuner.Supervised.utils.tun... |
# Copyright 2018 Google 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 to in writing,... | [
"tensorflow.reduce_sum",
"tensorflow.reshape",
"tensorflow.zeros_like",
"tensorflow.matmul",
"tensorflow.floor",
"tensorflow.sqrt",
"tensorflow.greater",
"tensorflow.logical_and",
"tensorflow.gather",
"tensorflow.less",
"tensorflow.TensorShape",
"tensorflow.concat",
"tensorflow.cast",
"ten... | [((5283, 5299), 'numpy.zeros', 'np.zeros', (['(3, 3)'], {}), '((3, 3))\n', (5291, 5299), True, 'import numpy as np\n'), ((5707, 5738), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['positions'], {}), '(positions)\n', (5727, 5738), True, 'import tensorflow as tf\n'), ((5748, 5774), 'tensorflow.convert_to_ten... |
"""
Calculation of Earth layers and electron densities.
"""
from __future__ import division
import numpy as np
try:
import numba
except ImportError:
numba = None
from pisa import FTYPE
from pisa.utils.fileio import from_file
from pisa.utils.log import logging, set_verbosity
__all__ = ['extCalcLayers', 'Lay... | [
"pisa.utils.log.logging.debug",
"pisa.utils.fileio.from_file",
"copy.deepcopy",
"numpy.sum",
"pisa.utils.log.set_verbosity",
"numpy.allclose",
"numpy.zeros",
"numpy.ones",
"numpy.diff",
"numpy.array",
"pisa.utils.log.logging.info",
"numpy.where",
"numpy.sqrt",
"numpy.concatenate",
"pisa.... | [((14535, 14575), 'pisa.utils.log.logging.info', 'logging.info', (['"""Test layers calculation:"""'], {}), "('Test layers calculation:')\n", (14547, 14575), False, 'from pisa.utils.log import logging, set_verbosity\n'), ((14744, 14790), 'pisa.utils.log.logging.info', 'logging.info', (["('n_layers = %s' % layer.n_layers... |
# Copyright 2017 GATECH ECE6254 KDS17 TEAM. 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 appl... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.animation.ArtistAnimation",
"matplotlib.pyplot.figure",
"numpy.rot90"
] | [((928, 940), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (938, 940), True, 'from matplotlib import pyplot as plt\n'), ((1107, 1160), 'matplotlib.animation.ArtistAnimation', 'an.ArtistAnimation', (['fig', 'ims'], {'interval': '(150)', 'blit': '(True)'}), '(fig, ims, interval=150, blit=True)\n', (1125, 1... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import dm_env
from dm_env import specs
from dm_control import mujoco
from dm_control.rl import control
from dm_control.suite import base
from dm_control.suite import common
from dm_control.... | [
"dm_control.suite.common.read_model",
"dm_control.rl.control.Environment",
"dm_control.utils.containers.TaggedTasks",
"numpy.zeros",
"numpy.ones",
"numpy.random.RandomState",
"numpy.clip",
"numpy.hstack",
"dm_env.specs.BoundedArray",
"numpy.sin",
"numpy.array",
"numpy.linalg.norm",
"numpy.co... | [((973, 997), 'dm_control.utils.containers.TaggedTasks', 'containers.TaggedTasks', ([], {}), '()\n', (995, 997), False, 'from dm_control.utils import containers\n'), ((3655, 3780), 'dm_control.rl.control.Environment', 'control.Environment', (['physics', 'task'], {'control_timestep': 'control_timestep', 'time_limit': 'e... |
import numpy as np
from TrajectoryIO import *
import matplotlib.pyplot as plt
from DataTools import writeDataToFile
sigma = 1.0
epsilon = 1.0
m = 1.0
kB = 1.0
r_cutoff = float('inf')
r2_cutoff = r_cutoff**2
ener_shift = 4.0*epsilon*(1.0/r2_cutoff**6-1.0/r2_cutoff**3)
r_walls = 3.0
r2_walls = r_walls**2
k_walls = 100... | [
"matplotlib.pyplot.show",
"numpy.average",
"matplotlib.pyplot.plot",
"numpy.sum",
"numpy.random.seed",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.min",
"numpy.arange",
"numpy.rint",
"numpy.random.normal",
"numpy.sqrt",
"DataTools.writeDataToFile"
] | [((3013, 3036), 'numpy.zeros', 'np.zeros', (['(num_steps + 1)'], {}), '(num_steps + 1)\n', (3021, 3036), True, 'import numpy as np\n'), ((3052, 3075), 'numpy.zeros', 'np.zeros', (['(num_steps + 1)'], {}), '(num_steps + 1)\n', (3060, 3075), True, 'import numpy as np\n'), ((3089, 3112), 'numpy.zeros', 'np.zeros', (['(num... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("seaborn-muted")
import seaborn as sns
import argparse
import glob
parser = argparse.ArgumentParser(description="generate value counts for dataset")
parser.add_argument("--data",type=str,help="path to data")
parser.add_argument("--o"... | [
"pandas.DataFrame",
"argparse.ArgumentParser",
"pandas.read_csv",
"matplotlib.pyplot.style.use",
"numpy.unique"
] | [((71, 101), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-muted"""'], {}), "('seaborn-muted')\n", (84, 101), True, 'import matplotlib.pyplot as plt\n'), ((162, 234), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""generate value counts for dataset"""'}), "(description='ge... |
'''
@ Author: <NAME>, <EMAIL>
@ Notes: Here we do the interpolation using scipy.interpolate.interp1d.
"n_sample" is a crutial paramtere other than "n_interp".
'''
from scipy.interpolate import interp1d
import numpy as np
import matplotlib.pyplot as plt
from nn_regression_funcs import *
Obj_SD = Clas... | [
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"numpy.linspace"
] | [((420, 467), 'numpy.linspace', 'np.linspace', (['x_start', 'x_end', '(200)'], {'endpoint': '(True)'}), '(x_start, x_end, 200, endpoint=True)\n', (431, 467), True, 'import numpy as np\n'), ((469, 525), 'numpy.linspace', 'np.linspace', (['x_start', 'x_end'], {'num': 'n_sample', 'endpoint': '(True)'}), '(x_start, x_end, ... |
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from dqn.ExperienceReplay import ExperienceReplay
from dqn.PrioritizedExperienceReplay import PrioritizedExperienceReplay
from dqn.QNetwork_fc import QNetwork_fc
device = torch.device("cuda... | [
"torch.nn.MSELoss",
"torch.load",
"torch.nn.functional.mse_loss",
"dqn.QNetwork_fc.QNetwork_fc",
"random.random",
"dqn.PrioritizedExperienceReplay.PrioritizedExperienceReplay",
"random.seed",
"torch.cuda.is_available",
"numpy.arange",
"torch.no_grad",
"dqn.ExperienceReplay.ExperienceReplay",
"... | [((327, 352), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (350, 352), False, 'import torch\n'), ((1191, 1213), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (1202, 1213), False, 'import random\n'), ((2039, 2051), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {}), '()\n', (2049... |
import pandas as pd
import os
import numpy as np
def listdir(path, list_name): #传入存储的list
for file in os.listdir(path):
file_path = os.path.join(path, file)
if os.path.isdir(file_path):
listdir(file_path, list_name)
else:
list_name.append(file_path)
file... | [
"numpy.argmax",
"pandas.read_csv",
"os.path.isdir",
"os.path.join",
"os.listdir"
] | [((383, 404), 'pandas.read_csv', 'pd.read_csv', (['files[0]'], {}), '(files[0])\n', (394, 404), True, 'import pandas as pd\n'), ((500, 539), 'numpy.argmax', 'np.argmax', (['result.iloc[:, 1:].values', '(1)'], {}), '(result.iloc[:, 1:].values, 1)\n', (509, 539), True, 'import numpy as np\n'), ((108, 124), 'os.listdir', ... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"tensorflow.test.main",
"tf_quant_finance.volatility.implied_vol.newton_root.implied_vol",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_almost_equal",
"numpy.zeros",
"numpy.ones",
"tf_quant_finance.volatility.implied_vol.newton_root.root_finder",
"numpy.array",
"absl.testing.parameteriz... | [((6423, 6627), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["('call_lower', 0.0, 1.0, 1.0, 1.0, 1.0)", "('call_upper', 1.0, 1.0, 1.0, 1.0, 1.0)", "('put_lower', 1.0, 1.0, 1.0, 1.0, -1.0)", "('put_upper', 0.0, 1.0, 1.0, 1.0, -1.0)"], {}), "(('call_lower', 0.0, 1.0, 1.0, 1.0, 1.0), ... |
# from https://github.com/csinva/hierarchical-dnn-interpretations/blob/master/acd/scores/score_funcs.py
import torch
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
import sys
import copy
import cd
def cdep(model, data, blobs,model_type = 'cifar'):
rel, irrel = cd.cd(blobs, data,model,mo... | [
"torch.nn.L1Loss",
"torch.distributions.uniform.Uniform",
"cd.cd",
"torch.autograd.grad",
"numpy.zeros",
"torch.nn.NLLLoss",
"numpy.int",
"torch.Size",
"torch.zeros",
"torch.abs"
] | [((294, 342), 'cd.cd', 'cd.cd', (['blobs', 'data', 'model'], {'model_type': 'model_type'}), '(blobs, data, model, model_type=model_type)\n', (299, 342), False, 'import cd\n'), ((979, 991), 'torch.nn.NLLLoss', 'nn.NLLLoss', ([], {}), '()\n', (989, 991), True, 'import torch.nn as nn\n'), ((1384, 1453), 'numpy.zeros', 'np... |
import atexit
from enum import IntEnum
import numpy as np
import shapely.affinity as saffinity
import copy
from imapper.logic.categories import CATEGORIES, TRANSLATIONS_CATEGORIES
from imapper.logic.joints import Joint
from imapper.pose.confidence import get_confs
from imapper.scenelet_fit.create_dataset import get_p... | [
"atexit.register",
"imapper.util.stealth_logging.lg.warning",
"numpy.empty",
"numpy.sin",
"numpy.mean",
"numpy.meshgrid",
"imapper.util.stealth_logging.lg.error",
"imapper.pose.confidence.get_confs",
"imapper.util.timer.Timer",
"numpy.max",
"numpy.linspace",
"imapper.config.conf.Conf.get",
"... | [((1523, 1559), 'shapely.affinity.affine_transform', 'saffinity.affine_transform', (['poly', 'tr'], {}), '(poly, tr)\n', (1549, 1559), True, 'import shapely.affinity as saffinity\n'), ((1627, 1823), 'numpy.array', 'np.array', (['[[poly2.bounds[0], 0.0, poly2.bounds[1]], [poly2.bounds[2], 0.0, poly2.\n bounds[1]], [p... |
from three_cart_dynamics import ThreeCartDynamics
import numpy as np
import time, os
import matplotlib.pyplot as plt
carts = ThreeCartDynamics(0.05)
dynamics = carts.dynamics
dynamics_batch = carts.dynamics_batch
projection = carts.projection
timesteps = 100
x0 = np.array([0, 2, 3, 0, 0, 0])
u_trj = np.tile(np.array(... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.close",
"numpy.zeros",
"matplotlib.pyplot.axis",
"three_cart_dynamics.ThreeCartDynamics",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.random.normal",
"numpy.random.rand"
] | [((126, 149), 'three_cart_dynamics.ThreeCartDynamics', 'ThreeCartDynamics', (['(0.05)'], {}), '(0.05)\n', (143, 149), False, 'from three_cart_dynamics import ThreeCartDynamics\n'), ((266, 294), 'numpy.array', 'np.array', (['[0, 2, 3, 0, 0, 0]'], {}), '([0, 2, 3, 0, 0, 0])\n', (274, 294), True, 'import numpy as np\n'), ... |
"""
Microlaser example
--------
This short script is intended to be a minimum working example
of the PyPBEC package. It solves for the steady-state
population of a single-mode microlaser as a function of pump
rate, using Rhodamine 6G as the gain medium.
"""
import os
import sys
sys.path.insert(0, os.path.abspath('..'... | [
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.yscale",
"os.path.abspath",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.geomspace",
"matplotlib.pyplot.ylabel",
"PyPBEC.Solver.SteadyState",
"matplotlib.pyplot.xlabel",
"PyPBEC.Cavity.Cavity"
] | [((472, 674), 'PyPBEC.Cavity.Cavity', 'Cavity', ([], {'M': '(1)', 'J': '(1)', 'cavity_loss_rates': '[1.0]', 'cavity_emission_rates': '[10.0]', 'cavity_absorption_rates': '[0.0]', 'reservoir_decay_rates': '[500.0]', 'reservoir_population': '[1000000000.0]', 'coupling_terms': '[[1.0]]'}), '(M=1, J=1, cavity_loss_rates=[1... |
# note: depends on a scipy and matplotlib
# easiest way to get them, is to install Anaconda, https://www.continuum.io/anaconda-overview
import sys
import scipy
import scipy.misc
import numpy as np
from matplotlib import pyplot as plt
if ( len( sys.argv ) ) < 2:
sys.exit("usage: analyse.py <filename.bmp>")
###... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.savefig",
"numpy.abs",
"numpy.angle",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.yticks",
"numpy.fft.fftshift",
"numpy.fft.fft2",
"sys.exit",
"matplotlib.pyplot.xticks",
"scipy.misc.imread"
] | [((340, 380), 'scipy.misc.imread', 'scipy.misc.imread', (['sys.argv[1]'], {'mode': '"""L"""'}), "(sys.argv[1], mode='L')\n", (357, 380), False, 'import scipy\n'), ((407, 423), 'numpy.fft.fft2', 'np.fft.fft2', (['img'], {}), '(img)\n', (418, 423), True, 'import numpy as np\n'), ((448, 466), 'numpy.fft.fftshift', 'np.fft... |
# coding: utf-8
"""
Generate ground trouth-aligned predictions
usage: generate_aligned_predictions.py [options] <checkpoint> <in_dir> <out_dir>
options:
--hparams=<parmas> Hyper parameters [default: ].
--preset=<json> Path of preset parameters (json).
--overwrite Overwrite audi... | [
"numpy.pad",
"torch.from_numpy",
"os.makedirs",
"docopt.docopt",
"torch.LongTensor",
"torch.autograd.Variable",
"torch.load",
"train.build_model",
"torch.cuda.is_available",
"torch.arange",
"hparams.hparams.parse",
"os.path.join",
"sys.exit",
"numpy.repeat"
] | [((759, 784), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (782, 784), False, 'import torch\n'), ((1497, 1574), 'numpy.pad', 'np.pad', (['mel_org', '[(b_pad, e_pad), (0, 0)]'], {'mode': '"""constant"""', 'constant_values': '(0)'}), "(mel_org, [(b_pad, e_pad), (0, 0)], mode='constant', constan... |
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import platform
import subprocess
import os
from os.path import expanduser
import re
import glob
import numpy as np
from argparse import ArgumentParser, REMAINDER
from argparse import RawTextHelpFormatter
import logging
import... | [
"subprocess.Popen",
"psutil.net_if_addrs",
"argparse.ArgumentParser",
"logging.basicConfig",
"subprocess.check_output",
"os.path.exists",
"re.match",
"subprocess.CalledProcessError",
"os.environ.keys",
"numpy.array",
"re.search",
"glob.glob",
"platform.system",
"os.path.expanduser",
"log... | [((329, 436), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""'}), "(level=logging.INFO, format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n", (348, 436), False, 'import logging\n'), ((444, 471), 'loggin... |
"""
Utility functions associated with the likelihood function.
"""
# Author: <NAME>
# License: BSD 3 clause
import numpy as np
def loglikelihood(rss, resid_variance, num_data):
"""
Parameters
----------
rss: float
resid_variance: float
num_data: int
"""
term1 = num_data * np.log(2.0 ... | [
"numpy.abs",
"numpy.log",
"numpy.array",
"numpy.delete"
] | [((1492, 1505), 'numpy.array', 'np.array', (['arr'], {}), '(arr)\n', (1500, 1505), True, 'import numpy as np\n'), ((1631, 1644), 'numpy.array', 'np.array', (['arr'], {}), '(arr)\n', (1639, 1644), True, 'import numpy as np\n'), ((1706, 1732), 'numpy.delete', 'np.delete', (['arr_to_use', 'idx'], {}), '(arr_to_use, idx)\n... |
"""
Functions that aid weighting the visibility data prior to imaging.
There are two classes of functions:
- Changing the weight dependent on noise level or sample density or a combination
- Tapering the weihght spatially to avoid effects of sharp edges or to emphasize a given scale size in the image
"""
imp... | [
"libs.fourier_transforms.convolutional_gridding.weight_gridding",
"libs.imaging.imaging_params.get_polarisation_map",
"numpy.log",
"libs.imaging.imaging_params.get_frequency_map",
"data_models.parameters.get_parameter",
"numpy.max",
"numpy.exp",
"libs.imaging.imaging_params.get_uvw_map",
"libs.util.... | [((1662, 1688), 'libs.imaging.imaging_params.get_frequency_map', 'get_frequency_map', (['vis', 'im'], {}), '(vis, im)\n', (1679, 1688), False, 'from libs.imaging.imaging_params import get_frequency_map\n'), ((1731, 1760), 'libs.imaging.imaging_params.get_polarisation_map', 'get_polarisation_map', (['vis', 'im'], {}), '... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.signal import lfilter, hamming
#from pylab import plot
#帧的类
class frame:
"""audio:一帧的原数据 window:窗 start:这一帧的起始取样点"""
def __init__(self, audio, window, start):
self.start = start
self.data = window * audio #因为下标个数一致,直接对应相乘加窗
... | [
"scipy.signal.hamming",
"numpy.amin",
"scipy.signal.lfilter",
"numpy.amax",
"numpy.array"
] | [((901, 921), 'numpy.array', 'np.array', (['[1, -0.97]'], {}), '([1, -0.97])\n', (909, 921), True, 'import numpy as np\n'), ((934, 960), 'scipy.signal.lfilter', 'lfilter', (['b', '(1)', 'music[:, 0]'], {}), '(b, 1, music[:, 0])\n', (941, 960), False, 'from scipy.signal import lfilter, hamming\n'), ((973, 999), 'scipy.s... |
import os, pickle, logging
import numpy as np
from .process_file import prepare_data
def setup_loo_experiment(experiment_name,ds_path,ds_names,leave_id,experiment_parameters,use_pickled_data=False,pickle_dir='pickle/',validation_proportion=0.1):
# Dataset to be tested
testing_datasets_names = [ds_names[leave_... | [
"pickle.dump",
"numpy.genfromtxt",
"logging.info",
"pickle.load",
"numpy.random.permutation",
"os.path.join"
] | [((5183, 5243), 'os.path.join', 'os.path.join', (["(ds_path + testing_datasets_names[0] + '/H.txt')"], {}), "(ds_path + testing_datasets_names[0] + '/H.txt')\n", (5195, 5243), False, 'import os, pickle, logging\n'), ((5262, 5292), 'numpy.genfromtxt', 'np.genfromtxt', (['homography_file'], {}), '(homography_file)\n', (5... |
from __future__ import print_function
from __future__ import absolute_import
from . import result_utils
from . import smdfile
import motmot.FlyMovieFormat.FlyMovieFormat as FlyMovieFormat
import numpy as nx
class NoFrameRecordedHere(Exception):
pass
class CachingMovieOpener:
"""
last used 2006-05-17
... | [
"motmot.FlyMovieFormat.FlyMovieFormat.FlyMovie",
"numpy.ones"
] | [((3118, 3151), 'motmot.FlyMovieFormat.FlyMovieFormat.FlyMovie', 'FlyMovieFormat.FlyMovie', (['filename'], {}), '(filename)\n', (3141, 3151), True, 'import motmot.FlyMovieFormat.FlyMovieFormat as FlyMovieFormat\n'), ((6561, 6595), 'numpy.ones', 'nx.ones', (['(height, width)', 'nx.UInt8'], {}), '((height, width), nx.UIn... |
import numpy as np
import pickle
import pandas as pd
from flasgger import Swagger
import streamlit as st
from flask import Flask,request
app=Flask(__name__)
Swagger(app)
model=pickle.load(open(f'model.pkl','rb+'))
@app.route('/')
def welcome():
return "Welcome All"
@app.route('/predict',methods=["GET"])
def... | [
"flasgger.Swagger",
"flask.Flask",
"numpy.zeros",
"flask.request.args.get"
] | [((146, 161), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (151, 161), False, 'from flask import Flask, request\n'), ((162, 174), 'flasgger.Swagger', 'Swagger', (['app'], {}), '(app)\n', (169, 174), False, 'from flasgger import Swagger\n'), ((2508, 2520), 'numpy.zeros', 'np.zeros', (['(30)'], {}), '(30)\... |
import numpy as np
import astropy.units as u
import pygeoid.constants.iers2010 as iers2010
def test_tcg_to_tt():
x_tcg = iers2010.GM_earth_tcg
x_tt = iers2010.tcg_to_tt(x_tcg)
np.testing.assert_almost_equal(x_tt.value / 10e5,
iers2010.GM_earth_tt.value / 10e5, 0)
def test_l2_shida_number()... | [
"pygeoid.constants.iers2010.tcg_to_tt",
"numpy.testing.assert_almost_equal",
"pygeoid.constants.iers2010.h2_love_number",
"pygeoid.constants.iers2010.l2_shida_number"
] | [((162, 187), 'pygeoid.constants.iers2010.tcg_to_tt', 'iers2010.tcg_to_tt', (['x_tcg'], {}), '(x_tcg)\n', (180, 187), True, 'import pygeoid.constants.iers2010 as iers2010\n'), ((192, 294), 'numpy.testing.assert_almost_equal', 'np.testing.assert_almost_equal', (['(x_tt.value / 1000000.0)', '(iers2010.GM_earth_tt.value /... |
# -*- coding: utf-8 -*-
'''
Created on 2015.07.01
@author: Haar_Mao
'''
import log
import cv2
import numpy as np
global HEIGHT #y,rows归一化后图片的规格,可修改
global WIDTH #x,cols
HEIGHT = 90
WIDTH = 60
#若轮廓数大于1则将其合并
def GetFinalContour(contour,num):
C = np.array([[[]]])
x = 1
for x in contour:
C = np.conca... | [
"cv2.resize",
"numpy.concatenate",
"cv2.cvtColor",
"cv2.threshold",
"cv2.moments",
"numpy.float32",
"cv2.warpAffine",
"numpy.array",
"log.message",
"cv2.findContours"
] | [((251, 267), 'numpy.array', 'np.array', (['[[[]]]'], {}), '([[[]]])\n', (259, 267), True, 'import numpy as np\n'), ((473, 510), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (485, 510), False, 'import cv2\n'), ((527, 563), 'cv2.threshold', 'cv2.threshold', (['img_g... |
import argparse
import numpy as np
import os
import sys
import cPickle as pickle
from neuralnet import NeuralNet
from svm import SVM
from autoencoder import AutoencoderModel
from config import Configuration as Cfg
# Experiment checks:
#
# 1. Supervised methods should produce high AUCs
# 2. Can a supervised CNN... | [
"argparse.ArgumentParser",
"config.Configuration.floatX",
"os.path.exists",
"neuralnet.NeuralNet",
"cPickle.dump",
"numpy.max",
"numpy.array",
"svm.SVM",
"autoencoder.AutoencoderModel",
"sys.exit"
] | [((710, 735), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (733, 735), False, 'import argparse\n'), ((1926, 1953), 'os.path.exists', 'os.path.exists', (['args.xp_dir'], {}), '(args.xp_dir)\n', (1940, 1953), False, 'import os\n'), ((3134, 3172), 'numpy.array', 'np.array', (['[0.01, 0.05, 0.1, ... |
import numpy as np
from pymul.functions.activation import tanh, tanh_prime
from pymul.functions.loss import mse, mse_prime
from pymul.layers.activation_layer import ActivationLayer
from pymul.layers.neuron_layer import NeuronLayer
class Network:
def __init__(
self,
layer_sizes,
activation... | [
"pymul.layers.activation_layer.ActivationLayer",
"numpy.array",
"pymul.layers.neuron_layer.NeuronLayer"
] | [((2187, 2203), 'numpy.array', 'np.array', (['[list]'], {}), '([list])\n', (2195, 2203), True, 'import numpy as np\n'), ((2269, 2282), 'numpy.array', 'np.array', (['[i]'], {}), '([i])\n', (2277, 2282), True, 'import numpy as np\n'), ((518, 565), 'pymul.layers.neuron_layer.NeuronLayer', 'NeuronLayer', (['layer_sizes[i]'... |
""""
This file contains simple simulation tests that are used to see if all parts of the package work
:authors: <NAME>
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import importlib
import arviz as az
from scdcdm.util import data_generation as gen
from scdcdm.util ... | [
"numpy.full",
"scdcdm.util.cell_composition_data.from_pandas",
"numpy.random.seed",
"matplotlib.pyplot.show",
"scdcdm.util.multi_parameter_sampling.Multi_param_simulation_multi_model",
"pandas.read_csv",
"scdcdm.util.comp_ana.CompositionalAnalysis",
"seaborn.barplot",
"matplotlib.pyplot.subplots",
... | [((553, 595), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', 'None'], {}), "('display.max_columns', None)\n", (566, 595), True, 'import pandas as pd\n'), ((619, 639), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (633, 639), True, 'import numpy as np\n'), ((693, 732), 'numpy... |
# Copyright 2020-2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
"unittest.main",
"extras.python.tactile.enveloper.Enveloper",
"numpy.sum",
"numpy.clip",
"numpy.sin",
"numpy.array",
"numpy.arange",
"numpy.random.rand"
] | [((3230, 3245), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3243, 3245), False, 'import unittest\n'), ((1149, 1178), 'numpy.sum', 'np.sum', (['(x[i_start:i_end] ** 2)'], {}), '(x[i_start:i_end] ** 2)\n', (1155, 1178), True, 'import numpy as np\n'), ((1092, 1109), 'numpy.array', 'np.array', (['t_range'], {}), '... |
import sys
import numpy as np
import math
import pickle
import os
import logging
logging.getLogger("tensorflow").setLevel(logging.CRITICAL)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
logging.basicConfig(level=logging.CRITICAL)
import tensorflow as tf
import tensorflow_text
import tensorflow_hub as hub
sys.path.append("..... | [
"sys.path.append",
"logging.basicConfig",
"numpy.asarray",
"tensorflow.constant",
"Utils.functions.simple_preprocess",
"logging.getLogger"
] | [((181, 224), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.CRITICAL'}), '(level=logging.CRITICAL)\n', (200, 224), False, 'import logging\n'), ((301, 323), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (316, 323), False, 'import sys\n'), ((81, 112), 'logging.getLogger',... |
"""
Pull Trial information, and generate correlation plots and hyperparameter vs. trial plots
Requires MongoDB to be running is separate process
[usage]: python3 insights.py --ip {mongodb ip} --port {mongodb port} --key {mongodb run key} --loop
"""
# Disabling pylint snake_case warnings, import error warnings,... | [
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"numpy.zeros_like",
"seaborn.heatmap",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"os.getcwd",
"hyperopt.mongoexp.MongoTrials",
"matplotlib.pyplot.figure",
"numpy.triu_indices_from",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyp... | [((3709, 4117), 'pandas.DataFrame', 'pd.DataFrame', (['arr'], {'columns': "['NWTNUM', 'headtol', 'fluxtol', 'maxiterout', 'thickfact', 'linmeth',\n 'iprnwt', 'ibotav', 'option', 'dbdtheta', 'dbdkappa', 'dbdgamma',\n 'momfact', 'backflag', 'maxbackiter', 'backtol', 'backreduce',\n 'maxitinner', 'ilumethod', 'le... |
import multiprocessing
import os
import pickle
import re
import sys
import traceback
import time
from multiprocessing.spawn import freeze_support
from pathlib import Path
import numpy as np
import pandas as pd
from scipy.stats import ttest_ind
from scipy.special import logsumexp
from scipy.stats import poisson
from nu... | [
"numpy.sum",
"pathlib.Path.home",
"numpy.argsort",
"os.path.isfile",
"numpy.mean",
"pickle.load",
"numpy.linalg.norm",
"scipy.special.logsumexp",
"numpy.arange",
"pandas.DataFrame",
"numpy.multiply",
"numpy.copy",
"numpy.std",
"numpy.cumsum",
"numpy.swapaxes",
"numpy.random.poisson",
... | [((2895, 2913), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (2898, 2913), False, 'from numba import jit\n'), ((4424, 4470), 'scipy.stats.ttest_ind', 'ttest_ind', (['sample_1', 'sample_2'], {'equal_var': '(False)'}), '(sample_1, sample_2, equal_var=False)\n', (4433, 4470), False, 'from scipy.s... |
###################################################################################
# Copyright (c) 2021 Rhombus Systems #
# #
# Permission is hereby granted, free of charge, to any person obtai... | [
"cv2.dnn.NMSBoxes",
"numpy.argmax",
"helper_types.vector.Vec2",
"cv2.dnn.blobFromImage",
"RhombusAPI.models.footage_bounding_box_type.FootageBoundingBoxType",
"cv2.imread",
"numpy.array",
"glob.glob"
] | [((4226, 4247), 'cv2.imread', 'cv2.imread', (['file_path'], {}), '(file_path)\n', (4236, 4247), False, 'import cv2\n'), ((4295, 4369), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFromImage', (['img', '(1 / 255.0)', '(416, 416)'], {'swapRB': '(True)', 'crop': '(False)'}), '(img, 1 / 255.0, (416, 416), swapRB=True, crop=False)... |
import numpy as np
import config
import logging
#logging.basicConfig(filename="logs/MCTS.log", level=logging.INFO)
class Node:
def __init__(self, env):
self.env = env
self.id = env.id
self.edges = []
logging.info("Node created")
@property
def is_leaf(self):
retur... | [
"logging.info",
"numpy.isnan",
"numpy.sqrt"
] | [((236, 264), 'logging.info', 'logging.info', (['"""Node created"""'], {}), "('Node created')\n", (248, 264), False, 'import logging\n'), ((861, 889), 'logging.info', 'logging.info', (['"""Edge created"""'], {}), "('Edge created')\n", (873, 889), False, 'import logging\n'), ((1264, 1304), 'logging.info', 'logging.info'... |
import os
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import matplotlib.pyplot as plt
from utils import ProgressBar, plot
from dataset import Dataset
class InfoDCGAN(object):
def __init__(self, config, sess):
self.input_dim = config.input_dim
... | [
"tensorflow.maximum",
"numpy.random.multinomial",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.nn.conv2d",
"numpy.random.normal",
"tensorflow.sqrt",
"os.path.join",
"tensorflow.layers.batch_normalization",
"utils.plot",
"tensorflow.nn.softmax",
"tensorflow.nn.relu",
"dataset.Datase... | [((1169, 1194), 'dataset.Dataset', 'Dataset', (['"""raw/grayscale/"""'], {}), "('raw/grayscale/')\n", (1176, 1194), False, 'from dataset import Dataset\n'), ((1244, 1299), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, self.input_dim]', '"""X"""'], {}), "(tf.float32, [None, self.input_dim], 'X')\n"... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | [
"tokenization.whitespace_tokenize",
"tokenization.printable_text",
"argparse.ArgumentParser",
"modeling.BertModel",
"chainer.training.extensions.LinearShift",
"chainer.functions.pad_sequence",
"json.dumps",
"collections.defaultdict",
"chainer.no_backprop_mode",
"modeling.BertConfig.from_json_file"... | [((1243, 1270), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1260, 1270), False, 'import logging\n'), ((21571, 21656), 'collections.namedtuple', 'collections.namedtuple', (['"""RawResult"""', "['unique_id', 'start_logits', 'end_logits']"], {}), "('RawResult', ['unique_id', 'start_logit... |
import matplotlib.pyplot as plt
import muons as mu
import numpy as np
import weather as w
import pi_muons as pi
import sys
args = map(lambda x: x.replace("-", ""), sys.argv[1:])
plot_deviation = "dev" in args
# Get weather data.
weather = w.get_data()
weather_times = w.get_times(weather)
# Get data from lab muon det... | [
"weather.get_times",
"weather.get_pressures",
"matplotlib.pyplot.tight_layout",
"pi_muons.get_counts",
"weather.get_data",
"muons.get_data",
"matplotlib.pyplot.show",
"numpy.average",
"matplotlib.pyplot.legend",
"pi_muons.get_counts_in_time",
"muons.average_with_step",
"matplotlib.pyplot.ylabe... | [((241, 253), 'weather.get_data', 'w.get_data', ([], {}), '()\n', (251, 253), True, 'import weather as w\n'), ((270, 290), 'weather.get_times', 'w.get_times', (['weather'], {}), '(weather)\n', (281, 290), True, 'import weather as w\n'), ((340, 353), 'muons.get_data', 'mu.get_data', ([], {}), '()\n', (351, 353), True, '... |
import itertools
import numpy as np
# generate states and encode/decode between idx and state
class StateCoder:
def __init__(self, config, ):
self.state_list = StateCoder.generate_state_list(config['max_conc'])
# Generate State List
@staticmethod
def generate_state_list(max_conc):
co... | [
"numpy.zeros",
"itertools.product"
] | [((1100, 1136), 'numpy.zeros', 'np.zeros', (['(state_count, state_count)'], {}), '((state_count, state_count))\n', (1108, 1136), True, 'import numpy as np\n'), ((384, 414), 'itertools.product', 'itertools.product', (['cont_counts'], {}), '(cont_counts)\n', (401, 414), False, 'import itertools\n')] |
from itertools import product
import scipy.stats as st
import numpy as np
from functools import lru_cache
from collections import namedtuple
from maypy import ALPHA
from maypy.distributions.properties import DistributionProperties
from maypy.experiment.experiment import Experiment
from maypy.utils import Document
... | [
"numpy.random.choice",
"numpy.std",
"collections.namedtuple",
"maypy.utils.Document",
"itertools.product",
"maypy.experiment.experiment.Experiment",
"numpy.sqrt"
] | [((1514, 1560), 'collections.namedtuple', 'namedtuple', (['"""Result"""', "['statistic', 'p_value']"], {}), "('Result', ['statistic', 'p_value'])\n", (1524, 1560), False, 'from collections import namedtuple\n'), ((4506, 4555), 'maypy.experiment.experiment.Experiment', 'Experiment', (['"""\'P\' and \'Q\' are correlated"... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
An app that detects faces, reads emotions, and displays an avatar with the
same emotions as the detected face.
How to run the program:
1. run the image collection program with: python3 avatar_emo.py collect
- take images of your face to use ... | [
"wx.RadioButton",
"wx.BoxSizer",
"argparse.ArgumentParser",
"cv2.putText",
"numpy.argmax",
"cv2.waitKey",
"data.store.save_datum",
"wx.Panel",
"cv2.VideoCapture",
"cv2.imread",
"wx.Button",
"wx.App",
"detectors.FaceDetector",
"cv2.destroyWindow",
"cv2.imshow",
"data.store.pickle_load",... | [((15150, 15169), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (15166, 15169), False, 'import cv2\n'), ((15479, 15487), 'wx.App', 'wx.App', ([], {}), '()\n', (15485, 15487), False, 'import wx\n'), ((15687, 15706), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (15703, 15706), False, ... |
# Copyright 2018 <NAME> and <NAME>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
"graph_nets.modules_torch.RelationNetwork",
"torch.set_default_dtype",
"numpy.linalg.norm",
"torch.range",
"unittest.main",
"graph_nets.modules_torch._received_edges_normalizer",
"graph_nets.modules_torch.SelfAttention",
"graph_nets.utils_torch.data_dicts_to_graphs_tuple",
"graph_nets.blocks_torch.G... | [((7095, 7185), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["('default name', None)", "('custom name', 'custom_name')"], {}), "(('default name', None), ('custom name',\n 'custom_name'))\n", (7125, 7185), False, 'from absl.testing import parameterized\n'), ((8680, 8840), 'absl.t... |
"""
Indicator data preprocessing module.
The low-level metrics do not correspond to the high-level SLAs,
and the indicators are corresponding and merged according to
the method of time stamp proximity search..
"""
import time
import sys
import pandas as pd
import numpy as np
class Preprocess(object):
def __init_... | [
"pandas.read_table",
"numpy.mean",
"time.strptime",
"pandas.DataFrame.from_records"
] | [((681, 740), 'pandas.read_table', 'pd.read_table', (['self.metrics'], {'header': '(0)', 'sep': '""","""', 'index_col': '(0)'}), "(self.metrics, header=0, sep=',', index_col=0)\n", (694, 740), True, 'import pandas as pd\n'), ((779, 825), 'pandas.read_table', 'pd.read_table', (['self.qos'], {'header': '(0)', 'index_col'... |
# %%
import os
import torch
import torchvision
import torch.nn as nn
import numpy as np
import pickle
import torchvision.transforms as transforms
import torchvision.transforms.functional as TF
import torchvision.models as models
import matplotlib.pyplot as plt
# from tensorboardX import SummaryWriter
# from torchviz i... | [
"torch.argmax",
"torchvision.datasets.CIFAR10",
"matplotlib.pyplot.figure",
"torchvision.transforms.Pad",
"torchvision.transforms.Normalize",
"torch.no_grad",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.imshow",
"numpy.transpose",
"numpy.random.choice",
"torch.utils.data.random_split",
"... | [((2245, 2343), 'torchvision.datasets.CIFAR10', 'torchvision.datasets.CIFAR10', ([], {'root': '"""data/cifar10/"""', 'train': '(True)', 'transform': 'None', 'download': '(True)'}), "(root='data/cifar10/', train=True, transform=\n None, download=True)\n", (2273, 2343), False, 'import torchvision\n'), ((2487, 2566), '... |
# Module imports
import numpy as np
import cv2
import images
# Desciption:
# Class that defines camera properties and processes its images
# Attributes:
# camera: cv2.VideoCapture object
# resolution: camera resolution
class Camera:
def __init__(self, camera_port = 0, resolution = 1):
self.camera = cv2.VideoCaptu... | [
"images.gaussian",
"images.canny",
"numpy.average",
"numpy.copy",
"cv2.cvtColor",
"images.hough",
"numpy.float32",
"cv2.waitKey",
"cv2.imshow",
"images.region_of_interest",
"images.punto_medio",
"cv2.VideoCapture",
"images.warp",
"cv2.addWeighted",
"numpy.array",
"cv2.destroyAllWindows... | [((306, 337), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""estaaa.webm"""'], {}), "('estaaa.webm')\n", (322, 337), False, 'import cv2\n'), ((1078, 1101), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1099, 1101), False, 'import cv2\n'), ((1503, 1561), 'numpy.float32', 'np.float32', (['[[0, 480],... |
import numpy as np
import scipy as sp
from scipy.sparse import diags
import gurobipy as gp
from gurobipy import GRB
def ip_nmin_fpe(A, tau):
"""
Decription
----------
Solve the NMIN-FPE as an integer program. Formulation see paper.
Input
-----
A: scipy sparse matrix
The adjacency ... | [
"scipy.sparse.diags",
"numpy.zeros",
"numpy.ones",
"gurobipy.Model",
"numpy.shape"
] | [((716, 726), 'numpy.ones', 'np.ones', (['n'], {}), '(n)\n', (723, 726), True, 'import numpy as np\n'), ((760, 771), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (768, 771), True, 'import numpy as np\n'), ((904, 924), 'gurobipy.Model', 'gp.Model', (['"""NMIN-FPE"""'], {}), "('NMIN-FPE')\n", (912, 924), True, 'impor... |
"""
http://machinelearningmastery.com/understanding-stateful-lstm-recurrent-neural-networks-python-keras/
http://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/
http://machinelearningmastery.com/tactics-to-combat-imbalanced-classes-in-your-machine-learning-dataset/
"""
from ker... | [
"keras.models.load_model",
"numpy.argmax",
"numpy.zeros",
"numpy.random.randint",
"sys.stdout.flush",
"numpy.reshape"
] | [((2931, 2958), 'keras.models.load_model', 'load_model', (['load_checkpoint'], {}), '(load_checkpoint)\n', (2941, 2958), False, 'from keras.models import Model, load_model\n'), ((3088, 3121), 'numpy.random.randint', 'np.random.randint', (['(0)', '(samples - 1)'], {}), '(0, samples - 1)\n', (3105, 3121), True, 'import n... |
import numba as nb
import numpy as np
@nb.njit((nb.c16[:], nb.optional(nb.b1)))
def fft(a: np.ndarray, inverse: bool = False) -> np.ndarray:
n = a.size
if n == 1:
return a
h = 1
while 1 << h < n:
h += 1
assert 1 << h == n
b = fft(a[::2], inverse)
c = fft(a[1::2], inverse)
... | [
"numpy.arange",
"numba.njit",
"numpy.zeros",
"numba.optional"
] | [((543, 564), 'numba.njit', 'nb.njit', (['(nb.c16[:],)'], {}), '((nb.c16[:],))\n', (550, 564), True, 'import numba as nb\n'), ((329, 361), 'numpy.zeros', 'np.zeros', (['n'], {'dtype': 'np.complex128'}), '(n, dtype=np.complex128)\n', (337, 361), True, 'import numpy as np\n'), ((61, 79), 'numba.optional', 'nb.optional', ... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright © 2016 <NAME> <<EMAIL>>
import argparse
import matplotlib.pyplot as pl
import numpy as np
import scipy.optimize as op
def dandify_axes(ax, legend=False):
ax.grid(True)
ax.margins(0.05)
if legend:
ax.legend(loc='best')
def dandify_figure(f... | [
"numpy.sum",
"numpy.random.random_sample",
"argparse.ArgumentParser",
"numpy.exp",
"numpy.sqrt"
] | [((467, 496), 'numpy.random.random_sample', 'np.random.random_sample', (['(1000)'], {}), '(1000)\n', (490, 496), True, 'import numpy as np\n'), ((627, 643), 'numpy.sum', 'np.sum', (['summands'], {}), '(summands)\n', (633, 643), True, 'import numpy as np\n'), ((817, 856), 'argparse.ArgumentParser', 'argparse.ArgumentPar... |
# local imports
from .util import (
tqdm_joblib,
chunks,
S3Url,
get_bias_field,
)
import glob
import os
from io import BytesIO
import argparse
import boto3
from botocore.client import Config
import numpy as np
from PIL import Image
from tqdm import tqdm
from joblib import Parallel, delayed, cpu_count
i... | [
"argparse.ArgumentParser",
"numpy.clip",
"numpy.around",
"boto3.resource",
"glob.glob",
"joblib.cpu_count",
"os.path.exists",
"botocore.client.Config",
"io.BytesIO",
"tqdm.tqdm",
"math.ceil",
"numpy.min",
"numpy.concatenate",
"numpy.zeros",
"SimpleITK.GetImageFromArray",
"joblib.Parall... | [((389, 443), 'botocore.client.Config', 'Config', ([], {'connect_timeout': '(5)', 'retries': "{'max_attempts': 5}"}), "(connect_timeout=5, retries={'max_attempts': 5})\n", (395, 443), False, 'from botocore.client import Config\n'), ((711, 750), 'numpy.zeros', 'np.zeros', (['raw_tile.shape'], {'dtype': '"""float"""'}), ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.