code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import os
import numpy as np
import matplotlib.pyplot as plt
import pyvips as Vips
NP_DTYPE_TO_VIPS_FORMAT = {
np.dtype('int8'): Vips.BandFormat.CHAR,
np.dtype('uint8'): Vips.BandFormat.UCHAR,
np.dtype('int16'): Vips.BandFormat.SHORT,
np.dtype('uint16'): Vips.BandFormat.USHORT,
... | [
"os.path.exists",
"matplotlib.pyplot.get_cmap",
"os.makedirs",
"numpy.max",
"os.path.basename",
"pyvips.Image.dzsave",
"numpy.dtype",
"matplotlib.pyplot.show"
] | [((121, 137), 'numpy.dtype', 'np.dtype', (['"""int8"""'], {}), "('int8')\n", (129, 137), True, 'import numpy as np\n'), ((169, 186), 'numpy.dtype', 'np.dtype', (['"""uint8"""'], {}), "('uint8')\n", (177, 186), True, 'import numpy as np\n'), ((219, 236), 'numpy.dtype', 'np.dtype', (['"""int16"""'], {}), "('int16')\n", (... |
"""
Make a compund path -- in this case two simple polygons, a rectangle
and a triangle. Use CLOSEOPOLY and MOVETO for the different parts of
the compound path
"""
import numpy as np
from matplotlib.path import Path
from matplotlib.patches import PathPatch
import matplotlib.pyplot as plt
vertices = []
codes = []
co... | [
"matplotlib.path.Path",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.patches.PathPatch",
"matplotlib.pyplot.show"
] | [((541, 566), 'numpy.array', 'np.array', (['vertices', 'float'], {}), '(vertices, float)\n', (549, 566), True, 'import numpy as np\n'), ((574, 595), 'matplotlib.path.Path', 'Path', (['vertices', 'codes'], {}), '(vertices, codes)\n', (578, 595), False, 'from matplotlib.path import Path\n'), ((609, 661), 'matplotlib.patc... |
"""
Results generated
0: Number of hospitals
1: Mean time to thrombolysis
2: Max time to thrombolysis
3: Mean time to thrombectomy
4: Maximum time to thrombectomy
5: Minimum thrombolysis admissions to any one hospital
6: Maximum thrombolysis admissions to any one hospital
7: Minimum thrombectomy admissions to ... | [
"numpy.unique",
"pandas.DataFrame",
"numpy.max",
"classes.score.Score_population",
"numpy.sum",
"datetime.datetime.now",
"numpy.vstack",
"classes.pareto.Pareto",
"classes.data.Data",
"classes.score_with_diagnostic.Score_population_with_diagnostic",
"time.time",
"classes.population.Pop"
] | [((2174, 2180), 'classes.data.Data', 'Data', ([], {}), '()\n', (2178, 2180), False, 'from classes.data import Data\n'), ((2200, 2205), 'classes.population.Pop', 'Pop', ([], {}), '()\n', (2203, 2205), False, 'from classes.population import Pop\n'), ((8850, 8896), 'pandas.DataFrame', 'pd.DataFrame', (['self.score.results... |
"""-----------------------------------------------------------------------------
sample.py (Last Updated: 01/26/2021)
The purpose of this script is to actually to run the sample project.
Specifically, it will initiate a call to file watcher that searches for incoming
dicom files, do some sort of analysis based on the... | [
"nibabel.nicom.dicomreaders.mosaic_to_nii",
"scipy.io.savemat",
"rtCommon.imageHandling.convertDicomImgToNifti",
"argparse.ArgumentParser",
"rtCommon.imageHandling.readRetryDicomFromDataInterface",
"rtCommon.dataInterface.DataInterface",
"os.path.join",
"warnings.catch_warnings",
"os.path.realpath",... | [((2594, 2619), 'sys.path.append', 'sys.path.append', (['rootPath'], {}), '(rootPath)\n', (2609, 2619), False, 'import sys\n'), ((3000, 3042), 'os.path.join', 'os.path.join', (['currPath', '"""conf/sample.toml"""'], {}), "(currPath, 'conf/sample.toml')\n", (3012, 3042), False, 'import os\n'), ((1972, 1997), 'warnings.c... |
import numpy as np
from .base_classifier import BaseClassifier
from regex.handlers import CaptureHandler
from collections import defaultdict
class CaptureClassifier(BaseClassifier):
"""Class specialized in capturing information of interest. E.g Country of Birth
"""
def __init__(self, classifier_name="Capt... | [
"numpy.array",
"regex.handlers.CaptureHandler",
"collections.defaultdict"
] | [((413, 429), 'regex.handlers.CaptureHandler', 'CaptureHandler', ([], {}), '()\n', (427, 429), False, 'from regex.handlers import CaptureHandler\n'), ((5639, 5654), 'numpy.array', 'np.array', (['preds'], {}), '(preds)\n', (5647, 5654), True, 'import numpy as np\n'), ((4126, 4142), 'collections.defaultdict', 'defaultdic... |
from rllab.misc import logger
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import os.path as osp
import numpy as np
import math
import random
def line_intersect(pt1, pt2, ptA, ptB):
"""
Taken from https://www.cs.hmc.edu/ACM/lectures/intersections.html
this returns the intersect... | [
"numpy.ones",
"matplotlib.use",
"matplotlib.pyplot.plot",
"os.path.join",
"matplotlib.pyplot.close",
"numpy.array",
"math.cos",
"rllab.misc.logger.get_snapshot_dir",
"math.fabs",
"matplotlib.pyplot.scatter",
"math.sin",
"matplotlib.pyplot.subplots",
"numpy.arange"
] | [((55, 69), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (62, 69), True, 'import matplotlib as mpl\n'), ((15460, 15474), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (15472, 15474), True, 'import matplotlib.pyplot as plt\n'), ((16510, 16537), 'matplotlib.pyplot.scatter', 'plt.scatte... |
'''An example to show how to set up an pommerman game programmatically'''
import pommerman
from pommerman import agents
import numpy as np
from tqdm import tqdm
def main():
'''Simple function to bootstrap a game.
Use this as an example to set up your training env.
'''
# Print all possible en... | [
"numpy.reshape",
"pommerman.make",
"pommerman.agents.DeepQAgent",
"pommerman.agents.SimpleAgent",
"numpy.ravel"
] | [((1211, 1230), 'pommerman.agents.DeepQAgent', 'agents.DeepQAgent', ([], {}), '()\n', (1228, 1230), False, 'from pommerman import agents\n'), ((1394, 1435), 'pommerman.make', 'pommerman.make', (['"""OneVsOne-v0"""', 'agent_list'], {}), "('OneVsOne-v0', agent_list)\n", (1408, 1435), False, 'import pommerman\n'), ((1171,... |
#Written by <NAME>
import numpy as np
import lc3asm
#2^16 16bit memory address's
memory = np.uint16([0]*0xFFFF)
#registers
reg = np.uint16([0]*8)
pc = np.int16(0x0200)
psr = 0xFFFC
halt = True
#special memory ptrs
kbsr_ptr = 0xFE00
kbdr_ptr = 0xFE02
dsr_ptr = 0xFE04
ddr_ptr = 0xFE06
mcr_ptr = 0xFF... | [
"lc3asm.loadFile",
"numpy.int16",
"lc3asm.asm",
"numpy.uint16",
"lc3asm.out.items"
] | [((101, 123), 'numpy.uint16', 'np.uint16', (['([0] * 65535)'], {}), '([0] * 65535)\n', (110, 123), True, 'import numpy as np\n'), ((142, 160), 'numpy.uint16', 'np.uint16', (['([0] * 8)'], {}), '([0] * 8)\n', (151, 160), True, 'import numpy as np\n'), ((165, 178), 'numpy.int16', 'np.int16', (['(512)'], {}), '(512)\n', (... |
import pickle
import pandas as pd
import numpy as np
import xgboost as xgb
from sklearn.feature_extraction import DictVectorizer
from sklearn.model_selection import train_test_split
output_file = 'model.bin'
print('Reading data')
df_raw = pd.read_csv('survey.csv')
print('Wrangling Data')
string_columns = df... | [
"pickle.dump",
"xgboost.train",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.feature_extraction.DictVectorizer",
"numpy.log1p"
] | [((250, 275), 'pandas.read_csv', 'pd.read_csv', (['"""survey.csv"""'], {}), "('survey.csv')\n", (261, 275), True, 'import pandas as pd\n'), ((3187, 3247), 'sklearn.model_selection.train_test_split', 'train_test_split', (['df'], {'test_size': 'prop_test', 'random_state': 'seed'}), '(df, test_size=prop_test, random_state... |
"""
Functions and objects for working with LC-MS data
Objects
-------
Chromatogram
MSSpectrum
Roi
"""
import numpy as np
import pandas as pd
import pyopenms
from scipy.interpolate import interp1d
from typing import Optional, Iterable, Tuple, Union, List, Callable
from . import peaks
from . import validation
import b... | [
"numpy.hstack",
"scipy.interpolate.interp1d",
"numpy.argsort",
"numpy.array",
"numpy.nanmean",
"pyopenms.OnDiscMSExperiment",
"numpy.arange",
"pyopenms.MzMLFile",
"pyopenms.MSExperiment",
"numpy.searchsorted",
"numpy.where",
"numpy.diff",
"numpy.linspace",
"numpy.vstack",
"pandas.DataFra... | [((23814, 23857), 'collections.namedtuple', 'namedtuple', (['"""TempRoi"""', "['mz', 'sp', 'scan']"], {}), "('TempRoi', ['mz', 'sp', 'scan'])\n", (23824, 23857), False, 'from collections import namedtuple\n'), ((3203, 3235), 'numpy.zeros', 'np.zeros', (['(mz.size, end - start)'], {}), '((mz.size, end - start))\n', (321... |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
gmm = __import__('11-gmm').gmm
if __name__ == '__main__':
np.random.seed(11)
a = np.random.multivariate_normal([30, 40], [[75, 5], [5, 75]], size=10000)
b = np.random.multivariate_normal([5, 25], [[16, 10], [10, 16]], size=750)
c... | [
"matplotlib.pyplot.show",
"numpy.random.multivariate_normal",
"numpy.random.seed",
"matplotlib.pyplot.scatter",
"numpy.concatenate",
"numpy.random.shuffle"
] | [((137, 155), 'numpy.random.seed', 'np.random.seed', (['(11)'], {}), '(11)\n', (151, 155), True, 'import numpy as np\n'), ((164, 235), 'numpy.random.multivariate_normal', 'np.random.multivariate_normal', (['[30, 40]', '[[75, 5], [5, 75]]'], {'size': '(10000)'}), '([30, 40], [[75, 5], [5, 75]], size=10000)\n', (193, 235... |
import argparse
import copy
import math
import numpy as np
import pygame
from pygame.locals import *
from timeit import default_timer as timer
import traceback
import os
from minos.lib import common
from minos.config.sim_args import parse_sim_args
from minos.lib.Simulator import Simulator
from minos.lib.util.ActionTrac... | [
"minos.lib.util.VideoWriter.VideoWriter",
"pygame.init",
"pygame.quit",
"math.sqrt",
"time.sleep",
"math.cos",
"copy.copy",
"argparse.ArgumentParser",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.draw.rect",
"minos.lib.util.StateSet.StateSet",
"minos.lib.common.attach_exit_handl... | [((2154, 2204), 'pygame.draw.rect', 'pygame.draw.rect', (['display_surf', '(0, 0, 0)', 'area', '(0)'], {}), '(display_surf, (0, 0, 0), area, 0)\n', (2170, 2204), False, 'import pygame\n'), ((2785, 2829), 'math.sqrt', 'math.sqrt', (['(dir[0] * dir[0] + dir[1] * dir[1])'], {}), '(dir[0] * dir[0] + dir[1] * dir[1])\n', (2... |
from abc import abstractmethod, abstractproperty
import os
from pathlib import Path
import collections.abc
import logging
import pkg_resources
import uuid
from urllib.parse import urlparse
from typing import Set, List
import threading
import numpy as np
from frozendict import frozendict
import pyarrow as pa
import v... | [
"logging.getLogger",
"vaex.encoding.set_object",
"frozendict.frozendict",
"vaex.encoding.register",
"numpy.asanyarray",
"numpy.array",
"vaex.file.fingerprint",
"numpy.ma.isMaskedArray",
"vaex.encoding.set_object_spec",
"vaex.encoding.get_object_spec",
"vaex.array_types.to_numpy",
"pathlib.Path... | [((553, 586), 'logging.getLogger', 'logging.getLogger', (['"""vaex.dataset"""'], {}), "('vaex.dataset')\n", (570, 586), False, 'import logging\n'), ((746, 762), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (760, 762), False, 'import threading\n'), ((905, 933), 'vaex.encoding.register', 'encoding.register', (['... |
import numpy as np
import matplotlib.pyplot as plt
def kalman_xy(x, P, measurement, R,
motion = np.matrix('0. 0. 0. 0.').T,
Q = np.matrix(np.eye(4))):
"""
Parameters:
x: initial state 4-tuple of location and velocity: (x0, x1, x0_dot, x1_dot)
P: initial uncertainty conva... | [
"numpy.eye",
"numpy.random.random",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.matrix",
"matplotlib.pyplot.show"
] | [((2070, 2095), 'numpy.linspace', 'np.linspace', (['(0.0)', '(10.0)', 'N'], {}), '(0.0, 10.0, N)\n', (2081, 2095), True, 'import numpy as np\n'), ((2239, 2277), 'matplotlib.pyplot.plot', 'plt.plot', (['observed_x', 'observed_y', '"""ro"""'], {}), "(observed_x, observed_y, 'ro')\n", (2247, 2277), True, 'import matplotli... |
import os, sys, inspect
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from core.bounds import WSR_mu_plus
from core.concentration import get_tlambda, get_lhat_from_table, get_lhat_from_table_binarysearch
import numpy as np
from scipy.optimize import brentq
from tqdm import tqdm
import pdb
def get_coco_example_l... | [
"core.concentration.get_lhat_from_table_binarysearch",
"core.concentration.get_tlambda",
"os.path.join",
"numpy.argmax",
"numpy.linspace",
"numpy.zeros",
"numpy.concatenate",
"numpy.random.uniform",
"numpy.load",
"numpy.random.shuffle"
] | [((43, 74), 'os.path.join', 'os.path.join', (['sys.path[0]', '""".."""'], {}), "(sys.path[0], '..')\n", (55, 74), False, 'import os, sys, inspect\n'), ((684, 703), 'numpy.load', 'np.load', (['fname_loss'], {}), '(fname_loss)\n', (691, 703), True, 'import numpy as np\n'), ((722, 742), 'numpy.load', 'np.load', (['fname_s... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 19:17:17 2020
@author: djamal
"""
import numpy as np
import struct
import os
#import pandas as pd
class Filetranslation():
def fread(self, fid, n, type):
fmt, nbytes = {'uint8': ('B', 1), 'int16':('h', 2), 'int32':('i', 4), 'float32':('f', 4), 'float64':... | [
"numpy.array",
"os.path.basename",
"numpy.arange"
] | [((3960, 3980), 'numpy.array', 'np.array', (['PackedData'], {}), '(PackedData)\n', (3968, 3980), True, 'import numpy as np\n'), ((4112, 4132), 'numpy.array', 'np.array', (['PackedTime'], {}), '(PackedTime)\n', (4120, 4132), True, 'import numpy as np\n'), ((4210, 4223), 'numpy.arange', 'np.arange', (['NT'], {}), '(NT)\n... |
#!/usr/bin/env python
import numpy as np
import rospy
import tf
import tf_conversions
from math import *
import geometry_msgs.msg
def phoxi_transformation_examples():
# original matrix
T_phoxi = np.array([
[-0.034784670752, 0.873298269909, -0.485942546454, 0.594404677631629],
[0.979858695089... | [
"tf.transformations.euler_from_quaternion",
"tf.transformations.compose_matrix",
"numpy.array",
"tf.transformations.decompose_matrix",
"tf.transformations.concatenate_matrices"
] | [((207, 466), 'numpy.array', 'np.array', (['[[-0.034784670752, 0.873298269909, -0.485942546454, 0.594404677631629], [\n 0.979858695089, -0.065869488303, -0.18851564436, 0.128504467275411], [-\n 0.19663917295, -0.482712484078, -0.853417654714, 1.427249342095321], [\n 0.0, 0.0, 0.0, 1.0]]'], {}), '([[-0.03478467... |
"""
Solver D3Q6 for the advection equation on the 3D-torus
d_t(u) + cx d_x(u) + cy d_y(u) + c_z d_z(u) = 0, t > 0, 0 < x,y,z < 1,
u(t=0,x,y,z) = u0(x,y,z),
u(t,x=0,y,z) = u(t,x=1,y,z) 0 < y,z < 1,
u(t,x,y=0,z) = u(t,x,y=1,z) 0 < x,z < 1,
u(t,x,y,z=0) = u(t,x,y,z=1) 0 < x,y < 1,
the solution is
u(t,x,y,z) = ... | [
"six.moves.range",
"numpy.ones",
"pylbm.Simulation",
"pylbm.H5File",
"sympy.symbols"
] | [((459, 491), 'sympy.symbols', 'sp.symbols', (['"""u, X, Y, Z, lambda"""'], {}), "('u, X, Y, Z, lambda')\n", (469, 491), True, 'import sympy as sp\n'), ((576, 641), 'pylbm.H5File', 'pylbm.H5File', (['sol.domain.mpi_topo', '"""advection"""', '"""./advection"""', 'im'], {}), "(sol.domain.mpi_topo, 'advection', './advecti... |
import numpy as np
import re
import pandas as pd
import networkx as nx
from cloudvolume import CloudVolume, Skeleton
from io import StringIO
import os
from brainlit.utils.util import (
check_type,
check_size,
)
from sklearn.metrics import pairwise_distances_argmin_min
import warnings
class NeuronTrace:
""... | [
"brainlit.utils.util.check_type",
"numpy.array",
"numpy.divide",
"numpy.arange",
"numpy.mean",
"re.split",
"numpy.int64",
"sklearn.metrics.pairwise_distances_argmin_min",
"networkx.DiGraph",
"numpy.concatenate",
"warnings.warn",
"io.StringIO",
"numpy.round",
"cloudvolume.CloudVolume",
"o... | [((2585, 2606), 'brainlit.utils.util.check_type', 'check_type', (['path', 'str'], {}), '(path, str)\n', (2595, 2606), False, 'from brainlit.utils.util import check_type, check_size\n'), ((2704, 2733), 'brainlit.utils.util.check_type', 'check_type', (['read_offset', 'bool'], {}), '(read_offset, bool)\n', (2714, 2733), F... |
"""
Find chessboards in both frames of a stereo feed
"""
import logging
from pathlib import Path
import click
import cv2 as cv
import numpy as np
from rakali import VideoPlayer
from rakali.annotate import add_frame_labels
from rakali.camera.chessboard import ChessboardFinder
from rakali.stereo.reader import StereoCam... | [
"logging.basicConfig",
"logging.getLogger",
"rakali.video.writer.get_stereo_writer",
"cv2.imwrite",
"rakali.VideoPlayer",
"pathlib.Path",
"click.option",
"rakali.video.go",
"numpy.hstack",
"rakali.annotate.add_frame_labels",
"click.version_option",
"rakali.stereo.reader.StereoCamera",
"rakal... | [((403, 443), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (422, 443), False, 'import logging\n'), ((454, 481), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (471, 481), False, 'import logging\n'), ((568, 590), 'click.version_... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import gym
import torch
import time
import numpy as np
import torch.nn as nn
from datetime import datetime, timedelta
from torch.nn import functional as F
from collections import namedtuple
hidden_size =128
batch_size = 100
percentile = ... | [
"numpy.mean",
"torch.nn.ReLU",
"collections.namedtuple",
"torch.nn.CrossEntropyLoss",
"torch.LongTensor",
"time.sleep",
"datetime.datetime.now",
"gym.make",
"numpy.percentile",
"torch.nn.Linear",
"torch.no_grad",
"torch.FloatTensor"
] | [((715, 757), 'collections.namedtuple', 'namedtuple', (['"""Episode"""', "('reward', 'steps')"], {}), "('Episode', ('reward', 'steps'))\n", (725, 757), False, 'from collections import namedtuple\n'), ((764, 810), 'collections.namedtuple', 'namedtuple', (['"""Steps"""', "('observation', 'action')"], {}), "('Steps', ('ob... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from supra.Utils.Classes import Constants
consts = Constants()
def getPressure(z):
p = 10*101.325*np.exp(-0.00012*z)*100
# in Pa
return p
def anglescan(S, phi, theta, z_profile, vfreq, P_amb, wind=True, debug=Tru... | [
"numpy.radians",
"numpy.sqrt",
"matplotlib.pyplot.show",
"numpy.exp",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.isnan",
"numpy.cos",
"numpy.sin",
"supra.Utils.Classes.Constants",
"numpy.seterr",
"mpl_toolkits.mplot3d.Axes3D",
"numpy.arctan"
] | [((145, 156), 'supra.Utils.Classes.Constants', 'Constants', ([], {}), '()\n', (154, 156), False, 'from supra.Utils.Classes import Constants\n'), ((1833, 1848), 'numpy.radians', 'np.radians', (['phi'], {}), '(phi)\n', (1843, 1848), True, 'import numpy as np\n'), ((1861, 1878), 'numpy.radians', 'np.radians', (['theta'], ... |
#!/usr/bin/python3
import numpy as np
class Softmax:
# Converts Arbitrary Values from layers to probabilties
def __init__(self, input_nodes, output_nodes):
self.weights = np.random.randn(input_nodes, output_nodes) / input_nodes
self.biases = np.zeros(output_nodes)
def backprop(self, d_L_d... | [
"numpy.exp",
"numpy.sum",
"numpy.zeros",
"numpy.dot",
"numpy.random.randn"
] | [((268, 290), 'numpy.zeros', 'np.zeros', (['output_nodes'], {}), '(output_nodes)\n', (276, 290), True, 'import numpy as np\n'), ((631, 655), 'numpy.exp', 'np.exp', (['self.last_totals'], {}), '(self.last_totals)\n', (637, 655), True, 'import numpy as np\n'), ((698, 711), 'numpy.sum', 'np.sum', (['t_exp'], {}), '(t_exp)... |
# -*- coding: utf-8 -*-
"""
//////////////////////////////////////////////////////////////////////////////////////////
// Original author: <NAME>
// Github: https://github.com/aritzLizoain
// My personal website: https://aritzlizoain.github.io/
// Description: CNN Image Segmentation
// Copyright 2020, <NAME>.
// Licens... | [
"matplotlib.pyplot.grid",
"numpy.array",
"astropy.utils.data.get_pkg_data_filename",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.style.use",
"mask.get_percentages",
"mask.output_to_label_one_object",
"numpy.squeeze",
"matplotlib.patches.Patch",
"matplotlib.pyplot.title",
"matplotlib.pyplot.le... | [((2433, 2460), 'mask.get_percentages', 'get_percentages', (['all_images'], {}), '(all_images)\n', (2448, 2460), False, 'from mask import get_percentages\n'), ((2976, 3008), 'matplotlib.pyplot.style.use', 'plt.style.use', (['astropy_mpl_style'], {}), '(astropy_mpl_style)\n', (2989, 3008), True, 'import matplotlib.pyplo... |
import tensorflow as tf
import numpy as np
import mnist_data
import vae
""" parameters """
model_no = '299'
IMAGE_SIZE_MNIST = 28
n_hidden = 500
dim_img = IMAGE_SIZE_MNIST**2 # number of pixels for a MNIST image
dim_z = 10
""" build graph """
# input placeholders
x = tf.placeholder(tf.float32, shape=[None, dim_im... | [
"vae.autoencoder_rec_loss",
"tensorflow.InteractiveSession",
"numpy.repeat",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"numpy.asarray",
"numpy.max",
"tensorflow.train.import_meta_graph"
] | [((274, 342), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, dim_img]', 'name': '"""target_img"""'}), "(tf.float32, shape=[None, dim_img], name='target_img')\n", (288, 342), True, 'import tensorflow as tf\n'), ((347, 437), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'sh... |
import numpy
import pandas
from pathlib import Path
def raw_to_dataframe(raw):
data = numpy.frombuffer(raw, dtype='int16')
data = data.reshape((data.size // 4, 4))
df = pandas.DataFrame(data, columns=['t', 'x', 'y', 'z'])
# Center the curve
shift = len(df) // 2 - df['x'].idxmin()
df = df.rein... | [
"numpy.roll",
"pandas.read_csv",
"pathlib.Path",
"pandas.DataFrame",
"numpy.frombuffer"
] | [((92, 128), 'numpy.frombuffer', 'numpy.frombuffer', (['raw'], {'dtype': '"""int16"""'}), "(raw, dtype='int16')\n", (108, 128), False, 'import numpy\n'), ((183, 235), 'pandas.DataFrame', 'pandas.DataFrame', (['data'], {'columns': "['t', 'x', 'y', 'z']"}), "(data, columns=['t', 'x', 'y', 'z'])\n", (199, 235), False, 'im... |
import pandas
from scipy.stats import zscore
from IMLearn.learners import MultivariateGaussian
from IMLearn.utils import split_train_test
from IMLearn.learners.regressors import LinearRegression
from typing import NoReturn, Tuple
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.e... | [
"numpy.mean",
"plotly.graph_objects.Layout",
"pandas.read_csv",
"numpy.asarray",
"IMLearn.learners.regressors.LinearRegression",
"numpy.array",
"plotly.graph_objects.Scatter",
"numpy.random.seed",
"numpy.std",
"pandas.concat",
"IMLearn.learners.MultivariateGaussian"
] | [((1514, 1535), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (1525, 1535), True, 'import pandas as pd\n'), ((3467, 3476), 'numpy.std', 'np.std', (['y'], {}), '(y)\n', (3473, 3476), True, 'import numpy as np\n'), ((4928, 4958), 'numpy.asarray', 'np.asarray', (['test_set[FEATURES]'], {}), '(test_... |
import random
import os
import numpy as np
from typing import List, Tuple, Dict, Set, Optional
def print_grid(grid: list):
for row in grid:
row_str = " ".join([str(el) for el in row])
print(row_str)
def txt_to_grid(file_name, simple_layout=False, use_curr_workspace=False):
if use_curr_works... | [
"os.getcwd",
"GlobalObjs.GraphNX.GridGraph",
"numpy.zeros",
"numpy.random.randint",
"numpy.concatenate",
"os.path.abspath"
] | [((2628, 2654), 'numpy.zeros', 'np.zeros', (['shape'], {'dtype': 'int'}), '(shape, dtype=int)\n', (2636, 2654), True, 'import numpy as np\n'), ((2942, 2990), 'numpy.concatenate', 'np.concatenate', (['[static_grid, rand_grid]'], {'axis': '(1)'}), '([static_grid, rand_grid], axis=1)\n', (2956, 2990), True, 'import numpy ... |
import cv2
import numpy as np
import math
import os
from time import sleep
def prewitt(nome):
imagem = cv2.imread(nome)
imagemNova = cv2.imread(nome)
colunas = imagem.shape[1]
linhas = imagem.shape[0]
sizeMask = 3
flagStop = sizeMask**2
pixelB = 0
pixelG = 0
pixelR = 0
p... | [
"cv2.imwrite",
"math.log10",
"cv2.imread",
"numpy.abs"
] | [((110, 126), 'cv2.imread', 'cv2.imread', (['nome'], {}), '(nome)\n', (120, 126), False, 'import cv2\n'), ((145, 161), 'cv2.imread', 'cv2.imread', (['nome'], {}), '(nome)\n', (155, 161), False, 'import cv2\n'), ((3281, 3328), 'cv2.imwrite', 'cv2.imwrite', (['"""ImagemcomPrewitt.png"""', 'imagemNova'], {}), "('Imagemcom... |
import numpy as np
import pandas as pd
from statsmodels.sandbox.stats.multicomp import multipletests
import regreg.api as rr
from ...api import (randomization,
glm_group_lasso,
multiple_queries)
from ...tests.instance import (gaussian_instance,
lo... | [
"numpy.sqrt",
"numpy.ones",
"regreg.api.l1norm",
"statsmodels.sandbox.stats.multicomp.multipletests",
"numpy.where",
"numpy.diag",
"regreg.api.glm.logistic",
"numpy.sum",
"regreg.api.glm.gaussian",
"numpy.zeros",
"numpy.nonzero",
"numpy.arange"
] | [((3690, 3710), 'numpy.sum', 'np.sum', (['active_union'], {}), '(active_union)\n', (3696, 3710), True, 'import numpy as np\n'), ((1940, 1961), 'regreg.api.glm.gaussian', 'rr.glm.gaussian', (['X', 'y'], {}), '(X, y)\n', (1955, 1961), True, 'import regreg.api as rr\n'), ((2131, 2141), 'numpy.sqrt', 'np.sqrt', (['n'], {})... |
"""Hardware interfaces for triggering"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import sys
import numpy as np
from ._utils import verbose_dec, string_types, logger
class ParallelTrigger(object):
"""Parallel port and dummy triggering support.
.. warning:: When u... | [
"numpy.uint8",
"sys.platform.startswith",
"numpy.binary_repr",
"numpy.any",
"numpy.array",
"parallel.Parallel",
"numpy.arange",
"numpy.atleast_1d"
] | [((6159, 6182), 'numpy.array', 'np.array', (['decimals', 'int'], {}), '(decimals, int)\n', (6167, 6182), True, 'import numpy as np\n'), ((6323, 6344), 'numpy.array', 'np.array', (['n_bits', 'int'], {}), '(n_bits, int)\n', (6331, 6344), True, 'import numpy as np\n'), ((7460, 7482), 'numpy.array', 'np.array', (['binary',... |
#!/usr/bin/env python3
import os
import random
import numpy as np
import pandas as pd
import numpy as np
from numpy.linalg import slogdet
import time
from experiment_runner.experiment_runner_v2 import run_experiments
# from PySSM import Matrix, Vector
from PySSM import RBFKernel
from PySSM import IVM, FastIVM
from... | [
"PySSM.Salsa",
"numpy.sqrt",
"PySSM.SieveStreaming",
"PySSM.RBFKernel",
"PySSM.Random",
"PySSM.Greedy",
"PySSM.IndependentSetImprovement",
"PySSM.FastIVM",
"PySSM.ThreeSieves",
"PySSM.SieveStreamingPP",
"numpy.load",
"sklearn.preprocessing.MinMaxScaler",
"numpy.save",
"experiment_runner.ex... | [((2586, 2658), 'numpy.load', 'np.load', (['"""/home/share/fuerBuschjaeger/threesieves/stream51/stream51.npy"""'], {}), "('/home/share/fuerBuschjaeger/threesieves/stream51/stream51.npy')\n", (2593, 2658), True, 'import numpy as np\n'), ((5077, 5107), 'experiment_runner.experiment_runner_v2.run_experiments', 'run_experi... |
import numpy as np
import scipy.sparse as sp
def get_sparse_mat(a2b, a2idx, b2idx):
n = len(a2idx)
m = len(b2idx)
assoc = np.zeros((n, m))
for a, b_assoc in a2b.iteritems():
if a not in a2idx:
continue
for b in b_assoc:
if b not in b2idx:
continu... | [
"numpy.zeros",
"scipy.sparse.isspmatrix_coo",
"numpy.vstack",
"scipy.sparse.coo_matrix"
] | [((136, 152), 'numpy.zeros', 'np.zeros', (['(n, m)'], {}), '((n, m))\n', (144, 152), True, 'import numpy as np\n'), ((377, 397), 'scipy.sparse.coo_matrix', 'sp.coo_matrix', (['assoc'], {}), '(assoc)\n', (390, 397), True, 'import scipy.sparse as sp\n'), ((460, 488), 'scipy.sparse.isspmatrix_coo', 'sp.isspmatrix_coo', ([... |
from abc import ABC, abstractmethod
from typing import List
import numpy as np
from scipy.stats import t, spearmanr
from scipy.special import erfinv
from chemprop.uncertainty.uncertainty_calibrator import UncertaintyCalibrator
from chemprop.train import evaluate_predictions
class UncertaintyEvaluator(ABC):
"""
... | [
"numpy.abs",
"numpy.mean",
"numpy.sqrt",
"numpy.log",
"numpy.zeros_like",
"scipy.special.erfinv",
"numpy.square",
"numpy.array_split",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.expand_dims",
"scipy.stats.t.var",
"scipy.stats.spearmanr",
"numpy.rec.fromarrays",
"numpy.arange"
] | [((4921, 4938), 'numpy.array', 'np.array', (['targets'], {}), '(targets)\n', (4929, 4938), True, 'import numpy as np\n'), ((4963, 4986), 'numpy.array', 'np.array', (['uncertainties'], {}), '(uncertainties)\n', (4971, 4986), True, 'import numpy as np\n'), ((5814, 5842), 'numpy.array', 'np.array', (['targets'], {'dtype':... |
"""
Classes for preprocessing input data in various contexts.
:author: <NAME> (<EMAIL>)
:author: <NAME> (<EMAIL>)
:author: <NAME> (<EMAIL>)
:organization: ETS
"""
import logging
import re
import warnings
import numpy as np
import pandas as pd
from collections import defaultdict
from numpy.random import RandomStat... | [
"numpy.isclose",
"re.compile",
"pandas.merge",
"logging.warning",
"logging.info",
"numpy.array",
"numpy.errstate",
"numpy.rint",
"pandas.to_numeric",
"numpy.isnan",
"numpy.std",
"pandas.DataFrame",
"numpy.isinf",
"pandas.concat",
"numpy.random.RandomState"
] | [((6204, 6244), 'pandas.DataFrame', 'pd.DataFrame', (["{'feature': feature_names}"], {}), "({'feature': feature_names})\n", (6216, 6244), True, 'import pandas as pd\n'), ((12767, 12794), 'pandas.DataFrame', 'pd.DataFrame', (['feature_specs'], {}), '(feature_specs)\n', (12779, 12794), True, 'import pandas as pd\n'), ((1... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | [
"datasets.SplitGenerator",
"xml.etree.ElementTree.parse",
"datasets.Version",
"numpy.argsort",
"numpy.array",
"os.path.isfile",
"datasets.logging.get_logger",
"datasets.Value",
"datasets.Features"
] | [((779, 816), 'datasets.logging.get_logger', 'datasets.logging.get_logger', (['__name__'], {}), '(__name__)\n', (806, 816), False, 'import datasets\n'), ((13623, 13638), 'numpy.argsort', 'np.argsort', (['key'], {}), '(key)\n', (13633, 13638), True, 'import numpy as np\n'), ((12510, 12704), 'datasets.SplitGenerator', 'd... |
"""HPO script."""
import argparse
import logging
import pathlib
import random as rn
import sys
from enum import Enum
from typing import Any, Mapping, Tuple
import numpy as np
import torch
from ray import tune
from sklearn.metrics import mean_absolute_error, mean_squared_error
from nlkda.data.base import DatasetEnum, ... | [
"logging.getLogger",
"logging.StreamHandler",
"nlkda.eval.get_model_size",
"nlkda.models.base.FormulationWrapperEnum",
"sys.exc_info",
"torch.cuda.is_available",
"nlkda.models.utils.ModelEnum",
"torch.random.manual_seed",
"nlkda.utils.tune_bool",
"nlkda.utils.enum_values",
"argparse.ArgumentPars... | [((969, 1011), 'nlkda.utils.tune_q_log_uniform', 'tune_q_log_uniform', ([], {'low': '(1)', 'high': '(n * k)', 'q': '(1)'}), '(low=1, high=n * k, q=1)\n', (987, 1011), False, 'from nlkda.utils import MLFlowClient, enum_values, flatten_dict, save_to_file, tune_bool, tune_enum, tune_q_log_uniform\n'), ((2592, 2619), 'logg... |
import hydra
import hydra.utils as utils
from pathlib import Path
import torch
import numpy as np
from tqdm import tqdm
import soundfile as sf
from model_encoder import Encoder, Encoder_lf0
from model_decoder import Decoder_ac
from model_encoder import SpeakerEncoder as Encoder_spk
import os
import random
from glob... | [
"numpy.log",
"hydra.utils.to_absolute_path",
"torch.cuda.is_available",
"spectrogram.logmelspectrogram",
"model_encoder.SpeakerEncoder",
"resampy.resample",
"numpy.mean",
"hydra.main",
"model_encoder.Encoder",
"subprocess.call",
"glob.glob",
"numpy.abs",
"random.choice",
"numpy.nonzero",
... | [((1921, 1966), 'hydra.main', 'hydra.main', ([], {'config_path': '"""config/convert.yaml"""'}), "(config_path='config/convert.yaml')\n", (1931, 1966), False, 'import hydra\n'), ((751, 768), 'soundfile.read', 'sf.read', (['wav_path'], {}), '(wav_path)\n', (758, 768), True, 'import soundfile as sf\n'), ((1035, 1156), 'sp... |
import numpy as np
from nms import nms
import cfg
from shapely.geometry import Polygon
class Averager(object):
"""Compute average for torch.Tensor, used for loss average."""
def __init__(self):
self.reset()
def add(self, v):
count = v.data.numel()
v = v.data.sum()
self.n_... | [
"numpy.amin",
"numpy.where",
"numpy.argsort",
"numpy.array",
"shapely.geometry.Polygon",
"numpy.sum",
"numpy.zeros",
"nms.nms",
"numpy.exp",
"numpy.greater_equal"
] | [((1223, 1233), 'shapely.geometry.Polygon', 'Polygon', (['g'], {}), '(g)\n', (1230, 1233), False, 'from shapely.geometry import Polygon\n'), ((1246, 1256), 'shapely.geometry.Polygon', 'Polygon', (['p'], {}), '(p)\n', (1253, 1256), False, 'from shapely.geometry import Polygon\n'), ((2168, 2187), 'numpy.zeros', 'np.zeros... |
import numpy as np
from sklearn.utils import class_weight
from sklearn.metrics import accuracy_score
from sklearn.model_selection import KFold
from sklearn.base import clone
import optuna
from pathlib import Path
import os
class Objective:
def __init__(self, classifier, parameter_distributions, cv, x, y, class_... | [
"numpy.unique",
"pathlib.Path",
"sklearn.base.clone",
"sklearn.utils.class_weight.compute_class_weight",
"numpy.array",
"sklearn.model_selection.KFold",
"sklearn.metrics.accuracy_score",
"optuna.create_study",
"os.remove"
] | [((2589, 2612), 'pathlib.Path', 'Path', (['file_storage_name'], {}), '(file_storage_name)\n', (2593, 2612), False, 'from pathlib import Path\n'), ((2725, 2810), 'optuna.create_study', 'optuna.create_study', ([], {'study_name': 'study_name', 'load_if_exists': '(True)', 'storage': 'storage'}), '(study_name=study_name, lo... |
import numpy as np
from sacred import Ingredient
config_ingredient = Ingredient("cfg")
@config_ingredient.config
def cfg():
# Base configuration
model_config = {"musdb_path" : "/home/daniel/Datasets/MUSDB18", # SET MUSDB PATH HERE, AND SET CCMIXTER PATH IN CCMixter.xml
"estimates_path" : "... | [
"numpy.random.randint",
"sacred.Ingredient"
] | [((70, 87), 'sacred.Ingredient', 'Ingredient', (['"""cfg"""'], {}), "('cfg')\n", (80, 87), False, 'from sacred import Ingredient\n'), ((3676, 3705), 'numpy.random.randint', 'np.random.randint', (['(0)', '(1000000)'], {}), '(0, 1000000)\n', (3693, 3705), True, 'import numpy as np\n')] |
# Reverse photography
##h3D-II sensor size
# 36 * 48 mm, 0.036 x 0.048m
## focal length
# 28mm, 0.028m
## multiplier
# 1.0
from skimage import io
import matplotlib.pyplot as plt
import numpy as np
import cv2
from scipy.spatial import distance
import shapefile as shp
def buildshape(corners, filename):
"""build ... | [
"numpy.hstack",
"numpy.array",
"numpy.sin",
"numpy.genfromtxt",
"numpy.mean",
"numpy.cross",
"numpy.max",
"numpy.vstack",
"numpy.min",
"numpy.arctan",
"numpy.ceil",
"cv2.getPerspectiveTransform",
"numpy.floor",
"skimage.io.imread",
"numpy.cos",
"numpy.savetxt",
"numpy.int",
"cv2.im... | [((9338, 9387), 'numpy.hstack', 'np.hstack', (['[topleft, topright, botright, botleft]'], {}), '([topleft, topright, botright, botleft])\n', (9347, 9387), True, 'import numpy as np\n'), ((9747, 9777), 'numpy.genfromtxt', 'np.genfromtxt', (['trajectory_file'], {}), '(trajectory_file)\n', (9760, 9777), True, 'import nump... |
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import streamlit as st
@st.cache
def infer_dtypes(df):
dtype_dict = dict()
for col_name in df.columns:
series = df[col_name]
dtype_dict[col_name] = 'categorical'
nunique = df[col_name].nunique()
if nuniqu... | [
"streamlit.checkbox",
"plotly.graph_objects.Histogram",
"streamlit.markdown",
"numpy.ones",
"streamlit.container",
"pandas.api.types.is_numeric_dtype",
"streamlit.expander",
"pandas.api.types.is_bool_dtype",
"numpy.append",
"numpy.count_nonzero",
"streamlit.json",
"streamlit.plotly_chart",
"... | [((1833, 1860), 'numpy.ones', 'np.ones', (['num_numerical_cols'], {}), '(num_numerical_cols)\n', (1840, 1860), True, 'import numpy as np\n'), ((1887, 1942), 'numpy.append', 'np.append', (['numerical_cols_spec', '[chart_col_width_scale]'], {}), '(numerical_cols_spec, [chart_col_width_scale])\n', (1896, 1942), True, 'imp... |
"""Pareto tail indices plot."""
import matplotlib.pyplot as plt
from matplotlib.colors import to_rgba_array
import matplotlib.cm as cm
import numpy as np
from xarray import DataArray
from .plot_utils import (
_scale_fig_size,
get_coords,
color_from_dim,
format_coords_as_labels,
get_plotting_functio... | [
"matplotlib.colors.to_rgba_array",
"numpy.full",
"numpy.arange"
] | [((5047, 5071), 'numpy.arange', 'np.arange', (['n_data_points'], {}), '(n_data_points)\n', (5056, 5071), True, 'import numpy as np\n'), ((6060, 6080), 'matplotlib.colors.to_rgba_array', 'to_rgba_array', (['color'], {}), '(color)\n', (6073, 6080), False, 'from matplotlib.colors import to_rgba_array\n'), ((5962, 5991), '... |
''' Agents: stop/random/shortest/seq2seq '''
import json
import sys
import numpy as np
import random
from collections import namedtuple
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.distributions as D
from utils import vocab_pad_idx, vocab_eos_id... | [
"itertools.chain",
"torch.nn.CrossEntropyLoss",
"torch.distributions.Categorical",
"torch.LongTensor",
"utils.flatten",
"torch.from_numpy",
"numpy.array",
"sys.exit",
"torch.nn.functional.softmax",
"numpy.arange",
"numpy.concatenate",
"torch.autograd.Variable",
"collections.namedtuple",
"h... | [((578, 756), 'collections.namedtuple', 'namedtuple', (['"""InferenceState"""', '"""prev_inference_state, world_state, observation, flat_index, last_action, last_action_embedding, action_count, score, h_t, c_t, last_alpha"""'], {}), "('InferenceState',\n 'prev_inference_state, world_state, observation, flat_index, l... |
import os
import math
import ffmpeg
import numpy as np
from vispy import scene, app, io, geometry
from vispy.color import Color
from vispy.visuals import transforms
from vispy.scene.cameras import TurntableCamera
from .. import util as util
CF_MESH_PATH = os.path.join(os.path.dirname(__file__), "crazyflie2.obj.gz")... | [
"vispy.scene.visuals.Line",
"numpy.eye",
"numpy.ones",
"vispy.scene.cameras.TurntableCamera",
"vispy.visuals.transforms.MatrixTransform",
"numpy.array",
"os.path.dirname",
"vispy.scene.visuals.XYZAxis",
"numpy.zeros",
"vispy.io.read_mesh",
"vispy.geometry.create_sphere",
"numpy.dot",
"vispy.... | [((778, 805), 'vispy.color.Color', 'Color', (['"""#11FF22"""'], {'alpha': '(0.1)'}), "('#11FF22', alpha=0.1)\n", (783, 805), False, 'from vispy.color import Color\n'), ((835, 862), 'vispy.color.Color', 'Color', (['"""#FF0000"""'], {'alpha': '(0.1)'}), "('#FF0000', alpha=0.1)\n", (840, 862), False, 'from vispy.color imp... |
import scipy.integrate as intg
import numpy as np
import matplotlib.pyplot as plt
#Physical Constants
#Everything is in MKS units
h = 6.6261e-34 #Planck constant [J/s]
kB = 1.3806e-23 #Boltzmann constant [J/K]
c = 299792458.0 #Speed of light [m/s]
PI = np.pi #Pi
eps0 = 8.85e-12 #Vacuum Permitivity
rho=2.417e-8 ... | [
"numpy.trapz",
"numpy.sqrt",
"numpy.power",
"numpy.exp",
"numpy.cos"
] | [((1028, 1049), 'numpy.trapz', 'np.trapz', (['spec', 'freqs'], {}), '(spec, freqs)\n', (1036, 1049), True, 'import numpy as np\n'), ((1401, 1412), 'numpy.cos', 'np.cos', (['chi'], {}), '(chi)\n', (1407, 1412), True, 'import numpy as np\n'), ((1438, 1471), 'numpy.sqrt', 'np.sqrt', (['(4 * PI * eps0 * rho * nu)'], {}), '... |
import pickle
import pathlib
import numpy as np
from bci3wads.utils import constants
class Epoch:
def __init__(self, signals, flashing, stimulus_codes, stimulus_types,
target_char):
self.n_channels = signals.shape[1]
self.signals = signals
self.flashing = flashing
... | [
"pickle.dump",
"numpy.unique",
"pathlib.Path",
"pickle.load",
"numpy.array",
"numpy.nonzero",
"bci3wads.utils.constants.INTER_DATA_PATH.joinpath"
] | [((920, 983), 'numpy.array', 'np.array', (['[channel_signals[i:i + window_size] for i in indices]'], {}), '([channel_signals[i:i + window_size] for i in indices])\n', (928, 983), True, 'import numpy as np\n'), ((1664, 1719), 'numpy.array', 'np.array', (['[samples[position] for position in positions]'], {}), '([samples[... |
'''
Unit test of the wrapper for the connected ls mask creation c++ code
Created on May 25, 2016
@author: thomasriddick
'''
import unittest
import numpy as np
from Dynamic_HD_Scripts.interface.cpp_interface.libs \
import create_connected_lsmask_wrapper as cc_lsmask_wrapper #@UnresolvedImport
class Test(unittes... | [
"unittest.main",
"numpy.asarray",
"Dynamic_HD_Scripts.interface.cpp_interface.libs.create_connected_lsmask_wrapper.create_connected_ls_mask",
"numpy.testing.assert_array_equal"
] | [((5148, 5163), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5161, 5163), False, 'import unittest\n'), ((466, 842), 'numpy.asarray', 'np.asarray', (['[[0, 0, 1, 0, 1, 1, 0, 1, 0, 1], [1, 0, 0, 0, 0, 1, 0, 1, 1, 1], [0, 0, 0, \n 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 0, 1, 0, 0, 1, 1, 1], [0, 0, 0, 1, 0, 0,\n 0, ... |
import sys
from typing import Collection, Tuple, Optional
import numba
import pandas as pd
import numpy as np
from numpy import linalg as la
from scipy.sparse import issparse
from anndata import AnnData
from .. import logging as logg
from ..utils import sanitize_anndata
def _design_matrix(
model: pd.DataFram... | [
"numpy.sqrt",
"numpy.ones",
"scipy.sparse.issparse",
"numpy.any",
"numpy.array",
"numpy.dot",
"numpy.sum",
"numpy.isnan",
"pandas.DataFrame",
"pandas.concat"
] | [((3100, 3151), 'numpy.dot', 'np.dot', (['(n_batches / n_array).T', 'B_hat[:n_batch, :]'], {}), '((n_batches / n_array).T, B_hat[:n_batch, :])\n', (3106, 3151), True, 'import numpy as np\n'), ((3949, 4009), 'pandas.DataFrame', 'pd.DataFrame', (['s_data'], {'index': 'data.index', 'columns': 'data.columns'}), '(s_data, i... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Fuzz test for LlvmEnv.validate()."""
import numpy as np
import pytest
from compiler_gym.envs import LlvmEnv
from compiler_gym.errors import... | [
"numpy.testing.assert_array_almost_equal",
"tests.pytest_plugins.random_util.apply_random_trajectory",
"numpy.testing.assert_almost_equal",
"tests.test_main.main",
"pytest.mark.timeout"
] | [((580, 604), 'pytest.mark.timeout', 'pytest.mark.timeout', (['(600)'], {}), '(600)\n', (599, 604), False, 'import pytest\n'), ((1132, 1228), 'tests.pytest_plugins.random_util.apply_random_trajectory', 'apply_random_trajectory', (['env'], {'random_trajectory_length_range': 'RANDOM_TRAJECTORY_LENGTH_RANGE'}), '(env, ran... |
########################################################################################################
## pyFAST - Fingerprint and Similarity Thresholding in python
##
## <NAME>
## 11/14/2016
##
## (see Yoon et. al. 2015, Sci. Adv. for algorithm details)
##
############################################################... | [
"numpy.mean",
"numpy.median",
"numpy.reshape",
"pywt.wavedec2",
"pywt.Wavelet",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.sign",
"scipy.misc.imresize",
"numpy.std",
"numpy.concatenate",
"numpy.shape"
] | [((4642, 4655), 'numpy.shape', 'np.shape', (['Sxx'], {}), '(Sxx)\n', (4650, 4655), True, 'import numpy as np\n'), ((4770, 4810), 'numpy.zeros', 'np.zeros', (['[nWindows, nFreq, self.fp_len]'], {}), '([nWindows, nFreq, self.fp_len])\n', (4778, 4810), True, 'import numpy as np\n'), ((4975, 5000), 'numpy.shape', 'np.shape... |
import cv2 as cv
import matplotlib.pyplot as plt
import numpy as np
def show_image(image_path,type = "matplotlib"):
image = cv.imread(image_path, 0)
if type == "cv":
cv.imshow("original",image)
cv.waitKey(0)
cv.destroyWindow()
else:
plt.imshow(image,cmap = 'gray', interpola... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.xticks",
"cv2.destroyWindow",
"cv2.line",
"cv2.imshow",
"numpy.zeros",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"matplotlib.pyplot.yticks",
"cv2.cvtColor",
"cv2.imread",
"matplotlib.pyplot.show"
] | [((130, 154), 'cv2.imread', 'cv.imread', (['image_path', '(0)'], {}), '(image_path, 0)\n', (139, 154), True, 'import cv2 as cv\n'), ((435, 453), 'cv2.VideoCapture', 'cv.VideoCapture', (['(0)'], {}), '(0)\n', (450, 453), True, 'import cv2 as cv\n'), ((689, 711), 'cv2.destroyAllWindows', 'cv.destroyAllWindows', ([], {}),... |
import sys
import csv
from matplotlib import image as mpimg
import numpy as np
import scipy.misc
import cv2
vert_filename = sys.argv[1]
edge_filename = sys.argv[2]
img_filename = sys.argv[3]
output_img_filename = sys.argv[4]
thresh = int(sys.argv[5])
print('reading in verts...')
verts = []
with open(vert_filename, '... | [
"cv2.imwrite",
"matplotlib.image.imread",
"numpy.asarray",
"csv.reader"
] | [((815, 841), 'matplotlib.image.imread', 'mpimg.imread', (['img_filename'], {}), '(img_filename)\n', (827, 841), True, 'from matplotlib import image as mpimg\n'), ((986, 1004), 'numpy.asarray', 'np.asarray', (['output'], {}), '(output)\n', (996, 1004), True, 'import numpy as np\n'), ((1662, 1702), 'cv2.imwrite', 'cv2.i... |
from __future__ import (division, print_function, absolute_import)
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import scipy.integrate as integrate
import scipy.optimize as optimize
from datetime import datetime
from elecsus.goal_functions import *
import time
import sys... | [
"numpy.radians",
"time.clock",
"scipy.optimize.differential_evolution",
"numpy.argmax",
"numpy.array",
"numpy.linspace",
"numpy.dot",
"numpy.array_equal",
"numpy.cos",
"numpy.concatenate",
"numpy.sin",
"elecsus.elecsus_methods_NEW.calculate",
"numpy.round"
] | [((1844, 1863), 'numpy.array', 'np.array', (['[1, 0, 0]'], {}), '([1, 0, 0])\n', (1852, 1863), True, 'import numpy as np\n'), ((2152, 2179), 'numpy.array', 'np.array', (['(J_out * E_out[:2])'], {}), '(J_out * E_out[:2])\n', (2160, 2179), True, 'import numpy as np\n'), ((5867, 5895), 'numpy.round', 'np.round', (['params... |
import tensorflow as tf
import numpy as np
def batches(l, n):
"""Yield successive n-sized batches from l, the last batch is the left indexes."""
for i in range(0, l, n):
yield range(i,min(l,i+n))
class Deep_Autoencoder(object):
def __init__(self, sess, input_dim_list=[7,64,64,7],transfer_function... | [
"numpy.sqrt",
"tensorflow.transpose",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.random_uniform",
"numpy.negative",
"tensorflow.matmul",
"tensorflow.subtract",
"tensorflow.train.AdamOptimizer"
] | [((1466, 1518), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, self.dim_list[0]]'], {}), '(tf.float32, [None, self.dim_list[0]])\n', (1480, 1518), True, 'import tensorflow as tf\n'), ((2317, 2350), 'tensorflow.global_variables_initializer', 'tf.global_variables_initializer', ([], {}), '()\n', (2348... |
import random
random.seed(666)
import dynet as dy
import numpy as np
np.random.seed(666)
import heapq
from utils.helper import *
class LSTMDecoder(object):
def __init__(self, model, x_dims, h_dims, ccg_dims, LSTMBuilder, n_tag):
pc = model.add_subcollection()
input_dim = x_dims + ccg_dims
#... | [
"dynet.pickneglogsoftmax_batch",
"dynet.lookup_batch",
"dynet.inputTensor",
"numpy.array",
"dynet.esum",
"dynet.pick_batch",
"dynet.cmult",
"dynet.softmax",
"numpy.random.binomial",
"numpy.reshape",
"numpy.max",
"numpy.exp",
"numpy.random.seed",
"dynet.concatenate_cols",
"numpy.argmax",
... | [((14, 30), 'random.seed', 'random.seed', (['(666)'], {}), '(666)\n', (25, 30), False, 'import random\n'), ((69, 88), 'numpy.random.seed', 'np.random.seed', (['(666)'], {}), '(666)\n', (83, 88), True, 'import numpy as np\n'), ((1234, 1287), 'numpy.reshape', 'np.reshape', (['masks_batch', '(mask_dim[0] * mask_dim[1],)']... |
# %% Packages
import os
os.chdir('/Users/czarrar/Dropbox/Circle/Jerb/recipe_rec/scripts')
import recipe_rec
import importlib
recipe_rec = importlib.reload(recipe_rec)
# %% Read in ingredients
recipe_file = '../data/30_ingredients+ave_ratings.csv'
recs = recipe_rec.RecipeRec()
recs.load_from_csv(recipe_file, index_col... | [
"recipe_rec.RecipeRec",
"os.chdir",
"importlib.reload",
"numpy.all",
"recipe_rec.RecipeRec.load_model"
] | [((24, 89), 'os.chdir', 'os.chdir', (['"""/Users/czarrar/Dropbox/Circle/Jerb/recipe_rec/scripts"""'], {}), "('/Users/czarrar/Dropbox/Circle/Jerb/recipe_rec/scripts')\n", (32, 89), False, 'import os\n'), ((139, 167), 'importlib.reload', 'importlib.reload', (['recipe_rec'], {}), '(recipe_rec)\n', (155, 167), False, 'impo... |
# import packages here
import copy
import cv2
import numpy as np
import matplotlib.pyplot as plt
import glob
import random
import time
import torch
import torchvision
import torchvision.transforms as transforms
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
# my imports
fro... | [
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"numpy.hstack",
"torch.LongTensor",
"torch.max",
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"matplotlib.pyplot.imshow",
"torch.nn.BatchNorm2d",
"numpy.flip",
"numpy.reshape",
"torch.set_grad_enabled",
"numpy.asarray",
"n... | [((7361, 7367), 'time.time', 'time', ([], {}), '()\n', (7365, 7367), False, 'from time import time\n'), ((7465, 7471), 'time.time', 'time', ([], {}), '()\n', (7469, 7471), False, 'from time import time\n'), ((11884, 11890), 'time.time', 'time', ([], {}), '()\n', (11888, 11890), False, 'from time import time\n'), ((1196... |
from time import time
import os
from random import gauss
import sys
import numpy as np
from keras.models import Sequential, load_model
from keras.layers import Dense, Activation
from Bio.SeqIO import SeqRecord
from Bio import SeqIO, Seq
from advntr.sam_utils import get_id_of_reads_mapped_to_vntr_in_bamfile, make_bam... | [
"blast_wrapper.get_blast_matched_ids",
"advntr.sam_utils.get_id_of_reads_mapped_to_vntr_in_bamfile",
"Bio.Seq.Seq",
"numpy.array",
"advntr.advntr_commands.get_tested_vntrs",
"keras.layers.Activation",
"keras.layers.Dense",
"os.path.exists",
"Bio.SeqIO.write",
"advntr.models.load_unique_vntrs_data"... | [((3485, 3502), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (3496, 3502), False, 'import random\n'), ((5971, 6039), 'blast_wrapper.make_blast_database', 'make_blast_database', (['fasta_file', "(blast_dir + 'blast_db_%s' % vntr_id)"], {}), "(fasta_file, blast_dir + 'blast_db_%s' % vntr_id)\n", (5990, 6039)... |
from tensorflow.keras.models import load_model
from time import sleep
from keras.preprocessing.image import img_to_array
from keras.preprocessing import image
import cv2
import numpy as np
import os
from mtcnn import MTCNN
# Importing the MTCNN detector to detect faces
detector = MTCNN()
# Path to the emotion detecti... | [
"cv2.rectangle",
"keras.preprocessing.image.img_to_array",
"mtcnn.MTCNN",
"os.path.join",
"cv2.putText",
"numpy.sum",
"tensorflow.keras.models.load_model",
"cv2.VideoCapture",
"cv2.VideoWriter_fourcc",
"cv2.cvtColor",
"numpy.expand_dims",
"cv2.resize"
] | [((282, 289), 'mtcnn.MTCNN', 'MTCNN', ([], {}), '()\n', (287, 289), False, 'from mtcnn import MTCNN\n'), ((342, 381), 'os.path.join', 'os.path.join', (['"""model"""', '"""accuracy_80.h5"""'], {}), "('model', 'accuracy_80.h5')\n", (354, 381), False, 'import os\n'), ((393, 415), 'tensorflow.keras.models.load_model', 'loa... |
"""Drug Response Predictor
@author: <NAME>
This module centralizes the domain adaptation strategy towards biology-aware drug response
prediction on in-vivo dataset.
Example
-------
Examples are given in the vignettes.
Notes
-------
Examples are given in the vignette
References
-------
[1] <NAME>., <NAME>., ... | [
"scipy.stats.pearsonr",
"precise.pipeline_routine.FlowProjector",
"sklearn.linear_model.ElasticNet",
"precise.pipeline_routine.GeodesicMatrixComputer",
"numpy.memmap",
"sklearn.linear_model.Ridge",
"sklearn.preprocessing.StandardScaler",
"numpy.array",
"numpy.zeros",
"precise.intermediate_factors.... | [((6854, 6946), 'precise.principal_vectors.PVComputation', 'PVComputation', (['self.n_factors', 'self.n_pv', 'self.dim_reduction', 'self.dim_reduction_target'], {}), '(self.n_factors, self.n_pv, self.dim_reduction, self.\n dim_reduction_target)\n', (6867, 6946), False, 'from precise.principal_vectors import PVComput... |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without... | [
"numpy.testing.assert_allclose",
"pytest.raises"
] | [((1428, 1466), 'numpy.testing.assert_allclose', 'assert_allclose', (['Ts_sums_calc', 'Ts_sums'], {}), '(Ts_sums_calc, Ts_sums)\n', (1443, 1466), False, 'from numpy.testing import assert_allclose\n'), ((1658, 1702), 'numpy.testing.assert_allclose', 'assert_allclose', (['diffs_sums_calc', 'diffs_sums'], {}), '(diffs_sum... |
"""Generate coil geometries.
This module provides functions to generate various coil geometries
that can be used in conjuction with the eppy module to calculate eddy
currents in flat plates.
"""
import numpy as np
import numpy.typing as npt
# ----------------------------------------------------------------------
#... | [
"numpy.tile",
"numpy.ceil",
"numpy.sqrt",
"numpy.cross",
"numpy.hstack",
"numpy.column_stack",
"numpy.array",
"numpy.zeros",
"numpy.linspace",
"numpy.empty",
"numpy.cos",
"numpy.dot",
"numpy.linalg.norm",
"numpy.sin",
"numpy.vstack"
] | [((1045, 1067), 'numpy.array', 'np.array', (['[start, end]'], {}), '([start, end])\n', (1053, 1067), True, 'import numpy as np\n'), ((1079, 1095), 'numpy.array', 'np.array', (['[0, 1]'], {}), '([0, 1])\n', (1087, 1095), True, 'import numpy as np\n'), ((1129, 1156), 'numpy.linalg.norm', 'np.linalg.norm', (['(end - start... |
from setuptools import setup, find_packages, Extension
#######################################
# Prepare list of compiled extensions #
#######################################
extensions = []
# C extension called via ctypes
extensions.append(
Extension(
# "name" defines the location of the compile... | [
"Cython.Build.cythonize",
"numpy.distutils.core.Extension",
"setuptools.find_packages"
] | [((1549, 1577), 'Cython.Build.cythonize', 'cythonize', (['cython_extensions'], {}), '(cython_extensions)\n', (1558, 1577), False, 'from Cython.Build import cythonize\n'), ((253, 470), 'numpy.distutils.core.Extension', 'Extension', ([], {'name': '"""pypkgexample.mymodule_c_with_ctypes.hellofcctyp"""', 'sources': "['pypk... |
'Test of label scope and label exporter'
import numpy as np
from videocore.assembler import qpu, get_label_positions
from videocore.driver import Driver
@qpu
def given_jmp(asm):
mov(ra0, uniform)
mov(r0, 0)
L.entry
jmp(reg=ra0)
nop()
nop()
nop()
iadd(r0, r0, 1)
L.test
iadd... | [
"videocore.driver.Driver",
"videocore.assembler.get_label_positions",
"numpy.all"
] | [((497, 527), 'videocore.assembler.get_label_positions', 'get_label_positions', (['given_jmp'], {}), '(given_jmp)\n', (516, 527), False, 'from videocore.assembler import qpu, get_label_positions\n'), ((709, 717), 'videocore.driver.Driver', 'Driver', ([], {}), '()\n', (715, 717), False, 'from videocore.driver import Dri... |
from __future__ import print_function,division
import os,sys,re
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import h5py
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage import median_filter
from scipy.optimize import leastsq, curve_fit
from scipy.signal import lombscargl... | [
"numpy.log10",
"scipy.ndimage.filters.gaussian_filter",
"numpy.polyfit",
"acor.function",
"numpy.argsort",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.plot",
"numpy.polyval",
"pandas.DataFrame",
"logging.warning",
"numpy.argmax",
"numpy.isnan",
"numpy.atleast_1d",
"scipy.optimize.c... | [((641, 657), 'numpy.atleast_1d', 'np.atleast_1d', (['t'], {}), '(t)\n', (654, 657), True, 'import numpy as np\n'), ((675, 691), 'numpy.atleast_1d', 'np.atleast_1d', (['f'], {}), '(f)\n', (688, 691), True, 'import numpy as np\n'), ((3081, 3108), 'matplotlib.pyplot.plot', 'plt.plot', (['lag', 'ac'], {}), '(lag, ac, **kw... |
import time
import logging
import numpy as np
from supervised.callbacks.callback import Callback
from supervised.exceptions import AutoMLException
from supervised.utils.config import LOG_LEVEL
log = logging.getLogger(__name__)
log.setLevel(LOG_LEVEL)
class TotalTimeConstraint(Callback):
def __init__(self, params... | [
"logging.getLogger",
"time.time",
"numpy.round",
"supervised.exceptions.AutoMLException"
] | [((200, 227), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (217, 227), False, 'import logging\n'), ((727, 738), 'time.time', 'time.time', ([], {}), '()\n', (736, 738), False, 'import time\n'), ((1116, 1127), 'time.time', 'time.time', ([], {}), '()\n', (1125, 1127), False, 'import time\n... |
import numbers
import warnings
from typing import Union
from copy import deepcopy
from abc import ABC, abstractmethod
import torch
import numpy as np
import SimpleITK as sitk
from .. import TypeData, INTENSITY, DATA
from ..data.image import Image
from ..data.subject import Subject
from ..data.dataset import ImagesDat... | [
"torch.rand",
"torch.from_numpy",
"numpy.errstate",
"copy.deepcopy",
"warnings.warn",
"torch.cat"
] | [((2031, 2047), 'copy.deepcopy', 'deepcopy', (['sample'], {}), '(sample)\n', (2039, 2047), False, 'from copy import deepcopy\n'), ((2062, 2086), 'numpy.errstate', 'np.errstate', ([], {'all': '"""raise"""'}), "(all='raise')\n", (2073, 2086), True, 'import numpy as np\n'), ((2361, 2378), 'torch.cat', 'torch.cat', (['imag... |
""" Implements DEIMOS-specific functions, including reading in slitmask design files.
"""
import glob
import re
import os
import numpy as np
import warnings
from scipy import interpolate
from astropy.io import fits
from pypeit import msgs
from pypeit import telescopes
from pypeit.core import parse
from pypeit.core ... | [
"numpy.radians",
"pypeit.par.pypeitpar.PypeItPar",
"pypeit.par.pypeitpar.DetectorPar",
"scipy.interpolate.interp1d",
"numpy.array",
"astropy.io.fits.open",
"numpy.sin",
"pypeit.core.framematch.check_frame_exptime",
"pypeit.core.parse.load_sections",
"pypeit.msgs.error",
"pypeit.spectrographs.opt... | [((919, 948), 'pypeit.telescopes.KeckTelescopePar', 'telescopes.KeckTelescopePar', ([], {}), '()\n', (946, 948), False, 'from pypeit import telescopes\n'), ((9511, 9532), 'pypeit.par.pypeitpar.PypeItPar', 'pypeitpar.PypeItPar', ([], {}), '()\n', (9530, 9532), False, 'from pypeit.par import pypeitpar\n'), ((15945, 16003... |
# tests/artclass/test_train.py
# Test artclass/train.py unit components.
import numpy as np
from artclass import train
def test_find_best_threshold():
y_true = np.array([[1, 0], [0, 1], [0, 0], [1, 1]])
y_prob = np.array([[0.75, 0.25], [0.25, 0.75], [0.25, 0.25], [0.75, 0.75]])
assert train.find_best_th... | [
"numpy.array",
"artclass.train.find_best_threshold"
] | [((168, 210), 'numpy.array', 'np.array', (['[[1, 0], [0, 1], [0, 0], [1, 1]]'], {}), '([[1, 0], [0, 1], [0, 0], [1, 1]])\n', (176, 210), True, 'import numpy as np\n'), ((224, 290), 'numpy.array', 'np.array', (['[[0.75, 0.25], [0.25, 0.75], [0.25, 0.25], [0.75, 0.75]]'], {}), '([[0.75, 0.25], [0.25, 0.75], [0.25, 0.25],... |
import pickle
import numpy as np
import pytest
from sklearn.neighbors._quad_tree import _QuadTree
from sklearn.utils import check_random_state
def test_quadtree_boundary_computation():
# Introduce a point into a quad tree with boundaries not easy to compute.
Xs = []
# check a random case
... | [
"sklearn.utils.check_random_state",
"numpy.isclose",
"pickle.dumps",
"pytest.mark.parametrize",
"numpy.array",
"pickle.loads",
"sklearn.neighbors._quad_tree._QuadTree"
] | [((2471, 2518), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_dimensions"""', '(2, 3)'], {}), "('n_dimensions', (2, 3))\n", (2494, 2518), False, 'import pytest\n'), ((2521, 2567), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""protocol"""', '(0, 1, 2)'], {}), "('protocol', (0, 1, 2))\n", (2... |
# Copyright (c) 2017 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
"nnef_tools.shape_inference.shape_inference.reshape",
"numpy.array",
"nnef_tools.core.utils.inverse_permutation",
"functools.partial",
"nnef_tools.core.utils.key_value_swapped",
"six.iteritems",
"nnef_tools.shape_inference.shape_inference.transpose"
] | [((1003, 1070), 'nnef_tools.core.utils.key_value_swapped', 'utils.key_value_swapped', (['tf_pb_to_tf_py._tf_py_dtype_by_tf_pb_dtype'], {}), '(tf_pb_to_tf_py._tf_py_dtype_by_tf_pb_dtype)\n', (1026, 1070), False, 'from nnef_tools.core import utils\n'), ((6749, 6774), 'six.iteritems', 'six.iteritems', (['converters'], {})... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 :
#
# This script is written to investigate what (if any) mathematical
# relationship exists among the orders that could be used to simplify
# fitting and reduce jitter.
#
# <NAME>
# Created: 2018-05-08
# Last modified: 2018-12-24
#-----... | [
"numpy.sqrt",
"theil_sen.linefit",
"sys.exit",
"copy.deepcopy",
"nres_extraction.TraceIO",
"numpy.arange",
"numpy.abs",
"matplotlib.pyplot.gcf",
"imp.reload",
"os.path.isfile",
"sys.stderr.write",
"matplotlib.pyplot.draw",
"numpy.copy",
"numpy.median",
"os.getenv",
"matplotlib.pyplot.f... | [((2113, 2136), 'imp.reload', 'reload', (['nres_extraction'], {}), '(nres_extraction)\n', (2119, 2136), False, 'from imp import reload\n'), ((2144, 2169), 'nres_extraction.TraceIO', 'nres_extraction.TraceIO', ([], {}), '()\n', (2167, 2169), False, 'import nres_extraction\n'), ((6979, 7002), 'theil_sen.linefit', 'ts.lin... |
"""
This is a wrapper for executing various parallel map routines in a consistent way.
The primary routines are:
work_orders(): Calls a function with args or kwargs.
def _do_work(i, foo=None):
print(i, foo)
results = zap.work_orders([
dict(fn=_do_work, args=(i,), foo=i*10)
... | [
"logging.getLogger",
"os.kill",
"concurrent.futures.thread._threads_queues.clear",
"concurrent.futures.ThreadPoolExecutor",
"os.environ.get",
"multiprocessing.cpu_count",
"random.seed",
"concurrent.futures.as_completed",
"plaster.tools.utils.utils.listi",
"numpy.array",
"psutil.virtual_memory",
... | [((3031, 3058), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (3048, 3058), False, 'import logging\n'), ((3281, 3313), 'os.environ.get', 'os.environ.get', (['"""ZAP_DEBUG_MODE"""'], {}), "('ZAP_DEBUG_MODE')\n", (3295, 3313), False, 'import os\n'), ((7342, 7353), 'multiprocessing.cpu_coun... |
"""Spherical harmonic vector wind computations."""
# Copyright (c) 2012-2016 <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 rig... | [
"spharm.gaussian_lats_wts",
"spharm.Spharmt",
"numpy.ones",
"numpy.linspace",
"numpy.deg2rad",
"numpy.isnan",
"numpy.arange"
] | [((4311, 4371), 'spharm.Spharmt', 'Spharmt', (['nlon', 'nlat'], {'gridtype': 'self.gridtype', 'rsphere': 'rsphere'}), '(nlon, nlat, gridtype=self.gridtype, rsphere=rsphere)\n', (4318, 4371), False, 'from spharm import Spharmt, gaussian_lats_wts\n'), ((8759, 8782), 'spharm.gaussian_lats_wts', 'gaussian_lats_wts', (['nla... |
"""Define networks for dannce."""
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, concatenate, Conv2D, MaxPooling2D
from tensorflow.keras.layers import Conv2DTranspose, Conv3D, Lambda
from tensorflow.keras.layers import MaxPooling3D, Conv3DTranspose
from tensorflow.keras.layers impo... | [
"tensorflow.keras.layers.Conv3D",
"tensorflow.keras.layers.BatchNormalization",
"dannce.engine.ops.InstanceNormalization",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Conv2D",
"dannce.engine.ops.spatial_softmax",
"tensorflow.keras.utils.multi_gpu_model",
"tensorflow.keras.models.Model",
... | [((1283, 1313), 'tensorflow.keras.layers.Input', 'Input', (['(None, None, input_dim)'], {}), '((None, None, input_dim))\n', (1288, 1313), False, 'from tensorflow.keras.layers import Input, concatenate, Conv2D, MaxPooling2D\n'), ((5074, 5104), 'tensorflow.keras.layers.Input', 'Input', (['(None, None, input_dim)'], {}), ... |
import librosa
import numpy as np
import extract_feat as ef
local_config = {
'batch_size': 1,
'eps': 1e-5,
'sample_rate': 22050,
'load_size': 22050*20,
'name_scope': 'SoundNet',
'phase': 'extract',
}
def analyse_sound(path):
x,... | [
"numpy.reshape",
"librosa.get_duration",
"numpy.load",
"extract_feat.extract_feat",
"librosa.load"
] | [((326, 344), 'librosa.load', 'librosa.load', (['path'], {}), '(path)\n', (338, 344), False, 'import librosa\n'), ((354, 377), 'librosa.get_duration', 'librosa.get_duration', (['x'], {}), '(x)\n', (374, 377), False, 'import librosa\n'), ((428, 456), 'numpy.reshape', 'np.reshape', (['x', '[1, -1, 1, 1]'], {}), '(x, [1, ... |
import numpy as np
from system_env import system_models
def random_intelligent_agent(network_hp, system, controller, channels, policy, horizon, epochs, system_noise,
channel_init, channel_transitions):
resources = sum(network_hp['model_quantities'])
action_size = system... | [
"system_env.system_models.BaseNetworkGE",
"numpy.reshape",
"numpy.random.choice",
"numpy.array",
"numpy.zeros",
"numpy.sum"
] | [((347, 384), 'system_env.system_models.BaseNetworkGE', 'system_models.BaseNetworkGE', (['channels'], {}), '(channels)\n', (374, 384), False, 'from system_env import system_models\n'), ((736, 770), 'numpy.zeros', 'np.zeros', (['(resources, action_size)'], {}), '((resources, action_size))\n', (744, 770), True, 'import n... |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# 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, merg... | [
"collections.OrderedDict",
"numpy.array",
"numpy.zeros",
"copy.deepcopy",
"json.load"
] | [((1610, 1651), 'numpy.zeros', 'np.zeros', (['skeleton.reference_frame_length'], {}), '(skeleton.reference_frame_length)\n', (1618, 1651), True, 'import numpy as np\n'), ((3048, 3069), 'numpy.zeros', 'np.zeros', (['(n_j * 4 + 3)'], {}), '(n_j * 4 + 3)\n', (3056, 3069), True, 'import numpy as np\n'), ((3874, 3889), 'num... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
def calc_model(indexes, dt, n_preds, mvals, parvals, mults, heats, heatsinks):
deriv = np.zeros(n_preds)
def dT_dt(j, y):
deriv[:] = 0.0
# Couplings with other nodes
for i in xrange(len(mults)):
... | [
"numpy.zeros"
] | [((175, 192), 'numpy.zeros', 'np.zeros', (['n_preds'], {}), '(n_preds)\n', (183, 192), True, 'import numpy as np\n')] |
import logging
import numpy as np
import sklearn.preprocessing as prep
from sklearn.linear_model import LogisticRegression
from sklearn.svm import LinearSVC
from sklearn.utils import check_random_state
from csrank.objectranking.object_ranker import ObjectRanker
from csrank.tunable import Tunable
from csrank.util impo... | [
"logging.getLogger",
"sklearn.utils.check_random_state",
"sklearn.svm.LinearSVC",
"sklearn.linear_model.LogisticRegression",
"sklearn.preprocessing.StandardScaler",
"numpy.array",
"numpy.sum",
"numpy.append",
"csrank.util.print_dictionary"
] | [((1818, 1846), 'logging.getLogger', 'logging.getLogger', (['"""RankSVM"""'], {}), "('RankSVM')\n", (1835, 1846), False, 'import logging\n'), ((1875, 1907), 'sklearn.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (1893, 1907), False, 'from sklearn.utils import check_random_... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import copy
import torchvision
import torchvision.transforms as transforms
import numpy as np
from PyHessian.pyhessian import hessian # Hessian computation
from ResNet_CIFAR10 import *
fro... | [
"torchvision.datasets.CIFAR100",
"torch.nn.CrossEntropyLoss",
"numpy.sqrt",
"numpy.array",
"torch.cuda.is_available",
"copy.deepcopy",
"argparse.ArgumentParser",
"os.path.isdir",
"os.mkdir",
"torchvision.transforms.ToTensor",
"torchvision.transforms.RandomHorizontalFlip",
"torch.Tensor",
"to... | [((1852, 1924), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Finetuning for verification error"""'}), "(description='Finetuning for verification error')\n", (1875, 1924), False, 'import argparse\n'), ((6082, 6175), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['hessia... |
'''
Created on 29 Mar 2019
@author: ssg37927
'''
from numpy import meshgrid, linspace, concatenate, zeros_like, sqrt, int16
def build_cubemap_vector_array(com, mesh_size=10,
min_radius=200,
max_radius=800,
radial_steps=1000... | [
"numpy.sqrt",
"numpy.linspace",
"numpy.zeros_like",
"numpy.concatenate"
] | [((577, 591), 'numpy.zeros_like', 'zeros_like', (['xt'], {}), '(xt)\n', (587, 591), False, 'from numpy import meshgrid, linspace, concatenate, zeros_like, sqrt, int16\n'), ((1380, 1419), 'numpy.sqrt', 'sqrt', (['(xmap ** 2 + ymap ** 2 + zmap ** 2)'], {}), '(xmap ** 2 + ymap ** 2 + zmap ** 2)\n', (1384, 1419), False, 'f... |
# Keplerian fit configuration file for HIP11915
# 15 Mar 2022
# Packages
import pandas as pd
import os
import numpy as np
import radvel
import astropy.units as u
# Global planetary system and datasets parameters
starname = 'HIP11915'
nplanets = 2
instnames = ['HARPS-A', 'HARPS-B']
ntels = len(instnames... | [
"numpy.median",
"pandas.read_csv",
"radvel.prior.EccentricityPrior",
"radvel.Parameters",
"numpy.array",
"radvel.Parameter",
"radvel.prior.Gaussian"
] | [((512, 620), 'pandas.read_csv', 'pd.read_csv', (['"""https://raw.githubusercontent.com/thiagofst/HIP11915/main/A/HIP11915_A.txt"""'], {'sep': '""","""'}), "(\n 'https://raw.githubusercontent.com/thiagofst/HIP11915/main/A/HIP11915_A.txt'\n , sep=',')\n", (523, 620), True, 'import pandas as pd\n'), ((620, 642), 'n... |
#!/usr/bin/env python
# coding=utf-8
import numpy as np
def information_entropy(x, p):
ret = [0] * (len(x)+1)
for i in range(len(x)):
ret[i] = -p[i] * np.log2(p[i])
result = np.sum(ret[i])
return result
| [
"numpy.sum",
"numpy.log2"
] | [((200, 214), 'numpy.sum', 'np.sum', (['ret[i]'], {}), '(ret[i])\n', (206, 214), True, 'import numpy as np\n'), ((169, 182), 'numpy.log2', 'np.log2', (['p[i]'], {}), '(p[i])\n', (176, 182), True, 'import numpy as np\n')] |
# (c) 2021 <NAME>
import jax.numpy as jnp
import numpy as np
from jax import vmap
from jax.flatten_util import ravel_pytree
from myriad.config import Config, HParams
from myriad.custom_types import Control, Cost, DState, Params, State, Timestep, DStates
from myriad.trajectory_optimizers.base import TrajectoryOptimize... | [
"jax.numpy.zeros",
"jax.numpy.hstack",
"jax.numpy.vstack",
"jax.flatten_util.ravel_pytree",
"numpy.empty",
"numpy.expand_dims",
"myriad.utils.integrate_time_independent",
"jax.numpy.linspace",
"jax.vmap"
] | [((1217, 1262), 'jax.numpy.zeros', 'jnp.zeros', (['(num_intervals + 1, control_shape)'], {}), '((num_intervals + 1, control_shape))\n', (1226, 1262), True, 'import jax.numpy as jnp\n'), ((2191, 2223), 'jax.flatten_util.ravel_pytree', 'ravel_pytree', (['(x_guess, u_guess)'], {}), '((x_guess, u_guess))\n', (2203, 2223), ... |
"""
Missile Defence Game
Building generation, drawing and destruction module.
Copyright (C) 2011-2012 <NAME>.
See LICENSE (GNU GPL version 3 or later).
"""
import numpy
from random import uniform
def generate_city(resolution):
# create a byte array for buildings info
# we will use 0 for e... | [
"numpy.ma.shape",
"numpy.zeros",
"random.uniform"
] | [((356, 391), 'numpy.zeros', 'numpy.zeros', (['resolution', 'numpy.int8'], {}), '(resolution, numpy.int8)\n', (367, 391), False, 'import numpy\n'), ((1365, 1390), 'numpy.ma.shape', 'numpy.ma.shape', (['pixeldata'], {}), '(pixeldata)\n', (1379, 1390), False, 'import numpy\n'), ((458, 471), 'random.uniform', 'uniform', (... |
"""
============
Radian ticks
============
Plot with radians from the basic_units mockup example package.
This example shows how the unit class can determine the tick locating,
formatting and axis labeling.
"""
import numpy as np
from basic_units import radians, degrees, cos
from matplotlib.pyplot import figure, show... | [
"matplotlib.pyplot.figure",
"basic_units.cos",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((381, 389), 'matplotlib.pyplot.figure', 'figure', ([], {}), '()\n', (387, 389), False, 'from matplotlib.pyplot import figure, show\n'), ((565, 571), 'matplotlib.pyplot.show', 'show', ([], {}), '()\n', (569, 571), False, 'from matplotlib.pyplot import figure, show\n'), ((469, 475), 'basic_units.cos', 'cos', (['x'], {}... |
from typing import List, cast
import hither2 as hi
import numpy as np
import spikeextractors as se
import kachery_client as kc
from sortingview.config import job_cache, job_handler
from sortingview.extractors import LabboxEphysSortingExtractor
@hi.function(
'sorting_info', '0.1.3'
)
def sorting_info(sorting_uri):
... | [
"hither2.Job",
"hither2.Config",
"numpy.array",
"hither2.function",
"kachery_client.taskfunction",
"sortingview.extractors.LabboxEphysSortingExtractor"
] | [((246, 282), 'hither2.function', 'hi.function', (['"""sorting_info"""', '"""0.1.3"""'], {}), "('sorting_info', '0.1.3')\n", (257, 282), True, 'import hither2 as hi\n'), ((548, 606), 'kachery_client.taskfunction', 'kc.taskfunction', (['"""sorting_info.3"""'], {'type': '"""pure-calculation"""'}), "('sorting_info.3', typ... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"jax.numpy.abs",
"jax.numpy.nanmedian",
"jax.numpy.log",
"scipy.interpolate.interp1d",
"jax.tree_map",
"numpy.array",
"numpy.linalg.norm",
"jax.numpy.matmul",
"numpy.mean",
"scipy.spatial.transform.Rotation.from_dcm",
"scipy.interpolate.CubicSpline",
"numpy.max",
"jax.tree_util.tree_map",
... | [((1744, 1804), 'functools.partial', 'functools.partial', (['jax.custom_jvp'], {'nondiff_argnums': '(1, 2, 3)'}), '(jax.custom_jvp, nondiff_argnums=(1, 2, 3))\n', (1761, 1804), False, 'import functools\n'), ((1653, 1706), 'jax.numpy.matmul', 'jnp.matmul', (['a', 'b'], {'precision': 'jax.lax.Precision.HIGHEST'}), '(a, b... |
import unittest
from nose.tools import (assert_in, assert_raises, assert_equals)
import logging
import numpy
from sknn.mlp import Regressor as MLPR
from sknn.mlp import Layer as L, Convolution as C
class TestDataAugmentation(unittest.TestCase):
def setUp(self):
self.called = 0
self.value = 1.0
... | [
"nose.tools.assert_raises",
"sknn.mlp.Layer",
"numpy.zeros",
"nose.tools.assert_equals"
] | [((737, 778), 'nose.tools.assert_equals', 'assert_equals', (['a_in.shape[0]', 'self.called'], {}), '(a_in.shape[0], self.called)\n', (750, 778), False, 'from nose.tools import assert_in, assert_raises, assert_equals\n'), ((915, 969), 'nose.tools.assert_raises', 'assert_raises', (['RuntimeError', 'self.nn._fit', 'a_in',... |
# -*- coding: utf-8 -*-
import activation as a
import numpy as np
import forwardpropagate as fp
import copy
def back_propagation(X, y, al, L, parameters, caches,dropout=False):
m = X.shape[1]
grads = {}
da3 = (-np.divide(y, caches["a3"]) + np.divide(1 - y, 1 - caches["a3"]))
dz3 =... | [
"forwardpropagate.cost",
"activation.relu_back",
"activation.sigmoid_back",
"numpy.sum",
"copy.deepcopy",
"forwardpropagate.forward_propagate",
"numpy.divide"
] | [((275, 309), 'numpy.divide', 'np.divide', (['(1 - y)', "(1 - caches['a3'])"], {}), "(1 - y, 1 - caches['a3'])\n", (284, 309), True, 'import numpy as np\n'), ((327, 355), 'activation.sigmoid_back', 'a.sigmoid_back', (["caches['a3']"], {}), "(caches['a3'])\n", (341, 355), True, 'import activation as a\n'), ((440, 474), ... |
#--------------------------------------------------------------------------------
# Authors:
# - <NAME>: <EMAIL>
# - <NAME>: <EMAIL>
#
# MIT License
# Copyright (c) 2021 CORSMAL
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (t... | [
"pybullet.getMatrixFromQuaternion",
"pybullet.computeViewMatrix",
"libs.simulation.ur5.ur5",
"pybullet_data.getDataPath",
"pybullet.setTimeStep",
"pybullet.setGravity",
"math.cos",
"numpy.array",
"pybullet.setPhysicsEngineParameter",
"pybullet.disconnect",
"time.sleep",
"numpy.linalg.norm",
... | [((1742, 1827), 'pybullet.computeProjectionMatrixFOV', 'p.computeProjectionMatrixFOV', ([], {'fov': '(90)', 'aspect': '(1.777777778)', 'nearVal': '(0.01)', 'farVal': '(10)'}), '(fov=90, aspect=1.777777778, nearVal=0.01,\n farVal=10)\n', (1770, 1827), True, 'import pybullet as p\n'), ((1882, 1893), 'os.getcwd', 'os.g... |
import os.path as osp
import random
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal, assert_array_equal
from mmaction.core import (ActivityNetLocalization,
average_recall_at_avg_proposals, confusion_matrix,
get_weighted_score, ... | [
"mmaction.core.average_recall_at_avg_proposals",
"numpy.array",
"numpy.arange",
"numpy.mean",
"numpy.testing.assert_array_almost_equal",
"numpy.int64",
"mmaction.core.mmit_mean_average_precision",
"numpy.delete",
"mmaction.core.top_k_accuracy",
"mmaction.core.mean_class_accuracy",
"numpy.diff",
... | [((739, 795), 'numpy.zeros', 'np.zeros', (['(max_index + 1, max_index + 1)'], {'dtype': 'np.int64'}), '((max_index + 1, max_index + 1), dtype=np.int64)\n', (747, 795), True, 'import numpy as np\n'), ((1057, 1100), 'numpy.delete', 'np.delete', (['confusion_mat', 'del_index'], {'axis': '(0)'}), '(confusion_mat, del_index... |
import numpy as np
import sys
import os
import pytest
from knnFeat import _distance
sys.path.append(os.getcwd())
@pytest.mark.success
def test_distance():
a = np.array([0, 0])
b = np.array([3, 4])
expected = _distance(a, b)
actual = 5
assert expected == actual
| [
"numpy.array",
"knnFeat._distance",
"os.getcwd"
] | [((100, 111), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (109, 111), False, 'import os\n'), ((165, 181), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (173, 181), True, 'import numpy as np\n'), ((190, 206), 'numpy.array', 'np.array', (['[3, 4]'], {}), '([3, 4])\n', (198, 206), True, 'import numpy as np\n'... |
import numpy as np
import os
import pdb
import sys
import time
import pickle
from create_pair_set import create
from mediator import train_mediator, test_mediator
def get_hist(cmt):
cmt = [idx for c in cmt for idx in c]
hist = {}
for i in cmt:
if i == -1:
continue
if i in hist.k... | [
"numpy.ones",
"numpy.unique",
"numpy.where",
"numpy.sort",
"pickle.load",
"os.path.isfile",
"numpy.array",
"mediator.test_mediator",
"multiprocessing.Pool",
"create_pair_set.create",
"mediator.train_mediator",
"numpy.load",
"numpy.save"
] | [((979, 1003), 'multiprocessing.Pool', 'multiprocessing.Pool', (['(16)'], {}), '(16)\n', (999, 1003), False, 'import multiprocessing\n'), ((1241, 1256), 'numpy.array', 'np.array', (['pairs'], {}), '(pairs)\n', (1249, 1256), True, 'import numpy as np\n'), ((1270, 1286), 'numpy.array', 'np.array', (['scores'], {}), '(sco... |
from scipy import stats
from scipy import optimize
from scipy.special import logsumexp
from scipy.cluster import hierarchy
import scipy
import warnings
import numpy as np
import sys
import collections
import operator
import itertools
from time import perf_counter
from datetime import timedelta
from enum import Enum
fr... | [
"numpy.log",
"scipy.stats.beta.logcdf",
"numpy.array",
"scipy.stats.pearsonr",
"operator.itemgetter",
"scipy.special.logsumexp",
"scipy.cluster.hierarchy.fcluster",
"numpy.mean",
"numpy.full_like",
"numpy.where",
"time.perf_counter",
"numpy.max",
"numpy.exp",
"scipy.cluster.hierarchy.linka... | [((16173, 16297), 'collections.namedtuple', 'collections.namedtuple', (['"""_BestCluster"""', '"""cluster_i n_reliable info_content likelihood psv_f_values sample_gt_probs"""'], {}), "('_BestCluster',\n 'cluster_i n_reliable info_content likelihood psv_f_values sample_gt_probs'\n )\n", (16195, 16297), False, 'imp... |
import matplotlib, os
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
from flarestack.analyses.ccsn.necker_2019.ccsn_helpers import (
updated_sn_catalogue_name,
sn_cats,
sn_times,
pdf_names,
raw_output_dir,
)
import logging
from flarestack.shared import plot_output_dir
pl... | [
"flarestack.analyses.ccsn.necker_2019.ccsn_helpers.updated_sn_catalogue_name",
"os.makedirs",
"matplotlib.use",
"flarestack.shared.plot_output_dir",
"matplotlib.pyplot.close",
"numpy.array",
"os.path.isdir",
"flarestack.analyses.ccsn.necker_2019.ccsn_helpers.pdf_names",
"matplotlib.pyplot.subplots"
... | [((23, 44), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (37, 44), False, 'import matplotlib, os\n'), ((329, 408), 'flarestack.shared.plot_output_dir', 'plot_output_dir', (["(raw_output_dir + '/catalogue_visualization/difference_stasik/')"], {}), "(raw_output_dir + '/catalogue_visualization/dif... |
import numpy as np
import pytest
from ephysiopy.common import utils
def test_smooth():
x = np.random.rand(100)
x = list(x)
with pytest.raises(ValueError):
utils.smooth(np.atleast_2d(x))
with pytest.raises(ValueError):
utils.smooth(x, window_len=len(x)+1)
utils.smooth(x, window_len=... | [
"ephysiopy.common.utils.polar",
"ephysiopy.common.utils.bwperim",
"numpy.atleast_2d",
"numpy.random.rand",
"numpy.random.default_rng",
"ephysiopy.common.utils.blurImage",
"ephysiopy.common.utils.smooth",
"ephysiopy.common.utils.repeat_ind",
"numpy.array",
"numpy.random.randint",
"pytest.raises",... | [((97, 116), 'numpy.random.rand', 'np.random.rand', (['(100)'], {}), '(100)\n', (111, 116), True, 'import numpy as np\n'), ((293, 322), 'ephysiopy.common.utils.smooth', 'utils.smooth', (['x'], {'window_len': '(2)'}), '(x, window_len=2)\n', (305, 322), False, 'from ephysiopy.common import utils\n'), ((327, 356), 'ephysi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.