code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 11 21:57:41 2020
@author: inderpreet
calculate statistics for MWHS point estimates, the results are given in latex format
results from scattering index and beuhler et al
"""
import netCDF4
import os
import matplotlib.pyplot as plt
import numpy as ... | [
"numpy.abs",
"numpy.sum",
"numpy.histogram",
"numpy.mean",
"numpy.arange",
"os.path.join",
"read_qrnn.read_qrnn",
"netCDF4.Dataset",
"numpy.std",
"numpy.isfinite",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.subplots",
"mwhs.mwhsData",
"numpy.argwhere",
"numpy.squeeze",
"nu... | [((377, 415), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 26}"], {}), "({'font.size': 26})\n", (396, 415), True, 'import matplotlib.pyplot as plt\n'), ((1027, 1042), 'numpy.mean', 'np.mean', (['(y - y0)'], {}), '(y - y0)\n', (1034, 1042), True, 'import numpy as np\n'), ((1070, 1084), 'n... |
from sklearn.datasets import load_iris
iris = load_iris()
from sklearn.cluster import DBSCAN
dbscan = DBSCAN(eps=0.2, metric='euclidean', min_samples=5)
import numpy
# DBSCAN(eps=0.5, metric='euclidean', min_samples=5,random_state=111)
iris = load_iris()
print (iris.feature_names)
X, y = load_iris(return_X_y=True... | [
"sklearn.metrics.silhouette_score",
"sklearn.datasets.load_iris",
"numpy.delete",
"sklearn.cluster.DBSCAN"
] | [((46, 57), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (55, 57), False, 'from sklearn.datasets import load_iris\n'), ((103, 153), 'sklearn.cluster.DBSCAN', 'DBSCAN', ([], {'eps': '(0.2)', 'metric': '"""euclidean"""', 'min_samples': '(5)'}), "(eps=0.2, metric='euclidean', min_samples=5)\n", (109, 153),... |
"""
Script to evaluate the activation functions for the selected network + grid.
"""
import sys
import os
sys.path.insert(0, os.getcwd())
import numpy as np
import sys
import os
import subprocess
import itertools
import imageio
import json
import torch
import io
import shutil
import matplotlib.pyp... | [
"pyrenderer.GPUTimer",
"io.StringIO",
"os.path.abspath",
"json.dump",
"os.makedirs",
"json.load",
"volnet.inference.LoadedModel",
"os.getcwd",
"subprocess.run",
"numpy.std",
"os.path.exists",
"losses.lossbuilder.LossBuilder",
"volnet.inference.LoadedModel.convert_image",
"numpy.mean",
"t... | [((134, 145), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (143, 145), False, 'import os\n'), ((3188, 3225), 'os.path.join', 'os.path.join', (['BASE_PATH', '"""stats.json"""'], {}), "(BASE_PATH, 'stats.json')\n", (3200, 3225), False, 'import os\n'), ((3234, 3265), 'os.path.exists', 'os.path.exists', (['statistics_file']... |
import numpy as np
import pickle
from IPython import embed
class RunningMeanStd(object):
# https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
def __init__(self, shape=()):
self.mean = np.zeros(shape, np.float32)
self.var = np.ones(shape, np.float32)
sel... | [
"pickle.dump",
"numpy.square",
"numpy.zeros",
"numpy.ones",
"numpy.isnan",
"numpy.mean",
"pickle.load",
"numpy.var",
"numpy.sqrt"
] | [((235, 262), 'numpy.zeros', 'np.zeros', (['shape', 'np.float32'], {}), '(shape, np.float32)\n', (243, 262), True, 'import numpy as np\n'), ((282, 308), 'numpy.ones', 'np.ones', (['shape', 'np.float32'], {}), '(shape, np.float32)\n', (289, 308), True, 'import numpy as np\n'), ((609, 628), 'numpy.mean', 'np.mean', (['x_... |
import matrices_new_extended as mne
import numpy as np
import sympy as sp
from equality_check import Point
x, y, z = sp.symbols("x y z")
Point.base_point = np.array([x, y, z, 1])
class Test_Axis_2_x0x:
def test_matrix_2_x0x(self):
expected = Point([ z, -y, x, 1])
calculated = Point.calculate(mne... | [
"sympy.symbols",
"numpy.array",
"equality_check.Point.calculate",
"equality_check.Point"
] | [((118, 137), 'sympy.symbols', 'sp.symbols', (['"""x y z"""'], {}), "('x y z')\n", (128, 137), True, 'import sympy as sp\n'), ((157, 179), 'numpy.array', 'np.array', (['[x, y, z, 1]'], {}), '([x, y, z, 1])\n', (165, 179), True, 'import numpy as np\n'), ((258, 278), 'equality_check.Point', 'Point', (['[z, -y, x, 1]'], {... |
from CNF_Creator import *
import numpy as np
import time
import timeit
#---Parameters-----------------------------------------------
num_of_literals = 50 # Number of literals
pop_size = 10 # Population size of each generation
time_limit = 45
p_mutate = 0.9 # Probability of Mutation
p_mutate_lite... | [
"numpy.zeros",
"time.time",
"numpy.append",
"numpy.random.random",
"numpy.random.randint",
"numpy.random.choice"
] | [((4268, 4298), 'numpy.zeros', 'np.zeros', (['self.population_size'], {}), '(self.population_size)\n', (4276, 4298), True, 'import numpy as np\n'), ((4827, 4852), 'numpy.random.randint', 'np.random.randint', (['length'], {}), '(length)\n', (4844, 4852), True, 'import numpy as np\n'), ((4921, 4970), 'numpy.append', 'np.... |
import time
from collections import defaultdict
from typing import List, Dict
import numpy as np
def timed(callback, *args, **kwargs):
start = time.time()
result = callback(*args, **kwargs)
return result, time.time() - start
class Timer:
def __init__(self):
self.start = 0.
self.res... | [
"collections.defaultdict",
"numpy.mean",
"time.time"
] | [((150, 161), 'time.time', 'time.time', ([], {}), '()\n', (159, 161), False, 'import time\n'), ((376, 387), 'time.time', 'time.time', ([], {}), '()\n', (385, 387), False, 'import time\n'), ((707, 724), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (718, 724), False, 'from collections import defa... |
import matplotlib.pyplot as plt
from matplotlib import animation
import matplotlib.gridspec as gridspec
from IPython.core.display import HTML
import numpy as np
import math
def animate(sequences, interval=100, blit=True, fig_size=(14, 10), get_fig=False):
if isinstance(sequences, list) or isinstance(sequences, n... | [
"numpy.pad",
"matplotlib.colors.Normalize",
"math.ceil",
"matplotlib.cm.get_cmap",
"numpy.roll",
"numpy.argmax",
"numpy.zeros",
"matplotlib.pyplot.axis",
"matplotlib.animation.ArtistAnimation",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.squeeze",
"matplotlib.pyplot.xticks",
"matplo... | [((1273, 1342), 'matplotlib.animation.ArtistAnimation', 'animation.ArtistAnimation', (['fig', 'animate'], {'interval': 'interval', 'blit': 'blit'}), '(fig, animate, interval=interval, blit=blit)\n', (1298, 1342), False, 'from matplotlib import animation\n'), ((350, 368), 'matplotlib.pyplot.subplots', 'plt.subplots', ([... |
#! python
# -*- coding: utf-8 -*-
"""
WavyTool is a simple program that allows you to acquire data from input devices,
i.e microphones, and save them as file (csv, png). Also, you can perform
some simple processing as spectral analysis.
:authors: <NAME>, <NAME>
:contact: <EMAIL>, <EMAIL>
:since: 2015/02/27
"""
impo... | [
"qdarkstyle.load_stylesheet_from_environment",
"numpy.empty",
"pyqtgraph.exporters.CSVExporter",
"os.path.join",
"collections.deque",
"os.path.expanduser",
"qtpy.QtWidgets.QSplashScreen",
"logging.warning",
"qtpy.QtCore.QTimer",
"numpy.linspace",
"pyqtgraph.mkPen",
"wavytool.mw_wavy.Ui_MainWin... | [((1169, 1209), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (1188, 1209), False, 'import logging\n'), ((1242, 1355), 'logging.info', 'logging.info', (['"""Using Qt binding (QtPy/PyQtGraph): %s"""', "(os.environ['QT_API'], os.environ['PYQTGRAPH_QT_LIB'])"], ... |
import numpy as np
import tensiga
from tensiga.iga.Nurbs import Nurbs
from tensiga.iga.Bspline import Bspline
from math import sqrt
import os
def UnitCube(n, p):
dim = n
codim = n
deg = [ p for _ in range(n) ]
kv = [ np.repeat([0., 1.], deg[k]+1) for k in range(n) ]
cp_shape = [ deg[k]+1 for k in r... | [
"math.sqrt",
"tensiga.iga.Bspline.Bspline",
"os.path.dirname",
"numpy.zeros",
"numpy.hstack",
"tensiga.iga.Nurbs.Nurbs",
"numpy.prod",
"numpy.array",
"numpy.loadtxt",
"numpy.linspace",
"numpy.unique",
"numpy.repeat"
] | [((1134, 1166), 'tensiga.iga.Bspline.Bspline', 'Bspline', (['dim', 'codim', 'kv', 'deg', 'cp'], {}), '(dim, codim, kv, deg, cp)\n', (1141, 1166), False, 'from tensiga.iga.Bspline import Bspline\n'), ((1547, 1573), 'tensiga.iga.Bspline.Bspline', 'Bspline', (['(1)', '(1)', 'kv', 'deg', 'cp'], {}), '(1, 1, kv, deg, cp)\n'... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 9 15:45:53 2020
@author: Antony
"""
import matplotlib.pyplot as plt
import time
from skimage.draw import random_shapes
import numpy as np
import astra
def cirmask(im, npx=0):
"""
Apply a circular mask to the image
"""
... | [
"matplotlib.pyplot.clf",
"numpy.floor",
"matplotlib.pyplot.figure",
"astra.data2d.get",
"pathlib.Path",
"SampleGen.random_sample",
"numpy.arange",
"numpy.round",
"astra.create_vol_geom",
"os.chdir",
"astra.create_projector",
"numpy.random.rand",
"skimage.draw.random_shapes",
"matplotlib.py... | [((820, 831), 'time.time', 'time.time', ([], {}), '()\n', (829, 831), False, 'import time\n'), ((907, 1063), 'skimage.draw.random_shapes', 'random_shapes', (['(sz, sz)'], {'min_shapes': 'min_shapes', 'max_shapes': 'max_shapes', 'multichannel': '(False)', 'min_size': 'min_size', 'max_size': 'max_size', 'allow_overlap': ... |
import unittest
import math
import pyomo.environ as pe
import coramin
import numpy as np
from coramin.relaxations.segments import compute_k_segment_points
class TestUnivariateExp(unittest.TestCase):
@classmethod
def setUpClass(cls):
model = pe.ConcreteModel()
cls.model = model
model.y ... | [
"math.exp",
"pyomo.environ.log",
"pyomo.environ.SolverFactory",
"coramin.relaxations.PWUnivariateRelaxation",
"pyomo.environ.Constraint",
"pyomo.environ.Var",
"pyomo.environ.value",
"pyomo.environ.Objective",
"pyomo.environ.exp",
"coramin.relaxations.segments.compute_k_segment_points",
"numpy.li... | [((259, 277), 'pyomo.environ.ConcreteModel', 'pe.ConcreteModel', ([], {}), '()\n', (275, 277), True, 'import pyomo.environ as pe\n'), ((322, 330), 'pyomo.environ.Var', 'pe.Var', ([], {}), '()\n', (328, 330), True, 'import pyomo.environ as pe\n'), ((349, 375), 'pyomo.environ.Var', 'pe.Var', ([], {'bounds': '(-1.5, 1.5)'... |
import sys
import re
import time
import argparse
from collections import namedtuple, deque
from itertools import cycle, chain, repeat
import numpy as np
from PIL import Image
import rgbmatrix as rgb
sys.path.append("/home/pi/pixel_art/")
from settings import (NES_PALETTE_HEX, dispmatrix)
from core import *
from sp... | [
"sys.path.append",
"numpy.random.shuffle",
"argparse.ArgumentParser",
"collections.deque",
"settings.dispmatrix.Clear"
] | [((203, 241), 'sys.path.append', 'sys.path.append', (['"""/home/pi/pixel_art/"""'], {}), "('/home/pi/pixel_art/')\n", (218, 241), False, 'import sys\n'), ((1462, 1571), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'desc', 'add_help': '(False)', 'epilog': 'epilog', 'formatter_class': 'Custo... |
'''
KnockoffGAN Knockoff Variable Generation
<NAME> (9/27/2018)
'''
#%% Necessary Packages
import numpy as np
from tqdm import tqdm
import tensorflow as tf
import logging
import argparse
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
#%% KnockoffGAN Function
'''
Inputs:
x_train: Training data
lamd... | [
"tensorflow.reduce_sum",
"argparse.ArgumentParser",
"tensorflow.nn.tanh",
"pandas.read_csv",
"tensorflow.reset_default_graph",
"sklearn.preprocessing.MinMaxScaler",
"tensorflow.ConfigProto",
"tensorflow.matmul",
"tensorflow.sqrt",
"tensorflow.RunOptions",
"pandas.DataFrame",
"tensorflow.concat... | [((394, 413), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (411, 413), False, 'import logging\n'), ((2404, 2451), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, x_dim]'}), '(tf.float32, shape=[None, x_dim])\n', (2418, 2451), True, 'import tensorflow as tf\n'), ((2496, 2543... |
#!/usr/bin/python
import numpy as np
import sys
import argparse
from assembler import symbolTable, singleInstr, doubleInstr, tripleInstr
from transcoder import key_note_length, offsetArr
from music21 import midi, note, chord
#The stack size and the program size are both 256 for easy addressing
STACK_SIZE = 256
PROG_SI... | [
"sys.stdout.write",
"numpy.uint8",
"argparse.ArgumentParser",
"numpy.zeros",
"music21.midi.translate.midiTrackToStream",
"music21.midi.base.MidiFile",
"music21.chord.Chord",
"music21.note.Note"
] | [((7199, 7275), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""This is a VM to run Ballad (byte)code"""'}), "(description='This is a VM to run Ballad (byte)code')\n", (7222, 7275), False, 'import argparse\n'), ((586, 622), 'numpy.zeros', 'np.zeros', (['STACK_SIZE'], {'dtype': 'np.uint8'}... |
from numpy.random import choice
from statistics import mode
KEY = 0
VALUE = 1
TWICE = 2
THRICE = 3
PROBABILITY = [0.30, 0.265, 0.179, 0.129, 0.073, 0.035, 0.019]
NOTHING = ":x:"
CHERRY = ":cherries:"
BLUEBERRY = ":blueberries:"
COIN = ":coin:"
CARD = ":credit_card:"
GEM = ":gem:"
EIGHTBALL = ":8ball:"
SLOT = [NOTHING... | [
"statistics.mode",
"numpy.random.choice"
] | [((849, 889), 'numpy.random.choice', 'choice', (['SLOT'], {'size': 'THRICE', 'p': 'PROBABILITY'}), '(SLOT, size=THRICE, p=PROBABILITY)\n', (855, 889), False, 'from numpy.random import choice\n'), ((1038, 1047), 'statistics.mode', 'mode', (['row'], {}), '(row)\n', (1042, 1047), False, 'from statistics import mode\n')] |
# coding: utf-8
# # Exploratory data analysis of TCGA mutation data
# In[1]:
import os
import numpy
import pandas
import seaborn
get_ipython().run_line_magic('matplotlib', 'inline')
# ## Read TCGA datasets
# In[2]:
path = os.path.join('data', 'mutation-matrix.tsv.bz2')
mutation_df = pandas.read_table(path, ... | [
"seaborn.heatmap",
"numpy.expm1",
"seaborn.distplot",
"seaborn.jointplot",
"pandas.read_table",
"os.path.join",
"numpy.log1p"
] | [((234, 281), 'os.path.join', 'os.path.join', (['"""data"""', '"""mutation-matrix.tsv.bz2"""'], {}), "('data', 'mutation-matrix.tsv.bz2')\n", (246, 281), False, 'import os\n'), ((296, 332), 'pandas.read_table', 'pandas.read_table', (['path'], {'index_col': '(0)'}), '(path, index_col=0)\n', (313, 332), False, 'import pa... |
# --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
new=np.concatenate((data,new_record),axis=0)
age=new[:,0]
max_ag... | [
"numpy.sum",
"warnings.filterwarnings",
"numpy.std",
"numpy.genfromtxt",
"numpy.max",
"numpy.min",
"numpy.mean",
"numpy.array",
"numpy.concatenate"
] | [((82, 115), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (105, 115), False, 'import warnings\n'), ((203, 252), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (216, 252), True, 'i... |
""" A collection of common routines for plotting ones """
import time
import matplotlib.pyplot as plt
import numpy as np
from lamberthub.utils.misc import _get_sample_vectors_from_theta_and_rho
class TauThetaPlotter:
"""A class for modelling a discrete grid contour plotter."""
def __init__(self, ax=None, ... | [
"numpy.vectorize",
"time.perf_counter",
"lamberthub.utils.misc._get_sample_vectors_from_theta_and_rho",
"numpy.linalg.norm",
"numpy.array",
"numpy.linspace",
"numpy.cos",
"numpy.log10",
"matplotlib.pyplot.subplots"
] | [((6346, 6444), 'numpy.vectorize', 'np.vectorize', (['_measure_performance'], {'otypes': '[np.ndarray, np.ndarray, np.ndarray]', 'excluded': '[0]'}), '(_measure_performance, otypes=[np.ndarray, np.ndarray, np.\n ndarray], excluded=[0])\n', (6358, 6444), True, 'import numpy as np\n'), ((5144, 5194), 'lamberthub.utils... |
# -*- coding: utf-8 -*-
from copy import deepcopy
import numpy as np
import pytest
from pygam import *
from pygam.terms import Term, Intercept, SplineTerm, LinearTerm, FactorTerm, TensorTerm, TermList
from pygam.utils import flatten
@pytest.fixture
def chicago_gam(chicago_X_y):
X, y = chicago_X_y
gam = Pois... | [
"copy.deepcopy",
"pygam.utils.flatten",
"numpy.allclose",
"pygam.terms.FactorTerm",
"pygam.penalties.derivative",
"pygam.terms.Term.build_from_info",
"pytest.raises",
"pygam.terms.TensorTerm",
"numpy.arange",
"pygam.terms.SplineTerm",
"numpy.linspace",
"pygam.terms.LinearTerm",
"pygam.terms.... | [((1283, 1296), 'pygam.terms.SplineTerm', 'SplineTerm', (['(0)'], {}), '(0)\n', (1293, 1296), False, 'from pygam.terms import Term, Intercept, SplineTerm, LinearTerm, FactorTerm, TensorTerm, TermList\n'), ((1693, 1746), 'numpy.allclose', 'np.allclose', (['gam.coef_', 'chicago_gam.coef_'], {'atol': '(1e-06)'}), '(gam.co... |
from serial import Serial
import time
from PyQt5.QtCore import pyqtSignal, QObject, QTimer
from PyQt5.QtWidgets import QMessageBox
from PyQt5 import QtTest
from math import isclose
import numpy as np
class Stages(QObject):
def __init__(self,parent=None):
super().__init__()
... | [
"serial.Serial",
"PyQt5.QtCore.QTimer",
"numpy.abs",
"numpy.asarray",
"PyQt5.QtTest.QTest.qWait",
"PyQt5.QtWidgets.QMessageBox.question",
"numpy.sqrt"
] | [((1056, 1083), 'numpy.asarray', 'np.asarray', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (1066, 1083), True, 'import numpy as np\n'), ((1110, 1137), 'numpy.asarray', 'np.asarray', (['[0.1, 0.1, 0.1]'], {}), '([0.1, 0.1, 0.1])\n', (1120, 1137), True, 'import numpy as np\n'), ((5024, 5173), 'PyQt5.QtWidgets.QMess... |
import numpy as np
from scipy.ndimage import gaussian_filter1d
from . import ExpFilter, Source, Visualizer
from .melbank import compute_melmat
class Sampler:
y_rolling: np.ndarray
source: Source
_gamma_table = None
def __init__(self, source: Source, visualizer: Visualizer, gamma_table_path: str = No... | [
"numpy.pad",
"numpy.load",
"numpy.fft.rfft",
"numpy.abs",
"numpy.sum",
"numpy.copy",
"numpy.array_equal",
"scipy.ndimage.gaussian_filter1d",
"numpy.log2",
"numpy.clip",
"numpy.tile",
"numpy.array_split",
"numpy.concatenate"
] | [((719, 751), 'numpy.tile', 'np.tile', (['(1)', '(3, self.num_pixels)'], {}), '(1, (3, self.num_pixels))\n', (726, 751), True, 'import numpy as np\n'), ((779, 813), 'numpy.tile', 'np.tile', (['(253)', '(3, self.num_pixels)'], {}), '(253, (3, self.num_pixels))\n', (786, 813), True, 'import numpy as np\n'), ((2279, 2310)... |
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..','..'))
import numpy as np
import commpy
from sdr_utils import vector as vec
from sdr_utils import plot_two_signals
class synchronization():
def __init__(self, param):
self.halfpreamble = param.halfpreamble
self... | [
"numpy.pad",
"numpy.abs",
"numpy.sum",
"numpy.argmax",
"os.path.dirname",
"numpy.empty_like",
"sdr_utils.vector.shift",
"numpy.append",
"numpy.where",
"numpy.array",
"numpy.correlate"
] | [((47, 72), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (62, 72), False, 'import sys, os\n'), ((1644, 1694), 'numpy.correlate', 'np.correlate', (['data', 'self.halfpreamble'], {'mode': '"""same"""'}), "(data, self.halfpreamble, mode='same')\n", (1656, 1694), True, 'import numpy as np\n'), ... |
import os
import argparse
import numpy as np
from tqdm import tqdm
from utils.audio import AudioProcessor
from utils.text import phoneme_to_sequence
def load_metadata(metadata_file):
items = []
with open(metadata_file, 'r') as fp:
for line in fp:
cols = line.split('|')
wav_file... | [
"tqdm.tqdm",
"numpy.save",
"argparse.ArgumentParser",
"os.makedirs",
"numpy.asarray",
"os.path.exists",
"utils.text.phoneme_to_sequence",
"utils.audio.AudioProcessor",
"os.path.join"
] | [((495, 586), 'utils.text.phoneme_to_sequence', 'phoneme_to_sequence', (['text', "['phoneme_cleaners']"], {'language': '"""en-us"""', 'enable_eos_bos': '(False)'}), "(text, ['phoneme_cleaners'], language='en-us',\n enable_eos_bos=False)\n", (514, 586), False, 'from utils.text import phoneme_to_sequence\n'), ((668, 7... |
import os
from collections import deque
from multiprocessing import Process
import cv2 as cv
import dlib
import numpy as np
from skimage import transform as tf
from tqdm import tqdm
STD_SIZE = (224, 224)
stablePntsIDs = [33, 36, 39, 42, 45]
def shape_to_array(shape):
coords = np.empty((68, 2))
... | [
"cv2.resize",
"tqdm.tqdm",
"numpy.concatenate",
"cv2.cvtColor",
"numpy.empty",
"os.system",
"cv2.VideoCapture",
"numpy.mean",
"numpy.array",
"dlib.get_frontal_face_detector",
"skimage.transform.warp",
"skimage.transform.estimate_transform",
"multiprocessing.Process",
"collections.deque"
] | [((300, 317), 'numpy.empty', 'np.empty', (['(68, 2)'], {}), '((68, 2))\n', (308, 317), True, 'import numpy as np\n'), ((535, 561), 'numpy.mean', 'np.mean', (['landmarks'], {'axis': '(0)'}), '(landmarks, axis=0)\n', (542, 561), True, 'import numpy as np\n'), ((5524, 5550), 'cv2.VideoCapture', 'cv.VideoCapture', (['video... |
#!/usr/bin/env python3
import os
import numpy as np
import jax.numpy as jnp
from multiprocessing import Pool, Manager, Condition, Value, Process
import sys
import io
import time
import yaml
import re
import traceback
import subprocess
from .utils import *
from rich.progress import (
Progress,
TextColumn,
... | [
"io.StringIO",
"numpy.load",
"re.split",
"rich.progress.TextColumn",
"os.makedirs",
"multiprocessing.Manager",
"subprocess.check_output",
"multiprocessing.Value",
"rich.progress.TimeElapsedColumn",
"multiprocessing.Condition",
"os.system",
"rich.progress.BarColumn",
"time.sleep",
"rich.pro... | [((494, 503), 'multiprocessing.Manager', 'Manager', ([], {}), '()\n', (501, 503), False, 'from multiprocessing import Pool, Manager, Condition, Value, Process\n'), ((586, 597), 'multiprocessing.Condition', 'Condition', ([], {}), '()\n', (595, 597), False, 'from multiprocessing import Pool, Manager, Condition, Value, Pr... |
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
#create multindex dataframe
arrays = [['Fruit', 'Fruit', 'Fruit', 'Veggies', 'Veggies', 'Veggies'],
['Bananas', 'Oranges', 'Pears', 'Carrots', 'Potatoes', 'Celery']]
index = pd.MultiIndex.from_tuples(list(zip(*arrays)))
df = pd.DataFrame(... | [
"matplotlib.pyplot.tight_layout",
"numpy.random.randint",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((398, 473), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(1)', 'ncols': '(2)', 'sharey': '(True)', 'figsize': '(14 / 2.54, 10 / 2.54)'}), '(nrows=1, ncols=2, sharey=True, figsize=(14 / 2.54, 10 / 2.54))\n', (410, 473), True, 'import matplotlib.pyplot as plt\n'), ((943, 961), 'matplotlib.pyplot.tight_... |
import unittest
import numpy as np
import pandas as pd
import os
import pytz
from clairvoyant import History
dir_path = os.path.dirname(os.path.realpath(__file__))
class Test_History(unittest.TestCase):
def setUp(self):
column_map = {
'Date': 'Unnamed: 0', 'Open': 'open', 'High': 'high', 'Low'... | [
"os.path.realpath",
"pandas.to_datetime",
"os.path.join",
"numpy.isclose"
] | [((136, 162), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (152, 162), False, 'import os\n'), ((499, 543), 'os.path.join', 'os.path.join', (['dir_path', '"""tsla-sentiment.csv"""'], {}), "(dir_path, 'tsla-sentiment.csv')\n", (511, 543), False, 'import os\n'), ((1708, 1745), 'pandas.to_dat... |
import numpy as np
numNodes = 891
coord = np.zeros((numNodes,2))
K = np.zeros((numNodes*2,numNodes*2))
for i in range(numNodes):
coord[i,0] = int(i / 11) / 10
coord[i,1] = i % 11 / 10
gaussxi = np.array([-1,1,1,-1]) / np.sqrt(3)
gausseta = np.array([-1,-1,1,1]) / np.sqrt(3)
numEle = 800
E = 1e5
nu = 0.25... | [
"numpy.zeros",
"numpy.transpose",
"numpy.linalg.det",
"numpy.array",
"numpy.linalg.inv",
"numpy.dot",
"numpy.sqrt"
] | [((43, 66), 'numpy.zeros', 'np.zeros', (['(numNodes, 2)'], {}), '((numNodes, 2))\n', (51, 66), True, 'import numpy as np\n'), ((70, 108), 'numpy.zeros', 'np.zeros', (['(numNodes * 2, numNodes * 2)'], {}), '((numNodes * 2, numNodes * 2))\n', (78, 108), True, 'import numpy as np\n'), ((208, 232), 'numpy.array', 'np.array... |
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.markers as mk
import matplotlib.pylab as plt
def sp_plot(df, x_col, y_col, color_col,ci = None,domain_range=[0, 20, 0 , 20],
ax=None,aggplot=True,x_jitter=0,height=3,legend=True):
"""
create SP vizualization plot from 2... | [
"seaborn.set_style",
"seaborn.lmplot",
"matplotlib.markers.MarkerStyle.markers.keys",
"numpy.asarray",
"matplotlib.pylab.axis",
"matplotlib.pylab.gca",
"seaborn.regplot",
"numpy.max",
"numpy.arange",
"numpy.eye",
"matplotlib.pylab.grid",
"matplotlib.pylab.matshow"
] | [((636, 781), 'seaborn.lmplot', 'sns.lmplot', (['x_col', 'y_col'], {'data': 'df', 'hue': 'color_col', 'ci': 'ci', 'markers': 'cur_markers', 'palette': '"""Set1"""', 'x_jitter': 'x_jitter', 'height': 'height', 'legend': 'legend'}), "(x_col, y_col, data=df, hue=color_col, ci=ci, markers=cur_markers,\n palette='Set1', ... |
# Copyright (C) 2017-2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
import run_utils as utils
import numpy as np
import sys, os
import dpctl, dpctl.tensor as dpt
from dpbench_python.pairwise_distance.pairwise_distance_python import (
pairwise_distance_python,
)
from dpbench_datagen.pairwise_distance impor... | [
"os.remove",
"argparse.ArgumentParser",
"numpy.fromfile",
"run_utils.run_command",
"numpy.empty",
"numpy.allclose",
"dpbench_python.pairwise_distance.pairwise_distance_python.pairwise_distance_python",
"os.path.isfile",
"dpbench_datagen.pairwise_distance.gen_data_to_file",
"dpbench_datagen.pairwis... | [((649, 674), 'dpbench_datagen.pairwise_distance.gen_rand_data', 'gen_rand_data', (['nopt', 'dims'], {}), '(nopt, dims)\n', (662, 674), False, 'from dpbench_datagen.pairwise_distance import gen_rand_data, gen_data_to_file\n'), ((799, 824), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (822, 82... |
import numpy as np
import matplotlib.pyplot as plt
from rbm import RBM
import click
import gzip
import pickle
@click.group(context_settings={"help_option_names": ['-h', '--help']})
def cli():
"""Simple tool for training an RBM"""
pass
# @click.option('--target-path', type=click.Path(exists=True),
# ... | [
"gzip.open",
"matplotlib.pyplot.show",
"click.option",
"click.Choice",
"pickle.load",
"numpy.array",
"click.Path",
"rbm.RBM",
"click.group",
"matplotlib.pyplot.subplots"
] | [((113, 182), 'click.group', 'click.group', ([], {'context_settings': "{'help_option_names': ['-h', '--help']}"}), "(context_settings={'help_option_names': ['-h', '--help']})\n", (124, 182), False, 'import click\n'), ((684, 826), 'click.option', 'click.option', (['"""-n"""', '"""--num-hidden"""'], {'default': 'None', '... |
# Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | [
"pandas.DataFrame",
"pandas.testing.assert_frame_equal",
"xarray.testing.assert_equal",
"pandas.date_range",
"pandas.read_csv",
"s3fs.S3FileSystem",
"xarray.open_zarr",
"numpy.random.rand"
] | [((902, 925), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'data'}), '(data=data)\n', (914, 925), True, 'import pandas as pd\n'), ((961, 994), 'pandas.read_csv', 'pd.read_csv', (['s3_file'], {'index_col': '(0)'}), '(s3_file, index_col=0)\n', (972, 994), True, 'import pandas as pd\n'), ((1042, 1082), 'pandas.testin... |
import numpy as np
import multiprocessing
from abito.lib.stats.weighted import _quantile_sorted, _sort_obs
__all__ = ['generate_bootstrap_estimates']
def _do_bootstrap_plain(obs, stat_func, stat_args, n_iters, seed):
np.random.seed(seed)
nobs = obs.shape[0]
result = []
for i in range(n_iters):
... | [
"numpy.random.seed",
"abito.lib.stats.weighted._sort_obs",
"numpy.empty",
"numpy.random.multinomial",
"numpy.asarray",
"multiprocessing.Pool",
"numpy.random.randint",
"numpy.random.choice",
"multiprocessing.cpu_count"
] | [((225, 245), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (239, 245), True, 'import numpy as np\n'), ((566, 586), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (580, 586), True, 'import numpy as np\n'), ((1382, 1393), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (1390, ... |
from ising import *
import os
import numpy as np
Ns = [10, 20, 50, 100, 1000] # System Size
T_Tcs = np.linspace(0.5, 1.7, 30) # T/Tc
Tc = 2.268 # Onsager's Tc
for n in Ns:
for i, T_Tc in enumerate(T_Tcs):
T = T_Tc*Tc
wd = 'magnetization/size-{0}/temp-{1}'.format(n, i)
if not os.path.exi... | [
"os.path.exists",
"os.makedirs",
"numpy.linspace"
] | [((102, 127), 'numpy.linspace', 'np.linspace', (['(0.5)', '(1.7)', '(30)'], {}), '(0.5, 1.7, 30)\n', (113, 127), True, 'import numpy as np\n'), ((309, 327), 'os.path.exists', 'os.path.exists', (['wd'], {}), '(wd)\n', (323, 327), False, 'import os\n'), ((342, 357), 'os.makedirs', 'os.makedirs', (['wd'], {}), '(wd)\n', (... |
import numpy as np
import scipy.stats
from functools import partial
from ..util.math import flattengrid
from ..comp.codata import ILR, close
from .log import Handle
logger = Handle(__name__)
def get_scaler(*fs):
"""
Generate a function which will transform columns of an array
based on input functions (e.... | [
"numpy.atleast_2d",
"functools.partial",
"numpy.log",
"numpy.isfinite",
"numpy.exp",
"numpy.nanmax",
"numpy.sqrt"
] | [((749, 771), 'functools.partial', 'partial', (['scaler'], {'fs': 'fs'}), '(scaler, fs=fs)\n', (756, 771), False, 'from functools import partial\n'), ((1578, 1597), 'numpy.atleast_2d', 'np.atleast_2d', (['data'], {}), '(data)\n', (1591, 1597), True, 'import numpy as np\n'), ((3903, 3928), 'numpy.exp', 'np.exp', (['(mu ... |
# -*- coding: utf-8 -*
import numpy as np
a = np.array([2, 0, 1 ,5])
print(a)
print(a[:3])
print(a.min())
# 由小到大排序
a.sort()
print(a)
# 二维矩阵
b = np.array([[1,2,3], [4,5,6]])
print(b*b)
| [
"numpy.array"
] | [((47, 69), 'numpy.array', 'np.array', (['[2, 0, 1, 5]'], {}), '([2, 0, 1, 5])\n', (55, 69), True, 'import numpy as np\n'), ((149, 181), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6]]'], {}), '([[1, 2, 3], [4, 5, 6]])\n', (157, 181), True, 'import numpy as np\n')] |
import sys
from vispy import scene
from vispy.scene import SceneCanvas
from vispy.visuals import transforms
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QMainWindow, QWidget, QLabel, QGridLayout, QPushButton, QCheckBox, QSlider
#from MyWidget import *
from vispy import ... | [
"vispy.scene.visuals.Mesh",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QPushButton",
"numpy.ones",
"vispy.scene.visuals.Markers",
"PyQt5.QtWidgets.QApplication",
"numpy.diag",
"vispy.scene.SceneCanvas",
"vispy.scene.visuals.XYZAxis",
"PyQt5.QtWidgets.QWidget",
"random.seed",
"numpy.stack"... | [((1039, 1071), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (1061, 1071), False, 'from PyQt5 import QtWidgets, QtCore\n'), ((1079, 1092), 'PyQt5.QtWidgets.QMainWindow', 'QMainWindow', ([], {}), '()\n', (1090, 1092), False, 'from PyQt5.QtWidgets import QMainWindow, QWidg... |
import numpy as np
import copy
from memory_profiler import profile
# physical/external base state of all entites
def isNear(box,landmark,threshold=0.05):
if (np.sum(np.square(box.state.p_pos-landmark.state.p_pos)) <= threshold):
return True
else:
return False
def calcDistance(entity1,entity2)... | [
"copy.deepcopy",
"numpy.abs",
"numpy.random.randn",
"numpy.square",
"numpy.zeros",
"numpy.arcsin",
"numpy.ones",
"numpy.sin",
"numpy.linalg.norm",
"numpy.array",
"numpy.logaddexp",
"numpy.cos"
] | [((1463, 1482), 'numpy.array', 'np.array', (['endpoints'], {}), '(endpoints)\n', (1471, 1482), True, 'import numpy as np\n'), ((1655, 1680), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (1663, 1680), True, 'import numpy as np\n'), ((3590, 3622), 'copy.deepcopy', 'copy.deepcopy', (['self.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `ndex2.client` package."""
import os
import sys
import io
import decimal
import unittest
import numpy as np
import json
import requests_mock
from unittest.mock import MagicMock
from requests.exceptions import HTTPError
from ndex2 import client
from ndex2.cli... | [
"ndex2.client.DecimalEncoder",
"unittest.mock.MagicMock",
"json.loads",
"decimal.Decimal",
"requests_mock.mock",
"json.dumps",
"ndex2.client.Ndex2",
"numpy.int32",
"numpy.int64",
"os.getenv"
] | [((1625, 1641), 'ndex2.client.DecimalEncoder', 'DecimalEncoder', ([], {}), '()\n', (1639, 1641), False, 'from ndex2.client import DecimalEncoder\n'), ((2484, 2507), 'ndex2.client.Ndex2', 'Ndex2', ([], {'host': '"""localhost"""'}), "(host='localhost')\n", (2489, 2507), False, 'from ndex2.client import Ndex2\n'), ((3141,... |
import ABCLogger, pygame as py, numpy, itertools
from Numerical import Numerical
from global_values import *
class CirclesLogger(ABCLogger.ABCLogger):
def log(self, foreignSelf):
return repr(foreignSelf._nextCollisionTime)
class Circles:
def expectedTimeCircles(self, circleA, circleB):
#TODO refactor this to wor... | [
"pygame.event.get",
"Numerical.Numerical.solveQuadraticPrune",
"pygame.display.update",
"numpy.linalg.norm",
"numpy.dot",
"numpy.ndarray"
] | [((2195, 2232), 'numpy.linalg.norm', 'numpy.linalg.norm', (['positionDifference'], {}), '(positionDifference)\n', (2212, 2232), False, 'import ABCLogger, pygame as py, numpy, itertools\n'), ((2562, 2616), 'numpy.ndarray', 'numpy.ndarray', ([], {'shape': '([self.circlesNo] * 2)', 'dtype': 'float'}), '(shape=[self.circle... |
from enum import IntEnum
import numpy as np
class Cell(IntEnum):
Empty = 0
O = -1 # player 2
X = 1 # player 1
class Result(IntEnum):
X_Wins = 1
O_Wins = -1
Draw = 0
Incomplete = 2
SIZE = 3
class Board(object):
"""docstring for Board"""
def __init__(self, cells=None):
... | [
"numpy.array",
"numpy.count_nonzero"
] | [((777, 805), 'numpy.count_nonzero', 'np.count_nonzero', (['self.cells'], {}), '(self.cells)\n', (793, 805), True, 'import numpy as np\n'), ((404, 438), 'numpy.array', 'np.array', (['([Cell.Empty] * SIZE ** 2)'], {}), '([Cell.Empty] * SIZE ** 2)\n', (412, 438), True, 'import numpy as np\n')] |
import numpy as np
from mayavi import mlab as mayalab
def plot_pc_with_normal(pcs,pcs_n,scale_factor=1.0):
mayalab.quiver3d(pcs[:, 0], pcs[:, 1], pcs[:, 2], pcs_n[:, 0], pcs_n[:, 1], pcs_n[:, 2], mode='arrow',scale_factor=1.0)
def plot_pc(pcs,color=None,scale_factor=.05,mode='point'):
if color == 'r':
mayalab... | [
"mayavi.mlab.quiver3d",
"numpy.copy",
"numpy.zeros",
"numpy.all",
"mayavi.mlab.points3d",
"numpy.hstack",
"numpy.any",
"numpy.ones",
"numpy.array",
"numpy.linalg.norm",
"numpy.eye",
"numpy.vstack"
] | [((110, 234), 'mayavi.mlab.quiver3d', 'mayalab.quiver3d', (['pcs[:, 0]', 'pcs[:, 1]', 'pcs[:, 2]', 'pcs_n[:, 0]', 'pcs_n[:, 1]', 'pcs_n[:, 2]'], {'mode': '"""arrow"""', 'scale_factor': '(1.0)'}), "(pcs[:, 0], pcs[:, 1], pcs[:, 2], pcs_n[:, 0], pcs_n[:, 1],\n pcs_n[:, 2], mode='arrow', scale_factor=1.0)\n", (126, 234... |
import os
import numpy as np
def generate_synth_unit_sphere_dataset(N_data=20000,
rand_seed=38,
sampling_magnitude=50000.0,
noise_level=0.01,
dataset_save_path='u... | [
"numpy.random.uniform",
"numpy.save",
"numpy.random.seed",
"numpy.linalg.norm",
"numpy.random.normal"
] | [((429, 454), 'numpy.random.seed', 'np.random.seed', (['rand_seed'], {}), '(rand_seed)\n', (443, 454), True, 'import numpy as np\n'), ((524, 614), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-sampling_magnitude)', 'high': 'sampling_magnitude', 'size': '(N_data, 3)'}), '(low=-sampling_magnitude, high=sam... |
import os
import os.path as osp
import json
from collections import OrderedDict
import numpy as np
from sklearn.metrics import average_precision_score
from sklearn.metrics import confusion_matrix
import functools
import sklearn
__all__ = [
'compute_result_multilabel',
'compute_result',
]
def calibrated_ap(... | [
"numpy.stack",
"json.dump",
"numpy.sum",
"os.makedirs",
"numpy.copy",
"numpy.argmax",
"os.path.isdir",
"numpy.append",
"numpy.where",
"numpy.array",
"collections.OrderedDict",
"sklearn.metrics.confusion_matrix",
"os.path.join",
"numpy.concatenate"
] | [((359, 395), 'numpy.stack', 'np.stack', (['[label, predicted]'], {'axis': '(1)'}), '([label, predicted], axis=1)\n', (367, 395), True, 'import numpy as np\n'), ((1329, 1342), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1340, 1342), False, 'from collections import OrderedDict\n'), ((1363, 1386), 'numpy... |
import sys
import os
import glob
import numpy as np
import torch
import torch.optim as optim
from torch.optim import lr_scheduler
import math
from sklearn.metrics import f1_score, precision_score, recall_score, accuracy_score
from scipy.special import softmax
from Clf import *
from CBLoss import *
from FBeta_Loss impor... | [
"sys.stdout.write",
"os.mkdir",
"os.remove",
"torch.optim.lr_scheduler.StepLR",
"numpy.argmax",
"numpy.empty",
"torch.argmax",
"torch.randn",
"sys.stdout.flush",
"glob.glob",
"torch.no_grad",
"os.path.exists",
"torch.hub.load",
"math.isnan",
"numpy.save",
"efficientnet_pytorch.Efficien... | [((5759, 5796), 'sys.stdout.write', 'sys.stdout.write', (["('%s\\r' % string_out)"], {}), "('%s\\r' % string_out)\n", (5775, 5796), False, 'import sys\n'), ((5801, 5819), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (5817, 5819), False, 'import sys\n'), ((15583, 15650), 'torch.optim.lr_scheduler.StepLR', '... |
import numpy as np
import scipy.cluster.vq as vq
import argparse
import matplotlib as mpl
mpl.use("qt4Agg")
import matplotlib.pyplot as plt
import thimbles as tmb
import json
import latbin
parser = argparse.ArgumentParser()
parser.add_argument("linelist")
parser.add_argument("--k-max", default=300, type=int)
parser... | [
"argparse.ArgumentParser",
"numpy.argmax",
"numpy.clip",
"numpy.unique",
"numpy.power",
"numpy.log10",
"thimbles.io.linelist_io.write_linelist",
"json.dump",
"matplotlib.pyplot.show",
"thimbles.io.linelist_io.read_linelist",
"matplotlib.use",
"latbin.ALattice",
"thimbles.transitions.lines_by... | [((92, 109), 'matplotlib.use', 'mpl.use', (['"""qt4Agg"""'], {}), "('qt4Agg')\n", (99, 109), True, 'import matplotlib as mpl\n'), ((202, 227), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (225, 227), False, 'import argparse\n'), ((985, 1032), 'thimbles.io.linelist_io.read_linelist', 'tmb.io.l... |
import unittest
import warnings
import numpy as np
import numpy.testing as npt
from squidward import utils
from squidward.utils import deprecated
# useful for debugging
np.set_printoptions(suppress=True)
class UtilitiesTestCase(unittest.TestCase):
"""Class for utilities tests."""
# ------------------------... | [
"unittest.main",
"squidward.utils.exactly_2d",
"numpy.set_printoptions",
"squidward.utils.is_invertible",
"squidward.utils.onehot",
"squidward.utils.softmax",
"warnings.simplefilter",
"squidward.utils.Invert",
"numpy.testing.assert_almost_equal",
"numpy.ones",
"squidward.utils.sigmoid",
"numpy... | [((171, 205), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (190, 205), True, 'import numpy as np\n'), ((12808, 12823), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12821, 12823), False, 'import unittest\n'), ((693, 704), 'numpy.ones', 'np.ones', (['(10)'], ... |
# -*- coding: utf-8 -*-
"""
Compares two bottom detections.
Copyright (c) 2021, Contributors to the CRIMAC project.
Licensed under the MIT license.
"""
import numpy as np
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
import xarray as xr
def compare(zarr_file: str,
a_bottom_parque... | [
"numpy.isnan",
"pyarrow.Table.from_pandas",
"pandas.read_parquet",
"xarray.open_zarr",
"xarray.apply_ufunc",
"pyarrow.parquet.ParquetWriter"
] | [((783, 874), 'xarray.open_zarr', 'xr.open_zarr', (['zarr_file'], {'chunks': "{'frequency': 'auto', 'ping_time': 'auto', 'range': -1}"}), "(zarr_file, chunks={'frequency': 'auto', 'ping_time': 'auto',\n 'range': -1})\n", (795, 874), True, 'import xarray as xr\n'), ((1904, 2102), 'xarray.apply_ufunc', 'xr.apply_ufunc... |
# Copyright 2022 Quantapix Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
"datasets.load_dataset",
"faiss.IndexHNSWFlat",
"faiss.read_index",
"os.path.isdir",
"numpy.hstack",
"time.time",
"pickle.load",
"datasets.load_from_disk",
"numpy.array",
"os.path.join"
] | [((2300, 2334), 'os.path.join', 'os.path.join', (['index_path', 'filename'], {}), '(index_path, filename)\n', (2312, 2334), False, 'import os\n'), ((3670, 3707), 'faiss.read_index', 'faiss.read_index', (['resolved_index_path'], {}), '(resolved_index_path)\n', (3686, 3707), False, 'import faiss\n'), ((4227, 4273), 'fais... |
import sys
import os, os.path
import subprocess
import numpy
if __name__ == "__main__":
formula = sys.argv[1]
kind = sys.argv[2]
program = "bsub"
params = ["-n", "4", "-W", "04:00", "-R", "\"rusage[mem=4096]\""]
run_string = "\"mpirun -n 4 gpaw-python run_doping.py {0} {1} {2:.2f}\""
for fermi_... | [
"numpy.linspace"
] | [((329, 358), 'numpy.linspace', 'numpy.linspace', (['(-1.0)', '(1.0)', '(41)'], {}), '(-1.0, 1.0, 41)\n', (343, 358), False, 'import numpy\n'), ((585, 614), 'numpy.linspace', 'numpy.linspace', (['(-1.0)', '(1.0)', '(41)'], {}), '(-1.0, 1.0, 41)\n', (599, 614), False, 'import numpy\n')] |
import numpy as np
import utils
from torch import nn
import torch
import torch.nn.functional as F
from metrics import AllInOneMeter
import time
import torchvision.transforms as transforms
def validation_binary(model: nn.Module, criterion, valid_loader, device, device_id, num_classes=None):
with torch.no_grad():
... | [
"numpy.histogramdd",
"torch.nn.functional.binary_cross_entropy_with_logits",
"time.time",
"torch.cuda.is_available",
"torch.nn.functional.sigmoid",
"metrics.AllInOneMeter",
"torchvision.transforms.Normalize",
"torch.no_grad"
] | [((2637, 2741), 'numpy.histogramdd', 'np.histogramdd', (['replace_indices'], {'bins': '(nr_labels, nr_labels)', 'range': '[(0, nr_labels), (0, nr_labels)]'}), '(replace_indices, bins=(nr_labels, nr_labels), range=[(0,\n nr_labels), (0, nr_labels)])\n', (2651, 2741), True, 'import numpy as np\n'), ((303, 318), 'torch... |
import numpy
from .base import Algorithm, Model
from collections import OrderedDict
class LinearRegression(Algorithm):
def __init__(self, features=[], label='label', prediction='prediction', fit_intercept=True):
super().__init__(features=features, label=label, prediction=prediction, fit_intercept=fit_int... | [
"numpy.dot",
"numpy.transpose",
"numpy.insert"
] | [((453, 471), 'numpy.transpose', 'numpy.transpose', (['X'], {}), '(X)\n', (468, 471), False, 'import numpy\n'), ((1061, 1085), 'numpy.dot', 'numpy.dot', (['X', 'self._coef'], {}), '(X, self._coef)\n', (1070, 1085), False, 'import numpy\n'), ((409, 438), 'numpy.insert', 'numpy.insert', (['X', '(0)', '(1)'], {'axis': '(1... |
"""
module documentation
"""
import numpy as np
import imageio
import tensorflow as tf
import requests # für http
from . import checkpoint
from . import layer
from . import graph
from .ops import * # das müsste ok sein, weil operations sehr spezielle namen haben und sich da nichts in die quere kommt
from . import m... | [
"skimage.measure.block_reduce",
"matplotlib.pyplot.imshow",
"numpy.transpose",
"tensorflow.cast",
"numpy.reshape",
"requests.get",
"tensorflow.io.read_file",
"matplotlib.pyplot.subplots",
"numpy.dstack",
"numpy.stack",
"matplotlib.image.imread",
"matplotlib.pyplot.show",
"math.sqrt",
"tens... | [((1641, 1705), 'matplotlib.image.imread', 'mpimg.imread', (["('/content/drive/My Drive/colab/images/' + filename)"], {}), "('/content/drive/My Drive/colab/images/' + filename)\n", (1653, 1705), True, 'import matplotlib.image as mpimg\n'), ((1864, 1892), 'tensorflow.io.read_file', 'tf.io.read_file', (['path_to_img'], {... |
import numpy as np
import pandas as pd
import mechbayes.util as util
import mechbayes.jhu as jhu
from pathlib import Path
import warnings
'''Submission'''
def create_submission_file(prefix, forecast_date, model, data, places, submit_args):
print(f"Creating submission file in {prefix}")
samples_directory ... | [
"pandas.DataFrame",
"mechbayes.util.resample_to_weekly",
"pandas.read_csv",
"numpy.percentile",
"pathlib.Path",
"pandas.to_datetime",
"mechbayes.util.load_samples",
"pandas.Timedelta",
"warnings.warn",
"mechbayes.util.construct_daily_df",
"mechbayes.jhu.get_county_info"
] | [((638, 652), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (650, 652), True, 'import pandas as pd\n'), ((674, 703), 'pandas.to_datetime', 'pd.to_datetime', (['forecast_date'], {}), '(forecast_date)\n', (688, 703), True, 'import pandas as pd\n'), ((2285, 2329), 'pandas.read_csv', 'pd.read_csv', (['f"""{resource... |
import os
import numpy as np
from keras.layers import Dense
from keras.models import Sequential
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
class Model:
def name(self):
return "Keras MLP"
def train(self, x_train, y_train):
num_classes = y_train.shape[1]
self.model = Sequential()
... | [
"keras.models.Sequential",
"numpy.asarray",
"keras.layers.Dense"
] | [((302, 314), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (312, 314), False, 'from keras.models import Sequential\n'), ((780, 802), 'numpy.asarray', 'np.asarray', (['bool_preds'], {}), '(bool_preds)\n', (790, 802), True, 'import numpy as np\n'), ((338, 394), 'keras.layers.Dense', 'Dense', (['(20)'], {'in... |
import pandas as pd
import numpy as np
s = pd.Series(np.tile([3,5],2))
print(s) | [
"numpy.tile"
] | [((55, 73), 'numpy.tile', 'np.tile', (['[3, 5]', '(2)'], {}), '([3, 5], 2)\n', (62, 73), True, 'import numpy as np\n')] |
"""
Main script to fine-tuning the Wav2Vec model.
author: <NAME>. Adapted from the tutorial: https://colab.research.google.com/github/m3hrdadfi/soxan/blob/main/notebooks/Emotion_recognition_in_Greek_speech_using_Wav2Vec2.ipynb
date: 03/2022
Usage:
e.g.
python3 MMEmotionRecognition/src/Audio/FineTuningWav... | [
"sys.path.append",
"pandas.DataFrame",
"datasets.load_dataset",
"transformers.TrainingArguments",
"numpy.random.seed",
"argparse.ArgumentParser",
"os.makedirs",
"torchaudio.transforms.Resample",
"numpy.argmax",
"datetime.datetime.now",
"time.sleep",
"pathlib.Path",
"random.seed",
"torchaud... | [((996, 1016), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (1011, 1016), False, 'import sys\n'), ((1017, 1038), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (1032, 1038), False, 'import sys\n'), ((1039, 1064), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}),... |
import model3 as M
import numpy as np
import tensorflow as tf
import data_reader
class VariationalDrop(M.Model):
# arxiv 1512.05287
def initialize(self, drop_rate):
self.drop_rate = drop_rate
def _get_mask(self, shape):
# (time, batch, dim)
mask = np.random.choice(2, size=(1, shape[1], shape[2]), p=[1-self... | [
"model3.Saver",
"model3.LSTM",
"tensorflow.square",
"data_reader.data_reader",
"tensorflow.convert_to_tensor",
"tensorflow.reduce_mean",
"tensorflow.optimizers.Adam",
"model3.Dense",
"numpy.random.choice",
"tensorflow.GradientTape"
] | [((1014, 1039), 'data_reader.data_reader', 'data_reader.data_reader', ([], {}), '()\n', (1037, 1039), False, 'import data_reader\n'), ((1067, 1092), 'tensorflow.optimizers.Adam', 'tf.optimizers.Adam', (['(0.001)'], {}), '(0.001)\n', (1085, 1092), True, 'import tensorflow as tf\n'), ((1102, 1116), 'model3.Saver', 'M.Sav... |
import pytest
import numpy as np
from pytsmp import pytsmp
from tests import helpers
class TestMatrixProfile:
def test_MatrixProfile_init(self):
with pytest.raises(TypeError):
t = np.random.rand(1000)
mp = pytsmp.MatrixProfile(t, window_size=100, verbose=False)
class TestSTAMP:
... | [
"numpy.abs",
"numpy.allclose",
"tests.helpers.naive_matrix_profile",
"pytsmp.pytsmp.STAMP",
"pytsmp.pytsmp.SCRIMP",
"pytsmp.pytsmp.MatrixProfile",
"pytest.raises",
"numpy.random.randint",
"pytsmp.pytsmp.PreSCRIMP",
"numpy.loadtxt",
"numpy.tile",
"numpy.random.rand",
"pytest.mark.skip",
"py... | [((42167, 42281), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Randomized tests on approximate algorithms do not seem a correct thing to do."""'}), "(reason=\n 'Randomized tests on approximate algorithms do not seem a correct thing to do.'\n )\n", (42183, 42281), False, 'import pytest\n'), ((43065,... |
#!/home/andrew/.envs/venv38/bin/python3
import sys
import numpy as np
def get_input():
for line in sys.stdin:
line = line.strip()
if len(line) == 0:
continue
if line.startswith("target area:"):
fields = line.split()
x_region = tuple(int(x) for x in field... | [
"numpy.maximum",
"numpy.cumsum",
"numpy.max",
"numpy.array",
"numpy.arange"
] | [((1280, 1333), 'numpy.arange', 'np.arange', (["v0['y']", "(v0['y'] - n_points)", '(-1)'], {'dtype': 'int'}), "(v0['y'], v0['y'] - n_points, -1, dtype=int)\n", (1289, 1333), True, 'import numpy as np\n'), ((1356, 1379), 'numpy.cumsum', 'np.cumsum', (['velocities_y'], {}), '(velocities_y)\n', (1365, 1379), True, 'import... |
import numpy as np
class NeuralNetwork():
def __init__(self):
# DO NOT CHANGE PARAMETERS
self.input_to_hidden_weights = np.matrix('1 1; 1 1; 1 1')
self.hidden_to_output_weights = np.matrix('1 1 1')
self.biases = np.matrix('0; 0; 0')
self.learning_rate = .001
self.ep... | [
"numpy.matrix",
"numpy.vectorize",
"numpy.maximum",
"numpy.array",
"numpy.dot"
] | [((142, 168), 'numpy.matrix', 'np.matrix', (['"""1 1; 1 1; 1 1"""'], {}), "('1 1; 1 1; 1 1')\n", (151, 168), True, 'import numpy as np\n'), ((209, 227), 'numpy.matrix', 'np.matrix', (['"""1 1 1"""'], {}), "('1 1 1')\n", (218, 227), True, 'import numpy as np\n'), ((250, 270), 'numpy.matrix', 'np.matrix', (['"""0; 0; 0""... |
import numpy as np
from tensorflow.contrib.keras.api.keras.models import Sequential,load_model
from tensorflow.contrib.keras.api.keras.layers import Conv2D, MaxPooling2D
from tensorflow.contrib.keras.api.keras.layers import Dropout, Flatten, Dense
import cv2
class Classifier():
def __init__(self,img_shape):
... | [
"numpy.zeros_like",
"tensorflow.contrib.keras.api.keras.layers.Conv2D",
"tensorflow.contrib.keras.api.keras.models.Sequential",
"tensorflow.contrib.keras.api.keras.layers.MaxPooling2D",
"tensorflow.contrib.keras.api.keras.layers.Dense",
"tensorflow.contrib.keras.api.keras.layers.Flatten",
"numpy.array",... | [((408, 420), 'tensorflow.contrib.keras.api.keras.models.Sequential', 'Sequential', ([], {}), '()\n', (418, 420), False, 'from tensorflow.contrib.keras.api.keras.models import Sequential, load_model\n'), ((1527, 1549), 'tensorflow.contrib.keras.api.keras.models.load_model', 'load_model', (['model_path'], {}), '(model_p... |
## THIS FUNCTION IS UNUSED - THE ACTIVE VERSION LIES IN hs.py
from numba import double, jit, njit, vectorize
from numba import int32, float32, uint8, float64, int64, boolean
import numpy as np
import time
# Apply a line and step function
from numpy import cos, sin, radians
@njit#@vectorize(["boolean (float32, float3... | [
"numpy.stack",
"numpy.radians",
"numpy.meshgrid",
"numpy.multiply",
"numba.float32",
"numpy.zeros",
"numpy.sin",
"numpy.array",
"numpy.linspace",
"numpy.cos"
] | [((2085, 2109), 'numpy.stack', 'np.stack', (['(a, b)'], {'axis': '(2)'}), '((a, b), axis=2)\n', (2093, 2109), True, 'import numpy as np\n'), ((2125, 2186), 'numpy.zeros', 'np.zeros', (['(subsets.shape[0], subsets.shape[0])'], {'dtype': 'np.bool'}), '((subsets.shape[0], subsets.shape[0]), dtype=np.bool)\n', (2133, 2186)... |
from __future__ import absolute_import
import numpy as np
import os
import unittest
from numpy.testing import assert_array_almost_equal
from .. import parse_spectrum
FIXTURE_PATH = os.path.dirname(__file__)
FIXTURE_DATA = np.array([[0.4,3.2],[1.2,2.7],[2.0,5.4]])
class TextFormatTests(unittest.TestCase):
def test... | [
"unittest.main",
"os.path.dirname",
"numpy.array",
"numpy.testing.assert_array_almost_equal",
"os.path.join"
] | [((183, 208), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (198, 208), False, 'import os\n'), ((224, 270), 'numpy.array', 'np.array', (['[[0.4, 3.2], [1.2, 2.7], [2.0, 5.4]]'], {}), '([[0.4, 3.2], [1.2, 2.7], [2.0, 5.4]])\n', (232, 270), True, 'import numpy as np\n'), ((764, 779), 'unittest... |
from typing import Dict, List, Union, Any
import numpy as np
import numpy.linalg as la
from graphik.robots import RobotPlanar
from graphik.graphs.graph_base import ProblemGraph
from graphik.utils import *
from liegroups.numpy import SE2, SO2
import networkx as nx
from numpy import cos, pi
from math import sqrt
class ... | [
"numpy.math.atan2",
"liegroups.numpy.SO2.identity",
"numpy.linalg.norm",
"liegroups.numpy.SO2.from_angle",
"networkx.compose",
"networkx.empty_graph",
"numpy.array",
"numpy.cos",
"networkx.DiGraph",
"numpy.vstack"
] | [((597, 624), 'networkx.compose', 'nx.compose', (['base', 'structure'], {}), '(base, structure)\n', (607, 624), True, 'import networkx as nx\n'), ((860, 910), 'networkx.DiGraph', 'nx.DiGraph', (["[('p0', 'x'), ('p0', 'y'), ('x', 'y')]"], {}), "([('p0', 'x'), ('p0', 'y'), ('x', 'y')])\n", (870, 910), True, 'import netwo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 2 19:07:01 2021
@author: wyattpetryshen
"""
# Code templates for Ornstein-Uhlenbeck process and Brownian motion are from IPython Interactive Computing and Visualization Cookbook, Second Edition (2018), by <NAME>.
import numpy as np
import matplot... | [
"matplotlib.pyplot.title",
"numpy.subtract",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"matplotlib.pyplot.scatter",
"numpy.zeros",
"matplotlib.pyplot.axis",
"time.time",
"numpy.sin",
"numpy.arange",
"numpy.linalg.norm",
"numpy.linspace",
"numpy.mean",
"numpy.dot",
"matplotlib.pyplo... | [((1568, 1601), 'numpy.arange', 'np.arange', (['(0)', '(10)', '(1 / sample_rate)'], {}), '(0, 10, 1 / sample_rate)\n', (1577, 1601), True, 'import numpy as np\n'), ((1904, 1926), 'numpy.linspace', 'np.linspace', (['(0.0)', 'T', 'n'], {}), '(0.0, T, n)\n', (1915, 1926), True, 'import numpy as np\n'), ((2026, 2037), 'num... |
#!/usr/bin/env python
import pickle
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
fast_file_name = 'photobleaching_mixture00_grid.csv'
slow_file_name = 'photobleaching_mixture01_grid.csv'
data_fast = np.genfromtxt(fast_file_name, delimiter = ',', skip_header = True)
data_slow = np.genfrom... | [
"pickle.dump",
"numpy.genfromtxt"
] | [((231, 293), 'numpy.genfromtxt', 'np.genfromtxt', (['fast_file_name'], {'delimiter': '""","""', 'skip_header': '(True)'}), "(fast_file_name, delimiter=',', skip_header=True)\n", (244, 293), True, 'import numpy as np\n'), ((310, 372), 'numpy.genfromtxt', 'np.genfromtxt', (['slow_file_name'], {'delimiter': '""","""', 's... |
"""
do gradients flow into vqvae codebook?
"""
import torch
from torch import nn, optim, autograd
import numpy as np
import math, time
def run():
num_codes = 5
N = 7
K = 3
np.random.seed(123)
torch.manual_seed(123)
Z = torch.from_numpy(np.random.choice(num_codes, N, replace=True))
print('Z'... | [
"torch.manual_seed",
"numpy.random.choice",
"numpy.random.seed",
"torch.rand"
] | [((189, 208), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (203, 208), True, 'import numpy as np\n'), ((213, 235), 'torch.manual_seed', 'torch.manual_seed', (['(123)'], {}), '(123)\n', (230, 235), False, 'import torch\n'), ((534, 550), 'torch.rand', 'torch.rand', (['N', 'K'], {}), '(N, K)\n', (544... |
from typing import List
import numpy as np
Tensor = List[float]
def single_output(xdata: List[Tensor], ydata: List[Tensor]) -> List[Tensor]:
xdata = np.asarray(xdata)
ydata = np.asarray(ydata)
| [
"numpy.asarray"
] | [((155, 172), 'numpy.asarray', 'np.asarray', (['xdata'], {}), '(xdata)\n', (165, 172), True, 'import numpy as np\n'), ((185, 202), 'numpy.asarray', 'np.asarray', (['ydata'], {}), '(ydata)\n', (195, 202), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 17 14:53:05 2017
@author: manu
Step 1 : Modify the 1KGP OMNI maps to have same physical positions(bp) by interpolation
"""
import pandas as pd
import os
from scipy.interpolate import interp1d
import numpy as np
omni="../OMNI/" #... | [
"pandas.DataFrame",
"os.makedirs",
"pandas.merge",
"os.path.exists",
"numpy.diff",
"pandas.read_table",
"scipy.interpolate.interp1d",
"os.listdir"
] | [((474, 490), 'os.listdir', 'os.listdir', (['omni'], {}), '(omni)\n', (484, 490), False, 'import os\n'), ((1431, 1447), 'os.listdir', 'os.listdir', (['omni'], {}), '(omni)\n', (1441, 1447), False, 'import os\n'), ((551, 573), 'os.listdir', 'os.listdir', (['(omni + pop)'], {}), '(omni + pop)\n', (561, 573), False, 'impo... |
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
import random
import time
import sys
def display_image(window_name, img):
"""
Displays image with given window name.
:param window_name: name of the window
:param img: image object to display
"""
cv.imshow(window_name, im... | [
"cv2.GaussianBlur",
"cv2.integral",
"numpy.sum",
"numpy.argmax",
"cv2.sepFilter2D",
"cv2.medianBlur",
"cv2.bilateralFilter",
"numpy.exp",
"cv2.imshow",
"random.randint",
"cv2.filter2D",
"cv2.copyMakeBorder",
"cv2.destroyAllWindows",
"cv2.equalizeHist",
"numpy.size",
"cv2.waitKey",
"c... | [((295, 322), 'cv2.imshow', 'cv.imshow', (['window_name', 'img'], {}), '(window_name, img)\n', (304, 322), True, 'import cv2 as cv\n'), ((327, 340), 'cv2.waitKey', 'cv.waitKey', (['(0)'], {}), '(0)\n', (337, 340), True, 'import cv2 as cv\n'), ((345, 367), 'cv2.destroyAllWindows', 'cv.destroyAllWindows', ([], {}), '()\n... |
# CSE Drone Team 2020
import numpy as np
import cv2
import cv2.aruco as aruco
import sys, time, math
class ArucoTracker():
def __init__(self, tracker_id, tracker_size, mtx, dst, camera_size=[640,480], gui=False):
#Marker information
self.tracker_id = tracker_id
self.tracker_s... | [
"math.atan",
"cv2.aruco.estimatePoseSingleMarkers",
"cv2.aruco.drawDetectedMarkers",
"cv2.aruco.DetectorParameters_create",
"cv2.putText",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.destroyAllWindows",
"time.time",
"cv2.aruco.Dictionary_get",
"cv2.VideoCapture",
"cv2.aruco.detectMarkers",
"numpy.sh... | [((5528, 5579), 'numpy.loadtxt', 'np.loadtxt', (['"""calib/cameraMatrix.txt"""'], {'delimiter': '""","""'}), "('calib/cameraMatrix.txt', delimiter=',')\n", (5538, 5579), True, 'import numpy as np\n'), ((5592, 5647), 'numpy.loadtxt', 'np.loadtxt', (['"""calib/cameraDistortion.txt"""'], {'delimiter': '""","""'}), "('cali... |
#!/usr/bin/env python
import os
import time
import traceback
from argparse import ArgumentParser
from glob import glob
import numpy as np
import tensorflow as tf
from scipy.misc import imread, imsave
from utils import (get_hand_segmentation_for_image, get_combined_segmentation_for_image,
get_patho... | [
"utils.get_patho_segmentation_for_image",
"utils.get_combined_segmentation_for_image",
"numpy.count_nonzero",
"argparse.ArgumentParser",
"tensorflow.logging.info",
"os.path.basename",
"tensorflow.logging.set_verbosity",
"time.time",
"utils.get_hand_segmentation_for_image",
"os.path.splitext",
"t... | [((471, 487), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (485, 487), False, 'from argparse import ArgumentParser\n'), ((2610, 2721), 'tensorflow.logging.info', 'tf.logging.info', (['"""There seems to be exactly one hand, pathology, and combined segmentation per image"""'], {}), "(\n 'There seems ... |
import numpy as np
from numpy.linalg import inv
def ukfupdate(xsigmapts, ysigmapts, yobs, sigw):
"""Provides Updated mean and covariance.
:param xsigmapts: prior state sigma points.
:param ysigmapts: measurement generated by prior state sigma points.
:param yobs: actual measurement.
:param sigw: ... | [
"numpy.shape",
"numpy.linalg.inv",
"numpy.zeros",
"numpy.matmul"
] | [((572, 590), 'numpy.zeros', 'np.zeros', (['(l1, l1)'], {}), '((l1, l1))\n', (580, 590), True, 'import numpy as np\n'), ((601, 619), 'numpy.zeros', 'np.zeros', (['(l1, l1)'], {}), '((l1, l1))\n', (609, 619), True, 'import numpy as np\n'), ((630, 648), 'numpy.zeros', 'np.zeros', (['(l1, l1)'], {}), '((l1, l1))\n', (638,... |
import numpy as np
def realization(p_1, p_2, n_trials):
p_3 = 1.0 - p_1 - p_2
outcomes = np.random.random(n_trials)
ii_1 = outcomes<=p_1
ii_2 = (outcomes>p_1) & (outcomes<=(p_1+p_2))
ii_3 = (~ii_1) & (~ii_2)
outcomes[ii_1] = 1
outcomes[ii_2] = 2
outcomes[ii_3] = 3
N_1 = len(outc... | [
"numpy.random.random",
"numpy.zeros"
] | [((99, 125), 'numpy.random.random', 'np.random.random', (['n_trials'], {}), '(n_trials)\n', (115, 125), True, 'import numpy as np\n'), ((468, 506), 'numpy.zeros', 'np.zeros', (['[n_trials + 1, n_trials + 1]'], {}), '([n_trials + 1, n_trials + 1])\n', (476, 506), True, 'import numpy as np\n')] |
import os
import random
import string
import numpy as np
import pandas as pd
from sklearn import preprocessing
from pymilvus_orm.types import DataType
from base.schema_wrapper import ApiCollectionSchemaWrapper, ApiFieldSchemaWrapper
from common import common_type as ct
from utils.util_log import test_log as log
import... | [
"numpy.bitwise_xor",
"utils.util_log.test_log.error",
"os.path.isfile",
"numpy.arange",
"base.schema_wrapper.ApiFieldSchemaWrapper",
"numpy.bitwise_or",
"pandas.DataFrame",
"base.schema_wrapper.ApiCollectionSchemaWrapper",
"random.randint",
"utils.util_log.test_log.debug",
"utils.util_log.test_l... | [((3773, 3824), 'sklearn.preprocessing.normalize', 'preprocessing.normalize', (['vectors'], {'axis': '(1)', 'norm': '"""l2"""'}), "(vectors, axis=1, norm='l2')\n", (3796, 3824), False, 'from sklearn import preprocessing\n'), ((4483, 4641), 'pandas.DataFrame', 'pd.DataFrame', (['{ct.default_int64_field_name: int_values,... |
import datetime
import os
from collections import deque
import random
import numpy as np
import tensorflow as tf
import pysc2.agents.myAgent.myAgent_6.config.config as config
from pysc2.agents.myAgent.myAgent_6.net.lenet import Lenet
class DQN():
def __init__(self, mu, sigma, learning_rate, actiondim, paramete... | [
"numpy.random.uniform",
"os.makedirs",
"tensorflow.train.Saver",
"numpy.argmax",
"numpy.random.rand",
"random.sample",
"numpy.zeros",
"numpy.append",
"pysc2.agents.myAgent.myAgent_6.net.lenet.Lenet",
"tensorflow.summary.FileWriter",
"numpy.array",
"numpy.random.randint",
"tensorflow.initiali... | [((418, 450), 'collections.deque', 'deque', ([], {'maxlen': 'config.REPLAY_SIZE'}), '(maxlen=config.REPLAY_SIZE)\n', (423, 450), False, 'from collections import deque\n'), ((845, 959), 'pysc2.agents.myAgent.myAgent_6.net.lenet.Lenet', 'Lenet', (['self.mu', 'self.sigma', 'self.learning_rate', 'self.action_dim', 'self.pa... |
import logging
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',
datefmt='%Y/%m/%d %H:%M:%S',
level=logging.INFO,
)
logger = logging.getLogger("Main")
import os,random
import numpy as np
import torch
from utils_glue import output_modes, processors
from pytorch_pretrai... | [
"numpy.random.seed",
"torch.utils.data.RandomSampler",
"numpy.argmax",
"pytorch_pretrained_bert.BertTokenizer",
"textbrewer.MultiTeacherDistiller",
"torch.cuda.device_count",
"config.parse",
"pytorch_pretrained_bert.my_modeling.BertConfig.from_json_file",
"torch.device",
"modeling.BertForGLUESimpl... | [((15, 157), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(name)s - %(message)s"""', 'datefmt': '"""%Y/%m/%d %H:%M:%S"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt=\n '%Y/%m/%d %H:%M:%S', level=logg... |
import numpy as np
import random,copy
from scipy.sparse import csr_matrix
import scipy.integrate
from numpy import linalg
import time
import settings
import math
####PAULI OPERATORS####
def sigma_x_operator(basis_vector,indices,pos_sigma=-1):
"""Operator that creates the matrix representation of sigma_x."""
... | [
"numpy.trace",
"numpy.zeros_like",
"numpy.multiply",
"numpy.std",
"numpy.vdot",
"numpy.zeros",
"numpy.transpose",
"numpy.identity",
"copy.copy",
"random.random",
"scipy.sparse.csr_matrix",
"numpy.mean",
"numpy.reshape",
"numpy.linalg.norm",
"numpy.sqrt"
] | [((731, 751), 'numpy.zeros', 'np.zeros', (['(dim, dim)'], {}), '((dim, dim))\n', (739, 751), True, 'import numpy as np\n'), ((2582, 2595), 'numpy.zeros', 'np.zeros', (['dim'], {}), '(dim)\n', (2590, 2595), True, 'import numpy as np\n'), ((3320, 3333), 'numpy.zeros', 'np.zeros', (['dim'], {}), '(dim)\n', (3328, 3333), T... |
import pytest
try:
from unittest import mock
except ImportError:
import mock
from collections import defaultdict, Counter
import itertools
import numpy as np
from openpathsampling.tests.test_helpers import make_1d_traj
from .serialization_helpers import get_uuid, set_uuid
from .storable_functions import *
_... | [
"collections.Counter",
"pytest.skip",
"mock.patch",
"collections.defaultdict",
"mock.NonCallableMock",
"pytest.raises",
"numpy.array",
"itertools.product",
"pytest.mark.parametrize",
"mock.MagicMock",
"openpathsampling.tests.test_helpers.make_1d_traj"
] | [((1438, 1630), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""array_input,expected"""', '[([[1], [2], [3]], [1, 2, 3]), ([1, 2, 3], [1, 2, 3]), ([[1, 2], [3, 4]], [\n [1, 2], [3, 4]]), ([[[1, 2]], [[3, 4]]], [[1, 2], [3, 4]])]'], {}), "('array_input,expected', [([[1], [2], [3]], [1, 2, 3\n ]), ([1, ... |
# -*- coding: utf-8 -*-
"""
Functions to calculate the color of a multilayer thin film under reflected
light. A perfect mirror will look white, because we imagine seeing the white
light source ("illuminant") reflected in it. A half-reflective mirror will be
gray, a non-reflective surface will be black, etc. See tmm.exa... | [
"colorpy.ciexyz.xyz_from_spectrum",
"numpy.all",
"colorpy.plots.spectrum_plot",
"numpy.array",
"numpy.arange",
"colorpy.colormodels.irgb_from_rgb",
"colorpy.colormodels.rgb_from_xyz"
] | [((2541, 2557), 'numpy.arange', 'arange', (['(360)', '(831)'], {}), '(360, 831)\n', (2547, 2557), False, 'from numpy import arange, array\n'), ((3416, 3435), 'numpy.array', 'array', (['final_answer'], {}), '(final_answer)\n', (3421, 3435), False, 'from numpy import arange, array\n'), ((4564, 4583), 'numpy.array', 'arra... |
#!/usr/bin/env python
import sys
import os
import numpy as np
from BaseDriver import LabberDriver, Error
sys.path.append('C:\\Program Files (x86)\\Keysight\\SD1\\Libraries\\Python')
import keysightSD1
class Driver(LabberDriver):
"""Keysigh PXI HVI trigger"""
def performOpen(self, options={}):
"""Perf... | [
"sys.path.append",
"BaseDriver.Error",
"keysightSD1.SD_Module.getProductNameByIndex",
"keysightSD1.SD_Module.getSlotByIndex",
"os.path.realpath",
"keysightSD1.SD_Module.moduleCount",
"keysightSD1.SD_HVI",
"keysightSD1.SD_Module.getChassisByIndex",
"numpy.array",
"os.path.join",
"keysightSD1.SD_E... | [((105, 181), 'sys.path.append', 'sys.path.append', (['"""C:\\\\Program Files (x86)\\\\Keysight\\\\SD1\\\\Libraries\\\\Python"""'], {}), "('C:\\\\Program Files (x86)\\\\Keysight\\\\SD1\\\\Libraries\\\\Python')\n", (120, 181), False, 'import sys\n'), ((585, 620), 'keysightSD1.SD_Module.moduleCount', 'keysightSD1.SD_Modu... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 20:23:01 2020
@author: wantysal
"""
# Standard library imports
import numpy as np
# Mosqito functions import
from mosqito.sq_metrics.tonality.tone_to_noise_ecma._spectrum_smoothing import _spectrum_smoothing
from mosqito.sq_metrics.tonality.tone_to_noise_ecma._LTH imp... | [
"mosqito.sq_metrics.tonality.tone_to_noise_ecma._critical_band._critical_band",
"mosqito.sq_metrics.tonality.tone_to_noise_ecma._LTH._LTH",
"numpy.asarray",
"numpy.append",
"numpy.where",
"numpy.arange",
"numpy.diff",
"mosqito.sq_metrics.tonality.tone_to_noise_ecma._spectrum_smoothing._spectrum_smooth... | [((5967, 5998), 'numpy.asarray', 'np.asarray', (['tones'], {'dtype': 'object'}), '(tones, dtype=object)\n', (5977, 5998), True, 'import numpy as np\n'), ((1765, 1834), 'mosqito.sq_metrics.tonality.tone_to_noise_ecma._spectrum_smoothing._spectrum_smoothing', '_spectrum_smoothing', (['freqs', 'spec_db.T', '(24)', 'low_fr... |
"""Variable is a one-dimensional discrete and continuous real variable class.
<NAME>, July 2005
"""
# ----------------------------------------------------------------------------
from __future__ import absolute_import, print_function
# PyDSTool imports
from .utils import *
from .common import *
from .c... | [
"six.exec_",
"numpy.asarray",
"copy.copy",
"numpy.isfinite",
"numpy.array",
"numpy.all"
] | [((45847, 45871), 'copy.copy', 'copy.copy', (['self.__dict__'], {}), '(self.__dict__)\n', (45856, 45871), False, 'import copy\n'), ((51884, 51927), 'numpy.array', 'array', (['[vs.indepvararray, vs.coordarray[0]]'], {}), '([vs.indepvararray, vs.coordarray[0]])\n', (51889, 51927), False, 'from numpy import Inf, NaN, isfi... |
import unittest
import numpy
import pytest
import dpnp as cupy
from tests.third_party.cupy import testing
# from cupy.core import _accelerator
@testing.gpu
class TestSearch(unittest.TestCase):
@testing.for_all_dtypes(no_complex=True)
@testing.numpy_cupy_allclose()
def test_argmax_all(self, xp, dtype):
... | [
"tests.third_party.cupy.testing.product",
"tests.third_party.cupy.testing.for_all_dtypes",
"tests.third_party.cupy.testing.parameterize",
"tests.third_party.cupy.testing.for_all_dtypes_combination",
"numpy.empty",
"tests.third_party.cupy.testing.with_requires",
"pytest.raises",
"tests.third_party.cupy... | [((8409, 8713), 'tests.third_party.cupy.testing.parameterize', 'testing.parameterize', (["{'cond_shape': (2, 3, 4), 'x_shape': (2, 3, 4), 'y_shape': (2, 3, 4)}", "{'cond_shape': (4,), 'x_shape': (2, 3, 4), 'y_shape': (2, 3, 4)}", "{'cond_shape': (2, 3, 4), 'x_shape': (2, 3, 4), 'y_shape': (3, 4)}", "{'cond_shape': (3, ... |
"""Provides an easy way of generating several geometric objects.
CONTAINS
--------
vtkArrowSource
vtkCylinderSource
vtkSphereSource
vtkPlaneSource
vtkLineSource
vtkCubeSource
vtkConeSource
vtkDiskSource
vtkRegularPolygonSource
vtkPyramid
vtkPlatonicSolidSource
vtkSuperquadricSource
as well as some pure-python helpers... | [
"numpy.sum",
"pyvista.StructuredGrid",
"numpy.empty",
"numpy.allclose",
"pyvista._vtk.vtkUnstructuredGrid",
"numpy.sin",
"numpy.linalg.norm",
"numpy.arange",
"numpy.full",
"pyvista._vtk.vtkArrowSource",
"numpy.meshgrid",
"pyvista._vtk.vtkTriangleFilter",
"pyvista._vtk.vtkPlaneSource",
"pyv... | [((894, 926), 'numpy.cross', 'np.cross', (['normx', '[0, 1.0, 1e-07]'], {}), '(normx, [0, 1.0, 1e-07])\n', (902, 926), True, 'import numpy as np\n'), ((944, 965), 'numpy.linalg.norm', 'np.linalg.norm', (['normz'], {}), '(normz)\n', (958, 965), True, 'import numpy as np\n'), ((978, 1000), 'numpy.cross', 'np.cross', (['n... |
'''
A class that performs tracking and drift scans
with parameters acquired from the scan queue.
Author: <NAME>
Date: June 2018
'''
from CommandStation import CommandStation
from astropy.coordinates import SkyCoord, EarthLocation, AltAz
from astropy.time import Time
from astropy.table import Table
from astropy import... | [
"io.BytesIO",
"re.split",
"astropy.table.Table",
"astropy.time.Time",
"astropy.coordinates.AltAz",
"CommandStation.CommandStation",
"datetime.date.today",
"sqlite3.connect",
"astropy.coordinates.EarthLocation",
"numpy.linspace",
"srtutility.NTPTime.NTPTime",
"astropy.coordinates.SkyCoord"
] | [((11124, 11168), 'sqlite3.connect', 'sqlite3.connect', (['"""../srtdatabase/srtdata.db"""'], {}), "('../srtdatabase/srtdata.db')\n", (11139, 11168), False, 'import sqlite3\n'), ((527, 543), 'CommandStation.CommandStation', 'CommandStation', ([], {}), '()\n', (541, 543), False, 'from CommandStation import CommandStatio... |
"""
An experimental protocol is handled as a pandas DataFrame
that includes an 'onset' field.
This yields the onset time of the events in the experimental paradigm.
It can also contain:
* a 'trial_type' field that yields the condition identifier.
* a 'duration' field that yields event duration (for so-called ... | [
"warnings.warn",
"numpy.array",
"numpy.ones",
"numpy.repeat"
] | [((1664, 1689), 'numpy.array', 'np.array', (["events['onset']"], {}), "(events['onset'])\n", (1672, 1689), True, 'import numpy as np\n'), ((1794, 1824), 'numpy.array', 'np.array', (["events['trial_type']"], {}), "(events['trial_type'])\n", (1802, 1824), True, 'import numpy as np\n'), ((1842, 1859), 'numpy.ones', 'np.on... |
import numpy as np
from BMA_support import *
from BMA_agent import *
try:
from scipy.special import lambertw
except:
print("could not import lambertw (bounded priors won't work)")
class Node(object):
def __init__(self,name='',dims=[],inds=[],num=1,cp=False):
self.name = name
self.ag = [Age... | [
"numpy.log",
"numpy.copy",
"numpy.einsum",
"numpy.unravel_index",
"numpy.zeros",
"numpy.shape",
"numpy.exp"
] | [((1531, 1579), 'numpy.einsum', 'np.einsum', (['joint.val', 'joint.r', 'self.prior.r[:-1]'], {}), '(joint.val, joint.r, self.prior.r[:-1])\n', (1540, 1579), True, 'import numpy as np\n'), ((1602, 1692), 'numpy.einsum', 'np.einsum', (['(1.0 / (Z + 1e-55))', 'self.prior.r[:-1]', 'joint.val', 'joint.r', 'self.post.r[:-1]'... |
import logging
import numpy as np
from monai.transforms import LoadImage
from monailabel.interfaces.datastore import Datastore, DefaultLabelTag
from monailabel.interfaces.tasks import ScoringMethod
logger = logging.getLogger(__name__)
class Sum(ScoringMethod):
"""
Consider implementing simple np sum method... | [
"monai.transforms.LoadImage",
"numpy.sum",
"logging.getLogger"
] | [((210, 237), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (227, 237), False, 'import logging\n'), ((650, 676), 'monai.transforms.LoadImage', 'LoadImage', ([], {'image_only': '(True)'}), '(image_only=True)\n', (659, 676), False, 'from monai.transforms import LoadImage\n'), ((1028, 1050)... |
#
# pr8_1_1
from math import pi
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import ellipord, ellip, freqz, group_delay
def freqz_m(b, a):
"""
Modified version of freqz subroutine
:param b: numerator polynomial of H(z) (for FIR: b=h)
:param a: denominator polynomial of H(z) (for FIR: a... | [
"matplotlib.pyplot.title",
"numpy.abs",
"scipy.signal.ellip",
"scipy.signal.group_delay",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.angle",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axis",
"numpy.finfo",
"matplotlib.pyplot.figure",
"numpy.max",
"numpy.array",
"scipy.s... | [((636, 665), 'scipy.signal.freqz', 'freqz', (['b', 'a', '(1000)'], {'whole': '(True)'}), '(b, a, 1000, whole=True)\n', (641, 665), False, 'from scipy.signal import ellipord, ellip, freqz, group_delay\n'), ((701, 710), 'numpy.abs', 'np.abs', (['H'], {}), '(H)\n', (707, 710), True, 'import numpy as np\n'), ((792, 803), ... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.python.data.ops.dataset_ops.Dataset.from_tensors",
"tensorflow.contrib.distribute.python.combinations.combine",
"tensorflow.python.framework.constant_op.constant",
"numpy.ones",
"tensorflow.python.distribute.values.select_replica",
"tensorflow.python.framework.ops.device",
"json.dumps",
"t... | [((2753, 3033), 'tensorflow.contrib.distribute.python.combinations.combine', 'combinations.combine', ([], {'distribution': '[combinations.mirrored_strategy_with_gpu_and_cpu, combinations.\n mirrored_strategy_with_two_gpus, combinations.\n core_mirrored_strategy_with_gpu_and_cpu, combinations.\n core_mirrored_s... |
import numpy
import argparse
from matplotlib import colors
from src.powerspectrum import from_frequency_to_eta
from src.powerspectrum import fiducial_eor_power_spectrum
from src.radiotelescope import RadioTelescope
from src.plottools import plot_2dpower_spectrum
from src.plottools import plot_power_contours
from src... | [
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"src.powerspectrum.fiducial_eor_power_spectrum",
"src.plottools.plot_2dpower_spectrum",
"src.covariance.calibrated_residual_error",
"matplotlib.colors.LogNorm",
"numpy.array",
"matplotlib.use",
"src.powerspectru... | [((663, 694), 'numpy.array', 'numpy.array', (['[1.0, 10.0, 100.0]'], {}), '([1.0, 10.0, 100.0])\n', (674, 694), False, 'import numpy\n'), ((984, 1011), 'numpy.array', 'numpy.array', (['[0.0001, 0.11]'], {}), '([0.0001, 0.11])\n', (995, 1011), False, 'import numpy\n'), ((1136, 1174), 'src.powerspectrum.from_frequency_to... |
"""
Created on Mon Nov 23 2020
@author: <NAME>
"""
import numpy as np
from PIL import Image
import cv2
import time
import copy
import arcpy
from arcpy import env
from arcpy.sa import Viewshed2
#from arcpy.da import *
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import matplotlib.pypl... | [
"math.atan2",
"gym.spaces.Discrete",
"arcpy.sa.Viewshed2",
"cv2.startWindowThread",
"arcpy.ClearWorkspaceCache_management",
"cv2.imshow",
"gym.utils.seeding.np_random",
"numpy.multiply",
"math.radians",
"numpy.max",
"cv2.destroyAllWindows",
"arcpy.NumPyArrayToRaster",
"cv2.resize",
"arcpy.... | [((518, 556), 'arcpy.ClearWorkspaceCache_management', 'arcpy.ClearWorkspaceCache_management', ([], {}), '()\n', (554, 556), False, 'import arcpy\n'), ((762, 809), 'arcpy.SpatialReference', 'arcpy.SpatialReference', (['"""WGS 1984 UTM Zone 18N"""'], {}), "('WGS 1984 UTM Zone 18N')\n", (784, 809), False, 'import arcpy\n'... |
from __future__ import print_function
import warnings
from setuptools import setup, find_packages, Extension
from setuptools.command.install import install
import numpy
from six.moves import input
# from theano.compat.six.moves import input
# Because many people neglected to run the pylearn2/utils/setup.py script
# ... | [
"numpy.get_include",
"warnings.warn",
"setuptools.command.install.install.run",
"six.moves.input",
"setuptools.find_packages"
] | [((576, 786), 'warnings.warn', 'warnings.warn', (['"""Cython was not found and hence pylearn2.utils._window_flip and pylearn2.utils._video and classes that depend on them (e.g. pylearn2.train_extensions.window_flip) will not be available"""'], {}), "(\n 'Cython was not found and hence pylearn2.utils._window_flip and... |
from unittest import TestCase
import numpy as np
from scvi.dataset import (
SyntheticDataset,
SyntheticRandomDataset,
SyntheticDatasetCorr,
ZISyntheticDatasetCorr,
)
from .utils import unsupervised_training_one_epoch
class TestSyntheticDataset(TestCase):
def test_train_one(self):
dataset... | [
"scvi.dataset.SyntheticDataset",
"scvi.dataset.ZISyntheticDatasetCorr",
"scvi.dataset.SyntheticRandomDataset",
"numpy.arange",
"scvi.dataset.SyntheticDatasetCorr",
"numpy.unique"
] | [((323, 367), 'scvi.dataset.SyntheticDataset', 'SyntheticDataset', ([], {'batch_size': '(10)', 'nb_genes': '(10)'}), '(batch_size=10, nb_genes=10)\n', (339, 367), False, 'from scvi.dataset import SyntheticDataset, SyntheticRandomDataset, SyntheticDatasetCorr, ZISyntheticDatasetCorr\n'), ((493, 539), 'scvi.dataset.Synth... |
# Copyright 2020 <NAME>
# SPDX-License-Identifier: Apache-2.0
'''
batch and commandline utilities
'''
from __future__ import print_function
import gc
import os
import ssl
import sys
import site
import shlex
import logging
import warnings
import argparse
import platform
import resource
import subprocess
import time
if ... | [
"sys.stdout.write",
"logging.addLevelName",
"subprocess.list2cmdline",
"logging.Formatter",
"gc.collect",
"pathlib.Path",
"sys.stdout.flush",
"resource.getrusage",
"subprocess.check_call",
"numpy.set_printoptions",
"logging.FileHandler",
"logging.log",
"shlex.split",
"site.getsitepackages"... | [((380, 407), 'warnings.warn', 'warnings.warn', (['"""old python"""'], {}), "('old python')\n", (393, 407), False, 'import warnings\n'), ((6927, 6946), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (6944, 6946), False, 'import logging\n'), ((8334, 8365), 'logging.getLogger', 'logging.getLogger', (['"""ten... |
import unittest
import numpy as np
from collections import namedtuple
from pyrostest import RosTest, with_launch_file, launch_node
from process.bearing import calculate_directions
from sensor_msgs.msg import NavSatFix
from std_msgs.msg import Float64
fix = namedtuple('fix', ['latitude', 'longitude'])
class TestBear... | [
"process.bearing.calculate_directions.get_distance",
"numpy.isclose",
"pyrostest.with_launch_file",
"collections.namedtuple",
"pyrostest.launch_node",
"sensor_msgs.msg.NavSatFix"
] | [((259, 303), 'collections.namedtuple', 'namedtuple', (['"""fix"""', "['latitude', 'longitude']"], {}), "('fix', ['latitude', 'longitude'])\n", (269, 303), False, 'from collections import namedtuple\n'), ((589, 641), 'pyrostest.with_launch_file', 'with_launch_file', (['"""buzzmobile"""', '"""test_params.launch"""'], {}... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"unittest.main",
"paddle.fluid.tests.unittests.op_test.skip_check_grad_ci",
"math.ceil",
"paddle.enable_static",
"numpy.zeros",
"numpy.transpose",
"math.floor",
"numpy.random.random",
"numpy.array"
] | [((2692, 2765), 'paddle.fluid.tests.unittests.op_test.skip_check_grad_ci', 'skip_check_grad_ci', ([], {'reason': '"""Haven not implement interpolate grad kernel."""'}), "(reason='Haven not implement interpolate grad kernel.')\n", (2710, 2765), False, 'from paddle.fluid.tests.unittests.op_test import skip_check_grad_ci\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.