code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import pylab import matplotlib as mpl import numpy as np import matplotlib.colors as colors import matplotlib.pyplot as plt import matplotlib.colors as mcolors from colormap import cmap_builder, test_cmap # for _build_colormap() # --------------------------------------...
[ "matplotlib.pyplot.imshow", "colormap.cmap_builder", "matplotlib.pyplot.savefig", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.clf", "matplotlib.pyplot.axis", "numpy.linspace", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((769, 808), 'colormap.cmap_builder', 'cmap_builder', (['"""blue"""', '"""orange"""', '"""green"""'], {}), "('blue', 'orange', 'green')\n", (781, 808), False, 'from colormap import cmap_builder, test_cmap\n'), ((1019, 1040), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'ncols': '(2)'}), '(ncols=2)\n', (1031, 10...
import random as _random import unittest as _unittest import numpy as _np import torch as _torch import torchutils as _tu class _TestUtils(_unittest.TestCase): def test_set_random_seed(self): # Set new seed and verify. seed = _random.randint(1, 1000) _tu.set_random_seed(seed) np...
[ "numpy.random.get_state", "torch.initial_seed", "torch.cuda.is_available", "torch.cuda.initial_seed", "unittest.main", "random.randint", "torchutils.set_random_seed" ]
[((676, 692), 'unittest.main', '_unittest.main', ([], {}), '()\n', (690, 692), True, 'import unittest as _unittest\n'), ((251, 275), 'random.randint', '_random.randint', (['(1)', '(1000)'], {}), '(1, 1000)\n', (266, 275), True, 'import random as _random\n'), ((284, 309), 'torchutils.set_random_seed', '_tu.set_random_se...
import numpy as np import matplotlib.pyplot as plt from sklearn import svm from solo12_collisions_utils import followBoundary # Load the collision map from file col_map_file = './npy_data/collision_map_centered_res100.npy' col_map = np.load(col_map_file, allow_pickle=True) traj1 = np.array(followBoundary(col_map)) tr...
[ "matplotlib.pyplot.xticks", "sklearn.svm.NuSVC", "solo12_collisions_utils.followBoundary", "numpy.array", "matplotlib.pyplot.contour", "numpy.linspace", "matplotlib.pyplot.yticks", "matplotlib.pyplot.scatter", "matplotlib.pyplot.axis", "numpy.load", "matplotlib.pyplot.show" ]
[((235, 275), 'numpy.load', 'np.load', (['col_map_file'], {'allow_pickle': '(True)'}), '(col_map_file, allow_pickle=True)\n', (242, 275), True, 'import numpy as np\n'), ((1417, 1428), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (1425, 1428), True, 'import numpy as np\n'), ((1497, 1514), 'sklearn.svm.NuSVC', 'svm.N...
import os import numpy as np from data_prepare import * from Network_structure import * from loss_function import * from train_method import * def save_eeg(saved_model, result_location, foldername, save_train, save_vali, save_test, noiseEEG_train, EEG_train, noiseEEG_val, EEG_val, noiseEEG_test,...
[ "os.makedirs", "os.path.exists", "numpy.save" ]
[((814, 946), 'numpy.save', 'np.save', (["(result_location + '/' + foldername + '/' + train_num + '/' + 'nn_output' +\n '/' + 'noiseinput_train.npy')", 'noiseEEG_train'], {}), "(result_location + '/' + foldername + '/' + train_num + '/' +\n 'nn_output' + '/' + 'noiseinput_train.npy', noiseEEG_train)\n", (821, 946...
import os import tempfile import time import cv2 import numpy as np from PIL import Image def calcVanishingPoint(lines): points = lines[:, :2] normals = lines[:, 2:4] - lines[:, :2] normals /= np.maximum(np.linalg.norm(normals, axis=-1, keepdims=True), 1e-4) normals = np.stack([normals[:, 1], -normal...
[ "numpy.clip", "numpy.ceil", "numpy.linalg.solve", "numpy.ones", "numpy.random.choice", "numpy.logical_not", "numpy.argmax", "numpy.stack", "numpy.deg2rad", "numpy.zeros", "numpy.array", "numpy.random.randint", "numpy.linalg.lstsq", "numpy.linalg.norm", "numpy.dot", "numpy.expand_dims",...
[((288, 337), 'numpy.stack', 'np.stack', (['[normals[:, 1], -normals[:, 0]]'], {'axis': '(1)'}), '([normals[:, 1], -normals[:, 0]], axis=1)\n', (296, 337), True, 'import numpy as np\n'), ((2329, 2350), 'numpy.stack', 'np.stack', (['VPs'], {'axis': '(0)'}), '(VPs, axis=0)\n', (2337, 2350), True, 'import numpy as np\n'),...
from __future__ import print_function import argparse from collections import OrderedDict import json import os import logging from keras.callbacks import EarlyStopping from sklearn.preprocessing import normalize from sklearn.metrics import roc_curve, auc, roc_auc_score, precision_score, recall_score, f1_score, accurac...
[ "logging.debug", "pandas.read_csv", "common.get_next_model_id", "common.save_model", "sklearn.metrics.precision_score", "sklearn.metrics.recall_score", "keras.optimizers.SGD", "common.ensure_dir", "sklearn.metrics.r2_score", "argparse.ArgumentParser", "numpy.where", "json.dumps", "numpy.asar...
[((1981, 1998), 'numpy.load', 'np.load', (['filename'], {}), '(filename)\n', (1988, 1998), True, 'import numpy as np\n'), ((2010, 2103), 'scipy.sparse.csr_matrix', 'csr_matrix', (["(loader['data'], loader['indices'], loader['indptr'])"], {'shape': "loader['shape']"}), "((loader['data'], loader['indices'], loader['indpt...
import tensorflow as tf from tensorflow.contrib import slim import numpy as np import os import time from utils import kde from ops import * tf.reset_default_graph() os.environ['CUDA_VISIBLE_DEVICES'] = '6' # Parameters learning_rate = 1e-3 reg_param = 10. batch_size = 128 x_dim = 2 z_dim = 2 sigma = 0.7 mu = 2 met...
[ "os.path.exists", "tensorflow.reset_default_graph", "tensorflow.random_normal", "os.makedirs", "tensorflow.Session", "time.strftime", "os.path.join", "tensorflow.global_variables_initializer", "numpy.random.randn", "tensorflow.summary.scalar", "tensorflow.summary.FileWriter", "tensorflow.make_...
[((144, 168), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (166, 168), True, 'import tensorflow as tf\n'), ((1302, 1357), 'tensorflow.make_template', 'tf.make_template', (['"""generator"""', 'generator4Gaussian_func1'], {}), "('generator', generator4Gaussian_func1)\n", (1318, 1357), Tru...
# Copyright 2022 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...
[ "mindspore.ops.Cummax", "mindspore.context.set_context", "pytest.mark.parametrize", "numpy.array", "mindspore.ops.operations._inner_ops.Cummin", "mindspore.Tensor" ]
[((2017, 2113), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""data_type"""', '[np.uint8, np.int8, np.int32, np.float16, np.float32]'], {}), "('data_type', [np.uint8, np.int8, np.int32, np.\n float16, np.float32])\n", (2040, 2113), False, 'import pytest\n'), ((3272, 3389), 'pytest.mark.parametrize', 'py...
import random import numpy as np from mesa import Agent # [STRATEGY_CHEATERS, STRATEGY_FAIR, STRATEGY_GENEROUS, STRATEGY_MARTYRS, STRATEGY_PRUDENT] SMART_VAMPIRE_STRATEGIES_PROB = [0.25, 0.25, 0.125, 0.25, 0.125] class Vampire(Agent): def __init__(self, id, model, root_id): super().__init__(id, model) ...
[ "random.choice", "numpy.ones", "numpy.random.choice", "numpy.sum", "numpy.random.randint", "random.random" ]
[((2752, 2829), 'numpy.random.choice', 'np.random.choice', (['self.STRATEGIES'], {'p': 'self.model.smart_vampire_strategies_prob'}), '(self.STRATEGIES, p=self.model.smart_vampire_strategies_prob)\n', (2768, 2829), True, 'import numpy as np\n'), ((720, 735), 'random.random', 'random.random', ([], {}), '()\n', (733, 735)...
from numpy import random x = random.multinomial(n=6, pvals=[1 / 6, 1 / 6, 1 / 6, 1 / 6, 1 / 6, 1 / 6]) print(x)
[ "numpy.random.multinomial" ]
[((30, 103), 'numpy.random.multinomial', 'random.multinomial', ([], {'n': '(6)', 'pvals': '[1 / 6, 1 / 6, 1 / 6, 1 / 6, 1 / 6, 1 / 6]'}), '(n=6, pvals=[1 / 6, 1 / 6, 1 / 6, 1 / 6, 1 / 6, 1 / 6])\n', (48, 103), False, 'from numpy import random\n')]
#getLog(mt) : Returns the natural log of the matrix. import numpy as np from .isPSDMd import isPSD __all__ = ['getLog'] def getLog(M, eps=1e-15): r"""Takes as input a matrix M and returns the natural log of M. Parameters ---------- M : numpy.ndarray 2-d array representing a...
[ "numpy.log", "numpy.any" ]
[((1135, 1152), 'numpy.any', 'np.any', (['(val < eps)'], {}), '(val < eps)\n', (1141, 1152), True, 'import numpy as np\n'), ((1211, 1222), 'numpy.log', 'np.log', (['val'], {}), '(val)\n', (1217, 1222), True, 'import numpy as np\n')]
# Copyright 2020 Xilinx Inc. # # 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 writin...
[ "os.path.join", "cv2.resize", "numpy.asarray", "cv2.imread" ]
[((1452, 1508), 'cv2.resize', 'cv2.resize', (['image', 'size'], {'interpolation': 'cv2.INTER_NEAREST'}), '(image, size, interpolation=cv2.INTER_NEAREST)\n', (1462, 1508), False, 'import cv2\n'), ((1551, 1568), 'numpy.asarray', 'np.asarray', (['image'], {}), '(image)\n', (1561, 1568), True, 'import numpy as np\n'), ((22...
# SCRAMBLE - Adit import cv2 import numpy as np from emb import * def decryption2(p,key): img = cv2.imread(p, cv2.IMREAD_GRAYSCALE) i2 = np.zeros((258, 258), dtype="int") i3 = np.zeros((258, 258), dtype="int") i4 = np.zeros((258, 258), dtype="int") i5 = np.zeros((258, 258), dtype="int") key2=ke...
[ "numpy.roll", "cv2.imwrite", "numpy.zeros", "cv2.imread" ]
[((101, 136), 'cv2.imread', 'cv2.imread', (['p', 'cv2.IMREAD_GRAYSCALE'], {}), '(p, cv2.IMREAD_GRAYSCALE)\n', (111, 136), False, 'import cv2\n'), ((146, 179), 'numpy.zeros', 'np.zeros', (['(258, 258)'], {'dtype': '"""int"""'}), "((258, 258), dtype='int')\n", (154, 179), True, 'import numpy as np\n'), ((189, 222), 'nump...
import pickle import pytest import numpy as np from astropy import units as u from astropy import modeling from specutils.utils import QuantityModel from ..utils.wcs_utils import refraction_index, vac_to_air, air_to_vac wavelengths = [300, 500, 1000] * u.nm data_index_refraction = { 'Griesen2006': np.array([3.073...
[ "astropy.modeling.models.Chebyshev1D", "pickle.dump", "specutils.utils.QuantityModel", "numpy.isclose", "pickle.load", "numpy.array", "numpy.all" ]
[((305, 349), 'numpy.array', 'np.array', (['[3.07393068, 2.9434858, 2.8925797]'], {}), '([3.07393068, 2.9434858, 2.8925797])\n', (313, 349), True, 'import numpy as np\n'), ((369, 415), 'numpy.array', 'np.array', (['[2.91557413, 2.78963801, 2.74148172]'], {}), '([2.91557413, 2.78963801, 2.74148172])\n', (377, 415), True...
#数値微分の例 import numpy as np from common_function import function_1, numerical_diff import matplotlib.pylab as plt def tangent_line(f, x): d = numerical_diff(f, x) print(d) y = f(x) - d*x return lambda t: d*t + y x = np.arange(0.0, 20.0, 0.1) #0から20まで0.1刻みのx配列 y = function_1(x) plt.xlabel("x") plt.yla...
[ "matplotlib.pylab.xlabel", "common_function.function_1", "matplotlib.pylab.show", "common_function.numerical_diff", "matplotlib.pylab.plot", "numpy.arange", "matplotlib.pylab.ylabel" ]
[((234, 259), 'numpy.arange', 'np.arange', (['(0.0)', '(20.0)', '(0.1)'], {}), '(0.0, 20.0, 0.1)\n', (243, 259), True, 'import numpy as np\n'), ((282, 295), 'common_function.function_1', 'function_1', (['x'], {}), '(x)\n', (292, 295), False, 'from common_function import function_1, numerical_diff\n'), ((297, 312), 'mat...
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from perlin import generate_perlin def gaussian_2d_fast(size, amp, mu_x, mu_y, sigma): x = np.arange(0, 1, 1/size[0]) y = np.arange(0, 1, 1/size[1]) xs, ys = np.meshgrid(x,y) dxs = np.minimum(np.abs(xs-mu_x), 1-np.abs(xs-mu_x)...
[ "numpy.sin", "numpy.arange", "matplotlib.pyplot.imshow", "numpy.mean", "numpy.multiply", "numpy.reshape", "numpy.random.random", "numpy.where", "numpy.exp", "matplotlib.cm.ScalarMappable", "perlin.generate_perlin", "numpy.meshgrid", "numpy.abs", "matplotlib.pyplot.quiver", "numpy.amin", ...
[((172, 200), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(1 / size[0])'], {}), '(0, 1, 1 / size[0])\n', (181, 200), True, 'import numpy as np\n'), ((207, 235), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(1 / size[1])'], {}), '(0, 1, 1 / size[1])\n', (216, 235), True, 'import numpy as np\n'), ((247, 264), 'numpy.m...
""" Module: libfmp.c8.c8s2_salience Author: <NAME>, <NAME> License: The MIT license, https://opensource.org/licenses/MIT This file is part of the FMP Notebooks (https://www.audiolabs-erlangen.de/FMP) """ import numpy as np import librosa from scipy import ndimage from numba import jit import libfmp.b import libfmp.c...
[ "numpy.hanning", "numpy.abs", "numpy.copy", "numpy.logical_and", "numpy.angle", "numpy.array", "numpy.zeros", "numba.jit", "librosa.stft", "numpy.log2", "numpy.mod", "numpy.float32", "numpy.arange" ]
[((325, 343), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (328, 343), False, 'from numba import jit\n'), ((709, 727), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (712, 727), False, 'from numba import jit\n'), ((1672, 1690), 'numba.jit', 'jit', ([], {'nopython': '(Tr...
from pandas import Series from igraph import * from numba import jit import numpy as np import os # import time # Gather all the files. files = os.listdir('timeseries/') # Concatenate (or stack) all the files. # Approx 12.454981 seconds i = 0 for f in files: if i == 0: ts_matrix = np.loadtxt('timeseries/'...
[ "pandas.Series", "os.listdir", "numpy.hstack", "numpy.where", "numpy.corrcoef", "numpy.loadtxt", "numpy.arange" ]
[((145, 170), 'os.listdir', 'os.listdir', (['"""timeseries/"""'], {}), "('timeseries/')\n", (155, 170), False, 'import os\n'), ((504, 528), 'numpy.corrcoef', 'np.corrcoef', (['ts_matrix.T'], {}), '(ts_matrix.T)\n', (515, 528), True, 'import numpy as np\n'), ((1929, 1940), 'numpy.where', 'np.where', (['X'], {}), '(X)\n'...
import numpy as np # Part 1 data = np.loadtxt('data.csv') def get_number_of_times_count_increased(data): increased_counter = 0 for i in range(len(data)-1): if data[i+1]>data[i]: increased_counter +=1 return increased_counter data = np.loadtxt('data.csv') increased_counter = get_numbe...
[ "numpy.sum", "numpy.loadtxt" ]
[((37, 59), 'numpy.loadtxt', 'np.loadtxt', (['"""data.csv"""'], {}), "('data.csv')\n", (47, 59), True, 'import numpy as np\n'), ((268, 290), 'numpy.loadtxt', 'np.loadtxt', (['"""data.csv"""'], {}), "('data.csv')\n", (278, 290), True, 'import numpy as np\n'), ((568, 599), 'numpy.sum', 'np.sum', (['data[i:i + window_size...
# Copyright (c) 2019 Intel Corporation. # # 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, ...
[ "logging.getLogger", "cv2.createBackgroundSubtractorMOG2", "cv2.threshold", "cv2.morphologyEx", "numpy.sum", "cv2.getStructuringElement", "cv2.boundingRect" ]
[((2080, 2111), 'logging.getLogger', 'logging.getLogger', (['"""PCB_FILTER"""'], {}), "('PCB_FILTER')\n", (2097, 2111), False, 'import logging\n'), ((2242, 2278), 'cv2.createBackgroundSubtractorMOG2', 'cv2.createBackgroundSubtractorMOG2', ([], {}), '()\n', (2276, 2278), False, 'import cv2\n'), ((3565, 3616), 'cv2.getSt...
import numpy as np from scipy.sparse import diags from sklearn.metrics import pairwise_distances from fclsp.reshaping_utils import vec_hollow_sym def get_lap_coef(V, w, var_type, shape): """ Computes the Laplacian coefficent vector TODO: finish documenting Parameters ---------- V: array-lik...
[ "fclsp.reshaping_utils.vec_hollow_sym", "numpy.sqrt" ]
[((1688, 1708), 'fclsp.reshaping_utils.vec_hollow_sym', 'vec_hollow_sym', (['coef'], {}), '(coef)\n', (1702, 1708), False, 'from fclsp.reshaping_utils import vec_hollow_sym\n'), ((1579, 1589), 'numpy.sqrt', 'np.sqrt', (['w'], {}), '(w)\n', (1586, 1589), True, 'import numpy as np\n')]
# See ciDifference.ipynb for derivation, implementation notes, and test def cidifference(datagen, umin, umax, wmin, wmax, alpha=0.05, rmin=0, rmax=1, raiseonerr=False): import numpy as np from cvxopt import solvers, matrix from math import log, exp from scipy.stats import f from .es...
[ "scipy.stats.f.isf", "numpy.ones", "pprint.pformat", "math.log", "numpy.array", "numpy.zeros", "numpy.outer", "cvxopt.matrix", "math.exp" ]
[((3035, 3144), 'numpy.array', 'np.array', (['[[1, u, w] for u in (umin, umax) for w in (wmin, wmax) for r in (rmin, rmax)]'], {'dtype': '"""float64"""'}), "([[1, u, w] for u in (umin, umax) for w in (wmin, wmax) for r in (\n rmin, rmax)], dtype='float64')\n", (3043, 3144), True, 'import numpy as np\n'), ((633, 667)...
import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as p3 import matplotlib.animation as animation filename = "experiment_data/012522-16_29_48-data.csv" data = np.genfromtxt(filename, delimiter=',', skip_header=2) timestamps = data[:, 0] timestamps -= timestamps[0] cf1_actual_posi...
[ "mpl_toolkits.mplot3d.axes3d.Axes3D", "matplotlib.pyplot.figure", "numpy.genfromtxt", "matplotlib.pyplot.show" ]
[((197, 250), 'numpy.genfromtxt', 'np.genfromtxt', (['filename'], {'delimiter': '""","""', 'skip_header': '(2)'}), "(filename, delimiter=',', skip_header=2)\n", (210, 250), True, 'import numpy as np\n'), ((832, 844), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (842, 844), True, 'import matplotlib.pyplot...
# //////////////////////////////////////////////////////////////////////////// # // This file is part of NIID-Net. For more information # // see <https://github.com/zju3dv/NIID-Net>. # // If you use this code, please cite the corresponding publications as # // listed on the above website. # // # // Copyright (c) Z...
[ "torch.cuda.manual_seed_all", "torch.manual_seed", "random.seed", "numpy.random.seed", "torch.cuda.manual_seed" ]
[((1479, 1502), 'torch.manual_seed', 'torch.manual_seed', (['SEED'], {}), '(SEED)\n', (1496, 1502), False, 'import torch\n'), ((1511, 1539), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['SEED'], {}), '(SEED)\n', (1533, 1539), False, 'import torch\n'), ((1548, 1580), 'torch.cuda.manual_seed_all', 'torch.cuda.ma...
from typing import Dict, Generator, Optional, Tuple, Union import numpy as np from joblib import ( # type: ignore delayed, Parallel, ) from numpy import linalg from sklearn.metrics import accuracy_score from sklearn.base import BaseEstimator from libifbtsvm.functions import ( fuzzy_membership, trai...
[ "numpy.reshape", "numpy.unique", "numpy.ones", "libifbtsvm.functions.train_model", "numpy.delete", "numpy.where", "numpy.asarray", "joblib.Parallel", "numpy.array", "numpy.append", "numpy.argwhere", "numpy.matmul", "numpy.ndarray", "numpy.concatenate", "numpy.linalg.norm", "joblib.dela...
[((1870, 1901), 'numpy.delete', 'np.delete', (['score[0]', 'candidates'], {}), '(score[0], candidates)\n', (1879, 1901), True, 'import numpy as np\n'), ((1917, 1948), 'numpy.delete', 'np.delete', (['score[1]', 'candidates'], {}), '(score[1], candidates)\n', (1926, 1948), True, 'import numpy as np\n'), ((1966, 1990), 'n...
# Simple Python script to compute feature importance using univariate statistical analysis, recursive feature elimination, and elastic net # by <NAME> and <NAME>, 2018 import numpy as np import sys # feature selection methods from sklearn.feature_selection import SelectKBest from sklearn.feature_selection import Gene...
[ "sklearn.linear_model.ElasticNetCV", "sklearn.feature_selection.SelectKBest", "datetime.datetime.now", "genericFunctions.loadTCGADataset", "numpy.isnan", "sklearn.svm.SVC" ]
[((876, 894), 'sklearn.feature_selection.SelectKBest', 'SelectKBest', ([], {'k': '(100)'}), '(k=100)\n', (887, 894), False, 'from sklearn.feature_selection import SelectKBest\n'), ((1141, 1155), 'sklearn.linear_model.ElasticNetCV', 'ElasticNetCV', ([], {}), '()\n', (1153, 1155), False, 'from sklearn.linear_model import...
"""Collage renderer.""" import itertools import logger import numpy from PIL import Image, ImageEnhance from distance_matrix import imageMSE ENABLE_POST_OPTIMIZATION = True def adjustImage(image, parameters): """Adjusts the brightness, contrast, and saturation of the given image.""" (brightness, contrast, satur...
[ "distance_matrix.imageMSE", "PIL.Image.new", "PIL.Image.blend", "itertools.product", "logger.info", "PIL.ImageEnhance.Brightness", "PIL.ImageEnhance.Contrast", "PIL.ImageEnhance.Color", "logger.progress", "numpy.arange" ]
[((898, 926), 'numpy.arange', 'numpy.arange', (['(0.6)', '(1.3)', '(0.05)'], {}), '(0.6, 1.3, 0.05)\n', (910, 926), False, 'import numpy\n'), ((943, 971), 'numpy.arange', 'numpy.arange', (['(0.9)', '(1.2)', '(0.05)'], {}), '(0.9, 1.2, 0.05)\n', (955, 971), False, 'import numpy\n'), ((990, 1018), 'numpy.arange', 'numpy....
# -*- coding: utf-8 -*- """ Created on Fri Jan 29 16:39:41 2021 @author: harsh """ import numpy as np import math as mm import opensees as op import time as tt ################################################################## # # # Effective s...
[ "opensees.updateMaterialStage", "opensees.wipe", "math.floor", "opensees.nDMaterial", "opensees.pattern", "math.cos", "opensees.getTime", "opensees.numberer", "opensees.integrator", "opensees.constraints", "math.atan", "opensees.element", "opensees.wipeAnalysis", "opensees.timeSeries", "...
[((1778, 1787), 'opensees.wipe', 'op.wipe', ([], {}), '()\n', (1785, 1787), True, 'import opensees as op\n'), ((2056, 2080), 'numpy.zeros', 'np.zeros', (['(numLayers, 1)'], {}), '((numLayers, 1))\n', (2064, 2080), True, 'import numpy as np\n'), ((2540, 2564), 'numpy.zeros', 'np.zeros', (['(numLayers, 1)'], {}), '((numL...
import logging from typing import Union, Tuple import threading import numpy as np from pyobs.comm import RemoteException from pyobs.interfaces import IFocuser, ICamera, IAutoFocus, IFilters, ICameraExposureTime, IImageType from pyobs.events import FocusFoundEvent from pyobs.object import get_object from pyobs.mixins ...
[ "logging.getLogger", "pyobs.mixins.CameraSettingsMixin.__init__", "pyobs.object.get_object", "threading.Event", "pyobs.modules.Module.open", "pyobs.modules.timeout", "numpy.linspace", "numpy.isnan", "pyobs.modules.Module.__init__", "pyobs.events.FocusFoundEvent" ]
[((484, 511), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (501, 511), False, 'import logging\n'), ((2078, 2090), 'pyobs.modules.timeout', 'timeout', (['(600)'], {}), '(600)\n', (2085, 2090), False, 'from pyobs.modules import timeout, Module\n'), ((7549, 7560), 'pyobs.modules.timeout', ...
import matplotlib.pylab as plt import numpy as np def plotFlow(env,policy,x2d): flow = [] for s in range(env.nx): env.reset(s) x = x2d(s) a = policy(s) snext,r = env.step(a) xnext = x2d(snext) flow.append( [x,xnext-x] ) flow=np.array( [ np.concatenate(a) for...
[ "matplotlib.pylab.quiver", "numpy.concatenate" ]
[((342, 400), 'matplotlib.pylab.quiver', 'plt.quiver', (['flow[:, 0]', 'flow[:, 1]', 'flow[:, 2]', 'flow[:, 3]'], {}), '(flow[:, 0], flow[:, 1], flow[:, 2], flow[:, 3])\n', (352, 400), True, 'import matplotlib.pylab as plt\n'), ((299, 316), 'numpy.concatenate', 'np.concatenate', (['a'], {}), '(a)\n', (313, 316), True, ...
import pytest from metagraph.tests.util import default_plugin_resolver from . import RoundTripper from metagraph.plugins.python.types import PythonNodeSetType from metagraph.plugins.numpy.types import NumpyNodeSet, NumpyNodeMap import numpy as np def test_nodeset_roundtrip(default_plugin_resolver): rt = RoundTrip...
[ "numpy.array" ]
[((514, 535), 'numpy.array', 'np.array', (['[0, 10, 20]'], {}), '([0, 10, 20])\n', (522, 535), True, 'import numpy as np\n'), ((593, 612), 'numpy.array', 'np.array', (['[0, 1, 2]'], {}), '([0, 1, 2])\n', (601, 612), True, 'import numpy as np\n'), ((807, 826), 'numpy.array', 'np.array', (['[9, 5, 1]'], {}), '([9, 5, 1])...
""" Definition of direct collocation problem. Authors: <NAME>, <NAME> Date: 05/01/2021 """ # third party imports try: import ipyopt _ipyopt_imported = True except: _ipyopt_imported = False import matplotlib.pyplot as plt import numpy as np from scipy.optimize import minimize, NonlinearConstraint from scipy.inte...
[ "sympy.Symbol", "numpy.ones", "sympy.core.function.BadArgumentsError", "scipy.optimize.minimize", "scipy.integrate.solve_ivp", "sympy.Matrix", "scipy.optimize.NonlinearConstraint", "numpy.sum", "numpy.linspace", "numpy.zeros", "numpy.array", "ipyopt.Problem", "matplotlib.pyplot.subplots", ...
[((1312, 1323), 'sympy.Symbol', 'Symbol', (['"""h"""'], {}), "('h')\n", (1318, 1323), False, 'from sympy import Matrix, Symbol, lambdify\n'), ((1973, 1991), 'sympy.Matrix', 'Matrix', (['state_vars'], {}), '(state_vars)\n', (1979, 1991), False, 'from sympy import Matrix, Symbol, lambdify\n'), ((1998, 2018), 'sympy.Matri...
from bluesky.plan_patterns import spiral_square_pattern import time as ttime import numpy as np import bluesky.plans as bp from bluesky.plans import rel_spiral_square from ophyd.sim import NullStatus # def sample_spiral_scan(): # detectors = [apb_ave] # # return general_spiral_scan(detectors, giantxy.x, giant...
[ "numpy.abs", "time.ctime", "bluesky.plans.rel_spiral_square", "numpy.log", "ophyd.sim.NullStatus", "bluesky.plans.rel_grid_scan", "numpy.sum", "matplotlib.pyplot.figure", "time.time" ]
[((1561, 1710), 'bluesky.plans.rel_spiral_square', 'rel_spiral_square', (['detectors_list', 'motor1', 'motor2', 'motor1_range', 'motor2_range', 'motor1_nsteps', 'motor2_nsteps'], {'md': "{'plan_name': 'spiral scan'}"}), "(detectors_list, motor1, motor2, motor1_range,\n motor2_range, motor1_nsteps, motor2_nsteps, md=...
import cv2 import time import os import matplotlib.pyplot as plt import torch from torch import nn import torchvision.models as models import torchvision.transforms as transforms import numpy as np savepath='./color_heatmap' if not os.path.exists(savepath): os.mkdir(savepath) def draw_features(width, height, x, ...
[ "numpy.argsort", "matplotlib.pyplot.imshow", "os.path.exists", "numpy.max", "matplotlib.pyplot.close", "numpy.linspace", "os.mkdir", "numpy.min", "matplotlib.pyplot.axis", "torchvision.transforms.ToTensor", "torchvision.models.resnet101", "cv2.cvtColor", "torchvision.transforms.Normalize", ...
[((3632, 3657), 'cv2.imread', 'cv2.imread', (['"""example.jpg"""'], {}), "('example.jpg')\n", (3642, 3657), False, 'import cv2\n'), ((3664, 3691), 'cv2.resize', 'cv2.resize', (['img', '(224, 224)'], {}), '(img, (224, 224))\n', (3674, 3691), False, 'import cv2\n'), ((3698, 3734), 'cv2.cvtColor', 'cv2.cvtColor', (['img',...
import random import torch import time import os import numpy as np from torch.utils.data import Dataset from functools import partial from .utils import dataset_to_dataloader, max_io_workers from pytorch_transformers.tokenization_bert import BertTokenizer # the following will be shared on other datasets too if not, ...
[ "pytorch_transformers.tokenization_bert.BertTokenizer.from_pretrained", "os.path.isfile", "torch.tensor", "numpy.zeros", "numpy.sum", "functools.partial", "numpy.concatenate", "numpy.load", "torch.zeros", "numpy.random.shuffle" ]
[((9564, 9658), 'functools.partial', 'partial', (['mean_rgb_unit_norm_transform'], {'mean_rgb': 'mean_rgb', 'unit_norm': 'args.unit_sphere_norm'}), '(mean_rgb_unit_norm_transform, mean_rgb=mean_rgb, unit_norm=args.\n unit_sphere_norm)\n', (9571, 9658), False, 'from functools import partial\n'), ((1616, 1666), 'pytor...
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: parser_funs Description : Author : <NAME> date: ------------------------------------------------- Change Activity: 2019/7/28: ------------------------------------------------- """ import ...
[ "numpy.where", "numpy.sum", "numpy.zeros", "numpy.argmax" ]
[((520, 556), 'numpy.where', 'np.where', (['(semhead_probs >= 0.5)', '(1)', '(0)'], {}), '(semhead_probs >= 0.5, 1, 0)\n', (528, 556), True, 'import numpy as np\n'), ((584, 629), 'numpy.zeros', 'np.zeros', (['semhead_preds.shape'], {'dtype': 'np.int32'}), '(semhead_preds.shape, dtype=np.int32)\n', (592, 629), True, 'im...
import functools import json import re from collections import Counter import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd import seaborn as sns from statics import STRUCTURE_TYPES sns.set_style("whitegrid") plt.rcParams["figure.figsize"] = (18, 12) plt.rcParams["font.size"] ...
[ "networkx.layout.fruchterman_reingold_layout", "pandas.read_csv", "matplotlib.pyplot.ylabel", "networkx.traversal.bfs_tree", "seaborn.set_style", "networkx.draw_networkx_labels", "matplotlib.pyplot.xlabel", "networkx.MultiGraph", "matplotlib.pyplot.close", "numpy.random.seed", "networkx.dfs_post...
[((225, 251), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (238, 251), True, 'import seaborn as sns\n'), ((325, 345), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (339, 345), True, 'import numpy as np\n'), ((3269, 3356), 'pandas.DataFrame', 'pd.DataFrame', ...
# # Copyright (c) 2018-2019 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 la...
[ "tensorflow_serving.apis.predict_pb2.PredictResponse", "tensorflow.python.framework.dtypes.as_dtype", "numpy.asarray", "tensorflow.python.framework.tensor_shape.as_shape", "ie_serving.logger.get_logger", "tensorflow.contrib.util.make_ndarray", "ie_serving.server.constants.INVALID_BATCHSIZE.format" ]
[((1302, 1322), 'ie_serving.logger.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (1312, 1322), False, 'from ie_serving.logger import get_logger\n'), ((4355, 4384), 'tensorflow_serving.apis.predict_pb2.PredictResponse', 'predict_pb2.PredictResponse', ([], {}), '()\n', (4382, 4384), False, 'from tensorfl...
import numpy as np import matplotlib.pyplot as plt # plt.style.use('ggplot') ''' Shot Accuracy Plot ticks = [5,6,7,8,9,10,11,12,13,14,15]#[1,2,3,4,5] data_lists = [ [92.35,92.52,93.2,93.71,93.85,94.15,94.22,94.37,94.68,94.73,94.82], [89.15,89.74,90.41,90.88,91.31,91.47,91.84,92.03,92.2,92.3,92.48], [86.13...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.xticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.show" ]
[((1704, 1727), 'numpy.arange', 'np.arange', (['(50)', '(1050)', '(50)'], {}), '(50, 1050, 50)\n', (1713, 1727), True, 'import numpy as np\n'), ((2020, 2057), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'fig_size', 'dpi': 'dpi'}), '(figsize=fig_size, dpi=dpi)\n', (2030, 2057), True, 'import matplotlib.py...
import argparse import os import random from PIL import Image import cv2 import gym import numpy as np def save_as_image(observation, save_dir, img_name, prefix="img_"): # donwnscaling the image im_array = cv2.resize(observation, IMAGE_SIZE) im = Image...
[ "os.path.exists", "PIL.Image.fromarray", "random.choice", "numpy.mean", "argparse.ArgumentParser", "os.makedirs", "os.path.join", "cv2.resize", "gym.make" ]
[((270, 305), 'cv2.resize', 'cv2.resize', (['observation', 'IMAGE_SIZE'], {}), '(observation, IMAGE_SIZE)\n', (280, 305), False, 'import cv2\n'), ((315, 347), 'PIL.Image.fromarray', 'Image.fromarray', (['im_array', '"""RGB"""'], {}), "(im_array, 'RGB')\n", (330, 347), False, 'from PIL import Image\n'), ((487, 512), 'ar...
import numpy as np def hermitegaussian(coeffs,x,sigma): xhat = (x/sigma) herms = np.polynomial.hermite.Hermite(coeffs) return herms(xhat) * np.exp(-xhat**2) def continuous_convolve(kernels,obj): out = np.empty(obj.shape) for i in range(kernels.shape[0]): out[jj] = np.dot(obj[max(0,jj-cente...
[ "numpy.exp", "numpy.sum", "numpy.polynomial.hermite.Hermite", "numpy.empty" ]
[((90, 127), 'numpy.polynomial.hermite.Hermite', 'np.polynomial.hermite.Hermite', (['coeffs'], {}), '(coeffs)\n', (119, 127), True, 'import numpy as np\n'), ((219, 238), 'numpy.empty', 'np.empty', (['obj.shape'], {}), '(obj.shape)\n', (227, 238), True, 'import numpy as np\n'), ((878, 898), 'numpy.empty', 'np.empty', ([...
import warnings from collections import OrderedDict from pathlib import Path import numpy as np import pandas as pd import torch from tqdm import tqdm import librosa import model_utils import utils def long_clip_to_images(y, sample_rate, composer): len_y = len(y) start = 0 end = sample_rate * 5 imag...
[ "collections.OrderedDict", "model_utils.load_pytorch_model", "utils.noise_reduce", "torch.Tensor", "numpy.asarray", "numpy.argwhere", "torch.cuda.is_available", "numpy.concatenate", "pandas.DataFrame", "torch.no_grad", "warnings.filterwarnings", "librosa.load" ]
[((3641, 3674), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (3664, 3674), False, 'import warnings\n'), ((3740, 3753), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3751, 3753), False, 'from collections import OrderedDict\n'), ((5386, 5434), 'pandas.DataFr...
#!/usr/bin/env python # # # Train TuneNet on position-position bouncing ball data, which is very similar to the dataset of Ajay et al 2018. import matplotlib.pyplot as plt import numpy as np import torch import torch.utils import torch.utils import torch.utils.data import torch.utils.data from tune.utils import get_...
[ "numpy.mean", "torch.abs", "tune.utils.get_torch_device", "tune.utils.create_tensorboard_writer", "torch.nn.MSELoss", "numpy.zeros", "torch.tensor", "torch.zeros", "matplotlib.pyplot.pause", "torch.no_grad", "matplotlib.pyplot.subplots" ]
[((370, 388), 'tune.utils.get_torch_device', 'get_torch_device', ([], {}), '()\n', (386, 388), False, 'from tune.utils import get_torch_device, create_tensorboard_writer\n'), ((398, 425), 'tune.utils.create_tensorboard_writer', 'create_tensorboard_writer', ([], {}), '()\n', (423, 425), False, 'from tune.utils import ge...
#!/usr/bin/python3 ''' Abstract: This is a program to show the data with different true and prediction Usage: plot_sed.py [main_name] [true label] [pred label] Example: plot_sed.py MaxLoss15 1 2 Editor: Jacob975 ################################## # Python3 # # This code is mad...
[ "load_lib.confusion_matrix", "load_lib.load_cls_true", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.where", "numpy.argmax", "collections.Counter", "numpy.array", "numpy.append", "load_lib.load_cls_pred", "load_lib.load_arrangement", "time.time", "glob.glob" ]
[((1239, 1250), 'time.time', 'time.time', ([], {}), '()\n', (1248, 1250), False, 'import time\n'), ((1455, 1467), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1463, 1467), True, 'import numpy as np\n'), ((1508, 1520), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1516, 1520), True, 'import numpy as np\n'),...
# -*- coding: utf-8 -*- """ ========== """ # import standard libraries import os # import third-party libraries import numpy as np import matplotlib.pyplot as plt from colour import write_image, read_image # import my libraries import test_pattern_generator2 as tpg import transfer_functions as tf import plot_utili...
[ "matplotlib.pyplot.savefig", "numpy.ones", "colour.write_image", "test_pattern_generator2.shaper_func_log2_to_linear", "colour.read_image", "matplotlib.pyplot.legend", "transfer_functions.eotf_to_luminance", "matplotlib.pyplot.close", "plot_utility.log_scale_settings", "numpy.linspace", "os.path...
[((661, 685), 'numpy.ones', 'np.ones', (['(1080, 1920, 3)'], {}), '((1080, 1920, 3))\n', (668, 685), True, 'import numpy as np\n'), ((708, 760), 'colour.write_image', 'write_image', (['img', '"""test_src.tif"""'], {'bit_depth': '"""uint16"""'}), "(img, 'test_src.tif', bit_depth='uint16')\n", (719, 760), False, 'from co...
import math import numpy as np import matplotlib.pyplot as plt import csv import os logPath = './online/log/9x16_test/' nameList = ['Alien', 'Conan1', 'Conan2', 'Cooking', 'Rhinos', 'Skiing', 'Surfing', 'War'] num = 48 batch_size = 4 tileList = [] tileListList = [[] for j in range(len(nameList))] for idx, f in enu...
[ "numpy.mean", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xticks", "csv.writer", "matplotlib.pyplot.bar", "matplotlib.pyplot.tight_layout", "csv.reader", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((883, 912), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(20, 8)'}), '(figsize=(20, 8))\n', (895, 912), True, 'import matplotlib.pyplot as plt\n'), ((913, 946), 'matplotlib.pyplot.bar', 'plt.bar', (['x', 'tileList'], {'width': 'width'}), '(x, tileList, width=width)\n', (920, 946), True, 'import mat...
# -*- coding: utf-8 -*- import numpy as np import scipy.io as sio import glob import os import torch import torch.utils.data import torchvision.transforms.functional import cv2 def read_dataset(path): """ Read training dataset or validation dataset. :param path: The path of dataset. :return: The list of filenames...
[ "numpy.logical_not", "os.path.join", "numpy.max", "numpy.exp", "numpy.zeros", "numpy.transpose", "cv2.imread" ]
[((2187, 2220), 'numpy.exp', 'np.exp', (['(-D2 / 2.0 / sigma / sigma)'], {}), '(-D2 / 2.0 / sigma / sigma)\n', (2193, 2220), True, 'import numpy as np\n'), ((351, 385), 'os.path.join', 'os.path.join', (['path', '"""images/*.jpg"""'], {}), "(path, 'images/*.jpg')\n", (363, 385), False, 'import os\n'), ((1042, 1074), 'nu...
import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf import numpy as np from tensorflow import keras from pandas.plotting import autocorrelation_plot from keras import Sequential from tensorflow.python.keras.layers.recurrent import LSTM from sklearn.preprocessing import MinMaxScaler from...
[ "keras.Sequential", "pandas.read_csv", "sklearn.preprocessing.OneHotEncoder", "numpy.asarray", "tensorflow.python.keras.layers.recurrent.LSTM", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Dense" ]
[((412, 489), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\Users\\\\Michael\\\\Desktop\\\\pwrball_rand\\\\pwr_ball - Copy.csv"""'], {}), "('C:\\\\Users\\\\Michael\\\\Desktop\\\\pwrball_rand\\\\pwr_ball - Copy.csv')\n", (423, 489), True, 'import pandas as pd\n'), ((1243, 1255), 'keras.Sequential', 'Sequential', ([], {}...
import torch import torch.utils.data as data from glob import glob from os.path import join, basename, exists import numpy as np import pickle as pkl from random import random class KETTS76(data.Dataset): def __init__(self, which_set='train', datapath='/home/thkim/data/KETTS76/bin_22050'): # Load vocabular...
[ "os.path.exists", "ipdb.set_trace", "numpy.random.choice", "os.path.join", "numpy.asarray", "numpy.random.randint", "os.path.basename", "glob.glob" ]
[((4439, 4455), 'ipdb.set_trace', 'ipdb.set_trace', ([], {}), '()\n', (4453, 4455), False, 'import ipdb\n'), ((2296, 2323), 'os.path.basename', 'basename', (['self.mellist[idx]'], {}), '(self.mellist[idx])\n', (2304, 2323), False, 'from os.path import join, basename, exists\n'), ((3660, 3678), 'os.path.basename', 'base...
"""Flexible code for histogramming per-snp and per-replica statistics for selected SNPs in selected replicas in selected scenarios and/or demographies.""" from Operations.Shari_Operations.localize.Scenario import GetScenarios, GetSelectionScenarios from Operations.MiscUtil import Dict, compile_expr, dbg, Histogrammer...
[ "Operations.Shari_Operations.localize.Scenario.GetScenarios", "Operations.MiscUtil.dbg", "matplotlib.pyplot.ylabel", "Operations.MiscUtil.compile_expr", "Operations.MiscUtil.ReplaceFileExt", "itertools.izip", "Operations.MiscUtil.Dict", "operator.itemgetter", "logging.info", "Operations.Shari_Oper...
[((871, 892), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (885, 892), False, 'import matplotlib\n'), ((4643, 4683), 'Operations.Shari_Operations.localize.Scenario.GetScenarios', 'GetScenarios', (['mutAges', 'mutPops', 'mutFreqs'], {}), '(mutAges, mutPops, mutFreqs)\n', (4655, 4683), False, 'fr...
import logging import os import random import time import warnings from collections import OrderedDict from contextlib import contextmanager from pathlib import Path from typing import List, Optional import cv2 import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F im...
[ "torch.nn.BatchNorm1d", "librosa.util.pad_center", "torch.nn.functional.avg_pool1d", "torch.sum", "torch.nn.functional.pad", "torch.isinf", "numpy.imag", "numpy.arange", "torch.nn.BatchNorm2d", "torch.nn.init.xavier_uniform_", "torch.mean", "torch.nn.functional.avg_pool2d", "numpy.exp", "t...
[((9567, 9604), 'torch.nn.init.xavier_uniform_', 'nn.init.xavier_uniform_', (['layer.weight'], {}), '(layer.weight)\n', (9590, 9604), True, 'import torch.nn as nn\n'), ((11300, 11341), 'torch.cat', 'torch.cat', (['(framewise_output, pad)'], {'dim': '(1)'}), '((framewise_output, pad), dim=1)\n', (11309, 11341), False, '...
# -*- coding: utf-8 -*- # pylint: disable=invalid-name, too-many-arguments, bad-whitespace # pylint: disable=too-many-lines, too-many-locals, len-as-condition # pylint: disable=import-outside-toplevel """Copyright 2015 <NAME>. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.rea...
[ "numpy.sqrt", "math.sqrt", "math.log", "numpy.array", "math.exp", "scipy.stats.norm.cdf", "numpy.atleast_2d", "numpy.isscalar", "random.gammavariate", "numpy.asarray", "scipy.stats.norm.interval", "numpy.dot", "numpy.linalg.eigh", "warnings.warn", "scipy.sparse.linalg.spsolve", "numpy....
[((1014, 1070), 'scipy.stats.multivariate_normal.logpdf', 'multivariate_normal.logpdf', (['(1)', '(1)', '(1)'], {'allow_singular': '(True)'}), '(1, 1, 1, allow_singular=True)\n', (1040, 1070), False, 'from scipy.stats import norm, multivariate_normal\n'), ((1685, 1701), 'numpy.atleast_1d', 'np.atleast_1d', (['u'], {}),...
import tensorflow as tf from dltk.core.activations import leaky_relu import numpy as np def test_leaky_relu(): test_alpha = tf.constant(0.1) test_inp_1 = tf.constant(1.) test_inp_2 = tf.constant(-1.) test_relu_1 = leaky_relu(test_inp_1, test_alpha) test_relu_2 = leaky_relu(test_inp_2, test_alpha)...
[ "tensorflow.Session", "tensorflow.constant", "numpy.isclose", "dltk.core.activations.leaky_relu" ]
[((130, 146), 'tensorflow.constant', 'tf.constant', (['(0.1)'], {}), '(0.1)\n', (141, 146), True, 'import tensorflow as tf\n'), ((164, 180), 'tensorflow.constant', 'tf.constant', (['(1.0)'], {}), '(1.0)\n', (175, 180), True, 'import tensorflow as tf\n'), ((197, 214), 'tensorflow.constant', 'tf.constant', (['(-1.0)'], {...
# # Copyright (c) 2021 IBM Corp. # 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 writi...
[ "numpy.array", "numpy.empty_like" ]
[((5071, 5104), 'numpy.empty_like', 'np.empty_like', (['old_ids'], {'dtype': 'int'}), '(old_ids, dtype=int)\n', (5084, 5104), True, 'import numpy as np\n'), ((9024, 9052), 'numpy.array', 'np.array', (['int_ids'], {'dtype': 'int'}), '(int_ids, dtype=int)\n', (9032, 9052), True, 'import numpy as np\n')]
""" Semantic operations. outliers create_or_update_out_of_the_bbox, create_or_update_gps_deactivated_signal, create_or_update_gps_jump, create_or_update_short_trajectory, create_or_update_gps_block_signal, filter_block_signal_by_repeated_amount_of_points, filter_block_signal_by_time, filter_longer_time_to_stop_segment...
[ "pymove.preprocessing.filters.by_bbox", "pymove.preprocessing.stay_point_detection.create_or_update_move_stop_by_dist_time", "pymove.utils.log.logger.debug", "pymove.utils.log.logger.warning", "pymove.preprocessing.segmentation.by_max_dist", "numpy.concatenate", "pymove.preprocessing.segmentation.by_dis...
[((2615, 2659), 'numpy.concatenate', 'np.concatenate', (['[idx_start, idx_end]'], {'axis': '(0)'}), '([idx_start, idx_end], axis=0)\n', (2629, 2659), True, 'import numpy as np\n'), ((5895, 5986), 'pymove.utils.log.logger.debug', 'logger.debug', (['"""\nCreate or update boolean feature to detect points out of the bbox""...
# -*- coding: utf-8 -*- # Copyright 2018, IBM. # # 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 qiskit import * import numpy as np import time import itertools import math from random import * def inner_pr...
[ "numpy.eye", "numpy.concatenate" ]
[((2266, 2294), 'numpy.eye', 'np.eye', (['dimension', 'dimension'], {}), '(dimension, dimension)\n', (2272, 2294), True, 'import numpy as np\n'), ((3185, 3228), 'numpy.concatenate', 'np.concatenate', (['[first_array, second_array]'], {}), '([first_array, second_array])\n', (3199, 3228), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- """Copyright 2015 <NAME>. Code supporting the book Kalman and Bayesian Filters in Python https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the LICENSE.txt file for more information. """ from __future__ import (absolut...
[ "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "numpy.array", "matplotlib.pyplot.scatter", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ion", "matplotlib.pyplot.pause", "numpy.random.randn" ]
[((747, 765), 'numpy.array', 'np.array', (['[20, 20]'], {}), '([20, 20])\n', (755, 765), True, 'import numpy as np\n'), ((826, 846), 'numpy.array', 'np.array', (['[0.0, 0.0]'], {}), '([0.0, 0.0])\n', (834, 846), True, 'import numpy as np\n'), ((850, 877), 'matplotlib.pyplot.plot', 'plt.plot', (['pf'], {'weights': '(Fal...
import os import cv2 import numpy as np import torch import pickle import argparse from configs import paths from utils.cam_utils import perspective_project_torch from models.smpl_official import SMPL def rotate_2d(pt_2d, rot_rad): x = pt_2d[0] y = pt_2d[1] sn, cs = np.sin(rot_rad), np.cos(rot_rad) ...
[ "torch.from_numpy", "numpy.array", "torch.cuda.is_available", "numpy.sin", "numpy.savez", "argparse.ArgumentParser", "os.path.isdir", "pickle.load", "os.path.isfile", "numpy.cos", "cv2.imread", "cv2.imwrite", "utils.cam_utils.perspective_project_torch", "os.path.join", "numpy.sum", "nu...
[((377, 413), 'numpy.array', 'np.array', (['[xx, yy]'], {'dtype': 'np.float32'}), '([xx, yy], dtype=np.float32)\n', (385, 413), True, 'import numpy as np\n'), ((632, 643), 'numpy.zeros', 'np.zeros', (['(2)'], {}), '(2)\n', (640, 643), True, 'import numpy as np\n'), ((1018, 1072), 'numpy.array', 'np.array', (['[dst_w * ...
import numpy as np import torch import torch.nn.functional as F import skimage.measure as sk import time import pyrender import pymesh import trimesh from pyemd import emd_samples import chamfer_python import binvox_rw from glob import glob D2R = np.pi/180.0 voxsize = 32 sample_size = 2048 def RotatePhi(phi): ...
[ "numpy.clip", "numpy.sqrt", "pyemd.emd_samples", "trimesh.sample.sample_surface", "skimage.measure.marching_cubes_lewiner", "numpy.array", "numpy.sin", "numpy.arange", "numpy.where", "torch.mean", "numpy.linspace", "pymesh.form_mesh", "numpy.vstack", "numpy.concatenate", "pyrender.Mesh.f...
[((2036, 2067), 'numpy.expand_dims', 'np.expand_dims', (['x_mesh'], {'axis': '(-1)'}), '(x_mesh, axis=-1)\n', (2050, 2067), True, 'import numpy as np\n'), ((2085, 2116), 'numpy.expand_dims', 'np.expand_dims', (['y_mesh'], {'axis': '(-1)'}), '(y_mesh, axis=-1)\n', (2099, 2116), True, 'import numpy as np\n'), ((2134, 216...
import os import math import gzip import csv import time import torch import torch.optim as optim import torch.utils.data as data_utils from sklearn.model_selection import train_test_split from tqdm import tqdm # import matplotlib.pyplot as plt import numpy as np from crf import CRF # import Data Loa...
[ "os.listdir", "numpy.random.choice", "os.path.join", "torch.from_numpy", "torch.eq", "torch.tensor", "torch.cuda.is_available", "data_loader.get_dataset", "torch.sum", "torch.utils.data.DataLoader", "torch.no_grad", "crf.CRF", "time.time" ]
[((841, 854), 'data_loader.get_dataset', 'get_dataset', ([], {}), '()\n', (852, 854), False, 'from data_loader import get_dataset\n'), ((1818, 1838), 'os.listdir', 'os.listdir', (['dir_name'], {}), '(dir_name)\n', (1828, 1838), False, 'import os\n'), ((2138, 2149), 'time.time', 'time.time', ([], {}), '()\n', (2147, 214...
import torch import numpy as np import argparse import os from utils import Logger, LogFiles, ValidationAccuracies, cross_entropy_loss, compute_accuracy, MetaLearningState,\ shuffle from model import FewShotClassifier from dataset import get_dataset_reader from tf_dataset_reader import TfDatasetReader from image_fo...
[ "torch.from_numpy", "numpy.array", "torch.cuda.is_available", "utils.ValidationAccuracies", "torch.set_grad_enabled", "argparse.ArgumentParser", "utils.LogFiles", "dataset.get_dataset_reader", "tf_dataset_reader.TfDatasetReader", "utils.shuffle", "numpy.random.permutation", "torch.Tensor", "...
[((597, 729), 'utils.LogFiles', 'LogFiles', (['self.args.checkpoint_dir', 'self.args.resume_from_checkpoint', "(self.args.mode == 'test' or self.args.mode == 'test_vtab')"], {}), "(self.args.checkpoint_dir, self.args.resume_from_checkpoint, self.\n args.mode == 'test' or self.args.mode == 'test_vtab')\n", (605, 729)...
#!/usr/bin/env python3 import os import numpy as np import sys try: import torch except ImportError: pass from easypbr import * from dataloaders import * config_file="lnn_check_lattice_size.cfg" config_path=os.path.join( os.path.dirname( os.path.realpath(__file__) ) , '../../config', config_file) view=Viewer...
[ "os.path.realpath", "numpy.mean" ]
[((249, 275), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (265, 275), False, 'import os\n'), ((792, 820), 'numpy.mean', 'np.mean', (['nr_points_in_radius'], {}), '(nr_points_in_radius)\n', (799, 820), True, 'import numpy as np\n')]
import arff import argparse import json import logging import numpy as np import openmlcontrib import openmldefaults import os import pandas as pd # SSHFS NEMO FREIBURG: # sshfs <EMAIL>:/rigel/home/jv2657/experiments ~/habanero_experiments # # SSHFS GRACE LEIDEN: # ssh -f -N -L 1233:grace.liacs.nl:22 <EMAIL> # sshfs ...
[ "logging.getLogger", "json.loads", "numpy.unique", "argparse.ArgumentParser", "openmldefaults.models.AverageRankDefaults", "arff.load", "numpy.append", "logging.info", "os.path.expanduser", "openmldefaults.models.ActiveTestingDefaults" ]
[((450, 507), 'os.path.expanduser', 'os.path.expanduser', (['"""../../data/text_classification.arff"""'], {}), "('../../data/text_classification.arff')\n", (468, 507), False, 'import os\n'), ((521, 580), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Creates an ARFF file"""'}), "(descrip...
# -*- coding: utf-8 -*- """ This module contains a method for determining the highest concentration recorded by passed dataframes within the testing period (including sensor and/or reference data). ================================================================================ @Author: | <NAME>, NSSC Contractor (O...
[ "numpy.isnan" ]
[((2235, 2246), 'numpy.isnan', 'np.isnan', (['i'], {}), '(i)\n', (2243, 2246), True, 'import numpy as np\n')]
# This script takes as an argument the path to the folder which # contains folders of images. # It is assumed that name of each folder with images is # the label for the images, that is all the images in each folder belong # to the the same class, and the name of that class is the name of the folder. # Images are assum...
[ "os.listdir", "os.path.join", "numpy.array", "scipy.misc.imread", "scipy.misc.imresize", "numpy.save" ]
[((2311, 2333), 'numpy.array', 'np.array', (['folder_names'], {}), '(folder_names)\n', (2319, 2333), True, 'import numpy as np\n'), ((3448, 3467), 'numpy.save', 'np.save', (['f', 'X_train'], {}), '(f, X_train)\n', (3455, 3467), True, 'import numpy as np\n'), ((3468, 3487), 'numpy.save', 'np.save', (['f', 'y_train'], {}...
''' Helper class and functions for loading SUN RGB-D objects Author: <NAME> Date: October 2017 Modified by <NAME> ''' import os import sys import numpy as np import pickle import argparse from PIL import Image BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) import sunrgbd_utils as u...
[ "numpy.array", "numpy.arctan2", "sys.path.append", "sunrgbd_utils.random_shift_box2d", "os.path.exists", "argparse.ArgumentParser", "sunrgbd_utils.compute_box_3d", "sunrgbd_object.sunrgbd_object", "numpy.random.choice", "pickle.load", "numpy.floor", "numpy.median", "pickle.dump", "numpy.un...
[((268, 293), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (283, 293), False, 'import sys\n'), ((241, 266), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (256, 266), False, 'import os\n'), ((557, 597), 'numpy.zeros', 'np.zeros', (['coord.shape[0]'], {'dtype': 'np...
import copy import numpy as np import pandas as pd from sklearn.model_selection import train_test_split class DataFrame(object): """Minimal pd.DataFrame analog for handling n-dimensional numpy matrices with additional support for shuffling, batching, and train/test splitting. Args: columns: Lis...
[ "sklearn.model_selection.train_test_split", "numpy.random.randint", "numpy.concatenate", "copy.copy", "numpy.arange", "numpy.random.shuffle" ]
[((1114, 1136), 'numpy.arange', 'np.arange', (['self.length'], {}), '(self.length)\n', (1123, 1136), True, 'import numpy as np\n'), ((1383, 1410), 'numpy.random.shuffle', 'np.random.shuffle', (['self.idx'], {}), '(self.idx)\n', (1400, 1410), True, 'import numpy as np\n'), ((1468, 1491), 'numpy.random.randint', 'np.rand...
#! /usr/bin/env python3 # coding=utf-8 ''' Loads a saved pytorch model checkpoint and an image and prints the most likely image class and it's associated probability. If provided, uses a category to name json file to map categories to names and print the names as well. SPECS: - Allows users to print out the top K cla...
[ "PIL.Image.open", "argparse.ArgumentParser", "torch.load", "torch.exp", "numpy.array", "json.load", "torch.autograd.Variable", "torch.FloatTensor", "os.path.relpath" ]
[((1022, 1061), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (1045, 1061), False, 'import argparse\n'), ((2041, 2078), 'os.path.relpath', 'os.path.relpath', (['args.checkpoint_path'], {}), '(args.checkpoint_path)\n', (2056, 2078), False, 'import os\n'), ((...
import os import torch import numpy as np class IoUAverager: def __init__(self, nCls, eps=1e-5): self.nCls = nCls self.eps = eps self.shape_ious = [[] for _ in range(self.nCls)] def clear(self): self.shape_ious = [[] for _ in range(self.nCls)] def update(self, outputs, tru...
[ "numpy.mean", "numpy.prod", "numpy.logical_and", "os.path.join", "numpy.logical_or", "numpy.bitwise_and", "numpy.sum", "numpy.zeros", "torch.argmax" ]
[((1053, 1065), 'numpy.mean', 'np.mean', (['res'], {}), '(res)\n', (1060, 1065), True, 'import numpy as np\n'), ((1821, 1861), 'numpy.zeros', 'np.zeros', (['(self.nCls, 4)'], {'dtype': 'np.int32'}), '((self.nCls, 4), dtype=np.int32)\n', (1829, 1861), True, 'import numpy as np\n'), ((1983, 2023), 'numpy.zeros', 'np.zero...
# Author: <NAME> import numpy as np import pickle class evolutionary_strategies_model(object): def __init__( self, n_population, n_params, n_survival, n_crossover = 2, sigma_init = 1, mu_init = 0, tau = None): """ Evolutionary strategies model loosely based on Beyer and Sch...
[ "numpy.random.normal", "numpy.tile", "numpy.eye", "pickle.dump", "numpy.argsort", "numpy.zeros", "numpy.full", "numpy.random.shuffle" ]
[((1928, 1991), 'numpy.random.normal', 'np.random.normal', (['mu_init', 'sigma_init', '(n_population, n_params)'], {}), '(mu_init, sigma_init, (n_population, n_params))\n', (1944, 1991), True, 'import numpy as np\n'), ((2014, 2076), 'numpy.full', 'np.full', (['(n_population, n_params)', 'sigma_init'], {'dtype': '"""flo...
################################################################################ ## Imports and configurations import sys import os PROJ_PATH = '.' #PROJ_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '../../')) #sys.path.append(PROJ_PATH) import pandas as pd import numpy as np from sklearn.preproc...
[ "pandas.Series", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.ensemble.RandomForestClassifier", "sklearn.preprocessing.StandardScaler", "numpy.array", "src.reporting.reports.reports", "pandas.DataFrame", "pandas.concat", "sklearn.feature_selection.SelectFromModel" ]
[((1358, 1374), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (1372, 1374), False, 'from sklearn.preprocessing import StandardScaler\n'), ((1589, 1653), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.4)', 'random_state': 'random_state'}), '(X...
# Test methods with long descriptive names can omit docstrings # pylint: disable=missing-docstring import warnings from time import time from numbers import Real from itertools import starmap, chain import unittest import pickle import numpy as np from numpy.testing import assert_array_equal from Orange.data import (...
[ "itertools.chain", "pickle.dumps", "Orange.preprocess.Impute", "Orange.data.DiscreteVariable", "numpy.array", "unittest.main", "numpy.arange", "Orange.data.domain.filter_visible", "Orange.data.DomainConversion", "numpy.testing.assert_almost_equal", "warnings.simplefilter", "Orange.data.Domain"...
[((692, 720), 'Orange.data.Variable._clear_all_caches', 'Variable._clear_all_caches', ([], {}), '()\n', (718, 720), False, 'from Orange.data import ContinuousVariable, DiscreteVariable, StringVariable, TimeVariable, Variable, Domain, Table, DomainConversion\n'), ((23186, 23201), 'unittest.main', 'unittest.main', ([], {...
""" .. module:: mixtures :platform: Unix, Windows :synopsis: a module for defining the class :class:`Mixture`. .. moduleauthor:: <NAME> <<EMAIL>> """ import numpy as np import pandas as pd import mics from mics.funcs import deltaMethod from mics.funcs import diff from mics.funcs import func from mics.utils im...
[ "mics.utils.InputError", "numpy.log", "numpy.equal", "mics.utils.stdError", "numpy.array", "mics.utils.multimap", "numpy.arange", "numpy.histogram", "mics.utils.cases", "mics.funcs.diff", "pandas.concat", "pandas.DataFrame", "mics.utils.info", "mics.funcs.deltaMethod", "numpy.amin", "n...
[((1484, 1529), 'numpy.array', 'np.array', (['[sample.neff for sample in samples]'], {}), '([sample.neff for sample in samples])\n', (1492, 1529), True, 'import numpy as np\n'), ((1933, 1948), 'mics.utils.bennett', 'bennett', (['self.u'], {}), '(self.u)\n', (1940, 1948), False, 'from mics.utils import bennett\n'), ((12...
import math import os import time import numpy as np import pybullet as p import pybullet_utils.bullet_client as bc from gripper_module import load_gripper from misc.urdf_editor import UrdfEditor import utils from fusion import TSDFVolume class Gripper(object): """ A moving mount and a gripper. the mou...
[ "numpy.abs", "numpy.tan", "numpy.random.random", "fusion.TSDFVolume", "misc.urdf_editor.UrdfEditor", "numpy.array", "numpy.linspace", "numpy.cos", "gripper_module.load_gripper", "numpy.sin", "numpy.all", "numpy.transpose", "time.time", "os.remove" ]
[((1374, 1386), 'misc.urdf_editor.UrdfEditor', 'UrdfEditor', ([], {}), '()\n', (1384, 1386), False, 'from misc.urdf_editor import UrdfEditor\n'), ((1494, 1506), 'misc.urdf_editor.UrdfEditor', 'UrdfEditor', ([], {}), '()\n', (1504, 1506), False, 'from misc.urdf_editor import UrdfEditor\n'), ((2897, 2916), 'os.remove', '...
""" Scattering GUI """ import sys, os import matplotlib.pyplot as plt # Plotting import numpy as np if sys.version_info[0] < 3: import Tkinter as tk else: import tkinter as tk from .. import functions_general as fg from .. import functions_crystallography as fc from .basic_widgets import StringViewer from .b...
[ "tkinter.IntVar", "tkinter.LabelFrame", "tkinter.Entry", "tkinter.Checkbutton", "tkinter.BooleanVar", "tkinter.Button", "tkinter.StringVar", "tkinter.Tk", "tkinter.Label", "tkinter.DoubleVar", "tkinter.OptionMenu", "numpy.fromstring", "tkinter.Frame", "matplotlib.pyplot.show" ]
[((743, 750), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (748, 750), True, 'import tkinter as tk\n'), ((1146, 1165), 'tkinter.Frame', 'tk.Frame', (['self.root'], {}), '(self.root)\n', (1154, 1165), True, 'import tkinter as tk\n'), ((1260, 1284), 'tkinter.DoubleVar', 'tk.DoubleVar', (['frame', '(8.0)'], {}), '(frame, 8.0)...
from time import clock import sys sys.path.append('../../../') print (sys.path) from tspdb.src.data import generateHarmonics as gH from tspdb.src.data import generateTrend as gT import tspdb.src.data.generateARMA as gA import numpy as np from tspdb.src.hdf_util import write_data import matplotlib.pyplot as pl...
[ "numpy.sqrt", "time.clock", "tspdb.src.data.generateARMA.generate", "tspdb.src.data.generateTrend.generate", "matplotlib.pyplot.plot", "tspdb.src.hdf_util.write_data", "tspdb.src.data.generateHarmonics.generate", "sys.path.append", "matplotlib.pyplot.show" ]
[((36, 64), 'sys.path.append', 'sys.path.append', (['"""../../../"""'], {}), "('../../../')\n", (51, 64), False, 'import sys\n'), ((1375, 1382), 'time.clock', 'clock', ([], {}), '()\n', (1380, 1382), False, 'from time import clock\n'), ((2049, 2082), 'matplotlib.pyplot.plot', 'plt.plot', (['combinedTS'], {'label': '"""...
import os import sys import math import numpy as np import pandas as pd sys.path.append(os.getcwd()) pdata = pd.read_csv(os.getcwd() + '/Bayes/data/train_data.csv', header=None) test_data = pd.read_csv(os.getcwd() + '/Bayes/data/test_data.csv', header=None) npdata = pd.DataFrame(pdata).values final_test = pd.DataFram...
[ "math.sqrt", "os.getcwd", "numpy.array", "numpy.sum", "pandas.DataFrame", "math.exp" ]
[((1836, 1853), 'pandas.DataFrame', 'pd.DataFrame', (['res'], {}), '(res)\n', (1848, 1853), True, 'import pandas as pd\n'), ((88, 99), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (97, 99), False, 'import os\n'), ((269, 288), 'pandas.DataFrame', 'pd.DataFrame', (['pdata'], {}), '(pdata)\n', (281, 288), True, 'import pan...
#!/usr/bin/env python import tensorflow as tf import numpy as np import time # shortcut tfs = tf.sparse logger = tf.compat.v1.logging # eager execution #tf.enable_eager_execution() config = tf.ConfigProto() config.inter_op_parallelism_threads = 4 config.intra_op_parallelism_threads = 4 tf.compat.v1.enable_eager_execu...
[ "numpy.random.normal", "numpy.sqrt", "numpy.reshape", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Flatten", "numpy.random.randint", "tensorflow.keras.layers.Dense", "tensorflow.compat.v1.enable_eager_execution", "time.time", "tensorflow.ConfigProto", "numpy.random.randn" ]
[((192, 208), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (206, 208), True, 'import tensorflow as tf\n'), ((289, 339), 'tensorflow.compat.v1.enable_eager_execution', 'tf.compat.v1.enable_eager_execution', ([], {'config': 'config'}), '(config=config)\n', (324, 339), True, 'import tensorflow as tf\n'), ...
import PIL from skimage.io import imread import numpy as np # https://stackoverflow.com/questions/27026866/convert-an-image-to-2d-array-in-python im = imread("snowboarder.jpg") indices = np.dstack(np.indices(im.shape[:2])) data = np.concatenate((im, indices), axis=-1) new_data = data[:, :, :] print(new_data) # np.sa...
[ "skimage.io.imread", "numpy.indices", "numpy.concatenate" ]
[((153, 178), 'skimage.io.imread', 'imread', (['"""snowboarder.jpg"""'], {}), "('snowboarder.jpg')\n", (159, 178), False, 'from skimage.io import imread\n'), ((232, 270), 'numpy.concatenate', 'np.concatenate', (['(im, indices)'], {'axis': '(-1)'}), '((im, indices), axis=-1)\n', (246, 270), True, 'import numpy as np\n')...
"""Convert a CP trace to NCP or VIP. blaze run convert_traces -- \ --tracefile=german_partial_prior.npz \ --model=german_credit_lognormalcentered \ --vip_json=german_credit_lognormalcentered_data/cVIP_exp_tied.json """ from absl import app from absl import flags import io import json import os import numpy as n...
[ "tensorflow_probability.edward2.tape", "numpy.savez", "tensorflow.io.gfile.GFile", "tensorflow.compat.v1.Session", "io.BytesIO", "absl.app.run", "tensorflow.vectorized_map", "tensorflow.reshape", "json.load", "models.get_model_by_name", "numpy.load", "absl.flags.DEFINE_string", "tensorflow.i...
[((421, 474), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""tracefile"""'], {'default': '""""""', 'help': '""""""'}), "('tracefile', default='', help='')\n", (440, 474), False, 'from absl import flags\n'), ((475, 527), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""vip_json"""'], {'default': '"""""...
import cv2 import numpy as np def ColorAzul(): black_screen = np.zeros([500, 500, 3], dtype=np.uint8) black_screen[:, :, 0] = np.ones([500, 500]) * 255 black_screen[:, :, 1] = np.ones([500, 500]) * 0 black_screen[:, :, 2] = np.ones([500, 500]) * 0 return black_screen def ColorRojo(): black...
[ "numpy.ones", "cv2.createButton", "cv2.imshow", "numpy.zeros", "cv2.destroyAllWindows", "cv2.waitKey", "cv2.namedWindow" ]
[((708, 732), 'cv2.namedWindow', 'cv2.namedWindow', (['"""Frame"""'], {}), "('Frame')\n", (723, 732), False, 'import cv2\n'), ((733, 771), 'cv2.createButton', 'cv2.createButton', (['"""Cahnge Color"""', 'back'], {}), "('Cahnge Color', back)\n", (749, 771), False, 'import cv2\n'), ((937, 951), 'cv2.waitKey', 'cv2.waitKe...
import torch from time import time from IPython import display import numpy as np import matplotlib.pyplot as plt import random import torch.utils.data as Data from torch.nn import init import torch.nn as nn # 3.3.1 生成数据集 # 我们生成与上一节中相同的数据集。其中features是训练数据特征,labels是标签 num_inputs = 2 #x1,x2 有几个x num_examples = 1000 true_...
[ "numpy.random.normal", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.utils.data.TensorDataset", "torch.nn.MSELoss", "torch.nn.Linear", "torch.utils.data.DataLoader", "torch.nn.init.normal_" ]
[((751, 787), 'torch.utils.data.TensorDataset', 'Data.TensorDataset', (['features', 'labels'], {}), '(features, labels)\n', (769, 787), True, 'import torch.utils.data as Data\n'), ((810, 860), 'torch.utils.data.DataLoader', 'Data.DataLoader', (['dataset', 'batch_size'], {'shuffle': '(True)'}), '(dataset, batch_size, sh...
import numpy as np from netCDF4 import Dataset from datetime import datetime from datetime import timedelta import os import sys TOP = "/data_ballantine02/miyoshi-t/honda/SCALE-LETKF/BAIU2018_5.3.6" stime = datetime( 2018, 6, 30, 0, 0, 0 ) vtime = datetime( 2018, 7, 6, 0, 0, 0 ) adt = timedelta( hours=24 ) m = 1 ...
[ "datetime.datetime", "numpy.abs", "netCDF4.Dataset", "cartopy.crs.PlateCarree", "numpy.sum", "matplotlib.pyplot.figure", "cartopy.mpl.ticker.LatitudeFormatter", "cartopy.mpl.ticker.LongitudeFormatter", "sys.exit", "datetime.timedelta", "matplotlib.pyplot.subplots", "numpy.arange", "matplotli...
[((211, 241), 'datetime.datetime', 'datetime', (['(2018)', '(6)', '(30)', '(0)', '(0)', '(0)'], {}), '(2018, 6, 30, 0, 0, 0)\n', (219, 241), False, 'from datetime import datetime\n'), ((252, 281), 'datetime.datetime', 'datetime', (['(2018)', '(7)', '(6)', '(0)', '(0)', '(0)'], {}), '(2018, 7, 6, 0, 0, 0)\n', (260, 281)...
# --- # jupyter: # jupytext: # formats: ipynb,py # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.9.1+dev # kernelspec: # display_name: Python [conda env:annorxiver] # language: python # name: conda-env-annorxiver-...
[ "pandas.read_csv", "plotnine.coord_flip", "plotnine.aes", "plotnine.position_dodge", "sklearn.linear_model.LogisticRegressionCV", "pathlib.Path", "matplotlib.pyplot.twinx", "pandas.DataFrame.from_dict", "pandas.Categorical", "numpy.random.seed", "tqdm.tqdm_notebook", "requests.get", "plotnin...
[((1494, 1515), 'requests.get', 'requests.get', (['api_url'], {}), '(api_url)\n', (1506, 1515), False, 'import requests\n'), ((1603, 1622), 'numpy.random.seed', 'np.random.seed', (['(100)'], {}), '(100)\n', (1617, 1622), True, 'import numpy as np\n'), ((1649, 1688), 'numpy.random.randint', 'np.random.randint', (['(0)',...
# Car Pooling ''' You are driving a vehicle that has capacity empty seats initially available for passengers. The vehicle only drives east (ie. it cannot turn around and drive west.) Given a list of trips, trip[i] = [num_passengers, start_location, end_location] contains information about the i-th trip: the number o...
[ "numpy.array" ]
[((1856, 1871), 'numpy.array', 'np.array', (['trips'], {}), '(trips)\n', (1864, 1871), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- import math import pandas as pd import xml.etree.ElementTree as ET import matplotlib.pyplot as plt import os.path as osp from PIL import Image import numpy as np plt.rcParams['font.sans-serif'] = ['SimHei'] #用来正常显示中文标签 plt.rcParams['font.family']='sans-serif' plt.rcParams['figure.figsize'] ...
[ "PIL.Image.open", "xml.etree.ElementTree.parse", "matplotlib.pyplot.savefig", "os.path.join", "math.sqrt", "numpy.array", "pandas.DataFrame" ]
[((6121, 6265), 'pandas.DataFrame', 'pd.DataFrame', (['count_wh'], {'index': "['0-0.25', '0.25-0.33', '0.33-0.5', '0.5-1', '1-1.5', '1.5-2', '2-2.5',\n '2.5-3', '3-4', '>4']", 'columns': "['宽高比']"}), "(count_wh, index=['0-0.25', '0.25-0.33', '0.33-0.5', '0.5-1',\n '1-1.5', '1.5-2', '2-2.5', '2.5-3', '3-4', '>4'],...
# -*- coding: utf-8 -*- """ Created on Tue Jan 8 14:45:56 2019 @author: Xuan-Laptop """ import pandas as pd import numpy as np from utils import np_macro_f1, encoding from sklearn.linear_model import LinearRegression, LogisticRegression import warnings warnings.filterwarnings("ignore") def calibration...
[ "numpy.dstack", "numpy.mean", "sklearn.linear_model.LinearRegression", "pandas.read_csv", "pandas.merge", "numpy.log", "numpy.array", "pandas.DataFrame", "warnings.filterwarnings", "utils.np_macro_f1" ]
[((268, 301), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (291, 301), False, 'import warnings\n'), ((1301, 1344), 'pandas.read_csv', 'pd.read_csv', (['"""./data/sample_submission.csv"""'], {}), "('./data/sample_submission.csv')\n", (1312, 1344), True, 'import pandas as ...
""" Plot different high-thrust corrections used in BEM """ # --- Common libraries import numpy as np import matplotlib.pyplot as plt # --- Local libraries from welib.BEM.highthrust import * from welib.tools.figure import defaultRC; defaultRC(); def main(test=False): Ct=np.linspace(0,2,50) a =np.linspace(0,1...
[ "welib.tools.repo.export_figs_callback", "welib.tools.figure.defaultRC", "numpy.linspace", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((235, 246), 'welib.tools.figure.defaultRC', 'defaultRC', ([], {}), '()\n', (244, 246), False, 'from welib.tools.figure import defaultRC\n'), ((278, 299), 'numpy.linspace', 'np.linspace', (['(0)', '(2)', '(50)'], {}), '(0, 2, 50)\n', (289, 299), True, 'import numpy as np\n'), ((305, 326), 'numpy.linspace', 'np.linspac...
import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle from sarna.viz import highlight def compare_box_and_slice(x, box, slc): '''Function used to compare slice limits and box range of a rectangle.''' halfsample = np.diff(x).mean() / 2 correct_limits = x[slc][[0, -1]]...
[ "numpy.allclose", "sarna.viz.highlight", "numpy.random.random", "matplotlib.pyplot.plot", "numpy.diff", "matplotlib.pyplot.close", "numpy.array", "numpy.arange" ]
[((497, 539), 'numpy.allclose', 'np.allclose', (['correct_limits', 'bbox_x_limits'], {}), '(correct_limits, bbox_x_limits)\n', (508, 539), True, 'import numpy as np\n'), ((572, 599), 'numpy.arange', 'np.arange', (['(0)', '(10)'], {'step': '(0.05)'}), '(0, 10, step=0.05)\n', (581, 599), True, 'import numpy as np\n'), ((...
import numpy as np import matplotlib.pyplot as plt from numpy import pi as pi from numpy import sin as sin from numpy import cos as cos from scipy import signal # example 1a N=1000 f=50 T=1/f t=np.arange(N) Phi=np.random.normal(0,1,N) X=sin(2*pi*f*t/N) Y=sin(2*pi*f*t/N + Phi) plt.plot(Phi) plt.plot(X) plt.plot(Y) pl...
[ "numpy.random.normal", "matplotlib.pyplot.semilogy", "matplotlib.pyplot.grid", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplot", "numpy.cos", "numpy.sin", "scipy.signal.periodogram", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((196, 208), 'numpy.arange', 'np.arange', (['N'], {}), '(N)\n', (205, 208), True, 'import numpy as np\n'), ((213, 238), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)', 'N'], {}), '(0, 1, N)\n', (229, 238), True, 'import numpy as np\n'), ((239, 262), 'numpy.sin', 'sin', (['(2 * pi * f * t / N)'], {}), '(2 * ...
# -*- coding: utf-8 -*- import unittest import numpy as np import tensorflow as tf from tfsnippet.bayes import BernoulliLayer, StochasticTensor from tests.helper import TestCase class BernoulliLayerTestCase(TestCase): def test_basic(self): layer = BernoulliLayer() output = layer({'logits': tf.z...
[ "numpy.ones", "numpy.zeros", "tfsnippet.bayes.BernoulliLayer", "unittest.main", "tensorflow.zeros" ]
[((748, 763), 'unittest.main', 'unittest.main', ([], {}), '()\n', (761, 763), False, 'import unittest\n'), ((265, 281), 'tfsnippet.bayes.BernoulliLayer', 'BernoulliLayer', ([], {}), '()\n', (279, 281), False, 'from tfsnippet.bayes import BernoulliLayer, StochasticTensor\n'), ((316, 333), 'tensorflow.zeros', 'tf.zeros',...
"""Computation of quadrature points and weights for different schemes. Attributes ---------- DEFAULT_COLLOCATION_POINTS_MAX : int Constant default limitation on the maximum number of collocation points per mesh section that a user can specify. The value of 20 has been chosen as above this the algorithms th...
[ "numpy.insert", "numpy.linalg.solve", "numpy.ones", "numpy.hstack", "numpy.delete", "numpy.append", "numpy.array", "numpy.zeros", "numpy.count_nonzero", "numpy.concatenate", "numpy.polynomial.legendre.Legendre", "pyproprop.Options" ]
[((1165, 1233), 'pyproprop.Options', 'Options', (['(GAUSS, LOBATTO, RADAU)'], {'default': 'LOBATTO', 'unsupported': 'GAUSS'}), '((GAUSS, LOBATTO, RADAU), default=LOBATTO, unsupported=GAUSS)\n', (1172, 1233), False, 'from pyproprop import Options\n'), ((4125, 4170), 'numpy.polynomial.legendre.Legendre', 'np.polynomial.l...
import visa import numpy as np class Agilent54845A: def __init__(self,instrument,chan_num=1): """ Default constructor only requires direct access to the underlyign visa handler. See the method fromResourceManager for a more user-friendly way of constructing the class. """ ...
[ "numpy.array", "numpy.sqrt", "numpy.abs" ]
[((5140, 5173), 'numpy.array', 'np.array', (['query[1:7]'], {'dtype': 'float'}), '(query[1:7], dtype=float)\n', (5148, 5173), True, 'import numpy as np\n'), ((5345, 5379), 'numpy.array', 'np.array', (['query[8:14]'], {'dtype': 'float'}), '(query[8:14], dtype=float)\n', (5353, 5379), True, 'import numpy as np\n'), ((554...
''' Provider for dataset ''' import os import os.path import numpy as np import time class SceneflowDataset(): def __init__(self, root='/tmp/FlyingThings3D_subset_processed_35m', npoints=8192, mode = 'train_ft3d'): self.npoints = npoints self.mode = mode self.root = root if se...
[ "os.listdir", "numpy.logical_and", "numpy.random.choice", "numpy.where", "numpy.logical_not", "os.path.join", "numpy.logical_or", "os.walk", "os.path.split", "os.path.dirname", "numpy.random.seed", "numpy.load", "os.path.expanduser" ]
[((895, 912), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (909, 912), True, 'import numpy as np\n'), ((1120, 1147), 'os.path.join', 'os.path.join', (['fn', '"""pc1.npy"""'], {}), "(fn, 'pc1.npy')\n", (1132, 1147), False, 'import os\n'), ((1161, 1188), 'os.path.join', 'os.path.join', (['fn', '"""pc2.n...
import numpy as np import pandas as pd import torch import torchvision from am_utils.utils import walk_dir from torch.utils.data import DataLoader from torchvision.models.detection.faster_rcnn import FastRCNNPredictor from tqdm import tqdm from ..dataset.dataset_object_inference import DatasetObjectInference, DatasetO...
[ "numpy.round_", "torch.load", "tqdm.tqdm", "torchvision.models.detection.faster_rcnn.FastRCNNPredictor", "am_utils.utils.walk_dir", "torch.tensor", "torchvision.models.detection.fasterrcnn_resnet50_fpn", "torch.cuda.is_available", "torch.utils.data.DataLoader", "pandas.DataFrame", "pandas.concat...
[((931, 950), 'am_utils.utils.walk_dir', 'walk_dir', (['input_dir'], {}), '(input_dir)\n', (939, 950), False, 'from am_utils.utils import walk_dir\n'), ((1014, 1044), 'pandas.DataFrame', 'pd.DataFrame', (['{id_name: files}'], {}), '({id_name: files})\n', (1026, 1044), True, 'import pandas as pd\n'), ((1681, 1782), 'tor...
""" Pure Python implementation of the kernel functions """ import numpy as np from scipy.special import erf from utils import numpy_trans, numpy_trans_idx s2pi = np.sqrt(2.0 * np.pi) s2 = np.sqrt(2.0) @numpy_trans def norm1d_pdf(z, out): """ Full-python implementation of :py:func:`normal_kernel1d.pdf` ...
[ "numpy.multiply", "numpy.sqrt", "numpy.power", "numpy.exp", "scipy.special.erf", "numpy.isfinite", "numpy.empty", "numpy.divide", "numpy.atleast_1d" ]
[((165, 185), 'numpy.sqrt', 'np.sqrt', (['(2.0 * np.pi)'], {}), '(2.0 * np.pi)\n', (172, 185), True, 'import numpy as np\n'), ((191, 203), 'numpy.sqrt', 'np.sqrt', (['(2.0)'], {}), '(2.0)\n', (198, 203), True, 'import numpy as np\n'), ((1354, 1373), 'numpy.sqrt', 'np.sqrt', (['(35.0 / 243)'], {}), '(35.0 / 243)\n', (13...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import numpy as np __all__ = ['raises', 'assert_equal', 'assert_almost_equal', 'assert_true', 'setup_function', 'teardown_function', 'has_isnan'] CWD = os.getcwd() TEST_DIR = os.path.dirname(__file__) has_isnan = Tru...
[ "os.chdir", "os.path.dirname", "numpy.allclose", "os.getcwd" ]
[((255, 266), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (264, 266), False, 'import os\n'), ((278, 303), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (293, 303), False, 'import os\n'), ((566, 584), 'os.chdir', 'os.chdir', (['TEST_DIR'], {}), '(TEST_DIR)\n', (574, 584), False, 'import os\n'...
import platform import scipy import numpy as np import math from scipy import integrate from scipy import optimize as opt from scipy.stats import gamma from colorama import init, Fore, Back, Style from cell import Cell class PopSimulator: def __init__(self, ncells, gr, sb, steps, CV2div = 0, CV2gr = 0, lamb=1, V0...
[ "numpy.random.rand", "numpy.log", "numpy.array", "math.trunc", "scipy.stats.gamma.pdf", "numpy.diff", "numpy.exp", "platform.system", "numpy.random.gamma", "cell.Cell", "numpy.concatenate", "numpy.min", "numpy.argmin", "numpy.round", "scipy.stats.gamma.cdf", "numpy.trapz", "numpy.ran...
[((6301, 6334), 'scipy.optimize.bisect', 'opt.bisect', (['self.opti', '(0.001)', '(1.5)'], {}), '(self.opti, 0.001, 1.5)\n', (6311, 6334), True, 'from scipy import optimize as opt\n'), ((15927, 15943), 'numpy.zeros_like', 'np.zeros_like', (['u'], {}), '(u)\n', (15940, 15943), True, 'import numpy as np\n'), ((16557, 165...
""" file: simple_gen.py author: <NAME> date: 17 May 2020 notes: a most basic implementation of genetic cross breeding and mutation to attempt to improve a neural network. Assumes the standard Keras model from Donkeycar project. Lower score means less loss = better. """ import argparse import json import...
[ "numpy.tril_indices_from", "argparse.ArgumentParser", "tensorflow.keras.models.model_from_json", "numpy.absolute", "warnings.catch_warnings", "tensorflow.logging.set_verbosity", "numpy.array", "os.path.dirname", "numpy.random.uniform", "json.load", "time.time", "warnings.filterwarnings", "os...
[((600, 642), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (624, 642), True, 'import tensorflow as tf\n'), ((482, 507), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {}), '()\n', (505, 507), False, 'import warnings\n'), ((513, 570), 'wa...
import os import glob import pickle import pcl import torch import torch.utils.data import torch.nn as nn import numpy as np # global configurations: from autolab_core import YamlConfig from dexnet.grasping import GpgGraspSampler from dexnet.grasping import RobotGripper home_dir = os.environ['HOME'] yaml_config = Ya...
[ "dexnet.grasping.GpgGraspSampler", "numpy.hstack", "torch.initial_seed", "numpy.array", "numpy.linalg.norm", "numpy.sin", "pcl.PointCloud", "autolab_core.YamlConfig", "mayavi.mlab.points3d", "mayavi.mlab.pipeline.open", "numpy.cross", "numpy.where", "numpy.delete", "numpy.dot", "numpy.vs...
[((318, 389), 'autolab_core.YamlConfig', 'YamlConfig', (["(home_dir + '/Projects/PointNetGPD/dex-net/test/config.yaml')"], {}), "(home_dir + '/Projects/PointNetGPD/dex-net/test/config.yaml')\n", (328, 389), False, 'from autolab_core import YamlConfig\n'), ((428, 521), 'dexnet.grasping.RobotGripper.load', 'RobotGripper....