code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# Audio processing tools # # <NAME> 2020 # # Some code modified from original MATLAB rastamat package. # import numpy as np from scipy.signal import hanning, spectrogram, resample, hilbert, butter, filtfilt from scipy.io import wavfile # import spectools # from .fbtools import fft2melmx from matplotlib import pyplot...
[ "parselmouth.Sound", "numpy.sqrt", "scipy.signal.filtfilt", "numpy.log", "scipy.signal.hanning", "numpy.arange", "numpy.atleast_2d", "numpy.dot", "numpy.concatenate", "numpy.min", "numpy.round", "numpy.abs", "numpy.floor", "scipy.io.wavfile.read", "numpy.int", "scipy.signal.butter", ...
[((969, 987), 'parselmouth.Sound', 'pm.Sound', (['fileName'], {}), '(fileName)\n', (977, 987), True, 'import parselmouth as pm\n'), ((2381, 2405), 'numpy.zeros', 'np.zeros', (['(nfilts, nfft)'], {}), '((nfilts, nfft))\n', (2389, 2405), True, 'import numpy as np\n'), ((2723, 2760), 'numpy.round', 'np.round', (['(binfrqs...
import argparse import gym import numpy as np import os import torch import BCQ import BEAR import utils def train_PQL_BEAR(state_dim, action_dim, max_action, device, args): print("Training BEARState\n") log_name = f"{args.dataset}_{args.seed}" # Initialize policy policy = BEAR.BEAR(2, state_dim, acti...
[ "torch.manual_seed", "os.path.exists", "argparse.ArgumentParser", "os.makedirs", "utils.ReplayBuffer", "numpy.array", "torch.cuda.is_available", "BEAR.BEAR", "numpy.random.seed", "BCQ.PQL_BCQ", "numpy.percentile", "gym.make", "numpy.save" ]
[((292, 928), 'BEAR.BEAR', 'BEAR.BEAR', (['(2)', 'state_dim', 'action_dim', 'max_action'], {'delta_conf': '(0.1)', 'use_bootstrap': '(False)', 'version': 'args.version', 'lambda_': '(0.0)', 'threshold': '(0.05)', 'mode': 'args.mode', 'num_samples_match': 'args.num_samples_match', 'mmd_sigma': 'args.mmd_sigma', 'lagrang...
from numpy import sin, pi, cos from objects.CSCG._3d.exact_solutions.status.Stokes.base import Stokes_Base # noinspection PyAbstractClass class Stokes_SinCos1(Stokes_Base): """ The sin cos test case 1. """ def __init__(self, es): super(Stokes_SinCos1, self).__init__(es) self._es_.sta...
[ "numpy.sin", "numpy.cos" ]
[((573, 588), 'numpy.sin', 'sin', (['(2 * pi * z)'], {}), '(2 * pi * z)\n', (576, 588), False, 'from numpy import sin, pi, cos\n'), ((659, 674), 'numpy.sin', 'sin', (['(2 * pi * z)'], {}), '(2 * pi * z)\n', (662, 674), False, 'from numpy import sin, pi, cos\n'), ((743, 758), 'numpy.sin', 'sin', (['(2 * pi * z)'], {}), ...
#!/usr/bin/python """ Test that pairwise deletion mask (intersection) returns expected values """ from __future__ import print_function from __future__ import division from builtins import zip from builtins import range from past.utils import old_div from pybraincompare.mr.datasets import get_pair_images, get_data_dir...
[ "pybraincompare.mr.datasets.get_data_directory", "numpy.testing.assert_equal", "numpy.unique", "nibabel.load", "numpy.where", "numpy.floor", "past.utils.old_div", "builtins.zip", "numpy.zeros", "pybraincompare.compare.mrutils.make_binary_deletion_vector", "builtins.range", "numpy.isnan", "py...
[((864, 884), 'pybraincompare.mr.datasets.get_data_directory', 'get_data_directory', ([], {}), '()\n', (882, 884), False, 'from pybraincompare.mr.datasets import get_data_directory\n'), ((966, 988), 'nibabel.load', 'nibabel.load', (['standard'], {}), '(standard)\n', (978, 988), False, 'import nibabel\n'), ((3557, 3592)...
import numpy as np from math import ceil from scipy.stats import norm from TaPR import compute_precision_recall from data_loader import _count_anomaly_segments n_thresholds = 1000 def _simulate_thresholds(rec_errors, n, verbose): # maximum value of the anomaly score for all time steps in the test data thres...
[ "numpy.mean", "numpy.abs", "data_loader._count_anomaly_segments", "math.ceil", "numpy.max", "numpy.square", "scipy.stats.norm.fit", "numpy.array", "TaPR.compute_precision_recall", "numpy.min", "numpy.ravel" ]
[((401, 419), 'numpy.min', 'np.min', (['rec_errors'], {}), '(rec_errors)\n', (407, 419), True, 'import numpy as np\n'), ((2459, 2498), 'data_loader._count_anomaly_segments', '_count_anomaly_segments', (['pred_anomalies'], {}), '(pred_anomalies)\n', (2482, 2498), False, 'from data_loader import _count_anomaly_segments\n...
# import gym # env = gym.make('FrozenLake8x8-v0') # env.reset() # for _ in range(10): # env.render() # env.step(env.action_space.sample()) # take a random action # env.close() # from gym import envs # import gym # frozen = gym.make('FrozenLake8x8-v0') # numEpisodes = 10 # for episode in range(numEpisodes...
[ "numpy.mean", "matplotlib.pyplot.plot", "gym.make", "tqdm.trange", "matplotlib.pyplot.show" ]
[((898, 926), 'gym.make', 'gym.make', (['"""FrozenLake8x8-v0"""'], {}), "('FrozenLake8x8-v0')\n", (906, 926), False, 'import gym\n'), ((937, 951), 'tqdm.trange', 'trange', (['ngames'], {}), '(ngames)\n', (943, 951), False, 'from tqdm import trange\n'), ((1269, 1289), 'matplotlib.pyplot.plot', 'plt.plot', (['percentage'...
# --- built in --- import os import sys import time import math import logging import functools # --- 3rd party --- import numpy as np import tensorflow as tf # --- my module --- __all__ = [ 'ToyMLP', 'Energy', 'Trainer', ] # --- primitives --- class ToyMLP(tf.keras.Model): def __init__( se...
[ "numpy.sqrt", "logging.debug", "tensorflow.GradientTape", "tensorflow.keras.layers.Dense", "logging.info", "tensorflow.math.sign", "tensorflow.random.normal", "numpy.mean", "tensorflow.keras.Sequential", "tensorflow.math.reduce_mean", "tensorflow.convert_to_tensor", "tensorflow.repeat", "ten...
[((1432, 1459), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', (['layers'], {}), '(layers)\n', (1451, 1459), True, 'import tensorflow as tf\n'), ((1507, 1553), 'tensorflow.keras.Input', 'tf.keras.Input', (['(input_dim,)'], {'dtype': 'tf.float32'}), '((input_dim,), dtype=tf.float32)\n', (1521, 1553), True, 'impor...
""" Test `sinethesizer.effects.stereo` module. Author: <NAME> """ import numpy as np import pytest from sinethesizer.effects.stereo import apply_haas_effect, apply_panning from sinethesizer.synth.core import Event @pytest.mark.parametrize( "sound, event, location, max_channel_delay, expected", [ (...
[ "numpy.testing.assert_equal", "sinethesizer.effects.stereo.apply_haas_effect", "sinethesizer.effects.stereo.apply_panning", "numpy.testing.assert_almost_equal", "numpy.array", "sinethesizer.synth.core.Event" ]
[((1812, 1872), 'sinethesizer.effects.stereo.apply_haas_effect', 'apply_haas_effect', (['sound', 'event', 'location', 'max_channel_delay'], {}), '(sound, event, location, max_channel_delay)\n', (1829, 1872), False, 'from sinethesizer.effects.stereo import apply_haas_effect, apply_panning\n'), ((1877, 1918), 'numpy.test...
import enum from typing import Any, Optional, Union, cast import numpy as np import scipy.special import sklearn.metrics as skm from . import util from .util import TaskType class PredictionType(enum.Enum): LOGITS = 'logits' PROBS = 'probs' def calculate_rmse( y_true: np.ndarray, y_pred: np.ndarray, s...
[ "sklearn.metrics.classification_report", "sklearn.metrics.roc_auc_score", "numpy.round", "sklearn.metrics.mean_squared_error" ]
[((363, 401), 'sklearn.metrics.mean_squared_error', 'skm.mean_squared_error', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (385, 401), True, 'import sklearn.metrics as skm\n'), ((1165, 1180), 'numpy.round', 'np.round', (['probs'], {}), '(probs)\n', (1173, 1180), True, 'import numpy as np\n'), ((2053, 2112), 'sklea...
import matplotlib.pyplot as plt import numpy as np from matplotlib import cm from matplotlib import colors from matplotlib import patches import os.path as path from Synthesis.units import * from tqdm import tqdm from scipy.integrate import quad def Power_Law(x, a, b): return a * np.power(x, b) def scatter_parame...
[ "numpy.log10", "numpy.column_stack", "numpy.array", "matplotlib.colors.LogNorm", "matplotlib.pyplot.style.use", "numpy.max", "matplotlib.pyplot.close", "numpy.linspace", "matplotlib.cm.ScalarMappable", "numpy.min", "numpy.abs", "matplotlib.patches.Patch", "matplotlib.colors.Normalize", "ma...
[((758, 806), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'figure.autolayout': True}"], {}), "({'figure.autolayout': True})\n", (777, 806), True, 'import matplotlib.pyplot as plt\n'), ((811, 841), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-paper"""'], {}), "('seaborn-paper')\n", (...
from .vec3 import vec3 from .geometry import isnear import numpy as np class quat: def __repr__(self): return f'quat({self.w:.4f}, {self.x:.4f}, {self.y:.4f}, {self.z:.4f})' def __init__(self, w, x, y, z): self.w = w self.x = x self.y = y self.z = z @classmethod ...
[ "numpy.sin", "numpy.cos" ]
[((471, 486), 'numpy.cos', 'np.cos', (['(a / 2.0)'], {}), '(a / 2.0)\n', (477, 486), True, 'import numpy as np\n'), ((425, 440), 'numpy.sin', 'np.sin', (['(a / 2.0)'], {}), '(a / 2.0)\n', (431, 440), True, 'import numpy as np\n')]
import threading import time import numpy as np from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds import pandas as pd import tkinter as tk from tkinter import filedialog from queue import Queue from threading import Thread import streamlit as st from streamlit.scriptrunner import add_script_run...
[ "brainflow.board_shim.BoardShim", "pandas.DataFrame", "brainflow.board_shim.BrainFlowInputParams", "pandas.read_csv", "numpy.floor", "time.sleep", "streamlit.title", "numpy.append", "streamlit.text", "tkinter.Tk", "streamlit.container", "threading.Thread", "queue.Queue", "streamlit.empty",...
[((3451, 3465), 'streamlit.container', 'st.container', ([], {}), '()\n', (3463, 3465), True, 'import streamlit as st\n'), ((3480, 3494), 'streamlit.container', 'st.container', ([], {}), '()\n', (3492, 3494), True, 'import streamlit as st\n'), ((3510, 3524), 'streamlit.container', 'st.container', ([], {}), '()\n', (3522...
#!/usr/bin/env python from __future__ import print_function from soma import aims import numpy as np import glob import os import json def get_scale(img, divisions=21, x_shift=-5): y = [img.getSize()[1] * ((float(i) + 0.5) / divisions) for i in range(divisions)] x = x_shift if x < 0: x ...
[ "os.path.exists", "soma.aims.write", "numpy.sqrt", "soma.aims.Converter_Volume_RGB_Volume_HSV", "numpy.asarray", "soma.aims.Converter_Volume_FLOAT_Volume_U16", "numpy.sum", "os.mkdir", "soma.aims.read", "numpy.argmin", "glob.glob" ]
[((3336, 3367), 'glob.glob', 'glob.glob', (['"""altitude/raw/*.jpg"""'], {}), "('altitude/raw/*.jpg')\n", (3345, 3367), False, 'import glob\n'), ((3376, 3409), 'os.path.exists', 'os.path.exists', (['"""altitude/intens"""'], {}), "('altitude/intens')\n", (3390, 3409), False, 'import os\n'), ((3415, 3442), 'os.mkdir', 'o...
from __future__ import absolute_import, division import logging import time from builtins import int import numpy as np from future.utils import raise_with_traceback from scipy.stats import ks_2samp from sklearn.metrics import silhouette_score from .mediods import k_medoids from .tfidf import get_n_top_keywords from...
[ "numpy.average", "numpy.zeros", "numpy.apply_along_axis", "numpy.linalg.norm", "numpy.argmin", "builtins.int", "sklearn.metrics.silhouette_score", "time.time", "logging.error" ]
[((1002, 1049), 'numpy.zeros', 'np.zeros', (['(chunks_num, similarites_vector_size)'], {}), '((chunks_num, similarites_vector_size))\n', (1010, 1049), True, 'import numpy as np\n'), ((1744, 1815), 'numpy.apply_along_axis', 'np.apply_along_axis', (['ks_2samp', '(1)', 'second_mat[j - T + 1:j]', 'first_mat[i]'], {}), '(ks...
# encoding: utf-8 # butterfly.py # TODO fix documentation import numpy as np from math import sqrt from numba import jit from scipy.linalg import block_diag from scipy.stats import chi from .basics import get_D, radius, rnsimp NQ = 3 @jit(nopython=True) def butterfly_generating_vector(n): ''' Generates...
[ "numpy.prod", "numpy.sqrt", "numpy.random.rand", "math.sqrt", "numpy.array", "numpy.arctan2", "numpy.einsum", "numpy.sin", "numpy.arange", "numpy.repeat", "numpy.empty", "numpy.vstack", "numpy.concatenate", "numpy.diagflat", "numpy.ceil", "numpy.eye", "numpy.fill_diagonal", "numba....
[((244, 262), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (247, 262), False, 'from numba import jit\n'), ((1468, 1486), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (1471, 1486), False, 'from numba import jit\n'), ((1980, 1998), 'numba.jit', 'jit', ([], {'nopython': ...
# -*- coding: utf-8 -*- """ Created on Tue Jun 1 23:29:40 2021 @author: <NAME> Converted from Yi Jiang's 'postProcess.m'' """ import numpy as np from skimage.transform import rotate, rescale def sind(x): return np.sin(x * np.pi / 180) def cosd(x): return np.cos(x * np.pi / 180) def removePhaseRamp(input, d...
[ "numpy.ceil", "skimage.transform.rotate", "numpy.size", "numpy.floor", "numpy.angle", "numpy.exp", "numpy.array", "numpy.cos", "numpy.linalg.lstsq", "numpy.sin", "numpy.meshgrid", "skimage.transform.rescale" ]
[((218, 241), 'numpy.sin', 'np.sin', (['(x * np.pi / 180)'], {}), '(x * np.pi / 180)\n', (224, 241), True, 'import numpy as np\n'), ((267, 290), 'numpy.cos', 'np.cos', (['(x * np.pi / 180)'], {}), '(x * np.pi / 180)\n', (273, 290), True, 'import numpy as np\n'), ((496, 513), 'numpy.meshgrid', 'np.meshgrid', (['x', 'y']...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `fpipy.raw` module.""" import numpy as np import xarray as xr import xarray.testing as xrt import fpipy.raw as fpr import fpipy.conventions as c from fpipy.raw import BayerPattern def test_read_calibration_format(calib_seq): assert type(calib_seq) is x...
[ "fpipy.raw.BayerPattern.get", "numpy.ones", "fpipy.raw.subtract_dark", "numpy.isnan", "fpipy.raw.raw_to_radiance", "numpy.all", "numpy.bincount", "xarray.testing.assert_equal", "fpipy.raw.radiance_to_reflectance" ]
[((2619, 2659), 'numpy.bincount', 'np.bincount', (['rad_computed[c.image_index]'], {}), '(rad_computed[c.image_index])\n', (2630, 2659), True, 'import numpy as np\n'), ((3046, 3072), 'numpy.all', 'np.all', (['(expected == actual)'], {}), '(expected == actual)\n', (3052, 3072), True, 'import numpy as np\n'), ((3510, 354...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 25 11:41:02 2021 @author: ike """ import numpy as np import pandas as pd from ..utils.csvreader import CSVReader from ..utils.csvcolumns import STIM voltage=2.437588 def count_frames( filename, threshold=1, volCol="AIN4", fCol="frames...
[ "numpy.mean", "numpy.ones", "numpy.diff", "numpy.max", "numpy.round" ]
[((3491, 3502), 'numpy.max', 'np.max', (['rel'], {}), '(rel)\n', (3497, 3502), True, 'import numpy as np\n'), ((5390, 5417), 'numpy.mean', 'np.mean', (['(dfs[1:] - dfs[:-1])'], {}), '(dfs[1:] - dfs[:-1])\n', (5397, 5417), True, 'import numpy as np\n'), ((2217, 2253), 'numpy.round', 'np.round', (['(max_t_step / time_int...
# -*- coding: utf-8 -*- import cv2 import os import dlib from scipy import misc import numpy as np from PIL import Image def getBound(img, shape): xMin = len(img[0]) xMax = 0 yMin = len(img) yMax = 0 for i in range(shape.num_parts): if (shape.part(i).x < xMin): x...
[ "numpy.uint8", "os.path.exists", "os.listdir", "numpy.reshape", "PIL.Image.new", "scipy.misc.imsave", "os.path.join", "dlib.shape_predictor", "dlib.get_frontal_face_detector", "numpy.zeros", "os.mkdir", "cv2.resize", "cv2.imread" ]
[((648, 700), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(imga.shape[0] * 2, imga.shape[1])'], {}), "('RGB', (imga.shape[0] * 2, imga.shape[1]))\n", (657, 700), False, 'from PIL import Image\n'), ((1337, 1370), 'dlib.shape_predictor', 'dlib.shape_predictor', (['shape_model'], {}), '(shape_model)\n', (1357, 1370), Fa...
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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 applica...
[ "numpy.array", "paddle.nn.CrossEntropyLoss" ]
[((1505, 1533), 'paddle.nn.CrossEntropyLoss', 'paddle.nn.CrossEntropyLoss', ([], {}), '()\n', (1531, 1533), False, 'import paddle\n'), ((4704, 4738), 'numpy.array', 'np.array', (['data[key]'], {'dtype': '"""int64"""'}), "(data[key], dtype='int64')\n", (4712, 4738), True, 'import numpy as np\n')]
''' This contains a number of methods and functions to calculate the iRep metric https://github.com/christophertbrown/iRep https://www.nature.com/articles/nbt.3704 ''' import os import sys import glob import scipy import lmfit import scipy.signal import numpy as np import pandas as pd import seaborn as sns from Bio...
[ "numpy.mean", "numpy.median", "numpy.ones", "numpy.average", "pandas.merge", "numpy.asarray", "scipy.signal.fftconvolve", "numpy.var", "collections.defaultdict", "pandas.DataFrame", "numpy.log2", "lmfit.Parameters", "lmfit.minimize" ]
[((1130, 1143), 'numpy.mean', 'np.mean', (['rcov'], {}), '(rcov)\n', (1137, 1143), True, 'import numpy as np\n'), ((3977, 3992), 'numpy.ones', 'np.ones', (['window'], {}), '(window)\n', (3984, 3992), True, 'import numpy as np\n'), ((4005, 4022), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (401...
import numpy as np import torch.optim as optim import networks.networks as net from networks.gtsrb import * from networks.svhn import * import torchvision as tv from torchvision import transforms from torch.utils.data import DataLoader from data.idadataloader import DoubleDataset from config import get_transform from d...
[ "config.get_transform", "argparse.ArgumentParser", "torchvision.transforms.Grayscale", "numpy.exp", "torchvision.datasets.SVHN", "networks.networks.parameters", "torch.utils.data.DataLoader", "data.idadataloader.DoubleDataset", "torchvision.transforms.Compose" ]
[((372, 429), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Sanity Checks Only"""'}), "(description='Sanity Checks Only')\n", (395, 429), False, 'import argparse\n'), ((6591, 6612), 'config.get_transform', 'get_transform', (['"""svhn"""'], {}), "('svhn')\n", (6604, 6612), False, 'from c...
"""Inversion Tools This file contains the classes that compute least squares inversions using data stored in DesignMatrix and DataArray objects. This file can also be imported as a module and contains the following classes: * Inversion """ import numpy as np from typing import Union from scipy.linalg import lst...
[ "numpy.isin", "numpy.zeros", "scipy.sparse.coo_matrix", "threadpoolctl.threadpool_limits", "scipy.sparse.vstack" ]
[((3718, 3735), 'scipy.sparse.coo_matrix', 'coo_matrix', (['gamma'], {}), '(gamma)\n', (3728, 3735), False, 'from scipy.sparse import coo_matrix, vstack, hstack\n'), ((3817, 3835), 'scipy.sparse.vstack', 'vstack', (['(g, gamma)'], {}), '((g, gamma))\n', (3823, 3835), False, 'from scipy.sparse import coo_matrix, vstack,...
#!/usr/bin/python3.6 import argparse import multiprocessing import os import sys from typing import List from functools import partial import numpy as np from tqdm import tqdm def read_confidences(s: str) -> List[float]: return list(map(float, s.split()[7::6])) def trim_line(threshold: float, s: str) -> str:...
[ "os.path.exists", "argparse.ArgumentParser", "numpy.partition", "functools.partial", "multiprocessing.Pool", "sys.exit" ]
[((617, 642), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (640, 642), False, 'import argparse\n'), ((1165, 1187), 'multiprocessing.Pool', 'multiprocessing.Pool', ([], {}), '()\n', (1185, 1187), False, 'import multiprocessing\n'), ((1036, 1063), 'os.path.exists', 'os.path.exists', (['args.res...
''' Assign stellar mass/magnitude to subhalos via abundance matching. Masses in log {M_sun}, luminosities in log {L_sun / h^2}, distances in {Mpc comoving}. ''' # system ----- #from __future__ import division import numpy as np from numpy import log10, Inf from scipy import integrate, interpolate, ndimage # local ---...
[ "numpy.log10", "numpy.log", "numpy.argsort", "numpy.array", "utilities.utility.math.deconvolute", "numpy.arange", "utilities.utility.bin.idigitize", "numpy.exp", "scipy.interpolate.splev", "numpy.min", "utilities.utility.array.elements", "scipy.integrate.quad", "scipy.ndimage.filters.gaussia...
[((1353, 1375), 'utilities.utility.array.arrayize', 'ut.array.arrayize', (['zis'], {}), '(zis)\n', (1370, 1375), True, 'from utilities import utility as ut\n'), ((28456, 28497), 'utilities.utility.bin.idigitize', 'ut.bin.idigitize', (['sub[zi][m_kind]', 'm_bins'], {}), '(sub[zi][m_kind], m_bins)\n', (28472, 28497), Tru...
""" Morphology operations on multi-label ANTsImage types """ __all__ = ['multi_label_morphology'] import numpy as np def multi_label_morphology(image, operation, radius, dilation_mask=None, label_list=None, force=False): """ Morphology on multi label images. Wraps calls to iMath binary morphology. A...
[ "numpy.unique" ]
[((2317, 2344), 'numpy.unique', 'np.unique', (['image[image > 0]'], {}), '(image[image > 0])\n', (2326, 2344), True, 'import numpy as np\n')]
import numpy as np from conftest import EPS from testutils import ( CLUSTER_LABEL_FIRST_CLUSTER, CLUSTER_LABEL_NOISE, assert_cluster_labels, assert_label_of_object_is_among_possible_ones, assert_two_objects_are_in_same_cluster, insert_objects_then_assert_cluster_labels, reflect_horizontally...
[ "testutils.assert_label_of_object_is_among_possible_ones", "testutils.assert_cluster_labels", "numpy.array", "numpy.vstack", "testutils.assert_two_objects_are_in_same_cluster", "testutils.insert_objects_then_assert_cluster_labels", "testutils.reflect_horizontally" ]
[((445, 516), 'testutils.assert_cluster_labels', 'assert_cluster_labels', (['incdbscan4', 'object_far_away', 'CLUSTER_LABEL_NOISE'], {}), '(incdbscan4, object_far_away, CLUSTER_LABEL_NOISE)\n', (466, 516), False, 'from testutils import CLUSTER_LABEL_FIRST_CLUSTER, CLUSTER_LABEL_NOISE, assert_cluster_labels, assert_labe...
import socket import cv2 import numpy import os import win32serviceutil import win32service import win32event import servicemanager import socket from datetime import datetime, date, time class AppServerSvc (win32serviceutil.ServiceFramework): _svc_name_ = "TestService" _svc_display_name_ = "Tes...
[ "cv2.imencode", "socket.socket", "os.environ.get", "win32serviceutil.HandleCommandLine", "servicemanager.LogMsg", "numpy.array", "win32serviceutil.ServiceFramework.__init__", "cv2.VideoCapture", "win32event.SetEvent", "socket.gethostname", "win32event.CreateEvent", "socket.setdefaulttimeout" ]
[((1049, 1075), 'os.environ.get', 'os.environ.get', (['"""USERNAME"""'], {}), "('USERNAME')\n", (1063, 1075), False, 'import os\n'), ((1088, 1108), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (1106, 1108), False, 'import socket\n'), ((1281, 1296), 'socket.socket', 'socket.socket', ([], {}), '()\n', (1...
import tensorflow as tf import numpy as np import os import sys import time import cv2 from collections import defaultdict from io import StringIO from matplotlib import pyplot as plt from PIL import Image # Helper code def load_image_into_numpy_array(image): (im_width, im_height) = image.size return np.array(ima...
[ "tensorflow.Graph", "cv2.imencode", "tensorflow.Session", "time.time", "os.path.join", "tensorflow.GraphDef", "numpy.squeeze", "cv2.putText", "numpy.array", "numpy.append", "cv2.VideoCapture", "object_detection.utils.label_map_util.convert_label_map_to_categories", "tensorflow.import_graph_d...
[((723, 746), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video'], {}), '(video)\n', (739, 746), False, 'import cv2\n'), ((830, 851), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (845, 851), False, 'import sys\n'), ((1422, 1485), 'os.path.join', 'os.path.join', (['"""object_detection/data"""', '...
import flask import numpy as np import os import requests import sys from cv2 import cv2 as cv from socket import AF_INET, SOCK_DGRAM, INADDR_ANY, IPPROTO_IP, IP_ADD_MEMBERSHIP, SOL_SOCKET, SO_REUSEADDR, socket, inet_aton, error as socket_error import struct from threading import Thread import imagehash from PIL import...
[ "sys.stdout.flush", "numpy.frombuffer", "cv2.cv2.threshold", "PIL.Image.open", "socket.socket", "flask.Flask", "requests.get", "os.path.isfile", "cv2.cv2.imdecode", "flask.send_file", "socket.inet_aton", "sys.exit", "cv2.cv2.Canny", "threading.Thread", "cv2.cv2.cvtColor", "cv2.cv2.imwr...
[((858, 879), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (869, 879), False, 'import flask\n'), ((6565, 6588), 'threading.Thread', 'Thread', ([], {'target': 'serv.run'}), '(target=serv.run)\n', (6571, 6588), False, 'from threading import Thread\n'), ((6723, 6733), 'sys.exit', 'sys.exit', ([], {}),...
import os import cv2 import numpy as np from PIL import Image from keras.engine.topology import Layer, InputSpec import keras.utils.conv_utils as conv_utils import tensorflow as tf import keras.backend as K import skimage.io as io class DenseDepthAnalysis: def __init__(self, image_id, model, object_at...
[ "keras.engine.topology.InputSpec", "tensorflow.image.resize_images", "keras.backend.shape", "os.getenv", "numpy.asarray", "numpy.expand_dims", "keras.backend.normalize_data_format", "keras.utils.conv_utils.normalize_tuple" ]
[((1363, 1390), 'numpy.expand_dims', 'np.expand_dims', (['inp'], {'axis': '(0)'}), '(inp, axis=0)\n', (1377, 1390), True, 'import numpy as np\n'), ((2548, 2584), 'keras.backend.normalize_data_format', 'K.normalize_data_format', (['data_format'], {}), '(data_format)\n', (2571, 2584), True, 'import keras.backend as K\n')...
# coding: utf-8 # In[ ]: # 0. 執行指令: # !python predict.py -c config.json -i /path/to/image/or/video # 輸入為 圖片: !python predict.py -c config.json -i ./o_input # 輸入為 影片: !python predict.py -c config.json -i ./o_input/Produce.mp4 # 1. 輸入檔案擺放位置: # 將要偵測的 影片或圖片 放到 資料夾 o_input (影片必須為mp4格式;圖片可以多張,必須為...
[ "matplotlib.pyplot.imshow", "numpy.uint8", "os.listdir", "keras.models.load_model", "time.gmtime", "utils.utils.get_yolo_boxes", "cv2.imshow", "utils.bbox.draw_boxes", "os.path.isdir", "utils.utils.makedirs", "cv2.VideoCapture", "cv2.VideoWriter_fourcc", "cv2.destroyAllWindows", "cv2.waitK...
[((1453, 1474), 'utils.utils.makedirs', 'makedirs', (['output_path'], {}), '(output_path)\n', (1461, 1474), False, 'from utils.utils import get_yolo_boxes, makedirs\n'), ((2241, 2275), 'keras.models.load_model', 'load_model', (['"""kholes_448_an_ne4.h5"""'], {}), "('kholes_448_an_ne4.h5')\n", (2251, 2275), False, 'from...
import mne import numpy as np size = (600, 600) renderer = mne.viz.backends.renderer.create_3d_figure(bgcolor='w', size=size, scene=False) mne.viz.set_3d_backend('pyvista') print("Creating image") renderer.sphere((0, 0, 0), 'k', 1, resolution=1000) renderer.plotter.camera.enable_parallel_projection(True) renderer.figur...
[ "mne.viz.set_3d_backend", "numpy.linspace", "mne.viz.backends.renderer.create_3d_figure", "numpy.ones" ]
[((59, 138), 'mne.viz.backends.renderer.create_3d_figure', 'mne.viz.backends.renderer.create_3d_figure', ([], {'bgcolor': '"""w"""', 'size': 'size', 'scene': '(False)'}), "(bgcolor='w', size=size, scene=False)\n", (101, 138), False, 'import mne\n'), ((139, 172), 'mne.viz.set_3d_backend', 'mne.viz.set_3d_backend', (['""...
import pystan import numpy as np import matplotlib.pyplot as plt import pickle import os from pystan_vb_extract import pystan_vb_extract ### Model Name ### model_name = 'mix' # model_name = 'mix-dp' ### Use variational inference? ### # use_vb = True use_vb = False # Compile stan model, if needed. Otherwise, load mo...
[ "pickle.dump", "numpy.ones", "pystan_vb_extract.pystan_vb_extract", "numpy.random.seed", "numpy.random.randn" ]
[((699, 716), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (713, 716), True, 'import numpy as np\n'), ((1186, 1208), 'pystan_vb_extract.pystan_vb_extract', 'pystan_vb_extract', (['fit'], {}), '(fit)\n', (1203, 1208), False, 'from pystan_vb_extract import pystan_vb_extract\n'), ((660, 678), 'pickle.dum...
import numpy as np from test.util import generate_kernel_test_case from webdnn.graph.graph import Graph from webdnn.graph.operators.col2im import Col2Im from webdnn.graph.order import OrderNHWC from webdnn.graph.variable import Variable def generate_data_311(): v_col = np.array([[[[[ [0, 0, 0], [...
[ "webdnn.graph.variable.Variable", "numpy.rollaxis", "numpy.array", "webdnn.graph.operators.col2im.Col2Im", "webdnn.graph.graph.Graph" ]
[((1121, 1144), 'numpy.rollaxis', 'np.rollaxis', (['v_im', '(1)', '(4)'], {}), '(v_im, 1, 4)\n', (1132, 1144), True, 'import numpy as np\n'), ((1846, 1869), 'numpy.rollaxis', 'np.rollaxis', (['v_im', '(1)', '(4)'], {}), '(v_im, 1, 4)\n', (1857, 1869), True, 'import numpy as np\n'), ((1977, 2015), 'webdnn.graph.variable...
# -*- coding: utf-8 -*- """DECONVOLUTION FILE INPUT/OUTPUT This module defines methods for file input and output for deconvolution_script.py. :Author: <NAME> <<EMAIL>> :Version: 1.0 :Date: 13/03/2017 """ import numpy as np from os.path import splitext from astropy.io import fits from .types import check_npndarra...
[ "astropy.io.fits.PrimaryHDU", "os.path.splitext", "astropy.io.fits.getdata", "numpy.load", "numpy.save" ]
[((1194, 1217), 'astropy.io.fits.getdata', 'fits.getdata', (['file_name'], {}), '(file_name)\n', (1206, 1217), False, 'from astropy.io import fits\n'), ((1904, 1922), 'numpy.load', 'np.load', (['file_name'], {}), '(file_name)\n', (1911, 1922), True, 'import numpy as np\n'), ((4783, 4832), 'numpy.save', 'np.save', (["(o...
import cv2 import gc import numpy as np from ctypes import * __all__ = ['darknet_resize'] class IMAGE(Structure): _fields_ = [("w", c_int), ("h", c_int), ("c", c_int), ("data", POINTER(c_float))] lib = CDLL("darknet/libdarknet.so", RTLD_GLOBAL) resize_image = li...
[ "cv2.imread", "numpy.ctypeslib.as_array", "gc.collect", "numpy.ascontiguousarray" ]
[((595, 643), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['arr.flat'], {'dtype': 'np.float32'}), '(arr.flat, dtype=np.float32)\n', (615, 643), True, 'import numpy as np\n'), ((846, 914), 'numpy.ctypeslib.as_array', 'np.ctypeslib.as_array', (['im.data'], {'shape': '(shape[2], shape[0], shape[1])'}), '(im.data, ...
import numpy as np import os ''' This is a simple script to collect all of the file outputs from individual CorrCal runs (saved in an `output_runs' directory), and create a 2D numpy array (full_runs.npy) containing all recovered gains.''' full_runs_output = np.array([]) data_path = '/data/zahrakad/hirax_corrcal/outpu...
[ "os.listdir", "os.path.join", "numpy.append", "numpy.array", "numpy.save" ]
[((260, 272), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (268, 272), True, 'import numpy as np\n'), ((606, 677), 'numpy.save', 'np.save', (['"""/data/zahrakad/hirax_corrcal/full_runs.npy"""', 'full_runs_output'], {}), "('/data/zahrakad/hirax_corrcal/full_runs.npy', full_runs_output)\n", (613, 677), True, 'impor...
from collections import Counter, defaultdict, OrderedDict from sklearn.neighbors.kde import KernelDensity import itertools import numpy as np import os import pysam import random as rnd import sys import matplotlib matplotlib.use('Agg') # required if X11 display is not present import matplotlib.pyplot as plt...
[ "itertools.chain", "numpy.log", "pysam.AlignmentFile", "arcsv.helper.is_read_through", "arcsv.softclip.process_softclip", "arcsv.helper.normpdf", "sys.exit", "arcsv.helper.add_time_checkpoint", "arcsv.helper.not_primary", "arcsv.pecluster.process_discordant_pair", "arcsv.helper.len_without_gaps"...
[((216, 237), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (230, 237), False, 'import matplotlib\n'), ((1394, 1434), 'arcsv.helper.get_chrom_size_from_bam', 'get_chrom_size_from_bam', (['chrom_name', 'bam'], {}), '(chrom_name, bam)\n', (1417, 1434), False, 'from arcsv.helper import get_chrom_si...
# sinh() function import numpy as np import math in_array = [0, math.pi / 2, np.pi / 3, np.pi] print ("Input array : \n", in_array) Sinh_Values = np.sinh(in_array) print ("\nSine Hyperbolic values : \n", Sinh_Values)
[ "numpy.sinh" ]
[((152, 169), 'numpy.sinh', 'np.sinh', (['in_array'], {}), '(in_array)\n', (159, 169), True, 'import numpy as np\n')]
import numpy as np from edutorch.nn import SpatialGroupNorm from tests.gradient_check import estimate_gradients def test_spatial_groupnorm_forward() -> None: N, C, H, W, G = 2, 6, 4, 5, 2 x = 4 * np.random.randn(N, C, H, W) + 10 model = SpatialGroupNorm(C, G) model.gamma = np.ones((1, C, 1, 1)) m...
[ "numpy.allclose", "numpy.ones", "edutorch.nn.SpatialGroupNorm", "numpy.zeros", "tests.gradient_check.estimate_gradients", "numpy.random.randn" ]
[((252, 274), 'edutorch.nn.SpatialGroupNorm', 'SpatialGroupNorm', (['C', 'G'], {}), '(C, G)\n', (268, 274), False, 'from edutorch.nn import SpatialGroupNorm\n'), ((293, 314), 'numpy.ones', 'np.ones', (['(1, C, 1, 1)'], {}), '((1, C, 1, 1))\n', (300, 314), True, 'import numpy as np\n'), ((332, 354), 'numpy.zeros', 'np.z...
# -*- coding: utf-8 -*- """Emotion-Analysis.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1Hg2TKSPhWyjQZJDEyHaQxuRiD-A7_WtQ #Imports """ import pandas as pd import numpy as np import os import random import re import nltk nltk.download('punk...
[ "sklearn.metrics.accuracy_score", "nltk.corpus.stopwords.words", "nltk.download", "pandas.read_csv", "sklearn.metrics.classification_report", "nltk.stem.WordNetLemmatizer", "seaborn.heatmap", "sklearn.linear_model.LogisticRegression", "numpy.array", "sklearn.feature_extraction.text.TfidfVectorizer...
[((301, 323), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (314, 323), False, 'import nltk\n'), ((324, 348), 'nltk.download', 'nltk.download', (['"""wordnet"""'], {}), "('wordnet')\n", (337, 348), False, 'import nltk\n'), ((349, 375), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}...
from igraph import * import numpy as np # Create the graph vertices = [i for i in range(7)] edges = [(0,2),(0,1),(0,3),(1,0),(1,2),(1,3),(2,0),(2,1),(2,3),(3,0),(3,1),(3,2),(2,4),(4,5),(4,6),(5,4),(5,6),(6,4),(6,5)] g = Graph(vertex_attrs={"label":vertices}, edges=edges, directed=True) visual_style = {} # Scale ver...
[ "numpy.digitize" ]
[((730, 758), 'numpy.digitize', 'np.digitize', (['outdegree', 'bins'], {}), '(outdegree, bins)\n', (741, 758), True, 'import numpy as np\n')]
from flask import session from flask import render_template import os from flask import Blueprint, request import numpy as np from flaskr.auth import login_required from flask import g import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import base64 import io from .classes.preProcessClass impo...
[ "flask.render_template", "os.path.exists", "flask.request.args.get", "os.listdir", "matplotlib.use", "pathlib.Path.cwd", "numpy.warnings.filterwarnings", "io.BytesIO", "matplotlib.pyplot.close", "os.path.isfile", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.figure", "matplotlib.pyplot....
[((206, 227), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (220, 227), False, 'import matplotlib\n'), ((412, 422), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (420, 422), False, 'from pathlib import Path\n'), ((483, 538), 'flask.Blueprint', 'Blueprint', (['"""visualization"""', '__name__'...
# -*- coding: utf-8 -*- """ Created on Mon Jan 29 13:42:29 2018 @author: <NAME> """ import numpy as np import cv2 captura = cv2.VideoCapture(0) #img = cv2.imread('tucan.jpg', cv2.IMREAD_COLOR) #print(img.shape) isFirstFrame = True # Creates the window where slider will be placed cv2.namedWindow("Salida") while(Tr...
[ "cv2.imshow", "numpy.zeros", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.waitKey", "cv2.namedWindow", "cv2.absdiff" ]
[((127, 146), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (143, 146), False, 'import cv2\n'), ((285, 310), 'cv2.namedWindow', 'cv2.namedWindow', (['"""Salida"""'], {}), "('Salida')\n", (300, 310), False, 'import cv2\n'), ((1135, 1158), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\...
import colorsys import numpy as np def random_colors(N, bright=True): brightness = 1.0 if bright else 0.7 hsv = [(i / N, 1, brightness) for i in range(N)] colors = list(map(lambda c: colorsys.hsv_to_rgb(*c), hsv)) return colors def apply_mask(image, mask, color, alpha=0.5): for i in range(3): ...
[ "numpy.where", "colorsys.hsv_to_rgb" ]
[((684, 713), 'numpy.where', 'np.where', (['(mask == 0)', '(0.0)', '(1.0)'], {}), '(mask == 0, 0.0, 1.0)\n', (692, 713), True, 'import numpy as np\n'), ((343, 437), 'numpy.where', 'np.where', (['(mask == 1)', '(image[:, :, i] * (1 - alpha) + alpha * color[i] * 255)', 'image[:, :, i]'], {}), '(mask == 1, image[:, :, i] ...
from __future__ import annotations from typing import TYPE_CHECKING, List import numpy as np if TYPE_CHECKING: import napari def make_sample_data() -> List[napari.types.LayerData]: """Generate a parabolic gradient to simulate uneven illumination""" np.random.seed(42) n_images = 8 # Create a g...
[ "numpy.moveaxis", "numpy.linspace", "numpy.random.seed" ]
[((266, 284), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (280, 284), True, 'import numpy as np\n'), ((821, 847), 'numpy.moveaxis', 'np.moveaxis', (['images', '(-1)', '(0)'], {}), '(images, -1, 0)\n', (832, 847), True, 'import numpy as np\n'), ((373, 417), 'numpy.linspace', 'np.linspace', (['(-size...
import argparse import glob import os import random import logging import numpy as np import math from tqdm import tqdm import time import torch from transformers import AutoTokenizer, AutoModelForMaskedLM from transformers import DataCollatorForLanguageModeling from transformers.optimization import AdamW, get_linear_s...
[ "logging.getLogger", "torch.exp", "math.log", "torch.utils.data.distributed.DistributedSampler", "torch.cuda.is_available", "transformers.AutoTokenizer.from_pretrained", "torch_xla.core.xla_model.all_reduce", "logging.info", "pytorch_lightning.logging.test_tube.TestTubeLogger", "transformers.optim...
[((563, 602), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (582, 602), False, 'import logging\n'), ((612, 639), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (629, 639), False, 'import logging\n'), ((19355, 19382), 'random.seed'...
# ================================================================================================== # A minimal example that renders a triangle mesh into a depth image using predefined perspective projection matrix # Copyright 2021 <NAME> # # Please run script from repository root, i.e.: # python3 ./tsdf_management/re...
[ "pytorch3d.renderer.mesh.MeshRasterizer", "cv2.imread", "pytorch3d.renderer.mesh.TexturesVertex", "pytorch3d.renderer.mesh.SoftPhongShader", "os.path.join", "settings.process_arguments", "torch.from_numpy", "cv2.imshow", "numpy.array", "cv2.waitKey", "data.camera.load_intrinsic_matrix_entries_fr...
[((1166, 1257), 'os.path.join', 'os.path.join', (['Parameters.path.dataset_base_directory.value', '"""val/seq014/intrinsics.txt"""'], {}), "(Parameters.path.dataset_base_directory.value,\n 'val/seq014/intrinsics.txt')\n", (1178, 1257), False, 'import os\n'), ((1274, 1296), 'torch.device', 'torch.device', (['"""cuda:...
import cv2 import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mping import time import imutils import os focalLength = None def load_custom_names(): "load names of custom text file" # create epmty list class_list = [] # open coco txt file with open("./object_detection...
[ "cv2.dnn.blobFromImage", "cv2.rectangle", "matplotlib.image.imread", "numpy.argmax", "time.sleep", "cv2.putText", "cv2.minAreaRect", "os.getcwd", "matplotlib.pyplot.figure", "imutils.grab_contours", "cv2.cvtColor", "cv2.dnn.readNet", "cv2.dnn.NMSBoxes", "cv2.Canny", "cv2.waitKey", "cv2...
[((747, 860), 'cv2.dnn.readNet', 'cv2.dnn.readNet', (['"""./object_detection/yolov3-tiny-custom.weights"""', '"""./object_detection/yolov3-tiny-custom.cfg"""'], {}), "('./object_detection/yolov3-tiny-custom.weights',\n './object_detection/yolov3-tiny-custom.cfg')\n", (762, 860), False, 'import cv2\n'), ((3537, 3556)...
import numpy as np import numba as nb from Bio import pairwise2 from Bio.Seq import Seq from Bio.SubsMat import MatrixInfo from Bio.Alphabet import generic_dna from Bio import SeqUtils def initialStep(V0, V1, InSeq, In, M, Dir, isLocal = False): d = 8 for i in range(V0.shape[0]): top = np.iinfo(np.int1...
[ "Bio.Seq.Seq", "numpy.iinfo", "numpy.chararray.tostring", "numpy.zeros", "numpy.chararray" ]
[((5095, 5154), 'Bio.Seq.Seq', 'Seq', (['"""GTGGCCATTGTAATGGGCCGCTGAAAGGGTGCCCGATAG"""', 'generic_dna'], {}), "('GTGGCCATTGTAATGGGCCGCTGAAAGGGTGCCCGATAG', generic_dna)\n", (5098, 5154), False, 'from Bio.Seq import Seq\n'), ((5162, 5212), 'Bio.Seq.Seq', 'Seq', (['"""GTGGCCATTGTAATGGAAAGGGTGAAAGAT"""', 'generic_dna'], {}...
from ..gui.main_window import Ui_EditorMainWindow from PySide.QtGui import QApplication, QMainWindow, QPixmap from PySide import QtGui, QtCore from PySide.QtCore import QObject import sys import numpy as np from .. import util from .brush_dialog import BrushDialog from .about_dialog import AboutDialog from .new_image_d...
[ "numpy.clip", "PySide.QtGui.QPixmap.fromImage", "PySide.QtGui.QFileDialog.getOpenFileName", "numpy.absolute", "numpy.fft.fft2", "numpy.angle", "numpy.zeros", "PySide.QtGui.QDesktopServices.openUrl", "PySide.QtGui.QFileDialog.getSaveFileName", "PySide.QtGui.QApplication", "PySide.QtGui.QImage", ...
[((16472, 16494), 'PySide.QtGui.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (16484, 16494), False, 'from PySide.QtGui import QApplication, QMainWindow, QPixmap\n'), ((3087, 3106), 'numpy.fft.fft2', 'np.fft.fft2', (['garray'], {}), '(garray)\n', (3098, 3106), True, 'import numpy as np\n'), ((3124,...
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "paddle.fluid.framework._test_eager_guard", "numpy.random.rand", "paddle.fluid.CPUPlace", "numpy.random.randint", "paddle.to_tensor", "paddle.linalg.cov", "paddle.fluid.CUDAPlace", "unittest.main", "paddle.fluid.core.is_compiled_with_cuda", "paddle.set_device" ]
[((11390, 11405), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11403, 11405), False, 'import unittest\n'), ((1256, 1290), 'paddle.fluid.core.is_compiled_with_cuda', 'fluid.core.is_compiled_with_cuda', ([], {}), '()\n', (1288, 1290), True, 'import paddle.fluid as fluid\n'), ((2398, 2432), 'paddle.fluid.core.is_c...
""" Description: A python 2.7 implementation of gcForest proposed in [1]. A demo implementation of gcForest library as well as some demo client scripts to demostrate how to use the code. The implementation is flexible enough for modifying the model or fit your own datasets. Reference: [1] <NAME> and <NAME>. Deep Fores...
[ "matplotlib.pylab.savefig", "sklearn.ensemble.ExtraTreesClassifier", "matplotlib.pylab.show", "numpy.mean", "matplotlib.pylab.clf", "matplotlib.pylab.grid", "matplotlib.pylab.title", "json.dumps", "numpy.asarray", "numpy.concatenate", "matplotlib.pylab.axes", "sklearn.ensemble.RandomForestClas...
[((1582, 1611), 'numpy.concatenate', 'np.concatenate', (['datas'], {'axis': '(1)'}), '(datas, axis=1)\n', (1596, 1611), True, 'import numpy as np\n'), ((1658, 1682), 'numpy.mean', 'np.mean', (['X_train'], {'axis': '(0)'}), '(X_train, axis=0)\n', (1665, 1682), True, 'import numpy as np\n'), ((1695, 1718), 'numpy.std', '...
from __future__ import print_function import unittest import numpy as np from simpegEM1D import ( GlobalEM1DProblemFD, GlobalEM1DSurveyFD, get_vertical_discretization_frequency ) from SimPEG import ( regularization, Inversion, InvProblem, DataMisfit, Utils, Mesh, Maps, Optimization, Tests ) np.rand...
[ "numpy.random.rand", "SimPEG.Maps.ExpMap", "numpy.log", "SimPEG.DataMisfit.l2_DataMisfit", "numpy.array", "unittest.main", "numpy.arange", "simpegEM1D.get_vertical_discretization_frequency", "numpy.random.seed", "SimPEG.Optimization.InexactGaussNewton", "SimPEG.Inversion.BaseInversion", "numpy...
[((313, 331), 'numpy.random.seed', 'np.random.seed', (['(41)'], {}), '(41)\n', (327, 331), True, 'import numpy as np\n'), ((6276, 6291), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6289, 6291), False, 'import unittest\n'), ((430, 471), 'numpy.array', 'np.array', (['[900, 7200, 56000]'], {'dtype': 'float'}), '(...
from collections import deque import numpy as np from gym.spaces import Box from gym import ObservationWrapper class FrameStack(ObservationWrapper): def __init__(self, env, num_frames): super(FrameStack, self).__init__(env) self._env = env self.num_frames = num_frames self.frames ...
[ "collections.deque", "numpy.repeat", "gym.spaces.Box", "cv2.cvtColor", "numpy.expand_dims" ]
[((322, 346), 'collections.deque', 'deque', ([], {'maxlen': 'num_frames'}), '(maxlen=num_frames)\n', (327, 346), False, 'from collections import deque\n'), ((362, 455), 'numpy.repeat', 'np.repeat', (["self.observation_space['observation'].low[np.newaxis, ...]", 'num_frames'], {'axis': '(0)'}), "(self.observation_space[...
from torchvision import datasets, transforms from customImageLoader import CustomImageFolder from torch.utils.data import SubsetRandomSampler, DataLoader import numpy as np class Data: """ Class for managing and preparing data for training, validation and testing phases. """ def __init__(self, train_p...
[ "torchvision.transforms.CenterCrop", "torchvision.transforms.RandomRotation", "numpy.floor", "torch.utils.data.SubsetRandomSampler", "torchvision.transforms.RandomHorizontalFlip", "customImageLoader.CustomImageFolder", "torchvision.transforms.Normalize", "torch.utils.data.DataLoader", "torchvision.t...
[((1515, 1581), 'customImageLoader.CustomImageFolder', 'CustomImageFolder', (['self.train_path'], {'transform': 'self.train_transform'}), '(self.train_path, transform=self.train_transform)\n', (1532, 1581), False, 'from customImageLoader import CustomImageFolder\n'), ((1757, 1786), 'numpy.random.shuffle', 'np.random.sh...
import numpy as np from IMLearn.learners.classifiers import Perceptron, LDA, GaussianNaiveBayes from typing import Tuple from utils import * from os import path import plotly.graph_objects as go from plotly.subplots import make_subplots from matplotlib import pyplot as plt from math import atan2, pi def load_dataset...
[ "IMLearn.learners.classifiers.Perceptron", "matplotlib.pyplot.ylabel", "IMLearn.learners.classifiers.GaussianNaiveBayes", "matplotlib.pyplot.xlabel", "os.path.join", "numpy.diag", "numpy.linalg.eigvalsh", "plotly.graph_objects.Scatter", "numpy.linspace", "numpy.random.seed", "math.atan2", "num...
[((885, 902), 'numpy.load', 'np.load', (['filename'], {}), '(filename)\n', (892, 902), True, 'import numpy as np\n'), ((2656, 2683), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * pi)', '(100)'], {}), '(0, 2 * pi, 100)\n', (2667, 2683), True, 'import numpy as np\n'), ((2849, 2923), 'plotly.graph_objects.Scatter', 'go....
import FINE as fn import pandas as pd import numpy as np """ Here we are testing differnt inputs for time-invariant conversion factors that are not covered in the minimal test system or other tests. """ def create_core_esm(): """ We create a core esm that only consists of a source and a sink in one location. ...
[ "pandas.Series", "FINE.Sink", "numpy.array", "FINE.EnergySystemModel", "FINE.Source" ]
[((437, 760), 'FINE.EnergySystemModel', 'fn.EnergySystemModel', ([], {'locations': "{'ElectrolyzerLocation'}", 'commodities': "{'electricity', 'hydrogen'}", 'numberOfTimeSteps': 'numberOfTimeSteps', 'commodityUnitsDict': "{'electricity': 'kW$_{el}$', 'hydrogen': 'kW$_{H_{2},LHV}$'}", 'hoursPerTimeStep': 'hoursPerTimeSt...
import os import shutil import sys MEDCOMMON_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.path.pardir, os.path.pardir) sys.path.append(MEDCOMMON_ROOT) sys.path.append(os.path.join(MEDCOMMON_ROOT, 'external_lib')) from utils.data_io_utils import DataIO from utils.mask_bounding_utils import MaskBo...
[ "os.path.exists", "os.listdir", "utils.datasets_utils.DatasetsUtils.resample_image_mask_unsame_resolution_multiprocess", "json.dumps", "os.path.join", "SimpleITK.GetArrayFromImage", "utils.detection_utils.DETECTION_UTILS.point_coordinate_resampled", "torch.from_numpy", "utils.mask_bounding_utils.Mas...
[((142, 173), 'sys.path.append', 'sys.path.append', (['MEDCOMMON_ROOT'], {}), '(MEDCOMMON_ROOT)\n', (157, 173), False, 'import sys\n'), ((190, 234), 'os.path.join', 'os.path.join', (['MEDCOMMON_ROOT', '"""external_lib"""'], {}), "(MEDCOMMON_ROOT, 'external_lib')\n", (202, 234), False, 'import os\n'), ((1317, 1350), 'os...
import types import numpy as np import jax from jax import numpy as jnp from flax import struct import utils DTYPE = jnp.int16 SIZE = 10 one_hot_10 = jax.partial(utils.one_hot, k=SIZE) ACTION_MAP = jnp.stack([ jnp.array((1, 0), dtype=DTYPE), # visually DOWN jnp.array((0, 1), dtype=DTYPE), # visually R...
[ "jax.partial", "flax.struct.field", "jax.numpy.arange", "jax.numpy.array", "numpy.zeros", "jax.jit", "jax.numpy.clip", "jax.numpy.linspace", "jax.vmap", "random.randint" ]
[((155, 189), 'jax.partial', 'jax.partial', (['utils.one_hot'], {'k': 'SIZE'}), '(utils.one_hot, k=SIZE)\n', (166, 189), False, 'import jax\n'), ((1076, 1091), 'jax.vmap', 'jax.vmap', (['reset'], {}), '(reset)\n', (1084, 1091), False, 'import jax\n'), ((1204, 1220), 'jax.vmap', 'jax.vmap', (['render'], {}), '(render)\n...
from finetuna.ml_potentials.ocpd_calc import OCPDCalc import torch from torch import nn import torch.nn.functional as F import numpy as np import copy from multiprocessing import Pool from ase.atoms import Atoms class OCPDNNCalc(OCPDCalc): implemented_properties = ["energy", "forces", "stds"] def __init__( ...
[ "numpy.multiply", "torch.nn.Dropout", "copy.deepcopy", "numpy.ones", "torch.optim.lr_scheduler.ReduceLROnPlateau", "numpy.average", "torch.nn.init.xavier_uniform_", "torch.nn.MSELoss", "numpy.zeros", "torch.tensor", "multiprocessing.Pool", "torch.nn.Linear", "numpy.std" ]
[((7096, 7120), 'copy.deepcopy', 'copy.deepcopy', (['estimator'], {}), '(estimator)\n', (7109, 7120), False, 'import copy\n'), ((1162, 1174), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {}), '()\n', (1172, 1174), False, 'from torch import nn\n'), ((3884, 3911), 'numpy.std', 'np.std', (['predictions'], {'axis': '(0)'}), '(pr...
import click from pathlib import Path import datetime from moviepy.editor import * from PIL import Image from PIL import ImageFont from PIL import ImageDraw import numpy as np import xmltodict def make_clips(filelist,timelist,AOI=None): print('loopstart') clips=[] for file, time in zip(filelist, timelist)...
[ "PIL.Image.open", "pathlib.Path", "click.option", "numpy.array", "PIL.ImageDraw.Draw", "click.command" ]
[((1118, 1133), 'click.command', 'click.command', ([], {}), '()\n', (1131, 1133), False, 'import click\n'), ((1135, 1290), 'click.option', 'click.option', (['"""--exp_folder"""'], {'default': '"""."""', 'help': '"""Path to experiment folder with images. Exp_folder will be also used to name the timelapse video"""'}), "(...
""" Usefull functions for loading files etc. -AN """ import os import pickle import zipfile, lzma import numpy as np import matplotlib.pyplot as plt from collections import OrderedDict # saves dict to csv using keys as headers def saveToCSV(savedict, filename = "", path = ""): try: #print(sav...
[ "numpy.abs", "collections.OrderedDict", "numpy.convolve", "pickle.dump", "zipfile.ZipFile", "os.makedirs", "matplotlib.pyplot.plot", "os.path.join", "os.getcwd", "os.path.isdir", "numpy.shape", "os.walk", "matplotlib.pyplot.show" ]
[((3085, 3098), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3096, 3098), False, 'from collections import OrderedDict\n'), ((4311, 4324), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (4322, 4324), False, 'from collections import OrderedDict\n'), ((6392, 6428), 'numpy.convolve', 'np.convol...
""" ----------------------------------------------------------------------- Harmoni: a Novel Method for Eliminating Spurious Neuronal Interactions due to the Harmonic Components in Neuronal Data <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> https://doi.org/10.1101/2021.10.06.463319 ----------------------------...
[ "numpy.abs", "tools_signal.plot_fft", "scipy.signal.filtfilt", "tools_signal.hilbert_", "matplotlib.pyplot.plot", "tools_connectivity.compute_phase_connectivity", "matplotlib.pyplot.legend", "numpy.array", "numpy.linspace", "scipy.signal.sawtooth", "matplotlib.pyplot.figure", "matplotlib.pyplo...
[((1223, 1247), 'numpy.arange', 'np.arange', (['dt', 't_len', 'dt'], {}), '(dt, t_len, dt)\n', (1232, 1247), True, 'import numpy as np\n'), ((1451, 1480), 'numpy.linspace', 'np.linspace', (['(0)', 't_len', 'n_samp'], {}), '(0, t_len, n_samp)\n', (1462, 1480), True, 'import numpy as np\n'), ((1503, 1536), 'scipy.signal....
import copy import torch import numpy as np from torch.utils.data import DataLoader from src.cli import get_args from src.utils import capitalize_first_letter, load from src.data import get_data, get_glove_emotion_embs from src.trainers.sentiment import SentiTrainer from src.trainers.emotion import MoseiEmoTrainer, Iem...
[ "torch.manual_seed", "torch.optim.lr_scheduler.ReduceLROnPlateau", "src.models.mult.MULTModel", "copy.deepcopy", "torch.nn.CrossEntropyLoss", "torch.nn.BCEWithLogitsLoss", "torch.nn.L1Loss", "src.data.get_data", "torch.nn.MSELoss", "torch.cuda.is_available", "torch.nn.Parameter", "numpy.random...
[((630, 640), 'src.cli.get_args', 'get_args', ([], {}), '()\n', (638, 640), False, 'from src.cli import get_args\n'), ((705, 728), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (722, 728), False, 'import torch\n'), ((733, 753), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : 2019/5/15 @Author : AnNing """ from __future__ import print_function import os import sys import numpy as np from initialize import load_yaml_file from load import ReadAhiL1 TEST = True def ndsi(in_file_l1, in_file_geo, in_file_cloud): # ----------...
[ "numpy.sqrt", "numpy.arccos", "initialize.load_yaml_file", "numpy.logical_and.reduce", "sys.exit", "numpy.sin", "load.ReadAhiL1", "numpy.maximum", "numpy.round", "numpy.abs", "numpy.ones", "os.path.dirname", "numpy.isnan", "numpy.cos", "numpy.minimum", "numpy.logical_and", "os.path.j...
[((7744, 7779), 'os.path.join', 'os.path.join', (['path', '"""ndsi_cfg.yaml"""'], {}), "(path, 'ndsi_cfg.yaml')\n", (7756, 7779), False, 'import os\n'), ((7847, 7882), 'initialize.load_yaml_file', 'load_yaml_file', (['name_list_swath_snc'], {}), '(name_list_swath_snc)\n', (7861, 7882), False, 'from initialize import lo...
# to do: # - read in tidal predictions (if file exists) to validate data import socket import numpy as np def ADCP_read(stage_instance, udp_IP = "", udp_port = 61557, buff_size = 1024, timeout = 5): """ Reads ADCP data continously from the specified port. **EDITING NOTE - break added after timeout** ...
[ "numpy.mean", "socket.socket", "numpy.array", "numpy.resize", "numpy.arctan" ]
[((606, 654), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (619, 654), False, 'import socket\n'), ((3093, 3111), 'numpy.array', 'np.array', (['currents'], {}), '(currents)\n', (3101, 3111), True, 'import numpy as np\n'), ((3126, 3151), 'numpy....
# python libraries import numpy as np # matplotlib libraries import matplotlib.pyplot as plt from sklearn.model_selection import StratifiedKFold from sklearn.metrics import f1_score, make_scorer, accuracy_score, average_precision_score, confusion_matrix from sklearn.ensemble import RandomForestClassifier from sklearn....
[ "sys.path.insert", "util.code_truVrest", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel", "numpy.arange", "sklearn.utils.shuffle", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.argmax", "sklearn.preprocessing.StandardScaler", "numpy.array", "...
[((444, 483), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../data+wrangling"""'], {}), "(0, '../data+wrangling')\n", (459, 483), False, 'import sys\n'), ((3532, 3549), 'numpy.argmax', 'np.argmax', (['scores'], {}), '(scores)\n', (3541, 3549), True, 'import numpy as np\n'), ((3930, 3986), 'matplotlib.pyplot.plot'...
# coding=utf8 import json import math from numpy.ma import arange from data_utils import build_data_loader from model_utils import load_vocabulary, build_model, model_evaluate with open('config.json') as config_file: config = json.load(config_file) MIN_EPOCH = config['SELECTOR']['MIN_EPOCH'] MAX_EPOCH = config[...
[ "model_utils.model_evaluate", "data_utils.build_data_loader", "numpy.ma.arange", "model_utils.load_vocabulary", "json.load", "math.exp" ]
[((233, 255), 'json.load', 'json.load', (['config_file'], {}), '(config_file)\n', (242, 255), False, 'import json\n'), ((483, 534), 'numpy.ma.arange', 'arange', (['MIN_EPOCH', '(MAX_EPOCH + STEP_SIZE)', 'STEP_SIZE'], {}), '(MIN_EPOCH, MAX_EPOCH + STEP_SIZE, STEP_SIZE)\n', (489, 534), False, 'from numpy.ma import arange...
import os import numpy as np from scipy.stats import rankdata from scipy.special import binom #faster than comb import dynamicTreeCut.df_apply from functools import partial from dynamicTreeCut.R_func import * chunkSize = 100 #Function to index flat matrix as squareform matrix def dist_index(i, j, matrix, l, n): ...
[ "numpy.sqrt", "numpy.argsort", "numpy.array", "numpy.arange", "numpy.mean", "numpy.repeat", "numpy.max", "numpy.min", "numpy.argmin", "numpy.round", "os.path.isfile", "numpy.isnan", "numpy.unique", "numpy.logical_and", "scipy.stats.rankdata", "numpy.logical_or", "numpy.append", "nu...
[((3209, 3238), 'numpy.mean', 'np.mean', (['CoreAverageDistances'], {}), '(CoreAverageDistances)\n', (3216, 3238), True, 'import numpy as np\n'), ((3289, 3304), 'numpy.round', 'np.round', (['index'], {}), '(index)\n', (3297, 3304), True, 'import numpy as np\n'), ((4419, 4449), 'numpy.round', 'np.round', (['(nMerge * re...
import pickle import numpy as np import pygame from time import sleep #Duplicate of the Arduino map function (needed for processing autoencoder data) def map(x, in_min, in_max, out_min, out_max): return (x - in_min) * (out_max - out_min) // (in_max - in_min) + out_min class number: def __init__(self, imag...
[ "numpy.reshape", "pygame.init", "pygame.quit", "pygame.event.get", "pygame.display.set_mode", "pygame.display.flip", "pickle.load", "time.sleep", "pygame.draw.rect", "pygame.display.set_caption", "pygame.font.Font" ]
[((4453, 4467), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (4464, 4467), False, 'import pickle\n'), ((1205, 1218), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1216, 1218), False, 'import pygame\n'), ((1261, 1310), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(screenSize, screenSize)'], {}), '(...
#!/usr/bin/env python # encoding: utf-8 ''' @project : MSRGCN @file : config.py @author : Droliven @contact : <EMAIL> @ide : PyCharm @time : 2021-07-27 16:56 ''' import os import getpass import torch import numpy as np class Config(): def __init__(self, exp_name="h36m", input_n=10, output_n=10, dct_n=1...
[ "getpass.getuser", "numpy.array", "os.path.join" ]
[((397, 414), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (412, 414), False, 'import getpass\n'), ((5601, 5692), 'os.path.join', 'os.path.join', (['"""./ckpt/"""', 'exp_name', "('short_term' if self.output_n == 10 else 'long_term')"], {}), "('./ckpt/', exp_name, 'short_term' if self.output_n == 10 else\n ...
import numpy as np import pandas as pd from numpy.testing import assert_array_equal from numpy.testing import assert_array_almost_equal from auxiliary.functions_daniel import ( rastrigin_instance, griewank_instance, levi_no_13_instance, rosenbrock_instance, ) def test_rastrigin(): inputs = crea...
[ "auxiliary.functions_daniel.rosenbrock_instance", "auxiliary.functions_daniel.rastrigin_instance", "numpy.testing.assert_array_almost_equal", "auxiliary.functions_daniel.levi_no_13_instance", "auxiliary.functions_daniel.griewank_instance", "numpy.array" ]
[((347, 368), 'auxiliary.functions_daniel.rastrigin_instance', 'rastrigin_instance', (['(3)'], {}), '(3)\n', (365, 368), False, 'from auxiliary.functions_daniel import rastrigin_instance, griewank_instance, levi_no_13_instance, rosenbrock_instance\n'), ((389, 433), 'numpy.array', 'np.array', (['[15, 111, 139, 31, 2, 46...
# Copyright (C) <NAME> 2020. # Distributed under the MIT License (see the accompanying README.md and LICENSE files). import numpy as np import utils.clicks as clk def oracle_doc_variance( expected_reward, doc_values, rel_prob, obs_prob, sampled_inv_rankings): n_doc...
[ "numpy.mean", "numpy.tile", "numpy.exp", "numpy.sum", "utils.clicks.bernoilli_sample_from_probs", "numpy.zeros", "numpy.add.at", "numpy.amax", "numpy.arange" ]
[((360, 407), 'numpy.mean', 'np.mean', (['obs_prob[sampled_inv_rankings]'], {'axis': '(0)'}), '(obs_prob[sampled_inv_rankings], axis=0)\n', (367, 407), True, 'import numpy as np\n'), ((643, 664), 'numpy.mean', 'np.mean', (['doc_variance'], {}), '(doc_variance)\n', (650, 664), True, 'import numpy as np\n'), ((1262, 1309...
import math import numpy as np from keras.datasets import mnist, cifar10 def combine_images(generated_images): num = generated_images.shape[0] width = int(math.sqrt(num)) height = int(math.ceil(float(num) / width)) shape = generated_images.shape[1:3] image = np.zeros((height * shape[0], width * s...
[ "keras.datasets.cifar10.load_data", "numpy.zeros", "math.sqrt", "keras.datasets.mnist.load_data" ]
[((282, 359), 'numpy.zeros', 'np.zeros', (['(height * shape[0], width * shape[1])'], {'dtype': 'generated_images.dtype'}), '((height * shape[0], width * shape[1]), dtype=generated_images.dtype)\n', (290, 359), True, 'import numpy as np\n'), ((729, 746), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()...
from __future__ import division import numpy as np from collections import namedtuple import bilby from bilby.gw import conversion import os import gwpopulation MassContainer = namedtuple('MassContainer', ['primary_masses', 'secondary_masses', 'mass_ratios', 'total_masses...
[ "matplotlib.pyplot.ylabel", "numpy.array", "matplotlib.pyplot.semilogy", "numpy.random.random", "matplotlib.pyplot.xlabel", "numpy.max", "numpy.linspace", "gwpopulation.models.mass.power_law_primary_mass_ratio", "matplotlib.pyplot.scatter", "numpy.meshgrid", "collections.namedtuple", "os.path....
[((180, 298), 'collections.namedtuple', 'namedtuple', (['"""MassContainer"""', "['primary_masses', 'secondary_masses', 'mass_ratios', 'total_masses',\n 'chirp_masses']"], {}), "('MassContainer', ['primary_masses', 'secondary_masses',\n 'mass_ratios', 'total_masses', 'chirp_masses'])\n", (190, 298), False, 'from c...
import os import numpy as np import time import sys import paddle import paddle.fluid as fluid from resnet import TSN_ResNet import reader import argparse import functools from paddle.fluid.framework import Parameter from utility import add_arguments, print_arguments parser = argparse.ArgumentParser(description=__doc...
[ "paddle.fluid.DataFeeder", "reader.infer", "argparse.ArgumentParser", "paddle.fluid.default_startup_program", "resnet.TSN_ResNet", "paddle.fluid.layers.data", "numpy.argsort", "paddle.fluid.default_main_program", "paddle.fluid.Executor", "functools.partial", "paddle.fluid.io.load_vars", "paddl...
[((279, 323), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (302, 323), False, 'import argparse\n'), ((334, 384), 'functools.partial', 'functools.partial', (['add_arguments'], {'argparser': 'parser'}), '(add_arguments, argparser=parser)\n', (351, 384)...
import os import numpy as np import torch import torch.utils.data as data from .common import flatten_first_dim, load_dataset, load_datasets, data_dir, dataset_bounds from .utils import * batch_size = 1 input_features = [ 'x', 'y', 'z', 'q', 'ax', 'ay', 'az', 'rq' ] list_datasets_lab = [ '3d/l...
[ "os.path.join", "numpy.min", "torch.from_numpy", "numpy.max", "numpy.append", "torch.utils.data.DataLoader" ]
[((1640, 1694), 'numpy.min', 'np.min', (['(lab_min, carm_min, test_min, val_min)'], {'axis': '(0)'}), '((lab_min, carm_min, test_min, val_min), axis=0)\n', (1646, 1694), True, 'import numpy as np\n'), ((1705, 1759), 'numpy.max', 'np.max', (['(lab_max, carm_max, test_max, val_max)'], {'axis': '(0)'}), '((lab_max, carm_m...
import types import logging import time import numpy as np from jbopt.de import de from jbopt.classic import classical from starkit.fitkit.priors import PriorCollection logger = logging.getLogger(__name__) def fit_evaluate(self, model_param): # returns the likelihood of observing the data given the model param...
[ "logging.getLogger", "jbopt.de.de", "numpy.asarray", "jbopt.classic.classical", "types.MethodType", "time.time" ]
[((181, 208), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (198, 208), False, 'import logging\n'), ((732, 748), 'numpy.asarray', 'np.asarray', (['cube'], {}), '(cube)\n', (742, 748), True, 'import numpy as np\n'), ((1080, 1127), 'types.MethodType', 'types.MethodType', (['fit_evaluate', ...
import xbos_services_getter as xsg import numpy as np """Thermostat class to model temperature change. Note, set STANDARD fields to specify error for actions which do not have enough data for valid predictions. """ class Tstat: STANDARD_MEAN = 0 STANDARD_VAR = 0 STANDARD_UNIT = "F" def __init__(self, ...
[ "numpy.random.normal", "xbos_services_getter.get_indoor_temperature_prediction_stub", "xbos_services_getter.get_indoor_temperature_prediction_error" ]
[((549, 593), 'xbos_services_getter.get_indoor_temperature_prediction_stub', 'xsg.get_indoor_temperature_prediction_stub', ([], {}), '()\n', (591, 593), True, 'import xbos_services_getter as xsg\n'), ((2070, 2141), 'numpy.random.normal', 'np.random.normal', (["self.error[action]['mean']", "self.error[action]['var']"], ...
""" Neural Network to implement AND gate using McCulloch-Pitts Neuron Model. """ import numpy as np from .neurons import neuron def main(): print("\n*** Neural Network for AND Operation ***") print("\ny = x1 . x2") x1 = np.array([0, 0, 1, 1]) x2 = np.array([0, 1, 0, 1]) y: np.array = np.logical...
[ "numpy.array", "numpy.logical_and" ]
[((236, 258), 'numpy.array', 'np.array', (['[0, 0, 1, 1]'], {}), '([0, 0, 1, 1])\n', (244, 258), True, 'import numpy as np\n'), ((268, 290), 'numpy.array', 'np.array', (['[0, 1, 0, 1]'], {}), '([0, 1, 0, 1])\n', (276, 290), True, 'import numpy as np\n'), ((310, 332), 'numpy.logical_and', 'np.logical_and', (['x1', 'x2']...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import base64 import glob from scipy.signal import medfilt from scipy.integrate import trapz import xml.etree.ElementTree as et from datetime import date today = date.today() np.warnings.filterwarnings('ignore') ...
[ "seaborn.set", "pandas.pivot_table", "numpy.repeat", "xml.etree.ElementTree.parse", "numpy.asarray", "numpy.diff", "numpy.linspace", "pandas.DataFrame", "glob.glob", "numpy.abs", "numpy.warnings.filterwarnings", "numpy.isnan", "datetime.date.today", "numpy.median", "base64.b64decode", ...
[((266, 278), 'datetime.date.today', 'date.today', ([], {}), '()\n', (276, 278), False, 'from datetime import date\n'), ((282, 318), 'numpy.warnings.filterwarnings', 'np.warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (308, 318), True, 'import numpy as np\n'), ((320, 345), 'seaborn.set', 'sns.set', ([...
import os import numpy as np import crepe # this data contains a sine sweep file = os.path.join(os.path.dirname(__file__), 'sweep.wav') f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv') def verify_f0(): result = np.loadtxt(f0_file, delimiter=',', skiprows=1) # it should be confident enough a...
[ "numpy.mean", "numpy.allclose", "torch.as_tensor", "numpy.corrcoef", "crepe.predict", "crepe.torch_backend.DataHelper", "os.path.dirname", "crepe.core.get_frames", "torch.cuda.is_available", "functools.partial", "scipy.io.wavfile.read", "crepe.process_file", "numpy.loadtxt", "os.remove" ]
[((97, 122), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (112, 122), False, 'import os\n'), ((160, 185), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (175, 185), False, 'import os\n'), ((235, 281), 'numpy.loadtxt', 'np.loadtxt', (['f0_file'], {'delimiter': '"""...
import numpy as np import collections class Hopfield(): """ The hopfield network in the simplest case of AMIT book in attractor neural network """ def __init__(self, n_dim=3, T=0, prng=np.random): self.prng = prng self.n_dim = n_dim self.s = np.sign(prng.normal(size=n_dim)) ...
[ "numpy.mean", "numpy.diag_indices_from", "numpy.copy", "collections.deque", "numpy.ones", "numpy.sqrt", "numpy.zeros", "numpy.outer", "numpy.dot", "numpy.sign", "numpy.linalg.norm" ]
[((337, 352), 'numpy.zeros', 'np.zeros', (['n_dim'], {}), '(n_dim)\n', (345, 352), True, 'import numpy as np\n'), ((1001, 1035), 'numpy.zeros', 'np.zeros', (['(self.n_dim, self.n_dim)'], {}), '((self.n_dim, self.n_dim))\n', (1009, 1035), True, 'import numpy as np\n'), ((1884, 1899), 'numpy.sign', 'np.sign', (['self.h']...
from itertools import islice from itertools import islice import matplotlib.pyplot as plt import numpy as np import torch from torch.autograd import Variable from torch import utils import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import os import pickle from torchvision import datasets...
[ "numpy.transpose", "torch.nn.functional.mse_loss", "torch.nn.ReLU", "torchvision.transforms.ToTensor", "matplotlib.pyplot.ylabel", "conv_utils.DCT", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "torchvision.transforms.Scale", "torch.nn.Conv2d", "torchvision.transforms.RandomCrop", "to...
[((11196, 11218), 'matplotlib.pyplot.plot', 'plt.plot', (['loss_history'], {}), '(loss_history)\n', (11204, 11218), True, 'import matplotlib.pyplot as plt\n'), ((11219, 11242), 'matplotlib.pyplot.title', 'plt.title', (['"""Model loss"""'], {}), "('Model loss')\n", (11228, 11242), True, 'import matplotlib.pyplot as plt\...
# coding: utf-8 import numpy as np import argparse import torch import os from shutil import rmtree import torch.nn as nn import torch.nn.functional as F from torch.distributions import Bernoulli from copy import deepcopy from envs import IPD # from torch.utils.tensorboard import SummaryWriter from tensorboardX import...
[ "torch.histc", "torch.from_numpy", "envs.IPD", "os.path.exists", "numpy.mean", "tensorboardX.SummaryWriter", "argparse.ArgumentParser", "torch.eye", "torch.nn.functional.kl_div", "models.SteerablePolicy", "torch.randn", "plotting.plot", "torch.autograd.grad", "models.PolicyEvaluationNetwor...
[((452, 477), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (475, 477), False, 'import argparse\n'), ((2116, 2137), 'torch.sigmoid', 'torch.sigmoid', (['theta1'], {}), '(theta1)\n', (2129, 2137), False, 'import torch\n'), ((2147, 2185), 'torch.sigmoid', 'torch.sigmoid', (['theta2[[0, 1, 3, 2, ...
import json import os # Parse ISO date import dateutil.parser as dapa import pandas as pd from matplotlib import pyplot as plt import numpy as np strategy_indices = { 'FIXED': 0, 'OPTIMIZED': 1, 'FINED': 2 } strategy_labels = { 0: 'FIX({} ,{})', 1: 'OPT({}, {})', 2: 'FIN({}, {})' } legend_la...
[ "numpy.mean", "dateutil.parser.parse", "os.listdir", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figtext", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figlegend", "os.path.join", "matplotlib.pyplot.close", "numpy.array", "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.round" ...
[((2860, 2879), 'matplotlib.pyplot.savefig', 'plt.savefig', (['output'], {}), '(output)\n', (2871, 2879), True, 'from matplotlib import pyplot as plt\n'), ((2911, 2922), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (2920, 2922), True, 'from matplotlib import pyplot as plt\n'), ((3031, 3054), 'os.listdir', ...
import logging from typing import Tuple import pandas as pd import numpy as np from cachetools import cached from cachetools.keys import hashkey from . import _get_common_columns logger = logging.getLogger(__name__) ACCEPTED_TYPES = ["linear"] def distance(source: pd.Series, target: pd.Series, answers: pd.DataF...
[ "logging.getLogger", "numpy.float", "cachetools.keys.hashkey", "numpy.isnan", "numpy.int" ]
[((192, 219), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (209, 219), False, 'import logging\n'), ((1858, 1869), 'numpy.float', 'np.float', (['(0)'], {}), '(0)\n', (1866, 1869), True, 'import numpy as np\n'), ((1829, 1852), 'numpy.isnan', 'np.isnan', (['distance_mean'], {}), '(distance...
""" Defining standard tensorflow layers as modules. """ import tensorflow as tf from deeplearning import module from deeplearning import tf_util as U import numpy as np class Input(module.Module): ninputs=0 class Placeholder(Input): def __init__(self, dtype, shape, name, default=None): super().__init...
[ "tensorflow.variance_scaling_initializer", "deeplearning.tf_util.batch_to_seq", "tensorflow.layers.flatten", "numpy.repeat", "tensorflow.losses.softmax_cross_entropy", "tensorflow.placeholder", "deeplearning.tf_util.seq_to_batch", "tensorflow.placeholder_with_default", "numpy.zeros", "tensorflow.s...
[((3068, 3108), 'numpy.zeros', 'np.zeros', (['(nlstm * 2,)'], {'dtype': 'np.float32'}), '((nlstm * 2,), dtype=np.float32)\n', (3076, 3108), True, 'import numpy as np\n'), ((3550, 3592), 'deeplearning.tf_util.batch_to_seq', 'U.batch_to_seq', (['M', 'self.nbatch', 'self.nstep'], {}), '(M, self.nbatch, self.nstep)\n', (35...
import argparse import string from nltk.corpus import stopwords from nltk.util import ngrams from nltk.lm import NgramCounter from sklearn.feature_extraction.text import CountVectorizer import pandas as pd import numpy as np from tqdm import tqdm import parmap import os, pickle from multiprocessing import Pool from ite...
[ "time.ctime", "pandas.to_timedelta", "nltk.corpus.stopwords.words", "argparse.ArgumentParser", "pandas.read_csv", "sklearn.feature_extraction.text.CountVectorizer", "os.path.join", "nltk.lm.NgramCounter", "numpy.max", "nltk.util.ngrams", "multiprocessing.Pool", "numpy.min", "numpy.timedelta6...
[((385, 512), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Preprocess notes, extract ventilation duration, and prepare for running MixEHR"""'}), "(description=\n 'Preprocess notes, extract ventilation duration, and prepare for running MixEHR'\n )\n", (408, 512), False, 'import ar...
#!/usr/bin/env python3 # ======================================================================== # # Imports # # ======================================================================== import os import shutil import argparse import subprocess as sp import numpy as np import time from datetime import timedelta # ===...
[ "os.path.exists", "argparse.ArgumentParser", "os.makedirs", "subprocess.Popen", "os.path.join", "os.getcwd", "os.chdir", "numpy.linspace", "shutil.rmtree", "os.path.abspath", "datetime.timedelta", "time.time", "numpy.arange" ]
[((528, 539), 'time.time', 'time.time', ([], {}), '()\n', (537, 539), False, 'import time\n'), ((576, 624), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run cases"""'}), "(description='Run cases')\n", (599, 624), False, 'import argparse\n'), ((802, 822), 'numpy.arange', 'np.arange', ([...
""" Автор: <NAME> Группа: КБ-161 Вариант: 11 Дата создания: 19/04/2018 Python Version: 3.6 """ import math import sys import warnings import numpy as np import matplotlib.pyplot as plt # Constants accuracy = 0.00001 START_X = 0.2 END_X = 0.8 START_Y = 1 END_Y = 3 x = [0.35, 0.41, 0.47, 0.51, 0.56,...
[ "matplotlib.pyplot.grid", "numpy.linalg.det", "matplotlib.pyplot.axhline", "numpy.array", "matplotlib.pyplot.scatter", "matplotlib.pyplot.axis", "matplotlib.pyplot.axvline", "matplotlib.pyplot.show" ]
[((1141, 1155), 'matplotlib.pyplot.grid', 'plt.grid', (['(True)'], {}), '(True)\n', (1149, 1155), True, 'import matplotlib.pyplot as plt\n'), ((1160, 1202), 'matplotlib.pyplot.axis', 'plt.axis', (['[START_X, END_X, START_Y, END_Y]'], {}), '([START_X, END_X, START_Y, END_Y])\n', (1168, 1202), True, 'import matplotlib.py...
import pandas as pd import numpy as np from scipy.stats import skew df_test = pd.read_csv("../../test.csv") df_train = pd.read_csv("../../train.csv") TARGET = 'SalePrice' #删除缺失值特征 #对存在大量缺失值的特征进行删除 #对于缺失值,不同情况不同分析 高特征的低缺失值可以尝试填充估计;高缺失值的可以通过回归估计计算 #低特征的低缺失值可以不做处理;高缺失值的可直接剔除字段 #通过观察发现出现缺失值的字段的相关系数都很低,特征都不明显,因此可以删除 to...
[ "pandas.read_csv", "pandas.DataFrame", "numpy.log", "numpy.array", "pandas.get_dummies", "numpy.log1p", "pandas.concat" ]
[((79, 108), 'pandas.read_csv', 'pd.read_csv', (['"""../../test.csv"""'], {}), "('../../test.csv')\n", (90, 108), True, 'import pandas as pd\n'), ((120, 150), 'pandas.read_csv', 'pd.read_csv', (['"""../../train.csv"""'], {}), "('../../train.csv')\n", (131, 150), True, 'import pandas as pd\n'), ((485, 547), 'pandas.conc...
from torch import nn, optim import torch from .fit import set_determenistic import numpy as np class mlp(nn.Module): def __init__(self, in_features, n_hidden, seed=None): set_determenistic(seed) super().__init__() self.in_features = in_features n_middle= i...
[ "torch.nn.Sigmoid", "torch.nn.LSTM", "numpy.array", "torch.tensor", "torch.nn.Linear", "torch.set_grad_enabled", "torch.zeros", "torch.cat", "torch.device" ]
[((385, 442), 'torch.nn.Linear', 'nn.Linear', ([], {'in_features': 'in_features', 'out_features': 'n_middle'}), '(in_features=in_features, out_features=n_middle)\n', (394, 442), False, 'from torch import nn, optim\n'), ((466, 520), 'torch.nn.Linear', 'nn.Linear', ([], {'in_features': 'n_middle', 'out_features': 'n_hidd...
# %% import pandas as pd import numpy as np from datetime import datetime import os import pickle import matplotlib.pyplot as plt import scipy.special as sc from scipy.stats import norm from scipy.stats import lognorm import copy import matplotlib.pyplot as plt exec(open('../env_vars.py').read()) dir_data = os.envir...
[ "numpy.eye", "os.path.realpath", "numpy.array", "numpy.random.seed", "copy.deepcopy", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show" ]
[((558, 584), 'copy.deepcopy', 'copy.deepcopy', (['latent_data'], {}), '(latent_data)\n', (571, 584), False, 'import copy\n'), ((602, 627), 'copy.deepcopy', 'copy.deepcopy', (['clean_data'], {}), '(clean_data)\n', (615, 627), False, 'import copy\n'), ((1257, 1284), 'numpy.random.seed', 'np.random.seed', ([], {'seed': '...
import glob import os from typing import Tuple import numpy as np from PIL import Image import tensorflow as tf from models import resnet50 from tensorflow import lite as tf_lite CHECKPOINT_DIR = './checkpoints/resnet50' TF_LITE_MODEL = './tflite-models/resnet50.tflite' def run_tflite(interpreter: tf_lite.Interpret...
[ "tensorflow.lite.Interpreter", "numpy.mean", "PIL.Image.open", "numpy.asarray", "models.resnet50", "numpy.expand_dims", "tensorflow.train.latest_checkpoint", "glob.glob" ]
[((1054, 1098), 'glob.glob', 'glob.glob', (['"""./assets/imagenet-val-samples/*"""'], {}), "('./assets/imagenet-val-samples/*')\n", (1063, 1098), False, 'import glob\n'), ((1114, 1156), 'tensorflow.train.latest_checkpoint', 'tf.train.latest_checkpoint', (['CHECKPOINT_DIR'], {}), '(CHECKPOINT_DIR)\n', (1140, 1156), True...
import click import os import pandas as pd import torch import logging import random import numpy as np import logging import ray from itertools import tee import pickle from sklearn.metrics import roc_auc_score, precision_recall_curve, auc from ray import tune from ray.tune import track from ray.tune.suggest.ax import...
[ "torch.manual_seed", "ray.init", "models.deepSVDD.DeepSVDD", "click.option", "sklearn.metrics.auc", "os.path.join", "sklearn.metrics.precision_recall_curve", "random.seed", "sklearn.metrics.roc_auc_score", "ray.tune.grid_search", "numpy.array", "torch.cuda.is_available", "click.Path", "num...
[((4872, 4887), 'click.command', 'click.command', ([], {}), '()\n', (4885, 4887), False, 'import click\n'), ((5436, 5528), 'click.option', 'click.option', (['"""--seed"""'], {'type': 'int', 'default': '(0)', 'help': '"""Set seed. If -1, use randomization."""'}), "('--seed', type=int, default=0, help=\n 'Set seed. If...
# Licensed under the BSD 3-Clause License # Copyright (C) 2021 GeospaceLab (geospacelab) # Author: <NAME>, Space Physics and Astronomy, University of Oulu __author__ = "<NAME>" __copyright__ = "Copyright 2021, GeospaceLab" __license__ = "BSD-3-Clause License" __email__ = "<EMAIL>" __docformat__ = "reStructureText" i...
[ "datetime.datetime", "geospacelab.toolbox.utilities.pydatetime.get_diff_days", "datetime.datetime.utcfromtimestamp", "cftime.date2num", "pathlib.Path", "datetime.datetime.strptime", "netCDF4.Dataset", "datetime.timedelta", "numpy.array", "numpy.empty_like", "re.findall" ]
[((5637, 5667), 'datetime.datetime', 'datetime.datetime', (['(2016)', '(3)', '(15)'], {}), '(2016, 3, 15)\n', (5654, 5667), False, 'import datetime\n'), ((5681, 5711), 'datetime.datetime', 'datetime.datetime', (['(2016)', '(3)', '(15)'], {}), '(2016, 3, 15)\n', (5698, 5711), False, 'import datetime\n'), ((1307, 1351), ...
''' Tools for generating fractals. <NAME>, 2019 ''' import numpy; import os; import numba; MAX_ITERATIONS=1000 NEXT_PLOT_NUM=0 # Wether or not to output information to the terminal when running. PRINT_MESSAGES=True # Have constantly updating filename def NEXT_PLOT(suffix=''): global NEXT_PLOT_NUM NEXT...
[ "numpy.ones", "numpy.absolute", "os.path.isfile", "tkinter.Canvas", "numpy.zeros", "numba.jit", "numpy.linspace", "tkinter.Tk", "numpy.rot90" ]
[((610, 634), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (619, 634), False, 'import numba\n'), ((903, 927), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (912, 927), False, 'import numba\n'), ((499, 522), 'os.path.isfile', 'os.path.isfile', (['ret_val'], ...