code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
""" Biharmonic splines in 2D. """ from warnings import warn import numpy as np from sklearn.utils.validation import check_is_fitted from .base import BaseGridder, check_fit_input, least_squares from .coordinates import get_region from .utils import n_1d_arrays, parse_engine try: import numba from numba impor...
[ "numpy.log", "numpy.empty", "numpy.broadcast", "sklearn.utils.validation.check_is_fitted", "numba.jit", "numba.prange", "warnings.warn", "numpy.sqrt" ]
[((10003, 10018), 'numba.jit', 'jit', ([], {}), '(**JIT_ARGS)\n', (10006, 10018), False, 'from numba import jit\n'), ((10491, 10506), 'numba.jit', 'jit', ([], {}), '(**JIT_ARGS)\n', (10494, 10506), False, 'from numba import jit\n'), ((9034, 9065), 'numpy.sqrt', 'np.sqrt', (['(east ** 2 + north ** 2)'], {}), '(east ** 2...
import io import os import numpy as np from numpy.testing import assert_array_equal import pytest import asdf from asdf import block from asdf import constants from asdf import generic_io def test_external_block(tmpdir): tmpdir = str(tmpdir) my_array = np.random.rand(8, 8) tree = {'my_array': my_array...
[ "os.listdir", "io.BytesIO", "numpy.ndarray", "asdf.generic_io.InputStream", "asdf.AsdfFile", "os.stat", "numpy.testing.assert_array_equal", "numpy.asarray", "asdf.block.UnloadedBlock", "numpy.ones", "pytest.raises", "numpy.random.random", "numpy.arange", "numpy.array", "numpy.random.rand...
[((267, 287), 'numpy.random.rand', 'np.random.rand', (['(8)', '(8)'], {}), '(8, 8)\n', (281, 287), True, 'import numpy as np\n'), ((331, 350), 'asdf.AsdfFile', 'asdf.AsdfFile', (['tree'], {}), '(tree)\n', (344, 350), False, 'import asdf\n'), ((608, 628), 'numpy.random.rand', 'np.random.rand', (['(8)', '(8)'], {}), '(8,...
#!/usr/bin/env python3 """ A collection of functions for the DPD simulation. 13/10/17 """ import numpy as np from numpy import sqrt from numpy.random import rand, randn from numba import jit, float64, int64 from .sim_io import save_xyzfile # ===== # Numba helper functions # ===== @jit(float64(float64[:]), nopython=T...
[ "numpy.sum", "numpy.random.randn", "numpy.zeros", "numpy.empty_like", "numba.jit", "numba.float64", "numpy.random.rand", "numpy.linalg.det", "numpy.diag", "numpy.sqrt" ]
[((1845, 1863), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (1848, 1863), False, 'from numba import jit, float64, int64\n'), ((407, 415), 'numpy.sqrt', 'sqrt', (['rn'], {}), '(rn)\n', (411, 415), False, 'from numpy import sqrt\n'), ((289, 308), 'numba.float64', 'float64', (['float64[:]'], {})...
import numpy as np from model.pca_based_z.divide_phase import divide_phase_frame_ma def gen_with_pca(k_space: np.ndarray, spv: int, len_segment: float, n_dim: int, start_bias: np.ndarray, max_num_phase: int = 10, k_c...
[ "numpy.random.uniform", "numpy.concatenate", "numpy.ceil", "numpy.random.randint", "numpy.array", "numpy.linalg.norm", "numpy.where", "numpy.arange", "numpy.unique" ]
[((2041, 2072), 'numpy.concatenate', 'np.concatenate', (['samples'], {'axis': '(0)'}), '(samples, axis=0)\n', (2055, 2072), True, 'import numpy as np\n'), ((3250, 3281), 'numpy.concatenate', 'np.concatenate', (['samples'], {'axis': '(0)'}), '(samples, axis=0)\n', (3264, 3281), True, 'import numpy as np\n'), ((3503, 353...
import math import numpy as np from scipy import special def _get_coulomb(rij, dij, ke): return ke / dij, ke * rij / dij**3 get_coulomb = np.vectorize(_get_coulomb, signature='(m),(),()->(),(m)') def _get_ewald_real(rij, n, alpha, ke): r = rij + n d2 = np.sum(r**2, axis=1) d = np.sqrt(d2) prod...
[ "numpy.vectorize", "numpy.sum", "math.sqrt", "scipy.special.erfc", "numpy.sin", "numpy.exp", "numpy.cos", "numpy.dot", "numpy.sqrt" ]
[((146, 203), 'numpy.vectorize', 'np.vectorize', (['_get_coulomb'], {'signature': '"""(m),(),()->(),(m)"""'}), "(_get_coulomb, signature='(m),(),()->(),(m)')\n", (158, 203), True, 'import numpy as np\n'), ((531, 597), 'numpy.vectorize', 'np.vectorize', (['_get_ewald_real'], {'signature': '"""(m),(n,m),(),()->(),(m)"""'...
import numpy as np import matplotlib import matplotlib.pyplot as plt from scipy.interpolate import griddata class data_linewidth_plot(): """ from https://stackoverflow.com/questions/19394505/matplotlib-expand-the-line-with-specified-width-in-data-unit#42972469 """ def __init__(self, x, y, **kwargs): se...
[ "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.Circle", "matplotlib.pyplot.set_cmap", "matplotlib.pyplot.gca", "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.subplots" ]
[((1579, 1616), 'numpy.load', 'np.load', (['"""2018-08-05_191829_path.npz"""'], {}), "('2018-08-05_191829_path.npz')\n", (1586, 1616), True, 'import numpy as np\n'), ((1771, 1785), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1783, 1785), True, 'import matplotlib.pyplot as plt\n'), ((2502, 2530), 'm...
# -*- time-stamp-pattern: "changed[\s]+:[\s]+%%$"; -*- # AUTHOR INFORMATION ########################################################## # file : cyclical_feature_encoder.py # author : <NAME> <<EMAIL>> # # created : 2022-01-07 09:02:38 (<NAME>) # changed : 2022-03-17 17:23:19 (<NAME>) # DESCRIPTION ##################...
[ "numpy.sin", "numpy.cos", "tensorflow.math.atan2" ]
[((1668, 1753), 'numpy.sin', 'np.sin', (['(2 * np.pi * (cycl - self.cycl_min) / (self.cycl_max - self.cycl_min + 1))'], {}), '(2 * np.pi * (cycl - self.cycl_min) / (self.cycl_max - self.cycl_min + 1)\n )\n', (1674, 1753), True, 'import numpy as np\n'), ((1785, 1870), 'numpy.cos', 'np.cos', (['(2 * np.pi * (cycl - se...
import torch as th from torch import Tensor import numpy as np from torchbenchmark.network.splitconnection.core import Layer # Reference: https://github.com/aayushmnit/Deep_learning_explorations/blob/master/1_MLP_from_scratch/Building_neural_network_from_scratch.ipynb class Dense(Layer): def __init__(self, input...
[ "numpy.zeros", "torch.mm", "numpy.sqrt" ]
[((1364, 1390), 'torch.mm', 'th.mm', (['input', 'self.weights'], {}), '(input, self.weights)\n', (1369, 1390), True, 'import torch as th\n'), ((1633, 1667), 'torch.mm', 'th.mm', (['grad_output', 'self.weights.T'], {}), '(grad_output, self.weights.T)\n', (1638, 1667), True, 'import torch as th\n'), ((1753, 1780), 'torch...
import os import numpy as np import tensorflow as tf from processing.utils import printProgressBar, is_rgb from skimage.metrics import structural_similarity from skimage.util import img_as_ubyte import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class ResmapCalculator: de...
[ "tensorflow.image.rgb_to_grayscale", "numpy.abs", "numpy.sum", "logging.basicConfig", "skimage.util.img_as_ubyte", "numpy.zeros", "numpy.clip", "numpy.amax", "skimage.metrics.structural_similarity", "numpy.array", "processing.utils.is_rgb", "logging.getLogger" ]
[((211, 250), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (230, 250), False, 'import logging\n'), ((260, 287), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'import logging\n'), ((3428, 3477), 'numpy.zeros', ...
# source: https://github.com/allentran/pca-magic/blob/master/ppca/_ppca.py from __future__ import division from __future__ import print_function from builtins import object import os import numpy as np from scipy.linalg import orth class PPCA: def __init__(self): self.raw = None self.data = Non...
[ "numpy.trace", "numpy.sum", "numpy.eye", "numpy.log", "numpy.random.randn", "numpy.nanstd", "numpy.isinf", "numpy.isnan", "numpy.isfinite", "numpy.argsort", "numpy.linalg.det", "numpy.linalg.inv", "scipy.linalg.orth", "numpy.nanvar", "numpy.linalg.slogdet", "numpy.dot", "numpy.linalg...
[((944, 968), 'numpy.nanmean', 'np.nanmean', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (954, 968), True, 'import numpy as np\n'), ((989, 1012), 'numpy.nanstd', 'np.nanstd', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (998, 1012), True, 'import numpy as np\n'), ((1106, 1123), 'numpy.sum', 'np.sum', (['(~obse...
import numpy as np import networkx as nx import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.animation as animation from itertools import product def animate_count(cp, tmax, subgraph_nodes = None): G = cp.graphs[0] B = G.system_matrix() xvec = np.zeros([G.K(), tmax+1], dtype=float) uvec =...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "networkx.draw_networkx_edges", "matplotlib.pyplot.ylim", "matplotlib.pyplot.axis", "matplotlib.pyplot.cm.ScalarMappable", "matplotlib.pyplot.text", "numpy.max", "numpy.arange", "matplotlib.pyplot.subplots" ]
[((819, 833), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (831, 833), True, 'import matplotlib.pyplot as plt\n'), ((835, 850), 'matplotlib.pyplot.axis', 'plt.axis', (['"""off"""'], {}), "('off')\n", (843, 850), True, 'import matplotlib.pyplot as plt\n'), ((963, 1011), 'matplotlib.pyplot.text', 'plt....
#!/usr/bin/python3 from pylab import * import matplotlib as mplt import numpy as np import matplotlib.pyplot as plt import os import math import argparse from module_getarg import getarg from argparse import RawTextHelpFormatter from module_io import * # this is to ignore warnings import warnings warnings.filterwarni...
[ "module_colormap.set_colormap", "argparse.ArgumentParser", "module_colormap.set_colormap_alpha", "warnings.filterwarnings", "numpy.ceil", "numpy.floor", "matplotlib.pyplot.figure", "module_getarg.getarg" ]
[((300, 354), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'module': '"""matplotlib"""'}), "('ignore', module='matplotlib')\n", (323, 354), False, 'import warnings\n'), ((417, 647), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""\n ...
import numpy as np from scipy.optimize import linear_sum_assignment def xywh2xyxy(bbox): x, y, w, h = bbox return [x, y, x+w, y + h] def single_batch_iou(bbox1, bbox2): xmin1, ymin1, xmax1, ymax1 = bbox1 xmin2, ymin2, xmax2, ymax2 = bbox2 w1, h1 = xmax1 - xmin1, ymax1 - ymin1 w2, h2 = xmax...
[ "numpy.asarray", "numpy.zeros", "scipy.optimize.linear_sum_assignment" ]
[((661, 677), 'numpy.zeros', 'np.zeros', (['(M, N)'], {}), '((M, N))\n', (669, 677), True, 'import numpy as np\n'), ((1277, 1317), 'scipy.optimize.linear_sum_assignment', 'linear_sum_assignment', (['match_cost_matrix'], {}), '(match_cost_matrix)\n', (1298, 1317), False, 'from scipy.optimize import linear_sum_assignment...
import pandas as pd import matplotlib.pyplot as plt import numpy as np def f(x, c): return x**2 + c # seeds definitions params = np.arange(-0.75, 0.25, 1/200) params = np.concatenate((params, np.arange(-1.25, -0.75, 0.5/200))) params = np.concatenate((params, np.arange(-1.4, -1.25, 0.15/200))) params = np.conca...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((137, 168), 'numpy.arange', 'np.arange', (['(-0.75)', '(0.25)', '(1 / 200)'], {}), '(-0.75, 0.25, 1 / 200)\n', (146, 168), True, 'import numpy as np\n'), ((527, 539), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (537, 539), True, 'import matplotlib.pyplot as plt\n'), ((817, 839), 'matplotlib.pyplot.plo...
import pickle import pandas as pd import matplotlib.pyplot as plt from matplotlib.dates import DateFormatter import seaborn as sns from gensim.models.ldamulticore import LdaMulticore import numpy as np # load the model from disk filename = 'models/trained_lda.sav' ldamodel = LdaMulticore.load(filename) filename = 'mo...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.figure", "numpy.where", "pandas.to_datetime", "gensim.models.ldamulticore.LdaMulticore.load", "matplotlib.pyplot.savefig" ]
[((277, 304), 'gensim.models.ldamulticore.LdaMulticore.load', 'LdaMulticore.load', (['filename'], {}), '(filename)\n', (294, 304), False, 'from gensim.models.ldamulticore import LdaMulticore\n'), ((636, 650), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (648, 650), True, 'import pandas as pd\n'), ((2396, 2467)...
from unittest import TestCase from axitom.config import Config from axitom.backprojection import map_object_to_detector_coords import numpy as np class TestMap_object_to_detector_coords(TestCase): def test_map_object_to_detector_coords_1xmag(self): """ When the detector and object are located at ...
[ "numpy.meshgrid", "numpy.abs", "numpy.argmax", "axitom.backprojection.map_object_to_detector_coords", "numpy.max", "axitom.config.Config" ]
[((588, 756), 'axitom.config.Config', 'Config', ([], {'n_pixels_u': '(20)', 'n_pixels_v': '(20)', 'detector_size_u': '(200.0)', 'detector_size_v': '(200.0)', 'source_to_detector_dist': '(10000000000.0)', 'source_to_object_dist': '(10000000000.0)'}), '(n_pixels_u=20, n_pixels_v=20, detector_size_u=200.0, detector_size_v...
# -*- coding: utf-8 -*- import numpy as np import random import math import csv import pathlib class genertic_algorithem(): ''' Genetischer Algortihmus zum Berechnen einer optimalen Verteilung von Hardware (hardware_data.csv) auf LKWs (fahrezug_data.csv). Das Ergebnis wird in Form einer CS-Datei mit dem ...
[ "csv.reader", "csv.writer", "random.randint", "pathlib.Path", "numpy.array", "numpy.random.permutation" ]
[((5375, 5395), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (5389, 5395), False, 'import random\n'), ((5410, 5430), 'random.randint', 'random.randint', (['(0)', '(9)'], {}), '(0, 9)\n', (5424, 5430), False, 'import random\n'), ((5445, 5465), 'random.randint', 'random.randint', (['(0)', '(9)'],...
import time import numpy as np from numpy.random import uniform from acrobotics.shapes import Box from acrolib.geometry import pose_x box1 = Box(1, 0.5, 2) box2 = Box(0.7, 1.5, 1) def check_random_collision(): tf1 = pose_x(uniform(-2, 2), uniform(0, 3), 0, 0) tf2 = pose_x(uniform(-2, 2), 0, uniform(0, 3), 0...
[ "numpy.random.uniform", "numpy.zeros", "time.time", "acrobotics.shapes.Box", "numpy.mean" ]
[((143, 157), 'acrobotics.shapes.Box', 'Box', (['(1)', '(0.5)', '(2)'], {}), '(1, 0.5, 2)\n', (146, 157), False, 'from acrobotics.shapes import Box\n'), ((165, 181), 'acrobotics.shapes.Box', 'Box', (['(0.7)', '(1.5)', '(1)'], {}), '(0.7, 1.5, 1)\n', (168, 181), False, 'from acrobotics.shapes import Box\n'), ((394, 405)...
# DataFrame = pd.DataFrame from datetime import datetime, timedelta import numpy as np import pandas as pd from optimus.engines.base.commons.functions import to_string, to_integer, to_float, to_boolean, word_tokenize from optimus.engines.base.functions import Functions from optimus.helpers.core import val_to_list imp...
[ "optimus.engines.base.commons.functions.word_tokenize", "optimus.engines.base.commons.functions.to_boolean", "numpy.log", "optimus.engines.base.commons.functions.to_integer", "optimus.helpers.core.val_to_list", "datetime.timedelta", "pandas.to_datetime", "optimus.engines.base.commons.functions.to_stri...
[((481, 497), 'optimus.engines.base.commons.functions.to_float', 'to_float', (['series'], {}), '(series)\n', (489, 497), False, 'from optimus.engines.base.commons.functions import to_string, to_integer, to_float, to_boolean, word_tokenize\n'), ((547, 563), 'optimus.engines.base.commons.functions.to_float', 'to_float', ...
# taken loosely from https://medium.com/@thechrisyoon/deriving-policy-gradients-and-implementing-reinforce-f887949bd63 import sys import torch import numpy as np import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable import matplotlib.pyplot as plt class ...
[ "numpy.random.uniform", "numpy.random.choice", "matplotlib.pyplot.show", "torch.stack", "matplotlib.pyplot.plot", "numpy.sum", "torch.autograd.Variable", "numpy.floor", "torch.isinf", "numpy.mean", "torch.nn.Linear", "matplotlib.pyplot.ylabel", "torch.tensor", "matplotlib.pyplot.xlabel", ...
[((3223, 3259), 'numpy.floor', 'np.floor', (['(action / action_buckets[1])'], {}), '(action / action_buckets[1])\n', (3231, 3259), True, 'import numpy as np\n'), ((7854, 7872), 'matplotlib.pyplot.plot', 'plt.plot', (['numsteps'], {}), '(numsteps)\n', (7862, 7872), True, 'import matplotlib.pyplot as plt\n'), ((7877, 789...
from PyQt5.QtWidgets import QDial from PyQt5.QtCore import (pyqtSignal, pyqtSlot) import numpy as np import logging logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.WARNING) class QRotaryEncoder(QDial): '''Subclassed QDial that emits signals indicating direction of rotation ...
[ "PyQt5.QtCore.pyqtSignal", "numpy.abs", "logging.basicConfig", "numpy.sign", "PyQt5.QtCore.pyqtSlot", "PyQt5.QtWidgets.QApplication", "logging.getLogger" ]
[((118, 139), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (137, 139), False, 'import logging\n'), ((149, 176), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (166, 176), False, 'import logging\n'), ((702, 714), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n',...
# -*- coding: utf-8 -*- """ Spyder Editor Rescale data Attributes are often rescaled into the range between 0 and 1 It is useful for algorithms that weight inputs like regression and neural networks and algorithms that use distance measures like K-Nearest Neighbors. This is a temporary script file. Co...
[ "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler", "numpy.set_printoptions" ]
[((703, 732), 'pandas.read_csv', 'pd.read_csv', (['url'], {'names': 'names'}), '(url, names=names)\n', (714, 732), True, 'import pandas as pd\n'), ((789, 823), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'feature_range': '(0, 1)'}), '(feature_range=(0, 1))\n', (801, 823), False, 'from sklearn.preprocess...
""" CUDA PARALLEL PROGRAMMING: cuda_c_ops.py * Purpose: Python interface for performing matrix operations using CUDA C/C++ * @author <NAME> * @version 2.2 15/10/18 * Build shared object library using: nvcc -Xcompiler -fPIC -shared -o lib/cuda_mat_ops.so ops/matrix_ops.cu """ import ctypes import numpy as np fr...
[ "numpy.zeros_like", "numpy.maximum", "ctypes.c_double", "numpy.random.randn", "numpy.allclose", "numpy.zeros", "numpy.array", "numpy.dot", "ctypes.CDLL", "numpy.all", "ctypes.POINTER" ]
[((433, 494), 'ctypes.CDLL', 'ctypes.CDLL', (['"""./lib/cuda_mat_ops.so"""'], {'mode': 'ctypes.RTLD_GLOBAL'}), "('./lib/cuda_mat_ops.so', mode=ctypes.RTLD_GLOBAL)\n", (444, 494), False, 'import ctypes\n'), ((2662, 2680), 'ctypes.c_double', 'ctypes.c_double', (['b'], {}), '(b)\n', (2677, 2680), False, 'import ctypes\n')...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (C) 2010-2018 GEM Foundation, <NAME>, <NAME>, # <NAME>. # # The Hazard Modeller's Toolkit is free software: you can redistribute # it and/or modify it under the terms of the GNU Affero General Public # License as published by...
[ "openquake.hmtk.strain.strain_utils.moment_function", "numpy.sum", "numpy.amin", "numpy.logical_and", "math.fabs", "numpy.zeros", "openquake.hmtk.strain.strain_utils.calculate_taper_function", "numpy.amax", "numpy.shape", "numpy.where", "numpy.array", "numpy.column_stack", "numpy.unique" ]
[((7795, 7829), 'openquake.hmtk.strain.strain_utils.moment_function', 'moment_function', (["reg['corner_mag']"], {}), "(reg['corner_mag'])\n", (7810, 7829), False, 'from openquake.hmtk.strain.strain_utils import moment_function, calculate_taper_function\n'), ((10829, 10868), 'openquake.hmtk.strain.strain_utils.moment_f...
import sys import random import os import argparse import numpy as np import gc # garbage collection; call with gc.collect() bases = list('GTCA') def random_seq(seq_len): return ''.join(np.random.choice(bases,seq_len)) def gen_random_seq(filename, seq_len, num_seq = 1): ''' Generate and return random GTCA sequen...
[ "random.choice", "argparse.ArgumentParser", "numpy.random.choice" ]
[((2423, 2482), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate random data"""'}), "(description='Generate random data')\n", (2446, 2482), False, 'import argparse\n'), ((189, 221), 'numpy.random.choice', 'np.random.choice', (['bases', 'seq_len'], {}), '(bases, seq_len)\n', (205, ...
import sys, os this_dir = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.realpath(this_dir + '/../magphase/src')) import numpy as np from matplotlib import pyplot as plt import libutils as lu import libaudio as la import magphase as mp from scikits.talkbox import lpc from scipy.signal import lfilte...
[ "numpy.roots", "numpy.abs", "numpy.angle", "numpy.argmin", "numpy.argsort", "matplotlib.pyplot.figure", "numpy.mean", "libaudio.reaper_epoch_detection", "libaudio.read_audio_file", "numpy.fft.fft", "numpy.minimum", "libaudio.remove_hermitian_half", "matplotlib.pyplot.show", "os.path.realpa...
[((42, 68), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (58, 68), False, 'import sys, os\n'), ((86, 133), 'os.path.realpath', 'os.path.realpath', (["(this_dir + '/../magphase/src')"], {}), "(this_dir + '/../magphase/src')\n", (102, 133), False, 'import sys, os\n'), ((830, 847), 'numpy.di...
# -*- encoding:utf-8 -*- """ 计算线atr模块 """ from __future__ import division from __future__ import print_function from __future__ import absolute_import import matplotlib.pyplot as plt import numpy as np import pandas as pd from ..TLineBu.ABuTLine import AbuTLine from ..CoreBu.ABuPdHelper import pd_rolling_std, pd...
[ "pandas.Series", "matplotlib.pyplot.show", "numpy.log", "numpy.sqrt" ]
[((1033, 1043), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1041, 1043), True, 'import matplotlib.pyplot as plt\n'), ((673, 707), 'numpy.log', 'np.log', (["(kl_pd['atr21'] / pre_atr21)"], {}), "(kl_pd['atr21'] / pre_atr21)\n", (679, 707), True, 'import numpy as np\n'), ((795, 806), 'numpy.sqrt', 'np.sqrt',...
from utils import configurations, utils from moviepy.editor import VideoFileClip, ColorClip, concatenate_videoclips import tensorflow_hub as hub import tensorflow as tf from tensorflow.keras.layers import Layer, Bidirectional, GRU, Dense import numpy as np import os from tqdm import tqdm def get_frames_properly_forma...
[ "tensorflow_hub.load", "numpy.save", "moviepy.editor.VideoFileClip", "tensorflow.convert_to_tensor", "numpy.asarray", "numpy.split", "os.path.isfile", "tensorflow.keras.regularizers.L2", "moviepy.editor.concatenate_videoclips", "utils.utils.load_configs_if_none", "moviepy.editor.ColorClip" ]
[((902, 928), 'numpy.split', 'np.split', (['frames', 'n_splits'], {}), '(frames, n_splits)\n', (910, 928), True, 'import numpy as np\n'), ((1064, 1090), 'numpy.asarray', 'np.asarray', (['video_features'], {}), '(video_features)\n', (1074, 1090), True, 'import numpy as np\n'), ((595, 646), 'moviepy.editor.ColorClip', 'C...
from __future__ import print_function import numpy as np import PIL.Image import pickle import json from tqdm import trange from time import sleep import os.path import sys sys.path.append("../src/") import renderer as rd from scipy.io import loadmat from mesh_edit import fast_deform_dja from mesh_edit import fast_def...
[ "numpy.load", "numpy.moveaxis", "scipy.io.loadmat", "pickle.load", "mesh_edit.fast_deform_dja", "sys.path.append", "utility.take_notes", "utility.make_trimesh", "numpy.rollaxis", "data_filter.lspet_filter", "numpy.stack", "json.dump", "renderer.SMPLRenderer", "tqdm.trange", "numpy.asarra...
[((174, 200), 'sys.path.append', 'sys.path.append', (['"""../src/"""'], {}), "('../src/')\n", (189, 200), False, 'import sys\n'), ((710, 745), 'numpy.load', 'np.load', (['"""../predef/smpl_faces.npy"""'], {}), "('../predef/smpl_faces.npy')\n", (717, 745), True, 'import numpy as np\n'), ((788, 803), 'hmr_predictor.hmr_p...
import numpy as np from collections import defaultdict class Agent: def __init__(self, nA=6): """ Initialize agent. Params ====== - nA: number of actions available to the agent """ self.nA = nA self.Q = defaultdict(lambda: np.zeros(self.nA)) #init e...
[ "numpy.random.choice", "numpy.zeros", "numpy.ones", "numpy.argmax" ]
[((786, 810), 'numpy.argmax', 'np.argmax', (['self.Q[state]'], {}), '(self.Q[state])\n', (795, 810), True, 'import numpy as np\n'), ((958, 999), 'numpy.random.choice', 'np.random.choice', (['self.nA'], {'p': 'policy_state'}), '(self.nA, p=policy_state)\n', (974, 999), True, 'import numpy as np\n'), ((286, 303), 'numpy....
# Author: <NAME>, University of Sussex (<EMAIL>) # Purpose: Code for preparing real data for further analysis import nibabel as nib import numpy as np data_dir = '/Users/is321/Documents/Data/qBold/hyperv_data/' def estimate_noise_level(): import matplotlib.pyplot as plt subjects = ['CISC17352', 'CISC17543',...
[ "subprocess.run", "os.remove", "numpy.save", "nibabel.load", "os.path.basename", "numpy.std", "os.path.dirname", "os.path.exists", "os.system", "numpy.mean", "numpy.array", "glob.glob", "tarfile.open", "numpy.concatenate" ]
[((2335, 2358), 'numpy.array', 'np.array', (['norm_snr_list'], {}), '(norm_snr_list)\n', (2343, 2358), True, 'import numpy as np\n'), ((2624, 2652), 'os.path.dirname', 'path.dirname', (['image_filename'], {}), '(image_filename)\n', (2636, 2652), False, 'from os import remove, path\n'), ((6010, 6038), 'os.path.dirname',...
import numpy as np def get_onehot(y): classes = np.unique(y) one_hot = np.zeros((len(y),len(classes))) for i in range(len(y)): one_hot[i][y[i]] = 1 return one_hot class activater(): def softmax(self, X): return np.exp(X)/np.sum(np.exp(X),1).reshape(-1,1) def sigmoid(self, ...
[ "numpy.random.seed", "numpy.log", "numpy.random.randn", "numpy.argmax", "numpy.unique", "numpy.ones", "numpy.exp", "numpy.concatenate" ]
[((53, 65), 'numpy.unique', 'np.unique', (['y'], {}), '(y)\n', (62, 65), True, 'import numpy as np\n'), ((554, 571), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (568, 571), True, 'import numpy as np\n'), ((952, 976), 'numpy.ones', 'np.ones', (['(X.shape[0], 1)'], {}), '((X.shape[0], 1))\n', (959, 976...
import os import numpy as np import pdb import matplotlib as mpl import matplotlib.pyplot as plt import pickle from terminaltables import AsciiTable colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'] base_path = "/home/anowak/struntho/logs/" task = "multiclass" # task = "ordinal" # task = "sequence" # task = "ranking"...
[ "terminaltables.AsciiTable", "numpy.array", "pdb.set_trace", "os.path.join", "os.listdir" ]
[((4863, 4891), 'terminaltables.AsciiTable', 'AsciiTable', (['cross_valid_info'], {}), '(cross_valid_info)\n', (4873, 4891), False, 'from terminaltables import AsciiTable\n'), ((3322, 3349), 'numpy.array', 'np.array', (['test_error_finals'], {}), '(test_error_finals)\n', (3330, 3349), True, 'import numpy as np\n'), ((1...
import argparse import os import numpy as np import pandas as pd import torch import random from unet3d.train import run_training from unet3d.utils.filenames import wrapped_partial, generate_filenames, load_bias, load_sequence from unet3d.utils.sequences import (WholeVolumeToSurfaceSequence, HCPRegressionSequence, Pa...
[ "numpy.random.seed", "argparse.ArgumentParser", "pandas.read_csv", "numpy.round", "os.path.join", "unet3d.utils.filenames.load_sequence", "unet3d.utils.utils.load_json", "unet3d.utils.filenames.load_bias", "os.path.exists", "random.seed", "unet3d.utils.filenames.wrapped_partial", "unet3d.utils...
[((1038, 1063), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1061, 1063), False, 'import argparse\n'), ((2523, 2559), 'unet3d.scripts.script_utils.add_machine_config_to_parser', 'add_machine_config_to_parser', (['parser'], {}), '(parser)\n', (2551, 2559), False, 'from unet3d.scripts.script_u...
"""## Download the required data : Annotations,Captions,Images""" import os import urllib import zipfile from pycocotools.coco import COCO os.chdir('cocoapi') # Download the annotation : annotations_trainval2014 = 'http://images.cocodataset.org/annotations/annotations_trainval2014.zip' image_info_test2014 = 'http:/...
[ "os.remove", "pickle.dump", "pickle.load", "nltk.download", "torchvision.transforms.Normalize", "os.path.join", "os.chdir", "torch.utils.data.DataLoader", "matplotlib.pyplot.imshow", "os.path.exists", "torch.Tensor", "numpy.random.choice", "collections.Counter", "skimage.io.imread", "tor...
[((142, 161), 'os.chdir', 'os.chdir', (['"""cocoapi"""'], {}), "('cocoapi')\n", (150, 161), False, 'import os\n'), ((382, 480), 'urllib.request.urlretrieve', 'urllib.request.urlretrieve', (['annotations_trainval2014'], {'filename': '"""annotations_trainval2014.zip"""'}), "(annotations_trainval2014, filename=\n 'anno...
import os import numpy as np os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices' from training import train, load_model, load_generator, extra_epochs from discriminator import Discriminator from generator import Generator from tensorflow.keras.preprocessing.image import ImageDataGenerator from data_process impor...
[ "tensorflow.keras.preprocessing.image.ImageDataGenerator", "traversal.read_latent_points", "argparse.ArgumentParser", "tensorflow.compat.v1.InteractiveSession", "traversal.traverse_latent_space", "numpy.savetxt", "training.train", "training.load_model", "traversal.genGif", "tensorflow.compat.v1.Co...
[((585, 598), 'tensorflow.compat.v1.ConfigProto', 'ConfigProto', ([], {}), '()\n', (596, 598), False, 'from tensorflow.compat.v1 import ConfigProto\n'), ((648, 681), 'tensorflow.compat.v1.InteractiveSession', 'InteractiveSession', ([], {'config': 'config'}), '(config=config)\n', (666, 681), False, 'from tensorflow.comp...
from sklearn.impute import SimpleImputer from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from sklearn.linear_model import LinearRegression, Ridge, Lasso from sklearn.model_selection import KFold, ShuffleSplit, GridSearchCV, cross_val_score, StratifiedKFold, train_test_split from s...
[ "numpy.abs", "numpy.mean", "sklearn.base.clone", "cvxpy.quad_form", "pandas.DataFrame", "cvxpy.matmul", "pycasso.Solver", "itertools.product", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.Lasso", "sklearn.linear_model.Ridge", "cvxpy.pnorm", "copy.deepcopy", "sklearn.linear_m...
[((1418, 1441), 'cvxpy.Variable', 'cp.Variable', (['X.shape[1]'], {}), '(X.shape[1])\n', (1429, 1441), True, 'import cvxpy as cp\n'), ((1451, 1476), 'cvxpy.Parameter', 'cp.Parameter', ([], {'nonneg': '(True)'}), '(nonneg=True)\n', (1463, 1476), True, 'import cvxpy as cp\n'), ((1681, 1701), 'numpy.zeros', 'np.zeros', ([...
# Licensed under an MIT open source license - see LICENSE """ SCOUSE - Semi-automated multi-COmponent Universal Spectral-line fitting Engine Copyright (c) 2016-2018 <NAME> CONTACT: <EMAIL> """ import numpy as np import sys from .io import * from .parallel_map import * def compute_noise(scouseobject): """ ...
[ "numpy.sum", "numpy.nanmedian", "numpy.ravel", "numpy.ones", "numpy.shape", "matplotlib.pyplot.figure", "numpy.arange", "numpy.nanmean", "matplotlib.patches.Rectangle", "numpy.isfinite", "numpy.max", "numpy.ravel_multi_index", "matplotlib.patches.PathPatch", "numpy.size", "tqdm.tqdm", ...
[((1665, 1686), 'numpy.nanmedian', 'np.nanmedian', (['rmsList'], {}), '(rmsList)\n', (1677, 1686), True, 'import numpy as np\n'), ((2291, 2333), 'astropy.stats.median_absolute_deviation', 'median_absolute_deviation', (['reflected_noise'], {}), '(reflected_noise)\n', (2316, 2333), False, 'from astropy.stats import media...
import logging from abc import ABC, abstractmethod from itertools import product import matplotlib.pyplot as plt import numpy as np from skimage.filters import difference_of_gaussians, window from skimage.transform import rotate, warp_polar from tqdm import tqdm, trange from aspire.image import Image from aspire.nume...
[ "matplotlib.pyplot.title", "aspire.image.Image", "numpy.abs", "numpy.sum", "numpy.argmax", "numpy.empty", "numpy.ones", "numpy.mean", "numpy.arange", "skimage.transform.rotate", "aspire.numeric.fft.fft2", "numpy.atleast_2d", "numpy.full", "aspire.numeric.fft.ifft2", "matplotlib.pyplot.im...
[((432, 459), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (449, 459), False, 'import logging\n'), ((3066, 3116), 'numpy.empty', 'np.empty', (['(n_nbor, src.L, src.L)'], {'dtype': 'self.dtype'}), '((n_nbor, src.L, src.L), dtype=self.dtype)\n', (3074, 3116), True, 'import numpy as np\n')...
from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize from Cython.Distutils import build_ext import numpy ext_modules = [ Extension( "gpss", ["gpss.pyx"], libraries=["m"], cython_directives={'language_level' : "3"}, extra_com...
[ "distutils.extension.Extension", "Cython.Build.cythonize", "numpy.get_include" ]
[((184, 386), 'distutils.extension.Extension', 'Extension', (['"""gpss"""', "['gpss.pyx']"], {'libraries': "['m']", 'cython_directives': "{'language_level': '3'}", 'extra_compile_args': "['-O3', '-ffast-math', '-march=native', '-fopenmp']", 'extra_link_args': "['-fopenmp']"}), "('gpss', ['gpss.pyx'], libraries=['m'], c...
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets 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 appl...
[ "tensorflow_datasets.core.features.feature.TensorInfo", "tensorflow_datasets.core.utils.py_utils.zip_dict", "numpy.zeros", "tensorflow_datasets.testing.test_main", "numpy.array", "tensorflow_datasets.core.example_serializer._dict_to_tf_example", "tensorflow_datasets.core.example_serializer._add_ragged_f...
[((7532, 7551), 'tensorflow_datasets.testing.test_main', 'testing.test_main', ([], {}), '()\n', (7549, 7551), False, 'from tensorflow_datasets import testing\n'), ((1352, 1383), 'tensorflow_datasets.core.utils.py_utils.zip_dict', 'py_utils.zip_dict', (['dict1', 'dict2'], {}), '(dict1, dict2)\n', (1369, 1383), False, 'f...
import numpy as np import pandas as pd import pytest def data_handling(df: pd.DataFrame): new_col_name = "".join([c for c in df.columns]) print(new_col_name) @pytest.fixture() def data(): return pd.DataFrame(columns=["a", "b", "c"], data=[3, 2, 1]*np.ones([5,3])) def test_data_handling(data): d...
[ "pytest.fixture", "numpy.ones" ]
[((174, 190), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (188, 190), False, 'import pytest\n'), ((267, 282), 'numpy.ones', 'np.ones', (['[5, 3]'], {}), '([5, 3])\n', (274, 282), True, 'import numpy as np\n')]
# todo figure out how to import without polluting namespace import pandas as pd import numpy as np import re import sklearn def hex_to_bin_state(state): hex_num = state[1:-3] # todo use this domain import? or get rid of it domain = state[-1] valid_last_digits = int(state[-3]) if valid_last_digits ...
[ "pandas.MultiIndex.from_tuples", "re.match", "sklearn.linear_model.LinearRegression", "numpy.array", "glob.glob" ]
[((966, 992), 'glob.glob', 'glob.glob', (["(base_name + '*')"], {}), "(base_name + '*')\n", (975, 992), False, 'import glob\n'), ((1378, 1467), 'pandas.MultiIndex.from_tuples', 'pd.MultiIndex.from_tuples', (["(('other', 'grade', 'grade'), ('other', 'domain', 'name'))"], {}), "((('other', 'grade', 'grade'), ('other', 'd...
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "<NAME>" at 11:59, 17/03/2020 % # ...
[ "numpy.random.uniform", "mealpy.root.Root.__init__", "copy.deepcopy", "numpy.abs" ]
[((1183, 1214), 'mealpy.root.Root.__init__', 'Root.__init__', (['self', 'root_paras'], {}), '(self, root_paras)\n', (1196, 1214), False, 'from mealpy.root import Root\n'), ((1474, 1498), 'copy.deepcopy', 'deepcopy', (['sorted_pop[:3]'], {}), '(sorted_pop[:3])\n', (1482, 1498), False, 'from copy import deepcopy\n'), ((2...
from sbrfuzzy import * import numpy as np def f1(vet): return 1.4329 * vet[0] - 0.0757 def f2(vet): return 1.4357 * vet[0] - 0.0744 def f3(vet): return 1.0728 * vet[0] + 0.0724 def f4(vet): return 0.9702 * vet[0] + 0.1341 def f5(vet): return 0.4968 * vet[0] + 0.5114 v1 = variavellinguistica("EAS",np.arange(0,1.001,...
[ "numpy.arange" ]
[((731, 752), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(0.01)'], {}), '(0, 1, 0.01)\n', (740, 752), True, 'import numpy as np\n'), ((302, 328), 'numpy.arange', 'np.arange', (['(0)', '(1.001)', '(0.001)'], {}), '(0, 1.001, 0.001)\n', (311, 328), True, 'import numpy as np\n')]
import re from collections import defaultdict from itertools import product import networkx as nx import numpy as np from scipy.ndimage import convolve LOCHNESS = ( ' # ', '# ## ## ###', ' # # # # # # ', ) def parse_data(): with open('2020/20/input.txt') as f: ...
[ "re.fullmatch", "scipy.ndimage.convolve", "collections.defaultdict", "numpy.rot90", "numpy.array_equal" ]
[((963, 980), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (974, 980), False, 'from collections import defaultdict\n'), ((1204, 1218), 'numpy.rot90', 'np.rot90', (['tile'], {}), '(tile)\n', (1212, 1218), True, 'import numpy as np\n'), ((2818, 2872), 'scipy.ndimage.convolve', 'convolve', (['imag...
import numpy as np import flask import tensorflow as tf import tensorflow.keras as k import cv2 from resizable_autoencoder_model import load_resizable_autoencoder from util.pad_image import pad_image import re def process_image(image, resizable_autoencoder): image = image / 255.0 full_model, expanded_image_sha...
[ "util.image_cache.image_cache.get_data_image", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.clf", "matplotlib.pyplot.imshow", "flask.Flask", "cv2.imdecode", "re.match", "numpy.clip", "util.pad_image.pad_image", "cv2.imread", "cv2.imencode", "resizable_autoencoder...
[((415, 459), 'util.pad_image.pad_image', 'pad_image', (['image'], {'shape': 'expanded_image_shape'}), '(image, shape=expanded_image_shape)\n', (424, 459), False, 'from util.pad_image import pad_image\n'), ((760, 785), 'numpy.clip', 'np.clip', (['result', '(0.0)', '(1.0)'], {}), '(result, 0.0, 1.0)\n', (767, 785), True...
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import gevent.monkey import multiprocessing import itertools,time,pdb from . accumulators import mutated_pool,cross_pool,dependency,calc_new_factor GLOBAL_ORDER_ID = 0 class GeneticCrossFactors(object): def __init__(self, del_prob, add_prob, cross_prob...
[ "numpy.random.uniform", "time.time", "numpy.hstack", "itertools.combinations", "numpy.array", "pandas.Series", "multiprocessing.Pool", "multiprocessing.cpu_count" ]
[((2086, 2124), 'itertools.combinations', 'itertools.combinations', (['cross_group', '(2)'], {}), '(cross_group, 2)\n', (2108, 2124), False, 'import itertools, time, pdb\n'), ((6805, 6816), 'time.time', 'time.time', ([], {}), '()\n', (6814, 6816), False, 'import itertools, time, pdb\n'), ((8230, 8255), 'pandas.Series',...
from __future__ import print_function, division from PyAstronomy.pyaC import pyaPermanent as pp from PyAstronomy import pyaC import os import gzip import numpy as np from PyAstronomy.pyaC import pyaErrors as PE import six class Baraffe98Tracks: """ Provide access to the evolutionary tracks of Baraffe et al. 98....
[ "numpy.logical_and", "six.iterkeys", "PyAstronomy.pyaC.pyaPermanent.pyaFS.PyAFS", "six.iteritems", "os.path.join", "numpy.unique" ]
[((849, 874), 'numpy.unique', 'np.unique', (['self.dat[:, 0]'], {}), '(self.dat[:, 0])\n', (858, 874), True, 'import numpy as np\n'), ((884, 909), 'numpy.unique', 'np.unique', (['self.dat[:, 1]'], {}), '(self.dat[:, 1])\n', (893, 909), True, 'import numpy as np\n'), ((919, 944), 'numpy.unique', 'np.unique', (['self.dat...
import numpy as np import torch import torch.nn as nn from sklearn.cluster import KMeans import wordninja import random class sequence_data_sampler(object): def __init__(self, data_sampler, seed = None): self.data_sampler = data_sampler self.batch = 0 self.len = data_sampler.num_clusters if data_sampler.seed...
[ "numpy.load", "numpy.save", "random.shuffle", "numpy.asarray", "sklearn.cluster.KMeans", "torch.cat", "numpy.argsort", "wordninja.split", "numpy.array", "random.seed" ]
[((411, 445), 'random.shuffle', 'random.shuffle', (['self.shuffle_index'], {}), '(self.shuffle_index)\n', (425, 445), False, 'import random\n'), ((469, 499), 'numpy.argsort', 'np.argsort', (['self.shuffle_index'], {}), '(self.shuffle_index)\n', (479, 499), True, 'import numpy as np\n'), ((2702, 2758), 'numpy.save', 'np...
import os import glob from PIL import Image import numpy as np import math import matplotlib.pyplot as plt import time import sys NUM_CLASS = 100 NUM_DATA_PER_CLASS = int(360 / 5) def make_probability(dim=3, var=0.1): """ Gaussian Mixture Model, Normal Distribution :param dim: :param var: :return: ...
[ "numpy.random.binomial", "matplotlib.pyplot.imshow", "numpy.asarray", "numpy.transpose", "math.floor", "numpy.random.randint", "numpy.array", "numpy.reshape", "numpy.random.normal", "matplotlib.pyplot.pause", "PIL.Image.fromarray", "os.path.join", "numpy.concatenate" ]
[((377, 403), 'numpy.random.binomial', 'np.random.binomial', (['(1)', '(0.5)'], {}), '(1, 0.5)\n', (395, 403), True, 'import numpy as np\n'), ((555, 586), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)', '(dim - 1)'], {}), '(0, 1, dim - 1)\n', (571, 586), True, 'import numpy as np\n'), ((597, 639), 'numpy.con...
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import range from future import standard_library import numpy as np import scipy.stats import matplotlib.pyplot as plt from pyts.utils import paa, s...
[ "pyts.utils.sax", "pyts.utils.dtw", "future.standard_library.install_aliases", "pyts.utils.mtf", "matplotlib.pyplot.figure", "numpy.arange", "builtins.range", "matplotlib.pyplot.axvline", "matplotlib.pyplot.imshow", "numpy.linspace", "pyts.utils.recurrence_plot", "pyts.utils.paa", "numpy.rep...
[((370, 404), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (402, 404), False, 'from future import standard_library\n'), ((921, 960), 'matplotlib.pyplot.plot', 'plt.plot', (['ts'], {'color': '"""#7f7f7f"""'}), "(ts, color='#7f7f7f', **kwargs)\n", (929, 960), True, 'imp...
import os import numpy as np import cv2 import Mask.model as modellib import Mask.visualize as visualize from Mask.meta.config.coco_config import CocoConfig np.set_printoptions(threshold=np.inf) # path of the trained model dir_path = os.path.dirname(os.path.realpath(__file__)) MODEL_DIR = dir_path + "/models/" MODEL...
[ "numpy.set_printoptions", "os.path.realpath", "Mask.model.MaskRCNN", "Mask.visualize.display_instances", "os.path.exists", "Mask.meta.config.coco_config.CocoConfig", "cv2.imread", "os.path.isfile", "cv2.resize" ]
[((159, 196), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.inf'}), '(threshold=np.inf)\n', (178, 196), True, 'import numpy as np\n'), ((586, 598), 'Mask.meta.config.coco_config.CocoConfig', 'CocoConfig', ([], {}), '()\n', (596, 598), False, 'from Mask.meta.config.coco_config import CocoConfig...
"""chrips.py: Module is used to implement edge detection tecqniues using CV2""" __author__ = "<NAME>." __copyright__ = "Copyright 2021, SuperDARN@VT" __credits__ = [] __license__ = "MIT" __version__ = "1.0." __maintainer__ = "<NAME>." __email__ = "<EMAIL>" __status__ = "Research" import os import matplotlib matplotli...
[ "cv2.GaussianBlur", "cv2.arcLength", "to_remote.get_session", "cv2.adaptiveThreshold", "numpy.around", "numpy.exp", "cv2.line", "cv2.contourArea", "numpy.zeros_like", "numpy.copy", "cv2.cvtColor", "os.path.exists", "cv2.samples.findFile", "matplotlib.pyplot.subplots", "cv2.resize", "cv...
[((311, 332), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (325, 332), False, 'import matplotlib\n'), ((449, 477), 'matplotlib.pyplot.style.context', 'plt.style.context', (['"""seaborn"""'], {}), "('seaborn')\n", (466, 477), True, 'import matplotlib.pyplot as plt\n'), ((1102, 1115), 'to_remote....
# 파넬백 광학 흐름 변환으로 영상을 만들어주는 파일 import cv2 import numpy as np cap = cv2.VideoCapture("./data/squat_wrong1.mp4") fourcc = cv2.VideoWriter_fourcc('M', 'J', 'P', 'G') out = cv2.VideoWriter('./data/optical_squat_wrong1.avi', fourcc, 20.0, (int(cap.get(3)), int(cap.get(4)))) ret, frame1 = cap.read() prvs = cv2.cvtColor(fr...
[ "numpy.zeros_like", "cv2.cartToPolar", "cv2.VideoWriter_fourcc", "cv2.cvtColor", "cv2.waitKey", "cv2.imshow", "cv2.VideoCapture", "cv2.calcOpticalFlowFarneback", "cv2.normalize", "cv2.destroyAllWindows" ]
[((68, 111), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""./data/squat_wrong1.mp4"""'], {}), "('./data/squat_wrong1.mp4')\n", (84, 111), False, 'import cv2\n'), ((122, 164), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (['"""M"""', '"""J"""', '"""P"""', '"""G"""'], {}), "('M', 'J', 'P', 'G')\n", (144, 164), Fal...
import numpy as np import csv import imageio import matplotlib.pyplot as plt class DataGenerator: ''' generate batch data for training ''' def __init__(self, data_path_corrupted, data_path_clean, data_list_file, batch_size = 4, frame_window_size=3, shuffle=False, crop=None, seed=10): ...
[ "csv.reader", "imageio.imread", "numpy.zeros", "numpy.random.RandomState", "matplotlib.pyplot.figure", "matplotlib.pyplot.pause" ]
[((6877, 6889), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (6887, 6889), True, 'import matplotlib.pyplot as plt\n'), ((627, 654), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (648, 654), True, 'import numpy as np\n'), ((4733, 4760), 'numpy.random.RandomState', 'np.ra...
# Copyright 2020 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.Tensor", "argparse.ArgumentParser", "numpy.concatenate" ]
[((905, 951), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""resnet50 example"""'}), "(description='resnet50 example')\n", (919, 951), False, 'from argparse import ArgumentParser\n'), ((2396, 2414), 'mindspore.Tensor', 'Tensor', (['batch_data'], {}), '(batch_data)\n', (2402, 2414), False, 'from m...
import numpy as np from scipy.integrate import odeint def resorte(): idm=0 fdm=50 dt=0.1 t=np.arange(idm,fdm,dt) def mmr(y,t,m,k): x,v =y dxdy=[ v ,(-k/m) * x] return dxdy m=5 k=.1 y0=[1,0] sol=odeint(mmr,y0,t,args=(m,k)) x=sol[:,0] velocidad=sol[:,...
[ "scipy.integrate.odeint", "numpy.zeros_like", "numpy.arange" ]
[((109, 132), 'numpy.arange', 'np.arange', (['idm', 'fdm', 'dt'], {}), '(idm, fdm, dt)\n', (118, 132), True, 'import numpy as np\n'), ((257, 288), 'scipy.integrate.odeint', 'odeint', (['mmr', 'y0', 't'], {'args': '(m, k)'}), '(mmr, y0, t, args=(m, k))\n', (263, 288), False, 'from scipy.integrate import odeint\n'), ((41...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import math import time import numpy as np import tensorflow as tf import svhn import svhn_readInput FLAGS = tf.app.flags.FLAGS #eval interval: tf.app.flags.DEFINE_integer('...
[ "tensorflow.gfile.Exists", "tensorflow.train.Coordinator", "numpy.sum", "tensorflow.get_collection", "tensorflow.app.flags.DEFINE_boolean", "tensorflow.app.flags.DEFINE_integer", "tensorflow.train.ExponentialMovingAverage", "tensorflow.Summary", "tensorflow.summary.FileWriter", "tensorflow.gfile.D...
[((291, 378), 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""eval_interval_secs"""', '(10)', '"""How often to run the eval."""'], {}), "('eval_interval_secs', 10,\n 'How often to run the eval.')\n", (318, 378), True, 'import tensorflow as tf\n'), ((407, 492), 'tensorflow.app.flags.DEFINE...
import numpy as np import torch from gym import Wrapper # from gym_maze.envs.maze_env import MazeEnvSample5x5 import wandb from config import config from embedding_model import compute_intrinsic_reward from memory import LocalBuffer from model import R2D2_agent57 # todo : MetaController 구현 class Maze(Wrapper): de...
[ "memory.LocalBuffer", "gym.make", "model.R2D2_agent57.get_td_error", "torch.Tensor", "numpy.random.rand", "embedding_model.compute_intrinsic_reward" ]
[((757, 773), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (771, 773), True, 'import numpy as np\n'), ((1086, 1109), 'gym.make', 'gym.make', (['"""CartPole-v1"""'], {}), "('CartPole-v1')\n", (1094, 1109), False, 'import gym\n'), ((1710, 1723), 'memory.LocalBuffer', 'LocalBuffer', ([], {}), '()\n', (1721, 17...
import numpy as np import pandas as pd # %% Vector Autoregression with Long-Run Restriction def varlr(series, p=1): """ Vector Autoregression with Long-Run Restriction (Blanchard-Quah restriction (1989)) Parameters ---------- series : DataFrame, Array (Automatically transformed to NumPy Arra...
[ "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.identity", "numpy.insert", "numpy.random.random", "numpy.linalg.inv", "numpy.column_stack", "numpy.dot", "numpy.vstack" ]
[((711, 729), 'numpy.asarray', 'np.asarray', (['series'], {}), '(series)\n', (721, 729), True, 'import numpy as np\n'), ((765, 798), 'numpy.ones', 'np.ones', (['[nobs - p, 1 + nvar * p]'], {}), '([nobs - p, 1 + nvar * p])\n', (772, 798), True, 'import numpy as np\n'), ((3833, 3870), 'numpy.column_stack', 'np.column_sta...
import unittest import numpy from scipy.spatial.distance import pdist, squareform from seriate import IncompleteSolutionError, InvalidDistanceValues, seriate class SeriateTests(unittest.TestCase): def setUp(self): self.elements = numpy.ones((5, 3)) * numpy.arange(5, 0, -1)[:, None] def test_pdist(s...
[ "unittest.main", "numpy.random.seed", "numpy.empty", "numpy.ones", "numpy.random.random", "scipy.spatial.distance.pdist", "numpy.arange", "numpy.array", "seriate.seriate" ]
[((1818, 1833), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1831, 1833), False, 'import unittest\n'), ((342, 362), 'scipy.spatial.distance.pdist', 'pdist', (['self.elements'], {}), '(self.elements)\n', (347, 362), False, 'from scipy.spatial.distance import pdist, squareform\n'), ((377, 391), 'seriate.seriate',...
from unittest import TestCase import numpy as np from numpy.testing import assert_allclose from pytest import approx from fastats.linear_algebra import lu, lu_inplace, lu_compact from fastats.core.ast_transforms.convert_to_jit import convert_to_jit lu_jit = convert_to_jit(lu) lu_compact_jit = convert_to_jit(lu_com...
[ "numpy.zeros_like", "fastats.linear_algebra.lu", "pytest.approx", "pytest.main", "fastats.linear_algebra.lu_compact", "numpy.array", "numpy.testing.assert_allclose", "fastats.core.ast_transforms.convert_to_jit.convert_to_jit", "fastats.linear_algebra.lu_inplace" ]
[((263, 281), 'fastats.core.ast_transforms.convert_to_jit.convert_to_jit', 'convert_to_jit', (['lu'], {}), '(lu)\n', (277, 281), False, 'from fastats.core.ast_transforms.convert_to_jit import convert_to_jit\n'), ((299, 325), 'fastats.core.ast_transforms.convert_to_jit.convert_to_jit', 'convert_to_jit', (['lu_compact'],...
import numpy as np import torch from PIL import Image from random import random from scipy.ndimage import geometric_transform from numpy import * from torchvision import transforms from mobius_transformation import Mobius from mobius_mask import Mobius_mask from util.cutout import Cutout #np.random.seed(0) class sup...
[ "util.cutout.Cutout", "torchvision.transforms.RandomHorizontalFlip", "mobius_mask.Mobius_mask", "mobius_transformation.Mobius", "numpy.random.randint", "random.random.randint", "torchvision.transforms.CenterCrop", "torchvision.transforms.Resize", "torchvision.transforms.RandomCrop", "torchvision.t...
[((1109, 1166), 'mobius_transformation.Mobius', 'Mobius', (['rand', 'interpolation', 'dataset', 'std', 'madmissable', 'M'], {}), '(rand, interpolation, dataset, std, madmissable, M)\n', (1115, 1166), False, 'from mobius_transformation import Mobius\n'), ((1190, 1235), 'mobius_mask.Mobius_mask', 'Mobius_mask', (['datase...
# -*- coding: utf-8 -*- """ train voc 2007 data tip: tensorboard --logdir log_frcnn\???\tensorboard @author: <NAME> @date: Fri Dec 18 04:39:21 2020 """ import os import time import random import numpy as np import matplotlib.pyplot as plt from frcnn import data from frcnn import visualize from frcnn.core import uti...
[ "frcnn.core.utils.compute_ap", "frcnn.model.log", "frcnn.model.FasterRCNN", "frcnn.dataset.voc.VocConfig", "random.choice", "frcnn.core.common.mold_image", "time.time", "frcnn.dataset.voc.VocDataset", "numpy.mean", "numpy.random.choice", "matplotlib.pyplot.subplots", "frcnn.data.load_image_gt"...
[((966, 977), 'frcnn.dataset.voc.VocConfig', 'VocConfig', ([], {}), '()\n', (975, 977), False, 'from frcnn.dataset.voc import VocConfig\n'), ((1093, 1105), 'frcnn.dataset.voc.VocDataset', 'VocDataset', ([], {}), '()\n', (1103, 1105), False, 'from frcnn.dataset.voc import VocDataset\n'), ((1214, 1226), 'frcnn.dataset.vo...
from scipy.interpolate import CubicSpline, CubicHermiteSpline import airsimneurips as airsim import cvxpy as cp import numpy as np import time gate_dimensions = [1.6, 1.6] gate_facing_vector = airsim.Vector3r(x_val=0, y_val=1, z_val=0) def rotate_vector(q, v): v_quat = v.to_Quaternionr() v_rotated_ = q * v_qu...
[ "scipy.interpolate.CubicSpline", "numpy.linalg.norm", "scipy.interpolate.CubicHermiteSpline", "numpy.zeros_like", "numpy.copy", "numpy.cumsum", "cvxpy.Constant", "numpy.linspace", "numpy.size", "numpy.cross", "numpy.isinf", "cvxpy.Variable", "numpy.dot", "cvxpy.Minimize", "numpy.outer", ...
[((194, 236), 'airsimneurips.Vector3r', 'airsim.Vector3r', ([], {'x_val': '(0)', 'y_val': '(1)', 'z_val': '(0)'}), '(x_val=0, y_val=1, z_val=0)\n', (209, 236), True, 'import airsimneurips as airsim\n'), ((348, 440), 'airsimneurips.Vector3r', 'airsim.Vector3r', ([], {'x_val': 'v_rotated_.x_val', 'y_val': 'v_rotated_.y_v...
#!/usr/bin/env python # # Copyright 2019 DFKI GmbH. # # 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, merg...
[ "scipy.ndimage.morphology.binary_erosion", "scipy.ndimage.filters.minimum_filter", "numpy.where" ]
[((2030, 2107), 'scipy.ndimage.morphology.binary_erosion', 'morphology.binary_erosion', (['background'], {'structure': 'neighborhood', 'border_value': '(1)'}), '(background, structure=neighborhood, border_value=1)\n', (2055, 2107), True, 'import scipy.ndimage.morphology as morphology\n'), ((1922, 1973), 'scipy.ndimage....
#!/usr/bin/env python3 # coding: utf-8 import os, time, sys import pandas as pd import numpy as np import networkx as nx from sklearn.metrics import roc_auc_score from sklearn.metrics import ndcg_score from sklearn.metrics import average_precision_score from collections import defaultdict from itertools import islice ...
[ "time.asctime", "numpy.random.choice", "numpy.random.seed", "pandas.read_csv", "numpy.hstack", "tensorflow.keras.models.Model", "gc.collect", "time.time", "numpy.array", "node2vec.Node2Vec", "itertools.islice", "networkx.from_pandas_edgelist", "networkx.non_edges", "numpy.unique" ]
[((755, 772), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (769, 772), True, 'import numpy as np\n'), ((1001, 1026), 'pandas.read_csv', 'pd.read_csv', (['DATASET_FILE'], {}), '(DATASET_FILE)\n', (1012, 1026), True, 'import pandas as pd\n'), ((1143, 1175), 'networkx.from_pandas_edgelist', 'nx.from_pand...
# MIT License # # Copyright (c) 2018 <NAME>, <NAME> # # 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, merg...
[ "tensorflow.Session", "qml.aglaia.aglaia.MRMP", "tensorflow.constant", "numpy.isclose", "numpy.reshape", "numpy.linspace", "numpy.testing.assert_array_almost_equal" ]
[((7264, 7280), 'qml.aglaia.aglaia.MRMP', 'MRMP', ([], {'l2_reg': '(0.1)'}), '(l2_reg=0.1)\n', (7268, 7280), False, 'from qml.aglaia.aglaia import MRMP\n'), ((7393, 7405), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (7403, 7405), True, 'import tensorflow as tf\n'), ((7467, 7503), 'numpy.isclose', 'np.isclose'...
import unittest import numpy as np from src.swarm_algorithms.particle_swarm_optimisation import ParticleSwarmOptimisation class TestParticleSwarmOptimisation(unittest.TestCase): def setUp(self): self.alg = ParticleSwarmOptimisation(100, 2, None, seed=0) self.alg.compile(lambda x: np.sum(x, axis=1...
[ "unittest.main", "numpy.testing.assert_almost_equal", "src.swarm_algorithms.particle_swarm_optimisation.ParticleSwarmOptimisation", "numpy.sum" ]
[((1303, 1318), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1316, 1318), False, 'import unittest\n'), ((221, 268), 'src.swarm_algorithms.particle_swarm_optimisation.ParticleSwarmOptimisation', 'ParticleSwarmOptimisation', (['(100)', '(2)', 'None'], {'seed': '(0)'}), '(100, 2, None, seed=0)\n', (246, 268), Fals...
""" Helper functions to convert the data to the format expected by run_robot.py """ import sys import seir import pandas as pd import numpy as np import numpy.linalg as la import os.path as path # To use PyJulia print('Loading PyJulia module...') from julia.api import Julia jl = Julia(compiled_modules=False) from jul...
[ "pandas.DataFrame", "numpy.fill_diagonal", "pandas.DataFrame.from_dict", "pandas.read_csv", "os.path.exists", "numpy.ones", "numpy.zeros", "julia.Main.eval", "julia.Main", "pandas.Series", "seir.seir", "os.path.join" ]
[((282, 311), 'julia.Main', 'Julia', ([], {'compiled_modules': '(False)'}), '(compiled_modules=False)\n', (287, 311), True, 'from julia import Main as Julia\n'), ((344, 384), 'julia.Main.eval', 'Julia.eval', (['"""ENV["OMP_NUM_THREADS"] = 8"""'], {}), '(\'ENV["OMP_NUM_THREADS"] = 8\')\n', (354, 384), True, 'from julia ...
"""Experiment result collection.""" import glob import os import json import argparse import pickle import collections import functools import numpy as onp import pandas as pd import scipy.stats import jax.scipy.stats import jax.numpy as jnp from jax import vmap, jit from sacred.experiment import Experiment # pylin...
[ "functools.partial", "tqdm.tqdm", "json.load", "jax.vmap", "argparse.ArgumentParser", "os.path.join", "numpy.sum", "numpy.abs", "distributed_cox.experiments.run.init_data_gen_fn", "distributed_cox.experiments.run.compute_results_averaged", "jax.numpy.logical_and", "json.dumps", "collections....
[((2255, 2284), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (2278, 2284), False, 'import collections\n'), ((2773, 2847), 'functools.partial', 'functools.partial', (['jax.scipy.stats.norm.cdf'], {'loc': 'beta_true', 'scale': 'std_true'}), '(jax.scipy.stats.norm.cdf, loc=beta_true, s...
import numpy as np from foolbox.models import ModelWrapper from foolbox.models import DifferentiableModelWrapper from foolbox.models import CompositeModel def test_context_manager(gl_bn_model): assert isinstance(gl_bn_model, ModelWrapper) with gl_bn_model as model: assert model is not None as...
[ "numpy.random.seed", "foolbox.models.DifferentiableModelWrapper", "numpy.random.rand", "foolbox.models.CompositeModel", "numpy.all" ]
[((769, 803), 'foolbox.models.DifferentiableModelWrapper', 'DifferentiableModelWrapper', (['model1'], {}), '(model1)\n', (795, 803), False, 'from foolbox.models import DifferentiableModelWrapper\n'), ((1585, 1622), 'foolbox.models.CompositeModel', 'CompositeModel', (['gl_bn_model', 'bn_model'], {}), '(gl_bn_model, bn_m...
import math import numpy as np import torch from torch import nn def nCr(n,r): f = math.factorial return f(n) / f(r) / f(n-r) class Poly(nn.Module): def __init__(self,*, bits_per_symbol, degree_polynomial, batch_normalize=False, **kwargs...
[ "torch.norm", "numpy.sqrt", "torch.pow", "torch.nn.Linear" ]
[((682, 743), 'torch.nn.Linear', 'nn.Linear', (['self.num_polynomial_terms', 'num_classes'], {'bias': '(False)'}), '(self.num_polynomial_terms, num_classes, bias=False)\n', (691, 743), False, 'from torch import nn\n'), ((2403, 2436), 'torch.norm', 'torch.norm', (['self.base.weight'], {'p': '(1)'}), '(self.base.weight, ...
import numpy as np import cv2 from tensorflow.keras.models import model_from_json model_json_file = 'model.json' model_weights_file = 'model_weights.h5' with open(model_json_file, "r") as json_file: loaded_model_json = json_file.read() loaded_model = model_from_json(loaded_model_json) loaded_model.l...
[ "copy.deepcopy", "cv2.putText", "numpy.argmax", "cv2.cvtColor", "cv2.waitKey", "cv2.imshow", "cv2.VideoCapture", "cv2.rectangle", "cv2.CascadeClassifier", "cv2.destroyAllWindows", "cv2.resize", "tensorflow.keras.models.model_from_json" ]
[((368, 428), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_frontalface_default.xml"""'], {}), "('haarcascade_frontalface_default.xml')\n", (389, 428), False, 'import cv2\n'), ((436, 455), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (452, 455), False, 'import cv2\n'), ((1704, 1...
# Authors: <NAME> <<EMAIL>> # # License: BSD-3-Clause import numpy as np def check_indices(indices): """Check indices parameter.""" if not isinstance(indices, tuple) or len(indices) != 2: raise ValueError('indices must be a tuple of length 2') if len(indices[0]) != len(indices[1]): raise ...
[ "numpy.tril_indices", "numpy.sum", "numpy.allclose", "numpy.asarray", "numpy.argsort", "numpy.array", "numpy.tile" ]
[((1841, 1863), 'numpy.array', 'np.array', (['connectivity'], {}), '(connectivity)\n', (1849, 1863), True, 'import numpy as np\n'), ((2137, 2178), 'numpy.allclose', 'np.allclose', (['connectivity', 'connectivity.T'], {}), '(connectivity, connectivity.T)\n', (2148, 2178), True, 'import numpy as np\n'), ((2883, 2909), 'n...
""" Tests for miscellaneous (non-magic) ``np.ndarray``/``np.generic`` methods. More extensive tests are performed for the methods' function-based counterpart in `../from_numeric.py`. """ from __future__ import annotations import operator from typing import cast, Any import numpy as np class SubClass(np.ndarray): ...
[ "numpy.empty", "numpy.array", "numpy.int32" ]
[((330, 341), 'numpy.int32', 'np.int32', (['(1)'], {}), '(1)\n', (338, 341), True, 'import numpy as np\n'), ((383, 414), 'numpy.array', 'np.array', (['[[1]]'], {'dtype': 'np.int32'}), '([[1]], dtype=np.int32)\n', (391, 414), True, 'import numpy as np\n'), ((609, 644), 'numpy.array', 'np.array', (['[0, 1, 2]'], {'dtype'...
"""Testing the elkanoto classifiers.""" import numpy as np import pytest from sklearn.datasets import make_classification from sklearn.svm import SVC from sklearn.ensemble import RandomForestClassifier from sklearn.exceptions import NotFittedError from pulearn import ( ElkanotoPuClassifier, WeightedElkanotoPu...
[ "sklearn.ensemble.RandomForestClassifier", "sklearn.datasets.make_classification", "pytest.fixture", "pytest.raises", "numpy.where", "sklearn.svm.SVC", "pytest.mark.parametrize" ]
[((337, 382), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""', 'autouse': '(True)'}), "(scope='session', autouse=True)\n", (351, 382), False, 'import pytest\n'), ((1205, 1391), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""cls_n_args"""', "[(ElkanotoPuClassifier, {'hold_out_ratio': 0.2}...
import logging import azure.functions as func import onnxruntime from PIL import Image import numpy as np import io def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') body = req.get_body() try: ...
[ "io.BytesIO", "numpy.transpose", "numpy.expand_dims", "numpy.clip", "onnxruntime.InferenceSession", "logging.info", "PIL.Image.fromarray", "numpy.array", "azure.functions.HttpResponse" ]
[((206, 271), 'logging.info', 'logging.info', (['"""Python HTTP trigger function processed a request."""'], {}), "('Python HTTP trigger function processed a request.')\n", (218, 271), False, 'import logging\n'), ((598, 623), 'azure.functions.HttpResponse', 'func.HttpResponse', (['result'], {}), '(result)\n', (615, 623)...
"""C 2021 <NAME> and <NAME> numba version of fast likelihood""" import numpy as np import numba as nb from numba import njit,prange from numba.experimental import jitclass from numba.typed import List import scipy.linalg from enterprise import constants as const from lapack_wrappers import solve_triangular ...
[ "numpy.abs", "numpy.sum", "numba.njit", "numpy.ones", "numpy.sin", "numpy.arange", "numba.prange", "numpy.copy", "numba.experimental.jitclass", "numpy.identity", "numpy.max", "numpy.arccos", "numba.types.ListType", "numpy.cos", "numpy.dot", "numpy.log", "numpy.zeros", "lapack_wrapp...
[((6076, 6111), 'numba.njit', 'njit', ([], {'fastmath': '(True)', 'parallel': '(False)'}), '(fastmath=True, parallel=False)\n', (6080, 6111), False, 'from numba import njit, prange\n'), ((6567, 6602), 'numba.njit', 'njit', ([], {'fastmath': '(True)', 'parallel': '(False)'}), '(fastmath=True, parallel=False)\n', (6571, ...
# -*- coding: utf-8 -*- """ Created on Mon May 28 13:07:24 2018 @author: ziyad """ import glob import cv2 import numpy as np from utils import * PROCESSED_SUMME = '../data/SumMe/processed/eccv16_dataset_summe_google_pool5.h5' SUMME_MAPPED_VIDEO_NAMES = '../data/SumMe/mapped_video_names.json' PROCESSED_TVSUM = '../da...
[ "numpy.save", "numpy.dtype", "cv2.VideoCapture", "glob.glob", "cv2.resize" ]
[((1565, 1606), 'glob.glob', 'glob.glob', (['"""./../data/SumMe/videos/*.mp4"""'], {}), "('./../data/SumMe/videos/*.mp4')\n", (1574, 1606), False, 'import glob\n'), ((526, 552), 'cv2.VideoCapture', 'cv2.VideoCapture', (['fileName'], {}), '(fileName)\n', (542, 552), False, 'import cv2\n'), ((2130, 2196), 'numpy.save', '...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from __future__ import print_function import json import torch import numpy as np import random import os os.environ["CUDA_VISIBLE_DEVICES"] = "1" import time import argparse from src.models.models import TAI...
[ "src.dataloaders.cmu_dataloader.MOSEI_Dataset", "numpy.random.seed", "argparse.ArgumentParser", "torch.utils.data.DataLoader", "os.makedirs", "torch.manual_seed", "torch.load", "torch.cuda.manual_seed", "os.path.exists", "src.utils.eval.get_metrics", "time.time", "torch.cat", "random.seed", ...
[((2702, 2757), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""model interfence"""'}), "(description='model interfence')\n", (2725, 2757), False, 'import argparse\n'), ((5119, 5141), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (5130, 5141), False, 'import random\n...
# Copyright 2017 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
[ "numpy.load", "tensorflow.reduce_sum", "pickle.dump", "tensorflow.clip_by_value", "tensorflow.maximum", "tensorflow.reshape", "tensorflow.logging.set_verbosity", "matplotlib.pyplot.figure", "tensorflow.GPUOptions", "os.path.join", "tensorflow.math.abs", "tensorflow.nn.softmax", "pre_process_...
[((1196, 1232), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""contextualLoss"""'], {}), "(1, 'contextualLoss')\n", (1211, 1232), False, 'import sys\n'), ((2448, 2524), 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""eval_type"""', '"""rgb"""', '"""rgb, rgb600, , flow, or joint"""'], {}), "('eval...
import numpy as np from mpl_toolkits.mplot3d import Axes3D from matplotlib import pyplot as plt import matplotlib.cm as cm def make_temp3d_dailyPlots(err): weeklyPlotsMain = np.load("outData/windT_9qty-7day-2dSpatial_profiles_9x7x73x144_.npy") titles = ['at_Surface','_250mbar','_850mbar'] basic = np.linspace(-1,62,...
[ "numpy.load", "numpy.meshgrid", "mpl_toolkits.mplot3d.Axes3D", "matplotlib.pyplot.clf", "matplotlib.pyplot.gca", "matplotlib.pyplot.close", "matplotlib.pyplot.yticks", "numpy.transpose", "matplotlib.pyplot.figure", "numpy.array", "matplotlib.pyplot.cla", "numpy.linspace", "numpy.arange", "...
[((176, 245), 'numpy.load', 'np.load', (['"""outData/windT_9qty-7day-2dSpatial_profiles_9x7x73x144_.npy"""'], {}), "('outData/windT_9qty-7day-2dSpatial_profiles_9x7x73x144_.npy')\n", (183, 245), True, 'import numpy as np\n'), ((302, 340), 'numpy.linspace', 'np.linspace', (['(-1)', '(62)', '(9)'], {'endpoint': '(False)'...
############################################################# # EECS 442: Computer Vision - W19 # ############################################################# # Authors: <NAME> & <NAME> # # Filename: __main__.py # # Description: ...
[ "matplotlib.pyplot.title", "numpy.abs", "matplotlib.pyplot.bar", "matplotlib.pyplot.quiver", "file_data.read_file", "matplotlib.pyplot.figure", "numpy.mean", "cv2.minMaxLoc", "os.path.join", "cv2.matchTemplate", "numpy.std", "matplotlib.pyplot.imshow", "matplotlib.pyplot.colorbar", "matplo...
[((842, 863), 'os.listdir', 'os.listdir', (['image_dir'], {}), '(image_dir)\n', (852, 863), False, 'import os\n'), ((3989, 4001), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3999, 4001), True, 'from matplotlib import pyplot as plt\n'), ((4021, 4070), 'numpy.zeros', 'np.zeros', (['(ref_img.shape[0], ref...
from keras.preprocessing.image import img_to_array from keras.models import load_model from keras import backend as K import tensorflow as tf import numpy as np import argparse import imutils import pickle import cv2 import os import base64 import io from PIL import Image from flask import request from flask import jso...
[ "keras.models.load_model", "io.BytesIO", "argparse.ArgumentParser", "numpy.argmax", "flask.Flask", "numpy.expand_dims", "base64.b64decode", "keras.preprocessing.image.img_to_array", "flask.jsonify", "numpy.array", "tensorflow.get_default_graph", "flask.request.get_json" ]
[((452, 467), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (457, 467), False, 'from flask import Flask\n'), ((474, 499), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (497, 499), False, 'import argparse\n'), ((1355, 1377), 'tensorflow.get_default_graph', 'tf.get_default_graph', ...
#!/usr/bin/env python3 """ Implements a TF trainer class inherited from base_train super class. @author: <NAME> @version: 1.0 """ from base.base_train import BaseTrain from tqdm import tqdm import numpy as np class ImdbTrainer(BaseTrain): def __init__(self, sess, model, data, config, logger): """ ...
[ "numpy.mean" ]
[((1442, 1457), 'numpy.mean', 'np.mean', (['losses'], {}), '(losses)\n', (1449, 1457), True, 'import numpy as np\n'), ((1472, 1485), 'numpy.mean', 'np.mean', (['accs'], {}), '(accs)\n', (1479, 1485), True, 'import numpy as np\n')]
#mod specific libraries from time import ctime from catboost import CatBoostClassifier import sklearn.metrics as metrics import pandas as pd import numpy as np class PredictiveModel(object): """ base class for the prediction task of Adoption Prediction competition this is catboost! https://www.cours...
[ "pandas.DataFrame", "time.ctime", "sklearn.model_selection.KFold", "matplotlib.pyplot.barh", "sklearn.metrics.cohen_kappa_score", "numpy.array", "catboost.CatBoostClassifier" ]
[((1638, 1661), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': 'n_folds'}), '(n_splits=n_folds)\n', (1643, 1661), False, 'from sklearn.model_selection import KFold\n'), ((3856, 3879), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': 'n_folds'}), '(n_splits=n_folds)\n', (3861, 3879), False, 'from...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "td3_agent.TD3", "c2a2_agent.C2A2", "argparse.ArgumentParser", "tensorflow.logging.info", "gym.wrappers.Monitor", "tensorflow.logging.set_verbosity", "tensorflow.contrib.training.python.training.hparam.HParams", "tensorflow.summary.merge", "os.path.join", "common.util.reverse_act", "tensorflow.p...
[((975, 1017), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.float32', 'shape': '[]'}), '(dtype=tf.float32, shape=[])\n', (989, 1017), True, 'import tensorflow as tf\n'), ((1169, 1195), 'tensorflow.summary.merge', 'tf.summary.merge', (['[reward]'], {}), '([reward])\n', (1185, 1195), True, 'import tenso...
import numpy as np from numpy import sin, cos, pi import json def tip2angle(x, y, z, x0 = -45.21, y0 = -22.97, l1 = 89.68, l2 = 113.58, l3 = 75.0, h1 = 67.66, alpha = 0.0): #see https://docs.google.com/document/d/1VgmlxTxL5Gy_7Gs2rrF7Axosbcyzhjpy9Q3a6_KBHHA/edit for detail #all angles are in rad #height of...
[ "numpy.clip", "numpy.sin", "numpy.array", "numpy.cos", "numpy.arctan", "numpy.arccos", "numpy.sqrt" ]
[((490, 516), 'numpy.sqrt', 'np.sqrt', (['(dx ** 2 + dy ** 2)'], {}), '(dx ** 2 + dy ** 2)\n', (497, 516), True, 'import numpy as np\n'), ((1019, 1046), 'numpy.clip', 'np.clip', (['result[3]', '(-45)', '(45)'], {}), '(result[3], -45, 45)\n', (1026, 1046), True, 'import numpy as np\n'), ((387, 405), 'numpy.arctan', 'np....
import numpy as np from numba import guvectorize from pygama.dsp.errors import DSPFatal @guvectorize(["void(float32[:], float32, float32[:])", "void(float64[:], float64, float64[:])"], "(n),()->(n)", nopython=True, cache=True) def moving_window_left(w_in, length, w_out): """ Apply a ...
[ "numpy.floor", "pygama.dsp.errors.DSPFatal", "numba.guvectorize", "numpy.isnan" ]
[((90, 235), 'numba.guvectorize', 'guvectorize', (["['void(float32[:], float32, float32[:])',\n 'void(float64[:], float64, float64[:])']", '"""(n),()->(n)"""'], {'nopython': '(True)', 'cache': '(True)'}), "(['void(float32[:], float32, float32[:])',\n 'void(float64[:], float64, float64[:])'], '(n),()->(n)', nopyth...
#!/usr/bin/env python '''====================================================== Created by: <NAME> Last updated: January 2015 File name: Ishmaalsplots.py Organization: RISC Lab, Utah State University ======================================================''' import roslib; roslib.load_manifest('a...
[ "matplotlib.pyplot.show", "rospy.Subscriber", "numpy.zeros", "rospy.Rate", "IshyPlots.pl3d", "numpy.append", "rospy.is_shutdown", "rospy.loginfo", "numpy.array", "rospy.init_node", "rospy.get_time", "roslib.load_manifest" ]
[((297, 338), 'roslib.load_manifest', 'roslib.load_manifest', (['"""ardrone_tutorials"""'], {}), "('ardrone_tutorials')\n", (317, 338), False, 'import roslib\n'), ((339, 372), 'roslib.load_manifest', 'roslib.load_manifest', (['"""risc_msgs"""'], {}), "('risc_msgs')\n", (359, 372), False, 'import roslib\n'), ((1177, 119...
#!/usr/bin/env python """ lambdata - a collection of Data Science helper functions """ import pandas as pd import numpy as np from . import example_module #module TEST = pd.DataFrame(np.ones(10)) Y = example_module.increment(example_module.x) setup = pd.options.display.max_columns = 999 #functions def check_null(X)...
[ "numpy.ones" ]
[((186, 197), 'numpy.ones', 'np.ones', (['(10)'], {}), '(10)\n', (193, 197), True, 'import numpy as np\n')]
#!/usr/bin/env python3 import cv2 import numpy as np def core(img, N, out, r_start, r_out, c_in, c_out, scale): in_rows, in_cols = img.shape[:2] if c_in is None: c_in = (dim // 2 for dim in (in_rows, in_cols)) c_y, c_x = c_in r_start %= 2 * np.pi width = np.pi / N r_end = r_start + wi...
[ "cv2.circle", "numpy.arctan2", "argparse.ArgumentParser", "cv2.waitKey", "cv2.destroyAllWindows", "numpy.empty", "cv2.imread", "numpy.sin", "numpy.arange", "numpy.cos", "cv2.imshow", "numpy.sqrt" ]
[((2299, 2346), 'cv2.circle', 'cv2.circle', (['img', '(c_x, c_y)', '(10)', '(0, 0, 255)', '(2)'], {}), '(img, (c_x, c_y), 10, (0, 0, 255), 2)\n', (2309, 2346), False, 'import cv2\n'), ((4061, 4077), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (4075, 4077), False, 'from argparse import ArgumentParser\...
import numpy as np import csv import system import input.inputgenerator import metropolis import neighbourlist import lennardjones import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import time import pbc ############################################################################################...
[ "system.Box", "csv.reader", "matplotlib.pyplot.show", "numpy.asarray", "numpy.zeros", "numpy.ones", "matplotlib.pyplot.figure", "numpy.linalg.norm", "numpy.inner", "pbc.enforce_pbc" ]
[((1912, 1972), 'csv.reader', 'csv.reader', (['fid'], {'delimiter': '""","""', 'quoting': 'csv.QUOTE_NONNUMERIC'}), "(fid, delimiter=',', quoting=csv.QUOTE_NONNUMERIC)\n", (1922, 1972), False, 'import csv\n'), ((2642, 2711), 'system.Box', 'system.Box', ([], {'dimension': 'dim', 'size': 'boxsize', 'particles': 'particle...
# coding=utf-8 # Copyright (c) DIRECT Contributors import argparse import pathlib import h5py import numpy as np from tqdm import tqdm def extract_mask(filename): """Extract the mask from masked k-space data, these are not explicitly given. Parameters ---------- filename : pathlib.Path Returns ...
[ "tqdm.tqdm", "numpy.save", "numpy.abs", "argparse.ArgumentParser", "h5py.File" ]
[((683, 708), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (706, 708), False, 'import argparse\n'), ((1182, 1201), 'tqdm.tqdm', 'tqdm', (['testing_files'], {}), '(testing_files)\n', (1186, 1201), False, 'from tqdm import tqdm\n'), ((364, 388), 'h5py.File', 'h5py.File', (['filename', '"""r"""'...
import numpy as np import random import time import copy, math from collections import namedtuple, deque from utils import distr_projection, RewardTracker, TBMeanTracker import torch import torch.nn.functional as F import torch.optim as optim import threading # use tensorboard to monitor progress from d4pg_agent imp...
[ "numpy.zeros", "time.time", "numpy.any", "numpy.mean", "utils.RewardTracker", "unityagents.UnityEnvironment", "ddpg_agent.Agent" ]
[((513, 591), 'unityagents.UnityEnvironment', 'UnityEnvironment', ([], {'file_name': '"""p2_continuous-control/Reacher_Windows_20/Reacher"""'}), "(file_name='p2_continuous-control/Reacher_Windows_20/Reacher')\n", (529, 591), False, 'from unityagents import UnityEnvironment\n'), ((1385, 1430), 'ddpg_agent.Agent', 'Agent...
""" Script used to generate panel a of Figure 3, illustrating pairwise invasiblity plots for the adaptive dynamics under the Cobb-Douglas utility function. """ import matplotlib.pyplot as plt import matplotlib as mpl mpl.rcParams['text.usetex']=True import numpy as np from matplotlib.widgets import Slider from scipy.o...
[ "matplotlib.rc", "numpy.maximum", "numpy.abs", "matplotlib.widgets.Slider", "numpy.ones", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.tight_layout", "matplotlib.colors.ListedColormap", "numpy.meshgrid", "numpy.power", "scipy.optimize.fsolve", "numpy.linspa...
[((369, 436), 'matplotlib.rc', 'rc', (['"""font"""'], {}), "('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']})\n", (371, 436), False, 'from matplotlib import rc\n'), ((530, 553), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (532, 553), False, 'from matplotlib ...
# coding: utf-8 '''Classify IRS spectra. Create a widget that allows selection of some buttons to classify IRS spectra. A fair amount of by-hand fiddling below depending on what is being done. ''' import glob import os import shutil import pickle import json import numpy as np from scipy import optimize from sklear...
[ "numpy.sum", "matplotlib.pyplot.axes", "astroquery.simbad.Simbad", "scipy.optimize.leastsq", "matplotlib.pyplot.figure", "numpy.mean", "glob.glob", "shutil.copy", "matplotlib.widgets.CheckButtons", "matplotlib.pyplot.close", "os.path.exists", "json.dump", "matplotlib.pyplot.show", "os.path...
[((4501, 4558), 'glob.glob', 'glob.glob', (["(cfg.spectra + 'training/*fits')"], {'recursive': '(True)'}), "(cfg.spectra + 'training/*fits', recursive=True)\n", (4510, 4558), False, 'import glob\n'), ((4704, 4987), 'numpy.array', 'np.array', (["['class I', 'class II', 'transition', 'debris', 'star', 'be star',\n 'am...
import numpy as np import matplotlib.pyplot as plt from pandas._libs.tslibs import Timedelta plt.style.use("bmh") import pandas as pd import datetime """ Plots the loss and accuracy for the training and testing data """ def visualize_training_results(results): history = results.history plt.figure(figsize=(16,...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "datetime.datetime.strptime", "datetime.timedelta", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.sqrt" ]
[((93, 113), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""bmh"""'], {}), "('bmh')\n", (106, 113), True, 'import matplotlib.pyplot as plt\n'), ((297, 324), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(16, 5)'}), '(figsize=(16, 5))\n', (307, 324), True, 'import matplotlib.pyplot as plt\n'), ((328...