code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np
import scipy.linalg as la
from progress.bar import IncrementalBar
def eig_trajectories(A,T,verbose=False):
"""Computes the trajectories of the eigenvalues of the
matrix function A(t)
Parameters
----------
A : callable
Matrix-valued function of one parameter t
T : 1d ... | [
"numpy.sign",
"numpy.abs",
"numpy.empty",
"progress.bar.IncrementalBar"
] | [((634, 667), 'numpy.empty', 'np.empty', (['(n, m)'], {'dtype': '"""complex"""'}), "((n, m), dtype='complex')\n", (642, 667), True, 'import numpy as np\n'), ((1743, 1779), 'numpy.empty', 'np.empty', (['(n, m, l)'], {'dtype': '"""complex"""'}), "((n, m, l), dtype='complex')\n", (1751, 1779), True, 'import numpy as np\n'... |
#
# Copyright (C) <NAME>, <NAME>, and <NAME>, 2016
#
# Distributed under the same BSD license as Scipy.
#
# adapted from scipy's cython version
import numpy as np
import numpy.random as random
#pythran export directed_hausdorff(float64[:,:], float64[:,:], int)
#pythran export directed_hausdorff_noshuffle(float64[:,:]... | [
"numpy.sqrt",
"numpy.asarray",
"numpy.sum",
"numpy.random.seed",
"numpy.arange",
"numpy.random.shuffle"
] | [((806, 823), 'numpy.random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (817, 823), True, 'import numpy.random as random\n'), ((838, 851), 'numpy.arange', 'np.arange', (['N1'], {}), '(N1)\n', (847, 851), True, 'import numpy as np\n'), ((866, 879), 'numpy.arange', 'np.arange', (['N2'], {}), '(N2)\n', (875, 879), T... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from itertools import product
import math
try:
import numpy as np
except ImportError:
np = None
from .printing import number_to_scientific_html
from ._util import get_backend, mat_dot_vec, prodpow
class EqCalcResult(... | [
"numpy.abs",
"matplotlib.pyplot.gca",
"numpy.asarray",
"numpy.tanh",
"numpy.exp",
"sympy.Piecewise",
"numpy.zeros",
"numpy.empty_like",
"sympy.Min",
"sympy.tanh",
"numpy.arctanh",
"math.exp"
] | [((7799, 7812), 'math.exp', 'math.exp', (['(-80)'], {}), '(-80)\n', (7807, 7812), False, 'import math\n'), ((663, 692), 'numpy.empty_like', 'np.empty_like', (['self.all_inits'], {}), '(self.all_inits)\n', (676, 692), True, 'import numpy as np\n'), ((5770, 5812), 'sympy.Piecewise', 'sp.Piecewise', (['(yi ** 2, yi < 0)',... |
import numpy as np
import astropy.units as u
import astropy.constants as const
import astropy.io.fits
import astropy.time as atime
import astropy.coordinates as coord
import numpy.random as random
import os
from simulacra.theory import TheoryModel
def read_in_fits(filename):
print('reading in {}'.format(filenam... | [
"numpy.sqrt",
"numpy.log",
"numpy.array",
"numpy.sin",
"numpy.mean",
"ftplib.FTP",
"astropy.units.spectral_density",
"numpy.exp",
"numpy.linspace",
"astropy.coordinates.Distance",
"numpy.ones",
"astroplan.Observer",
"os.path.isfile",
"astropy.coordinates.EarthLocation.of_site",
"numpy.me... | [((570, 600), 'os.path.join', 'os.path.join', (['outdir', 'filename'], {}), '(outdir, filename)\n', (582, 600), False, 'import os\n'), ((607, 630), 'os.path.isfile', 'os.path.isfile', (['outname'], {}), '(outname)\n', (621, 630), False, 'import os\n'), ((1470, 1500), 'os.path.join', 'os.path.join', (['outdir', 'filenam... |
import numpy as np
import math
import random
def f(x):
return (x[0]-3)**2 + (x[1]+1)**2
class ES:
def __init__(self, MaxIter, a, sigma0, f):
self.MaxIter = MaxIter
self.f = f
self.a = a
self.sigma = 0.4
self.sigma0 = sigma0
self.P_S = 0
se... | [
"random.uniform",
"numpy.sqrt",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.cos",
"numpy.sin",
"numpy.meshgrid",
"random.gauss",
"matplotlib.pyplot.show"
] | [((1547, 1570), 'numpy.linspace', 'np.linspace', (['(-5)', '(5)', '(100)'], {}), '(-5, 5, 100)\n', (1558, 1570), True, 'import numpy as np\n'), ((1577, 1600), 'numpy.linspace', 'np.linspace', (['(-5)', '(5)', '(100)'], {}), '(-5, 5, 100)\n', (1588, 1600), True, 'import numpy as np\n'), ((1611, 1630), 'numpy.meshgrid', ... |
import sys
sys.path.append("python")
from SurfStatF import *
import surfstat_wrap as sw
import numpy as np
import sys
import pytest
sw.matlab_init_surfstat()
def dummy_test(A, B):
try:
# wrap matlab functions
Wrapped_slm = sw.matlab_SurfStatF(A, B)
except:
pytest.skip("Original MATLAB code does not work w... | [
"numpy.allclose",
"numpy.random.rand",
"numpy.random.default_rng",
"numpy.ones",
"surfstat_wrap.matlab_SurfStatF",
"surfstat_wrap.matlab_init_surfstat",
"numpy.random.randint",
"pytest.skip",
"sys.path.append"
] | [((11, 36), 'sys.path.append', 'sys.path.append', (['"""python"""'], {}), "('python')\n", (26, 36), False, 'import sys\n'), ((133, 158), 'surfstat_wrap.matlab_init_surfstat', 'sw.matlab_init_surfstat', ([], {}), '()\n', (156, 158), True, 'import surfstat_wrap as sw\n'), ((870, 893), 'numpy.random.default_rng', 'np.rand... |
import math
import torch
import itertools
import numpy as np
from torchvision.ops.boxes import nms
class SSDBoxCoder:
def __init__(self, steps, box_sizes, aspect_ratios, fm_sizes, box_generator=None):
self.prior_boxes, self.priors = box_generator(steps, box_sizes, aspect_ratios, fm_sizes) if box_generato... | [
"torch.log",
"torch.max",
"torch.Tensor",
"math.sqrt",
"torch.exp",
"torch.min",
"torch.full_like",
"torch.tensor",
"numpy.array",
"torchvision.ops.boxes.nms",
"torch.zeros",
"torch.cat",
"torch.device"
] | [((7271, 7307), 'torch.cat', 'torch.cat', (['[a - b / 2, a + b / 2]', '(1)'], {}), '([a - b / 2, a + b / 2], 1)\n', (7280, 7307), False, 'import torch\n'), ((8308, 8349), 'torch.max', 'torch.max', (['box1[:, None, :2]', 'box2[:, :2]'], {}), '(box1[:, None, :2], box2[:, :2])\n', (8317, 8349), False, 'import torch\n'), (... |
from typing import Dict, List
import torch
import numpy as np
import copy
from ..modules import Module
from ..datasets import shuffle, collate_dict_wrapper
class ObverterDatasamplingModule(Module):
def __init__(self,
id:str,
config:Dict[str,object]):
"""
:par... | [
"numpy.random.choice",
"torch.ones",
"torch.Tensor",
"copy.deepcopy"
] | [((4135, 4244), 'numpy.random.choice', 'np.random.choice', (['[idx for idx in latents_to_possible_indices[color_id][shape_id] if idx !=\n speaker_idx]'], {}), '([idx for idx in latents_to_possible_indices[color_id][\n shape_id] if idx != speaker_idx])\n', (4151, 4244), True, 'import numpy as np\n'), ((4800, 4857)... |
import multiprocessing
import itertools
import numpy as np
import pandas as pd
import scipy.optimize
import pickle
import sys
if '../' not in sys.path:
sys.path.append('../')
import tick
from tick.hawkes.simulation import SimuHawkesExpKernels
from tick.hawkes.inference import HawkesConditionalLaw, HawkesADM4, Haw... | [
"tick.hawkes.inference.HawkesConditionalLaw",
"numpy.reshape",
"numpy.ones",
"lib.utils.cumulants.compute_cumulants",
"tick.hawkes.inference.HawkesADM4",
"tick.hawkes.simulation.SimuHawkesExpKernels",
"itertools.product",
"tick.hawkes.inference.HawkesCumulantMatching",
"numpy.array",
"lib.simulati... | [((448, 1045), 'numpy.array', 'np.array', (['[[0.23, 0.23, 0.23, 0.23, 0.23, 0.0, 0.0, 0.0, 0.0, 0.23], [0.0, 0.23, 0.23,\n 0.23, 0.23, 0.0, 0.0, 0.0, 0.23, 0.0], [0.0, 0.0, 0.23, 0.23, 0.23, 0.0,\n 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.23, 0.23, 0.0, 0.0, 0.0, 0.0, \n 0.0], [0.0, 0.0, 0.0, 0.0, 0.23, 0.0, 0.... |
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
class PhysNetDataset(Dataset):
def __init__(self, video_data, label_data):
self.transform = transforms.Compose([transforms.ToTensor()])
self.video_data = video_data
se... | [
"torch.is_tensor",
"torchvision.transforms.ToTensor",
"numpy.transpose",
"torch.tensor"
] | [((391, 413), 'torch.is_tensor', 'torch.is_tensor', (['index'], {}), '(index)\n', (406, 413), False, 'import torch\n'), ((583, 635), 'torch.tensor', 'torch.tensor', (['self.label[index]'], {'dtype': 'torch.float32'}), '(self.label[index], dtype=torch.float32)\n', (595, 635), False, 'import torch\n'), ((488, 538), 'nump... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
pyarrow = pytest.importorskip("pyarrow")
def test_categorical_is_valid():
# validate a categorical array by its content
arr... | [
"awkward._v2.Array",
"awkward._v2.behaviors.categorical.to_categorical",
"numpy.asarray",
"awkward._v2.operations.is_valid",
"pytest.importorskip",
"awkward._v2.operations.from_arrow"
] | [((197, 227), 'pytest.importorskip', 'pytest.importorskip', (['"""pyarrow"""'], {}), "('pyarrow')\n", (216, 227), False, 'import pytest\n'), ((323, 367), 'awkward._v2.Array', 'ak._v2.Array', (['[2019, 2020, 2021, 2020, 2019]'], {}), '([2019, 2020, 2021, 2020, 2019])\n', (335, 367), True, 'import awkward as ak\n'), ((38... |
import numpy as np
import warnings
from scipy.ndimage.interpolation import zoom
import torch
import math
import copy
import cv2
from skimage import measure
import pandas as pd
def resample(imgs, spacing, new_spacing, order=2):
if len(imgs.shape) == 3:
new_shape = np.round(imgs.shape * spacing / new_spacing... | [
"numpy.clip",
"numpy.arccos",
"math.sqrt",
"torch.from_numpy",
"math.cos",
"numpy.array",
"torch.log2",
"copy.deepcopy",
"numpy.linalg.norm",
"scipy.ndimage.interpolation.zoom",
"numpy.mean",
"cv2.threshold",
"warnings.simplefilter",
"pandas.DataFrame",
"numpy.round",
"skimage.measure.... | [((1807, 1819), 'numpy.mean', 'np.mean', (['img'], {}), '(img)\n', (1814, 1819), True, 'import numpy as np\n'), ((1840, 1851), 'numpy.std', 'np.std', (['img'], {}), '(img)\n', (1846, 1851), True, 'import numpy as np\n'), ((1870, 1894), 'numpy.percentile', 'np.percentile', (['img', '(99.5)'], {}), '(img, 99.5)\n', (1883... |
# Copyright 2018 Deep Learning Service of Huawei Cloud. 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... | [
"mxnet.nd.stack",
"mxnet.io.DataDesc",
"numpy.asarray",
"os.path.join",
"mxnet.nd.full",
"mxnet.io.DataBatch",
"moxing.framework.file.exists",
"utils.read_image_to_list.get_image_list",
"moxing.framework.file.read"
] | [((1378, 1436), 'mxnet.nd.full', 'nd.full', ([], {'shape': 'ret_shape', 'val': 'pad_val', 'dtype': 'arrs[0].dtype'}), '(shape=ret_shape, val=pad_val, dtype=arrs[0].dtype)\n', (1385, 1436), False, 'from mxnet import gluon, io, nd\n'), ((2002, 2039), 'mxnet.nd.stack', 'nd.stack', (['*[item[0] for item in data]'], {}), '(... |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under ... | [
"numpy.hstack",
"numpy.where",
"numpy.diff",
"numpy.any",
"numpy.array",
"numpy.zeros",
"numpy.all"
] | [((3302, 3321), 'numpy.any', 'np.any', (['(resids == 0)'], {}), '(resids == 0)\n', (3308, 3321), True, 'import numpy as np\n'), ((2260, 2293), 'numpy.zeros', 'np.zeros', (['n_atoms'], {'dtype': 'np.int32'}), '(n_atoms, dtype=np.int32)\n', (2268, 2293), True, 'import numpy as np\n'), ((2317, 2348), 'numpy.zeros', 'np.ze... |
# Copyright (c) 2015-2019 <NAME> and contributors.
# MC3 is open-source software under the MIT license (see LICENSE).
import os
import re
import sys
import setuptools
from setuptools import setup, Extension
from numpy import get_include
sys.path.append('mc3')
from VERSION import __version__
srcdir = 'src_c/' ... | [
"os.listdir",
"setuptools.find_packages",
"numpy.get_include",
"sys.path.append",
"re.search"
] | [((240, 262), 'sys.path.append', 'sys.path.append', (['"""mc3"""'], {}), "('mc3')\n", (255, 262), False, 'import sys\n'), ((418, 436), 'os.listdir', 'os.listdir', (['srcdir'], {}), '(srcdir)\n', (428, 436), False, 'import os\n'), ((591, 604), 'numpy.get_include', 'get_include', ([], {}), '()\n', (602, 604), False, 'fro... |
####Please do not remove lines below####
from lmfit import Parameters
import numpy as np
import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('./Functions'))
sys.path.append(os.path.abspath('./Fortran_routines'))
####Please do not remove lines above####
####Import your modules bel... | [
"Structure_Factors.hard_sphere_sf",
"numpy.ones_like",
"numpy.abs",
"numpy.sqrt",
"numpy.log",
"numpy.zeros_like",
"numpy.exp",
"numpy.array",
"numpy.sum",
"ff_sphere.ff_sphere_ml",
"numpy.linspace",
"os.path.abspath",
"functools.lru_cache",
"Structure_Factors.sticky_sphere_sf",
"lmfit.P... | [((126, 146), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (141, 146), False, 'import os\n'), ((164, 194), 'os.path.abspath', 'os.path.abspath', (['"""./Functions"""'], {}), "('./Functions')\n", (179, 194), False, 'import os\n'), ((212, 249), 'os.path.abspath', 'os.path.abspath', (['"""./Fortran_... |
import numpy as np
import numpy.fft as fft
import matplotlib.pyplot as plt
def fft_demo():
x = np.arange(-100, 100, 0.5)
y = np.sin(x) + np.sin(3 * x)
plt.figure()
plt.plot(x, y)
plt.show()
plt.figure()
plt.plot(fft.fftfreq(x.shape[-1]), abs(fft.fft(y)))
plt.show()
plt.imshow(np.si... | [
"numpy.fft.fftfreq",
"matplotlib.pyplot.plot",
"numpy.fft.fft",
"matplotlib.pyplot.figure",
"numpy.outer",
"numpy.sin",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((101, 126), 'numpy.arange', 'np.arange', (['(-100)', '(100)', '(0.5)'], {}), '(-100, 100, 0.5)\n', (110, 126), True, 'import numpy as np\n'), ((165, 177), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (175, 177), True, 'import matplotlib.pyplot as plt\n'), ((182, 196), 'matplotlib.pyplot.plot', 'plt.plo... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Modifications copyright (C) 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | [
"logging.getLogger",
"torch.nn.CrossEntropyLoss",
"torch.cuda.device_count",
"torch.cuda.is_available",
"pytorch_pretrained_bert.modeling.BertForSequenceClassification.from_pretrained",
"run_classifier_dataset_utils.compute_metrics",
"os.path.exists",
"pytorch_pretrained_bert.tokenization.BertTokenize... | [((1627, 1654), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1644, 1654), False, 'import logging\n'), ((1816, 1895), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(formatter_class=argparse.ArgumentDefaultsHel... |
from skimage import io, transform
import glob
import tensorflow as tf
import numpy as np
path = 'E:/RealTimeIR/predict/'
# 将所有的图片resize成128*128
w = 100
h = 100
c = 3
# 读取图片
def read_img(path):
imgs = []
for im in glob.glob(path + '*.jpg'):
img = io.imread(im)
img = transform.resize(img, (w, ... | [
"tensorflow.InteractiveSession",
"tensorflow.contrib.layers.l2_regularizer",
"tensorflow.layers.max_pooling2d",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"numpy.asarray",
"tensorflow.truncated_normal_initializer",
"tensorflow.argmax",
"skimage.io.imread",
"tensorflow.reshape",
"skimage... | [((505, 564), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, w, h, c]', 'name': '"""x"""'}), "(tf.float32, shape=[None, w, h, c], name='x')\n", (519, 564), True, 'import tensorflow as tf\n'), ((849, 915), 'tensorflow.layers.max_pooling2d', 'tf.layers.max_pooling2d', ([], {'inputs': 'conv... |
"""
defines:
- model = Boundary(log=None, debug=False)
- model = BoundaryFile(log=None, debug=False)
"""
from __future__ import print_function
import os
from codecs import open
from collections import OrderedDict
import numpy as np
from pyNastran.converters.openfoam.points_file import PointFile
from pyNastran.conve... | [
"collections.OrderedDict",
"pyNastran.converters.openfoam.points_file.PointFile",
"pyNastran.converters.openfoam.face_file.FaceFile",
"numpy.zeros",
"pyNastran.utils.check_path",
"numpy.ravel",
"codecs.open",
"pyNastran.utils.log.get_logger2",
"numpy.arange"
] | [((540, 569), 'pyNastran.utils.log.get_logger2', 'get_logger2', (['log'], {'debug': 'debug'}), '(log, debug=debug)\n', (551, 569), False, 'from pyNastran.utils.log import get_logger2\n'), ((5151, 5180), 'pyNastran.utils.log.get_logger2', 'get_logger2', (['log'], {'debug': 'debug'}), '(log, debug=debug)\n', (5162, 5180)... |
import tnetwork as tn
import sklearn
import sklearn.metrics
import scipy
import statistics
import networkx as nx
from tnetwork.DCD.analytics.onmi import onmi
import numpy as np
__all__ = ["longitudinal_similarity", "consecutive_sn_similarity", "similarity_at_each_step", "entropy_by_node","nb_node_change","quality_at_e... | [
"statistics.mean",
"scipy.stats.entropy",
"sklearn.metrics.adjusted_mutual_info_score",
"numpy.average"
] | [((9391, 9421), 'statistics.mean', 'statistics.mean', (['all_entropies'], {}), '(all_entropies)\n', (9406, 9421), False, 'import statistics\n'), ((9874, 9934), 'numpy.average', 'np.average', (['consecutive_NMIs[0]'], {'weights': 'consecutive_NMIs[1]'}), '(consecutive_NMIs[0], weights=consecutive_NMIs[1])\n', (9884, 993... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 13 12:00:40 2020
@author: medrclaa
This file contains the functions for constructing an exit gfates probablity
distribution for an agent given its current heading. Currently, this heading is
determined by the slope of the line through an agents st... | [
"numpy.hstack",
"matplotlib.pyplot.plot",
"shapely.geometry.Point",
"numpy.array",
"matplotlib.pyplot.figure",
"shapely.geometry.LineString",
"numpy.arctan2",
"stationsim.stationsim_model.Model",
"numpy.cos",
"numpy.sin",
"sys.path.append",
"matplotlib.pyplot.show"
] | [((885, 906), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (900, 906), False, 'import sys\n'), ((907, 931), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (922, 931), False, 'import sys\n'), ((1028, 1055), 'sys.path.append', 'sys.path.append', (['"""../../.."""'], {... |
#!/usr/bin/env python
# import tensorflow as tf
# zero_out_module = tf.load_op_library('../lib/zero_out.so')
# with tf.Session(''):
# print(zero_out_module.zero_out([[1, 2], [3, 4]]).eval())
import numpy as np
import tensorflow as tf
class ExampleOpsTest(tf.test.TestCase):
def setUp(self):
se... | [
"tensorflow.load_op_library",
"tensorflow.test.main",
"numpy.random.randint",
"tensorflow.constant",
"numpy.random.randn"
] | [((1534, 1548), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (1546, 1548), True, 'import tensorflow as tf\n'), ((335, 375), 'tensorflow.load_op_library', 'tf.load_op_library', (['"""lib/example_ops.so"""'], {}), "('lib/example_ops.so')\n", (353, 375), True, 'import tensorflow as tf\n'), ((969, 1009), 'tens... |
from math import pi, sin, cos
from numpy import sign
import tf.transformations
from geometry_msgs.msg import Quaternion
from nav_msgs.msg import Odometry
def yaw_from_odom_message(odom):
"""Converts an Odometry message into an Euler yaw value
Parameters:
:param Odometry odom:
:rtype: float
"... | [
"nav_msgs.msg.Odometry",
"math.cos",
"geometry_msgs.msg.Quaternion",
"numpy.sign",
"math.sin"
] | [((1128, 1144), 'numpy.sign', 'sign', (['diff_angle'], {}), '(diff_angle)\n', (1132, 1144), False, 'from numpy import sign\n'), ((2928, 2940), 'geometry_msgs.msg.Quaternion', 'Quaternion', ([], {}), '()\n', (2938, 2940), False, 'from geometry_msgs.msg import Quaternion\n'), ((3057, 3067), 'nav_msgs.msg.Odometry', 'Odom... |
"""
library containing differential equation solver for d=1 kernel elements
"""
__author__ = " <NAME>"
__email__ = "<EMAIL>"
import os
import numpy as np
from scipy.special import factorial
import pdb
np.seterr(divide='ignore', invalid='ignore')
from scipy import special
from scipy.integrate import odeint, solve_ivp... | [
"logging.getLogger",
"cosmoboost.lib.FileHandler.get_matrices_filename",
"numpy.arange",
"cosmoboost.lib.MatrixHandler.get_ML_matrix",
"cosmoboost.lib.MatrixHandler.shift_left",
"cosmoboost.lib.FileHandler.get_kernel_filename",
"os.path.exists",
"cosmoboost.lib.FileHandler.file_exists",
"numpy.delet... | [((203, 247), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='ignore', invalid='ignore')\n", (212, 247), True, 'import numpy as np\n'), ((481, 508), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (498, 508), False, 'import logging\n'), (... |
"""
Testing what the fastest way is to create a 1D Array with 2 values
"""
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import random
import numpy as np
x, y = random.uniform(0, 300), random.uniform(0, 300)
def numpy_array(x, y):
# Calculate distances between each of the... | [
"random.uniform",
"numpy.fromiter",
"numpy.ones",
"numpy.asarray",
"numpy.asanyarray",
"numpy.array",
"numpy.zeros",
"os.path.dirname",
"numpy.array_equal"
] | [((1970, 1986), 'numpy.array', 'np.array', (['[x, y]'], {}), '([x, y])\n', (1978, 1986), True, 'import numpy as np\n'), ((203, 225), 'random.uniform', 'random.uniform', (['(0)', '(300)'], {}), '(0, 300)\n', (217, 225), False, 'import random\n'), ((227, 249), 'random.uniform', 'random.uniform', (['(0)', '(300)'], {}), '... |
import numpy as np
class GPInterface(object):
def __init__(self):
self.kernel = None
self.ndim = None
self.model = None
self.outdim = 1
def create_kernel(self, ndim, kernel_name, var_f=1.0, lengthscale=1.0):
pass
def create_model(self, x, y, noise_var, noise_prior)... | [
"numpy.ones",
"numpy.isscalar"
] | [((540, 564), 'numpy.isscalar', 'np.isscalar', (['lengthscale'], {}), '(lengthscale)\n', (551, 564), True, 'import numpy as np\n'), ((592, 605), 'numpy.ones', 'np.ones', (['ndim'], {}), '(ndim)\n', (599, 605), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
# <NAME>
# <EMAIL>
import logging
import numpy as np
import pandas as pd
from bioidtracker.database_manager import DatabaseManager
from bioidtracker.db import DB
class Dataset:
"""Todo."""
def __init__(self, db_manager: DatabaseManager, narrow_search=True):
"""Todo.
... | [
"logging.getLogger",
"pandas.Series",
"numpy.unique",
"numpy.any",
"pandas.DataFrame",
"numpy.all",
"pandas.concat"
] | [((422, 450), 'logging.getLogger', 'logging.getLogger', (['"""dataset"""'], {}), "('dataset')\n", (439, 450), False, 'import logging\n'), ((1487, 1502), 'numpy.all', 'np.all', (['id_vers'], {}), '(id_vers)\n', (1493, 1502), True, 'import numpy as np\n'), ((2572, 2586), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\... |
#!/usr/bin/env python2
'''
description: Convert directory with downloaded zipped KNMI ascii files to
netCDF format. Station information is obtained from a csv file.
Creation of the csv file and downloading of the KNMI data is
performed in another script (knmi_getdata.py).
aut... | [
"netcdftime.date2num",
"csv.DictReader",
"load_knmi_data.load_knmi_data",
"collections.defaultdict",
"numpy.dtype",
"time.time"
] | [((1095, 1124), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1118, 1124), False, 'import collections\n'), ((5595, 5631), 'csv.DictReader', 'csv.DictReader', (['csvin'], {'delimiter': '""","""'}), "(csvin, delimiter=',')\n", (5609, 5631), False, 'import csv\n'), ((968, 992), 'load_k... |
#! /usr/local/bin/python
# ! -*- encoding:utf-8 -*-
from pathlib import Path
import pandas as pd
import numpy as np
import random
import os
import argparse
proj_path = Path(__file__).parent.resolve().parent.resolve().parent.resolve()
data_path = proj_path / 'data' / 'PPP'
def read_csv(data_file, dataset):
cci_la... | [
"random.choice",
"argparse.ArgumentParser",
"pandas.read_csv",
"pathlib.Path",
"random.seed",
"numpy.random.seed",
"pandas.DataFrame",
"random.randint"
] | [((487, 527), 'pandas.read_csv', 'pd.read_csv', (['edge_list_path'], {'header': 'None'}), '(edge_list_path, header=None)\n', (498, 527), True, 'import pandas as pd\n'), ((2419, 2439), 'random.choice', 'random.choice', (['nodes'], {}), '(nodes)\n', (2432, 2439), False, 'import random\n'), ((2585, 2599), 'pandas.DataFram... |
from hydroDL import kPath, utils
from hydroDL.app import waterQuality
from hydroDL.master import basins
from hydroDL.data import usgs, gageII, gridMET, ntn, transform
from hydroDL.master import slurm
from hydroDL.post import axplot, figplot
import numpy as np
import matplotlib.pyplot as plt
codeLst = sorted(usgs.newC)... | [
"numpy.array",
"hydroDL.data.transform.transInAll",
"hydroDL.utils.sortData",
"hydroDL.app.waterQuality.DataModelWQ",
"hydroDL.app.waterQuality.extractVarMtd",
"matplotlib.pyplot.subplots"
] | [((367, 401), 'hydroDL.app.waterQuality.DataModelWQ', 'waterQuality.DataModelWQ', (['dataName'], {}), '(dataName)\n', (391, 401), False, 'from hydroDL.app import waterQuality\n'), ((562, 597), 'hydroDL.app.waterQuality.extractVarMtd', 'waterQuality.extractVarMtd', (['codeLst'], {}), '(codeLst)\n', (588, 597), False, 'f... |
""" Affine image registration module consisting of the following classes:
AffineMap: encapsulates the necessary information to perform affine
transforms between two domains, defined by a `static` and a `moving`
image. The `domain` of the transform is the set of points in the
`static` image'... | [
"numpy.eye",
"numpy.ceil",
"numpy.ones",
"numpy.array",
"numpy.linalg.inv",
"numpy.isnan",
"numpy.empty"
] | [((48493, 48508), 'numpy.eye', 'np.eye', (['(dim + 1)'], {}), '(dim + 1)\n', (48499, 48508), True, 'import numpy as np\n'), ((50090, 50105), 'numpy.eye', 'np.eye', (['(dim + 1)'], {}), '(dim + 1)\n', (50096, 50105), True, 'import numpy as np\n'), ((51476, 51491), 'numpy.eye', 'np.eye', (['(dim + 1)'], {}), '(dim + 1)\n... |
import matplotlib
from matplotlib.pyplot import subplot, plot, show
from numpy import linspace, sin, pi
import seismo
matplotlib.style.use('ggplot')
x = linspace(0, 0.05, 500)
y = 0.6*sin(2*pi*240*x)\
+ 0.15*sin(2*pi*1303*x + 0.4)\
+ 0.1*sin(2*pi*3000*x)
f, a = seismo.deeming(x, y)
subplot(211)
plot(x, y, '... | [
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.linspace",
"matplotlib.style.use",
"seismo.deeming",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((119, 149), 'matplotlib.style.use', 'matplotlib.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (139, 149), False, 'import matplotlib\n'), ((155, 177), 'numpy.linspace', 'linspace', (['(0)', '(0.05)', '(500)'], {}), '(0, 0.05, 500)\n', (163, 177), False, 'from numpy import linspace, sin, pi\n'), ((273, 293), 'sei... |
#!/usr/bin/python
"""
roadGrid.py: version 0.1.0
A quick 2D Voxel implemenation.
History:
2017/01/29: coding style phase1:
reformat to python-guide.org code style
http://docs.python-guide.org/en/latest/writing/style/
which uses PEP 8 as a base: http://pep8.org/.
2017/01/23: Initial version converted to a c... | [
"numpy.polyfit",
"numpy.array",
"re.compile"
] | [((4602, 4620), 'numpy.array', 'np.array', (['[y0, y1]'], {}), '([y0, y1])\n', (4610, 4620), True, 'import numpy as np\n'), ((4636, 4654), 'numpy.array', 'np.array', (['[x0, x1]'], {}), '([x0, x1])\n', (4644, 4654), True, 'import numpy as np\n'), ((15339, 15382), 're.compile', 're.compile', (["('^%s[0123456789]+$' % la... |
# Copyright 2020 <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 use, copy, modify, merge,
# publish, distribute, subl... | [
"collections.deque",
"matplotlib.pyplot.plot",
"numpy.append",
"numpy.array",
"numpy.empty",
"matplotlib.pyplot.scatter"
] | [((1736, 1743), 'collections.deque', 'deque', ([], {}), '()\n', (1741, 1743), False, 'from collections import deque\n'), ((2555, 2581), 'numpy.empty', 'np.empty', (['(total_nodes, 2)'], {}), '((total_nodes, 2))\n', (2563, 2581), True, 'import numpy as np\n'), ((2594, 2610), 'numpy.empty', 'np.empty', (['(0, 2)'], {}), ... |
# Copyright (c) OpenMMLab. All rights reserved.
from collections import defaultdict
from contextlib import contextmanager
from functools import partial
import numpy as np
from mmcv import Timer
class RunningAverage():
r"""A helper class to calculate running average in a sliding window.
Args:
window ... | [
"functools.partial",
"numpy.mean",
"collections.defaultdict",
"mmcv.Timer"
] | [((706, 725), 'numpy.mean', 'np.mean', (['self._data'], {}), '(self._data)\n', (713, 725), True, 'import numpy as np\n'), ((3683, 3700), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3694, 3700), False, 'from collections import defaultdict\n'), ((1609, 1652), 'functools.partial', 'partial', (['... |
# -*- encoding: utf-8 -*-
# @Author: <NAME>
# @Time: 2021/08/21 04:37:56
# @File: saligned.py
import math
import torch
import numpy as np
from torch import nn
from mwptoolkit.module.Embedder.basic_embedder import BaiscEmbedder
from mwptoolkit.module.Encoder.rnn_encoder import SalignedEncoder
from mwptoolkit.module.D... | [
"torch.nn.functional.softmax",
"mwptoolkit.module.Decoder.rnn_decoder.SalignedDecoder",
"mwptoolkit.module.Environment.stack_machine.OPERATIONS",
"mwptoolkit.module.Embedder.basic_embedder.BaiscEmbedder",
"torch.nn.CrossEntropyLoss",
"torch.LongTensor",
"torch.stack",
"torch.argmax",
"mwptoolkit.mod... | [((808, 842), 'mwptoolkit.module.Environment.stack_machine.OPERATIONS', 'OPERATIONS', (['dataset.out_symbol2idx'], {}), '(dataset.out_symbol2idx)\n', (818, 842), False, 'from mwptoolkit.module.Environment.stack_machine import OPERATIONS, StackMachine\n'), ((3000, 3050), 'mwptoolkit.module.Embedder.basic_embedder.BaiscE... |
"""
A class for loading neural networks in nnet format, as described in the readme.
The nnet format used is a slightly modified version of the ACAS Xu format (https://github.com/sisl/NNet).
Author: <NAME> <<EMAIL>>
"""
import numpy as np
import torch
import torch.nn as nn
from src.neural_networks.verinet_nn import ... | [
"torch.nn.Sigmoid",
"torch.nn.ReLU",
"numpy.prod",
"torch.nn.BatchNorm2d",
"torch.nn.Tanh",
"torch.nn.Sequential",
"numpy.float64",
"torch.Tensor",
"src.neural_networks.verinet_nn.VeriNetNN",
"torch.nn.Conv2d",
"numpy.array",
"numpy.empty",
"torch.nn.Linear",
"torch.FloatTensor",
"numpy.... | [((9765, 9794), 'numpy.empty', 'np.empty', (['(out_size, in_size)'], {}), '((out_size, in_size))\n', (9773, 9794), True, 'import numpy as np\n'), ((9810, 9828), 'numpy.empty', 'np.empty', (['out_size'], {}), '(out_size)\n', (9818, 9828), True, 'import numpy as np\n'), ((10700, 10827), 'numpy.empty', 'np.empty', (["(con... |
import unittest
import numpy as np
from numpy import array
from bruges.models import reconcile, interpolate, panel
from bruges.models import wedge
class ModelTest(unittest.TestCase):
"""
Tests models.
"""
def test_reconcile(self):
a = np.array([2, 6, 7, 7, 3])
b = np.array([3, 7, 3])
... | [
"numpy.allclose",
"unittest.TextTestRunner",
"bruges.models.wedge",
"numpy.array",
"bruges.models.panel",
"numpy.array_equal",
"numpy.isnan",
"numpy.all",
"bruges.models.reconcile",
"bruges.models.interpolate",
"unittest.TestLoader"
] | [((262, 287), 'numpy.array', 'np.array', (['[2, 6, 7, 7, 3]'], {}), '([2, 6, 7, 7, 3])\n', (270, 287), True, 'import numpy as np\n'), ((300, 319), 'numpy.array', 'np.array', (['[3, 7, 3]'], {}), '([3, 7, 3])\n', (308, 319), True, 'import numpy as np\n'), ((335, 359), 'bruges.models.reconcile', 'reconcile', (['a', 'b'],... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 23 12:22:37 2020
@author: ninjaac
"""
#############################################################################################
#Array manupulation
"""def matchingStrings(s, q):
for query in q:
lenth = 0
for strings in s:
... | [
"numpy.zeros"
] | [((827, 852), 'numpy.zeros', 'np.zeros', (['(10)'], {'dtype': '"""int"""'}), "(10, dtype='int')\n", (835, 852), True, 'import numpy as np\n')] |
#
# Copyright (c) 2016 - 2022 Deephaven Data Labs and Patent Pending
#
""" Utilities for gathering Deephaven table data into Python objects """
import enum
from typing import Any, Type
import jpy
import numpy as np
from deephaven import DHError
_JGatherer = jpy.get_type("io.deephaven.integrations.learn.gather.Num... | [
"numpy.frombuffer",
"jpy.get_type",
"deephaven.DHError"
] | [((264, 324), 'jpy.get_type', 'jpy.get_type', (['"""io.deephaven.integrations.learn.gather.NumPy"""'], {}), "('io.deephaven.integrations.learn.gather.NumPy')\n", (276, 324), False, 'import jpy\n'), ((2727, 2763), 'numpy.frombuffer', 'np.frombuffer', (['buffer'], {'dtype': 'np_type'}), '(buffer, dtype=np_type)\n', (2740... |
import os
import numpy as np
import tensorflow as tf
from depth.self_supervised_sfm.utils import readlines
AUTOTUNE = tf.data.experimental.AUTOTUNE
########################
# Constants
#########################
KITTI_K = np.array([[0.58, 0, 0.5, 0], # fx/width
[0, 1.92, 0.5, 0],
... | [
"tensorflow.random.uniform",
"os.path.exists",
"tensorflow.image.decode_png",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.image.resize",
"tensorflow.convert_to_tensor",
"tensorflow.io.read_file",
"os.path.join",
"tensorflow.linalg.inv",
"numpy.array",
"os.path.isdir",
"depth.self... | [((225, 321), 'numpy.array', 'np.array', (['[[0.58, 0, 0.5, 0], [0, 1.92, 0.5, 0], [0, 0, 1, 0], [0, 0, 0, 1]]'], {'dtype': 'np.float'}), '([[0.58, 0, 0.5, 0], [0, 1.92, 0.5, 0], [0, 0, 1, 0], [0, 0, 0, 1]],\n dtype=np.float)\n', (233, 321), True, 'import numpy as np\n'), ((1276, 1295), 'depth.self_supervised_sfm.ut... |
import ecoblock_test.simulation as sim
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
NUMBER_OF_SIMULATIONS = 20
NUMBER_OF_SIMULATIONS_ID = 28
cost_record = []
flywheel_final_soc = []
def plot_hist(data):
plt.figure()
num_bins = 30
data.hist(bins=num_bins)
plt.xlabel('Cost in ... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"ecoblock_test.simulation.System",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.sum",
"matplotlib.pyplot.figure",
"pandas.DataFrame"
] | [((1136, 1181), 'pandas.DataFrame', 'pd.DataFrame', (['sim_id_list'], {'columns': "['sim_id']"}), "(sim_id_list, columns=['sim_id'])\n", (1148, 1181), True, 'import pandas as pd\n'), ((1367, 1410), 'pandas.DataFrame', 'pd.DataFrame', (['cost_record'], {'columns': "['cost']"}), "(cost_record, columns=['cost'])\n", (1379... |
import glob
from pathlib import Path
import json
import re
import os
import numpy as np
import pandas as pd
from isochrones.models import StellarModelGrid, ModelGridInterpolator
from isochrones.mist.models import MISTEvolutionTrackGrid
from isochrones.mist.bc import MISTBolometricCorrectionGrid
from isochrones.mags i... | [
"numpy.atleast_2d",
"pathlib.Path",
"os.path.join",
"numpy.broadcast",
"numpy.array",
"numpy.resize",
"isochrones.mags.interp_mag_4d",
"isochrones.mags.interp_mags_4d",
"pandas.DataFrame",
"isochrones.models.StellarModelGrid.df_all",
"numpy.broadcast_arrays",
"numpy.atleast_1d"
] | [((1999, 2028), 'isochrones.models.StellarModelGrid.df_all', 'StellarModelGrid.df_all', (['self'], {}), '(self)\n', (2022, 2028), False, 'from isochrones.models import StellarModelGrid, ModelGridInterpolator\n'), ((3353, 3387), 'pandas.DataFrame', 'pd.DataFrame', (['values'], {'columns': 'cols'}), '(values, columns=col... |
import sys
from cv2 import cv2
import numpy as np
import mss
from pynput.mouse import Button, Controller
while True:
stc = mss.mss()
scr = stc.grab(
{
"left": 744,
"top": 152,
"width": 420,
"height": 240,
}
)
frame = np.array(scr)
hsvframe = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_white = np... | [
"cv2.cv2.setWindowProperty",
"cv2.cv2.inRange",
"sys.exit",
"mss.mss",
"cv2.cv2.waitKey",
"cv2.cv2.bitwise_and",
"cv2.cv2.destroyAllWindows",
"numpy.array",
"cv2.cv2.contourArea",
"cv2.cv2.findContours",
"pynput.mouse.Controller",
"cv2.cv2.cvtColor",
"cv2.cv2.boundingRect",
"cv2.cv2.imshow... | [((125, 134), 'mss.mss', 'mss.mss', ([], {}), '()\n', (132, 134), False, 'import mss\n'), ((238, 251), 'numpy.array', 'np.array', (['scr'], {}), '(scr)\n', (246, 251), True, 'import numpy as np\n'), ((264, 302), 'cv2.cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2HSV'], {}), '(frame, cv2.COLOR_BGR2HSV)\n', (2... |
# coding=utf-8
###
# Patient.py -
# This file contains the definition of class Patient used to handle patients scans, store their lesions
# and survival time.
# Patient.py also implements handy function to pre process a pile of dicom image e.g. conversion to SUV
#
# Author : <NAME> - <EMAIL>
#
# Created on : 16/02/201... | [
"SimpleITK.GetImageFromArray",
"pydicom.dcmread",
"dicom_numpy.combine_slices",
"numpy.log",
"os.path.join",
"SimpleITK.GetArrayFromImage",
"os.walk"
] | [((1532, 1563), 'pydicom.dcmread', 'pydicom.dcmread', (['pathToDcmSlice'], {}), '(pathToDcmSlice)\n', (1547, 1563), False, 'import pydicom\n'), ((2107, 2138), 'pydicom.dcmread', 'pydicom.dcmread', (['pathToDcmSlice'], {}), '(pathToDcmSlice)\n', (2122, 2138), False, 'import pydicom\n'), ((2988, 3009), 'os.walk', 'os.wal... |
import numpy as np
import open3d as o3d
from argparse import ArgumentParser
import os
parser = ArgumentParser()
parser.add_argument("--red",type=float, default= 0.5)
parser.add_argument("--blue", type=float, default = 0.4)
parser.add_argument("--green", type=float, default = 0.4)
parser.add_argument("--scan_folder",ty... | [
"numpy.savez",
"os.listdir",
"numpy.cross",
"argparse.ArgumentParser",
"numpy.asarray",
"numpy.linalg.norm",
"numpy.argmax",
"numpy.zeros",
"open3d.geometry.PointCloud",
"open3d.io.read_point_cloud",
"numpy.argmin",
"open3d.utility.Vector3dVector"
] | [((96, 112), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (110, 112), False, 'from argparse import ArgumentParser\n'), ((1944, 1995), 'os.listdir', 'os.listdir', (['f"""./pointcloud_raw/{args.scan_folder}/"""'], {}), "(f'./pointcloud_raw/{args.scan_folder}/')\n", (1954, 1995), False, 'import os\n'), (... |
'''
A simple neural network to solve 2 input XOR
'''
import numpy as np
import tensorflow as tf
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
X = np.array([
[0, 0],
[0, 1],
[1, 0],
[1, 1]
], "float32")
y = np.array([
[0],
[1],
[1],
... | [
"tensorflow.cast",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.merge_all",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.OneHotEncoder",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.global_variables_initializer",
"numpy.array",
"tensorflow.argmax",
"... | [((204, 257), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 0], [1, 1]]', '"""float32"""'], {}), "([[0, 0], [0, 1], [1, 0], [1, 1]], 'float32')\n", (212, 257), True, 'import numpy as np\n'), ((281, 320), 'numpy.array', 'np.array', (['[[0], [1], [1], [0]]', '"""int32"""'], {}), "([[0], [1], [1], [0]], 'int32')\n", ... |
'''
Applying Stochastic Gradient Descent for Linear Regression
'''
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
X = 2 * np.random.rand(100,1)
y = 4 + 3 * X + np.random.randn(100,1)
X_b = np.c_[np.ones((100,1)), X]
eta = .1
m = 100
n_epochs = 50
# Learning schedule hyperparameters
t0, t1 = 5... | [
"numpy.ones",
"numpy.random.rand",
"sklearn.linear_model.SGDRegressor",
"numpy.random.randint",
"numpy.random.randn"
] | [((420, 441), 'numpy.random.randn', 'np.random.randn', (['(2)', '(1)'], {}), '(2, 1)\n', (435, 441), True, 'import numpy as np\n'), ((871, 920), 'sklearn.linear_model.SGDRegressor', 'SGDRegressor', ([], {'max_iter': '(50)', 'penalty': 'None', 'eta0': '(0.1)'}), '(max_iter=50, penalty=None, eta0=0.1)\n', (883, 920), Fal... |
#!/usr/bin/env python
### shared_qvm.py
###
### Author: <NAME>
###
### Copyright (c) 2017 Rigetti Computing
### This file shows a minimal example of how to use the --shared
### option with QVM from Python.
from __future__ import print_function
import posix_ipc as pos
import mmap
import ctypes
import numpy as np
impo... | [
"pyquil.api.QVMConnection",
"mmap.mmap",
"ctypes.POINTER",
"numpy.sqrt",
"socket.socket",
"numpy.isclose",
"numpy.ctypeslib.as_array",
"posix_ipc.SharedMemory",
"pyquil.quil.Program",
"ctypes.c_void_p.from_buffer",
"pyquil.gates.X",
"numpy.ctypeslib.ndpointer",
"sys.exit"
] | [((491, 540), 'socket.socket', 'socket.socket', (['socket.AF_UNIX', 'socket.SOCK_STREAM'], {}), '(socket.AF_UNIX, socket.SOCK_STREAM)\n', (504, 540), False, 'import socket\n'), ((794, 816), 'posix_ipc.SharedMemory', 'pos.SharedMemory', (['name'], {}), '(name)\n', (810, 816), True, 'import posix_ipc as pos\n'), ((825, 8... |
import numpy as np
n = int(input().strip())
array = np.array([[float(x) for x in input().strip().split()] for _ in range(n)], dtype = float)
print(np.linalg.det(array)) | [
"numpy.linalg.det"
] | [((149, 169), 'numpy.linalg.det', 'np.linalg.det', (['array'], {}), '(array)\n', (162, 169), True, 'import numpy as np\n')] |
#Created by JetBrains PyCharm
#Project Name: SoundAnalyzer with RaspberryPi
#Author: <NAME>
#University: Cergy-Pontoise
#E-mail : <EMAIL>
import asyncio
import os, errno
import pyaudio
import spl_lib as spl
from scipy.signal import lfilter
import numpy
import time
class MicUSB:
#CHUNKS[1] was 9600
CHUNKS = [... | [
"spl_lib.rms_flat",
"asyncio.get_event_loop",
"spl_lib.A_weighting",
"scipy.signal.lfilter",
"pyaudio.PyAudio",
"numpy.fromstring",
"time.time"
] | [((500, 521), 'spl_lib.A_weighting', 'spl.A_weighting', (['RATE'], {}), '(RATE)\n', (515, 521), True, 'import spl_lib as spl\n'), ((567, 584), 'pyaudio.PyAudio', 'pyaudio.PyAudio', ([], {}), '()\n', (582, 584), False, 'import pyaudio\n'), ((1245, 1256), 'time.time', 'time.time', ([], {}), '()\n', (1254, 1256), False, '... |
import six
from collections import deque, defaultdict
import numpy as np
from pybot.utils.itertools_recipes import chunks
def concat_chunked_dicts(dlist):
"""
Concatenate individual arrays in dictionary
TODO: defaultdict is the right way to do it, except for
conversion to dict in the final retur... | [
"six.iteritems",
"collections.defaultdict",
"numpy.concatenate",
"pybot.utils.itertools_recipes.chunks"
] | [((384, 401), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (395, 401), False, 'from collections import deque, defaultdict\n'), ((511, 531), 'six.iteritems', 'six.iteritems', (['batch'], {}), '(batch)\n', (524, 531), False, 'import six\n'), ((851, 879), 'pybot.utils.itertools_recipes.chunks', 'c... |
from unityagents import UnityEnvironment
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import torch
from collections import deque
from maddpg import MADDPG
env = UnityEnvironment(file_name="Tennis_Linux/Tennis.x86_64")
# get the default brain
brain_name = env.brain_names[0]
brain = env.br... | [
"numpy.mean",
"collections.deque",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.style.use",
"numpy.any",
"numpy.max",
"unityagents.UnityEnvironment",
"matplotlib.pyplot.figure",
"numpy.zeros",
"maddpg.MADDPG",
"matplotlib.pyplot.show"
] | [((92, 115), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (105, 115), True, 'import matplotlib.pyplot as plt\n'), ((192, 248), 'unityagents.UnityEnvironment', 'UnityEnvironment', ([], {'file_name': '"""Tennis_Linux/Tennis.x86_64"""'}), "(file_name='Tennis_Linux/Tennis.x86_64')... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 21 15:50:29 2017
@author: BallBlueMeercat
"""
#import csv
#with open('Amanullah.txt') as f:
# reader = csv.reader(f, delimiter="\t")
# d = list(reader)
#print(d[5][:]) # 248
#import pandas as pd
#pd.read_csv('Amanullah.txt', delim_whitespace=... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.asarray",
"results.load",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((36606, 36618), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (36616, 36618), True, 'import matplotlib.pyplot as plt\n'), ((36619, 36644), 'matplotlib.pyplot.scatter', 'plt.scatter', (['zpicks1', 'mag'], {}), '(zpicks1, mag)\n', (36630, 36644), True, 'import matplotlib.pyplot as plt\n'), ((36644, 36664)... |
# %% [markdown]
# ##
import os
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.patches import Circle
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from sci... | [
"numpy.log10",
"pandas.read_csv",
"src.io.savecsv",
"numpy.empty",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.isinf",
"src.io.savefig",
"numpy.random.choice",
"hyppo.ksample.KSample",
"time.time",
"numpy.median",
"src.io.readcsv",
"sklearn.metrics.pairwise_distances",
"joblib.Parall... | [((962, 982), 'numpy.random.seed', 'np.random.seed', (['(8888)'], {}), '(8888)\n', (976, 982), True, 'import numpy as np\n'), ((1522, 1577), 'src.io.readcsv', 'readcsv', (["('meta' + basename)"], {'foldername': 'exp', 'index_col': '(0)'}), "('meta' + basename, foldername=exp, index_col=0)\n", (1529, 1577), False, 'from... |
import sys, os, random, json, uuid, time, argparse, logging, logging.config
import numpy as np
from random import randint
from collections import defaultdict as ddict, Counter
from orderedset import OrderedSet
from pprint import pprint
# PyTorch related imports
import torch
from torch.nn import functional as F
from to... | [
"logging.getLogger",
"logging.StreamHandler",
"logging.config.dictConfig",
"logging.Formatter",
"torch.stack",
"torch.Tensor",
"torch.rfft",
"torch.nn.init.xavier_normal_",
"numpy.set_printoptions"
] | [((531, 563), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(4)'}), '(precision=4)\n', (550, 563), True, 'import numpy as np\n'), ((1400, 1438), 'logging.config.dictConfig', 'logging.config.dictConfig', (['config_dict'], {}), '(config_dict)\n', (1425, 1438), False, 'import sys, os, random, json, ... |
"""
This module provides a function to evaluate potential outliers in the aseg.stats
values.
"""
# ------------------------------------------------------------------------------
# subfunctions
def readAsegStats(path_aseg_stats):
"""
A function to read aseg.stats files.
"""
# read file
with open... | [
"csv.DictWriter",
"numpy.mean",
"os.path.join",
"pandas.DataFrame.from_dict",
"numpy.std",
"numpy.percentile",
"qatoolspython.outlierDetection.readAsegStats"
] | [((11106, 11164), 'os.path.join', 'os.path.join', (['subjects_dir', 'subject', '"""stats"""', '"""aseg.stats"""'], {}), "(subjects_dir, subject, 'stats', 'aseg.stats')\n", (11118, 11164), False, 'import os\n'), ((11186, 11216), 'qatoolspython.outlierDetection.readAsegStats', 'readAsegStats', (['path_aseg_stats'], {}), ... |
#!/usr/bin/env python
# coding:utf8
# -*- coding: utf-8 -*-
"""
Main Program: Run MODIS AGGREGATION IN PARALLEL
Created on 2019
@author: <NAME>
"""
import os
import sys
import h5py
import timeit
import random
import numpy as np
from mpi4py import MPI
from netCDF4 import Dataset
def read_filelist(loc_dir,prefix,yr,... | [
"numpy.dstack",
"numpy.unique",
"numpy.where",
"timeit.default_timer",
"netCDF4.Dataset",
"numpy.min",
"random.seed",
"h5py.File",
"numpy.append",
"numpy.array",
"numpy.zeros",
"os.popen",
"numpy.split",
"numpy.max",
"sys.exit",
"numpy.meshgrid",
"numpy.int",
"numpy.arange"
] | [((673, 693), 'netCDF4.Dataset', 'Dataset', (['fname1', '"""r"""'], {}), "(fname1, 'r')\n", (680, 693), False, 'from netCDF4 import Dataset\n'), ((702, 746), 'numpy.array', 'np.array', (["ncfile.variables['Cloud_Mask_1km']"], {}), "(ncfile.variables['Cloud_Mask_1km'])\n", (710, 746), True, 'import numpy as np\n'), ((88... |
import argparse
import datetime
import numpy as np
import os
import optuna
import pandas as pd
import sys
import tensorflow as tf
from optuna.integration import TFKerasPruningCallback
from pathlib import Path
# global variables
DATA_SET_PATH = ""
def parse_split(split_str):
pieces = split_str.split(",")
spl... | [
"tensorflow.data.experimental.cardinality",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.keras.callbacks.EarlyStopping",
"tensorflow.keras.layers.Dense",
"optuna.integration.TFKerasPruningCallback",
"numpy.mean",
"argparse.ArgumentParser",
"numpy.concatenate",
"numpy.abs",
"tensorflow.k... | [((1230, 1275), 'tensorflow.data.experimental.load', 'tf.data.experimental.load', (['path', 'element_spec'], {}), '(path, element_spec)\n', (1255, 1275), True, 'import tensorflow as tf\n'), ((1723, 1788), 'tensorflow.keras.Input', 'tf.keras.Input', ([], {'shape': '(None, num_twitter_features)', 'name': '"""tweets"""'})... |
from collections import Iterable
from typing import Union, List, Tuple
import numpy as np
from functools import partial
from scipy import ndimage as ndi
import cv2
import random
from .utils import clipBBoxes
from .base import AugBase
# -------------- channel aug_cuda --------------- #
class RGB2Gray(AugBase):
d... | [
"numpy.clip",
"numpy.random.rand",
"numpy.array",
"scipy.ndimage.gaussian_filter",
"numpy.moveaxis",
"numpy.arange",
"numpy.mean",
"numpy.repeat",
"numpy.where",
"numpy.max",
"numpy.exp",
"numpy.stack",
"numpy.concatenate",
"numpy.min",
"numpy.meshgrid",
"numpy.floor",
"numpy.std",
... | [((13049, 13069), 'numpy.zeros_like', 'np.zeros_like', (['image'], {}), '(image)\n', (13062, 13069), True, 'import numpy as np\n'), ((17227, 17269), 'numpy.random.rand', 'np.random.rand', (['num_spikes_param', 'self.dim'], {}), '(num_spikes_param, self.dim)\n', (17241, 17269), True, 'import numpy as np\n'), ((18967, 19... |
## ========================================================================== ##
## Copyright (c) 2019 The University of Texas at Austin. ##
## All rights reserved. ##
## ... | [
"numpy.random.normal",
"numpy.abs",
"numpy.random.rand",
"vtk.vtkIdList",
"vtk.reference",
"vtk.vtkGenericCell",
"vtk.vtkCellArray",
"numpy.max",
"numpy.array",
"vtk.vtkCellTreeLocator",
"numpy.random.seed",
"numpy.min"
] | [((5405, 5426), 'numpy.random.seed', 'np.random.seed', (['(12346)'], {}), '(12346)\n', (5419, 5426), True, 'import numpy as np\n'), ((5753, 5788), 'numpy.max', 'np.max', (['volume.PointData[arrayName]'], {}), '(volume.PointData[arrayName])\n', (5759, 5788), True, 'import numpy as np\n'), ((2417, 2440), 'vtk.reference',... |
import requests, json
import numpy as np
from ftplib import FTP
from osgeo import ogr
from osgeo import osr
import os.path
import zipfile
import time
from math import floor, ceil, atan2, pi, sqrt
import pickle
import simplekml
from osgeo import gdal
import urllib.request
def loadMapsWCS(bbox, dim, mapTyp... | [
"osgeo.gdal.Open",
"zipfile.ZipFile",
"math.floor",
"math.sqrt",
"time.sleep",
"osgeo.osr.CoordinateTransformation",
"ftplib.FTP",
"numpy.linspace",
"json.loads",
"osgeo.ogr.Geometry",
"pickle.load",
"requests.get",
"numpy.cos",
"numpy.transpose",
"time.time",
"math.ceil",
"osgeo.osr... | [((1140, 1158), 'osgeo.gdal.Open', 'gdal.Open', (['mapFile'], {}), '(mapFile)\n', (1149, 1158), False, 'from osgeo import gdal\n'), ((2462, 2484), 'osgeo.osr.SpatialReference', 'osr.SpatialReference', ([], {}), '()\n', (2482, 2484), False, 'from osgeo import osr\n'), ((2572, 2594), 'osgeo.osr.SpatialReference', 'osr.Sp... |
# Copyright (c) 2020 zfit
# noinspection PyUnresolvedReferences
from zfit.core.testing import setup_function, teardown_function, tester
# deactivating CUDA capable gpus
from zfit.z.tools import _auto_upcast
suppress_gpu = False
if suppress_gpu:
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see... | [
"pytest.approx",
"tensorflow.constant",
"numpy.polyval"
] | [((572, 588), 'tensorflow.constant', 'tf.constant', (['(5.0)'], {}), '(5.0)\n', (583, 588), True, 'import tensorflow as tf\n'), ((698, 727), 'numpy.polyval', 'np.polyval', (['coeffs[::-1]', '(5.0)'], {}), '(coeffs[::-1], 5.0)\n', (708, 727), True, 'import numpy as np\n'), ((781, 816), 'pytest.approx', 'pytest.approx', ... |
# Lint as: python3
# Copyright 2020 DeepMind Technologies Limited. 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
#
# U... | [
"dm_alchemy.types.stones_and_potions.unalign",
"random.sample",
"numpy.where",
"dm_alchemy.types.utils.TypeBasedAction",
"collections.Counter",
"numpy.array",
"itertools.chain.from_iterable",
"dm_alchemy.types.graphs.Node",
"copy.deepcopy",
"numpy.full"
] | [((2362, 2395), 'copy.deepcopy', 'copy.deepcopy', (['trial_items.stones'], {}), '(trial_items.stones)\n', (2375, 2395), False, 'import copy\n'), ((2568, 2602), 'copy.deepcopy', 'copy.deepcopy', (['trial_items.potions'], {}), '(trial_items.potions)\n', (2581, 2602), False, 'import copy\n'), ((11844, 11901), 'collections... |
# Begin: Python 2/3 compatibility header small
# Get Python 3 functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
from future.utils import raise_with_traceback, raise_from
# catch exception with: except Exception as e
from builtins import range, map, zip, filter
from i... | [
"numpy.random.rand"
] | [((1603, 1649), 'numpy.random.rand', 'np.random.rand', (['(1)', "*network['input_shape'][1:]"], {}), "(1, *network['input_shape'][1:])\n", (1617, 1649), True, 'import numpy as np\n'), ((2228, 2275), 'numpy.random.rand', 'np.random.rand', (['(10)', "*network['input_shape'][1:]"], {}), "(10, *network['input_shape'][1:])\... |
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 <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 use, copy, modify,... | [
"numpy.abs",
"numpy.sqrt",
"numpy.array",
"numpy.zeros",
"numpy.matmul",
"numpy.argmin",
"numpy.linalg.svd"
] | [((1542, 1580), 'numpy.zeros', 'np.zeros', (['(2 * N, 9)'], {'dtype': 'np.float64'}), '((2 * N, 9), dtype=np.float64)\n', (1550, 1580), True, 'import numpy as np\n'), ((2053, 2069), 'numpy.linalg.svd', 'np.linalg.svd', (['M'], {}), '(M)\n', (2066, 2069), True, 'import numpy as np\n'), ((2624, 2655), 'numpy.sqrt', 'np.s... |
"""Unit tests for modified Helmholtz operators."""
# pylint: disable=redefined-outer-name
# pylint: disable=C0103
import numpy as _np
import pytest
pytestmark = pytest.mark.usefixtures("default_parameters", "helpers")
def test_maxwell_electric_field_sphere(
default_parameters, helpers, device_interface, precis... | [
"numpy.testing.assert_allclose",
"bempp.api.operators.boundary.maxwell.electric_field",
"bempp.api.operators.boundary.maxwell.magnetic_field",
"pytest.mark.usefixtures",
"bempp.api.function_space",
"pytest.skip",
"numpy.random.RandomState"
] | [((164, 220), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""default_parameters"""', '"""helpers"""'], {}), "('default_parameters', 'helpers')\n", (187, 220), False, 'import pytest\n'), ((539, 569), 'bempp.api.function_space', 'function_space', (['grid', '"""RWG"""', '(0)'], {}), "(grid, 'RWG', 0)\n", (553... |
import sys
import typing
from pathlib import Path
import numpy as np
import pandas as pd
import mpmp.config as cfg
import mpmp.utilities.data_utilities as du
from mpmp.utilities.tcga_utilities import (
process_y_matrix,
process_y_matrix_cancertype,
align_matrices,
filter_to_cross_data_samples,
)
clas... | [
"mpmp.utilities.tcga_utilities.process_y_matrix_cancertype",
"numpy.count_nonzero",
"mpmp.utilities.data_utilities.load_multiple_data_types",
"mpmp.utilities.data_utilities.load_random_genes",
"mpmp.utilities.tcga_utilities.process_y_matrix",
"mpmp.utilities.data_utilities.load_top_50",
"mpmp.utilities.... | [((1997, 2017), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (2011, 2017), True, 'import numpy as np\n'), ((5226, 5395), 'mpmp.utilities.tcga_utilities.filter_to_cross_data_samples', 'filter_to_cross_data_samples', (['train_filtered_df', 'y_filtered_df'], {'data_types': 'self.overlap_data_types', ... |
from src.pyIsoFit.core.model_fit_def import get_guess_params, get_fit_tuples
import numpy as np
import pandas as pd
import unittest
class TestModelFitDef(unittest.TestCase):
def test_get_guess_params(self):
df1 = pd.read_csv('../Datasets for testing/Computational Data (EPFL) CO2.csv')
key_uptakes =... | [
"numpy.testing.assert_array_almost_equal",
"src.pyIsoFit.core.model_fit_def.get_guess_params",
"pandas.read_csv",
"src.pyIsoFit.core.model_fit_def.get_fit_tuples"
] | [((226, 298), 'pandas.read_csv', 'pd.read_csv', (['"""../Datasets for testing/Computational Data (EPFL) CO2.csv"""'], {}), "('../Datasets for testing/Computational Data (EPFL) CO2.csv')\n", (237, 298), True, 'import pandas as pd\n'), ((415, 476), 'src.pyIsoFit.core.model_fit_def.get_guess_params', 'get_guess_params', (... |
#Plot the potential of the periodic surface with a dipole source
import numpy as np
import matplotlib.pyplot as plt
from Calc_power_cresc import Pow_abs_rad, \
Pow_abs_rad_r,\
Pow_abs_rad_hori,\
Pow_sca_rad, ... | [
"matplotlib.pyplot.ylabel",
"Calc_power_cresc.Pow_abs_rad",
"Calc_power_cresc.Pow_sca_r",
"numpy.imag",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.exp",
"numpy.real",
"Calc_power_cresc.Pow_abs_rad_hori",
"Calc_power_cresc.Pow_abs_rad_r",
"Calc_power_cresc.Pow_... | [((460, 490), 'numpy.arange', 'np.arange', (['(0)', '(2 * np.pi)', '(0.001)'], {}), '(0, 2 * np.pi, 0.001)\n', (469, 490), True, 'import numpy as np\n'), ((738, 762), 'numpy.arange', 'np.arange', (['(0.01)', '(8)', '(0.01)'], {}), '(0.01, 8, 0.01)\n', (747, 762), True, 'import numpy as np\n'), ((804, 817), 'matplotlib.... |
#!/usr/bin/env python3
from pathlib import Path
import defopt
import numpy as np
import pandas as pd
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
from gp_ppc import load_data
from gp_model import extract_filters
from plot_orsolic_paper import plot_psycho, plot_chrono
from strenum... | [
"pandas.read_pickle",
"gp_model.extract_filters",
"seaborn.set",
"plot_orsolic_paper.plot_psycho",
"pathlib.Path",
"numpy.arange",
"seaborn.despine",
"numpy.log",
"seaborn.set_context",
"gp_ppc.load_data",
"matplotlib.pyplot.close",
"numpy.isnan",
"pandas.concat",
"defopt.run",
"strenum.... | [((4748, 4781), 'strenum.strenum', 'strenum', (['"""Fold"""', '"""train val test"""'], {}), "('Fold', 'train val test')\n", (4755, 4781), False, 'from strenum import strenum\n'), ((1008, 1050), 'gp_ppc.load_data', 'load_data', (['pred_filename', 'n_samples', 'folds'], {}), '(pred_filename, n_samples, folds)\n', (1017, ... |
import numpy as np
from scipy.interpolate import LinearNDInterpolator, interp1d
from astropy import table
from astropy.table import Table, Column
import warnings
def get_track_meta(track, key="FeH"):
""" get meta info from a track """
assert key in track.meta.keys()
return track.meta[key]
def find_ran... | [
"numpy.log10",
"astropy.table.Table",
"numpy.hstack",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.arange",
"numpy.where",
"numpy.sort",
"numpy.max",
"numpy.min",
"warnings.simplefilter",
"numpy.argmin",
"numpy.abs",
"scipy.interpolate.LinearNDInterpolator",
"astropy.table.Column"... | [((554, 579), 'numpy.hstack', 'np.hstack', (['(sub, sub + 1)'], {}), '((sub, sub + 1))\n', (563, 579), True, 'import numpy as np\n'), ((894, 911), 'numpy.abs', 'np.abs', (['(arr - val)'], {}), '(arr - val)\n', (900, 911), True, 'import numpy as np\n'), ((959, 975), 'numpy.array', 'np.array', (['weight'], {}), '(weight)... |
#!/usr/bin/env python
# Family size distribution of tags which were aligned to the reference genome
#
# Author: <NAME> & <NAME>, Johannes-Kepler University Linz (Austria)
# Contact: <EMAIL>
#
# Takes at least one TABULAR file with tags before the alignment to the SSCS,
# a BAM file with tags of reads that overlap the ... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"pysam.AlignmentFile",
"numpy.array",
"matplotlib.pyplot.switch_backend",
"numpy.genfromtxt",
"numpy.arange",
"matplotlib.pyplot.margins",
"re.search",
"re.split",
"argparse.ArgumentParser",
"numpy.where",
"matplotlib.pyplot.xlabel",
"m... | [((995, 1020), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (1013, 1020), True, 'import matplotlib.pyplot as plt\n'), ((1262, 1397), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Family Size Distribution of tags which were aligned to region... |
#!/usr/bin/env python
# Usage:
# python figure_five.py inputfile outputfile
# optional args: [--target, --raw]
from sequential import optimizers
from objective_functions import objectives
import numpy as np
import argparse
import pickle
import pandas as pd
from collections import defaultdict
def compute_avera... | [
"numpy.mean",
"pickle.dump",
"argparse.ArgumentParser",
"pickle.load",
"pandas.DataFrame.from_dict",
"numpy.max",
"numpy.any",
"numpy.array",
"numpy.zeros",
"collections.defaultdict",
"numpy.nonzero",
"numpy.std",
"numpy.arange"
] | [((4485, 4510), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4508, 4510), False, 'import argparse\n'), ((733, 780), 'numpy.array', 'np.array', (["[bnd[0] for bnd in objective['bnds']]"], {}), "([bnd[0] for bnd in objective['bnds']])\n", (741, 780), True, 'import numpy as np\n'), ((802, 849),... |
"""
<NAME> ETHZ, 2020
Script to compute dci score of learned representation.
"""
import warnings
from typing import Union, Iterable
from numpy.core._multiarray_umath import ndarray
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
from absl import flags, app
from sklearn.model_select... | [
"numpy.transpose",
"numpy.ones",
"absl.flags.DEFINE_bool",
"sklearn.model_selection.train_test_split",
"os.path.join",
"numpy.diff",
"absl.app.run",
"warnings.simplefilter",
"numpy.load",
"absl.flags.DEFINE_string"
] | [((184, 246), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (205, 246), False, 'import warnings\n'), ((435, 505), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""z_name"""', '""""""', '"""Filename ... |
import sys
import stable_baselines
sys.path.append("../../../k_road/")
import numpy as np
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines.ddpg.noise import (
OrnsteinUhlenbeckActionNoise,
)
from stable_baselines import DDPG
# from cavs_environments.vehicle.deep_road.deep_road impo... | [
"stable_baselines.DDPG",
"scenario.road.RoadObserver",
"numpy.ones",
"scenario.road.RoadProcess",
"numpy.zeros",
"scenario.road.RoadTerminator",
"sys.path.append",
"scenario.road.RoadGoalRewarder"
] | [((37, 72), 'sys.path.append', 'sys.path.append', (['"""../../../k_road/"""'], {}), "('../../../k_road/')\n", (52, 72), False, 'import sys\n'), ((2359, 2497), 'stable_baselines.DDPG', 'DDPG', (['CustomPolicy', 'env'], {'verbose': '(1)', 'tensorboard_log': '"""/tmp/k_road_0/"""', 'gamma': '(0.999)', 'param_noise': 'para... |
"""FPS_receive_test.py -- receive (text, image) pairs & print FPS stats
A test program to provide FPS statistics as different imagenode algorithms are
being tested. This program receives images OR images that have been jpg
compressed, depending on the setting of the JPG option.
It computes and prints FPS statistics. ... | [
"time.sleep",
"cv2.imshow",
"threading.Event",
"imutils.video.FPS",
"cv2.destroyAllWindows",
"collections.defaultdict",
"sys.exit",
"numpy.frombuffer",
"traceback.print_exc",
"cv2.waitKey",
"imagezmq.ImageHub",
"threading.Thread"
] | [((2353, 2372), 'imagezmq.ImageHub', 'imagezmq.ImageHub', ([], {}), '()\n', (2370, 2372), False, 'import imagezmq\n'), ((2797, 2813), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (2808, 2813), False, 'from collections import defaultdict\n'), ((3112, 3119), 'threading.Event', 'Event', ([], {}), '(... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, <NAME>PORATION. 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 ... | [
"logging.getLogger",
"numpy.eye",
"torch.ones_like",
"numpy.ones",
"torch.__version__.split",
"torch.sigmoid",
"torch.sqrt",
"math.sqrt",
"torch.tensor",
"torch.is_tensor",
"torch.arange",
"torch.nn.functional.log_softmax",
"torch.logsumexp",
"torch.zeros",
"torch.zeros_like",
"torch.d... | [((903, 930), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (920, 930), False, 'import logging\n'), ((1296, 1312), 'torch.sigmoid', 'torch.sigmoid', (['x'], {}), '(x)\n', (1309, 1312), False, 'import torch\n'), ((7503, 7536), 'torch.nn.functional.log_softmax', 'F.log_softmax', (['sim_mat... |
from greengraph.ggraph import Greengraph
import numpy as np
from mock import Mock
from pytest import raises
graph = Greengraph("London", "Paris")
precision = 1e-3
def test_init():
assert graph.start == "London"
assert graph.end == "Paris"
def test_geolocate():
# test method returns correct latitude & lo... | [
"numpy.shape",
"pytest.raises",
"greengraph.ggraph.Greengraph"
] | [((118, 147), 'greengraph.ggraph.Greengraph', 'Greengraph', (['"""London"""', '"""Paris"""'], {}), "('London', 'Paris')\n", (128, 147), False, 'from greengraph.ggraph import Greengraph\n'), ((1257, 1280), 'numpy.shape', 'np.shape', (['green_between'], {}), '(green_between)\n', (1265, 1280), True, 'import numpy as np\n'... |
import os
import json
from utils import load_datasets, load_target, save_submission
import models
from models.tuning import beyesian_optimization
from models.evaluation import cross_validation_score
from lightgbm.sklearn import LGBMClassifier
from sklearn.ensemble import StackingClassifier, RandomForestClassifier, Extr... | [
"numpy.mean",
"sklearn.linear_model.RidgeClassifier",
"lightgbm.sklearn.LGBMClassifier",
"keras.layers.core.Activation",
"sklearn.ensemble.ExtraTreesClassifier",
"keras.layers.advanced_activations.PReLU",
"utils.load_target",
"sklearn.ensemble.RandomForestClassifier",
"keras.models.Sequential",
"t... | [((1170, 1203), 'utils.load_datasets', 'load_datasets', (["config['features']"], {}), "(config['features'])\n", (1183, 1203), False, 'from utils import load_datasets, load_target, save_submission\n'), ((1214, 1230), 'utils.load_target', 'load_target', (['"""Y"""'], {}), "('Y')\n", (1225, 1230), False, 'from utils impor... |
#________HEADER FILES_______
import tkinter
from tkinter import*
#from tkvideo import tkvideo
from tkinter import ttk
from tkinter import filedialog
from _cffi_backend import callback
from PIL import ImageTk, Image
import cv2
from cv2 import *
import numpy as np
import sys
import time
import argparse
import imutils
fr... | [
"numpy.clip",
"tkinter.ttk.Scale",
"numpy.ones",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.waitKey",
"numpy.float32",
"tkinter.filedialog.askopenfilename"
] | [((398, 423), 'numpy.ones', 'np.ones', (['(3, 3)', 'np.uint8'], {}), '((3, 3), np.uint8)\n', (405, 423), True, 'import numpy as np\n'), ((434, 459), 'numpy.ones', 'np.ones', (['(3, 3)', 'np.uint8'], {}), '((3, 3), np.uint8)\n', (441, 459), True, 'import numpy as np\n'), ((2645, 2812), 'tkinter.filedialog.askopenfilenam... |
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
# https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csgraph.minimum_spanning_tree.html
# Euclidean distance
def dist(p1, p2):
return np.sqrt(sum([(a - b) ** 2 for a, b ... | [
"pandas.DataFrame",
"numpy.array",
"numpy.tril_indices_from",
"scipy.sparse.csgraph.minimum_spanning_tree"
] | [((625, 642), 'pandas.DataFrame', 'pd.DataFrame', (['mat'], {}), '(mat)\n', (637, 642), True, 'import pandas as pd\n'), ((869, 893), 'scipy.sparse.csgraph.minimum_spanning_tree', 'minimum_spanning_tree', (['X'], {}), '(X)\n', (890, 893), False, 'from scipy.sparse.csgraph import minimum_spanning_tree\n'), ((653, 680), '... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 17 13:38:07 2021
@author: zayn
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 17 12:07:50 2021
@author: zayn
"""
"""
Linear regression implementation.
"""
import numpy as np
import matplotlib.pyplot as plt
class lgreg:
""" implementati... | [
"numpy.mean",
"numpy.log",
"numpy.asarray",
"numpy.exp",
"numpy.zeros",
"numpy.std",
"matplotlib.pyplot.subplots",
"numpy.round"
] | [((1122, 1136), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1134, 1136), True, 'import matplotlib.pyplot as plt\n'), ((1918, 1939), 'numpy.zeros', 'np.zeros', (['theta.shape'], {}), '(theta.shape)\n', (1926, 1939), True, 'import numpy as np\n'), ((2243, 2262), 'numpy.zeros', 'np.zeros', (['num_iter... |
import numpy as np
import deerlab as dl
#---------------------------------------------------------------------------------------
def assert_bgmodel(model,Bref):
"Check the correct behaviour of the core functionality of a background model"
t = np.linspace(-5,5,500)
# Extract model information
... | [
"numpy.linspace",
"numpy.isnan"
] | [((263, 286), 'numpy.linspace', 'np.linspace', (['(-5)', '(5)', '(500)'], {}), '(-5, 5, 500)\n', (274, 286), True, 'import numpy as np\n'), ((724, 736), 'numpy.isnan', 'np.isnan', (['B1'], {}), '(B1)\n', (732, 736), True, 'import numpy as np\n'), ((747, 759), 'numpy.isnan', 'np.isnan', (['B2'], {}), '(B2)\n', (755, 759... |
import numpy as np
# from scp import SCP
from main_komo import run_komo_standalone
from utils_motion_primitives import sort_primitives, visualize_motion, plot_stats
import robots
import yaml
import msgpack
import multiprocessing as mp
import tqdm
import itertools
import argparse
import subprocess
import tempfile
from p... | [
"tempfile.TemporaryDirectory",
"utils_motion_primitives.sort_primitives",
"msgpack.pack",
"argparse.ArgumentParser",
"pathlib.Path",
"yaml.dump",
"utils_motion_primitives.plot_stats",
"yaml.load",
"numpy.linalg.norm",
"os.getcwd",
"time.sleep",
"numpy.array",
"yaml.safe_load",
"psutil.cpu_... | [((413, 424), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (422, 424), False, 'import sys, os\n'), ((4006, 4023), 'pathlib.Path', 'Path', (['"""../tuning"""'], {}), "('../tuning')\n", (4010, 4023), False, 'from pathlib import Path\n'), ((4196, 4239), 'motionplanningutils.RobotHelper', 'RobotHelper', (['robot_type', "myc... |
""" Unit tests for the finite_difference module
"""
import unittest
import numpy as np
from scipy.optimize import rosen, rosen_der, rosen_hess
from polynomials_on_simplices.calculus.finite_difference import (
central_difference, central_difference_jacobian, forward_difference, forward_difference_jacobian,
se... | [
"polynomials_on_simplices.calculus.finite_difference.forward_difference_jacobian",
"numpy.allclose",
"numpy.ones",
"numpy.random.rand",
"numpy.sin",
"numpy.testing.assert_allclose",
"scipy.optimize.rosen_der",
"polynomials_on_simplices.calculus.finite_difference.second_central_difference",
"polynomi... | [((7313, 7328), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7326, 7328), False, 'import unittest\n'), ((487, 555), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['array1', 'array2'], {'atol': '(0.0001)', 'rtol': '(0.0001)'}), '(array1, array2, atol=0.0001, rtol=0.0001)\n', (513, 555), True, '... |
from skfem import *
import numpy as np
import matplotlib.pyplot as plt
m = MeshTri()
m.refine(5)
@bilinear_form
def jacobian(u, du, v, dv, w):
w, dw = w.w, w.dw
return 1.0/np.sqrt(1.0 + dw[0]**2 + dw[1]**2)*(du[0]*dv[0] + du[1]*dv[1])\
-(2.0*du[1]*dw[1] + 2.0*du[0]*dw[0])*(dw[1]*dv[1] + dw[0]*dv[0]... | [
"numpy.sin",
"numpy.zeros",
"numpy.sqrt",
"numpy.linalg.norm"
] | [((556, 573), 'numpy.zeros', 'np.zeros', (['basis.N'], {}), '(basis.N)\n', (564, 573), True, 'import numpy as np\n'), ((628, 653), 'numpy.sin', 'np.sin', (['(np.pi * m.p[0, D])'], {}), '(np.pi * m.p[0, D])\n', (634, 653), True, 'import numpy as np\n'), ((844, 870), 'numpy.linalg.norm', 'np.linalg.norm', (['(x - x_prev)... |
#!/usr/bin/env python
# pylint: disable=unexpected-keyword-arg,too-few-public-methods
"""
Test suite for data processing, dummy data and input/output functions.
"""
import os
import sys
import shutil
import unittest
import warnings
import numpy as np
import numpy.testing
import nestcheck.data_processing
import nestchec... | [
"os.path.exists",
"os.makedirs",
"numpy.random.random",
"numpy.asarray",
"warnings.catch_warnings",
"os.path.join",
"numpy.array",
"numpy.zeros",
"numpy.array_equal",
"shutil.rmtree",
"warnings.simplefilter",
"numpy.full",
"numpy.all"
] | [((862, 892), 'os.path.exists', 'os.path.exists', (['TEST_CACHE_DIR'], {}), '(TEST_CACHE_DIR)\n', (876, 892), False, 'import os\n'), ((2339, 2363), 'numpy.asarray', 'np.asarray', (['[1, 1, 3, 5]'], {}), '([1, 1, 3, 5])\n', (2349, 2363), True, 'import numpy as np\n'), ((2385, 2410), 'numpy.asarray', 'np.asarray', (['[-1... |
# Copyright 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | [
"torch.ops.load_library",
"numpy.prod",
"pathlib.Path",
"platform.system",
"torch.zeros"
] | [((1295, 1328), 'torch.ops.load_library', 'torch.ops.load_library', (['_LIB_PATH'], {}), '(_LIB_PATH)\n', (1317, 1328), False, 'import torch\n'), ((1173, 1190), 'platform.system', 'platform.system', ([], {}), '()\n', (1188, 1190), False, 'import platform\n'), ((1601, 1664), 'torch.zeros', 'torch.zeros', (['*shape'], {'... |
# -- coding: utf-8 --
import os
from timeit import default_timer as timer
import numpy as np
from PIL import Image
from tensorflow.keras import backend, layers, models
from detection_yolo3.model import yolo_eval, yolo_body
from detection_yolo3.utils import get_anchors, draw_boxes
from util import check_or_makedirs
... | [
"tensorflow.keras.layers.Input",
"PIL.Image.fromarray",
"PIL.Image.open",
"os.path.exists",
"os.listdir",
"detection_yolo3.utils.get_anchors",
"timeit.default_timer",
"os.path.join",
"detection_yolo3.model.yolo_body",
"util.check_or_makedirs",
"numpy.array",
"numpy.empty",
"os.path.basename"... | [((734, 765), 'detection_yolo3.utils.get_anchors', 'get_anchors', (['YOLO3_ANCHORS_FILE'], {}), '(YOLO3_ANCHORS_FILE)\n', (745, 765), False, 'from detection_yolo3.utils import get_anchors, draw_boxes\n'), ((1135, 1187), 'tensorflow.keras.layers.Input', 'layers.Input', ([], {'shape': '(None, None, 1)', 'dtype': '"""floa... |
import cv2
from shutil import *
import os
from PIL import Image
import numpy as np
sampleNum = 0
folder = input("\nEnter your Registration number's numerical part : ")
user = input("\nEnter Your name : ")
folder1 = folder
user1 = user
copy2('C:\\Users\\MY PC\\PycharmProjects\\untitled\\try1.py','C:\\Users\\MY PC\\Pych... | [
"cv2.rectangle",
"os.listdir",
"PIL.Image.open",
"os.path.join",
"cv2.imshow",
"os.path.split",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.CascadeClassifier",
"cv2.resize",
"cv2.waitKey",
"cv2.face.createLBPHFaceRecognizer",
"os.remove"
] | [((380, 538), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""D:\\\\UDAY\\\\SOFTWARES\\\\opencv\\\\sources\\\\OpenCV Master\\\\opencv-master\\\\data\\\\haarcascades\\\\haarcascade_frontalface_default.xml"""'], {}), "(\n 'D:\\\\UDAY\\\\SOFTWARES\\\\opencv\\\\sources\\\\OpenCV Master\\\\opencv-master\\\\data\\... |
#<NAME>
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
from sklearn.linear_model import LinearRegression, Ridge, Lasso, ElasticNet
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_predi... | [
"warnings.filterwarnings",
"sklearn.model_selection.GridSearchCV",
"sklearn.linear_model.ElasticNet",
"sklearn.linear_model.Lasso",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"sklearn.linear_model.Ridge",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
... | [((96, 158), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (119, 158), False, 'import warnings\n'), ((1118, 1136), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (1134, 1136), Fal... |
import pandas as pd
import numpy as np
import re
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.preprocessing import OneHotEncoder
from sklearn.decomposition import PCA , TruncatedSVD
import joblib
from sklearn.manifold import TSNE
# import seaborn as sns
import matplotlib.pyplot as ... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"pandas.to_datetime",
"sklearn.feature_extraction.text.CountVectorizer",
"matplotlib.pyplot.xlabel",
"sklearn.manifold.TSNE",
"matplotlib.pyplot.scatter",
"joblib.load",
"joblib.dump",
"matplotlib.pyplot.savefig",
"sklearn.decomposition.TruncatedSVD... | [((3375, 3390), 'sklearn.preprocessing.OneHotEncoder', 'OneHotEncoder', ([], {}), '()\n', (3388, 3390), False, 'from sklearn.preprocessing import OneHotEncoder\n'), ((3595, 3624), 'sklearn.decomposition.TruncatedSVD', 'TruncatedSVD', ([], {'n_components': '(50)'}), '(n_components=50)\n', (3607, 3624), False, 'from skle... |
"""
Utility functions for domain decomposition.
"""
def lazy_reduce(reduction, block, launches, contexts):
"""
Applies a reduction over a sequence of parallelizable device operations.
The reduction can be something like built-in `max` or `min`. The
`launches` argument is a sequence of callables which... | [
"numpy.zeros"
] | [((2623, 2641), 'numpy.zeros', 'np.zeros', (['[ni, nq]'], {}), '([ni, nq])\n', (2631, 2641), True, 'import numpy as np\n'), ((3212, 3234), 'numpy.zeros', 'np.zeros', (['[ni, nj, nq]'], {}), '([ni, nj, nq])\n', (3220, 3234), True, 'import numpy as np\n')] |
import random
import os
import numpy as np
from scipy.ndimage.filters import median_filter
import os
import random
import numpy as np
from scipy.ndimage.filters import median_filter
def gaussian_noise(img, mean=0, sigma=0.03):
img = img.copy()
noise = np.random.normal(mean, sigma, img.shape)
mask_overflo... | [
"numpy.random.normal",
"os.path.exists",
"random.uniform",
"scipy.ndimage.filters.median_filter",
"os.path.join",
"numpy.sum",
"numpy.zeros",
"os.mkdir",
"numpy.expand_dims",
"random.randint"
] | [((263, 303), 'numpy.random.normal', 'np.random.normal', (['mean', 'sigma', 'img.shape'], {}), '(mean, sigma, img.shape)\n', (279, 303), True, 'import numpy as np\n'), ((1600, 1630), 'os.path.exists', 'os.path.exists', (['pred_dir_train'], {}), '(pred_dir_train)\n', (1614, 1630), False, 'import os\n'), ((1640, 1664), '... |
from collections import namedtuple
from scipy.special import expit
import numpy as np
from .mapping import Mapping
class Activation(Mapping):
pass
# Activation = namedtuple("Activation", ["forward", "backward"])
class Relu(Activation):
@staticmethod
def forward(x):
return np.where(x>0, x, 0)
... | [
"numpy.identity",
"numpy.eye",
"numpy.where",
"numpy.exp",
"numpy.sum"
] | [((296, 317), 'numpy.where', 'np.where', (['(x > 0)', 'x', '(0)'], {}), '(x > 0, x, 0)\n', (304, 317), True, 'import numpy as np\n'), ((549, 558), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (555, 558), True, 'import numpy as np\n'), ((912, 921), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (918, 921), True, 'import n... |
from collections import OrderedDict
import torch
import torch.nn as nn
from gym import spaces
from rl.policies.utils import MLP, BC_Visual_Policy
from rl.policies.actor_critic import Actor, Critic
from util.gym import observation_size, action_size, goal_size, box_size, robot_state_size, image_size
import numpy as np... | [
"rl.policies.distributions.FixedNormal",
"numpy.log",
"torch.tanh",
"rl.policies.distributions.MixedDistribution",
"rl.policies.distributions.FixedCategorical",
"util.gym.goal_size",
"util.gym.image_size",
"torch.nn.ModuleDict",
"torch.zeros_like",
"util.pytorch.to_tensor",
"collections.OrderedD... | [((1407, 1500), 'rl.policies.utils.BC_Visual_Policy', 'BC_Visual_Policy', ([], {'robot_state': 'input_dim', 'num_classes': '(256)', 'img_size': 'config.env_image_size'}), '(robot_state=input_dim, num_classes=256, img_size=config.\n env_image_size)\n', (1423, 1500), False, 'from rl.policies.utils import MLP, BC_Visua... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 3 09:30:54 2020
@author: jeremiasknoblauch
Description: Read in the results and produce plots. Before creating the plots
create .txt files holding the results to be plotted.
"""
import numpy as np
import matplotlib.pyplot as plt
# global variabl... | [
"numpy.mean",
"numpy.log",
"numpy.max",
"numpy.zeros",
"numpy.loadtxt",
"matplotlib.pyplot.subplots"
] | [((2559, 2584), 'numpy.loadtxt', 'np.loadtxt', (['path_name_TVD'], {}), '(path_name_TVD)\n', (2569, 2584), True, 'import numpy as np\n'), ((2600, 2625), 'numpy.loadtxt', 'np.loadtxt', (['path_name_KLD'], {}), '(path_name_KLD)\n', (2610, 2625), True, 'import numpy as np\n'), ((6767, 6817), 'matplotlib.pyplot.subplots', ... |
from utils.prepare_data import get_training_data
from utils.prepare_plots import plot_results
from simpleencoderdecoder.build_simple_encoderdecoder_model import simple_encoderdecoder
import random
import numpy as np
if __name__ == "__main__":
profile_gray_objs, midcurve_gray_objs = get_training_data()
test_gra... | [
"random.sample",
"utils.prepare_plots.plot_results",
"numpy.asarray",
"utils.prepare_data.get_training_data",
"simpleencoderdecoder.build_simple_encoderdecoder_model.simple_encoderdecoder"
] | [((288, 307), 'utils.prepare_data.get_training_data', 'get_training_data', ([], {}), '()\n', (305, 307), False, 'from utils.prepare_data import get_training_data\n'), ((331, 366), 'random.sample', 'random.sample', (['profile_gray_objs', '(5)'], {}), '(profile_gray_objs, 5)\n', (344, 366), False, 'import random\n'), ((5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.