code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
Vector class for 1D heat problem
Note: values at two consecutive time points are grouped as pairs
"""
import numpy as np
from pymgrit.core.vector import Vector
class VectorHeat1D2Pts(Vector):
"""
Vector class for grouping values at two consecutive time points
"""
def __init__(self, size, dtau)... | [
"numpy.array",
"numpy.append",
"numpy.random.rand",
"numpy.zeros"
] | [((702, 716), 'numpy.zeros', 'np.zeros', (['size'], {}), '(size)\n', (710, 716), True, 'import numpy as np\n'), ((757, 771), 'numpy.zeros', 'np.zeros', (['size'], {}), '(size)\n', (765, 771), True, 'import numpy as np\n'), ((3625, 3696), 'numpy.array', 'np.array', (['[self.values_first_time_point, self.values_second_ti... |
# coding: utf-8
import numpy as np
import csv
import codecs
import os
import glob
from collections import defaultdict
SPACE = " "
EMPTY = " "
INV_PUNCTUATION_CODES = {EMPTY:0, SPACE:0, ',':1, '.':2, '?':3, '!':4, '-':5, ';':6, ':':7, '...':8, '':0}
PUNCTUATION_VOCABULARY = {0:SPACE, 1:',', 2:'.', 3:'?', 4:'!', 5:'-', ... | [
"codecs.open",
"os.makedirs",
"os.path.isdir",
"csv.DictReader",
"collections.defaultdict",
"os.path.isfile",
"numpy.arange",
"numpy.array"
] | [((920, 937), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (931, 937), False, 'from collections import defaultdict\n'), ((2497, 2518), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(0.05)'], {}), '(0, 1, 0.05)\n', (2506, 2518), True, 'import numpy as np\n'), ((2780, 2837), 'numpy.array', 'np.ar... |
import os
import numpy as np
from keras import backend as K
from keras.losses import mean_absolute_error
import utils
from model import wdsr_b
def psnr(hr, sr, max_val=2):
mse = K.mean(K.square(hr - sr))
return 10.0 / np.log(10) * K.log(max_val ** 2 / mse)
def data_generator(path, batch_size=8, input_shap... | [
"utils.normalization",
"utils.pair",
"numpy.log",
"keras.backend.log",
"numpy.array",
"model.wdsr_b",
"keras.backend.square",
"os.path.join",
"os.listdir",
"numpy.random.shuffle"
] | [((946, 954), 'model.wdsr_b', 'wdsr_b', ([], {}), '()\n', (952, 954), False, 'from model import wdsr_b\n'), ((389, 405), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (399, 405), False, 'import os\n'), ((193, 210), 'keras.backend.square', 'K.square', (['(hr - sr)'], {}), '(hr - sr)\n', (201, 210), True, 'from... |
#!/usr/bin/env python
import numpy as np
import sys
sys.path.append("../ar/")
import fastopc, time
import functionLib as lib
import micStream
nStrips = 16
lStrip = 64
client = fastopc.FastOPC('localhost:7890')
pixels = lib.Pixels(nStrips, lStrip, 0)
theoStrip = np.zeros([lStrip, 3])
stream = micStream.Stream(fps... | [
"sys.path.append",
"numpy.sum",
"numpy.zeros",
"functionLib.Pixels",
"numpy.mod",
"functionLib.ExpFilter",
"fastopc.FastOPC",
"micStream.Stream",
"functionLib.getColorWheel"
] | [((53, 78), 'sys.path.append', 'sys.path.append', (['"""../ar/"""'], {}), "('../ar/')\n", (68, 78), False, 'import sys\n'), ((178, 211), 'fastopc.FastOPC', 'fastopc.FastOPC', (['"""localhost:7890"""'], {}), "('localhost:7890')\n", (193, 211), False, 'import fastopc, time\n'), ((225, 255), 'functionLib.Pixels', 'lib.Pix... |
import tensorflow as tf
try:
# the endless shuffle of keras modules
import tensorflow.keras as keras
from tensorflow.keras import layers
print("Using TF-Keras version:", keras.__version__)
except ImportError:
import keras
import keras.layers as layers
print("Using Keras version:", keras.__ve... | [
"keras.regularizers.l2",
"math.sqrt",
"numpy.float32",
"tensorflow.add",
"keras.layers.LayerNormalization",
"keras.layers.Concatenate",
"tensorflow.matmul",
"tensorflow.cast",
"keras.layers.ReLU",
"keras.layers.Dense",
"numpy.sin",
"numpy.cos",
"keras.layers.Permute",
"numpy.arange",
"ke... | [((1789, 1813), 'keras.layers.Dense', 'layers.Dense', (['self.units'], {}), '(self.units)\n', (1801, 1813), True, 'import keras.layers as layers\n'), ((1833, 1860), 'keras.layers.BatchNormalization', 'layers.BatchNormalization', ([], {}), '()\n', (1858, 1860), True, 'import keras.layers as layers\n'), ((1881, 1894), 'k... |
"""Functions that work on collections of shapes
"""
from __future__ import division, print_function
import numpy as np
from .convex import convex_area, convex_centroid
__all__ = ['recenter_polygon', 'centroid_for_shapes',
'centroid_for_uncomputed_shapes', 'recenter_system',
'rescale_and_recenter... | [
"numpy.zeros",
"numpy.sin",
"numpy.array",
"numpy.cos",
"numpy.dot",
"numpy.sqrt"
] | [((1354, 1365), 'numpy.zeros', 'np.zeros', (['(2)'], {}), '(2)\n', (1362, 1365), True, 'import numpy as np\n'), ((1554, 1566), 'numpy.array', 'np.array', (['gc'], {}), '(gc)\n', (1562, 1566), True, 'import numpy as np\n'), ((4369, 4396), 'numpy.sqrt', 'np.sqrt', (['(total_area / tot_a)'], {}), '(total_area / tot_a)\n',... |
from sympy import Rational, Symbol, latex, UnevaluatedExpr
import sympy as sp
import numpy as np
u = lambda x : UnevaluatedExpr(x)
# Helper functions
def explain_add(a, b):
assert(np.shape(a) == np.shape(b))
rows, columns = np.shape(a)
return sp.Matrix([[Symbol(f"({latex(u(a[i,j]))} + {latex(u(b[i,j]))})"... | [
"sympy.Symbol",
"numpy.empty",
"sympy.UnevaluatedExpr",
"sympy.Matrix",
"numpy.shape"
] | [((113, 131), 'sympy.UnevaluatedExpr', 'UnevaluatedExpr', (['x'], {}), '(x)\n', (128, 131), False, 'from sympy import Rational, Symbol, latex, UnevaluatedExpr\n'), ((234, 245), 'numpy.shape', 'np.shape', (['a'], {}), '(a)\n', (242, 245), True, 'import numpy as np\n'), ((1001, 1046), 'numpy.empty', 'np.empty', ([], {'sh... |
##
# Copyright 2018, <NAME>
# Licensed under MIT.
# Since: v1.0.0
##
import time
import cv2
import numpy as np
from src.common.package.config import application
from src.opencv.package.config import application as _application
from src.common.package.http import server as _server
from src.common.package.http.handler i... | [
"src.opencv.package.opencv.opencv.OpenCV",
"cv2.cvtColor",
"src.common.package.http.handler.Handler.stream",
"time.sleep",
"src.common.package.http.server.Server",
"src.common.package.frame.draw.Draw.rectangle",
"numpy.array",
"cv2.imencode",
"src.common.package.camera.capture.Capture",
"time.loca... | [((591, 599), 'src.opencv.package.opencv.opencv.OpenCV', 'OpenCV', ([], {}), '()\n', (597, 599), False, 'from src.opencv.package.opencv.opencv import OpenCV\n'), ((860, 880), 'src.common.package.http.handler.Handler.stream', 'Handler.stream', (['self'], {}), '(self)\n', (874, 880), False, 'from src.common.package.http.... |
# *****************************************************************************
# Copyright (c) 2020, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sou... | [
"numpy.random.rand",
"numpy.random.randint",
"sys.stdout.flush",
"argparse.ArgumentParser"
] | [((2141, 2171), 'numpy.random.rand', 'np.random.rand', (['nopt', 'data_dim'], {}), '(nopt, data_dim)\n', (2155, 2171), True, 'import numpy as np\n'), ((2238, 2279), 'numpy.random.randint', 'np.random.randint', (['classes_num'], {'size': 'nopt'}), '(classes_num, size=nopt)\n', (2255, 2279), True, 'import numpy as np\n')... |
#!/usr/bin/env python2
#Author: <NAME>
import itertools
import numpy as np
from operator import mul
from sklearn.linear_model import LinearRegression
if __name__ == '__main__':
#read input
f, n = map(int, raw_input().split())
X = []
y = []
for _ in range(n):
line = raw_input().split()
... | [
"sklearn.linear_model.LinearRegression",
"numpy.array"
] | [((578, 589), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (586, 589), True, 'import numpy as np\n'), ((599, 611), 'numpy.array', 'np.array', (['Xt'], {}), '(Xt)\n', (607, 611), True, 'import numpy as np\n'), ((914, 932), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (930, 932), Fal... |
import logging
import numpy as np
from fbpca import pca
from scipy.stats import norm
from .sparseutils import nonzero_mean, nonzero_std, find_zeroed_indices
log = logging.getLogger("ALRA")
def choose_k(X, k=100, pval_thresh=1e-10, noise_start=80, n_iter=2):
if k > min(X.shape):
raise ValueError(
... | [
"numpy.std",
"scipy.stats.norm.pdf",
"fbpca.pca",
"numpy.isnan",
"numpy.min",
"numpy.mean",
"numpy.diff",
"numpy.ma.masked_array",
"numpy.argwhere",
"logging.getLogger"
] | [((165, 190), 'logging.getLogger', 'logging.getLogger', (['"""ALRA"""'], {}), "('ALRA')\n", (182, 190), False, 'import logging\n'), ((570, 606), 'fbpca.pca', 'pca', (['X'], {'k': 'k', 'n_iter': 'n_iter', 'raw': '(True)'}), '(X, k=k, n_iter=n_iter, raw=True)\n', (573, 606), False, 'from fbpca import pca\n'), ((626, 636)... |
import numpy as np
import torch
from torch import nn
from rlkit.policies.base import ExplorationPolicy, Policy
from rlkit.torch.core import eval_np
from rlkit.torch.distributions import TanhNormal
from rlkit.torch.networks import Mlp
from rlkit.torch.modules import Attention, preprocess_attention_input
LOG_SIG_MAX =... | [
"rlkit.torch.modules.Attention",
"rlkit.torch.distributions.TanhNormal",
"torch.nn.ReLU",
"numpy.log",
"torch.exp",
"rlkit.torch.core.eval_np",
"torch.clamp",
"torch.nn.init.zeros_",
"rlkit.torch.modules.preprocess_attention_input",
"torch.nn.Linear",
"torch.no_grad",
"torch.tanh"
] | [((6195, 6256), 'rlkit.torch.modules.Attention', 'Attention', (['embed_dim', 'z_goal_size', 'z_size'], {}), '(embed_dim, z_goal_size, z_size, **attention_kwargs)\n', (6204, 6256), False, 'from rlkit.torch.modules import Attention, preprocess_attention_input\n'), ((7027, 7104), 'rlkit.torch.modules.preprocess_attention_... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier, BaggingClassifier
def plotSensores():
### Letra A
df_a = pd.read_csv("data/bernardo/bernardo-A-3-emg.csv")
df_a_... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"pandas.read_csv",
"numpy.genfromtxt",
"matplotlib.pyplot.figure",
"pandas.Series",
"matplotlib.pyplot.subplots"
] | [((260, 309), 'pandas.read_csv', 'pd.read_csv', (['"""data/bernardo/bernardo-A-3-emg.csv"""'], {}), "('data/bernardo/bernardo-A-3-emg.csv')\n", (271, 309), True, 'import pandas as pd\n'), ((326, 405), 'numpy.genfromtxt', 'np.genfromtxt', (['"""data/bernardo/bernardo-A-3-avg.csv"""'], {'delimiter': '""","""', 'dtype': '... |
#!/usr/bin/env python3
import yaml
import numpy as np
def read_evals(fyml):
with open(fyml, 'r') as f:
evd = yaml.safe_load(f)
elist = evd['evals']
return np.array(elist)
def main():
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('nup', type=int)
parser.add_argumen... | [
"yaml.safe_load",
"numpy.where",
"numpy.array",
"argparse.ArgumentParser"
] | [((166, 181), 'numpy.array', 'np.array', (['elist'], {}), '(elist)\n', (174, 181), True, 'import numpy as np\n'), ((244, 260), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (258, 260), False, 'from argparse import ArgumentParser\n'), ((116, 133), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\n'... |
# Copyright 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | [
"numba_dppy.dpctl_functions.malloc_shared",
"numba_dppy.dpnp_glue.dpnpimpl.dpnp_func",
"numba_dppy.dpctl_functions.get_current_queue",
"numpy.zeros",
"numba.core.typing.signature",
"numpy.ones",
"numba_dppy.dpctl_functions.queue_memcpy",
"numba_dppy.dpnp.diagonal",
"numpy.arange",
"numba_dppy.dpnp... | [((2525, 2556), 'numba.core.extending.overload', 'overload', (['stubs.dpnp.zeros_like'], {}), '(stubs.dpnp.zeros_like)\n', (2533, 2556), False, 'from numba.core.extending import overload, register_jitable\n'), ((3489, 3519), 'numba.core.extending.overload', 'overload', (['stubs.dpnp.ones_like'], {}), '(stubs.dpnp.ones_... |
"""
Copyright (c) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | [
"numpy.load"
] | [((6591, 6607), 'numpy.load', 'np.load', (['ref_ark'], {}), '(ref_ark)\n', (6598, 6607), True, 'import numpy as np\n'), ((8030, 8053), 'numpy.load', 'np.load', (['input_files[0]'], {}), '(input_files[0])\n', (8037, 8053), True, 'import numpy as np\n'), ((8151, 8167), 'numpy.load', 'np.load', (['ref_ark'], {}), '(ref_ar... |
import numpy as np
import os
import sys
sys.path.append(os.getcwd())
from mindware.components.feature_engineering.transformations.preprocessor.text2vector import \
Text2VectorTransformation
from mindware.components.feature_engineering.transformation_graph import DataNode
from mindware.components.utils.constants i... | [
"mindware.components.feature_engineering.transformation_graph.DataNode",
"os.getcwd",
"mindware.components.feature_engineering.transformations.preprocessor.text2vector.Text2VectorTransformation",
"mindware.estimators.Classifier",
"numpy.array"
] | [((376, 541), 'numpy.array', 'np.array', (["[[1, 'I am good', 'I am right', 3], [2, 'He is good', 'He is ok', 4], [2.5,\n 'Everyone is good', 'Everyone is ok', 7], [1.3333, 'well', 'what', 5]]"], {}), "([[1, 'I am good', 'I am right', 3], [2, 'He is good', 'He is ok', \n 4], [2.5, 'Everyone is good', 'Everyone is... |
## @package Labelling_app
# Labelling app software developed with Grabcut
#
# @version 1
#
# Pontificia Universidad Javeriana
#
# Electronic Enginnering
#
# Developed by:
# - <NAME>
# Mail: <<EMAIL>>
# GitHub: andrearuizg
# - <NAME>
# Mail: <<EMAIL>>
# GitHub: PedroRuizCode
#
# With suppo... | [
"cv2.bitwise_and",
"PyQt5.QtGui.QColor",
"PyQt5.QtGui.QPixmap.fromImage",
"cv2.cvtColor",
"cv2.imwrite",
"numpy.savetxt",
"cv2.drawContours",
"cv2.resize",
"cv2.circle",
"PyQt5.QtGui.QPalette",
"PyQt5.QtGui.QImage",
"cv2.grabCut",
"PyQt5.QtGui.QIcon",
"cv2.threshold",
"numpy.zeros",
"t... | [((7423, 7465), 'cv2.cvtColor', 'cv2.cvtColor', (['self.out', 'cv2.COLOR_BGR2GRAY'], {}), '(self.out, cv2.COLOR_BGR2GRAY)\n', (7435, 7465), False, 'import cv2\n'), ((7488, 7520), 'cv2.threshold', 'cv2.threshold', (['imgray', '(1)', '(255)', '(0)'], {}), '(imgray, 1, 255, 0)\n', (7501, 7520), False, 'import cv2\n'), ((7... |
# Copyright 2017 <NAME>. 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 applicable law or agree... | [
"numpy.sum",
"numpy.log",
"numpy.zeros",
"numpy.linalg.matrix_rank",
"sklearn.decomposition.PCA",
"numpy.matmul",
"numpy.diag",
"numpy.concatenate"
] | [((1802, 1830), 'numpy.matmul', 'np.matmul', (['(data - m)', 'inv_A.T'], {}), '(data - m, inv_A.T)\n', (1811, 1830), True, 'import numpy as np\n'), ((2051, 2066), 'numpy.zeros', 'np.zeros', (['shape'], {}), '(shape)\n', (2059, 2066), True, 'import numpy as np\n'), ((2167, 2187), 'numpy.matmul', 'np.matmul', (['data', '... |
import numpy as np
from scipy.stats import norm
import GPy
class Cluster(object):
def __init__(self, n_arms=8, mu_init=0.0, var_init=1.0):
self.history = list()
self.n_arms = n_arms
# store for MAP estimates of the means
self.mu_init = mu_init
self.var_init = var_init
... | [
"numpy.sum",
"GPy.models.GPRegression",
"numpy.zeros",
"numpy.mean",
"numpy.array",
"numpy.reshape",
"numpy.eye",
"numpy.sqrt"
] | [((1611, 1635), 'numpy.zeros', 'np.zeros', (['self.mus.shape'], {}), '(self.mus.shape)\n', (1619, 1635), True, 'import numpy as np\n'), ((1657, 1681), 'numpy.zeros', 'np.zeros', (['self.mus.shape'], {}), '(self.mus.shape)\n', (1665, 1681), True, 'import numpy as np\n'), ((3377, 3393), 'numpy.zeros', 'np.zeros', (['(1, ... |
import logging
import os
import numpy as np
from scipy.stats import spearmanr
from scipy.cluster.hierarchy import linkage, dendrogram
from scipy.special import comb
from pandas import DataFrame
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import matplotlib
matplotlib.use('... | [
"os.mkdir",
"sklearn.preprocessing.StandardScaler",
"numpy.sum",
"matplotlib.pyplot.bar",
"scipy.cluster.hierarchy.linkage",
"scipy.special.comb",
"logging.getLogger",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"os.path.join",... | [((304, 325), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (318, 325), False, 'import matplotlib\n'), ((1044, 1085), 'logging.getLogger', 'logging.getLogger', (['"""Performance Analysis"""'], {}), "('Performance Analysis')\n", (1061, 1085), False, 'import logging\n'), ((1144, 1188), 'os.path.jo... |
""" Module to train and run LISRD-SIFT. """
import warnings
warnings.filterwarnings(action='once')
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
import cv2
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as func
from .base_model import BaseModel, Mode
from .bac... | [
"numpy.sum",
"numpy.ones",
"numpy.clip",
"numpy.argmin",
"numpy.linalg.norm",
"torch.no_grad",
"torch.nn.functional.normalize",
"torch.ones",
"torch.nn.init.kaiming_normal_",
"cv2.cvtColor",
"torch.nn.functional.relu",
"numpy.stack",
"numpy.linalg.inv",
"torch.max",
"torch.sum",
"torch... | [((61, 99), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""once"""'}), "(action='once')\n", (84, 99), False, 'import warnings\n'), ((100, 169), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'message': '"""numpy.ufunc size changed"""'}), "('ignore', message='numpy.u... |
# Copyright (c) Facebook, Inc. and its affiliates.
"""Utils for notebook."""
import sys
import os
import os.path as osp
import glob
from collections import OrderedDict
from collections.abc import Iterable
import json
import subprocess
import pickle as pkl
import logging
import h5py
import math
import operator
import ... | [
"matplotlib.rc",
"hydra.experimental.compose",
"pickle.dump",
"torch.argmax",
"tqdm.notebook.tqdm",
"numpy.einsum",
"moviepy.editor.CompositeVideoClip",
"numpy.isnan",
"numpy.argpartition",
"numpy.isclose",
"pickle.load",
"numpy.linalg.norm",
"pathlib.Path",
"numpy.mean",
"torch.no_grad"... | [((806, 827), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (821, 827), False, 'import sys\n'), ((1230, 1248), 'proglog.notebook', 'proglog.notebook', ([], {}), '()\n', (1246, 1248), False, 'import proglog\n'), ((1291, 1303), 'math.sqrt', 'math.sqrt', (['(2)'], {}), '(2)\n', (1300, 1303), False,... |
# house_price.py
# predict price from AC, sq ft, style, nearest school
# PyTorch 1.7.0-CPU Anaconda3-2020.02 Python 3.7.6
# Windows 10
import numpy as np
import time
import torch as T
device = T.device("cpu") # apply to Tensor or Module
# -----------------------------------------------------------
class HouseData... | [
"torch.nn.MSELoss",
"numpy.random.seed",
"torch.utils.data.DataLoader",
"torch.sum",
"torch.manual_seed",
"torch.nn.init.xavier_uniform_",
"time.strftime",
"torch.save",
"torch.nn.Linear",
"torch.nn.init.zeros_",
"numpy.array",
"numpy.loadtxt",
"torch.device",
"torch.no_grad",
"torch.abs... | [((196, 211), 'torch.device', 'T.device', (['"""cpu"""'], {}), "('cpu')\n", (204, 211), True, 'import torch as T\n'), ((2825, 2839), 'torch.abs', 'T.abs', (['(pct * Y)'], {}), '(pct * Y)\n', (2830, 2839), True, 'import torch as T\n'), ((2881, 2896), 'torch.abs', 'T.abs', (['(oupt - Y)'], {}), '(oupt - Y)\n', (2886, 289... |
# -*- coding: utf-8 -*-
"""data_augmentation.py
# Notebook: Generate Training Dataset
In this Notebook, we want to simulate training dataset from the real world dataset. There are two steps in making such data:
* 1) Create pair of trajectories from the original set
* 2) Create label per pair of trajectories
# Requir... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"glob.glob",
"numpy.unique",
"pandas.DataFrame",
"matplotlib.pyplot.yticks",
"numpy.max",
"pandas.Timedelta",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.subplots",
"numpy.var",
"pandas.concat",
"numpy.save",
"matplotlib.pyplot.legend",
"p... | [((5274, 5302), 'numpy.save', 'save', (['"""x1_list.npy"""', 'x1_list'], {}), "('x1_list.npy', x1_list)\n", (5278, 5302), False, 'from numpy import save, load\n'), ((5302, 5330), 'numpy.save', 'save', (['"""x2_list.npy"""', 'x2_list'], {}), "('x2_list.npy', x2_list)\n", (5306, 5330), False, 'from numpy import save, loa... |
#!/usr/bin/env python
import os
import shutil
import glob
import argparse
import numpy as np
import torch
from torch.utils.data import DataLoader
from importlib import import_module
import ast
from utils.logger import _logger
from utils.dataset import SimpleIterDataset
parser = argparse.ArgumentParser()
parser.add_a... | [
"pickle.dump",
"argparse.ArgumentParser",
"collections.defaultdict",
"torch.device",
"glob.glob",
"utils.data.fileio._write_root",
"torch.ones",
"torch.utils.data.DataLoader",
"utils.data.tools.awkward.save",
"torch.load",
"os.path.dirname",
"os.path.exists",
"utils.data.tools._concat",
"u... | [((282, 307), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (305, 307), False, 'import argparse\n'), ((5540, 5567), 'numpy.random.shuffle', 'np.random.shuffle', (['filelist'], {}), '(filelist)\n', (5557, 5567), True, 'import numpy as np\n'), ((5813, 6060), 'utils.dataset.SimpleIterDataset', 'S... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"src.loss.cal_acc",
"numpy.random.seed",
"mindspore.common.initializer.XavierUniform",
"math.sqrt",
"math.ceil",
"mindspore.common.initializer.HeUniform",
"numpy.random.RandomState",
"mindspore.common.set_seed",
"mindspore.common.initializer.TruncatedNormal",
"mindspore.common.initializer.initiali... | [((911, 922), 'mindspore.common.set_seed', 'set_seed', (['(1)'], {}), '(1)\n', (919, 922), False, 'from mindspore.common import initializer as init, set_seed\n'), ((923, 940), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (937, 940), True, 'import numpy as np\n'), ((4175, 4217), 'src.model.DeepID', 'De... |
"""
░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░ ░░░░░░░░ ░░░░░░░ ░░░░░░ ░░░░░░
▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒
▒▒▒▒▒▒ ▒▒ ▒▒ ▒▒ ▒▒▒▒▒▒▒ ▒▒ ▒▒▒▒▒ ▒▒▒▒▒ ▒▒ ▒▒
▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓
██ ██ ██████ ██ ██ ██... | [
"numpy.radians",
"matplotlib.pyplot.show",
"os.path.join",
"numpy.ptp",
"os.walk",
"numpy.zeros",
"numpy.insert",
"numpy.append",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.loadtxt",
"os.path.splitext",
"scipy.spatial.transform.Rotation.from_rotvec"
] | [((2247, 2266), 'numpy.array', 'np.array', (['[0, 0, 1]'], {}), '([0, 0, 1])\n', (2255, 2266), True, 'import numpy as np\n'), ((2372, 2401), 'os.walk', 'os.walk', (['"""csv"""'], {'topdown': '(False)'}), "('csv', topdown=False)\n", (2379, 2401), False, 'import os\n'), ((2597, 2613), 'numpy.zeros', 'np.zeros', (['(1, 3)... |
"""This module contains simple helper functions """
from __future__ import print_function
import torch
import numpy as np
from PIL import Image
import os
def display_mask(mask):
dict_col =np.array(
[
[0,0,0],
[0,255,0],
[255,0,0],
[0,0,255],
[255,... | [
"os.makedirs",
"numpy.median",
"numpy.std",
"numpy.zeros",
"os.path.exists",
"numpy.transpose",
"numpy.min",
"numpy.mean",
"numpy.array",
"numpy.tile",
"numpy.max",
"PIL.Image.fromarray",
"torch.abs"
] | [((193, 349), 'numpy.array', 'np.array', (['[[0, 0, 0], [0, 255, 0], [255, 0, 0], [0, 0, 255], [255, 255, 255], [96, 96,\n 96], [253, 96, 96], [255, 255, 0], [237, 127, 16], [102, 0, 153]]'], {}), '([[0, 0, 0], [0, 255, 0], [255, 0, 0], [0, 0, 255], [255, 255, 255],\n [96, 96, 96], [253, 96, 96], [255, 255, 0], [... |
import unittest, os
import json
import numpy as np
from math import factorial
from overcooked_ai_py.mdp.actions import Action, Direction
from overcooked_ai_py.mdp.overcooked_mdp import PlayerState, OvercookedGridworld, OvercookedState, ObjectState, SoupState, Recipe
from overcooked_ai_py.mdp.overcooked_env import Overc... | [
"numpy.random.seed",
"overcooked_ai_py.agents.benchmarking.AgentEvaluator.load_traj_from_json",
"json.dumps",
"numpy.random.randint",
"overcooked_ai_py.planning.planners.MediumLevelActionManager.from_pickle_or_compute",
"os.path.join",
"overcooked_ai_py.mdp.overcooked_mdp.OvercookedGridworld.from_layout... | [((31722, 31772), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(0)', 'high': 'num_actions', 'size': '(2)'}), '(low=0, high=num_actions, size=2)\n', (31739, 31772), True, 'import numpy as np\n'), ((45837, 45852), 'unittest.main', 'unittest.main', ([], {}), '()\n', (45850, 45852), False, 'import unittest, o... |
"""
This script is used to generate a mock catalog from MDPL2 Rockstar data.
The main procedures of this script are:
1. Load and organize all raw data and mock observation parameters.
Seperate the data into 'host' information and 'galaxy'
information.
2. Iterate through all galaxies and assign t... | [
"pickle.dump",
"numpy.random.seed",
"numpy.sum",
"numpy.abs",
"tools.catalog.Catalog",
"collections.defaultdict",
"pickle.load",
"numpy.arange",
"numpy.mean",
"os.path.join",
"numpy.unique",
"pandas.DataFrame",
"numpy.append",
"numpy.random.choice",
"numpy.log10",
"multiprocessing.Pool... | [((2110, 2131), 'numpy.random.seed', 'np.random.seed', (['(44323)'], {}), '(44323)\n', (2124, 2131), True, 'import numpy as np\n'), ((2528, 3323), 'collections.OrderedDict', 'OrderedDict', (["[('wdir', '/hildafs/home/mho1/scratch/halo_cnn'), ('in_folder', 'data_raw'),\n ('out_folder', 'data_mocks'), ('catalog_name',... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import requests
import numpy.testing as npt
from astropy.tests.helper import pytest
from astropy.table import Table
import astropy.units as u
from ...utils.testing_tools import MockResponse
from ... import nist
DATA_FILES = {'lines': 'nist_out... | [
"numpy.testing.assert_approx_equal",
"os.path.dirname",
"os.path.join"
] | [((429, 461), 'os.path.join', 'os.path.join', (['data_dir', 'filename'], {}), '(data_dir, filename)\n', (441, 461), False, 'import os\n'), ((922, 974), 'numpy.testing.assert_approx_equal', 'npt.assert_approx_equal', (['minwav', '(4000)'], {'significant': '(4)'}), '(minwav, 4000, significant=4)\n', (945, 974), True, 'im... |
from collections import OrderedDict
from itertools import count
from warnings import warn
import matplotlib.pyplot as plt
from scipy.interpolate import InterpolatedUnivariateSpline
from tqdm import tqdm
from pycircstat import event_series as es
import pycircstat as circ
from .utils.data import peakdet
from .utils.locki... | [
"numpy.abs",
"numpy.ones",
"numpy.isnan",
"numpy.argsort",
"numpy.histogram",
"numpy.mean",
"numpy.arange",
"numpy.exp",
"pycircstat.std",
"numpy.interp",
"numpy.unique",
"pandas.DataFrame",
"pycircstat.mean",
"scipy.interpolate.InterpolatedUnivariateSpline",
"pycircstat.var",
"pycircs... | [((795, 819), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {}), "('paper')\n", (810, 819), True, 'import seaborn as sns\n'), ((1071, 1111), 'sympy.symbols', 'sympy.symbols', (['"""f_s, EODf, f_b, \\\\Delta"""'], {}), "('f_s, EODf, f_b, \\\\Delta')\n", (1084, 1111), False, 'import sympy\n'), ((9243, 9267)... |
import subprocess
from subprocess import call
import pandas as pd
import os
import shutil
import gzip
import json
import sys
import mygene
import pickle
def uncompress_gzip(file_name, new_name=None, delete=True):
# Read the stream and write that stream to a new file:
in_file = gzip.open(file_name, 'rb')
i... | [
"subprocess.run",
"os.remove",
"subprocess.Popen",
"gzip.open",
"os.mkdir",
"os.path.isdir",
"mygene.MyGeneInfo",
"os.path.realpath",
"os.path.exists",
"subprocess.CalledProcessError",
"pickle.load",
"pandas.Series",
"pandas.read_table",
"os.path.join",
"pandas.concat",
"numpy.unique"
... | [((12382, 12401), 'mygene.MyGeneInfo', 'mygene.MyGeneInfo', ([], {}), '()\n', (12399, 12401), False, 'import mygene\n'), ((288, 314), 'gzip.open', 'gzip.open', (['file_name', '"""rb"""'], {}), "(file_name, 'rb')\n", (297, 314), False, 'import gzip\n'), ((6425, 6446), 'pandas.Series', 'pd.Series', (["df['Name']"], {}), ... |
""" Illustris Simulation: Public Data Release.
lhalotree.py: File I/O related to the LHaloTree merger tree files. """
import numpy as np
import h5py
from groupcat import gcPath
from util import partTypeNum
def treePath(basePath,chunkNum=0):
""" Return absolute path to a LHaloTree HDF5 file (modify as n... | [
"groupcat.gcPath",
"numpy.where",
"numpy.zeros"
] | [((3634, 3688), 'numpy.zeros', 'np.zeros', (["conn['FirstProgenitor'].shape"], {'dtype': '"""int32"""'}), "(conn['FirstProgenitor'].shape, dtype='int32')\n", (3642, 3688), True, 'import numpy as np\n'), ((899, 930), 'numpy.where', 'np.where', (['(groupFileOffsets >= 0)'], {}), '(groupFileOffsets >= 0)\n', (907, 930), T... |
#!/usr/bin/python
# removeQuadOff_ENVI.py
# Author: <NAME>
# All rights reserved
def residuals(p, y, xs):
err = y;
for i in range(0, len(xs)):
err = err - p[i] * xs[i];
# for i in range(0, len(xs)):
# err = err - p[i] * xs;
return err;
def peval(xs, p):
value = p[0] * xs[0];
for i in range(1, len(xs... | [
"pylab.fromfile",
"subprocess.Popen",
"numpy.meshgrid",
"scipy.arange",
"numpy.size",
"os.path.exists",
"numpy.isnan",
"scipy.optimize.leastsq",
"scipy.matrix",
"scipy.vstack",
"scipy.asarray",
"subprocess.call",
"re.search",
"scipy.size"
] | [((1832, 1852), 'numpy.meshgrid', 'numpy.meshgrid', (['x', 'y'], {}), '(x, y)\n', (1846, 1852), False, 'import numpy\n'), ((2721, 2739), 'scipy.arange', 'scipy.arange', (['(0)', '(1)'], {}), '(0, 1)\n', (2733, 2739), False, 'import scipy\n'), ((4139, 4180), 'scipy.matrix', 'scipy.matrix', (['ramp_removed', 'scipy.float... |
import numpy as np
import pandas as pd
import networkx as nx
def read_lines(folder, file_name):
'''parse the output from the SchNet evalutation
1) a list of the coordinates of each cluster (returns 1st)
['O 1.922131 -1.3179458 -2.891314\n', 'H 1.9396669 -1.812519 -2.0610204\n', ...]
... | [
"numpy.cross",
"networkx.Graph",
"numpy.array",
"pandas.Series",
"numpy.linalg.norm",
"numpy.dot"
] | [((1690, 1734), 'numpy.array', 'np.array', (['lines[1::n_lines]'], {'dtype': '"""float32"""'}), "(lines[1::n_lines], dtype='float32')\n", (1698, 1734), True, 'import numpy as np\n'), ((2399, 2420), 'pandas.Series', 'pd.Series', (['coord_list'], {}), '(coord_list)\n', (2408, 2420), True, 'import pandas as pd\n'), ((4473... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
x_start = 40
y_start = 80
x_extent = 50
y_extent = -40
fig = plt.figure()
fig.set_size_inches(5.5, 2.5)
ax = fig.add_subplot(111)
ax.set_xlim([0., 100.])
ax.set_ylim([0., 100.])
ax.set_xticks(np.arange(0, 101, 25))
ax.set_yticks(... | [
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.patches.Rectangle"
] | [((151, 163), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (161, 163), True, 'import matplotlib.pyplot as plt\n'), ((408, 533), 'matplotlib.patches.Rectangle', 'patches.Rectangle', (['(x_start, y_start)', 'x_extent', 'y_extent'], {'alpha': '(0.5)', 'facecolor': '"""silver"""', 'edgecolor': '"""k"""', 'lw... |
#!/usr/bin/env python
# coding: utf-8
# In[2]:
import numpy as np
# In[3]:
from sn_random_numbers import sn_random_numbers
# In[5]:
from simulation_class import simulation_class
# In[22]:
class geometric_brownian_motion(simulation_class):
def __init__(self,name,mar_env,corr=False):
super... | [
"numpy.dot",
"numpy.zeros",
"sn_random_numbers.sn_random_numbers",
"numpy.sqrt"
] | [((929, 945), 'numpy.zeros', 'np.zeros', (['(M, I)'], {}), '((M, I))\n', (937, 945), True, 'import numpy as np\n'), ((1030, 1081), 'sn_random_numbers.sn_random_numbers', 'sn_random_numbers', (['(1, M, I)'], {'fixed_seed': 'fixed_seed'}), '((1, M, I), fixed_seed=fixed_seed)\n', (1047, 1081), False, 'from sn_random_numbe... |
# libraries and directory
import pandas as pd
import numpy as np
import os
directory = "C:/Users/" # complete directory
os.chdir(directory)
# load data
dataset = pd.read_csv("data.txt", header = None)
# scale data so that values fall between -1 and 1
X = pd.DataFrame.to_numpy(dataset.loc[:,0:datase... | [
"pandas.read_csv",
"numpy.savetxt",
"os.chdir",
"pandas.DataFrame.to_numpy"
] | [((129, 148), 'os.chdir', 'os.chdir', (['directory'], {}), '(directory)\n', (137, 148), False, 'import os\n'), ((177, 213), 'pandas.read_csv', 'pd.read_csv', (['"""data.txt"""'], {'header': 'None'}), "('data.txt', header=None)\n", (188, 213), True, 'import pandas as pd\n'), ((276, 348), 'pandas.DataFrame.to_numpy', 'pd... |
import os
from tqdm import tqdm
import numpy as np
import mercantile
import torch
import torch.backends.cudnn
from torch.utils.data import DataLoader
from robosat_pink.core import load_config, load_module, check_classes, check_channels, make_palette, web_ui, Logs
from robosat_pink.tiles import tile_label_to_file, ti... | [
"os.path.expanduser",
"tqdm.tqdm",
"mercantile.Tile",
"robosat_pink.core.load_config",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.load",
"robosat_pink.core.make_palette",
"robosat_pink.core.check_classes",
"torch.cuda.device_count",
"numpy.around",
"torch.cuda.is_available",
"rob... | [((2290, 2362), 'torch.utils.data.DataLoader', 'DataLoader', (['loader_predict'], {'batch_size': 'args.bs', 'num_workers': 'args.workers'}), '(loader_predict, batch_size=args.bs, num_workers=args.workers)\n', (2300, 2362), False, 'from torch.utils.data import DataLoader\n'), ((2480, 2531), 'tqdm.tqdm', 'tqdm', (['loade... |
import os
os.environ['OPENBLAS_NUM_THREADS'] = '1' # Limit numpy threads to 1
import argparse
import csv
import matplotlib
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from src.anomaly_detection import *
from src.dataloader import load_weighted_edgelist
from src.egonet_extractor import Eg... | [
"matplotlib.pyplot.yscale",
"argparse.ArgumentParser",
"networkx.write_gpickle",
"matplotlib.colors.LogNorm",
"os.path.join",
"os.path.exists",
"matplotlib.pyplot.colorbar",
"src.dataloader.load_weighted_edgelist",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"csv.writer",
"matplotl... | [((1822, 1836), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1834, 1836), True, 'import matplotlib.pyplot as plt\n'), ((3202, 3220), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['xlabel'], {}), '(xlabel)\n', (3212, 3220), True, 'import matplotlib.pyplot as plt\n'), ((3222, 3240), 'matplotlib.pyplot.y... |
"""
SCRIPT TO CONVERT WRITE CNS/X-PLOR PARAM AND TOP FILES
FROM BOSS ZMATRIX
Created on Mon Feb 15 15:40:05 2016
@author: <NAME> <EMAIL>
@author: <NAME>
REQUIREMENTS:
BOSS (need to set BOSSdir in bashrc and cshrc)
Preferably Anaconda python with following modules
pandas
argparse
numpy
"""
from LigParGen.BOSSReader... | [
"pandas.DataFrame",
"LigParGen.BOSSReader.tor_cent",
"numpy.array",
"LigParGen.BOSSReader.bossPdbAtom2Element",
"LigParGen.BOSSReader.bossElement2Mass",
"pandas.concat"
] | [((5333, 5346), 'numpy.array', 'np.array', (['dhd'], {}), '(dhd)\n', (5341, 5346), True, 'import numpy as np\n'), ((5437, 5488), 'pandas.DataFrame', 'pd.DataFrame', (['dhd'], {'columns': "['V1', 'V2', 'V3', 'V4']"}), "(dhd, columns=['V1', 'V2', 'V3', 'V4'])\n", (5449, 5488), True, 'import pandas as pd\n'), ((6094, 6141... |
"""Module containing AOI loss calculation methods"""
from pvfactors.config import DISTANCE_TOLERANCE
from pvfactors.geometry.timeseries import (
TsPointCoords, TsSurface, TsLineCoords)
from pvfactors import PVFactorsError
import pvlib
from pvlib.tools import cosd
import numpy as np
class AOIMethods:
"""Class... | [
"pvfactors.PVFactorsError",
"numpy.arctan2",
"numpy.zeros_like",
"pvfactors.geometry.timeseries.TsPointCoords",
"numpy.ones_like",
"numpy.abs",
"pvlib.pvsystem.retrieve_sam",
"numpy.clip",
"numpy.where",
"numpy.array",
"numpy.tile",
"numpy.linspace",
"numpy.linalg.norm",
"pvlib.iam.sapm",
... | [((29991, 30031), 'pvlib.pvsystem.retrieve_sam', 'pvlib.pvsystem.retrieve_sam', (['"""SandiaMod"""'], {}), "('SandiaMod')\n", (30018, 30031), False, 'import pvlib\n'), ((2506, 2563), 'numpy.linspace', 'np.linspace', (['(0.0)', '(180.0)'], {'num': '(self.n_integral_sections + 1)'}), '(0.0, 180.0, num=self.n_integral_sec... |
# Copyright (c) 2022 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 applic... | [
"paddle.to_tensor",
"os.path.abspath",
"paddle.inference.Config",
"medicalseg.utils.logger.info",
"argparse.ArgumentParser",
"os.getpid",
"os.makedirs",
"numpy.argmax",
"os.path.basename",
"medicalseg.transforms.Compose",
"os.path.exists",
"medicalseg.core.infer_window.sliding_window_inference... | [((707, 732), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (722, 732), False, 'import os\n'), ((750, 786), 'os.path.join', 'os.path.join', (['LOCAL_PATH', '""".."""', '""".."""'], {}), "(LOCAL_PATH, '..', '..')\n", (762, 786), False, 'import os\n'), ((1472, 1515), 'argparse.ArgumentParser',... |
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import animation
import numpy as np
import pickle
import seaborn as sns
import sys
from time import time
try:
# if calling from XGMix
from Utils.utils import read_vcf, vcf_to_npy, fb2proba, npy_to_vcf
from XGFix.phasing import *
from XGF... | [
"sys.stdout.write",
"numpy.argmax",
"pickle.load",
"numpy.arange",
"utils.read_vcf",
"simple_switch.simple_switch",
"numpy.zeros_like",
"numpy.copy",
"utils.npy_to_vcf",
"numpy.max",
"utils.vcf_to_npy",
"numpy.dstack",
"numpy.ones_like",
"utils.fb2proba",
"sys.exit",
"numpy.concatenate... | [((845, 864), 'numpy.array', 'np.array', (['base_prob'], {}), '(base_prob)\n', (853, 864), True, 'import numpy as np\n'), ((929, 947), 'numpy.copy', 'np.copy', (['base_prob'], {}), '(base_prob)\n', (936, 947), True, 'import numpy as np\n'), ((1964, 1982), 'numpy.copy', 'np.copy', (['base_prob'], {}), '(base_prob)\n', (... |
from itertools import chain, combinations
def powerset(iterable):
"powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
s = list(iterable)
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
from utils.utils import choose
from collections import defaultdict
import panda... | [
"pandas.DataFrame",
"numpy.abs",
"torch.stack",
"numpy.log",
"random.shuffle",
"time.process_time",
"torch.randn",
"scipy.stats.pearsonr",
"collections.defaultdict",
"itertools.combinations",
"torch.arange",
"torch.linalg.norm",
"torch.zeros",
"pandas.set_option",
"torch.square"
] | [((437, 459), 'torch.arange', 'torch.arange', (['(1)', '(1 + M)'], {}), '(1, 1 + M)\n', (449, 459), False, 'import torch\n'), ((511, 526), 'torch.square', 'torch.square', (['a'], {}), '(a)\n', (523, 526), False, 'import torch\n'), ((1902, 1944), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', 'None... |
import gensim
import numpy as np
import pandas as pd
import re
import os
import time
import jieba
import cv2
import json
import urllib
import random
import hashlib
from snownlp import sentiment
from snownlp import SnowNLP
import jieba.posseg as pseg
from gensim.models import word2vec
import logging
import torch
import ... | [
"pandas.read_csv",
"json.dumps",
"os.path.isfile",
"numpy.mean",
"gensim.models.KeyedVectors.load_word2vec_format",
"gensim.models.word2vec.Text8Corpus",
"gensim.models.word2vec.Word2Vec.load",
"gensim.models.word2vec.Word2Vec",
"tensorflow.keras.applications.vgg19.decode_predictions",
"random.ran... | [((37266, 37361), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s : %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s : %(levelname)s : %(message)s',\n level=logging.INFO)\n", (37285, 37361), False, 'import logging\n'), ((37577, 37588), 'time.time', 'time... |
from __future__ import print_function, division, absolute_import
import time
import warnings
import sys
# unittest only added in 3.4 self.subTest()
if sys.version_info[0] < 3 or sys.version_info[1] < 4:
import unittest2 as unittest
else:
import unittest
# unittest.mock is not available in 2.7 (though unittest2... | [
"warnings.simplefilter",
"imgaug.Keypoint",
"imgaug.is_np_array",
"numpy.zeros",
"imgaug.testutils.reseed",
"time.time",
"imgaug.BoundingBox",
"imgaug.Batch",
"matplotlib.use",
"warnings.catch_warnings",
"imgaug.Polygon"
] | [((433, 454), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (447, 454), False, 'import matplotlib\n'), ((619, 630), 'time.time', 'time.time', ([], {}), '()\n', (628, 630), False, 'import time\n'), ((667, 678), 'time.time', 'time.time', ([], {}), '()\n', (676, 678), False, 'import time\n'), ((835... |
"""
LTI SSM Policy training N-step
physics informed policy gradient
"""
import numpy as np
import numpy.matlib
import matplotlib.pyplot as plt
from scipy.io import loadmat
import torch
import torch.nn.functional as F
from torch import nn
from sklearn.model_selection import train_test_split
import time
"""
Ground trut... | [
"matplotlib.pyplot.title",
"scipy.io.loadmat",
"numpy.ones",
"torch.cat",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"torch.no_grad",
"torch.ones",
"torch.nn.MSELoss",
"torch.nn.Linear",
"torch.zeros",
"torch.nn.functional.relu",
"numpy.matlib.repmat",
"matplotlib.pyplot.s... | [((354, 493), 'numpy.matrix', 'np.matrix', (['[[0.995, 0.0017, 0.0, 0.0031], [0.0007, 0.9957, 0.0003, 0.0031], [0.0, \n 0.0003, 0.9834, 0.0], [0.2015, 0.4877, 0.01, 0.2571]]'], {}), '([[0.995, 0.0017, 0.0, 0.0031], [0.0007, 0.9957, 0.0003, 0.0031],\n [0.0, 0.0003, 0.9834, 0.0], [0.2015, 0.4877, 0.01, 0.2571]])\n'... |
import numpy as np
from math import *
def cosine_similarity(a, b):
# numerator = sum(a*b for a,b in zip(x,y))
# denominator = square_rooted(x) * square_rooted(y)
return dot(a, b) / ((dot(a, a) ** .5) * (dot(b, b) ** .5))
# return round(numerator/float(denominator),3)
def dot(A, B):
return (sum(a... | [
"itertools.combinations",
"numpy.array",
"numpy.linalg.inv",
"numpy.dot",
"numpy.cov",
"numpy.sqrt"
] | [((1965, 1976), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (1973, 1976), True, 'import numpy as np\n'), ((1986, 1997), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (1994, 1997), True, 'import numpy as np\n'), ((2059, 2070), 'numpy.cov', 'np.cov', (['mat'], {}), '(mat)\n', (2065, 2070), True, 'import numpy as ... |
# MEAN FILTERING AND EDGE DETECTION FOR VIDEO
# AUTHOR: <NAME>
import numpy as np
import cv2
import skvideo.io
def Videogray(video):
cap = cv2.VideoCapture(video)
total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WI... | [
"numpy.multiply",
"cv2.VideoWriter_fourcc",
"cv2.cvtColor",
"numpy.zeros",
"cv2.VideoCapture",
"numpy.shape",
"numpy.array",
"cv2.VideoWriter",
"numpy.sqrt"
] | [((152, 175), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video'], {}), '(video)\n', (168, 175), False, 'import cv2\n'), ((390, 432), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (['"""M"""', '"""J"""', '"""P"""', '"""G"""'], {}), "('M', 'J', 'P', 'G')\n", (412, 432), False, 'import cv2\n'), ((451, 516), 'cv2.Vid... |
import glob
import cv2
import json
import os
import numpy as np
import xml.etree.cElementTree as ET
from weed_annotator.annotation_converter.BoundingBox import BoundingBox
from weed_annotator.annotation_converter.Polygon import Polygon
from weed_annotator.annotation_converter.Annotation import Annotation
class Annota... | [
"cv2.findContours",
"xml.etree.cElementTree.parse",
"json.load",
"weed_annotator.annotation_converter.BoundingBox.BoundingBox",
"xml.etree.cElementTree.ElementTree",
"cv2.cvtColor",
"os.path.basename",
"cv2.threshold",
"weed_annotator.annotation_converter.Polygon.Polygon",
"numpy.zeros",
"os.pat... | [((1429, 1449), 'xml.etree.cElementTree.ElementTree', 'ET.ElementTree', (['root'], {}), '(root)\n', (1443, 1449), True, 'import xml.etree.cElementTree as ET\n'), ((1557, 1582), 'xml.etree.cElementTree.Element', 'ET.Element', (['"""annotations"""'], {}), "('annotations')\n", (1567, 1582), True, 'import xml.etree.cElemen... |
from __future__ import absolute_import, division, print_function
import time
import cPickle
import numpy as np
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from data.reader import data_iterator, ptb_raw_data
import models.stacked as stacked
from utils ... | [
"theano.tensor.nnet.categorical_crossentropy",
"argparse.ArgumentParser",
"data.reader.data_iterator",
"numpy.argmin",
"theano.sandbox.rng_mrg.MRG_RandomStreams",
"utils.get_noise_x",
"models.stacked.model",
"numpy.exp",
"theano.tensor.iscalar",
"data.reader.ptb_raw_data",
"utils.cast_floatX",
... | [((404, 429), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (427, 429), False, 'import argparse\n'), ((2312, 2342), 'data.reader.ptb_raw_data', 'ptb_raw_data', (['config.data_path'], {}), '(config.data_path)\n', (2324, 2342), False, 'from data.reader import data_iterator, ptb_raw_data\n'), ((2... |
'''
Utility functions, etc. for working with SVG documents.
'''
from __future__ import absolute_import
import logging
import re
from six.moves import map
import numpy as np
import six
from functools import reduce
__all__ = ['shape_points', 'get_CTM', 'get_current_transformation_matrix']
CRE_TRANSFORM =... | [
"re.split",
"numpy.asarray",
"six.moves.map",
"numpy.append",
"numpy.tan",
"numpy.sin",
"numpy.matmul",
"numpy.cos",
"functools.reduce",
"numpy.eye",
"logging.getLogger",
"re.compile"
] | [((321, 411), 're.compile', 're.compile', (['"""(?P<operation>(skew[XY]|scale|translate|rotate))\\\\((?P<args>[^\\\\)]+)\\\\)"""'], {}), "(\n '(?P<operation>(skew[XY]|scale|translate|rotate))\\\\((?P<args>[^\\\\)]+)\\\\)')\n", (331, 411), False, 'import re\n'), ((3018, 3027), 'numpy.eye', 'np.eye', (['(3)'], {}), '(... |
import tensorflow as tf
import numpy as np
from settings import float_type, jitter_level,std_qmu_init, np_float_type, np_int_type
from functions import eye, variational_expectations, block_diagonal
from mean_functions import Zero
from kullback_leiblers import gauss_kl_white, gauss_kl_white_diag, gauss_kl, gauss_kl_diag... | [
"tensorflow.reduce_sum",
"numpy.sum",
"tensorflow.constant_initializer",
"numpy.ones",
"tensorflow.matmul",
"tensorflow.reduce_prod",
"tensorflow.Variable",
"conditionals.conditional_batch",
"numpy.random.randn",
"functions.block_diagonal",
"tensorflow.variable_scope",
"tensorflow.stack",
"t... | [((3690, 3750), 'tensorflow.Variable', 'tf.Variable', (['(0)'], {'name': '"""KL"""', 'trainable': '(False)', 'dtype': 'float_type'}), "(0, name='KL', trainable=False, dtype=float_type)\n", (3701, 3750), True, 'import tensorflow as tf\n'), ((5856, 5889), 'tensorflow.reduce_sum', 'tf.reduce_sum', (['samples_fs'], {'axis'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
2D MAF data of 2Na2O.3SiO2 glass
================================
"""
# %%
# The following example illustrates an application of the statistical learning method
# applied in determining the distribution of the nuclear shielding tensor parameters
# from a 2D magic-angle ... | [
"matplotlib.pyplot.subplot",
"csdmpy.load",
"matplotlib.pyplot.show",
"mrinversion.linear_model.SmoothLasso",
"mrinversion.utils.to_Haeberlen_grid",
"matplotlib.pyplot.figure",
"mrinversion.linear_model.TSVDCompression",
"numpy.arange",
"mrinversion.kernel.nmr.ShieldingPALineshape",
"csdmpy.Linear... | [((1459, 1476), 'csdmpy.load', 'cp.load', (['filename'], {}), '(filename)\n', (1466, 1476), True, 'import csdmpy as cp\n'), ((3975, 4206), 'mrinversion.kernel.nmr.ShieldingPALineshape', 'ShieldingPALineshape', ([], {'anisotropic_dimension': 'anisotropic_dimension', 'inverse_dimension': 'inverse_dimensions', 'channel': ... |
import os
import cv2
import sys
import time
import collections
import torch
import argparse
import numpy as np
from torch.autograd import Variable
from torch.utils import data
import PSENet.models as models
from PSENet.pse import pse
from argparse import Namespace
from PIL import Image
import torc... | [
"torch.cuda.synchronize",
"argparse.Namespace",
"os.path.isfile",
"numpy.mean",
"sys.stdout.flush",
"cv2.boxPoints",
"cv2.minAreaRect",
"torch.cuda.current_device",
"torchvision.transforms.Normalize",
"torch.no_grad",
"PSENet.pse.pse",
"torch.load",
"torch.sign",
"numpy.max",
"PSENet.mod... | [((497, 522), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (520, 522), False, 'import torch\n'), ((901, 948), 'cv2.resize', 'cv2.resize', (['img'], {'dsize': 'None', 'fx': 'scale', 'fy': 'scale'}), '(img, dsize=None, fx=scale, fy=scale)\n', (911, 948), False, 'import cv2\n'), ((1249, 1276), '... |
import numpy as np
import pandas as pd
import pickle, os, csv, math, time
from joblib import Parallel, delayed
import datetime as dt
from datetime import date, datetime, timedelta
from collections import Counter
import copy as cp
import tqdm
from sklearn.ensemble import ExtraTreesRegressor, ExtraTreesClassifier
from li... | [
"numpy.argmax",
"sklearn.metrics.mean_absolute_error",
"numpy.arange",
"numpy.tile",
"numpy.unique",
"sys.path.append",
"util.construct_dicts",
"numpy.max",
"copy.deepcopy",
"pandas.get_dummies",
"numpy.asarray",
"contrastive_deepnet.ContrastiveNet",
"contrastive_deepnet.ContrastiveDataset",... | [((764, 787), 'numpy.seterr', 'np.seterr', ([], {'all': '"""ignore"""'}), "(all='ignore')\n", (773, 787), True, 'import numpy as np\n'), ((962, 991), 'sys.path.append', 'sys.path.append', (['"""../models/"""'], {}), "('../models/')\n", (977, 991), False, 'import sys\n'), ((1581, 1632), 'util.construct_dicts', 'util_fqi... |
import numpy as np
from hmf.density_field.transfer import Transfer
from hmf.density_field.transfer_models import EH_BAO
import pytest
import camb
# def rms(a):
# print(a)
# print("RMS: ", np.sqrt(np.mean(np.square(a))))
# return np.sqrt(np.mean(np.square(a)))
#
# def check_close(t, t2, fit):
# t.updat... | [
"astropy.cosmology.LambdaCDM",
"hmf.density_field.transfer.Transfer",
"camb.CAMBparams",
"numpy.abs",
"numpy.log",
"numpy.logspace",
"camb.get_transfer_functions",
"numpy.square",
"numpy.genfromtxt",
"numpy.isclose",
"numpy.max",
"numpy.exp",
"pytest.mark.parametrize",
"pytest.mark.skip"
] | [((517, 640), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["['name', 'val']", "[('z', 0.1), ('sigma_8', 0.82), ('n', 0.95), ('cosmo_params', {'H0': 68.0})]"], {}), "(['name', 'val'], [('z', 0.1), ('sigma_8', 0.82), (\n 'n', 0.95), ('cosmo_params', {'H0': 68.0})])\n", (540, 640), False, 'import pytest\n'),... |
'''
Created on 22 de mai de 2021
@author: jose
'''
from Harmonica import Harmonica
from typing import List
import numpy
class FormaOnda():
'''
classdocs
'''
def __init__(self, nAmostras, listaH: List[Harmonica]):
'''
Constructor
'''
self.__list = listaH
self._... | [
"numpy.zeros"
] | [((372, 409), 'numpy.zeros', 'numpy.zeros', (['nAmostras'], {'dtype': '"""float"""'}), "(nAmostras, dtype='float')\n", (383, 409), False, 'import numpy\n')] |
# -*- coding: utf-8 -*-
#
# Author <NAME>
# E-mail <EMAIL>
# License MIT
# Created 06/01/2017
# Updated 06/01/2017
# Version 1.0.0
#
"""
Description of stats.py
======================
1 Shapiro (test normality)
2 Bartlett (test homostedasticity)
3 if normal and same variance then ANOVA and Tukey post hoc... | [
"scipy.stats.kruskal",
"utils.print_info",
"scipy.stats.shapiro",
"statistics.stdev",
"utils.print_success",
"scipy.stats.bartlett",
"scipy.stats.f_oneway",
"statsmodels.stats.multicomp.MultiComparison",
"numpy.array",
"utils.print_error",
"os.listdir"
] | [((1022, 1041), 'scipy.stats.shapiro', 'stats.shapiro', (['data'], {}), '(data)\n', (1035, 1041), False, 'from scipy import stats\n'), ((2955, 2970), 'numpy.array', 'np.array', (['names'], {}), '(names)\n', (2963, 2970), True, 'import numpy as np\n'), ((3070, 3083), 'numpy.array', 'np.array', (['tmp'], {}), '(tmp)\n', ... |
import random
import torch
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from networks.maddpg_critic_version_3 import MADDPGCriticVersion3
from networks.maddpg_actor_version_2 import MADDPGActorVersion2
from agents.base_agent import BaseAgent
from agents.game import Game
from utils.ou... | [
"utils.experience_pack.ExperienceUnpack",
"networks.maddpg_actor_version_2.MADDPGActorVersion2",
"torch.nn.functional.mse_loss",
"torch.cat",
"numpy.clip",
"utils.ounoise.OUNoise",
"random.seed",
"torch.cuda.is_available",
"torch.no_grad",
"networks.maddpg_critic_version_3.MADDPGCriticVersion3",
... | [((439, 464), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (462, 464), False, 'import torch\n'), ((2022, 2046), 'random.seed', 'random.seed', (['random_seed'], {}), '(random_seed)\n', (2033, 2046), False, 'import random\n'), ((3487, 3566), 'utils.ounoise.OUNoise', 'OUNoise', (['self.action_si... |
import numpy as np
from scipy.stats import norm
#Define the expected improvement as objective function to optimize over.
def expected_improvement(X,surrogate,X_sample,Y_sample,correct_label,classify,USE_SKLEARN=True,VERBOSE=True,boundary_penalty=lambda a,b: 0):
my_X = np.copy(X)
my_X = X.reshape(1, -1)
my_X... | [
"numpy.divide",
"numpy.absolute",
"numpy.copy",
"numpy.asarray",
"scipy.stats.norm.pdf",
"numpy.errstate",
"scipy.stats.norm.cdf",
"numpy.max",
"numpy.where",
"numpy.diag",
"numpy.vstack"
] | [((273, 283), 'numpy.copy', 'np.copy', (['X'], {}), '(X)\n', (280, 283), True, 'import numpy as np\n'), ((856, 873), 'numpy.asarray', 'np.asarray', (['my_mu'], {}), '(my_mu)\n', (866, 873), True, 'import numpy as np\n'), ((889, 909), 'numpy.asarray', 'np.asarray', (['my_sigma'], {}), '(my_sigma)\n', (899, 909), True, '... |
import numpy as np
from scipy.optimize import dual_annealing
from ..base import BaseEstimator
class LinearNoTrendFourier(BaseEstimator):
"""Linear regression with Fourier terms.
The Fourier terms allow capturing the periodic variability in the
time-series.
No trend is assumed in the time series.
... | [
"numpy.stack",
"numpy.abs",
"numpy.linalg.lstsq",
"numpy.sum",
"scipy.optimize.dual_annealing",
"numpy.ones",
"numpy.subtract.outer",
"numpy.sin",
"numpy.where",
"numpy.cos"
] | [((1880, 1915), 'numpy.linalg.lstsq', 'np.linalg.lstsq', (['mat', 'y'], {'rcond': 'None'}), '(mat, y, rcond=None)\n', (1895, 1915), True, 'import numpy as np\n'), ((8473, 8482), 'numpy.abs', 'np.abs', (['u'], {}), '(u)\n', (8479, 8482), True, 'import numpy as np\n'), ((9267, 9292), 'numpy.subtract.outer', 'np.subtract.... |
# Copyright 2020 The FastEstimator 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 appl... | [
"fastestimator.backend.random_normal_like",
"tensorflow.constant",
"tensorflow.shape",
"torch.Tensor",
"numpy.array"
] | [((932, 958), 'numpy.array', 'np.array', (['[[0, 1], [1, 1]]'], {}), '([[0, 1], [1, 1]])\n', (940, 958), True, 'import numpy as np\n'), ((981, 1010), 'tensorflow.constant', 'tf.constant', (['[[0, 1], [2, 2]]'], {}), '([[0, 1], [2, 2]])\n', (992, 1010), True, 'import tensorflow as tf\n'), ((1036, 1066), 'torch.Tensor', ... |
import torch
import numpy as np
import pandas as pd
import multiprocessing as mp
from torch_geometric.data import Data
from functools import partial
from easydict import EasyDict
from tqdm.auto import tqdm
from rdkit import Chem
from rdkit.Chem.rdForceFieldHelpers import MMFFOptimizeMolecule
from ..chem import set_rd... | [
"functools.partial",
"rdkit.Chem.rdForceFieldHelpers.MMFFOptimizeMolecule",
"numpy.median",
"numpy.std",
"numpy.ones",
"numpy.mean",
"numpy.arange",
"numpy.array",
"easydict.EasyDict",
"multiprocessing.Pool",
"numpy.vstack"
] | [((777, 820), 'numpy.ones', 'np.ones', (['[num_ref, num_gen]'], {'dtype': 'np.float'}), '([num_ref, num_gen], dtype=np.float)\n', (784, 820), True, 'import numpy as np\n'), ((2524, 2551), 'numpy.arange', 'np.arange', (['(0.05)', '(3.05)', '(0.05)'], {}), '(0.05, 3.05, 0.05)\n', (2533, 2551), True, 'import numpy as np\n... |
import pandas as pd
import numpy as np
import cv2
import os
path = './google_tiles_13/'
lower_green = np.array([45, 0, 0])
upper_green = np.array([65, 256, 256])
x_min = 5975
y_max = 2598
for file in os.listdir(path):
file_path = os.path.join(path, file)
if not os.path.isfile(file_path):
continue
... | [
"pandas.DataFrame",
"cv2.cvtColor",
"cv2.imread",
"os.path.isfile",
"numpy.array",
"numpy.arange",
"os.path.join",
"os.listdir"
] | [((105, 125), 'numpy.array', 'np.array', (['[45, 0, 0]'], {}), '([45, 0, 0])\n', (113, 125), True, 'import numpy as np\n'), ((140, 164), 'numpy.array', 'np.array', (['[65, 256, 256]'], {}), '([65, 256, 256])\n', (148, 164), True, 'import numpy as np\n'), ((205, 221), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\... |
import sys
sys.path.insert(0, '/home/bryanb/setigen')
import setigen as stg
import numpy as np
iq_sample_rate = 2.048e6
sample_rate = iq_sample_rate * 2
carrier_freq = 90.3e6
antenna = stg.voltage.Antenna(sample_rate=sample_rate,
fch1=carrier_freq - iq_sample_rate / 2,
... | [
"setigen.voltage.ComplexQuantizer",
"setigen.voltage.get_unit_drift_rate",
"numpy.frombuffer",
"sys.path.insert",
"setigen.voltage.RawVoltageBackend",
"setigen.voltage.Antenna",
"setigen.voltage.get_level",
"setigen.voltage.PolyphaseFilterbank",
"numpy.sqrt"
] | [((11, 53), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/home/bryanb/setigen"""'], {}), "(0, '/home/bryanb/setigen')\n", (26, 53), False, 'import sys\n'), ((189, 306), 'setigen.voltage.Antenna', 'stg.voltage.Antenna', ([], {'sample_rate': 'sample_rate', 'fch1': '(carrier_freq - iq_sample_rate / 2)', 'ascending':... |
import tensorflow as tf
import numpy as np
import sys
from tensorflow.examples.tutorials.mnist import input_data
sys.path.append("/data")
def test_1():
sess = tf.Session()
hell = tf.constant('Hello!!!')
sess.run(hell)
def simple_mnist():
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True... | [
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.Variable",
"tensorflow.nn.conv2d",
"tensorflow.InteractiveSession",
"tensorflow.truncated_normal",
"sys.path.append",
"tensorflow.abs",
"tensorflow.placeholder",
"tensorflow.cast",
"numpy.max",
"tensorflow.gradients",
"tensorflow.global_... | [((114, 138), 'sys.path.append', 'sys.path.append', (['"""/data"""'], {}), "('/data')\n", (129, 138), False, 'import sys\n'), ((166, 178), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (176, 178), True, 'import tensorflow as tf\n'), ((190, 213), 'tensorflow.constant', 'tf.constant', (['"""Hello!!!"""'], {}), "(... |
from pycocotools.coco import COCO
from scipy import ndimage
from tqdm import tqdm
import numpy as np
import os
import pylab
import sys
pylab.rcParams['figure.figsize'] = (8.0, 10.0)
from PIL import Image, ImagePalette # For indexed images
import matplotlib # For Matlab's color maps
import argparse
def cocoSegmentatio... | [
"os.mkdir",
"numpy.random.seed",
"argparse.ArgumentParser",
"matplotlib.cm.get_cmap",
"numpy.sum",
"numpy.random.set_state",
"numpy.arange",
"os.path.join",
"os.path.exists",
"tqdm.tqdm",
"numpy.size",
"matplotlib.colors.hsv_to_rgb",
"numpy.random.permutation",
"numpy.vstack",
"matplotli... | [((7060, 7085), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (7083, 7085), False, 'import argparse\n'), ((7499, 7512), 'pycocotools.coco.COCO', 'COCO', (['annFile'], {}), '(annFile)\n', (7503, 7512), False, 'from pycocotools.coco import COCO\n'), ((7851, 7883), 'os.path.join', 'os.path.join',... |
#!/usr/bin/env python3
import unittest
import numpy as np
from panda import Panda
from panda.tests.safety import libpandasafety_py
from panda.tests.safety.common import make_msg
from panda.tests.safety.test_toyota import toyota_checksum
IPAS_OVERRIDE_THRESHOLD = 200
ANGLE_DELTA_BP = [0., 5., 15.]
ANGLE_DELTA_V = [5.,... | [
"unittest.main",
"numpy.interp",
"panda.tests.safety.test_toyota.toyota_checksum",
"panda.tests.safety.common.make_msg"
] | [((9402, 9417), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9415, 9417), False, 'import unittest\n'), ((831, 847), 'panda.tests.safety.common.make_msg', 'make_msg', (['(0)', '(608)'], {}), '(0, 608)\n', (839, 847), False, 'from panda.tests.safety.common import make_msg\n'), ((1217, 1232), 'panda.tests.safety.c... |
import os
import numpy as np
from polharmonic import util, ill, det, gaunt, shcoeffs
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['contour.negative_linestyle'] = 'solid'
class Microscope:
"""
A Microscope represents an experiment that collects a single frame of
intensity data.
... | [
"polharmonic.util.lm2j",
"numpy.floor",
"polharmonic.shcoeffs.SHCoeffs",
"numpy.sin",
"numpy.meshgrid",
"os.path.exists",
"numpy.arcsin",
"numpy.max",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"numpy.ndenumerate",
"numpy.cos",
"numpy.arctan",
"numpy.dot",
"polharmonic.det.Detector"... | [((483, 500), 'polharmonic.ill.Illuminator', 'ill.Illuminator', ([], {}), '()\n', (498, 500), False, 'from polharmonic import util, ill, det, gaunt, shcoeffs\n'), ((506, 520), 'polharmonic.det.Detector', 'det.Detector', ([], {}), '()\n', (518, 520), False, 'from polharmonic import util, ill, det, gaunt, shcoeffs\n'), (... |
import numpy as np
import matplotlib.pyplot as plt
import types
from darklim.limit._limit import drde, gauss_smear
__all__ = [
"RatePlot",
]
class RatePlot(object):
"""
Class for making a plot of different dark matter spectra with the ability of comparing
different data and with theoretical dR/dE c... | [
"numpy.isscalar",
"darklim.limit._limit.gauss_smear",
"numpy.histogram",
"numpy.diff",
"numpy.linspace",
"darklim.limit._limit.drde",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.cm.get_cmap"
] | [((1708, 1737), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (1720, 1737), True, 'import matplotlib.pyplot as plt\n'), ((4697, 4757), 'numpy.histogram', 'np.histogram', (['energies'], {'bins': 'nbins', 'range': 'self._energy_range'}), '(energies, bins=nbins, range=s... |
import argparse
import os
parser = argparse.ArgumentParser(description='Model Trainer')
parser.add_argument('--path', help='Path to data folder.', required=True)
parser.add_argument('--lite', help='Generate lite Model.', action='store_true')
args = parser.parse_args()
if args.path:
import cv2
import numpy as ... | [
"argparse.ArgumentParser",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"cv2.cvtColor",
"sklearn.model_selection.train_test_split",
"os.walk",
"numpy.float",
"tensorflow.data.Dataset.from_tensor_slices",
"cv2.imread",
"tensorflow.keras.callbacks.LearningRateScheduler",
"nu... | [((36, 88), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Model Trainer"""'}), "(description='Model Trainer')\n", (59, 88), False, 'import argparse\n'), ((1673, 1752), 'sklearn.model_selection.train_test_split', 'train_test_split', (['train', 'labels'], {'test_size': '(0.3)', 'stratify'... |
import math
import numpy as np
import random
import timeit
from threading import Thread
import functools
dist_ar = [] # 거리표(global)
cities_count = 0 # 도시 수(global)
dots_list = [] # 도시 리스트(global)
# Hyper Parameter
limits = 60 * 12 # 제한시간
# 시간제한 데코레이터
def timeout(seconds_before_timeout):
def deco(func):
... | [
"threading.Thread",
"math.sqrt",
"random.uniform",
"timeit.default_timer",
"numpy.argsort",
"numpy.array",
"functools.wraps"
] | [((1912, 1929), 'numpy.array', 'np.array', (['dist_ar'], {}), '(dist_ar)\n', (1920, 1929), True, 'import numpy as np\n'), ((4090, 4118), 'numpy.array', 'np.array', (['[population, fits]'], {}), '([population, fits])\n', (4098, 4118), True, 'import numpy as np\n'), ((4803, 4825), 'timeit.default_timer', 'timeit.default_... |
import numpy as np
class ActivationModel:
def activation(
self,
Z
):
# Z: (num_outputs, num_examples)
# outputs: (num_outputs, num_examples)
raise NotImplementedError('Method must be implemented by child class')
def d_activation_d_Z(
self,
Z,
... | [
"numpy.multiply",
"numpy.subtract",
"numpy.tanh",
"numpy.square",
"numpy.exp"
] | [((1339, 1349), 'numpy.tanh', 'np.tanh', (['Z'], {}), '(Z)\n', (1346, 1349), True, 'import numpy as np\n'), ((1878, 1901), 'numpy.multiply', 'np.multiply', (['Z', '(Z > 0.0)'], {}), '(Z, Z > 0.0)\n', (1889, 1901), True, 'import numpy as np\n'), ((2166, 2191), 'numpy.multiply', 'np.multiply', (['(1.0)', '(Z > 0.0)'], {}... |
import os
import sys
import time
import glob
import numpy as np
import torch
import utils
import logging
import argparse
import torch.nn as nn
import genotypes
import torch.utils
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
from face_dataset_train import DataLoaderFace
from torch.autograd ... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"time.strftime",
"numpy.ones",
"logging.Formatter",
"utils.accuracy_face",
"model.NetworkCIFAR",
"glob.glob",
"utils.AvgrageMeter",
"os.path.join",
"face_dataset_train.DataLoaderFace",
"torch.cuda.set_device",
"utils.count_parameters_in_MB",
... | [((389, 421), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""cifar"""'], {}), "('cifar')\n", (412, 421), False, 'import argparse\n'), ((2478, 2589), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO', 'format': 'log_format', 'datefmt': '"""%m/%d %I:%M:%S %p"... |
import keras
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from keras import metrics, losses
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.models import Sequential
from sklearn.preprocessing import MinMaxScaler
chart_names = ["total-bi... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"keras.layers.LSTM",
"matplotlib.pyplot.legend",
"sklearn.preprocessing.MinMaxScaler",
"matplotlib.pyplot.ylabel",
"keras.layers.Dropout",
"keras.layers.Dense",
"numpy.array",
"numpy.reshape",
"... | [((1430, 1469), 'matplotlib.pyplot.plot', 'plt.plot', (['x_list', 'y_list'], {'label': '"""line1"""'}), "(x_list, y_list, label='line1')\n", (1438, 1469), True, 'import matplotlib.pyplot as plt\n'), ((1474, 1514), 'matplotlib.pyplot.plot', 'plt.plot', (['x_list', 'y_list2'], {'label': '"""line2"""'}), "(x_list, y_list2... |
import sys,os,math,time,json,fitsio
import os.path
import subprocess
import matplotlib.pyplot as plt
import numpy as np
import pylab as py
from astropy.table import Table, Column
import datetime
from bokeh.plotting import *
from bokeh.embed import components
from bokeh.models import ColumnDataSource, LabelSet, HoverToo... | [
"bokeh.models.ColumnDataSource",
"astropy.coordinates.get_moon",
"argparse.ArgumentParser",
"numpy.argsort",
"fitsio.read",
"matplotlib.pyplot.style.use",
"bokeh.models.CrosshairTool",
"numpy.arange",
"numpy.round",
"astropy.coordinates.EarthLocation.of_site",
"astropy.coordinates.get_body",
"... | [((808, 840), 'matplotlib.pyplot.style.use', 'plt.style.use', (['astropy_mpl_style'], {}), '(astropy_mpl_style)\n', (821, 840), True, 'import matplotlib.pyplot as plt\n'), ((2664, 3274), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""\n\n - A visulaization tool for planning DESI observations\n... |
"""
Like image_sample.py, but use a noisy image classifier to guide the sampling
process towards more realistic images.
"""
import argparse
import os
import numpy as np
import torch as th
import torch.distributed as dist
import torch.nn.functional as F
from guided_diffusion import dist_util, logger
from guided_diffu... | [
"argparse.ArgumentParser",
"guided_diffusion.dist_util.setup_dist",
"torch.distributed.all_gather",
"torch.distributed.get_world_size",
"torch.no_grad",
"guided_diffusion.script_util.add_dict_to_argparser",
"os.path.join",
"guided_diffusion.script_util.diffusion_defaults",
"guided_diffusion.logger.l... | [((748, 778), 'torch.distributed.all_gather', 'dist.all_gather', (['gathered_x', 'x'], {}), '(gathered_x, x)\n', (763, 778), True, 'import torch.distributed as dist\n'), ((985, 1074), 'guided_diffusion.dist_util.setup_dist', 'dist_util.setup_dist', ([], {'visible_gpu_list': 'visible_gpus_list', 'local_rank': 'args.loca... |
import os
import sys
import math
sys.path.insert(0,os.path.abspath('../../datatypes_and_database/'))
sys.path.insert(0,os.path.abspath('../../background_subtraction/sg_background_fit'))
sys.path.insert(0,os.path.abspath('../../config_file_handling/'))
sys.path.insert(0,os.path.abspath('../fitting_functions/'))
sys.path... | [
"yaml.load",
"numpy.sum",
"argparse.ArgumentParser",
"scipy.constants.codata.value",
"fitting_functions.least_squares_fit_lorentz_skew_lorentz_gain_slope_free_center",
"fitting_functions.least_squares_fit_lorentz_skew_lorentz_gain_slope_fixed_center",
"os.path.abspath",
"numpy.multiply",
"admx_datat... | [((1146, 1171), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1169, 1171), False, 'import argparse\n'), ((1488, 1518), 'yaml.load', 'yaml.load', (['run_definition_file'], {}), '(run_definition_file)\n', (1497, 1518), False, 'import yaml\n'), ((1627, 1653), 'admx_db_interface.ADMXDB', 'admx_db... |
# -*- coding: utf-8 -*-
"""
Generate figure showing the distribution of the nearest neighbor distance ratio
for regular and highly memorized observations.
Author: <NAME>
License: See LICENSE file.
Copyright: 2021, The Alan Turing Institute
"""
import argparse
import numpy as np
from fitter import Fitter
from ana... | [
"analysis_utils.dict2tex",
"numpy.load",
"argparse.ArgumentParser",
"fitter.Fitter"
] | [((381, 406), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (404, 406), False, 'import argparse\n'), ((4154, 4194), 'numpy.load', 'np.load', (['args.results'], {'allow_pickle': '(True)'}), '(args.results, allow_pickle=True)\n', (4161, 4194), True, 'import numpy as np\n'), ((4205, 4222), 'numpy... |
import pytest
import numpy as np
from eddington import FitFunctionRuntimeError
from tests.fit_function.dummy_functions import dummy_func1, dummy_func2
delta = 10e-5
@pytest.fixture
def dummy_func1_fixture():
yield dummy_func1
dummy_func1.clear_fixed()
@pytest.fixture
def dummy_func2_fixture():
yield ... | [
"tests.fit_function.dummy_functions.dummy_func2.clear_fixed",
"pytest.raises",
"numpy.array",
"tests.fit_function.dummy_functions.dummy_func2",
"pytest.approx",
"tests.fit_function.dummy_functions.dummy_func1.clear_fixed"
] | [((239, 264), 'tests.fit_function.dummy_functions.dummy_func1.clear_fixed', 'dummy_func1.clear_fixed', ([], {}), '()\n', (262, 264), False, 'from tests.fit_function.dummy_functions import dummy_func1, dummy_func2\n'), ((336, 361), 'tests.fit_function.dummy_functions.dummy_func2.clear_fixed', 'dummy_func2.clear_fixed', ... |
#!/usr/bin/env python
from __future__ import print_function
from statlogging import readlog
from readconfig import readconfig
from chkrate import chkrate
import os
import tempfile
os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp()
import matplotlib
matplotlib.use('Agg',warn=False)
import matplotlib.pyplot as plt
from sci... | [
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.axis",
"numpy.hstack",
"tempfile.mkdtemp",
"numpy.array",
"sys.stdout.flush",
"matplotlib.use",
"numpy.linspace",
"datetime.timedelta",
"scipy.interpolate.interp... | [((210, 228), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (226, 228), False, 'import tempfile\n'), ((247, 280), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {'warn': '(False)'}), "('Agg', warn=False)\n", (261, 280), False, 'import matplotlib\n'), ((654, 672), 'sys.stdout.flush', 'sys.stdout.flush',... |
'''
Created on 15 Jul 2013
@author: <NAME>
'''
import numpy as np
from core import regression_methods
def exponentialModelAnalysis(isopachs,n):
"""
Analyses the isopach data under the assumption it follows a n-segment exponential model
Model: T(x) = c*exp(-m*x)
IMPORTANT: Works under the assum... | [
"numpy.log",
"core.regression_methods.calculateMultiLineRegression",
"numpy.exp",
"core.regression_methods.meanRelativeSquaredError",
"numpy.sqrt"
] | [((2002, 2079), 'core.regression_methods.calculateMultiLineRegression', 'regression_methods.calculateMultiLineRegression', (['sqrtAreasKM', 'logThickness', 'n'], {}), '(sqrtAreasKM, logThickness, n)\n', (2049, 2079), False, 'from core import regression_methods\n'), ((2789, 2882), 'core.regression_methods.meanRelativeSq... |
from os import listdir
from os.path import isfile, join
import numpy as np
import matplotlib.pyplot as plt
from magenta.models.nsynth.wavenet import fastgen
import sys
# Change path back to /src to load other modules
sys.path.insert(0, '/home/ubuntu/DeepBass/src')
from ingestion.IO_utils import Load, Save
import stream... | [
"numpy.save",
"os.path.join",
"ingestion.IO_utils.Load",
"magenta.models.nsynth.wavenet.fastgen.synthesize",
"sys.path.insert",
"time.time",
"magenta.models.nsynth.wavenet.fastgen.encode",
"streamlit.pyplot",
"matplotlib.pyplot.subplots",
"os.listdir",
"ingestion.IO_utils.Save"
] | [((217, 264), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/home/ubuntu/DeepBass/src"""'], {}), "(0, '/home/ubuntu/DeepBass/src')\n", (232, 264), False, 'import sys\n'), ((1059, 1095), 'ingestion.IO_utils.Load', 'Load', (['AUDIO_DIR', 'filenames[0]'], {'sr': 'sr'}), '(AUDIO_DIR, filenames[0], sr=sr)\n', (1063, 10... |
# -*- coding: utf-8 -*-
"""
HikeBooklet
author: georand
source: https://github.com/georand/hikebooklet
date: 2021
"""
import io, pathlib, logging
import requests
import numpy as np
from PIL import Image, ImageDraw, ImageColor, ImageFont
from config import *
logger=logging.getLogger(__name__)
class TileMap ():
... | [
"numpy.radians",
"PIL.Image.new",
"io.BytesIO",
"numpy.log",
"requests.Session",
"pathlib.Path",
"numpy.tan",
"numpy.cos",
"PIL.ImageDraw.Draw",
"numpy.sinh",
"logging.getLogger"
] | [((273, 300), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (290, 300), False, 'import io, pathlib, logging\n'), ((3374, 3399), 'numpy.radians', 'np.radians', (["latlon['lat']"], {}), "(latlon['lat'])\n", (3384, 3399), True, 'import numpy as np\n'), ((4204, 4242), 'PIL.Image.new', 'Image... |
import pytest
from _plotly_utils.basevalidators import InfoArrayValidator, type_str
import numpy as np
# Fixtures
# --------
@pytest.fixture()
def validator_any2():
return InfoArrayValidator('prop', 'parent', items=[{'valType': 'any'}, {'valType': 'any'}])
@pytest.fixture()
def validator_number3():
return I... | [
"_plotly_utils.basevalidators.InfoArrayValidator",
"_plotly_utils.basevalidators.type_str",
"pytest.fixture",
"pytest.raises",
"numpy.array",
"pytest.mark.parametrize"
] | [((128, 144), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (142, 144), False, 'import pytest\n'), ((266, 282), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (280, 282), False, 'import pytest\n'), ((521, 537), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (535, 537), False, 'import pytest\n'), (... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import operator
import itertools
import numpy as np
from zarr.util import is_total_slice, normalize_array_selection, \
get_chunk_range, human_readable_size, normalize_resize_args, \
normalize_storage_path, normalize_sha... | [
"zarr.util.normalize_storage_path",
"numpy.empty",
"zarr.codecs.get_codec",
"zarr.util.normalize_resize_args",
"zarr.storage.listdir",
"zarr.codecs.AsType",
"zarr.util.normalize_shape",
"zarr.errors.err_read_only",
"zarr.util.normalize_chunks",
"itertools.product",
"zarr.attrs.Attributes",
"za... | [((2311, 2339), 'zarr.util.normalize_storage_path', 'normalize_storage_path', (['path'], {}), '(path)\n', (2333, 2339), False, 'from zarr.util import is_total_slice, normalize_array_selection, get_chunk_range, human_readable_size, normalize_resize_args, normalize_storage_path, normalize_shape, normalize_chunks\n'), ((2... |
import torch
from torch.utils.data import Dataset
import torchvision.transforms as transforms
import os.path as osp
import os
from PIL import Image
import numpy as np
import json
from data_utils.transform import *
import cv2
class TransformationVal(object):
def __init__(self, size_wh=[1536, 768]):
self.s... | [
"tqdm.tqdm",
"PIL.Image.open",
"numpy.array",
"torchvision.transforms.Normalize",
"numpy.unique",
"torchvision.transforms.ToTensor"
] | [((3417, 3425), 'tqdm.tqdm', 'tqdm', (['ds'], {}), '(ds)\n', (3421, 3425), False, 'from tqdm import tqdm\n'), ((2559, 2576), 'PIL.Image.open', 'Image.open', (['impth'], {}), '(impth)\n', (2569, 2576), False, 'from PIL import Image\n'), ((2593, 2610), 'PIL.Image.open', 'Image.open', (['lbpth'], {}), '(lbpth)\n', (2603, ... |
"""
Kriging geographical data
-------------------------
In this example we are going to interpolate actual temperature data from
the German weather service `DWD <https://www.dwd.de/EN>`_.
"""
import os
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import gstools as gs
border = np.loadtxt... | [
"gstools.krige.Universal",
"os.path.join",
"numpy.deg2rad",
"gstools.Spherical",
"numpy.arange",
"scipy.stats.linregress",
"numpy.linspace",
"gstools.vario_estimate",
"matplotlib.pyplot.subplots",
"gstools.krige.Detrended"
] | [((788, 852), 'gstools.vario_estimate', 'gs.vario_estimate', (['(lat, lon)', 'temp'], {'bin_edges': 'bins', 'latlon': '(True)'}), '((lat, lon), temp, bin_edges=bins, latlon=True)\n', (805, 852), True, 'import gstools as gs\n'), ((1567, 1617), 'gstools.Spherical', 'gs.Spherical', ([], {'latlon': '(True)', 'rescale': 'gs... |
from random import shuffle
import sys
import anndata
import numpy as np
from scipy import sparse
from sklearn import preprocessing
def print_progress(epoch, logs, n_epochs=10000):
"""Creates Message for '_print_progress_bar'.
Parameters
----------
epoch: Integer
Current epoch ite... | [
"sys.stdout.write",
"scipy.sparse.issparse",
"random.shuffle",
"numpy.unique",
"sklearn.preprocessing.LabelEncoder",
"sys.stdout.flush",
"anndata.AnnData",
"numpy.concatenate",
"numpy.repeat"
] | [((1784, 1802), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (1800, 1802), False, 'import sys\n'), ((3182, 3217), 'numpy.unique', 'np.unique', (['adata.obs[cell_type_key]'], {}), '(adata.obs[cell_type_key])\n', (3191, 3217), True, 'import numpy as np\n'), ((4081, 4111), 'numpy.concatenate', 'np.concatenate... |
# ----------------------------------------------------------------------------
# - TanksAndTemples Website Toolbox -
# - http://www.tanksandtemples.org -
# ----------------------------------------------------------------------------
# Th... | [
"copy.deepcopy",
"json.load",
"numpy.asarray",
"numpy.savetxt",
"os.system",
"numpy.cumsum",
"numpy.histogram",
"numpy.array",
"numpy.arange"
] | [((2217, 2238), 'copy.deepcopy', 'copy.deepcopy', (['source'], {}), '(source)\n', (2230, 2238), False, 'import copy\n'), ((2465, 2486), 'copy.deepcopy', 'copy.deepcopy', (['target'], {}), '(target)\n', (2478, 2486), False, 'import copy\n'), ((3757, 3783), 'os.system', 'os.system', (['eval_str_viewDT'], {}), '(eval_str_... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"tensorflow.compat.v1.variables_initializer",
"numpy.ceil",
"tensorflow.compat.v1.zeros_initializer",
"tensorflow.compat.v1.variable_scope",
"tensorflow.compat.v1.reduce_mean",
"tensorflow.compat.v1.logging.info",
"tensorflow.compat.v1.layers.batch_normalization",
"collections.namedtuple",
"tensorfl... | [((982, 1055), 'collections.namedtuple', 'collections.namedtuple', (['"""ConvLayer"""', "['kernel_size', 'stride', 'filters']"], {}), "('ConvLayer', ['kernel_size', 'stride', 'filters'])\n", (1004, 1055), False, 'import collections\n'), ((2664, 2686), 'tensorflow.compat.v1.variable_scope', 'tf.variable_scope', (['"""a"... |
from src.metrics.significance import _significance, _mask_with_significance
from src.metrics.consolidated_dprimes import single_cell_dprimes, probewise_LDA_dprimes, probewise_dPCA_dprimes, full_dPCA_dprimes
from src.metrics.dprime import flip_dprimes
from src.data.load import get_site_ids
from src.metrics.consolidated_... | [
"pandas.DataFrame",
"src.metrics.consolidated_metrics.metrics_to_DF",
"src.metrics.dprime.flip_dprimes",
"src.metrics.significance._mask_with_significance",
"src.metrics.consolidated_dprimes.full_dPCA_dprimes",
"joblib.dump",
"src.data.load.set_name",
"src.metrics.significance._significance",
"pathl... | [((2125, 2139), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (2137, 2139), False, 'from configparser import ConfigParser\n'), ((3672, 3686), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (3684, 3686), True, 'import pandas as pd\n'), ((6296, 6321), 'joblib.dump', 'dump', (['DF', 'summary_DF_fil... |
#!/usr/bin/python
# Copyright 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice... | [
"sys.path.append",
"unittest.main",
"numpy.arange",
"numpy.ones"
] | [((1572, 1600), 'sys.path.append', 'sys.path.append', (['"""../common"""'], {}), "('../common')\n", (1587, 1600), False, 'import sys\n'), ((6869, 6884), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6882, 6884), False, 'import unittest\n'), ((1997, 2027), 'numpy.arange', 'np.arange', (['(8)'], {'dtype': 'np.floa... |
# Copyright 2019, Ri<NAME>
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
import os
from abc import ABCMeta, abstractmethod
from itertools import product
from typing import Callable
import gym
import gym.spaces
import n... | [
"pyquil.gates.RESET",
"numpy.load",
"numpy.random.seed",
"numpy.isclose",
"numpy.mean",
"pyquil.unitary_tools.all_bitstrings",
"numpy.full",
"os.path.exists",
"numpy.apply_along_axis",
"numpy.max",
"pyquil.quil.Pragma",
"numpy.linspace",
"itertools.product",
"pyquil.gates.CNOT",
"pyquil.... | [((1793, 1823), 'numpy.apply_along_axis', 'np.apply_along_axis', (['f', '(1)', 'bss'], {}), '(f, 1, bss)\n', (1812, 1823), True, 'import numpy as np\n'), ((1907, 1923), 'numpy.isclose', 'np.isclose', (['m', 'M'], {}), '(m, M)\n', (1917, 1923), True, 'import numpy as np\n'), ((1873, 1885), 'numpy.min', 'np.min', (['vals... |
# -*- coding: utf-8 -*-
"""Abstract Base Class for Basis Function and some common implementations."""
import abc
import numpy as np
class BasisFunction(object):
r"""ABC for basis functions used by LSPI Policies.
A basis function is a function that takes in a state vector and an action
index and return... | [
"numpy.where",
"numpy.array",
"numpy.sum"
] | [((4384, 4399), 'numpy.array', 'np.array', (['[1.0]'], {}), '([1.0])\n', (4392, 4399), True, 'import numpy as np\n'), ((13339, 13368), 'numpy.sum', 'np.sum', (['(mean_diff * mean_diff)'], {}), '(mean_diff * mean_diff)\n', (13345, 13368), True, 'import numpy as np\n'), ((14546, 14571), 'numpy.where', 'np.where', (['(num... |
"""
femagtools.dxfsl.converter
~~~~~~~~~~~~~~~~~~~~~~~~~~
read a dxf file and create a plot or fsl file
Authors: <NAME>, <NAME>
"""
import os
from femagtools.dxfsl.geom import Geometry, dxfshapes, femshapes
from femagtools.dxfsl.shape import Shape
from femagtools.dxfsl.fslrenderer import FslRenderer, agndst
fr... | [
"femagtools.dxfsl.geom.femshapes",
"os.path.basename",
"femagtools.dxfsl.fslrenderer.FslRenderer",
"femagtools.dxfsl.plotrenderer.PlotRenderer",
"numpy.isclose",
"femagtools.dxfsl.geom.dxfshapes",
"logging.getLogger",
"femagtools.dxfsl.fslrenderer.agndst"
] | [((439, 466), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (456, 466), False, 'import logging\n'), ((4986, 5000), 'femagtools.dxfsl.plotrenderer.PlotRenderer', 'PlotRenderer', ([], {}), '()\n', (4998, 5000), False, 'from femagtools.dxfsl.plotrenderer import PlotRenderer\n'), ((16593, 16... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.