code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import os import numpy as np import h5py import multiprocessing import argparse def calc_syncParam(file): ''' function to pass to multiprocessing pool to calculate order paramter in parallel ''' print('Reading {f}'.format(f=file.split(os.path.sep)[-2])) with h5py.File(file) as d: t_poi...
[ "argparse.ArgumentParser", "numpy.where", "h5py.File", "numpy.exp", "numpy.arctan2", "multiprocessing.Pool" ]
[((1477, 1502), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1500, 1502), False, 'import argparse\n'), ((1795, 1837), 'multiprocessing.Pool', 'multiprocessing.Pool', ([], {'processes': 'nProcesses'}), '(processes=nProcesses)\n', (1815, 1837), False, 'import multiprocessing\n'), ((285, 300), ...
import warnings import numpy as np import pandas as pd from tqdm import tqdm from scipy import optimize, stats def impulse(t, h0, h1p, h2, t1, t2, beta): ''' A parametric impulse function defined by two conjoined sigmoids. See ImpulseDE2 paper. ''' return 1. / (h1p + 1) * \ (h0 + (h1p - h...
[ "tqdm.tqdm", "warnings.catch_warnings", "numpy.log", "numpy.exp", "numpy.array", "scipy.stats.chi2.sf", "warnings.simplefilter", "pandas.DataFrame" ]
[((1044, 1106), 'pandas.DataFrame', 'pd.DataFrame', (["{'hour': t, 'expr': expression_matrix.loc[gene]}"], {}), "({'hour': t, 'expr': expression_matrix.loc[gene]})\n", (1056, 1106), True, 'import pandas as pd\n'), ((1674, 1685), 'numpy.array', 'np.array', (['t'], {}), '(t)\n', (1682, 1685), True, 'import numpy as np\n'...
from univariate._base import Base import matplotlib.pyplot as plt import numpy as np def plot(Distribution:Base, x:np.ndarray)->None: # plot multiple versions of the distirbution in # different parameterization. Annotate vaules on # legend and include annotations on the image. plt.plot(x,Dis...
[ "univariate.Infinite.Gaussian", "numpy.linspace" ]
[((556, 566), 'univariate.Infinite.Gaussian', 'Gaussian', ([], {}), '()\n', (564, 566), False, 'from univariate.Infinite import Gaussian\n'), ((580, 604), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', '(1000)'], {}), '(-1, 1, 1000)\n', (591, 604), True, 'import numpy as np\n')]
# Copyright 2020 FZI Forschungszentrum Informatik # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
[ "numpy.random.normal", "numpy.random.multivariate_normal", "numpy.random.choice", "numpy.diag", "numpy.zeros", "random.randint" ]
[((1407, 1506), 'random.randint', 'random.randint', (["self.action_spec[action_choice]['min']", "self.action_spec[action_choice]['max']"], {}), "(self.action_spec[action_choice]['min'], self.action_spec[\n action_choice]['max'])\n", (1421, 1506), False, 'import random\n'), ((1558, 1602), 'numpy.zeros', 'np.zeros', (...
#!python3 import numpy as np import matplotlib.pyplot as plt def set_aspect(ax, ratio): xleft, xright = ax.get_xlim() ybottom, ytop = ax.get_ylim() ax.set_aspect(abs((xright-xleft)/(ybottom-ytop))*ratio) def main(): hour = np.arange(24) power = np.array([1.24,1.82,1.32,1.57,1.72,1.84,1.99,5.3,6.49,3.98,3.35,2.9...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.array", "numpy.arange", "matplotlib.pyplot.show" ]
[((230, 243), 'numpy.arange', 'np.arange', (['(24)'], {}), '(24)\n', (239, 243), True, 'import numpy as np\n'), ((253, 408), 'numpy.array', 'np.array', (['[1.24, 1.82, 1.32, 1.57, 1.72, 1.84, 1.99, 5.3, 6.49, 3.98, 3.35, 2.98, \n 2.09, 4.76, 2.51, 2.46, 3.47, 6.02, 7.52, 7.08, 5, 4.08, 1.63, 0.41]'], {}), '([1.24, 1...
import typing as t import numpy as np from gym.spaces import Box def box_action_scaler(action_space: Box) -> t.Callable[[np.ndarray], np.ndarray]: shift = action_space.low scale = action_space.high - action_space.low return lambda action: scale / (1.0 + np.exp(-action)) + shift
[ "numpy.exp" ]
[((269, 284), 'numpy.exp', 'np.exp', (['(-action)'], {}), '(-action)\n', (275, 284), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # # Compare automatic block id using "training" set from human transcription # import io, json, sys, os, psycopg2, logging, subprocess, swifter, re, dateparser from glob import glob from pathlib import Path from psycopg2.extras import RealDictCursor from time import localtime, strftime from fuz...
[ "logging.basicConfig", "logging.getLogger", "psycopg2.connect", "logging.StreamHandler", "os.path.exists", "os.makedirs", "logging.Formatter", "os.getcwd", "os.chdir", "numpy.array_split", "pandas.to_numeric", "multiprocessing.Pool", "sys.exit", "pandas.DataFrame", "re.sub", "time.loca...
[((910, 1080), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)s %(name)-12s %(levelname)-8s %(message)s"""', 'datefmt': '"""%m-%d %H:%M:%S"""', 'filename': 'logfile', 'filemode': '"""a"""'}), "(level=logging.DEBUG, format=\n '%(asctime)s %(name)-12s %(levelname)...
import numpy as np import cv2 from matplotlib import pyplot as plt # Scaling img = cv2.imread('a.jpg') print(img.shape) cv2.imshow('img', img) res = cv2.resize(img, None, fx=2, fy=2, interpolation = cv2.INTER_AREA) print(res.shape) print(img.shape) cv2.imshow('res', res) cv2.waitKey(0) cv2.destroyAllWindows() # Tran...
[ "matplotlib.pyplot.imshow", "cv2.warpAffine", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "cv2.getPerspectiveTransform", "cv2.imshow", "matplotlib.pyplot.subplot", "cv2.warpPerspective", "cv2.destroyAllWindows", "cv2.cvtColor", "cv2.getAffineTransform", "cv2.getRotationMatrix2D", "c...
[((84, 103), 'cv2.imread', 'cv2.imread', (['"""a.jpg"""'], {}), "('a.jpg')\n", (94, 103), False, 'import cv2\n'), ((122, 144), 'cv2.imshow', 'cv2.imshow', (['"""img"""', 'img'], {}), "('img', img)\n", (132, 144), False, 'import cv2\n'), ((151, 214), 'cv2.resize', 'cv2.resize', (['img', 'None'], {'fx': '(2)', 'fy': '(2)...
import numpy as np from modules.DataStructures import AccelData def GenADot(_AccelData:AccelData): """ Outputs an array of doubles that represents the first-order derivative of the acceleration data """ adot_list = np.array([]) dt = _AccelData.t[1]-_AccelData.t[0] for i in range(len(_AccelData...
[ "numpy.array" ]
[((231, 243), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (239, 243), True, 'import numpy as np\n')]
# Copyright (c) 2019 MindAffect B.V. # Author: <NAME> <<EMAIL>> # This file is part of pymindaffectBCI <https://github.com/mindaffect/pymindaffectBCI>. # # pymindaffectBCI is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softwar...
[ "numpy.flatnonzero", "mindaffectBCI.utopiaclient.StimulusEvent", "numpy.any", "numpy.zeros", "devent2stimsequence.devent2stimSequence", "numpy.arange" ]
[((1797, 1814), 'numpy.arange', 'np.arange', (['(0)', '(256)'], {}), '(0, 256)\n', (1806, 1814), True, 'import numpy as np\n'), ((1832, 1857), 'numpy.zeros', 'np.zeros', (['(256)'], {'dtype': 'bool'}), '(256, dtype=bool)\n', (1840, 1857), True, 'import numpy as np\n'), ((3860, 3898), 'numpy.zeros', 'np.zeros', (['stimu...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # S_Se...
[ "collections.namedtuple", "numpy.sqrt", "numpy.random.rand", "matplotlib.pyplot.plot", "numpy.log", "matplotlib.pyplot.style.use", "scipy.stats.lognorm.rvs", "numpy.exp", "numpy.linalg.eigvals", "numpy.linspace", "matplotlib.pyplot.figure", "matplotlib.pyplot.bar", "os.path.abspath", "matp...
[((1075, 1099), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (1088, 1099), True, 'import matplotlib.pyplot as plt\n'), ((1254, 1267), 'numpy.random.randn', 'randn', (['i_', 'i_'], {}), '(i_, i_)\n', (1259, 1267), False, 'from numpy.random import rand, randn\n'), ((1803, 1833...
import tensorflow as tf import numpy as np import RecordLoader as rloader from RecordUtil import converIntToLabels from RecordConver import readVideo def readVideos(filenames): videos = [] videoLens = [] for filename in filenames: video = readVideo(filename) videoLens.append(len(...
[ "RecordConver.readVideo", "tensorflow.Session", "numpy.array", "RecordLoader.loadUtilDict", "tensorflow.train.import_meta_graph", "RecordUtil.converIntToLabels", "tensorflow.train.latest_checkpoint", "tensorflow.get_default_graph" ]
[((1283, 1319), 'RecordLoader.loadUtilDict', 'rloader.loadUtilDict', (['"""utilDict.pkl"""'], {}), "('utilDict.pkl')\n", (1303, 1319), True, 'import RecordLoader as rloader\n'), ((374, 406), 'numpy.array', 'np.array', (['videos'], {'dtype': 'np.uint8'}), '(videos, dtype=np.uint8)\n', (382, 406), True, 'import numpy as ...
import logging import os import textwrap import numpy as np import pytest from yt.config import ytcfg from yt.frontends.enzo.api import EnzoDataset from yt.loaders import load_sample from yt.sample_data.api import get_data_registry_table from yt.testing import requires_module_pytest from yt.utilities.logger import yt...
[ "numpy.testing.assert_array_less", "yt.testing.requires_module_pytest", "pytest.mark.xfail", "pandas.Int64Dtype", "yt.loaders.load_sample", "yt.sample_data.api.get_data_registry_table", "pytest.raises", "pytest.mark.usefixtures", "pytest.fixture", "yt.config.ytcfg.set" ]
[((330, 346), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (344, 346), False, 'import pytest\n'), ((560, 576), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (574, 576), False, 'import pytest\n'), ((860, 901), 'yt.testing.requires_module_pytest', 'requires_module_pytest', (['"""pandas"""', '"""pooch"""'...
#Calculation of the Simulated Impedance # ------------------------------------------------------ # Copyright (C) 2020 <NAME> # Licensed under the MIT license, see LICENSE. # ------------------------------------------------------ import numpy as np import math from arv import * from replot2 import * #===#In...
[ "numpy.array" ]
[((3651, 3668), 'numpy.array', 'np.array', (['DataSim'], {}), '(DataSim)\n', (3659, 3668), True, 'import numpy as np\n')]
#!/usr/bin/env python import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter import pickle import numpy as np import datetime import os data_filename = "/Yep/data/sleep_data_%s.pckl" fig_name = "sandbox/.figures/tmp_sleep.png" def get_hour_min(time_str): fields = time_str.split(':') retu...
[ "os.sync", "pickle.dump", "matplotlib.ticker.FuncFormatter", "pickle.load", "datetime.timedelta", "numpy.append", "numpy.array", "numpy.zeros", "datetime.date.today", "matplotlib.pyplot.subplots", "numpy.arange" ]
[((651, 672), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (670, 672), False, 'import datetime\n'), ((1440, 1459), 'pickle.dump', 'pickle.dump', (['dic', 'f'], {}), '(dic, f)\n', (1451, 1459), False, 'import pickle\n'), ((1486, 1495), 'os.sync', 'os.sync', ([], {}), '()\n', (1493, 1495), False, 'impo...
import numpy as np import os import pygame, sys from pygame.locals import * import sys sys.path.insert(0, os.getcwd()) import rodentia BLACK = (0, 0, 0) MAX_STEP_NUM = 60 * 30 class Display(object): def __init__(self, display_size): self.width = 640 self.height = 480 self.data_path = os...
[ "pygame.display.set_caption", "pygame.init", "rodentia.Environment", "pygame.image.frombuffer", "pygame.event.get", "pygame.display.set_mode", "os.getcwd", "numpy.array", "pygame.key.get_pressed", "pygame.time.Clock", "os.path.abspath", "pygame.display.update" ]
[((106, 117), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (115, 117), False, 'import os\n'), ((12070, 12089), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (12087, 12089), False, 'import pygame, sys\n'), ((420, 509), 'rodentia.Environment', 'rodentia.Environment', ([], {'width': 'self.width', 'height': 's...
""" Copyright (C) 2019 <NAME>, ETH Zurich 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.prod", "cxplain.backend.masking.masking_util.MaskingUtil.get_ith_mask", "numpy.array", "cxplain.backend.masking.masking_util.MaskingUtil.extract_downsample_factors", "numpy.random.seed", "cxplain.backend.masking.masking_util.MaskingUtil.get_input_constants", "unittest.main" ]
[((3467, 3482), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3480, 3482), False, 'import unittest\n'), ((1276, 1295), 'numpy.random.seed', 'np.random.seed', (['(909)'], {}), '(909)\n', (1290, 1295), True, 'import numpy as np\n'), ((1656, 1703), 'cxplain.backend.masking.masking_util.MaskingUtil.extract_downsampl...
import numpy as np import paddle from paddlevision.models.alexnet import alexnet from reprod_log import ReprodLogger if __name__ == "__main__": paddle.set_device("cpu") # load model # the model is save into ~/.cache/torch/hub/checkpoints/alexnet-owt-4df8aa71.pth # def logger reprod_logger = Repr...
[ "reprod_log.ReprodLogger", "paddlevision.models.alexnet.alexnet", "paddle.to_tensor", "numpy.load", "paddle.set_device" ]
[((151, 175), 'paddle.set_device', 'paddle.set_device', (['"""cpu"""'], {}), "('cpu')\n", (168, 175), False, 'import paddle\n'), ((316, 330), 'reprod_log.ReprodLogger', 'ReprodLogger', ([], {}), '()\n', (328, 330), False, 'from reprod_log import ReprodLogger\n'), ((344, 421), 'paddlevision.models.alexnet.alexnet', 'ale...
# Copyright 2019 <NAME>. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
[ "mt.mvae.ops.poincare.poincare_distance", "numpy.sqrt", "mt.mvae.ops.spherical_projected.exp_map", "tests.mvae.ops.test_spherical_projected.is_in_tangent_space", "tests.mvae.ops.test_euclidean.inverse_parallel_transport", "mt.mvae.ops.spherical_projected.inverse_sample_projection_mu0", "tests.mvae.ops.t...
[((1210, 1228), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1224, 1228), True, 'import numpy as np\n'), ((6822, 6870), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""curvature"""', 'curvatures'], {}), "('curvature', curvatures)\n", (6845, 6870), False, 'import pytest\n'), ((7095, 7143...
# # this code is for plate localization # # import tensorflow as tf import cv2 import imutils import numpy as np from imutils import paths import RDetectPlates as detplt from imutils import perspective import matplotlib.pyplot as plt import RLpPreprocess as prpr # # trying different images by addressing different pa...
[ "imutils.perspective.four_point_transform", "imutils.paths.list_images", "numpy.linalg.norm", "cv2.getStructuringElement", "matplotlib.pyplot.imshow", "cv2.threshold", "cv2.erode", "numpy.max", "matplotlib.pyplot.close", "cv2.minAreaRect", "numpy.min", "cv2.boxPoints", "cv2.morphologyEx", ...
[((820, 867), 'cv2.imread', 'cv2.imread', (["(path + '/ANPRCAMERA_701_143.52.jpg')"], {}), "(path + '/ANPRCAMERA_701_143.52.jpg')\n", (830, 867), False, 'import cv2\n'), ((462, 485), 'imutils.paths.list_images', 'paths.list_images', (['path'], {}), '(path)\n', (479, 485), False, 'from imutils import paths\n'), ((1101, ...
import matplotlib.pyplot as plt import random import os import numpy as np import tensorflow as tf import logging from load_data import load_train_data, load_data_by_id, load_entity_by_id, \ load_candidates_by_id, load_mention_entity_prior2, load_entity_emb, load_voting_eid_by_doc, \ get_embeddi...
[ "logging.getLogger", "load_data.load_mention_entity_prior2", "matplotlib.pyplot.ylabel", "numpy.array", "load_data.load_mention_context", "load_data.load_char_vocabulary", "load_data.get_embedding_of_voting", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "os.path.split", "numpy.random.se...
[((417, 438), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (431, 438), False, 'import matplotlib\n'), ((450, 477), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (467, 477), False, 'import logging\n'), ((519, 649), 'logging.basicConfig', 'logging.basicConfig', ([]...
import numpy as np import pandas as pd import datetime from matplotlib import rcParams import matplotlib.pyplot as plt from pandas_datareader import data from tqdm import tqdm from scipy.optimize import minimize from scipy.optimize import NonlinearConstraint def randomWeightGen(n): w = np.random.random(n) ret...
[ "numpy.mean", "numpy.linalg.solve", "numpy.sqrt", "numpy.ones", "numpy.hstack", "numpy.random.random", "tqdm.tqdm", "scipy.optimize.NonlinearConstraint", "datetime.timedelta", "numpy.append", "numpy.array", "numpy.dot", "numpy.linalg.inv", "numpy.expand_dims", "numpy.std", "pandas.Data...
[((293, 312), 'numpy.random.random', 'np.random.random', (['n'], {}), '(n)\n', (309, 312), True, 'import numpy as np\n'), ((520, 533), 'tqdm.tqdm', 'tqdm', (['symbols'], {}), '(symbols)\n', (524, 533), False, 'from tqdm import tqdm\n'), ((993, 1028), 'numpy.cov', 'np.cov', (['assets_daily_return'], {'ddof': '(0)'}), '(...
from torch.utils.data import RandomSampler, BatchSampler, Sampler import numpy as np from random import shuffle class VideoSampler(Sampler): """a batch sampler for sampling multiple video frames""" def __init__(self, dataset, batchSize, shuffle=True): self.dataset = dataset self.num_videos = le...
[ "numpy.random.randint" ]
[((521, 563), 'numpy.random.randint', 'np.random.randint', (['(0)'], {'high': 'self.num_videos'}), '(0, high=self.num_videos)\n', (538, 563), True, 'import numpy as np\n'), ((1470, 1512), 'numpy.random.randint', 'np.random.randint', (['(0)'], {'high': 'self.num_videos'}), '(0, high=self.num_videos)\n', (1487, 1512), Tr...
# -*- coding: utf-8 -*- """ Created on Sat May 14 17:10:46 2016 @author: castaned """ import numpy as np import main_modules as mmod def xi(i,r1,theta,dr,phi,tstp): global dth,dr_arr,alambda dx1 = np.sin(np.deg2rad(i)) # dy1 = 0. dz1 = np.cos(np.deg2rad(i)) x1 = r1*np.sin(np.deg2rad(theta))*np....
[ "numpy.tile", "numpy.sqrt", "numpy.tan", "numpy.arcsin", "numpy.diff", "numpy.array", "numpy.linspace", "numpy.deg2rad", "numpy.empty", "numpy.interp", "numpy.transpose", "numpy.genfromtxt", "numpy.arange" ]
[((537, 572), 'numpy.sqrt', 'np.sqrt', (['((r1 + pert) ** 2 + r3 ** 2)'], {}), '((r1 + pert) ** 2 + r3 ** 2)\n', (544, 572), True, 'import numpy as np\n'), ((841, 880), 'numpy.sqrt', 'np.sqrt', (['(dx2 ** 2 + dy2 ** 2 + dz2 ** 2)'], {}), '(dx2 ** 2 + dy2 ** 2 + dz2 ** 2)\n', (848, 880), True, 'import numpy as np\n'), (...
import warnings import pandas as pd import numpy as np import tensorflow as tf from tensorflow import math as tfm import anndata from .utils import print_func from .utils.float_limits import check_range_exp # Preprocessing functionalities def preprocess(adata, prepro_func='none', transf...
[ "numpy.log", "numpy.argsort", "numpy.nanmean", "numpy.array", "numpy.isfinite", "tensorflow.math.exp", "numpy.exp", "numpy.random.seed", "numpy.concatenate", "numpy.nanmax", "warnings.simplefilter", "anndata.AnnData", "numpy.random.normal", "numpy.nanstd", "numpy.ones", "numpy.random.c...
[((1336, 1363), 'numpy.nanmean', 'np.nanmean', (['adata.X'], {'axis': '(0)'}), '(adata.X, axis=0)\n', (1346, 1363), True, 'import numpy as np\n'), ((1901, 1913), 'numpy.array', 'np.array', (['sf'], {}), '(sf)\n', (1909, 1913), True, 'import numpy as np\n'), ((8050, 8080), 'numpy.random.seed', 'np.random.seed', (["kwarg...
#!/usr/bin/env python3 #title : exponential.py #description : Discrete exponential distribution. #author : <NAME> #date : 2015.06.19 #version : 0.1 #usage : python exponential.py #===================================================== import numpy as np from mpmath import ex...
[ "mpmath.exp", "core.core.delta.log_likelihood", "numpy.where", "core.core.delta.pmf", "numpy.exp", "core.core.delta.samples", "numpy.sum", "numpy.arange" ]
[((940, 965), 'core.core.delta.pmf', 'co.delta.pmf', (['[0]', 'domain'], {}), '([0], domain)\n', (952, 965), True, 'from core import core as co\n'), ((1032, 1056), 'numpy.arange', 'np.arange', (['(0)', '(domain + 1)'], {}), '(0, domain + 1)\n', (1041, 1056), True, 'import numpy as np\n'), ((1542, 1569), 'core.core.delt...
from rlkit.samplers.util import rollout from rlkit.samplers.rollout_functions import multitask_rollout import numpy as np class InPlacePathSampler(object): """ A sampler that does not serialization for sampling. Instead, it just uses the current policy and environment as-is. WARNING: This will affect...
[ "numpy.ones", "rlkit.samplers.util.rollout" ]
[((1912, 1980), 'rlkit.samplers.util.rollout', 'rollout', (['self.env', 'self.policy'], {'max_path_length': 'self.max_path_length'}), '(self.env, self.policy, max_path_length=self.max_path_length)\n', (1919, 1980), False, 'from rlkit.samplers.util import rollout\n'), ((1743, 1786), 'numpy.ones', 'np.ones', (['(1, self....
import numpy as np from PIL import Image import matplotlib.pyplot as plt import matplotlib from corner_detector import * from anms import * from feat_desc import * from feat_match import * from ransac_est_homography import * from mymosaic import * def wrapper(): #SET 1 im1 = np.array(Image.open('SET1_L.jpg')....
[ "matplotlib.pyplot.imshow", "numpy.zeros", "PIL.Image.open", "matplotlib.pyplot.show" ]
[((511, 541), 'numpy.zeros', 'np.zeros', (['(3,)'], {'dtype': '"""object"""'}), "((3,), dtype='object')\n", (519, 541), True, 'import numpy as np\n'), ((715, 739), 'matplotlib.pyplot.imshow', 'plt.imshow', (['final_mosaic'], {}), '(final_mosaic)\n', (725, 739), True, 'import matplotlib.pyplot as plt\n'), ((744, 754), '...
#!/usr/bin/env python # # Observed Data Object # # Started: Jan 2015 (KDG) # from __future__ import print_function import string import numpy as np import matplotlib.pyplot as pyplot from astropy.table import Table from Ext import f99 from Ext import extdata # Object for the observed dust data class ObsData(): ...
[ "numpy.power", "Ext.f99.f99", "Ext.extdata.ExtData", "numpy.square", "numpy.array", "numpy.concatenate" ]
[((442, 459), 'Ext.extdata.ExtData', 'extdata.ExtData', ([], {}), '()\n', (457, 459), False, 'from Ext import extdata\n'), ((1308, 1348), 'numpy.array', 'np.array', (['[7.52, 8.14, 6.88, 6.96, 6.89]'], {}), '([7.52, 8.14, 6.88, 6.96, 6.89])\n', (1316, 1348), True, 'import numpy as np\n'), ((1377, 1417), 'numpy.array', ...
import inspect import numpy as np from limix.core.type.exception import NotArrayConvertibleError def my_name(): return inspect.stack()[1][3] def assert_finite_array(*arrays): for a in arrays: if not np.isfinite(a).all(): raise ValueError("Array must not contain infs or NaNs") def asser...
[ "numpy.isfinite", "numpy.asarray", "inspect.stack", "limix.core.type.exception.NotArrayConvertibleError" ]
[((378, 406), 'numpy.asarray', 'np.asarray', (['arr'], {'dtype': 'float'}), '(arr, dtype=float)\n', (388, 406), True, 'import numpy as np\n'), ((125, 140), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (138, 140), False, 'import inspect\n'), ((449, 525), 'limix.core.type.exception.NotArrayConvertibleError', 'NotA...
import sys import tables from collections import OrderedDict import datetime import os import numpy as np from copy import deepcopy from qtpy import QtGui, QtWidgets from qtpy.QtCore import QObject, Slot, Signal, QLocale, QDateTime, QRectF, QDate, QThread, Qt from pathlib import Path import pickle from pyqtgraph.dockar...
[ "logging.getLogger", "pymodaq.daq_utils.daq_utils.get_set_config_path", "pymodaq.daq_utils.h5modules.browse_data", "qtpy.QtGui.QPixmap", "qtpy.QtWidgets.QListWidget", "qtpy.QtWidgets.QAction", "qtpy.QtWidgets.QStatusBar", "pymodaq.daq_utils.daq_utils.ThreadCommand", "pymodaq.daq_utils.daq_utils.eV2n...
[((1246, 1295), 'pymodaq.daq_utils.daq_utils.get_set_config_path', 'utils.get_set_config_path', (['"""spectrometer_configs"""'], {}), "('spectrometer_configs')\n", (1271, 1295), True, 'from pymodaq.daq_utils import daq_utils as utils\n'), ((1198, 1229), 'pymodaq.daq_utils.daq_utils.get_module_name', 'utils.get_module_n...
import os import unittest import imageio import numpy as np class TestBase(unittest.TestCase): def setUp(self): self.to_clear = [] def tearDown(self): for path in self.to_clear: os.remove(path) def save_temp(self, path, image): self.to_clear.append(path) imag...
[ "numpy.zeros", "imageio.imsave", "os.remove" ]
[((316, 343), 'imageio.imsave', 'imageio.imsave', (['path', 'image'], {}), '(path, image)\n', (330, 343), False, 'import imageio\n'), ((1251, 1287), 'numpy.zeros', 'np.zeros', (['(510, 510)'], {'dtype': 'np.uint8'}), '((510, 510), dtype=np.uint8)\n', (1259, 1287), True, 'import numpy as np\n'), ((218, 233), 'os.remove'...
import pymbar from fe import endpoint_correction from collections import namedtuple import pickle import dataclasses import time import functools import copy import jax import numpy as np from md import minimizer from typing import Tuple, List, Any import os from fe import standard_state from fe.utils import sanitiz...
[ "numpy.sqrt", "numpy.iinfo", "numpy.array", "copy.deepcopy", "numpy.linalg.norm", "fe.utils.sanitize_energies", "pymbar.BAR", "numpy.save", "numpy.mean", "numpy.reshape", "fe.standard_state.release_orientational_restraints", "numpy.asarray", "timemachine.lib.custom_ops.AvgPartialUPartialPara...
[((761, 833), 'jax.tree_util.register_pytree_node', 'jax.tree_util.register_pytree_node', (['SimulationResult', 'flatten', 'unflatten'], {}), '(SimulationResult, flatten, unflatten)\n', (795, 833), False, 'import jax\n'), ((6167, 6369), 'collections.namedtuple', 'namedtuple', (['"""FreeEnergyModel"""', "['unbound_poten...
#from argparse import ArgumentParser #Discomment to pass the variables import visual as v import numpy as np # This version is for visual 6.11 SF = 1e-6 G = C.G * SF ** 3 DT = 3600 * 24 RATE = 50000 scene = v.display(title="Solar System variations", x=0, y=0, z=0, width=600, height=600, range=100...
[ "visual.vector", "visual.norm", "visual.rate", "numpy.loadtxt", "visual.mag" ]
[((1143, 1174), 'numpy.loadtxt', 'np.loadtxt', (['file'], {'dtype': '"""float"""'}), "(file, dtype='float')\n", (1153, 1174), True, 'import numpy as np\n'), ((2228, 2240), 'visual.rate', 'v.rate', (['RATE'], {}), '(RATE)\n', (2234, 2240), True, 'import visual as v\n'), ((376, 393), 'visual.vector', 'v.vector', (['(0)',...
import numpy as np import matplotlib.pyplot as plt plt.figure(figsize=(20.0, 6.0)) def f(x): return 1 - np.sqrt(1 - x ** 2) EXPECTED_AREA = 1.0 - np.pi / 4 def vegas(iterations=3, samples_per_iteration=333, num_bins=20, K=1000, alpha=1.0, make_plots=False): bin_edges = np.linspace(start=0, stop=1, endpoin...
[ "numpy.mean", "numpy.sqrt", "numpy.random.rand", "matplotlib.pyplot.savefig", "matplotlib.pyplot.vlines", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplot", "numpy.sum", "matplotlib.pyplot.figure", "numpy.linspace", "numpy.random.randint", "numpy.zeros", "...
[((51, 82), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20.0, 6.0)'}), '(figsize=(20.0, 6.0))\n', (61, 82), True, 'import matplotlib.pyplot as plt\n'), ((284, 345), 'numpy.linspace', 'np.linspace', ([], {'start': '(0)', 'stop': '(1)', 'endpoint': '(True)', 'num': '(num_bins + 1)'}), '(start=0, stop=1, ...
import numpy as np import pandas as pd import sys import math import os.path as osp import torch from torch_geometric.data import Data from torch_geometric.data import Dataset from torch_geometric.data import InMemoryDataset from sklearn.preprocessing import StandardScaler from torch_geometric.data import DataLoader im...
[ "numpy.column_stack", "torch.cuda.is_available", "numpy.reshape", "ovito.io.export_file", "pandas.DataFrame", "torch_geometric.nn.SAGEConv", "torch.nn.functional.dropout", "torch.save", "torch.nn.functional.relu", "torch.nn.functional.log_softmax", "numpy.bincount", "torch_geometric.data.Data"...
[((723, 746), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (744, 746), False, 'import datetime\n'), ((816, 838), 'ovito.io.import_file', 'import_file', (['file_path'], {}), '(file_path)\n', (827, 838), False, 'from ovito.io import import_file\n'), ((3282, 3337), 'torch.load', 'torch.load', (['"""...
import logging import numpy as np from tramp.models import glm_generative from tramp.experiments import save_experiments, BayesOptimalScenario from tramp.algos import EarlyStopping def run_perceptron(N, alpha, p_pos): model = glm_generative( N=N, alpha=alpha, ensemble_type="gaussian", prior_type="...
[ "logging.basicConfig", "tramp.experiments.BayesOptimalScenario", "tramp.models.glm_generative", "numpy.linspace", "tramp.algos.EarlyStopping" ]
[((231, 353), 'tramp.models.glm_generative', 'glm_generative', ([], {'N': 'N', 'alpha': 'alpha', 'ensemble_type': '"""gaussian"""', 'prior_type': '"""binary"""', 'output_type': '"""sgn"""', 'prior_p_pos': 'p_pos'}), "(N=N, alpha=alpha, ensemble_type='gaussian', prior_type=\n 'binary', output_type='sgn', prior_p_pos=...
# Copyright Amazon.com, Inc. or its affiliates. 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 # Unle...
[ "os.listdir", "boto3.client", "json.dumps", "inspect.signature", "lookoutvision.metrics.Metrics", "time.sleep", "multiprocessing.pool.ThreadPool", "numpy.array", "lookoutvision.manifest.Manifest", "collections.defaultdict", "logging.error" ]
[((2035, 2064), 'boto3.client', 'boto3.client', (['"""lookoutvision"""'], {}), "('lookoutvision')\n", (2047, 2064), False, 'import boto3\n'), ((2084, 2102), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (2096, 2102), False, 'import boto3\n'), ((2564, 2587), 'inspect.signature', 'inspect.signature', ([...
from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import RepeatedStratifiedKFold import numpy as np import pandas as pd def get_splits(dataset_size): return int(np.round(dataset_size / (0.2 * dataset_size))) def append_values(y, split_id): df = pd.DataFrame({f"split_{split_id...
[ "pandas.DataFrame", "numpy.round", "sklearn.ensemble.RandomForestClassifier", "pandas.read_csv" ]
[((417, 461), 'pandas.read_csv', 'pd.read_csv', (['snakemake.input[0]'], {'index_col': '(0)'}), '(snakemake.input[0], index_col=0)\n', (428, 461), True, 'import pandas as pd\n'), ((521, 577), 'sklearn.ensemble.RandomForestClassifier', 'RandomForestClassifier', ([], {'n_estimators': '(100)', 'random_state': '(0)'}), '(n...
# -*- coding: utf-8 -*- """ Created on Wed May 23 16:54:52 2018 @author: tommy_mizuki """ def my_func(x,y): import numpy as np element0 = np.cos(x) + 10*y element1 = np.sin(x) - 20*y A = [element0,element1] print(A)
[ "numpy.sin", "numpy.cos" ]
[((148, 157), 'numpy.cos', 'np.cos', (['x'], {}), '(x)\n', (154, 157), True, 'import numpy as np\n'), ((180, 189), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (186, 189), True, 'import numpy as np\n')]
#-*- encoding:utf8 -*- import os import time import pickle import torch as t import numpy as np from torch.utils import data import nibabel as nib class dataSet_V1(data.Dataset): def __init__(self,sequences_file=None,label_file=None,gos_gile=None,embeddings_file=None, PPI_embedding_file=None): super(dataS...
[ "pickle.load", "numpy.stack", "numpy.array", "numpy.zeros", "numpy.load" ]
[((668, 692), 'numpy.load', 'np.load', (['embeddings_file'], {}), '(embeddings_file)\n', (675, 692), True, 'import numpy as np\n'), ((1189, 1213), 'numpy.stack', 'np.stack', (['feavalue_value'], {}), '(feavalue_value)\n', (1197, 1213), True, 'import numpy as np\n'), ((1279, 1312), 'numpy.array', 'np.array', (['label'],...
import numpy as np import cv2 import random import tqdm import utils import os DAVIS17_TRAINING_VIDEOS = [ 'bear', 'bmx-bumps', 'boat', 'boxing-fisheye', 'breakdance-flare', 'bus', 'car-turn', 'cat-girl', 'classic-car', 'color-run', 'crossing', 'dance-jump', 'dancing', 'disc-jockey', 'dog-agility', 'dog-go...
[ "numpy.random.normal", "os.listdir", "numpy.random.rand", "numpy.logical_and", "numpy.logical_not", "os.path.join", "numpy.logical_or", "numpy.zeros", "numpy.random.randint", "numpy.random.uniform", "cv2.resize", "cv2.imread" ]
[((1872, 1903), 'os.path.join', 'os.path.join', (['date_path', 'subdir'], {}), '(date_path, subdir)\n', (1884, 1903), False, 'import os\n'), ((2527, 2570), 'numpy.zeros', 'np.zeros', (['(self.shape[0], self.shape[1], 3)'], {}), '((self.shape[0], self.shape[1], 3))\n', (2535, 2570), True, 'import numpy as np\n'), ((2636...
from contextlib import suppress from datetime import datetime import requests import numpy as np from astropy import units as u from astropy.time import Time from astropy.coordinates import get_sun, AltAz from panoptes.utils.utils import get_quantity_value AAT_URL = 'http://aat-ops.anu.edu.au/met/metdata.dat' AAT...
[ "astropy.coordinates.get_sun", "requests.get", "datetime.datetime.now", "contextlib.suppress", "panoptes.utils.utils.get_quantity_value", "astropy.coordinates.AltAz", "numpy.arange" ]
[((1377, 1415), 'astropy.coordinates.AltAz', 'AltAz', ([], {'obstime': 'time', 'location': 'location'}), '(obstime=time, location=location)\n', (1382, 1415), False, 'from astropy.coordinates import get_sun, AltAz\n'), ((1939, 1977), 'astropy.coordinates.AltAz', 'AltAz', ([], {'obstime': 'time', 'location': 'location'})...
# ~~~ # This file is part of the paper: # # "A NON-CONFORMING DUAL APPROACH FOR ADAPTIVE TRUST-REGION REDUCED BASIS # APPROXIMATION OF PDE-CONSTRAINED OPTIMIZATION" # # https://github.com/TiKeil/NCD-corrected-TR-RB-approach-for-pde-opt # # Copyright 2019-2020 all developers. All rights reserved. # License:...
[ "numpy.multiply", "numpy.eye", "copy.deepcopy", "numpy.ones", "numpy.array", "numpy.dot", "numpy.outer", "numpy.linalg.norm", "time.time" ]
[((2148, 2161), 'numpy.array', 'np.array', (['Act'], {}), '(Act)\n', (2156, 2161), True, 'import numpy as np\n'), ((4486, 4510), 'numpy.multiply', 'np.multiply', (['Active', 'eta'], {}), '(Active, eta)\n', (4497, 4510), True, 'import numpy as np\n'), ((4522, 4548), 'numpy.multiply', 'np.multiply', (['Inactive', 'eta'],...
from __future__ import print_function import gdal import os import numpy as np from time import time import osr import argparse import shutil from scipy import ndimage as ndi from skimage.filters import gabor_kernel import multiprocessing as mp from sklearn.cluster import AffinityPropagation from sklearn im...
[ "gdal.GetDriverByName", "os.remove", "os.path.exists", "argparse.ArgumentParser", "os.mkdir", "pandas.DataFrame", "osr.SpatialReference", "sklearn.cluster.AffinityPropagation", "scipy.ndimage.convolve", "shutil.copy", "time.time", "sklearn.preprocessing.scale", "gdal.Open", "os.makedirs", ...
[((1002, 1042), 'numpy.zeros', 'np.zeros', (['(2 * n_filters)'], {'dtype': 'np.double'}), '(2 * n_filters, dtype=np.double)\n', (1010, 1042), True, 'import numpy as np\n'), ((1308, 1322), 'gdal.Open', 'gdal.Open', (['arr'], {}), '(arr)\n', (1317, 1322), False, 'import gdal\n'), ((1341, 1358), 'numpy.zeros', 'np.zeros',...
import io import os import time from collections import Counter from tempfile import NamedTemporaryFile import cv2 import numpy as np import pyautogui from gtts import gTTS from mpg123 import Mpg123, Out123 def get_screen_image(): with NamedTemporaryFile() as f: pil_image = pyautogui.screenshot(imageFile...
[ "pyautogui.screenshot", "io.BytesIO", "time.perf_counter", "collections.Counter", "numpy.array", "mpg123.Mpg123", "gtts.gTTS", "tempfile.NamedTemporaryFile", "mpg123.Out123", "cv2.QRCodeDetector" ]
[((480, 500), 'cv2.QRCodeDetector', 'cv2.QRCodeDetector', ([], {}), '()\n', (498, 500), False, 'import cv2\n'), ((565, 580), 'collections.Counter', 'Counter', (['res[1]'], {}), '(res[1])\n', (572, 580), False, 'from collections import Counter\n'), ((243, 263), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2019 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
[ "iris.cube.CubeList", "cf_units.Unit", "improver.units.DEFAULT_UNITS.keys", "numpy.issubdtype", "numpy.modf", "numpy.round" ]
[((4842, 4871), 'iris.cube.CubeList', 'iris.cube.CubeList', (['new_cubes'], {}), '(new_cubes)\n', (4860, 4871), False, 'import iris\n'), ((5578, 5598), 'improver.units.DEFAULT_UNITS.keys', 'DEFAULT_UNITS.keys', ([], {}), '()\n', (5596, 5598), False, 'from improver.units import DEFAULT_UNITS\n'), ((9808, 9845), 'numpy.i...
import pandas as pd import numpy as np import mapping as mp from . import strategy def get_relative_to_expiry_instrument_weights(dates, root_generics, expiries, offsets, all_monthly=False, holidays=None): """ Generate ...
[ "pandas.MultiIndex.from_product", "mapping.mappings.roller", "numpy.busday_offset", "pandas.DatetimeIndex", "pandas.Timedelta", "numpy.array", "pandas.offsets.MonthBegin", "numpy.concatenate", "pandas.DataFrame", "pandas.offsets.MonthEnd", "pandas.date_range" ]
[((6720, 6747), 'numpy.concatenate', 'np.concatenate', (['rebal_dates'], {}), '(rebal_dates)\n', (6734, 6747), True, 'import numpy as np\n'), ((2891, 2945), 'pandas.MultiIndex.from_product', 'pd.MultiIndex.from_product', (["[gnrcs, ['front', 'back']]"], {}), "([gnrcs, ['front', 'back']])\n", (2917, 2945), True, 'import...
from __future__ import print_function import time import numpy as np from scipy.special import gammaln, psi from six.moves import xrange from .utils import write_top_words from .formatted_logger import formatted_logger eps = 1e-20 logger = formatted_logger('RelationalTopicModel', 'info') class RelationalTopicMode...
[ "numpy.random.normal", "os.path.exists", "scipy.special.psi", "numpy.log", "numpy.exp", "numpy.sum", "numpy.random.dirichlet", "numpy.random.gamma", "six.moves.xrange", "numpy.zeros", "numpy.savetxt", "os.mkdir", "numpy.dot", "time.time", "scipy.special.gammaln" ]
[((854, 915), 'numpy.random.gamma', 'np.random.gamma', (['(100.0)', '(1.0 / 100)', '[self.n_doc, self.n_topic]'], {}), '(100.0, 1.0 / 100, [self.n_doc, self.n_topic])\n', (869, 915), True, 'import numpy as np\n'), ((934, 986), 'numpy.random.dirichlet', 'np.random.dirichlet', (['([5] * self.n_voca)', 'self.n_topic'], {}...
"""test update parameters""" import numpy as np from neuralink.parameters import Parameters from .utils import multiple_test def test_update_parameters1(): parameters = { "W1": np.array( [ [-0.00615039, 0.0169021], [-0.02311792, 0.03137121], [-...
[ "numpy.allclose", "neuralink.parameters.Parameters", "numpy.array", "numpy.random.seed", "numpy.random.randn" ]
[((1224, 1348), 'numpy.array', 'np.array', (['[[-0.00643025, 0.01936718], [-0.02410458, 0.03978052], [-0.01653973, -\n 0.02096177], [0.01046864, -0.05990141]]'], {}), '([[-0.00643025, 0.01936718], [-0.02410458, 0.03978052], [-\n 0.01653973, -0.02096177], [0.01046864, -0.05990141]])\n', (1232, 1348), True, 'import...
# -*- coding: utf-8 -*- from datetime import datetime import tensorflow as tf import tensornet as tn import numpy as np def read_dataset(data_path, days, match_pattern, batch_size, parse_func, num_parallel_calls = 12): ds_data_files = tn.data.list_files(data_path, days=days, match_pattern=match_pattern) datas...
[ "tensorflow.data.TFRecordDataset", "tensornet.core.shard_num", "tensornet.core.self_shard_id", "tensornet.model.read_last_train_dt", "tensornet.data.BalanceDataset", "tensorflow.io.write_file", "numpy.concatenate", "datetime.datetime.fromisoformat", "tensornet.data.list_files" ]
[((241, 310), 'tensornet.data.list_files', 'tn.data.list_files', (['data_path'], {'days': 'days', 'match_pattern': 'match_pattern'}), '(data_path, days=days, match_pattern=match_pattern)\n', (259, 310), True, 'import tensornet as tn\n'), ((867, 898), 'tensornet.data.BalanceDataset', 'tn.data.BalanceDataset', (['dataset...
import numpy as np import re import torch import random import transformers from sklearn.preprocessing import LabelEncoder from transformers import DistilBertTokenizer, DistilBertModel import sys import pathlib scripts_dir = pathlib.Path(__file__).parent.resolve() sys.path.append(str(scripts_dir)) from bert_model impor...
[ "os.path.exists", "sklearn.preprocessing.LabelEncoder", "random.choice", "torch.nn.Softmax", "transformers.DistilBertModel.from_pretrained", "pathlib.Path", "torch.load", "os.environ.get", "os.path.join", "numpy.argmax", "transformers.DistilBertTokenizer.from_pretrained", "torch.tensor", "to...
[((421, 450), 'transformers.logging.set_verbosity_error', 'logging.set_verbosity_error', ([], {}), '()\n', (448, 450), False, 'from transformers import logging\n'), ((544, 578), 'os.environ.get', 'os.environ.get', (['"""mode"""', '"""response"""'], {}), "('mode', 'response')\n", (558, 578), False, 'import os\n'), ((610...
from zipfile import ZipFile # from skimage.io import imread import os import numpy as np import pandas as pd from PIL import Image from pathlib import Path from data_layer.util import image_path # from data_layer.dataset import CovidMetadata # DEFAULT_BASE_PATH = 'C:/Covid-Screening/data_layer/raw_data' DEFAULT_BAS...
[ "PIL.Image.open", "numpy.repeat", "pandas.read_csv", "pathlib.Path", "zipfile.ZipFile", "os.path.join", "os.pathPath", "pandas.DataFrame", "data_layer.util.image_path" ]
[((388, 435), 'os.path.join', 'os.path.join', (['DEFAULT_BASE_PATH', '"""metadata.csv"""'], {}), "(DEFAULT_BASE_PATH, 'metadata.csv')\n", (400, 435), False, 'import os\n'), ((819, 858), 'pandas.read_csv', 'pd.read_csv', (['DEFAULT_METADATA_BASE_PATH'], {}), '(DEFAULT_METADATA_BASE_PATH)\n', (830, 858), True, 'import pa...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Drop in replacement for lf0 extraction in the HTS training demo script using Praat, trying to compensate for octave errors especially if the voice is slightly hoarse... """ from __future__ import unicode_literals, division, print_function #Py2 __author__ = "<NA...
[ "ttslab.trackfile.Track", "math.log", "ttslab.extend", "numpy.array", "numpy.concatenate" ]
[((454, 513), 'ttslab.extend', 'ttslab.extend', (['Track', '"""ttslab.trackfile.funcs.tfuncs_praat"""'], {}), "(Track, 'ttslab.trackfile.funcs.tfuncs_praat')\n", (467, 513), False, 'import ttslab\n'), ((770, 777), 'ttslab.trackfile.Track', 'Track', ([], {}), '()\n', (775, 777), False, 'from ttslab.trackfile import Trac...
import sys import numpy as np import matplotlib print("Python", sys.version) print("Numpy", np.__version__) print("Matplotlib", matplotlib.__version__) inputs = [1.0, 2.0, 3.0, 2.5] weights = [[0.2, 0.8, -0.5, 1.0], [0.5, -0.91, 0.26, -0.5], [-0.26, -0.27, 0.17, 0.87]] bias = [2....
[ "numpy.dot" ]
[((696, 719), 'numpy.dot', 'np.dot', (['weights', 'inputs'], {}), '(weights, inputs)\n', (702, 719), True, 'import numpy as np\n')]
import unittest from site_analysis.atom import Atom from unittest.mock import patch, MagicMock, Mock from pymatgen.core import Structure, Lattice import numpy as np class AtomTestCase(unittest.TestCase): def test_atom_is_initialised(self): atom = Atom(index=22) self.assertEqual(atom.index, 22) ...
[ "pymatgen.core.Lattice.from_parameters", "pymatgen.core.Structure", "numpy.array", "site_analysis.atom.Atom", "unittest.main", "numpy.testing.assert_array_equal" ]
[((2210, 2263), 'pymatgen.core.Lattice.from_parameters', 'Lattice.from_parameters', (['(10.0)', '(10.0)', '(10.0)', '(90)', '(90)', '(90)'], {}), '(10.0, 10.0, 10.0, 90, 90, 90)\n', (2233, 2263), False, 'from pymatgen.core import Structure, Lattice\n'), ((2287, 2387), 'numpy.array', 'np.array', (['[[1.0, 1.0, 1.0], [9....
__description__ = \ """ Standard plots for output of machine learning runs. """ __author__ = "<NAME>" __date__ = "2016-04-23" import numpy as np import matplotlib.pylab as plt from matplotlib.backends.backend_pdf import PdfPages def correlation(ml_data,ml_machine,pdf_file=None,max_value=12): if pdf_file is not N...
[ "matplotlib.pylab.xlim", "numpy.polyfit", "matplotlib.pylab.figure", "matplotlib.pylab.ylim", "matplotlib.pylab.xlabel", "numpy.array", "matplotlib.pylab.rcParams.update", "matplotlib.pylab.plot", "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pylab.ylabel" ]
[((367, 405), 'matplotlib.pylab.rcParams.update', 'plt.rcParams.update', (["{'font.size': 20}"], {}), "({'font.size': 20})\n", (386, 405), True, 'import matplotlib.pylab as plt\n'), ((416, 442), 'matplotlib.pylab.figure', 'plt.figure', ([], {'figsize': '(7, 7)'}), '(figsize=(7, 7))\n', (426, 442), True, 'import matplot...
import sys, serial, time, array import numpy as np import statistics as st class TFmini(): def __init__(self): self.ser = serial.Serial("/dev/ttyAMA0", 115200) #self.unit_cm = 24.57284 # number unit per one centimater self.lidar_per_sec = 127.64107 self.rate_s...
[ "serial.Serial", "statistics.mode", "numpy.max" ]
[((144, 181), 'serial.Serial', 'serial.Serial', (['"""/dev/ttyAMA0"""', '(115200)'], {}), "('/dev/ttyAMA0', 115200)\n", (157, 181), False, 'import sys, serial, time, array\n'), ((3118, 3133), 'numpy.max', 'np.max', (['disList'], {}), '(disList)\n', (3124, 3133), True, 'import numpy as np\n'), ((1125, 1137), 'statistics...
# Front matter ############## import os from os import fdopen, remove from tempfile import mkstemp from shutil import move import glob import re import time import pandas as pd import numpy as np from scipy import constants from scipy.optimize import curve_fit, fsolve from scipy.interpolate import interp1d import matpl...
[ "os.path.exists", "pandas.read_csv", "os.makedirs", "scipy.interpolate.interp1d", "seaborn.set_style", "numpy.exp", "matplotlib.pyplot.close", "matplotlib.rc", "pandas.DataFrame", "re.findall", "time.time", "matplotlib.pyplot.subplots", "glob.glob" ]
[((509, 545), 'matplotlib.rc', 'matplotlib.rc', (['"""xtick"""'], {'labelsize': '(16)'}), "('xtick', labelsize=16)\n", (522, 545), False, 'import matplotlib\n'), ((547, 583), 'matplotlib.rc', 'matplotlib.rc', (['"""ytick"""'], {'labelsize': '(16)'}), "('ytick', labelsize=16)\n", (560, 583), False, 'import matplotlib\n'...
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ # SPDX-FileCopyrightText: 2021 <NAME> # SPDX-License-Identifier: MIT import simpa as sp import numpy as np def create_custom_absorber(): wavelengths = np.linspace(200, 1500, 100) absorber = sp.Spectrum(spectrum_name="random absorber...
[ "simpa.ScatteringSpectrumLibrary.CONSTANT_SCATTERING_ARBITRARY", "simpa.MOLECULE_LIBRARY.deoxyhemoglobin", "simpa.MOLECULE_LIBRARY.water", "numpy.linspace", "numpy.shape", "simpa.MOLECULE_LIBRARY.oxyhemoglobin", "simpa.AnisotropySpectrumLibrary.CONSTANT_ANISOTROPY_ARBITRARY", "simpa.MolecularCompositi...
[((235, 262), 'numpy.linspace', 'np.linspace', (['(200)', '(1500)', '(100)'], {}), '(200, 1500, 100)\n', (246, 262), True, 'import numpy as np\n'), ((1061, 1095), 'simpa.MolecularCompositionGenerator', 'sp.MolecularCompositionGenerator', ([], {}), '()\n', (1093, 1095), True, 'import simpa as sp\n'), ((738, 802), 'simpa...
import numpy as np import time import sys import random from domain.make_env import make_env from .ind import * from domain.classify_gym import mnist_256, fashion_mnist import pdb class Task(): """Problem domain to be solved by neural network. Uses OpenAI Gym patterns. """ def __init__(self, game, param...
[ "numpy.mean", "numpy.copy", "numpy.reshape", "numpy.where", "domain.classify_gym.mnist_256", "numpy.argmax", "random.seed", "numpy.array", "numpy.linspace", "numpy.sum", "numpy.empty", "numpy.random.seed", "numpy.isnan", "domain.classify_gym.fashion_mnist", "numpy.full", "numpy.shape",...
[((3425, 3453), 'numpy.reshape', 'np.reshape', (['wVec', '(dim, dim)'], {}), '(wVec, (dim, dim))\n', (3435, 3453), True, 'import numpy as np\n'), ((4385, 4410), 'numpy.argmax', 'np.argmax', (['action'], {'axis': '(1)'}), '(action, axis=1)\n', (4394, 4410), True, 'import numpy as np\n'), ((5004, 5057), 'numpy.empty', 'n...
import os import cv2 import copy import numpy as np import imgaug as ia from imgaug import augmenters as iaa from keras.utils import Sequence import xml.etree.ElementTree as ET from yok.utils import BoundBox, normalize, bbox_iou def parse_annotation(ann_dir, img_dir, labels=[]): count = 0 all_img...
[ "cv2.rectangle", "imgaug.augmenters.AverageBlur", "imgaug.augmenters.GaussianBlur", "yok.utils.bbox_iou", "copy.deepcopy", "numpy.random.binomial", "os.listdir", "xml.etree.ElementTree.parse", "imgaug.augmenters.Add", "imgaug.augmenters.Sharpen", "imgaug.augmenters.AdditiveGaussianNoise", "num...
[((374, 393), 'os.listdir', 'os.listdir', (['ann_dir'], {}), '(ann_dir)\n', (384, 393), False, 'import os\n'), ((490, 513), 'xml.etree.ElementTree.parse', 'ET.parse', (['(ann_dir + ann)'], {}), '(ann_dir + ann)\n', (498, 513), True, 'import xml.etree.ElementTree as ET\n'), ((4677, 4762), 'numpy.zeros', 'np.zeros', (["(...
# Algoritmos y Complejidad # Profesor: <NAME> # Alumno: <NAME> import datetime as time import numpy as np from matplotlib import pyplot as plt import AlgoritmosOrdenacion as sort # Configuaracion inicio = 0 # Tamano inicial del arreglo aumento = 1 # Aumento del tamano del arreglo tamMax = 1000001 # T...
[ "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "AlgoritmosOrdenacion.InsertionSort", "AlgoritmosOrdenacion.MergeSort", "datetime.datetime.now", "numpy.random.randint", "matplotlib.pyplot.pause", "matplotlib.pyplot.title", "AlgoritmosOrdenacion.BubbleSort", "mat...
[((2217, 2227), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2225, 2227), True, 'from matplotlib import pyplot as plt\n'), ((755, 789), 'numpy.random.randint', 'np.random.randint', (['(1)', '(1000)'], {'size': 'n'}), '(1, 1000, size=n)\n', (772, 789), True, 'import numpy as np\n'), ((798, 817), 'datetime.da...
import matplotlib matplotlib.use('Agg') import numpy from amuse.io import write_set_to_file from amuse.io import read_set_from_file from amuse.lab import Particles, units from amuse.ext.protodisk import ProtoPlanetaryDisk from amuse.lab import nbody_system from amuse.lab import new_powerlaw_mass_distribution from matpl...
[ "amuse.lab.Particles", "matplotlib.use", "amuse.lab.new_powerlaw_mass_distribution", "amuse.lab.nbody_system.nbody_to_si", "numpy.random.seed", "amuse.ext.protodisk.ProtoPlanetaryDisk", "amuse.io.write_set_to_file" ]
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((475, 487), 'amuse.lab.Particles', 'Particles', (['(3)'], {}), '(3)\n', (484, 487), False, 'from amuse.lab import Particles, units\n'), ((1261, 1281), 'numpy.random.seed', 'numpy.random.seed', (['...
import numpy as np def sigmoid(x): return 1 / (1 + np.exp(-x)) def relu(x): return np.maximum(x, 0) def d_relu_dz(z): return (z > 0) * 1 def leaky_relu(Z): return np.maximum(0.1 * Z, Z) def d_leaky_relu_dz(z): return 1 if z >= 0 else 0.01 def tanh(Z): return np.tanh(Z) def d_tanh_d...
[ "numpy.exp", "numpy.maximum", "numpy.tanh", "numpy.square" ]
[((95, 111), 'numpy.maximum', 'np.maximum', (['x', '(0)'], {}), '(x, 0)\n', (105, 111), True, 'import numpy as np\n'), ((187, 209), 'numpy.maximum', 'np.maximum', (['(0.1 * Z)', 'Z'], {}), '(0.1 * Z, Z)\n', (197, 209), True, 'import numpy as np\n'), ((295, 305), 'numpy.tanh', 'np.tanh', (['Z'], {}), '(Z)\n', (302, 305)...
""" Module for holding common checking utility functions. """ # Copyright (c) 2012-2013 <NAME> # # This file is part of the KMCLib project distributed under the terms of the # GNU General Public License version 3, see <http://www.gnu.org/licenses/>. # import numpy from KMCLib.Exceptions.Error import Error def c...
[ "KMCLib.Exceptions.Error.Error", "numpy.linalg.det", "numpy.array", "numpy.shape", "numpy.transpose" ]
[((1955, 2019), 'numpy.array', 'numpy.array', (['[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]'], {}), '([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])\n', (1966, 2019), False, 'import numpy\n'), ((2192, 2221), 'numpy.transpose', 'numpy.transpose', (['cell_vectors'], {}), '(cell_vectors)\n', (2207, 2221), F...
from numba import jit import numpy as np import matplotlib.pyplot as plt visualization = True def show_spheres(scale, points, rgb, label=None): """ :param scale: int :param points: tuple (x, y, z) :param rgb: :return: """ if label is not None: print('') print(label) p...
[ "numpy.sqrt", "numpy.arccos", "numpy.array", "numpy.arctan2", "numpy.sin", "numpy.multiply", "numpy.max", "numpy.stack", "numpy.dot", "numpy.min", "numpy.identity", "numpy.deg2rad", "numba.jit", "numpy.cos", "matplotlib.pyplot.draw", "matplotlib.pyplot.legend", "matplotlib.pyplot.sho...
[((2861, 2891), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'cache': '(True)'}), '(nopython=True, cache=True)\n', (2864, 2891), False, 'from numba import jit\n'), ((4176, 4206), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'cache': '(True)'}), '(nopython=True, cache=True)\n', (4179, 4206), False, 'from numba imp...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """Return residual from pyccd model using Google Earth Engine Usage: GE_pyccd_residual.py [options] --path=PATH path --row=ROW row --lon=LON longitude --lat=LAT latitude --date=DATE date to compare (%Y%j) --count=COUNT ...
[ "wget.download", "ee.Image", "ee.ImageCollection", "numpy.array", "sys.exit", "numpy.sin", "numpy.linalg.norm", "docopt.docopt", "numpy.arange", "numpy.where", "datetime.datetime.fromordinal", "os.path.isdir", "os.mkdir", "pandas.DataFrame", "ccd.detect", "numpy.abs", "ee.Filter.eq",...
[((787, 802), 'ee.Initialize', 'ee.Initialize', ([], {}), '()\n', (800, 802), False, 'import ee\n'), ((5173, 5211), 'pandas.merge', 'pd.merge', (['df_sr', 'df_thermal'], {'on': '"""time"""'}), "(df_sr, df_thermal, on='time')\n", (5181, 5211), True, 'import pandas as pd\n'), ((5687, 5707), 'numpy.array', 'np.array', (["...
#!/usr/bin/env python3 """ Parse intermediary data files and produce single hdf5 file with collected information about each read. All the intermediary txt files can be deleted after this step. Usage: python collect_data.py test output.hdf5 {..long list of input files..} [.. optional files with restriction annot..] E...
[ "numpy.array", "re.findall", "numpy.minimum", "h5py.File" ]
[((1880, 1911), 'h5py.File', 'h5py.File', (['output_filename', '"""w"""'], {}), "(output_filename, 'w')\n", (1889, 1911), False, 'import h5py\n'), ((11826, 11902), 'numpy.minimum', 'np.minimum', (["outfile['dna_R1_len_trim'][()]", "outfile['dna_R1_len_notrim'][()]"], {}), "(outfile['dna_R1_len_trim'][()], outfile['dna_...
# Object Detector # Developed by <NAME> : November 2018 # # Developped on : Python 3.6.5.final.0 (Conda 4.5.11), OpenCV 3.4.1, Numpy 1.14.3 # The programs first extracts the circles (Hough Transform) on each frame, # then compares each circle with the object using the SIFT detector. # Execute as follows : detect....
[ "cv2.rectangle", "cv2.threshold", "csv.writer", "cv2.medianBlur", "cv2.HoughCircles", "cv2.VideoWriter", "cv2.imshow", "numpy.count_nonzero", "cv2.circle", "cv2.waitKey", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.VideoWriter_fourcc", "cv2.xfeatures2d.SIFT_create", "cv2.cvtColor",...
[((4477, 4505), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video_file'], {}), '(video_file)\n', (4493, 4505), False, 'import cv2\n'), ((4518, 4544), 'cv2.imread', 'cv2.imread', (['"""positive.png"""'], {}), "('positive.png')\n", (4528, 4544), False, 'import cv2\n'), ((4579, 4608), 'cv2.xfeatures2d.SIFT_create', 'cv2.xf...
# Piecewise-constant Neural ODEs # <NAME>, <NAME>, <NAME> import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Circle import matplotlib.collections as mcollections from skimage.transform import resize from moviepy.editor import ImageSequenceClip ##### GENERIC PLOTTING UTILITIES ##### d...
[ "matplotlib.pyplot.close", "numpy.stack", "matplotlib.pyplot.figure", "matplotlib.pyplot.ion", "matplotlib.patches.Circle", "matplotlib.collections.PatchCollection.__init__", "skimage.transform.resize" ]
[((1201, 1218), 'numpy.stack', 'np.stack', (['new_ims'], {}), '(new_ims)\n', (1209, 1218), True, 'import numpy as np\n'), ((1703, 1712), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (1710, 1712), True, 'import matplotlib.pyplot as plt\n'), ((2164, 2175), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n'...
import os, sys import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from anndata import read_mtx import pegasus as pg from termcolor import cprint from sklearn.metrics import silhouette_score method_list = ["baseline", "pegasus", "seurat", "mnn", "combat", "bbknn"] figure_index...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "pegasus.neighbors", "seaborn.scatterplot", "sys.exit", "pegasus.write_output", "os.path.exists", "os.listdir", "pegasus.umap", "matplotlib.pyplot.xlabel", "pandas.Categorical", "matplotlib.pyplot.close", "pandas.DataFrame", "pegasus.calc_kBET...
[((997, 1051), 'termcolor.cprint', 'cprint', (['"""For pegasus with no batch correction:"""', '"""red"""'], {}), "('For pegasus with no batch correction:', 'red')\n", (1003, 1051), False, 'from termcolor import cprint\n'), ((1230, 1274), 'termcolor.cprint', 'cprint', (['"""Loading processed data..."""', '"""green"""'],...
import numpy as np def sigmoid(x): return 1 / (1 + np.exp(-x)) def sigmoid_der(x): return x / (1 - x) def relu(x): if x > 0: return x else: return 0 def relu_der(x): if x > 0: return 1 else: return 0 def leaky_relu(x): if x < 0: return 0.01 * x ...
[ "numpy.exp" ]
[((56, 66), 'numpy.exp', 'np.exp', (['(-x)'], {}), '(-x)\n', (62, 66), True, 'import numpy as np\n'), ((437, 447), 'numpy.exp', 'np.exp', (['(-x)'], {}), '(-x)\n', (443, 447), True, 'import numpy as np\n'), ((479, 488), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (485, 488), True, 'import numpy as np\n'), ((515, 524),...
#! /usr/bin/env python from distutils.core import Extension, setup from distutils import sysconfig import numpy try: numpy_include = numpy.get_include() except: numpy_include = numpy.get_numpy_include() # inplace extension module _inplace = Extension("_inplace", ["inplace.i", "inplace.c"], include_d...
[ "distutils.core.Extension", "numpy.get_include", "numpy.get_numpy_include", "distutils.core.setup" ]
[((253, 332), 'distutils.core.Extension', 'Extension', (['"""_inplace"""', "['inplace.i', 'inplace.c']"], {'include_dirs': '[numpy_include]'}), "('_inplace', ['inplace.i', 'inplace.c'], include_dirs=[numpy_include])\n", (262, 332), False, 'from distutils.core import Extension, setup\n'), ((348, 530), 'distutils.core.se...
#!/usr/bin/env python # encoding: utf-8 # # Copyright SAS Institute # # 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 b...
[ "numpy.asarray", "io.BytesIO", "PIL.Image.isImageType" ]
[((1799, 1822), 'PIL.Image.isImageType', 'Image.isImageType', (['data'], {}), '(data)\n', (1816, 1822), False, 'from PIL import Image\n'), ((2445, 2461), 'io.BytesIO', 'io.BytesIO', (['data'], {}), '(data)\n', (2455, 2461), False, 'import io\n'), ((883, 904), 'numpy.asarray', 'np.asarray', (['pil_image'], {}), '(pil_im...
from __future__ import division import numpy as np import math def vectorAdd(v1, v2): ans = (v1[0]+v2[0], v1[1]+v2[1], v1[2]+v2[2]) return ans def vectorSum(vList): ans = (0, 0, 0) for v in vList: ans = vectorAdd(ans, v) return ans def vectorCross(v1, v2): v1 = li...
[ "math.pow", "numpy.cross", "numpy.linalg.norm" ]
[((363, 379), 'numpy.cross', 'np.cross', (['v1', 'v2'], {}), '(v1, v2)\n', (371, 379), True, 'import numpy as np\n'), ((1151, 1170), 'numpy.linalg.norm', 'np.linalg.norm', (['vec'], {}), '(vec)\n', (1165, 1170), True, 'import numpy as np\n'), ((1427, 1449), 'math.pow', 'math.pow', (['vec[0]', 'pow_'], {}), '(vec[0], po...
import requests as rt import pandas as pd import numpy as np import PyPDF2 as p2 from pathlib import Path def trans_csv(path): #Recebe o caminho do arquivo csv e retorna uma array do tipo string. Leitura do arquivo csv com os dados das escolas. Transforma a coluna COD_ESC em uma unida Array do tipo string. data =...
[ "pandas.read_csv", "pathlib.Path", "requests.get", "numpy.array", "PyPDF2.PdfFileReader" ]
[((321, 338), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (332, 338), True, 'import pandas as pd\n'), ((351, 376), 'numpy.array', 'np.array', (["data['COD_ESC']"], {}), "(data['COD_ESC'])\n", (359, 376), True, 'import numpy as np\n'), ((907, 918), 'requests.get', 'rt.get', (['url'], {}), '(url)\n', (9...
import numpy as np from .detector import LISADetector class NoiseCorrelationBase(object): """ Noise correlation objects have methods to compute noise PSD correlation matrices. Do not use the bare class. """ def __init__(self, ndet): self.ndet def _get_corrmat(self, f): raise ...
[ "numpy.tile", "numpy.eye", "numpy.fabs", "numpy.ndim", "numpy.full", "numpy.atleast_1d" ]
[((1459, 1475), 'numpy.atleast_1d', 'np.atleast_1d', (['f'], {}), '(f)\n', (1472, 1475), True, 'import numpy as np\n'), ((1945, 1962), 'numpy.eye', 'np.eye', (['self.ndet'], {}), '(self.ndet)\n', (1951, 1962), True, 'import numpy as np\n'), ((3277, 3293), 'numpy.atleast_1d', 'np.atleast_1d', (['f'], {}), '(f)\n', (3290...
import numpy as np from sklearn.datasets import load_iris import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestClassifier from matplotlib import cm s=20 X, y = load_iris(return_X_y=True) X = X[:, [2, 3]] f, ax = plt.subplots(figsize=(4, 2.2)) ax.set_xlim(0, 7) ax.set_ylim(0, 2.7) x_ = ax.set_xlab...
[ "sklearn.datasets.load_iris", "matplotlib.pyplot.contourf", "matplotlib.pyplot.savefig", "numpy.where", "sklearn.ensemble.RandomForestClassifier", "numpy.array", "numpy.linspace", "matplotlib.pyplot.scatter", "matplotlib.pyplot.subplots", "matplotlib.pyplot.legend" ]
[((181, 207), 'sklearn.datasets.load_iris', 'load_iris', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (190, 207), False, 'from sklearn.datasets import load_iris\n'), ((234, 264), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(4, 2.2)'}), '(figsize=(4, 2.2))\n', (246, 264), True, 'import matp...
# stdlib from abc import ABCMeta, abstractmethod from typing import Any, List, Tuple # third party import numpy as np class Params(metaclass=ABCMeta): def __init__(self, name: str, bounds: Tuple[Any, Any]) -> None: self.name = name self.bounds = bounds @abstractmethod def get(self) -> Li...
[ "numpy.random.choice", "numpy.random.uniform" ]
[((1155, 1193), 'numpy.random.uniform', 'np.random.uniform', (['self.low', 'self.high'], {}), '(self.low, self.high)\n', (1172, 1193), True, 'import numpy as np\n'), ((731, 764), 'numpy.random.choice', 'np.random.choice', (['self.choices', '(1)'], {}), '(self.choices, 1)\n', (747, 764), True, 'import numpy as np\n'), (...
import math import numpy as np from scipy.spatial.transform import Rotation """ The rotations can of two types: 1. In a global frame of reference (also known as rotation w.r.t. fixed or extrinsic frame) 2. In a body-centred frame of reference (also known as rotation with respect to current frame of reference. It is ...
[ "numpy.roll", "scipy.spatial.transform.Rotation.from_euler", "scipy.spatial.transform.Rotation.from_matrix", "numpy.tan", "scipy.spatial.transform.Rotation.from_quat", "numpy.arcsin", "math.cos", "numpy.array", "numpy.dot", "numpy.arctan2", "numpy.cos", "numpy.sin", "math.sin", "numpy.rand...
[((2362, 2381), 'math.cos', 'math.cos', (['(yaw * 0.5)'], {}), '(yaw * 0.5)\n', (2370, 2381), False, 'import math\n'), ((2391, 2410), 'math.sin', 'math.sin', (['(yaw * 0.5)'], {}), '(yaw * 0.5)\n', (2399, 2410), False, 'import math\n'), ((2420, 2441), 'math.cos', 'math.cos', (['(pitch * 0.5)'], {}), '(pitch * 0.5)\n', ...
""" Provide some basic statistics on the get_valid_cpgs_dataset file before converting it to a data for the nn """ import argparse import os import sys import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns plt.style.use('seaborn') sns.set_style('whitegrid') # Change this when ...
[ "matplotlib.pyplot.subplots_adjust", "pandas.isnull", "matplotlib.pyplot.grid", "argparse.ArgumentParser", "pandas.read_csv", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "os.path.join", "matplotlib.pyplot.style.use", "seaborn.set_style", "matplotlib.pyplot.close", "numpy.sum", "o...
[((248, 272), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (261, 272), True, 'import matplotlib.pyplot as plt\n'), ((273, 299), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (286, 299), True, 'import seaborn as sns\n'), ((484, 509), 'arg...
# map labels to shuffled images import os import yaml import numpy as np def div_labels(src_file, orig_batch_size, num_div): ''' src_file, is a .npy file orig_batch_size, original batch size num_div, is number of batches to divide, can only be 2 or 4 for now ''' labels = np.load(src_file) ...
[ "os.makedirs", "os.path.join", "yaml.load", "os.path.isdir", "numpy.all", "numpy.load", "numpy.save" ]
[((300, 317), 'numpy.load', 'np.load', (['src_file'], {}), '(src_file)\n', (307, 317), True, 'import numpy as np\n'), ((3350, 3389), 'numpy.save', 'np.save', (['train_label_name', 'final_labels'], {}), '(train_label_name, final_labels)\n', (3357, 3389), True, 'import numpy as np\n'), ((3666, 3697), 'numpy.save', 'np.sa...
""" " License: " ----------------------------------------------------------------------------- " Copyright (c) 2018, <NAME>. " All rights reserved. " " Redistribution and use in source and binary forms, with or without " modification, are permitted provided that the following conditions are met: " " 1. Redistr...
[ "os.path.exists", "sklearn.preprocessing.LabelEncoder", "numpy.mean", "os.makedirs", "sklearn.model_selection.train_test_split", "os.path.join", "numpy.ravel", "cv2.imread", "os.walk" ]
[((2127, 2159), 'os.path.join', 'os.path.join', (['root_path', '"""train"""'], {}), "(root_path, 'train')\n", (2139, 2159), False, 'import os\n'), ((2191, 2231), 'os.path.join', 'os.path.join', (['root_path', '"""val"""', '"""images"""'], {}), "(root_path, 'val', 'images')\n", (2203, 2231), False, 'import os\n'), ((226...
""" File: pylinex/loglikelihood/NonlinearTruncationLoglikelihood.py Author: <NAME> Date: 29 Sep 2018 Description: File containing a class which represents a DIC-like loglikelihood which uses the number of coefficients to use in each of a number of bases as the parameters of the likelihood. ""...
[ "distpy.Expression.load_from_hdf5_group", "numpy.allclose", "numpy.sqrt", "numpy.reshape", "numpy.power", "numpy.array", "numpy.dot", "numpy.isnan" ]
[((3533, 3548), 'numpy.array', 'np.array', (['value'], {}), '(value)\n', (3541, 3548), True, 'import numpy as np\n'), ((8652, 8704), 'distpy.Expression.load_from_hdf5_group', 'Expression.load_from_hdf5_group', (["group['expression']"], {}), "(group['expression'])\n", (8683, 8704), False, 'from distpy import Expression\...
import os import glob import argparse import numpy as np from deepSM import SMData from deepSM import bpm_estimator def evaluate_bpm(raw_data_path, gen_path): songs = os.listdir(gen_path) true_bpms = [] est_bpms = [] for song_name in songs: est_sm = SMData.SMFile( song_name, ...
[ "numpy.mean", "numpy.abs", "os.listdir", "argparse.ArgumentParser", "deepSM.bpm_estimator.true_bpm", "numpy.array", "deepSM.SMData.SMFile" ]
[((174, 194), 'os.listdir', 'os.listdir', (['gen_path'], {}), '(gen_path)\n', (184, 194), False, 'import os\n'), ((723, 742), 'numpy.array', 'np.array', (['true_bpms'], {}), '(true_bpms)\n', (731, 742), True, 'import numpy as np\n'), ((758, 776), 'numpy.array', 'np.array', (['est_bpms'], {}), '(est_bpms)\n', (766, 776)...
# coding=utf-8 # Copyright 2016-2018 <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 ...
[ "logging.getLogger", "itertools.chain", "numpy.log10", "pandas.read_csv", "sklearn.linear_model.Lasso", "math.sqrt", "sys.exit", "math.exp", "numpy.asarray", "numpy.dot", "numpy.linspace", "numpy.linalg.lstsq", "pandas.DataFrame", "random.randint", "numpy.ones", "pandas.merge", "nump...
[((1100, 1133), 'logging.getLogger', 'logging.getLogger', (['"""ai4materials"""'], {}), "('ai4materials')\n", (1117, 1133), False, 'import logging\n'), ((1343, 1389), 'pandas.read_csv', 'pd.read_csv', (['atomic_data_file'], {'index_col': '(False)'}), '(atomic_data_file, index_col=False)\n', (1354, 1389), True, 'import ...
# -*- coding: utf-8 -*- """ Created on Tue Dec 3 20:18:00 2019 @author: wcoll """ import numpy as np import matplotlib.pyplot as plt from co2_forcing_AR6 import co2_forcing_AR6 from ch4_forcing_AR6 import ch4_forcing_AR6 from n2o_forcing_AR6 import n2o_forcing_AR6 # All from table 7.8 co2_erf_AR6 = 2.16 ch4_erf_AR6 ...
[ "numpy.sqrt", "numpy.array", "ch4_forcing_AR6.ch4_forcing_AR6", "matplotlib.pyplot.errorbar", "co2_forcing_AR6.co2_forcing_AR6", "numpy.genfromtxt", "numpy.arange", "n2o_forcing_AR6.n2o_forcing_AR6", "numpy.where", "matplotlib.pyplot.barh", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.yticks...
[((1223, 1323), 'numpy.genfromtxt', 'np.genfromtxt', (['"""attribution_input.csv"""'], {'delimiter': '""","""', 'filling_values': '(0)', 'names': '(True)', 'dtype': 'dtype'}), "('attribution_input.csv', delimiter=',', filling_values=0,\n names=True, dtype=dtype)\n", (1236, 1323), True, 'import numpy as np\n'), ((135...
""" 损失函数 loss 预测值(predict)(y)与已知答案(target)(y_)的差距 均方误差 MSE mean-square error MSE(y, y_) = sigma ((y - y_)^2 / n) loss = tf.reduce_mean(tf.square(y, y_)) 反向传播 BP back propagation 为训练模型参数, 在所有参数上用梯度下降, 使NN模型在训练数据上的损失最小. train_step = tf.train.GradientDescentOptimizer(learning_rate).minimize(loss) train_step = tf.train.M...
[ "tensorflow.random_normal", "tensorflow.placeholder", "tensorflow.Session", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.matmul", "tensorflow.square", "numpy.random.RandomState" ]
[((902, 929), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (923, 929), True, 'import numpy as np\n'), ((1379, 1422), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, 2)'}), '(tf.float32, shape=(None, 2))\n', (1393, 1422), True, 'import tensorflow as tf\n...
''' Infers pseudo log likelihood approximations from ESM models. ''' import argparse from collections import defaultdict import os import pathlib import numpy as np import pandas as pd import torch from esm import Alphabet, FastaBatchedDataset, ProteinBertModel, pretrained, BatchConverter from utils import read_fas...
[ "utils.esm_utils.PLLFastaBatchedDataset.from_file", "torch.nn.CrossEntropyLoss", "torch.cuda.is_available", "torch.sum", "torch.squeeze", "argparse.ArgumentParser", "torch.unsqueeze", "pandas.DataFrame.from_dict", "esm.pretrained.load_model_and_alphabet", "utils.esm_utils.PLLBatchConverter", "ut...
[((412, 455), 'torch.nn.CrossEntropyLoss', 'torch.nn.CrossEntropyLoss', ([], {'reduction': '"""none"""'}), "(reduction='none')\n", (437, 455), False, 'import torch\n'), ((492, 622), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Extract per-token representations and model outputs for seq...
#!/usr/bin/env python3 import re from collections import namedtuple import numpy as np Node = namedtuple('Node', ['name', 'x', 'y', 'size', 'used', 'avail']) nodes = [] node_lookup = {} max_x = -1 max_y = -1 empty = None with open('input.txt', 'r') as f: f.readline() # Shell command f.readline() # Headers ...
[ "numpy.zeros", "collections.namedtuple", "re.compile" ]
[((96, 159), 'collections.namedtuple', 'namedtuple', (['"""Node"""', "['name', 'x', 'y', 'size', 'used', 'avail']"], {}), "('Node', ['name', 'x', 'y', 'size', 'used', 'avail'])\n", (106, 159), False, 'from collections import namedtuple\n'), ((1150, 1193), 'numpy.zeros', 'np.zeros', (['(max_x + 1, max_y + 1)'], {'dtype'...
import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! import matplotlib.pyplot as plt import numpy as np import pandas as pd import numpy.ma as ma import glob from collections import namedtuple, OrderedDict import netCDF4 as nc import os import scipy import scipy.io as sio from ...
[ "matplotlib.pyplot.savefig", "salishsea_tools.geo_tools.find_closest_model_point", "numpy.ma.array", "matplotlib.use", "netCDF4.Dataset", "salishsea_tools.viz_tools.plot_land_mask", "matplotlib.pyplot.close", "salishsea_tools.viz_tools.plot_coastline", "numpy.rint", "matplotlib.pyplot.clabel", "...
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((398, 448), 'sys.path.append', 'sys.path.append', (['"""/ocean/ssahu/CANYONS/wcvi/grid/"""'], {}), "('/ocean/ssahu/CANYONS/wcvi/grid/')\n", (413, 448), False, 'import sys\n'), ((1175, 1248), 'netC...
# -*- coding: utf-8 -*- import pyfits from pylab import * import Marsh import numpy import scipy def getSpectrum(filename,b,Aperture,minimum_column,maximum_column): hdulist = pyfits.open(filename) # Here we obtain the image... data=hdulist[0].data # ... and we obtain the...
[ "pyfits.open", "numpy.arange", "pyfits.getdata" ]
[((837, 913), 'pyfits.getdata', 'pyfits.getdata', (['"""../../../transmission_spectroscopy/WASP6/trace_coeffs.fits"""'], {}), "('../../../transmission_spectroscopy/WASP6/trace_coeffs.fits')\n", (851, 913), False, 'import pyfits\n'), ((178, 199), 'pyfits.open', 'pyfits.open', (['filename'], {}), '(filename)\n', (189, 19...
"""Generate confidence intervals for RNA velocity models by bootstrapping across reads. Our bootstrapping procedure is as follows: 1. Given a spliced count matrix ([Cells, Genes]) S and an unspliced matrix U, create a total counts matrix X = S + U. 2.1 For each cell X_i \in X, fit a multinomial distribution. Sample D...
[ "scvelo.pp.normalize_per_cell", "numpy.copyto", "numpy.prod", "numpy.array", "scvelo.pp.log1p", "anndata.read_h5ad", "numpy.random.RandomState", "numpy.mean", "argparse.ArgumentParser", "numpy.stack", "scvelo.pp.pca", "numpy.frombuffer", "numpy.ceil", "scvelo.pp.moments", "scvelo.tl.velo...
[((27557, 27673), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Compute confidence intervals for RNA velocity by molecular bootstrapping"""'}), "(description=\n 'Compute confidence intervals for RNA velocity by molecular bootstrapping')\n", (27580, 27673), False, 'import argparse\n')...
import getpass import json import pathlib import random import time from typing import List import torch import numpy as np from src.utils.log import create_base_logger, create_logdir from src.utils import measure_runtime, get_git_version from .experiment import Experiment class ExperimentSet: def __init__(self...
[ "torch.manual_seed", "src.utils.get_git_version", "pathlib.Path", "random.seed", "src.utils.log.create_base_logger", "torch.cuda.is_available", "numpy.random.seed", "src.utils.measure_runtime", "getpass.getuser", "src.utils.log.create_logdir", "time.time", "torch.cuda.empty_cache", "json.dum...
[((599, 637), 'src.utils.log.create_logdir', 'create_logdir', (['f"""learning_{self.name}"""'], {}), "(f'learning_{self.name}')\n", (612, 637), False, 'from src.utils.log import create_base_logger, create_logdir\n'), ((693, 713), 'pathlib.Path', 'pathlib.Path', (['"""data"""'], {}), "('data')\n", (705, 713), False, 'im...
import numpy as np with open('data/21.txt') as file: mappings = dict() for line in file.readlines(): parts = tuple(map(lambda p: np.array(list(map(lambda r: [c == '#' for c in r], p.split('/')))), line.strip().split(' => '))) # All possible transformations of our mapp...
[ "numpy.flipud", "numpy.fliplr", "numpy.array", "numpy.empty", "numpy.rot90" ]
[((1733, 1807), 'numpy.array', 'np.array', (['[[False, True, False], [False, False, True], [True, True, True]]'], {}), '([[False, True, False], [False, False, True], [True, True, True]])\n', (1741, 1807), True, 'import numpy as np\n'), ((1357, 1421), 'numpy.empty', 'np.empty', (['(length // oss * nss, length // oss * n...
import numpy as np from numpy import where from pandas import DataFrame from src.support import get_samples, display_cross_tab from src.model import fit_predict, preprocessing_pipeline from src.plots import create_model_plots, plot_smd from src.propensity import create_matched_df, calc_smd class PropensityScorer: ...
[ "src.plots.create_model_plots", "src.plots.plot_smd", "src.propensity.create_matched_df", "src.model.fit_predict", "src.support.display_cross_tab", "numpy.where", "src.support.get_samples", "pandas.DataFrame", "src.model.preprocessing_pipeline", "src.propensity.calc_smd" ]
[((429, 440), 'pandas.DataFrame', 'DataFrame', ([], {}), '()\n', (438, 440), False, 'from pandas import DataFrame\n'), ((468, 479), 'pandas.DataFrame', 'DataFrame', ([], {}), '()\n', (477, 479), False, 'from pandas import DataFrame\n'), ((507, 518), 'pandas.DataFrame', 'DataFrame', ([], {}), '()\n', (516, 518), False, ...
# -*- coding: utf-8 -*- # author: ysoftman # python version : 3.x # desc : pandas test import matplotlib.pyplot as plt import numpy as np import pandas as pd # pandas 에는 Timestamp, DatetimeIndex, Period, PeriodIndex 클래스가 있다. # 타임스탬프 형식들 print(pd.Timestamp('2/15/2019 07:20PM')) print(pd.Timestamp('2019-02-15 07:20PM')...
[ "pandas.Timedelta", "numpy.random.randint", "pandas.DateOffset", "pandas.date_range", "pandas.DataFrame", "pandas.Timestamp", "pandas.Period", "pandas.to_datetime", "matplotlib.pyplot.show" ]
[((1610, 1635), 'pandas.to_datetime', 'pd.to_datetime', (['ts3.index'], {}), '(ts3.index)\n', (1624, 1635), True, 'import pandas as pd\n'), ((2026, 2117), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': "['2019-01-02', '2109-01-02', '2019-01-03']", 'columns': "['sample date']"}), "(data=['2019-01-02', '2109-01-02', '...
import numpy as np import cv2 from PyQt5 import QtGui from PyQt5.QtCore import Qt from GUI.config import Config class Utils: @staticmethod def enhanceMask(mask): des = mask contour, _ = cv2.findContours(des,cv2.RETR_CCOMP,cv2.CHAIN_APPROX_SIMPLE) for cnt in contour: cv2.dra...
[ "cv2.meanStdDev", "cv2.drawContours", "numpy.ones", "cv2.erode", "PyQt5.QtGui.QPixmap.fromImage", "cv2.bitwise_and", "PyQt5.QtGui.QImage", "cv2.contourArea", "numpy.zeros", "cv2.cvtColor", "cv2.findContours", "cv2.dilate", "cv2.GaussianBlur", "numpy.zeros_like" ]
[((211, 273), 'cv2.findContours', 'cv2.findContours', (['des', 'cv2.RETR_CCOMP', 'cv2.CHAIN_APPROX_SIMPLE'], {}), '(des, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)\n', (227, 273), False, 'import cv2\n'), ((596, 619), 'numpy.zeros_like', 'np.zeros_like', (['maskROAD'], {}), '(maskROAD)\n', (609, 619), True, 'import numpy ...
from __future__ import absolute_import, division, print_function from .common import Benchmark import numpy as np class Core(Benchmark): def setup(self): self.l100 = range(100) self.l50 = range(50) self.l = [np.arange(1000), np.arange(1000)] self.l10x10 = np.ones((10, 10)) d...
[ "numpy.identity", "numpy.dstack", "numpy.eye", "numpy.convolve", "numpy.ones", "numpy.hstack", "numpy.diag", "numpy.array", "numpy.zeros", "numpy.linspace", "numpy.empty", "numpy.vstack", "numpy.tril", "numpy.correlate", "numpy.diagflat", "numpy.triu", "numpy.arange", "numpy.ma.mas...
[((296, 313), 'numpy.ones', 'np.ones', (['(10, 10)'], {}), '((10, 10))\n', (303, 313), True, 'import numpy as np\n'), ((351, 362), 'numpy.array', 'np.array', (['(1)'], {}), '(1)\n', (359, 362), True, 'import numpy as np\n'), ((404, 416), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (412, 416), True, 'import numpy...