code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""Create tables from data-objects"""
# Author: <NAME> <<EMAIL>>
from itertools import zip_longest
from operator import itemgetter
import re
from typing import Callable, Sequence, Union
from warnings import warn
import numpy as np
from . import fmtxt
from ._celltable import Celltable
from ._exceptions import KeysMiss... | [
"numpy.sum",
"numpy.logical_and",
"numpy.empty",
"itertools.zip_longest",
"re.match",
"numpy.any",
"numpy.diff",
"operator.itemgetter",
"numpy.unique"
] | [((16283, 16316), 'itertools.zip_longest', 'zip_longest', (['xs', 'data_vars', 'names'], {}), '(xs, data_vars, names)\n', (16294, 16316), False, 'from itertools import zip_longest\n'), ((4872, 4886), 'numpy.unique', 'np.unique', (['y.x'], {}), '(y.x)\n', (4881, 4886), True, 'import numpy as np\n'), ((14653, 14676), 'nu... |
import os
import sys
import argparse
import numpy as np
import tensorflow as tf
from pathlib import Path
from tensorflow import keras
from datetime import datetime
import matplotlib.pyplot as plt
from azureml.core.run import Run
from amlcallback import AMLCallback
from tensorflow.keras.optimizers import Adam
from six.m... | [
"numpy.load",
"argparse.ArgumentParser",
"os.makedirs",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.close",
"azureml.core.run.Run.get_context",
"os.path.exists",
"datetime.datetime.now",
"pathlib.Path",
"tensorflow.keras.optimizers.Adam",
"six.moves.urllib.request.urlretrieve",
"amlcal... | [((1995, 2006), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (2004, 2006), True, 'import matplotlib.pyplot as plt\n'), ((3202, 3218), 'amlcallback.AMLCallback', 'AMLCallback', (['run'], {}), '(run)\n', (3213, 3218), False, 'from amlcallback import AMLCallback\n'), ((3598, 3638), 'os.path.join', 'os.path.jo... |
import csv
import cv2
import numpy as np
from glob import glob
import os
from keras.models import Sequential
from keras.layers import Flatten, Lambda, Dense, Dropout, Activation, ELU, BatchNormalization
from keras.layers import Dropout, Conv2D, Convolution2D, MaxPooling2D, Cropping2D
from keras.callbacks import Tensor... | [
"keras.layers.Activation",
"keras.layers.Flatten",
"cv2.imread",
"keras.layers.Dense",
"keras.layers.Lambda",
"numpy.array",
"keras.layers.Conv2D",
"keras.models.Sequential",
"keras.layers.MaxPooling2D"
] | [((731, 747), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (739, 747), True, 'import numpy as np\n'), ((757, 773), 'numpy.array', 'np.array', (['labels'], {}), '(labels)\n', (765, 773), True, 'import numpy as np\n'), ((952, 964), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (962, 964), False... |
from __future__ import division
import numpy as np
import unittest
from openmdao.api import Problem, Group, IndepVarComp, ExplicitComponent
from openmdao.utils.assert_utils import assert_rel_error
try:
from openmdao.parallel_api import PETScVector
except ImportError:
PETScVector = None
class ReconfComp(Expl... | [
"unittest.main",
"openmdao.utils.assert_utils.assert_rel_error",
"openmdao.api.IndepVarComp",
"openmdao.api.Problem",
"numpy.zeros",
"numpy.ones"
] | [((3827, 3842), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3840, 3842), False, 'import unittest\n'), ((1218, 1227), 'openmdao.api.Problem', 'Problem', ([], {}), '()\n', (1225, 1227), False, 'from openmdao.api import Problem, Group, IndepVarComp, ExplicitComponent\n'), ((1693, 1728), 'openmdao.utils.assert_uti... |
# the different frameworks interfer with each other and
# sometimes cause segfaults or similar problems;
# choosing the right import order seems to be a
# workaround; given the current test order,
# first import tensorflow, then pytorch and then
# according to test order seems to solve it
import tensorflow
print(tensor... | [
"numpy.random.seed",
"numpy.argmax",
"numpy.mean",
"foolbox.criteria.TargetClass",
"foolbox.criteria.Misclassification",
"foolbox.models.TensorFlowModel",
"os.path.dirname",
"tensorflow.placeholder",
"torch.mean",
"foolbox.utils.binarize",
"numpy.asarray",
"pytest.fixture",
"tensorflow.reduc... | [((3813, 3914), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[CoordinateWiseGradientEstimator, EvolutionaryStrategiesGradientEstimator]'}), '(params=[CoordinateWiseGradientEstimator,\n EvolutionaryStrategiesGradientEstimator])\n', (3827, 3914), False, 'import pytest\n'), ((6835, 6936), 'pytest.fixture', 'pyt... |
__author__ = "<NAME>"
"""
This files contains the implementation of Glynn's formula for permanent calculation,
that uses Gray codes to during the iterations. This method has the same complexity
as the Ryser formula (O(n2^n), but has been proven to be numerically more stable
(due to physical limitations... | [
"numpy.complex128",
"math.prod"
] | [((1588, 1601), 'numpy.complex128', 'complex128', (['(1)'], {}), '(1)\n', (1598, 1601), False, 'from numpy import ndarray, complex128, ones\n'), ((1943, 1953), 'math.prod', 'prod', (['sums'], {}), '(sums)\n', (1947, 1953), False, 'from math import prod\n'), ((1797, 1810), 'numpy.complex128', 'complex128', (['(0)'], {})... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"numpy.cos"
] | [((863, 898), 'numpy.cos', 'np.cos', (['(np.pi * step_ / decay_steps)'], {}), '(np.pi * step_ / decay_steps)\n', (869, 898), True, 'import numpy as np\n')] |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... | [
"unittest.main",
"oneflow.arange",
"oneflow._C.logical_slice",
"oneflow.unittest.skip_unless_1n2d",
"numpy.array",
"oneflow.sbp.split",
"oneflow.env.all_device_placement",
"os.getenv"
] | [((687, 719), 'oneflow.unittest.skip_unless_1n2d', 'flow.unittest.skip_unless_1n2d', ([], {}), '()\n', (717, 719), True, 'import oneflow as flow\n'), ((737, 771), 'os.getenv', 'os.getenv', (['"""ONEFLOW_TEST_CPU_ONLY"""'], {}), "('ONEFLOW_TEST_CPU_ONLY')\n", (746, 771), False, 'import os\n'), ((1632, 1647), 'unittest.m... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
import os
import unittest
import n... | [
"nimbusml.FileDataStream",
"numpy.random.seed",
"pandas.read_csv",
"sklearn.utils.testing.assert_equal",
"nimbusml.ensemble.LightGbmRanker",
"sklearn.utils.testing.assert_true",
"unittest.skipIf",
"nimbusml.feature_extraction.categorical.OneHotVectorizer",
"nimbusml.linear_model.FastLinearClassifier... | [((1688, 1735), 'nimbusml.FileDataStream', 'FileDataStream', (['infert_file'], {'schema': 'file_schema'}), '(infert_file, schema=file_schema)\n', (1702, 1735), False, 'from nimbusml import Pipeline, FileDataStream, Role, DataSchema\n'), ((1975, 2015), 'nimbusml.tests.test_utils.split_features_and_label', 'split_feature... |
# This code is based on: https://github.com/nutonomy/second.pytorch.git
#
# MIT License
# Copyright (c) 2018
# 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 ... | [
"torch.FloatTensor",
"torch.nn.functional.softmax",
"torch.sigmoid",
"torch.clamp",
"torch.max",
"torch.tensor",
"torch.sum",
"numpy.prod"
] | [((3135, 3153), 'torch.sum', 'torch.sum', (['weights'], {}), '(weights)\n', (3144, 3153), False, 'import torch\n'), ((11173, 11210), 'torch.clamp', 'torch.clamp', (['self.prec_count'], {'min': '(1.0)'}), '(self.prec_count, min=1.0)\n', (11184, 11210), False, 'import torch\n'), ((11231, 11267), 'torch.clamp', 'torch.cla... |
# This tool converts a sequential data set into a number of equally sized windows,
# to be used for supervised training.
__author__ = "<NAME>"
from numpy import r_, array, isfinite
from pybrain.datasets import SequentialDataSet
def convertSequenceToTimeWindows(DSseq, NewClass, winsize):
""" Converts a sequentia... | [
"numpy.array",
"numpy.isfinite"
] | [((2821, 2835), 'numpy.array', 'array', (['seq_res'], {}), '(seq_res)\n', (2826, 2835), False, 'from numpy import r_, array, isfinite\n'), ((3714, 3722), 'numpy.array', 'array', (['c'], {}), '(c)\n', (3719, 3722), False, 'from numpy import r_, array, isfinite\n'), ((4952, 4975), 'numpy.isfinite', 'isfinite', (['self.sc... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A performance comparison of the transformer and a traditional recurrent attention-based model.
This module measures how long it takes to process one training batch of a (random) sequence-to-sequence task. The
architecture of the recurrent model that the transformer is... | [
"transformer.Transformer",
"torch.nn.GRU",
"torch.stack",
"torch.nn.Tanh",
"torch.nn.Embedding",
"torch.FloatTensor",
"torch.cat",
"time.time",
"torch.nn.init.normal_",
"numpy.random.randint",
"torch.nn.Softmax",
"numpy.mean",
"torch.nn.Linear"
] | [((8214, 8254), 'torch.nn.Embedding', 'nn.Embedding', (['VOCAB_SIZE', 'EMBEDDING_SIZE'], {}), '(VOCAB_SIZE, EMBEDDING_SIZE)\n', (8226, 8254), False, 'from torch import nn\n'), ((8622, 8737), 'transformer.Transformer', 'transformer.Transformer', (['emb', '(0)', 'emb.num_embeddings'], {'max_seq_len': 'INPUT_LEN', 'dim_mo... |
"""
main.py
Example: python3 main.py --DURATION_S 10 --TOP_K 5
"""
######################
# Import waggle modules
######################
from waggle import plugin
from waggle.data.audio import AudioFolder, Microphone
import argparse
import logging
import time
######################
# Import main modules
###########... | [
"wave.open",
"logging.basicConfig",
"time.sleep",
"waggle.plugin.init",
"logging.info",
"waggle.plugin.upload_file",
"numpy.squeeze",
"waggle.plugin.publish",
"waggle.data.audio.Microphone"
] | [((746, 852), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s %(message)s"""', 'datefmt': '"""%Y/%m/%d %H:%M:%S"""'}), "(level=logging.INFO, format='%(asctime)s %(message)s',\n datefmt='%Y/%m/%d %H:%M:%S')\n", (765, 852), False, 'import logging\n'), ((1129, 1142... |
import os
import math
import numpy as np
import random
from scipy.interpolate import splev, splrep, interp1d
def interp_wp_linear(x,y,interp_res):
f = interp1d(x, y)
x_interp = np.arange(min(x), max(x)+interp_res, interp_res)
y_interp = f(x_interp)
return x_interp, y_interp
def interp_wp_cubic(x,y,interp_res):
... | [
"os.path.join",
"scipy.interpolate.splev",
"numpy.linspace",
"numpy.interp",
"scipy.interpolate.interp1d",
"scipy.interpolate.splrep"
] | [((1184, 1234), 'numpy.linspace', 'np.linspace', (['x_list[0]', 'x_list[-1]'], {'num': 'num_points'}), '(x_list[0], x_list[-1], num=num_points)\n', (1195, 1234), True, 'import numpy as np\n'), ((1246, 1278), 'numpy.interp', 'np.interp', (['xvals', 'x_list', 'y_list'], {}), '(xvals, x_list, y_list)\n', (1255, 1278), Tru... |
from abc import ABC, abstractmethod
from typing import Union
import numpy as np
from copy import deepcopy
from spikeextractors.baseextractor import BaseExtractor
from .extraction_tools import (
ArrayType,
PathType,
NumpyArray,
DtypeType,
IntType,
FloatType,
check_get_videos_args,
)
class... | [
"copy.deepcopy",
"spikeextractors.baseextractor.BaseExtractor.__init__",
"numpy.searchsorted"
] | [((499, 527), 'spikeextractors.baseextractor.BaseExtractor.__init__', 'BaseExtractor.__init__', (['self'], {}), '(self)\n', (521, 527), False, 'from spikeextractors.baseextractor import BaseExtractor\n'), ((3866, 3892), 'copy.deepcopy', 'deepcopy', (['extractor._times'], {}), '(extractor._times)\n', (3874, 3892), False... |
import re
import os
from collections import Counter
import sys
import argparse
from transformers import BertModel
from transformers import BertTokenizer
import torch
from torch import nn
import torch.optim as optim
import numpy as np
import random
from booknlp.common.pipelines import Token, Entity
from booknlp.engli... | [
"torch.nn.Dropout",
"numpy.random.seed",
"torch.nn.Embedding",
"torch.cat",
"numpy.arange",
"torch.FloatTensor",
"torch.exp",
"random.seed",
"torch.nn.Linear",
"transformers.BertModel.from_pretrained",
"torch.matmul",
"re.search",
"re.sub",
"torch.logsumexp",
"numpy.vectorize",
"torch.... | [((464, 478), 'random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (475, 478), False, 'import random\n'), ((479, 496), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (493, 496), True, 'import numpy as np\n'), ((497, 517), 'torch.manual_seed', 'torch.manual_seed', (['(1)'], {}), '(1)\n', (514, 517), Fal... |
"""Test fixtures for kernels."""
from typing import Callable, Optional
import numpy as np
import pytest
import probnum as pn
from probnum.typing import ShapeType
@pytest.fixture(
params=[pytest.param(seed, id=f"seed{seed}") for seed in range(1)],
name="rng",
)
def fixture_rng(request):
"""Random state(... | [
"numpy.random.default_rng",
"pytest.param",
"pytest.fixture",
"numpy.vectorize"
] | [((1902, 1942), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""kernel_call_naive"""'}), "(name='kernel_call_naive')\n", (1916, 1942), False, 'import pytest\n'), ((3536, 3561), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""x0"""'}), "(name='x0')\n", (3550, 3561), False, 'import pytest\n'), ((3800, 3825), ... |
#To plot 2D PS for a given tau, polystr, offset and header
#plots for given total_signal, total_noise, recovered_signal
import numpy as np
import matplotlib.pyplot as plt
import argparse
import sys
import matplotlib as mpl
from mpl_toolkits.axes_grid1 import make_axes_locatable
parser = argparse.ArgumentP... | [
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.yscale",
"argparse.ArgumentParser",
"sys.exit",
"numpy.clip",
"matplotlib.pyplot.colorbar",
"numpy.loadtxt",
"matplotlib.pyplot.clim",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tight_layout",
"numpy.fromstring",
... | [((302, 327), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (325, 327), False, 'import argparse\n'), ((1741, 1771), 'numpy.loadtxt', 'np.loadtxt', (['xfile'], {'unpack': '(True)'}), '(xfile, unpack=True)\n', (1751, 1771), True, 'import numpy as np\n'), ((1775, 1805), 'numpy.loadtxt', 'np.loadt... |
from matplotlib import pyplot
import re, argparse
import numpy as np
import plistlib
import sys
# +-----------------------------------------+
# | FIND COMMON TRACKS AMONG MULTIPLE FILES |
# +-----------------------------------------+
def findCommonTracks(fileNames):
# A list of sets of track name... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.hist",
"plistlib.readPlist",
"numpy.max",
"numpy.array",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((1639, 1667), 'plistlib.readPlist', 'plistlib.readPlist', (['fileName'], {}), '(fileName)\n', (1657, 1667), False, 'import plistlib\n'), ((2442, 2471), 'numpy.array', 'np.array', (['durations', 'np.int32'], {}), '(durations, np.int32)\n', (2450, 2471), True, 'import numpy as np\n'), ((2481, 2508), 'numpy.array', 'np.... |
import pytest
import numpy as np
from floodlight.models.kinetics import MetabolicPowerModel
@pytest.mark.unit
def test_calc_es(example_velocity, example_acceleration) -> None:
# Arrange
velocity = example_velocity
acceleration = example_acceleration
# Act
equivalent_slope = MetabolicPowerModel._... | [
"floodlight.models.kinetics.MetabolicPowerModel._calc_ecw",
"floodlight.models.kinetics.MetabolicPowerModel._calc_ecr",
"floodlight.models.kinetics.MetabolicPowerModel._calc_metabolic_power",
"numpy.round",
"floodlight.models.kinetics.MetabolicPowerModel._calc_es",
"floodlight.models.kinetics.MetabolicPow... | [((299, 351), 'floodlight.models.kinetics.MetabolicPowerModel._calc_es', 'MetabolicPowerModel._calc_es', (['velocity', 'acceleration'], {}), '(velocity, acceleration)\n', (327, 351), False, 'from floodlight.models.kinetics import MetabolicPowerModel\n'), ((673, 719), 'floodlight.models.kinetics.MetabolicPowerModel._cal... |
import sys
import os
import numpy as np
from astropy.coordinates import SkyCoord
import astropy.units as u
import MulensModel as mm
SAMPLE_FILE_01 = os.path.join(
mm.DATA_PATH, "photometry_files", "OB08092", "phot_ob08092_O4.dat")
def test_model_coords():
"""
Test Model.coords and different changes of ... | [
"MulensModel.MulensData",
"MulensModel.Model",
"os.path.join",
"MulensModel.Coordinates",
"numpy.testing.assert_almost_equal",
"astropy.coordinates.SkyCoord",
"MulensModel.Event"
] | [((152, 237), 'os.path.join', 'os.path.join', (['mm.DATA_PATH', '"""photometry_files"""', '"""OB08092"""', '"""phot_ob08092_O4.dat"""'], {}), "(mm.DATA_PATH, 'photometry_files', 'OB08092', 'phot_ob08092_O4.dat'\n )\n", (164, 237), False, 'import os\n'), ((349, 406), 'astropy.coordinates.SkyCoord', 'SkyCoord', (['"""... |
import unittest
import numpy as np
from prml import nn
class TestCholesky(unittest.TestCase):
def test_cholesky(self):
A = np.array([
[2., -1],
[-1., 5.]
])
L = np.linalg.cholesky(A)
Ap = nn.Parameter(A)
L_test = nn.linalg.cholesky(Ap)
self.... | [
"unittest.main",
"prml.nn.linalg.cholesky",
"numpy.allclose",
"prml.nn.square",
"numpy.array",
"numpy.linalg.cholesky",
"prml.nn.Parameter"
] | [((733, 748), 'unittest.main', 'unittest.main', ([], {}), '()\n', (746, 748), False, 'import unittest\n'), ((138, 172), 'numpy.array', 'np.array', (['[[2.0, -1], [-1.0, 5.0]]'], {}), '([[2.0, -1], [-1.0, 5.0]])\n', (146, 172), True, 'import numpy as np\n'), ((216, 237), 'numpy.linalg.cholesky', 'np.linalg.cholesky', ([... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from ..stats import standardize, mad
from ..signal import signal_filter
def eeg_gfp(eeg, sampling_rate=None, normalize=False, method="l1", smooth=0, robust=False, standardize_eeg=False):
"""Global Field Power (GFP)
Global Field Power (GFP) const... | [
"numpy.std",
"numpy.max",
"numpy.mean",
"numpy.median"
] | [((4488, 4515), 'numpy.std', 'np.std', (['eeg'], {'axis': '(0)', 'ddof': '(0)'}), '(eeg, axis=0, ddof=0)\n', (4494, 4515), True, 'import numpy as np\n'), ((3151, 3162), 'numpy.max', 'np.max', (['gfp'], {}), '(gfp)\n', (3157, 3162), True, 'import numpy as np\n'), ((4268, 4288), 'numpy.mean', 'np.mean', (['eeg'], {'axis'... |
# ---------------------------------------------------------------------------------------
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal i... | [
"sensor_msgs.msg.Image",
"ros2_trt_pose_hand.utils.preprocess",
"cv2.imshow",
"os.path.join",
"numpy.reshape",
"rclpy.duration.Duration",
"math.isnan",
"cv2.waitKey",
"ros2_trt_pose_hand.utils.load_model",
"numpy.asarray",
"hand_pose_msgs.msg.HandPoseDetection",
"ros2_trt_pose_hand.preprocessd... | [((3193, 3238), 'os.path.join', 'os.path.join', (['self.base_dir', '"""hand_pose.json"""'], {}), "(self.base_dir, 'hand_pose.json')\n", (3205, 3238), False, 'import os\n'), ((4346, 4412), 'ros2_trt_pose_hand.utils.load_params', 'load_params', ([], {'base_dir': 'self.base_dir', 'hand_pose_json': 'self.json_file'}), '(ba... |
import xarray as xr
from dask.diagnostics import ProgressBar
from scipy import stats
import numpy as np
from cmpdata.utils import _regrid
def do_ttest(x,ci=0.95):
rgr= stats.linregress(np.r_[1:len(x)+1],x)
trnd=rgr.slope
tsig = (rgr.pvalue<(1 - ci))
stderr = rgr.stderr
ci = 1.96*stderr... | [
"numpy.ma.masked_all",
"numpy.zeros",
"numpy.isnan",
"dask.diagnostics.ProgressBar",
"xarray.merge",
"cmpdata.utils._regrid",
"xarray.DataArray",
"xarray.open_mfdataset"
] | [((493, 524), 'numpy.ma.masked_all', 'np.ma.masked_all', (['var.shape[1:]'], {}), '(var.shape[1:])\n', (509, 524), True, 'import numpy as np\n'), ((1063, 1089), 'numpy.zeros', 'np.zeros', (['var[0].shape[1:]'], {}), '(var[0].shape[1:])\n', (1071, 1089), True, 'import numpy as np\n'), ((1184, 1272), 'xarray.DataArray', ... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 14 16:14:16 2018
@author: Arbeiten
"""
# -*- coding: utf-8 -*-
"""
SVM Maturaarbeit
Author: <NAME>
Date: 23.04.18
"""
try:
import cvxopt.solvers
except:
print("cvxopt nicht geladen")
import matplotlib.pyplot as plt
from sklearn import datasets
import numpy as ... | [
"matplotlib.pyplot.title",
"numpy.isin",
"pickle.dump",
"numpy.ravel",
"numpy.ones",
"pickle.load",
"matplotlib.pyplot.contour",
"numpy.arange",
"numpy.unique",
"numpy.identity",
"operator.itemgetter",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"n... | [((1108, 1140), 'numpy.zeros', 'np.zeros', (['(n_samples, n_samples)'], {}), '((n_samples, n_samples))\n', (1116, 1140), True, 'import numpy as np\n'), ((2032, 2055), 'numpy.ravel', 'np.ravel', (["solution['x']"], {}), "(solution['x'])\n", (2040, 2055), True, 'import numpy as np\n'), ((7263, 7277), 'pickle.load', 'pick... |
import numpy as np
import pytest
import xarray as xr
from sgkit_plink.pysnptools import read_plink
example_dataset_1 = "plink_sim_10s_100v_10pmiss"
@pytest.fixture(params=[dict()])
def ds1(shared_datadir, request):
path = shared_datadir / example_dataset_1
return read_plink(path=path, bim_sep="\t", fam_sep="... | [
"xarray.testing.assert_equal",
"pytest.main",
"pytest.raises",
"numpy.array",
"sgkit_plink.pysnptools.read_plink",
"numpy.testing.assert_equal",
"numpy.all"
] | [((275, 341), 'sgkit_plink.pysnptools.read_plink', 'read_plink', ([], {'path': 'path', 'bim_sep': '"""\t"""', 'fam_sep': '"""\t"""'}), "(path=path, bim_sep='\\t', fam_sep='\\t', **request.param)\n", (285, 341), False, 'from sgkit_plink.pysnptools import read_plink\n'), ((642, 675), 'xarray.testing.assert_equal', 'xr.te... |
import numpy as np
from PyEFVLib.Point import Point
from PyEFVLib.InnerFace import InnerFace
class Element:
def __init__(self, grid, verticesIndexes, handle):
self.handle = handle
self.grid = grid
self.vertices = np.array([grid.vertices[vertexIndex] for vertexIndex in verticesIndexes])
for vertex in self.ver... | [
"numpy.append",
"numpy.transpose",
"numpy.array",
"PyEFVLib.InnerFace.InnerFace"
] | [((221, 294), 'numpy.array', 'np.array', (['[grid.vertices[vertexIndex] for vertexIndex in verticesIndexes]'], {}), '([grid.vertices[vertexIndex] for vertexIndex in verticesIndexes])\n', (229, 294), True, 'import numpy as np\n'), ((377, 389), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (385, 389), True, 'import ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... | [
"numpy.zeros",
"numpy.transpose",
"numpy.prod",
"numpy.array",
"numpy.reshape",
"numpy.concatenate"
] | [((534, 556), 'numpy.array', 'np.array', (['tensor.shape'], {}), '(tensor.shape)\n', (542, 556), True, 'import numpy as np\n'), ((900, 987), 'numpy.concatenate', 'np.concatenate', (['[size_t_ori[n:n + 1], size_t_ori[0:n], size_t_ori[n + 1:N]]'], {'axis': '(0)'}), '([size_t_ori[n:n + 1], size_t_ori[0:n], size_t_ori[n + ... |
# coding: utf-8
from __future__ import division
from optparse import OptionParser
from collections import OrderedDict
import sys
import os
import numpy as np
from time import time
import yaml
import models
from models import PuncTensor
from utilities import *
import theano
import theano.tensor as T
from theano.compil... | [
"yaml.load",
"optparse.OptionParser",
"sys.stdout.flush",
"numpy.exp",
"theano.tensor.ge",
"theano.tensor.sqrt",
"os.path.join",
"theano.tensor.scalar",
"numpy.prod",
"numpy.round",
"models.GRU_parallel",
"models.GRU_stage2",
"numpy.random.shuffle",
"models.PuncTensor",
"theano.tensor.su... | [((630, 658), 'os.listdir', 'os.listdir', (['sample_directory'], {}), '(sample_directory)\n', (640, 658), False, 'import os\n'), ((6561, 6575), 'theano.tensor.scalar', 'T.scalar', (['"""lr"""'], {}), "('lr')\n", (6569, 6575), True, 'import theano.tensor as T\n'), ((6581, 6595), 'theano.tensor.imatrix', 'T.imatrix', (['... |
import torch
from torch import nn
import numpy as np
from ..second_order import zero_grads
from copy import deepcopy
from tqdm import trange, tqdm
base_config = {
'batch_size': 16,
'device': 'cpu',
'num_samples': 150,
'itr_between_samples':100,
'learning_rate':1e-4
}
class SWAG(nn.Module):
... | [
"torch.ones",
"copy.deepcopy",
"tqdm.tqdm",
"torch.stack",
"torch.utils.data.DataLoader",
"tqdm.trange",
"torch.sqrt",
"torch.randn",
"torch.clamp",
"torch.zeros",
"torch.no_grad",
"numpy.sqrt"
] | [((586, 607), 'copy.deepcopy', 'deepcopy', (['base_config'], {}), '(base_config)\n', (594, 607), False, 'from copy import deepcopy\n'), ((671, 686), 'copy.deepcopy', 'deepcopy', (['model'], {}), '(model)\n', (679, 686), False, 'from copy import deepcopy\n'), ((1704, 1782), 'torch.utils.data.DataLoader', 'torch.utils.da... |
######################################################################
######################################################################
# Copyright <NAME>, Cambridge Dialogue Systems Group, 2017 #
######################################################################
#############################################... | [
"numpy.argsort",
"theano.tensor.log10",
"theano.tensor.nnet.sigmoid",
"theano.tensor.concatenate",
"numpy.multiply",
"math.pow",
"numpy.log10",
"utils.mathUtil.tanh",
"copy.deepcopy",
"theano.tensor.sum",
"theano.tensor.dot",
"Queue.PriorityQueue",
"theano.scan",
"numpy.dot",
"sys.exit",... | [((2295, 2332), 'numpy.random.uniform', 'np.random.uniform', (['(-0.3)', '(0.3)', '(doh * 3)'], {}), '(-0.3, 0.3, doh * 3)\n', (2312, 2332), True, 'import numpy as np\n'), ((4000, 4046), 'numpy.zeros', 'np.zeros', (['(1, doh)'], {'dtype': 'theano.config.floatX'}), '((1, doh), dtype=theano.config.floatX)\n', (4008, 4046... |
import itertools
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from xarray.core.missing import (
NumpyInterpolator,
ScipyInterpolator,
SplineInterpolator,
_get_nan_block_lengths,
get_clean_interp_index,
)
from xarray.core.pycompat import dask_array_type
from xarray.tests... | [
"xarray.tests.raises_regex",
"xarray.Variable",
"numpy.arange",
"pytest.mark.parametrize",
"xarray.tests.assert_equal",
"numpy.full",
"numpy.random.randn",
"xarray.core.missing._get_nan_block_lengths",
"numpy.random.RandomState",
"pytest.raises",
"itertools.product",
"numpy.testing.assert_allc... | [((3440, 3530), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""method"""', "['barycentric', 'krog', 'pchip', 'spline', 'akima']"], {}), "('method', ['barycentric', 'krog', 'pchip', 'spline',\n 'akima'])\n", (3463, 3530), False, 'import pytest\n'), ((12363, 12440), 'pytest.mark.parametrize', 'pytest.mark... |
"""
Path Planning Sample Code with RRT for car like robot.
author: AtsushiSakai(@Atsushi_twi)
"""
import random
import math
import copy
import numpy as np
import dubins_path_planning
import matplotlib.pyplot as plt
show_animation = True
class RRT():
"""
Class for RRT Planning
"""
def __init__(sel... | [
"copy.deepcopy",
"matplotlib.pyplot.show",
"random.randint",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"dubins_path_planning.plot_arrow",
"math.radians",
"math.sqrt",
"math.atan2",
"random.uniform",
"matplotlib.pyplot.axis",
"dubins_path_planning.dubins_path_planning",
"numpy.linalg... | [((2865, 2992), 'dubins_path_planning.dubins_path_planning', 'dubins_path_planning.dubins_path_planning', (['nearestNode.x', 'nearestNode.y', 'nearestNode.yaw', 'rnd[0]', 'rnd[1]', 'rnd[2]', 'curvature'], {}), '(nearestNode.x, nearestNode.y,\n nearestNode.yaw, rnd[0], rnd[1], rnd[2], curvature)\n', (2906, 2992), Fal... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple forward integration test for ODE generators
Comparing numerical results with exact solution
Free vibration of a simple oscillator::
m \ddot{u} + k u = 0, u(0) = u_0 \dot{u}(0) \dot{u}_0
Solution::
u(t) = u_0*cos(sqrt(k/m)*t)+\do... | [
"numpy.sin",
"numpy.array",
"numpy.cos",
"numpy.linspace",
"numpy.sqrt"
] | [((786, 810), 'numpy.array', 'array', (['[1.0, 0.1]', 'float'], {}), '([1.0, 0.1], float)\n', (791, 810), False, 'from numpy import linspace, allclose, array, cos, sin, sqrt\n'), ((1144, 1155), 'numpy.sqrt', 'sqrt', (['(k / m)'], {}), '(k / m)\n', (1148, 1155), False, 'from numpy import linspace, allclose, array, cos, ... |
import gym
import torch
import random
import numpy as np
from agents import Double_DQN_Cnn
import argparse
from utils import init_state, preprocess
import os
import time
def main(args):
env = gym.make(args['env_name'])
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
action_dim = e... | [
"utils.init_state",
"gym.make",
"argparse.ArgumentParser",
"torch.load",
"agents.Double_DQN_Cnn",
"numpy.append",
"torch.cuda.is_available",
"utils.preprocess"
] | [((197, 223), 'gym.make', 'gym.make', (["args['env_name']"], {}), "(args['env_name'])\n", (205, 223), False, 'import gym\n'), ((397, 448), 'agents.Double_DQN_Cnn', 'Double_DQN_Cnn', (['args', 'state_dim', 'action_dim', 'device'], {}), '(args, state_dim, action_dim, device)\n', (411, 448), False, 'from agents import Dou... |
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------------
# Copyright 2021 Arm Limited
#
# 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 ... | [
"json.load",
"argparse.ArgumentParser",
"json.dumps",
"collections.defaultdict",
"numpy.mean",
"argparse.FileType"
] | [((10194, 10204), 'collections.defaultdict', 'ddict', (['int'], {}), '(int)\n', (10199, 10204), True, 'from collections import defaultdict as ddict\n'), ((10872, 10882), 'collections.defaultdict', 'ddict', (['int'], {}), '(int)\n', (10877, 10882), True, 'from collections import defaultdict as ddict\n'), ((15256, 15281)... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 6 11:29:45 2021
@author: sefaaksungu
"""
def MLearning(x1,x2,x3,x4):
# Python version
import sys
#print('Python: {}'.format(sys.version))
# scipy
import scipy
#print('scipy: {}'.format(scipy.__version__))
# numpy
import numpy
#print('n... | [
"sklearn.naive_bayes.GaussianNB",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.model_selection.cross_val_score",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.linear_model.LogisticRegression",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.array",
"sklearn.model_select... | [((1533, 1566), 'pandas.read_csv', 'pandas.read_csv', (['url'], {'names': 'names'}), '(url, names=names)\n', (1548, 1566), False, 'import pandas\n'), ((2247, 2300), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.2)', 'random_state': '(1)'}), '(X, y, test_size=0.2, random_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Functions to do boresight calibration.
@author: <NAME> (<EMAIL>)
"""
import logging, os, numpy as np
logger = logging.getLogger(__name__)
def boresight_calibration(boresight_file, gcp_file, imugps_file, sensor_model_file, dem_image_file, boresight_options):
""" ... | [
"numpy.sum",
"numpy.einsum",
"numpy.ones",
"numpy.sin",
"numpy.arange",
"numpy.interp",
"scipy.optimize.minimize",
"os.path.exists",
"numpy.tan",
"numpy.loadtxt",
"Geography.define_wgs84_crs",
"osr.CoordinateTransformation",
"numpy.cos",
"osr.SpatialReference",
"numpy.deg2rad",
"numpy.... | [((163, 190), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (180, 190), False, 'import logging, os, numpy as np\n'), ((856, 886), 'os.path.exists', 'os.path.exists', (['boresight_file'], {}), '(boresight_file)\n', (870, 886), False, 'import logging, os, numpy as np\n'), ((1113, 1136), 'n... |
import matplotlib.pyplot as plt
import numpy as np
def visualize_detections(detections_dict):
colors = plt.cm.hsv(np.linspace(0, 1, 21)).tolist()
plt.clf()
plt.figure(figsize=(3 * len(detections_dict), 3))
for pid, title in enumerate(detections_dict.keys()):
input_img, detections, mod... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.Rectangle",
"numpy.linspace",
"matplotlib.pyplot.gca"
] | [((162, 171), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (169, 171), True, 'import matplotlib.pyplot as plt\n'), ((1392, 1402), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1400, 1402), True, 'import matplotlib.pyplot as plt\n'), ((507, 523), 'matplotlib.pyplot.title', 'plt.title', (['title'], {}... |
import numpy
class Branin(object):
def __init__(self):
self._dim = 2
self._search_domain = numpy.array([[0, 15], [-5, 15]])
self._num_init_pts = 3
self._sample_var = 0.0
self._min_value = 0.397887
self._observations = []
self._num_fidelity = 0
def evalua... | [
"numpy.log",
"numpy.sin",
"numpy.array",
"numpy.exp",
"numpy.arange",
"numpy.cos",
"numpy.repeat"
] | [((112, 144), 'numpy.array', 'numpy.array', (['[[0, 15], [-5, 15]]'], {}), '([[0, 15], [-5, 15]])\n', (123, 144), False, 'import numpy\n'), ((1207, 1253), 'numpy.repeat', 'numpy.repeat', (['[[-2.0, 2.0]]', 'self._dim'], {'axis': '(0)'}), '([[-2.0, 2.0]], self._dim, axis=0)\n', (1219, 1253), False, 'import numpy\n'), ((... |
import sys
import os
from shutil import copyfile
from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
import xarray as xr
src_dir = os.path.join(os.environ.get('projdir'),'src')
sys.path.append(src_dir)
from features.uvp_masks import uvp_masks
grd_old = os.path.join(os.environ.get('intdir'),'... | [
"sys.path.append",
"netCDF4.Dataset",
"numpy.size",
"os.environ.get",
"features.uvp_masks.uvp_masks",
"numpy.where",
"numpy.array",
"shutil.copyfile"
] | [((204, 228), 'sys.path.append', 'sys.path.append', (['src_dir'], {}), '(src_dir)\n', (219, 228), False, 'import sys\n'), ((420, 446), 'shutil.copyfile', 'copyfile', (['grd_old', 'grd_new'], {}), '(grd_old, grd_new)\n', (428, 446), False, 'from shutil import copyfile\n'), ((2825, 2855), 'numpy.array', 'np.array', (['[4... |
import functools
import numpy as np
import time as timer
import datetime
from _datetime import datetime
from _datetime import date
from matplotlib import pyplot as plt
from numba import jit, njit
from simulation.common import constants
"""
Description: contains the simulation's helper functions.
"""
def timeit(fu... | [
"numpy.empty",
"numpy.sin",
"numpy.degrees",
"numpy.arcsin",
"numpy.float_",
"numpy.insert",
"numpy.append",
"numpy.max",
"numpy.repeat",
"numpy.radians",
"_datetime.date",
"numpy.roll",
"numpy.square",
"time.perf_counter",
"numpy.not_equal",
"_datetime.datetime.utcfromtimestamp",
"n... | [((330, 351), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (345, 351), False, 'import functools\n'), ((1087, 1110), 'numpy.diff', 'np.diff', (['zeroed_indices'], {}), '(zeroed_indices)\n', (1094, 1110), True, 'import numpy as np\n'), ((2371, 2391), 'numpy.diff', 'np.diff', (['input_array'], {}), '(... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import numpy as np
from gym import utils
from gym.envs.mujoco import mujoco_env
TARGET = np.array([0.13345871, 0.21923056, -0.10861196])
THRESH = 0.05
HORIZON = 100
FAILURE_COST = 0
class ReacherS... | [
"gym.utils.EzPickle.__init__",
"numpy.copy",
"os.path.realpath",
"numpy.cross",
"numpy.zeros",
"numpy.sin",
"numpy.array",
"numpy.linalg.norm",
"numpy.random.normal",
"numpy.cos",
"os.path.join",
"numpy.concatenate"
] | [((212, 259), 'numpy.array', 'np.array', (['[0.13345871, 0.21923056, -0.10861196]'], {}), '([0.13345871, 0.21923056, -0.10861196])\n', (220, 259), True, 'import numpy as np\n'), ((443, 472), 'gym.utils.EzPickle.__init__', 'utils.EzPickle.__init__', (['self'], {}), '(self)\n', (466, 472), False, 'from gym import utils\n... |
'''
Copyright 2015 by <NAME>
This file is part of Statistical Parameter Estimation Tool (SPOTPY).
:author: <NAME>
This example implements the Rosenbrock function into SPOT.
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode... | [
"spotpy.objectivefunctions.rmse",
"spotpy.parameter.generate",
"numpy.array",
"spotpy.parameter.Uniform"
] | [((627, 665), 'spotpy.parameter.generate', 'spotpy.parameter.generate', (['self.params'], {}), '(self.params)\n', (652, 665), False, 'import spotpy\n'), ((724, 740), 'numpy.array', 'np.array', (['vector'], {}), '(vector)\n', (732, 740), True, 'import numpy as np\n'), ((446, 494), 'spotpy.parameter.Uniform', 'spotpy.par... |
# Copyright 2018 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | [
"pennylane.ops.Hermitian",
"numpy.diag",
"numpy.round",
"pennylane.utils._get_default_args",
"numpy.identity",
"numpy.kron",
"pennylane.utils.unflatten",
"pennylane.ops.PolyXP",
"pennylane.utils._flatten",
"pennylane.Hermitian",
"autograd.extend.defvjp",
"pennylane.variable.Variable",
"numpy... | [((2090, 2142), 'collections.namedtuple', 'namedtuple', (['"""ParameterDependency"""', "['op', 'par_idx']"], {}), "('ParameterDependency', ['op', 'par_idx'])\n", (2100, 2142), False, 'from collections import namedtuple\n'), ((49889, 49938), 'autograd.extend.defvjp', 'ae.defvjp', (['QNode.evaluate', 'QNode_vjp'], {'argn... |
from matplotlib import pyplot as plt
import cv2
from PIL import Image
def img_hist_plt(gray_image_array):
plt.figure()
plt.hist(gray_image_array.flatten(), 128)
plt.show()
def img_hist_cv2(gray_image_array):
channels = cv2.split(gray_image_array)
new_channels = []
for channel in channels:
... | [
"cv2.equalizeHist",
"matplotlib.pyplot.show",
"cv2.waitKey",
"numpy.asarray",
"PIL.Image.open",
"matplotlib.pyplot.figure",
"cv2.split",
"cv2.imshow",
"matplotlib.pyplot.subplots"
] | [((112, 124), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (122, 124), True, 'from matplotlib import pyplot as plt\n'), ((175, 185), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (183, 185), True, 'from matplotlib import pyplot as plt\n'), ((239, 266), 'cv2.split', 'cv2.split', (['gray_image_ar... |
import numpy as np
import trimesh.visual
import os
import json
partial_scan_dataset_dir = os.path.join(os.sep, 'Volumes', 'warm_blue', 'datasets', 'partial_scans')
denoised_dir = 'test-images_dim32_sdf_pc'
noised_dir = 'NOISE_test-images_dim32_sdf_pc'
if not os.path.isdir(os.path.join(partial_scan_dataset_dir, noised... | [
"json.load",
"os.path.join",
"numpy.random.normal"
] | [((91, 164), 'os.path.join', 'os.path.join', (['os.sep', '"""Volumes"""', '"""warm_blue"""', '"""datasets"""', '"""partial_scans"""'], {}), "(os.sep, 'Volumes', 'warm_blue', 'datasets', 'partial_scans')\n", (103, 164), False, 'import os\n'), ((476, 488), 'json.load', 'json.load', (['f'], {}), '(f)\n', (485, 488), False... |
import pandas as pd
import numpy as np
import os
import pandas as pd
from sklearn.neighbors import KDTree
import pickle
import random
###Building database and query files for evaluation
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
base_path= "../jittered_dataset_4096/"#"../partial_dataset/"
query_path = '../... | [
"pandas.DataFrame",
"os.path.abspath",
"pickle.dump",
"pickle.load",
"numpy.arange",
"sklearn.neighbors.KDTree",
"numpy.array",
"os.path.join"
] | [((4376, 4402), 'numpy.arange', 'np.arange', (['(0.25)', '(2.1)', '(0.25)'], {}), '(0.25, 2.1, 0.25)\n', (4385, 4402), True, 'import numpy as np\n'), ((4799, 4825), 'numpy.arange', 'np.arange', (['(0.25)', '(2.1)', '(0.25)'], {}), '(0.25, 2.1, 0.25)\n', (4808, 4825), True, 'import numpy as np\n'), ((214, 239), 'os.path... |
from __future__ import division
import json
import logging
import pdb
import os
import sys
import inspect
import psspy
import dyntools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import six
import win32api
class DataAnalytics(object):
voltage_mag_ph_a_property = 'Vmag_a'
voltage_mag_ph... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.clf",
"numpy.argmax",
"numpy.mean",
"os.path.join",
"pandas.DataFrame",
"os.path.abspath",
"os.path.exists",
"numpy.max",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.roll",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.text"... | [((1800, 1826), 'os.path.exists', 'os.path.exists', (['folderPath'], {}), '(folderPath)\n', (1814, 1826), False, 'import os\n'), ((2633, 2732), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['scenario', 't', 'tnodeid', 'dfeederid', 'dnodeid', 'property', 'value']"}), "(columns=['scenario', 't', 'tnodeid', 'dfee... |
from tensorflow.nn import relu, softmax
from tensorflow.keras import Sequential, Model
from tensorflow.keras.layers import Input, Dense, Conv2D, MaxPooling2D
from tensorflow.keras.layers import UpSampling2D, Reshape, Flatten
from tensorflow.keras.datasets import mnist
import numpy as np
import matplotlib.pyplot as plt
... | [
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.keras.Model",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.array",
"tensorflow.keras.layers.In... | [((386, 404), 'tensorflow.keras.layers.Input', 'Input', (['(28, 28, 1)'], {}), '((28, 28, 1))\n', (391, 404), False, 'from tensorflow.keras.layers import Input, Dense, Conv2D, MaxPooling2D\n'), ((1086, 1110), 'tensorflow.keras.Model', 'Model', (['ae_input', 'decoder'], {}), '(ae_input, decoder)\n', (1091, 1110), False,... |
import numpy as np
import pyMilne
class MilneEddington:
"""
MilneEddington class
Purpose: Implementation of a parallel Milne-Eddington solver with analytical response functions
Coded in C++/python by <NAME> (ISP-SU, 2020)
References:
<NAME> & Landolfi (2004)
<NAME> & de... | [
"pyMilne.pyLinesf",
"numpy.zeros",
"numpy.ones",
"pyMilne.pyLines",
"numpy.float64",
"pyMilne.pyMilne_float",
"numpy.ascontiguousarray",
"pyMilne.pyMilne",
"numpy.sqrt"
] | [((11629, 11690), 'numpy.float64', 'np.float64', (['[750, 1.0, 0.39, 0.25, 0.02, 30.0, 0.1, 0.8, 0.2]'], {}), '([750, 1.0, 0.39, 0.25, 0.02, 30.0, 0.1, 0.8, 0.2])\n', (11639, 11690), True, 'import numpy as np\n'), ((11739, 11784), 'numpy.zeros', 'np.zeros', (['(ny, nx, 9)'], {'dtype': 'dtype', 'order': '"""c"""'}), "((... |
import numpy as np
from scipy import signal
from scipy.ndimage import filters
from xicam import debugtools
import pyqtgraph as pg
from PySide import QtCore
# maxfiltercoef = 5
# cwtrange = np.arange(1, 100)
#
# maxfiltercoef = 5
# cwtrange = np.arange(3, 100)
# gaussiancentersigma = 2
# gaussianwidthsigma = 5
#
#
# @d... | [
"pyqtgraph.TextItem",
"numpy.arange",
"scipy.signal.find_peaks_cwt",
"pyqtgraph.mkBrush",
"pyqtgraph.mkPen",
"numpy.vstack"
] | [((950, 966), 'numpy.arange', 'np.arange', (['(1)', '(20)'], {}), '(1, 20)\n', (959, 966), True, 'import numpy as np\n'), ((1651, 1756), 'scipy.signal.find_peaks_cwt', 'signal.find_peaks_cwt', (['y', 'widths', 'wavelet', 'max_distances', 'gap_thresh', 'min_length', 'min_snr', 'noise_perc'], {}), '(y, widths, wavelet, m... |
import matplotlib.pyplot as plt
import numpy as np
import torch
from models import infogan
from morphomnist.util import plot_grid
_TICK_LABEL_SIZE = 'x-large'
_VAR_LABEL_SIZE = 'xx-large'
def _prep_ax(ax):
ax.axis('on')
ax.xaxis.set_visible(True)
ax.yaxis.set_visible(True)
ax.xaxis.set_label_positio... | [
"matplotlib.pyplot.suptitle",
"numpy.argsort",
"numpy.arange",
"torch.linspace",
"numpy.prod"
] | [((549, 572), 'numpy.argsort', 'np.argsort', (['cat_mapping'], {}), '(cat_mapping)\n', (559, 572), True, 'import numpy as np\n'), ((605, 623), 'numpy.arange', 'np.arange', (['cat_dim'], {}), '(cat_dim)\n', (614, 623), True, 'import numpy as np\n'), ((4204, 4277), 'matplotlib.pyplot.suptitle', 'plt.suptitle', (['f"""$c_... |
"""
Copyright 2020 Nvidia Corporation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Re... | [
"torch.ones_like",
"numpy.sum",
"runx.logx.logx.msg",
"torch.histc",
"torch.nonzero",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nn.functional.softmax",
"torch.nn.NLLLoss",
"loss.rmi.RMILoss",
"torch.Tensor",
"torch.nn.functional.log_softmax",
"torch.nn.NLLLoss2d"
] | [((5149, 5163), 'torch.nn.functional.softmax', 'F.softmax', (['inp'], {}), '(inp)\n', (5158, 5163), True, 'import torch.nn.functional as F\n'), ((2983, 3030), 'runx.logx.logx.msg', 'logx.msg', (['"""Using Per Image based weighted loss"""'], {}), "('Using Per Image based weighted loss')\n", (2991, 3030), False, 'from ru... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
TensorRT Object detection.
Copyright (c) 2021 <NAME>
This software is released under the MIT License.
See the LICENSE file in the project root for more information.
"""
import argparse
import colorsys
import os
import random
import time
import cv2
i... | [
"argparse.ArgumentParser",
"cv2.VideoWriter_fourcc",
"random.shuffle",
"numpy.mean",
"cv2.VideoWriter",
"cv2.rectangle",
"cv2.imshow",
"tensorrt.Logger",
"cv2.cvtColor",
"tensorrt.init_libnvinfer_plugins",
"random.seed",
"cv2.destroyAllWindows",
"cv2.resize",
"common.allocate_buffers",
"... | [((391, 418), 'tensorrt.Logger', 'trt.Logger', (['trt.Logger.INFO'], {}), '(trt.Logger.INFO)\n', (401, 418), True, 'import tensorrt as trt\n'), ((419, 462), 'tensorrt.init_libnvinfer_plugins', 'trt.init_libnvinfer_plugins', (['TRT_LOGGER', '""""""'], {}), "(TRT_LOGGER, '')\n", (446, 462), True, 'import tensorrt as trt\... |
import torch
from collections import OrderedDict
from .utils_misc import get_names_dict
from enum import Enum
import numpy as np
class _ForwardType(Enum):
HOOK = 0
FORWARD = 1
class ModelOutputs(object):
def __init__(self, net, summary):
self._net = net
self._summary = summary
se... | [
"torchsummaryX.summary",
"numpy.copy",
"numpy.array",
"torch.zeros",
"torch.no_grad",
"collections.OrderedDict"
] | [((2356, 2435), 'torch.zeros', 'torch.zeros', (['(2, self._num_channel, self._input_shape[0], self._input_shape[1])'], {}), '((2, self._num_channel, self._input_shape[0], self._input_shape[1]))\n', (2367, 2435), False, 'import torch\n'), ((2778, 2791), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2789, ... |
import re
from collections.abc import Container, Iterable
from numbers import Integral
import numpy as np
import pandas as pd
import pyarrow as pa
from pandas.api.extensions import ExtensionArray, ExtensionDtype
from pandas.api.types import is_array_like
from .._optional_imports import gp, sg
from ..spatialindex impo... | [
"pandas.array",
"numpy.isscalar",
"numpy.asarray",
"numpy.dtype",
"pyarrow.concat_arrays",
"numpy.isnan",
"pandas.core.missing.get_fill_func",
"pandas.util._validators.validate_fillna_kwargs",
"pandas.api.types.is_array_like",
"numpy.nonzero",
"numpy.array",
"pyarrow.array",
"pandas.isna",
... | [((940, 953), 'numpy.dtype', 'np.dtype', (['"""O"""'], {}), "('O')\n", (948, 953), True, 'import numpy as np\n'), ((1462, 1527), 're.compile', 're.compile', (["('^' + cls._geometry_name + '\\\\[(?P<subtype>\\\\w+)\\\\]$')"], {}), "('^' + cls._geometry_name + '\\\\[(?P<subtype>\\\\w+)\\\\]$')\n", (1472, 1527), False, 'i... |
from bisect import bisect_left
import numpy as np
def correlate_valid(buffer: np.ndarray, kernel: np.ndarray) -> np.ndarray:
"""
Based on scipy.correlate. buffer must be longer (or equal) to kernel. Returns an
array of length (buffer - kernel + 1) without edge effects, much like mode="valid".
"""
... | [
"numpy.asarray",
"numpy.fft.rfft",
"bisect.bisect_left",
"numpy.fft.irfft"
] | [((329, 347), 'numpy.asarray', 'np.asarray', (['buffer'], {}), '(buffer)\n', (339, 347), True, 'import numpy as np\n'), ((361, 379), 'numpy.asarray', 'np.asarray', (['kernel'], {}), '(kernel)\n', (371, 379), True, 'import numpy as np\n'), ((790, 820), 'numpy.fft.rfft', 'np.fft.rfft', (['buffer', 'fft_nsamp'], {}), '(bu... |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
# Script generates Fig. 8 of Heck et al. 2016 (ESD)
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from pylab import *
array = np.array
nstep = 128 # steps of parameter variation
par1='alpha_max'
par2= 'thresh_geo'
a2 = np.load('/sa... | [
"numpy.load",
"matplotlib.pyplot.show",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((308, 361), 'numpy.load', 'np.load', (['"""/save/a_alpha_max_thresh_geo_c_max=0.2.npy"""'], {}), "('/save/a_alpha_max_thresh_geo_c_max=0.2.npy')\n", (315, 361), True, 'import numpy as np\n'), ((367, 421), 'numpy.load', 'np.load', (['"""/save/a_alpha_max_thresh_geo_c_max=0.31.npy"""'], {}), "('/save/a_alpha_max_thresh... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 18 11:18:20 2014
@author: schackv
"""
from . import GPA
import numpy as np
class ASM:
def build(self,landmarks):
"""Build an active shape model from the landmarks given.
Landmarks are expected to be a numpy N x 2*p array
where p is the... | [
"numpy.abs",
"numpy.sum",
"numpy.linalg.eig",
"numpy.argsort",
"numpy.array",
"numpy.sqrt"
] | [((563, 575), 'numpy.array', 'np.array', (['mu'], {}), '(mu)\n', (571, 575), True, 'import numpy as np\n'), ((602, 613), 'numpy.array', 'np.array', (['S'], {}), '(S)\n', (610, 613), True, 'import numpy as np\n'), ((643, 657), 'numpy.array', 'np.array', (['Xnew'], {}), '(Xnew)\n', (651, 657), True, 'import numpy as np\n... |
from scipy.fftpack import fft, fftshift
import numpy as np
import math
from seizures.features.FeatureExtractBase import FeatureExtractBase
def nextpow2(i):
#n = 1
#while n < i: n *= 2
#return n
return int(2**math.ceil(math.log(i)/math.log(2)))
class FFTFeatures(FeatureExtractBase):
... | [
"numpy.sum",
"numpy.empty",
"numpy.square",
"scipy.fftpack.fft",
"numpy.linspace",
"math.log"
] | [((683, 698), 'scipy.fftpack.fft', 'fft', (['data', 'nfft'], {}), '(data, nfft)\n', (686, 698), False, 'from scipy.fftpack import fft, fftshift\n'), ((1272, 1333), 'numpy.empty', 'np.empty', (['(subsampled_instance.number_of_channels, self.bins)'], {}), '((subsampled_instance.number_of_channels, self.bins))\n', (1280, ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 16 16:38:19 2018
@author: hehu
"""
import numpy as np
def detect(x, frequency, Fs, L = 128):
n = np.arange(L)
h = np.exp(-2 * np.pi * 1j * frequency * n / Fs)
y = np.abs(np.convolve(h, x, 'same'))
return y
| [
"numpy.convolve",
"numpy.arange",
"numpy.exp"
] | [((152, 164), 'numpy.arange', 'np.arange', (['L'], {}), '(L)\n', (161, 164), True, 'import numpy as np\n'), ((173, 219), 'numpy.exp', 'np.exp', (['(-2 * np.pi * 1.0j * frequency * n / Fs)'], {}), '(-2 * np.pi * 1.0j * frequency * n / Fs)\n', (179, 219), True, 'import numpy as np\n'), ((233, 258), 'numpy.convolve', 'np.... |
'''
Function: using output files under /DFS-L/DATA/pritchard/hongcheq/OLD/scratch/
hongcheq/HCforcing_sim2_WADA_CTR_TOPO_ENSEMBLE_post-processing_h2_tapes_New_Modifications/MSE_decomp_Andes_Amazon
MSE.nc LSE.nc DSE.nc
Date: 2019/06/17
'''
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
data_pat... | [
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"xarray.open_dataset",
"numpy.zeros",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.... | [((686, 703), 'numpy.zeros', 'np.zeros', (['(4, 96)'], {}), '((4, 96))\n', (694, 703), True, 'import numpy as np\n'), ((1554, 1596), 'matplotlib.pyplot.axhline', 'plt.axhline', ([], {'y': '(0)', 'linewidth': '(1.5)', 'color': '"""k"""'}), "(y=0, linewidth=1.5, color='k')\n", (1565, 1596), True, 'import matplotlib.pyplo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 13 13:32:14 2019
@author: ortutay
"""
import pandas as pd
import numpy as np
link = 'http://bit.ly/uforeports'
ufo = pd.read_csv(link)
# We split 60-20-20% tran-validation-test sets
train, validate, test = np.split(ufo.sample(frac=1),
... | [
"pandas.read_csv",
"numpy.arange"
] | [((191, 208), 'pandas.read_csv', 'pd.read_csv', (['link'], {}), '(link)\n', (202, 208), True, 'import pandas as pd\n'), ((410, 426), 'numpy.arange', 'np.arange', (['(1)', '(21)'], {}), '(1, 21)\n', (419, 426), True, 'import numpy as np\n'), ((435, 452), 'numpy.arange', 'np.arange', (['(21)', '(41)'], {}), '(21, 41)\n',... |
import sys
import numpy as np
import math
import random
import time
import matplotlib.pyplot as plt
import pickle
import gym
import gym_maze
"""
Implementation of TD methods for the maze environment.
(you can find the environment here: https://github.com/MattChanTK/gym-maze)
"""
#Simulation parameters
NUM_EPISODES =... | [
"matplotlib.pyplot.show",
"gym.make",
"numpy.argmax",
"numpy.zeros",
"matplotlib.pyplot.axis",
"time.sleep",
"numpy.max",
"numpy.mean",
"numpy.random.rand",
"matplotlib.pyplot.pause"
] | [((4281, 4318), 'gym.make', 'gym.make', (['"""maze-random-20x20-plus-v0"""'], {}), "('maze-random-20x20-plus-v0')\n", (4289, 4318), False, 'import gym\n'), ((4384, 4406), 'numpy.zeros', 'np.zeros', (['NUM_EPISODES'], {}), '(NUM_EPISODES)\n', (4392, 4406), True, 'import numpy as np\n'), ((4644, 4654), 'matplotlib.pyplot... |
"""Generic sampling methods"""
import numpy as np
import heapq as hq
import random
def reservoir(it, k):
"""Reservoir sampling with Random Sort from a job posting iterator
Randomly choosing a sample of k items from a streaming iterator. Using random sort to implement the algorithm.
Basically, it's assigni... | [
"heapq.heapreplace",
"numpy.random.uniform",
"random.randint",
"heapq.heappop"
] | [((848, 872), 'random.randint', 'random.randint', (['(0)', '(i - 1)'], {}), '(0, i - 1)\n', (862, 872), False, 'import random\n'), ((1869, 1896), 'numpy.random.uniform', 'np.random.uniform', (['(0.0)', '(1.0)'], {}), '(0.0, 1.0)\n', (1886, 1896), True, 'import numpy as np\n'), ((2130, 2166), 'heapq.heapreplace', 'hq.he... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
from scipy import stats
# data source: https://ourworldindata.org/coronavirus-source-data
def setup(csv_filename, country):
df = pd.read_csv(csv_filename)
df = df.loc[: , ["location", "date", "new_cases" ]]
df = df[df["loc... | [
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"math.pow",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"math.log10",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((219, 244), 'pandas.read_csv', 'pd.read_csv', (['csv_filename'], {}), '(csv_filename)\n', (230, 244), True, 'import pandas as pd\n'), ((1427, 1447), 'numpy.linspace', 'np.linspace', (['(1)', '(9)', '(9)'], {}), '(1, 9, 9)\n', (1438, 1447), True, 'import numpy as np\n'), ((2086, 2106), 'numpy.linspace', 'np.linspace',... |
import dash
import dash_table
import dash_html_components as html
import dash_core_components as dcc
import MySQLdb
import numpy as np
import pandas as pd
import webbrowser
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from threading import Timer
external_styl... | [
"pandas.DataFrame",
"threading.Timer",
"webbrowser.open_new",
"dash.Dash",
"MySQLdb.connect",
"dash_core_components.DatePickerSingle",
"dash_html_components.Div",
"dash_html_components.Button",
"dash.dependencies.State",
"dash_core_components.Input",
"dash.dependencies.Input",
"dash_html_compo... | [((384, 446), 'dash.Dash', 'dash.Dash', (['__name__'], {'external_stylesheets': 'external_stylesheets'}), '(__name__, external_stylesheets=external_stylesheets)\n', (393, 446), False, 'import dash\n'), ((9483, 9510), 'dash.dependencies.Output', 'Output', (['"""top-table"""', '"""data"""'], {}), "('top-table', 'data')\n... |
# ======================================================================================================================
# * Weighted Holistic Atom Localization and Entity Shape (WHALES) descriptors *
# v. 1, May 2018
# --------------------------------------------------------------------------------------------------... | [
"rdkit.Chem.AllChem.RemoveHs",
"numpy.zeros",
"numpy.ones",
"rdkit.Chem.AllChem.ComputeGasteigerCharges",
"rdkit.Chem.AllChem.AddHs"
] | [((1686, 1705), 'numpy.zeros', 'np.zeros', (['(n_at, 3)'], {}), '((n_at, 3))\n', (1694, 1705), True, 'import numpy as np\n'), ((1733, 1752), 'numpy.zeros', 'np.zeros', (['(n_at, 1)'], {}), '((n_at, 1))\n', (1741, 1752), True, 'import numpy as np\n'), ((4546, 4564), 'rdkit.Chem.AllChem.RemoveHs', 'Chem.RemoveHs', (['mol... |
def run(dirOut = "FLFFCoutput", country = "United Kingdom", steps = 50):
# Import standard modules ...
import os
# Import special modules ...
try:
import cartopy
import cartopy.crs
import cartopy.io
import cartopy.io.shapereader
except:
raise Exception("\"car... | [
"pyguymer3.geo.add_map_background",
"shapely.geometry.Point",
"cartopy.crs.Geodetic",
"os.makedirs",
"matplotlib.pyplot.close",
"os.path.exists",
"matplotlib.pyplot.colorbar",
"cartopy.io.shapereader.natural_earth",
"matplotlib.pyplot.figure",
"matplotlib.use",
"cartopy.io.shapereader.Reader",
... | [((1545, 1650), 'cartopy.io.shapereader.natural_earth', 'cartopy.io.shapereader.natural_earth', ([], {'resolution': '"""10m"""', 'category': '"""cultural"""', 'name': '"""admin_0_countries"""'}), "(resolution='10m', category='cultural',\n name='admin_0_countries')\n", (1581, 1650), False, 'import cartopy\n'), ((435,... |
"""The WaveBlocks Project
This file contains code for the inhomogeneous (or mixing) quadrature of two
wave packets. The class defined here can compute brakets, inner products and
expectation values and compute the :math:`F` matrix.
@author: <NAME>
@copyright: Copyright (C) 2011 <NAME>
@license: Modified BSD License
"... | [
"numpy.sum",
"numpy.zeros",
"numpy.ones",
"numpy.cumsum",
"numpy.imag",
"scipy.sqrt",
"numpy.dot",
"numpy.conjugate",
"numpy.squeeze"
] | [((2044, 2057), 'numpy.conjugate', 'conjugate', (['rr'], {}), '(rr)\n', (2053, 2057), False, 'from numpy import zeros, ones, complexfloating, sum, cumsum, squeeze, imag, conjugate, outer, dot\n'), ((2112, 2119), 'numpy.imag', 'imag', (['s'], {}), '(s)\n', (2116, 2119), False, 'from numpy import zeros, ones, complexfloa... |
__all__ = [
'GridSpec',
'geoeas_to_np',
'geoeas_to_npGS',
]
__displayname__ = 'Grids'
import properties
import numpy as np
################################################################################
class GridSpec(properties.HasProperties):
"""A ``GridSpec`` object provides the details of a s... | [
"properties.Integer",
"numpy.swapaxes",
"numpy.reshape"
] | [((430, 498), 'properties.Integer', 'properties.Integer', (['"""The number of components along this dimension."""'], {}), "('The number of components along this dimension.')\n", (448, 498), False, 'import properties\n'), ((509, 597), 'properties.Integer', 'properties.Integer', (['"""The minimum value along this dimensi... |
# MIMIC IIIv14 on postgres 9.4
import argparse
import os
import pickle
import numpy as np
import pandas as pd
import psycopg2
pickle.HIGHEST_PROTOCOL = 3
# Output filenames
static_filename = 'static_data.csv'
static_columns_filename = 'static_colnames.txt'
dynamic_filename = 'vitals_hourly_data.csv'
columns_filename... | [
"pandas.DataFrame",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.isnan",
"os.path.expandvars",
"pandas.read_sql_query",
"pandas.isna",
"psycopg2.connect"
] | [((1833, 1931), 'pandas.DataFrame', 'pd.DataFrame', (["{'subject_id': subject_id, 'hadm_id': hadm_id, 'hours_in': hours, 'on': on_vals\n }"], {}), "({'subject_id': subject_id, 'hadm_id': hadm_id, 'hours_in':\n hours, 'on': on_vals})\n", (1845, 1931), True, 'import pandas as pd\n'), ((2274, 2367), 'pandas.DataFram... |
# ==============================================================================
# Copyright 2018-2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | [
"tensorflow.placeholder",
"tensorflow.pad",
"numpy.random.seed"
] | [((1010, 1027), 'numpy.random.seed', 'np.random.seed', (['(5)'], {}), '(5)\n', (1024, 1027), True, 'import numpy as np\n'), ((1114, 1152), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32'], {'shape': '(2, 3)'}), '(tf.int32, shape=(2, 3))\n', (1128, 1152), True, 'import tensorflow as tf\n'), ((1172, 1210), 'tens... |
import cv2
import numpy as np
import glob
import os
# Function to stack images
def stackImages(self, scale, imgArray):
rows = len(imgArray)
cols = len(imgArray[0])
rowsAvailable = isinstance(imgArray[0], list)
width = imgArray[0][0].shape[1]
height = imgArray[0][0].shape[0]
if rowsAvailable:
... | [
"cv2.resize",
"cv2.GaussianBlur",
"cv2.Canny",
"cv2.putText",
"cv2.cvtColor",
"numpy.zeros",
"numpy.ones",
"numpy.hstack",
"cv2.rectangle",
"cv2.imread",
"cv2.CascadeClassifier",
"glob.glob",
"numpy.vstack"
] | [((1627, 1747), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""/home/raxit/anaconda3/share/opencv4/haarcascades/haarcascade_russian_plate_number.xml"""'], {}), "(\n '/home/raxit/anaconda3/share/opencv4/haarcascades/haarcascade_russian_plate_number.xml'\n )\n", (1648, 1747), False, 'import cv2\n'), ((1748... |
"""Compute dispersion correction using Greenwell & Beran's MP2D executable."""
import pprint
import re
import sys
from decimal import Decimal
from typing import Any, Dict, Optional, Tuple
import numpy as np
import qcelemental as qcel
from qcelemental.models import AtomicResult, Provenance
from qcelemental.util import... | [
"subprocess.run",
"qcelemental.molparse.to_string",
"qcelemental.util.unnp",
"numpy.sum",
"numpy.zeros",
"re.match",
"sys._getframe",
"pprint.PrettyPrinter",
"qcelemental.Datum",
"numpy.array",
"numpy.argwhere",
"numpy.fromstring",
"qcelemental.util.which"
] | [((519, 574), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'width': '(120)', 'compact': '(True)', 'indent': '(1)'}), '(width=120, compact=True, indent=1)\n', (539, 574), False, 'import pprint\n'), ((992, 1114), 'qcelemental.util.which', 'which', (['"""mp2d"""'], {'return_bool': '(True)', 'raise_error': 'raise_... |
#!/usr/bin/env python
#******************************************************************************
#
# Project: GDAL
# Purpose: Use HTDP to generate PROJ.4 compatible datum grid shift files.
# Author: <NAME>, <EMAIL>
#
# See also: http://www.ngs.noaa.gov/TOOLS/Htdp/Htdp.shtml
# http://trac.osgeo.org... | [
"os.unlink",
"numpy.zeros",
"os.system",
"osgeo.gdal.GeneralCmdLineProcessor",
"numpy.array",
"numpy.linspace",
"numpy.column_stack",
"sys.exit",
"osgeo.gdal_array.SaveArray",
"numpy.vstack"
] | [((3018, 3036), 'numpy.zeros', 'numpy.zeros', (['shape'], {}), '(shape)\n', (3029, 3036), False, 'import numpy\n'), ((4022, 4067), 'numpy.linspace', 'numpy.linspace', (['lat_start', 'lat_end', 'lat_steps'], {}), '(lat_start, lat_end, lat_steps)\n', (4036, 4067), False, 'import numpy\n'), ((4081, 4126), 'numpy.linspace'... |
"""
Created on March 07, 2019
@author: <NAME>
"""
import numpy as np
from scipy.special import logsumexp
from spn.structure.leaves.parametric.Parametric import Gaussian, Bernoulli
from spn.algorithms.EM import add_node_em_update
def bernoulli_em_update(node, node_lls=None, node_gradients=None, root_lls=None, data=... | [
"numpy.sum",
"spn.algorithms.EM.add_node_em_update",
"numpy.power",
"numpy.isnan",
"numpy.exp",
"scipy.special.logsumexp"
] | [((479, 491), 'scipy.special.logsumexp', 'logsumexp', (['p'], {}), '(p)\n', (488, 491), False, 'from scipy.special import logsumexp\n'), ((828, 840), 'scipy.special.logsumexp', 'logsumexp', (['p'], {}), '(p)\n', (837, 840), False, 'from scipy.special import logsumexp\n'), ((849, 864), 'numpy.exp', 'np.exp', (['(p - lse... |
import operator
from nltk.corpus import brown
import matplotlib.pyplot as plt
import numpy as np
import string
from glob import glob
def get_brown_freq():
sentences = brown.sents()
word_idx_count = {}
for sentence in sentences:
for token in sentence:
token = token.lower()
... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.log",
"matplotlib.pyplot.scatter",
"nltk.corpus.brown.sents",
"glob.glob",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tight_layout",
"operator.itemgetter"
] | [((172, 185), 'nltk.corpus.brown.sents', 'brown.sents', ([], {}), '()\n', (183, 185), False, 'from nltk.corpus import brown\n'), ((640, 667), 'glob.glob', 'glob', (['"""../Wiki/enwiki*.txt"""'], {}), "('../Wiki/enwiki*.txt')\n", (644, 667), False, 'from glob import glob\n'), ((1309, 1329), 'matplotlib.pyplot.subplot', ... |
from tkinter import EXCEPTION
import streamlit as st
from tensorflow.keras.models import load_model
import numpy as np
from tensorflow.keras.preprocessing.image import img_to_array
from collections import Counter
import pandas as pd
import os, ast, cv2, time
from song_recom.pred import angry_mood, happy_mood, s... | [
"song_recom.similar.selected_songid",
"numpy.sum",
"pandas.read_csv",
"streamlit.sidebar.selectbox",
"streamlit.container",
"cv2.rectangle",
"cv2.CascadeClassifier",
"song_recom.pred.happy_mood",
"streamlit.set_page_config",
"cv2.cvtColor",
"streamlit.info",
"collections.Counter",
"cv2.destr... | [((498, 572), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascades\\\\haarcascade_frontalface_default.xml"""'], {}), "('haarcascades\\\\haarcascade_frontalface_default.xml')\n", (519, 572), False, 'import os, ast, cv2, time\n'), ((588, 614), 'tensorflow.keras.models.load_model', 'load_model', (['"""best... |
import os
import pickle
import shutil
import numpy as np
from .. import RandomSparseEncoder
from jina.executors import BaseExecutor
from jina.executors.encoders.numeric import TransformEncoder
input_dim = 28
target_output_dim = 2
def rm_files(file_paths):
for file_path in file_paths:
if os.path.exists(... | [
"os.remove",
"jina.executors.encoders.numeric.TransformEncoder",
"os.path.isdir",
"numpy.testing.assert_almost_equal",
"numpy.testing.assert_array_equal",
"os.path.exists",
"jina.executors.BaseExecutor.load",
"sklearn.random_projection.SparseRandomProjection",
"os.path.isfile",
"jina.executors.Bas... | [((609, 638), 'numpy.random.rand', 'np.random.rand', (['(10)', 'input_dim'], {}), '(10, input_dim)\n', (623, 638), True, 'import numpy as np\n'), ((874, 903), 'numpy.random.rand', 'np.random.rand', (['(10)', 'input_dim'], {}), '(10, input_dim)\n', (888, 903), True, 'import numpy as np\n'), ((1007, 1043), 'os.path.exist... |
import numpy as np
import pandas as pd
import copy
import random
from collections import namedtuple
import data
Fold = namedtuple('Fold', 'training_mask, testing_mask, clipnames, call_ids, label_df')
class FoldBuilder(object):
"""Build folds for submission or cross validation"""
def __init__(self):
... | [
"copy.deepcopy",
"random.shuffle",
"random.seed",
"numpy.array",
"collections.namedtuple",
"data.get_wav_dict"
] | [((123, 208), 'collections.namedtuple', 'namedtuple', (['"""Fold"""', '"""training_mask, testing_mask, clipnames, call_ids, label_df"""'], {}), "('Fold', 'training_mask, testing_mask, clipnames, call_ids, label_df'\n )\n", (133, 208), False, 'from collections import namedtuple\n'), ((344, 373), 'data.get_wav_dict', ... |
import pickle
import cv2 as cv
import numpy as np
import Calibration.calibration as clb
def draw_holes(a, b, color=(0, 0, 255)):
coords = zip(a, b)
for center in coords:
x, y = map(int, center)
cv.circle(img, (x, y), 7, color, 2)
if __name__ == "__main__":
img = cv.imread('samples/fr... | [
"cv2.warpPerspective",
"cv2.circle",
"Calibration.calibration.undistort",
"Calibration.calibration.load_coefficients",
"cv2.waitKey",
"cv2.imread",
"numpy.sin",
"numpy.linspace",
"numpy.cos",
"cv2.imshow"
] | [((299, 330), 'cv2.imread', 'cv.imread', (['"""samples/frame1.jpg"""'], {}), "('samples/frame1.jpg')\n", (308, 330), True, 'import cv2 as cv\n'), ((451, 488), 'Calibration.calibration.load_coefficients', 'clb.load_coefficients', (['"""calibration/"""'], {}), "('calibration/')\n", (472, 488), True, 'import Calibration.c... |
# -*- coding: utf-8 -*-
"""Copyright 2015 <NAME>.
FilterPy library.
http://github.com/rlabbe/filterpy
Documentation at:
https://filterpy.readthedocs.org
Supporting book at:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
This is licensed under an MIT license. See the readme.MD file
for more informat... | [
"numpy.random.seed",
"matplotlib.pyplot.plot",
"filterpy.leastsq.LeastSquaresFilter",
"numpy.random.randn",
"filterpy.gh.GHFilter",
"matplotlib.pyplot.scatter",
"math.sqrt",
"numpy.zeros",
"scipy.linalg.inv",
"numpy.array",
"numpy.arange",
"numpy.dot",
"numpy.eye"
] | [((7999, 8008), 'numpy.eye', 'np.eye', (['(1)'], {}), '(1)\n', (8005, 8008), True, 'import numpy as np\n'), ((8016, 8025), 'numpy.eye', 'np.eye', (['(1)'], {}), '(1)\n', (8022, 8025), True, 'import numpy as np\n'), ((8033, 8042), 'numpy.eye', 'np.eye', (['(1)'], {}), '(1)\n', (8039, 8042), True, 'import numpy as np\n')... |
import logging
import pathlib
import shutil
import urllib.request
import numpy as np
import pandas as pd
from remat.core.dfgraph import DFGraph
from remat.core.schedule import ScheduledResult
from remat.core.utils.solver_common import solve_r_opt, setup_implied_s_backwards
from remat.core.utils.scheduler import sched... | [
"remat.core.utils.timer.Timer",
"remat.core.utils.solver_common.setup_implied_s_backwards",
"numpy.fill_diagonal",
"remat.core.utils.solver_common.solve_r_opt",
"logging.exception",
"logging.warning",
"numpy.zeros",
"logging.info",
"pathlib.Path",
"remat.core.utils.scheduler.schedule_from_rs",
"... | [((631, 656), 'remat.core.utils.scheduler.schedule_from_rs', 'schedule_from_rs', (['g', 'r', 's'], {}), '(g, r, s)\n', (647, 656), False, 'from remat.core.utils.scheduler import schedule_from_rs\n'), ((751, 950), 'remat.core.schedule.ScheduledResult', 'ScheduledResult', ([], {'solve_strategy': 'SolveStrategy.GRIEWANK_L... |
# Copyright 2020 The AutoKeras 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 applicable law or agreed to i... | [
"unittest.mock.patch",
"autokeras.TextRegressor",
"numpy.array",
"autokeras.TextClassifier"
] | [((684, 721), 'unittest.mock.patch', 'mock.patch', (['"""autokeras.AutoModel.fit"""'], {}), "('autokeras.AutoModel.fit')\n", (694, 721), False, 'from unittest import mock\n'), ((952, 989), 'unittest.mock.patch', 'mock.patch', (['"""autokeras.AutoModel.fit"""'], {}), "('autokeras.AutoModel.fit')\n", (962, 989), False, '... |
# Fixes for defective mne functions
from collections import defaultdict
from distutils.version import LooseVersion
import os.path as op
import numpy as np
from mne.surface import read_surface
from mne.utils import get_subjects_dir, logger, verbose
from mne.label import _get_annot_fname, _n_colors, _write_annot
import... | [
"mne.label._n_colors",
"mne.utils.logger.info",
"mne.surface.read_surface",
"numpy.sum",
"mne.label._write_annot",
"distutils.version.LooseVersion",
"numpy.empty",
"os.path.exists",
"numpy.all",
"numpy.any",
"collections.defaultdict",
"numpy.max",
"numpy.array",
"mne.utils.get_subjects_dir... | [((333, 366), 'distutils.version.LooseVersion', 'LooseVersion', (['nibabel.__version__'], {}), '(nibabel.__version__)\n', (345, 366), False, 'from distutils.version import LooseVersion\n'), ((370, 391), 'distutils.version.LooseVersion', 'LooseVersion', (['"""2.3.0"""'], {}), "('2.3.0')\n", (382, 391), False, 'from dist... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Fri May 1 10:09:24 2015
@author: ddboline
"""
#from __future__ import absolute_import
#from __future__ import division
#from __future__ import print_function
#from __future__ import unicode_literals
import os
import gzip
import cPickle as pickle
import numpy ... | [
"sklearn.cross_validation.train_test_split",
"gzip.open",
"sklearn.metrics.mean_squared_error",
"xgboost.train",
"sklearn.ensemble.GradientBoostingRegressor",
"load_data.load_data",
"numpy.zeros",
"os.rename",
"cPickle.load",
"cPickle.dump",
"numpy.expm1",
"xgboost.Booster",
"xgboost.DMatrix... | [((808, 819), 'numpy.log1p', 'np.log1p', (['y'], {}), '(y)\n', (816, 819), True, 'import numpy as np\n'), ((1128, 1186), 'sklearn.cross_validation.train_test_split', 'train_test_split', (['xtrain', 'ytrain[:, index]'], {'test_size': '(0.25)'}), '(xtrain, ytrain[:, index], test_size=0.25)\n', (1144, 1186), False, 'from ... |
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: collapsed,code_folding
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.2.4
# kernelspec:
# display_name: Python 3
# language: pyth... | [
"HARK.distribution.Uniform",
"copy.deepcopy",
"numpy.sum",
"numpy.log",
"numpy.concatenate",
"numpy.zeros",
"HARK.utilities.getPercentiles",
"numpy.mean",
"HARK.parallel.multiThreadCommands",
"numpy.array",
"HARK.estimation.minimizeNelderMead"
] | [((5607, 5630), 'copy.deepcopy', 'deepcopy', (['init_infinite'], {}), '(init_infinite)\n', (5615, 5630), False, 'from copy import deepcopy\n'), ((5943, 5956), 'numpy.log', 'np.log', (['(23.72)'], {}), '(23.72)\n', (5949, 5956), True, 'import numpy as np\n'), ((6237, 6368), 'numpy.array', 'np.array', (['[[1.047, 0.745, ... |
from xgboost import XGBClassifier
from xgboost import plot_importance
from matplotlib import pyplot
import pandas as pd
import numpy as np
# carrega dados
X = pd.read_csv(filepath_or_buffer="train.csv",
index_col=0, sep=',')
y = X["TARGET"]
X = X.drop(labels="TARGET", axis=1)
ratio = float(n... | [
"xgboost.plot_importance",
"matplotlib.pyplot.show",
"numpy.sum",
"pandas.read_csv",
"xgboost.XGBClassifier"
] | [((160, 225), 'pandas.read_csv', 'pd.read_csv', ([], {'filepath_or_buffer': '"""train.csv"""', 'index_col': '(0)', 'sep': '""","""'}), "(filepath_or_buffer='train.csv', index_col=0, sep=',')\n", (171, 225), True, 'import pandas as pd\n'), ((381, 473), 'xgboost.XGBClassifier', 'XGBClassifier', ([], {'max_depth': '(5)', ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
def weight_init(m):
if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear):
nn.init.orthogonal_(m.weight.data, np.sqrt(2))
if m.bias is not N... | [
"torch.nn.ReLU",
"torch.randn_like",
"torch.nn.Tanh",
"torch.nn.Conv2d",
"torch.nn.functional.linear",
"torch.nn.LayerNorm",
"torch.nn.init.constant_",
"torch.nn.Linear",
"torch.nn.functional.tanh",
"numpy.sqrt"
] | [((603, 631), 'torch.nn.Linear', 'nn.Linear', (['in_size', 'out_size'], {}), '(in_size, out_size)\n', (612, 631), True, 'import torch.nn as nn\n'), ((282, 292), 'numpy.sqrt', 'np.sqrt', (['(2)'], {}), '(2)\n', (289, 292), True, 'import numpy as np\n'), ((337, 370), 'torch.nn.init.constant_', 'nn.init.constant_', (['m.b... |
#!/usr/bin/env python3
# add logger, to allow logging to Labber's instrument log
import logging
import numpy as np
log = logging.getLogger('LabberDriver')
class Demodulation(object):
"""Demodulate multi-tone qubit readout.
Parameters
----------
n_qubit : int
The number of qubits to readout.... | [
"numpy.full",
"numpy.trapz",
"numpy.arctan2",
"numpy.zeros",
"numpy.sin",
"numpy.arange",
"numpy.exp",
"numpy.cos",
"logging.getLogger"
] | [((123, 156), 'logging.getLogger', 'logging.getLogger', (['"""LabberDriver"""'], {}), "('LabberDriver')\n", (140, 156), False, 'import logging\n'), ((480, 502), 'numpy.zeros', 'np.zeros', (['self.n_qubit'], {}), '(self.n_qubit)\n', (488, 502), True, 'import numpy as np\n'), ((526, 553), 'numpy.full', 'np.full', (['self... |
# Date: March 2017
# Author: <NAME>
"""
3D vector operations
"""
import math
import numpy as np
def align(v1, v2, norm=True):
""" Calculates the rotation axis and angle to align v1 with v2. """
if norm:
v1 = np.array(v1) / np.linalg.norm(v1)
v2 = np.array(v2) / np.linalg.norm(v2)
rotation_... | [
"math.isnan",
"numpy.cross",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.arccos"
] | [((327, 343), 'numpy.cross', 'np.cross', (['v1', 'v2'], {}), '(v1, v2)\n', (335, 343), True, 'import numpy as np\n'), ((352, 366), 'numpy.dot', 'np.dot', (['v1', 'v2'], {}), '(v1, v2)\n', (358, 366), True, 'import numpy as np\n'), ((379, 391), 'numpy.arccos', 'np.arccos', (['d'], {}), '(d)\n', (388, 391), True, 'import... |
import numpy as np
from mirdata import annotations
from mirdata.datasets import saraga_carnatic
from tests.test_utils import run_track_tests
def test_track():
default_trackid = "116_Bhuvini_Dasudane"
data_home = "tests/resources/mir_datasets/saraga_carnatic"
dataset = saraga_carnatic.Dataset(data_home)
... | [
"mirdata.datasets.saraga_carnatic.Dataset",
"mirdata.datasets.saraga_carnatic.load_phrases",
"mirdata.datasets.saraga_carnatic.load_tonic",
"mirdata.datasets.saraga_carnatic.load_sama",
"tests.test_utils.run_track_tests",
"mirdata.datasets.saraga_carnatic.load_metadata",
"mirdata.datasets.saraga_carnati... | [((283, 317), 'mirdata.datasets.saraga_carnatic.Dataset', 'saraga_carnatic.Dataset', (['data_home'], {}), '(data_home)\n', (306, 317), False, 'from mirdata.datasets import saraga_carnatic\n'), ((4176, 4244), 'tests.test_utils.run_track_tests', 'run_track_tests', (['track', 'expected_attributes', 'expected_property_type... |
import joblib
from tqdm import tqdm
import scipy.sparse as sp
from collections import Counter
import numpy as np
from VISIBILITY import VISIBILITY_GRAPH
# 数据集
dataset = "R8"
zaoyin=20
# 参数
window_size = 7
embedding_dim = 300
max_text_len = 800
# node_state=[i for i in range(25)]
# normalize
def norm... | [
"tqdm.tqdm",
"numpy.load",
"numpy.save",
"numpy.power",
"collections.Counter",
"joblib.dump",
"numpy.isinf",
"numpy.errstate",
"numpy.zeros",
"VISIBILITY.VISIBILITY_GRAPH",
"numpy.array",
"numpy.random.normal",
"numpy.diag",
"joblib.load"
] | [((533, 552), 'numpy.diag', 'np.diag', (['d_inv_sqrt'], {}), '(d_inv_sqrt)\n', (540, 552), True, 'import numpy as np\n'), ((851, 896), 'joblib.load', 'joblib.load', (['f"""temp/{dataset}.word2index.pkl"""'], {}), "(f'temp/{dataset}.word2index.pkl')\n", (862, 896), False, 'import joblib\n'), ((1293, 1304), 'tqdm.tqdm', ... |
# Copyright 2021 <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, merge,
# publish, distribute, subl... | [
"numpy.sum",
"numpy.abs",
"numpy.empty",
"numpy.append",
"numpy.sin",
"numpy.array",
"numpy.exp",
"numpy.cos"
] | [((2826, 2837), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (2834, 2837), True, 'import numpy as np\n'), ((4789, 4824), 'numpy.append', 'np.append', (['a_param', 'b_param'], {'axis': '(0)'}), '(a_param, b_param, axis=0)\n', (4798, 4824), True, 'import numpy as np\n'), ((5256, 5289), 'numpy.append', 'np.append', ... |
#!/usr/bin/python
# ******************************************************************************
# Copyright 2014-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#... | [
"numpy.pad",
"numpy.random.uniform",
"numpy.absolute",
"numpy.set_printoptions",
"numpy.empty",
"numpy.zeros",
"numpy.ones",
"struct.pack",
"numpy.transpose",
"numpy.around",
"numpy.array",
"numpy.dot",
"numpy.float64"
] | [((25891, 25994), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': '(8192 * 4)', 'linewidth': '(600)', 'formatter': "{'float': lambda x: '%6.3f' % x}"}), "(threshold=8192 * 4, linewidth=600, formatter={'float': \n lambda x: '%6.3f' % x})\n", (25910, 25994), True, 'import numpy as np\n'), ((27159, ... |
import numpy as np
import tensorflow as tf
from tensorflow import keras
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.cm as cm
class CAM:
"""Class activation maps are a simple technique to get the discriminative image regions
used by a CNN to identify a specific class in the image.
... | [
"numpy.uint8",
"matplotlib.pyplot.show",
"tensorflow.keras.models.load_model",
"matplotlib.cm.get_cmap",
"tensorflow.keras.preprocessing.image.img_to_array",
"matplotlib.pyplot.matshow",
"numpy.expand_dims",
"tensorflow.keras.preprocessing.image.load_img",
"numpy.arange",
"tensorflow.keras.preproc... | [((5301, 5325), 'numpy.uint8', 'np.uint8', (['(255 * heat_map)'], {}), '(255 * heat_map)\n', (5309, 5325), True, 'import numpy as np\n'), ((5368, 5386), 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""jet"""'], {}), "('jet')\n", (5379, 5386), True, 'import matplotlib.cm as cm\n'), ((5531, 5583), 'tensorflow.keras.prepro... |
"""Audio settings for wav2mel"""
import typing
from dataclasses import dataclass
import librosa
import numpy as np
@dataclass
class AudioSettings:
"""Settings for wav <-> mel"""
# STFT settings
filter_length: int = 1024
hop_length: int = 256
win_length: int = 256
mel_channels: int = 80
s... | [
"numpy.abs",
"numpy.maximum",
"numpy.power",
"librosa.effects.trim",
"numpy.clip",
"librosa.filters.mel",
"librosa.istft",
"numpy.random.rand",
"numpy.dot",
"numpy.linalg.pinv",
"librosa.stft"
] | [((823, 951), 'librosa.filters.mel', 'librosa.filters.mel', (['self.sample_rate', 'self.filter_length'], {'n_mels': 'self.mel_channels', 'fmin': 'self.mel_fmin', 'fmax': 'self.mel_fmax'}), '(self.sample_rate, self.filter_length, n_mels=self.\n mel_channels, fmin=self.mel_fmin, fmax=self.mel_fmax)\n', (842, 951), Fal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.