code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import sys import os import json import numpy as np import scipy as sp from scipy.linalg import svdvals, expm from focont import accessories as acc def _parse_matrix_definition(d, n): if type(d) == str: d = d.strip() ind = d.find('I') if ind > -1: d = d.strip('I').strip() if d: g =...
[ "scipy.linalg.expm", "json.load", "scipy.io.loadmat", "numpy.logspace", "scipy.linalg.block_diag", "scipy.linalg.svdvals", "numpy.zeros", "numpy.shape", "numpy.linalg.matrix_rank", "numpy.array", "os.path.splitext", "numpy.matmul", "focont.accessories.is_symmetric", "numpy.linalg.inv", "...
[((779, 799), 'numpy.array', 'np.array', (["pdata['A']"], {}), "(pdata['A'])\n", (787, 799), True, 'import numpy as np\n'), ((1183, 1203), 'numpy.array', 'np.array', (["pdata['B']"], {}), "(pdata['B'])\n", (1191, 1203), True, 'import numpy as np\n'), ((5072, 5090), 'numpy.logspace', 'np.logspace', (['(-2)', '(5)'], {})...
""" :copyright: Copyright 2006-2013 by the PyNN team, see AUTHORS. :license: CeCILL, see LICENSE for details. """ import numpy import brian from pyNN import recording from pyNN.brian import simulator import logging mV = brian.mV ms = brian.ms uS = brian.uS logger = logging.getLogger("PyNN") # --- For implementatio...
[ "brian.SpikeMonitor", "pyNN.recording.Recorder.__init__", "numpy.concatenate", "brian.StateMonitor", "numpy.empty", "numpy.ones", "logging.getLogger", "pyNN.brian.simulator.state.add", "numpy.array", "numpy.vstack" ]
[((270, 295), 'logging.getLogger', 'logging.getLogger', (['"""PyNN"""'], {}), "('PyNN')\n", (287, 295), False, 'import logging\n'), ((611, 672), 'pyNN.recording.Recorder.__init__', 'recording.Recorder.__init__', (['self', 'variable', 'population', 'file'], {}), '(self, variable, population, file)\n', (638, 672), False,...
""" 网络训练 首先,正负样本分成3个阶段 第一阶段是RPN的先验框是否包含物体(包含具体物体为正样本,包含背景为负样本),这可以初步预测出建议框 第二阶段是判断建议框与真实框的重合度,(可以线性回归的是正样本,必须非线性回归的是负样本) 第三阶段是最终选出的建议框中,所含物体的类别,多个二分类构成的多分类 其次,训练分两个阶段 第一阶段,训练RPN得到建议框 第二阶段,使用RPN提取建议框,训练建议框中的物体分类与边框细致回归 """ import sys sys.path.append("..") from net import fasterrcnn as frcnn from fasterRCNNtrain import ...
[ "keras.utils.generic_utils.Progbar", "numpy.random.seed", "fasterRCNNtrain.loss_and_gen.get_img_output_length", "net.fasterrcnn.get_model", "numpy.shape", "net.tools.BBoxUtility", "numpy.mean", "fasterRCNNtrain.loss_and_gen.cls_loss", "sys.path.append", "tensorflow.Summary", "fasterRCNNtrain.los...
[((233, 254), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (248, 254), False, 'import sys\n'), ((1114, 1132), 'net.netconfig.Config', 'netconfig.Config', ([], {}), '()\n', (1130, 1132), True, 'from net import netconfig as netconfig\n'), ((1259, 1363), 'net.tools.BBoxUtility', 'tools.BBoxUtility...
#!/usr/bin/env python import rospy import numpy as np from std_msgs.msg import Float32MultiArray from geometry_msgs.msg import Twist from simple_pid import PID class AutonomousControlNode(object): def __init__(self): self.node_name = rospy.get_name() rospy.loginfo("[%s] Initializing " %(self.node_n...
[ "simple_pid.PID", "rospy.Subscriber", "numpy.average", "numpy.zeros", "rospy.Publisher", "geometry_msgs.msg.Twist", "rospy.loginfo", "rospy.on_shutdown", "rospy.init_node", "rospy.get_name", "rospy.spin", "rospy.Duration" ]
[((2097, 2156), 'rospy.init_node', 'rospy.init_node', (['"""autonomous_control_node"""'], {'anonymous': '(False)'}), "('autonomous_control_node', anonymous=False)\n", (2112, 2156), False, 'import rospy\n'), ((2196, 2208), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (2206, 2208), False, 'import rospy\n'), ((247, 263),...
import numpy as np import sys def acc(p, g, start, end): return (p[start:end] == g[start:end]).mean() gt_path = 'hans_evalset_full_lbl_file' gt_labels = [] with open(gt_path, 'r') as f: for line in f: gt_labels.append(line.strip()) gt_labels = np.array(gt_labels) results_path = sys.argv[1] #'../../....
[ "numpy.array" ]
[((263, 282), 'numpy.array', 'np.array', (['gt_labels'], {}), '(gt_labels)\n', (271, 282), True, 'import numpy as np\n'), ((561, 576), 'numpy.array', 'np.array', (['preds'], {}), '(preds)\n', (569, 576), True, 'import numpy as np\n')]
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "numpy.pad", "mindspore.common.tensor.Tensor", "numpy.sum" ]
[((1390, 1478), 'numpy.pad', 'np.pad', (['origin_inputs', '((0, 0), (0, pad_length))', '"""constant"""'], {'constant_values': '(0, 0)'}), "(origin_inputs, ((0, 0), (0, pad_length)), 'constant',\n constant_values=(0, 0))\n", (1396, 1478), True, 'import numpy as np\n'), ((2484, 2504), 'numpy.sum', 'np.sum', (['(output...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import ray from ray.rllib.agent import Agent from ray.rllib.ddpg.ddpg_evaluator import DDPGEvaluator, RemoteDDPGEvaluator from ray.rllib.optimizers import LocalSyncReplayOptimizer from ray.t...
[ "numpy.sum", "ray.get", "numpy.mean", "ray.rllib.ddpg.ddpg_evaluator.RemoteDDPGEvaluator.remote", "ray.tune.result.TrainingResult", "ray.rllib.ddpg.ddpg_evaluator.DDPGEvaluator", "ray.rllib.optimizers.LocalSyncReplayOptimizer" ]
[((1768, 1827), 'ray.rllib.ddpg.ddpg_evaluator.DDPGEvaluator', 'DDPGEvaluator', (['self.registry', 'self.env_creator', 'self.config'], {}), '(self.registry, self.env_creator, self.config)\n', (1781, 1827), False, 'from ray.rllib.ddpg.ddpg_evaluator import DDPGEvaluator, RemoteDDPGEvaluator\n'), ((2059, 2159), 'ray.rlli...
from typing import Tuple, Dict, Union, Iterable import numpy as np from jina.executors.crafters import BaseCrafter from .helper import _load_image, _move_channel_axis, _crop_image, _resize_short class ImageNormalizer(BaseCrafter): """:class:`ImageNormalizer` works on doc-level, it receives values of fil...
[ "numpy.array" ]
[((2067, 2085), 'numpy.array', 'np.array', (['img_mean'], {}), '(img_mean)\n', (2075, 2085), True, 'import numpy as np\n'), ((2128, 2145), 'numpy.array', 'np.array', (['img_std'], {}), '(img_std)\n', (2136, 2145), True, 'import numpy as np\n'), ((2837, 2850), 'numpy.array', 'np.array', (['img'], {}), '(img)\n', (2845, ...
import json import time import pandas as pd import sklearn import yaml import werkzeug from flask import Flask,render_template,url_for,request from flask_restful import reqparse, Resource import numpy as np import pandas as pd import argparse import os import sys import time from sklearn.metrics import balanced_accu...
[ "sys.path.append", "pandas.DataFrame", "os.makedirs", "os.getcwd", "pandas.read_csv", "flask_restful.reqparse.RequestParser", "numpy.zeros", "os.path.exists", "json.dumps", "time.time", "solnml.utils.data_manager.DataManager", "solnml.estimators.Classifier" ]
[((414, 436), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (429, 436), False, 'import sys\n'), ((401, 412), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (410, 412), False, 'import os\n'), ((705, 729), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (727, 729...
#! /usr/bin/env python3 import rclpy from rclpy.node import Node from rclpy.duration import Duration import time import sys import numpy as np import copy import pickle import gzip import lzma from std_msgs.msg import String from nav_msgs.msg import OccupancyGrid from action_msgs.msg import GoalStatus from multi_robot_...
[ "multi_robot_interfaces.srv.WfdService.Request", "multi_robot_interfaces.action.WfdAction.Goal", "rclpy.shutdown", "lzma.compress", "sys.exc_info", "multi_robot_explore.window_WFD.WindowWFD", "multi_robot_interfaces.srv.GetPeerMapValueOnCoords.Request", "geometry_msgs.msg.PoseStamped", "multi_robot_...
[((55403, 55424), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (55413, 55424), False, 'import rclpy\n'), ((55626, 55651), 'rclpy.executors.MultiThreadedExecutor', 'MultiThreadedExecutor', (['(16)'], {}), '(16)\n', (55647, 55651), False, 'from rclpy.executors import MultiThreadedExecutor\n'), ((5...
import sys import numpy as np import matplotlib.pyplot as plt dimensions=[2,3,4,5,6,7,8,9,10] print("Gaussian dimensional analysis \n") #Decision Tree p_1_dt = [] p_2_dt = [] p_3_dt = [] for dim in range(2,11): temp1,temp2,temp3 = np.loadtxt("../dt_gauss/"+str(dim)+'Dgauss_dt_p_values_1_2_3_std_dev.txt') p_1_dt.ap...
[ "matplotlib.pyplot.figure", "numpy.array", "numpy.loadtxt", "matplotlib.pyplot.ylim" ]
[((2157, 2195), 'numpy.array', 'np.array', (['[10, 2, 3, 4, 5, 6, 7, 8, 9]'], {}), '([10, 2, 3, 4, 5, 6, 7, 8, 9])\n', (2165, 2195), True, 'import numpy as np\n'), ((2226, 2275), 'numpy.loadtxt', 'np.loadtxt', (['"""gaussian_dimensionality_analysis_nn"""'], {}), "('gaussian_dimensionality_analysis_nn')\n", (2236, 2275)...
import numpy from chainer import cuda from chainer import function from chainer.functions.connection import convolution_2d from chainer.utils import conv from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cuda.cudnn.cudnn _cudnn_version = libcudnn.getVersion() _f...
[ "numpy.rollaxis", "chainer.utils.conv.im2col_gpu", "chainer.utils.type_check.expect", "chainer.utils.conv.col2im_cpu", "chainer.cuda.get_max_workspace_size", "chainer.utils.conv.get_deconv_outsize", "chainer.utils.conv.get_conv_outsize", "numpy.tensordot", "chainer.cuda.cupy.tensordot", "chainer.u...
[((1257, 1296), 'chainer.utils.type_check.expect', 'type_check.expect', (['(2 <= n_in)', '(n_in <= 3)'], {}), '(2 <= n_in, n_in <= 3)\n', (1274, 1296), False, 'from chainer.utils import type_check\n'), ((1344, 1490), 'chainer.utils.type_check.expect', 'type_check.expect', (["(x_type.dtype.kind == 'f')", "(w_type.dtype....
import numpy as np from unittest import TestCase from pyppca import ppca class TestPpca(TestCase): def setUp(self) -> None: """Creates some data to use in test(s) below""" n_dims = 10 n_obs = 10000 missing_rate = .0001 self.n_latent = 10 W = np.random.normal(loc=0,...
[ "numpy.full", "numpy.random.seed", "numpy.abs", "numpy.floor", "pyppca.ppca", "numpy.random.normal", "numpy.random.shuffle" ]
[((297, 361), 'numpy.random.normal', 'np.random.normal', ([], {'loc': '(0)', 'scale': '(0.1)', 'size': '(n_dims, self.n_latent)'}), '(loc=0, scale=0.1, size=(n_dims, self.n_latent))\n', (313, 361), True, 'import numpy as np\n'), ((370, 387), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (384, 387), Tru...
import os import re import numpy as np from argparse import ArgumentParser from collections import namedtuple, Counter from typing import Dict, Iterable, Any from utils.constants import TRAIN, VALID, TEST, INPUTS, OUTPUT, SAMPLE_ID from utils.data_writer import DataWriter from utils.file_utils import make_dir LabelK...
[ "argparse.ArgumentParser", "utils.file_utils.make_dir", "collections.namedtuple", "collections.Counter", "os.path.join", "numpy.concatenate" ]
[((325, 386), 'collections.namedtuple', 'namedtuple', (['"""LabelKey"""', "['user_id', 'exp_id', 'begin', 'end']"], {}), "('LabelKey', ['user_id', 'exp_id', 'begin', 'end'])\n", (335, 386), False, 'from collections import namedtuple, Counter\n'), ((397, 441), 'collections.namedtuple', 'namedtuple', (['"""DataKey"""', "...
import torch import torchvision import torchvision.transforms as transforms import os from scipy.io.wavfile import read import scipy.io.wavfile as wav import subprocess as sp import numpy as np import argparse import random import os import sys import torch.nn.init as init from random import shuffle import speechpy imp...
[ "os.mkdir", "torch.optim.lr_scheduler.StepLR", "argparse.ArgumentParser", "torch.cuda.device_count", "os.path.isfile", "numpy.sqrt", "os.path.join", "torch.nn.BatchNorm3d", "torch.utils.data.DataLoader", "DataProviderDevelopment.ToOutput", "torch.nn.Conv3d", "torch.load", "os.path.exists", ...
[((724, 814), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Creating background model in development phase"""'}), "(description=\n 'Creating background model in development phase')\n", (747, 814), False, 'import argparse\n'), ((4917, 5041), 'torch.utils.data.DataLoader', 'torch.utils...
import os import torch import numpy as np from typing import Union, Optional from .utils.space_warper import WarpingImageToDifferentSpace from .backbones import iresnet18, iresnet50, rtnet50 import cv2 from copy import deepcopy __all__=["FaceEmbeddingPredictor"] SPACE_TO_NAME = { None: "arcface_cartesian", "...
[ "numpy.stack", "copy.deepcopy", "torch.load", "os.path.realpath", "os.path.exists", "numpy.expand_dims", "os.path.dirname", "numpy.linalg.norm", "torch.no_grad", "torch.sum", "cv2.resize" ]
[((3586, 3601), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3599, 3601), False, 'import torch\n'), ((2905, 2958), 'torch.load', 'torch.load', (['self.model_path'], {'map_location': 'self.device'}), '(self.model_path, map_location=self.device)\n', (2915, 2958), False, 'import torch\n'), ((2455, 2481), 'os.path....
# -*- coding: utf-8 -*- """ Example definition of a borehole. A top-view plot of the borehole is created and the borehole resistance is computed. """ import numpy as np from scipy.constants import pi import pygfunction as gt def main(): # ---------------------------------------------------------------------...
[ "pygfunction.pipes.SingleUTube", "pygfunction.pipes.convective_heat_transfer_coefficient_circular_pipe", "pygfunction.pipes.conduction_thermal_resistance_circular_pipe", "pygfunction.pipes.MultipleUTube", "pygfunction.pipes.convective_heat_transfer_coefficient_concentric_annulus", "numpy.array", "pygfun...
[((1340, 1369), 'numpy.array', 'np.array', (['[r_in_in, r_out_in]'], {}), '([r_in_in, r_out_in])\n', (1348, 1369), True, 'import numpy as np\n'), ((1411, 1442), 'numpy.array', 'np.array', (['[r_in_out, r_out_out]'], {}), '([r_in_out, r_out_out])\n', (1419, 1442), True, 'import numpy as np\n'), ((1891, 1918), 'pygfuncti...
''' Created on May 1, 2015 @author: <NAME> <<EMAIL>> ''' from __future__ import division import collections import itertools import unittest import numpy as np from scipy import special from .lib_bin_base import LibraryBinaryBase from .lib_bin_numeric import LibraryBinaryNumeric from .numba_speedup import numba_pa...
[ "unittest.main", "numpy.random.uniform", "numpy.outer", "scipy.special.comb", "numpy.random.randint", "numpy.random.random", "numpy.arange", "numpy.exp", "collections.OrderedDict" ]
[((12856, 12871), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12869, 12871), False, 'import unittest\n'), ((803, 828), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (826, 828), False, 'import collections\n'), ((2349, 2375), 'numpy.arange', 'np.arange', (['(0)', '(model.Ns + 1)'], {}),...
import pytest import warnings import numpy as np import astropy.units as u # from astropy.modeling import models, fitting from ..analysis_utilities import stack_spectra, fourier_shift from .utilities import generate_gaussian_cube, gaussian def test_shift(): amp = 1 v0 = 0 * u.m / u.s sigma = 8 spec...
[ "numpy.abs", "numpy.roll", "numpy.std", "numpy.ones", "pytest.raises", "numpy.array", "warnings.catch_warnings", "numpy.arange", "numpy.testing.assert_allclose", "numpy.sqrt" ]
[((540, 566), 'numpy.roll', 'np.roll', (['true_spectrum', '(10)'], {}), '(true_spectrum, 10)\n', (547, 566), True, 'import numpy as np\n'), ((627, 699), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['shift_spectrum', 'rolled_spectrum'], {'rtol': '(0.0001)'}), '(shift_spectrum, rolled_spectrum, rtol=0...
""" Copyright (c) 2021 The authors of Llama All rights reserved. Initially modified from cover_tree.py of CoverTree https://github.com/manzilzaheer/CoverTree Copyright (c) 2017 <NAME> All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wi...
[ "llamac.delete", "llamac.get_descendants", "llamac.new", "llamac.get_child_parent_edges", "numpy.ones", "llamac.get_round", "llamac.cluster" ]
[((864, 888), 'llamac.delete', 'llamac.delete', (['self.this'], {}), '(self.this)\n', (877, 888), False, 'import llamac\n'), ((958, 983), 'llamac.cluster', 'llamac.cluster', (['self.this'], {}), '(self.this)\n', (972, 983), False, 'import llamac\n'), ((1354, 1387), 'llamac.get_descendants', 'llamac.get_descendants', ([...
import annotation.Decoder import numpy as np import annotation.state from annotation.Annotation import Annotation import report QUAL_BEG = 33 QUAL_END = 127 QUALITY_CODES = list(map(chr, range(QUAL_BEG, QUAL_END))) QUALITY_NUMS = range(QUAL_END - QUAL_BEG) NUCLEOTIDES = ['A', 'C', 'G', 'T', 'N'] MOTIF_NUCLEOTIDES = ['...
[ "numpy.array", "annotation.Annotation.Annotation", "report.tuple_into_seq", "numpy.sum" ]
[((5573, 5606), 'report.tuple_into_seq', 'report.tuple_into_seq', (['self.motif'], {}), '(self.motif)\n', (5594, 5606), False, 'import report\n'), ((15964, 15979), 'numpy.array', 'np.array', (['trans'], {}), '(trans)\n', (15972, 15979), True, 'import numpy as np\n'), ((16001, 16025), 'numpy.sum', 'np.sum', (['trans_np'...
""" Convolutional Restricted Boltzmann Machine using chainer """ from __future__ import print_function import os, sys import argparse import timeit import numpy as np try: import PIL.Image as Image except ImportError: import Image import chainer from chainer import computational_graph from chainer import cu...
[ "chainer.links.Convolution2D", "numpy.random.binomial", "chainer.functions.convolution_2d", "src.functions.flip", "numpy.asarray", "chainer.functions.sum", "chainer.cuda.get_array_module", "chainer.functions.exp", "chainer.functions.sigmoid", "chainer.functions.reshape", "chainer.functions.broad...
[((6564, 6581), 'numpy.asarray', 'np.asarray', (['[1.0]'], {}), '([1.0])\n', (6574, 6581), True, 'import numpy as np\n'), ((8033, 8067), 'chainer.cuda.get_array_module', 'cuda.get_array_module', (['h_mean.data'], {}), '(h_mean.data)\n', (8054, 8067), False, 'from chainer import cuda, Variable, optimizers, serializers, ...
#!/usr/bin/env python3 import unittest import numpy as np import numpy.testing as numpy_testing from distributions import Binomial class TestBinomail(unittest.TestCase): def setUp(self): self.distribution = Binomial(3, 5, 0.85) def test_init_with_errors(self): params = ( (None, ...
[ "numpy.array", "numpy.testing.assert_allclose", "distributions.Binomial" ]
[((223, 243), 'distributions.Binomial', 'Binomial', (['(3)', '(5)', '(0.85)'], {}), '(3, 5, 0.85)\n', (231, 243), False, 'from distributions import Binomial\n'), ((1433, 1496), 'numpy.array', 'np.array', (['[7.59375e-05, 0.0021515625, 0.024384375, 0.138178125]'], {}), '([7.59375e-05, 0.0021515625, 0.024384375, 0.138178...
#!/usr/bin/env python # # <NAME> (https://pucktada.github.io/) # License: MIT # 2017-05-01 # # A recurrent neural network model (LSTM) for thai word segmentation import logging import re import numpy as np import tensorflow as tf import tensorflow.contrib.layers as layers import tensorflow.contrib.rnn as rnn #from . i...
[ "tensorflow.contrib.rnn.GRUCell", "tensorflow.reduce_sum", "tensorflow.contrib.rnn.BasicRNNCell", "tensorflow.trainable_variables", "tensorflow.get_collection", "tensorflow.reshape", "tensorflow.assign", "tensorflow.Variable", "tensorflow.contrib.layers.linear", "tensorflow.get_default_graph", "...
[((442, 464), 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), '()\n', (462, 464), True, 'import tensorflow as tf\n'), ((2342, 2399), 'tensorflow.train.import_meta_graph', 'tf.train.import_meta_graph', (['meta_file'], {'clear_devices': '(True)'}), '(meta_file, clear_devices=True)\n', (2368, 2399), True...
## Import the packages import numpy as np from scipy import stats ## Define 2 random distributions #Sample Size N = 10 #Gaussian distributed data with mean = 2 and var = 1 a = np.random.randn(N) + 2 #Gaussian distributed data with with mean = 0 and var = 1 b = np.random.randn(N) ## Calculate the Stand...
[ "numpy.random.randn", "scipy.stats.ttest_ind", "numpy.array", "scipy.stats.t.cdf", "numpy.sqrt" ]
[((274, 292), 'numpy.random.randn', 'np.random.randn', (['N'], {}), '(N)\n', (289, 292), True, 'import numpy as np\n'), ((570, 598), 'numpy.sqrt', 'np.sqrt', (['((var_a + var_b) / 2)'], {}), '((var_a + var_b) / 2)\n', (577, 598), True, 'import numpy as np\n'), ((1227, 1248), 'scipy.stats.ttest_ind', 'stats.ttest_ind', ...
from ..meta import api_dumb as ma import numpy as np from pyDictH5.base import data as SourceDataType import six import copy rad_hz = ma.marray(2 * np.pi, ma.varMeta('', {'s': -1, 'hz': -1})) def indent(text, padding=' '): return ''.join(padding + line for line in text.splitlines(True)) def _format_repr(dat...
[ "pyDictH5.base.data._subset", "copy.deepcopy", "numpy.hstack", "numpy.arange", "numpy.in1d" ]
[((3333, 3451), 'pyDictH5.base.data._subset', 'SourceDataType._subset', (['self', 'indx'], {'raise_on_empty_array': 'raise_on_empty_array', 'copy': '(copy + self._subset_copy_vars)'}), '(self, indx, raise_on_empty_array=\n raise_on_empty_array, copy=copy + self._subset_copy_vars)\n', (3355, 3451), True, 'from pyDict...
import matplotlib matplotlib.use('Agg') import pdb import sys import Pipelines as pl import pandas as pd from datetime import datetime import numpy as np import time # saving the models for the iteration tests: # to save the models for the iteration tests, we will save a dataframe (in the form of the final dataframe f...
[ "pandas.DataFrame", "Pipelines.get_td_stats_custom", "time.time", "matplotlib.use", "numpy.arange", "pandas.Series", "Pipelines.get_td_community", "datetime.datetime.now" ]
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((1077, 1091), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1089, 1091), True, 'import pandas as pd\n'), ((666, 680), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (678, 680)...
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.models import load_model import numpy as np import cv2 # load the face mask detector model from disk print("[INFO] loading face mask detector model...") # model = ...
[ "tensorflow.keras.models.load_model", "tensorflow.keras.preprocessing.image.img_to_array", "numpy.expand_dims", "tensorflow.keras.applications.mobilenet_v2.preprocess_input", "cv2.resize" ]
[((374, 422), 'tensorflow.keras.models.load_model', 'load_model', (['"""model/mobilenet_classifier_2.model"""'], {}), "('model/mobilenet_classifier_2.model')\n", (384, 422), False, 'from tensorflow.keras.models import load_model\n'), ((527, 558), 'cv2.resize', 'cv2.resize', (['img_arr', '(224, 224)'], {}), '(img_arr, (...
import tensorflow as tf import numpy as np import tensorflow_hub as hub from tensorflow.keras.models import load_model from PIL import Image import argparse import json parser = argparse.ArgumentParser(description='Image Classifier - Part(2))') parser.add_argument('--input', default='./test_images/wild_pansy.jpg', act...
[ "json.load", "tensorflow.keras.models.load_model", "argparse.ArgumentParser", "tensorflow.convert_to_tensor", "numpy.asarray", "numpy.expand_dims", "PIL.Image.open", "tensorflow.math.top_k", "tensorflow.image.resize" ]
[((179, 245), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Image Classifier - Part(2))"""'}), "(description='Image Classifier - Part(2))')\n", (202, 245), False, 'import argparse\n'), ((961, 1006), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['image'], {'dtype': 'tf.float3...
"""NumPy基礎 配列(ndarray)の形状を変更する方法 列ベクトルを作成する (np.newaxisを使用する方法) [説明ページ] https://tech.nkhn37.net/numpy-ndarray-reshape-newaxis/#npnewaxis-2 """ import numpy as np x = np.array([1, 2, 3, 4, 5]) print(f'x = {x}') # 列ベクトルを作成する x_col = x[:, np.newaxis] print(f'x_col = \n{x_col}')
[ "numpy.array" ]
[((168, 193), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (176, 193), True, 'import numpy as np\n')]
import tensorspark.core.weight_combiner as comb import numpy as np def test_delta_weight_combiner(): combiner = comb.DeltaWeightCombiner() origin = np.array([0, 0, 0]) updated_1 = np.array([2, 2, 2]) updated_2 = np.array([3, 3, 2]) updated_3 = np.array([2, 4, 3]) result1 = combiner.compute(origin, updated_1, wor...
[ "numpy.array", "tensorspark.core.weight_combiner.DeltaWeightCombiner" ]
[((114, 140), 'tensorspark.core.weight_combiner.DeltaWeightCombiner', 'comb.DeltaWeightCombiner', ([], {}), '()\n', (138, 140), True, 'import tensorspark.core.weight_combiner as comb\n'), ((151, 170), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (159, 170), True, 'import numpy as np\n'), ((184, 203)...
# -------------------------------------------------------------------------- # Copyright (c) <2017> <<NAME>> # BE-BI-PM, CERN (European Organization for Nuclear Research) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softwa...
[ "matplotlib.pyplot.get_cmap", "matplotlib.colors.Normalize", "matplotlib.cm.ScalarMappable", "numpy.ones", "PyQt5.QtWidgets.QVBoxLayout", "PyQt5.QtWidgets.QStackedWidget", "matplotlib.backends.backend_qt5.NavigationToolbar2QT", "lib.prairie.style" ]
[((2039, 2059), 'PyQt5.QtWidgets.QStackedWidget', 'QStackedWidget', (['self'], {}), '(self)\n', (2053, 2059), False, 'from PyQt5.QtWidgets import QStackedWidget, QWidget, QVBoxLayout\n'), ((2138, 2167), 'PyQt5.QtWidgets.QVBoxLayout', 'QVBoxLayout', (['self.main_widget'], {}), '(self.main_widget)\n', (2149, 2167), False...
#!/usr/bin/env python3 # coding: utf8 """ This script was created for reading MigroMag files and plotting FORC (first-order reversal curves) diagram as well as related figures. This script was inspired by FORKIT program which was written Gary Acton (http://paleomag.ucdavis.edu/software-forcit.html) and contains som...
[ "numpy.sum", "argparse.ArgumentParser", "numpy.ones", "matplotlib.pyplot.figure", "numpy.mean", "scipy.spatial.cKDTree", "argparse.ArgumentTypeError", "numpy.meshgrid", "os.path.dirname", "matplotlib.ticker.MaxNLocator", "numpy.max", "matplotlib.pyplot.subplots", "matplotlib.pyplot.get_cmap"...
[((1648, 1737), 'collections.namedtuple', 'collections.namedtuple', (['"""Rawdata"""', '"""params calibration_measurement source_data NData"""'], {}), "('Rawdata',\n 'params calibration_measurement source_data NData')\n", (1670, 1737), False, 'import collections\n'), ((719, 797), 'argparse.ArgumentParser', 'argparse...
import numpy as np from core import Object3D, Uniform, UniformList from mathutils import MatrixFactory class Camera(Object3D): def __init__(self): super().__init__() self.projectionMatrix = MatrixFactory.makeIdentity() self.viewMatrix = MatrixFactory.makeIdentity() self.un...
[ "numpy.linalg.inv", "mathutils.MatrixFactory.makeIdentity", "core.UniformList", "core.Uniform" ]
[((212, 240), 'mathutils.MatrixFactory.makeIdentity', 'MatrixFactory.makeIdentity', ([], {}), '()\n', (238, 240), False, 'from mathutils import MatrixFactory\n'), ((267, 295), 'mathutils.MatrixFactory.makeIdentity', 'MatrixFactory.makeIdentity', ([], {}), '()\n', (293, 295), False, 'from mathutils import MatrixFactory\...
""" FizzBuzz is the following problem: For each of the numbers 1 to 100: * if the number is divisible by 3, print "fizz" * if the number is divisible by 5, print "buzz" * if the number is divisible by 15, print "fizzbuzz" * otherwise, just print the number """ import numpy as np from typing import Lis...
[ "kaynet.layers.Linear", "kaynet.layers.Tanh", "kaynet.optim.SGD", "numpy.argmax" ]
[((1277, 1297), 'numpy.argmax', 'np.argmax', (['predicted'], {}), '(predicted)\n', (1286, 1297), True, 'import numpy as np\n'), ((996, 1033), 'kaynet.layers.Linear', 'Linear', ([], {'input_size': '(10)', 'output_size': '(50)'}), '(input_size=10, output_size=50)\n', (1002, 1033), False, 'from kaynet.layers import Linear...
from PIL import Image , ImageDraw import xmltodict import os import numpy as np import glob import keras import tensorflow as tf from sklearn.model_selection import train_test_split #variable declaration input_dim = 228 #create an array and get the path to the images folder images = [] image_paths = glo...
[ "tensorflow.losses.mean_squared_error", "keras.Sequential", "sklearn.model_selection.train_test_split", "tensorflow.maximum", "numpy.asarray", "keras.optimizers.Adam", "tensorflow.minimum", "PIL.Image.open", "numpy.array", "keras.layers.Conv2D", "glob.glob", "PIL.ImageDraw.Draw", "keras.laye...
[((317, 392), 'glob.glob', 'glob.glob', (['"""C:\\\\Users\\\\Local User\\\\Pictures\\\\cars_train\\\\cars_train\\\\*.jpg"""'], {}), "('C:\\\\Users\\\\Local User\\\\Pictures\\\\cars_train\\\\cars_train\\\\*.jpg')\n", (326, 392), False, 'import glob\n'), ((652, 738), 'glob.glob', 'glob.glob', (['"""C:\\\\Users\\\\Local U...
from __future__ import print_function, division import numpy as np try: import MDAnalysis as mda except ImportError: print("MDAnalysis must be installed to use MDSimulation") pass try: import periodictable as pt except ImportError: print( "periodictable must be installed to use automaticall...
[ "numpy.average", "numpy.floor", "refnx.reflect.structure.sld_profile", "MDAnalysis.Universe", "numpy.array", "periodictable.elements.symbol" ]
[((11639, 11683), 'numpy.array', 'np.array', (['self.layers[:, :-layers_to_cut, :]'], {}), '(self.layers[:, :-layers_to_cut, :])\n', (11647, 11683), True, 'import numpy as np\n'), ((11797, 11834), 'numpy.average', 'np.average', (['layers_to_average'], {'axis': '(0)'}), '(layers_to_average, axis=0)\n', (11807, 11834), T...
"""Tests for :mod:`numpy.core.fromnumeric`.""" import numpy as np A = np.array(True, ndmin=2, dtype=bool) B = np.array(1.0, ndmin=2, dtype=np.float32) A.setflags(write=False) B.setflags(write=False) a = np.bool_(True) b = np.float32(1.0) c = 1.0 d = np.array(1.0, dtype=np.float32) # writeable reveal_type(np.take(a...
[ "numpy.bool_", "numpy.trace", "numpy.sum", "numpy.amin", "numpy.resize", "numpy.argmax", "numpy.ravel", "numpy.argmin", "numpy.clip", "numpy.argsort", "numpy.argpartition", "numpy.shape", "numpy.around", "numpy.mean", "numpy.prod", "numpy.cumprod", "numpy.std", "numpy.transpose", ...
[((72, 107), 'numpy.array', 'np.array', (['(True)'], {'ndmin': '(2)', 'dtype': 'bool'}), '(True, ndmin=2, dtype=bool)\n', (80, 107), True, 'import numpy as np\n'), ((112, 152), 'numpy.array', 'np.array', (['(1.0)'], {'ndmin': '(2)', 'dtype': 'np.float32'}), '(1.0, ndmin=2, dtype=np.float32)\n', (120, 152), True, 'impor...
import airfoil_db as adb import sys import numpy as np if __name__=="__main__": # Loop through arguments for NACA in sys.argv[1:]: # Input airfoil_input = { "geometry" : { "NACA" : NACA } } # Initialize airfoil = adb.Airfoil("NA...
[ "numpy.radians", "airfoil_db.Airfoil" ]
[((305, 347), 'airfoil_db.Airfoil', 'adb.Airfoil', (["('NACA_' + NACA)", 'airfoil_input'], {}), "('NACA_' + NACA, airfoil_input)\n", (316, 347), True, 'import airfoil_db as adb\n'), ((430, 447), 'numpy.radians', 'np.radians', (['(-20.0)'], {}), '(-20.0)\n', (440, 447), True, 'import numpy as np\n'), ((449, 465), 'numpy...
import numpy import logging from tradechecker import TradeChecker from stocks import allstocks, stockgroup100, singlestock, stockgroupX, stockgroupY, stockgroupZ, stockgroupFav, stockgroupFavSma, stockgroupFavSma2,stockgroupFav2 from Asset import Asset from Portfolio import Portfolio import talib import matplotlib.pyp...
[ "talib.SMA", "Asset.Asset", "numpy.where", "logging.getLogger" ]
[((661, 693), 'logging.getLogger', 'logging.getLogger', (['"""algologger6"""'], {}), "('algologger6')\n", (678, 693), False, 'import logging\n'), ((903, 918), 'Asset.Asset', 'Asset', (['"""STOCK1"""'], {}), "('STOCK1')\n", (908, 918), False, 'from Asset import Asset\n'), ((932, 987), 'numpy.where', 'numpy.where', (['(r...
#!/usr/bin/env python PKG = 'numpy_tutorial' import roslib; roslib.load_manifest(PKG) import rospy from rospy.numpy_msg import numpy_msg from rospy_tutorials.msg import Floats import numpy def talker(): pub = rospy.Publisher('floats', numpy_msg(Floats),queue_size=10) rospy.init_node('talker', anonymous=True) ...
[ "rospy.numpy_msg.numpy_msg", "rospy.Rate", "rospy.is_shutdown", "numpy.array", "rospy.init_node", "roslib.load_manifest" ]
[((60, 85), 'roslib.load_manifest', 'roslib.load_manifest', (['PKG'], {}), '(PKG)\n', (80, 85), False, 'import roslib\n'), ((278, 319), 'rospy.init_node', 'rospy.init_node', (['"""talker"""'], {'anonymous': '(True)'}), "('talker', anonymous=True)\n", (293, 319), False, 'import rospy\n'), ((328, 342), 'rospy.Rate', 'ros...
from BiGNN import BiGNN import sys sys.path.append('..') from utlis import load_data,load_customdataset_test_data,load_randomdataset_test_data,vaild,get_50_epoch_MAPE,accuracy_train import argparse import random import numpy as np import torch from torch.optim import lr_scheduler import torch.optim as optim import tim...
[ "numpy.random.seed", "argparse.ArgumentParser", "torch.optim.lr_scheduler.StepLR", "utlis.load_data", "numpy.mean", "sys.path.append", "utlis.vaild", "utlis.get_50_epoch_MAPE", "utlis.load_randomdataset_test_data", "random.seed", "utlis.load_customdataset_test_data", "torch.manual_seed", "to...
[((35, 56), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (50, 56), False, 'import sys\n'), ((362, 387), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (385, 387), False, 'import argparse\n'), ((1400, 1417), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1411...
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ "paddle.mean", "numpy.random.uniform", "paddle.fluid.data", "numpy.random.seed", "paddle.fluid.optimizer.SGD", "paddle.batch", "paddle.distributed.fleet.init", "paddle.enable_static", "paddle.distributed.fleet.DistributedStrategy", "paddle.incubate.nn.FusedMultiTransformer", "paddle.distributed....
[((1115, 1137), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (1135, 1137), False, 'import paddle\n'), ((1592, 1612), 'numpy.random.seed', 'np.random.seed', (['(2021)'], {}), '(2021)\n', (1606, 1612), True, 'import numpy as np\n'), ((5720, 5739), 'paddle.mean', 'paddle.mean', (['result'], {}), '(res...
import datetime import numpy as np import tensorflow as tf from network import GoogLenet for gpu in tf.config.experimental.list_physical_devices('GPU'): tf.config.experimental.set_memory_growth(gpu, True) class DataLoader(): def __init__(self): initial_data = tf.keras.datasets.fashion_mnist (...
[ "network.GoogLenet.build_googlenet", "tensorflow.keras.optimizers.SGD", "tensorflow.config.experimental.set_memory_growth", "tensorflow.keras.callbacks.ModelCheckpoint", "datetime.datetime.now", "numpy.shape", "tensorflow.image.resize_with_pad", "tensorflow.keras.callbacks.TensorBoard", "tensorflow....
[((101, 152), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (145, 152), True, 'import tensorflow as tf\n'), ((158, 209), 'tensorflow.config.experimental.set_memory_growth', 'tf.config.experimental.set_memory_growth', (['gpu', '(...
import argparse from reward_surfaces.plotting import plot_plane import os from pathlib import Path from reward_surfaces.utils.job_results_to_csv import job_results_to_csv import shutil import numpy as np import pandas if __name__ == "__main__": parser = argparse.ArgumentParser(description='generate jobs for plane'...
[ "os.mkdir", "argparse.ArgumentParser", "os.path.isdir", "pandas.read_csv", "os.rename", "os.path.exists", "reward_surfaces.utils.job_results_to_csv.job_results_to_csv", "pathlib.Path", "numpy.max", "numpy.min", "shutil.rmtree", "os.listdir" ]
[((259, 321), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""generate jobs for plane"""'}), "(description='generate jobs for plane')\n", (282, 321), False, 'import argparse\n'), ((811, 837), 'os.path.exists', 'os.path.exists', (['frames_dir'], {}), '(frames_dir)\n', (825, 837), False, 'i...
# reproduce of PyTorch performance regression with tensors concatenation import torch import time import numpy as np ITERS = 100 BATCH = 128 SHAPE = (4, 84, 84) def test_1(device): ts = time.time() for _ in range(ITERS): batch = [] for _ in range(BATCH): batch.append(np.zeros(SHAP...
[ "torch.cuda.synchronize", "torch.stack", "numpy.zeros", "torch.FloatTensor", "time.time", "numpy.array", "torch.device" ]
[((193, 204), 'time.time', 'time.time', ([], {}), '()\n', (202, 204), False, 'import time\n'), ((582, 593), 'time.time', 'time.time', ([], {}), '()\n', (591, 593), False, 'import time\n'), ((984, 995), 'time.time', 'time.time', ([], {}), '()\n', (993, 995), False, 'import time\n'), ((1984, 2004), 'torch.device', 'torch...
import numpy as np import numpy.linalg as la import networkx as nx import warnings import scipy.optimize as opt from neml import uniaxial class BarModel(nx.MultiGraph): """ Model of an arbitrary bar network. Graph structure: I am an networkx graph Bars are edge data Nodes are rigid lin...
[ "numpy.copy", "numpy.empty", "numpy.zeros", "numpy.linalg.cond", "neml.uniaxial.UniaxialModel", "numpy.append", "numpy.array", "numpy.linalg.norm", "numpy.dot", "warnings.warn", "numpy.linalg.solve", "numpy.vstack" ]
[((11210, 11220), 'numpy.linalg.norm', 'la.norm', (['R'], {}), '(R)\n', (11217, 11220), True, 'import numpy.linalg as la\n'), ((11238, 11249), 'numpy.copy', 'np.copy', (['x0'], {}), '(x0)\n', (11245, 11249), True, 'import numpy as np\n'), ((1523, 1538), 'numpy.array', 'np.array', (['[0.0]'], {}), '([0.0])\n', (1531, 15...
# -*- coding: utf-8 -*- """\ Copyright (c) 2015-2018, MGH Computational Pathology """ from calicoml.core.algo.qq import QQ, QQPlot from calicoml.core.problem import Problem from calicoml.core.reporting import ReportRenderer from calicoml.core.utils import with_numpy_arrays import nose import numpy as np import os i...
[ "pandas.DataFrame", "calicoml.core.reporting.ReportRenderer", "numpy.random.RandomState", "sklearn.linear_model.LinearRegression", "calicoml.core.problem.Problem", "numpy.mean", "numpy.testing.assert_allclose", "os.path.join", "calicoml.core.algo.qq.QQ", "numpy.all" ]
[((552, 583), 'numpy.all', 'np.all', (['(lst[1:] - lst[:-1] >= 0)'], {}), '(lst[1:] - lst[:-1] >= 0)\n', (558, 583), True, 'import numpy as np\n'), ((701, 732), 'numpy.random.RandomState', 'np.random.RandomState', (['(12648430)'], {}), '(12648430)\n', (722, 732), True, 'import numpy as np\n'), ((1137, 1175), 'pandas.Da...
"""This module contains functions for calculating the acquisition score of an input based on various metrics""" from typing import Callable, Optional, Set import numpy as np from scipy.stats import norm # this module maintains an independent random number generator RG = np.random.default_rng() def set_seed(seed: Opti...
[ "numpy.std", "scipy.stats.norm.pdf", "numpy.errstate", "numpy.random.default_rng", "scipy.stats.norm.cdf", "numpy.where", "numpy.sqrt" ]
[((273, 296), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}), '()\n', (294, 296), True, 'import numpy as np\n'), ((434, 461), 'numpy.random.default_rng', 'np.random.default_rng', (['seed'], {}), '(seed)\n', (455, 461), True, 'import numpy as np\n'), ((3906, 3920), 'numpy.std', 'np.std', (['Y_mean'], {}),...
# # Copyright © 2020 Intel Corporation. # # This software and the related documents are Intel copyrighted # materials, and your use of them is governed by the express # license under which they were provided to you (License). Unless # the License provides otherwise, you may not use, modify, copy, # publish, distribute,...
[ "nxsdk_modules_ncl.dnn.src.synapse_compression.reconstructKMapFromPartitions", "numpy.ravel", "tensorflow.keras.layers.Dense.get_config", "nxsdk_modules_ncl.dnn.src.data_structures.Partition", "nxsdk_modules_ncl.dnn.src.utils._getPadding", "tensorflow.keras.layers.Dense.__init__", "numpy.ones", "nxsdk...
[((3203, 3265), 'collections.namedtuple', 'collections.namedtuple', (['"""CxAddr"""', "['chipId', 'coreId', 'cxId']"], {}), "('CxAddr', ['chipId', 'coreId', 'cxId'])\n", (3225, 3265), False, 'import collections\n'), ((12363, 12385), 'numpy.ravel', 'np.ravel', (['weights', '"""F"""'], {}), "(weights, 'F')\n", (12371, 12...
# -*- coding: utf-8 -*- """ Created on Wed Jan 26 10:32:01 2022 @author: benja """ import os import rasterio as rio import geopandas as gpd import numpy as np from whitebox import WhiteboxTools from rasterio.merge import merge #from utils import load_if_path, max_rast_value_in_shp, count_points_i...
[ "geopandas.sjoin", "numpy.arange", "rasterio.merge.merge", "os.path.join", "os.chdir", "numpy.unique", "shapely.geometry.Point", "os.path.exists", "geopandas.pd.DataFrame", "numpy.append", "geopandas.GeoDataFrame", "geopandas.read_file", "whitebox.WhiteboxTools", "os.listdir", "numpy.del...
[((24624, 24635), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (24633, 24635), False, 'import os\n'), ((24641, 24655), 'os.chdir', 'os.chdir', (['dir_'], {}), '(dir_)\n', (24649, 24655), False, 'import os\n'), ((26257, 26301), 'rasterstats.zonal_stats', 'zonal_stats', (['geoms', 'raster_path'], {'stat': '[stat]'}), '(ge...
import argparse import math from typing import List, Tuple import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.io import loadmat from sklearn import preprocessing def generate_data_with_features(data: pd.DataFrame, features: List[int], elements: int = None, normalise: bool = True, ...
[ "numpy.sum", "argparse.ArgumentParser", "scipy.io.loadmat", "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler", "matplotlib.pyplot.figure", "numpy.exp", "pandas.DataFrame", "matplotlib.pyplot.close", "sklearn.preprocessing.LabelEncoder", "numpy.max", "matplotlib.pyplot.show", "matplotli...
[((2007, 2035), 'sklearn.preprocessing.LabelEncoder', 'preprocessing.LabelEncoder', ([], {}), '()\n', (2033, 2035), False, 'from sklearn import preprocessing\n'), ((4294, 4304), 'numpy.sum', 'np.sum', (['dz'], {}), '(dz)\n', (4300, 4304), True, 'import numpy as np\n'), ((5048, 5102), 'numpy.random.uniform', 'np.random....
import numpy as np # autocorrelation function for wide-sense stationary process def autocorr(exes, p): results = [] total_len = 0 for x in exes: result = np.correlate(x, x, mode='full') results.append(result[result.size / 2:result.size / 2 + p + 1]) total_len = total_len + len(x)...
[ "numpy.sum", "numpy.square", "numpy.array", "numpy.exp", "numpy.correlate", "numpy.sqrt" ]
[((335, 352), 'numpy.array', 'np.array', (['results'], {}), '(results)\n', (343, 352), True, 'import numpy as np\n'), ((178, 209), 'numpy.correlate', 'np.correlate', (['x', 'x'], {'mode': '"""full"""'}), "(x, x, mode='full')\n", (190, 209), True, 'import numpy as np\n'), ((367, 390), 'numpy.sum', 'np.sum', (['results']...
from typing import Union, Optional, List, Tuple, Text, BinaryIO import pathlib import torch import math import warnings import numpy as np from PIL import Image, ImageDraw, ImageFont, ImageColor __all__ = ["make_grid", "save_image", "draw_bounding_boxes", "draw_segmentation_masks"] @torch.no_grad() def make_grid( ...
[ "torch.stack", "PIL.ImageFont.load_default", "PIL.ImageColor.getrgb", "torch.cat", "PIL.ImageFont.truetype", "numpy.array", "torch.is_tensor", "PIL.Image.fromarray", "warnings.warn", "PIL.ImageDraw.Draw", "torch.no_grad", "torch.tensor" ]
[((287, 302), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (300, 302), False, 'import torch\n'), ((4480, 4495), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4493, 4495), False, 'import torch\n'), ((5500, 5515), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (5513, 5515), False, 'import torch\n'), ((...
# Copyright (c) 2016-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
[ "unittest.main", "caffe2.python.core.Net", "hypothesis.strategies.permutations", "numpy.apply_along_axis", "caffe2.python.hypothesis_test_util.temp_workspace", "numpy.array", "caffe2.python.hypothesis_test_util.arrays", "caffe2.python.core.CreateOperator", "hypothesis.strategies.integers", "caffe2...
[((7292, 7307), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7305, 7307), False, 'import unittest\n'), ((1251, 1312), 'hypothesis.strategies.integers', 'st.integers', ([], {'min_value': 'data_min_size', 'max_value': 'data_max_size'}), '(min_value=data_min_size, max_value=data_max_size)\n', (1262, 1312), True, '...
""" Module for conducting fullrelax with castep This replicate the castep_relax.pl based on previous implemented fullrelax function in casteptool module """ import json import subprocess import os import re import io import shutil import fileinput import logging import slurmtools as stl from .utils import filter_out_st...
[ "slurmtools.SlurmAdapter", "os.remove", "json.dump", "json.load", "fileinput.input", "time.time", "os.path.isfile", "subprocess.call", "numpy.array", "shutil.move", "logging.getLogger", "re.compile" ]
[((495, 522), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (512, 522), False, 'import logging\n'), ((532, 562), 'slurmtools.SlurmAdapter', 'stl.SlurmAdapter', (['logger', 'None'], {}), '(logger, None)\n', (548, 562), True, 'import slurmtools as stl\n'), ((12293, 12335), 're.compile', 'r...
import pytest import shutil from pathlib import Path import numpy as np from spikeinterface import extract_waveforms, WaveformExtractor from spikeinterface.extractors import toy_example from spikeinterface.toolkit.postprocessing import WaveformPrincipalComponent, compute_principal_components if hasattr(pytest, "gl...
[ "numpy.load", "spikeinterface.extractors.toy_example", "shutil.rmtree", "numpy.random.randn", "spikeinterface.toolkit.postprocessing.WaveformPrincipalComponent.load_from_folder", "pathlib.Path", "spikeinterface.extract_waveforms", "spikeinterface.toolkit.postprocessing.compute_principal_components", ...
[((823, 864), 'spikeinterface.extractors.toy_example', 'toy_example', ([], {'num_segments': '(2)', 'num_units': '(10)'}), '(num_segments=2, num_units=10)\n', (834, 864), False, 'from spikeinterface.extractors import toy_example\n'), ((1012, 1176), 'spikeinterface.extract_waveforms', 'extract_waveforms', (['recording', ...
from __future__ import print_function from fmpy import simulate_fmu from fmpy.util import download_test_file import numpy as np def simulate_coupled_clutches(fmi_version='2.0', fmi_type='ModelExchange', output=['outputs[1]', 'outputs[2]', 'outputs[3]...
[ "fmpy.util.download_test_file", "numpy.genfromtxt", "fmpy.util.plot_result" ]
[((788, 854), 'numpy.genfromtxt', 'np.genfromtxt', (['"""CoupledClutches_in.csv"""'], {'delimiter': '""","""', 'names': '(True)'}), "('CoupledClutches_in.csv', delimiter=',', names=True)\n", (801, 854), True, 'import numpy as np\n'), ((649, 745), 'fmpy.util.download_test_file', 'download_test_file', (['fmi_version', 'f...
#!/usr/bin/env python3 import os import sys import copy import re import importlib import numpy as np import roslib import rospy import rospkg import time import sensor_msgs.msg import nxp_gazebo.msg from cv_bridge import CvBridge import cv2 if cv2.__version__ < "4.0.0": raise ImportError("Requires opencv >= 4.0, "...
[ "rospy.Subscriber", "cv2.bitwise_and", "numpy.empty", "numpy.ones", "cv2.fillPoly", "cv2.rectangle", "cv2.pyrDown", "rospy.logwarn", "cv2.line", "cv2.cvtColor", "rospy.init_node", "copy.deepcopy", "cv_bridge.CvBridge", "cv2.threshold", "rospy.Publisher", "time.time", "rospy.get_param...
[((11861, 11892), 'rospy.init_node', 'rospy.init_node', (['"""track_vision"""'], {}), "('track_vision')\n", (11876, 11892), False, 'import rospy\n'), ((484, 494), 'cv_bridge.CvBridge', 'CvBridge', ([], {}), '()\n', (492, 494), False, 'from cv_bridge import CvBridge\n'), ((1032, 1071), 'rospy.get_param', 'rospy.get_para...
import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.colors import Normalize from scipy.linalg import svd import starry import os lmax = 15 nsamples = 100 np.random.seed(0) # Compute the rank as a function of sph harm degree # We'll do this for various inclinations and take # the media...
[ "starry.Map", "numpy.random.uniform", "os.path.abspath", "numpy.random.seed", "numpy.median", "numpy.empty", "numpy.linalg.matrix_rank", "numpy.arange", "numpy.array", "numpy.linspace", "matplotlib.pyplot.subplots" ]
[((188, 205), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (202, 205), True, 'import numpy as np\n'), ((329, 357), 'starry.Map', 'starry.Map', (['lmax'], {'lazy': '(False)'}), '(lmax, lazy=False)\n', (339, 357), False, 'import starry\n'), ((366, 391), 'numpy.linspace', 'np.linspace', (['(0)', '(360)',...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import assert_allclose import astropy.units as u from astropy.coordinates import Angle, SkyCoord from regions import CircleSkyRegion from gammapy.data import DataStore from gammapy.datasets import Spectru...
[ "gammapy.makers.SpectrumDatasetMaker", "numpy.logspace", "gammapy.maps.RegionGeom.create", "pytest.fixture", "gammapy.maps.WcsGeom.create", "gammapy.makers.ReflectedRegionsBackgroundMaker", "gammapy.data.DataStore.from_dir", "numpy.testing.assert_allclose", "gammapy.makers.SafeMaskMaker", "pytest....
[((1301, 1317), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1315, 1317), False, 'import pytest\n'), ((1654, 1670), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1668, 1670), False, 'import pytest\n'), ((2042, 2058), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (2056, 2058), False, 'import p...
import pandas as pd import numpy as np from rdkit import Chem from rdkit.Chem import Descriptors, AllChem from sklearn.preprocessing import MinMaxScaler from sklearn.neural_network import MLPClassifier from sklearn.model_selection import StratifiedKFold # Load training data scams = pd.read_csv('train_data.txt', sep='...
[ "pandas.DataFrame", "rdkit.Chem.AllChem.GetMorganFingerprintAsBitVect", "pandas.read_csv", "numpy.float32", "sklearn.preprocessing.MinMaxScaler", "numpy.isnan", "numpy.finfo", "sklearn.model_selection.StratifiedKFold", "rdkit.Chem.MolFromSmiles", "sklearn.neural_network.MLPClassifier", "pandas.c...
[((285, 324), 'pandas.read_csv', 'pd.read_csv', (['"""train_data.txt"""'], {'sep': '"""\t"""'}), "('train_data.txt', sep='\\t')\n", (296, 324), True, 'import pandas as pd\n'), ((1259, 1273), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {}), '()\n', (1271, 1273), False, 'from sklearn.preprocessing import M...
"""Noisy MLP module""" from typing import Callable, Iterable, Optional import jax import jax.numpy as jnp import numpy as np import haiku as hk class NoisyLinear(hk.Module): """Noisy Linear module.""" def __init__( self, output_size: int, rng: jax.random.PRNGKey, ...
[ "haiku.initializers.TruncatedNormal", "jax.random.split", "jax.numpy.dot", "haiku.get_parameter", "haiku.PRNGSequence", "jax.random.PRNGKey", "jax.numpy.multiply", "jax.numpy.broadcast_to", "numpy.sqrt" ]
[((1287, 1307), 'haiku.PRNGSequence', 'hk.PRNGSequence', (['rng'], {}), '(rng)\n', (1302, 1307), True, 'import haiku as hk\n'), ((2039, 2107), 'haiku.get_parameter', 'hk.get_parameter', (['"""w"""', '[input_size, output_size]', 'dtype'], {'init': 'w_init'}), "('w', [input_size, output_size], dtype, init=w_init)\n", (20...
import pytest import numpy as np import openpnm as op class SubdomainTest: def setup_class(self): pass def test_add_locations(self): pn = op.network.Cubic([6, 1, 1]) g1 = op.geometry.GenericGeometry(network=pn) g2 = op.geometry.GenericGeometry(network=pn) g1.set_locat...
[ "openpnm.phases.Air", "openpnm.geometry.GenericGeometry", "openpnm.network.Cubic", "pytest.raises", "openpnm.phases.GenericPhase", "openpnm.physics.GenericPhysics", "numpy.all" ]
[((166, 193), 'openpnm.network.Cubic', 'op.network.Cubic', (['[6, 1, 1]'], {}), '([6, 1, 1])\n', (182, 193), True, 'import openpnm as op\n'), ((207, 246), 'openpnm.geometry.GenericGeometry', 'op.geometry.GenericGeometry', ([], {'network': 'pn'}), '(network=pn)\n', (234, 246), True, 'import openpnm as op\n'), ((260, 299...
import numpy import copy class Shift(object): """ A class for shifting the parameter space of a spectra. Attributes: _shift (float): The factor you want to shift a parameter by. """ def __init__(self): """ Initialise the Shift class. """ self._shift = 0. def get_sh...
[ "numpy.zeros", "numpy.isclose", "copy.copy" ]
[((1225, 1257), 'numpy.isclose', 'numpy.isclose', (['(shift % step)', '(0.0)'], {}), '(shift % step, 0.0)\n', (1238, 1257), False, 'import numpy\n'), ((1521, 1540), 'copy.copy', 'copy.copy', (['spectrum'], {}), '(spectrum)\n', (1530, 1540), False, 'import copy\n'), ((1638, 1671), 'numpy.zeros', 'numpy.zeros', (['spectr...
# Copyright [yyyy] [name of copyright owner] # Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
[ "numpy.zeros", "cv2.resize", "concern.config.State" ]
[((2634, 2661), 'concern.config.State', 'State', ([], {'default': '"""keep_ratio"""'}), "(default='keep_ratio')\n", (2639, 2661), False, 'from concern.config import Configurable, State\n'), ((2679, 2706), 'concern.config.State', 'State', ([], {'default': '[1152, 2048]'}), '(default=[1152, 2048])\n', (2684, 2706), False...
from datetime import datetime import numpy as np from dateutil.relativedelta import relativedelta from utils.db.table import Meteorology __all__ = ["MeteorologyDTO"] # Meteorology,气象要素类,用于存储同一站点相同时间内的气象要素,可以方便扩展处理数据的方法 class MeteorologyDTO(object): """ 存储一个月的气象要素,每个要素用二维数组存储,第一维是小时,第二维是分钟 """ def ...
[ "numpy.ones_like", "numpy.array", "dateutil.relativedelta.relativedelta", "utils.db.table.Meteorology" ]
[((714, 732), 'numpy.array', 'np.array', (['pressure'], {}), '(pressure)\n', (722, 732), True, 'import numpy as np\n'), ((790, 811), 'numpy.array', 'np.array', (['temperature'], {}), '(temperature)\n', (798, 811), True, 'import numpy as np\n'), ((872, 899), 'numpy.array', 'np.array', (['relative_humidity'], {}), '(rela...
from os.path import dirname, join, basename, isfile from tqdm import tqdm from models import SyncNet_color as SyncNet import audio import torch from torch import nn from torch import optim import torch.backends.cudnn as cudnn from torch.utils import data as data_utils import numpy as np from glob import glob import...
[ "os.mkdir", "argparse.ArgumentParser", "os.path.isfile", "torch.device", "torch.no_grad", "os.path.join", "audio.load_wav", "torch.ones", "torch.nn.BCELoss", "torch.utils.data.DataLoader", "os.path.dirname", "torch.load", "os.path.exists", "torch.FloatTensor", "audio.melspectrogram", "...
[((440, 531), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Code to train the expert lip-sync discriminator"""'}), "(description=\n 'Code to train the expert lip-sync discriminator')\n", (463, 531), False, 'import os, random, cv2, argparse\n'), ((916, 941), 'torch.cuda.is_available',...
import numpy as np import matplotlib.pyplot as plt x = np.linspace(-3, 3, 100) y = x**2 plt.plot(x, y) plt.show()
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.linspace" ]
[((56, 79), 'numpy.linspace', 'np.linspace', (['(-3)', '(3)', '(100)'], {}), '(-3, 3, 100)\n', (67, 79), True, 'import numpy as np\n'), ((90, 104), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (98, 104), True, 'import matplotlib.pyplot as plt\n'), ((105, 115), 'matplotlib.pyplot.show', 'plt.show'...
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # - Redistributions of source code must retain the above copyright # notice, this list of conditions...
[ "numpy.outer", "numpy.log", "scipy.special.multigammaln", "numpy.zeros", "numpy.ones", "numpy.linalg.det", "numpy.array", "numpy.random.multivariate_normal", "numpy.eye", "distributions.dbg.random.sample_normal_inverse_wishart", "distributions.dbg.random.score_student_t" ]
[((5163, 5199), 'numpy.array', 'np.array', (['message.mu'], {'dtype': 'np.float'}), '(message.mu, dtype=np.float)\n', (5171, 5199), True, 'import numpy as np\n'), ((5254, 5291), 'numpy.array', 'np.array', (['message.psi'], {'dtype': 'np.float'}), '(message.psi, dtype=np.float)\n', (5262, 5291), True, 'import numpy as n...
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import json from random import randint import matplotlib.patches as mpatches compact_x = [randint(5,40) for _ in range(60)] compact_y = [randint(5,40) for _ in range(60)] spread_x = [randint(13,100) for _ in range(40)] spread_y = [randint(22...
[ "matplotlib.pyplot.show", "random.randint", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.axis", "numpy.mean" ]
[((367, 385), 'numpy.mean', 'np.mean', (['compact_x'], {}), '(compact_x)\n', (374, 385), True, 'import numpy as np\n'), ((407, 425), 'numpy.mean', 'np.mean', (['compact_y'], {}), '(compact_y)\n', (414, 425), True, 'import numpy as np\n'), ((447, 464), 'numpy.mean', 'np.mean', (['spread_x'], {}), '(spread_x)\n', (454, 4...
import numpy as np import sklearn.metrics import torch def macro_recall(pred_y, y, n_grapheme=168, n_vowel=11, n_consonant=7): pred_y = torch.split(pred_y, [n_grapheme, n_vowel, n_consonant], dim=1) pred_labels = [torch.argmax(py, dim=1).cpu().numpy() for py in pred_y] y = y.cpu().numpy() # pred_y = ...
[ "torch.argmax", "torch.split", "numpy.average" ]
[((142, 204), 'torch.split', 'torch.split', (['pred_y', '[n_grapheme, n_vowel, n_consonant]'], {'dim': '(1)'}), '(pred_y, [n_grapheme, n_vowel, n_consonant], dim=1)\n', (153, 204), False, 'import torch\n'), ((650, 735), 'numpy.average', 'np.average', (['[recall_grapheme, recall_vowel, recall_consonant]'], {'weights': '...
"""Feature generation""" from abc import ABC import numpy as np from synmod.constants import BINARY, CATEGORICAL, NUMERIC, TABULAR from synmod.generators import BernoulliDistribution, CategoricalDistribution, NormalDistribution from synmod.generators import BernoulliProcess, MarkovChain from synmod.aggregators impor...
[ "numpy.random.default_rng", "synmod.aggregators.get_aggregation_fn_cls", "synmod.generators.BernoulliDistribution", "synmod.generators.CategoricalDistribution" ]
[((486, 517), 'numpy.random.default_rng', 'np.random.default_rng', (['seed_seq'], {}), '(seed_seq)\n', (507, 517), True, 'import numpy as np\n'), ((1474, 1506), 'synmod.generators.BernoulliDistribution', 'BernoulliDistribution', (['self._rng'], {}), '(self._rng)\n', (1495, 1506), False, 'from synmod.generators import B...
""" Tools to read an ENDF-6 data file. From https://t2.lanl.gov/nis/endf/intro05.html An ENDF-format nuclear data library has an hierarchical structure by tape, material, file, and section, denoted by numerical identifiers. Tape is a data-file that contains one or more ENDF materials in increasing order by MAT. E...
[ "numpy.array" ]
[((3220, 3236), 'numpy.array', 'np.array', (['x[:nP]'], {}), '(x[:nP])\n', (3228, 3236), True, 'import numpy as np\n'), ((3238, 3254), 'numpy.array', 'np.array', (['y[:nP]'], {}), '(y[:nP])\n', (3246, 3254), True, 'import numpy as np\n')]
# Load Dependencies # ---------------------------------------------------------------------------------- import base64 import io import logging import os import glob import json import numpy as np import torch import time import cv2 from PIL import Image, ImageChops from torch.autograd import Variable from torchvisio...
[ "PIL.ImageChops.difference", "io.BytesIO", "cv2.bitwise_and", "torch.load", "cv2.threshold", "numpy.asarray", "torchvision.transforms.ToTensor", "os.path.isfile", "PIL.ImageChops.add", "torch.cuda.is_available", "torchvision.models.detection.backbone_utils.resnet_fpn_backbone", "PIL.Image.from...
[((350, 377), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (367, 377), False, 'import logging\n'), ((1288, 1320), 'PIL.ImageChops.difference', 'ImageChops.difference', (['image', 'bg'], {}), '(image, bg)\n', (1309, 1320), False, 'from PIL import Image, ImageChops\n'), ((1332, 1369), 'PI...
""" (c) Copyright 2021 Palantir Technologies Inc. All rights reserved. """ from concurrent.futures import ThreadPoolExecutor import sys import cv2 import numpy as np from detectron2.engine import DefaultPredictor from detectron2.config import get_cfg from grpc import ServicerContext, server, RpcContext from proto im...
[ "proto.processing_service_v2_pb2.Classification", "proto.processing_service_v2_pb2.BoundingBox", "proto.processing_service_v2_pb2.Inferences", "numpy.frombuffer", "detectron2.engine.DefaultPredictor", "proto.processing_service_v2_pb2.ProcessorV2Config", "detectron2.config.get_cfg", "cv2.imread", "co...
[((6372, 6405), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {'max_workers': '(8)'}), '(max_workers=8)\n', (6390, 6405), False, 'from concurrent.futures import ThreadPoolExecutor\n'), ((6580, 6626), 'grpc.server', 'server', (['thread_pool'], {'maximum_concurrent_rpcs': '(8)'}), '(thread_pool, max...
# -*- coding: utf-8 -*- """ Created on Sat Jan 18 23:19:54 2020 @author: arthurd """ import numpy as np import osmnx as ox import time from noiseplanet import matcher def test_match(): print('\nTest match(graph, track, method)') center_point = (45.75793143, 4.83549635) graph = ox.graph_from_point(center...
[ "osmnx.graph_from_point", "noiseplanet.matcher.match", "time.time", "noiseplanet.matcher.match_from_geojsons", "numpy.array" ]
[((294, 341), 'osmnx.graph_from_point', 'ox.graph_from_point', (['center_point'], {'distance': '(100)'}), '(center_point, distance=100)\n', (313, 341), True, 'import osmnx as ox\n'), ((354, 1603), 'numpy.array', 'np.array', (['[[45.75793143, 4.83549635], [45.75793143, 4.83549635], [45.75791593, \n 4.83548718], [45.7...
# -*- coding:utf-8 -*- ##################################### import shutil import os import numpy as np #%% we use cnn,首先加载CNN模型 import generate_cnn_layers as gen_cnn H = gen_cnn.generate_cnn() # 创建CNN模型 import cnn_user as cu # 添加正则化项,改善测试集性能 epsilon = 1e-4 keep_prob = 0.5 cnn = cu.cnn_user() cnn.create_cnn(H, epsilo...
[ "numpy.savetxt", "os.path.exists", "cnn_user.cnn_user", "numpy.fliplr", "generate_cnn_layers.generate_cnn" ]
[((173, 195), 'generate_cnn_layers.generate_cnn', 'gen_cnn.generate_cnn', ([], {}), '()\n', (193, 195), True, 'import generate_cnn_layers as gen_cnn\n'), ((282, 295), 'cnn_user.cnn_user', 'cu.cnn_user', ([], {}), '()\n', (293, 295), True, 'import cnn_user as cu\n'), ((544, 589), 'os.path.exists', 'os.path.exists', (['"...
# -*- coding: utf-8 -*- """ Created on Fri Jul 10 16:29:31 2020 @author: 108431 """ import matplotlib.pyplot as plt import networkx as nx import numpy as np, copy import pandas as pd def getLinkToFollowingCluster (veryInitialEdge, linkedClustersIdx, edgeToStartFrom, clustersTSP_nodes, distances_df, clu...
[ "pandas.DataFrame", "copy.deepcopy", "numpy.sum" ]
[((6578, 6601), 'pandas.DataFrame', 'pd.DataFrame', (['distances'], {}), '(distances)\n', (6590, 6601), True, 'import pandas as pd\n'), ((5205, 5228), 'copy.deepcopy', 'copy.deepcopy', (['newEdges'], {}), '(newEdges)\n', (5218, 5228), False, 'import numpy as np, copy\n'), ((5245, 5310), 'numpy.sum', 'np.sum', (['[dista...
import numpy as np from tensorflow.keras import layers, models from ..base.capsulelayers import CapsuleLayer, PrimaryCap, Length, Mask def CapsNet( input_shape, num_class, dim_capsule, routings, learning_rate, lam_recon, run_options=None, run_metadata=None, **kwargs, ): """Cap...
[ "tensorflow.keras.layers.AveragePooling2D", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Input", "numpy.prod" ]
[((1036, 1067), 'tensorflow.keras.layers.Input', 'layers.Input', ([], {'shape': 'input_shape'}), '(shape=input_shape)\n', (1048, 1067), False, 'from tensorflow.keras import layers, models\n'), ((2346, 2378), 'tensorflow.keras.layers.Input', 'layers.Input', ([], {'shape': '(num_class,)'}), '(shape=(num_class,))\n', (235...
import sys import os import numpy as np import datetime import calendar from jdcal import gcal2jd, jd2gcal from numpy import array from pyearth.system.define_global_variables import * from pyearth.toolbox.reader.text_reader_string import text_reader_string from pyearth.toolbox.data.convert_time_series_daily_to_mont...
[ "numpy.full", "numpy.savetxt", "jdcal.gcal2jd", "numpy.array", "pyearth.toolbox.data.convert_time_series_daily_to_monthly.convert_time_series_daily_to_monthly", "pyearth.toolbox.reader.text_reader_string.text_reader_string" ]
[((930, 976), 'jdcal.gcal2jd', 'gcal2jd', (['iYear_start', 'iMonth_start', 'iDay_start'], {}), '(iYear_start, iMonth_start, iDay_start)\n', (937, 976), False, 'from jdcal import gcal2jd, jd2gcal\n'), ((1210, 1284), 'pyearth.toolbox.reader.text_reader_string.text_reader_string', 'text_reader_string', (['sFilename_discha...
"""Historic Mean for Time-Series problems. Predicts the mean of the target for each time group for regression problems.""" import datatable as dt import numpy as np import pandas as pd from h2oaicore.models import CustomTimeSeriesModel class HistoricMeanModel(CustomTimeSeriesModel): _can_handle_non_numeric = True...
[ "numpy.full", "datatable.mean", "numpy.setdiff1d", "numpy.ones", "datatable.Frame", "numpy.mean", "datatable.join", "numpy.float64", "datatable.by" ]
[((1142, 1182), 'numpy.setdiff1d', 'np.setdiff1d', (['self.tgc', 'self.time_column'], {}), '(self.tgc, self.time_column)\n', (1154, 1182), True, 'import numpy as np\n'), ((1273, 1283), 'numpy.mean', 'np.mean', (['y'], {}), '(y)\n', (1280, 1283), True, 'import numpy as np\n'), ((1617, 1627), 'numpy.mean', 'np.mean', (['...
import numpy as np import scipy.interpolate as itp import scipy.io as io import matplotlib as mpl import matplotlib.pyplot as plt from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot import plotly.graph_objs as go # backend = mpl.get_backend() # print(backend) class AnalyzeDisp(object): '...
[ "plotly.offline.iplot", "numpy.abs", "numpy.polyfit", "plotly.graph_objs.Scatter", "matplotlib.pyplot.subplots", "numpy.array", "numpy.arange", "matplotlib.pyplot.pause", "scipy.interpolate.splev", "plotly.graph_objs.Figure", "plotly.offline.init_notebook_mode", "scipy.interpolate.splrep", "...
[((3068, 3083), 'numpy.gradient', 'np.gradient', (['rf'], {}), '(rf)\n', (3079, 3083), True, 'import numpy as np\n'), ((3414, 3441), 'numpy.array', 'np.array', (['[-2, -1, 0, 1, 2]'], {}), '([-2, -1, 0, 1, 2])\n', (3422, 3441), True, 'import numpy as np\n'), ((3518, 3557), 'numpy.polyfit', 'np.polyfit', (['dm', 'drf[pu...
# Author: <NAME> # Email: <EMAIL> # Date: import numpy as np from dev.linear_model import LogisticRegression from sklearn.linear_model import LogisticRegression as _LogisticRegression import time # In[0] rng = np.random.default_rng(42) X = rng.standard_normal((2000, 500)) w = rng.standard_normal((500, 1)) b = rng.sta...
[ "sklearn.datasets.load_iris", "dev.linear_model.LogisticRegression", "time.time", "numpy.random.default_rng", "sklearn.linear_model.LogisticRegression" ]
[((212, 237), 'numpy.random.default_rng', 'np.random.default_rng', (['(42)'], {}), '(42)\n', (233, 237), True, 'import numpy as np\n'), ((387, 450), 'dev.linear_model.LogisticRegression', 'LogisticRegression', ([], {'max_iter': '(20)', 'device': '"""cuda"""', 'random_state': '(42)'}), "(max_iter=20, device='cuda', rand...
import os import hydra import wandb import torch import numpy as np import matplotlib.pyplot as plt import torchvision.transforms as tf from collections import defaultdict from tqdm import tqdm import src.data.datasets as datasets import src.nn.models as models import src.utils.transforms as transforms import src.util...
[ "torch.utils.data.RandomSampler", "matplotlib.pyplot.style.use", "torch.device", "torch.no_grad", "os.path.join", "matplotlib.pyplot.rc", "torch.cuda.set_device", "torchvision.transforms.CenterCrop", "src.utils.logging.LossLogger", "tqdm.tqdm", "src.utils.transforms.ToIndex", "torch.cuda.is_av...
[((375, 406), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-poster"""'], {}), "('seaborn-poster')\n", (388, 406), True, 'import matplotlib.pyplot as plt\n'), ((446, 475), 'matplotlib.pyplot.rc', 'plt.rc', (['"""legend"""'], {'fontsize': '(10)'}), "('legend', fontsize=10)\n", (452, 475), True, 'import ma...
import numpy as np import pyopencl as cl from functools import lru_cache from pydlearn.function import Function def gpu_buffer(ctx, hostbuf=None, shape=None): return cl.Buffer(ctx, cl.mem_flags.READ_WRITE | cl.mem_flags.COPY_HOST_PTR,\ hostbuf=(np.zeros(shape) if shape else hostbuf)) @lru_cache def gpu_kernel(c...
[ "numpy.sum", "pyopencl.enqueue_copy", "pyopencl.create_some_context", "numpy.empty_like", "numpy.zeros", "pyopencl.CommandQueue" ]
[((1014, 1034), 'numpy.empty_like', 'np.empty_like', (['shape'], {}), '(shape)\n', (1027, 1034), True, 'import numpy as np\n'), ((1037, 1084), 'pyopencl.enqueue_copy', 'cl.enqueue_copy', (['queue', 'res', "buffers['res_buf']"], {}), "(queue, res, buffers['res_buf'])\n", (1052, 1084), True, 'import pyopencl as cl\n'), (...
from __future__ import print_function import numpy as np from numpy import pi from . import model class BTModel(model.Model): r"""Single-layer (barotropic) quasigeostrophic model. This class can represent both pure two-dimensional flow and also single reduced-gravity layers with deformation radius ``r...
[ "numpy.asarray", "numpy.hstack", "numpy.array", "numpy.random.rand", "numpy.sqrt" ]
[((1074, 1085), 'numpy.array', 'np.array', (['H'], {}), '(H)\n', (1082, 1085), True, 'import numpy as np\n'), ((1594, 1615), 'numpy.asarray', 'np.asarray', (['self.beta'], {}), '(self.beta)\n', (1604, 1615), True, 'import numpy as np\n'), ((2718, 2731), 'numpy.asarray', 'np.asarray', (['U'], {}), '(U)\n', (2728, 2731),...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np import copy import astropy.units as u import operator from ..utils.fitting import Parameters, Parameter from ..utils.scripts import make_path from ..maps ...
[ "copy.deepcopy", "astropy.units.Quantity", "numpy.sum", "copy.copy" ]
[((568, 587), 'copy.deepcopy', 'copy.deepcopy', (['self'], {}), '(self)\n', (581, 587), False, 'import copy\n'), ((3160, 3195), 'numpy.sum', 'np.sum', (['[m for m in self.skymodels]'], {}), '([m for m in self.skymodels])\n', (3166, 3195), True, 'import numpy as np\n'), ((10918, 10967), 'astropy.units.Quantity', 'u.Quan...
from __future__ import print_function import numpy as np import mxnet as mx import mxnext as X from symbol.builder import RpnHead, Backbone, RoiExtractor from models.tridentnet.resnet_v2 import TridentResNetV2Builder from models.tridentnet.resnet_v1b import TridentResNetV1bBuilder from models.tridentnet.resnet_v1 imp...
[ "mxnext.softmax", "mxnet.sym.ProposalMaskTarget", "mxnext.reshape", "mxnext.group", "mxnext.var", "mxnext.smooth_l1", "mxnet.sym.slice_axis", "models.tridentnet.resnet_v1b.TridentResNetV1bBuilder", "numpy.where", "models.tridentnet.resnet_v2.TridentResNetV2Builder", "models.tridentnet.resnet_v1....
[((604, 626), 'mxnext.var', 'X.var', (['"""rpn_cls_label"""'], {}), "('rpn_cls_label')\n", (609, 626), True, 'import mxnext as X\n'), ((652, 675), 'mxnext.var', 'X.var', (['"""rpn_reg_target"""'], {}), "('rpn_reg_target')\n", (657, 675), True, 'import mxnext as X\n'), ((701, 724), 'mxnext.var', 'X.var', (['"""rpn_reg_w...
from copy import Error import os from typing import Type from ase.parallel import paropen, parprint, world from ase.db import connect from ase.io import read from glob import glob import numpy as np from gpaw import restart import BASIC.optimizer as opt import sys from ase.constraints import FixAtoms,FixedLine import p...
[ "pandas.DataFrame", "os.remove", "BASIC.optimizer.relax", "ase.parallel.parprint", "ase.parallel.paropen", "gpaw.restart", "BASIC.utils.detect_cluster", "ase.constraints.FixAtoms", "numpy.any", "numpy.append", "os.path.isfile", "ase.db.connect", "ase.io.read", "ase.constraints.FixedLine", ...
[((493, 511), 'numpy.any', 'np.any', (['anlges_arg'], {}), '(anlges_arg)\n', (499, 511), True, 'import numpy as np\n'), ((1694, 1723), 'ase.parallel.paropen', 'paropen', (['report_location', '"""a"""'], {}), "(report_location, 'a')\n", (1701, 1723), False, 'from ase.parallel import paropen, parprint, world\n'), ((1727,...
import numpy as np from tqdm import tqdm import pandas as pd # set com energy s = 1000**2 # set 4-momentum proximity by angle delta_angle = np.cos(0.4) # set ps variable product delta_vars = 0.2 def pair_check_phase(p1,p2,delta=delta_angle): '''Check proximity of pair of momenta :param p1, p2: 4-momenta ...
[ "pandas.DataFrame", "numpy.random.uniform", "tqdm.tqdm", "numpy.ones", "numpy.sin", "numpy.array", "numpy.cos", "numpy.dot", "numpy.prod", "numpy.sqrt" ]
[((142, 153), 'numpy.cos', 'np.cos', (['(0.4)'], {}), '(0.4)\n', (148, 153), True, 'import numpy as np\n'), ((1413, 1432), 'numpy.array', 'np.array', (['variables'], {}), '(variables)\n', (1421, 1432), True, 'import numpy as np\n'), ((1444, 1462), 'numpy.prod', 'np.prod', (['variables'], {}), '(variables)\n', (1451, 14...
from __future__ import division import math import torch import numpy as np # import matplotlib.pyplot as plt # import matplotlib.patches as patches def convert_box_xy(x1, y1, width, height): """ Convert from x1, y1, representing the center of the box to the top left coordinate (corner). :param x1:...
[ "numpy.sum", "numpy.maximum", "torch.nn.init.normal_", "numpy.where", "torch.nn.init.constant_", "numpy.concatenate" ]
[((3773, 3811), 'numpy.concatenate', 'np.concatenate', (['([0.0], recall, [1.0])'], {}), '(([0.0], recall, [1.0]))\n', (3787, 3811), True, 'import numpy as np\n'), ((3823, 3864), 'numpy.concatenate', 'np.concatenate', (['([0.0], precision, [0.0])'], {}), '(([0.0], precision, [0.0]))\n', (3837, 3864), True, 'import nump...
import os.path as op import numpy as np import pandas as pd import itertools import numpy.testing as npt import pytest import matplotlib matplotlib.use('Agg') import tcrdist as td tempSkip = pytest.mark.skip(reason="Temporarily skipping for efficiency.") @tempSkip def exampleBetaChains(): lines = """TRBV18*01 ...
[ "tcrdist.distance.computeVRegionDistances", "tcrdist.distances.basicDistance", "tcrdist.processing.identifyClones", "tcrdist.embedding.plotEmbedding", "tcrdist.objects.TCRChain", "tcrdist.distances.computeVRegionDistances", "matplotlib.use", "tcrdist.datasets.loadPSData", "pandas.objects.DistancePar...
[((139, 160), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (153, 160), False, 'import matplotlib\n'), ((195, 258), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Temporarily skipping for efficiency."""'}), "(reason='Temporarily skipping for efficiency.')\n", (211, 258), False, 'imp...
import array import os import pickle import json from os import listdir import random import numpy as np import pandas as pd from keras.models import load_model from learner.evolution.sascorer import calculateScore from learner.models import coeff_determination from learner.seq2seq.sampler import latent_to_smiles from ...
[ "keras.models.load_model", "rdkit.Chem.MolToSmiles", "json.load", "deap.base.Toolbox", "pandas.read_csv", "random.random", "deap.creator.create", "matplotlib.pyplot.rc", "numpy.reshape", "learner.seq2seq.sampler.latent_to_smiles", "rdkit.Chem.MolFromSmiles", "rdkit.Avalon.pyAvalonTools.GetAval...
[((717, 831), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\PycharmProjects\\\\ml.services\\\\Source\\\\sds_tools\\\\learner\\\\evolution\\\\enum2can_sol.csv"""'], {}), "(\n 'C:\\\\PycharmProjects\\\\ml.services\\\\Source\\\\sds_tools\\\\learner\\\\evolution\\\\enum2can_sol.csv'\n )\n", (728, 831), True, 'import ...
import numpy as np from .baseMetric import BaseMetric from rubin_sim.photUtils import Dust_values import healpy as hp from rubin_sim.maf.maps import TrilegalDensityMap __all__ = ['NgalScaleMetric', 'NlcPointsMetric'] class NgalScaleMetric(BaseMetric): """Approximate number of galaxies, scaled by median seeing. ...
[ "numpy.size", "numpy.sum", "numpy.median", "rubin_sim.maf.maps.TrilegalDensityMap", "rubin_sim.photUtils.Dust_values", "healpy.nside2pixarea", "numpy.where", "numpy.interp", "numpy.unique" ]
[((1375, 1388), 'rubin_sim.photUtils.Dust_values', 'Dust_values', ([], {}), '()\n', (1386, 1388), False, 'from rubin_sim.photUtils import Dust_values\n'), ((1697, 1751), 'numpy.where', 'np.where', (['(dataSlice[self.filterCol] == self.filtername)'], {}), '(dataSlice[self.filterCol] == self.filtername)\n', (1705, 1751),...
""" MIT License Copyright (c) 2019 YangYun Copyright (c) 2020 <NAME> Copyright (c) 2020 <NAME> <<EMAIL>> 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.stack", "numpy.full", "numpy.concatenate", "cv2.cvtColor", "numpy.empty", "numpy.floor", "numpy.zeros", "numpy.expand_dims", "numpy.any", "cv2.imread", "random.random", "numpy.array", "os.path.splitext", "numpy.arange", "os.path.join", "numpy.random.shuffle" ]
[((13530, 13564), 'numpy.empty', 'np.empty', (['(1, size[0], size[1], 3)'], {}), '((1, size[0], size[1], 3))\n', (13538, 13564), True, 'import numpy as np\n'), ((9581, 9626), 'numpy.expand_dims', 'np.expand_dims', (['(resized_image / 255.0)'], {'axis': '(0)'}), '(resized_image / 255.0, axis=0)\n', (9595, 9626), True, '...
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of exma (https://github.com/fernandezfran/exma/). # Copyright (c) 2021, <NAME> # License: MIT # Full Text: https://github.com/fernandezfran/exma/blob/master/LICENSE # ============================================================================ # DOCS...
[ "pandas.DataFrame", "numpy.asarray", "numpy.float32", "numpy.intc", "numpy.array" ]
[((2566, 2581), 'numpy.intc', 'np.intc', (['natoms'], {}), '(natoms)\n', (2573, 2581), True, 'import numpy as np\n'), ((5507, 5525), 'numpy.array', 'np.array', (['box_size'], {}), '(box_size)\n', (5515, 5525), True, 'import numpy as np\n'), ((7643, 7663), 'pandas.DataFrame', 'pd.DataFrame', (['thermo'], {}), '(thermo)\...
""" Distributed under the terms of the BSD 3-Clause License. The full license is in the file LICENSE, distributed with this software. Author: <NAME> <<EMAIL>> Copyright (C) European X-Ray Free-Electron Laser Facility GmbH. All rights reserved. """ import unittest import numpy as np from extra_foam.serialization impo...
[ "extra_foam.serialization.serialize_images", "numpy.testing.assert_array_equal", "extra_foam.serialization.deserialize_image", "numpy.ones", "numpy.array", "extra_foam.serialization.deserialize_images", "extra_foam.serialization.serialize_image" ]
[((945, 995), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6]]'], {'dtype': 'np.float32'}), '([[1, 2, 3], [4, 5, 6]], dtype=np.float32)\n', (953, 995), True, 'import numpy as np\n'), ((1046, 1071), 'extra_foam.serialization.serialize_image', 'serialize_image', (['orig_img'], {}), '(orig_img)\n', (1061, 1071), False...
# Lint as: python3 # 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 agr...
[ "tensorflow.test.main", "apache_beam.testing.util.assert_that", "apache_beam.Create", "apache_beam.Map", "tensorflow_model_analysis.metrics.confusion_matrix_plot.ConfusionMatrixPlot", "apache_beam.Pipeline", "apache_beam.testing.util.BeamAssertException", "apache_beam.CombinePerKey", "numpy.array", ...
[((4599, 4613), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (4611, 4613), True, 'import tensorflow as tf\n'), ((1468, 1483), 'numpy.array', 'np.array', (['[0.0]'], {}), '([0.0])\n', (1476, 1483), True, 'import numpy as np\n'), ((1508, 1523), 'numpy.array', 'np.array', (['[0.0]'], {}), '([0.0])\n', (1516, ...
import sys if "" not in sys.path : sys.path.append("") import os import numpy as np import nibabel as nib from keras.preprocessing.image import img_to_array from glob import glob import random import math import scipy import matplotlib.pyplot as plt def inspect_data(dataset, n_samples=20, show_fig=True): """ ...
[ "numpy.sum", "numpy.shape", "keras.preprocessing.image.img_to_array", "numpy.mean", "os.path.join", "sys.path.append", "numpy.std", "matplotlib.pyplot.imshow", "matplotlib.pyplot.close", "random.Random", "numpy.transpose", "scipy.ndimage.zoom", "numpy.max", "matplotlib.pyplot.show", "mat...
[((35, 54), 'sys.path.append', 'sys.path.append', (['""""""'], {}), "('')\n", (50, 54), False, 'import sys\n'), ((584, 611), 'math.ceil', 'math.ceil', (['(n_samples ** 0.5)'], {}), '(n_samples ** 0.5)\n', (593, 611), False, 'import math\n'), ((1277, 1295), 'numpy.zeros', 'np.zeros', (['map_size'], {}), '(map_size)\n', ...