code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import heartpy as hp
import wfdb
from wfdb import processing
from heartpy.datautils import rolling_mean, _sliding_window
from heartpy.peakdetection import detect_peaks
from feature_extractions import Feature_Extractor #get_features_matrix,
impor... | [
"heartpy.process",
"utils.load_visualise",
"numpy.asarray",
"feature_extractions.Feature_Extractor",
"wfdb.io.get_record_list",
"pandas.DataFrame",
"wfdb.rdsamp"
] | [((713, 745), 'wfdb.rdsamp', 'wfdb.rdsamp', (['instance'], {'pn_dir': 'db'}), '(instance, pn_dir=db)\n', (724, 745), False, 'import wfdb\n'), ((823, 887), 'pandas.DataFrame', 'pd.DataFrame', (['signals'], {'columns': "fields['sig_name']", 'dtype': '"""float"""'}), "(signals, columns=fields['sig_name'], dtype='float')\n... |
# Analytical solution for scattering of a plane wave by a sound-hard circle,
# i.e., with the Neumann data set to zero on the circle boundary.
# <NAME>
# Cambridge, 20/11/19
from numba import njit, prange
def sound_hard_circle(k, rad, plot_grid):
# from pylab import find
from scipy.special import jv, hankel1
... | [
"numpy.sqrt",
"scipy.special.hankel1",
"numba.prange",
"numpy.where",
"numpy.size",
"numba.njit",
"numpy.exp",
"numpy.sum",
"numpy.zeros",
"numpy.arctan2",
"scipy.special.jv",
"numpy.int"
] | [((481, 523), 'numpy.sqrt', 'np.sqrt', (['(fem_xx * fem_xx + fem_xy * fem_xy)'], {}), '(fem_xx * fem_xx + fem_xy * fem_xy)\n', (488, 523), True, 'import numpy as np\n'), ((536, 562), 'numpy.arctan2', 'np.arctan2', (['fem_xy', 'fem_xx'], {}), '(fem_xy, fem_xx)\n', (546, 562), True, 'import numpy as np\n'), ((574, 592), ... |
import numpy as np
import tensorflow.keras.layers as layers
from invoke.context import Context
from tensorflow.keras.models import Sequential
import config as cfg
from ennclave import Enclave
import ennclave_inference
def build_library(model: Enclave, mode: str):
model.generate_state()
model.generate_forward... | [
"numpy.prod",
"numpy.random.default_rng",
"config.get_ennclave_home",
"numpy.testing.assert_almost_equal",
"invoke.context.Context",
"tensorflow.keras.layers.Dense",
"numpy.expand_dims",
"numpy.frombuffer",
"ennclave.Enclave",
"numpy.arange"
] | [((343, 352), 'invoke.context.Context', 'Context', ([], {}), '()\n', (350, 352), False, 'from invoke.context import Context\n'), ((767, 790), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}), '()\n', (788, 790), True, 'import numpy as np\n'), ((935, 960), 'numpy.expand_dims', 'np.expand_dims', (['inputs', ... |
################################## Define Some Useful Functions ###############################
import numpy as np
import torch as t
from decimal import *
import scipy
# import sympy
import math
# from pynverse import inversefunc
# import cvxpy as cp
def indicator(K):
# This function is used to ge... | [
"numpy.sqrt",
"numpy.log",
"torch.sqrt",
"torch.pow",
"torch.exp",
"torch.from_numpy",
"torch.sum",
"torch.bmm",
"numpy.sin",
"torch.eye",
"numpy.exp",
"torch.matmul",
"numpy.concatenate",
"torch.randn",
"torch.ones_like",
"torch.abs",
"math.factorial",
"torch.empty_like",
"numpy... | [((435, 447), 'torch.eye', 't.eye', (['(5 * K)'], {}), '(5 * K)\n', (440, 447), True, 'import torch as t\n'), ((1425, 1441), 'torch.pow', 't.pow', (['HW_tmp', '(2)'], {}), '(HW_tmp, 2)\n', (1430, 1441), True, 'import torch as t\n'), ((2910, 2926), 'torch.pow', 't.pow', (['HW_tmp', '(2)'], {}), '(HW_tmp, 2)\n', (2915, 2... |
import numpy as np
import copy
from util.util import *
from heuristics.greedy_tsp import greedy as greedy_tsp
from graph.graph import Graph
from util.prim import *
# prefer concorde
try:
from concorde.tsp import TSPSolver
CONCORDE_AVAILABLE = True
#CONCORDE_AVAILABLE = False
except ImportError:
CONC... | [
"numpy.mean",
"python_tsp.heuristics.solve_tsp_simulated_annealing",
"numpy.random.default_rng",
"concorde.tsp.TSPSolver.from_data",
"heuristics.greedy_tsp.greedy",
"numpy.zeros",
"copy.deepcopy",
"numpy.random.RandomState"
] | [((661, 697), 'numpy.random.default_rng', 'np.random.default_rng', ([], {'seed': 'rng_seed'}), '(seed=rng_seed)\n', (682, 697), True, 'import numpy as np\n'), ((1253, 1282), 'copy.deepcopy', 'copy.deepcopy', (['graph.vertices'], {}), '(graph.vertices)\n', (1266, 1282), False, 'import copy\n'), ((1447, 1483), 'numpy.ran... |
import numpy as np
import plac
import os
@plac.annotations(
idsfile=("file with the ids", "positional"),
linenumsfile=("file containing linenums", "positional"),
nlines=("the size of the sample", "option", None, int)
)
def main (idsfile, linenumsfile, nlines=100000):
np.random.seed (100)
with open (idsfile) as fi... | [
"numpy.random.choice",
"numpy.random.seed",
"plac.annotations",
"plac.call"
] | [((43, 227), 'plac.annotations', 'plac.annotations', ([], {'idsfile': "('file with the ids', 'positional')", 'linenumsfile': "('file containing linenums', 'positional')", 'nlines': "('the size of the sample', 'option', None, int)"}), "(idsfile=('file with the ids', 'positional'), linenumsfile=\n ('file containing li... |
"""
Tests for the data augmentation methods in gprof_nn.augmentation.
"""
from pathlib import Path
import numpy as np
import xarray as xr
from gprof_nn import sensors
from gprof_nn.data import get_test_data_path
from gprof_nn.augmentation import (
Swath,
get_center_pixels,
get_transformation_coordinates,
... | [
"numpy.isclose",
"gprof_nn.augmentation.get_transformation_coordinates",
"gprof_nn.augmentation.get_center_pixel_input",
"gprof_nn.augmentation.Swath",
"gprof_nn.data.training_data.decompress_and_load",
"gprof_nn.data.get_test_data_path",
"numpy.meshgrid",
"numpy.all",
"numpy.arange"
] | [((437, 457), 'gprof_nn.data.get_test_data_path', 'get_test_data_path', ([], {}), '()\n', (455, 457), False, 'from gprof_nn.data import get_test_data_path\n'), ((605, 626), 'numpy.arange', 'np.arange', (['(0)', '(221)', '(10)'], {}), '(0, 221, 10)\n', (614, 626), True, 'import numpy as np\n'), ((635, 656), 'numpy.arang... |
import numpy as np
def prepareData(train, dev, embeddings):
'''
Almacenamiento de palabras en nuestro vocabulario -> Añadimos al vocabulario
aquellas palabras que estén en el subconjunto de los embeddings seleccionados
(200000) + 2 de padding y unkown
'''
vocabulary = {}
vocabulary["PADDING"] = len(vocabular... | [
"numpy.array",
"numpy.zeros",
"numpy.argmax",
"numpy.random.uniform"
] | [((2084, 2107), 'numpy.array', 'np.array', (['data_test_idx'], {}), '(data_test_idx)\n', (2092, 2107), True, 'import numpy as np\n'), ((453, 466), 'numpy.zeros', 'np.zeros', (['(300)'], {}), '(300)\n', (461, 466), True, 'import numpy as np\n'), ((494, 529), 'numpy.random.uniform', 'np.random.uniform', (['(-0.25)', '(0.... |
import os
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
from crabby import (generate_master_flat_and_dark, photometry,
PhotometryResults, PCA_light_curve, params_e,
transit_model_e)
# Image paths
image_paths = sorted(glob('... | [
"crabby.PhotometryResults.load",
"os.path.exists",
"numpy.ones_like",
"numpy.ones",
"numpy.arange",
"matplotlib.pyplot.plot",
"numpy.array",
"crabby.photometry",
"crabby.generate_master_flat_and_dark",
"numpy.vstack",
"numpy.std",
"glob.glob",
"matplotlib.pyplot.show"
] | [((400, 467), 'glob.glob', 'glob', (['"""/Users/bmmorris/data/saintex/2019_55cnc/20190427/Dark/*.fts"""'], {}), "('/Users/bmmorris/data/saintex/2019_55cnc/20190427/Dark/*.fts')\n", (404, 467), False, 'from glob import glob\n'), ((481, 548), 'glob.glob', 'glob', (['"""/Users/bmmorris/data/saintex/2019_55cnc/20190427/Fla... |
import numpy as np
def norm_to_zscore(img_array, cer_arr, max_z_score=4.0):
temp_cer_mask = (cer_arr > 0)
temp_masked_img = img_array[temp_cer_mask]
temp_avg_img = np.mean(temp_masked_img)
temp_std_img = np.std(temp_masked_img)
img_array[temp_cer_mask] = (img_array[temp_cer_mas... | [
"numpy.mean",
"numpy.std"
] | [((190, 214), 'numpy.mean', 'np.mean', (['temp_masked_img'], {}), '(temp_masked_img)\n', (197, 214), True, 'import numpy as np\n'), ((238, 261), 'numpy.std', 'np.std', (['temp_masked_img'], {}), '(temp_masked_img)\n', (244, 261), True, 'import numpy as np\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
: Project - RGANet
: calculate statistics
: Author - <NAME>
: Institute - University of Kansas
: Date - 5/20/2021
: HowTo: Set "Choice", evaluation file is a must-be for calculating statistics
"""
import torch
from pathlib import Path
import numpy as np
from thop impor... | [
"torchvision.models.segmentation.fcn_resnet50",
"torchvision.models.segmentation.deeplabv3_resnet101",
"torchvision.models.segmentation.lraspp_mobilenet_v3_large",
"numpy.median",
"torchvision.models.segmentation.fcn_resnet101",
"utils.network.GANet_dense_ga_accurate_small_link",
"pathlib.Path",
"thop... | [((647, 697), 'numpy.linspace', 'np.linspace', (['(5)', '(100)', '(19)'], {'dtype': 'int', 'endpoint': '(False)'}), '(5, 100, 19, dtype=int, endpoint=False)\n', (658, 697), True, 'import numpy as np\n'), ((6026, 6054), 'torch.randn', 'torch.randn', (['(1)', '(3)', '(512)', '(1024)'], {}), '(1, 3, 512, 1024)\n', (6037, ... |
# adapted from https://github.com/berenslab/mini-atlas/blob/master/code/patch-seq-data-load.ipynb
import numpy as np
import scanpy as sc
import math
#import pylab as plt
#import seaborn as sns
import pandas as pd
import pickle
import scipy.sparse
import scipy
import time
import warnings
import os
OUTPUT_FOLDER = './d... | [
"pandas.read_csv",
"os.path.join",
"numpy.array",
"pandas.DataFrame",
"scipy.sparse.csr_matrix"
] | [((375, 441), 'pandas.read_csv', 'pd.read_csv', (['"""./data/original/m1_patchseq_meta_data.csv"""'], {'sep': '"""\t"""'}), "('./data/original/m1_patchseq_meta_data.csv', sep='\\t')\n", (386, 441), True, 'import pandas as pd\n'), ((557, 653), 'pandas.read_csv', 'pd.read_csv', (['"""./data/original/m1_patchseq_exon_coun... |
from flask import Blueprint, current_app, abort, request, jsonify
from functools import wraps
from app.db import db, User, Hex, QuestionList, World
from datetime import datetime, timedelta
import numpy
bp = Blueprint('interface', __name__)
def validate_request(f):
@wraps(f)
def decorated_function(*args, **kw... | [
"datetime.datetime.utcfromtimestamp",
"app.db.World.query.filter_by",
"app.db.QuestionList.query.all",
"app.db.Hex.query.filter_by",
"app.db.db.session.commit",
"app.db.User.query.filter_by",
"app.db.World",
"functools.wraps",
"datetime.timedelta",
"datetime.datetime.now",
"numpy.random.randint"... | [((209, 241), 'flask.Blueprint', 'Blueprint', (['"""interface"""', '__name__'], {}), "('interface', __name__)\n", (218, 241), False, 'from flask import Blueprint, current_app, abort, request, jsonify\n'), ((273, 281), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (278, 281), False, 'from functools import wraps\n'),... |
import numpy as np
import torch
class Cutout(object):
"""Randomly mask out one or more patches from an image.
please refer to https://github.com/uoguelph-mlrg/Cutout/blob/master/util/cutout.py
Args:
n_holes (int): Number of patches to cut out of each image.
length (int): The length (in pixels) of each square... | [
"numpy.clip",
"numpy.random.random_sample",
"numpy.ones",
"torch.from_numpy",
"numpy.zeros",
"numpy.random.randint",
"numpy.expand_dims"
] | [((731, 758), 'numpy.ones', 'np.ones', (['(h, w)', 'np.float32'], {}), '((h, w), np.float32)\n', (738, 758), True, 'import numpy as np\n'), ((2223, 2242), 'numpy.zeros', 'np.zeros', (['new_shape'], {}), '(new_shape)\n', (2231, 2242), True, 'import numpy as np\n'), ((2387, 2421), 'numpy.random.randint', 'np.random.randi... |
import warnings
import numpy as np
import networkx as nx
from scipy.stats import logistic
from mossspider.estimators.utils import fast_exp_map
def uniform_network(n, degree, pr_w=0.35, seed=None):
"""Generates a uniform random graph for a set number of nodes (n) and specified max and min degree (degree).
Add... | [
"numpy.mean",
"networkx.relabel_nodes",
"mossspider.estimators.utils.fast_exp_map",
"numpy.random.default_rng",
"networkx.adjacency_matrix",
"networkx.selfloop_edges",
"scipy.stats.logistic.cdf",
"networkx.Graph",
"numpy.sum",
"networkx.configuration_model",
"numpy.random.binomial"
] | [((1085, 1112), 'numpy.random.default_rng', 'np.random.default_rng', (['seed'], {}), '(seed)\n', (1106, 1112), True, 'import numpy as np\n'), ((2689, 2735), 'networkx.configuration_model', 'nx.configuration_model', (['degree_dist'], {'seed': 'seed'}), '(degree_dist, seed=seed)\n', (2711, 2735), True, 'import networkx a... |
# -*- coding: utf-8 -*-
"""turtles.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1Wl6WD8ntb-XqJEb1m4CfYfHvWXR-99ok
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from IPython.display import HTML
... | [
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.plot",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"matplotlib.pyplot.axis",
"random.random",
"matplotlib.pyplot.subplots"
] | [((524, 538), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (536, 538), True, 'import matplotlib.pyplot as plt\n'), ((544, 572), 'matplotlib.pyplot.axis', 'plt.axis', (['[-40, 40, -40, 40]'], {}), '([-40, 40, -40, 40])\n', (552, 572), True, 'import matplotlib.pyplot as plt\n'), ((2162, 2239), 'matplot... |
import numpy as np
import matplotlib.pyplot as plt
from pyad.nn import NeuralNet
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
np.random.seed(0)
X, y = load_boston(return_X_y=True)
X_scaled = preprocessing.scale(X)
y_scaled = preproces... | [
"numpy.mean",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"sklearn.datasets.load_boston",
"matplotlib.pyplot.plot",
"pyad.nn.NeuralNet",
"numpy.sum",
"numpy.random.seed",
"matplotlib.pyplot.title",
"sklearn.pre... | [((211, 228), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (225, 228), True, 'import numpy as np\n'), ((237, 265), 'sklearn.datasets.load_boston', 'load_boston', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (248, 265), False, 'from sklearn.datasets import load_boston\n'), ((277, 299), 'sklea... |
import numpy as np
import unittest
from partitura import EXAMPLE_MUSICXML
from partitura import load_musicxml
from partitura.musicanalysis import estimate_spelling
def compare_spelling(spelling, notes):
comparisons = np.zeros((len(spelling), 3))
for i, (n, s) in enumerate(zip(notes, spelling)):
compa... | [
"partitura.load_musicxml",
"numpy.all",
"partitura.musicanalysis.estimate_spelling"
] | [((694, 725), 'partitura.load_musicxml', 'load_musicxml', (['EXAMPLE_MUSICXML'], {}), '(EXAMPLE_MUSICXML)\n', (707, 725), False, 'from partitura import load_musicxml\n'), ((771, 800), 'partitura.musicanalysis.estimate_spelling', 'estimate_spelling', (['self.score'], {}), '(self.score)\n', (788, 800), False, 'from parti... |
from argparse import ArgumentParser
from operator import itemgetter
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import sys
from itertools import combinations
from scaffold import Longreads
parser = ArgumentParser()
parser.add_argument("inputfiles", help="Input Files in Error-Rate or PAF fo... | [
"numpy.mean",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"pandas.DataFrame.from_dict",
"scaffold.Longreads",
"itertools.combinations",
"matplotlib.pyplot.scatter"
] | [((228, 244), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (242, 244), False, 'from argparse import ArgumentParser\n'), ((1228, 1280), 'scaffold.Longreads', 'Longreads', (['args.inputfiles', 'blacklist', 'args.linename'], {}), '(args.inputfiles, blacklist, args.linename)\n', (1237, 1280), False, 'from... |
from setuptools import Extension, setup
from Cython.Build import cythonize
import numpy as np
include_dirs = [np.get_include()]
extensions = [
# cython blas
Extension("struntho.utils._cython_blas",
["struntho/utils/_cython_blas.pyx"] # source files of extensiom
),
... | [
"setuptools.Extension",
"Cython.Build.cythonize",
"numpy.get_include"
] | [((111, 127), 'numpy.get_include', 'np.get_include', ([], {}), '()\n', (125, 127), True, 'import numpy as np\n'), ((175, 252), 'setuptools.Extension', 'Extension', (['"""struntho.utils._cython_blas"""', "['struntho/utils/_cython_blas.pyx']"], {}), "('struntho.utils._cython_blas', ['struntho/utils/_cython_blas.pyx'])\n"... |
# -*- coding: utf-8 -*-
import numpy as np
from sklearn.feature_extraction import image
from PIL import Image
from sklearn.preprocessing import normalize
from sklearn.neural_network import MLPClassifier
from sklearn.model_selection import cross_val_score
from sklearn import decomposition
from sklearn import datasets
im... | [
"numpy.mean",
"sklearn.neural_network.MLPClassifier",
"sklearn.decomposition.PCA",
"csv.writer",
"numpy.array",
"sklearn.model_selection.cross_val_score"
] | [((2590, 2610), 'csv.writer', 'csv.writer', (['csv_file'], {}), '(csv_file)\n', (2600, 2610), False, 'import csv\n'), ((1051, 1074), 'numpy.array', 'np.array', (['imagensTreino'], {}), '(imagensTreino)\n', (1059, 1074), True, 'import numpy as np\n'), ((1091, 1113), 'numpy.array', 'np.array', (['imagensTeste'], {}), '(i... |
import torch
import numpy as np
import json
from collections import Counter
class TranslationDatasetTorch(torch.utils.data.Dataset):
def __init__(self,
file_name,
source_field='src',
target_filed='tgt',
unk_idx=1,
sos_idx=2,
... | [
"json.loads",
"torch.stack",
"collections.Counter",
"numpy.array",
"torch.argsort"
] | [((2078, 2099), 'torch.stack', 'torch.stack', (['src_lens'], {}), '(src_lens)\n', (2089, 2099), False, 'import torch\n'), ((690, 699), 'collections.Counter', 'Counter', ([], {}), '()\n', (697, 699), False, 'from collections import Counter\n'), ((720, 729), 'collections.Counter', 'Counter', ([], {}), '()\n', (727, 729),... |
import sympy
from sympy import *
import numpy
from numpy import *
from numpy.linalg import matrix_rank
from sympy.parsing.sympy_parser import *
from sympy.matrices import *
import csv
import os
import random
from random import shuffle
def Reduce(eq):
for el in ['kPDK1', 'kAkt']:
el=parse_expr(el)
i... | [
"random.random",
"numpy.linalg.qr",
"random.shuffle",
"numpy.nonzero"
] | [((2546, 2567), 'numpy.linalg.qr', 'numpy.linalg.qr', (['ranM'], {}), '(ranM)\n', (2561, 2567), False, 'import numpy\n'), ((3804, 3821), 'random.shuffle', 'shuffle', (['rowliste'], {}), '(rowliste)\n', (3811, 3821), False, 'from random import shuffle\n'), ((3088, 3114), 'numpy.nonzero', 'numpy.nonzero', (['testM[:, i]'... |
import collections
import re
import string
import numpy
import six
import cupy
def calc_single_view(ioperand, subscript):
"""Calculates 'ii->i' by cupy.diagonal if needed.
Args:
ioperand (cupy.ndarray): Array to be calculated diagonal.
subscript (str):
Specifies the subscripts. ... | [
"cupy.tensordot",
"numpy.result_type",
"re.match",
"collections.Counter",
"collections.defaultdict",
"cupy.rollaxis",
"six.iteritems",
"cupy.asarray"
] | [((510, 539), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (533, 539), False, 'import collections\n'), ((661, 691), 'collections.Counter', 'collections.Counter', (['subscript'], {}), '(subscript)\n', (680, 691), False, 'import collections\n'), ((4122, 4153), 'collections.Counter', '... |
import cv2
import numpy as np
from PIL import Image
from scipy import ndimage
from skimage.filters import threshold_local
def resize(image, canvas_size):
# type: (np.array, tuple) -> np.array
"""Resize an image to specified size while preserving the aspect ratio.
The longer side of the image is made equa... | [
"cv2.threshold",
"PIL.Image.fromarray",
"numpy.zeros",
"numpy.where"
] | [((2264, 2330), 'cv2.threshold', 'cv2.threshold', (['im', '(0)', '(255)', '(cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)'], {}), '(im, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)\n', (2277, 2330), False, 'import cv2\n'), ((2405, 2426), 'numpy.where', 'np.where', (['(thresh != 0)'], {}), '(thresh != 0)\n', (2413, 2426)... |
import numpy as np
def apple_p(feature_vector,model):
processed_vector = np.array(feature_vector).reshape(1, -1)
output = model.predict(processed_vector)
output = int(output)
label_dict = {0 :'Apple___healthy', 1: 'Apple___Apple_scab', 2: 'Apple___Black_rot', 3: 'Apple___Cedar_apple_rust'}
output = label_dict[out... | [
"numpy.array"
] | [((75, 99), 'numpy.array', 'np.array', (['feature_vector'], {}), '(feature_vector)\n', (83, 99), True, 'import numpy as np\n'), ((395, 419), 'numpy.array', 'np.array', (['feature_vector'], {}), '(feature_vector)\n', (403, 419), True, 'import numpy as np\n'), ((778, 802), 'numpy.array', 'np.array', (['feature_vector'], ... |
import os
import logging
import numpy as np
import pandas as pd
from collections import OrderedDict
from model_learning.algorithms.max_entropy import THETA_STR
from model_learning.clustering.evaluation import evaluate_clustering
from model_learning.util.io import create_clear_dir, change_log_handler
from model_learning... | [
"model_learning.clustering.linear.get_clusters_means",
"numpy.mean",
"collections.OrderedDict",
"pandas.read_csv",
"os.path.join",
"os.path.isfile",
"numpy.array",
"model_learning.clustering.evaluation.evaluate_clustering",
"atomic.definitions.world_map.WorldMap.get_move_actions",
"model_learning.... | [((1306, 1331), 'os.path.isfile', 'os.path.isfile', (['file_path'], {}), '(file_path)\n', (1320, 1331), False, 'import os\n'), ((1395, 1430), 'pandas.read_csv', 'pd.read_csv', (['file_path'], {'index_col': '(0)'}), '(file_path, index_col=0)\n', (1406, 1430), True, 'import pandas as pd\n'), ((1895, 1920), 'os.path.isfil... |
import os
import zipfile
import json
from collections import OrderedDict
from collections import namedtuple
from enum import Enum
import gi
import numpy
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, Gdk, Pango, Gio, GLib, GdkPixbuf
from mxdc.utils import colors
from mxdc.conf import load_c... | [
"gi.repository.GdkPixbuf.Pixbuf.new_from_stream",
"collections.OrderedDict",
"collections.namedtuple",
"gi.repository.GdkPixbuf.Pixbuf.new_from_stream_at_scale",
"zipfile.ZipFile",
"gi.repository.Gtk.Builder",
"gi.repository.Gtk.TreeStore",
"gi.repository.Gdk.RGBA",
"gi.repository.Gtk.CellRendererPi... | [((155, 187), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (173, 187), False, 'import gi\n'), ((2683, 2748), 'collections.namedtuple', 'namedtuple', (['"""ColRow"""', "['data', 'title', 'type', 'text', 'expand']"], {}), "('ColRow', ['data', 'title', 'type', 'text', '... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from generator import generator, generate
from openvino.tools.mo.middle.L2NormFusing import L2NormToNorm
from openvino.tools.mo.front.common.partial_infer.utils import int64_array
from openvino.tools.... | [
"openvino.tools.mo.utils.ir_engine.compare_graphs.compare_graphs",
"numpy.array",
"openvino.tools.mo.middle.L2NormFusing.L2NormToNorm",
"openvino.tools.mo.front.common.partial_infer.utils.int64_array"
] | [((5065, 5128), 'openvino.tools.mo.utils.ir_engine.compare_graphs.compare_graphs', 'compare_graphs', (['graph', 'graph_ref', '"""result"""'], {'check_op_attrs': '(True)'}), "(graph, graph_ref, 'result', check_op_attrs=True)\n", (5079, 5128), False, 'from openvino.tools.mo.utils.ir_engine.compare_graphs import compare_g... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2017 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without lim... | [
"numpy.percentile"
] | [((2676, 2704), 'numpy.percentile', 'np.percentile', (['magnitude', '(75)'], {}), '(magnitude, 75)\n', (2689, 2704), True, 'import numpy as np\n'), ((2707, 2735), 'numpy.percentile', 'np.percentile', (['magnitude', '(25)'], {}), '(magnitude, 25)\n', (2720, 2735), True, 'import numpy as np\n'), ((3695, 3717), 'numpy.per... |
from cluster.preprocess.pre_node_feed import PreNodeFeed
from master.workflow.preprocess.workflow_feed_fr2auto import WorkflowFeedFr2Auto
import pandas as pd
import warnings
import numpy as np
from functools import reduce
from konlpy.tag import Mecab
from common.utils import *
class PreNodeFeedFr2Auto(PreNodeFeed):
... | [
"numpy.array",
"master.workflow.preprocess.workflow_feed_fr2auto.WorkflowFeedFr2Auto",
"warnings.warn",
"pandas.HDFStore",
"math.isnan"
] | [((653, 681), 'master.workflow.preprocess.workflow_feed_fr2auto.WorkflowFeedFr2Auto', 'WorkflowFeedFr2Auto', (['node_id'], {}), '(node_id)\n', (672, 681), False, 'from master.workflow.preprocess.workflow_feed_fr2auto import WorkflowFeedFr2Auto\n'), ((5819, 5832), 'math.isnan', 'math.isnan', (['x'], {}), '(x)\n', (5829,... |
import turbpy.multiConst as mc
import numpy as np
def bulkRichardson(airTemp, # air temperature (K)
sfcTemp, # surface temperature (K)
windspd, # wind speed (m s-1)
mHeight, # measurement height... | [
"numpy.max"
] | [((486, 501), 'numpy.max', 'np.max', (['airTemp'], {}), '(airTemp)\n', (492, 501), True, 'import numpy as np\n'), ((551, 566), 'numpy.max', 'np.max', (['sfcTemp'], {}), '(sfcTemp)\n', (557, 566), True, 'import numpy as np\n')] |
import argparse
import os
import numpy as np
from PIL import Image
from imgaug import augmenters as iaa
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="Input image path")
ap.add_argument("-o", "--output", required=False, default="prspt-transf", help="Output folder")
args = vars(a... | [
"os.path.exists",
"PIL.Image.fromarray",
"PIL.Image.open",
"os.makedirs",
"argparse.ArgumentParser",
"numpy.array",
"imgaug.augmenters.PerspectiveTransform",
"os.path.basename"
] | [((111, 136), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (134, 136), False, 'import argparse\n'), ((469, 490), 'PIL.Image.open', 'Image.open', (['imagefile'], {}), '(imagefile)\n', (479, 490), False, 'from PIL import Image\n'), ((371, 396), 'os.path.exists', 'os.path.exists', (['imagefile']... |
from rllab.envs.mujoco.ant_env_rand_crippled_joints import AntEnvRandDisable
import numpy as np
env = AntEnvRandDisable()
init_state = env.reset(reset_args= 3)
new_obs = init_state
for i in range(8000):
env.render()
action = np.random.uniform(-1.0, 1.0, env.action_space.shape[0])
print(env.model.geom_siz... | [
"rllab.envs.mujoco.ant_env_rand_crippled_joints.AntEnvRandDisable",
"numpy.random.uniform"
] | [((103, 122), 'rllab.envs.mujoco.ant_env_rand_crippled_joints.AntEnvRandDisable', 'AntEnvRandDisable', ([], {}), '()\n', (120, 122), False, 'from rllab.envs.mujoco.ant_env_rand_crippled_joints import AntEnvRandDisable\n'), ((235, 290), 'numpy.random.uniform', 'np.random.uniform', (['(-1.0)', '(1.0)', 'env.action_space.... |
# -*- coding: utf-8 -*-
"""
Date created: 03 August 2016
@author : <NAME>
@description : Velocity magnitudes calculator
"""
import numpy as np
import csv
# 1
xyz = np.zeros([0,3]) # Replace '3' with the number of columns in your csv file
# 2
with open ('hemeLB-csv-file-name') as csvfile:
file... | [
"numpy.zeros",
"numpy.sqrt",
"csv.reader"
] | [((182, 198), 'numpy.zeros', 'np.zeros', (['[0, 3]'], {}), '([0, 3])\n', (190, 198), True, 'import numpy as np\n'), ((769, 847), 'numpy.sqrt', 'np.sqrt', (['(xyz[:, 0] * xyz[:, 0] + xyz[:, 1] * xyz[:, 1] + xyz[:, 2] * xyz[:, 2])'], {}), '(xyz[:, 0] * xyz[:, 0] + xyz[:, 1] * xyz[:, 1] + xyz[:, 2] * xyz[:, 2])\n', (776, ... |
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
from biopandas.pdb import PandasPdb
from scipy.spatial.distance import squareform, pdist
def remove_ipynb_checkpoints(path):
flag = False
for i in range(len(os.listdir(path))):
if (os.listdir(path)[i] == '.ipynb_check... | [
"os.listdir",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"scipy.spatial.distance.pdist",
"matplotlib.pyplot.xlabel",
"numpy.append",
"numpy.array",
"os.rmdir",
"numpy.dot",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"biopandas.pdb.PandasPdb",
"numpy.triu",
"matplotlib.pyplot... | [((2590, 2635), 'numpy.array', 'np.array', (['[[-1, 0, 0], [0, -1, 0], [0, 0, 1]]'], {}), '([[-1, 0, 0], [0, -1, 0], [0, 0, 1]])\n', (2598, 2635), True, 'import numpy as np\n'), ((1267, 1288), 'numpy.array', 'np.array', (['anti_coords'], {}), '(anti_coords)\n', (1275, 1288), True, 'import numpy as np\n'), ((1354, 1394)... |
# Authors: <NAME>
# <NAME>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.size']=6
from scipy import linalg
import pandas as pd
from sklearn.decomposition import PCA, FactorAnalysis
from sklearn.covariance import ShrunkCovariance, LedoitWolf
from sklearn.model_s... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"sklearn.covariance.ShrunkCovariance",
"numpy.arange",
"numpy.multiply",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"pandas.concat",
"numpy.logspace",
"sklearn.model_selection.cross_val_score",
"matplotlib.p... | [((456, 483), 'os.path.abspath', 'os.path.abspath', (['"""__file__"""'], {}), "('__file__')\n", (471, 483), False, 'import os\n'), ((513, 552), 'os.path.join', 'os.path.join', (['root_path', 'os.path.pardir'], {}), '(root_path, os.path.pardir)\n', (525, 552), False, 'import os\n'), ((2201, 2238), 'pandas.concat', 'pd.c... |
#!/usr/bin/env python
# This program is re-implementation of getHeightmaps.m
from __future__ import division
from __future__ import print_function
import glob
import os
import os.path as osp
import warnings
import numpy as np
import skimage.io
import tqdm
from grasp_fusion_lib.contrib import grasp_fusion
def get... | [
"os.path.exists",
"grasp_fusion_lib.contrib.grasp_fusion.utils.heightmap_postprocess",
"os.path.join",
"grasp_fusion_lib.contrib.grasp_fusion.datasets.SuctionDataset",
"warnings.catch_warnings",
"grasp_fusion_lib.contrib.grasp_fusion.datasets.PinchDataset",
"numpy.array",
"grasp_fusion_lib.contrib.gra... | [((745, 781), 'os.path.join', 'osp.join', (['dataset_dir', '"""color-input"""'], {}), "(dataset_dir, 'color-input')\n", (753, 781), True, 'import os.path as osp\n'), ((1034, 1075), 'os.path.join', 'osp.join', (['dataset_dir', '"""heightmap-color2"""'], {}), "(dataset_dir, 'heightmap-color2')\n", (1042, 1075), True, 'im... |
# TODO
# - train an LFP decoder
# - run an LFP decoder
# - CLDA
import matplotlib.pyplot as plt
import os
import pyaudio
import serial
import pandas as pd
import numpy as np
import unittest
import time
import tables
from features.hdf_features import SaveHDF
from riglib import experiment
from riglib import sink
from f... | [
"numpy.hstack",
"built_in_tasks.passivetasks.TargetCaptureVFB2DWindow.centerout_2D_discrete",
"time.sleep",
"riglib.sink.sinks.register",
"numpy.arctan2",
"numpy.linalg.norm",
"numpy.sin",
"riglib.source.DataSource",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.plot",
"numpy.fft.fft",
"n... | [((3693, 3790), 'riglib.experiment.make', 'experiment.make', (['TargetCaptureVFB2DWindow'], {'feats': '[SaveHDF, SimLFPSensorFeature, SimLFPOutput]'}), '(TargetCaptureVFB2DWindow, feats=[SaveHDF,\n SimLFPSensorFeature, SimLFPOutput])\n', (3708, 3790), False, 'from riglib import experiment\n'), ((3812, 3881), 'built_... |
"""
Leontis-Westhof Nomenclature
============================
In this example we plot a secondary structure diagram annotated with
Leontis-Westhof nomenclature :footcite:`Leontis2001` of the sarcin-ricin
loop from E. coli (PDB ID: 6ZYB).
"""
# Code source: <NAME>
# License: BSD 3 clause
from tempfile import gettemp... | [
"biotite.structure.base_pairs",
"biotite.structure.residue_iter",
"biotite.structure.io.pdb.get_structure",
"tempfile.gettempdir",
"matplotlib.pyplot.subplots",
"biotite.structure.filter_nucleotides",
"biotite.structure.get_residue_count",
"numpy.full",
"biotite.structure.base_pairs_edge",
"biotit... | [((662, 693), 'biotite.structure.io.pdb.PDBFile.read', 'pdb.PDBFile.read', (['pdb_file_path'], {}), '(pdb_file_path)\n', (678, 693), True, 'import biotite.structure.io.pdb as pdb\n'), ((877, 906), 'biotite.structure.base_pairs', 'struc.base_pairs', (['nucleotides'], {}), '(nucleotides)\n', (893, 906), True, 'import bio... |
import os
import sys
import argparse
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator, NullFormatter, ScalarFormatter)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description = "Build haplotypes and make scatter plot for vizualiz... | [
"pandas.Series",
"matplotlib.pyplot.grid",
"pandas.read_csv",
"argparse.ArgumentParser",
"numpy.where",
"matplotlib.pyplot.xticks",
"pandas.merge",
"numpy.array",
"matplotlib.ticker.ScalarFormatter",
"matplotlib.pyplot.yticks",
"numpy.vstack",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot... | [((2305, 2342), 'pandas.read_csv', 'pd.read_csv', (['gmm_file'], {'delimiter': '"""\t"""'}), "(gmm_file, delimiter='\\t')\n", (2316, 2342), True, 'import pandas as pd\n'), ((3352, 3388), 'pandas.read_csv', 'pd.read_csv', (['db_file'], {'delimiter': '"""\t"""'}), "(db_file, delimiter='\\t')\n", (3363, 3388), True, 'impo... |
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
import tensorflow as tf
from tensorflow.keras.models import load_model
from functions.sub_data_prep import create_trainingdata_baseline
from functions.tf_model_base import create_baseline_model_ffn, creat... | [
"functions.tf_model_base.transfer_weights_dense2simpleRNN",
"tensorflow.keras.losses.KLDivergence",
"functions.sub_backtesting.check_if_rnn_version",
"tensorflow.keras.callbacks.LearningRateScheduler",
"sklearn.utils.shuffle",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"functions.sub_data_p... | [((1231, 1326), 'tensorflow.keras.callbacks.EarlyStopping', 'tf.keras.callbacks.EarlyStopping', ([], {'monitor': '"""mape"""', 'patience': '(10000)', 'restore_best_weights': '(True)'}), "(monitor='mape', patience=10000,\n restore_best_weights=True)\n", (1263, 1326), True, 'import tensorflow as tf\n'), ((2884, 2974),... |
# @Author: <NAME> <arthur>
# @Date: 09.05.2021
# @Filename: test_gdt.py
# @Last modified by: arthur
# @Last modified time: 15.09.2021
import pyrexMD.misc as misc
import pyrexMD.analysis.gdt as gdt
from pyrexMD.analysis.analyze import get_Distance_Matrices
import MDAnalysis as mda
import numpy as np
from numpy.tes... | [
"pyrexMD.analysis.gdt.plot_GDT",
"pyrexMD.analysis.gdt.GDT_continuous_segments",
"pyrexMD.analysis.gdt.get_GDT_TS",
"pyrexMD.analysis.gdt.GDT_rank_percent",
"pyrexMD.analysis.gdt.get_continuous_segments",
"pyrexMD.analysis.gdt.plot_LA",
"unittest.mock.patch",
"pathlib.Path",
"numpy.testing.assert_al... | [((735, 746), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (744, 746), False, 'import os\n'), ((5264, 5295), 'unittest.mock.patch', 'patch', (['"""matplotlib.pyplot.show"""'], {}), "('matplotlib.pyplot.show')\n", (5269, 5295), False, 'from unittest.mock import patch\n'), ((7661, 7692), 'unittest.mock.patch', 'patch', ([... |
import logging
import time
from typing import Dict, List, Union
import numpy as np
from pymatgen.electronic_structure.core import Spin
from amset.constants import int_to_spin, numeric_types
from amset.electronic_structure.symmetry import (
rotation_matrix_to_su2,
similarity_transformation,
)
from amset.log im... | [
"logging.getLogger",
"numpy.abs",
"amset.electronic_structure.symmetry.rotation_matrix_to_su2",
"numpy.random.choice",
"numpy.conj",
"numpy.conjugate",
"time.perf_counter",
"amset.electronic_structure.symmetry.similarity_transformation",
"amset.util.get_progress_bar",
"numpy.stack",
"numpy.dot",... | [((461, 488), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (478, 488), False, 'import logging\n'), ((1202, 1227), 'numpy.concatenate', 'np.concatenate', (['spin_idxs'], {}), '(spin_idxs)\n', (1216, 1227), True, 'import numpy as np\n'), ((1244, 1269), 'numpy.concatenate', 'np.concatenate... |
#!/usr/bin/env python
#%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%#
#%!%!% ----------------------------- FPTE_Result_Stress_2nd ----------------------------- %!%!%#
#%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%!%#
... | [
"numpy.mat",
"os.path.exists",
"time.asctime",
"numpy.linalg.eig",
"numpy.polyfit",
"os.chdir",
"numpy.array",
"numpy.zeros",
"numpy.linalg.inv",
"numpy.linalg.lstsq",
"sys.exit",
"os.system"
] | [((19581, 19609), 'os.chdir', 'os.chdir', (['"""Stress-vs-Strain"""'], {}), "('Stress-vs-Strain')\n", (19589, 19609), False, 'import os\n'), ((24612, 24627), 'numpy.array', 'np.array', (['sigma'], {}), '(sigma)\n', (24620, 24627), True, 'import numpy as np\n'), ((24640, 24670), 'numpy.linalg.lstsq', 'np.linalg.lstsq', ... |
from __future__ import division, absolute_import, print_function
from builtins import range
import numpy as np
import os
import sys
import esutil
import time
import matplotlib.pyplot as plt
import scipy.optimize
from astropy.time import Time
from .sharedNumpyMemManager import SharedNumpyMemManager as snmm
class Fgcm... | [
"numpy.abs",
"numpy.unique",
"numpy.where",
"numpy.max",
"numpy.argsort",
"astropy.time.Time",
"matplotlib.pyplot.figure",
"builtins.range",
"matplotlib.pyplot.close",
"numpy.zeros",
"numpy.append",
"numpy.min",
"numpy.sum",
"matplotlib.pyplot.set_cmap",
"numpy.zeros_like",
"esutil.sta... | [((2206, 2341), 'numpy.where', 'np.where', (['((obsMagADUModelErr[goodObs] < self.ccdGrayMaxStarErr) & (obsMagADUModelErr\n [goodObs] > 0.0) & (obsMagStd[goodObs] < 90.0))'], {}), '((obsMagADUModelErr[goodObs] < self.ccdGrayMaxStarErr) & (\n obsMagADUModelErr[goodObs] > 0.0) & (obsMagStd[goodObs] < 90.0))\n', (22... |
"""
Imbalance metrics.
Author: <NAME>, agilescientific.com
Licence: Apache 2.0
Copyright 2022 Agile Scientific
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/L... | [
"numpy.abs",
"numpy.sqrt",
"numpy.log",
"numpy.asarray",
"numpy.argmax",
"collections.Counter",
"numpy.array",
"numpy.sum"
] | [((1197, 1207), 'collections.Counter', 'Counter', (['a'], {}), '(a)\n', (1204, 1207), False, 'from collections import Counter\n'), ((3686, 3697), 'numpy.array', 'np.array', (['i'], {}), '(i)\n', (3694, 3697), True, 'import numpy as np\n'), ((6128, 6141), 'numpy.asarray', 'np.asarray', (['a'], {}), '(a)\n', (6138, 6141)... |
import pytest
import numpy as np
from pyckmeans.io import NucleotideAlignment
from pyckmeans.distance.c_interop import \
p_distance,\
jc_distance,\
k2p_distance
@pytest.fixture(scope='session')
def prepare_alignments():
aln_0 = NucleotideAlignment(
['s0', 's1', 's2', 's3'],
np.array([... | [
"numpy.abs",
"pyckmeans.distance.c_interop.jc_distance",
"numpy.array",
"pyckmeans.distance.c_interop.k2p_distance",
"pyckmeans.distance.c_interop.p_distance",
"pytest.fixture"
] | [((177, 208), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (191, 208), False, 'import pytest\n'), ((609, 748), 'numpy.array', 'np.array', (['[[0.0, 0.2222222, 0.1, 0.3], [0.2222222, 0.0, 0.3333333, 0.5555556], [0.1, \n 0.3333333, 0.0, 0.4], [0.3, 0.5555556, 0.4, 0.0]]'... |
"""
@author: <NAME>
@file: preprocess_sst_dms.py
@time: 2021/5/11 10:17
@description:
"""
"""
DMS: direct multi-step, don't need to predict all predictors
"""
import os
import json
import random
import numpy as np
import tensorflow as tf
import netCDF4 as nc
from sklearn.preprocessing import StandardScaler, MinMaxScal... | [
"numpy.reshape",
"sklearn.model_selection.train_test_split",
"tensorflow.io.TFRecordWriter",
"tensorflow.train.Int64List",
"hparams.Hparams",
"tensorflow.train.BytesList",
"tensorflow.constant",
"tensorflow.train.FloatList",
"numpy.load",
"sklearn.preprocessing.MinMaxScaler"
] | [((462, 471), 'hparams.Hparams', 'Hparams', ([], {}), '()\n', (469, 471), False, 'from hparams import Hparams\n'), ((1392, 1406), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {}), '()\n', (1404, 1406), False, 'from sklearn.preprocessing import StandardScaler, MinMaxScaler, Normalizer\n'), ((2478, 2573), '... |
__author__ = 'DafniAntotsiou'
import mujoco_py
from numpy import array
from copy import deepcopy
import numpy as np
def GetBodyPosDist(bodyId, refbodyId, m):
bodyPos = array([0, 0, 0], dtype='f8')
if refbodyId < 0:
return bodyPos
while bodyId > refbodyId:
bodyPos += m.body_pos[bodyId]
... | [
"numpy.array",
"numpy.copy",
"numpy.float64",
"copy.deepcopy"
] | [((175, 203), 'numpy.array', 'array', (['[0, 0, 0]'], {'dtype': '"""f8"""'}), "([0, 0, 0], dtype='f8')\n", (180, 203), False, 'from numpy import array\n'), ((439, 467), 'numpy.array', 'array', (['[0, 0, 0]'], {'dtype': '"""f8"""'}), "([0, 0, 0], dtype='f8')\n", (444, 467), False, 'from numpy import array\n'), ((732, 76... |
import numpy as np
import scipy.integrate as integrate
from sklearn.neighbors.kde import KernelDensity
from scipy.stats import truncnorm
import multiprocessing as mp
import itertools
import matplotlib.pyplot as plt
import warnings
import statsmodels.api as sm
from statsmodels.distributions.empirical_distribution import... | [
"numpy.random.rand",
"numpy.hstack",
"multiprocessing.cpu_count",
"numpy.mean",
"numpy.reshape",
"numpy.where",
"numpy.asarray",
"numpy.max",
"sklearn.neighbors.kde.KernelDensity",
"numpy.vstack",
"numpy.min",
"numpy.argmin",
"numpy.ones",
"statsmodels.api.nonparametric.KDEUnivariate",
"... | [((383, 416), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (406, 416), False, 'import warnings\n'), ((544, 563), 'numpy.zeros', 'np.zeros', (['(3, 2, 2)'], {}), '((3, 2, 2))\n', (552, 563), True, 'import numpy as np\n'), ((2685, 2709), 'numpy.mean', 'np.mean', (['samples... |
import torch
import torch.nn as nn
import functools
from .simple_layers import SimpleLayerBase, SimpleOutputBase, SimpleModule, SimpleMergeBase
from ..layers.utils import div_shape
from ..train.outputs_trw import OutputClassification as OutputClassification_train
from ..train.outputs_trw import OutputEmbedding as Outp... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"numpy.prod",
"torch.nn.MaxPool3d",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"functools.partial",
"torch.nn.Linear",
"torch.nn.BatchNorm3d",
"torch.reshape",
"torch.nn.Conv3d"
] | [((1981, 2038), 'functools.partial', 'functools.partial', (['OutputEmbedding_train'], {'functor': 'functor'}), '(OutputEmbedding_train, functor=functor)\n', (1998, 2038), False, 'import functools\n'), ((3106, 3134), 'torch.reshape', 'torch.reshape', (['x', 'self.shape'], {}), '(x, self.shape)\n', (3119, 3134), False, '... |
import gvar as gv
import numpy as np
data_file = 'data/a094m400mL6.0trMc_cfgs5-105_srcs0-15.h5'
reweight = True
rw_files = 'data/a094m400mL6.0trMc_cfgs5-105.h5'
rw_path = 'reweighting-factors'
fit_states = ['pion', 'proton', 'omega']
bs_seed = 'a094m400mL6.0trMc'
# the pion data has a terrible condition number, ... | [
"gvar.gvar",
"numpy.log",
"gvar.BufferDict",
"numpy.arange"
] | [((2284, 2299), 'gvar.BufferDict', 'gv.BufferDict', ([], {}), '()\n', (2297, 2299), True, 'import gvar as gv\n'), ((2341, 2360), 'gvar.gvar', 'gv.gvar', (['(0.56)', '(0.06)'], {}), '(0.56, 0.06)\n', (2348, 2360), True, 'import gvar as gv\n'), ((2384, 2403), 'gvar.gvar', 'gv.gvar', (['(0.04)', '(0.01)'], {}), '(0.04, 0.... |
import numpy as np
import matplotlib.pyplot as plt
class Signal:
def __init__(self, min_value, max_value, length_dots):
self.min_value = min_value
self.max_value = max_value
self.length_dots = length_dots
def generate_signal(self):
number_array = np.linspace(self.mi... | [
"numpy.random.normal",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.sin",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((301, 362), 'numpy.linspace', 'np.linspace', (['self.min_value', 'self.max_value', 'self.length_dots'], {}), '(self.min_value, self.max_value, self.length_dots)\n', (312, 362), True, 'import numpy as np\n'), ((529, 549), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(3)', '(1)', '(1)'], {}), '(3, 1, 1)\n', (540, 549... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... | [
"numpy.repeat",
"numpy.ones",
"numpy.log",
"numpy.asarray",
"numpy.asanyarray",
"numpy.sum",
"numpy.zeros",
"numpy.linalg.inv"
] | [((2837, 2855), 'numpy.asarray', 'np.asarray', (['affine'], {}), '(affine)\n', (2847, 2855), True, 'import numpy as np\n'), ((11508, 11524), 'numpy.asarray', 'np.asarray', (['fwhm'], {}), '(fwhm)\n', (11518, 11524), True, 'import numpy as np\n'), ((956, 965), 'numpy.log', 'np.log', (['(2)'], {}), '(2)\n', (962, 965), T... |
import numpy as np
import torch
from pgbar import progress_bar
class RayS(object):
def __init__(self, model, epsilon=0.031, order=np.inf):
self.model = model
self.ord = order
self.epsilon = epsilon
self.sgn_t = None
self.d_t = None
self.x_final = None
self.q... | [
"numpy.prod",
"numpy.ceil",
"torch.ones_like",
"torch.mean",
"torch.min",
"torch.tensor",
"torch.sum",
"numpy.random.seed",
"torch.zeros_like",
"torch.clamp",
"torch.ones"
] | [((527, 551), 'torch.clamp', 'torch.clamp', (['out', 'lb', 'ub'], {}), '(out, lb, ub)\n', (538, 551), False, 'import torch\n'), ((849, 867), 'numpy.prod', 'np.prod', (['shape[1:]'], {}), '(shape[1:])\n', (856, 867), True, 'import numpy as np\n'), ((2763, 2804), 'torch.clamp', 'torch.clamp', (['stop_queries', '(0)', 'qu... |
from numpy import array
from pybimstab.astar import Astar
grid = array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 1, 1, 0, 0],
[1, 1, 0, 0, 1, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 1, 0, 1, 0, 0, 1],
[0, 0, 1, 1, 0, 1, 1, 1, 0, 0],
[0, 0, 0, 1, 1, 0,... | [
"numpy.array",
"pybimstab.astar.Astar"
] | [((65, 410), 'numpy.array', 'array', (['[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 1, 0, 0], [1, 1, 0, \n 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 0, 1, 0, 0, 1], [0, 0, 1, 1, 0, 1,\n 1, 1, 0, 0], [0, 0, 0, 1, 1, 0, 1, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 1, 0,\n 0], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0], [0, 0, ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, List, Optional, Type
import cv2
import numpy as np
from gym import spaces
import habitat
from ... | [
"numpy.ceil",
"habitat.core.simulator.SensorSuite",
"numpy.round",
"habitat.tasks.utils.cartesian_to_polar",
"cv2.line",
"numpy.any",
"gym.spaces.Box",
"numpy.array",
"numpy.finfo",
"habitat.utils.visualizations.maps.to_grid",
"habitat.utils.visualizations.maps.get_topdown_map",
"habitat.core.... | [((9852, 9914), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(-np.pi)', 'high': 'np.pi', 'shape': '(1,)', 'dtype': 'np.float'}), '(low=-np.pi, high=np.pi, shape=(1,), dtype=np.float)\n', (9862, 9914), False, 'from gym import spaces\n'), ((10100, 10120), 'numpy.array', 'np.array', (['[0, 0, -1]'], {}), '([0, 0, -1])\n'... |
import numpy as np
class Graph:
def __init__(self, vertices):
self._adjMat = np.zeros((vertices, vertices))
self._vertices = vertices
def insert_edge(self, u, v, x=1):
self._adjMat[u][v] = x
def remove_edge(self, u, v):
self._adjMat[u][v] = 0
def exist_edge(self, u, ... | [
"numpy.zeros"
] | [((91, 121), 'numpy.zeros', 'np.zeros', (['(vertices, vertices)'], {}), '((vertices, vertices))\n', (99, 121), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""
@author: LiuXin
@contact: <EMAIL>
@Created on: DATE{TIME}
"""
from __future__ import print_function, division
import os
from PIL import Image
import numpy as np
import torch
from torch.utils.data import Dataset
from mypath import Path
from torchvision import transforms
from dataloader.transf... | [
"numpy.all",
"PIL.Image.open",
"dataloader.transforms_utils.custom_transforms.FixedResize",
"dataloader.transforms_utils.custom_transforms.Normalize",
"dataloader.transforms_utils.custom_transforms.RandomScaleCrop",
"os.path.join",
"numpy.asarray",
"mypath.Path.db_root_dir",
"dataloader.transforms_u... | [((756, 927), 'numpy.asarray', 'np.asarray', (['[[0, 0, 0], [128, 0, 0], [0, 128, 0], [128, 128, 0], [0, 0, 128], [128, 0, \n 128], [0, 128, 128], [128, 128, 128], [64, 0, 0], [192, 0, 0], [64, 128, 0]\n ]'], {}), '([[0, 0, 0], [128, 0, 0], [0, 128, 0], [128, 128, 0], [0, 0, 128],\n [128, 0, 128], [0, 128, 128... |
from copy import deepcopy
import dendropy
from iterpop import iterpop as ip
import itertools as it
import numpy as np
from sortedcontainers import SortedSet
def dendropy_tree_to_scipy_linkage_matrix(tree: dendropy.Tree) -> np.array:
# scipy linkage format
# http://docs.scipy.org/doc/scipy/reference/generated/... | [
"numpy.array",
"itertools.count",
"copy.deepcopy"
] | [((421, 435), 'copy.deepcopy', 'deepcopy', (['tree'], {}), '(tree)\n', (429, 435), False, 'from copy import deepcopy\n'), ((785, 795), 'itertools.count', 'it.count', ([], {}), '()\n', (793, 795), True, 'import itertools as it\n'), ((2719, 2732), 'numpy.array', 'np.array', (['res'], {}), '(res)\n', (2727, 2732), True, '... |
# coding: utf-8
# Copyright (c) 2021 AkaiKKRteam.
# Distributed under the terms of the Apache License, Version 2.0.
import numpy as np
from pymatgen.analysis.structure_analyzer import VoronoiConnectivity
from pymatgen.core import Structure
def min_dist_matrix(structure: Structure) -> float:
"""make minimum distan... | [
"numpy.zeros",
"pymatgen.analysis.structure_analyzer.VoronoiConnectivity"
] | [((569, 585), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (577, 585), True, 'import numpy as np\n'), ((599, 629), 'pymatgen.analysis.structure_analyzer.VoronoiConnectivity', 'VoronoiConnectivity', (['structure'], {}), '(structure)\n', (618, 629), False, 'from pymatgen.analysis.structure_analyzer import V... |
"""Implementation of Pointer networks: http://arxiv.org/pdf/1506.03134v1.pdf.
"""
from __future__ import absolute_import, division, print_function
import random
import numpy as np
import tensorflow as tf
from dataset import DataGenerator
from pointer import pointer_decoder
flags = tf.app.flags
FLAGS = flags.FLAGS
... | [
"numpy.argsort",
"tensorflow.contrib.rnn.GRUCell",
"pointer.pointer_decoder",
"tensorflow.reduce_mean",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.concat",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.train.AdamOptimizer",
"tensorflow.zeros",
"tensorflow.contri... | [((7849, 7864), 'dataset.DataGenerator', 'DataGenerator', ([], {}), '()\n', (7862, 7864), False, 'from dataset import DataGenerator\n'), ((1747, 1778), 'tensorflow.Variable', 'tf.Variable', (['(0)'], {'trainable': '(False)'}), '(0, trainable=False)\n', (1758, 1778), True, 'import tensorflow as tf\n'), ((1795, 1823), 't... |
import cv2
import numpy as np
corners = np.array([[0, 0], [0, 1], [2, 0]])
# given corner computer the distance matrix
M = get_graph(corners, 1)
print(M) | [
"numpy.array"
] | [((41, 75), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [2, 0]]'], {}), '([[0, 0], [0, 1], [2, 0]])\n', (49, 75), True, 'import numpy as np\n')] |
# !/usr/bin/env python
# encoding: utf-8
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Main RLQA retriever training script."""
import argparse
import json
import os
import sys
... | [
"logging.getLogger",
"logging.StreamHandler",
"rlqa.retriever.utils.top_question_words",
"rlqa.retriever.data.Dictionary",
"rlqa.retriever.utils.Timer",
"torch.cuda.is_available",
"numpy.mean",
"rlqa.retriever.RLDocRetriever.load_checkpoint",
"argparse.ArgumentParser",
"torch.utils.data.sampler.Se... | [((586, 605), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (603, 605), False, 'import logging\n'), ((816, 851), 'os.path.join', 'os.path.join', (['RLQA_DATA', '"""datasets"""'], {}), "(RLQA_DATA, 'datasets')\n", (828, 851), False, 'import os\n'), ((864, 899), 'os.path.join', 'os.path.join', (['RLQA_DATA'... |
# Copyright 2021 PCL & PKU
# 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... | [
"cfg_parser.merge_args",
"moxing.file.make_dirs",
"mindspore.train.loss_scale_manager.FixedLossScaleManager",
"time.sleep",
"mindspore.nn.optim.Momentum",
"mlperf_logging.mllog.config",
"argparse.ArgumentParser",
"moxing.file.exists",
"moxing.file.remove",
"os.path.split",
"mindspore.dataset.con... | [((1416, 1444), 'os.getenv', 'os.getenv', (['"""RANK_TABLE_FILE"""'], {}), "('RANK_TABLE_FILE')\n", (1425, 1444), False, 'import os\n'), ((1691, 1782), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE', 'device_target': '"""Ascend"""', 'save_graphs': '(False)'}), "(mode=context.... |
import codes.my_helper as helper
import cv2
import numpy as np
import random
# TODO: megcsinálni
def create_skeleton(labels):
skeletons = []
for img in labels:
# shape: (256, 320)
size = np.size(img)
skel = np.zeros(img.shape, np.uint8)
ret, img = cv2.threshold(img, 127, 255, ... | [
"numpy.hstack",
"numpy.polyfit",
"codes.my_helper.read_images",
"cv2.imshow",
"cv2.bitwise_or",
"cv2.threshold",
"cv2.erode",
"cv2.line",
"numpy.linspace",
"numpy.vstack",
"cv2.waitKey",
"cv2.drawContours",
"codes.my_helper.resize_images",
"random.randrange",
"numpy.size",
"cv2.cvtColo... | [((7098, 7147), 'codes.my_helper.read_images', 'helper.read_images', (['"""../datas/images_roma/label/"""'], {}), "('../datas/images_roma/label/')\n", (7116, 7147), True, 'import codes.my_helper as helper\n'), ((7210, 7244), 'codes.my_helper.resize_images', 'helper.resize_images', (['labels', 'size'], {}), '(labels, si... |
import numpy as np
class FDBuffer(object):
"""A block of possibly-zero frequency-domain samples of a given size.
Attributes:
is_zero (bool): Are all samples in this block zero? If False, then buffer is not Null.
buffer (None or array): Complex samples.
"""
def __init__(self, block_siz... | [
"numpy.fft.irfft",
"numpy.any",
"numpy.fft.rfft",
"numpy.array",
"numpy.zeros"
] | [((951, 961), 'numpy.any', 'np.any', (['td'], {}), '(td)\n', (957, 961), True, 'import numpy as np\n'), ((3620, 3652), 'numpy.zeros', 'np.zeros', (['(n_in, block_size * 2)'], {}), '((n_in, block_size * 2))\n', (3628, 3652), True, 'import numpy as np\n'), ((503, 550), 'numpy.zeros', 'np.zeros', (['(self.block_size + 1)'... |
import unittest
import numpy as np
from desc.backend import jnp
from desc.derivatives import AutoDiffDerivative, FiniteDiffDerivative
from numpy.random import default_rng
class TestDerivative(unittest.TestCase):
"""Tests Grid classes"""
def test_finite_diff_vec(self):
def test_fun(x, y, a):
... | [
"desc.derivatives.FiniteDiffDerivative.compute_jvp3",
"desc.derivatives.AutoDiffDerivative.compute_jvp",
"numpy.random.default_rng",
"desc.derivatives.FiniteDiffDerivative.compute_jvp2",
"desc.derivatives.AutoDiffDerivative.compute_jvp3",
"numpy.ones",
"numpy.arange",
"numpy.testing.assert_allclose",
... | [((355, 382), 'numpy.array', 'np.array', (['[1, 5, 0.01, 200]'], {}), '([1, 5, 0.01, 200])\n', (363, 382), True, 'import numpy as np\n'), ((395, 423), 'numpy.array', 'np.array', (['[60, 1, 100, 0.02]'], {}), '([60, 1, 100, 0.02])\n', (403, 423), True, 'import numpy as np\n'), ((454, 494), 'desc.derivatives.FiniteDiffDe... |
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 21 10:18:03 2017
@author: damodara
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
import matplotlib.patches as mpatches
import os
def imshow_grid(images, shape=[2, 8]):
"""Plot images in a gri... | [
"sklearn.manifold.TSNE",
"numpy.max",
"matplotlib.pyplot.yticks",
"numpy.vstack",
"mpl_toolkits.axes_grid1.ImageGrid",
"numpy.min",
"matplotlib.pyplot.savefig",
"numpy.ones",
"matplotlib.pyplot.xticks",
"matplotlib.patches.Patch",
"matplotlib.pyplot.title",
"numpy.shape",
"matplotlib.pyplot.... | [((354, 367), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (364, 367), True, 'import matplotlib.pyplot as plt\n'), ((380, 433), 'mpl_toolkits.axes_grid1.ImageGrid', 'ImageGrid', (['fig', '(111)'], {'nrows_ncols': 'shape', 'axes_pad': '(0.05)'}), '(fig, 111, nrows_ncols=shape, axes_pad=0.05)\n', (38... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Definition of the RL policy (policy based on a neural network value model)."""
import os
import numpy as np
from copy import deepcopy
import tensorflow as tf
from .policy import Policy, policy_name
# _____________________ parameters _____________________
EPSILON = 1... | [
"tensorflow.reshape",
"numpy.asarray",
"numpy.min",
"numpy.sum",
"copy.deepcopy",
"tensorflow.math.reduce_sum",
"numpy.maximum"
] | [((3151, 3187), 'numpy.asarray', 'np.asarray', (['inputs'], {'dtype': 'np.float32'}), '(inputs, dtype=np.float32)\n', (3161, 3187), True, 'import numpy as np\n'), ((3237, 3272), 'numpy.asarray', 'np.asarray', (['probs'], {'dtype': 'np.float32'}), '(probs, dtype=np.float32)\n', (3247, 3272), True, 'import numpy as np\n'... |
"""
将原来的数据库,变成一个stock id一个文件的数据库
"""
import os
import pandas as pd
import numpy as np
import pickle
# 导入行情数据
file_path = 'C:/Users/Administrator/Desktop/program/data/hangqing/'
file_list = os.listdir(file_path)
columns_name = pd.read_csv(file_path+file_list[0]).columns
hangqing_record = []
temp_r... | [
"os.listdir",
"numpy.unique",
"pandas.read_csv",
"pandas.merge",
"pandas.read_table",
"pandas.DataFrame",
"pandas.concat"
] | [((207, 228), 'os.listdir', 'os.listdir', (['file_path'], {}), '(file_path)\n', (217, 228), False, 'import os\n'), ((328, 362), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'columns_name'}), '(columns=columns_name)\n', (340, 362), True, 'import pandas as pd\n'), ((1129, 1150), 'os.listdir', 'os.listdir', (['fil... |
import io
import numpy as np
import tensorflow as tf
from hparams import hparams
from models import create_model
from util import audio, textinput
class Synthesizer:
def load(self, checkpoint_path, model_name='tacotron'):
print('Constructing model: %s' % model_name)
inputs = tf.placeholder(tf.int32, [1, Non... | [
"util.textinput.to_sequence",
"util.audio.inv_spectrogram",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"tensorflow.Session",
"io.BytesIO",
"numpy.asarray",
"tensorflow.global_variables_initializer",
"models.create_model"
] | [((288, 333), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32', '[1, None]', '"""inputs"""'], {}), "(tf.int32, [1, None], 'inputs')\n", (302, 333), True, 'import tensorflow as tf\n'), ((354, 400), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32', '[1]', '"""input_lengths"""'], {}), "(tf.int32, [1], 'inp... |
import pandas
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
from sklearn import preprocessing
from helper import qda,misc_helper
dataFrame = pandas.read_csv('../CSV_Data/dataset_8.csv')
sum_acc = 0
sum_co... | [
"numpy.add",
"helper.misc_helper.write_matrix",
"helper.qda.find_accuracy",
"pandas.read_csv"
] | [((255, 299), 'pandas.read_csv', 'pandas.read_csv', (['"""../CSV_Data/dataset_8.csv"""'], {}), "('../CSV_Data/dataset_8.csv')\n", (270, 299), False, 'import pandas\n'), ((526, 595), 'helper.misc_helper.write_matrix', 'misc_helper.write_matrix', (['sum_confusion', '"""conf_matrices/qda_conf.csv"""'], {}), "(sum_confusio... |
# -*- coding: utf-8 -*-
#The MIT License (MIT)
#
#Copyright (c) 2014 <NAME>
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to us... | [
"numpy.abs",
"numpy.linalg.eig",
"chemtools.calculators.gamessreader.DictionaryFile",
"numpy.where",
"numpy.max",
"chemtools.calculators.gamessus.GamessDatParser",
"numpy.array",
"chemtools.calculators.gamessreader.tri2full",
"chemtools.calculators.gamessus.GamessLogParser",
"numpy.dot",
"numpy.... | [((3812, 3835), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'vecs'}), '(data=vecs)\n', (3824, 3835), True, 'import pandas as pd\n'), ((4632, 4661), 'chemtools.calculators.gamessreader.DictionaryFile', 'DictionaryFile', (['self.dictfile'], {}), '(self.dictfile)\n', (4646, 4661), False, 'from chemtools.calculators.... |
import unittest
import glob
import os.path as op
def BOLD_FIR_files( analysis_info,
experiment,
fir_file_reward_list = '',
glm_file_mapper_list = '',
behavior_file_list = '',
mapper_contrast ... | [
"utils.behavior.behavior_timing",
"pandas.DataFrame",
"spynoza.nodes.utils.get_scaninfo",
"os.path.join",
"os.path.split",
"numpy.squeeze",
"numpy.linspace",
"utils.roi_data_from_hdf",
"pandas.HDFStore"
] | [((2062, 2099), 'spynoza.nodes.utils.get_scaninfo', 'get_scaninfo', (['fir_file_reward_list[1]'], {}), '(fir_file_reward_list[1])\n', (2074, 2099), False, 'from spynoza.nodes.utils import get_scaninfo\n'), ((2198, 2255), 'utils.behavior.behavior_timing', 'behavior_timing', (['experiment', 'behavior_file_list', 'dyns', ... |
#! /usr/bin/python3
from logging import fatal
from math import atan2
import matplotlib.pyplot as plt
import numpy as np
import cv2
import rospy
from rospy.core import rospywarn
import tf2_ros
import time
from std_msgs.msg import Float32
from geometry_msgs.msg import QuaternionStamped
from geometry_msgs.msg import Po... | [
"rospy.is_shutdown",
"tf2_ros.TransformListener",
"rospy.init_node",
"rospy.get_time",
"transtonumpy.msg_to_se3",
"time.sleep",
"geometry_msgs.msg.PointStamped",
"tf2_ros.Buffer",
"numpy.array",
"math.atan2",
"numpy.savetxt",
"copy.deepcopy",
"rospy.Duration",
"rospy.Subscriber",
"time.t... | [((423, 466), 'rospy.init_node', 'rospy.init_node', (['"""dataConv"""'], {'anonymous': '(True)'}), "('dataConv', anonymous=True)\n", (438, 466), False, 'import rospy\n'), ((485, 501), 'tf2_ros.Buffer', 'tf2_ros.Buffer', ([], {}), '()\n', (499, 501), False, 'import tf2_ros\n'), ((563, 579), 'rospy.get_time', 'rospy.get_... |
"""
4. How to combine many series to form a dataframe?
"""
"""
Difficulty Level: L1
"""
"""
Combine ser1 and ser2 to form a dataframe.
"""
"""
Input
"""
"""
import numpy as np
ser1 = pd.Series(list('abcedfghijklmnopqrstuvwxyz'))
ser2 = pd.Series(np.arange(26))
"""
# Input
import numpy as np
ser1 = pd.Series(list('abce... | [
"numpy.arange"
] | [((363, 376), 'numpy.arange', 'np.arange', (['(26)'], {}), '(26)\n', (372, 376), True, 'import numpy as np\n')] |
"""Draw a fancy map"""
import sys
import numpy as np
from shapely.wkb import loads
from matplotlib.patches import Polygon
import matplotlib.colors as mpcolors
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from pyiem.plot import MapPlot
from pyiem.util import get_dbconn
def main():
"""GO!"""
pgco... | [
"numpy.asarray",
"pyiem.util.get_dbconn",
"pyiem.plot.MapPlot",
"matplotlib.colors.BoundaryNorm",
"cartopy.crs.Geodetic",
"matplotlib.patches.Polygon",
"matplotlib.pyplot.get_cmap"
] | [((325, 343), 'pyiem.util.get_dbconn', 'get_dbconn', (['"""idep"""'], {}), "('idep')\n", (335, 343), False, 'from pyiem.util import get_dbconn\n'), ((415, 619), 'pyiem.plot.MapPlot', 'MapPlot', ([], {'sector': '"""iowa"""', 'axisbg': '"""white"""', 'nologo': '(True)', 'subtitle': '"""1 Jan 2014 thru 31 Dec 2014"""', 'c... |
"""
POVM effect representation classes for the `statevec_slow` evolution type.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 wi... | [
"numpy.product",
"pygsti.baseobjs.statespace.StateSpace.cast",
"numpy.vdot",
"numpy.array",
"numpy.empty"
] | [((944, 973), 'pygsti.baseobjs.statespace.StateSpace.cast', '_StateSpace.cast', (['state_space'], {}), '(state_space)\n', (960, 973), True, 'from pygsti.baseobjs.statespace import StateSpace as _StateSpace\n'), ((1624, 1665), 'numpy.vdot', '_np.vdot', (['self.state_rep.data', 'state.data'], {}), '(self.state_rep.data, ... |
import logging
import tensorflow as tf
from data_all import get_dataset, get_train_pipeline
from training_all import train
from model_small import BIGBIGAN_G, BIGBIGAN_D_F, BIGBIGAN_D_H, BIGBIGAN_D_J, BIGBIGAN_E
import numpy as np
import os
from PIL import Image
def save_image(img, fname):
img = img*255.0
img ... | [
"model_small.BIGBIGAN_D_H",
"tensorflow.split",
"logging.info",
"os.path.exists",
"data_all.get_dataset",
"tensorflow.initializers.TruncatedNormal",
"tensorflow.initializers.orthogonal",
"numpy.max",
"tensorflow.config.threading.set_inter_op_parallelism_threads",
"model_small.BIGBIGAN_E",
"numpy... | [((1145, 1200), 'tensorflow.config.threading.set_inter_op_parallelism_threads', 'tf.config.threading.set_inter_op_parallelism_threads', (['(8)'], {}), '(8)\n', (1197, 1200), True, 'import tensorflow as tf\n'), ((1205, 1260), 'tensorflow.config.threading.set_intra_op_parallelism_threads', 'tf.config.threading.set_intra_... |
import os
import numpy as np
from PIL import Image
from tqdm import tqdm
# 0.83102435 0.83786940 0.73139444
# 0.27632148 0.20124162 0.29032342
def calc(*paths):
imgs = []
for path in paths:
for name in tqdm(os.listdir(path)):
img = Image.open(os.path.join(path, name)).convert('RGB')
... | [
"numpy.array",
"os.listdir",
"os.path.join",
"numpy.concatenate"
] | [((481, 509), 'numpy.concatenate', 'np.concatenate', (['imgs'], {'axis': '(0)'}), '(imgs, axis=0)\n', (495, 509), True, 'import numpy as np\n'), ((225, 241), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (235, 241), False, 'import os\n'), ((332, 362), 'numpy.array', 'np.array', (['img'], {'dtype': '"""float32... |
#!/usr/bin/env python
# _*_coding:utf-8_*_
import sys
import pandas as pd
import numpy as np
import rpy2
import rpy2.robjects
from rpy2.robjects import numpy2ri
numpy2ri.activate()
r = rpy2.robjects.r
r.library('Peptides')
GROUPS_SA = ['ALFCGIVW', 'RKQEND', 'MSPTHY'] #solventaccess
GROUPS_HB = ['ILVWAMGT', 'FYSQCN', ... | [
"numpy.hstack",
"sys.stderr.write",
"numpy.array",
"sys.exit",
"pandas.DataFrame",
"rpy2.robjects.numpy2ri.activate"
] | [((162, 181), 'rpy2.robjects.numpy2ri.activate', 'numpy2ri.activate', ([], {}), '()\n', (179, 181), False, 'from rpy2.robjects import numpy2ri\n'), ((2226, 2267), 'numpy.hstack', 'np.hstack', (['[aaComp, rfeatures, encodings]'], {}), '([aaComp, rfeatures, encodings])\n', (2235, 2267), True, 'import numpy as np\n'), ((2... |
# PyVision License
#
# Copyright (c) 2006-2008 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list o... | [
"numpy.log",
"cv.Scale",
"pyvision.OpenCVToNumpy",
"math.log",
"cv.GetSubRect",
"pyvision.face.CascadeDetector.CascadeDetector",
"pyvision.Point",
"cv.MulSpectrums",
"pyvision.analysis.FaceAnalysis.FaceDatabase.ScrapShotsDatabase",
"cv.DFT",
"cv.Resize",
"array.array",
"struct.pack",
"cv.C... | [((2812, 2837), 'sys.stderr.write', 'sys.stderr.write', (['warning'], {}), '(warning)\n', (2828, 2837), False, 'import sys\n'), ((5396, 5412), 'array.array', 'array.array', (['"""f"""'], {}), "('f')\n", (5407, 5412), False, 'import array\n'), ((5422, 5438), 'array.array', 'array.array', (['"""f"""'], {}), "('f')\n", (5... |
# -*- coding: utf-8 -*-
#
# Developed by <NAME> <<EMAIL>>
#
# References:
# - https://github.com/ultralytics/yolov5/blob/master/utils/datasets.py
import os
import cv2
import torch
import numpy as np
from torch.utils.data import Dataset, DataLoader
from util.common import exr2normal, exr2depth, img2bgr, pkl2mesh, re... | [
"torch.from_numpy",
"numpy.ascontiguousarray",
"util.common.pkl2mesh",
"os.cpu_count",
"numpy.mod",
"util.common.exr2depth",
"util.common.img2bgr",
"util.common.load_mesh_paths",
"util.common.resize_img",
"numpy.max",
"numpy.concatenate",
"numpy.floor",
"cv2.resize",
"numpy.unique",
"cv2... | [((901, 1004), 'torch.utils.data.DataLoader', 'DataLoader', (['dataset'], {'batch_size': 'batch_size', 'num_workers': 'nw', 'pin_memory': 'pin_memory', 'shuffle': 'shuffle'}), '(dataset, batch_size=batch_size, num_workers=nw, pin_memory=\n pin_memory, shuffle=shuffle)\n', (911, 1004), False, 'from torch.utils.data i... |
import codecs
from decomposition import PrincipalComponentAnalysis, LinearDiscriminantAnalysis
from retriever.data_collection import DataCollection, EDataType
from plot import plot_stuff
from sklearn.metrics import precision_recall_fscore_support
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_se... | [
"numpy.mean",
"retriever.data_collection.DataCollection",
"sklearn.metrics.precision_recall_fscore_support",
"sklearn.neighbors.KNeighborsClassifier",
"decomposition.PrincipalComponentAnalysis",
"codecs.open",
"sklearn.model_selection.KFold",
"decomposition.LinearDiscriminantAnalysis"
] | [((407, 437), 'retriever.data_collection.DataCollection', 'DataCollection', (['"""res/promise/"""'], {}), "('res/promise/')\n", (421, 437), False, 'from retriever.data_collection import DataCollection, EDataType\n'), ((445, 473), 'decomposition.PrincipalComponentAnalysis', 'PrincipalComponentAnalysis', ([], {}), '()\n'... |
"""
===================
Isotonic Regression
===================
An illustration of the isotonic regression on generated data. The
isotonic regression finds a non-decreasing approximation of a function
while minimizing the mean squared error on the training data. The benefit
of such a model is that it does not assume a... | [
"sklearn.utils.check_random_state",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"numpy.expand_dims",
"matplotlib.pyplot.title",
"sklearn.linear_model.LinearRegression",
"numpy.arange"
] | [((774, 786), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (783, 786), True, 'import numpy as np\n'), ((792, 813), 'sklearn.utils.check_random_state', 'check_random_state', (['(0)'], {}), '(0)\n', (810, 813), False, 'from sklearn.utils import check_random_state\n'), ((886, 904), 'sklearn.linear_model.LinearRegres... |
#!/bin/env/python
'''
test quijote halo readins
'''
import numpy as np
from boss_sbi.halos import Quijote_LHC_HR
halos = Quijote_LHC_HR(1, z=0.5)
print(np.array(halos['Position']))
| [
"boss_sbi.halos.Quijote_LHC_HR",
"numpy.array"
] | [((125, 149), 'boss_sbi.halos.Quijote_LHC_HR', 'Quijote_LHC_HR', (['(1)'], {'z': '(0.5)'}), '(1, z=0.5)\n', (139, 149), False, 'from boss_sbi.halos import Quijote_LHC_HR\n'), ((156, 183), 'numpy.array', 'np.array', (["halos['Position']"], {}), "(halos['Position'])\n", (164, 183), True, 'import numpy as np\n')] |
"""Tests for skio/codec.py"""
from skio import intdecode, intencode
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_almost_equal
IDAT = np.array(((0, 1, 2), (3, 4, 5))) # Integer data
FDAT = np.array(((0.0, 0.5, 1.0), (1.5, 2.0, 2.5))) # Float data
FDAT_NEG = np.array(((-2.0, -1.0, 0... | [
"skio.intencode",
"numpy.testing.assert_equal",
"numpy.array",
"numpy.testing.assert_almost_equal",
"pytest.raises",
"skio.intdecode"
] | [((170, 202), 'numpy.array', 'np.array', (['((0, 1, 2), (3, 4, 5))'], {}), '(((0, 1, 2), (3, 4, 5)))\n', (178, 202), True, 'import numpy as np\n'), ((226, 270), 'numpy.array', 'np.array', (['((0.0, 0.5, 1.0), (1.5, 2.0, 2.5))'], {}), '(((0.0, 0.5, 1.0), (1.5, 2.0, 2.5)))\n', (234, 270), True, 'import numpy as np\n'), (... |
# -*- coding: utf-8 -*-
"""
biosppy.stats
---------------
This module provides statistica functions and related tools.
:copyright: (c) 2015-2021 by Instituto de Telecomunicacoes
:license: BSD 3-clause, see LICENSE for more details.
"""
# Imports
# compat
from __future__ import absolute_import, division, print_functi... | [
"numpy.polyfit",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.array",
"scipy.stats.ttest_rel",
"scipy.stats.ttest_ind",
"matplotlib.pyplot.scatter",
"scipy.stats.pearsonr",
"numpy.poly1d",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend"
] | [((1516, 1527), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (1524, 1527), True, 'import numpy as np\n'), ((1536, 1547), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (1544, 1547), True, 'import numpy as np\n'), ((1671, 1685), 'scipy.stats.pearsonr', 'pearsonr', (['x', 'y'], {}), '(x, y)\n', (1679, 1685), False,... |
# Copyright 2020 The FastEstimator 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 appl... | [
"fastestimator.test.unittest_util.is_equal",
"numpy.array",
"torch.tensor",
"fastestimator.backend.percentile",
"tensorflow.constant"
] | [((1000, 1019), 'tensorflow.constant', 'tf.constant', (['[1, 2]'], {}), '([1, 2])\n', (1011, 1019), True, 'import tensorflow as tf\n'), ((1039, 1079), 'fastestimator.backend.percentile', 'fe.backend.percentile', (['t'], {'percentiles': '(50)'}), '(t, percentiles=50)\n', (1060, 1079), True, 'import fastestimator as fe\n... |
"""
This simple sensor-network environment consists of a few parts:
- The node-graph to explore.
- Each node has a 'name' vector for directing the traversal, and the node's resource amount (never less than 0).
- Each node has directed edges to a few neighbors.
- Nodes mostly form a tree, sometimes with... | [
"numpy.abs",
"random.uniform",
"random.choice",
"numpy.random.rand",
"numpy.array",
"numpy.stack"
] | [((7623, 7666), 'random.choice', 'random.choice', (['"""ABCDEFGHIJKLMNOPQRSTUVWXYZ"""'], {}), "('ABCDEFGHIJKLMNOPQRSTUVWXYZ')\n", (7636, 7666), False, 'import random\n'), ((8695, 8736), 'numpy.random.rand', 'np.random.rand', (["options['node_name_size']"], {}), "(options['node_name_size'])\n", (8709, 8736), True, 'impo... |
# -*- coding: utf-8 -*-
from torch.nn import functional as F
import torch.nn as nn
from PIL import Image
import numpy as np
from skimage.io import imsave
import cv2
import torch.nn as nn
import torch
from torch.autograd import Variable
from torchvision import models
from collections import namedtuple
import pdb
import... | [
"collections.namedtuple",
"torch.nn.Sequential",
"torch.eye",
"torch.load",
"torch.Tensor",
"torch.from_numpy",
"torch.nn.Conv2d",
"numpy.array",
"numpy.zeros",
"torch.tensor",
"cv2.cvtColor",
"torchvision.models.vgg16",
"cv2.imread"
] | [((830, 877), 'numpy.array', 'np.array', (['[[0, -1, 0], [-1, 4, -1], [0, -1, 0]]'], {}), '([[0, -1, 0], [-1, 4, -1], [0, -1, 0]])\n', (838, 877), True, 'import numpy as np\n'), ((899, 962), 'torch.nn.Conv2d', 'nn.Conv2d', (['(1)', '(1)'], {'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)', 'bias': '(False)'}), '... |
# -*- coding: utf-8 -*-
"""
The :func:`ground_truth_normalizer()`, :func:`ground_truth_normalize_row` and
:class:`TestLocalResponseNormalization2DLayer` implementations contain code
from `pylearn2 <http://github.com/lisa-lab/pylearn2>`_, which is covered
by the following license:
Copyright (c) 2011--2014, Universit... | [
"numpy.prod",
"theano.tensor.constant",
"numpy.allclose",
"lasagne.layers.input.InputLayer",
"numpy.random.rand",
"lasagne.layers.dnn.batch_norm_dnn",
"mock.Mock",
"lasagne.layers.dnn.BatchNormDNNLayer",
"lasagne.layers.get_output",
"pytest.mark.parametrize",
"numpy.zeros",
"lasagne.layers.nor... | [((11165, 11210), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dnn"""', '[False, True]'], {}), "('dnn', [False, True])\n", (11188, 11210), False, 'import pytest\n'), ((1940, 1960), 'numpy.zeros', 'np.zeros', (['c01b.shape'], {}), '(c01b.shape)\n', (1948, 1960), True, 'import numpy as np\n'), ((2350, 2369... |
#!/usr/bin/env python3
import numpy as np
class KMeans(object):
"""
Performs the K-Means Clustering algorithm i.e. Lloyd's algorithm a.k.a. Voronoi iteration or relaxation
Parameters
--------------------------------------------------
k : int the number of clusters to form i.e. the num... | [
"numpy.mean",
"numpy.median",
"numpy.append",
"numpy.array",
"numpy.zeros",
"numpy.random.randint",
"numpy.random.seed",
"numpy.linalg.norm",
"numpy.argmin"
] | [((1335, 1365), 'numpy.random.seed', 'np.random.seed', ([], {'seed': 'self.seed'}), '(seed=self.seed)\n', (1349, 1365), True, 'import numpy as np\n'), ((1420, 1431), 'numpy.zeros', 'np.zeros', (['m'], {}), '(m)\n', (1428, 1431), True, 'import numpy as np\n'), ((1452, 1473), 'numpy.zeros', 'np.zeros', (['[m, self.k]'], ... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
color = sns.color_palette()
# %matplotlib inline
pd.options.mode.chained_assignment=None
def col_count_plot_v1(df, col, create_plot=True):
cnt_srs = df[col].value_counts()
color=sns.color_palette()
plt.figure(fi... | [
"numpy.unique",
"seaborn.color_palette",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks",
"pandas.read_csv",
"matplotlib.pyplot.xlabel",
"seaborn.heatmap",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"seaborn.barplot",
"matplotlib.pyplot.show"
] | [((101, 120), 'seaborn.color_palette', 'sns.color_palette', ([], {}), '()\n', (118, 120), True, 'import seaborn as sns\n'), ((283, 302), 'seaborn.color_palette', 'sns.color_palette', ([], {}), '()\n', (300, 302), True, 'import seaborn as sns\n'), ((307, 334), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '... |
#!/usr/bin/env python3
"""
This example uses a configuration file in JSON format to
process the events and apply pre-selection cuts to the images
(charge and number of pixels).
An HDF5 file is written with image MC and moment parameters
(e.g. length, width, image amplitude, etc.).
"""
import numpy as np
from tqdm impo... | [
"ctapipe.io.EventSourceFactory.produce",
"ctapipe.io.HDF5TableWriter",
"ctapipe.image.hillas_parameters",
"ctapipe.core.traits.Bool",
"ctapipe.core.traits.Unicode",
"ctapipe.utils.CutFlow.CutFlow",
"tqdm.tqdm",
"ctapipe.calib.CameraCalibrator",
"numpy.count_nonzero",
"numpy.sum",
"ctapipe.image.... | [((713, 729), 'ctapipe.core.traits.Unicode', 'Unicode', (['__doc__'], {}), '(__doc__)\n', (720, 729), False, 'from ctapipe.core.traits import Unicode, List, Dict, Bool\n'), ((1000, 1185), 'ctapipe.core.traits.Dict', 'Dict', (["{'infile': 'EventSourceFactory.input_url', 'outfile':\n 'SimpleEventWriter.outfile', 'max-... |
import numpy as np
from scipy.spatial import distance
from scipy.sparse import csgraph
from matplotlib import pyplot
from matplotlib.widgets import Slider, Button, RadioButtons
import linear_utilities as lu
def rkm(X, init_W, s, plot_ax=None):
"""
Regularized K-means for principal path, MINIMIZER.
Arg... | [
"numpy.sqrt",
"numpy.linalg.pinv",
"numpy.hstack",
"numpy.logical_not",
"numpy.log",
"scipy.sparse.csgraph.dijkstra",
"numpy.argsort",
"numpy.linalg.norm",
"matplotlib.widgets.Slider",
"numpy.mean",
"numpy.flip",
"numpy.where",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.stack",
"num... | [((1116, 1140), 'numpy.zeros', 'np.zeros', (['[NC, d]', 'float'], {}), '([NC, d], float)\n', (1124, 1140), True, 'import numpy as np\n'), ((1335, 1375), 'scipy.spatial.distance.cdist', 'distance.cdist', (['X', 'init_W', '"""sqeuclidean"""'], {}), "(X, init_W, 'sqeuclidean')\n", (1349, 1375), False, 'from scipy.spatial ... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.optim import lr_scheduler
import numpy as np
import contextlib
import math
from medseg.models.segmentation_models.... | [
"medseg.models.segmentation_models.unet.UNet",
"torch.optim.lr_scheduler.LambdaLR",
"numpy.random.rand",
"torch.max",
"torch.sqrt",
"torch.min",
"torch.softmax",
"numpy.array",
"torch.cuda.is_available",
"torch.nn.functional.softmax",
"torch.nn.functional.nll_loss",
"torch.mean",
"medseg.com... | [((3932, 3959), 'torch.nn.functional.log_softmax', 'F.log_softmax', (['input'], {'dim': '(1)'}), '(input, dim=1)\n', (3945, 3959), True, 'import torch.nn.functional as F\n'), ((6332, 6419), 'torch.zeros', 'torch.zeros', (['(batch_size * h * w)', 'num_classes'], {'dtype': 'torch.float32', 'device': 'y.device'}), '(batch... |
"""Generates sets of testing indices for the galaxy classification task.
<NAME>
The Australian National University
2016
"""
import argparse
import h5py
import numpy
from .config import config
ATLAS_WIDTH = config['surveys']['atlas']['fits_width']
ATLAS_HEIGHT = config['surveys']['atlas']['fits_height']
ATLAS_SIZE... | [
"numpy.array",
"h5py.File",
"argparse.ArgumentParser",
"numpy.random.shuffle"
] | [((2699, 2722), 'numpy.array', 'numpy.array', (['test_sets_'], {}), '(test_sets_)\n', (2710, 2722), False, 'import numpy\n'), ((4099, 4124), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4122, 4124), False, 'import argparse\n'), ((1596, 1629), 'numpy.random.shuffle', 'numpy.random.shuffle', (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.