code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
:mod:`orion.algo.dehb.dehb -- Evolutionary Hyperband for Scalable,
Robust and Efficient Hyperparameter Optimization
============================================
Modern machine learning algorithms crucially rely on several design
decisions to achieve strong performance, making the problem of Hyper-
parameter O... | [
"copy.deepcopy",
"numpy.random.seed",
"sspace.convert.convert_space",
"numpy.random.get_state",
"orion.algo.dehb.brackets.SHBracketManager",
"sspace.convert.transform",
"numpy.iinfo",
"numpy.random.set_state",
"collections.defaultdict",
"orion.algo.base.BaseAlgorithm.set_state",
"orion.algo.base... | [((1413, 1428), 'orion.algo.dehb.logger.remove_loguru', 'remove_loguru', ([], {}), '()\n', (1426, 1428), False, 'from orion.algo.dehb.logger import remove_loguru\n'), ((1737, 1764), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1754, 1764), False, 'import logging\n'), ((4587, 4884), 'or... |
import numpy as num
from direct.showbase import DirectObject
from panda3d.core import LVector3f
TO_RAD = 0.017453293
TO_DEG = 57.295779513
class FreeCameraControl(DirectObject.DirectObject):
def __init__(self, base_object, cam_node=None):
DirectObject.DirectObject.__init__(self)
self.base_object... | [
"numpy.sin",
"numpy.cos",
"direct.showbase.DirectObject.DirectObject.__init__",
"panda3d.core.LVector3f"
] | [((254, 294), 'direct.showbase.DirectObject.DirectObject.__init__', 'DirectObject.DirectObject.__init__', (['self'], {}), '(self)\n', (288, 294), False, 'from direct.showbase import DirectObject\n'), ((623, 641), 'panda3d.core.LVector3f', 'LVector3f', (['(0)', '(0)', '(0)'], {}), '(0, 0, 0)\n', (632, 641), False, 'from... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue May 29 13:58:29 2018
@author: kristianeschenburg
"""
import numpy as np
def fisher(samples):
"""
Fisher transform samples of correlation values.
"""
return (1./2) * np.log((1.+samples)/(1.-samples))
def fisher_inv(samples):
... | [
"numpy.log",
"numpy.tanh"
] | [((420, 436), 'numpy.tanh', 'np.tanh', (['samples'], {}), '(samples)\n', (427, 436), True, 'import numpy as np\n'), ((260, 301), 'numpy.log', 'np.log', (['((1.0 + samples) / (1.0 - samples))'], {}), '((1.0 + samples) / (1.0 - samples))\n', (266, 301), True, 'import numpy as np\n')] |
import pickle
import torch.nn as nn
import numpy as np
import torch
import torch.nn.functional as F
from torch.autograd import Variable
# from dataloader.mano.network.utils import *
# from dataloader.mano.network.utilsSmallFunctions import *
# from dataloader.mano.network.Const import *
def minusHomoVectors(v0, v1):
... | [
"torch.eye",
"torch.cat",
"torch.cos",
"pickle.load",
"numpy.tile",
"torch.nn.functional.pad",
"torch.ones",
"numpy.zeros_like",
"numpy.reshape",
"torch.zeros",
"torch.matmul",
"torch.norm",
"torch.cuda.is_available",
"torch.unsqueeze",
"numpy.concatenate",
"torch.from_numpy",
"torch... | [((790, 821), 'numpy.array', 'np.array', (["model['f']"], {'dtype': 'int'}), "(model['f'], dtype=int)\n", (798, 821), True, 'import numpy as np\n'), ((950, 1203), 'numpy.array', 'np.array', (['[[38, 122, 92], [214, 79, 78], [239, 234, 122], [122, 118, 239], [215, 108,\n 79], [279, 118, 117], [117, 119, 279], [119, 1... |
# -------------------------------------------------------
# Assignment #1 Montreal Crime Analytics
# Written by <NAME> - 26250912
# For COMP 472 Section ABJX – Summer 2020
# --------------------------------------------------------
from src.Node import Node
from typing import Dict, Tuple
import numpy as np
from src.Gr... | [
"src.Node.Node",
"numpy.floor",
"numpy.abs"
] | [((9891, 9916), 'numpy.abs', 'np.abs', (['(bbox[2] - bbox[0])'], {}), '(bbox[2] - bbox[0])\n', (9897, 9916), True, 'import numpy as np\n'), ((9935, 9960), 'numpy.abs', 'np.abs', (['(bbox[3] - bbox[1])'], {}), '(bbox[3] - bbox[1])\n', (9941, 9960), True, 'import numpy as np\n'), ((2948, 2975), 'src.Node.Node', 'Node', (... |
"""
Created July, 2019
@author: <NAME> & <NAME>
"""
import tensorflow as tf
import dataset
import time
from datetime import timedelta
import math
import random
import numpy as np
from numpy.random import seed
seed(1)
from tensorflow import set_random_seed
set_random_seed(2)
batch_size = 1
# 7 classess for recogniti... | [
"numpy.random.seed",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.nn.conv2d",
"dataset.read_train_sets",
"tensorflow.truncated_normal",
"tensorflow.nn.softmax",
"tensorflow.nn.relu",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.set_random_seed",
"tensorflow.placeholde... | [((211, 218), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (215, 218), False, 'from numpy.random import seed\n'), ((258, 276), 'tensorflow.set_random_seed', 'set_random_seed', (['(2)'], {}), '(2)\n', (273, 276), False, 'from tensorflow import set_random_seed\n'), ((637, 729), 'dataset.read_train_sets', 'dataset... |
from data_loader import DataLoader
from text_cleaner import preprocess
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.decomposition import TruncatedSVD
from sklearn.utils import resample
from sklearn.metrics import confusion_matrix
from sklearn import svm
from sklearn.model... | [
"pandas.DataFrame",
"text_cleaner.preprocess",
"sklearn.decomposition.TruncatedSVD",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.model_selection.cross_validate",
"sklearn.model_selection.train_test_split",
"numpy.std",
"data_loader.DataLoader",
"numpy.mean",
"sklearn.utils.resample... | [((1300, 1351), 'data_loader.DataLoader', 'DataLoader', ([], {'filename': '"""../data/CRIM.csv"""', 'class_id': '(1)'}), "(filename='../data/CRIM.csv', class_id=1)\n", (1310, 1351), False, 'from data_loader import DataLoader\n'), ((1453, 1503), 'data_loader.DataLoader', 'DataLoader', ([], {'filename': '"""../data/COM.c... |
"""
@author: <NAME>
__license__= "LGPL"
"""
import numpy as np
import easyvvuq as uq
import os
#import matplotlib as mpl
#mpl.use('Agg')
#from matplotlib import ticker
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 20})
plt.rcParams['figure.figsize'] = 8,6
"""
*****************
* VVUQ ANALYSES *
**... | [
"easyvvuq.Campaign",
"easyvvuq.analysis.QMCAnalysis",
"matplotlib.pyplot.show",
"os.path.dirname",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.rcParams.update",
"numpy.arange",
"matplotlib.pyplot.tight_layout"
] | [((202, 240), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 20}"], {}), "({'font.size': 20})\n", (221, 240), True, 'import matplotlib.pyplot as plt\n'), ((494, 561), 'easyvvuq.Campaign', 'uq.Campaign', ([], {'state_file': '"""campaign_state_FC.json"""', 'work_dir': 'work_dir'}), "(state_f... |
# -*- coding: utf-8 -*-
"""
Created on Sun May 30 12:35:28 2021
@author: Lukas
"""
import numpy as np
import tensorflow as tf
import strawberryfields as sf
from strawberryfields import ops
import basis
import time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
tf.random... | [
"tensorflow.random.set_seed",
"strawberryfields.Engine",
"numpy.load",
"numpy.random.seed",
"tensorflow.reshape",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.arange",
"basis.layer",
"numpy.random.normal",
"numpy.prod",
"numpy.meshgrid",
"tensorflow.abs",
"numpy.reshape",
"numpy.linsp... | [((311, 335), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(2021)'], {}), '(2021)\n', (329, 335), True, 'import tensorflow as tf\n'), ((337, 357), 'numpy.random.seed', 'np.random.seed', (['(2021)'], {}), '(2021)\n', (351, 357), True, 'import numpy as np\n'), ((1431, 1459), 'numpy.linspace', 'np.linspace', (['... |
import numpy as np
import pytest
from numpy.testing import assert_almost_equal, assert_equal
import pyproj
from pyproj import Proj, Transformer, itransform, transform
from pyproj.exceptions import ProjError
def test_tranform_wgs84_to_custom():
custom_proj = pyproj.Proj(
"+proj=geos +lon_0=0.000000 +lat_0... | [
"pyproj.Transformer.from_proj",
"pytest.warns",
"numpy.testing.assert_almost_equal",
"numpy.isinf",
"pytest.raises",
"pyproj.Proj",
"pyproj.Transformer.from_crs",
"pyproj.itransform",
"pyproj.transform",
"pyproj.Transformer.from_pipeline"
] | [((265, 371), 'pyproj.Proj', 'pyproj.Proj', (['"""+proj=geos +lon_0=0.000000 +lat_0=0 +h=35807.414063 +a=6378.169000 +b=6356.583984"""'], {}), "(\n '+proj=geos +lon_0=0.000000 +lat_0=0 +h=35807.414063 +a=6378.169000 +b=6356.583984'\n )\n", (276, 371), False, 'import pyproj\n'), ((399, 462), 'pyproj.Proj', 'pyproj... |
import numpy as np
def parseData( path, n=25000, startWith=0):
games = open( path)
whiteWins = np.zeros( shape=(n, 1))
blackWins = np.zeros( shape=(n, 1))
draws = np.zeros( shape=(n, 1))
whiteElo = np.zeros( shape=(n, 1))
blackElo = np.zeros( shape=(n, 1))
i = -1
for row in games:
... | [
"numpy.zeros"
] | [((106, 128), 'numpy.zeros', 'np.zeros', ([], {'shape': '(n, 1)'}), '(shape=(n, 1))\n', (114, 128), True, 'import numpy as np\n'), ((146, 168), 'numpy.zeros', 'np.zeros', ([], {'shape': '(n, 1)'}), '(shape=(n, 1))\n', (154, 168), True, 'import numpy as np\n'), ((182, 204), 'numpy.zeros', 'np.zeros', ([], {'shape': '(n,... |
import numpy as np
import functions_plotting as plot
import functions_misc as misc
def plot_2pdataset(data_in):
"""Plot the raw, trial-averaged Ca data contained in the file, all protocols"""
# if a path was inserted, then the file
if data_in is str:
# file = r'J:\<NAME>\Data\DG_180816_a\2018_10_0... | [
"numpy.load",
"functions_misc.normalize_matrix",
"numpy.reshape",
"numpy.nanmean"
] | [((361, 396), 'numpy.load', 'np.load', (['data_in'], {'allow_pickle': '(True)'}), '(data_in, allow_pickle=True)\n', (368, 396), True, 'import numpy as np\n'), ((1095, 1122), 'numpy.nanmean', 'np.nanmean', (['ca_data'], {'axis': '(2)'}), '(ca_data, axis=2)\n', (1105, 1122), True, 'import numpy as np\n'), ((1144, 1207), ... |
import numpy as np
from scipy.optimize import least_squares
from .fitting import rmse
def linKK(f, Z, c=0.85, max_M=50):
""" A method for implementing the Lin-KK test for validating linearity [1]
Parameters
----------
f: np.ndarray
measured frequencies
Z: np.ndarray of complex numbers
... | [
"numpy.abs",
"numpy.zeros",
"numpy.ones",
"scipy.optimize.least_squares",
"numpy.min",
"numpy.max",
"numpy.real",
"numpy.log10"
] | [((4036, 4147), 'scipy.optimize.least_squares', 'least_squares', (['residuals_linKK', 'initial_guess'], {'method': '"""lm"""', 'args': "(ts, Z, f, 'both')", 'ftol': '(1e-13)', 'gtol': '(1e-10)'}), "(residuals_linKK, initial_guess, method='lm', args=(ts, Z, f,\n 'both'), ftol=1e-13, gtol=1e-10)\n", (4049, 4147), Fals... |
import random
########### Normal distribution ############
a = random.normalvariate(0, 1)
print(a)
arr = list('ABCDH')
a = random.choice(arr)
print(a)
########### Tokens / secret keys ############
import secrets
s = secrets.randbelow(3)
b = secrets.randbits(4)
print(f's: {s} and b: {b}')
import numpy as np
########... | [
"secrets.randbits",
"secrets.randbelow",
"random.normalvariate",
"random.choice",
"numpy.random.randint",
"numpy.random.rand"
] | [((64, 90), 'random.normalvariate', 'random.normalvariate', (['(0)', '(1)'], {}), '(0, 1)\n', (84, 90), False, 'import random\n'), ((125, 143), 'random.choice', 'random.choice', (['arr'], {}), '(arr)\n', (138, 143), False, 'import random\n'), ((219, 239), 'secrets.randbelow', 'secrets.randbelow', (['(3)'], {}), '(3)\n'... |
import torch
import numpy as np
import os
import glob
#import skvideo
#skvideo.setFFmpegPath("C:\\ffmpeg") # you need this before the import
import skvideo.io
def crop():
current_path = os.path.dirname(__file__)
resized_path = os.path.join(current_path, 'resized_data')
dirs = glob.glob(os.path.j... | [
"torch.stack",
"os.path.dirname",
"numpy.random.randint",
"glob.glob",
"os.path.join"
] | [((200, 225), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (215, 225), False, 'import os\n'), ((246, 288), 'os.path.join', 'os.path.join', (['current_path', '"""resized_data"""'], {}), "(current_path, 'resized_data')\n", (258, 288), False, 'import os\n'), ((825, 850), 'os.path.dirname', 'os... |
from collections import deque, defaultdict
import numpy as np
import pytest
from snc.environments.closed_loop_crw import ClosedLoopCRW
import snc.environments.examples as examples
from snc.environments.job_generators.discrete_review_job_generator import \
DeterministicDiscreteReviewJobGenerator
from snc.environmen... | [
"numpy.ones",
"collections.defaultdict",
"snc.environments.state_initialiser.DeterministicCRWStateInitialiser",
"snc.environments.closed_loop_crw.ClosedLoopCRW.get_supply_activity_to_buffer_association",
"pytest.mark.parametrize",
"snc.environments.closed_loop_crw.ClosedLoopCRW.get_supply_and_demand_ids",... | [((4179, 4389), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""supply_ids,demand_ids,env_class"""', '[([3], [5], examples.\n double_reentrant_line_with_demand_only_shared_resources_model), ([7, 8],\n [14, 15], examples.complex_demand_driven_model)]'], {}), "('supply_ids,demand_ids,env_class', [([3], ... |
import numpy as np
from scipy.special import gamma
from scipy.signal import residue
# Global Pade approximation of Miffag-Leffler function as described in https://arxiv.org/abs/1912.10996
# Valid for z < 0, 0 < alpha < 1, beta >= alpha, alpha != beta != 1
# Implemented by <NAME>
def solve_poly_coefs(alpha, beta, m=7,... | [
"numpy.fill_diagonal",
"scipy.special.gamma",
"numpy.zeros",
"numpy.max",
"scipy.signal.residue",
"numpy.real",
"numpy.linalg.solve"
] | [((747, 763), 'numpy.zeros', 'np.zeros', (['(7, 7)'], {}), '((7, 7))\n', (755, 763), True, 'import numpy as np\n'), ((766, 804), 'numpy.fill_diagonal', 'np.fill_diagonal', (['A[:3, :3]', '[1, 1, 1]'], {}), '(A[:3, :3], [1, 1, 1])\n', (782, 804), True, 'import numpy as np\n'), ((1465, 1486), 'numpy.linalg.solve', 'np.li... |
import torch
from torch import nn
import numpy as np
from scipy.io import loadmat, savemat
from array import array
class BFM():
"""
This is a numpy implementation of BFM model
for visualization purpose, not used in the DNN model
"""
def __init__(self):
model_path = './BFM/BFM_model_front.mat'
model = loadmat... | [
"torch.bmm",
"torch.eye",
"scipy.io.loadmat",
"torch.cos",
"numpy.squeeze",
"torch.sin",
"torch.tensor"
] | [((313, 332), 'scipy.io.loadmat', 'loadmat', (['model_path'], {}), '(model_path)\n', (320, 332), False, 'from scipy.io import loadmat, savemat\n'), ((1169, 1188), 'scipy.io.loadmat', 'loadmat', (['model_path'], {}), '(model_path)\n', (1176, 1188), False, 'from scipy.io import loadmat, savemat\n'), ((3561, 3577), 'torch... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 7 10:51:58 2021
@author: 91750
"""
import math
import numpy as np
def Join(Sensors,Model,TotalCH):
n=Model['n']
m=len(TotalCH)
if m>1:
D=[]
for i in range(m):
B=[]
for j in range(n):
B.ap... | [
"numpy.array",
"math.sqrt"
] | [((626, 637), 'numpy.array', 'np.array', (['D'], {}), '(D)\n', (634, 637), True, 'import numpy as np\n'), ((596, 614), 'math.sqrt', 'math.sqrt', (['(d1 + d2)'], {}), '(d1 + d2)\n', (605, 614), False, 'import math\n')] |
from __future__ import division
import numpy as np
import pdb
from scipy import integrate
__author__ = '<NAME>'
def area_weight_avg(data, lat, lat_axis):
'''Only use this for testing or plotting. This is a rough test.
Use calc_global_mean instead'''
weights = np.cos(np.radians(lat))
return np.av... | [
"numpy.radians",
"numpy.average",
"numpy.deg2rad",
"pdb.set_trace",
"numpy.cos",
"scipy.integrate.trapz"
] | [((315, 363), 'numpy.average', 'np.average', (['data'], {'weights': 'weights', 'axis': 'lat_axis'}), '(data, weights=weights, axis=lat_axis)\n', (325, 363), True, 'import numpy as np\n'), ((1048, 1063), 'numpy.deg2rad', 'np.deg2rad', (['lat'], {}), '(lat)\n', (1058, 1063), True, 'import numpy as np\n'), ((1158, 1173), ... |
#!/usr/bin/env python
'''
Uses SURF to match two images.
Based on the sample code from opencv:
samples/python2/find_obj.py
Example:
matcher = Matcher()
for i in range(8):
matcher.add_baseline_image(%imagepath%)
match_key, cnt = matcher.match_image_info(%imagepath%)
is_match = matcher.match_i... | [
"django.setup",
"numpy.sum",
"tradition.matcher.thread_pool.ThreadPool",
"cv2.xfeatures2d.SURF_create",
"os.path.isfile",
"cv2.line",
"cv2.contourArea",
"cv2.imwrite",
"os.path.dirname",
"cv2.BFMatcher",
"numpy.max",
"numpy.int32",
"cv2.circle",
"os.environ.setdefault",
"os.path.basename... | [((16286, 16297), 'time.time', 'time.time', ([], {}), '()\n', (16295, 16297), False, 'import time\n'), ((16357, 16368), 'time.time', 'time.time', ([], {}), '()\n', (16366, 16368), False, 'import time\n'), ((16474, 16485), 'time.time', 'time.time', ([], {}), '()\n', (16483, 16485), False, 'import time\n'), ((16566, 1657... |
from __future__ import print_function
import numpy as np
from sklearn import metrics
from sklearn.metrics import roc_auc_score
import math
import six
#import bootstrapped.bootstrap as bs
#import bootstrapped.stats_functions as bs_stats
from six.moves import cPickle as pkl
#from sklearn.covariance import GraphLasso
#im... | [
"six.moves.cPickle.dump",
"numpy.zeros",
"numpy.max",
"numpy.mean",
"six.moves.cPickle.load"
] | [((2091, 2114), 'numpy.zeros', 'np.zeros', (['A.shape[0:-1]'], {}), '(A.shape[0:-1])\n', (2099, 2114), True, 'import numpy as np\n'), ((2131, 2150), 'numpy.mean', 'np.mean', (['A'], {'axis': '(-1)'}), '(A, axis=-1)\n', (2138, 2150), True, 'import numpy as np\n'), ((3561, 3572), 'numpy.max', 'np.max', (['tmp'], {}), '(t... |
import copy
from typing import Tuple, Union
import numpy as np
from .module import Module
from .utils import bin2dec_vector, dec2bin_vector
class BinaryEncoder(Module):
@staticmethod
def __check_init_args(
dim: int, interval: Union[Tuple[Union[float, int], Union[float, int]]]
) -> Tuple[int, np... | [
"numpy.minimum",
"numpy.array"
] | [((1443, 1477), 'numpy.array', 'np.array', (['interval'], {'dtype': 'np.float'}), '(interval, dtype=np.float)\n', (1451, 1477), True, 'import numpy as np\n'), ((3767, 3801), 'numpy.array', 'np.array', (['interval'], {'dtype': 'np.float'}), '(interval, dtype=np.float)\n', (3775, 3801), True, 'import numpy as np\n'), ((2... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"scipy.sparse.dok_matrix",
"numpy.random.randint",
"argparse.ArgumentParser"
] | [((727, 774), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run GMF."""'}), "(description='Run GMF.')\n", (750, 774), False, 'import argparse\n'), ((1962, 2025), 'scipy.sparse.dok_matrix', 'sp.dok_matrix', (['(num_users + 1, num_items + 1)'], {'dtype': 'np.float32'}), '((num_users + 1, ... |
from __future__ import print_function, division, absolute_import
import itertools
from copy import copy
import numpy as np
import regreg.atoms.seminorms as S
import regreg.api as rr
import nose.tools as nt
def all_close(x, y, msg, solver):
"""
Check to see if x and y are close
"""
try:
v = n... | [
"regreg.api.identity_quadratic",
"regreg.api.simple_problem.nonsmooth",
"regreg.api.gengrad",
"nose.tools.assert_true",
"numpy.allclose",
"regreg.api.simple_problem",
"regreg.api.quadratic.shift",
"copy.copy",
"regreg.api.FISTA",
"regreg.api.dual_problem.fromprimal",
"regreg.api.separable_proble... | [((528, 545), 'numpy.allclose', 'np.allclose', (['x', 'y'], {}), '(x, y)\n', (539, 545), True, 'import numpy as np\n'), ((799, 816), 'nose.tools.assert_true', 'nt.assert_true', (['v'], {}), '(v)\n', (813, 816), True, 'import nose.tools as nt\n'), ((3519, 3646), 'itertools.product', 'itertools.product', (['self.offset_c... |
"""
MIT License
Copyright (c) 2020
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, distribute, ... | [
"numpy.cumprod",
"numpy.roll",
"numpy.equal",
"pathlib.Path",
"numpy.min",
"numpy.array",
"numpy.isclose",
"numpy.exp",
"numpy.max",
"numpy.less",
"numpy.greater_equal",
"logging.getLogger"
] | [((1261, 1280), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1278, 1280), False, 'import logging\n'), ((2824, 2841), 'pathlib.Path', 'Path', (['output_path'], {}), '(output_path)\n', (2828, 2841), False, 'from pathlib import Path\n'), ((6776, 6804), 'numpy.less', 'np.less', (['zeta[-1]', 'min_delta'], {... |
import os
import sys
import random
import time
import gym_mdptetris.envs
import numpy as np
from gym_mdptetris.envs import board, piece
from torch.utils.tensorboard import SummaryWriter
class RandomLinearGame():
def __init__(self, board_height=20, board_width=10, piece_set='pieces4.dat', seed=12345):
""... | [
"random.randint",
"gym_mdptetris.envs.piece.load_pieces",
"os.path.dirname",
"time.strftime",
"time.time",
"random.seed",
"numpy.array",
"torch.utils.tensorboard.SummaryWriter",
"gym_mdptetris.envs.board.Board",
"sys.exit"
] | [((2942, 2973), 'time.strftime', 'time.strftime', (['"""%Y%m%dT%H%M%SZ"""'], {}), "('%Y%m%dT%H%M%SZ')\n", (2955, 2973), False, 'import time\n'), ((2987, 3036), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', (['log_dir'], {'comment': 'f"""Random-{runid}"""'}), "(log_dir, comment=f'Random-{runid}')\n", (3000, ... |
"""
Logarithm base 10.
"""
import numpy
from ..baseclass import Dist
class Log10(Dist):
"""Logarithm base 10."""
def __init__(self, dist):
"""
Constructor.
Args:
dist (Dist) : distribution (>=0).
"""
assert isinstance(dist, Dist)
assert numpy.all(... | [
"numpy.log10",
"numpy.log"
] | [((636, 667), 'numpy.log10', 'numpy.log10', (["graph.keys['dist']"], {}), "(graph.keys['dist'])\n", (647, 667), False, 'import numpy\n'), ((1248, 1266), 'numpy.log10', 'numpy.log10', (['lower'], {}), '(lower)\n', (1259, 1266), False, 'import numpy\n'), ((1268, 1286), 'numpy.log10', 'numpy.log10', (['upper'], {}), '(upp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ALEXA Wide Gamut RGB Colourspace
================================
Defines the *ALEXA Wide Gamut RGB* colourspace:
- :attr:`ALEXA_WIDE_GAMUT_RGB_COLOURSPACE`.
See Also
--------
`RGB Colourspaces IPython Notebook
<http://nbviewer.ipython.org/github/colour-science/co... | [
"colour.utilities.CaseInsensitiveMapping",
"math.pow",
"colour.models.RGB_Colourspace",
"colour.colorimetry.ILLUMINANTS.get",
"math.log10",
"numpy.linalg.inv",
"numpy.array"
] | [((1460, 2169), 'colour.utilities.CaseInsensitiveMapping', 'CaseInsensitiveMapping', (["{'SUP 3.x': {(160): (0.0928, 0.8128), (200): (0.0928, 0.8341), (250): (\n 0.0928, 0.8549), (320): (0.0928, 0.8773), (400): (0.0928, 0.8968), (500\n ): (0.0928, 0.9158), (640): (0.0928, 0.9362), (800): (0.0928, 0.9539),\n (1... |
"""Forecast plotter tests."""
from copy import deepcopy
import locale
import numpy as np
import pytest
from soam.constants import (
ANOMALY_PLOT,
FIG_SIZE,
MONTHLY_TIME_GRANULARITY,
PLOT_CONFIG,
Y_COL,
YHAT_COL,
)
from soam.plotting.forecast_plotter import ForecastPlotterTask
from tests.helper... | [
"numpy.random.default_rng",
"copy.deepcopy",
"locale.setlocale",
"soam.plotting.forecast_plotter.ForecastPlotterTask"
] | [((422, 468), 'locale.setlocale', 'locale.setlocale', (['locale.LC_TIME', '(None, None)'], {}), '(locale.LC_TIME, (None, None))\n', (438, 468), False, 'import locale\n'), ((1085, 1106), 'copy.deepcopy', 'deepcopy', (['PLOT_CONFIG'], {}), '(PLOT_CONFIG)\n', (1093, 1106), False, 'from copy import deepcopy\n'), ((1192, 13... |
"""
neff.py
- compares predictions of PriMiDM and PRIMAT including additional dark radiation
- outputs pdf Neffcheck.pdf
- uses data from DeltaNeffPRIMAT.txt and DeltaNeffPRIMI.txt
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
plt.rcParams['axes.linewidth'] = 1.75
plt.r... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.yscale",
"numpy.abs",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.loadtxt",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((671, 731), 'numpy.loadtxt', 'np.loadtxt', (['"""DeltaNeffPRIMAT.txt"""'], {'skiprows': '(1)', 'delimiter': '""","""'}), "('DeltaNeffPRIMAT.txt', skiprows=1, delimiter=',')\n", (681, 731), True, 'import numpy as np\n'), ((745, 789), 'numpy.loadtxt', 'np.loadtxt', (['"""DeltaNeffPRIMI.txt"""'], {'skiprows': '(1)'}), "... |
"""
Random height, weight generator for males and females. Uses parameters from
<NAME>. & <NAME>. (1992). Bivariate distributions for height and
weight of men and women in the United States. Risk Analysis, 12(2), 267-275.
<NAME>, January 2008.
"""
from __future__ import division
from scipy.stats import multivari... | [
"numpy.random.seed",
"scipy.stats.multivariate_normal.rvs",
"numpy.zeros",
"numpy.array",
"numpy.exp",
"numpy.random.choice"
] | [((587, 613), 'numpy.array', 'np.array', (['[HtMmu, lnWtMmu]'], {}), '([HtMmu, lnWtMmu])\n', (595, 613), True, 'import numpy as np\n'), ((629, 722), 'numpy.array', 'np.array', (['[[HtMsd ** 2, Mrho * HtMsd * lnWtMsd], [Mrho * HtMsd * lnWtMsd, lnWtMsd ** 2]]'], {}), '([[HtMsd ** 2, Mrho * HtMsd * lnWtMsd], [Mrho * HtMsd... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 17 21:26:36 2018
@author: acer
function made and called from previous test1 mask value
"""
import numpy as np
import cv2
from test_frames_main2 import mask
class analyse_frame:
def frame_new1(filename):
filename1=filename
#filename i... | [
"cv2.line",
"cv2.Canny",
"numpy.asarray",
"cv2.threshold",
"numpy.any",
"test_frames_main2.mask.canny",
"cv2.HoughLinesP"
] | [((364, 384), 'test_frames_main2.mask.canny', 'mask.canny', (['filename'], {}), '(filename)\n', (374, 384), False, 'from test_frames_main2 import mask\n'), ((838, 884), 'numpy.any', 'np.any', (["((img1 == 'NULL') == False and tot1 > 0)"], {}), "((img1 == 'NULL') == False and tot1 > 0)\n", (844, 884), True, 'import nump... |
"""Used for rendering frames as png files."""
import os
import numpy as np
import pyvista as pv
import nibabel as nb
SCALAR = "/home/faruk/Documents/temp_flooding_brains/data/okapi/okapi_N4.nii.gz"
DIST = "/home/faruk/Documents/temp_flooding_brains/data/okapi/okapi_cerebrum_RH_v05_borders_inputrim_centroids1_geodista... | [
"os.makedirs",
"numpy.copy",
"nibabel.load",
"os.path.exists",
"pyvista.Plotter",
"numpy.ones",
"numpy.prod",
"numpy.max",
"os.path.join",
"numpy.unique"
] | [((1086, 1098), 'numpy.ones', 'np.ones', (['(255)'], {}), '(255)\n', (1093, 1098), True, 'import numpy as np\n'), ((1158, 1209), 'pyvista.Plotter', 'pv.Plotter', ([], {'window_size': 'RESOLUTION', 'off_screen': '(True)'}), '(window_size=RESOLUTION, off_screen=True)\n', (1168, 1209), True, 'import pyvista as pv\n'), ((7... |
import numpy as np
from chainer0.function import Function
class ReLU(Function):
def forward(self, x):
return np.maximum(x, 0)
def backward(self, gy):
y = self.outputs[0]
gx = gy * (y.data > 0)
return gx
def relu(x):
"""Rectified Linear Unit function."""
f = ReLU()
... | [
"numpy.maximum"
] | [((124, 140), 'numpy.maximum', 'np.maximum', (['x', '(0)'], {}), '(x, 0)\n', (134, 140), True, 'import numpy as np\n')] |
'''
be sure the python libraries are reachable
python dataset_generator.py --folder tr_dataset --num_images 100
qr capacity https://www.qrcode.com/en/about/version.html
qr code:4999 | elapsed time: 4m: 0s dll 25
qr code:19999 | elapsed time: 13m:50s dll 25
qr code:19999 | elapsed time: 14m:25s python 25
qr dama... | [
"ctypes.WinDLL",
"os.mkdir",
"PIL.Image.new",
"argparse.ArgumentParser",
"random.randint",
"cv2.cvtColor",
"cv2.imwrite",
"numpy.asarray",
"numpy.zeros",
"random.choice",
"time.time",
"numpy.shape",
"numpy.random.randint",
"numpy.reshape",
"qrcode.QRCode",
"PIL.ImageDraw.Draw",
"os.p... | [((1013, 1060), 'ctypes.WinDLL', 'ctypes.WinDLL', (['"""absolute path to maskWhite.dll"""'], {}), "('absolute path to maskWhite.dll')\n", (1026, 1060), False, 'import ctypes\n'), ((2208, 2220), 'numpy.shape', 'np.shape', (['qr'], {}), '(qr)\n', (2216, 2220), True, 'import numpy as np\n'), ((2884, 2896), 'numpy.shape', ... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.linalg import qr
mean = [0, 0, 0]
cov = np.eye(3)
x_y_z = np.random.multivariate_normal(mean, cov, 50000).T
def get_orthogonal_matrix(dim):
H = np.random.randn(dim, dim)
Q, R = qr(H)
return ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"numpy.random.randn",
"scipy.linalg.qr",
"matplotlib.pyplot.figure",
"numpy.random.multivariate_normal",
"numpy.array",
"numpy.eye"
] | [((149, 158), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (155, 158), True, 'import numpy as np\n'), ((168, 215), 'numpy.random.multivariate_normal', 'np.random.multivariate_normal', (['mean', 'cov', '(50000)'], {}), '(mean, cov, 50000)\n', (197, 215), True, 'import numpy as np\n'), ((264, 289), 'numpy.random.randn'... |
import os
import torch
import numpy as np
from PIL import Image
import matplotlib
from torch.serialization import save
matplotlib.use('Agg')
from matplotlib import pyplot as plt
class GraphPlotter:
def __init__(self, save_dir, metrics: list, phase):
self.save_dir = save_dir
self.gra... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplot",
"numpy.uint8",
"os.path.join",
"matplotlib.pyplot.close",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.figure",
"matplotlib.use",
"numpy.array",
"torch.no_grad",
"matplotlib.pyplot.subplots"
] | [((129, 150), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (143, 150), False, 'import matplotlib\n'), ((1154, 1185), 'numpy.array', 'np.array', (['[0.485, 0.456, 0.406]'], {}), '([0.485, 0.456, 0.406])\n', (1162, 1185), True, 'import numpy as np\n'), ((1193, 1224), 'numpy.array', 'np.array', ([... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"functools.partial",
"paddle.distributed.get_world_size",
"pgl.utils.logger.log.info",
"argparse.ArgumentParser",
"paddle.nn.loss.CrossEntropyLoss",
"numpy.argmax",
"dataset.ShardedDataset",
"paddle.no_grad",
"paddle.metric.accuracy",
"paddle.distributed.init_parallel_env",
"pgl.utils.data.Datal... | [((1982, 1998), 'paddle.no_grad', 'paddle.no_grad', ([], {}), '()\n', (1996, 1998), False, 'import paddle\n'), ((2779, 2835), 'pgl.dataset.RedditDataset', 'pgl.dataset.RedditDataset', (['args.normalize', 'args.symmetry'], {}), '(args.normalize, args.symmetry)\n', (2804, 2835), False, 'import pgl\n'), ((2840, 2869), 'pg... |
import cv2
import numpy as np
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from preprocess import *
from driveModel import driveModel
from keras.models import load_model
# Constants
PROCESSED_FILE_NAME = "data_processed/processed.txt"
BATCH_SIZE = 256
preprocess = False # Fl... | [
"sklearn.model_selection.train_test_split",
"driveModel.driveModel",
"cv2.imread",
"numpy.array",
"sklearn.utils.shuffle"
] | [((2302, 2343), 'sklearn.model_selection.train_test_split', 'train_test_split', (['train_db'], {'test_size': '(0.1)'}), '(train_db, test_size=0.1)\n', (2318, 2343), False, 'from sklearn.model_selection import train_test_split\n'), ((771, 788), 'sklearn.utils.shuffle', 'shuffle', (['XY_train'], {}), '(XY_train)\n', (778... |
import numpy as np
import cv2
_useGaussian = True
_gaussianPixels = 21
def prepare_frame(frame):
"""
todo
"""
# frame = imutils.resize(frame, width=500)
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
if _useGaussian: gray = cv2.GaussianBlur(gray, (_gaussianPixels, _gaussianPixels), 0)
retu... | [
"cv2.GaussianBlur",
"cv2.contourArea",
"numpy.zeros_like",
"cv2.putText",
"cv2.cvtColor",
"cv2.ellipse",
"cv2.fitEllipse",
"numpy.bitwise_and"
] | [((182, 221), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2GRAY'], {}), '(frame, cv2.COLOR_BGR2GRAY)\n', (194, 221), False, 'import cv2\n'), ((1089, 1107), 'numpy.zeros_like', 'np.zeros_like', (['src'], {}), '(src)\n', (1102, 1107), True, 'import numpy as np\n'), ((1122, 1145), 'cv2.fitEllipse', 'cv2.fitEl... |
"""
Benchmark inference speed on ImageNet
Example (run on Firefly RK3399):
python mali_imagenet_bench.py --target-host 'llvm -target=aarch64-linux-gnu' --host 192.168.0.100 --port 9090 --model mobilenet
"""
import time
import argparse
import numpy as np
import tvm
import nnvm.compiler
import nnvm.testing
from tvm.cont... | [
"numpy.random.uniform",
"argparse.ArgumentParser",
"tvm.contrib.rpc.connect",
"tvm.target.mali",
"tvm.nd.array",
"tvm.contrib.util.tempdir",
"time.sleep",
"tvm.contrib.graph_runtime.create",
"tvm.cl"
] | [((1343, 1357), 'tvm.contrib.util.tempdir', 'util.tempdir', ([], {}), '()\n', (1355, 1357), False, 'from tvm.contrib import util, rpc\n'), ((1809, 1841), 'tvm.contrib.graph_runtime.create', 'runtime.create', (['graph', 'rlib', 'ctx'], {}), '(graph, rlib, ctx)\n', (1823, 1841), True, 'from tvm.contrib import graph_runti... |
import datetime
import os
import time
import unittest
import numpy
import cf
class AuxiliaryCoordinateTest(unittest.TestCase):
def setUp(self):
self.filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'test_file.nc')
aux1 = cf.AuxiliaryCoordin... | [
"cf.environment",
"unittest.main",
"os.path.abspath",
"numpy.trunc",
"numpy.ceil",
"numpy.empty",
"numpy.floor",
"cf.read",
"numpy.clip",
"cf.Data",
"numpy.rint",
"cf.Bounds",
"numpy.array",
"numpy.arange",
"cf.AuxiliaryCoordinate",
"numpy.round",
"datetime.datetime.now"
] | [((10778, 10794), 'cf.environment', 'cf.environment', ([], {}), '()\n', (10792, 10794), False, 'import cf\n'), ((10811, 10837), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (10824, 10837), False, 'import unittest\n'), ((301, 325), 'cf.AuxiliaryCoordinate', 'cf.AuxiliaryCoordinate', (... |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 <NAME>, <NAME>, <NAME>,
# <NAME>. All rights reserved.
# Copyright (C) 2011-2014 <NAME>
#
# CasADi is free software; you can redistribute it and/or
# ... | [
"numpy.random.seed",
"casadi.diag",
"casadi.nnz",
"numpy.ones",
"casadi.inv",
"unittest.main",
"unittest.skipIf",
"warnings.simplefilter",
"casadi.size2",
"warnings.catch_warnings",
"numpy.linalg.det",
"casadi.det",
"numpy.linalg.inv",
"numpy.matrix",
"casadi.transpose",
"casadi.size1"... | [((34605, 34676), 'unittest.skipIf', 'unittest.skipIf', (['(sys.version_info >= (3, 0))', '"""pickle is not compatible"""'], {}), "(sys.version_info >= (3, 0), 'pickle is not compatible')\n", (34620, 34676), False, 'import unittest\n'), ((45163, 45178), 'unittest.main', 'unittest.main', ([], {}), '()\n', (45176, 45178)... |
import pandas as pd
import numpy as np, os, sys, librosa
import warnings
warnings.simplefilter("ignore")
MIN_GAP = 0
avoid_edges=True
edge_gap = 0.5
# Predict w/ pytorch code for audioset data
sys.path.append('../')
sys.path.append('../../')
sys.path.append('../../utils/')
import models, configs, torch
import dataset... | [
"sys.path.append",
"pandas.DataFrame",
"tqdm.tqdm",
"numpy.abs",
"warnings.simplefilter",
"pandas.read_csv",
"torch.device"
] | [((73, 104), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (94, 104), False, 'import warnings\n'), ((195, 217), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (210, 217), False, 'import numpy as np, os, sys, librosa\n'), ((218, 243), 'sys.path.append'... |
import math
from itertools import permutations, repeat
import numpy as np
# set radius in meters (e.g. here 5 km)
radius = 5000
# set bounding box (e.g. here Berlin)
start_lat = 52.341823
start_long = 13.088209
end_lat = 52.669724
end_long = 13.760610
# number of km per degree = 40075km / 360 = ~111
# (between 110.5... | [
"numpy.append",
"numpy.savetxt",
"numpy.array",
"math.cos"
] | [((2244, 2340), 'numpy.savetxt', 'np.savetxt', (['"""centers.csv"""', 'all_coordinates'], {'header': '"""lat, long"""', 'delimiter': '""","""', 'fmt': '"""%10.6f"""'}), "('centers.csv', all_coordinates, header='lat, long', delimiter=\n ',', fmt='%10.6f')\n", (2254, 2340), True, 'import numpy as np\n'), ((1967, 2014)... |
from copy import deepcopy
from typing import Tuple
import GPy
import numpy as np
from emukit.model_wrappers.gpy_model_wrappers import GPyModelWrapper
class FabolasKernel(GPy.kern.Kern):
def __init__(self, input_dim, basis_func, a=1., b=1., active_dims=None):
super(FabolasKernel, self).__init__(input_d... | [
"copy.deepcopy",
"numpy.sum",
"GPy.models.GPRegression",
"numpy.log2",
"numpy.ones",
"GPy.kern.White",
"numpy.min",
"GPy.kern.OU",
"numpy.dot",
"numpy.var",
"GPy.core.parameterization.Param",
"GPy.priors.Uniform"
] | [((442, 481), 'GPy.core.parameterization.Param', 'GPy.core.parameterization.Param', (['"""a"""', 'a'], {}), "('a', a)\n", (473, 481), False, 'import GPy\n'), ((499, 538), 'GPy.core.parameterization.Param', 'GPy.core.parameterization.Param', (['"""b"""', 'b'], {}), "('b', b)\n", (530, 538), False, 'import GPy\n'), ((947... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Categorical
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
from algo.ppo.Network import Actor, Critic
import os
from pathlib import Path
import sys
... | [
"algo.ppo.Network.Actor",
"os.makedirs",
"algo.ppo.Network.Critic",
"torch.load",
"torch.nn.functional.mse_loss",
"os.path.exists",
"common.buffer.Replay_buffer",
"pathlib.Path",
"torch.Tensor",
"numpy.array",
"torch.clamp",
"os.path.join",
"torch.min",
"torch.tensor"
] | [((1043, 1099), 'algo.ppo.Network.Actor', 'Actor', (['self.state_dim', 'self.action_dim', 'self.hidden_size'], {}), '(self.state_dim, self.action_dim, self.hidden_size)\n', (1048, 1099), False, 'from algo.ppo.Network import Actor, Critic\n'), ((1122, 1165), 'algo.ppo.Network.Critic', 'Critic', (['self.state_dim', '(1)'... |
import unittest
import numpy as np
from pyscfit.utils import _match, _match_hash
class UtilsTestCase(unittest.TestCase):
def setUp(self):
self.x = np.array([19, 21, 11, 18, 46], dtype=np.int_)
def test__match_single_query_value(self):
y = 11
self.assertEqual(_match(self.x, y), 2)
... | [
"pyscfit.utils._match_hash",
"pyscfit.utils._match",
"numpy.array"
] | [((161, 206), 'numpy.array', 'np.array', (['[19, 21, 11, 18, 46]'], {'dtype': 'np.int_'}), '([19, 21, 11, 18, 46], dtype=np.int_)\n', (169, 206), True, 'import numpy as np\n'), ((368, 405), 'numpy.array', 'np.array', (['[11, 18, 19]'], {'dtype': 'np.int_'}), '([11, 18, 19], dtype=np.int_)\n', (376, 405), True, 'import ... |
'''Dealing with Boond Manager .csv holidays files
Check the type of holidays -- check_conge_exceptionel(attente, log_file, VALIDEE)
Check the date of holidays -- check_conge_less_5_months(attente, log_file, VALIDEE)
Prepare data for processing -- create_tab_to_insert_vacances_en_attente(attente, log_file, VALIDEE)
Pre... | [
"pandas.Timestamp",
"pandas.read_csv",
"numpy.zeros",
"dateutil.relativedelta.relativedelta",
"datetime.date.today",
"pandas.to_datetime",
"pandas.Timestamp.now",
"datetime.datetime.now"
] | [((6595, 6628), 'pandas.read_csv', 'pd.read_csv', (['csv_attente'], {'sep': '""";"""'}), "(csv_attente, sep=';')\n", (6606, 6628), True, 'import pandas as pd\n'), ((7078, 7122), 'pandas.to_datetime', 'pd.to_datetime', (['attente.Début'], {'dayfirst': '(True)'}), '(attente.Début, dayfirst=True)\n', (7092, 7122), True, '... |
# Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
"""Functionality for managing markers (shapes used to highlight datums in plots and text).
"""
import copy
import xml.sax.saxutils
import nump... | [
"numpy.linalg.norm",
"copy.deepcopy",
"numpy.zeros",
"numpy.abs"
] | [((4488, 4505), 'numpy.zeros', 'numpy.zeros', (['(2,)'], {}), '((2,))\n', (4499, 4505), False, 'import numpy\n'), ((1243, 1262), 'copy.deepcopy', 'copy.deepcopy', (['self'], {}), '(self)\n', (1256, 1262), False, 'import copy\n'), ((3661, 3681), 'numpy.linalg.norm', 'numpy.linalg.norm', (['p'], {}), '(p)\n', (3678, 3681... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @author: Wesley
# @time: 2020/11/25 20:29
import numpy as np
def iou(box, boxes, isMin=False):
box_area = (box[2] - box[0]) * (box[3] - box[1])
boxes_area = (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])
# 计算相交框的坐标
xx1 = np.maximum(box[0], ... | [
"numpy.stack",
"numpy.minimum",
"numpy.maximum",
"numpy.where",
"numpy.array"
] | [((301, 332), 'numpy.maximum', 'np.maximum', (['box[0]', 'boxes[:, 0]'], {}), '(box[0], boxes[:, 0])\n', (311, 332), True, 'import numpy as np\n'), ((343, 374), 'numpy.maximum', 'np.maximum', (['box[1]', 'boxes[:, 1]'], {}), '(box[1], boxes[:, 1])\n', (353, 374), True, 'import numpy as np\n'), ((385, 416), 'numpy.minim... |
# Practical Machine learning
# k-Nearest neighbor example
# Chapter 6
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn import neighbors
class kNN():
def __init__(self, k):
self.k = k
def _euclidian_distance(self, x1, x... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"numpy.sum",
"numpy.copy",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.array",
"numpy.vstack",
"matplotlib.colors.ListedColormap",
"matplotlib... | [((1386, 1428), 'pandas.read_csv', 'pd.read_csv', (['"""data/iris.data"""'], {'header': 'None'}), "('data/iris.data', header=None)\n", (1397, 1428), True, 'import pandas as pd\n'), ((1496, 1545), 'matplotlib.colors.ListedColormap', 'ListedColormap', (["['#FFAAAA', '#AAFFAA', '#AAAAFF']"], {}), "(['#FFAAAA', '#AAFFAA', ... |
"""
Helper functions to deal with data from brick-spring-car
modelling.
"""
import numpy as np
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import os
from PIL import Image, ImageDraw, ImageFont
_c_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)))
_updir = os.path.split(_c_... | [
"os.path.dirname",
"numpy.ones",
"PIL.ImageFont.truetype",
"numpy.array",
"PIL.ImageDraw.Draw",
"os.path.split",
"os.path.join"
] | [((340, 397), 'os.path.join', 'os.path.join', (['_updir', '"""Open_Sans"""', '"""OpenSans-Regular.ttf"""'], {}), "(_updir, 'Open_Sans', 'OpenSans-Regular.ttf')\n", (352, 397), False, 'import os\n'), ((303, 324), 'os.path.split', 'os.path.split', (['_c_dir'], {}), '(_c_dir)\n', (316, 324), False, 'import os\n'), ((266, ... |
import datetime
import sys
import yaml
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
from copy import deepcopy
from agents.PPO import PPO
from envs.env_factory import EnvFactory
from automl.bohb_optim import run_bohb_parallel, run_bohb_serial
import numpy as np
NUM_EVALS = 3
class ExperimentWrapp... | [
"ConfigSpace.ConfigurationSpace",
"copy.deepcopy",
"ConfigSpace.hyperparameters.UniformIntegerHyperparameter",
"envs.env_factory.EnvFactory",
"agents.PPO.PPO",
"numpy.mean",
"ConfigSpace.hyperparameters.UniformFloatHyperparameter",
"yaml.safe_load",
"datetime.datetime.now"
] | [((4201, 4224), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (4222, 4224), False, 'import datetime\n'), ((618, 641), 'ConfigSpace.ConfigurationSpace', 'CS.ConfigurationSpace', ([], {}), '()\n', (639, 641), True, 'import ConfigSpace as CS\n'), ((1394, 1418), 'copy.deepcopy', 'deepcopy', (['default... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # s_cp... | [
"numpy.eye",
"arpym.tools.pca_cov",
"arpym.tools.cpca_cov",
"numpy.shape",
"numpy.array",
"numpy.diag"
] | [((824, 883), 'numpy.array', 'np.array', (['[[0.25, 0.3, 0.25], [0.3, 1, 0], [0.25, 0, 6.25]]'], {}), '([[0.25, 0.3, 0.25], [0.3, 1, 0], [0.25, 0, 6.25]])\n', (832, 883), True, 'import numpy as np\n'), ((929, 961), 'numpy.array', 'np.array', (['[[1, 0, 1], [0, 1, 0]]'], {}), '([[1, 0, 1], [0, 1, 0]])\n', (937, 961), Tr... |
import sys
import torch
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
sys.path.insert(0,'../')
from neurwin import fcnn
from envs.deadlineSchedulingEnv import deadlineSchedulingEnv
from envs.recoveringBanditsEnv import recoveringBanditsEnv
from envs.sizeAwareIndexEnv impor... | [
"envs.deadlineSchedulingEnv.deadlineSchedulingEnv",
"numpy.random.seed",
"matplotlib.pyplot.show",
"envs.sizeAwareIndexEnv.sizeAwareIndexEnv",
"torch.manual_seed",
"torch.load",
"sys.path.insert",
"numpy.shape",
"envs.recoveringBanditsEnv.recoveringBanditsEnv",
"numpy.random.randint",
"random.se... | [((116, 141), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (131, 141), False, 'import sys\n'), ((716, 836), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(1)', 'ncols': '(3)', 'figsize': '(WIDTH, HEIGHT)', 'gridspec_kw': "{'wspace': 0.13, 'hspace': 0.0}", 'frameon': ... |
import numpy as np
from mne import pick_channels
def get_sub_list(data_dir, allow_all=False):
# TODO Add docstring
# Ask for subject IDs to analyze
print('What IDs are being preprocessed?')
print('(Enter multiple values separated by a comma; e.g., 101,102)')
if allow_all:
print('To proces... | [
"numpy.ceil",
"numpy.logical_and",
"numpy.append",
"numpy.array",
"mne.pick_channels",
"numpy.squeeze"
] | [((987, 1003), 'numpy.squeeze', 'np.squeeze', (['data'], {}), '(data)\n', (997, 1003), True, 'import numpy as np\n'), ((1282, 1294), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1290, 1294), True, 'import numpy as np\n'), ((1531, 1592), 'numpy.logical_and', 'np.logical_and', (['(latencies >= seg_lstart)', '(late... |
try:
import jax
import jax.numpy as np
import jax.experimental.stax as stax
except ModuleNotFoundError:
import warnings
warnings.warn("ksc.backends.jax: Cannot find JAX! This is expected on Windows.")
import numpy as np
# Use relative import to work around a python 3.6 issue
# https://stackov... | [
"numpy.maximum",
"jax.lax.conv_general_dilated",
"warnings.warn",
"numpy.amax",
"numpy.mean",
"numpy.exp",
"numpy.dot",
"jax.nn.sigmoid",
"numpy.sqrt"
] | [((554, 566), 'numpy.dot', 'np.dot', (['x', 'y'], {}), '(x, y)\n', (560, 566), True, 'import numpy as np\n'), ((628, 646), 'numpy.maximum', 'np.maximum', (['x', '(0.0)'], {}), '(x, 0.0)\n', (638, 646), True, 'import numpy as np\n'), ((676, 693), 'jax.nn.sigmoid', 'jax.nn.sigmoid', (['x'], {}), '(x)\n', (690, 693), Fals... |
#
# Fast discrete cosine transform algorithms (Python)
#
# Copyright (c) 2020 Project Nayuki. (MIT License)
# https://www.nayuki.io/page/fast-discrete-cosine-transform-algorithms
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (th... | [
"numpy.array",
"numba.njit",
"numpy.zeros"
] | [((1594, 1606), 'numba.njit', 'numba.njit', ([], {}), '()\n', (1604, 1606), False, 'import numba\n'), ((2791, 2807), 'numpy.zeros', 'np.zeros', (['(8, 8)'], {}), '((8, 8))\n', (2799, 2807), True, 'import numpy as np\n'), ((4159, 4175), 'numpy.zeros', 'np.zeros', (['(8, 8)'], {}), '((8, 8))\n', (4167, 4175), True, 'impo... |
# Simple script to calculate halo/subhalo mass functions from hdf5
#
# ... | [
"matplotlib.pyplot.xscale",
"h5py.File",
"numpy.zeros_like",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.plot",
"numpy.logspace",
"matplotlib.pyplot.legend",
"numpy.histogram",
"numpy.array",
"matplotlib.pyplot.savefig",
"numpy.sqrt"
] | [((775, 800), 'h5py.File', 'h5py.File', (['inputfile', '"""r"""'], {}), "(inputfile, 'r')\n", (784, 800), False, 'import h5py\n'), ((809, 829), 'numpy.array', 'np.array', (["hf['Mvir']"], {}), "(hf['Mvir'])\n", (817, 829), True, 'import numpy as np\n'), ((837, 856), 'numpy.array', 'np.array', (["hf['pid']"], {}), "(hf[... |
from keras.models import Model
from keras.layers import Conv2D, MaxPooling2D, GlobalMaxPooling2D, Input
from keras.utils.data_utils import get_file
import keras.backend as K
import h5py
import numpy as np
import tensorflow as tf
WEIGHTS_PATH_NO_TOP = 'https://github.com/fchollet/deep-learning-models/releases/download/... | [
"h5py.File",
"tensorflow.reverse",
"keras.utils.data_utils.get_file",
"numpy.array",
"keras.layers.Conv2D",
"keras.layers.Input",
"keras.layers.MaxPooling2D"
] | [((390, 426), 'numpy.array', 'np.array', (['[103.939, 116.779, 123.68]'], {}), '([103.939, 116.779, 123.68])\n', (398, 426), True, 'import numpy as np\n'), ((443, 603), 'keras.utils.data_utils.get_file', 'get_file', (['"""vgg19_weights_tf_dim_ordering_tf_kernels_notop.h5"""', 'WEIGHTS_PATH_NO_TOP'], {'cache_subdir': '"... |
from ast import Not
from lib2to3.pytree import convert
from trace import CoverageResults
from pandas import options
import streamlit as st
import cv2 as cv
import numpy as np
import string
import random
from io import BytesIO
import requests
import shutil
import imutils
import streamlit.components.v1 as components
from... | [
"cv2.GaussianBlur",
"streamlit.text_input",
"streamlit.image",
"utils_helpers.convolve",
"streamlit.code",
"cv2.bitwise_and",
"cv2.medianBlur",
"utils_helpers.download_button1",
"numpy.arctan2",
"streamlit.expander",
"streamlit.title",
"utils_helpers.insert_data_mongodb",
"numpy.ones",
"st... | [((1448, 1515), 'streamlit.sidebar.selectbox', 'st.sidebar.selectbox', (['"""Choosse on of the following"""', 'selected_boxes'], {}), "('Choosse on of the following', selected_boxes)\n", (1468, 1515), True, 'import streamlit as st\n'), ((2291, 2304), 'streamlit.columns', 'st.columns', (['(2)'], {}), '(2)\n', (2301, 230... |
'''Plots and example weighting function'''
import numpy as np
import matplotlib.pyplot as plt
import misc
pressure = np.exp(np.linspace(np.log(1000), np.log(5), 300))
H = 8000
q = 0.01
g = 9.81
k = 7
Z = -H*np.log(pressure/1000)/1000
tau = k*q/g * pressure
T= np.exp(-tau)
plt.plot(T, Z, label='Transmissivity')
plt... | [
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.xlim",
"numpy.log",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"misc.stats.lin_av",
"numpy.max",
"numpy.diff",
"numpy.exp",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gcf"
] | [((264, 276), 'numpy.exp', 'np.exp', (['(-tau)'], {}), '(-tau)\n', (270, 276), True, 'import numpy as np\n'), ((278, 316), 'matplotlib.pyplot.plot', 'plt.plot', (['T', 'Z'], {'label': '"""Transmissivity"""'}), "(T, Z, label='Transmissivity')\n", (286, 316), True, 'import matplotlib.pyplot as plt\n'), ((317, 369), 'matp... |
import numpy as np
import taichi as ti
from tests import test_utils
@test_utils.test(arch=ti.vulkan)
def test_ndarray_int():
n = 4
@ti.kernel
def test(pos: ti.types.ndarray(field_dim=1)):
for i in range(n):
pos[i] = 1
sym_pos = ti.graph.Arg(ti.graph.ArgKind.NDARRAY, 'pos', ti.i3... | [
"taichi.ndarray",
"numpy.ones",
"taichi.graph.Arg",
"tests.test_utils.test",
"taichi.graph.GraphBuilder",
"taichi.types.ndarray"
] | [((72, 103), 'tests.test_utils.test', 'test_utils.test', ([], {'arch': 'ti.vulkan'}), '(arch=ti.vulkan)\n', (87, 103), False, 'from tests import test_utils\n'), ((269, 322), 'taichi.graph.Arg', 'ti.graph.Arg', (['ti.graph.ArgKind.NDARRAY', '"""pos"""', 'ti.i32'], {}), "(ti.graph.ArgKind.NDARRAY, 'pos', ti.i32)\n", (281... |
import lasagne, theano, numpy as np, logging
from theano import tensor as T
class Identity(lasagne.init.Initializer):
def sample(self, shape):
return lasagne.utils.floatX(np.eye(*shape))
class RDNN_Dummy:
def __init__(self, nf, kwargs):
pass
def train(self, dsetdat):
import time... | [
"lasagne.layers.ConcatLayer",
"numpy.sum",
"numpy.mean",
"lasagne.layers.get_output",
"lasagne.layers.get_output_shape",
"lasagne.layers.InputLayer",
"lasagne.init.Constant",
"lasagne.layers.set_all_param_values",
"lasagne.updates.total_norm_constraint",
"lasagne.layers.get_all_param_values",
"l... | [((329, 342), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (339, 342), False, 'import time\n'), ((887, 911), 'numpy.random.rand', 'np.random.rand', (['sent_len'], {}), '(sent_len)\n', (901, 911), True, 'import lasagne, theano, numpy as np, logging\n'), ((2311, 2360), 'lasagne.layers.InputLayer', 'lasagne.layers.... |
from __future__ import absolute_import
import numpy as np
from holoviews.element import Violin
from holoviews.operation.stats import univariate_kde
from .testplot import TestMPLPlot, mpl_renderer
class TestMPLViolinPlot(TestMPLPlot):
def test_violin_simple(self):
values = np.random.rand(100)
v... | [
"numpy.random.rand",
"holoviews.element.Violin",
"numpy.random.randint"
] | [((291, 310), 'numpy.random.rand', 'np.random.rand', (['(100)'], {}), '(100)\n', (305, 310), True, 'import numpy as np\n'), ((328, 342), 'holoviews.element.Violin', 'Violin', (['values'], {}), '(values)\n', (334, 342), False, 'from holoviews.element import Violin\n'), ((653, 681), 'numpy.random.randint', 'np.random.ran... |
## 1. Introduction ##
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
data = pd.read_csv('AmesHousing.txt', delimiter="\t")
train = data[0:1460]
test = data[1460:]
features = ['Wood Deck SF', 'Fireplaces', 'Full Bath', '1st Flr SF', 'Garage Area',
'Gr Liv Area', 'Overall Qual']
X = trai... | [
"pandas.read_csv",
"numpy.dot",
"numpy.transpose"
] | [((102, 148), 'pandas.read_csv', 'pd.read_csv', (['"""AmesHousing.txt"""'], {'delimiter': '"""\t"""'}), "('AmesHousing.txt', delimiter='\\t')\n", (113, 148), True, 'import pandas as pd\n'), ((540, 571), 'numpy.dot', 'np.dot', (['first_term', 'second_term'], {}), '(first_term, second_term)\n', (546, 571), True, 'import ... |
import glob
import logging
import os
import sys
import traceback
from functools import partial, reduce
from multiprocessing import Pool, cpu_count
import click
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.decomposition import KernelPCA
from tqdm import tqdm
... | [
"numpy.random.seed",
"matplotlib.pyplot.clf",
"pandas.read_csv",
"click.option",
"pimkl.analysis.significant_pathways",
"pimkl.inducers.read_inducer",
"click.Path",
"multiprocessing.cpu_count",
"pandas.DataFrame",
"pimkl.run.fold_generator",
"traceback.print_exc",
"matplotlib.pyplot.close",
... | [((606, 628), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (619, 628), True, 'import seaborn as sns\n'), ((629, 652), 'seaborn.set_context', 'sns.set_context', (['"""talk"""'], {}), "('talk')\n", (644, 652), True, 'import seaborn as sns\n'), ((11830, 11843), 'click.group', 'click.group', ... |
#!/usr/bin/env python
# coding: utf-8
import dash
from dash.exceptions import PreventUpdate
from dash.dependencies import Input, Output, State
import dash_html_components as html
import dash_core_components as dcc
from dash_canvas import DashCanvas
import os
from dash_canvas.utils import (array_to_data_url, pa... | [
"cv2.GaussianBlur",
"dash_html_components.H2",
"cv2.imdecode",
"base64.b64decode",
"json.dumps",
"dash_core_components.Input",
"cv2.warpAffine",
"glob.glob",
"cv2.rectangle",
"cv2.inRange",
"os.path.join",
"cv2.getRotationMatrix2D",
"cv2.contourArea",
"numpy.zeros_like",
"dash.Dash",
"... | [((864, 879), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (869, 879), False, 'from flask import Flask, send_from_directory\n'), ((887, 911), 'dash.Dash', 'dash.Dash', ([], {'server': 'server'}), '(server=server)\n', (896, 911), False, 'import dash\n'), ((779, 813), 'os.path.exists', 'os.path.exists', ([... |
from keras.models import Model
from keras.layers import Input, Embedding, GRU, Bidirectional, Dense, \
RepeatVector, Masking, concatenate, Reshape, TimeDistributed
from keras.optimizers import SGD, Adagrad, Adam
def seq2seq_simple(input_dic_len=100,
input_len=50,
vector_len=2... | [
"random.randint",
"numpy.argmax",
"keras.preprocessing.sequence.pad_sequences",
"keras.layers.GRU",
"keras.optimizers.Adam",
"random.choice",
"keras.models.Model",
"keras.preprocessing.text.Tokenizer",
"keras.layers.Dense",
"keras.layers.Embedding",
"keras.layers.Input",
"keras.layers.RepeatVe... | [((807, 831), 'keras.layers.Input', 'Input', ([], {'shape': '[input_len]'}), '(shape=[input_len])\n', (812, 831), False, 'from keras.layers import Input, Embedding, GRU, Bidirectional, Dense, RepeatVector, Masking, concatenate, Reshape, TimeDistributed\n'), ((2339, 2352), 'keras.optimizers.Adam', 'Adam', ([], {'lr': '(... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 22 08:40:31 2018
@author: alxgr
"""
import numpy as np
import matplotlib.pyplot as plt
from pyro.dynamic import system
from pyro.analysis import phaseanalysis
from pyro.analysis import simulation
from pyro.analysis import graphical
from pyro.analysis import costfunctio... | [
"matplotlib.pyplot.figure",
"pyro.dynamic.system.ContinuousDynamicSystem.show3",
"matplotlib.pyplot.tight_layout",
"pyro.analysis.costfunction.QuadraticCostFunction.from_sys",
"numpy.meshgrid",
"pyro.analysis.simulation.CLosedLoopSimulator",
"numpy.copy",
"matplotlib.pyplot.colorbar",
"numpy.linspac... | [((1799, 1815), 'numpy.zeros', 'np.zeros', (['self.k'], {}), '(self.k)\n', (1807, 1815), True, 'import numpy as np\n'), ((2251, 2267), 'numpy.zeros', 'np.zeros', (['self.m'], {}), '(self.m)\n', (2259, 2267), True, 'import numpy as np\n'), ((5031, 5057), 'numpy.linspace', 'np.linspace', (['xmin', 'xmax', 'n'], {}), '(xm... |
"""
Created on 19. 3. 2019
This module contains functions that are useful for estimating likelihood that given vector is in a class.
This module could be used for auto importing in a way:
FUNCTIONS=[o for o in getmembers(functions) if isfunction(o[1])]
:author: <NAME>
:contact: <EMAIL>
"""
from scipy.spa... | [
"numpy.average",
"numpy.isinf",
"numpy.errstate",
"numpy.hstack",
"numpy.isnan",
"numpy.where",
"scipy.spatial.cKDTree"
] | [((639, 655), 'scipy.spatial.cKDTree', 'cKDTree', (['samples'], {}), '(samples)\n', (646, 655), False, 'from scipy.spatial import cKDTree\n'), ((1479, 1504), 'numpy.where', 'np.where', (['(samplesVals > 0)'], {}), '(samplesVals > 0)\n', (1487, 1504), True, 'import numpy as np\n'), ((1616, 1642), 'numpy.where', 'np.wher... |
import pandas as pd
import quandl
import math
import numpy as np
from sklearn import preprocessing, cross_validation, svm
from sklearn.linear_model import LinearRegression
data_frame = quandl.get('WIKI/GOOGL')
# limit the columns that we display, and work with from 12 to 6
data_frame = data_frame[['Adj. Open','Adj.... | [
"quandl.get",
"numpy.array",
"sklearn.preprocessing.scale"
] | [((188, 212), 'quandl.get', 'quandl.get', (['"""WIKI/GOOGL"""'], {}), "('WIKI/GOOGL')\n", (198, 212), False, 'import quandl\n'), ((1080, 1109), 'numpy.array', 'np.array', (["data_frame['label']"], {}), "(data_frame['label'])\n", (1088, 1109), True, 'import numpy as np\n'), ((1115, 1137), 'sklearn.preprocessing.scale', ... |
import matplotlib.pyplot as plt
import os
import numpy as np
import yt
from pygrackle import \
FluidContainer, \
chemistry_data, \
evolve_constant_density
from pygrackle.utilities.physical_constants import \
mass_hydrogen_cgs, \
sec_per_Myr, \
cm_per_mpc
import sys
from multiprocessing impor... | [
"numpy.size",
"pygrackle.chemistry_data",
"numpy.meshgrid",
"matplotlib.pyplot.twinx",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"pygrackle.FluidContainer",
"time.time",
"yt.save_as_dataset",
"os.sep.join",
"multiprocessing.Pool",
"pygrackle.evolve_constant_density",
"numpy.log... | [((1584, 1600), 'pygrackle.chemistry_data', 'chemistry_data', ([], {}), '()\n', (1598, 1600), False, 'from pygrackle import FluidContainer, chemistry_data, evolve_constant_density\n'), ((2100, 2172), 'os.sep.join', 'os.sep.join', (["[grackle_dir, 'input', 'CloudyData_UVB=HM2012_shielded.h5']"], {}), "([grackle_dir, 'in... |
__author__ = "<NAME>"
import scipy.ndimage as ndimage
import numpy as np
from matplotlib import pyplot as plt
from scipy.io import wavfile
def GreenSqr(image, center, width):
if not isinstance(image, np.ndarray):
print("GreenSqr: Not a tensor. Was: Image=", image.__class__)
return No... | [
"matplotlib.pyplot.title",
"numpy.ones",
"scipy.io.wavfile.read",
"numpy.sin",
"numpy.float64",
"matplotlib.pyplot.tight_layout",
"numpy.round",
"numpy.pad",
"matplotlib.pyplot.yticks",
"scipy.io.wavfile.write",
"numpy.max",
"matplotlib.pyplot.xticks",
"numpy.uint8",
"numpy.median",
"num... | [((3331, 3343), 'numpy.sin', 'np.sin', (['time'], {}), '(time)\n', (3337, 3343), True, 'import numpy as np\n'), ((4256, 4291), 'scipy.ndimage.convolve', 'ndimage.convolve', (['signal', 'mafFilter'], {}), '(signal, mafFilter)\n', (4272, 4291), True, 'import scipy.ndimage as ndimage\n'), ((4675, 4713), 'numpy.pad', 'np.p... |
"""
???+ note "High-level functions to produce an interactive annotation interface."
Experimental recipes whose function signatures might change significantly in the future. Use with caution.
"""
from bokeh.layouts import row, column
from bokeh.models import Button, Slider
from .subroutine import (
standard_ann... | [
"wasabi.msg.info",
"bokeh.models.Slider",
"bokeh.models.Button",
"wasabi.msg.good",
"numpy.swapaxes",
"hover.utils.bokeh_helper.servable"
] | [((498, 534), 'hover.utils.bokeh_helper.servable', 'servable', ([], {'title': '"""Snorkel Crosscheck"""'}), "(title='Snorkel Crosscheck')\n", (506, 534), False, 'from hover.utils.bokeh_helper import servable\n'), ((2057, 2090), 'hover.utils.bokeh_helper.servable', 'servable', ([], {'title': '"""Active Learning"""'}), "... |
import matplotlib.pyplot as plt
from matplotlib import style
import numpy as np
fig =plt.figure()
x,y = np.loadtxt('test.txt', delimiter=',',unpack=True)
x2,y2=np.loadtxt('test2.txt', delimiter=',',unpack=True)
ax1 = plt.subplot2grid((1,1), (0,0))
ax1.grid(True)
ax1.text(x2[3],y2[3],'example')
ax1.annotate('Good!',(... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.style.use",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.subplot2grid",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"mat... | [((86, 98), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (96, 98), True, 'import matplotlib.pyplot as plt\n'), ((106, 156), 'numpy.loadtxt', 'np.loadtxt', (['"""test.txt"""'], {'delimiter': '""","""', 'unpack': '(True)'}), "('test.txt', delimiter=',', unpack=True)\n", (116, 156), True, 'import numpy as n... |
import pygame
from numpy import interp
pygame.init()
leveys = 600
korkeus = 600
display = pygame.display.set_mode((korkeus, leveys))
pygame.display.set_caption("ZzzZzz")
clock = pygame.time.Clock()
class Viiva:
def __init__(self, x, y):
self.x = x
self.y = y
self.suunta =... | [
"pygame.quit",
"pygame.draw.circle",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.Color",
"pygame.init",
"pygame.display.update",
"numpy.interp",
"pygame.display.set_caption",
"pygame.time.Clock"
] | [((43, 56), 'pygame.init', 'pygame.init', ([], {}), '()\n', (54, 56), False, 'import pygame\n'), ((99, 141), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(korkeus, leveys)'], {}), '((korkeus, leveys))\n', (122, 141), False, 'import pygame\n'), ((143, 179), 'pygame.display.set_caption', 'pygame.display.set_c... |
"""
This file is part of Cytometer
Copyright 2021 Medical Research Council
SPDX-License-Identifier: Apache-2.0
Author: <NAME> <<EMAIL>>
"""
# cross-platform home directory
from pathlib import Path
home = str(Path.home())
# PyCharm automatically adds cytometer to the python path, but this doesn't happen if the script ... | [
"keras.models.load_model",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.title",
"pathlib.Path.home",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.imshow",
"tensorflow.Session",
"numpy.ones",
"keras.backend.set_image_data_format",
"tensorflow.ConfigProto",
"pickle.lo... | [((707, 723), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (721, 723), True, 'import tensorflow as tf\n'), ((1289, 1329), 'keras.backend.set_image_data_format', 'K.set_image_data_format', (['"""channels_last"""'], {}), "('channels_last')\n", (1312, 1329), True, 'import keras.backend as K\n'), ((1392, 1... |
import numpy as np
def conv_forward_naive(x,weight,b,parameters):
pad = parameters['pad']
stride = parameters['stride']
(m, n_h, n_w, n_C_prev) = x.shape
(f,f, n_C_prev, n_C) = weight.shape
n_H = int(1 + (n_h + 2 * pad - f) / stride)
n_W = int(1 + (n_w + 2 * pad - f) / stride)
x_prev_pad = np.pad(x, (... | [
"numpy.pad",
"numpy.maximum",
"numpy.sum",
"numpy.log",
"numpy.multiply",
"numpy.zeros",
"numpy.max",
"numpy.array",
"numpy.exp",
"numpy.squeeze",
"numpy.sqrt"
] | [((309, 395), 'numpy.pad', 'np.pad', (['x', '((0, 0), (pad, pad), (pad, pad), (0, 0))', '"""constant"""'], {'constant_values': '(0)'}), "(x, ((0, 0), (pad, pad), (pad, pad), (0, 0)), 'constant',\n constant_values=0)\n", (315, 395), True, 'import numpy as np\n'), ((391, 419), 'numpy.zeros', 'np.zeros', (['(m, n_H, n_... |
import numpy as np
from xengine.colors import *
from xengine.types import UNDEFINED
class Point(list):
def __init__(self, x = 0, y = 0, z = 0, RGBA = WHITE):
super().__init__([x, y, z, RGBA])
self.vertices = np.array([x, y, z], dtype=np.float32)
self.color = np.array([RGBA[0], RGBA[1... | [
"numpy.array"
] | [((235, 272), 'numpy.array', 'np.array', (['[x, y, z]'], {'dtype': 'np.float32'}), '([x, y, z], dtype=np.float32)\n', (243, 272), True, 'import numpy as np\n'), ((295, 359), 'numpy.array', 'np.array', (['[RGBA[0], RGBA[1], RGBA[2], RGBA[3]]'], {'dtype': 'np.float32'}), '([RGBA[0], RGBA[1], RGBA[2], RGBA[3]], dtype=np.f... |
import cv2 as cv
import numpy as np
import torch
import os
import random
import albumentations as A
import torchvision
# Set random seed for reproducibility
manualSeed = 999
# manualSeed = random.randint(1, 10000) # use if you want new results
print("Random Seed: ", manualSeed)
random.seed(manualSeed)
torch.manual_seed... | [
"numpy.zeros_like",
"random.randint",
"cv2.cvtColor",
"torch.manual_seed",
"cv2.imread",
"random.seed",
"torchvision.transforms.Normalize",
"os.listdir",
"torch.from_numpy"
] | [((279, 302), 'random.seed', 'random.seed', (['manualSeed'], {}), '(manualSeed)\n', (290, 302), False, 'import random\n'), ((303, 332), 'torch.manual_seed', 'torch.manual_seed', (['manualSeed'], {}), '(manualSeed)\n', (320, 332), False, 'import torch\n'), ((521, 542), 'os.listdir', 'os.listdir', (['self.path'], {}), '(... |
import mxnet as mx
import logging
import numpy as np
import argparse
from ShuffleNet import get_shufflenet
# logging.getLogger().setLevel(logging.INFO)
logging.basicConfig(level=logging.DEBUG)
#数据路径
train_data = np.concatenate((mnist['train_data'], mnist['train_data'], mnist['train_data']),
... | [
"argparse.ArgumentParser",
"numpy.concatenate",
"logging.basicConfig",
"importlib.import_module",
"mxnet.io.NDArrayIter",
"mxnet.gpu",
"ShuffleNet.get_shufflenet"
] | [((153, 193), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (172, 193), False, 'import logging\n'), ((214, 306), 'numpy.concatenate', 'np.concatenate', (["(mnist['train_data'], mnist['train_data'], mnist['train_data'])"], {'axis': '(1)'}), "((mnist['train_dat... |
import logging
import os
import torch
from torch.utils.model_zoo import tqdm
import random
import numpy as np
from dataset import *
from torch.utils.data import DataLoader
import torch.nn.functional as F
import eval_metrics as em
from evaluate_tDCF_asvspoof19 import compute_eer_and_tdcf
from utils import setup_seed
imp... | [
"utils.setup_seed",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"os.path.basename",
"torch.load",
"eval_metrics.compute_eer",
"numpy.genfromtxt",
"torch.utils.model_zoo.tqdm",
"torch.nn.functional.softmax",
"torch.cat",
"torch.cuda.is_available",
"torch.device",
"torch.zeros",
... | [((518, 562), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""load model scores"""'], {}), "('load model scores')\n", (541, 562), False, 'import argparse\n'), ((2198, 2219), 'utils.setup_seed', 'setup_seed', (['args.seed'], {}), '(args.seed)\n', (2208, 2219), False, 'from utils import setup_seed\n'), ((2253... |
import os
import numpy as np
import torch.utils.data as torch_data
import lib.utils.calibration as calibration
import lib.utils.kitti_utils as kitti_utils
from PIL import Image
import argoverse
#from argoverse.data_loading.argoverse_tracking_loader import ArgoverseTrackingLoader
import lib.datasets.ground_segmentation ... | [
"numpy.fromfile",
"os.path.exists",
"lib.datasets.ground_segmentation.ground_segmentation",
"numpy.array",
"numpy.dot",
"os.path.join",
"os.listdir"
] | [((569, 617), 'os.path.join', 'os.path.join', (['root_dir', '"""sample/argoverse/lidar"""'], {}), "(root_dir, 'sample/argoverse/lidar')\n", (581, 617), False, 'import os\n'), ((643, 672), 'os.listdir', 'os.listdir', (['self.imageset_dir'], {}), '(self.imageset_dir)\n', (653, 672), False, 'import os\n'), ((901, 1038), '... |
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import style
from matplotlib import cm
import numpy as np
data = np.loadtxt("onda.dat")
fig=plt.figure(figsize=(15,5))
ax1 = fig.add_subplot(111,projection='3d')
x, y=np.mgrid[0:data.shape[0], 0:data.shape[1]]
print(np.shape(x), n... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((154, 176), 'numpy.loadtxt', 'np.loadtxt', (['"""onda.dat"""'], {}), "('onda.dat')\n", (164, 176), True, 'import numpy as np\n'), ((182, 209), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(15, 5)'}), '(figsize=(15, 5))\n', (192, 209), True, 'import matplotlib.pyplot as plt\n'), ((402, 433), 'matplotlib... |
import os
import os.path as osp
import numpy as np
from PIL import Image
import torch
# import torchvision
from torch.utils import data
import glob
class DAVIS_MO_Test(data.Dataset):
# for multi object, do shuffling
def __init__(self, root, imset='2017/train.txt', resolution='480p', single_object=False, max... | [
"numpy.empty",
"numpy.zeros",
"os.path.exists",
"PIL.Image.open",
"numpy.shape",
"numpy.max",
"os.path.join",
"os.listdir"
] | [((383, 428), 'os.path.join', 'os.path.join', (['root', '"""Annotations"""', 'resolution'], {}), "(root, 'Annotations', resolution)\n", (395, 428), False, 'import os\n'), ((456, 497), 'os.path.join', 'os.path.join', (['root', '"""Annotations"""', '"""480p"""'], {}), "(root, 'Annotations', '480p')\n", (468, 497), False,... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
*Copyright (c) 2015, <NAME>*
All rights reserved.
See the LICENSE file for license information.
odeintw
=======
`odeintw` provides a wrapper of `scipy.integrate.odeint` that allows it to
handle complex and matrix differential equations. That is, it can solve
equati... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.legend",
"numpy.zeros",
"odeintw.odeintw",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid"
] | [((1106, 1136), 'numpy.array', 'np.array', (['[1 + 2.0j, 3 + 4.0j]'], {}), '([1 + 2.0j, 3 + 4.0j])\n', (1114, 1136), True, 'import numpy as np\n'), ((1175, 1197), 'numpy.linspace', 'np.linspace', (['(0)', '(5)', '(101)'], {}), '(0, 5, 101)\n', (1186, 1197), True, 'import numpy as np\n'), ((1268, 1334), 'odeintw.odeintw... |
import time
import os
import sys
import numpy as np
from getting_data import load_sample, feature_key_list, get_categorical_encoded_data, decode_paper
from ranker_helper import get_scores, start_record_paper_count, end_record_paper_count, processing_log
from s2search_score_pdp import save_pdp_to_npz
from anchor import ... | [
"os.mkdir",
"numpy.load",
"getting_data.decode_paper",
"getting_data.load_sample",
"os.path.join",
"ranker_helper.end_record_paper_count",
"logging.FileHandler",
"os.path.exists",
"datetime.timedelta",
"datetime.datetime.now",
"s2search_score_pdp.save_pdp_to_npz",
"ranker_helper.start_record_p... | [((402, 435), 'pytz.timezone', 'pytz.timezone', (['"""America/Montreal"""'], {}), "('America/Montreal')\n", (415, 435), False, 'import pytz\n'), ((1480, 1587), 'os.path.join', 'os.path.join', (['output_exp_dir', '"""scores"""', 'f"""{output_data_sample_name}_anchor_metrics_{rg[0]}_{rg[1]}.npz"""'], {}), "(output_exp_di... |
from dataclasses import dataclass
import numpy as np
from loguru import logger
def centroid_to_bvol(centers, bvol_dim=(10, 10, 10), flipxy=False):
"""Centroid to bounding volume
Parameters
----------
centers : np.ndarray, (nx3)
3d coordinates of the point to use as the centroid... | [
"numpy.stack",
"numpy.meshgrid",
"numpy.abs",
"numpy.zeros_like",
"numpy.ceil",
"numpy.zeros",
"loguru.logger.info",
"numpy.max",
"numpy.random.random",
"numpy.min",
"numpy.array",
"numpy.linspace",
"numpy.where",
"numpy.delete"
] | [((3719, 3778), 'numpy.linspace', 'np.linspace', (['(0)', '(padded_vol.shape[0] - 2 * padding[0])', 'z_dim'], {}), '(0, padded_vol.shape[0] - 2 * padding[0], z_dim)\n', (3730, 3778), True, 'import numpy as np\n'), ((3795, 3854), 'numpy.linspace', 'np.linspace', (['(0)', '(padded_vol.shape[1] - 2 * padding[1])', 'x_dim'... |
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
from datetime import datetime
from dlimage.mnist import MNISTLoader
def vectorize(j):
e = np.zeros(10)
e[j] = 1.0
return e
mndata = MNISTLoader('dlimag... | [
"keras.optimizers.SGD",
"numpy.zeros",
"keras.layers.Dense",
"dlimage.mnist.MNISTLoader",
"keras.models.Sequential",
"datetime.datetime.now"
] | [((301, 334), 'dlimage.mnist.MNISTLoader', 'MNISTLoader', (['"""dlimage/mnist/data"""'], {}), "('dlimage/mnist/data')\n", (312, 334), False, 'from dlimage.mnist import MNISTLoader\n'), ((641, 674), 'dlimage.mnist.MNISTLoader', 'MNISTLoader', (['"""dlimage/mnist/data"""'], {}), "('dlimage/mnist/data')\n", (652, 674), Fa... |
import numpy as np
import pytest
import mbuild as mb
from mbuild.tests.base_test import BaseTest
class TestLattice(BaseTest):
"""
Unit Tests for Lattice class functionality.
"""
@pytest.mark.parametrize(
"spacing",
[
([1, 1, 1]),
([0.1, 0.1, 0.1]),
... | [
"mbuild.Lattice",
"mbuild.Compound",
"numpy.asarray",
"mbuild.Box",
"numpy.allclose",
"numpy.identity",
"numpy.split",
"pytest.raises",
"numpy.reshape",
"pytest.mark.parametrize",
"numpy.testing.assert_allclose"
] | [((199, 303), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""spacing"""', "[[1, 1, 1], [0.1, 0.1, 0.1], ['1', '1', '1'], ['1', 0.1, '0.1']]"], {}), "('spacing', [[1, 1, 1], [0.1, 0.1, 0.1], ['1', '1',\n '1'], ['1', 0.1, '0.1']])\n", (222, 303), False, 'import pytest\n'), ((780, 873), 'pytest.mark.parame... |
""" Training methods for the Naive Bayes model on the Web of Science dataset.
"""
import os
from pathlib import Path
from joblib import dump
import numpy as np
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
import utils
from constants.transformers import TransformerModel
from stre... | [
"sklearn.naive_bayes.GaussianNB",
"os.makedirs",
"warnings.filterwarnings",
"os.path.isdir",
"numpy.amax",
"streams.stream_data.WOSStream",
"pathlib.Path",
"numpy.arange",
"utils.metrics.get_metrics",
"os.path.join"
] | [((408, 441), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (431, 441), False, 'import warnings\n'), ((515, 534), 'os.path.isdir', 'os.path.isdir', (['PATH'], {}), '(PATH)\n', (528, 534), False, 'import os\n'), ((540, 557), 'os.makedirs', 'os.makedirs', (['PATH'], {}), '(... |
import math
import numpy as np
import scipy.misc
import tensorflow as tf
class Container(object):
"""Dumb container object"""
def __init__(self, dictionary):
self.__dict__.update(dictionary)
def _edge_filter():
"""Returns a 3x3 edge-detection functionally filter similar to Sobel"""
# See http... | [
"tensorflow.unpack",
"math.sqrt",
"tensorflow.image.resize_nearest_neighbor",
"tensorflow.image.random_contrast",
"tensorflow.image.random_saturation",
"numpy.transpose",
"numpy.zeros",
"tensorflow.add",
"tensorflow.reduce_mean",
"tensorflow.constant",
"tensorflow.image.random_flip_left_right",
... | [((465, 479), 'math.sqrt', 'math.sqrt', (['(0.5)'], {}), '(0.5)\n', (474, 479), False, 'import math\n'), ((556, 578), 'numpy.zeros', 'np.zeros', (['[3, 3, 3, 3]'], {}), '([3, 3, 3, 3])\n', (564, 578), True, 'import numpy as np\n'), ((758, 792), 'numpy.transpose', 'np.transpose', (['h'], {'axes': '[1, 0, 2, 3]'}), '(h, ... |
import sdf
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('seaborn-paper')
plt.rcParams['font.size'] = 24
def cm2inch(value):
return value/2.54
Num = 26
TeS1 = np.ones(Num)
TeS2 = np.ones(Num)
TeS3 = np.ones(Num)
part1 = np.ones(Num)
part2 = np.ones(Num)
pho1 = np.ones(Num)
pho2 = np.ones(Num)... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xlim",
"numpy.sum",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"sdf.read",
"numpy.ones",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"... | [((63, 93), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-paper"""'], {}), "('seaborn-paper')\n", (76, 93), True, 'import matplotlib.pyplot as plt\n'), ((186, 198), 'numpy.ones', 'np.ones', (['Num'], {}), '(Num)\n', (193, 198), True, 'import numpy as np\n'), ((206, 218), 'numpy.ones', 'np.ones', (['Num'... |
import torch
import torch.optim as optim
import torch.nn.functional as F
import torch.nn as nn
import torchvision
import time
import numpy as np
import progressbar
from torchvision import transforms
from torch.utils.data.sampler import SubsetRandomSampler
transform = transforms.Compose([
transforms.Resize(64),
... | [
"torch.nn.Dropout",
"torch.utils.data.DataLoader",
"torch.nn.Conv2d",
"torch.nn.CrossEntropyLoss",
"time.ctime",
"time.time",
"torchvision.datasets.ImageFolder",
"torchvision.transforms.ToTensor",
"torch.cuda.is_available",
"numpy.arange",
"torch.nn.functional.max_pool2d",
"torch.nn.Linear",
... | [((616, 705), 'torchvision.datasets.ImageFolder', 'torchvision.datasets.ImageFolder', ([], {'root': '"""./data/augmented/train"""', 'transform': 'transform'}), "(root='./data/augmented/train', transform=\n transform)\n", (648, 705), False, 'import torchvision\n'), ((716, 818), 'torch.utils.data.DataLoader', 'torch.u... |
from pytesseract import *
import cv2
import os
import re
import numpy as np
import difflib
from difflib import SequenceMatcher
def img_similarity(img1, img2):
#gray1 = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
#gray2 = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY)
#data1 = gray1.flatten()
#data2 = gray2.fl... | [
"cv2.bitwise_not",
"difflib.Differ",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.threshold",
"cv2.destroyAllWindows",
"difflib.SequenceMatcher",
"cv2.bilateralFilter",
"cv2.imread",
"numpy.isclose",
"cv2.addWeighted",
"numpy.array",
"numpy.vstack",
"cv2.resizeWindow",
"cv2.imshow",
"re.sub",
... | [((583, 609), 'os.listdir', 'os.listdir', (['"""src/extract/"""'], {}), "('src/extract/')\n", (593, 609), False, 'import os\n'), ((640, 665), 'os.listdir', 'os.listdir', (['"""src/thumbs/"""'], {}), "('src/thumbs/')\n", (650, 665), False, 'import os\n'), ((785, 801), 'difflib.Differ', 'difflib.Differ', ([], {}), '()\n'... |
from math import pi
import numpy as np
from aleph.consts import *
from reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD import svOsuMeasureLineMD, SvOsuMeasureLineEvent
from reamber.osu.OsuBpm import OsuBpm, MIN_BPM
from reamber.osu.OsuMap import OsuMap
COS_POWER = 2
def f950(m: OsuMap):
FIRST = 375... | [
"reamber.osu.OsuBpm.OsuBpm",
"numpy.cos",
"numpy.linspace",
"reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD.svOsuMeasureLineMD"
] | [((996, 1131), 'reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD.svOsuMeasureLineMD', 'svOsuMeasureLineMD', ([], {'events': 'events', 'scalingFactor': 'SCALE', 'firstOffset': 'first', 'lastOffset': 'last', 'paddingSize': '(PADDING * e)', 'endBpm': 'MIN_BPM'}), '(events=events, scalingFactor=SCALE, firstOffs... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# step 1: read the dataset
columns = ['unitid', 'time', 'set_1','set_2','set_3']
columns.extend(['sensor_' + str(i) for i in range(1,22)])
df = pd.read_csv('./data/train_FD001.txt', delim_whitespace=True,names=columns)
print(df.head())
#step 2: ... | [
"pandas.DataFrame",
"matplotlib.pyplot.subplot",
"numpy.random.seed",
"numpy.multiply",
"matplotlib.pyplot.show",
"pandas.read_csv",
"seaborn.tsplot",
"sklearn.preprocessing.MinMaxScaler",
"scipy.stats.pearsonr",
"sklearn.ensemble.RandomForestRegressor",
"keras.layers.Dense",
"numpy.array",
... | [((216, 291), 'pandas.read_csv', 'pd.read_csv', (['"""./data/train_FD001.txt"""'], {'delim_whitespace': '(True)', 'names': 'columns'}), "('./data/train_FD001.txt', delim_whitespace=True, names=columns)\n", (227, 291), True, 'import pandas as pd\n'), ((324, 366), 'pandas.set_option', 'pd.set_option', (['"""display.max_c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.