code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# Copyright 2018 <NAME> @imsrgadich
#
# 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 writin... | [
"tensorflow.reduce_sum",
"numpy.random.seed",
"numpy.abs",
"numpy.ones",
"numpy.shape",
"tensorflow.multiply",
"numpy.random.randint",
"numpy.arange",
"gpflow.params.Parameter",
"numpy.copy",
"tensorflow.subtract",
"numpy.std",
"numpy.random.randn",
"tensorflow.exp",
"numpy.divide",
"n... | [((4898, 4914), 'numpy.copy', 'np.copy', (['train_x'], {}), '(train_x)\n', (4905, 4914), True, 'import numpy as np\n'), ((4961, 5019), 'numpy.squeeze', 'np.squeeze', (['(train_x_sort[:, -1, :] - train_x_sort[:, 0, :])'], {}), '(train_x_sort[:, -1, :] - train_x_sort[:, 0, :])\n', (4971, 5019), True, 'import numpy as np\... |
""" Refer to "scikit-learn"
"""
# Author: Kun <<EMAIL>>
# License: xxx
import os
import numpy
def configuration(parent_package="", top_path=None):
from numpy.distutils.misc_util import Configuration
libraries = []
if os.name == "posix":
libraries.append("m")
config = Configuration("cluster", parent_package,... | [
"numpy.distutils.misc_util.Configuration",
"numpy.get_include"
] | [((280, 330), 'numpy.distutils.misc_util.Configuration', 'Configuration', (['"""cluster"""', 'parent_package', 'top_path'], {}), "('cluster', parent_package, top_path)\n", (293, 330), False, 'from numpy.distutils.misc_util import Configuration\n'), ((423, 442), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n'... |
import click as ck
import numpy as np
import pandas as pd
from collections import Counter
from utils import Ontology, FUNC_DICT, NAMESPACES, read_fasta
import logging
import os
logging.basicConfig(level=logging.INFO)
@ck.command()
@ck.option(
'--go-file', '-gf', default='data-cafa3/go.obo',
help='Gene Ontolog... | [
"pandas.DataFrame",
"utils.Ontology",
"numpy.random.seed",
"logging.basicConfig",
"click.option",
"click.command",
"logging.info",
"utils.read_fasta",
"numpy.array",
"pandas.read_pickle",
"collections.Counter",
"numpy.random.shuffle"
] | [((178, 217), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (197, 217), False, 'import logging\n'), ((220, 232), 'click.command', 'ck.command', ([], {}), '()\n', (230, 232), True, 'import click as ck\n'), ((234, 338), 'click.option', 'ck.option', (['"""--go-fil... |
import sys
import theano
import numpy
import collections
import cPickle
import lasagne
sys.setrecursionlimit(50000)
floatX=theano.config.floatX
class WordPairClassifier(object):
def __init__(self, config):
self.config = config
self.params = collections.OrderedDict()
self.rng = numpy.random... | [
"theano.tensor.fscalar",
"theano.tensor.iscalar",
"theano.tensor.concatenate",
"theano.tensor.sum",
"theano.tensor.dot",
"theano.tensor.abs_",
"theano.tensor.cast",
"theano.tensor.ivector",
"cPickle.load",
"numpy.random.RandomState",
"theano.tensor.gt",
"cPickle.dump",
"theano.shared",
"th... | [((88, 116), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(50000)'], {}), '(50000)\n', (109, 116), False, 'import sys\n'), ((263, 288), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (286, 288), False, 'import collections\n'), ((308, 355), 'numpy.random.RandomState', 'numpy.random.Rando... |
"""Sounscape is a subclass of scaper.Scaper to fulfill our specific needs and default values"""
import glob
import inspect
import numpy as np
import os
import shutil
import warnings
from os import path as osp
import scaper
import soundfile as sf
from .logger import create_logger, DesedWarning, DesedError
from .utils ... | [
"numpy.random.choice",
"os.remove",
"soundfile.info",
"numpy.minimum",
"shutil.rmtree",
"os.path.isdir",
"os.path.exists",
"os.path.isfile",
"os.path.splitext",
"inspect.currentframe",
"warnings.warn",
"os.path.join"
] | [((3672, 3705), 'os.path.join', 'os.path.join', (['self.fg_path', 'label'], {}), '(self.fg_path, label)\n', (3684, 3705), False, 'import os\n'), ((3721, 3743), 'os.path.exists', 'osp.exists', (['label_path'], {}), '(label_path)\n', (3731, 3743), True, 'from os import path as osp\n'), ((10071, 10087), 'os.path.exists', ... |
'''
Representation learning testing for TCGA data.
Set all parameters in this script & run with parameter "batch" or "local".
'''
import numpy as np
import logging
import datetime
#import argparse
from common import expInterp, ensure_dir_exists
import dataReader
import batch
from readHDF5 import getHDF5data
#option... | [
"models.nncommon.TimeBasedStopping",
"numpy.average",
"pandas.read_hdf",
"logging.basicConfig",
"numpy.random.seed",
"numpy.std",
"batch.main",
"logging.info",
"numpy.mean",
"datetime.timedelta",
"numpy.random.permutation",
"common.ensure_dir_exists",
"batch.init"
] | [((653, 692), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (672, 692), False, 'import logging\n'), ((1089, 1116), 'datetime.timedelta', 'datetime.timedelta', ([], {'hours': '(4)'}), '(hours=4)\n', (1107, 1116), False, 'import datetime\n'), ((10932, 10990), 'ba... |
"""
--------------------------
Created Feb 2022
<NAME>
github.com/marcodeangelis
MIT License
--------------------------
"""
import numpy
def multiply(s,o):
s_lo,s_hi,o_lo,o_hi=s.lo,s.hi,o.lo,o.hi
if s.scalar & o.scalar:
if (s_lo >= 0) & (o_lo >= 0): # A+ B+
l,h = s_lo * o_lo, s_hi * o_hi
... | [
"numpy.empty",
"numpy.min",
"numpy.max"
] | [((677, 748), 'numpy.min', 'numpy.min', (['(s_lo * o_hi, s_hi * o_lo, s_lo * o_lo, s_hi * o_hi)'], {'axis': '(0)'}), '((s_lo * o_hi, s_hi * o_lo, s_lo * o_lo, s_hi * o_hi), axis=0)\n', (686, 748), False, 'import numpy\n'), ((752, 823), 'numpy.max', 'numpy.max', (['(s_lo * o_lo, s_hi * o_hi, s_lo * o_hi, s_hi * o_lo)'],... |
"""
@title
@description
"""
import argparse
import os
import threading
import time
from queue import Queue, Empty
from time import sleep
import cv2
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from Andrutil.ObserverObservable import Observer
from matplotlib import style, animation
from win32api... | [
"threading.Timer",
"argparse.ArgumentParser",
"matplotlib.style.use",
"SystemControl.StimulusGenerator.StimulusGenerator",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"os.path.join",
"win32api.GetSystemMetrics",
"cv2.cvtColor",
"matplotlib.pyplot.close",
"threading.Lock",
... | [((6171, 6297), 'SystemControl.StimulusGenerator.StimulusGenerator', 'StimulusGenerator', ([], {'delay': 'generate_delay', 'jitter': 'jitter_generator', 'generator_type': 'GeneratorType.RANDOM', 'verbosity': 'verbosity'}), '(delay=generate_delay, jitter=jitter_generator,\n generator_type=GeneratorType.RANDOM, verbos... |
"""
Copyright 2019 <NAME>, <NAME>
This file is part of A2DR.
A2DR is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
A2DR is distributed in t... | [
"a2dr.proximal.prox_sum_squares_affine",
"a2dr.a2dr",
"scipy.sparse.random",
"numpy.random.seed",
"numpy.sum",
"numpy.random.randn",
"numpy.linalg.lstsq",
"numpy.zeros",
"scipy.sparse.bmat",
"numpy.split",
"scipy.sparse.lil_matrix",
"numpy.arange",
"scipy.sparse.eye"
] | [((967, 984), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (981, 984), True, 'import numpy as np\n'), ((1260, 1322), 'scipy.sparse.random', 'sparse.random', (['m', 'n'], {'density': 'density', 'data_rvs': 'np.random.randn'}), '(m, n, density=density, data_rvs=np.random.randn)\n', (1273, 1322), False, ... |
import numpy as np
import bioformats as bf
import tnia.io.bioformats_helper as bfh
import tnia.io.tifffile_helper as tfh
# 4 channels
nc=4
nz=5
# 512 by 512
ny = 512
nx = 512
test=((2**16-1)*np.random.rand(nc, nz, ny, nx)).astype('uint16')
'''
import tifffile
test = np.moveaxis(test,0,1)
tfh.save_zcyx('fromthetiffhelp... | [
"numpy.random.rand",
"imagej.init",
"xarray.DataArray"
] | [((439, 472), 'imagej.init', 'imagej.init', (['"""sc.fiji:fiji:2.1.1"""'], {}), "('sc.fiji:fiji:2.1.1')\n", (450, 472), False, 'import imagej\n'), ((480, 525), 'xarray.DataArray', 'xr.DataArray', (['test'], {'dims': "('C', 'z', 'y', 'x')"}), "(test, dims=('C', 'z', 'y', 'x'))\n", (492, 525), True, 'import xarray as xr\... |
import pandas as pd
import numpy as np
import cv2
import sys
import os
from keras.models import Sequential
from keras.callbacks import Callback, ModelCheckpoint
from keras.layers import (Flatten, Dense, Convolution2D, MaxPool2D,
BatchNormalization, Dropout, Activation, Cropping2D, Lambda)
from keras.optimizers import... | [
"matplotlib.pyplot.title",
"keras.preprocessing.image.ImageDataGenerator",
"sys.stdout.write",
"keras.regularizers.l2",
"matplotlib.style.use",
"argparse.ArgumentParser",
"keras.layers.Cropping2D",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sys.stdout.flush",
"pandas.DataFra... | [((680, 710), 'matplotlib.style.use', 'matplotlib.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (700, 710), False, 'import matplotlib\n'), ((1736, 1754), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (1752, 1754), False, 'import sys\n'), ((2058, 2106), 'matplotlib.pyplot.title', 'plt.title', (['"""Num... |
import numpy as np
import cv2
import os
import os.path as osp
from torch.utils.data import Dataset
import elasticdeform as ED
class DatasetGen(Dataset):
def __init__(self, train_path, gt_path, transform):
super(DatasetGen, self).__init__()
self.train_names = self.get_file_names(train_path)
... | [
"numpy.expand_dims",
"cv2.transpose",
"cv2.imread",
"elasticdeform.deform_random_grid",
"numpy.where",
"numpy.tile",
"cv2.flip",
"os.path.join",
"os.listdir"
] | [((2024, 2040), 'cv2.flip', 'cv2.flip', (['img', '(1)'], {}), '(img, 1)\n', (2032, 2040), False, 'import cv2\n'), ((2249, 2265), 'cv2.flip', 'cv2.flip', (['img', '(0)'], {}), '(img, 0)\n', (2257, 2265), False, 'import cv2\n'), ((2484, 2501), 'cv2.flip', 'cv2.flip', (['img', '(-1)'], {}), '(img, -1)\n', (2492, 2501), Fa... |
import torch
import imageio
from python_speech_features import mfcc, delta, logfbank
import librosa
import pandas as pd
import numpy as np
from torch.utils.data import Dataset
class LRWDataset(Dataset):
COL_MP4 = 'mp4'
COL_MP3 = 'mp3'
COL_TXT = 'txt'
def __init__(self, root_dir, clean_files_path, is_train=True, ... | [
"pandas.read_csv",
"librosa.feature.mfcc",
"librosa.feature.melspectrogram",
"numpy.insert",
"numpy.append",
"librosa.feature.rmse",
"torch.Tensor",
"numpy.swapaxes",
"imageio.get_reader",
"numpy.save",
"librosa.feature.delta",
"librosa.load",
"python_speech_features.mfcc",
"numpy.vstack",... | [((1348, 1381), 'pandas.read_csv', 'pd.read_csv', (['(root_dir + file_path)'], {}), '(root_dir + file_path)\n', (1359, 1381), True, 'import pandas as pd\n'), ((1797, 1819), 'torch.flip', 'torch.flip', (['ascii', '[0]'], {}), '(ascii, [0])\n', (1807, 1819), False, 'import torch\n'), ((2304, 2321), 'torch.Tensor', 'torch... |
import numpy as np
import pytest
from grove.alpha.fermion_transforms.bktransform import BKTransform
from grove.alpha.fermion_transforms.jwtransform import JWTransform
"""
Some tests inspired by:
https://github.com/ProjectQ-Framework/FermiLib/blob/develop/src/fermilib/transforms/_bravyi_kitaev_test.py
"""
def test_h... | [
"grove.alpha.fermion_transforms.jwtransform.JWTransform",
"numpy.log2",
"pytest.raises",
"grove.alpha.fermion_transforms.bktransform.BKTransform",
"pytest.mark.skip"
] | [((1727, 1823), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""pyQuil Pauli needs matrix operator / eigenspectrum functionality"""'}), "(reason=\n 'pyQuil Pauli needs matrix operator / eigenspectrum functionality')\n", (1743, 1823), False, 'import pytest\n'), ((370, 391), 'grove.alpha.fermion_transforms... |
# -*- coding: utf-8 -*-
import sys, os
import numpy as np
import pandas as pd
from Modules.camera_location import cal_camera_location, estimate_camera_location
from body_part_classification import BodyPartClassification, run_bpc
__all__ = ["DivConqBPC", "discretization_setting"]
def discretization_setting(discr_set... | [
"numpy.random.seed",
"body_part_classification.BodyPartClassification.predict",
"body_part_classification.run_bpc",
"os.path.exists",
"numpy.array",
"Modules.camera_location.cal_camera_location",
"Modules.camera_location.estimate_camera_location",
"numpy.random.shuffle",
"body_part_classification.Bo... | [((6625, 6644), 'body_part_classification.run_bpc', 'run_bpc', (['DivConqBPC'], {}), '(DivConqBPC)\n', (6632, 6644), False, 'from body_part_classification import BodyPartClassification, run_bpc\n'), ((1470, 1572), 'body_part_classification.BodyPartClassification.__init__', 'BodyPartClassification.__init__', (['self', '... |
"""Construct an array by repeating A the number of times given by reps."""
import numpy
import numpoly
from .common import implements
@implements(numpy.tile)
def tile(A, reps):
"""
Construct an array by repeating A the number of times given by reps.
If `reps` has length ``d``, the result will have dimen... | [
"numpoly.aspolynomial",
"numpy.tile"
] | [((1545, 1568), 'numpoly.aspolynomial', 'numpoly.aspolynomial', (['A'], {}), '(A)\n', (1565, 1568), False, 'import numpoly\n'), ((1582, 1613), 'numpy.tile', 'numpy.tile', (['A.values'], {'reps': 'reps'}), '(A.values, reps=reps)\n', (1592, 1613), False, 'import numpy\n'), ((1625, 1677), 'numpoly.aspolynomial', 'numpoly.... |
"""
Everything that summarizes Fourier (or other transforms)
into another frequency scale and summarizes frequency ranges
"""
import gammatone
import librosa
import numpy as np
from .stage_meta import Analytic, DType, ToDo
class FreqFilter(Analytic):
def __init__(self, n_filts=24, sr=16000, window=512, hop=128,... | [
"gammatone.gtgram.centre_freqs",
"numpy.vectorize",
"numpy.ceil",
"numpy.abs",
"gammatone.gtgram.erb_filterbank",
"numpy.zeros",
"librosa.filters.mel",
"numpy.mean",
"numpy.arange",
"numpy.dot",
"gammatone.gtgram.make_erb_filters",
"numpy.concatenate"
] | [((535, 574), 'numpy.concatenate', 'np.concatenate', (['[[0], self.scale, [sr]]'], {}), '([[0], self.scale, [sr]])\n', (549, 574), True, 'import numpy as np\n'), ((1099, 1129), 'numpy.dot', 'np.dot', (['recording', 'self.filter'], {}), '(recording, self.filter)\n', (1105, 1129), True, 'import numpy as np\n'), ((1276, 1... |
import numpy as np
from multiagent.core import World, Agent, Landmark
from multiagent.scenario import BaseScenario
import random
import sys
from colorama import init
init(strip=not sys.stdout.isatty()) # strip colors if stdout is redirected
from termcolor import cprint
from pyfiglet import figlet_format
from threading... | [
"numpy.random.uniform",
"threading.Timer",
"numpy.square",
"numpy.zeros",
"multiagent.core.Landmark",
"sys.stdout.isatty",
"numpy.array",
"multiagent.core.World",
"numpy.concatenate",
"multiagent.core.Agent"
] | [((431, 454), 'threading.Timer', 'Timer', (['(40)', 'self.timeout'], {}), '(40, self.timeout)\n', (436, 454), False, 'from threading import Timer\n'), ((747, 754), 'multiagent.core.World', 'World', ([], {}), '()\n', (752, 754), False, 'from multiagent.core import World, Agent, Landmark\n'), ((2700, 2728), 'numpy.array'... |
from __future__ import absolute_import, division, print_function
import numpy as np
from .core import IdentityOperator, Operator
from .flags import real, linear, square, inplace
from .utils import isalias, split
from .utils.mpi import MPI, as_mpi, distribute_shape, timer_mpi
__all__ = ['MPIDistributionGlobalOperator',... | [
"numpy.product"
] | [((1705, 1728), 'numpy.product', 'np.product', (['shapein[1:]'], {}), '(shapein[1:])\n', (1715, 1728), True, 'import numpy as np\n')] |
"""
Filename: plotting.py
Author: <NAME>, <EMAIL>
This script contains functions to read pre-processed NetCDF files, do some
final analysis and plot the results.
"""
# Import modules
from helpers import read_netcdf_dataset, get_config, save_fig_and_log, \
make_datelist, get_and_crop_radar_fobj
from dat... | [
"cosmo_utils.helpers.ddhhmmss",
"helpers.make_datelist",
"numpy.amin",
"numpy.ravel",
"matplotlib.pyplot.subplots",
"datetime.datetime",
"numpy.amax",
"helpers.get_config",
"cosmo_utils.pyncdf.getfobj_ncdf_ens",
"numpy.mean",
"datetime.timedelta",
"helpers.get_and_crop_radar_fobj",
"matplotl... | [((1120, 1147), 'helpers.read_netcdf_dataset', 'read_netcdf_dataset', (['inargs'], {}), '(inargs)\n', (1139, 1147), False, 'from helpers import read_netcdf_dataset, get_config, save_fig_and_log, make_datelist, get_and_crop_radar_fobj\n'), ((1299, 1384), 'matplotlib.pyplot.subplots', 'plt.subplots', (['n_rows', 'n_cols'... |
'''
Utilities for scoring the performance of models on datasets.
'''
from random import shuffle
import numpy as np
from classer.utils.status import set_status
def score_model(model, data, status_file, test_split=0.1, min_samples=10, iterations=3):
'''Calculate a score for a model and a specific dataset
Run... | [
"random.shuffle",
"classer.utils.status.set_status",
"numpy.zeros"
] | [((2696, 2730), 'numpy.zeros', 'np.zeros', (['(num_labels, num_labels)'], {}), '((num_labels, num_labels))\n', (2704, 2730), True, 'import numpy as np\n'), ((2751, 2785), 'numpy.zeros', 'np.zeros', (['(num_labels, num_labels)'], {}), '((num_labels, num_labels))\n', (2759, 2785), True, 'import numpy as np\n'), ((2927, 2... |
import sys
import random
import operator
import numpy as np
from functools import reduce
from itertools import product
from gensim.models import KeyedVectors
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
def select(k, n):
value = list(range(k))
rest = dict()
for i in range(k):
... | [
"numpy.lexsort",
"sklearn.cluster.KMeans",
"sklearn.decomposition.PCA",
"random.randrange",
"itertools.product",
"functools.reduce",
"operator.itemgetter"
] | [((978, 1010), 'functools.reduce', 'reduce', (['(lambda a, b: a * b)', 'dims'], {}), '(lambda a, b: a * b, dims)\n', (984, 1010), False, 'from functools import reduce\n'), ((1019, 1038), 'numpy.lexsort', 'np.lexsort', (['(dims,)'], {}), '((dims,))\n', (1029, 1038), True, 'import numpy as np\n'), ((1423, 1443), 'sklearn... |
from abc import abstractmethod
from .utils import get_params
from .structured_utils import *
from .mixin import ActivationMixin
from collections import OrderedDict, defaultdict
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import itertools
import time
class StructuredPruning(ActivationMixi... | [
"pandas.DataFrame",
"numpy.multiply",
"time.perf_counter",
"torch.cat",
"numpy.searchsorted",
"collections.defaultdict",
"numpy.argsort",
"numpy.array",
"torch.device",
"itertools.product",
"torch.no_grad",
"numpy.prod",
"torch.from_numpy"
] | [((1273, 1298), 'torch.cat', 'torch.cat', (['inputs'], {'axis': '(0)'}), '(inputs, axis=0)\n', (1282, 1298), False, 'import torch\n'), ((1317, 1343), 'torch.cat', 'torch.cat', (['outputs'], {'axis': '(0)'}), '(outputs, axis=0)\n', (1326, 1343), False, 'import torch\n'), ((1366, 1385), 'torch.device', 'torch.device', ([... |
import numpy as np
import pylab as pl
from scipy import io
# Adding Files and locations
froot = '/home/hari/Documents/PythonCodes/EfferentFFR/'
f331 = True
addMEM = False
if f331:
froot = froot + 'f331/'
f0 = 331.0
subjlist = ['I08', 'I14', 'I33', 'I41', 'I52', 'I11', 'I13',
'I12', 'I07']
... | [
"pylab.hold",
"pylab.show",
"numpy.abs",
"scipy.io.loadmat",
"numpy.arange",
"numpy.log10"
] | [((1798, 1811), 'pylab.hold', 'pl.hold', (['(True)'], {}), '(True)\n', (1805, 1811), True, 'import pylab as pl\n'), ((1877, 1886), 'pylab.show', 'pl.show', ([], {}), '()\n', (1884, 1886), True, 'import pylab as pl\n'), ((1824, 1839), 'numpy.arange', 'np.arange', (['(1)', '(4)'], {}), '(1, 4)\n', (1833, 1839), True, 'im... |
import pandas as pd
import csv
from collections import OrderedDict, defaultdict, Counter
from datetime import datetime
import pickle as pkl
import os
import numpy as np
import logging
import matplotlib
# avoid xWindows errors in plotting
matplotlib.use('Agg')
import matplotlib.pyplot as plt
#PROCESSEDPATH='processed/'... | [
"logging.basicConfig",
"pandas.read_csv",
"numpy.sort",
"numpy.cumsum",
"matplotlib.use",
"matplotlib.pyplot.subplots",
"logging.getLogger"
] | [((238, 259), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (252, 259), False, 'import matplotlib\n'), ((1212, 1302), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(message)s"""', 'datefmt': '"""%m/%d/%Y %I:%M:%S %p"""'}), "(format='%(asctime)s %(message)s', date... |
#!/usr/bin/env python
import numpy as np
from scipy.spatial.distance import cdist
def cosine_distance(row_patterns, col_patterns, e=1e-10):
"""A fast and naive implementation of cosine distance.
Numerical stability issues might arise.
:param row_patterns: A matrix with row vectors of dimensions MxN.
... | [
"scipy.spatial.distance.cdist",
"numpy.ones_like",
"numpy.zeros",
"numpy.argsort",
"numpy.cumsum",
"numpy.linalg.norm",
"numpy.dot"
] | [((627, 663), 'numpy.linalg.norm', 'np.linalg.norm', (['row_patterns'], {'axis': '(1)'}), '(row_patterns, axis=1)\n', (641, 663), True, 'import numpy as np\n'), ((677, 713), 'numpy.linalg.norm', 'np.linalg.norm', (['col_patterns'], {'axis': '(0)'}), '(col_patterns, axis=0)\n', (691, 713), True, 'import numpy as np\n'),... |
import csv
import numpy as np
import math
import random
from operator import itemgetter
print("Please wait while we initialize...")
def euclidean(a, b):
l = len(a)
val = 0
for i in range(l):
if (i-1) in range(5):
continue
val += (a[i]-b[0][i])**2
val = math.sqrt(val)
... | [
"numpy.matrix",
"numpy.amin",
"math.sqrt",
"numpy.amax",
"operator.itemgetter"
] | [((1463, 1477), 'numpy.matrix', 'np.matrix', (['lst'], {}), '(lst)\n', (1472, 1477), True, 'import numpy as np\n'), ((303, 317), 'math.sqrt', 'math.sqrt', (['val'], {}), '(val)\n', (312, 317), False, 'import math\n'), ((1584, 1600), 'numpy.amax', 'np.amax', (['x[:, i]'], {}), '(x[:, i])\n', (1591, 1600), True, 'import ... |
#from __future__ import absolute_import
import cv2
import glob
import numpy as np
from output_saver import OutputSaver
NUM_COLOR_CHANNELS = 3
CORNERS_PATH = '../output_images/corners/corners%d.jpg'
ORIGINAL_PATH = '../output_images/original/original%d.jpg'
UNDISTORTED_PATH = '../output_images/undistorted/undistorted... | [
"cv2.warpPerspective",
"cv2.findChessboardCorners",
"cv2.cvtColor",
"cv2.getPerspectiveTransform",
"numpy.float32",
"numpy.zeros",
"output_saver.OutputSaver",
"cv2.imread",
"numpy.array",
"cv2.calibrateCamera",
"glob.glob",
"cv2.undistort"
] | [((1627, 1696), 'cv2.calibrateCamera', 'cv2.calibrateCamera', (['objpoints', 'imgpoints', 'img.shape[0:2]', 'None', 'None'], {}), '(objpoints, imgpoints, img.shape[0:2], None, None)\n', (1646, 1696), False, 'import cv2\n'), ((1714, 1754), 'cv2.undistort', 'cv2.undistort', (['img', 'mtx', 'dist', 'None', 'mtx'], {}), '(... |
# Author: <NAME>
import numpy as np
import scipy.stats
import pandas as pd
import argparse
import pyBigWig
import os
import subprocess
import io
import gzip
import pickle
def padjust_bh(p):
"""
Benjamini-Hochberg ajdusted p-values
Replicates p.adjust(p, method="BH") from R
"""
n = len(p)
... | [
"pandas.DataFrame",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.float",
"numpy.percentile",
"numpy.argsort",
"pickle.load",
"pyBigWig.open",
"numpy.arange",
"numpy.array",
"os.path.join",
"pandas.concat"
] | [((488, 530), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""ASE"""'}), "(description='ASE')\n", (511, 530), False, 'import argparse\n'), ((1570, 1631), 'pandas.read_csv', 'pd.read_csv', (['args.read_count_file_list'], {'sep': '"""\t"""', 'index_col': '(0)'}), "(args.read_count_file_list... |
import pickle
import os
from torch.utils import data
import numpy as np
import torch
import torchvision.transforms as transforms
from PIL import Image
import random
from collections import Counter
class DataloaderCifar10_MultiLabel(data.Dataset):
def __init__(self, img_size=32, is_transform=False, split='train', ... | [
"random.randint",
"torchvision.transforms.RandomHorizontalFlip",
"random.uniform",
"collections.Counter",
"torchvision.transforms.ToTensor",
"numpy.vstack",
"pickle.load",
"random.seed",
"PIL.Image.fromarray",
"torchvision.transforms.RandomCrop",
"os.path.join",
"numpy.concatenate",
"torchvi... | [((1744, 1776), 'numpy.concatenate', 'np.concatenate', (['all_data'], {'axis': '(0)'}), '(all_data, axis=0)\n', (1758, 1776), True, 'import numpy as np\n'), ((2220, 2236), 'random.seed', 'random.seed', (['(100)'], {}), '(100)\n', (2231, 2236), False, 'import random\n'), ((3452, 3472), 'PIL.Image.fromarray', 'Image.from... |
import numpy as np
from itertools import accumulate
def _printer(i, a, m, k, m_a, k_a, z, x):
print(f"{a}x%{m}={k}")
print(f"x_{i}={x}")
print()
def solve(a, m, k, i=0, prnt=False, allow_zero=False):
"""
Solve simple linear conguruence equation
Find the least x such that ax=k (mod m)
if ... | [
"numpy.lcm.reduce",
"itertools.accumulate",
"doctest.testmod"
] | [((1699, 1715), 'numpy.lcm.reduce', 'np.lcm.reduce', (['P'], {}), '(P)\n', (1712, 1715), True, 'import numpy as np\n'), ((3531, 3567), 'doctest.testmod', 'testmod', ([], {'name': '"""decode"""', 'verbose': '(True)'}), "(name='decode', verbose=True)\n", (3538, 3567), False, 'from doctest import testmod\n'), ((2387, 2414... |
import os.path
import random
import torchvision.transforms as transforms
import torch
import numpy as np
from data.base_dataset import BaseDataset
from data.audio import Audio
#from data.image_folder import make_dataset
from PIL import Image
import progressbar
#def make_dataset(dir):
# images = []
# assert os.pa... | [
"numpy.load",
"numpy.resize",
"numpy.asarray",
"torch.cat",
"numpy.array",
"progressbar.ProgressBar",
"torch.tensor",
"torchvision.transforms.ToTensor"
] | [((14669, 14691), 'numpy.array', 'np.array', (['self.weights'], {}), '(self.weights)\n', (14677, 14691), True, 'import numpy as np\n'), ((16559, 16637), 'numpy.asarray', 'np.asarray', (['self.expressions[internal_sequence_id][audio_id]'], {'dtype': 'np.float32'}), '(self.expressions[internal_sequence_id][audio_id], dty... |
#!/usr/bin/env python3
#------------------------------------------------------------------------------
# LDO MODEL WRAPPER
# IDEA & POSH
# Date: 12/21/2018
#------------------------------------------------------------------------------
import sys
import getopt
import math
import subprocess as sp
import fileinput
impor... | [
"matplotlib.pyplot.title",
"os.mkdir",
"argparse.ArgumentParser",
"numpy.polyfit",
"run_digital_flow.run_synth_n_apr",
"os.path.join",
"matplotlib.pyplot.xlabel",
"sys.path.append",
"os.path.abspath",
"run_sim_flow.run_post_pex_model_imax_worst",
"datetime.datetime.now",
"re.sub",
"json.dump... | [((804, 833), 'os.path.split', 'os.path.split', (['head_tail_0[0]'], {}), '(head_tail_0[0])\n', (817, 833), False, 'import os\n'), ((963, 996), 'os.path.join', 'os.path.join', (['pvtGenDir', '"""./flow"""'], {}), "(pvtGenDir, './flow')\n", (975, 996), False, 'import os\n'), ((1016, 1055), 'os.path.join', 'os.path.join'... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 14 07:48:06 2019
@author: thomas
"""
import numpy as np
import matplotlib.pyplot as plt
# function to create the square pulse
def square(t,T):
f=(t<=T/2.0) * (t>=-T/2.0)
return(f)
font = {'family' : 'serif',
'weight' :... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.sinc",
"numpy.arange",
"matplotlib.pyplot.rc",
"numpy.real",
"numpy.fft.fftshift",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tight_layout",
"mat... | [((355, 377), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {}), "('font', **font)\n", (361, 377), True, 'import matplotlib.pyplot as plt\n'), ((415, 446), 'numpy.arange', 'np.arange', (['(-N / 2.0)', '(N / 2.0)', '(1)'], {}), '(-N / 2.0, N / 2.0, 1)\n', (424, 446), True, 'import numpy as np\n'), ((709, 722), 'mat... |
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from src.model.datasets.datasets import *
from src.model.configs import configs
import pipeline
import mlflow
import mlflow.sklearn
mlflow.set_experiment("train")
def eval_metric... | [
"mlflow.start_run",
"mlflow.end_run",
"mlflow.log_param",
"numpy.log",
"pipeline.model_pipeline.fit",
"mlflow.sklearn.log_model",
"mlflow.set_experiment",
"sklearn.model_selection.train_test_split",
"pipeline.model_pipeline.predict",
"mlflow.log_artifact",
"numpy.exp",
"mlflow.log_metric",
"... | [((273, 303), 'mlflow.set_experiment', 'mlflow.set_experiment', (['"""train"""'], {}), "('train')\n", (294, 303), False, 'import mlflow\n'), ((386, 405), 'numpy.exp', 'np.exp', (['predictions'], {}), '(predictions)\n', (392, 405), True, 'import numpy as np\n'), ((418, 452), 'sklearn.metrics.mean_squared_error', 'mean_s... |
import operator
from itertools import product
from itertools import accumulate
import numpy as np
import random
import pickle
from scipy.interpolate import BSpline
from sklearn import linear_model
from sklearn.linear_model import LinearRegression
from numpy.linalg import inv
from functools import reduce
from scip... | [
"scipy.stats.norm.ppf",
"pickle.dump",
"numpy.random.seed",
"numpy.std",
"pickle.load",
"numpy.mean",
"numpy.sqrt"
] | [((1182, 1215), 'pickle.dump', 'pickle.dump', (['value_store', 'outfile'], {}), '(value_store, outfile)\n', (1193, 1215), False, 'import pickle\n'), ((3939, 4029), 'pickle.dump', 'pickle.dump', (["{'scaler': a.scaler, 'bspline': a.bspline, 'para': a.para}", 'outfile_train'], {}), "({'scaler': a.scaler, 'bspline': a.bsp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 18-7-31 上午11:48
# @Author : xiezheng
# @Site :
# @File : train_detect.py
import time
import numpy as np
import torch
import torchvision.transforms as transforms
import cv2
import os
from models.onet import ONet
from models.pnet import PNet
from model... | [
"torch.stack",
"numpy.zeros",
"time.time",
"models.pnet.PNet",
"models.rnet.RNet",
"numpy.vstack",
"numpy.where",
"numpy.array",
"tools.utils.convert_to_square",
"models.onet.ONet",
"torch.cuda.is_available",
"checkpoint.CheckPoint",
"os.path.split",
"numpy.round",
"tools.utils.nms",
"... | [((1264, 1291), 'os.path.split', 'os.path.split', (['p_model_path'], {}), '(p_model_path)\n', (1277, 1291), False, 'import os\n'), ((1313, 1332), 'checkpoint.CheckPoint', 'CheckPoint', (['dirname'], {}), '(dirname)\n', (1323, 1332), False, 'from checkpoint import CheckPoint\n'), ((2949, 2974), 'numpy.where', 'np.where'... |
"""
Title: Random forest digital twin template
Authors: <NAME>, <NAME>, <NAME>
Date created: 2020/11/09
Last modified: 2020/11/09
Description: Templates for creation and execution through the VLAB on DestinationEarth VirtualCloud of random forest based digital twins.
Version: 0.1
"""
import json, csv
import ... | [
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.GridSearchCV",
"json.load",
"json.loads",
"sklearn.model_selection.train_test_split",
"generate_raster.do_parse",
"os.walk",
"joblib.dump",
"numpy.isnan",
"prepare_image.loadTrainData",
"sklearn.ensemble.RandomForestRegressor",
... | [((1543, 1620), 'sklearn.model_selection.GridSearchCV', 'GridSearchCV', ([], {'estimator': 'rf', 'param_grid': 'param_grid', 'cv': '(3)', 'n_jobs': '(-1)', 'verbose': '(2)'}), '(estimator=rf, param_grid=param_grid, cv=3, n_jobs=-1, verbose=2)\n', (1555, 1620), False, 'from sklearn.model_selection import RandomizedSearc... |
# Loading packages here
import sys
import argparse
import numpy as np
# import skbio as sb # Use this for ANOSIM
import pandas as pd # Use this for working with dataframes
import os
import networkx
import scipy.stats as stats
# import scipy.spatial.distance as distance # conda install scipy
# from skbio.diversity imp... | [
"matplotlib.pyplot.title",
"numpy.absolute",
"seaborn.heatmap",
"matplotlib.pyplot.figure",
"networkx.connected_components",
"networkx.closeness_centrality",
"networkx.from_pandas_edgelist",
"networkx.empty_graph",
"networkx.degree_centrality",
"matplotlib.pyplot.tight_layout",
"os.path.join",
... | [((1953, 2009), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'bc.data', 'index': 'bc.ids', 'columns': 'bc.ids'}), '(data=bc.data, index=bc.ids, columns=bc.ids)\n', (1965, 2009), True, 'import pandas as pd\n'), ((4881, 4917), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': 'num_pca_components'}), '(n_comp... |
from numpy import exp, ones_like, zeros_like, arange, multiply, \
subtract, add, minimum, maximum, sign, c_, argmax, \
array, where, hstack, logical_not, sqrt
from numpy import sum as npsum
from numpy import abs as npabs
from numpy import round as npround
from scipy.integrate import trapz
import matplotlib.py... | [
"matplotlib.pyplot.title",
"numpy.maximum",
"numpy.sum",
"numpy.abs",
"numpy.argmax",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.exp",
"matplotlib.pyplot.fill_between",
"numpy.zeros_like",
"numpy.multiply",
"numpy.logical_not",
"numpy.add",
"numpy.minimum",
"matplotlib.pyplot.sho... | [((1161, 1174), 'numpy.zeros_like', 'zeros_like', (['x'], {}), '(x)\n', (1171, 1174), False, 'from numpy import exp, ones_like, zeros_like, arange, multiply, subtract, add, minimum, maximum, sign, c_, argmax, array, where, hstack, logical_not, sqrt\n'), ((2024, 2059), 'numpy.multiply', 'multiply', (['params[1]', '(x ==... |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
import argparse
import os
from os.path import join
from collections import defaultdict as dd
import numpy as np
import sklearn
import torch
from torch.utils.data import D... | [
"utils.data_utils.load_json",
"argparse.ArgumentParser",
"logging.basicConfig",
"os.makedirs",
"keras.preprocessing.sequence.pad_sequences",
"utils.data_utils.dump_large_obj",
"utils.feature_utils.scale_matrix",
"utils.data_utils.load_large_obj",
"numpy.ones",
"sklearn.utils.shuffle",
"os.path.j... | [((551, 578), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (568, 578), False, 'import logging\n'), ((579, 652), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s %(message)s"""'}), "(level=logging.INFO, format='%(asctime)s %(message)s... |
class Callback():
def __init__(self, learner):
self.learner = learner
def fit_start(self):
return True
def fit_end(self):
return True
def epoch_start(self, epoch):
return True
def batch_start(self, batch):
return True
def after_loss(self, loss):
re... | [
"collections.defaultdict",
"numpy.mean",
"numpy.array"
] | [((548, 561), 'numpy.mean', 'np.mean', (['data'], {}), '(data)\n', (555, 561), True, 'import numpy as np\n'), ((596, 614), 'numpy.mean', 'np.mean', (['data[:-1]'], {}), '(data[:-1])\n', (603, 614), True, 'import numpy as np\n'), ((979, 996), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (990, 99... |
import numpy as np
"""
A2-Part-2: Generate a complex sinusoid
Write a function to generate the complex sinusoid that is used in DFT computation of length N (samples),
corresponding to the frequency index k. Note that the complex sinusoid used in DFT computation has a
negative sign in the exponential function.
The... | [
"numpy.arange",
"numpy.exp"
] | [((1195, 1210), 'numpy.arange', 'np.arange', (['(0)', 'N'], {}), '(0, N)\n', (1204, 1210), True, 'import numpy as np\n'), ((1219, 1266), 'numpy.exp', 'np.exp', (['(-1.0j * 2 * np.pi * k * time_domain / N)'], {}), '(-1.0j * 2 * np.pi * k * time_domain / N)\n', (1225, 1266), True, 'import numpy as np\n')] |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | [
"math.isclose",
"numpy.sign"
] | [((3451, 3554), 'math.isclose', 'isclose', (['(self._quantity + transaction.quantity)', '(0)'], {'rel_tol': 'ISCLOSE_REL_TOL', 'abs_tol': 'ISCLOSE_ABS_TOL'}), '(self._quantity + transaction.quantity, 0, rel_tol=ISCLOSE_REL_TOL,\n abs_tol=ISCLOSE_ABS_TOL)\n', (3458, 3554), False, 'from math import isclose\n'), ((2142... |
import os
import yaml
from yaml.loader import SafeLoader
import pandas as pd
import numpy as np
from typing import List, Optional
import pydantic as dt
from .dgl_dataset import DGLDataset
from ..convert import heterograph as dgl_heterograph
from .. import backend as F
from .utils import save_graphs, load_graphs
from ..... | [
"numpy.full",
"yaml.load",
"pandas.read_csv",
"os.path.dirname",
"os.path.exists",
"numpy.array",
"ast.literal_eval",
"os.path.join",
"numpy.unique"
] | [((1526, 1557), 'yaml.load', 'yaml.load', (['f'], {'Loader': 'SafeLoader'}), '(f, Loader=SafeLoader)\n', (1535, 1557), False, 'import yaml\n'), ((3225, 3261), 'pandas.read_csv', 'pd.read_csv', (['csv_path'], {'sep': 'separator'}), '(csv_path, sep=separator)\n', (3236, 3261), True, 'import pandas as pd\n'), ((3686, 3719... |
# --------------------------------------------------------------
# SNIPER: Efficient Multi-Scale Training
# Licensed under The Apache-2.0 License [see LICENSE for details]
# by <NAME> and <NAME>
# --------------------------------------------------------------
import chips
from bbox.bbox_transform import clip_boxes, ign... | [
"numpy.where",
"chips.append",
"numpy.array",
"numpy.random.permutation",
"numpy.ascontiguousarray"
] | [((2376, 2413), 'numpy.random.permutation', 'np.random.permutation', (['chips.shape[0]'], {}), '(chips.shape[0])\n', (2397, 2413), True, 'import numpy as np\n'), ((888, 921), 'numpy.array', 'np.array', (['[height - 1, width - 1]'], {}), '([height - 1, width - 1])\n', (896, 921), True, 'import numpy as np\n'), ((953, 99... |
import os
import sys
sys.path.append("../") # go to parent dir
import glob
import time
import pathlib
import logging
import numpy as np
from scipy.sparse import linalg as spla
from dedalus.tools.config import config
from simple_sphere import SimpleSphere, TensorField, TensorSystem
import equations
import matplotlib
mat... | [
"sys.path.append",
"simple_sphere.TensorField",
"matplotlib.pyplot.show",
"os.makedirs",
"matplotlib.pyplot.plot",
"numpy.abs",
"numpy.zeros",
"os.path.exists",
"logging.getLogger",
"simple_sphere.SimpleSphere",
"matplotlib.pyplot.figure",
"matplotlib.use",
"os.path.join",
"matplotlib.pypl... | [((21, 43), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (36, 43), False, 'import sys\n'), ((317, 340), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (331, 340), False, 'import matplotlib\n'), ((495, 522), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}... |
"""
Run PyTorch Reinforce on Pusher2D3DofGoalCompoEnv.
NOTE: You need PyTorch 0.4
"""
import numpy as np
import robolearn.torch.utils.pytorch_util as ptu
from robolearn.utils.launchers.launcher_util import setup_logger
from robolearn_gym_envs.pybullet import Reacher2D3DofBulletEnv
from robolearn.algorithms.rl_algos... | [
"robolearn.algorithms.rl_algos.MDGPS",
"argparse.ArgumentParser",
"numpy.deg2rad",
"robolearn_gym_envs.pybullet.Reacher2D3DofBulletEnv",
"robolearn.torch.policies.LinearGaussianPolicy",
"robolearn.utils.launchers.launcher_util.setup_logger",
"robolearn.torch.utils.pytorch_util.gpu_enabled",
"robolearn... | [((635, 667), 'robolearn.torch.utils.pytorch_util.set_gpu_mode', 'ptu.set_gpu_mode', (["variant['gpu']"], {}), "(variant['gpu'])\n", (651, 667), True, 'import robolearn.torch.utils.pytorch_util as ptu\n'), ((775, 822), 'robolearn_gym_envs.pybullet.Reacher2D3DofBulletEnv', 'Reacher2D3DofBulletEnv', ([], {}), "(**variant... |
import pandas as pd
import numpy as np
import talib
def get_label(revenue, period_length):
if period_length == 1:
if revenue <= 0.1:
lab = 0
elif 0.1 < revenue <= 1:
lab = 1
elif 1 < revenue <= 3:
lab = 2
else:
lab = 3
elif perio... | [
"pandas.DataFrame",
"talib.MACD",
"pandas.read_csv",
"pandas.to_datetime",
"numpy.array",
"talib.ADOSC"
] | [((1333, 1386), 'pandas.read_csv', 'pd.read_csv', (['inputFile'], {'engine': '"""python"""', 'skipfooter': '(1)'}), "(inputFile, engine='python', skipfooter=1)\n", (1344, 1386), True, 'import pandas as pd\n'), ((1407, 1439), 'pandas.to_datetime', 'pd.to_datetime', (["data['DateTime']"], {}), "(data['DateTime'])\n", (14... |
import numpy as np
#Radius of subconductor code:
# Variables from Radius of subconductors :
diameter_strand = float(input("diameter of strand?\n"))
number_of_strands = float(input("Input number of strands?\n"))
#number_of_layers = 2
#radius_subconductor = 0
layers_1 = ((3)+((9-(4*(3)*(1-number_of_strands)))**0.5))... | [
"reportlab.pdfgen.canvas.Canvas",
"numpy.cosh",
"numpy.sinh",
"numpy.log"
] | [((6211, 6240), 'reportlab.pdfgen.canvas.Canvas', 'canvas.Canvas', (['"""Output_dd_mm"""'], {}), "('Output_dd_mm')\n", (6224, 6240), False, 'from reportlab.pdfgen import canvas\n'), ((2096, 2115), 'numpy.log', 'np.log', (['(MGMD / SGMD)'], {}), '(MGMD / SGMD)\n', (2102, 2115), True, 'import numpy as np\n'), ((2389, 240... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
from pathlib import Path
import pytest
from pymatgen.core import Composition
from pymatgen.io.vasp import Vasprun
from vise.analyzer.plot_band import BandEdge, XTicks, BandMplSettings
from vise.analyzer.plot_brillouin_zone... | [
"pymatgen.io.vasp.Vasprun",
"vise.analyzer.vasp.plot_band.BandPlotInfoFromVasp",
"vise.util.dash_helper.show_png",
"vise.analyzer.plot_band.BandPlotter",
"vise.analyzer.plot_brillouin_zone.BZPlotlyPlotter",
"vise.analyzer.plot_band.XTicks",
"vise.analyzer.vasp.plot_band.italic_to_roman",
"vise.analyze... | [((1086, 1151), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""is_metal,expected_band_edge"""', 'test_data'], {}), "('is_metal,expected_band_edge', test_data)\n", (1109, 1151), False, 'import pytest\n'), ((3007, 3077), 'pytest.mark.skipif', 'pytest.mark.skipif', (['PSUTIL_NOT_PRESENT'], {'reason': '"""psut... |
import numpy as np
import pandas as pd
# peason
def Peason(x,y):
x = np.squeeze(x)
y = np.squeeze(y)
x = x - x.mean()
y = y - y.mean()
return x.dot(y)/(np.linalg.norm(x)*np.linalg.norm(y))
# Jaccard
def Jaccard(x,y):
x = np.squeeze(x)
y = np.squeeze(y)
a = x.dot(y)
b = np.linalg.nor... | [
"numpy.squeeze",
"numpy.power",
"numpy.linalg.norm",
"pandas.read_excel"
] | [((74, 87), 'numpy.squeeze', 'np.squeeze', (['x'], {}), '(x)\n', (84, 87), True, 'import numpy as np\n'), ((96, 109), 'numpy.squeeze', 'np.squeeze', (['y'], {}), '(y)\n', (106, 109), True, 'import numpy as np\n'), ((246, 259), 'numpy.squeeze', 'np.squeeze', (['x'], {}), '(x)\n', (256, 259), True, 'import numpy as np\n'... |
import math
import numpy as np
# Converts URx's rotation vector into a rotation matrix
#
# I did not derive this nor do I fully understand the maths behind this :0
# I took it from: https://dof.robotiq.com/discussion/1648/around-which-axes-are-the-rotation-vector-angles-defined
def convert_tool_pose_to_transformation... | [
"math.sqrt",
"math.sin",
"numpy.array",
"math.cos",
"numpy.round"
] | [((409, 447), 'math.sqrt', 'math.sqrt', (['(rx ** 2 + ry ** 2 + rz ** 2)'], {}), '(rx ** 2 + ry ** 2 + rz ** 2)\n', (418, 447), False, 'import math\n'), ((518, 533), 'math.cos', 'math.cos', (['theta'], {}), '(theta)\n', (526, 533), False, 'import math\n'), ((540, 555), 'math.sin', 'math.sin', (['theta'], {}), '(theta)\... |
import os
import time
import sys
from glob import glob
import numpy as np
from tqdm import tqdm
import pdb
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import argparse
im... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.cat",
"numpy.random.randint",
"_dct.LinearDCT",
"torch.fft.irfft",
"torch.device",
"numpy.sqrt",
"torch.no_grad",
"torch.nn.BCELoss",
"torch.utils.data.DataLoader",
"cv2.imwrite",
"torch.load",
"torch.FloatTensor",
"torch.nn.function... | [((6005, 6016), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (6013, 6016), True, 'import numpy as np\n'), ((7503, 7563), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch MNIST Example"""'}), "(description='PyTorch MNIST Example')\n", (7526, 7563), False, 'import argparse\n'),... |
import osqp # solver
import numpy as np
from scipy import sparse
from scipy.sparse import vstack, hstack, eye
from warnings import warn
class CCOCP:
"""
CC-OCP: chance-constrained optimal control problem
Defines a CC-OCP and adds the model specific constraints and objectives.
Parser f... | [
"numpy.stack",
"numpy.minimum",
"scipy.sparse.vstack",
"numpy.empty",
"scipy.sparse.eye",
"numpy.zeros",
"numpy.ones",
"numpy.hstack",
"scipy.sparse.csr_matrix",
"osqp.OSQP",
"numpy.reshape",
"numpy.linalg.norm",
"numpy.dot",
"numpy.eye",
"warnings.warn",
"numpy.concatenate"
] | [((1342, 1368), 'numpy.empty', 'np.empty', ([], {'shape': '[m.n_x, N]'}), '(shape=[m.n_x, N])\n', (1350, 1368), True, 'import numpy as np\n'), ((1410, 1440), 'numpy.empty', 'np.empty', ([], {'shape': '[m.n_u, N - 1]'}), '(shape=[m.n_u, N - 1])\n', (1418, 1440), True, 'import numpy as np\n'), ((1478, 1508), 'numpy.empty... |
import os
import pickle
from parameters import *
import tensorflow as tf
import numpy as np
def load_data():
"""
Loading Data
"""
input_file = os.path.join(TEXT_SAVE_DIR)
with open(input_file, "r") as f:
data = f.read()
return data
def preprocess_and_save_data():
"""
Preproces... | [
"numpy.argmax",
"tensorflow.train.import_meta_graph",
"tensorflow.Session",
"numpy.array",
"tensorflow.Graph",
"numpy.squeeze",
"os.path.join"
] | [((160, 187), 'os.path.join', 'os.path.join', (['TEXT_SAVE_DIR'], {}), '(TEXT_SAVE_DIR)\n', (172, 187), False, 'import os\n'), ((2436, 2496), 'numpy.array', 'np.array', (['int_text[:num_batches * (BATCH_SIZE * SEQ_LENGTH)]'], {}), '(int_text[:num_batches * (BATCH_SIZE * SEQ_LENGTH)])\n', (2444, 2496), True, 'import num... |
# -*- coding: utf-8 -*-
import numpy as np
# Constructs the problem data also used in the thesis
# When multiple problems of the same dimensions are used, we count up the rng seed
# CQP_problem constructs CQP problem data
# min 1/2x^TPx + q^Tx
# s.t Ax >= b
def CQP_problem(m,n):
rng = np... | [
"numpy.random.default_rng",
"numpy.eye"
] | [((318, 349), 'numpy.random.default_rng', 'np.random.default_rng', (['(65687777)'], {}), '(65687777)\n', (339, 349), True, 'import numpy as np\n'), ((621, 652), 'numpy.random.default_rng', 'np.random.default_rng', (['(65687777)'], {}), '(65687777)\n', (642, 652), True, 'import numpy as np\n'), ((398, 407), 'numpy.eye',... |
#!/usr/bin/env pythonu
# -*- coding: utf-8 -*-
"""
Module containing Bicubic class and EfitData class for handling all interpolation
related computations.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage import zoom
def Bicubic(... | [
"numpy.meshgrid",
"numpy.zeros_like",
"matplotlib.pyplot.clf",
"numpy.floor",
"numpy.zeros",
"scipy.ndimage.zoom",
"time.time",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.arange",
"numpy.linspace",
"numpy.matmul",
"matplotlib.pyplot.get_fignums"
] | [((1638, 1772), 'numpy.array', 'np.array', (['[[f[0], f[2], fy[0], fy[2]], [f[1], f[3], fy[1], fy[3]], [fx[0], fx[2], fxy\n [0], fxy[2]], [fx[1], fx[3], fxy[1], fxy[3]]]'], {}), '([[f[0], f[2], fy[0], fy[2]], [f[1], f[3], fy[1], fy[3]], [fx[0],\n fx[2], fxy[0], fxy[2]], [fx[1], fx[3], fxy[1], fxy[3]]])\n', (1646,... |
import matplotlib.pyplot as plt
from matplotlib import style
import numpy as np
import pandas as pd
import seaborn as sns
import gym
import numpy
import math
import os
import random
import cntk as C
isFast = True
C.device.try_set_default_device(C.device.gpu(0))
env = gym.make('CartPole-v0')
ST... | [
"cntk.learning_parameter_schedule",
"cntk.sgd",
"random.sample",
"numpy.exp",
"cntk.layers.Sequential",
"cntk.layers.Dense",
"random.randint",
"cntk.sequence.input_variable",
"cntk.square",
"seaborn.set",
"random.random",
"cntk.Trainer",
"matplotlib.pyplot.ylabel",
"cntk.device.gpu",
"ma... | [((291, 314), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (299, 314), False, 'import gym\n'), ((5418, 5436), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""step"""'], {}), "('step')\n", (5428, 5436), True, 'import matplotlib.pyplot as plt\n'), ((5437, 5462), 'matplotlib.pyplot.ylabel', 'p... |
from collections import Counter
import datetime
import logging
import time
import attr
import numba
import numpy as np
import dask.array as da
import UVDesc
from katacomb import AIPSPath, normalise_target_name
from katacomb.util import fmt_bytes
from katdal.lazy_indexer import DaskLazyIndexer, dask_getitem
log = l... | [
"numpy.empty",
"time.strftime",
"attr.make_class",
"numpy.product",
"UVDesc.ERate",
"numba.prange",
"katacomb.normalise_target_name",
"UVDesc.PDate2JD",
"katacomb.util.fmt_bytes",
"UVDesc.GST0",
"numpy.asarray",
"datetime.date.today",
"katacomb.AIPSPath",
"dask.array.where",
"dask.array.... | [((319, 348), 'logging.getLogger', 'logging.getLogger', (['"""katacomb"""'], {}), "('katacomb')\n", (336, 348), False, 'import logging\n'), ((39652, 39691), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)', 'parallel': '(True)'}), '(nopython=True, parallel=True)\n', (39661, 39691), False, 'import numba\n'), ((4577,... |
from Tkinter import *
import ttk
import Pmw
from PIL import Image, ImageTk
import os
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.widgets import LassoSelector, RectangleSelector, EllipseSelector
from matplotlib import pa... | [
"matplotlib.pyplot.gray",
"numpy.abs",
"matplotlib.widgets.LassoSelector",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.gca",
"ttk.Progressbar",
"os.path.join",
"matplotlib.pyplot.cla",
"numpy.swapaxes",
"matplotlib.patches.PathPatch",
"tkFileDialog.askopenfilename",
"h5py.... | [((1433, 1449), 'Pmw.initialise', 'Pmw.initialise', ([], {}), '()\n', (1447, 1449), False, 'import Pmw\n'), ((1964, 1987), 'Pmw.NoteBook', 'Pmw.NoteBook', (['self.root'], {}), '(self.root)\n', (1976, 1987), False, 'import Pmw\n'), ((2532, 2556), 'os.listdir', 'os.listdir', (['self.sFolder'], {}), '(self.sFolder)\n', (2... |
'''
<NAME>
TrimmerFun in python
This program numerically calculates the equilibrium state and control vectors of an F-16 model given
certain parameters.
states: controls:
x1 = Vt x4 = phi x7 = p x10 = pn u1 = throttle
x2 = alpha x5 = theta x8 = q x11 = pe u2 = e... | [
"adc.adc",
"scipy.optimize.minimize",
"numpy.zeros",
"math.sin"
] | [((2033, 2164), 'scipy.optimize.minimize', 'minimize', (['clf16', 's'], {'args': '(x, u, const, model, adjust_cy)', 'method': '"""Nelder-Mead"""', 'tol': 'minimize_tol', 'options': "{'maxiter': maxiter}"}), "(clf16, s, args=(x, u, const, model, adjust_cy), method=\n 'Nelder-Mead', tol=minimize_tol, options={'maxiter... |
import numpy as np
import pydensecrf.densecrf as dcrf
from pydensecrf.utils import unary_from_labels, unary_from_softmax
from pydensecrf.utils import compute_unary, create_pairwise_bilateral, \
create_pairwise_gaussian
# Fully connected CRF post processing function
def do_crf(im, mask, n_labels, enable_color=False... | [
"pydensecrf.utils.create_pairwise_gaussian",
"numpy.argmax",
"pydensecrf.utils.create_pairwise_bilateral",
"numpy.unique",
"pydensecrf.densecrf.DenseCRF",
"pydensecrf.utils.unary_from_softmax",
"pydensecrf.densecrf.DenseCRF2D",
"numpy.putmask",
"numpy.ascontiguousarray",
"pydensecrf.utils.unary_fr... | [((362, 398), 'numpy.unique', 'np.unique', (['mask'], {'return_inverse': '(True)'}), '(mask, return_inverse=True)\n', (371, 398), True, 'import numpy as np\n'), ((478, 533), 'pydensecrf.densecrf.DenseCRF2D', 'dcrf.DenseCRF2D', (['image_size[1]', 'image_size[0]', 'n_labels'], {}), '(image_size[1], image_size[0], n_label... |
import os
import threading
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42 # Edit plots with Illustrator
from matplotlib.figure import Figure
from matplotlib.ticker import StrMethodFormatter
import numpy as np
import pandas as pd
import skimage.morphology as skmorph
from . import const
from .events import ... | [
"pandas.DataFrame",
"numpy.sum",
"matplotlib.ticker.StrMethodFormatter",
"skimage.morphology.remove_small_holes",
"threading.RLock",
"numpy.empty",
"numpy.zeros",
"skimage.morphology.disk",
"matplotlib.figure.Figure",
"os.path.splitext",
"skimage.morphology.remove_small_objects",
"os.path.spli... | [((4701, 4718), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (4716, 4718), False, 'import threading\n'), ((6589, 6606), 'os.path.split', 'os.path.split', (['fn'], {}), '(fn)\n', (6602, 6606), False, 'import os\n'), ((15642, 15716), 'numpy.zeros', 'np.zeros', (['(meta.height, meta.width)'], {'dtype': '(np.boo... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
import copy
import numpy as np
def get_labels_start_end_time(frame_wise_labels, bg_class=["background"]):
labels = []
starts = []
ends = []
last_label = frame_wise_labels[0]
if frame_wise_labels[0] not in bg... | [
"torch.nn.Dropout",
"torch.nn.MSELoss",
"numpy.minimum",
"numpy.maximum",
"torch.nn.Conv1d",
"torch.nn.CrossEntropyLoss",
"numpy.zeros",
"torch.nn.functional.softmax",
"numpy.array",
"torch.max",
"torch.nn.functional.log_softmax",
"torch.no_grad",
"torch.sum",
"torch.tensor"
] | [((917, 959), 'numpy.zeros', 'np.zeros', (['[m_row + 1, n_col + 1]', 'np.float'], {}), '([m_row + 1, n_col + 1], np.float)\n', (925, 959), True, 'import numpy as np\n'), ((3481, 3510), 'torch.nn.Conv1d', 'nn.Conv1d', (['dim', 'num_f_maps', '(1)'], {}), '(dim, num_f_maps, 1)\n', (3490, 3510), True, 'import torch.nn as n... |
import os
import csv
import numpy as np
import matplotlib.pyplot as plt
from cached_property import cached_property
from probez.spike_handling import waveforms, cluster_exceptions, cluster
from probez.util import generic_functions
from probez.sorting_quality import load_quality_measures
from bisect import bisect_left
... | [
"numpy.load",
"csv.reader",
"os.path.join",
"probez.sorting_quality.load_quality_measures.load_from_matlab",
"probez.spike_handling.cluster_exceptions.IncorrectNchanTracesStructError",
"numpy.median",
"matplotlib.pyplot.imshow",
"probez.spike_handling.cluster.Cluster",
"numpy.logical_and",
"numpy.... | [((1242, 1272), 'numpy.unique', 'np.unique', (['self.spike_clusters'], {}), '(self.spike_clusters)\n', (1251, 1272), True, 'import numpy as np\n'), ((2258, 2271), 'numpy.load', 'np.load', (['path'], {}), '(path)\n', (2265, 2271), True, 'import numpy as np\n'), ((2856, 2899), 'numpy.memmap', 'np.memmap', (['self.traces_... |
"""Anglit distribution."""
import numpy
from ..baseclass import Dist
from ..operators.addition import Add
class anglit(Dist):
"""Anglit distribution."""
def __init__(self):
Dist.__init__(self)
def _pdf(self, x):
return numpy.cos(2*x)
def _cdf(self, x):
return numpy.sin(x+nu... | [
"numpy.sin",
"numpy.cos",
"numpy.sqrt"
] | [((252, 268), 'numpy.cos', 'numpy.cos', (['(2 * x)'], {}), '(2 * x)\n', (261, 268), False, 'import numpy\n'), ((306, 333), 'numpy.sin', 'numpy.sin', (['(x + numpy.pi / 4)'], {}), '(x + numpy.pi / 4)\n', (315, 333), False, 'import numpy\n'), ((388, 401), 'numpy.sqrt', 'numpy.sqrt', (['q'], {}), '(q)\n', (398, 401), Fals... |
#!\usr\bin\python
# coding=utf-8
# Author: youngfeng
# Update: 07/17/2018
"""
This code is used to find the lowest rank in validation pool (top-10) by using flash method
"""
import sys
sys.path.append("../")
import os
from Flash import find_lowest_rank
from Flash import predict_by_flash
from Flash import split_data_b... | [
"sys.path.append",
"Flash.predict_by_flash",
"numpy.mean",
"Flash.find_lowest_rank",
"Flash.split_data_by_fraction",
"os.listdir"
] | [((187, 209), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (202, 209), False, 'import sys\n'), ((1302, 1330), 'numpy.mean', 'np.mean', (['ave_top_10_act_rank'], {}), '(ave_top_10_act_rank)\n', (1309, 1330), True, 'import numpy as np\n'), ((417, 438), 'os.listdir', 'os.listdir', (['"""../data"... |
"""..
Copyright (c) 2014-2017, Magni developers.
All rights reserved.
See LICENSE.rst for further information.
Module for wrapping the Magni IPython Notebook examples.
**This module is based on the "ipnbdoctest.py" script by <NAME> (MinRK)**, source: https://gist.github.com/minrk/2620735.
This assumes co... | [
"numpy.bool_",
"numpy.sum",
"numpy.abs",
"base64.b64decode",
"os.path.join",
"IPython.nbformat.NotebookNode",
"warnings.simplefilter",
"numpy.logical_not",
"warnings.catch_warnings",
"io.BytesIO",
"subprocess.check_output",
"IPython.nbformat.reads",
"platform.system",
"os.listdir",
"pkg_... | [((2244, 2311), 'warnings.warn', 'warnings.warn', (['"""Skipping display data ipynb tests."""', 'RuntimeWarning'], {}), "('Skipping display data ipynb tests.', RuntimeWarning)\n", (2257, 2311), False, 'import warnings\n'), ((5917, 5932), 'IPython.kernel.KernelManager', 'KernelManager', ([], {}), '()\n', (5930, 5932), F... |
from __future__ import print_function, division
import numpy as np
import six
from astropy import units as u
from ..util.integrate import integrate
from ..util.validator import validate_scalar, validate_array
class Filter(object):
"""
A 'filter', in the general sense of a spectral transmission curve.
... | [
"numpy.argsort",
"astropy.units.spectral",
"numpy.string_"
] | [((3350, 3364), 'numpy.argsort', 'np.argsort', (['nu'], {}), '(nu)\n', (3360, 3364), True, 'import numpy as np\n'), ((4253, 4274), 'numpy.string_', 'np.string_', (['self.name'], {}), '(self.name)\n', (4263, 4274), True, 'import numpy as np\n'), ((3225, 3237), 'astropy.units.spectral', 'u.spectral', ([], {}), '()\n', (3... |
#Reader for the coco panoptic data set for pointer based image segmentation
import numpy as np
import os
import scipy.misc as misc
import random
import cv2
import json
import threading
############################################################################################################
def rgb2id(color): # Conv... | [
"os.mkdir",
"json.load",
"numpy.floor",
"numpy.zeros",
"os.path.exists",
"numpy.ones",
"cv2.imread",
"numpy.random.randint",
"os.listdir"
] | [((3205, 3230), 'os.listdir', 'os.listdir', (['AnnotationDir'], {}), '(AnnotationDir)\n', (3215, 3230), False, 'import os\n'), ((4667, 4726), 'numpy.zeros', 'np.zeros', (['[NumCCmp, Seg.shape[0], Seg.shape[1]]'], {'dtype': 'bool'}), '([NumCCmp, Seg.shape[0], Seg.shape[1]], dtype=bool)\n', (4675, 4726), True, 'import nu... |
"""Tests for reading data from MCD."""
from datetime import datetime
from pathlib import Path
import numpy as np
import pytest
from mars_mcd_helper.read_mars_data import parse_body, parse_header, parse_number, read_ascii_data
cases = [["12", 12], ["12.0008", 12.0008], ["----", None], ["1e78", 1e78]]
@pytest.mark.p... | [
"mars_mcd_helper.read_mars_data.read_ascii_data",
"pytest.approx",
"datetime.datetime",
"mars_mcd_helper.read_mars_data.parse_header",
"pathlib.Path",
"numpy.array",
"numpy.rot90",
"pytest.mark.parametrize",
"mars_mcd_helper.read_mars_data.parse_body",
"mars_mcd_helper.read_mars_data.parse_number"... | [((307, 356), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('numstr', 'res')", 'cases'], {}), "(('numstr', 'res'), cases)\n", (330, 356), False, 'import pytest\n'), ((2161, 2177), 'mars_mcd_helper.read_mars_data.parse_body', 'parse_body', (['body'], {}), '(body)\n', (2171, 2177), False, 'from mars_mcd_helpe... |
import numpy as np
from vaex.dataset import DatasetArrays
class DatasetTap(DatasetArrays):
class TapColumn(object):
def __init__(self, tap_dataset, column_name, column_type, ucd):
self.tap_dataset = tap_dataset
self.column_name = column_name
self.column_type = column_... | [
"requests.request",
"bs4.BeautifulSoup",
"tempfile.mktemp",
"urllib2.urlopen",
"numpy.concatenate"
] | [((4894, 4944), 'requests.request', 'requests.request', (['"""get"""', "(self.tap_url + '/tables/')"], {}), "('get', self.tap_url + '/tables/')\n", (4910, 4944), False, 'import requests\n'), ((5141, 5179), 'bs4.BeautifulSoup', 'BeautifulSoup', (['self.req.content', '"""xml"""'], {}), "(self.req.content, 'xml')\n", (515... |
import cv2
import numpy as np
import glob
import random
import mediapipe as mp
import matplotlib.pyplot as plt
import time
import math
def getObjectsFromImages(img):
# Load Yolo
net = cv2.dnn.readNet("Utilities/yolov3_training_last.weights", "Utilities/yolov3_testing.cfg")
# Name custom object
classes = [... | [
"matplotlib.pyplot.show",
"cv2.dnn.NMSBoxes",
"cv2.putText",
"numpy.argmax",
"cv2.waitKey",
"matplotlib.pyplot.imshow",
"cv2.cvtColor",
"cv2.dnn.blobFromImage",
"cv2.getTickCount",
"cv2.imshow",
"math.sqrt",
"cv2.dnn.readNet",
"time.time",
"cv2.VideoCapture",
"cv2.rectangle",
"cv2.flip... | [((189, 282), 'cv2.dnn.readNet', 'cv2.dnn.readNet', (['"""Utilities/yolov3_training_last.weights"""', '"""Utilities/yolov3_testing.cfg"""'], {}), "('Utilities/yolov3_training_last.weights',\n 'Utilities/yolov3_testing.cfg')\n", (204, 282), False, 'import cv2\n'), ((757, 833), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFr... |
# Author: 14281055 <NAME>U
# File Name:
import matplotlib.pyplot
import pybrain.datasets
import pybrain.tools.shortcuts
import pybrain.utilities
import pybrain.structure
import pybrain.supervised.trainers
import numpy
import Repository
def percent_error(out, true, threshold=30):
out_array = numpy.array(out).flat... | [
"numpy.abs",
"Repository.excel_to_np_array",
"numpy.array",
"numpy.atleast_2d"
] | [((1588, 1639), 'Repository.excel_to_np_array', 'Repository.excel_to_np_array', (['train_input_file_path'], {}), '(train_input_file_path)\n', (1616, 1639), False, 'import Repository\n'), ((1951, 2001), 'Repository.excel_to_np_array', 'Repository.excel_to_np_array', (['test_input_file_path'], {}), '(test_input_file_path... |
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from matplotlib.ticker import PercentFormatter
data = pd.read_csv('C:\\Users\\stewue\\OneDrive - Wuersten\\Uni\\19_HS\\Masterarbeit\\Repo\\Evaluation\\RQ1_Results\\current-commit\\merged-isMain-header.csv')
def update(df):
if df['jmhParamCount... | [
"pandas.read_csv",
"numpy.cumsum",
"matplotlib.pyplot.figure",
"matplotlib.ticker.PercentFormatter",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig"
] | [((126, 288), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\Users\\\\stewue\\\\OneDrive - Wuersten\\\\Uni\\\\19_HS\\\\Masterarbeit\\\\Repo\\\\Evaluation\\\\RQ1_Results\\\\current-commit\\\\merged-isMain-header.csv"""'], {}), "(\n 'C:\\\\Users\\\\stewue\\\\OneDrive - Wuersten\\\\Uni\\\\19_HS\\\\Masterarbeit\\\\Repo\\... |
import os
from glob import glob
import json
import numpy as np
from tensorflow.keras.utils import Progbar
from ..abstract import Loader
from .utils import get_class_names
class FAT(Loader):
""" Dataset loader for the falling things dataset (FAT).
# Arguments
path: String indicating full path to dat... | [
"os.path.basename",
"numpy.zeros",
"glob.glob"
] | [((1110, 1137), 'glob.glob', 'glob', (["(self.path + 'mixed/*')"], {}), "(self.path + 'mixed/*')\n", (1114, 1137), False, 'from glob import glob\n'), ((2702, 2728), 'numpy.zeros', 'np.zeros', (['(num_objects, 5)'], {}), '((num_objects, 5))\n', (2710, 2728), True, 'import numpy as np\n'), ((3337, 3363), 'os.path.basenam... |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
from .utils_phi import _phi
from .utils_get_r import _get_r
def entropy_approximate(signal, order=2, r="default"):
"""Compute the approximate entropy (ApEn).
Approximate entropy is a technique used to quantify the amount of regularity and the u... | [
"numpy.subtract"
] | [((1900, 1927), 'numpy.subtract', 'np.subtract', (['phi[0]', 'phi[1]'], {}), '(phi[0], phi[1])\n', (1911, 1927), True, 'import numpy as np\n')] |
"""
Companion code for the Roam blog post on hyperparameter optimization.
"""
import itertools as it
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from operator import itemgetter
import pandas as pd
import random
from scipy import stats
from time import time
from hyperopt import fmin, tpe, hp, S... | [
"pandas.DataFrame",
"sklearn.cross_validation.cross_val_score",
"numpy.log",
"warnings.filterwarnings",
"random.sample",
"numpy.std",
"hyperopt.fmin",
"sklearn.datasets.make_classification",
"time.time",
"matplotlib.pyplot.style.use",
"numpy.mean",
"scipy.stats.t.interval",
"itertools.produc... | [((815, 877), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (838, 877), False, 'import warnings\n'), ((1024, 1064), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""../../src/roam.mplstyle"""'], {}), "('../... |
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow.compat.v1 as tf
import zipfile
import cv2
import glob
from distutils.version import StrictVersion
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Im... | [
"sys.path.append",
"utils.ops.reframe_box_masks_to_image_masks",
"tensorflow.compat.v1.cast",
"distutils.version.StrictVersion",
"tensorflow.compat.v1.import_graph_def",
"cv2.imwrite",
"tensorflow.compat.v1.get_default_graph",
"numpy.expand_dims",
"tensorflow.compat.v1.gfile.GFile",
"PIL.Image.ope... | [((403, 424), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (418, 424), False, 'import sys\n'), ((710, 720), 'tensorflow.compat.v1.Graph', 'tf.Graph', ([], {}), '()\n', (718, 720), True, 'import tensorflow.compat.v1 as tf\n'), ((1052, 1161), 'utils.label_map_util.create_category_index_from_label... |
import numpy as np
class Penalty:
""" class for penalty function """
__slots__ = ['alpha','beta','C']
def __init__(self,alpha=2,beta=2,C=100):
self.alpha = alpha
self.beta = beta
self.C = C
def eval_ics(self,values,ii):
""" evaluate penalty term for inequality constrai... | [
"numpy.nonzero",
"numpy.abs",
"numpy.zeros"
] | [((340, 375), 'numpy.zeros', 'np.zeros', (['values.shape'], {'dtype': 'float'}), '(values.shape, dtype=float)\n', (348, 375), True, 'import numpy as np\n'), ((389, 411), 'numpy.nonzero', 'np.nonzero', (['(values > 0)'], {}), '(values > 0)\n', (399, 411), True, 'import numpy as np\n'), ((610, 645), 'numpy.zeros', 'np.ze... |
import numpy as np
from LtP import *
from sklearn.ensemble import RandomForestClassifier
X_train = np.array([[0, 0, 1, 1, 1, 1, 1, 0, 1],
[0, 0, 1, 0, 0, 1, 0, 1, 1],
[0, 0, 1, 1, 0, 1, 1, 0, 0],
[1, 1, 1, 1, 0, 1, 1, 0, 1],
[0, 1, 1, 1, 1... | [
"sklearn.ensemble.RandomForestClassifier",
"numpy.array"
] | [((100, 322), 'numpy.array', 'np.array', (['[[0, 0, 1, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0, 0, 1, 0, 1, 1], [0, 0, 1, 1, 0, \n 1, 1, 0, 0], [1, 1, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1],\n [1, 1, 1, 0, 1, 1, 0, 0, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1]]'], {}), '([[0, 0, 1, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0, 0, 1, 0,... |
from matplotlib import pyplot as plt
import numpy as np
angle_from = -90
angle_to = 91
angle_step = 10
x_ = np.arange(angle_from,angle_to,angle_step)
x = np.radians(x_)
lambda_l = np.reshape(np.repeat(x,x.shape[0],axis=0),(x.shape[0],x.shape[0]))
phi_l = np.repeat([x],x.shape[0],axis=0)
# specific case: l = 0
# phi_... | [
"numpy.radians",
"matplotlib.pyplot.plot",
"numpy.sin",
"numpy.arange",
"matplotlib.pyplot.cla",
"numpy.cos",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.repeat"
] | [((110, 153), 'numpy.arange', 'np.arange', (['angle_from', 'angle_to', 'angle_step'], {}), '(angle_from, angle_to, angle_step)\n', (119, 153), True, 'import numpy as np\n'), ((156, 170), 'numpy.radians', 'np.radians', (['x_'], {}), '(x_)\n', (166, 170), True, 'import numpy as np\n'), ((257, 291), 'numpy.repeat', 'np.re... |
# Copyright 2017 <NAME>, <NAME> and <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 agre... | [
"tsfresh.feature_extraction.settings.EfficientFCParameters",
"numpy.corrcoef",
"numpy.asarray",
"numpy.hstack",
"sciope.features.feature_extraction.generate_tsfresh_features",
"itertools.combinations",
"numpy.mean",
"tsfresh.feature_extraction.settings.MinimalFCParameters",
"sciope.features.feature_... | [((1880, 1922), 'sciope.features.feature_extraction._get_tsfresh_features_names', '_get_tsfresh_features_names', (['self.features'], {}), '(self.features)\n', (1907, 1922), False, 'from sciope.features.feature_extraction import generate_tsfresh_features, _get_tsfresh_features_names\n'), ((2299, 2355), 'sciope.features.... |
from .SpikeUnit import SpikeUnit
import numpy as np
def gaussian_kernel(sigma):
"""
The gaussian kernel.
.. math ::
w(\\tau) = \\frac{1}{\\sqrt{2 \\pi} \\sigma_w}
\\exp(-\\frac{\\tau^2}{2 \\sigma^2_w})
example:
.. code-block:: python
>>> kernel('guassian', {'sigma': 0.4})
"""
return lambda... | [
"numpy.ones_like",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"numpy.vstack",
"numpy.sqrt"
] | [((2963, 2996), 'numpy.linspace', 'np.linspace', (['(0)', 'target[-1]', 'nbins'], {}), '(0, target[-1], nbins)\n', (2974, 2996), True, 'import numpy as np\n'), ((353, 387), 'numpy.exp', 'np.exp', (['(-t ** 2 / (2 * sigma ** 2))'], {}), '(-t ** 2 / (2 * sigma ** 2))\n', (359, 387), True, 'import numpy as np\n'), ((634, ... |
import unittest
import os
from maskgen import plugins, image_wrap
import numpy
import tempfile
class MaskSelectorTestCase(unittest.TestCase):
filesToKill = []
def setUp(self):
plugins.loadPlugins()
def test_something(self):
img = numpy.zeros((500,500),dtype='uint8')
wrapper = imag... | [
"unittest.main",
"maskgen.image_wrap.openImageFile",
"os.remove",
"maskgen.plugins.loadPlugins",
"maskgen.image_wrap.ImageWrapper",
"numpy.zeros",
"os.path.exists",
"maskgen.plugins.callPlugin",
"tempfile.mktemp",
"numpy.prod"
] | [((1488, 1503), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1501, 1503), False, 'import unittest\n'), ((194, 215), 'maskgen.plugins.loadPlugins', 'plugins.loadPlugins', ([], {}), '()\n', (213, 215), False, 'from maskgen import plugins, image_wrap\n'), ((261, 299), 'numpy.zeros', 'numpy.zeros', (['(500, 500)'],... |
import copy
import math
import numpy as np
from astropy import units as u
from astropy.coordinates import SkyCoord
################################
# Functions for locating the SN.
################################
# Function that takes in the latitude and longitude (in degrees) and returns the (x,y,z) coordinates
#... | [
"math.atan",
"math.sqrt",
"math.radians",
"numpy.empty",
"numpy.cross",
"copy.copy",
"math.sin",
"math.acos",
"numpy.linalg.norm",
"numpy.array",
"numpy.linspace",
"math.cos",
"numpy.dot",
"astropy.coordinates.SkyCoord"
] | [((775, 794), 'numpy.array', 'np.array', (['[x, y, z]'], {}), '([x, y, z])\n', (783, 794), True, 'import numpy as np\n'), ((1703, 1724), 'numpy.array', 'np.array', (['[lat, long]'], {}), '([lat, long])\n', (1711, 1724), True, 'import numpy as np\n'), ((1965, 2062), 'math.sqrt', 'math.sqrt', (['(separation_vector[0] ** ... |
import argparse
import pickle
from tqdm import tqdm
from pathlib import Path
import os
import cv2
import numpy as np
import pandas as pd
from collections import defaultdict
from utils.mask_functions import mask2rle, rle_encode
from utils.helpers import load_yaml
def argparser():
parser = argparse.ArgumentParser... | [
"os.mkdir",
"argparse.ArgumentParser",
"pandas.read_csv",
"collections.defaultdict",
"numpy.argsort",
"pathlib.Path",
"pickle.load",
"utils.mask_functions.rle_encode",
"cv2.contourArea",
"cv2.imwrite",
"os.path.exists",
"numpy.transpose",
"numpy.max",
"cv2.drawContours",
"cv2.resize",
... | [((297, 354), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Body Morp pipeline"""'}), "(description='Body Morp pipeline')\n", (320, 354), False, 'import argparse\n'), ((727, 757), 'numpy.zeros', 'np.zeros', (['mask.shape', 'np.uint8'], {}), '(mask.shape, np.uint8)\n', (735, 757), True, ... |
import os
import gc
import time
import torch
import random
import pickle
import numpy as np
import pandas as pd
from tqdm import tqdm
from torch.autograd import Variable
from train_help import *
from multi_task_models import *
import torch
import yaml
with open("./config.yaml") as file:
config = yaml.load(file)
... | [
"yaml.load",
"pickle.dump",
"torch.LongTensor",
"torch.FloatTensor",
"time.time",
"numpy.array",
"torch.cuda.is_available"
] | [((301, 316), 'yaml.load', 'yaml.load', (['file'], {}), '(file)\n', (310, 316), False, 'import yaml\n'), ((784, 809), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (807, 809), False, 'import torch\n'), ((2393, 2418), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2416... |
import numpy as np
def calc_bic(num_params: float, data_size: float, log_likelihood: float) -> float:
return -2 * log_likelihood + num_params * np.log(data_size)
| [
"numpy.log"
] | [((150, 167), 'numpy.log', 'np.log', (['data_size'], {}), '(data_size)\n', (156, 167), True, 'import numpy as np\n')] |
#!/usr/bin/env python
import rospy, cv2, cv_bridge, numpy, math, imutils
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from std_msgs.msg import Int32
from sensor_msgs.msg import Image
from tf.transformations import euler_from_quaternion
from scipy.spatial import distance
from collections import... | [
"cv2.GaussianBlur",
"rospy.Subscriber",
"cv2.bitwise_and",
"cv2.arcLength",
"rospy.Duration.from_sec",
"cv2.erode",
"cv2.imshow",
"cv2.contourArea",
"scipy.spatial.distance.euclidean",
"cv2.cvtColor",
"rospy.Rate",
"rospy.init_node",
"cv2.drawContours",
"cv2.mean",
"cv2.Canny",
"cv2.ci... | [((5949, 5971), 'rospy.init_node', 'rospy.init_node', (['"""cpu"""'], {}), "('cpu')\n", (5964, 5971), False, 'import rospy, cv2, cv_bridge, numpy, math, imutils\n'), ((5984, 5996), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (5994, 5996), False, 'import rospy, cv2, cv_bridge, numpy, math, imutils\n'), ((456, 476), 'c... |
import numpy as np
import pytest
from alibi_detect.cd import MMDDriftOnline
from alibi_detect.cd.pytorch.mmd_online import MMDDriftOnlineTorch
from alibi_detect.cd.tensorflow.mmd_online import MMDDriftOnlineTF
n, n_features = 100, 5
tests_mmddriftonline = ['tensorflow', 'pytorch', 'PyToRcH', 'mxnet']
n_tests = len(te... | [
"alibi_detect.cd.MMDDriftOnline",
"numpy.random.randn"
] | [((626, 659), 'numpy.random.randn', 'np.random.randn', (['*(n, n_features)'], {}), '(*(n, n_features))\n', (641, 659), True, 'import numpy as np\n'), ((1142, 1169), 'numpy.random.randn', 'np.random.randn', (['n_features'], {}), '(n_features)\n', (1157, 1169), True, 'import numpy as np\n'), ((726, 815), 'alibi_detect.cd... |
"""This module contains function solely related to the estimation of the model."""
import shutil
import copy
import os
from statsmodels.tools.eval_measures import rmse as get_rmse
from scipy.optimize import minimize
import pandas as pd
import numpy as np
from trempy.shared.shared_auxiliary import get_optimal_compensa... | [
"trempy.simulate.simulate.simulate",
"os.mkdir",
"copy.deepcopy",
"scipy.optimize.minimize",
"os.remove",
"trempy.shared.shared_auxiliary.get_optimal_compensations",
"os.path.exists",
"trempy.shared.shared_auxiliary.dist_class_attributes",
"pandas.isnull",
"statsmodels.tools.eval_measures.rmse",
... | [((5824, 5847), 'numpy.array', 'np.array', (['m_optimal_obs'], {}), '(m_optimal_obs)\n', (5832, 5847), True, 'import numpy as np\n'), ((8690, 8759), 'trempy.shared.shared_auxiliary.dist_class_attributes', 'dist_class_attributes', (['model_obj', '"""paras_obj"""', '"""questions"""', '"""version"""'], {}), "(model_obj, '... |
import pytest
import numpy as np
import pandas as pd
from metaspace.image_processing import clip_hotspots, colocalization, colocalization_matrix
IMG_A = np.array([[1, 1, 0, 0], [1, 1, 0, 0], [1, 1, 0, 0], [1, 1, 0, 0]])
IMG_B = np.array([[1, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]])
IMG_C = np.array([[0, 0... | [
"pandas.DataFrame",
"metaspace.image_processing.clip_hotspots",
"pandas.testing.assert_frame_equal",
"numpy.ones",
"metaspace.image_processing.colocalization_matrix",
"metaspace.image_processing.colocalization",
"numpy.isclose",
"numpy.array",
"numpy.arange"
] | [((155, 221), 'numpy.array', 'np.array', (['[[1, 1, 0, 0], [1, 1, 0, 0], [1, 1, 0, 0], [1, 1, 0, 0]]'], {}), '([[1, 1, 0, 0], [1, 1, 0, 0], [1, 1, 0, 0], [1, 1, 0, 0]])\n', (163, 221), True, 'import numpy as np\n'), ((230, 296), 'numpy.array', 'np.array', (['[[1, 1, 1, 1], [1, 1, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]]'], {... |
import cv2
from cv2 import aruco
import pdb
import pandas as pd
import numpy as np
from .corner_finder import CornerFinder
from .aruco_corner import ArucoCorner
from .aruco_loc import ArucoLoc
class ArucoHelper:
"""
Helper class with static functions designed to help a user review or debug images with aruco da... | [
"cv2.aruco.getPredefinedDictionary",
"cv2.aruco.DetectorParameters_create",
"pandas.read_csv",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.imread",
"numpy.reshape",
"cv2.imshow"
] | [((553, 574), 'pandas.read_csv', 'pd.read_csv', (['file_loc'], {}), '(file_loc)\n', (564, 574), True, 'import pandas as pd\n'), ((871, 913), 'numpy.reshape', 'np.reshape', (['data[:, 1:9]', '(data_len, 4, 2)'], {}), '(data[:, 1:9], (data_len, 4, 2))\n', (881, 913), True, 'import numpy as np\n'), ((1205, 1226), 'pandas.... |
import logging
from collections import defaultdict
import dataclasses
import numpy as np
import pandas as pd
from scipy import stats
from statsmodels.stats.contingency_tables import Table2x2
from sklearn.cluster import DBSCAN
import pomegranate as pm
from .io import load_model_priors
logger = logging.getLogger('yan... | [
"numpy.absolute",
"numpy.argmax",
"numpy.negative",
"numpy.argmin",
"collections.defaultdict",
"numpy.linalg.svd",
"numpy.exp",
"numpy.diag",
"numpy.round",
"sklearn.cluster.DBSCAN",
"pomegranate.MultivariateGaussianDistribution.from_samples",
"numpy.zeros_like",
"scipy.stats.kstwobign.sf",
... | [((298, 327), 'logging.getLogger', 'logging.getLogger', (['"""yanocomp"""'], {}), "('yanocomp')\n", (315, 327), False, 'import logging\n'), ((571, 608), 'numpy.linalg.svd', 'np.linalg.svd', (['X'], {'full_matrices': '(False)'}), '(X, full_matrices=False)\n', (584, 608), True, 'import numpy as np\n'), ((633, 652), 'nump... |
# -*- coding: utf-8 -*-
"""
DEPRECATED
"""
from __future__ import division, print_function
import numpy as np
from theano import gof
import theano.tensor as tt
__all__ = ["tensordotDOp"]
class tensordotDOp(tt.Op):
def __init__(self, func):
self.func = func
self._grad_op = tensordotDGradientOp(... | [
"theano.tensor.as_tensor_variable",
"numpy.shape",
"theano.gof.Apply",
"theano.tensor.TensorType"
] | [((505, 537), 'theano.gof.Apply', 'gof.Apply', (['self', 'inputs', 'outputs'], {}), '(self, inputs, outputs)\n', (514, 537), False, 'from theano import gof\n'), ((1224, 1256), 'theano.gof.Apply', 'gof.Apply', (['self', 'inputs', 'outputs'], {}), '(self, inputs, outputs)\n', (1233, 1256), False, 'from theano import gof\... |
import numpy as np
from sys import stdout
from sklearn.metrics import pairwise_kernels
def MMD2u(K, m, n):
"""The MMD^2_u unbiased statistic.
"""
Kx = K[:m, :m]
Ky = K[m:, m:]
Kxy = K[:m, m:]
return 1.0 / (m * (m - 1.0)) * (Kx.sum() - Kx.diagonal().sum()) + \
1.0 / (n * (n - 1.0)) * (K... | [
"sklearn.metrics.pairwise_kernels",
"numpy.zeros",
"numpy.random.RandomState",
"sys.stdout.flush",
"numpy.vstack"
] | [((765, 785), 'numpy.zeros', 'np.zeros', (['iterations'], {}), '(iterations)\n', (773, 785), True, 'import numpy as np\n'), ((1459, 1479), 'numpy.zeros', 'np.zeros', (['iterations'], {}), '(iterations)\n', (1467, 1479), True, 'import numpy as np\n'), ((2223, 2240), 'numpy.vstack', 'np.vstack', (['[X, Y]'], {}), '([X, Y... |
import collections
import numpy as np
from scipy import stats
from sklearn import metrics
from optable.synthesis import manipulation
from optable.synthesis import manipulation_candidate
from optable.dataset import feature_types
from optable import _core
class OneHotMeanManipulation(manipulation.Manipulation):
de... | [
"optable._core.Aggregator",
"numpy.isfinite",
"sklearn.metrics.roc_auc_score",
"optable._core.CategoricalManager",
"numpy.unique"
] | [((4077, 4111), 'numpy.isfinite', 'np.isfinite', (['new_data[:train_size]'], {}), '(new_data[:train_size])\n', (4088, 4111), True, 'import numpy as np\n'), ((4252, 4368), 'sklearn.metrics.roc_auc_score', 'metrics.roc_auc_score', (['self.__dataset.target[:train_size][train_isfinite]', 'new_data[:train_size][train_isfini... |
import numpy as np
import sys
import os
import matplotlib.pyplot as plt
sys.path.append(os.path.abspath("../../gunshots"))
sys.path.append(os.path.abspath("../../IoTPy/core"))
sys.path.append(os.path.abspath("../../IoTPy/helper_functions"))
sys.path.append(os.path.abspath("../../IoTPy/agent_types"))
from stream import... | [
"recent_values.recent_values",
"os.path.abspath",
"stream.Stream.scheduler.step",
"numpy.arange",
"numpy.dot",
"stream.Stream"
] | [((89, 122), 'os.path.abspath', 'os.path.abspath', (['"""../../gunshots"""'], {}), "('../../gunshots')\n", (104, 122), False, 'import os\n'), ((140, 175), 'os.path.abspath', 'os.path.abspath', (['"""../../IoTPy/core"""'], {}), "('../../IoTPy/core')\n", (155, 175), False, 'import os\n'), ((193, 240), 'os.path.abspath', ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.