code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import cv2 import numpy as np from torchvision.transforms import ColorJitter from PIL import Image class Compose(object): def __init__(self, transforms): self.transforms = transforms def __call__(self, img, kpts=None): for t in self.transforms: img, kpts = t(img, kpts) if ...
[ "torchvision.transforms.ColorJitter", "numpy.random.uniform", "cv2.GaussianBlur", "cv2.filter2D", "numpy.random.randn", "cv2.imdecode", "numpy.zeros", "numpy.ones", "numpy.clip", "PIL.Image.fromarray", "numpy.random.randint", "cv2.imencode", "numpy.random.choice", "numpy.random.rand", "n...
[((1262, 1316), 'numpy.random.randint', 'np.random.randint', (['self.quality_low', 'self.quality_high'], {}), '(self.quality_low, self.quality_high)\n', (1279, 1316), True, 'import numpy as np\n'), ((1406, 1445), 'cv2.imencode', 'cv2.imencode', (['""".jpg"""', 'img', 'encode_param'], {}), "('.jpg', img, encode_param)\n...
import numpy as np def _calc_A_min_max(tx_min, tx_max, rx_min, rx_max, gT=1.0, gR=0.6, window=7): """Calculate rain rate from attenuation using the A-R Relationship Parameters ---------- gT : float, optional induced bias gR : float, optional induced bias window: int, optional ...
[ "numpy.full", "numpy.isnan", "numpy.nanmean" ]
[((953, 979), 'numpy.full', 'np.full', (['Ac_max.shape', '(0.0)'], {}), '(Ac_max.shape, 0.0)\n', (960, 979), True, 'import numpy as np\n'), ((803, 819), 'numpy.isnan', 'np.isnan', (['Ac_max'], {}), '(Ac_max)\n', (811, 819), True, 'import numpy as np\n'), ((831, 849), 'numpy.nanmean', 'np.nanmean', (['Ac_max'], {}), '(A...
import cv2 import numpy as np import math ''' Get_X_Region - Functions ''' ''' get_rotated_region(data[],labels[],region_size, region_count_per_sample) Description: Takes multiple samples, the size of the regions to be cut and the amount of regions to be extracted from each sample. Then rotate each sample r...
[ "numpy.ones", "numpy.clip", "cv2.warpAffine", "numpy.linalg.svd", "numpy.random.randint", "numpy.diag", "cv2.imshow", "math.pow", "cv2.cvtColor", "math.cos", "numpy.add", "cv2.destroyAllWindows", "cv2.resize", "cv2.waitKey", "numpy.asarray", "math.sin", "numpy.dot", "cv2.resizeWind...
[((1018, 1097), 'numpy.zeros', 'np.zeros', (['(sample_count * region_count_per_sample, region_size, region_size, 1)'], {}), '((sample_count * region_count_per_sample, region_size, region_size, 1))\n', (1026, 1097), True, 'import numpy as np\n'), ((1110, 1189), 'numpy.zeros', 'np.zeros', (['(sample_count * region_count_...
import numpy as np from numpy.linalg import norm import sparse_matrices from reflection import hasArg def genPerturbation(x): return np.random.uniform(low=-1,high=1, size=x.shape) def preamble(obj, xeval, perturb, fixedVars = []): if (xeval is None): xeval = obj.getVars() if (perturb is None): perturb =...
[ "matplotlib.pyplot.loglog", "numpy.random.uniform", "matplotlib.pyplot.title", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplot", "numpy.abs", "numpy.copy", "numpy.ceil", "matplotlib.pyplot.plot", "numpy.logspace", "matplotlib.pyplot.figure", "reflection.hasArg", "numpy.linalg.no...
[((138, 185), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-1)', 'high': '(1)', 'size': 'x.shape'}), '(low=-1, high=1, size=x.shape)\n', (155, 185), True, 'import numpy as np\n'), ((383, 399), 'numpy.copy', 'np.copy', (['perturb'], {}), '(perturb)\n', (390, 399), True, 'import numpy as np\n'), ((5250, 52...
# coding : utf-8 from __future__ import print_function, absolute_import, division, unicode_literals import sys, logging import numpy as np from resfgb.models import ResFGB, LogReg, SVM, get_hyperparams from scripts import sample_data logging.basicConfig( format='%(message)s', level=logging.INFO ) # Set seed seed = 1...
[ "resfgb.models.ResFGB", "numpy.random.seed", "resfgb.models.get_hyperparams", "logging.basicConfig", "logging.info", "scripts.sample_data.get_ijcnn1" ]
[((236, 297), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(message)s"""', 'level': 'logging.INFO'}), "(format='%(message)s', level=logging.INFO)\n", (255, 297), False, 'import sys, logging\n'), ((323, 343), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (337, 343), True, 'impo...
""" Created on Tue Oct 09 16:39:00 2018 @author: <NAME> """ from scipy import special from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy import ndimage import numpy as np from matplotlib import (pyplot as plt, path, patches) Path = path.Path PathPatch = patches.PathPatch erf = special.erf def path_m...
[ "mpl_toolkits.axes_grid1.make_axes_locatable", "numpy.abs", "numpy.copy", "numpy.roll", "numpy.deg2rad", "numpy.isfinite", "numpy.nanmin", "matplotlib.pyplot.colorbar", "numpy.append", "numpy.array" ]
[((1252, 1277), 'numpy.array', 'np.array', (['vertices', 'float'], {}), '(vertices, float)\n', (1260, 1277), True, 'import numpy as np\n'), ((2112, 2127), 'numpy.copy', 'np.copy', (['image_'], {}), '(image_)\n', (2119, 2127), True, 'import numpy as np\n'), ((2210, 2226), 'numpy.nanmin', 'np.nanmin', (['image'], {}), '(...
import numpy as np from swutil.plots import plot_convergence from swutil.np_tools import extrapolate L=100 K=50 base=0.2 coeff = np.random.rand(1,L) hs= 2.**(-np.arange(1,K)) w=2**np.arange(1,K) hs = np.reshape(hs,(-1,1)) hf= hs**(base*np.arange(1,L+1)) T = coeff*hf values = np.sum(T,axis=1) from matplotlib import pypl...
[ "matplotlib.pyplot.show", "numpy.sum", "swutil.plots.plot_convergence", "swutil.np_tools.extrapolate", "numpy.arange", "numpy.reshape", "numpy.random.rand" ]
[((129, 149), 'numpy.random.rand', 'np.random.rand', (['(1)', 'L'], {}), '(1, L)\n', (143, 149), True, 'import numpy as np\n'), ((200, 223), 'numpy.reshape', 'np.reshape', (['hs', '(-1, 1)'], {}), '(hs, (-1, 1))\n', (210, 223), True, 'import numpy as np\n'), ((276, 293), 'numpy.sum', 'np.sum', (['T'], {'axis': '(1)'}),...
#!/usr/bin/env python # -*- coding:utf-8 -*- #@Time : 2019/5/13 10:28 #@Author: yangjian #@File : model.py import numpy import os import torch from flyai.model.base import Base __import__('net', fromlist=["Net"]) MODEL_NAME = "model.pkl" from path import MODEL_PATH # 判断gpu是否可用 if torch.cuda.is_av...
[ "torch.max", "torch.cuda.is_available", "numpy.arange", "torch.device", "os.path.join", "torch.from_numpy" ]
[((304, 329), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (327, 329), False, 'import torch\n'), ((389, 409), 'torch.device', 'torch.device', (['device'], {}), '(device)\n', (401, 409), False, 'import torch\n'), ((657, 684), 'torch.from_numpy', 'torch.from_numpy', (['x_data[0]'], {}), '(x_dat...
import numpy as np import copy from . import ekf_utils gtrack_MIN_DISPERSION_ALPHA = 0.1 gtrack_EST_POINTS = 10 gtrack_MIN_POINTS_TO_UPDATE_DISPERSION = 3 gtrack_KNOWN_TARGET_POINTS_THRESHOLD = 50 # GTRACK Module calls this function to instantiate GTRACK Unit with desired configuration parameters. # Function retur...
[ "copy.deepcopy", "numpy.uint8", "numpy.abs", "numpy.log", "numpy.float32", "numpy.zeros", "numpy.uint16", "numpy.arctan" ]
[((1718, 1757), 'numpy.zeros', 'np.zeros', ([], {'shape': '(36,)', 'dtype': 'np.float32'}), '(shape=(36,), dtype=np.float32)\n', (1726, 1757), True, 'import numpy as np\n'), ((1770, 1809), 'numpy.zeros', 'np.zeros', ([], {'shape': '(36,)', 'dtype': 'np.float32'}), '(shape=(36,), dtype=np.float32)\n', (1778, 1809), True...
# Use should provide a conformant object `hive` # and call the function `test_all` in their Hive setup # to test the UDF functionalities. import random import string from typing import List, Sequence, Tuple import numpy as np import pandas as pd from hive_udf import ( make_udf, hive_udf_example, hive_udaf...
[ "hive_udf.make_udf", "random.choices", "numpy.isnan" ]
[((802, 828), 'hive_udf.make_udf', 'make_udf', (['hive_udf_example'], {}), '(hive_udf_example)\n', (810, 828), False, 'from hive_udf import make_udf, hive_udf_example, hive_udaf_example, hive_udf_args_example\n'), ((1591, 1619), 'numpy.isnan', 'np.isnan', (["z['price'].iloc[2]"], {}), "(z['price'].iloc[2])\n", (1599, 1...
# coding: utf-8 import sys, os sys.path.append(os.pardir) # 부모 디렉터리의 파일을 가져올 수 있도록 설정 import numpy as np from dataset.mnist import load_mnist from PIL import Image def img_show(img): pil_img = Image.fromarray(np.uint8(img)) pil_img.show() (x_train, t_train), (x_test, t_test) = load_mnist(flatten=True, norma...
[ "sys.path.append", "dataset.mnist.load_mnist", "numpy.uint8" ]
[((31, 57), 'sys.path.append', 'sys.path.append', (['os.pardir'], {}), '(os.pardir)\n', (46, 57), False, 'import sys, os\n'), ((290, 331), 'dataset.mnist.load_mnist', 'load_mnist', ([], {'flatten': '(True)', 'normalize': '(False)'}), '(flatten=True, normalize=False)\n', (300, 331), False, 'from dataset.mnist import loa...
from faceEncodings import getencodes import face_recognition as fr import cv2 import os import numpy as np encodedfacesknown = getencodes() def recognize(face): name = -1 try: face = cv2.cvtColor(face, cv2.COLOR_BGR2RGB) encodeface = fr.face_encodings(face) facedist = fr.face_distance...
[ "face_recognition.face_distance", "face_recognition.compare_faces", "faceEncodings.getencodes", "cv2.cvtColor", "face_recognition.face_encodings", "numpy.argmin" ]
[((128, 140), 'faceEncodings.getencodes', 'getencodes', ([], {}), '()\n', (138, 140), False, 'from faceEncodings import getencodes\n'), ((202, 239), 'cv2.cvtColor', 'cv2.cvtColor', (['face', 'cv2.COLOR_BGR2RGB'], {}), '(face, cv2.COLOR_BGR2RGB)\n', (214, 239), False, 'import cv2\n'), ((261, 284), 'face_recognition.face...
# -*- coding: utf-8 -*- """ Created on Mon Sep 28 09:55:19 2015 @author: Ben """ import config as cfg import pandas as pd import util from datamapfunctions import Abstract import numpy as np import inspect from util import DfOper from shared_classes import StockItem import logging import pdb class FlexibleLoadMeasur...
[ "config.cfgfile.get", "util.currency_convert", "datamapfunctions.Abstract.__init__", "logging.debug", "util.DfOper.mult", "util.unit_convert", "numpy.pmt", "numpy.pv", "util.convert_age", "util.object_att_from_table", "shared_classes.StockItem.__init__" ]
[((510, 585), 'datamapfunctions.Abstract.__init__', 'Abstract.__init__', (['self', 'self.id'], {'primary_key': '"""id"""', 'data_id_key': '"""parent_id"""'}), "(self, self.id, primary_key='id', data_id_key='parent_id')\n", (527, 585), False, 'from datamapfunctions import Abstract\n'), ((2825, 2849), 'shared_classes.Sto...
# -*- coding: utf-8 -*- """ Created on Sat Feb 20 19:33:39 2021 @author: damv_ Ecuaciones cubicas de estado """ from scipy.special import gamma import numpy as np """**************************************************************************************************************************** Indices para ecuaciones cub...
[ "numpy.roots", "numpy.outer", "numpy.log", "numpy.power", "numpy.zeros", "numpy.append", "numpy.array", "numpy.exp", "numpy.dot", "numpy.polynomial.laguerre.laggauss", "scipy.special.gamma" ]
[((1317, 1329), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1325, 1329), True, 'import numpy as np\n'), ((1339, 1351), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1347, 1351), True, 'import numpy as np\n'), ((1363, 1397), 'numpy.polynomial.laguerre.laggauss', 'np.polynomial.laguerre.laggauss', (['n'], {...
from __future__ import division, print_function import numpy as np import scipy.io import scipy.ndimage import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.widgets import Slider from skimage import measure from mpl_toolkits.mplot3d.art3d import Poly3DCollection ###...
[ "numpy.shape", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "skimage.measure.marching_cubes_lewiner" ]
[((1316, 1406), 'skimage.measure.marching_cubes_lewiner', 'measure.marching_cubes_lewiner', (['rdata'], {'level': '(2.7)', 'spacing': '[1.0, 1.0, 1.0]', 'step_size': '(1)'}), '(rdata, level=2.7, spacing=[1.0, 1.0, 1.0],\n step_size=1)\n', (1346, 1406), False, 'from skimage import measure\n'), ((1439, 1529), 'skimage...
"""This script contains methods to plot multiple aspects of the results of MSAF. """ import logging import mir_eval import numpy as np import os from os.path import join, basename, dirname, splitext import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt # Local stuff import msaf from msaf import io f...
[ "matplotlib.pyplot.title", "msaf.utils.intervals_to_times", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "msaf.utils.segment_labels_to_floats", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.axvline", "msaf.jams2.converters.load_jams_range", "logging.warning", "matplotlib.pyplot.clos...
[((218, 239), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (232, 239), False, 'import matplotlib\n'), ((779, 795), 'matplotlib.pyplot.title', 'plt.title', (['title'], {}), '(title)\n', (788, 795), True, 'import matplotlib.pyplot as plt\n'), ((938, 966), 'matplotlib.pyplot.xlabel', 'plt.xlabel',...
from __future__ import annotations import logging import string from datetime import datetime, timezone from pathlib import Path from typing import Iterator, List, Optional, Tuple, Union import h5py import numpy as np from ParProcCo.aggregator_interface import AggregatorInterface from ParProcCo.utils import decode_t...
[ "h5py.File", "logging.debug", "numpy.multiply", "logging.warning", "numpy.allclose", "numpy.zeros", "numpy.isnan", "logging.info", "numpy.diff", "numpy.arange", "datetime.datetime.now", "ParProcCo.utils.decode_to_string" ]
[((1703, 1717), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1715, 1717), False, 'from datetime import datetime, timezone\n'), ((2466, 2559), 'logging.debug', 'logging.debug', (['f"""Calculated axes_mins: {self.axes_mins} and axes_maxs: {self.axes_maxs}"""'], {}), "(\n f'Calculated axes_mins: {self.ax...
# -*- coding: utf-8 -*- import cv2 import numpy as np #感知哈希算法 def pHash(image): image = cv2.resize(image,(32,32), interpolation=cv2.INTER_CUBIC) image = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) # 将灰度图转为浮点型,再进行dct变换 dct = cv2.dct(np.float32(image)) # 取左上角的8*8,这些代表图片的最低频率 # 这个操作等价于c++中利用opencv实现的掩码...
[ "cv2.cvtColor", "numpy.float32", "cv2.imread", "numpy.mean", "cv2.resize" ]
[((93, 151), 'cv2.resize', 'cv2.resize', (['image', '(32, 32)'], {'interpolation': 'cv2.INTER_CUBIC'}), '(image, (32, 32), interpolation=cv2.INTER_CUBIC)\n', (103, 151), False, 'import cv2\n'), ((162, 201), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (174, 201...
# Copyright 2017 <NAME>, <NAME> and <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[ "gillespy2.Species", "numpy.asarray", "sciope.utilities.distancefunctions.naive_squared.NaiveSquaredDistance", "gillespy2.Parameter", "gillespy2.Model.__init__", "sklearn.metrics.mean_absolute_error", "sciope.utilities.priors.uniform_prior.UniformPrior", "sciope.inference.abc_inference.ABC", "sciope...
[((3190, 3210), 'numpy.array', 'np.array', (['true_param'], {}), '(true_param)\n', (3198, 3210), True, 'import numpy as np\n'), ((3777, 3814), 'numpy.asarray', 'np.asarray', (['[x.T for x in fixed_data]'], {}), '([x.T for x in fixed_data])\n', (3787, 3814), True, 'import numpy as np\n'), ((4340, 4370), 'numpy.asarray',...
import numpy as np from probly.lib.utils import array from probly.distr import Normal, Distribution class Wigner(Distribution): """ A Wigner random matrix. A random symmetric matrix whose upper-diagonal entries are independent, identically distributed random variables. Parameters ----------...
[ "numpy.dot", "probly.distr.Normal" ]
[((637, 645), 'probly.distr.Normal', 'Normal', ([], {}), '()\n', (643, 645), False, 'from probly.distr import Normal, Distribution\n'), ((1721, 1729), 'probly.distr.Normal', 'Normal', ([], {}), '()\n', (1727, 1729), False, 'from probly.distr import Normal, Distribution\n'), ((1874, 1894), 'numpy.dot', 'np.dot', (['rect...
import numpy as np import scipy import math import matplotlib.pyplot as plt import matplotlib.image as mpimg import scipy.ndimage as ndimage import scipy.ndimage.filters as filters from orientTensor import calcOrientTensor def calcHarris(Im, gradKsize, gradSigma, window_size, kappa): T11, T12, T22 = calcOrientTens...
[ "scipy.ndimage.filters.maximum_filter", "numpy.multiply", "scipy.ndimage.filters.minimum_filter", "orientTensor.calcOrientTensor", "scipy.ndimage.find_objects", "numpy.zeros", "numpy.unravel_index", "scipy.ndimage.label" ]
[((306, 361), 'orientTensor.calcOrientTensor', 'calcOrientTensor', (['Im', 'gradKsize', 'gradSigma', 'window_size'], {}), '(Im, gradKsize, gradSigma, window_size)\n', (322, 361), False, 'from orientTensor import calcOrientTensor\n'), ((601, 629), 'numpy.multiply', 'np.multiply', (['(Ch > thresh)', 'Ch'], {}), '(Ch > th...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright CNRS 2012 # <NAME> (LULI) # ajout modificaton pour cross_section = 'gaussian1D' <NAME> (2016) # This software is governed by the CeCILL-B license under French law and # abiding by the rules of distribution of free software. import numpy as np from ..math.integrals i...
[ "numpy.trapz", "numpy.asarray", "numpy.ones", "numpy.exp", "numpy.linspace" ]
[((1011, 1032), 'numpy.ones', 'np.ones', (['P_time.shape'], {}), '(P_time.shape)\n', (1018, 1032), True, 'import numpy as np\n'), ((1086, 1142), 'numpy.exp', 'np.exp', (['(-(P_time[mask] - t0) ** 2 / (2 * rise_time ** 2))'], {}), '(-(P_time[mask] - t0) ** 2 / (2 * rise_time ** 2))\n', (1092, 1142), True, 'import numpy ...
# coding=utf-8 # Copyright 2021 DeepMind Technologies Limited. # # 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 applic...
[ "absl.logging.error", "os.remove", "uuid.uuid4", "android_env.proto.raw_observation_pb2.RawObservation.FromString", "android_env.components.errors.ConsoleConnectionError", "android_env.components.errors.ObservationDecodingError", "threading.Condition", "time.sleep", "absl.logging.info", "os.path.i...
[((2184, 2205), 'threading.Condition', 'threading.Condition', ([], {}), '()\n', (2203, 2205), False, 'import threading\n'), ((2234, 2251), 'threading.Event', 'threading.Event', ([], {}), '()\n', (2249, 2251), False, 'import threading\n'), ((6652, 6678), 'os.path.isfile', 'os.path.isfile', (['self._fifo'], {}), '(self._...
# Author: <NAME> # Time: 2021-07-31 import numpy as np from log import get_logger logger = get_logger() class HMM: def __init__(self, A=None, B=None, pi=None): self.A = A self.B = B self.pi = pi self.forward_p = None self.forward = None self.betas = None se...
[ "numpy.sum", "numpy.multiply", "numpy.argmax", "numpy.zeros", "numpy.ones", "log.get_logger", "numpy.dot" ]
[((93, 105), 'log.get_logger', 'get_logger', ([], {}), '()\n', (103, 105), False, 'from log import get_logger\n'), ((654, 670), 'numpy.zeros', 'np.zeros', (['(N, M)'], {}), '((N, M))\n', (662, 670), True, 'import numpy as np\n'), ((1124, 1166), 'numpy.sum', 'np.sum', (['[alpha[T - 1] for alpha in alphas]'], {}), '([alp...
"""This module contains tests for the integration function of PySim """ from unittest import TestCase import numpy as np from numpy import cos, sin, sqrt from pysim.simulation import Sim from pysim.simulation import Runge_Kutta_4 from pysim.simulation import Cash_Karp from pysim.simulation import Dormand_Prince_5 fr...
[ "pysim.systems.MassSpringDamper", "numpy.abs", "numpy.power", "numpy.max", "numpy.diff", "pysim.simulation.Cash_Karp", "numpy.sin", "numpy.cos", "pysim.simulation.Sim", "pysim.systems.python_systems.MassSpringDamper", "pysim.simulation.Dormand_Prince_5", "numpy.sqrt" ]
[((778, 798), 'numpy.sqrt', 'sqrt', (['(springk / mass)'], {}), '(springk / mass)\n', (782, 798), False, 'from numpy import cos, sin, sqrt\n'), ((923, 942), 'numpy.sqrt', 'sqrt', (['(1 - zeta ** 2)'], {}), '(1 - zeta ** 2)\n', (927, 942), False, 'from numpy import cos, sin, sqrt\n'), ((991, 1029), 'numpy.power', 'np.po...
from lxml import etree import numpy as np import pandas as pd import re from sklearn.model_selection import train_test_split import Bio from Bio import SeqIO from pathlib import Path import glob #console from tqdm import tqdm as tqdm import re import os import itertools #jupyter #from tqdm import tqdm_notebook as t...
[ "Bio.Seq.Seq", "numpy.random.seed", "Bio.SeqIO.write", "numpy.maximum", "pandas.read_csv", "sklearn.model_selection.train_test_split", "numpy.argsort", "pathlib.Path", "numpy.unique", "pandas.DataFrame", "numpy.power", "re.search", "pandas.concat", "tqdm.tqdm", "numpy.minimum", "Bio.Se...
[((1788, 1801), 'tqdm.tqdm', 'tqdm', (['context'], {}), '(context)\n', (1792, 1801), True, 'from tqdm import tqdm as tqdm\n'), ((7328, 7364), 'Bio.SeqIO.parse', 'SeqIO.parse', (['filename', '"""uniprot-xml"""'], {}), "(filename, 'uniprot-xml')\n", (7339, 7364), False, 'from Bio import SeqIO\n'), ((7392, 7403), 'tqdm.tq...
import re from skimage import io from glob import glob import numpy as np import os import bioformats from sklearn.externals import joblib from skimage.filters import roberts import os import time #os.chdir(os.getcwd() + '\utils') #print(os.getcwd()) #from utils import * def dataset(path, path_n): positive = [] ...
[ "sklearn.externals.joblib.dump", "numpy.polyfit", "numpy.empty", "time.strftime", "numpy.argsort", "os.path.isfile", "numpy.arange", "glob.glob", "bioformats.omexml.OMEXML", "os.path.dirname", "os.path.exists", "re.findall", "os.path.normpath", "skimage.io.imread", "numpy.repeat", "num...
[((355, 375), 'glob.glob', 'glob', (["(path + '*.tif')"], {}), "(path + '*.tif')\n", (359, 375), False, 'from glob import glob\n'), ((532, 554), 'glob.glob', 'glob', (["(path_n + '*.tif')"], {}), "(path_n + '*.tif')\n", (536, 554), False, 'from glob import glob\n'), ((746, 765), 'numpy.vstack', 'np.vstack', (['(X1, X2)...
#!/usr/bin/python3 from nicenet import NeuralNetwork from nicenet import Dataset from helpers import shuffle_array, split_arr import numpy as np inputs = 4 outputs = 3 network = NeuralNetwork(inputs, outputs, cost="ce") network.add_layer(8, activation_function="sigmoid") network.add_layer(8, activation_function="sigm...
[ "numpy.argmax", "nicenet.Dataset", "nicenet.NeuralNetwork", "helpers.shuffle_array", "helpers.split_arr" ]
[((180, 221), 'nicenet.NeuralNetwork', 'NeuralNetwork', (['inputs', 'outputs'], {'cost': '"""ce"""'}), "(inputs, outputs, cost='ce')\n", (193, 221), False, 'from nicenet import NeuralNetwork\n'), ((423, 447), 'nicenet.Dataset', 'Dataset', (['inputs', 'outputs'], {}), '(inputs, outputs)\n', (430, 447), False, 'from nice...
import SchematicTools from schematic import SchematicFile import numpy as np import SchematicTools from PIL import Image #import glob ## Take a large schematic (or multiple schematics) as input data. ## Process and export a numpy array that contains a large number of cube-shaped samples. ## The samples are also proc...
[ "numpy.stack", "numpy.save", "numpy.average", "numpy.concatenate", "schematic.SchematicFile", "numpy.empty", "numpy.zeros", "numpy.hstack", "numpy.random.randint", "SchematicTools.loadArea", "numpy.vstack" ]
[((4132, 4181), 'numpy.empty', 'np.empty', (['(0, SAMPLESIZE, SAMPLESIZE, SAMPLESIZE)'], {}), '((0, SAMPLESIZE, SAMPLESIZE, SAMPLESIZE))\n', (4140, 4181), True, 'import numpy as np\n'), ((4667, 4694), 'numpy.save', 'np.save', (['FILEPATH', 'filtered'], {}), '(FILEPATH, filtered)\n', (4674, 4694), True, 'import numpy as...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 27 09:42:34 2019 This script passes the speech segments identified in step 1 through Google Speech2Text (settings are for English) and creates an updated textgrid with speech tier. @author: szekely """ from google.cloud import speech_v1p1beta1...
[ "google.cloud.speech_v1p1beta1.RecognitionConfig", "codes.helpers.list_filenames", "os.makedirs", "google.api_core.client_options.ClientOptions", "google.cloud.speech_v1p1beta1.types.RecognitionMetadata", "numpy.asarray", "os.path.exists", "google.cloud.speech_v1p1beta1.RecognitionAudio", "praatio.t...
[((1189, 1245), 'praatio.tgio.openTextgrid', 'tgio.openTextgrid', (["(textgrid_root + tg_file + '.TextGrid')"], {}), "(textgrid_root + tg_file + '.TextGrid')\n", (1206, 1245), False, 'from praatio import tgio\n'), ((1854, 1908), 'codes.helpers.load_wav', 'load_wav', (["(orig_wav_root + infiles[epi] + '.wav')"], {'sr': ...
import sys import csv import random import numpy as np import pandas as pd from sklearn.preprocessing import OneHotEncoder def generate_ohe(data_x,name): new_data = np.asmatrix(np.zeros((data_x.shape[0],95),dtype=int)) for i in range(len(data_x)): for j in range((int)(data_x.shape[1]-1)/2): new_data[i,17*j + da...
[ "pandas.read_csv", "numpy.zeros", "numpy.array" ]
[((529, 563), 'pandas.read_csv', 'pd.read_csv', (['datapath'], {'header': 'None'}), '(datapath, header=None)\n', (540, 563), True, 'import pandas as pd\n'), ((179, 221), 'numpy.zeros', 'np.zeros', (['(data_x.shape[0], 95)'], {'dtype': 'int'}), '((data_x.shape[0], 95), dtype=int)\n', (187, 221), True, 'import numpy as n...
''' Please note that this code is optimized towards comprehension and not performance. ''' from tensorflow.python.keras import backend as K import tensorflow as tf import numpy as np import tqdm class ContrastivTensionModel(tf.keras.Model): def __init__(self, model1, model2, *args, **kwargs): super().__...
[ "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.losses.BinaryCrossentropy", "numpy.mean", "tensorflow.python.keras.backend.binary_crossentropy", "tensorflow.GradientTape", "tensorflow.expand_dims" ]
[((423, 469), 'tensorflow.losses.BinaryCrossentropy', 'tf.losses.BinaryCrossentropy', ([], {'from_logits': '(True)'}), '(from_logits=True)\n', (451, 469), True, 'import tensorflow as tf\n'), ((763, 787), 'tensorflow.cast', 'tf.cast', (['att', 'tf.float32'], {}), '(att, tf.float32)\n', (770, 787), True, 'import tensorfl...
""" Test the sensitivity reader """ from unittest import TestCase, skipUnless from collections import OrderedDict from itertools import product from io import BytesIO from numpy import array, inf from numpy.testing import assert_allclose, assert_array_equal from serpentTools.data import getFile from serpentTools.parse...
[ "io.BytesIO", "tests.MatlabTesterHelper.setUp", "scipy.io.loadmat", "serpentTools.parsers.sensitivity.SensitivityReader._RECONVERT_ATTR_MAP.items", "numpy.testing.assert_array_equal", "serpentTools.parsers.sensitivity.SensitivityReader._RECONVERT_LIST_MAP.items", "unittest.skipUnless", "tests.getLegen...
[((482, 504), 'serpentTools.data.getFile', 'getFile', (['"""bwr_sens0.m"""'], {}), "('bwr_sens0.m')\n", (489, 504), False, 'from serpentTools.data import getFile\n'), ((13212, 13263), 'unittest.skipUnless', 'skipUnless', (['HAS_SCIPY', '"""SCIPY needed for this test"""'], {}), "(HAS_SCIPY, 'SCIPY needed for this test')...
from .base import QA import glob import os import collections import numpy as np import fitsio import multiprocessing as mp import scipy.ndimage from astropy.table import Table import desiutil.log from desispec.maskbits import ccdmask from ..run import get_ncpu def _fix_amp_names(hdr): '''In-place fix of head...
[ "numpy.ones", "fitsio.read", "multiprocessing.Pool", "collections.OrderedDict", "os.path.join", "fitsio.read_header" ]
[((2989, 3026), 'fitsio.read_header', 'fitsio.read_header', (['filename', '"""IMAGE"""'], {}), "(filename, 'IMAGE')\n", (3007, 3026), False, 'import fitsio\n'), ((3123, 3152), 'fitsio.read', 'fitsio.read', (['filename', '"""MASK"""'], {}), "(filename, 'MASK')\n", (3134, 3152), False, 'import fitsio\n'), ((4314, 4345), ...
import phenom import numpy as np import scipy from scipy.fftpack import fft, fftfreq, fftshift, ifft def fft(t, h): """ t : in units of seconds h : in units of strain """ dt = t[1] - t[0] N = len(t) htilde = scipy.fftpack.fft(h) * dt f = scipy.fftpack.fftfreq(N, dt) # mask = ( f ...
[ "numpy.ceil", "numpy.angle", "phenom.planck_taper", "scipy.fftpack.fft", "scipy.fftpack.ifft", "numpy.arange", "numpy.exp", "scipy.fftpack.fftfreq" ]
[((273, 301), 'scipy.fftpack.fftfreq', 'scipy.fftpack.fftfreq', (['N', 'dt'], {}), '(N, dt)\n', (294, 301), False, 'import scipy\n'), ((911, 956), 'numpy.exp', 'np.exp', (['(-1.0j * 2.0 * np.pi * f * phase_shift)'], {}), '(-1.0j * 2.0 * np.pi * f * phase_shift)\n', (917, 956), True, 'import numpy as np\n'), ((976, 1024...
import streamlit as st import pandas as pd import numpy as np import os def main(): st.title('Uber pickups in NYC') DATE_COLUMN = 'date/time' DATA_URL = ('https://s3-us-west-2.amazonaws.com/' 'streamlit-demo-data/uber-raw-data-sep14.csv.gz') @st.cache def load_data(nrows): dat...
[ "streamlit.subheader", "streamlit.map", "streamlit.slider", "streamlit.checkbox", "pandas.read_csv", "streamlit.write", "streamlit.title", "streamlit.text", "numpy.histogram", "pandas.to_datetime", "streamlit.bar_chart" ]
[((89, 120), 'streamlit.title', 'st.title', (['"""Uber pickups in NYC"""'], {}), "('Uber pickups in NYC')\n", (97, 120), True, 'import streamlit as st\n'), ((643, 669), 'streamlit.text', 'st.text', (['"""Loading data..."""'], {}), "('Loading data...')\n", (650, 669), True, 'import streamlit as st\n'), ((886, 910), 'str...
import numpy as np #linear line is f(x) = ax +b for a and b is constant # x is order # y is data set def linear_vec(y): y_size = np.size(y) a = np.zeros(y_size-1) #for i in range(x_size): # x[i] = i #x is order now #need dy/dx b = np.zeros(y_size -1 ) for i in range(y_size-1): ...
[ "numpy.size", "numpy.zeros", "numpy.float" ]
[((135, 145), 'numpy.size', 'np.size', (['y'], {}), '(y)\n', (142, 145), True, 'import numpy as np\n'), ((154, 174), 'numpy.zeros', 'np.zeros', (['(y_size - 1)'], {}), '(y_size - 1)\n', (162, 174), True, 'import numpy as np\n'), ((265, 285), 'numpy.zeros', 'np.zeros', (['(y_size - 1)'], {}), '(y_size - 1)\n', (273, 285...
import cv2 import numpy as np import random import os import re import math import constants import scipy.misc from segmentModule import * from matplotlib import pyplot as plt #reads in training image for cnn using pixel data as the training set #28 x 28 surrounding area of each pixel used for training #3x3 conv, 7x7 ...
[ "numpy.concatenate", "random.randint", "cv2.waitKey", "random.shuffle", "cv2.imwrite", "numpy.unique", "os.path.exists", "cv2.imread", "re.findall", "random.seed", "numpy.array", "cv2.imshow", "os.listdir", "cv2.resize" ]
[((439, 478), 'cv2.imread', 'cv2.imread', (['image_dir', 'cv2.IMREAD_COLOR'], {}), '(image_dir, cv2.IMREAD_COLOR)\n', (449, 478), False, 'import cv2\n'), ((544, 562), 'numpy.unique', 'np.unique', (['markers'], {}), '(markers)\n', (553, 562), True, 'import numpy as np\n'), ((1940, 1957), 'random.seed', 'random.seed', ([...
import numpy as np a = np.random.rand(1000) print(a)
[ "numpy.random.rand" ]
[((23, 43), 'numpy.random.rand', 'np.random.rand', (['(1000)'], {}), '(1000)\n', (37, 43), True, 'import numpy as np\n')]
import numpy as np def calculate_energy(wfc, H_k, H_r, dx): """Calculate the energy <Psi|H|Psi>.""" # Creating momentum conjugate wavefunctions wfc_k = np.fft.fft(wfc) wfc_c = np.conj(wfc) # Finding the momentum and real-space energy terms energy_k = 0.5 * wfc_c * np.fft.ifft((H_k ** 2) * wfc...
[ "numpy.conj", "numpy.fft.fft", "numpy.fft.ifft" ]
[((166, 181), 'numpy.fft.fft', 'np.fft.fft', (['wfc'], {}), '(wfc)\n', (176, 181), True, 'import numpy as np\n'), ((194, 206), 'numpy.conj', 'np.conj', (['wfc'], {}), '(wfc)\n', (201, 206), True, 'import numpy as np\n'), ((292, 321), 'numpy.fft.ifft', 'np.fft.ifft', (['(H_k ** 2 * wfc_k)'], {}), '(H_k ** 2 * wfc_k)\n',...
from allensdk.brain_observatory.ecephys.ecephys_project_cache import EcephysProjectCache import os from sqlalchemy import delete from sqlalchemy.orm import sessionmaker import json import numpy as np import pandas as pd from datetime import date,datetime,timedelta import sqla_schema as sch import ingest data_direct...
[ "pandas.read_sql", "ingest.get_ecephys_cache", "ingest.connect_to_db", "sqlalchemy.orm.sessionmaker", "sqla_schema.Base.metadata.create_all", "os.path.join", "numpy.fromstring" ]
[((402, 447), 'os.path.join', 'os.path.join', (['data_directory', '"""manifest.json"""'], {}), "(data_directory, 'manifest.json')\n", (414, 447), False, 'import os\n'), ((922, 962), 'pandas.read_sql', 'pd.read_sql', (['Q.statement', 'Q.session.bind'], {}), '(Q.statement, Q.session.bind)\n', (933, 962), True, 'import pa...
from functools import reduce from config import PERIODO_INI, PERIODO_FIN import pandas as pd import numpy as np pd.options.mode.chained_assignment = None def check_periods(col): print(pd.DataFrame( {"Rango": [col.min(), col.max()]}, index=['MIN', 'MAX']) ) # HELPER FUNCTIONS d...
[ "pandas.DataFrame", "pandas.Timestamp", "pandas.read_csv", "pandas.merge", "numpy.timedelta64", "pandas.to_datetime", "pandas.to_numeric" ]
[((1820, 1858), 'pandas.DataFrame', 'pd.DataFrame', (['df_polizas_pivoted.index'], {}), '(df_polizas_pivoted.index)\n', (1832, 1858), True, 'import pandas as pd\n'), ((2062, 2158), 'pandas.read_csv', 'pd.read_csv', (['with_table'], {'sep': '"""\t"""', 'encoding': '"""latin1"""', 'decimal': '""","""', 'usecols': '[id_co...
""" Helpers for tfrecord conversion. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np class ImageCoder(object): """Helper class that provides TensorFlow image coding utilities. Taken from https://g...
[ "tensorflow.train.Int64List", "ipdb.set_trace", "numpy.ones", "tensorflow.image.decode_png", "tensorflow.train.FloatList", "tensorflow.compat.as_bytes", "tensorflow.python_io.tf_record_iterator", "numpy.pad", "tensorflow.train.Example", "os.path.exists", "tensorflow.placeholder", "cv2.resize",...
[((16003, 16046), 'cv2.resize', 'cv2.resize', (['img', '(new_size[1], new_size[0])'], {}), '(img, (new_size[1], new_size[0]))\n', (16013, 16046), False, 'import cv2\n'), ((16648, 16654), 'time.time', 'time', ([], {}), '()\n', (16652, 16654), False, 'from time import time\n'), ((16759, 16790), 'tensorflow.placeholder', ...
import hypney import numpy as np from scipy import stats def test_mixture(): m1 = hypney.models.uniform(rate=40) m2_free = hypney.models.uniform(rate=20) m2_frozen = m2_free.freeze() m3 = hypney.models.uniform(rate=30) for m2 in m2_free, m2_frozen: mix = hypney.models.mixture(m1, m2) ...
[ "hypney.models.norm", "scipy.stats.uniform", "numpy.array", "numpy.linspace", "hypney.models.uniform", "hypney.models.mixture" ]
[((89, 119), 'hypney.models.uniform', 'hypney.models.uniform', ([], {'rate': '(40)'}), '(rate=40)\n', (110, 119), False, 'import hypney\n'), ((134, 164), 'hypney.models.uniform', 'hypney.models.uniform', ([], {'rate': '(20)'}), '(rate=20)\n', (155, 164), False, 'import hypney\n'), ((207, 237), 'hypney.models.uniform', ...
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2021 Scipp contributors (https://github.com/scipp) # @file # @author <NAME> import numpy as np import pytest import scipp as sc from .common import assert_export def make_variables(): data = np.arange(1, 4, dtype=float) a = sc.Variable(dims=['x'], val...
[ "numpy.array_equal", "numpy.ones", "scipp.sum", "numpy.arange", "numpy.float64", "scipp.Dataset", "scipp.Variable", "scipp.identical", "scipp.mean", "pytest.raises", "scipp.vectors", "scipp.DataArray", "scipp.Unit", "numpy.testing.assert_array_equal", "scipp.nan_to_num", "numpy.float32...
[((256, 284), 'numpy.arange', 'np.arange', (['(1)', '(4)'], {'dtype': 'float'}), '(1, 4, dtype=float)\n', (265, 284), True, 'import numpy as np\n'), ((293, 329), 'scipp.Variable', 'sc.Variable', ([], {'dims': "['x']", 'values': 'data'}), "(dims=['x'], values=data)\n", (304, 329), True, 'import scipp as sc\n'), ((338, 3...
import numpy as np from .data_iterator import DataIterator class BatchIterator(DataIterator): """TODO: BatchIterator docs""" def __init__(self, batch_size, shuffle=False): super().__init__() self.batch_size = batch_size self.shuffle = shuffle def __call__(self, inputs, targets): ...
[ "numpy.random.shuffle" ]
[((416, 441), 'numpy.random.shuffle', 'np.random.shuffle', (['starts'], {}), '(starts)\n', (433, 441), True, 'import numpy as np\n')]
import torch import numpy as np from scipy.ndimage.filters import gaussian_filter class ModelMixing: def __init__(self, tokenizer, base_model, main_model, target_model, cold_zone_loss, seed = 80085): self.base_model = base_model self.main_model = main_model self.target_model = target_model ...
[ "torch.min", "torch.lerp", "numpy.random.RandomState", "torch.Tensor", "torch.max", "torch.rand", "torch.zeros", "torch.clone", "torch.Generator" ]
[((348, 375), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (369, 375), True, 'import numpy as np\n'), ((401, 418), 'torch.Generator', 'torch.Generator', ([], {}), '()\n', (416, 418), False, 'import torch\n'), ((802, 822), 'torch.Tensor', 'torch.Tensor', (['result'], {}), '(result)\n'...
# -*- coding: utf-8 -*- import functools import numpy as np from .. import datamods from .. import utils from .. import constants DB_SPECIES = datamods.species['debye'] def setup_extended_debye(solutes, calculate_osmotic_coefficient=False): db_species = DB_SPECIES I_factor = [] dh_a = [] dh_b = []...
[ "functools.partial", "numpy.sum", "numpy.nan_to_num", "numpy.isnan", "numpy.insert", "numpy.array", "numpy.sqrt" ]
[((523, 537), 'numpy.array', 'np.array', (['dh_a'], {}), '(dh_a)\n', (531, 537), True, 'import numpy as np\n'), ((549, 563), 'numpy.array', 'np.array', (['dh_b'], {}), '(dh_b)\n', (557, 563), True, 'import numpy as np\n'), ((579, 597), 'numpy.array', 'np.array', (['I_factor'], {}), '(I_factor)\n', (587, 597), True, 'im...
import numpy as np from sklearn.linear_model import LinearRegression from .model import Model class Linear(Model): def __init__(self, features): super(Linear, self).__init__(features) self.model = LinearRegression() def fit(self, X, y): X, y = np.array(X), np.array(y) self.mo...
[ "sklearn.linear_model.LinearRegression", "numpy.array" ]
[((220, 238), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (236, 238), False, 'from sklearn.linear_model import LinearRegression\n'), ((280, 291), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (288, 291), True, 'import numpy as np\n'), ((293, 304), 'numpy.array', 'np.array', (['y'],...
import logging import time import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from shapely import geometry import input_fn.input_fn_2d.data_gen_2dt.data_gen_t2d_util.polygone_2d_helper as old_helper logger = logging.getLogger("polygone_2d_helper") # logger.setLevel("DEBUG") # logger.setLevel(...
[ "tensorflow.einsum", "numpy.abs", "tensorflow.print", "tensorflow.zeros_like", "numpy.mean", "numpy.arange", "numpy.sin", "tensorflow.complex", "tensorflow.math.abs", "tensorflow.keras.optimizers.RMSprop", "tensorflow.keras.losses.mean_absolute_error", "input_fn.input_fn_2d.data_gen_2dt.data_g...
[((235, 274), 'logging.getLogger', 'logging.getLogger', (['"""polygone_2d_helper"""'], {}), "('polygone_2d_helper')\n", (252, 274), False, 'import logging\n'), ((360, 381), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (379, 381), False, 'import logging\n'), ((386, 433), 'numpy.set_printoptions', 'np....
# Import basic packages import pandas as pd import numpy as np # import plot packages import matplotlib.pyplot as plt import gspplot # Import graph packages import gsp import pygsp # Import pytorch packages import torch import torch.nn as nn import torch.optim as optim # Import other packages import os def set_ground_...
[ "numpy.load", "gsp.knn_graph", "torch.from_numpy", "torch.nn.BCELoss", "torch.optim.lr_scheduler.StepLR", "numpy.sum", "numpy.save", "numpy.linalg.lstsq", "numpy.zeros", "os.path.exists", "numpy.nonzero", "torch.exp", "torch.sigmoid", "torch.clamp", "torch.no_grad", "matplotlib.pyplot....
[((1558, 1587), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (1570, 1587), True, 'import matplotlib.pyplot as plt\n'), ((7907, 7931), 'numpy.zeros', 'np.zeros', (['[n_dim, n_dim]'], {}), '([n_dim, n_dim])\n', (7915, 7931), True, 'import numpy as np\n'), ((9870, 9909...
""" MIT License Copyright (c) 2017 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
[ "numpy.abs", "numpy.argmax", "scipy.sparse.linalg.factorized", "numpy.ones", "numpy.linalg.norm", "logging.error", "numpy.copy", "numpy.random.randn", "logging.warning", "numpy.linalg.eig", "numpy.max", "scipy.sparse.identity", "cvxpy.Problem", "numpy.asarray", "cvxpy.mul_elemwise", "n...
[((1383, 1457), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""qcqp.log"""', 'filemode': '"""w"""', 'level': 'logging.INFO'}), "(filename='qcqp.log', filemode='w', level=logging.INFO)\n", (1402, 1457), False, 'import logging\n'), ((1677, 1700), 'cvxpy.Semidef', 'cvx.Semidef', (['(prob.n + 1)'], {})...
#!/usr/bin/env python # encoding: utf-8 import tensorflow as tf import numpy as np import random from collections import deque FRAME_PER_ACTION = 1 GAMMA = 0.99 OBSERVE = 100. EXPLORE = 200000. FINAL_EPSILON = 0.001 INITIAL_EPSILON = 0.01 REPLAY_MEMORY = 50000 BATCH_SIZE = 32 UPDATE_TIME = 100 try: tf.mul except...
[ "numpy.argmax", "random.sample", "tensorflow.reshape", "tensorflow.matmul", "tensorflow.Variable", "tensorflow.nn.conv2d", "tensorflow.InteractiveSession", "tensorflow.truncated_normal", "collections.deque", "tensorflow.placeholder", "numpy.append", "numpy.max", "tensorflow.initialize_all_va...
[((427, 434), 'collections.deque', 'deque', ([], {}), '()\n', (432, 434), False, 'from collections import deque\n'), ((1650, 1666), 'tensorflow.train.Saver', 'tf.train.Saver', ([], {}), '()\n', (1664, 1666), True, 'import tensorflow as tf\n'), ((1690, 1713), 'tensorflow.InteractiveSession', 'tf.InteractiveSession', ([]...
import argparse import json import logging from typing import Any, Dict, List, Tuple import zipfile, gzip, re, copy, random, math import sys, os, shutil import numpy from typing import TypeVar,Iterable from multiprocessing import Pool from allennlp.common.elastic_logger import ElasticLogger from subprocess import Popen...
[ "subprocess.Popen", "json.load", "zipfile.ZipFile", "argparse.ArgumentParser", "shutil.rmtree", "numpy.argmax", "gzip.open", "allennlp.common.elastic_logger.ElasticLogger", "json.loads", "numpy.unique", "re.match", "allennlp.common.file_utils.cached_path", "typing.TypeVar", "os.path.join",...
[((331, 343), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (338, 343), False, 'from typing import TypeVar, Iterable\n'), ((931, 958), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (948, 958), False, 'import logging\n'), ((1299, 1365), 're.match', 're.match', (['"""(\\\\S+)_...
#!/usr/bin/env python3 import argparse import csv import matplotlib.pyplot as plt from matplotlib import style import numpy as np import datetime as dt parser = argparse.ArgumentParser(description='Plots battery discharge CSV log') parser.add_argument('csv_file', help='discharger log file to plot') parser.add_argument...
[ "numpy.vectorize", "argparse.ArgumentParser", "matplotlib.style.use", "matplotlib.pyplot.show", "csv.reader", "numpy.genfromtxt", "matplotlib.pyplot.figure" ]
[((162, 232), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Plots battery discharge CSV log"""'}), "(description='Plots battery discharge CSV log')\n", (185, 232), False, 'import argparse\n'), ((773, 816), 'numpy.genfromtxt', 'np.genfromtxt', (['args.csv_file'], {'delimiter': '""","""'}...
import numpy as np import rospy import tensorflow as tf import yaml from styx_msgs.msg import TrafficLight class TLClassifier(object): def __init__(self): SIM_MODEL_PATH = 'sim/frozen_inference_graph.pb' REAL_MODEL_PATH = 'real/frozen_inference_graph.pb' config_string = rospy.get_param("/tr...
[ "yaml.load", "tensorflow.Session", "numpy.expand_dims", "rospy.get_param", "tensorflow.gfile.GFile", "tensorflow.Graph", "numpy.squeeze", "tensorflow.import_graph_def", "tensorflow.GraphDef" ]
[((300, 340), 'rospy.get_param', 'rospy.get_param', (['"""/traffic_light_config"""'], {}), "('/traffic_light_config')\n", (315, 340), False, 'import rospy\n'), ((358, 382), 'yaml.load', 'yaml.load', (['config_string'], {}), '(config_string)\n', (367, 382), False, 'import yaml\n'), ((563, 573), 'tensorflow.Graph', 'tf.G...
import requests from pathlib import Path import cv2 from tqdm import tqdm import numpy as np from imutils.paths import list_images import pandas as pd def test_img(project,port): url=f'http://127.0.0.1:{port}/{project}' print(url) img_dir='img/' pbar=tqdm(list(list_images(img_dir)),colour='...
[ "pandas.DataFrame", "requests.post", "imutils.paths.list_images", "numpy.array" ]
[((780, 801), 'pandas.DataFrame', 'pd.DataFrame', (['recored'], {}), '(recored)\n', (792, 801), True, 'import pandas as pd\n'), ((456, 489), 'requests.post', 'requests.post', ([], {'url': 'url', 'data': 'data'}), '(url=url, data=data)\n', (469, 489), False, 'import requests\n'), ((290, 310), 'imutils.paths.list_images'...
import matplotlib.pyplot as plt import numpy as np from matplotlib.animation import FuncAnimation import math n = 8 # Number of particles m = np.ones(n).astype(float) # Particle masses x = np.zeros((n,2)).astype(float) # Particle positions (x and y for ith particle in x[i,0], x[i,1]) v = np.ze...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.close", "numpy.zeros", "numpy.ones", "numpy.array", "matplotlib.pyplot.subplots" ]
[((462, 481), 'numpy.array', 'np.array', (['[0, -9.8]'], {}), '([0, -9.8])\n', (470, 481), True, 'import numpy as np\n'), ((1574, 1588), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1586, 1588), True, 'import matplotlib.pyplot as plt\n'), ((2077, 2087), 'matplotlib.pyplot.show', 'plt.show', ([], {})...
import math import torch import pickle import numpy as np from torch import nn from scipy import signal import torch.optim as optim from torch.distributions import Normal def _uniform_init(tensor, param=3e-3): return tensor.data.uniform_(-param, param) def layer_init(layer, weight_init = _uniform_init, bias_ini...
[ "torch.mm", "numpy.clip", "torch.randn", "torch.set_num_threads", "torch.clone", "torch.ones", "torch.FloatTensor", "torch.exp", "torch.Tensor", "torch.nn.Linear", "torch.zeros", "numpy.random.shuffle", "copy.deepcopy", "torch.where", "torch.nn.Conv2d", "torch.rand", "torch.nn.MaxPoo...
[((23191, 23215), 'torch.set_num_threads', 'torch.set_num_threads', (['(1)'], {}), '(1)\n', (23212, 23215), False, 'import torch\n'), ((23242, 23272), 'gym.make', 'gym.make', (['"""HalfCheetahHier-v2"""'], {}), "('HalfCheetahHier-v2')\n", (23250, 23272), False, 'import gym\n'), ((2887, 2919), 'torch.zeros', 'torch.zero...
#!/usr/bin/python """ GridFlag Use XArray, Dask, and Numpy to load CASA Measurement Set (MS) data and create binned UV data. Todo: [ ] Add options for choosing stokes parameters or amplitude/complex components """ import numpy as np import dask import dask.array as da import numba as nb from . import groupby_app...
[ "numpy.absolute", "dask.array.sum", "numpy.sum", "dask.array.squeeze", "numba.njit", "logging.getLevelName", "numpy.arange", "dask.array.max", "logging.FileHandler", "dask.array.from_delayed", "numpy.median", "logging.StreamHandler", "numpy.min", "dask.array.where", "numpy.concatenate", ...
[((827, 846), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (844, 846), False, 'import logging\n'), ((8513, 8532), 'numba.njit', 'nb.njit', ([], {'nogil': '(True)'}), '(nogil=True)\n', (8520, 8532), True, 'import numba as nb\n'), ((8938, 8957), 'numba.njit', 'nb.njit', ([], {'nogil': '(True)'}), '(nogil=T...
################################################################################## # # # Michael: I think that this is the file to evaluate whether a rhythm is pyloric # # It does not exactly follow Prinz et al.'s definition of a pyloric rhy...
[ "numpy.load", "copy.deepcopy", "numpy.sum", "numpy.log", "numpy.asarray", "numpy.isnan", "numpy.savez_compressed", "numpy.array", "numpy.exp", "os.listdir", "numpy.all" ]
[((1845, 1864), 'os.listdir', 'os.listdir', (['filedir'], {}), '(filedir)\n', (1855, 1864), False, 'import os\n'), ((4790, 4889), 'numpy.savez_compressed', 'np.savez_compressed', (['outfile_name'], {'seeds': 'picked_seeds', 'params': 'picked_params', 'stats': 'picked_stats'}), '(outfile_name, seeds=picked_seeds, params...
from typing import Tuple import numpy as np import torch from torch import FloatTensor from torch.utils.data.dataset import Dataset from torchvision.datasets import MNIST from torchvision.transforms import Compose, ToTensor, Normalize from .settings import DATA_ROOT from IPython import embed MNIST_TRAN...
[ "torch.stack", "torch.LongTensor", "numpy.arange", "numpy.random.choice", "torchvision.transforms.Normalize", "torchvision.datasets.MNIST", "torchvision.transforms.ToTensor" ]
[((337, 347), 'torchvision.transforms.ToTensor', 'ToTensor', ([], {}), '()\n', (345, 347), False, 'from torchvision.transforms import Compose, ToTensor, Normalize\n'), ((349, 380), 'torchvision.transforms.Normalize', 'Normalize', (['(0.1307,)', '(0.3081,)'], {}), '((0.1307,), (0.3081,))\n', (358, 380), False, 'from tor...
import unittest import numpy as np from pyml.metrics.classification import precision_score class test_classification(unittest.TestCase): def test_precision_score(self): y_pred = np.array([1,2,3,4,5,6,3,1]) y_true = np.array([1,2,3,4,5,6,4,1]) # 默认,要7位有效数字都要相同 self.assertAlmostEqua...
[ "unittest.main", "numpy.array", "pyml.metrics.classification.precision_score" ]
[((390, 405), 'unittest.main', 'unittest.main', ([], {}), '()\n', (403, 405), False, 'import unittest\n'), ((193, 227), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6, 3, 1]'], {}), '([1, 2, 3, 4, 5, 6, 3, 1])\n', (201, 227), True, 'import numpy as np\n'), ((238, 272), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6, ...
import math import numpy as np from SPARQLWrapper import SPARQLWrapper, JSON, POST from rdflib import Graph from rdflib import URIRef from excut.kg.utils import data_formating from excut.utils.logging import logger from excut.kg.utils.data_formating import entity_full_url, relation_full_url from excut.kg.kg_triples_s...
[ "tqdm.tqdm", "rdflib.Graph", "math.ceil", "excut.utils.logging.logger.info", "excut.kg.kg_triples_source.FileTriplesSource", "rdflib.URIRef", "SPARQLWrapper.SPARQLWrapper", "numpy.array_split", "excut.kg.utils.data_formating.valid_id_triple" ]
[((1894, 1932), 'math.ceil', 'math.ceil', (['(data_size / self.batch_size)'], {}), '(data_size / self.batch_size)\n', (1903, 1932), False, 'import math\n'), ((1941, 1980), 'excut.utils.logging.logger.info', 'logger.info', (["('data size %i' % data_size)"], {}), "('data size %i' % data_size)\n", (1952, 1980), False, 'fr...
from bs4 import BeautifulSoup import requests import re import os import bz2 import sys from tqdm import tqdm import numpy as np import pandas as pd import h5py import time import shutil import zipfile from .hapi import db_begin, fetch, abundance, moleculeName, isotopologueName import excalibur.ExoMol as ExoMol impo...
[ "os.mkdir", "os.remove", "pandas.read_csv", "re.finditer", "shutil.rmtree", "excalibur.HITRAN.create_id_dict", "shutil.copy", "os.path.abspath", "os.path.dirname", "os.path.exists", "re.findall", "requests.get", "excalibur.ExoMol.get_default_linelist", "re.sub", "h5py.File", "excalibur...
[((4231, 4265), 'bs4.BeautifulSoup', 'BeautifulSoup', (['web_content', '"""lxml"""'], {}), "(web_content, 'lxml')\n", (4244, 4265), False, 'from bs4 import BeautifulSoup\n'), ((5878, 5905), 'pandas.to_numeric', 'pd.to_numeric', (["hitemp['ID']"], {}), "(hitemp['ID'])\n", (5891, 5905), True, 'import pandas as pd\n'), ((...
# Copyright (C) 2014-2021 Syntrogi Inc dba Intheon. All rights reserved. import sys import logging import json from typing import Tuple, List import numpy as np import pandas as pd from qtpy import QtCore from qtpy import QtGui from qtpy import QtWidgets from stream_viewer.buffers import StreamDataBuffer, MergeLastOn...
[ "pandas.DataFrame", "numpy.zeros_like", "numpy.abs", "json.loads", "numpy.multiply", "numpy.nanmax", "numpy.zeros", "stream_viewer.buffers.TimeSeriesBuffer", "numpy.nanmin", "stream_viewer.buffers.MergeLastOnlyBuffer", "numpy.any", "numpy.finfo", "pathlib.Path", "numpy.array", "qtpy.QtCo...
[((413, 440), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (430, 440), False, 'import logging\n'), ((512, 541), 'qtpy.QtCore.Signal', 'QtCore.Signal', (['QtCore.QObject'], {}), '(QtCore.QObject)\n', (525, 541), False, 'from qtpy import QtCore\n'), ((3699, 3723), 'qtpy.QtCore.Slot', 'QtC...
""" Classes for importing LAMMPS atom trajectory into a xarray dataset. The trajectory class also has a dataset with ellipsoid vectors. traj_options contains all the inputs for generating the trajectory class. Usage: traj_opt = t.trajectory_options(path = "./trajectories/", file_...
[ "pandas.DataFrame", "compute_op.qmatrix", "gzip.open", "numpy.transpose", "xarray.concat", "io_local.read_xarray", "xarray.Dataset", "xarray.DataArray", "glob.glob", "io_local.save_xarray", "numpy.arccos", "re.search", "numpy.sqrt" ]
[((5137, 5208), 'xarray.DataArray', 'xr.DataArray', (['bounds_array'], {'coords': '[data.ts, comp]', 'dims': "['ts', 'comp']"}), "(bounds_array, coords=[data.ts, comp], dims=['ts', 'comp'])\n", (5149, 5208), True, 'import xarray as xr\n'), ((6485, 6525), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {'columns': 'colum...
import numpy as np import polygon_tools as poly import csv import yaml import sys import matplotlib as plt from matplotlib.patches import Polygon as PlotPolygon from matplotlib.collections import PatchCollection import matplotlib.cm as cm import logging def robot_builder(robot): # Note that the robot type must be...
[ "polygon_tools.PointList", "polygon_tools.Polygon", "csv.reader", "polygon_tools.Point", "matplotlib.patches.Polygon", "numpy.sin", "numpy.array", "yaml.safe_load", "numpy.cos", "numpy.linspace", "matplotlib.collections.PatchCollection", "numpy.eye", "numpy.matmul", "matplotlib.subplots" ]
[((1163, 1179), 'numpy.array', 'np.array', (['limits'], {}), '(limits)\n', (1171, 1179), True, 'import numpy as np\n'), ((1562, 1580), 'polygon_tools.Point', 'poly.Point', (['*point'], {}), '(*point)\n', (1572, 1580), True, 'import polygon_tools as poly\n'), ((2201, 2234), 'matplotlib.collections.PatchCollection', 'Pat...
#!/usr/bin/env python #Source : https://github.com/myleott/mnist_png ## ----------- TO DO IN FUTURE --------------- #1. make the path recognition OS independent #2. do a file-exists check before execution ## ----------- INTRODUCTION --------------- # this script assumes that the following files are in the same l...
[ "os.makedirs", "numpy.asarray", "os.path.exists", "PIL.Image.fromarray", "os.path.join", "sys.exit" ]
[((2903, 2913), 'sys.exit', 'sys.exit', ([], {}), '()\n', (2911, 2913), False, 'import sys\n'), ((2136, 2152), 'os.path.exists', 'path.exists', (['dir'], {}), '(dir)\n', (2147, 2152), False, 'from os import path\n'), ((2166, 2182), 'os.makedirs', 'os.makedirs', (['dir'], {}), '(dir)\n', (2177, 2182), False, 'import os\...
import numpy as np import pandas as pd import yaml def anomaly_score_example(source: np.array, reconstructed: np.array): """ Calculate anomaly score :param source: original data :param reconstructed: reconstructed data :return: """ n, d = source.shape d_dis = np.zeros((d,)) for i i...
[ "yaml.load", "numpy.abs", "argparse.ArgumentParser", "numpy.sum", "pandas.read_csv", "numpy.argsort", "numpy.mean", "algorithm.moving_average.online_moving_average", "os.path.abspath", "utils.normalization", "numpy.savetxt", "detector.CSAnomalyDetector", "numpy.max", "numpy.loadtxt", "nu...
[((294, 308), 'numpy.zeros', 'np.zeros', (['(d,)'], {}), '((d,))\n', (302, 308), True, 'import numpy as np\n'), ((6669, 7024), 'detector.CSAnomalyDetector', 'CSAnomalyDetector', ([], {'workers': 'workers', 'cluster_threshold': 'cluster_threshold', 'sample_rate': 'sample_rate', 'sample_score_method': 'sample_score_metho...
from vidmapy.kurucz import parameters import numpy as np def test_default_parameters(): param = parameters.Parameters() assert param.teff == 5777 assert param.logg == 4.44 assert param.metallicity == 0.0 assert param.microturbulence == 2.0 def test_chemical_composition(): param = parameters.P...
[ "vidmapy.kurucz.parameters.Parameters", "numpy.alltrue" ]
[((101, 124), 'vidmapy.kurucz.parameters.Parameters', 'parameters.Parameters', ([], {}), '()\n', (122, 124), False, 'from vidmapy.kurucz import parameters\n'), ((308, 331), 'vidmapy.kurucz.parameters.Parameters', 'parameters.Parameters', ([], {}), '()\n', (329, 331), False, 'from vidmapy.kurucz import parameters\n'), (...
import numpy as np def generate_sine_wave(freq, duration, amp=0.5, phase_offset=0, sample_rate=44100): phase_duration = freq / sample_rate samples_per_phase = sample_rate / freq num_samples = (sample_rate * duration) + (3 * samples_per_phase) sine_samples = np.sin(2 * np.pi * np.arange(num_sample...
[ "numpy.arange" ]
[((300, 322), 'numpy.arange', 'np.arange', (['num_samples'], {}), '(num_samples)\n', (309, 322), True, 'import numpy as np\n')]
import numpy as np import matplotlib.pyplot as plt from scipy.fftpack import dct def hann_window(N): """ Create the Hann window 0.5*(1-cos(2pi*n/N)) """ return 0.5*(1 - np.cos(2*np.pi*np.arange(N)/N)) def specgram(x, win_length, hop_length, win_fn = hann_window): """ Compute the non-redundant ...
[ "numpy.abs", "numpy.ceil", "numpy.fft.fft", "numpy.floor", "scipy.fftpack.dct", "numpy.zeros", "numpy.arange", "numpy.linspace", "numpy.log10", "numpy.round" ]
[((924, 943), 'numpy.zeros', 'np.zeros', (['(K, nwin)'], {}), '((K, nwin))\n', (932, 943), True, 'import numpy as np\n'), ((2316, 2337), 'numpy.zeros', 'np.zeros', (['(n_bins, K)'], {}), '((n_bins, K))\n', (2324, 2337), True, 'import numpy as np\n'), ((3616, 3630), 'numpy.log10', 'np.log10', (['mfcc'], {}), '(mfcc)\n',...
from nub import timeit import iris from iris.time import PartialDateTime # Create 5 years of hourly data => ~45k data points # Similar to: http://hydromet-thredds.princeton.edu:9000/thredds/dodsC/MonitoringStations/butler.nc def setup(): from iris.coords import DimCoord from iris.cube import Cube import ...
[ "iris.time.PartialDateTime", "iris.Constraint", "iris.coords.DimCoord", "numpy.arange", "iris.cube.Cube", "nub.timeit" ]
[((344, 395), 'numpy.arange', 'np.arange', (['(1299002400)', '(1462554000)', '(3600)'], {'dtype': '"""f8"""'}), "(1299002400, 1462554000, 3600, dtype='f8')\n", (353, 395), True, 'import numpy as np\n'), ((407, 464), 'iris.coords.DimCoord', 'DimCoord', (['times', '"""time"""'], {'units': '"""seconds since 1970-01-01"""'...
#!python __author__ = 'ashwin' import pycuda.driver as drv import pycuda.tools import pycuda.autoinit from pycuda.compiler import SourceModule import numpy as np import scipy.misc as scm import matplotlib.pyplot as p mod = SourceModule \ ( """ #include<stdio.h> #define INDEX(a, b) a*256+b __global__ vo...
[ "pycuda.compiler.SourceModule", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "pycuda.driver.In", "numpy.reshape", "pycuda.driver.Out", "scipy.misc.imread" ]
[((227, 617), 'pycuda.compiler.SourceModule', 'SourceModule', (['"""\n#include<stdio.h>\n#define INDEX(a, b) a*256+b\n\n__global__ void rgb2gray(float *dest,float *r_img, float *g_img, float *b_img)\n{\n\nunsigned int idx = threadIdx.x+(blockIdx.x*(blockDim.x*blockDim.y));\n\n unsigned int a = idx/256;\n unsigned int...
import tensorflow as tf from tensorflow.keras import datasets, layers, models import matplotlib.pyplot as plt (train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data() # Normalize pixel values to be between 0 and 1 train_images, test_images = train_images / 255.0, test_images / 255.0 c...
[ "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "numpy.argmax", "tensorflow.keras.layers.Dense", "matplotlib.pyplot.legend", "tensorflow.keras.datasets.cifar10.load_...
[((171, 199), 'tensorflow.keras.datasets.cifar10.load_data', 'datasets.cifar10.load_data', ([], {}), '()\n', (197, 199), False, 'from tensorflow.keras import datasets, layers, models\n'), ((791, 810), 'tensorflow.keras.models.Sequential', 'models.Sequential', ([], {}), '()\n', (808, 810), False, 'from tensorflow.keras ...
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.4.1 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + from pptx import Pres...
[ "io.BytesIO", "skimage.color.rgb2gray", "datetime.datetime.today", "numpy.concatenate", "pptx.Presentation", "tqdm.autonotebook.tqdm", "cv2.imread", "pptx.util.Inches", "glob.glob", "PIL.Image.fromarray", "cv2.resize" ]
[((639, 655), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (653, 655), False, 'from datetime import datetime\n'), ((872, 898), 'glob.glob', 'glob.glob', (['"""./masks/*.png"""'], {}), "('./masks/*.png')\n", (881, 898), False, 'import glob\n'), ((932, 946), 'pptx.Presentation', 'Presentation', ([], {})...
#!/usr/bin/env python3 import time import numpy as np from collections import defaultdict, deque import logging import shapely.ops from threading import Thread #from line_profiler import LineProfiler import pyqtgraph.opengl as gl from phonebot.core.common.logger import get_default_logger from phonebot.core.common....
[ "phonebot.core.common.math.transform.Position", "phonebot.core.common.config.PhonebotSettings", "phonebot.vis.viewer.viewer_base.HandleHelper", "phonebot.core.common.math.transform.Rotation.from_euler", "phonebot.core.controls.controllers.base_rotation_controller.BaseRotationController", "collections.dequ...
[((1103, 1135), 'phonebot.core.common.logger.get_default_logger', 'get_default_logger', (['logging.WARN'], {}), '(logging.WARN)\n', (1121, 1135), False, 'from phonebot.core.common.logger import get_default_logger\n'), ((2471, 2489), 'phonebot.core.common.config.PhonebotSettings', 'PhonebotSettings', ([], {}), '()\n', (...
import torch import torch.nn as nn from config.config import SemSegMRIConfig import numpy as np from torchio import Image, ImagesDataset, SubjectsDataset import torchio from config.augm import train_transform from tabulate import tabulate def TorchIODataLoader_train(image_val, label_val): #print('Building TorchI...
[ "numpy.log", "torch.utils.data.DataLoader", "torchio.Image", "torchio.SubjectsDataset", "tabulate.tabulate", "numpy.array" ]
[((673, 729), 'torchio.SubjectsDataset', 'SubjectsDataset', (['subject_list'], {'transform': 'train_transform'}), '(subject_list, transform=train_transform)\n', (688, 729), False, 'from torchio import Image, ImagesDataset, SubjectsDataset\n'), ((747, 839), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (...
make_plots = 0 import numpy as np import os,sys import matplotlib.pyplot as pl import matplotlib.cm as plcm import dinterp import time if make_plots: pl.close("all") time0 = time.time() n = 14 print("FOM dof = 2 ** {:02d}".format(n)) snapshot_fname = "_output/sol_snapshots.npy" mu_fname = "_output/mu_snapsho...
[ "dinterp.deim", "numpy.load", "matplotlib.cm.get_cmap", "matplotlib.pyplot.figure", "numpy.linalg.svd", "numpy.arange", "numpy.sin", "numpy.linalg.solve", "matplotlib.pyplot.close", "numpy.savetxt", "numpy.cumsum", "numpy.linspace", "numpy.hstack", "numpy.cos", "numpy.dot", "numpy.vsta...
[((183, 194), 'time.time', 'time.time', ([], {}), '()\n', (192, 194), False, 'import time\n'), ((334, 357), 'numpy.load', 'np.load', (['snapshot_fname'], {}), '(snapshot_fname)\n', (341, 357), True, 'import numpy as np\n'), ((363, 380), 'numpy.load', 'np.load', (['mu_fname'], {}), '(mu_fname)\n', (370, 380), True, 'imp...
import numpy as np from scipy.stats import t from typing import Tuple def corrected_resampled_t_statistic(x: np.array, n: int, n1: int, n2: int, alpha: float = 0.05) -> Tuple[float, Tuple]: """ Nadeau and Bengio (2003), Bouckaert and Frank (2004) Corrected resampled t-statistic :param x: vector of dif...
[ "numpy.abs", "scipy.stats.t.isf", "numpy.mean", "numpy.var", "numpy.sqrt" ]
[((602, 612), 'numpy.mean', 'np.mean', (['x'], {}), '(x)\n', (609, 612), True, 'import numpy as np\n'), ((635, 644), 'numpy.var', 'np.var', (['x'], {}), '(x)\n', (641, 644), True, 'import numpy as np\n'), ((671, 715), 'numpy.sqrt', 'np.sqrt', (['((1 / n + n2 / n1) * sample_variance)'], {}), '((1 / n + n2 / n1) * sample...
""" Tests for collapsed observation vector These tests cannot be run for the Clark 1989 model since the dimension of observations (2) is smaller than the number of states (6). Author: <NAME> License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np import pandas ...
[ "os.path.abspath", "pandas.date_range", "numpy.log", "dismalpy.ssm.Model", "numpy.testing.assert_allclose", "numpy.zeros", "numpy.array", "numpy.exp", "numpy.testing.assert_equal", "numpy.eye", "numpy.diag" ]
[((546, 571), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (561, 571), False, 'import os\n'), ((1082, 1101), 'numpy.log', 'np.log', (["data['GDP']"], {}), "(data['GDP'])\n", (1088, 1101), True, 'import numpy as np\n'), ((1245, 1289), 'dismalpy.ssm.Model', 'ssm.Model', (['data'], {'k_states'...
import unittest import numpy as np from hockbot.scara_kinematics import ( fkin, jacobian, ikin, ) class TestScaraKinematics(unittest.TestCase): TEST_VECS = [ (np.array([0 , 0]), np.array([ 1.0, 0.0])), (np.array([np.pi/2, 0]), np.array([ 0.5, 0.5])), (np.ar...
[ "hockbot.scara_kinematics.fkin", "hockbot.scara_kinematics.ikin", "numpy.array", "numpy.sqrt" ]
[((187, 203), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (195, 203), True, 'import numpy as np\n'), ((218, 238), 'numpy.array', 'np.array', (['[1.0, 0.0]'], {}), '([1.0, 0.0])\n', (226, 238), True, 'import numpy as np\n'), ((251, 275), 'numpy.array', 'np.array', (['[np.pi / 2, 0]'], {}), '([np.pi / 2, 0...
from __future__ import print_function import os import numpy as np import pandas as pd import matplotlib.pyplot as pl import keras from keras import metrics from keras import regularizers from keras.models import Sequential, Model from keras.layers import Dense, Activation, Input, Flatten, Dropout from keras.layers imp...
[ "matplotlib.pyplot.title", "numpy.random.seed", "pandas.read_csv", "keras.models.Model", "numpy.mean", "keras.regularizers.l1", "keras.layers.Input", "keras.regularizers.l1_l2", "pandas.DataFrame", "keras.layers.embeddings.Embedding", "numpy.std", "keras.layers.Flatten", "matplotlib.pyplot.d...
[((789, 821), 'pandas.read_csv', 'pd.read_csv', (['"""kc_house_data.csv"""'], {}), "('kc_house_data.csv')\n", (800, 821), True, 'import pandas as pd\n'), ((1056, 1333), 'pandas.DataFrame', 'pd.DataFrame', (['kc_data_org'], {'columns': "['sale_yr', 'sale_month', 'sale_day', 'bedrooms', 'bathrooms',\n 'sqft_living', '...
import os.path from typing import Callable from scipy.io import loadmat, savemat import numpy as np import nibabel as nib import torch import argparse import time import matplotlib.pyplot as plt from torch.fft import ifftn, ifftshift, fftn, fftshift from utils.common import set_env from utils.proj_utils import phase2...
[ "matplotlib.pyplot.title", "utils.proj_utils.phase2in", "argparse.ArgumentParser", "scipy.io.loadmat", "matplotlib.pyplot.figure", "matplotlib.pyplot.close", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "utils.common.set_env", "torch.real", "matplotlib.pyplot.xticks", "torch.complex...
[((514, 525), 'time.time', 'time.time', ([], {}), '()\n', (523, 525), False, 'import time\n'), ((613, 652), 'scipy.io.loadmat', 'loadmat', (['f"""{root_fdr}/{sub}/cosmos.mat"""'], {}), "(f'{root_fdr}/{sub}/cosmos.mat')\n", (620, 652), False, 'from scipy.io import loadmat, savemat\n'), ((687, 716), 'torch.from_numpy', '...
def ivcurve(mechanism_name, i_type, vmin=-100, vmax=100, deltav=1, transient_time=50, test_time=50, rs=1, vinit=-665): """ Returns the (peak) current-voltage relationship for an ion channel. Args: mechanism_name = name of the mechanism (e.g. hh) i_type = which current to monitor (e.g. ik, i...
[ "neuron.h.continuerun", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "neuron.h.Vector", "matplotlib.pyplot.legend", "neuron.h.finitialize", "numpy.arange", "neuron.h.CVode", "matplotlib.pyplot.ylabel", "neuron.h.Section", "matplotlib.pyplot.xlabel", "neuron.h.load_file" ]
[((1154, 1179), 'neuron.h.load_file', 'h.load_file', (['"""stdrun.hoc"""'], {}), "('stdrun.hoc')\n", (1165, 1179), False, 'from neuron import h\n'), ((1190, 1201), 'neuron.h.Section', 'h.Section', ([], {}), '()\n', (1199, 1201), False, 'from neuron import h\n'), ((1422, 1432), 'neuron.h.Vector', 'h.Vector', ([], {}), '...
# pylint: disable=missing-docstring, protected-access, unused-argument, too-many-arguments, too-many-statements # pylint: disable=too-many-locals, bad-continuation # pydocstyle: disable=missing-docstring from collections import defaultdict from io import StringIO from unittest import TestCase, main from unittest import...
[ "unittest.main", "VirClass.VirClass.load.one_hot", "io.StringIO", "VirClass.VirClass.load.load_dataset", "unittest.mock.MagicMock", "VirClass.VirClass.load.save_dataset", "numpy.asarray", "VirClass.VirClass.load.load_from_file_fasta", "VirClass.VirClass.load.load_data", "unittest.mock.patch", "c...
[((3427, 3473), 'unittest.mock.patch', 'patch', (['"""VirClass.VirClass.load.os.path.isfile"""'], {}), "('VirClass.VirClass.load.os.path.isfile')\n", (3432, 3473), False, 'from unittest.mock import patch, mock_open, MagicMock, file_spec\n'), ((3479, 3530), 'unittest.mock.patch', 'patch', (['"""VirClass.VirClass.load.lo...
import numpy as np import cv2 #### define variables display = True # display frames while executing save_format = 'gray' # how to save frames, options are: # gray_norm - gray-scaled frame with normalized brightness and contrast # gray - gray-scaled frame (use only green channel) # color - colored frame # color_all - c...
[ "numpy.load", "numpy.abs", "cv2.Sobel" ]
[((1406, 1442), 'numpy.load', 'np.load', (['"""overlay/sony1_overlay.npy"""'], {}), "('overlay/sony1_overlay.npy')\n", (1413, 1442), True, 'import numpy as np\n'), ((1459, 1495), 'numpy.load', 'np.load', (['"""overlay/sony2_overlay.npy"""'], {}), "('overlay/sony2_overlay.npy')\n", (1466, 1495), True, 'import numpy as n...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ tenxtools.significant_test ~~~~~~~~~~~~~~~~~~~~~~~~~~ @Copyright: (c) 2018-08 by <NAME> (<EMAIL>). @License: LICENSE_NAME, see LICENSE for more details. """ from scipy import stats from skidmarks import wald_wolfowitz from statsmodels.stats.multitest im...
[ "scipy.stats.kstest", "numpy.random.seed", "scipy.stats.ttest_rel", "scipy.stats.expon.fit", "scipy.stats.ttest_ind", "scipy.stats.f_oneway", "statsmodels.stats.multitest.fdrcorrection", "scipy.stats.ranksums", "skidmarks.wald_wolfowitz", "scipy.stats.chisquare" ]
[((359, 383), 'numpy.random.seed', 'np.random.seed', (['(12345678)'], {}), '(12345678)\n', (373, 383), True, 'import numpy as np\n'), ((412, 477), 'statsmodels.stats.multitest.fdrcorrection', 'fdrcorrection', (['pvals'], {'alpha': '(0.05)', 'method': '"""indep"""', 'is_sorted': '(False)'}), "(pvals, alpha=0.05, method=...
from __future__ import division import sys import os import tempfile import warnings from distutils.spawn import find_executable from subprocess import Popen, PIPE import numpy as np from mbuild.compound import Compound from mbuild.exceptions import MBuildError from mbuild.box import Box from mbuild import clone __...
[ "mbuild.compound.Compound", "sys.platform.startswith", "subprocess.Popen", "os.path.join", "tempfile.mkstemp", "numpy.asarray", "mbuild.box.Box", "mbuild.clone", "distutils.spawn.find_executable", "warnings.warn", "mbuild.exceptions.MBuildError", "numpy.prod" ]
[((378, 404), 'distutils.spawn.find_executable', 'find_executable', (['"""packmol"""'], {}), "('packmol')\n", (393, 404), False, 'from distutils.spawn import find_executable\n'), ((6619, 6629), 'mbuild.compound.Compound', 'Compound', ([], {}), '()\n', (6627, 6629), False, 'from mbuild.compound import Compound\n'), ((68...
import numbers import numpy as np import time import pickle from typing import Optional from sklearn.base import BaseEstimator from sklearn.cluster import KMeans from dl_portfolio.logger import LOGGER from dl_portfolio.nmf.utils import negative_matrix, positive_matrix, reconstruction_error EPSILON = 1e-12 class Se...
[ "dl_portfolio.nmf.utils.reconstruction_error", "dl_portfolio.logger.LOGGER.info", "sklearn.cluster.KMeans", "numpy.zeros", "time.time", "numpy.dot", "numpy.sqrt" ]
[((1954, 1965), 'time.time', 'time.time', ([], {}), '()\n', (1963, 1965), False, 'import time\n'), ((2161, 2206), 'dl_portfolio.nmf.utils.reconstruction_error', 'reconstruction_error', (['X', 'F', 'G'], {'loss': 'self.loss'}), '(X, F, G, loss=self.loss)\n', (2181, 2206), False, 'from dl_portfolio.nmf.utils import negat...
"""Adds dilution of precision (DOP) to dataset Description: ------------ Dilution of precision calculation is based on estimated covariance matrix of unknowns. GDOP, PDOP, HDOP, VDOP and TDOP is added to dataset. TODO: Check if the calculation of HDOP and VDOP is correct. """ # External library imports import numpy ...
[ "where.lib.log.debug", "numpy.zeros", "numpy.sqrt" ]
[((748, 854), 'numpy.sqrt', 'np.sqrt', (['(dset.estimate_cov_site_pos_xx + dset.estimate_cov_site_pos_yy + dset.\n estimate_cov_site_pos_zz)'], {}), '(dset.estimate_cov_site_pos_xx + dset.estimate_cov_site_pos_yy +\n dset.estimate_cov_site_pos_zz)\n', (755, 854), True, 'import numpy as np\n'), ((967, 1022), 'wher...
from numpy.polynomial.polynomial import polypow from time import time def probability(dice_number, sides, target): powers = [0] + [1] * sides poly = polypow(powers, dice_number) try: return round(poly[target] / sides ** dice_number, 4) except IndexError: return 0 if __name__ == '__ma...
[ "numpy.polynomial.polynomial.polypow", "time.time" ]
[((159, 187), 'numpy.polynomial.polynomial.polypow', 'polypow', (['powers', 'dice_number'], {}), '(powers, dice_number)\n', (166, 187), False, 'from numpy.polynomial.polynomial import polypow\n'), ((335, 341), 'time.time', 'time', ([], {}), '()\n', (339, 341), False, 'from time import time\n'), ((387, 393), 'time.time'...
# -*- coding:UTF-8 -*- # ---------------------------------------------------# # Aim of the program: # Create plots to compare groups of models # FIG. 3 in Planton et al. 2020: Evaluating climate models with the CLIVAR 2020 ENSO metrics package. BAMS # It uses the first available member of each model or all me...
[ "driver_tools_lib.get_mod_mem_json", "driver_tools_lib.get_metric_values", "copy.deepcopy", "EnsoPlots.EnsoPlotToolsLib.bootstrap", "numpy.ma.masked_where", "numpy.ma.masked_invalid", "numpy.mean", "numpy.array", "os.path.join" ]
[((4842, 4877), 'os.path.join', 'OSpath__join', (['path_out', 'figure_name'], {}), '(path_out, figure_name)\n', (4854, 4877), True, 'from os.path import join as OSpath__join\n'), ((5849, 5945), 'driver_tools_lib.get_mod_mem_json', 'get_mod_mem_json', (['list_projects', 'list_metric_collections', 'dict_json'], {'first_o...
# Adapted from score written by wkentaro # https://github.com/wkentaro/pytorch-fcn/blob/master/torchfcn/utils.py import numpy as np class runningScore(object): def __init__(self, n_classes): self.n_classes = n_classes self.confusion_matrix = np.zeros((n_classes, n_classes)) def _fast_hist(se...
[ "numpy.abs", "numpy.zeros", "numpy.mean", "numpy.nanmean", "numpy.diag", "numpy.sqrt" ]
[((265, 297), 'numpy.zeros', 'np.zeros', (['(n_classes, n_classes)'], {}), '((n_classes, n_classes))\n', (273, 297), True, 'import numpy as np\n'), ((1141, 1160), 'numpy.nanmean', 'np.nanmean', (['acc_cls'], {}), '(acc_cls)\n', (1151, 1160), True, 'import numpy as np\n'), ((1262, 1276), 'numpy.nanmean', 'np.nanmean', (...
import cv2 import numpy as np class OpencvBruteForceMatcher(object): name = 'opencv_brute_force_matcher' distances = {} distances['l2'] = cv2.NORM_L2 distances['hamming'] = cv2.NORM_HAMMING def __init__(self, distance='l2'): self._matcher = cv2.BFMatcher(self.distances[distance]) ...
[ "numpy.asarray", "cv2.BFMatcher" ]
[((278, 317), 'cv2.BFMatcher', 'cv2.BFMatcher', (['self.distances[distance]'], {}), '(self.distances[distance])\n', (291, 317), False, 'import cv2\n'), ((1937, 1964), 'numpy.asarray', 'np.asarray', (['correspondences'], {}), '(correspondences)\n', (1947, 1964), True, 'import numpy as np\n')]
import numpy as np from utils import * class RandomPlayer(): def __init__(self, game): self.game = game def play(self, board): a = np.random.randint(self.game.getActionSize()) valids = self.game.getValidMoves(board, 1) while valids[a]!=1: a = np.random.randint(self....
[ "tk.TKGame.Board", "random.choice", "numpy.argmax" ]
[((1577, 1593), 'numpy.argmax', 'np.argmax', (['array'], {}), '(array)\n', (1586, 1593), True, 'import numpy as np\n'), ((1869, 1897), 'random.choice', 'random.choice', (['max_value_ids'], {}), '(max_value_ids)\n', (1882, 1897), False, 'import random\n'), ((1952, 1959), 'tk.TKGame.Board', 'Board', ([], {}), '()\n', (19...
from __future__ import absolute_import, division, print_function import logging import sys logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO, stream=sys.stderr) import json import os if o...
[ "tensorflow.estimator.export.build_raw_serving_input_receiver_fn", "cPickle.load", "collections.defaultdict", "tensorflow.ConfigProto", "os.path.isfile", "tensorflow.estimator.Estimator", "experiment_details.get_output_ckpts_dir_name", "os.path.join", "sys.path.append", "logging.error", "numpy.z...
[((91, 234), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)s: %(message)s"""', 'datefmt': '"""%m/%d/%Y %I:%M:%S %p"""', 'level': 'logging.INFO', 'stream': 'sys.stderr'}), "(format='%(asctime)s %(levelname)s: %(message)s',\n datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INF...
import time import numpy as np class CalcTime(object): def __init__(self, print_every_toc=True, between_toc=False): self.__print_every_toc = print_every_toc self.__between_toc = between_toc self.__num = 0 self.__nameList = [] self.__start_dic = {} self.__time_dic = {...
[ "numpy.set_printoptions", "numpy.sum", "time.time", "time.sleep", "numpy.append", "numpy.mean", "numpy.array", "numpy.round" ]
[((2495, 2510), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (2505, 2510), False, 'import time\n'), ((2529, 2544), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (2539, 2544), False, 'import time\n'), ((748, 759), 'time.time', 'time.time', ([], {}), '()\n', (757, 759), False, 'import time\n'), ((805...
""" Implementation of Moving Least Squares transformation. Powered by molesq, an optional dependency. """ from typing import Optional import numpy as np from molesq.transform import Transformer as _Transformer from ..base import Transform from ..util import SpaceRef class MovingLeastSquares(Transform): def __i...
[ "numpy.asarray" ]
[((1144, 1177), 'numpy.asarray', 'np.asarray', (['source_control_points'], {}), '(source_control_points)\n', (1154, 1177), True, 'import numpy as np\n'), ((1191, 1224), 'numpy.asarray', 'np.asarray', (['target_control_points'], {}), '(target_control_points)\n', (1201, 1224), True, 'import numpy as np\n')]