code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
''' Created on 18.03.2015 @author: <NAME> ''' import pandas as pd from pandas import Series, DataFrame, MultiIndex import matplotlib.pyplot as plt import matplotlib import matplotlib.gridspec as gridspec import numpy as np from matplotlib.patches import Polygon from docutils.languages.af import labels # import Histo...
[ "pandas.DataFrame", "matplotlib.pyplot.subplot", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.axes", "numpy.empty", "matplotlib.pyplot.setp", "matplotlib.patches.Polygon", "matplotlib.pyplot.figure", "matplotlib.pyplot.rcP...
[((777, 804), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['params'], {}), '(params)\n', (796, 804), True, 'import matplotlib.pyplot as plt\n'), ((1252, 1278), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 5)'}), '(figsize=(8, 5))\n', (1262, 1278), True, 'import matplotlib.pyplot as p...
import bz2 import time import array import logging from typing import Dict, Tuple, Optional, Any import numpy from cephlib import sensors_rpc_plugin from cephlib.units import b2ssize from cephlib.wally_storage import WallyDB from . import utils from .test_run_class import TestRun from .result_classes import DataSour...
[ "cephlib.units.b2ssize", "cephlib.sensors_rpc_plugin.__file__.rsplit", "time.time", "bz2.compress", "cephlib.sensors_rpc_plugin.unpack_rpc_updates", "cephlib.wally_storage.WallyDB.pgs_io.format", "array.array", "cephlib.wally_storage.WallyDB.pools_io.format", "numpy.array", "cephlib.wally_storage....
[((510, 536), 'logging.getLogger', 'logging.getLogger', (['"""wally"""'], {}), "('wally')\n", (527, 536), False, 'import logging\n'), ((376, 418), 'cephlib.sensors_rpc_plugin.__file__.rsplit', 'sensors_rpc_plugin.__file__.rsplit', (['"""."""', '(1)'], {}), "('.', 1)\n", (410, 418), False, 'from cephlib import sensors_r...
# -*- coding: utf-8 -*- import numpy as np import pudb from easyAI import TwoPlayersGame, DictTT black_pieces = [[0,3],[0,4],[0,5],[0,6],[0,7],[1,5],[3,0],[3,10],[4,0],[4,10],[5,0], [5,1],[5,9],[5,10],[6,0],[6,10],[7,0],[7,10],[9,5],[10,3],[10,4], [10,5],[10,6],[10,7]] white_pieces = [[...
[ "numpy.dstack", "easyAI.AI_Player", "numpy.ma.masked_where", "pudb.set_trace", "numpy.zeros", "numpy.where", "numpy.array", "easyAI.Negamax", "numpy.ma.notmasked_contiguous" ]
[((641, 659), 'numpy.array', 'np.array', (['[[5, 5]]'], {}), '([[5, 5]])\n', (649, 659), True, 'import numpy as np\n'), ((669, 715), 'numpy.array', 'np.array', (['[[0, 0], [0, 10], [10, 0], [10, 10]]'], {}), '([[0, 0], [0, 10], [10, 0], [10, 10]])\n', (677, 715), True, 'import numpy as np\n'), ((5545, 5561), 'easyAI.Ne...
import matplotlib.pyplot as plt import numpy as np import emcee import corner import random import math import subprocess from astropy.io import ascii import pickle from matplotlib.ticker import MaxNLocator import sys import idlsave from scipy.stats.kde import gaussian_kde import scipy.stats as stats import matplotlib....
[ "numpy.sum", "numpy.log", "mrprior.mr_prior", "numpy.isfinite", "run_model.runmodel", "numpy.log10", "initialise.init" ]
[((1085, 1091), 'initialise.init', 'init', ([], {}), '()\n', (1089, 1091), False, 'from initialise import init\n'), ((2777, 2897), 'run_model.runmodel', 'runmodel', (['theta', 'y', 'tref', 'bstart', 'pflux', 'pfluxe', 'tobs', 'numburstssim', 'ref_ind', 'gti_checking'], {'gti_start': 'st', 'gti_end': 'et'}), '(theta, y,...
import os import six import pytest import numpy as np import pandas as pd import pandas.util.testing as tm import ibis import ibis.expr.operations as ops from ibis.compat import Path, parse_version from ibis.impala.tests.conftest import IbisTestEnv as ImpalaEnv class RoundAwayFromZero(object): def round(self, se...
[ "ibis.parquet.connect", "ibis.mysql.connect", "ibis.hdfs_connect", "ibis.postgres.connect", "ibis.clickhouse.connect", "ibis.impala.tests.conftest.IbisTestEnv", "ibis.csv.connect", "ibis.compat.Path", "pandas.util.testing.assert_frame_equal", "ibis.impala.connect", "ibis.bigquery.connect", "pa...
[((1843, 1882), 'pandas.util.testing.assert_series_equal', 'tm.assert_series_equal', (['*args'], {}), '(*args, **kwargs)\n', (1865, 1882), True, 'import pandas.util.testing as tm\n'), ((2044, 2095), 'pandas.util.testing.assert_frame_equal', 'tm.assert_frame_equal', (['left', 'right', '*args'], {}), '(left, right, *args...
import numpy as np import pandas as pd from geometry import * def collectFaceComponents(facial_points): # Function to collect landmarks points, grouped, as polygons\shapes faceShape = np.concatenate((facial_points[0:17],facial_points[[78,74,79,73,80,71,70,69,76,75,77,0]])) leftEye = np.concatenate((facial...
[ "numpy.average", "numpy.min", "numpy.max", "numpy.array", "numpy.concatenate" ]
[((193, 298), 'numpy.concatenate', 'np.concatenate', (['(facial_points[0:17], facial_points[[78, 74, 79, 73, 80, 71, 70, 69, 76, 75,\n 77, 0]])'], {}), '((facial_points[0:17], facial_points[[78, 74, 79, 73, 80, 71,\n 70, 69, 76, 75, 77, 0]]))\n', (207, 298), True, 'import numpy as np\n'), ((7813, 7837), 'numpy.mi...
""" Test for PyBullet cartpole environment """ import time import tigercontrol import numpy as np import jax.random as random from tigercontrol.utils import generate_key import pybullet as pybullet import os.path from os import path from pathlib import Path # Compute control input def compute_control(y, K): # ...
[ "pybullet.getQuaternionFromEuler", "numpy.random.seed", "numpy.flip", "numpy.abs", "numpy.ceil", "numpy.zeros", "pybullet.resetDebugVisualizerCamera", "time.sleep", "pybullet.removeBody", "numpy.tan", "numpy.mean", "numpy.array", "numpy.linspace", "numpy.matmul", "tigercontrol.environmen...
[((451, 472), 'numpy.matmul', 'np.matmul', (['(1.0 / y)', 'K'], {}), '(1.0 / y, K)\n', (460, 472), True, 'import numpy as np\n'), ((2760, 2780), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (2774, 2780), True, 'import numpy as np\n'), ((2878, 2900), 'numpy.zeros', 'np.zeros', (['(numEnvs, L)'], {}...
import os from os.path import exists as pexists from os.path import join as pjoin import numpy as np import torch from pytorch_lightning.callbacks import ModelCheckpoint from .base import EpochBaseLightningModel from .. import models from ..data.imagenet_datasets import MyConcatDataset from ..data.imagenet_datasets i...
[ "numpy.load", "os.path.basename", "os.path.exists", "os.system", "os.path.join", "torch.optim.lr_scheduler.MultiStepLR" ]
[((8344, 8402), 'os.path.join', 'pjoin', (['self.hparams.logdir', 'self.hparams.name', '"""last.ckpt"""'], {}), "(self.hparams.logdir, self.hparams.name, 'last.ckpt')\n", (8349, 8402), True, 'from os.path import join as pjoin\n'), ((8414, 8432), 'os.path.exists', 'pexists', (['last_ckpt'], {}), '(last_ckpt)\n', (8421, ...
import numpy as np import matplotlib.pyplot as plt import tensorflow.compat.v1 as tf tf.disable_v2_behavior() class SVR(object): def __init__(self, epsilon=0.5): self.epsilon = epsilon def fit(self, X, y, epochs=100, learning_rate=0.1): self.sess = tf.Session() feature_len = X.sha...
[ "matplotlib.pyplot.show", "tensorflow.compat.v1.placeholder", "matplotlib.pyplot.legend", "tensorflow.compat.v1.train.GradientDescentOptimizer", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.abs", "tensorflow.compat.v1.random_normal", "numpy.linspace", "tenso...
[((85, 109), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (107, 109), True, 'import tensorflow.compat.v1 as tf\n'), ((1748, 1784), 'numpy.linspace', 'np.linspace', ([], {'start': '(0)', 'stop': '(5)', 'num': '(20)'}), '(start=0, stop=5, num=20)\n', (1759, 1784), True, 'import ...
import numpy from .agent_base import AgentBase class RandomAgent(AgentBase): def reset_target(self): boundary = self.world.get_boundary() self.target = numpy.array([ numpy.random.uniform(boundary[0][0], boundary[0][1]), numpy.random.uniform(boundary[1][0], boundary[1][1])...
[ "numpy.random.uniform" ]
[((202, 254), 'numpy.random.uniform', 'numpy.random.uniform', (['boundary[0][0]', 'boundary[0][1]'], {}), '(boundary[0][0], boundary[0][1])\n', (222, 254), False, 'import numpy\n'), ((268, 320), 'numpy.random.uniform', 'numpy.random.uniform', (['boundary[1][0]', 'boundary[1][1]'], {}), '(boundary[1][0], boundary[1][1])...
from numpy.core.numeric import roll from libs.effects.cube_effect import CubeEffect import numpy as np import random import time class CubeEffectA(CubeEffect): def run(self): effect_config = self.get_effect_config("effect_power") led_count = self._device.device_config["led_count"] n_fft_b...
[ "numpy.max", "numpy.zeros" ]
[((569, 578), 'numpy.max', 'np.max', (['y'], {}), '(y)\n', (575, 578), True, 'import numpy as np\n'), ((802, 844), 'numpy.zeros', 'np.zeros', (['(3, self.kx * self.ky * self.kz)'], {}), '((3, self.kx * self.ky * self.kz))\n', (810, 844), True, 'import numpy as np\n')]
""" Plot results of a particle tracking experiment, specific to experiments about vertical mixing of particles. e.g. from: python tracker.py -exp vmix -3d True -clb True -no_advection True """ # setup import os, sys sys.path.append(os.path.abspath('../alpha')) import Lfun sys.path.append(os.path.abspath('../plotting'...
[ "netCDF4.Dataset", "os.path.abspath", "matplotlib.pyplot.show", "Lfun.modtime_to_datetime", "os.path.isdir", "numpy.ones", "matplotlib.pyplot.rcdefaults", "matplotlib.pyplot.figure", "numpy.random.random", "numpy.histogram", "matplotlib.pyplot.rc", "Lfun.Lstart", "numpy.linspace", "os.list...
[((439, 452), 'Lfun.Lstart', 'Lfun.Lstart', ([], {}), '()\n', (450, 452), False, 'import Lfun\n'), ((1666, 1699), 'netCDF4.Dataset', 'nc4.Dataset', (['(indir0 + indir + rel)'], {}), '(indir0 + indir + rel)\n', (1677, 1699), True, 'import netCDF4 as nc4\n'), ((2511, 2534), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""...
from Cython.Build import cythonize import os from os.path import join as pjoin import numpy as np from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext def find_in_path(name, path): for dir in path.split(os.pathsep): binpath = pjoin(dir, name) ...
[ "os.path.abspath", "distutils.core.setup", "numpy.get_numpy_include", "os.path.exists", "distutils.extension.Extension", "numpy.get_include", "Cython.Distutils.build_ext.build_extensions", "os.path.join" ]
[((1768, 1840), 'distutils.core.setup', 'setup', ([], {'ext_modules': 'ext_modules', 'cmdclass': "{'build_ext': custom_build_ext}"}), "(ext_modules=ext_modules, cmdclass={'build_ext': custom_build_ext})\n", (1773, 1840), False, 'from distutils.core import setup\n'), ((439, 455), 'numpy.get_include', 'np.get_include', (...
import numpy as np class Sudoku: def __init__(self,main,size): self.cell=np.zeros([size,size]) for i in main: self.cell[i[0]-1,i[1]-1]=main[i] def p(self,guess=False): print(self.cell) def solve(self,i,j): if self.cell[i-1,j-1]!=0: return ...
[ "numpy.append", "numpy.zeros" ]
[((86, 108), 'numpy.zeros', 'np.zeros', (['[size, size]'], {}), '([size, size])\n', (94, 108), True, 'import numpy as np\n'), ((410, 461), 'numpy.append', 'np.append', (['self.cell[i - 1, :]', 'self.cell[:, j - 1]'], {}), '(self.cell[i - 1, :], self.cell[:, j - 1])\n', (419, 461), True, 'import numpy as np\n')]
import io, sys import numpy as np from heapq import * def load_vectors(filename): fin = io.open(filename, 'r', encoding='utf-8', newline='\n') n, d = map(int, fin.readline().split()) data = {} for line in fin: tokens = line.rstrip().split(' ') data[tokens[0]] = np.asarray(list(map(float...
[ "numpy.linalg.norm", "io.open" ]
[((93, 147), 'io.open', 'io.open', (['filename', '"""r"""'], {'encoding': '"""utf-8"""', 'newline': '"""\n"""'}), "(filename, 'r', encoding='utf-8', newline='\\n')\n", (100, 147), False, 'import io, sys\n'), ((1871, 1902), 'numpy.linalg.norm', 'np.linalg.norm', (['word_vectors[a]'], {}), '(word_vectors[a])\n', (1885, 1...
# Copyright 2018 SAS Project Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
[ "reference_models.geo.drive.terrain_driver.GetTerrainElevation", "numpy.array", "collections.namedtuple" ]
[((1181, 1296), 'collections.namedtuple', 'namedtuple', (['"""ProtectionConstraint"""', "['latitude', 'longitude', 'low_frequency', 'high_frequency', 'entity_type']"], {}), "('ProtectionConstraint', ['latitude', 'longitude',\n 'low_frequency', 'high_frequency', 'entity_type'])\n", (1191, 1296), False, 'from collecti...
__author__ = 'HarperMain' from scipy.stats import norm import numpy as np # class EuropeanLookbackGreeks(): # # def __init__(self, spot, strike, rate, dividend, sigma, expiry, t): # # self.spot = spot # self.strike = strike # self.rate = rate # self.dividend = dividend # se...
[ "scipy.stats.norm.cdf", "numpy.log", "numpy.exp", "numpy.sqrt" ]
[((909, 921), 'scipy.stats.norm.cdf', 'norm.cdf', (['d1'], {}), '(d1)\n', (917, 921), False, 'from scipy.stats import norm\n'), ((1458, 1470), 'scipy.stats.norm.cdf', 'norm.cdf', (['d2'], {}), '(d2)\n', (1466, 1470), False, 'from scipy.stats import norm\n'), ((1584, 1596), 'scipy.stats.norm.cdf', 'norm.cdf', (['d1'], {...
import os import pandas as pd import numpy as np import itertools import pickle class PickleStore(object): """Storage object to read and write very large dataset as pickle file""" def __init__(self, fname): self.fname = fname def write(self, dataset, chunksize=500): """Write data...
[ "numpy.load", "pickle.dump", "numpy.save", "numpy.lib.format.read_magic", "itertools.count", "pickle.load", "pandas.DataFrame.from_records", "numpy.lib.format._read_array_header" ]
[((461, 496), 'itertools.count', 'itertools.count', ([], {'start': '(0)', 'step': 'step'}), '(start=0, step=step)\n', (476, 496), False, 'import itertools\n'), ((2346, 2381), 'itertools.count', 'itertools.count', ([], {'start': '(0)', 'step': 'step'}), '(start=0, step=step)\n', (2361, 2381), False, 'import itertools\n'...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys # NOQA isort:skip sys.path.insert(0, 'datasets') # NOQA isort:skip import argparse import glob import json import os import zipfile from PIL import Image import chainer from chainer import serializers from chainercv import evaluations import matplotlib.pyplo...
[ "argparse.ArgumentParser", "matplotlib.pyplot.clf", "json.dumps", "zipped_cityscapes_road_dataset.ZippedCityscapesRoadDataset", "chainercv.evaluations.calc_semantic_segmentation_iou", "os.path.join", "chainer.serializers.load_npz", "matplotlib.pyplot.close", "os.path.exists", "matplotlib.pyplot.su...
[((77, 107), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""datasets"""'], {}), "(0, 'datasets')\n", (92, 107), False, 'import sys\n'), ((1327, 1402), 'chainer.serializers.load_npz', 'serializers.load_npz', (['snapshot', 'model'], {'path': '"""updater/model:main/predictor/"""'}), "(snapshot, model, path='updater/mo...
# -*- coding: utf-8 -*- """ Created on Wed Mar 25 18:01:21 2020 @author: Connor Preprocessing the Atari environment to fit our model, following the findings found in the paper """ #Importing Libraries import numpy as np import collections import cv2 import gym # Repeats action and takes max of last 2 frames class Re...
[ "numpy.zeros_like", "numpy.maximum", "gym.make", "cv2.cvtColor", "collections.deque", "numpy.random.randint", "numpy.array", "gym.spaces.Box", "cv2.resize" ]
[((3803, 3821), 'gym.make', 'gym.make', (['env_name'], {}), '(env_name)\n', (3811, 3821), False, 'import gym\n'), ((620, 650), 'numpy.zeros_like', 'np.zeros_like', (['(2, self.shape)'], {}), '((2, self.shape))\n', (633, 650), True, 'import numpy as np\n'), ((1210, 1264), 'numpy.maximum', 'np.maximum', (['self.frame_buf...
import sys import numpy as np from ares.util import ParameterBundle from scipy.interpolate import interp1d from ares.populations import GalaxyPopulation try: import h5py except ImportError: pass try: import genmassfct as gmf from classy import Class except ImportError: sys.exit() # Grab a vanill...
[ "genmassfct.dndlnm", "numpy.zeros_like", "h5py.File", "numpy.abs", "numpy.logspace", "genmassfct.par", "ares.util.ParameterBundle", "numpy.isfinite", "ares.populations.GalaxyPopulation", "numpy.array", "classy.Class", "numpy.log10", "sys.exit" ]
[((368, 386), 'ares.populations.GalaxyPopulation', 'GalaxyPopulation', ([], {}), '()\n', (384, 386), False, 'from ares.populations import GalaxyPopulation\n'), ((2070, 2077), 'classy.Class', 'Class', ([], {}), '()\n', (2075, 2077), False, 'from classy import Class\n'), ((2149, 2174), 'numpy.logspace', 'np.logspace', ([...
import numpy as np from matplotlib import pyplot as plt from sklearn.cluster import KMeans, MiniBatchKMeans from sklearn.preprocessing import RobustScaler, MinMaxScaler from sklearn.model_selection import train_test_split from tqdm import tqdm from . import ( info_message, warning_message, debug_message )...
[ "matplotlib.pyplot.show", "sklearn.preprocessing.RobustScaler", "sklearn.cluster.KMeans", "numpy.zeros", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplots" ]
[((1098, 1141), 'sklearn.preprocessing.RobustScaler', 'RobustScaler', ([], {'quantile_range': 'quantile_range'}), '(quantile_range=quantile_range)\n', (1110, 1141), False, 'from sklearn.preprocessing import RobustScaler, MinMaxScaler\n'), ((1259, 1391), 'sklearn.cluster.KMeans', 'KMeans', ([], {'n_clusters': 'n_cluster...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from wordcloud import WordCloud, STOPWORDS from fpdf import FPDF import sys import io def main(): df = pd.read_csv('reviews.csv') products = list(df.Item.value_counts().keys()) def cloudmaker(df,product): comment_words = '' ...
[ "matplotlib.pyplot.title", "pandas.read_csv", "fpdf.FPDF", "matplotlib.pyplot.imshow", "matplotlib.pyplot.bar", "wordcloud.WordCloud", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "numpy.mean", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.tight_layout", ...
[((181, 207), 'pandas.read_csv', 'pd.read_csv', (['"""reviews.csv"""'], {}), "('reviews.csv')\n", (192, 207), True, 'import pandas as pd\n'), ((1611, 1617), 'fpdf.FPDF', 'FPDF', ([], {}), '()\n', (1615, 1617), False, 'from fpdf import FPDF\n'), ((862, 906), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(1...
# Copyright (c) 2020, MeteoSwiss # Authors: <NAME> <<EMAIL>> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the...
[ "opendap_protocol.Attribute", "logging.debug", "logging.basicConfig", "flask.Flask", "opendap_protocol.Dataset", "numpy.array", "urllib.parse.urlsplit" ]
[((1659, 1699), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (1678, 1699), False, 'import logging\n'), ((1826, 1841), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1831, 1841), False, 'from flask import Flask, Response, jsonify, request\n'), (...
#!/usr/bin/env python from __future__ import print_function import numpy as np import pynbody as pn from tqdm import tqdm import h5py from . import constants as c def weight(snapshot, qty, weight_type="volume"): """ Weights the quantity 'qty' in the simulation. Parameters ---------- snapshot :...
[ "tqdm.tqdm", "h5py.File", "numpy.sum", "pynbody.load", "numpy.array" ]
[((2332, 2377), 'tqdm.tqdm', 'tqdm', (['snaplist'], {'desc': 'ion', 'disable': '(not verbose)'}), '(snaplist, desc=ion, disable=not verbose)\n', (2336, 2377), False, 'from tqdm import tqdm\n'), ((2761, 2780), 'h5py.File', 'h5py.File', (['ray', '"""r"""'], {}), "(ray, 'r')\n", (2770, 2780), False, 'import h5py\n'), ((30...
"""Test nimare.dataset (Dataset IO/transformations).""" import copy import json import os.path as op import warnings import nibabel as nib import numpy as np import pytest import nimare from nimare import dataset from nimare.tests.utils import get_test_data_path def test_dataset_smoke(): """Smoke test for nimar...
[ "nibabel.Nifti1Image", "copy.deepcopy", "json.load", "numpy.abs", "warnings.simplefilter", "nimare.tests.utils.get_test_data_path", "nibabel.is_proxy", "pytest.warns", "numpy.random.randn", "numpy.zeros", "pytest.raises", "warnings.catch_warnings", "numpy.array", "nimare.dataset.Dataset" ]
[((452, 476), 'nimare.dataset.Dataset', 'dataset.Dataset', (['db_file'], {}), '(db_file)\n', (467, 476), False, 'from nimare import dataset\n'), ((1386, 1427), 'numpy.zeros', 'np.zeros', (['dset.masker.mask_img.shape', 'int'], {}), '(dset.masker.mask_img.shape, int)\n', (1394, 1427), True, 'import numpy as np\n'), ((14...
############################TESTS ON POTENTIALS################################ from __future__ import print_function, division import os import sys PY3= sys.version > '3' import pytest import numpy from scipy import optimize try: import pynbody _PYNBODY_LOADED= True except ImportError: _PYNBODY_LOADED= Fal...
[ "galpy.util.conversion.dens_in_meanmatterdens", "numpy.ones", "numpy.argmin", "galpy.potential.TriaxialGaussianPotential", "galpy.potential.TransientLogSpiralPotential.__init__", "galpy.util.conversion.force_in_2piGmsolpc2", "numpy.exp", "numpy.diag", "galpy.potential.epifreq", "galpy.potential.pl...
[((395, 414), 'os.getenv', 'os.getenv', (['"""TRAVIS"""'], {}), "('TRAVIS')\n", (404, 414), False, 'import os\n'), ((3137, 3185), 'galpy.potential.SphericalShellPotential', 'potential.SphericalShellPotential', ([], {'normalize': '(1.0)'}), '(normalize=1.0)\n', (3170, 3185), False, 'from galpy import potential\n'), ((33...
""" Orbit discipline for CADRE """ from math import sqrt from six.moves import range import numpy as np from openmdao.api import ExplicitComponent from CADRE import rk4 # Constants mu = 398600.44 Re = 6378.137 J2 = 1.08264e-3 J3 = -2.51e-6 J4 = -1.60e-6 C1 = -mu C2 = -1.5*mu*J2*Re**2 C3 = -2.5*mu*J3*Re**3 C4 = 1....
[ "numpy.outer", "numpy.eye", "math.sqrt", "six.moves.range", "numpy.zeros", "numpy.identity", "numpy.ones", "numpy.sin", "numpy.array", "numpy.cos", "numpy.dot", "numpy.sqrt" ]
[((1217, 1233), 'numpy.zeros', 'np.zeros', (['(6, 1)'], {}), '((6, 1))\n', (1225, 1233), True, 'import numpy as np\n'), ((1439, 1463), 'math.sqrt', 'sqrt', (['(x * x + y * y + z2)'], {}), '(x * x + y * y + z2)\n', (1443, 1463), False, 'from math import sqrt\n'), ((1721, 1735), 'numpy.zeros', 'np.zeros', (['(6,)'], {}),...
import logging import numpy as np import tensorflow as tf from debias.datasets.training_data_loader import PREMISE_KEY from debias.utils import py_utils, configured, ops def build_epoch_fn(lst, sample=None, shuffle=False): """Build a function to return `lst` after sampling/shuffling""" if sample: def get():...
[ "debias.utils.py_utils.split", "tensorflow.shape", "numpy.random.shuffle" ]
[((1156, 1185), 'debias.utils.py_utils.split', 'py_utils.split', (['lst', 'n_groups'], {}), '(lst, n_groups)\n', (1170, 1185), False, 'from debias.utils import py_utils, configured, ops\n'), ((1322, 1346), 'numpy.random.shuffle', 'np.random.shuffle', (['group'], {}), '(group)\n', (1339, 1346), True, 'import numpy as np...
import os import sys import argparse import numpy as np import matplotlib.pyplot as plt from pathlib import Path import json from itertools import cycle import seaborn as sns import matplotlib.gridspec as gridspec import copy #USAGE: python .\DL_Layer_Analysis\plot_DL_json_results.py --main_dir RFWFC\results\mnist def...
[ "matplotlib.pyplot.subplot", "json.load", "matplotlib.pyplot.show", "argparse.ArgumentParser", "copy.copy", "pathlib.Path", "numpy.array", "seaborn.color_palette", "itertools.cycle", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.subplots" ]
[((343, 407), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Network Smoothness Script"""'}), "(description='Network Smoothness Script')\n", (366, 407), False, 'import argparse\n'), ((1953, 1984), 'seaborn.color_palette', 'sns.color_palette', (['"""pastel"""', '(20)'], {}), "('pastel', 2...
import os import re import numpy as np from keras import Input, Model from keras.layers import Embedding from keras_preprocessing.sequence import pad_sequences from keras_preprocessing.text import Tokenizer import tensorflow as tf from autokeras.constant import Constant from autokeras.utils import download_file_with_...
[ "GPUtil.getFirstAvailable", "keras.Input", "keras_preprocessing.sequence.pad_sequences", "autokeras.utils.download_file_with_extract", "keras.Model", "numpy.asarray", "tensorflow.device", "tensorflow.Session", "numpy.expand_dims", "keras.backend.set_session", "tensorflow.ConfigProto", "os.path...
[((545, 635), 'autokeras.utils.download_file_with_extract', 'download_file_with_extract', (['file_link'], {'file_path': 'file_path', 'extract_path': 'extract_path'}), '(file_link, file_path=file_path, extract_path=\n extract_path)\n', (571, 635), False, 'from autokeras.utils import download_file_with_extract\n'), ((...
# -*- coding: utf-8 -*- """ Created on Thu Oct 10 13:02:00 2019 @author: jaehooncha @email: <EMAIL> """ import tensorflow as tf import numpy as np def cycle_fn(iteration, base_lr, max_lr, stepsize): cycle = np.floor(1+iteration/(2*stepsize)) x = np.abs(iteration/stepsize - 2*cycle +1) lr = base_lr + (max...
[ "numpy.abs", "numpy.maximum", "numpy.floor", "numpy.float32", "tensorflow.contrib.layers.batch_norm", "numpy.array", "numpy.int" ]
[((214, 254), 'numpy.floor', 'np.floor', (['(1 + iteration / (2 * stepsize))'], {}), '(1 + iteration / (2 * stepsize))\n', (222, 254), True, 'import numpy as np\n'), ((257, 301), 'numpy.abs', 'np.abs', (['(iteration / stepsize - 2 * cycle + 1)'], {}), '(iteration / stepsize - 2 * cycle + 1)\n', (263, 301), True, 'impor...
import argparse import logging import sys import time import math from torchvision import datasets, transforms import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data as data from torch.utils.data import Dataset from torch.autograd import Variable from sklearn.metri...
[ "numpy.load", "numpy.random.seed", "argparse.ArgumentParser", "torch.utils.data.DataLoader", "torch.where", "torch.utils.data.cuda", "torch.manual_seed", "logging.StreamHandler", "torch.cuda.manual_seed", "torch.cat", "logging.getLogger", "torch.nn.functional.softmax", "torch.softmax", "PI...
[((542, 567), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (565, 567), False, 'import argparse\n'), ((5173, 5250), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['testset'], {'batch_size': '(128)', 'shuffle': '(False)'}), '(testset, batch_size=128, shuffle=False, **kwargs)\n'...
import os import numpy as np from tf_lite.tf_lite import TFLiteModel from tf_lite.ring_buffer import RingBuffer class Filter: def __init__( self, pre_emphasis: float = 0.0, sample_rate: int = 16000, fft_window_type: str = "hann", fft_hop_length: int = 10, model_dir...
[ "numpy.fft.rfft", "numpy.abs", "os.path.join", "numpy.expand_dims", "numpy.append", "numpy.hanning", "tf_lite.ring_buffer.RingBuffer" ]
[((965, 994), 'numpy.hanning', 'np.hanning', (['self._window_size'], {}), '(self._window_size)\n', (975, 994), True, 'import numpy as np\n'), ((1072, 1109), 'tf_lite.ring_buffer.RingBuffer', 'RingBuffer', ([], {'shape': '[self._window_size]'}), '(shape=[self._window_size])\n', (1082, 1109), False, 'from tf_lite.ring_bu...
# -*- coding: utf-8 -*- ''' Created on 27 jun. 2020 @author: reinaqu_2 ''' from matplotlib import pyplot as plt import geopandas as gpd import dataframes import numpy as np import pandas as pd from mpl_toolkits.axes_grid1.inset_locator import inset_axes import venn from typing import List import math from plotnine im...
[ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplots", "venn.venn3", "matplotlib.pyplot.figure", "mpl_toolkits.axes_grid1.inset_locator.inset_axes", "venn.venn4", "numpy.linspace", "matplotlib.pyplot.gca", ...
[((1016, 1033), 'matplotlib.pyplot.axis', 'plt.axis', (['"""equal"""'], {}), "('equal')\n", (1024, 1033), True, 'from matplotlib import pyplot as plt\n'), ((1205, 1214), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (1212, 1214), True, 'from matplotlib import pyplot as plt\n'), ((1751, 1761), 'matplotlib.pyplot...
import numpy as np def write_keypoints(path, keypoints): # path: path to save # keypoints: single-precision real matrix, N*4, x,y,scale, orientation assert keypoints.shape[1]==4 write_matrix(path, keypoints, np.float32) def write_descriptors(path, descriptors): write_matrix(path, descriptors, np.float32) def wr...
[ "numpy.fromfile", "numpy.asarray" ]
[((692, 733), 'numpy.fromfile', 'np.fromfile', (['fid'], {'count': '(2)', 'dtype': 'np.int32'}), '(fid, count=2, dtype=np.int32)\n', (703, 733), True, 'import numpy as np\n'), ((751, 807), 'numpy.fromfile', 'np.fromfile', (['fid'], {'count': '(shape[0] * shape[1])', 'dtype': 'dtype'}), '(fid, count=shape[0] * shape[1],...
import argparse import io import os import h5py import networkx as nx import numpy as np import torch from networkx.algorithms.dag import dag_longest_path from scipy.spatial.distance import cdist from torch.utils.data import DataLoader from tqdm import tqdm from data import FeatureDataset from model import (GRUModule...
[ "argparse.ArgumentParser", "numpy.ones", "numpy.argsort", "data.CC_WEB_VIDEO", "numpy.arange", "data.VCDB", "model.VideoComparator", "torch.load", "data.EVVE", "numpy.max", "torch.Tensor", "scipy.spatial.distance.cdist", "h5py.File", "tqdm.tqdm", "torch.einsum", "torch.cuda.is_availabl...
[((1933, 1983), 'torch.einsum', 'torch.einsum', (['"""ik,jk->ij"""', '[query, target_feature]'], {}), "('ik,jk->ij', [query, target_feature])\n", (1945, 1983), False, 'import torch\n'), ((2263, 2279), 'numpy.zeros', 'np.zeros', (['(n, m)'], {}), '((n, m))\n', (2271, 2279), True, 'import numpy as np\n'), ((3353, 3379), ...
from math import * import os import numpy as np def point_grapher( x_vals:list, y_vals:list, x_range:tuple=None, y_range:tuple=None,): if x_range==None: x_range=(min(x_vals), max(x_vals)) if y_range==None: y_range=(min(y_vals), max(y_val...
[ "os.get_terminal_size", "numpy.sin", "numpy.cos" ]
[((343, 365), 'os.get_terminal_size', 'os.get_terminal_size', ([], {}), '()\n', (363, 365), False, 'import os\n'), ((1570, 1579), 'numpy.sin', 'np.sin', (['t'], {}), '(t)\n', (1576, 1579), True, 'import numpy as np\n'), ((1588, 1597), 'numpy.cos', 'np.cos', (['t'], {}), '(t)\n', (1594, 1597), True, 'import numpy as np\...
# Copyright 2019 <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...
[ "sciope.utilities.epsilonselectors.RelativeEpsilonSelector", "sciope.utilities.distancefunctions.euclidean.EuclideanDistance", "sciope.utilities.housekeeping.sciope_logger.SciopeLogger", "numpy.sum", "numpy.asarray", "numpy.ones", "sciope.inference.abc_inference.ABC", "numpy.random.choice", "sciope....
[((2263, 2332), 'numpy.random.choice', 'np.random.choice', (['self.samples.shape[0]', 'm'], {'p': 'self.normalized_weights'}), '(self.samples.shape[0], m, p=self.normalized_weights)\n', (2279, 2332), True, 'import numpy as np\n'), ((2696, 2709), 'numpy.asarray', 'np.asarray', (['s'], {}), '(s)\n', (2706, 2709), True, '...
import pandas as pd import gensim from gensim.utils import simple_preprocess from gensim.parsing.preprocessing import STOPWORDS from nltk.stem import WordNetLemmatizer, SnowballStemmer from nltk.stem.porter import * import numpy as np import nltk def lemmatize_stemming(text): return stemmer.stem(WordNetLemmatizer(...
[ "pandas.DataFrame", "numpy.random.seed", "nltk.stem.WordNetLemmatizer", "pandas.read_csv", "nltk.stem.SnowballStemmer", "gensim.corpora.Dictionary", "gensim.utils.simple_preprocess", "nltk.download" ]
[((404, 440), 'gensim.utils.simple_preprocess', 'gensim.utils.simple_preprocess', (['text'], {}), '(text)\n', (434, 440), False, 'import gensim\n'), ((634, 711), 'pandas.read_csv', 'pd.read_csv', (['"""segmentaion_result.csv"""'], {'error_bad_lines': '(False)', 'encoding': '"""utf8"""'}), "('segmentaion_result.csv', er...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 11 22:13:10 2018 @author: tatvam """ import matplotlib.pyplot as plt import pandas as pd import numpy as np # import the dataset dataset = pd.read_csv("50_Startups.csv") X = dataset.iloc[:, :-1].values Y = dataset.iloc[:, 4].values # Encodin...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.OneHotEncoder", "numpy.ones", "sklearn.preprocessing.LabelEncoder", "sklearn.linear_model.LinearRegression", "statsmodels.formula.api.OLS", "numpy.delete" ]
[((217, 247), 'pandas.read_csv', 'pd.read_csv', (['"""50_Startups.csv"""'], {}), "('50_Startups.csv')\n", (228, 247), True, 'import pandas as pd\n'), ((419, 433), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (431, 433), False, 'from sklearn.preprocessing import LabelEncoder, OneHotEncoder\n')...
''' Author: <NAME> Youtube Channel: https://www.youtube.com/c/aiphile ''' import cv2 as cv import numpy as np # colors # values =(blue, green, red) opencv accepts BGR values not RGB BLACK = (0,0,0) WHITE = (255,255,255) BLUE = (255,0,0) RED = (0,0,255) CYAN = (255,255,0) YELLOW =(0,255,255) MAGENTA = (255,0,255)...
[ "cv2.putText", "cv2.cvtColor", "cv2.imwrite", "cv2.waitKey", "cv2.getTextSize", "cv2.blur", "cv2.addWeighted", "cv2.fillPoly", "cv2.VideoCapture", "numpy.array", "cv2.rectangle", "cv2.imshow" ]
[((1801, 1853), 'cv2.getTextSize', 'cv.getTextSize', (['text', 'font', 'fontScale', 'textThickness'], {}), '(text, font, fontScale, textThickness)\n', (1815, 1853), True, 'import cv2 as cv\n'), ((1945, 2043), 'cv2.rectangle', 'cv.rectangle', (['overlay', '(x - pad_x, y + pad_y)', '(x + t_w + pad_x, y - t_h - pad_y)', '...
from heritageconnector.disambiguation import retrieve, pipelines from heritageconnector.namespace import OWL, SKOS import numpy as np from rdflib import URIRef, Literal import pytest def test_disambiguator_process_wbgetentities_results(): qids = ["Q2897681", "Q75931117", "Q6198902", "Q3805088"] pids = ["P735"...
[ "numpy.isin", "rdflib.Literal", "heritageconnector.disambiguation.pipelines.Disambiguator", "rdflib.URIRef", "heritageconnector.disambiguation.retrieve.get_wikidata_fields" ]
[((377, 421), 'heritageconnector.disambiguation.pipelines.Disambiguator', 'pipelines.Disambiguator', ([], {'table_name': '"""PERSON"""'}), "(table_name='PERSON')\n", (400, 421), False, 'from heritageconnector.disambiguation import retrieve, pipelines\n'), ((445, 485), 'heritageconnector.disambiguation.retrieve.get_wiki...
# # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "os.remove", "tensorflow.strings.to_number", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Dense", "tensorflow.identity", "zoo.init_nncontext", "numpy.allclose", "tensorflow.keras.optimizers.SGD", "numpy.random.randint", "horovod.tensorflow.keras.callbacks.LearningRateWarmupCall...
[((1081, 1101), 'numpy.random.rand', 'np.random.rand', (['size'], {}), '(size)\n', (1095, 1101), True, 'import numpy as np\n'), ((1348, 1402), 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['(x_train, y_train)'], {}), '((x_train, y_train))\n', (1382, 1402), True, 'import tensorflo...
# Author: <NAME> # Vision for Robotics Group, Automation and Control Institute (ACIN) # TU Wien, Vienna import numpy as np import os basepath = os.path.dirname(os.path.abspath(__file__)) import sys sys.path.append(os.path.join(basepath, "cpp", "build")) import icp def refine(pose, cloud_observed, cloud_model, p_dist...
[ "icp.icp", "numpy.dot", "os.path.abspath", "os.path.join" ]
[((161, 186), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (176, 186), False, 'import os\n'), ((215, 253), 'os.path.join', 'os.path.join', (['basepath', '"""cpp"""', '"""build"""'], {}), "(basepath, 'cpp', 'build')\n", (227, 253), False, 'import os\n'), ((547, 611), 'icp.icp', 'icp.icp', ([...
import numpy as np from PIL import Image as im print() Mmax = -5000 Mmin = 0 F = open("KAU_Height.txt", 'r') F = F.readlines() xlen = int(F[-1].split(",")[0]) + 1 ylen = int(F[-1].split(",")[1].split(":")[0]) + 1 arr = np.zeros((ylen, xlen)) # print(arr.shape) for line in range(len(F)): s = F[line].sp...
[ "PIL.Image.fromarray", "numpy.zeros" ]
[((226, 248), 'numpy.zeros', 'np.zeros', (['(ylen, xlen)'], {}), '((ylen, xlen))\n', (234, 248), True, 'import numpy as np\n'), ((717, 736), 'PIL.Image.fromarray', 'im.fromarray', (['m_arr'], {}), '(m_arr)\n', (729, 736), True, 'from PIL import Image as im\n')]
""" Tets the :mod:`fatf.utils.data.occlusion` module. """ # Author: <NAME> <<EMAIL>> # License: new BSD import pytest import numpy as np from fatf.exceptions import IncorrectShapeError import fatf try: import fatf.utils.data.segmentation except ImportError: # pragma: no cover pytest.skip( 'Skippin...
[ "pytest.warns", "fatf.setup_random_seed", "pytest.skip", "numpy.ones", "numpy.zeros", "pytest.raises", "numpy.array", "numpy.array_equal", "fatf.utils.data.occlusion.Occlusion" ]
[((537, 569), 'numpy.ones', 'np.ones', ([], {'shape': '(2, 2)', 'dtype': 'int'}), '(shape=(2, 2), dtype=int)\n', (544, 569), True, 'import numpy as np\n'), ((581, 613), 'numpy.ones', 'np.ones', ([], {'shape': '(2, 2)', 'dtype': 'int'}), '(shape=(2, 2), dtype=int)\n', (588, 613), True, 'import numpy as np\n'), ((653, 67...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import _init_paths import os import cv2 import time import xlwt import numpy as np import math import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from cv2 import * ...
[ "opts.opts", "xlwt.Workbook", "math.sqrt", "time.sleep", "math.acos", "numpy.array", "math.degrees" ]
[((410, 441), 'xlwt.Workbook', 'xlwt.Workbook', ([], {'encoding': '"""utf-8"""'}), "(encoding='utf-8')\n", (423, 441), False, 'import xlwt\n'), ((702, 744), 'math.sqrt', 'math.sqrt', (['((x2 - x3) ** 2 + (y2 - y3) ** 2)'], {}), '((x2 - x3) ** 2 + (y2 - y3) ** 2)\n', (711, 744), False, 'import math\n'), ((741, 783), 'ma...
import numpy as np from nanograd.nn.conv_ops import get_conv1d_output_size, get_conv2d_output_size from nanograd.autograd import Function # ************************************* # ************** Helpers ************** # ************************************* def sigmoid(x:np.ndarray) -> np.ndarray: return 1 / (1 +...
[ "numpy.pad", "nanograd.nn.conv_ops.get_conv1d_output_size", "numpy.zeros_like", "numpy.maximum", "numpy.log", "numpy.tanh", "numpy.tensordot", "numpy.zeros", "numpy.expand_dims", "numpy.ones", "numpy.lib.stride_tricks.as_strided", "nanograd.nn.conv_ops.get_conv2d_output_size", "numpy.exp", ...
[((990, 1025), 'numpy.pad', 'np.pad', (['a', 'padding'], {'mode': '"""constant"""'}), "(a, padding, mode='constant')\n", (996, 1025), True, 'import numpy as np\n'), ((1428, 1465), 'numpy.zeros', 'np.zeros', (['(idx.shape[0], num_classes)'], {}), '((idx.shape[0], num_classes))\n', (1436, 1465), True, 'import numpy as np...
import enum import streamlit as st from gensim.models import KeyedVectors from sklearn.decomposition import PCA import pandas as pd from matplotlib import pyplot as plt import seaborn as sns import numpy as np from sklearn.manifold import TSNE from random import sample from operator import add, sub wv = KeyedVectors.l...
[ "streamlit.text_input", "sklearn.manifold.TSNE", "streamlit.slider", "streamlit.header", "gensim.models.KeyedVectors.load", "numpy.zeros", "streamlit.title", "streamlit.write", "sklearn.decomposition.PCA", "streamlit.pyplot", "matplotlib.pyplot.subplots" ]
[((306, 357), 'gensim.models.KeyedVectors.load', 'KeyedVectors.load', (['"""skip_model_cord19_covid_55k.kv"""'], {}), "('skip_model_cord19_covid_55k.kv')\n", (323, 357), False, 'from gensim.models import KeyedVectors\n'), ((1067, 1084), 'streamlit.write', 'st.write', (['results'], {}), '(results)\n', (1075, 1084), True...
import os from typing import Optional, Sequence, Union import numpy as np from tensorflow.keras.utils import to_categorical import yaml from transformers.tokenization_distilbert import DistilBertTokenizer def load_training_conf(conf_path: Optional[str] = None) -> dict: conf_path = conf_path or os.path.join("src"...
[ "numpy.array", "yaml.full_load", "os.path.join" ]
[((302, 339), 'os.path.join', 'os.path.join', (['"""src"""', '"""train_conf.yml"""'], {}), "('src', 'train_conf.yml')\n", (314, 339), False, 'import os\n'), ((394, 414), 'yaml.full_load', 'yaml.full_load', (['file'], {}), '(file)\n', (408, 414), False, 'import yaml\n'), ((1149, 1203), 'numpy.array', 'np.array', (['[lab...
# encoding: utf-8 """ tune.py ~~~~~~~ Functionality for tuning models """ __author__ = "<NAME>" __email__ = "<EMAIL>" __created__ = "2018-05-08" __copyright__ = "Copyright 2018 <NAME>" __license__ = "MIT https://opensource.org/licenses/MIT" # standard imports # third party imports import numpy as np from matplotlib...
[ "sklearn.model_selection.GridSearchCV", "numpy.sum", "numpy.abs", "sklearn.metrics.accuracy_score", "atnlp.core.logger.log", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.gca", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.hlines", "matplotlib.pyplot.errorbar", "matplot...
[((1133, 1223), 'sklearn.model_selection.GridSearchCV', 'GridSearchCV', (['model'], {'cv': '(5)', 'param_grid': 'params', 'return_train_score': '(True)', 'scoring': 'scoring'}), '(model, cv=5, param_grid=params, return_train_score=True,\n scoring=scoring)\n', (1145, 1223), False, 'from sklearn.model_selection import...
#!/usr/bin/env python # -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology. # SPDX-FileCopyrightText: © 2021 <NAME> <<EMAIL>> # NOTICE: authors should document their contributions in concisely in NOTICE # with details inline in source files...
[ "numpy.fft.ifftshift", "scipy.special.factorial", "numpy.zeros_like", "numpy.ones_like", "scipy.special.eval_hermite", "numpy.fft.fft", "numpy.angle", "numpy.zeros", "numpy.fft.fftshift", "numpy.arange", "numpy.exp", "numpy.real", "numpy.fft.hfft", "numpy.sqrt", "numpy.concatenate", "n...
[((1274, 1290), 'numpy.zeros_like', 'np.zeros_like', (['x'], {}), '(x)\n', (1287, 1290), True, 'import numpy as np\n'), ((4262, 4318), 'numpy.concatenate', 'np.concatenate', (['(w[:, n // 2:n], w[:, 0:n // 2])'], {'axis': '(1)'}), '((w[:, n // 2:n], w[:, 0:n // 2]), axis=1)\n', (4276, 4318), True, 'import numpy as np\n...
""" potentials - """ import numpy as np import atsim.potentials.potentialforms as pairpot def morse(r, params): Ed = params[0] re = params[1] drs = params[2] gam = 1.0/(drs*re) E = map(pairpot.morse(gam, re, Ed), r) return np.array(E)
[ "atsim.potentials.potentialforms.morse", "numpy.array" ]
[((251, 262), 'numpy.array', 'np.array', (['E'], {}), '(E)\n', (259, 262), True, 'import numpy as np\n'), ((209, 235), 'atsim.potentials.potentialforms.morse', 'pairpot.morse', (['gam', 're', 'Ed'], {}), '(gam, re, Ed)\n', (222, 235), True, 'import atsim.potentials.potentialforms as pairpot\n')]
import numpy as np def document_vectorizer(corpus, model, num_features): """ This averages all the word embeddings in the tweet. This function averages all the word embeddings in the tweet. corpus: String text corpus Model: Model to use num_features: Int, the number of features to use ...
[ "numpy.zeros", "numpy.divide", "numpy.add", "numpy.array" ]
[((994, 1012), 'numpy.array', 'np.array', (['features'], {}), '(features)\n', (1002, 1012), True, 'import numpy as np\n'), ((1963, 1981), 'numpy.array', 'np.array', (['features'], {}), '(features)\n', (1971, 1981), True, 'import numpy as np\n'), ((474, 516), 'numpy.zeros', 'np.zeros', (['(num_features,)'], {'dtype': '"...
import tvm import numpy as np import argparse import os import time def run_model(model_dir, input_fp, output_fp, warmup_trials, run_trials, cuda, try_randin): # import compiled graph print("=> [TVM on TX2] using model files in {}".format(model_dir)) assert(os.path.isdir(model_dir)) print("=> [TVM on ...
[ "numpy.load", "argparse.ArgumentParser", "os.path.join", "tvm.nd.empty", "os.path.isdir", "tvm.cpu", "numpy.random.randn", "numpy.transpose", "numpy.zeros", "tvm.gpu", "tvm.get_global_func" ]
[((271, 295), 'os.path.isdir', 'os.path.isdir', (['model_dir'], {}), '(model_dir)\n', (284, 295), False, 'import os\n'), ((870, 917), 'tvm.get_global_func', 'tvm.get_global_func', (['"""tvm.graph_runtime.create"""'], {}), "('tvm.graph_runtime.create')\n", (889, 917), False, 'import tvm\n'), ((1221, 1238), 'numpy.load',...
import pytest pytest.importorskip('sklearn') from sklearn.linear_model import SGDClassifier import dask.array as da import numpy as np import dask x = np.array([[1, 0], [2, 0], [3, 0], [4, 0], [0, 1], [0, 2], [3, 3], [4...
[ "pytest.importorskip", "sklearn.linear_model.SGDClassifier", "numpy.array", "dask.array.from_array", "dask.array.learn.predict" ]
[((14, 44), 'pytest.importorskip', 'pytest.importorskip', (['"""sklearn"""'], {}), "('sklearn')\n", (33, 44), False, 'import pytest\n'), ((154, 228), 'numpy.array', 'np.array', (['[[1, 0], [2, 0], [3, 0], [4, 0], [0, 1], [0, 2], [3, 3], [4, 4]]'], {}), '([[1, 0], [2, 0], [3, 0], [4, 0], [0, 1], [0, 2], [3, 3], [4, 4]])...
#WGAN-GP import torch.nn as nn import numpy as np class Discriminator(nn.Module): """ Implementation of WGAN_GP discrminator is learnt from https://github.com/eriklindernoren/PyTorch-GAN.git """ def __init__(self,conf_data): super(Discriminator, self).__init__() self.img_shape = (conf_da...
[ "torch.nn.LeakyReLU", "numpy.prod", "torch.nn.Linear" ]
[((544, 575), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (['(0.2)'], {'inplace': '(True)'}), '(0.2, inplace=True)\n', (556, 575), True, 'import torch.nn as nn\n'), ((589, 608), 'torch.nn.Linear', 'nn.Linear', (['(512)', '(256)'], {}), '(512, 256)\n', (598, 608), True, 'import torch.nn as nn\n'), ((622, 653), 'torch.nn.Leaky...
# python 2/3 compatibility from __future__ import division, print_function # global imports import numpy import json import urllib3 import pandas import libsbml from scipy.sparse import lil_matrix, hstack # package imports from .rba.core.constraint_blocks import ConstraintBlocks from .element_block import ElementBlo...
[ "urllib3.PoolManager", "numpy.unique" ]
[((2092, 2113), 'urllib3.PoolManager', 'urllib3.PoolManager', ([], {}), '()\n', (2111, 2113), False, 'import urllib3\n'), ((6437, 6463), 'numpy.unique', 'numpy.unique', (['self.BiGGids'], {}), '(self.BiGGids)\n', (6449, 6463), False, 'import numpy\n')]
import dataclasses as dc import typing from concurrent.futures import ThreadPoolExecutor from dataclasses import dataclass import ipywidgets.widgets as widgets import matplotlib.pyplot as plt import numpy as np import statsmodels.nonparametric.smoothers_lowess as smoothers_lowess import xarray as xr from diffpy.pdfget...
[ "ipywidgets.widgets.Checkbox", "pyFAI.azimuthalIntegrator.AzimuthalIntegrator", "numpy.subtract", "ipywidgets.widgets.FloatSlider", "numpy.searchsorted", "pdffitx.vend.generate_binner", "xarray.Dataset", "statsmodels.nonparametric.smoothers_lowess.lowess", "numpy.sign", "diffpy.pdfgetx.pdfconfig.P...
[((3692, 3713), 'pyFAI.azimuthalIntegrator.AzimuthalIntegrator', 'AzimuthalIntegrator', ([], {}), '()\n', (3711, 3713), False, 'from pyFAI.azimuthalIntegrator import AzimuthalIntegrator\n'), ((1448, 1477), 'numpy.searchsorted', 'np.searchsorted', (['xin', 'xcutoff'], {}), '(xin, xcutoff)\n', (1463, 1477), True, 'import...
import json import random import logging import unittest import numpy as np import tempfile import os.path from glob import glob import tenncor as tc from dbg.print import graph_to_str from testutil.array_testcase import ArrTest from testutil.generate_testcases import generate_testcases from testutil.compare_testcas...
[ "testutil.generate_testcases.generate_testcases", "tenncor.api.clip_by_l2norm", "tenncor.api.nn.max_pool2d", "numpy.ones", "tenncor.api.nn.mean_pool2d", "tenncor.api.nn.conv2d", "glob.glob", "tenncor.api.softmax", "unittest.main", "tenncor.variable", "tenncor.api.reduce_min_1d", "tenncor.api.r...
[((354, 399), 'glob.glob', 'glob', (['"""models/test/testcases/tf_cases_*.json"""'], {}), "('models/test/testcases/tf_cases_*.json')\n", (358, 399), False, 'from glob import glob\n'), ((428, 450), 'testutil.compare_testcase.joint_json', 'joint_json', (['_testcases'], {}), '(_testcases)\n', (438, 450), False, 'from test...
# Make a plot of age vs J_z for Kepler-TGAS. import numpy as np import matplotlib.pyplot as plt import pandas as pd import h5py import os from gyro import gyro_age from actions import action from granola import get_properties plotpar = {'axes.labelsize': 18, 'font.size': 10, 'legend.fontsize':...
[ "matplotlib.pyplot.clf", "pandas.read_csv", "numpy.shape", "matplotlib.pyplot.step", "numpy.histogram", "numpy.std", "pandas.merge", "matplotlib.pyplot.rcParams.update", "numpy.log10", "matplotlib.pyplot.ylim", "numpy.median", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots_adjust", ...
[((425, 453), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['plotpar'], {}), '(plotpar)\n', (444, 453), True, 'import matplotlib.pyplot as plt\n'), ((514, 538), 'numpy.histogram', 'np.histogram', (['age', 'nbins'], {}), '(age, nbins)\n', (526, 538), True, 'import numpy as np\n'), ((1542, 1582), 'pandas....
"""This module generates a pruned set of the data set. The procedure of pruning is as follows: 1. Import the data and have a low level energy associated with each sample. 2. Run a clustering algorithm. The centres of each cluster are what is kept as a point in the pruned data set. 3. Run a furthest first traversal a...
[ "pandas.DataFrame", "numpy.random.uniform", "sklearn.cluster.MiniBatchKMeans", "numpy.save", "matplotlib.pyplot.show", "numpy.amin", "numpy.argmax", "seaborn.pointplot", "sklearn.cluster.KMeans", "numpy.zeros", "sklearn.metrics.pairwise.euclidean_distances", "numpy.argmin", "sklearn.datasets...
[((6474, 6532), 'sklearn.datasets.samples_generator.make_blobs', 'make_blobs', ([], {'n_samples': '(8000)', 'centers': 'centers', 'cluster_std': '(5)'}), '(n_samples=8000, centers=centers, cluster_std=5)\n', (6484, 6532), False, 'from sklearn.datasets.samples_generator import make_blobs\n'), ((3164, 3187), 'numpy.zeros...
# -*- coding: utf-8 -*- """ Authors: <NAME>, <NAME> """ import logging import pickle import numpy as np import plotly.graph_objs as go import plotly.plotly as py import sys from pathlib import Path from models import * import datetime project_dir = Path(__file__).resolve().parents[2] def main(): """ Create, t...
[ "logging.basicConfig", "numpy.zeros", "pathlib.Path", "numpy.array", "datetime.datetime.now", "logging.getLogger" ]
[((649, 676), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (666, 676), False, 'import logging\n'), ((5308, 5363), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': 'log_fmt'}), '(level=logging.INFO, format=log_fmt)\n', (5327, 5363), False, 'import lo...
#!/usr/bin/env python #print "*** FM PIANO VERSION WITH NOTE CACHING ***" """ ########################################################################## # * * * PySynth * * * # A very basic audio synthesizer in Python (www.python.org) # # <NAME>, 2012-11-29 (<EMAIL>) ###########...
[ "wave.open", "mixfiles.mix_files", "numpy.zeros", "mkfreq.getfreq", "numpy.sin", "numpy.arange", "math.log" ]
[((1350, 1359), 'mkfreq.getfreq', 'getfreq', ([], {}), '()\n', (1357, 1359), False, 'from mkfreq import getfreq\n'), ((2262, 2280), 'numpy.zeros', 'np.zeros', (['(88, 20)'], {}), '((88, 20))\n', (2270, 2280), True, 'import numpy as np\n'), ((3673, 3691), 'wave.open', 'wave.open', (['fn', '"""w"""'], {}), "(fn, 'w')\n",...
""" MIT License Copyright (c) 2021 martinpflaum 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, ...
[ "torch.nn.MSELoss", "torch.zeros_like", "torch.argsort", "torch.cat", "numpy.clip", "numpy.array", "matplotlib.pyplot.imsave", "torch.no_grad", "numpy.random.shuffle" ]
[((1261, 1273), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {}), '()\n', (1271, 1273), True, 'import torch.nn as nn\n'), ((2533, 2556), 'torch.cat', 'torch.cat', (['preds'], {'dim': '(0)'}), '(preds, dim=0)\n', (2542, 2556), False, 'import torch\n'), ((3474, 3506), 'torch.zeros_like', 'torch.zeros_like', (['valid_ds[0][1]']...
#!/usr/bin/env python # -*- mode: python; coding: utf-8 -*- ################################################################## # Documentation ################################################################## # Imports from __future__ import absolute_import, unicode_literals, print_function try: from cPickle im...
[ "keras.regularizers.l2", "os.remove", "numpy.argmax", "cgsa.utils.common.normlex", "keras.preprocessing.sequence.pad_sequences", "six.iteritems", "os.path.join", "numpy.unique", "collections.Counter", "numpy.random.shuffle", "copy.deepcopy", "numpy.random.binomial", "os.path.basename", "ke...
[((3673, 3700), 'copy.deepcopy', 'deepcopy', (['DFLT_TRAIN_PARAMS'], {}), '(DFLT_TRAIN_PARAMS)\n', (3681, 3700), False, 'from copy import deepcopy\n'), ((4716, 4763), 'tempfile.mkstemp', 'mkstemp', ([], {'suffix': '""".hdf5"""', 'prefix': "(self.name + '.')"}), "(suffix='.hdf5', prefix=self.name + '.')\n", (4723, 4763)...
import model import time import numpy as np def run_epoch(session, epoch_model, input_batches, target_batches, eval_op=None, verbose=False): """Runs the model on the given data. :type epoch_model: model.WordRNN """ start_time = time.time() costs = 0.0 iters = 0 state = session.run(epoch_m...
[ "numpy.exp", "time.time" ]
[((247, 258), 'time.time', 'time.time', ([], {}), '()\n', (256, 258), False, 'import time\n'), ((1344, 1365), 'numpy.exp', 'np.exp', (['(costs / iters)'], {}), '(costs / iters)\n', (1350, 1365), True, 'import numpy as np\n'), ((1221, 1242), 'numpy.exp', 'np.exp', (['(costs / iters)'], {}), '(costs / iters)\n', (1227, 1...
""" > Modules for processing training/validation data > Maintainer: https://github.com/xahidbuffon """ import os import glob import random import numpy as np from PIL import Image from torch.utils.data import Dataset import torchvision.transforms as transforms class GetTrainingPairs(Dataset): """ Common data...
[ "PIL.Image.open", "numpy.random.random", "torchvision.transforms.Compose", "numpy.array", "os.path.join" ]
[((498, 529), 'torchvision.transforms.Compose', 'transforms.Compose', (['transforms_'], {}), '(transforms_)\n', (516, 529), True, 'import torchvision.transforms as transforms\n'), ((731, 772), 'PIL.Image.open', 'Image.open', (['self.filesA[index % self.len]'], {}), '(self.filesA[index % self.len])\n', (741, 772), False...
import json import numpy as np HTTPS_token = '<PASSWORD>' RT_token = '<PASSWORD>' at_token = '<PASSWORD>' hashtag_token = '<PASSWORD>' gt_token = '<PASSWORD>' lt_token = '<PASSWORD>' amp_token = '<PASSWORD>' question_token = '<PASSWORD>' esclamation_token = '<PASSWORD>' period_token = '<PASSWORD>' two_periods_token ...
[ "numpy.array", "json.dumps" ]
[((3448, 3472), 'json.dumps', 'json.dumps', (['mapping_dict'], {}), '(mapping_dict)\n', (3458, 3472), False, 'import json\n'), ((7881, 7897), 'numpy.array', 'np.array', (['tokens'], {}), '(tokens)\n', (7889, 7897), True, 'import numpy as np\n'), ((9308, 9332), 'numpy.array', 'np.array', (['decoded_tokens'], {}), '(deco...
# -*- coding: utf-8 -*- """ Showcases gamut section plotting examples. """ import numpy as np from matplotlib.lines import Line2D import colour.plotting from colour.plotting import ( colour_style, plot_visible_spectrum_section, plot_RGB_colourspace_section, ) from colour.utilities import message_box mess...
[ "colour.utilities.message_box", "colour.plotting.colour_style", "colour.plotting.plot_visible_spectrum_section", "numpy.arange", "colour.plotting.plot_RGB_colourspace_section" ]
[((316, 350), 'colour.utilities.message_box', 'message_box', (['"""Gamut Section Plots"""'], {}), "('Gamut Section Plots')\n", (327, 350), False, 'from colour.utilities import message_box\n'), ((352, 366), 'colour.plotting.colour_style', 'colour_style', ([], {}), '()\n', (364, 366), False, 'from colour.plotting import ...
import sys import numpy as np import matplotlib.pyplot as plt from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("-f", "--file", dest="filename", help="f0 file", metavar="FILE") args = parser.parse_args() if args.filename is not None: with open(args.filename, 'r') as f: dat...
[ "numpy.loadtxt", "numpy.power", "numpy.savetxt", "argparse.ArgumentParser" ]
[((109, 125), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (123, 125), False, 'from argparse import ArgumentParser\n'), ((458, 475), 'numpy.power', 'np.power', (['np.e', 'v'], {}), '(np.e, v)\n', (466, 475), True, 'import numpy as np\n'), ((498, 539), 'numpy.savetxt', 'np.savetxt', (['sys.stdout', 'da...
from typing import List, Tuple, Dict, Any, Optional, Union, Callable import copy from datetime import datetime from pathos.multiprocessing import ProcessingPool as Pool import numpy as np from scipy.special import expit import matplotlib.pyplot as plt import matplotlib.cm as plt_cm import matplotlib.colors as plt_co...
[ "matplotlib.colors.LinearSegmentedColormap.from_list", "copy.deepcopy", "matplotlib.pyplot.show", "plotly.graph_objects.Figure", "matplotlib.pyplot.close", "pathos.multiprocessing.ProcessingPool", "numpy.zeros", "numpy.clip", "scipy.special.expit", "numpy.array", "gym.spaces.Box", "matplotlib....
[((3895, 3918), 'gym.utils.seeding.np_random', 'seeding.np_random', (['seed'], {}), '(seed)\n', (3912, 3918), False, 'from gym.utils import seeding\n'), ((4087, 4125), 'copy.deepcopy', 'copy.deepcopy', (['self.original_simulator'], {}), '(self.original_simulator)\n', (4100, 4125), False, 'import copy\n'), ((8669, 8717)...
import os, sys, numpy variables_size = 22 dataset_name = "AUSLAN_CUTTED" ts_len = 45 #initializations dirname = os.path.abspath(os.path.dirname(sys.argv[0])) train_test_str = ["_TRAIN","_TEST"] serie_counter = 0 line_saver_vector = [] variable_test = [] for i in range(0,variables_size): variable_test.append([]) ...
[ "os.path.dirname", "numpy.array" ]
[((130, 158), 'os.path.dirname', 'os.path.dirname', (['sys.argv[0]'], {}), '(sys.argv[0])\n', (145, 158), False, 'import os, sys, numpy\n'), ((1649, 1678), 'numpy.array', 'numpy.array', (['variable_test[j]'], {}), '(variable_test[j])\n', (1660, 1678), False, 'import os, sys, numpy\n'), ((931, 960), 'numpy.array', 'nump...
import numpy as np from rlscore.measure import cindex #Concordance index is a pairwise ranking measure #Equivalent to AUC for bi-partite ranking problems Y = [-1, -1, -1, 1, 1] P = [-5, 2, -1, 1, 3.2] cind1 = cindex(Y, P) print("My cindex is %f" %cind1) #Can handle also real-valued Y-values Y2 = [-2.2, -1.3, -0....
[ "rlscore.measure.cindex", "numpy.vstack" ]
[((213, 225), 'rlscore.measure.cindex', 'cindex', (['Y', 'P'], {}), '(Y, P)\n', (219, 225), False, 'from rlscore.measure import cindex\n'), ((422, 436), 'rlscore.measure.cindex', 'cindex', (['Y2', 'P2'], {}), '(Y2, P2)\n', (428, 436), False, 'from rlscore.measure import cindex\n'), ((564, 582), 'numpy.vstack', 'np.vsta...
#!/usr/bin/python3 #-*- coding:utf-8 -*- ''' created on Feb.,2020 @Author:<NAME> ''' import numpy as np import os import cv2 from cv2 import VideoWriter,VideoWriter_fourcc,imread,resize from moviepy.editor import * from moviepy.audio.fx import all from PIL import Image from pydub import AudioSegment import time # ...
[ "cv2.imread", "numpy.zeros", "cv2.VideoWriter_fourcc", "time.time" ]
[((1006, 1037), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (["*'mp4v'"], {}), "(*'mp4v')\n", (1028, 1037), False, 'import cv2\n'), ((1212, 1241), 'numpy.zeros', 'np.zeros', (['numA'], {'dtype': '"""float"""'}), "(numA, dtype='float')\n", (1220, 1241), True, 'import numpy as np\n'), ((2353, 2364), 'time.time', ...
from parallel_env import ParallelEnv import parl import argparse import numpy as np from parl.utils import logger # example of ParallelEnv def parallel_env(): logger.info("Running example of RemoteEnv in atari_env: {}".format( args.atari_env)) parl.connect('localhost') env_list = ParallelEnv(env_...
[ "parl.connect", "numpy.random.randint", "argparse.ArgumentParser", "parallel_env.ParallelEnv" ]
[((263, 288), 'parl.connect', 'parl.connect', (['"""localhost"""'], {}), "('localhost')\n", (275, 288), False, 'import parl\n'), ((304, 362), 'parallel_env.ParallelEnv', 'ParallelEnv', ([], {'env_name': 'args.atari_env', 'env_num': 'args.env_num'}), '(env_name=args.atari_env, env_num=args.env_num)\n', (315, 362), False...
#!/usr/bin/env python3 ''' Internal simulation of steering-wheel robots ''' import rclpy from rclpy.node import Node from sensor_msgs.msg import JointState from std_msgs.msg import Float32MultiArray from geometry_msgs.msg import Twist import numpy as np dt = 0.05 class Wheel: def __init__(self, joint): ...
[ "numpy.matrix", "rclpy.spin_once", "rclpy.spin", "rclpy.node.Node", "rcl_interfaces.srv.GetParameters.Request", "rclpy.init", "geometry_msgs.msg.Twist", "numpy.hstack", "numpy.sin", "sensor_msgs.msg.JointState", "numpy.reshape", "numpy.cos", "numpy.array", "rclpy.ok", "numpy.eye" ]
[((9371, 9383), 'rclpy.init', 'rclpy.init', ([], {}), '()\n', (9381, 9383), False, 'import rclpy\n'), ((9442, 9459), 'rclpy.spin', 'rclpy.spin', (['robot'], {}), '(robot)\n', (9452, 9459), False, 'import rclpy\n'), ((5161, 5179), 'rclpy.node.Node', 'Node', (['"""rsp_client"""'], {}), "('rsp_client')\n", (5165, 5179), F...
r"""X-Path Factory :mod:`abelfunctions.complex_path_factory` ================================================= Module for computing the monodromy group of the set of discriminant points of a complex plane algebraic curve. """ import numpy import scipy from numpy import double, complex, floor, angle from sage.all im...
[ "numpy.poly1d", "numpy.roots", "numpy.abs", "abelfunctions.complex_path.ComplexLine", "numpy.double", "abelfunctions.complex_path.ComplexArc", "numpy.angle", "numpy.lexsort", "numpy.floor", "sage.all.scatter_plot", "abelfunctions.complex_path.ComplexPath", "numpy.array", "numpy.argwhere", ...
[((5105, 5121), 'numpy.array', 'numpy.array', (['rts'], {}), '(rts)\n', (5116, 5121), False, 'import numpy\n'), ((5160, 5191), 'numpy.array', 'numpy.array', (['rts'], {'dtype': 'complex'}), '(rts, dtype=complex)\n', (5171, 5191), False, 'import numpy\n'), ((5714, 5736), 'numpy.angle', 'angle', (['centered_points'], {})...
# # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "bigdl.util.common.callBigDlFunc", "tensorflow.get_collection", "json.dumps", "tensorflow.assign", "shutil.rmtree", "os.path.join", "bigdl.nn.layer.Layer.convert_output", "zoo.util.tf.process_grad", "queue.get", "tensorflow.placeholder", "tempfile.mkdtemp", "bigdl.nn.layer.Model.load_keras", ...
[((12279, 12292), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (12290, 12292), True, 'import queue as queue\n'), ((1670, 1749), 'bigdl.util.common.callBigDlFunc', 'callBigDlFunc', (['self.bigdl_type', '"""getFlattenSubModules"""', 'self', 'include_container'], {}), "(self.bigdl_type, 'getFlattenSubModules', self, in...
import pickle, os import pylab as pl import numpy as np import math PATH_TO_PLOTS = "./Plots/" PATH_TO_DATA = "./Optimization_Stats/" ALGORITHMS = ["AMPGO", "Anneal", "BSA", "Cuckoo", "qABC"] FUNCTIONS = ["Adjiman", "Beale", "EggHolder", "GoldsteinPrice", "Langermann", "Shubert01", "SixHumpCamel", "UrsemW...
[ "pylab.title", "pylab.rcParams.update", "pylab.ylabel", "os.popen", "pylab.plot", "pylab.savefig", "math.log10", "pickle.load", "numpy.array", "pylab.ylim", "pylab.xlabel", "pylab.clf", "pylab.legend" ]
[((8594, 8655), 'pylab.rcParams.update', 'pl.rcParams.update', (["{'font.size': 11, 'font.family': 'serif'}"], {}), "({'font.size': 11, 'font.family': 'serif'})\n", (8612, 8655), True, 'import pylab as pl\n'), ((9037, 9082), 'pylab.xlabel', 'pl.xlabel', (['"""Executions of objective function"""'], {}), "('Executions of...
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Cisco Systems, Inc. and others. 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...
[ "os.remove", "pickle.dump", "sklearn.feature_extraction.text.TfidfVectorizer", "numpy.empty", "json.dumps", "numpy.argsort", "numpy.around", "pickle.load", "numpy.mean", "os.path.exists", "re.escape", "copy.deepcopy", "numpy.concatenate", "numpy.vstack", "os.getpid", "os.makedirs", "...
[((1880, 1907), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1897, 1907), False, 'import logging\n'), ((4977, 5011), 'json.dumps', 'json.dumps', (['config'], {'sort_keys': '(True)'}), '(config, sort_keys=True)\n', (4987, 5011), False, 'import json\n'), ((49364, 49401), 'json.dumps', 'j...
import numpy as np from matplotlib import pyplot as plt from datetime import datetime def data_ft(data, plotting=True): t = data[5:-5, 0] x = data[5:-5, 1:] x /= np.mean(x, axis=0) f = np.fft.fftfreq(t.size, t[1]-t[0]) # f_norm = (f>0) & (f<250) x_fft =np.fft.fft(x, axis=0) x_fft_abs = np....
[ "matplotlib.pyplot.xlim", "numpy.abs", "matplotlib.pyplot.ioff", "matplotlib.pyplot.plot", "numpy.fft.fft", "matplotlib.pyplot.close", "matplotlib.pyplot.ion", "numpy.fft.fftfreq", "numpy.mean", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "datetime.dat...
[((175, 193), 'numpy.mean', 'np.mean', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (182, 193), True, 'import numpy as np\n'), ((202, 237), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['t.size', '(t[1] - t[0])'], {}), '(t.size, t[1] - t[0])\n', (216, 237), True, 'import numpy as np\n'), ((279, 300), 'numpy.fft.fft', 'np.fft....
"""Contains integration measures.""" import abc from typing import Optional, Tuple, Union import numpy as np import scipy.stats from probnum.randvars import Normal from probnum.typing import FloatArgType, IntArgType class IntegrationMeasure(abc.ABC): """An abstract class for a measure against which a target fu...
[ "numpy.full", "numpy.size", "numpy.isscalar", "numpy.prod", "numpy.max", "numpy.squeeze", "numpy.eye", "numpy.atleast_1d", "numpy.all", "numpy.diagonal" ]
[((3491, 3509), 'numpy.size', 'np.size', (['domain[0]'], {}), '(domain[0])\n', (3498, 3509), True, 'import numpy as np\n'), ((3533, 3551), 'numpy.size', 'np.size', (['domain[1]'], {}), '(domain[1])\n', (3540, 3551), True, 'import numpy as np\n'), ((6584, 6656), 'numpy.full', 'np.full', (['(() if num_dat == 1 else (num_...
import argparse import numpy as np import os import pandas as pd import pickle import util from datetime import datetime from scipy.sparse import save_npz, vstack from sklearn.preprocessing import LabelEncoder if __name__ == '__main__': # Commandline arguments parser = argparse.ArgumentParser() parser.add_...
[ "pickle.dump", "numpy.random.seed", "argparse.ArgumentParser", "scipy.sparse.vstack", "os.makedirs", "pandas.read_csv", "os.path.exists", "sklearn.preprocessing.LabelEncoder", "util.train_val_test_split_Jebara", "scipy.sparse.save_npz", "datetime.datetime.now", "numpy.random.shuffle" ]
[((279, 304), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (302, 304), False, 'import argparse\n'), ((528, 546), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (542, 546), True, 'import numpy as np\n'), ((636, 683), 'pandas.read_csv', 'pd.read_csv', (["(args.dir + 'preproces...
from sklearn import datasets from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier from sklearn.preprocessing import LabelEncoder from keras.utils import np_utils import pandas as pd import numpy as np import mat...
[ "numpy.random.seed", "matplotlib.pyplot.show", "numpy.std", "data_augmentation.get_augmented_input_1", "sklearn.model_selection.train_test_split", "numpy.ones", "matrix_plot.plot_confusion_matrix", "data_augmentation.get_augmented_input_2", "pandas.read_excel", "data_augmentation.get_augmented_inp...
[((435, 455), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (449, 455), True, 'import numpy as np\n'), ((574, 630), 'pandas.read_excel', 'pd.read_excel', (['"""data/female_session_1.xlsx"""'], {'header': 'None'}), "('data/female_session_1.xlsx', header=None)\n", (587, 630), True, 'import pandas as ...
"""GAN implementation for name generation.""" import time import json import os import tensorflow as tf from tensorflow.keras.layers import ( Dense, BatchNormalization, Reshape, Conv1D, Conv1DTranspose, Flatten, Dropout, ) from tensorflow.keras.models import Sequential import numpy as np ...
[ "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.zeros_like", "tensorflow.train.latest_checkpoint", "tensorflow.keras.models.Sequential", "os.path.join", "numpy.round", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.BatchNormalization", "tensorflow.train...
[((5157, 5209), 'tensorflow.keras.losses.BinaryCrossentropy', 'tf.keras.losses.BinaryCrossentropy', ([], {'from_logits': '(True)'}), '(from_logits=True)\n', (5191, 5209), True, 'import tensorflow as tf\n'), ((5233, 5265), 'tensorflow.keras.optimizers.Adam', 'tf.keras.optimizers.Adam', (['(0.0001)'], {}), '(0.0001)\n', ...
# Copyright (c) MONAI Consortium # 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, so...
[ "numpy.moveaxis", "monai.utils.OptionalImportError", "numpy.iinfo", "numpy.clip", "itk.size", "numpy.diag", "itk.GetMatrixFromArray", "nibabel.save", "numpy.max", "monai.data.utils.ensure_tuple_rep", "monai.transforms.spatial.array.SpatialResample", "monai.utils.require_pkg", "monai.data.uti...
[((1349, 1398), 'monai.apps.utils.get_logger', 'get_logger', ([], {'module_name': '__name__', 'fmt': 'DEFAULT_FMT'}), '(module_name=__name__, fmt=DEFAULT_FMT)\n', (1359, 1398), False, 'from monai.apps.utils import get_logger\n'), ((15368, 15395), 'monai.utils.require_pkg', 'require_pkg', ([], {'pkg_name': '"""itk"""'})...
from collections import namedtuple import numpy as np import talib from jesse.helpers import get_candle_source RSMK = namedtuple('RSMK', ['indicator', 'signal']) def rsmk(candles: np.ndarray, candles_compare: np.ndarray, lookback: int = 90, period: int = 3, signal_period: int = 20, matype: int = 1, ...
[ "numpy.log", "jesse.helpers.get_candle_source", "talib.MOM", "talib.MA", "numpy.isnan", "collections.namedtuple" ]
[((121, 164), 'collections.namedtuple', 'namedtuple', (['"""RSMK"""', "['indicator', 'signal']"], {}), "('RSMK', ['indicator', 'signal'])\n", (131, 164), False, 'from collections import namedtuple\n'), ((828, 879), 'jesse.helpers.get_candle_source', 'get_candle_source', (['candles'], {'source_type': 'source_type'}), '(...
from . import postprocessor as postp from ..shared_code import preprocessor as prep from tensorflow import make_tensor_proto, make_ndarray from tensorflow_serving.apis import predict_pb2 from tensorflow_serving.apis import prediction_service_pb2_grpc from time import time import azure.functions as func import cv2 impor...
[ "logging.error", "tensorflow.make_tensor_proto", "tensorflow_serving.apis.predict_pb2.PredictRequest", "logging.warning", "PIL.Image.composite", "numpy.asarray", "tensorflow.make_ndarray", "time.time", "os.environ.get", "logging.info", "tensorflow_serving.apis.prediction_service_pb2_grpc.Predict...
[((402, 447), 'os.environ.get', 'os.environ.get', (['"""HUMANSEGMENTATION_IPADDRESS"""'], {}), "('HUMANSEGMENTATION_IPADDRESS')\n", (416, 447), False, 'import os\n'), ((456, 496), 'os.environ.get', 'os.environ.get', (['"""HUMANSEGMENTATION_PORT"""'], {}), "('HUMANSEGMENTATION_PORT')\n", (470, 496), False, 'import os\n'...
""" UTILITY DESCRIBTION: -------------------- As the name states this is a utility with various plot tools to make it easier to make nice plots. This utility has the following overview: """ # Numpy: import numpy as np # Python functions: import time, sys, pylab, math, julian # Matplotlib: import matplotlib.pyplot...
[ "matplotlib.pyplot.title", "sys.stdout.write", "matplotlib.pyplot.subplot2grid", "numpy.ones", "matplotlib.pyplot.figure", "numpy.mean", "sys.stdout.flush", "matplotlib.pyplot.axvline", "numpy.meshgrid", "julian.from_jd", "Plot_Tools.linear", "numpy.std", "matplotlib.pyplot.colorbar", "num...
[((2232, 2242), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2240, 2242), True, 'import matplotlib.pyplot as plt\n'), ((2350, 2359), 'numpy.max', 'np.max', (['z'], {}), '(z)\n', (2356, 2359), True, 'import numpy as np\n'), ((2374, 2394), 'numpy.where', 'np.where', (['(z == z_max)'], {}), '(z == z_max)\n', (...
import collections import logging import os import tempfile import numpy from svviz.utilities import mean, stddev from svviz.kde import gaussian_kde from svviz import plotting def removeOutliers(data, m = 10.): """ a method of trimming outliers from a list/array using outlier-safe methods of calculating the ...
[ "numpy.median", "numpy.std", "svviz.kde.gaussian_kde", "rpy2.robjects.r.png", "numpy.percentile", "tempfile.mkdtemp", "numpy.array", "svviz.utilities.stddev", "numpy.mean", "collections.Counter", "svviz.plotting.ecdf", "os.path.join", "svviz.utilities.mean" ]
[((459, 476), 'numpy.array', 'numpy.array', (['data'], {}), '(data)\n', (470, 476), False, 'import numpy\n'), ((571, 590), 'numpy.median', 'numpy.median', (['d_abs'], {}), '(d_abs)\n', (583, 590), False, 'import numpy\n'), ((2523, 2544), 'collections.Counter', 'collections.Counter', ([], {}), '()\n', (2542, 2544), Fals...
# -*- coding: utf-8 -*- """ Created on Sat Apr 18 15:08:47 2015 @author: Ben """ import clearplot.plot_functions as pf import numpy as np xa = np.arange(0,10,0.01) ya = np.sqrt(xa) xb = xa yb = 3.0 * (xb/10)**3 - 2.0 * (xb/10)**2 [fig, ax, curves] = pf.plot('two_curves-legend.png', [xa, xb], [ya, yb], \ labels =...
[ "numpy.arange", "clearplot.plot_functions.plot", "numpy.sqrt" ]
[((145, 167), 'numpy.arange', 'np.arange', (['(0)', '(10)', '(0.01)'], {}), '(0, 10, 0.01)\n', (154, 167), True, 'import numpy as np\n'), ((171, 182), 'numpy.sqrt', 'np.sqrt', (['xa'], {}), '(xa)\n', (178, 182), True, 'import numpy as np\n'), ((253, 405), 'clearplot.plot_functions.plot', 'pf.plot', (['"""two_curves-leg...
import numpy as np import os, sys from os.path import join, dirname import argparse from tqdm import tqdm import pandas as pd import pickle import matplotlib matplotlib.use('agg') # use matplotlib without GUI support sys.path.append('./auxiliary/') from auxiliary.model import PoseEstimator from auxiliary.dataset imp...
[ "sys.path.append", "os.mkdir", "argparse.ArgumentParser", "os.path.isdir", "evaluation.test_category", "auxiliary.utils.load_checkpoint", "auxiliary.dataset.Pascal3D", "auxiliary.model.PoseEstimator", "matplotlib.use", "numpy.array", "os.path.join", "sys.exit" ]
[((159, 180), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (173, 180), False, 'import matplotlib\n'), ((220, 251), 'sys.path.append', 'sys.path.append', (['"""./auxiliary/"""'], {}), "('./auxiliary/')\n", (235, 251), False, 'import os, sys\n'), ((487, 512), 'argparse.ArgumentParser', 'argparse....
# # Created on Thu Dec 09 2021 6:44:55 AM # Author: <NAME> (<EMAIL>) # Objective: Gaussian Sparse Parity Experiment # # import standard libraries import numpy as np from tensorflow import keras from keras import layers import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # importing internal libr...
[ "pandas.DataFrame", "numpy.quantile", "tensorflow.keras.utils.to_categorical", "pandas.read_csv", "tensorflow.keras.Sequential", "numpy.median", "tensorflow.keras.callbacks.EarlyStopping", "keras.layers.Dense", "tensorflow.keras.optimizers.Adam", "kdg.utils.gaussian_sparse_parity", "matplotlib.p...
[((680, 694), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (692, 694), True, 'import pandas as pd\n'), ((815, 843), 'kdg.utils.gaussian_sparse_parity', 'gaussian_sparse_parity', (['(1000)'], {}), '(1000)\n', (837, 843), False, 'from kdg.utils import gaussian_sparse_parity\n'), ((970, 1047), 'tensorflow.keras.c...
# Copyright (c) 2020 The Plankton Authors. # All rights reserved. # # This source code is derived from UUV Simulator # (https://github.com/uuvsimulator/uuv_simulator) # Copyright (c) 2016-2019 The UUV Simulator Authors # licensed under the Apache license, Version 2.0 # cf. 3rd-party-licenses.txt file in the root direct...
[ "numpy.sin", "numpy.array", "numpy.cos", "numpy.sqrt" ]
[((1940, 1956), 'numpy.array', 'np.array', (['center'], {}), '(center)\n', (1948, 1956), True, 'import numpy as np\n'), ((2702, 2762), 'numpy.sqrt', 'np.sqrt', (['(self._step_z ** 2 + (2 * np.pi * self._radius) ** 2)'], {}), '(self._step_z ** 2 + (2 * np.pi * self._radius) ** 2)\n', (2709, 2762), True, 'import numpy as...
#!/usr/bin/env python from nose.tools import raises def Pan_linear_left_test(): import numpy as np from ATK.Core import DoubleInPointerFilter, DoubleOutPointerFilter from ATK.Tools import DoublePanFilter from numpy.testing import assert_almost_equal t = np.arange(1000, dtype=np.float64)[None, :] input...
[ "ATK.Core.DoubleInPointerFilter", "ATK.Core.DoubleOutPointerFilter", "numpy.testing.assert_almost_equal", "numpy.zeros", "numpy.sin", "numpy.arange", "ATK.Tools.DoublePanFilter" ]
[((323, 359), 'numpy.sin', 'np.sin', (['(t * 1000 * 2 * np.pi / 48000)'], {}), '(t * 1000 * 2 * np.pi / 48000)\n', (329, 359), True, 'import numpy as np\n'), ((458, 493), 'ATK.Core.DoubleInPointerFilter', 'DoubleInPointerFilter', (['input', '(False)'], {}), '(input, False)\n', (479, 493), False, 'from ATK.Core import D...
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
[ "tensorflow.random.set_seed", "numpy.load", "psl_utils.update_logits", "data_utils.get_dataset_num_latent_states", "tensorflow.reshape", "numpy.ones", "collections.defaultdict", "numpy.random.default_rng", "absl.logging.info", "tensorflow.io.gfile.makedirs", "data_preprocessor.BertDataPreprocess...
[((2328, 2395), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""output_dir"""', '"""/tmp/vrnn"""', '"""Output directory."""'], {}), "('output_dir', '/tmp/vrnn', 'Output directory.')\n", (2347, 2395), False, 'from absl import flags\n'), ((2439, 2486), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""s...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os import sys import glob import random import numpy as np import cv2 import uuid import tensorflow as tf import argparse parser = argparse.ArgumentParser() parser.add_argument("--input_di...
[ "argparse.ArgumentParser", "tensorflow.logging.set_verbosity", "cv2.warpAffine", "numpy.mean", "numpy.linalg.norm", "numpy.sin", "glob.glob", "os.path.join", "numpy.genfromtxt", "tensorflow.app.run", "numpy.cross", "tensorflow.Session", "uuid.uuid1", "tensorflow.data.Dataset.zip", "numpy...
[((263, 288), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (286, 288), False, 'import argparse\n'), ((665, 686), 'numpy.mean', 'np.mean', (['From'], {'axis': '(0)'}), '(From, axis=0)\n', (672, 686), True, 'import numpy as np\n'), ((700, 719), 'numpy.mean', 'np.mean', (['To'], {'axis': '(0)'})...
# -*- coding: utf-8 -*- """ @authors: PIE n°7 group - ISAE Supaero - 2020/2021 Description : This script intends to provide the current aerodynamic coefficients of the plane, which depends on the current state vector of the plane, the pilot commands, and some intrinsic parameters of the plane. Source : JSBSim """ ...
[ "numpy.exp", "numpy.sqrt" ]
[((2363, 2391), 'numpy.sqrt', 'np.sqrt', (['(1 - plane_mach ** 2)'], {}), '(1 - plane_mach ** 2)\n', (2370, 2391), True, 'import numpy as np\n'), ((3922, 3964), 'numpy.exp', 'np.exp', (['((plane_position[2] - 18000) / 2000)'], {}), '((plane_position[2] - 18000) / 2000)\n', (3928, 3964), True, 'import numpy as np\n')]