code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import xarray as xr from copy import deepcopy from skimage.draw import circle def generate_test_dist_matrix(num_A=100, num_B=100, num_C=100, distr_AB=(10, 1), distr_random=(200, 1), seed=None): """ This function will return a rand...
[ "numpy.fill_diagonal", "copy.deepcopy", "numpy.random.seed", "numpy.concatenate", "numpy.logical_and", "numpy.ix_", "numpy.unique", "numpy.zeros", "numpy.arange", "xarray.DataArray", "numpy.random.normal", "numpy.random.multivariate_normal", "numpy.random.permutation", "numpy.random.shuffl...
[((2829, 2906), 'numpy.concatenate', 'np.concatenate', (['((random_aa + random_aa.T) / 2, random_ab, random_ac)'], {'axis': '(1)'}), '(((random_aa + random_aa.T) / 2, random_ab, random_ac), axis=1)\n', (2843, 2906), True, 'import numpy as np\n'), ((2925, 3004), 'numpy.concatenate', 'np.concatenate', (['(random_ab.T, (r...
# -*- coding: utf-8 -*- # @Author: liuyulin # @Date: 2018-10-16 16:36:20 # @Last Modified by: <NAME> # @Last Modified time: 2019-06-23 21:03:01 from matplotlib.patches import Polygon import pyproj import numpy as np import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap import...
[ "utils.g.fwd", "numpy.load", "numpy.arctan2", "numpy.empty", "numpy.allclose", "matplotlib.pyplot.quiver", "matplotlib.patches.Polygon", "matplotlib.pyplot.figure", "utils.g.inv", "numpy.arange", "numpy.sin", "os.path.join", "numpy.unique", "numpy.linspace", "pyproj.Geod", "matplotlib....
[((3452, 3471), 'numpy.linalg.eigh', 'np.linalg.eigh', (['cov'], {}), '(cov)\n', (3466, 3471), True, 'import numpy as np\n'), ((3681, 3699), 'numpy.arctan2', 'np.arctan2', (['vy', 'vx'], {}), '(vy, vx)\n', (3691, 3699), True, 'import numpy as np\n'), ((4383, 4409), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsi...
from pydnameth.infrastucture.path import get_data_base_path import numpy as np import os.path import pickle def get_line_list(line): line_list = line.split('\t') for val_id in range(0, len(line_list)): line_list[val_id] = line_list[val_id].replace('"', '').rstrip() return line_list def load_cpg(...
[ "numpy.load", "pickle.dump", "numpy.savez_compressed", "pickle.load", "pydnameth.infrastucture.path.get_data_base_path" ]
[((638, 652), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (649, 652), False, 'import pickle\n'), ((687, 702), 'numpy.load', 'np.load', (['fn_npz'], {}), '(fn_npz)\n', (694, 702), True, 'import numpy as np\n'), ((1076, 1132), 'pickle.dump', 'pickle.dump', (['config.cpg_dict', 'f', 'pickle.HIGHEST_PROTOCOL'], {})...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2018 SMHI, Swedish Meteorological and Hydrological Institute # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). import os import numpy as np from sharkpylib.file.file_handlers import Directory from sharkpylib.geography import ...
[ "sharkpylib.geography.latlon_distance", "os.path.realpath", "numpy.array" ]
[((1713, 1727), 'numpy.array', 'np.array', (['dist'], {}), '(dist)\n', (1721, 1727), True, 'import numpy as np\n'), ((463, 489), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (479, 489), False, 'import os\n'), ((1631, 1684), 'sharkpylib.geography.latlon_distance', 'latlon_distance', (["(it...
import random import numpy as np import pandas as pd import plotnine as g def trace_plot(y, title): p = (g.qplot(y = y) + g.geom_line() + g.ggtitle(title) ) return p class MCMC: """A class to execute a Gibbs Sampler for MCMC""" def __init__(self, data, niter=500): ...
[ "pandas.DataFrame", "plotnine.stat_summary", "plotnine.geom_line", "numpy.sum", "plotnine.labs", "plotnine.qplot", "plotnine.ggtitle", "numpy.ones", "numpy.random.gamma", "numpy.mean", "numpy.array", "plotnine.aes", "numpy.sqrt" ]
[((168, 184), 'plotnine.ggtitle', 'g.ggtitle', (['title'], {}), '(title)\n', (177, 184), True, 'import plotnine as g\n'), ((1388, 1417), 'numpy.ones', 'np.ones', (['(self.niter, self.k)'], {}), '((self.niter, self.k))\n', (1395, 1417), True, 'import numpy as np\n'), ((1438, 1466), 'numpy.array', 'np.array', (['([1.0] *...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 15 21:37:42 2019 @author: leandrohirai """ import os import numpy as np from shutil import copyfile path = os.path.dirname(os.path.realpath(__file__)) #path = path+'/data/daySegData/JPEGImages' path = path+'/data/day2nightData/JPEGImages' txtPath ...
[ "numpy.random.seed", "os.path.realpath", "os.walk", "numpy.floor", "numpy.random.shuffle" ]
[((522, 535), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (529, 535), False, 'import os\n'), ((790, 808), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (804, 808), True, 'import numpy as np\n'), ((809, 835), 'numpy.random.shuffle', 'np.random.shuffle', (['indices'], {}), '(indices)\n', (826, 83...
#-*- coding: utf8 from __future__ import division, print_function import numpy as np def _compute_centroids(X, assign, num_clusters): C = np.zeros(shape=(num_clusters, X.shape[1]), dtype='d') for k in xrange(num_clusters): if not (assign == k).any(): continue K = X[assign == k] ...
[ "numpy.seterr", "numpy.log2", "os.path.dirname", "numpy.zeros", "numpy.genfromtxt", "numpy.errstate", "numpy.isnan", "numpy.isinf", "numpy.random.randint", "os.path.join" ]
[((144, 197), 'numpy.zeros', 'np.zeros', ([], {'shape': '(num_clusters, X.shape[1])', 'dtype': '"""d"""'}), "(shape=(num_clusters, X.shape[1]), dtype='d')\n", (152, 197), True, 'import numpy as np\n'), ((2238, 2260), 'numpy.seterr', 'np.seterr', ([], {'all': '"""raise"""'}), "(all='raise')\n", (2247, 2260), True, 'impo...
import random import numpy as np import rltorch import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Categorical import gym class Policy(nn.Module): def __init__(self, state_size, action_size): super(Policy, self).__init__() self.state_size = state_size self....
[ "numpy.full", "torch.distributions.Categorical", "gym.make", "numpy.setdiff1d", "torch.cat", "torch.randn", "numpy.argsort", "torch.nn.LayerNorm", "torch.nn.Linear", "numpy.random.rand", "torch.from_numpy" ]
[((735, 757), 'gym.make', 'gym.make', (['"""Acrobot-v1"""'], {}), "('Acrobot-v1')\n", (743, 757), False, 'import gym\n'), ((362, 388), 'torch.nn.Linear', 'nn.Linear', (['state_size', '(125)'], {}), '(state_size, 125)\n', (371, 388), True, 'import torch.nn as nn\n'), ((408, 425), 'torch.nn.LayerNorm', 'nn.LayerNorm', ([...
# pylint: skip-file import datetime import json import logging import traceback import numpy as np from api.infrastructure.mysql import connection logger = logging.getLogger(__name__) class ChurnRiskHistory: def __init__(self, database_name, kam=None): super().__init__() self.results_db = "r...
[ "numpy.ravel", "json.dumps", "api.infrastructure.mysql.connection.MySQLConnection", "traceback.format_exc", "datetime.datetime.now", "logging.getLogger" ]
[((160, 187), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (177, 187), False, 'import logging\n'), ((441, 484), 'api.infrastructure.mysql.connection.MySQLConnection', 'connection.MySQLConnection', (['self.results_db'], {}), '(self.results_db)\n', (467, 484), False, 'from api.infrastruct...
import unittest import numpy as np import numpy.testing as npt from uts import gradient class TestGradient(unittest.TestCase): def test_gradient_cfd_even(self): x = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) y = np.array([1, 4, 9, 16, 25, 36, 49, 64, 81]) result = gradient.cfd(x, y) de...
[ "unittest.main", "uts.gradient.csd", "numpy.testing.assert_almost_equal", "numpy.array", "uts.gradient.cfd" ]
[((1619, 1634), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1632, 1634), False, 'import unittest\n'), ((180, 217), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6, 7, 8, 9]'], {}), '([1, 2, 3, 4, 5, 6, 7, 8, 9])\n', (188, 217), True, 'import numpy as np\n'), ((230, 273), 'numpy.array', 'np.array', (['[1, 4, 9,...
""" LALinference posterior samples class and methods <NAME>, <NAME> """ import numpy as np import healpy as hp from scipy.stats import gaussian_kde from scipy import integrate, interpolate, random from astropy import units as u from astropy import constants as const from astropy.table import Table import h5py from bilb...
[ "astropy.cosmology.FlatLambdaCDM", "h5py.File", "numpy.random.seed", "numpy.sum", "astropy.constants.c.to", "numpy.power", "scipy.stats.gaussian_kde", "numpy.genfromtxt", "numpy.linspace", "scipy.interpolate.interp1d", "numpy.vstack", "numpy.sqrt" ]
[((699, 729), 'numpy.linspace', 'np.linspace', (['zmin', 'zmax', '(10000)'], {}), '(zmin, zmax, 10000)\n', (710, 729), True, 'import numpy as np\n'), ((1413, 1452), 'numpy.sqrt', 'np.sqrt', (['(Om * (1 + z) ** 3 + (1.0 - Om))'], {}), '(Om * (1 + z) ** 3 + (1.0 - Om))\n', (1420, 1452), True, 'import numpy as np\n'), ((5...
import math import h5py import matplotlib.pylab as plt import numpy as np from matplotlib import rc # rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) # for Palatino and other serif fonts use: rc('font',**{'family':'serif','serif':['Palatino']}) rc('text', usetex=True) plt.rcParams['figure.dpi'] = 100...
[ "matplotlib.rc", "numpy.meshgrid", "h5py.File", "math.sqrt", "numpy.copy", "math.ceil", "numpy.linspace", "numpy.squeeze", "matplotlib.pylab.figure" ]
[((210, 266), 'matplotlib.rc', 'rc', (['"""font"""'], {}), "('font', **{'family': 'serif', 'serif': ['Palatino']})\n", (212, 266), False, 'from matplotlib import rc\n'), ((263, 286), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (265, 286), False, 'from matplotlib import rc\n...
import torch import simplecv._impl.metric.function as mF from simplecv.util.logger import get_console_file_logger import logging import prettytable as pt import numpy as np from scipy import sparse class THMeanIntersectionOverUnion(object): def __init__(self, num_classes): self.num_classes = num_classes ...
[ "numpy.sum", "numpy.ones_like", "simplecv.util.logger.get_console_file_logger", "scipy.sparse.coo_matrix", "prettytable.PrettyTable", "torch.zeros", "numpy.diag" ]
[((758, 774), 'prettytable.PrettyTable', 'pt.PrettyTable', ([], {}), '()\n', (772, 774), True, 'import prettytable as pt\n'), ((1320, 1383), 'scipy.sparse.coo_matrix', 'sparse.coo_matrix', (['(num_classes, num_classes)'], {'dtype': 'np.float32'}), '((num_classes, num_classes), dtype=np.float32)\n', (1337, 1383), False,...
# coding: utf-8 import os import re import numpy as np import pandas as pd import seaborn as sns from kerasy.utils import findLowerUpper # set the `plotly.io.orca.config.executable` property to the full path of your orca executable. # If you use `environment.yml` to create anaconda environment, this command automatica...
[ "kerasy.utils.findLowerUpper", "seaborn.clustermap", "pandas.read_csv", "numpy.log2", "re.findall", "numpy.where", "numpy.log10", "os.path.join", "plotly.express.scatter" ]
[((405, 498), 're.findall', 're.findall', ([], {'pattern': 'f"""\\\\/.*\\\\/versions\\\\/{conda_env_name}\\\\/"""', 'string': 'plotly.__path__[0]'}), "(pattern=f'\\\\/.*\\\\/versions\\\\/{conda_env_name}\\\\/', string=plotly\n .__path__[0])\n", (415, 498), False, 'import re\n'), ((548, 583), 'os.path.join', 'os.path...
import numpy as np from tabulate import tabulate class TruncatedDisplay(object): """ Performs similar functionality as less command in unix OS where stdout is chunked up into a set number of lines and user needs to provide input to continue displaying lines """ def __init__(self, num_lines=10): ...
[ "tabulate.tabulate", "numpy.ndenumerate" ]
[((1122, 1177), 'tabulate.tabulate', 'tabulate', (['printable_df'], {'headers': '"""keys"""', 'tablefmt': '"""psql"""'}), "(printable_df, headers='keys', tablefmt='psql')\n", (1130, 1177), False, 'from tabulate import tabulate\n'), ((1908, 1927), 'numpy.ndenumerate', 'np.ndenumerate', (['row'], {}), '(row)\n', (1922, 1...
import numpy as np try: from scipy.cluster.hierarchy import DisjointSet except ImportError: pass from .common import Benchmark class Bench(Benchmark): params = [[100, 1000, 10000]] param_names = ['n'] def setup(self, n): # Create random edges rng = np.random.RandomState(seed=0) ...
[ "numpy.unique", "numpy.random.RandomState", "scipy.cluster.hierarchy.DisjointSet" ]
[((290, 319), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': '(0)'}), '(seed=0)\n', (311, 319), True, 'import numpy as np\n'), ((393, 414), 'numpy.unique', 'np.unique', (['self.edges'], {}), '(self.edges)\n', (402, 414), True, 'import numpy as np\n'), ((443, 466), 'scipy.cluster.hierarchy.DisjointSe...
import numpy as np from cv2 import cv2 import os import pafy import argparse from tensorflow.keras.models import load_model output_directory = 'Youtube_Videos' os.makedirs(output_directory, exist_ok = True) categories = ["Biking", "Drumming", "Basketball", "Diving","Billiards","HorseRiding","Mixing","PushUps","Skiin...
[ "cv2.cv2.VideoCapture", "tensorflow.keras.models.load_model", "os.makedirs", "argparse.ArgumentParser", "pafy.new", "numpy.zeros", "numpy.expand_dims", "cv2.cv2.resize", "numpy.argsort" ]
[((161, 205), 'os.makedirs', 'os.makedirs', (['output_directory'], {'exist_ok': '(True)'}), '(output_directory, exist_ok=True)\n', (172, 205), False, 'import os\n'), ((2394, 2431), 'tensorflow.keras.models.load_model', 'load_model', (['"""model_VGG16_CNN_LSTM.h5"""'], {}), "('model_VGG16_CNN_LSTM.h5')\n", (2404, 2431),...
"""Robust influence maximization. This module implements an algorithm for robust influence maximiztion. """ import sys import argparse import ast import numpy as np import robinmax_bac as bac import robinmax_graph as gr import robinmax_cover_generator as cg import robinmax_utils as util import robinmax_heuristics a...
[ "numpy.random.seed", "argparse.ArgumentParser", "robinmax_graph.read_text_graph", "time.time", "robinmax_cover_generator.generate_minimal_covers", "robinmax_heuristics.random_heuristic", "numpy.mean", "robinmax_utils.epsilon", "robinmax_heuristics.two_opt_heuristic", "robinmax_bac.bac_restart" ]
[((5220, 5239), 'robinmax_utils.epsilon', 'util.epsilon', (['graph'], {}), '(graph)\n', (5232, 5239), True, 'import robinmax_utils as util\n'), ((11735, 11832), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': "('Branch-and-Cut for ' + 'robust influence maximization.')"}), "(description='Branc...
import cv2 import os import numpy as np import tensorflow as tf import random def brightness_level(files,path): count=1 while(count <= (len(files)//4)): image=random.choice(files) img = cv2.imread(os.path.join(path,image)) increment=1 while(increment<=2): file_path =...
[ "tensorflow.keras.preprocessing.image.random_brightness", "cv2.imwrite", "random.choice", "numpy.array", "os.path.join" ]
[((176, 196), 'random.choice', 'random.choice', (['files'], {}), '(files)\n', (189, 196), False, 'import random\n'), ((222, 247), 'os.path.join', 'os.path.join', (['path', 'image'], {}), '(path, image)\n', (234, 247), False, 'import os\n'), ((388, 451), 'tensorflow.keras.preprocessing.image.random_brightness', 'tf.kera...
import matplotlib.pyplot as plt from collections import Counter import numpy as np import pandas as pd # USe LaTeX # import matplotlib # matplotlib.rcParams['text.usetex'] = True with open("data/ex2") as f: data = f.readlines() ## Convert to int data = [int(d) for d in data] ## Old stuff - dont use. # plt.plot(...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.axvline", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.hist", "pandas.read_csv", "numpy.std", "matplotlib.pyplot.bar", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "numpy.mean", "numpy.exp", "numpy.linspace", ...
[((521, 534), 'collections.Counter', 'Counter', (['data'], {}), '(data)\n', (528, 534), False, 'from collections import Counter\n'), ((692, 756), 'matplotlib.pyplot.bar', 'plt.bar', (['indexes', 'vals', 'width'], {'label': '"""Experimental Distribution"""'}), "(indexes, vals, width, label='Experimental Distribution')\n...
# %% import packages import warnings import numpy as np import pandas as pd from autokeras import StructuredDataRegressor from dask import delayed, compute from dask.distributed import Client from autogluon import TabularPrediction as task from ngboost import NGBRegressor from pydfs_lineup_optimizer import get_optimi...
[ "pandas.DataFrame", "dask.distributed.Client", "pydfs_lineup_optimizer.get_optimizer", "numpy.random.seed", "warnings.simplefilter", "autokeras.StructuredDataRegressor", "autogluon.TabularPrediction.Dataset", "sklearn.metrics.mean_absolute_error", "sklearn.preprocessing.MaxAbsScaler", "ngboost.NGB...
[((29254, 29262), 'dask.distributed.Client', 'Client', ([], {}), '()\n', (29260, 29262), False, 'from dask.distributed import Client\n'), ((3412, 3529), 'sqlalchemy.create_engine', 'create_engine', (['"""postgresql://username:password@pga-postgresql.cxmbk6ooy1lu.us-east-1.rds.amazonaws.com/pga"""'], {}), "(\n 'postg...
#!/usr/bin/env python3 import asyncio import json import keras.preprocessing import numpy as np import re import spacy import sys import tensorflow as tf from pathlib import Path from sklearn.feature_extraction.text import TfidfVectorizer from spacy import displacy from spacy.matcher import Matcher from textblob import...
[ "warnings.filterwarnings", "sklearn.feature_extraction.text.TfidfVectorizer", "spacy.matcher.Matcher", "time.perf_counter", "json.dumps", "spacy.load", "pathlib.Path", "textblob.TextBlob", "numpy.dot", "re.sub", "spacy.displacy.render", "re.compile" ]
[((347, 402), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'UserWarning'}), "('ignore', category=UserWarning)\n", (370, 402), False, 'import warnings\n'), ((5330, 5349), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (5347, 5349), False, 'import time\n'), ((5410, 54...
import numpy as np from ._ReadCDF import _ReadCDF import DateTimeTools as TT import DateTimeTools as TT def ReadDef(Date): ''' Reads the 'def' position (l2) files for a given date ''' #read the CDF file data,meta = _ReadCDF(Date,'def') if data is None: return None #create an output array dtype = [ ('Da...
[ "DateTimeTools.ContUT", "numpy.float32", "numpy.recarray", "DateTimeTools.CDFEpochtoDate", "numpy.where" ]
[((1969, 1996), 'numpy.recarray', 'np.recarray', (['n'], {'dtype': 'dtype'}), '(n, dtype=dtype)\n', (1980, 1996), True, 'import numpy as np\n'), ((2681, 2713), 'DateTimeTools.CDFEpochtoDate', 'TT.CDFEpochtoDate', (["data['epoch']"], {}), "(data['epoch'])\n", (2698, 2713), True, 'import DateTimeTools as TT\n'), ((2725, ...
#<NAME> #<NAME> from numpy import asarray from numpy import exp from numpy import sqrt from numpy import cos from numpy import e from numpy import pi from numpy import argsort from numpy.random import randn from numpy.random import rand from numpy.random import seed def objective(v): x, y = v return (x*...
[ "numpy.argsort", "numpy.asarray", "numpy.random.seed" ]
[((1561, 1568), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (1565, 1568), False, 'from numpy.random import seed\n'), ((1579, 1614), 'numpy.asarray', 'asarray', (['[[-5.0, 5.0], [-5.0, 5.0]]'], {}), '([[-5.0, 5.0], [-5.0, 5.0]])\n', (1586, 1614), False, 'from numpy import asarray\n'), ((1021, 1036), 'numpy.args...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import datetime import time from visdom import Visdom class VisPlot: """Plots to Visdom""" def __init__(self, env='main'): try: self.vis = Visdom() # global except ConnectionError as e: ...
[ "torch.nn.Sequential", "visdom.Visdom", "torch.nn.ConvTranspose1d", "numpy.array", "torch.is_tensor", "torch.zeros", "torch.no_grad", "datetime.datetime.now" ]
[((6294, 6312), 'torch.zeros', 'torch.zeros', (['shape'], {}), '(shape)\n', (6305, 6312), False, 'import torch\n'), ((11258, 11277), 'torch.nn.Sequential', 'nn.Sequential', (['*res'], {}), '(*res)\n', (11271, 11277), True, 'import torch.nn as nn\n'), ((11317, 11349), 'torch.zeros', 'torch.zeros', (['self.original_shape...
# Copyright (c) 2020, <NAME> # See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE> ### NOTE: The functions in this file are intended purely for inclusion in the AsymptoticBondData ### class. In particular, they assume that the first argument, `self` is an instance of ### AsymptoticBondDa...
[ "numpy.sum", "spinsfast.map2salm", "math.sqrt", "numpy.empty", "scipy.interpolate.CubicSpline", "spherical_functions.constant_from_ell_0_mode", "numpy.zeros", "spherical_functions.LM_index", "spherical_functions.Modes", "numpy.linalg.norm", "spherical_functions.SWSH_modes.Modes", "numpy.sqrt" ...
[((2543, 2584), 'numpy.empty', 'np.empty', (['P_restricted.shape'], {'dtype': 'float'}), '(P_restricted.shape, dtype=float)\n', (2551, 2584), True, 'import numpy as np\n'), ((13369, 13399), 'numpy.linalg.norm', 'np.linalg.norm', (['boost_velocity'], {}), '(boost_velocity)\n', (13383, 13399), True, 'import numpy as np\n...
#!/usr/bin/env python3 # Copyright 2014 <NAME>, <EMAIL> # # This file is part of the gammatone toolkit, and is licensed under the 3-clause # BSD license: https://github.com/detly/gammatone/blob/master/COPYING import nose import numpy as np import scipy.io from pkg_resources import resource_stream import gammatone.fil...
[ "pkg_resources.resource_stream", "nose.main", "numpy.allclose" ]
[((1872, 1883), 'nose.main', 'nose.main', ([], {}), '()\n', (1881, 1883), False, 'import nose\n'), ((620, 664), 'pkg_resources.resource_stream', 'resource_stream', (['__name__', 'REF_DATA_FILENAME'], {}), '(__name__, REF_DATA_FILENAME)\n', (635, 664), False, 'from pkg_resources import resource_stream\n'), ((1782, 1840)...
import numpy as np import tile import imageio CONTOUR_REGION_SIZE = 5 colormap = np.array( [ [ 47, 0, 135, ], [ 50, 0, 138, ], [ 53, 0, 140, ], [ 56, 0, 142, ], [ 59, 0, 144, ], [ 62, 0, 146, ], [ 65, 0, 148, ], [ 68, 0, 150, ], ...
[ "tile.TileMap", "numpy.zeros", "numpy.packbits", "numpy.ones", "numpy.where", "numpy.array", "numpy.linspace", "imageio.imwrite" ]
[((3820, 3876), 'numpy.zeros', 'np.zeros', (['(16, CONTOUR_REGION_SIZE, CONTOUR_REGION_SIZE)'], {}), '((16, CONTOUR_REGION_SIZE, CONTOUR_REGION_SIZE))\n', (3828, 3876), True, 'import numpy as np\n'), ((3891, 3991), 'numpy.array', 'np.array', (['[[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0,...
# general # ======= # # ... gerneal purpose tasks and helper functions from affine import Affine import geopandas as gp import luigi import math import numpy as np import os from rasterio import features import xarray as xr # helper functions ------------------------------------------------ def bbox_to_latlon(bbox,...
[ "os.makedirs", "luigi.FloatParameter", "numpy.asarray", "affine.Affine.translation", "affine.Affine.scale", "math.sin", "numpy.arange", "math.cos", "luigi.LocalTarget", "xarray.DataArray", "luigi.Parameter", "luigi.ListParameter", "geopandas.read_file" ]
[((634, 670), 'numpy.arange', 'np.arange', (['(lon1 + res / 2)', 'lon2', 'res'], {}), '(lon1 + res / 2, lon2, res)\n', (643, 670), True, 'import numpy as np\n'), ((680, 716), 'numpy.arange', 'np.arange', (['(lat1 + res / 2)', 'lat2', 'res'], {}), '(lat1 + res / 2, lat2, res)\n', (689, 716), True, 'import numpy as np\n'...
import torch import numpy as np from .exp import VaeSmExperiment import scanpy as sc import pandas as pd def define_exp( x_fname, s_fname, model_params = { 'x_dim': 100, 'z_dim': 10, 'enc_z_h_dim': 50, 'enc_d_h_dim': 50, 'dec_z_h_dim': 50, 'num_enc_z_lay...
[ "pandas.DataFrame", "numpy.isin", "numpy.quantile", "scanpy.tl.umap", "numpy.sum", "scanpy.tl.score_genes", "numpy.log2", "scanpy.pp.neighbors", "numpy.cumsum", "numpy.max", "numpy.arange", "numpy.loadtxt", "pandas.Categorical", "numpy.random.choice", "numpy.argwhere" ]
[((1334, 1385), 'scanpy.pp.neighbors', 'sc.pp.neighbors', (['adata'], {'use_rep': 'key', 'n_neighbors': '(30)'}), '(adata, use_rep=key, n_neighbors=30)\n', (1349, 1385), True, 'import scanpy as sc\n'), ((1390, 1407), 'scanpy.tl.umap', 'sc.tl.umap', (['adata'], {}), '(adata)\n', (1400, 1407), True, 'import scanpy as sc\...
import argparse import cv2 import math import time import numpy as np import util from config_reader import config_reader from scipy.ndimage.filters import gaussian_filter from model import get_testing_model # find connection in the specified sequence, center 29 is in the position 15 limbSeq = [[2, 3], [2, 6], [3, 4]...
[ "argparse.ArgumentParser", "cv2.VideoWriter_fourcc", "math.atan2", "numpy.ones", "cv2.warpAffine", "numpy.mean", "cv2.VideoWriter", "cv2.imshow", "numpy.multiply", "model.get_testing_model", "cv2.cvtColor", "cv2.imwrite", "numpy.logical_and.reduce", "numpy.linspace", "cv2.destroyAllWindo...
[((1337, 1385), 'numpy.zeros', 'np.zeros', (['(oriImg.shape[0], oriImg.shape[1], 19)'], {}), '((oriImg.shape[0], oriImg.shape[1], 19))\n', (1345, 1385), True, 'import numpy as np\n'), ((1400, 1448), 'numpy.zeros', 'np.zeros', (['(oriImg.shape[0], oriImg.shape[1], 38)'], {}), '((oriImg.shape[0], oriImg.shape[1], 38))\n'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 7 14:59:12 2018 @author: abrantesasf """ import numpy as np array1 = np.array([1, 2, 3, 4, 5]) array1 array2 = np.array([2, 3, 4, 5, 6]) array2 # Multiplicação vetorial dos arrays: array1 * array2 # Dot product dos arrays np.dot(array1, array2...
[ "numpy.dot", "numpy.array" ]
[((143, 168), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (151, 168), True, 'import numpy as np\n'), ((186, 211), 'numpy.array', 'np.array', (['[2, 3, 4, 5, 6]'], {}), '([2, 3, 4, 5, 6])\n', (194, 211), True, 'import numpy as np\n'), ((299, 321), 'numpy.dot', 'np.dot', (['array1', 'arra...
import random import string import re import html import cv2 # Not actually necessary if you just want to create an image. import numpy as np from PIL import ImageFont, ImageDraw, Image import h5py def generate(text, filepath, fontpath): height = 100 width = 1050 blank_image = np.zeros((height, width, 3...
[ "numpy.sum", "random.shuffle", "numpy.floor", "numpy.ones", "cv2.transpose", "cv2.warpAffine", "numpy.histogram", "numpy.arange", "cv2.erode", "cv2.getRotationMatrix2D", "cv2.filter2D", "cv2.dilate", "cv2.cvtColor", "cv2.imwrite", "cv2.copyMakeBorder", "re.escape", "numpy.apply_along...
[((2794, 2861), 're.compile', 're.compile', (['"""[\\\\-\\\\˗\\\\֊\\\\‐\\\\‑\\\\‒\\\\–\\\\—\\\\⁻\\\\₋\\\\−\\\\﹣\\\\-]"""', 're.UNICODE'], {}), "('[\\\\-\\\\˗\\\\֊\\\\‐\\\\‑\\\\‒\\\\–\\\\—\\\\⁻\\\\₋\\\\−\\\\﹣\\\\-]', re.UNICODE)\n", (2804, 2861), False, 'import re\n'), ((3080, 3112), 're.compile', 're.compile', (['"""[¶...
#cython: profile=True #cython: wraparound=False #cython: boundscheck=False #cython: initializedcheck=False import cython """ Module for creating boundary conditions. Imported in mprans.SpatialTools.py """ import sys import numpy as np from proteus import AuxiliaryVariables from proteus.ctransportCoefficients import (...
[ "cython.boundscheck", "numpy.empty", "numpy.zeros", "cython.initializedcheck", "proteus.ctransportCoefficients.smoothedHeaviside", "numpy.array", "cython.declare", "numpy.dot", "cython.wraparound" ]
[((26820, 26845), 'cython.boundscheck', 'cython.boundscheck', (['(False)'], {}), '(False)\n', (26838, 26845), False, 'import cython\n'), ((26847, 26871), 'cython.wraparound', 'cython.wraparound', (['(False)'], {}), '(False)\n', (26864, 26871), False, 'import cython\n'), ((26873, 26903), 'cython.initializedcheck', 'cyth...
import os import sys import time import torch import random import argparse import numpy as np from src.GAL import * parser = argparse.ArgumentParser(description=' ') parser.add_argument('--cuda', type=int, default=-1, help='Which GPU to run on (-1 for using CPU, 9 for not specifying which GPU to use.)') ...
[ "os.mkdir", "numpy.random.seed", "argparse.ArgumentParser", "os.path.isdir", "torch.manual_seed", "time.strftime", "torch.cuda.manual_seed_all", "random.seed", "torch.cuda.is_available", "torch.device", "torch.cuda.current_device", "torch.cuda.get_device_name" ]
[((138, 178), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""" """'}), "(description=' ')\n", (161, 178), False, 'import argparse\n'), ((2491, 2516), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2514, 2516), False, 'import torch\n'), ((2791, 2853), 'torch.devic...
""" Classes for mass-unvariate tuning analyses """ from numpy import array, sum, inner, dot, angle, abs, exp, asarray from thunder.rdds.series import Series from thunder.utils.common import loadMatVar class TuningModel(object): """ Base class for loading and fitting tuning models. Parameters ------...
[ "numpy.sum", "numpy.abs", "numpy.angle", "numpy.asarray", "thunder.utils.common.loadMatVar", "numpy.array", "numpy.exp", "numpy.dot" ]
[((2497, 2505), 'numpy.angle', 'angle', (['r'], {}), '(r)\n', (2502, 2505), False, 'from numpy import array, sum, inner, dot, angle, abs, exp, asarray\n'), ((2904, 2920), 'numpy.asarray', 'asarray', (['[mu, k]'], {}), '([mu, k])\n', (2911, 2920), False, 'from numpy import array, sum, inner, dot, angle, abs, exp, asarra...
import numpy as np def test_labeling_and_statistics(): from skimage.io import imread image = imread("napari_pyclesperanto_assistant/data/blobs.tif") from napari_pyclesperanto_assistant._napari_cle_functions import voronoi_otsu_labeling labels = voronoi_otsu_labeling(image) from napari_pyclespera...
[ "napari_pyclesperanto_assistant._convert_to_numpy.convert_labels_to_image", "napari_pyclesperanto_assistant._convert_to_numpy.reset_brightness_contrast", "napari_pyclesperanto_assistant._convert_to_numpy.set_voxel_size", "napari_pyclesperanto_assistant._convert_to_numpy.auto_brightness_contrast_all_images", ...
[((102, 157), 'skimage.io.imread', 'imread', (['"""napari_pyclesperanto_assistant/data/blobs.tif"""'], {}), "('napari_pyclesperanto_assistant/data/blobs.tif')\n", (108, 157), False, 'from skimage.io import imread\n'), ((264, 292), 'napari_pyclesperanto_assistant._napari_cle_functions.voronoi_otsu_labeling', 'voronoi_ot...
from os.path import join from multiprocessing import cpu_count import pytest from Tests import save_validation_path as save_path from numpy import exp, sqrt, pi, meshgrid, zeros, real from numpy.testing import assert_array_almost_equal from pyleecan.Classes.Simu1 import Simu1 from pyleecan.Classes.InputCurrent impo...
[ "pyleecan.Classes.ForceMT.ForceMT", "numpy.meshgrid", "pyleecan.Classes.InputCurrent.InputCurrent", "numpy.zeros", "multiprocessing.cpu_count", "numpy.exp", "pyleecan.Classes.Simu1.Simu1", "pyleecan.Classes.Output.Output", "numpy.testing.assert_array_almost_equal", "os.path.join", "numpy.sqrt" ]
[((984, 1031), 'pyleecan.Classes.Simu1.Simu1', 'Simu1', ([], {'name': '"""FEMM_periodicity"""', 'machine': 'IPMSM_A'}), "(name='FEMM_periodicity', machine=IPMSM_A)\n", (989, 1031), False, 'from pyleecan.Classes.Simu1 import Simu1\n'), ((1284, 1370), 'pyleecan.Classes.InputCurrent.InputCurrent', 'InputCurrent', ([], {'I...
""" Usage: tpch-pyarrow-p.py <num> Options: -h --help Show this screen. --version Show version. """ import io import itertools import os from multiprocessing import Pool from typing import Any, List import numpy as np import pyarrow as pa from contexttimer import Timer from docopt import docopt from pya...
[ "io.BytesIO", "docopt.docopt", "pyarrow.csv.ReadOptions", "pyarrow.concat_tables", "numpy.linspace", "sqlalchemy.create_engine", "contexttimer.Timer", "itertools.repeat" ]
[((452, 517), 'numpy.linspace', 'np.linspace', (['(0)', '(60000000)'], {'num': '(count + 1)', 'endpoint': '(True)', 'dtype': 'int'}), '(0, 60000000, num=count + 1, endpoint=True, dtype=int)\n', (463, 517), True, 'import numpy as np\n'), ((1370, 1389), 'sqlalchemy.create_engine', 'create_engine', (['conn'], {}), '(conn)...
import sqlite3 import numpy as np def get_prof(prof_identifier): """ Returns all professors that match the identifier entered in the query """ #Fetching professor from DB acc to query conn = sqlite3.connect('./db.sqlite3') cursor = conn.cursor() cursor.execute("SELECT * FROM professor WHERE...
[ "numpy.array", "numpy.mean", "sqlite3.connect" ]
[((212, 243), 'sqlite3.connect', 'sqlite3.connect', (['"""./db.sqlite3"""'], {}), "('./db.sqlite3')\n", (227, 243), False, 'import sqlite3\n'), ((598, 629), 'sqlite3.connect', 'sqlite3.connect', (['"""./db.sqlite3"""'], {}), "('./db.sqlite3')\n", (613, 629), False, 'import sqlite3\n'), ((984, 1015), 'sqlite3.connect', ...
# SAMPLE USAGE: # python3 step2_featureSelction_regression.py # before running, install all packages in requirement.txt import sys sys.path.append('../..') import operator import argparse import numpy as np import sklearn.linear_model from sklearn.metrics import mean_squared_error, r2_score from sklearn.feature_sele...
[ "sklearn.preprocessing.StandardScaler", "argparse.ArgumentParser", "pandas.read_csv", "sklearn.tree.DecisionTreeClassifier", "numpy.mean", "sklearn.svm.SVC", "numpy.unique", "sys.path.append", "statsmodels.stats.outliers_influence.variance_inflation_factor", "numpy.std", "sklearn.gaussian_proces...
[((133, 157), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (148, 157), False, 'import sys\n'), ((1195, 1221), 'sklearn.decomposition.PCA', 'PCA', (['target_num'], {'copy': '(True)'}), '(target_num, copy=True)\n', (1198, 1221), False, 'from sklearn.decomposition import PCA\n'), ((2505, 251...
import cv2 import numpy as np def get_amplified_image(image_path, amplified_image_path, factor=2): image = cv2.imread(image_path) height, width, channels = image.shape amplified_image = np.zeros((height,width,3), np.uint8) for i in range(0, height): for j in range(0,width): amplifi...
[ "cv2.imread", "numpy.zeros", "cv2.imwrite" ]
[((113, 135), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (123, 135), False, 'import cv2\n'), ((200, 238), 'numpy.zeros', 'np.zeros', (['(height, width, 3)', 'np.uint8'], {}), '((height, width, 3), np.uint8)\n', (208, 238), True, 'import numpy as np\n'), ((524, 574), 'cv2.imwrite', 'cv2.imwrite'...
"""/app/routes.py Description: Route definition for constellation generator Project: Fauxstrology Author: <NAME> Date: 12/7/2019 """ #=== Start imports ===# # third party from flask import current_app, jsonify, request from textgenrnn import textgenrnn from imageai.Prediction import ImagePrediction import numpy as ...
[ "cv2.GaussianBlur", "numpy.arctan2", "time.strftime", "flask.jsonify", "os.path.join", "flask.request.args.get", "cv2.cvtColor", "cv2.imwrite", "numpy.append", "io.BytesIO", "cv2.circle", "datetime.strptime", "imutils.grab_contours", "os.getcwd", "cv2.threshold", "cv2.moments", "nump...
[((524, 551), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (541, 551), False, 'import logging\n'), ((596, 618), 'flask.request.args.get', 'request.args.get', (['"""bd"""'], {}), "('bd')\n", (612, 618), False, 'from flask import current_app, jsonify, request\n'), ((1666, 1685), 'numpy.ar...
''' (c) University of Liverpool 2019 All rights reserved. @author: neilswainston ''' # pylint: disable=invalid-name # pylint: disable=ungrouped-imports import math import random import matplotlib from numpy import dot import matplotlib.pyplot as plt def step_function(x): '''step_function.''' return 1 if x...
[ "math.exp", "matplotlib.pyplot.show", "matplotlib.patches.Rectangle", "random.random", "matplotlib.pyplot.gca", "numpy.dot" ]
[((2416, 2513), 'matplotlib.patches.Rectangle', 'matplotlib.patches.Rectangle', (['(x - 0.5, y - 0.5)', '(1)', '(1)'], {'hatch': 'hatch', 'fill': '(False)', 'color': 'color'}), '((x - 0.5, y - 0.5), 1, 1, hatch=hatch, fill=\n False, color=color)\n', (2444, 2513), False, 'import matplotlib\n'), ((2858, 2867), 'matplo...
""" Create Nested Pipelines in Neuraxle ================================================ You can create pipelines within pipelines using the composition design pattern. This demonstrates how to create pipelines within pipelines, and how to access the steps and their attributes in the nested pipelines. For more info,...
[ "numpy.random.seed", "sklearn.preprocessing.StandardScaler", "neuraxle.base.Identity", "numpy.random.randint", "sklearn.decomposition.PCA" ]
[((1451, 1469), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1465, 1469), True, 'import numpy as np\n'), ((1478, 1513), 'numpy.random.randint', 'np.random.randint', (['(5)'], {'size': '(100, 5)'}), '(5, size=(100, 5))\n', (1495, 1513), True, 'import numpy as np\n'), ((1584, 1600), 'sklearn.preproce...
# -*- coding: utf-8 -*- """ Created on Thu Mar 08 20:02:09 2018 @author: sarth """ import numpy as np import matplotlib.pyplot as plt from scipy import ndimage def order_disorder_separation(image, percentile, size): """ Seperates the input image into order and disorder regions using percentile_fil...
[ "numpy.zeros_like", "matplotlib.pyplot.show", "numpy.sum", "scipy.ndimage.percentile_filter", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.subplots" ]
[((1641, 1707), 'scipy.ndimage.percentile_filter', 'ndimage.percentile_filter', (['image', 'percentile', 'size'], {'mode': '"""reflect"""'}), "(image, percentile, size, mode='reflect')\n", (1666, 1707), False, 'from scipy import ndimage\n'), ((1900, 1920), 'numpy.zeros_like', 'np.zeros_like', (['image'], {}), '(image)\...
from collections import defaultdict from graphviz import Digraph import numpy as np class BayesNet: def __init__(self, rvs): self.k = len(rvs) self.rvs = rvs self.G = None self.Grev = None def add_edges(self, edges): self.G = edges Grev = defaultdict(list) ...
[ "collections.defaultdict", "numpy.random.randint", "graphviz.Digraph" ]
[((1004, 1039), 'numpy.random.randint', 'np.random.randint', (['(2)'], {'size': '(100, 4)'}), '(2, size=(100, 4))\n', (1021, 1039), True, 'import numpy as np\n'), ((300, 317), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (311, 317), False, 'from collections import defaultdict\n'), ((681, 690), ...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import numpy as np import random from typing import List from .base_transform import BaseTransform from ...builder import TRANSFORMS @TRANSFORMS.register_module() class GroupFlip(BaseTransform): def __init__(self, flip...
[ "numpy.ascontiguousarray", "random.uniform" ]
[((1858, 1895), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['img[:, ::-1, :]'], {}), '(img[:, ::-1, :])\n', (1878, 1895), True, 'import numpy as np\n'), ((450, 474), 'random.uniform', 'random.uniform', (['(0.0)', '(1.0)'], {}), '(0.0, 1.0)\n', (464, 474), False, 'import random\n')]
import h5py import matplotlib.pyplot as plt from sklearn.neural_network import MLPRegressor from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler # doctest: +SKIP from sklearn.decomposition import PCA from sklearn.neural_netwo...
[ "h5py.File", "matplotlib.pyplot.show", "numpy.log", "matplotlib.pyplot.hist", "sklearn.preprocessing.StandardScaler", "numpy.median", "sklearn.model_selection.train_test_split", "numpy.abs", "numpy.std", "numpy.zeros", "numpy.hstack", "sklearn.neural_network.MLPClassifier" ]
[((512, 528), 'h5py.File', 'h5py.File', (['fname'], {}), '(fname)\n', (521, 528), False, 'import h5py\n'), ((611, 627), 'h5py.File', 'h5py.File', (['fname'], {}), '(fname)\n', (620, 627), False, 'import h5py\n'), ((711, 727), 'h5py.File', 'h5py.File', (['fname'], {}), '(fname)\n', (720, 727), False, 'import h5py\n'), (...
from collections import defaultdict, namedtuple from itertools import combinations import numpy as np from ._sitq import Sitq class Mips: def __init__(self, signature_size): """ Parameters ---------- signature_size: int The number of bits of a signature. """ ...
[ "numpy.empty", "numpy.clip", "collections.defaultdict", "numpy.argpartition", "numpy.argsort", "numpy.array", "collections.namedtuple", "numpy.vstack" ]
[((1072, 1110), 'collections.namedtuple', 'namedtuple', (['"""Item"""', "['name', 'vector']"], {}), "('Item', ['name', 'vector'])\n", (1082, 1110), False, 'from collections import defaultdict, namedtuple\n'), ((1403, 1445), 'numpy.array', 'np.array', (['[item.vector for item in _items]'], {}), '([item.vector for item i...
import numpy as np from static import * import xml.etree.ElementTree as ET from PIL import Image def onboarding(all_images_, all_breeds_): ''' Takes all images and breeds makes them ready for modeling args: all_images_: list of all images all_breeds_: list of all br...
[ "xml.etree.ElementTree.parse", "numpy.asarray", "PIL.Image.open", "numpy.append", "numpy.min", "numpy.array" ]
[((488, 513), 'numpy.array', 'np.array', (['[]'], {'dtype': '"""str"""'}), "([], dtype='str')\n", (496, 513), True, 'import numpy as np\n'), ((1794, 1830), 'numpy.asarray', 'np.asarray', (['normalized_image_vectors'], {}), '(normalized_image_vectors)\n', (1804, 1830), True, 'import numpy as np\n'), ((954, 1001), 'xml.e...
import math import numpy as np import pandas as pd #K均值 聚类 class K_means: def __init__(self,dataspath,k): ''' :param dataspath:数据的地址 :param k: 聚类簇数 ''' self.category = k self.model = {} self.datas = self.loadDataSet(dataspath) def loadDataSet(self,datas...
[ "math.pow", "math.sqrt", "pandas.read_csv", "numpy.mean", "numpy.array" ]
[((433, 455), 'pandas.read_csv', 'pd.read_csv', (['dataspath'], {}), '(dataspath)\n', (444, 455), True, 'import pandas as pd\n'), ((471, 502), 'numpy.array', 'np.array', (['data_set.iloc[:, 0:4]'], {}), '(data_set.iloc[:, 0:4])\n', (479, 502), True, 'import numpy as np\n'), ((767, 781), 'math.sqrt', 'math.sqrt', (['ans...
from learnml.linear_model import LinearRegression import numpy as np import numpy.testing import unittest class TestLinearRegression(unittest.TestCase): def test_fit_predict(self): X = np.array([[1], [2]]) y = np.array([1, 2]) lin_reg = LinearRegression() lin_reg.fit(X, y) ...
[ "unittest.main", "learnml.linear_model.LinearRegression", "numpy.array" ]
[((576, 591), 'unittest.main', 'unittest.main', ([], {}), '()\n', (589, 591), False, 'import unittest\n'), ((199, 219), 'numpy.array', 'np.array', (['[[1], [2]]'], {}), '([[1], [2]])\n', (207, 219), True, 'import numpy as np\n'), ((232, 248), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (240, 248), True, ...
"""Test schmidt_decomposition.""" import numpy as np from toqito.state_ops import schmidt_decomposition from toqito.states import basis, max_entangled def test_schmidt_decomp_max_ent(): """Schmidt decomposition of the 3-D maximally entangled state.""" singular_vals, u_mat, vt_mat = schmidt_decomposition(max_...
[ "toqito.states.basis", "numpy.testing.run_module_suite", "numpy.identity", "toqito.state_ops.schmidt_decomposition", "numpy.isclose", "numpy.array", "toqito.states.max_entangled", "numpy.kron", "numpy.linalg.norm", "numpy.all", "numpy.sqrt" ]
[((356, 370), 'numpy.identity', 'np.identity', (['(3)'], {}), '(3)\n', (367, 370), True, 'import numpy as np\n'), ((393, 407), 'numpy.identity', 'np.identity', (['(3)'], {}), '(3)\n', (404, 407), True, 'import numpy as np\n'), ((496, 529), 'numpy.isclose', 'np.isclose', (['expected_u_mat', 'u_mat'], {}), '(expected_u_m...
# -*- coding: utf-8 -*- """ Here is a three inputs runner. We make it for 3 inputs becuase mostly we run a function at different basis function order p, elements layout k and crazy coefficient c. <unittest> <unittests_P_Solvers> <test_No3_TIR>. <NAME> (C) Created on Mon Oct 29 15:38:46 2018 Aerodynamics, AE TU Del...
[ "matplotlib.pyplot.title", "os.remove", "tools.deprecated.serial_runners.INSTANCES.COMPONENTS.m_tir_tabular.M_TIR_Tabulate", "numpy.shape", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.tight_layout", "pandas.DataFrame", "matplotlib.pyplot.yticks", "tools.deprecat...
[((7034, 7094), 'screws.decorators.accepts.accepts', 'accepts', (['"""self"""', '(list, tuple)', '(list, tuple)', '(list, tuple)'], {}), "('self', (list, tuple), (list, tuple), (list, tuple))\n", (7041, 7094), False, 'from screws.decorators.accepts import accepts\n'), ((28490, 28513), 'os.remove', 'os.remove', (['"""sa...
#gen_matrix.py #Created by ImKe on 2020/3/1 #Copyright © 2020 ImKe. All rights reserved. import numpy as np import random import scipy.sparse as ss #generate a random matrix with shape n1*n2 and rank r to evaluate the algorithm def gen_matrix(n1, n2, r): np.random.seed(999) H = np.ones((n1,n2)) M = np.ra...
[ "numpy.random.seed", "numpy.ones", "numpy.unravel_index", "numpy.random.random", "scipy.sparse.csr_matrix" ]
[((262, 281), 'numpy.random.seed', 'np.random.seed', (['(999)'], {}), '(999)\n', (276, 281), True, 'import numpy as np\n'), ((290, 307), 'numpy.ones', 'np.ones', (['(n1, n2)'], {}), '((n1, n2))\n', (297, 307), True, 'import numpy as np\n'), ((509, 540), 'numpy.unravel_index', 'np.unravel_index', (['ind', '(n1, n2)'], {...
# Common library routines for the BCycle analysis import pandas as pd import numpy as np INPUT_DIR = '../input' def load_bikes(file=INPUT_DIR + '/bikes.csv'): ''' Load the bikes CSV file, converting column types INPUT: Filename to read (defaults to `../input/bikes.csv` RETURNS: Pandas dataframe conta...
[ "numpy.radians", "pandas.read_csv", "numpy.sin", "pandas.to_datetime", "numpy.cos", "pandas.concat", "numpy.sqrt" ]
[((2713, 2758), 'pandas.to_datetime', 'pd.to_datetime', (["df['date']"], {'format': '"""%Y-%m-%d"""'}), "(df['date'], format='%Y-%m-%d')\n", (2727, 2758), True, 'import pandas as pd\n'), ((4587, 4610), 'numpy.radians', 'np.radians', (['(lon2 - lon1)'], {}), '(lon2 - lon1)\n', (4597, 4610), True, 'import numpy as np\n')...
# -*- coding: utf-8 -*- """ Created on Tue Jan 26 10:03:34 2016 @author: <NAME> """ import numpy as np import os from copy import deepcopy import re import json from typing import List class StatsParams: """A class that implements the automated statistics of parameter files in text file format. A parame...
[ "json.dump", "os.path.abspath", "os.getcwd", "numpy.power", "os.path.exists", "numpy.zeros", "os.path.isfile", "numpy.array", "re.search", "numpy.sqrt", "os.path.join", "re.compile" ]
[((1366, 1377), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1375, 1377), False, 'import os\n'), ((2123, 2146), 'os.path.abspath', 'os.path.abspath', (['in_dir'], {}), '(in_dir)\n', (2138, 2146), False, 'import os\n'), ((2162, 2189), 'os.path.exists', 'os.path.exists', (['self.in_dir'], {}), '(self.in_dir)\n', (2176, 2...
# d2y/dt2 + 2*m*o*dy/dt + o2*y(t) = k*o2*u(t), y(t=0) = 0 & dy(t=0)/dt = 0 import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint from scipy.signal import step from scipy.signal import TransferFunction as tf from scipy.signal import StateSpace as ss ######################### # SIMULATI...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "scipy.signal.step", "matplotlib.pyplot.plot", "scipy.integrate.odeint", "matplotlib.pyplot.legend", "scipy.signal.StateSpace", "numpy.array", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "scipy.signal.TransferFu...
[((663, 690), 'numpy.linspace', 'np.linspace', (['(0.0)', '(10.0)', '(100)'], {}), '(0.0, 10.0, 100)\n', (674, 690), True, 'import numpy as np\n'), ((698, 726), 'scipy.integrate.odeint', 'odeint', (['mySys', '[0, 0]', 'tspan'], {}), '(mySys, [0, 0], tspan)\n', (704, 726), False, 'from scipy.integrate import odeint\n'),...
from typing import List, Tuple, Dict import numpy as np import tensorflow as tf class String2Tensor: _instance: 'String2Tensor' = None def __init__(self, node_label_max_chars: int, alphabet_string: str): self._node_label_max_chars = node_label_max_chars # "0" is PAD, "1" is UNK ...
[ "tensorflow.convert_to_tensor", "numpy.unique" ]
[((1091, 1144), 'numpy.unique', 'np.unique', (['string_tensor'], {'axis': '(0)', 'return_inverse': '(True)'}), '(string_tensor, axis=0, return_inverse=True)\n', (1100, 1144), True, 'import numpy as np\n'), ((1786, 1824), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['node_label_chars'], {}), '(node_label_ch...
""" create a function that returns True if vertex i and vertex j are connected in the graph represented by the input adjacency matrix A """ import numpy as np def isConnected(A: np.array, i: int, j: int) -> bool: paths = A # initialize the paths matrix to adjacency matrix A number_v...
[ "numpy.dot", "numpy.array", "numpy.sum" ]
[((1227, 1361), 'numpy.array', 'np.array', (['[[0, 1, 1, 0, 1, 0], [1, 0, 1, 1, 0, 1], [1, 1, 0, 1, 1, 0], [0, 1, 1, 0, 1,\n 0], [1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 0, 0]]'], {}), '([[0, 1, 1, 0, 1, 0], [1, 0, 1, 1, 0, 1], [1, 1, 0, 1, 1, 0], [0, 1,\n 1, 0, 1, 0], [1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 0, 0]])\n', (1235, ...
# -*- coding: UTF-8 -*- import re import numpy as np import pickle from sklearn.linear_model import LogisticRegression, RidgeClassifier from sklearn.metrics import f1_score, accuracy_score from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import TruncatedSVD import os from sklearn i...
[ "pickle.dump", "sklearn.feature_extraction.text.TfidfVectorizer", "unicodedata.numeric", "sklearn.metrics.f1_score", "pickle.load", "os.path.join", "sklearn.decomposition.TruncatedSVD", "os.path.dirname", "os.path.exists", "spacy.load", "numpy.append", "re.findall", "sklearn.svm.LinearSVC", ...
[((536, 551), 'nltk.stem.porter.PorterStemmer', 'PorterStemmer', ([], {}), '()\n', (549, 551), False, 'from nltk.stem.porter import PorterStemmer\n'), ((796, 821), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (811, 821), False, 'import os\n'), ((1078, 1094), 'nltk.tokenize.TweetTokenizer', ...
import os import numpy as np import torch import torchvision.transforms as transforms import torch.utils.data as data import matplotlib.pyplot as plt from functions import * from sklearn.preprocessing import OneHotEncoder, LabelEncoder from sklearn.metrics import accuracy_score import pandas as pd import pickle # set ...
[ "sklearn.preprocessing.OneHotEncoder", "sklearn.preprocessing.LabelEncoder", "torchvision.transforms.ToTensor", "pickle.load", "torch.cuda.is_available", "numpy.arange", "torch.device", "torchvision.transforms.Normalize", "os.path.join", "os.listdir", "torchvision.transforms.Resize" ]
[((1305, 1319), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (1317, 1319), False, 'from sklearn.preprocessing import OneHotEncoder, LabelEncoder\n'), ((1489, 1504), 'sklearn.preprocessing.OneHotEncoder', 'OneHotEncoder', ([], {}), '()\n', (1502, 1504), False, 'from sklearn.preprocessing impor...
import argparse import numpy as np from sklearn.metrics import accuracy_score import scipy.sparse as sps import torch as th import torch.optim as optim import torch.sparse as ths import torch.nn.functional as F import data import operators import sbm import utils parser = argparse.ArgumentParser() parser.add_argumen...
[ "argparse.ArgumentParser", "torch.argmax", "numpy.square", "torch.nn.functional.cross_entropy", "numpy.ones", "numpy.hstack", "sbm.generate", "numpy.mean", "torch.device", "torch.sparse.FloatTensor", "torch.sum", "numpy.vstack", "torch.from_numpy" ]
[((276, 301), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (299, 301), False, 'import argparse\n'), ((1364, 1398), 'numpy.mean', 'np.mean', (['x_train', '(0)'], {'keepdims': '(True)'}), '(x_train, 0, keepdims=True)\n', (1371, 1398), True, 'import numpy as np\n'), ((2102, 2123), 'sbm.generate'...
# -*- coding: utf-8 -*- ''' Copyright (c) 2021, MIT Interactive Robotics Group, PI <NAME>. Authors: <NAME>, <NAME>, <NAME>, <NAME> All rights reserved. ''' # Adapted from https://github.com/befelix/safe-exploration/blob/master/safe_exploration/environments.py import numpy as np from numpy.matlib import repmat from sci...
[ "yaml.load", "numpy.random.seed", "matplotlib.cm.get_cmap", "matplotlib.pyplot.clf", "numpy.clip", "matplotlib.pyplot.figure", "numpy.linalg.norm", "numpy.diag", "os.path.join", "scipy.interpolate.CubicHermiteSpline", "os.path.abspath", "numpy.set_printoptions", "numpy.copy", "numpy.random...
[((44994, 45011), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (45008, 45011), True, 'import numpy as np\n'), ((45058, 45105), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)', 'suppress': '(True)'}), '(precision=3, suppress=True)\n', (45077, 45105), True, 'import numpy as np\...
# -*- coding: utf8 -*- # Copyright 2019 JSALT2019 Distant Supervision Team # # 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 # # U...
[ "torch.nn.GRU", "logging.error", "numpy.ceil", "six.moves.range", "torch.nn.Conv2d", "torch.randn", "torch.nn.LSTM", "torch.nn.Linear", "numpy.array", "torch.nn.utils.rnn.pad_packed_sequence", "torch.arange", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.functional.max_pool2d", "tor...
[((2050, 2092), 'torch.arange', 'torch.arange', (['(0)', 'maxlen'], {'dtype': 'torch.int64'}), '(0, maxlen, dtype=torch.int64)\n', (2062, 2092), False, 'import torch\n'), ((14381, 14403), 'torch.randn', 'torch.randn', (['(2)', '(20)', '(81)'], {}), '(2, 20, 81)\n', (14392, 14403), False, 'import torch\n'), ((3561, 3585...
import numpy as np """ Assumed covariance matrix for cap-diameter, stem-height and stem-width to get a more realistic simulation of mushrooms (mushrooms with larger caps -> mushrooms with higer stems) The values are picked arbitrary and may be changed """ cov_mat = [[1, 0.5, 0.5], [0.5, 1, 0.7], ...
[ "pylab.hist", "pylab.show", "pylab.axis", "scipy.stats.norm.rvs", "scipy.linalg.cholesky", "pylab.ylabel", "numpy.zeros", "pylab.grid", "matplotlib.pyplot.subplots", "pylab.subplot", "numpy.array", "scipy.linalg.eigh", "pylab.xlabel", "matplotlib.pyplot.tight_layout", "pylab.plot", "nu...
[((2157, 2187), 'numpy.zeros', 'np.zeros', ([], {'shape': '(number, size)'}), '(shape=(number, size))\n', (2165, 2187), True, 'import numpy as np\n'), ((2934, 2947), 'scipy.linalg.eigh', 'eigh', (['cov_mat'], {}), '(cov_mat)\n', (2938, 2947), False, 'from scipy.linalg import eigh, cholesky\n'), ((3723, 3734), 'numpy.ar...
""" Noether (+matplotlib): easy graphing """ import argparse from collections import namedtuple import sys import numpy as np import matplotlib # noqa: F401 from matplotlib import animation, pyplot as plt from .matrix import Matrix, Vector # noqa: F401 import noether __all__ = """\ np matplotlib plt Vector Matrix...
[ "matplotlib.pyplot.show", "argparse.ArgumentParser", "astley.Lambda", "numpy.std", "matplotlib.pyplot.legend", "astley.parse", "collections.namedtuple", "numpy.linspace", "matplotlib.pyplot.subplots", "astley.arg" ]
[((487, 547), 'collections.namedtuple', 'namedtuple', (['"""GraphResult"""', '"""data label hasLimits isTimeFunc"""'], {}), "('GraphResult', 'data label hasLimits isTimeFunc')\n", (497, 547), False, 'from collections import namedtuple\n'), ((5400, 5495), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""noeth...
from energyOptimal.powerModel import powerModel from energyOptimal.performanceModel import performanceModel from energyOptimal.energyModel import energyModel from energyOptimal.monitor import monitorProcess from energyOptimal.dvfsModel import dvfsModel import _pickle as pickle from matplotlib import pyplot as plt impo...
[ "matplotlib.pyplot.title", "energyOptimal.energyModel.energyModel", "energyOptimal.performanceModel.performanceModel", "energyOptimal.powerModel.powerModel", "numpy.arange", "matplotlib.pyplot.tight_layout", "pandas.DataFrame", "energyOptimal.plotData.ax.view_init", "pandas.merge", "matplotlib.pyp...
[((382, 439), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'FutureWarning'}), "('ignore', category=FutureWarning)\n", (405, 439), False, 'import warnings\n'), ((818, 842), 'os.listdir', 'os.listdir', (['profile_path'], {}), '(profile_path)\n', (828, 842), False, 'import os\n'), ...
import math import numpy as np import scipy from python_reference import sparsemax from python_reference import sparsemax_loss class SparsemaxRegression: transform_type = 'sparsemax' def __init__(self, input_size, output_size, observations=None, regualizer=1e-1, learning_rate=1e-2, ...
[ "numpy.sum", "python_reference.sparsemax_loss.grad", "math.sqrt", "numpy.zeros", "numpy.linalg.norm", "scipy.stats.truncnorm.rvs", "numpy.dot" ]
[((812, 922), 'scipy.stats.truncnorm.rvs', 'scipy.stats.truncnorm.rvs', (['(-2)', '(2)'], {'size': '(self.input_size, self.output_size)', 'random_state': 'self.random_state'}), '(-2, 2, size=(self.input_size, self.output_size),\n random_state=self.random_state)\n', (837, 922), False, 'import scipy\n'), ((971, 1022),...
import abc import numpy as np from math import log from functools import lru_cache from copy import copy EXIT_POSITIONS = { "red": ((3, -3), (3, -2), (3, -1), (3, 0)), "green": ((-3, 3), (-2, 3), (-1, 3), (0, 3)), "blue": ((0, -3), (-1, -2), (-2, -1), (-3, 0)) } EXIT_CORNER = { "red": ((3, -3), (3, 0)...
[ "math.log", "numpy.dot", "functools.lru_cache", "copy.copy" ]
[((513, 534), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(10)'}), '(maxsize=10)\n', (522, 534), False, 'from functools import lru_cache\n'), ((1062, 1083), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(10)'}), '(maxsize=10)\n', (1071, 1083), False, 'from functools import lru_cache\n'), ((1663, 1684)...
# -*- coding: utf-8 -*- """ Created on Tue Jul 3 15:09:44 2018 @author: SilverDoe """ ''' The SciPy ndimage submodule is dedicated to image processing. 1. Input/Output, displaying images 2. Basic manipulations − Cropping, flipping, rotating, etc. 3. Image filtering − De-noising, sharpening, etc. 4. Image segmentat...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "scipy.ndimage.gaussian_filter", "numpy.zeros", "numpy.flipud", "scipy.ndimage.sobel", "numpy.hypot", "scipy.misc.imsave", "scipy.misc.face", "scipy.ndimage.rotate" ]
[((469, 480), 'scipy.misc.face', 'misc.face', ([], {}), '()\n', (478, 480), False, 'from scipy import misc, ndimage\n'), ((481, 567), 'scipy.misc.imsave', 'misc.imsave', (['"""E:\\\\Documents\\\\PythonProjects\\\\1_Basics\\\\DataForFiles\\\\array.jpg"""', 'f'], {}), "('E:\\\\Documents\\\\PythonProjects\\\\1_Basics\\\\D...
import os from pathlib import Path import numpy as np import time target_word_en = ['zui_da_liang_du', 'zui_xiao_liang_du'] MAX_LOOP = 2 # expand each .wav MAX_LOOP times MIN_STRETCH = 0.6 MAX_STRETCH = 1.1 src_path = '\\big_scale\\downsample\\' dst_path = '\\big_scale\\time_stretch\\' if (Path(src_path).exists()==F...
[ "os.mkdir", "os.popen", "time.sleep", "pathlib.Path", "numpy.random.randint", "os.listdir" ]
[((364, 384), 'os.listdir', 'os.listdir', (['src_path'], {}), '(src_path)\n', (374, 384), False, 'import os\n'), ((331, 349), 'os.mkdir', 'os.mkdir', (['src_path'], {}), '(src_path)\n', (339, 349), False, 'import os\n'), ((426, 444), 'os.mkdir', 'os.mkdir', (['dst_path'], {}), '(dst_path)\n', (434, 444), False, 'import...
#!/usr/bin/env python import numpy as np # polytope python module import pycapacity.pycapacity as capacity_solver # URDF parsing an kinematics from urdf_parser_py.urdf import URDF from pykdl_utils.kdl_kinematics import KDLKinematics import hrl_geom.transformations as trans class RobotSolver: base_link = "" ...
[ "pycapacity.pycapacity.manipulability_force", "numpy.array", "pykdl_utils.kdl_kinematics.KDLKinematics", "urdf_parser_py.urdf.URDF.from_parameter_server", "pycapacity.pycapacity.manipulability_velocity" ]
[((644, 672), 'urdf_parser_py.urdf.URDF.from_parameter_server', 'URDF.from_parameter_server', ([], {}), '()\n', (670, 672), False, 'from urdf_parser_py.urdf import URDF\n'), ((697, 758), 'pykdl_utils.kdl_kinematics.KDLKinematics', 'KDLKinematics', (['self.robot_urdf', 'self.base_link', 'self.tip_link'], {}), '(self.rob...
import numpy as np import healpy as hp #res = "2048" #res = "512" res = "4096" input_data_prefix = "/resource/data/MICE/maps/" output_data_prefix = "/arxiv/projects/MICEDataAnalysis/ForEuclidMeetingLausanne/spice_pcl_analysis/" ninv_file_name = input_data_prefix + res + "/mice_v2_0_shear_G_ninv.fits" # read the n_i...
[ "healpy.read_map", "numpy.where" ]
[((333, 369), 'healpy.read_map', 'hp.read_map', (['ninv_file_name'], {'field': '(0)'}), '(ninv_file_name, field=0)\n', (344, 369), True, 'import healpy as hp\n'), ((374, 410), 'healpy.read_map', 'hp.read_map', (['ninv_file_name'], {'field': '(1)'}), '(ninv_file_name, field=1)\n', (385, 410), True, 'import healpy as hp\...
import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib.colors as colors import numpy as np import pandas as pd def plot_pca_contribution(x, y, variance, num_components): """ Plots the contribution of PCA components towards variance ratio :return: """ fig = plt.figure(...
[ "matplotlib.pyplot.axhline", "matplotlib.pyplot.axvline", "matplotlib.pyplot.title", "pandas.DataFrame", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.ticker.PercentFormatter", "matplotlib.pyplot.ylabel",...
[((309, 335), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 6)'}), '(figsize=(8, 6))\n', (319, 335), True, 'import matplotlib.pyplot as plt\n'), ((370, 398), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {'color': '"""blue"""'}), "(x, y, color='blue')\n", (378, 398), True, 'import matplotlib.pypl...
import os, sys, numpy as np import config os.chdir('src/') # fix for data.init_dataset() np.random.seed(config.seed) import data, tfidf, models, sentimentanalysis from utils import utils, io # info = pandas.read_csv(config.dataset_dir + 'final_data.csv') dataset = data.init_dataset() # load model m = config.dataset...
[ "utils.io.read_book3", "numpy.stack", "numpy.random.seed", "utils.utils.format_score", "data.tokenlist_to_vector", "utils.utils.gen_table", "models.load_model", "numpy.append", "data.init_dataset", "data.decode_y", "sentimentanalysis.per_book", "os.chdir" ]
[((42, 58), 'os.chdir', 'os.chdir', (['"""src/"""'], {}), "('src/')\n", (50, 58), False, 'import os, sys, numpy as np\n'), ((90, 117), 'numpy.random.seed', 'np.random.seed', (['config.seed'], {}), '(config.seed)\n', (104, 117), True, 'import os, sys, numpy as np\n'), ((268, 287), 'data.init_dataset', 'data.init_dataset...
#! /usr/bin/env python3 import argparse import json import logging import logging.config import os import sys import time from concurrent import futures from datetime import datetime import numpy as np from sklearn.linear_model import LinearRegression from datetime import datetime import ServerSideExtension_pb2 as SS...
[ "os.mkdir", "argparse.ArgumentParser", "ServerSideExtension_pb2.FunctionRequestHeader", "os.path.join", "grpc.ssl_server_credentials", "ServerSideExtension_pb2.Dual", "os.path.exists", "concurrent.futures.ThreadPoolExecutor", "ServerSideExtension_pb2.Capabilities", "numpy.asarray", "os.path.real...
[((8973, 8998), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (8996, 8998), False, 'import argparse\n'), ((943, 955), 'ScriptEval_linearRegression.ScriptEval', 'ScriptEval', ([], {}), '()\n', (953, 955), False, 'from ScriptEval_linearRegression import ScriptEval\n'), ((1032, 1074), 'logging.co...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np def f(a,b,c): return a ** b - c x = np.ogrid[0:1:24j, 0:1:12j, 0:1:6j] values = f(x[0],x[1],x[2]) value = np.mean(values) print(value) exact = np.log(2) - 0.5 print(exact) differential = np.abs(exact - value) print(differential)
[ "numpy.mean", "numpy.abs", "numpy.log" ]
[((180, 195), 'numpy.mean', 'np.mean', (['values'], {}), '(values)\n', (187, 195), True, 'import numpy as np\n'), ((263, 284), 'numpy.abs', 'np.abs', (['(exact - value)'], {}), '(exact - value)\n', (269, 284), True, 'import numpy as np\n'), ((218, 227), 'numpy.log', 'np.log', (['(2)'], {}), '(2)\n', (224, 227), True, '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "<NAME>" __email__ = "<EMAIL>" from ddf_library.utils import generate_info, read_stage_file from pycompss.api.task import task from pycompss.functions.reduce import merge_reduce from pycompss.api.api import compss_wait_on, compss_delete_object from pycompss...
[ "numpy.divide", "ddf_library.utils.read_stage_file", "ddf_library.utils.generate_info", "numpy.median", "pycompss.api.task.task", "numpy.isnan", "time.time", "pycompss.api.api.compss_delete_object", "pycompss.api.api.compss_wait_on", "pandas.concat", "pycompss.functions.reduce.merge_reduce" ]
[((5578, 5613), 'pycompss.api.task.task', 'task', ([], {'returns': '(1)', 'data_input': 'FILE_IN'}), '(returns=1, data_input=FILE_IN)\n', (5582, 5613), False, 'from pycompss.api.task import task\n'), ((6019, 6034), 'pycompss.api.task.task', 'task', ([], {'returns': '(1)'}), '(returns=1)\n', (6023, 6034), False, 'from p...
#!/usr/bin/env python # -*- coding: utf-8 -*- from koheron import connect from spectrum import Spectrum import os import numpy as np import math import matplotlib matplotlib.use('TKAgg') from matplotlib import pyplot as plt host = os.getenv('HOST','192.168.1.100') client = connect(host, name='spectrum') spectrum =...
[ "matplotlib.pyplot.show", "matplotlib.use", "spectrum.Spectrum", "numpy.linspace", "koheron.connect", "numpy.log10", "os.getenv" ]
[((166, 189), 'matplotlib.use', 'matplotlib.use', (['"""TKAgg"""'], {}), "('TKAgg')\n", (180, 189), False, 'import matplotlib\n'), ((235, 269), 'os.getenv', 'os.getenv', (['"""HOST"""', '"""192.168.1.100"""'], {}), "('HOST', '192.168.1.100')\n", (244, 269), False, 'import os\n'), ((278, 308), 'koheron.connect', 'connec...
import codecademylib import numpy as np calorie_stats = np.genfromtxt('cereal.csv',delimiter=',') average_calories = np.mean(calorie_stats) print('maximum calories '+str(np.max(calorie_stats))) print('Minimum calories '+ str (np.min(calorie_stats))) print('average calories ' +str(average_calories)) calorie_stats_so...
[ "numpy.std", "numpy.genfromtxt", "numpy.percentile", "numpy.sort", "numpy.max", "numpy.mean", "numpy.min" ]
[((58, 100), 'numpy.genfromtxt', 'np.genfromtxt', (['"""cereal.csv"""'], {'delimiter': '""","""'}), "('cereal.csv', delimiter=',')\n", (71, 100), True, 'import numpy as np\n'), ((120, 142), 'numpy.mean', 'np.mean', (['calorie_stats'], {}), '(calorie_stats)\n', (127, 142), True, 'import numpy as np\n'), ((327, 349), 'nu...
import numpy as np import matplotlib.pyplot as plt """ Activation functions """ def slog_f(x): return (-1.)**(x < 0)*np.log(np.fabs(x)+1.) def slog_df(x): return 1./(np.fabs(x)+1.) def slog_af(y): return (-1.)**(y < 0)*(np.exp(np.fabs(y))-1.) def tanh_df(x): return 1. - np.tanh(x)**2. """ Activity pattern manipulatio...
[ "matplotlib.pyplot.show", "numpy.tanh", "numpy.random.randn", "matplotlib.pyplot.legend", "numpy.isnan", "numpy.fabs", "numpy.array", "numpy.arange" ]
[((3606, 3628), 'matplotlib.pyplot.legend', 'plt.legend', (["['l', 'g']"], {}), "(['l', 'g'])\n", (3616, 3628), True, 'import matplotlib.pyplot as plt\n'), ((3632, 3642), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3640, 3642), True, 'import matplotlib.pyplot as plt\n'), ((384, 416), 'numpy.random.randn', ...
""" This file define the function used in camera callibration """ import numpy as np import cv2 import matplotlib.image as mpimg import glob def calibrate_camera(dir_path): """ This function use the images in dir_path directy to calibrate the camera. Then save the result in calibrate_param file. :par...
[ "matplotlib.image.imread", "cv2.findChessboardCorners", "cv2.cvtColor", "numpy.zeros", "cv2.calibrateCamera", "glob.glob" ]
[((432, 451), 'glob.glob', 'glob.glob', (['dir_path'], {}), '(dir_path)\n', (441, 451), False, 'import glob\n'), ((464, 496), 'numpy.zeros', 'np.zeros', (['(9 * 6, 3)', 'np.float32'], {}), '((9 * 6, 3), np.float32)\n', (472, 496), True, 'import numpy as np\n'), ((990, 1061), 'cv2.calibrateCamera', 'cv2.calibrateCamera'...
import json import csv import numpy as np # import matplotlib.pyplot as plt # import matplotlib.colors as mcolors from scipy import stats from calibration import * import pandas as pd from eval_metrics import * from tqdm import tqdm from scipy.stats import norm from scipy.stats import pearsonr import argparse import it...
[ "argparse.ArgumentParser", "pandas.read_csv", "numpy.mean", "numpy.exp", "normalisation.compute_z_norm", "numpy.array_split", "os.path.join", "numpy.full_like", "numpy.std", "numpy.linspace", "pandas.concat", "copy.deepcopy", "normalisation.compute_fixed_std", "numpy.median", "scipy.stat...
[((9862, 9922), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Process comet outputs"""'}), "(description='Process comet outputs')\n", (9885, 9922), False, 'import argparse\n'), ((7057, 7082), 'numpy.array_split', 'np.array_split', (['zipped', 'k'], {}), '(zipped, k)\n', (7071, 7082), Tr...
# -*- coding: utf-8 -*- """A set of tools for calculating various material values Includes a couple of figures of merit as well as tools for checking and updating units .. :author:: dhancock """ def thermal_stress_fom(material,temperature=20,verbose = False): r"""Calculates the Thermal Stress Figure of Merit (*...
[ "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "materialtools.MaterialData", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((7704, 7732), 'materialtools.MaterialData', 'materialtools.MaterialData', ([], {}), '()\n', (7730, 7732), False, 'import materialtools\n'), ((8334, 8359), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""temperature"""'], {}), "('temperature')\n", (8344, 8359), True, 'from matplotlib import pyplot as plt\n'), ((8364, ...
#!/usr/bin/env python # ============================================================================= # GLOBAL IMPORTS # ============================================================================= import os import math import csv import json from collections import OrderedDict import numpy as np from simtk import ...
[ "json.dump", "numpy.log", "os.makedirs", "numpy.around", "numpy.isclose", "collections.OrderedDict", "numpy.sqrt" ]
[((11063, 11091), 'numpy.sqrt', 'np.sqrt', (['(dDH ** 2 + dDG ** 2)'], {}), '(dDH ** 2 + dDG ** 2)\n', (11070, 11091), True, 'import numpy as np\n'), ((12179, 12192), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (12190, 12192), False, 'from collections import OrderedDict\n'), ((15413, 15451), 'os.makedir...
# coding: utf-8 import numpy as np from ..utils import handleKeyError from ..utils import flatten_dual from ..utils import ItemsetTreeDOTexporter from ..utils import DOTexporterHandler ITEM_MINING_METHODS = ["all", "closed"] def create_one_hot(data): """ Create the one-hot binary matrix. @params data ...
[ "numpy.asarray", "numpy.zeros", "numpy.arange", "numpy.all" ]
[((756, 810), 'numpy.zeros', 'np.zeros', ([], {'shape': '(num_data, num_unique)', 'dtype': 'np.int32'}), '(shape=(num_data, num_unique), dtype=np.int32)\n', (764, 810), True, 'import numpy as np\n'), ((3703, 3728), 'numpy.arange', 'np.arange', (['self.num_items'], {}), '(self.num_items)\n', (3712, 3728), True, 'import ...
# -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt #Path of the file path data=pd.read_csv(path).rename(columns={'Total':'Total_Medals'}) data.head(10) #Code starts here # -------------- #Code starts here data['Better_Event']=np.whe...
[ "pandas.read_csv", "numpy.where", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((2468, 2495), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""United States"""'], {}), "('United States')\n", (2478, 2495), True, 'import matplotlib.pyplot as plt\n'), ((2497, 2523), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""Medals Tally"""'], {}), "('Medals Tally')\n", (2507, 2523), True, 'import matplotlib.py...
import numpy as np import pandas as pd from networkx import nx import numpy.linalg as la class DataSimulation: def __init__(self,p,n_days,t=None,road_props=None, noise_scale=1,t_switch=0,test_frac=0.8): self.p=p self.n_days=n_days if not t is None: self.t=t else : ...
[ "numpy.random.uniform", "pandas.date_range", "pandas.datetime", "numpy.random.multinomial", "networkx.nx.gnm_random_graph", "numpy.array", "numpy.reshape", "numpy.random.normal", "numpy.arange", "numpy.linalg.norm", "numpy.diag", "pandas.to_datetime" ]
[((905, 938), 'pandas.datetime', 'pd.datetime', (['(2020)', '(1)', '(1)', '(15)', '(0)', '(0)'], {}), '(2020, 1, 1, 15, 0, 0)\n', (916, 938), True, 'import pandas as pd\n'), ((947, 1026), 'pandas.date_range', 'pd.date_range', (['"""2020-1-1 15:00:00+01:00"""'], {'periods': '(4 * 24 * n_days)', 'freq': '"""15min"""'}), ...
import re,os,sys,warnings,numpy,scipy,math,itertools; from scipy import stats; from numpy import *; from multiprocessing import Pool; from scipy.optimize import fmin_cobyla from scipy.optimize import fmin_l_bfgs_b from math import log; numpy.random.seed(1231); warnings.filterwarnings('ignore'); #obsolete variables: ...
[ "scipy.stats.chi2.sf", "numpy.random.seed", "warnings.filterwarnings", "scipy.stats.ttest_ind", "re.findall", "scipy.stats.mstats.mquantiles", "multiprocessing.Pool", "math.log" ]
[((238, 261), 'numpy.random.seed', 'numpy.random.seed', (['(1231)'], {}), '(1231)\n', (255, 261), False, 'import re, os, sys, warnings, numpy, scipy, math, itertools\n'), ((263, 296), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (286, 296), False, 'import re, os, sys, wa...
import matplotlib.pyplot as plt import numpy as np def siso_freq_iden(win_num=32): #save_data_list = ["running_time", "yoke_pitch", "theta", "airspeed", "q", "aoa", "VVI", "alt"] arr = np.load("../data/sweep_data_2017_11_16_11_47.npy") time_seq_source = arr[:, 0] ele_seq_source = arr[:, 1] q_seq_so...
[ "numpy.load", "matplotlib.pyplot.show" ]
[((194, 244), 'numpy.load', 'np.load', (['"""../data/sweep_data_2017_11_16_11_47.npy"""'], {}), "('../data/sweep_data_2017_11_16_11_47.npy')\n", (201, 244), True, 'import numpy as np\n'), ((750, 760), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (758, 760), True, 'import matplotlib.pyplot as plt\n')]
import logging import time import copy from functools import partial from typing import Optional import numpy as np from qutip import Qobj from qutip.parallel import serial_map from .result import Result from .structural_conversions import ( extract_controls, extract_controls_mapping, control_onto_interval, ...
[ "functools.partial", "copy.deepcopy", "numpy.iscomplexobj", "logging.getLogger", "time.time", "numpy.min", "numpy.max", "time.localtime" ]
[((6044, 6071), 'logging.getLogger', 'logging.getLogger', (['"""krotov"""'], {}), "('krotov')\n", (6061, 6071), False, 'import logging\n'), ((7262, 7278), 'time.localtime', 'time.localtime', ([], {}), '()\n', (7276, 7278), False, 'import time\n'), ((7324, 7335), 'time.time', 'time.time', ([], {}), '()\n', (7333, 7335),...
#Pad(constant_pad) import onnx from onnx import helper from onnx import numpy_helper from onnx import AttributeProto, TensorProto, GraphProto import numpy as np from Compare_output import compare # Create the inputs (ValueInfoProto) x = helper.make_tensor_value_info('x', TensorProto.FLOAT, [1, 3, 4, 5]) pads = help...
[ "numpy.pad", "onnx.helper.make_node", "onnx.save", "numpy.random.randn", "onnx.helper.make_model", "os.getcwd", "onnx.helper.make_tensor_value_info", "numpy.asarray", "Compare_output.compare", "onnxruntime.InferenceSession", "numpy.array", "onnx.load", "numpy.squeeze", "onnx.checker.check_...
[((240, 307), 'onnx.helper.make_tensor_value_info', 'helper.make_tensor_value_info', (['"""x"""', 'TensorProto.FLOAT', '[1, 3, 4, 5]'], {}), "('x', TensorProto.FLOAT, [1, 3, 4, 5])\n", (269, 307), False, 'from onnx import helper\n'), ((316, 377), 'onnx.helper.make_tensor_value_info', 'helper.make_tensor_value_info', ([...
import numpy as np b = np.zeros((3, 4)) b[-1] = np.arange(5, 9) print(b)
[ "numpy.zeros", "numpy.arange" ]
[((24, 40), 'numpy.zeros', 'np.zeros', (['(3, 4)'], {}), '((3, 4))\n', (32, 40), True, 'import numpy as np\n'), ((49, 64), 'numpy.arange', 'np.arange', (['(5)', '(9)'], {}), '(5, 9)\n', (58, 64), True, 'import numpy as np\n')]
from exasol_udf_mock_python.column import Column from exasol_udf_mock_python.group import Group from exasol_udf_mock_python.mock_exa_environment import MockExaEnvironment from exasol_udf_mock_python.mock_meta_data import MockMetaData from exasol_udf_mock_python.udf_mock_executor import UDFMockExecutor def udf_wrapp...
[ "exasol_udf_mock_python.group.Group", "exasol_data_science_utils_python.model_utils.model_aggregator.combine_to_voting_regressor", "exasol_data_science_utils_python.preprocessing.scikit_learn.sklearn_identity_transformer.SKLearnIdentityTransformer", "numpy.random.RandomState", "exasol_data_science_utils_pyt...
[((2795, 2812), 'exasol_udf_mock_python.udf_mock_executor.UDFMockExecutor', 'UDFMockExecutor', ([], {}), '()\n', (2810, 2812), False, 'from exasol_udf_mock_python.udf_mock_executor import UDFMockExecutor\n'), ((3189, 3213), 'exasol_udf_mock_python.mock_exa_environment.MockExaEnvironment', 'MockExaEnvironment', (['meta'...
import io import time import logging from datetime import datetime import numpy as np from torch.utils.tensorboard import SummaryWriter LOGGER_NAME = 'root' LOGGER_DATEFMT = '%Y-%m-%d %H:%M:%S' handler = logging.StreamHandler() logger = logging.getLogger(LOGGER_NAME) logger.setLevel(logging.INFO) logger.addHandler(...
[ "datetime.datetime.today", "logging.StreamHandler", "time.time", "logging.Formatter", "numpy.array", "logging.getLogger" ]
[((207, 230), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (228, 230), False, 'import logging\n'), ((241, 271), 'logging.getLogger', 'logging.getLogger', (['LOGGER_NAME'], {}), '(LOGGER_NAME)\n', (258, 271), False, 'import logging\n'), ((568, 662), 'logging.Formatter', 'logging.Formatter', ([], {...
""" Data structure for implementing experience replay Author: <NAME> """ import numpy as np import matplotlib.pyplot as plt from replay_buffer import ReplayBuffer, ReplayBufferNew, ReplayBufferStructure, ReplayBufferStructureLean from result_buffer import ResultBuffer import time import csv import os import logging imp...
[ "result_buffer.ResultBuffer", "numpy.sum", "numpy.random.randn", "numpy.zeros", "numpy.ones", "numpy.mod", "numpy.sort", "replay_buffer.ReplayBuffer", "numpy.mean", "numpy.reshape", "numpy.random.rand", "logging.getLogger" ]
[((379, 406), 'logging.getLogger', 'logging.getLogger', (['"""logger"""'], {}), "('logger')\n", (396, 406), False, 'import logging\n'), ((684, 716), 'replay_buffer.ReplayBuffer', 'ReplayBuffer', (['config.buffer_size'], {}), '(config.buffer_size)\n', (696, 716), False, 'from replay_buffer import ReplayBuffer, ReplayBuf...
import glob import os from enum import Enum from timeit import default_timer as timer import numpy as np from cv2 import cv2 from numpy import random from data.train_model import ModelType from data.yolov3_load_dataset import YoloV3DataLoader from model.yolo3.utils import yolov3_classes from model.yolo3.yolo_eval imp...
[ "numpy.random.seed", "numpy.random.shuffle", "cv2.cv2.imread", "timeit.default_timer", "model.yolo3.yolo_eval.YOLO", "data.yolov3_load_dataset.YoloV3DataLoader", "data.train_model.ModelType", "numpy.array", "glob.iglob", "os.path.join", "keras.backend.clear_session" ]
[((713, 735), 'numpy.array', 'np.array', (['pred_box[:2]'], {}), '(pred_box[:2])\n', (721, 735), True, 'import numpy as np\n'), ((748, 771), 'numpy.array', 'np.array', (['pred_box[2:4]'], {}), '(pred_box[2:4])\n', (756, 771), True, 'import numpy as np\n'), ((880, 900), 'numpy.array', 'np.array', (['gt_box[:2]'], {}), '...
import mirdata import numpy as np import sklearn import random import torch import torchaudio import pytorch_lightning as pl class MridangamDataset(torch.utils.data.Dataset): def __init__( self, mirdataset, seq_duration=0.5, random_start=True, resample=8000, subset=...
[ "pytorch_lightning.Trainer", "torch.optim.lr_scheduler.StepLR", "sklearn.model_selection.train_test_split", "numpy.floor", "torch.nn.MaxPool1d", "pytorch_lightning.utilities.seed.seed_everything", "pytorch_lightning.metrics.classification.ConfusionMatrix", "torchaudio.info", "torch.utils.data.DataLo...
[((7115, 7153), 'mirdata.initialize', 'mirdata.initialize', (['"""mridangam_stroke"""'], {}), "('mridangam_stroke')\n", (7133, 7153), False, 'import mirdata\n'), ((7247, 7298), 'pytorch_lightning.utilities.seed.seed_everything', 'pl.utilities.seed.seed_everything', ([], {'seed': 'random_seed'}), '(seed=random_seed)\n',...