code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
Blockwise coregistration
========================
Often, biases are spatially variable, and a "global" shift may not be enough to coregister a DEM properly.
In the :ref:`sphx_glr_auto_examples_plot_nuth_kaab.py` example, we saw that the method improved the alignment significantly, but there were still possibly non... | [
"matplotlib.pyplot.title",
"xdem.spatialstats.nmad",
"numpy.zeros_like",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.figure",
"xdem.examples.get_path",
"xdem.coreg.NuthKaab"
] | [((1955, 1981), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 5)'}), '(figsize=(8, 5))\n', (1965, 1981), True, 'import matplotlib.pyplot as plt\n'), ((2073, 2087), 'matplotlib.pyplot.colorbar', 'plt.colorbar', ([], {}), '()\n', (2085, 2087), True, 'import matplotlib.pyplot as plt\n'), ((2088, 2098), '... |
"""
--- Day 9: Smoke Basin ---
These caves seem to be lava tubes. Parts are even still volcanically active; small hydrothermal
vents release smoke into the caves that slowly settles like rain.
If you can model how the smoke flows through the caves, you might be able to avoid it and be that
much safer. The submarine g... | [
"scipy.ndimage.rank_filter",
"scipy.ndimage.binary_dilation",
"numpy.sum",
"numpy.argsort",
"scipy.ndimage.label",
"numpy.array",
"numpy.unique"
] | [((2867, 2910), 'numpy.array', 'np.array', (['[[0, 1, 0], [1, 1, 1], [0, 1, 0]]'], {}), '([[0, 1, 0], [1, 1, 1], [0, 1, 0]])\n', (2875, 2910), True, 'import numpy as np\n'), ((2929, 3003), 'scipy.ndimage.rank_filter', 'ndimage.rank_filter', (['dem', '(1)'], {'footprint': 'adjacent', 'mode': '"""constant"""', 'cval': '(... |
################################################################################
#
# test_dtram.py - testing the dTRAM estimator
#
# author: <NAME> <<EMAIL>>
#
################################################################################
from nose.tools import assert_raises, assert_true
from pytram import DTRAM... | [
"pytram.DTRAM",
"numpy.abs",
"numpy.zeros",
"numpy.ones",
"numpy.array",
"numpy.exp",
"nose.tools.assert_raises"
] | [((1777, 1912), 'numpy.array', 'np.array', (['[[[2358, 29, 0], [29, 0, 32], [0, 32, 197518]], [[16818, 16763, 0], [16763,\n 0, 16510], [0, 16510, 16635]]]'], {'dtype': 'np.intc'}), '([[[2358, 29, 0], [29, 0, 32], [0, 32, 197518]], [[16818, 16763, 0],\n [16763, 0, 16510], [0, 16510, 16635]]], dtype=np.intc)\n', (1... |
import argparse
import json
import os
import os.path as osp
import sys
from PIL import Image
import numpy as np
# -----------------------------------------------------------------------------------------
def parse_wider_gt(dets_file_name, isEllipse=False):
# -------------------------------------------------------... | [
"json.dump",
"os.makedirs",
"argparse.ArgumentParser",
"numpy.array",
"os.path.join"
] | [((2680, 2734), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Convert dataset"""'}), "(description='Convert dataset')\n", (2703, 2734), False, 'import argparse\n'), ((3781, 3821), 'os.makedirs', 'os.makedirs', (['args.datadir'], {'exist_ok': '(True)'}), '(args.datadir, exist_ok=True)\n'... |
import numpy as np
a=np.load("/Users/ibm_siyuhuo/Github Repo/seq2seq/foodData/doinfer.npy")
ang1Pred=np.load("results/npyRes/ang1Pred.npy")
ang2Pred=np.load("results/npyRes/ang2Pred.npy")
thefile = open('./res_angle.txt', 'w')
for i in range(len(a)):
tmp1=""
tmp2=""
tmp3=""
for j in range(len(a[i])):
... | [
"numpy.load"
] | [((21, 91), 'numpy.load', 'np.load', (['"""/Users/ibm_siyuhuo/Github Repo/seq2seq/foodData/doinfer.npy"""'], {}), "('/Users/ibm_siyuhuo/Github Repo/seq2seq/foodData/doinfer.npy')\n", (28, 91), True, 'import numpy as np\n'), ((101, 139), 'numpy.load', 'np.load', (['"""results/npyRes/ang1Pred.npy"""'], {}), "('results/np... |
import json
import warnings
from collections import Counter, defaultdict
from glob import glob
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.optimize import minimize
from scipy.stats import norm
from tqdm import tqdm
plt.style.use('fivet... | [
"seaborn.heatmap",
"numpy.sum",
"pandas.read_csv",
"numpy.isnan",
"collections.defaultdict",
"matplotlib.pyplot.style.use",
"numpy.mean",
"networkx.draw_networkx_nodes",
"networkx.draw_networkx_labels",
"glob.glob",
"pandas.DataFrame",
"numpy.std",
"numpy.max",
"numpy.reshape",
"numpy.li... | [((300, 332), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (313, 332), True, 'import matplotlib.pyplot as plt\n'), ((1805, 1880), 'pandas.read_csv', 'pd.read_csv', (['fid'], {'index_col': '(0)', 'parse_dates': '(True)', 'infer_datetime_format': '(True)'}), '(... |
import numpy as np
import tensorflow as tf
from model.Sample_MIL import InstanceModels, RaggedModels
from model.KerasLayers import Losses, Metrics
from model import DatasetsUtils
from sklearn.model_selection import StratifiedShuffleSplit, StratifiedKFold
import pickle
physical_devices = tf.config.experimental.list_phys... | [
"pickle.dump",
"numpy.sum",
"numpy.argmax",
"numpy.ones",
"tensorflow.keras.callbacks.EarlyStopping",
"numpy.unique",
"model.KerasLayers.Losses.CrossEntropy",
"numpy.zeros_like",
"model.Sample_MIL.RaggedModels.MIL",
"model.KerasLayers.Metrics.Accuracy",
"numpy.apply_along_axis",
"tensorflow.ke... | [((288, 339), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (332, 339), True, 'import tensorflow as tf\n'), ((340, 408), 'tensorflow.config.experimental.set_memory_growth', 'tf.config.experimental.set_memory_growth', (['physical... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
script to generate figures for the paper
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import logsumexp
from matplotlib_scalebar.scalebar import ScaleBar
from . import prob, benchmark
# Figure
def fig_distribution(contigs, df, K, K0=10**3.5,... | [
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.bar",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.histogram",
"numpy.exp",
"scipy.special.logsumexp",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axvline",
"matplotlib.pypl... | [((1120, 1175), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Separation Distance $d$ (bp)"""'], {'fontsize': '(14)'}), "('Separation Distance $d$ (bp)', fontsize=14)\n", (1130, 1175), True, 'import matplotlib.pyplot as plt\n'), ((1180, 1233), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""Contact Probability $p(d)$... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import numpy as np
import logging
from train_test import train, test
import warnings
from arg_parser import init_parser
from setproctitle import setproctitle as ptitle
from normalized_env import NormalizedEnv
import gym
import sys
sys.path.insert(0,'../envs/')
f... | [
"arg_parser.init_parser",
"numpy.random.seed",
"util.get_output_folder",
"warnings.filterwarnings",
"normalized_env.NormalizedEnv",
"sys.path.insert",
"deadlineSchedulingMultipleArmsEnv.deadlineSchedulingMultipleArmsEnv",
"setproctitle.setproctitle",
"wolp_agent.WolpertingerAgent",
"recoveringBand... | [((289, 319), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../envs/"""'], {}), "(0, '../envs/')\n", (304, 319), False, 'import sys\n'), ((739, 758), 'setproctitle.setproctitle', 'ptitle', (['"""test_wolp"""'], {}), "('test_wolp')\n", (745, 758), True, 'from setproctitle import setproctitle as ptitle\n'), ((763, 7... |
from unittest import TestCase
import qelos_core as q
from torch.autograd import Variable
import torch
from torch import nn
import numpy as np
class TestEmptyWordEmb(TestCase):
def test_it(self):
dic = dict(zip(map(chr, range(97, 122)), range(1,122-97+1)))
dic[q.WordEmb.masktoken] = 0
m = ... | [
"numpy.allclose",
"torch.randn",
"qelos_core.ZeroWordLinout",
"numpy.random.randint",
"numpy.linalg.norm",
"qelos_core.PretrainedWordLinout",
"qelos_core.ComputedWordLinout",
"torch.FloatTensor",
"qelos_core.WordEmb",
"torch.nn.Linear",
"qelos_core.ZeroWordEmb",
"numpy.stack",
"qelos_core.Wo... | [((320, 350), 'qelos_core.ZeroWordEmb', 'q.ZeroWordEmb', (['(10)'], {'worddic': 'dic'}), '(10, worddic=dic)\n', (333, 350), True, 'import qelos_core as q\n'), ((771, 801), 'qelos_core.ZeroWordEmb', 'q.ZeroWordEmb', (['(10)'], {'worddic': 'dic'}), '(10, worddic=dic)\n', (784, 801), True, 'import qelos_core as q\n'), ((8... |
import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.metrics import confusion_matrix, roc_auc_score
from category_encoders import MEstimateEncoder
import numpy as np
from collections import defaultdict
def fit_predict(modelo, enc, data, target,... | [
"pandas.DataFrame",
"numpy.abs",
"numpy.transpose",
"sklearn.metrics.roc_auc_score",
"collections.defaultdict",
"sklearn.ensemble.GradientBoostingClassifier",
"category_encoders.MEstimateEncoder",
"sklearn.pipeline.Pipeline",
"sklearn.metrics.confusion_matrix",
"numpy.diag"
] | [((339, 386), 'sklearn.pipeline.Pipeline', 'Pipeline', (["[('encoder', enc), ('model', modelo)]"], {}), "([('encoder', enc), ('model', modelo)])\n", (347, 386), False, 'from sklearn.pipeline import Pipeline\n'), ((2183, 2212), 'sklearn.metrics.confusion_matrix', 'confusion_matrix', (['preds', 'true'], {}), '(preds, tru... |
# add the current directory to PYTHONPATH
from pathlib import Path
import sys
import os
path = Path(os.getcwd())
sys.path.append(str(path.parent))
# import the necessary packages
from sklearn.model_selection import train_test_split
from image_classification.callbacks import TrainingMonitor, CosineScheduler
from image_... | [
"numpy.ceil",
"image_classification.data.DataDispatcher",
"image_classification.callbacks.CosineScheduler",
"os.getcwd",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.losses.CategoricalCrossentropy",
"tensorflow.keras.callbacks.LearningRateScheduler... | [((833, 849), 'image_classification.data.DataDispatcher', 'DataDispatcher', ([], {}), '()\n', (847, 849), False, 'from image_classification.data import DataDispatcher\n'), ((953, 991), 'numpy.ceil', 'np.ceil', (['(dd.num_train_imgs / config.BS)'], {}), '(dd.num_train_imgs / config.BS)\n', (960, 991), True, 'import nump... |
# -----------------------------------------------------------------------------
# Copyright (c) 2015, <NAME>. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
import numpy as np
import matplotli... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.cm.jet",
"matplotlib.pyplot.bar",
"numpy.arange",
"numpy.random.rand"
] | [((342, 390), 'matplotlib.pyplot.axes', 'plt.axes', (['[0.025, 0.025, 0.95, 0.95]'], {'polar': '(True)'}), '([0.025, 0.025, 0.95, 0.95], polar=True)\n', (350, 390), True, 'import matplotlib.pyplot as plt\n'), ((404, 444), 'numpy.arange', 'np.arange', (['(0.0)', '(2 * np.pi)', '(2 * np.pi / N)'], {}), '(0.0, 2 * np.pi, ... |
####################
# Import Libraries
####################
import shap
import numpy as np
import pandas as pd
import altair as alt
import streamlit as st
import matplotlib.pyplot as plt
from math import sqrt
from dataclasses import dataclass
from sklearn.metrics import mean_squared_error
####################
# De... | [
"pandas.DataFrame",
"streamlit.sidebar.slider",
"streamlit.markdown",
"streamlit.sidebar.subheader",
"numpy.abs",
"matplotlib.pyplot.plot",
"streamlit.title",
"matplotlib.pyplot.figure",
"streamlit.text",
"numpy.polynomial.polynomial.polyval",
"numpy.sin",
"streamlit.pyplot",
"numpy.linspace... | [((1641, 1663), 'streamlit.title', 'st.title', (['"""Regression"""'], {}), "('Regression')\n", (1649, 1663), True, 'import streamlit as st\n'), ((1665, 1743), 'streamlit.markdown', 'st.markdown', (['"""Play with weights in sidebar and see if you can fit the points."""'], {}), "('Play with weights in sidebar and see if ... |
from __future__ import absolute_import
import numpy as np
from tensorflow.keras import Input
from numpy.testing import assert_almost_equal
import tensorflow.python.keras.backend as K
def get_standart_values_1d_box(n, dc_decomp=True, grad_bounds=False, nb=100):
"""
:param n: A set of functions with their mono... | [
"numpy.zeros_like",
"numpy.ones_like",
"numpy.sum",
"numpy.maximum",
"numpy.minimum",
"tensorflow.keras.Input",
"numpy.zeros",
"numpy.ones",
"numpy.transpose",
"numpy.clip",
"numpy.expand_dims",
"tensorflow.python.keras.backend.floatx",
"numpy.min",
"numpy.max",
"numpy.linspace",
"nump... | [((511, 522), 'numpy.ones', 'np.ones', (['nb'], {}), '(nb)\n', (518, 522), True, 'import numpy as np\n'), ((534, 546), 'numpy.zeros', 'np.zeros', (['nb'], {}), '(nb)\n', (542, 546), True, 'import numpy as np\n'), ((558, 569), 'numpy.ones', 'np.ones', (['nb'], {}), '(nb)\n', (565, 569), True, 'import numpy as np\n'), ((... |
# --------------
import pandas as pd
import numpy as np
# Read the data using pandas module.
#path = 'ipl_dataset.csv'
df_ipl = pd.read_csv(path)
df_ipl.shape
# Find the list of unique cities where matches were played
#df_ipl['city']
print('Unique Cities',df_ipl.loc[:,'city'].unique())
# Find the columns which co... | [
"pandas.read_csv",
"numpy.where"
] | [((131, 148), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (142, 148), True, 'import pandas as pd\n'), ((2118, 2190), 'numpy.where', 'np.where', (["(high_scoring['total_y'] > high_scoring['total_x'])", '"""yes"""', '"""no"""'], {}), "(high_scoring['total_y'] > high_scoring['total_x'], 'yes', 'no')\n", ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 7 15:50:28 2020
@author: <NAME>
"""
import numpy as np
from . import Protocols as prtcls
from memory_profiler import profile
from scipy.sparse import csr_matrix,lil_matrix
from scipy.sparse.csc import csc_matrix
from scipy.sparse import hstack
DEBUG = False
TypeEnum =... | [
"numpy.sum",
"numpy.ceil",
"numpy.abs",
"numpy.floor",
"numpy.zeros",
"numpy.identity",
"numpy.ones",
"scipy.sparse.lil_matrix",
"scipy.sparse.csr_matrix",
"numpy.array",
"numpy.matmul",
"scipy.sparse.hstack"
] | [((4713, 4727), 'numpy.array', 'np.array', (['lags'], {}), '(lags)\n', (4721, 4727), True, 'import numpy as np\n'), ((5047, 5059), 'numpy.sum', 'np.sum', (['x', '(0)'], {}), '(x, 0)\n', (5053, 5059), True, 'import numpy as np\n'), ((5070, 5082), 'numpy.sum', 'np.sum', (['y', '(0)'], {}), '(y, 0)\n', (5076, 5082), True,... |
import numpy as np
import xarray as xr
import pickle
import serialization
from copy import deepcopy
import pytest
def test_xarray():
arr = np.ones((128, 256, 256), dtype=np.float32)
arr[8, 8, 8] = 2
arr = xr.DataArray(arr)
arrpkl = pickle.dumps(arr)
data = [
1, "2", arr,
[3, "4", ... | [
"copy.deepcopy",
"serialization.serialize",
"numpy.ones",
"pytest.raises",
"xarray.DataArray",
"serialization.deserialize",
"numpy.all",
"pickle.dumps"
] | [((145, 187), 'numpy.ones', 'np.ones', (['(128, 256, 256)'], {'dtype': 'np.float32'}), '((128, 256, 256), dtype=np.float32)\n', (152, 187), True, 'import numpy as np\n'), ((219, 236), 'xarray.DataArray', 'xr.DataArray', (['arr'], {}), '(arr)\n', (231, 236), True, 'import xarray as xr\n'), ((250, 267), 'pickle.dumps', '... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Test for utils
from inspect import signature
import numpy as np
import xarray as xr
from xclim.core.indicator import Daily
from xclim.core.utils import (
ensure_chunk_size,
nan_calc_percentiles,
walk_map,
wrapped_partial,
)
def test_walk_map():
d =... | [
"xclim.core.utils.nan_calc_percentiles",
"numpy.asarray",
"numpy.zeros",
"numpy.isnan",
"xclim.core.utils.walk_map",
"numpy.arange",
"inspect.signature",
"xclim.core.utils.ensure_chunk_size",
"xclim.core.utils.wrapped_partial",
"numpy.all"
] | [((355, 379), 'xclim.core.utils.walk_map', 'walk_map', (['d', '(lambda x: 0)'], {}), '(d, lambda x: 0)\n', (363, 379), False, 'from xclim.core.utils import ensure_chunk_size, nan_calc_percentiles, walk_map, wrapped_partial\n'), ((549, 575), 'xclim.core.utils.wrapped_partial', 'wrapped_partial', (['func'], {'b': '(2)'})... |
# -*- coding: utf-8 -*-
"""
It is better to use constant variables instead of hoping you spell the same
string correctly every time you use it. (Also it makes it much easier if a
string name changes)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# import utool
import six
import ... | [
"utool.invert_dict",
"utool.noinject",
"numpy.array",
"utool.get_argflag",
"collections.OrderedDict",
"utool.get_computer_name",
"os.path.join",
"utool.get_argval"
] | [((424, 446), 'utool.noinject', 'ut.noinject', (['"""[const]"""'], {}), "('[const]')\n", (435, 446), True, 'import utool as ut\n'), ((552, 780), 'collections.OrderedDict', 'OrderedDict', (["[('right', 0.0 * TAU), ('frontright', 0.125 * TAU), ('front', 0.25 * TAU),\n ('frontleft', 0.375 * TAU), ('left', 0.5 * TAU), (... |
#numpyZeroArrays.py
import numpy as np
zeroArray = np.zeros(25)
zeroArray2 = np.zeros((5,5))
print(zeroArray)
print(zeroArray2) | [
"numpy.zeros"
] | [((52, 64), 'numpy.zeros', 'np.zeros', (['(25)'], {}), '(25)\n', (60, 64), True, 'import numpy as np\n'), ((78, 94), 'numpy.zeros', 'np.zeros', (['(5, 5)'], {}), '((5, 5))\n', (86, 94), True, 'import numpy as np\n')] |
import matplotlib
matplotlib.use('agg')
from substorm_utils.signature_lists import get_model_signature_lists, get_obs_signature_lists
from substorm_utils.bin_listings import find_substorms_convolution, find_substorms, find_convolution_onsets
from datetime import datetime, timedelta
import numpy as np
from matplotlib im... | [
"substorm_utils.signature_lists.get_model_signature_lists",
"substorm_utils.isi.get_isi",
"decouple.config",
"isi_functions.get_kde_ci",
"isi_functions.get_kde_cached",
"matplotlib.pyplot.figure",
"matplotlib.use",
"datetime.timedelta",
"matplotlib_utils.remove_overhanging_labels",
"numpy.linspace... | [((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (32, 39), False, 'import matplotlib\n'), ((1402, 1420), 'datetime.timedelta', 'timedelta', (['(0)', '(1800)'], {}), '(0, 1800)\n', (1411, 1420), False, 'from datetime import datetime, timedelta\n'), ((1457, 1474), 'decouple.config', 'conf... |
import unittest
import vinnpy
import numpy
from contexts import contexts
from nose_parameterized import parameterized
class test_numpy_integration(unittest.TestCase):
@parameterized.expand(contexts().enumerate, contexts().name)
def test_create_with_numpy_matrix_succeeds(self, context):
a = vinnpy.mat... | [
"contexts.contexts",
"numpy.matrix",
"vinnpy.matrix",
"numpy.array"
] | [((882, 937), 'numpy.matrix', 'numpy.matrix', (['[[1.0, 2.0], [3.0, 4.0]]'], {'dtype': '"""float32"""'}), "([[1.0, 2.0], [3.0, 4.0]], dtype='float32')\n", (894, 937), False, 'import numpy\n'), ((950, 979), 'vinnpy.matrix', 'vinnpy.matrix', (['context', 'array'], {}), '(context, array)\n', (963, 979), False, 'import vin... |
import pandas as pd
import json
import requests
from bs4 import BeautifulSoup
import numpy as np
from cloud_pricing.data.interface import FixedInstance
class AzureProcessor(FixedInstance):
url = 'https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/'
azure_gpus_ram = {
'K80': 12, ... | [
"pandas.DataFrame",
"numpy.array",
"requests.get",
"bs4.BeautifulSoup",
"pandas.concat"
] | [((1419, 1457), 'pandas.DataFrame', 'pd.DataFrame', (['all_data'], {'columns': 'titles'}), '(all_data, columns=titles)\n', (1431, 1457), True, 'import pandas as pd\n'), ((1557, 1579), 'requests.get', 'requests.get', (['self.url'], {}), '(self.url)\n', (1569, 1579), False, 'import requests\n'), ((1595, 1627), 'bs4.Beaut... |
import argparse
import numpy as np
from flask import Flask, request
import json
from text_classification.main import use_backend
from text_classification.opt import add_train_opt, add_server_opt
from text_classification.utils import load_opt
from text_classification.data import load_vocab, UNK_IDX
def run(opt_mod... | [
"argparse.ArgumentParser",
"flask.request.args.get",
"flask.Flask",
"text_classification.data.load_vocab",
"text_classification.main.use_backend",
"text_classification.opt.add_train_opt",
"numpy.array",
"text_classification.utils.load_opt",
"text_classification.opt.add_server_opt"
] | [((914, 946), 'text_classification.data.load_vocab', 'load_vocab', (['opt_model.vocab_path'], {}), '(opt_model.vocab_path)\n', (924, 946), False, 'from text_classification.data import load_vocab, UNK_IDX\n'), ((963, 995), 'text_classification.data.load_vocab', 'load_vocab', (['opt_model.label_path'], {}), '(opt_model.l... |
""" module to test mloutput assessments."""
import numpy as np
from duckie.mltesting_assessments import ConfusionMatrixAssessment
import os.path
import pandas as pd
def test_cma():
"""Test case for the confusion matrix assessment.
"""
confusion_matrix = np.load('tests/test_data/test_confusion_matrix.npy... | [
"numpy.load",
"numpy.allclose",
"numpy.array",
"duckie.mltesting_assessments.ConfusionMatrixAssessment",
"numpy.array_equal"
] | [((270, 322), 'numpy.load', 'np.load', (['"""tests/test_data/test_confusion_matrix.npy"""'], {}), "('tests/test_data/test_confusion_matrix.npy')\n", (277, 322), True, 'import numpy as np\n'), ((334, 387), 'duckie.mltesting_assessments.ConfusionMatrixAssessment', 'ConfusionMatrixAssessment', (['confusion_matrix', '"""Te... |
import torch
import numpy as np
import numba
import warnings
from .._models import Model, enforce_observed
from ...fitter import FitterSGD
@numba.jit(nopython=True, fastmath=True)
def _quant_hawkes_model_init_cache(times, counts, M, excit_func_jit):
dim = len(counts)
n_jumps = [len(times[i]) for i in range(d... | [
"numpy.sum",
"warnings.simplefilter",
"numpy.zeros",
"torch.cat",
"torch.exp",
"torch.cuda.is_available",
"numba.jit",
"numpy.array",
"warnings.catch_warnings",
"torch.sum",
"torch.tensor"
] | [((143, 182), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)', 'fastmath': '(True)'}), '(nopython=True, fastmath=True)\n', (152, 182), False, 'import numba\n'), ((338, 368), 'numpy.zeros', 'np.zeros', (['(dim, M, n_jumps[i])'], {}), '((dim, M, n_jumps[i]))\n', (346, 368), True, 'import numpy as np\n'), ((1592, 161... |
"""
author: <NAME> & <NAME>
code to generate synthetic data from stock-model SDEs
"""
# ==============================================================================
from math import sqrt, exp
import numpy as np
import matplotlib.pyplot as plt
import copy, os
# =====================================================... | [
"numpy.sum",
"numpy.maximum",
"numpy.empty",
"numpy.sin",
"numpy.exp",
"numpy.random.normal",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.size",
"matplotlib.pyplot.legend",
"numpy.concatenate",
"math.exp",
"numpy.log",
"matplotlib.pyplot.plot",
"copy.copy",
"numpy.s... | [((19536, 19560), 'numpy.sum', 'np.sum', (['(inner / n_obs_ot)'], {}), '(inner / n_obs_ot)\n', (19542, 19560), True, 'import numpy as np\n'), ((21093, 21138), 'matplotlib.pyplot.plot', 'plt.plot', (['dates', 'one_path'], {'label': '"""stock path"""'}), "(dates, one_path, label='stock path')\n", (21101, 21138), True, 'i... |
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD 3 clause
from inspect import getargs
import numpy as np
import pandas as pd
from sklearn.externals import joblib
from sklearn.pipeline import FeatureUnion
from sklearn.preprocessing import FunctionTransformer
from .bivariate import get_bivariate_f... | [
"pandas.DataFrame",
"sklearn.pipeline.FeatureUnion",
"sklearn.externals.joblib.Parallel",
"sklearn.externals.joblib.delayed",
"pandas.MultiIndex.from_arrays",
"inspect.getargs",
"numpy.arange",
"numpy.vstack"
] | [((9222, 9256), 'sklearn.pipeline.FeatureUnion', 'FeatureUnion', ([], {'transformer_list': '_tr'}), '(transformer_list=_tr)\n', (9234, 9256), False, 'from sklearn.pipeline import FeatureUnion\n'), ((9478, 9492), 'numpy.vstack', 'np.vstack', (['res'], {}), '(res)\n', (9487, 9492), True, 'import numpy as np\n'), ((3620, ... |
"""An abstract baseclass for apriori orbits
Description:
------------
Implementations of apriori orbits should inherit from `AprioriOrbit` and define their own read and calculate methods.
"""
# Standard library imports
import datetime
from typing import Any, Dict
# External library imports
import numpy as np
# Mi... | [
"where.lib.util.not_implemented",
"where.lib.log.fatal",
"where.data.dataset3.Dataset",
"numpy.einsum"
] | [((1710, 1821), 'where.data.dataset3.Dataset', 'dataset.Dataset', ([], {'rundate': 'rundate', 'pipeline': 'pipeline', 'stage': 'self.name', 'label': '"""raw"""', 'profile': 'profile', 'id': 'id_'}), "(rundate=rundate, pipeline=pipeline, stage=self.name, label=\n 'raw', profile=profile, id=id_)\n", (1725, 1821), True... |
"""
Usage:
$(cdips) python merge_for_exofoptess.py
"""
import os, socket
from glob import glob
import numpy as np, pandas as pd
from numpy import array as nparr
from scipy.optimize import curve_fit
from astrobase import imageutils as iu
from astrobase.timeutils import get_epochs_given_midtimes_and_period
from cdips.... | [
"cdips.utils.get_vizier_catalogs.get_k13_param_table",
"numpy.argmax",
"pandas.read_csv",
"cdips.utils.pipelineutils.load_status",
"glob.glob",
"os.path.join",
"astrobase.imageutils.get_header_keyword",
"numpy.unique",
"pandas.DataFrame",
"os.path.dirname",
"cdips.utils.collect_cdips_lightcurves... | [((615, 635), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (633, 635), False, 'import os, socket\n'), ((3347, 3453), 'os.path.join', 'os.path.join', (['fitdir', '"""sector-*_CLEAR_THRESHOLD/fitresults/hlsp_*gaiatwo*_llc/*fitparameters.csv"""'], {}), "(fitdir,\n 'sector-*_CLEAR_THRESHOLD/fitresults/h... |
"""
Test routine to test some of the model reduction routines
"""
import numpy as np
import scipy as sp
import nose
from amfe import modal_assurance, principal_angles
def test_mac_diag_ones():
'''
Test mac criterion for getting ones on the diagonal, if the same matrix is
given.
'''
N = 100
n ... | [
"numpy.eye",
"amfe.modal_assurance",
"numpy.zeros",
"numpy.ones",
"scipy.linalg.qr",
"numpy.random.rand",
"numpy.diag",
"amfe.principal_angles"
] | [((333, 353), 'numpy.random.rand', 'np.random.rand', (['N', 'n'], {}), '(N, n)\n', (347, 353), True, 'import numpy as np\n'), ((368, 389), 'amfe.modal_assurance', 'modal_assurance', (['A', 'A'], {}), '(A, A)\n', (383, 389), False, 'from amfe import modal_assurance, principal_angles\n'), ((525, 545), 'numpy.random.rand'... |
# 1. Import packages
import numpy as np
import pandas as pd
import os
from keras.models import Sequential
from keras.layers import Dense, Activation
from keras.preprocessing.sequence import pad_sequences
from gensim.models import word2vec
import logging
import utils.stemming as stemming
import utils.tokens as tokens
im... | [
"pandas.DataFrame",
"logging.basicConfig",
"os.getcwd",
"pandas.read_csv",
"keras.preprocessing.sequence.pad_sequences",
"gensim.models.word2vec.Word2Vec",
"keras.layers.Dense",
"gensim.models.word2vec.Word2Vec.load",
"keras.models.Sequential",
"os.chdir",
"numpy.concatenate"
] | [((350, 445), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s : %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s : %(levelname)s : %(message)s',\n level=logging.INFO)\n", (369, 445), False, 'import logging\n'), ((586, 597), 'os.getcwd', 'os.getcwd', ([],... |
from ldpc.encoder import EncoderG, EncoderTriangularH
import pytest
from ldpc.utils import NonBinaryMatrix, AList, IncorrectLength
import numpy as np
from bitstring import Bits
import numpy.typing as npt
class TestEncoderG:
def test_non_binary_matrix(self) -> None:
mat = np.arange(1, 5).reshape((2, 2))
... | [
"ldpc.utils.AList.from_file",
"numpy.testing.assert_array_equal",
"ldpc.encoder.EncoderTriangularH",
"pytest.raises",
"numpy.random.randint",
"numpy.array",
"ldpc.encoder.EncoderG",
"numpy.matmul",
"bitstring.Bits",
"numpy.arange"
] | [((517, 528), 'ldpc.encoder.EncoderG', 'EncoderG', (['g'], {}), '(g)\n', (525, 528), False, 'from ldpc.encoder import EncoderG, EncoderTriangularH\n'), ((589, 636), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['g', 'enc.generator'], {}), '(g, enc.generator)\n', (618, 636), True, 'import numpy ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 24 23:27:19 2021
@author: <NAME>
"""
from scipy.io import loadmat
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse import save_npz, load_npz
import multiprocessing as mp
import itertools
import time
import os
from gidmutils i... | [
"numpy.save",
"numpy.abs",
"numpy.sum",
"scipy.io.loadmat",
"os.path.dirname",
"numpy.zeros",
"time.perf_counter",
"numpy.nonzero",
"gc.collect",
"scipy.sparse.csr_matrix",
"scipy.sparse.save_npz",
"multiprocessing.Pool",
"itertools.chain"
] | [((1588, 1640), 'scipy.io.loadmat', 'loadmat', (['"""../TestData/Cancer/breast_cancer_5000.mat"""'], {}), "('../TestData/Cancer/breast_cancer_5000.mat')\n", (1595, 1640), False, 'from scipy.io import loadmat\n'), ((3036, 3091), 'numpy.save', 'np.save', (['"""../TestData/Cancer/cancerMP_21_signed.npy"""', 'D'], {}), "('... |
from typing import Dict, List, Iterable, Optional, Tuple
import numpy as np
from yarll.memory.experiences_memory import Experience
class PreAllocMemory:
def __init__(self, max_size: int, observation_shape: Tuple[int], action_shape: Tuple[int], states_dtype: type = np.float32):
self.max_size = max_size
... | [
"numpy.empty",
"numpy.copyto",
"numpy.random.randint",
"numpy.arange"
] | [((1566, 1614), 'numpy.random.randint', 'np.random.randint', (['(0)', 'self.n_entries', 'batch_size'], {}), '(0, self.n_entries, batch_size)\n', (1583, 1614), True, 'import numpy as np\n'), ((2374, 2428), 'numpy.copyto', 'np.copyto', (["self._data['states0'][self._pointer]", 'state'], {}), "(self._data['states0'][self.... |
"""Base ModelServer test class."""
import json
import numpy as np
from serveit.server import ModelServer
class ModelServerTest(object):
"""Base class to test the prediction server.
ModelServerTest should be inherited by a class that has a `model` attribute,
and calls `ModelServerTest._setup()` after ins... | [
"serveit.server.ModelServer",
"json.loads",
"json.dumps",
"numpy.random.randint",
"numpy.array",
"flask.request.get_json"
] | [((855, 902), 'serveit.server.ModelServer', 'ModelServer', (['self.model', 'self.predict'], {}), '(self.model, self.predict, **kwargs)\n', (866, 902), False, 'from serveit.server import ModelServer\n'), ((1345, 1395), 'numpy.random.randint', 'np.random.randint', (['self.data.data.shape[0]'], {'size': 'n'}), '(self.data... |
# -*- coding: utf-8 -*-
# Author : <NAME>
# e-mail : <EMAIL>
# Powered by Seculayer © 2021 Service Model Team, R&D Center.
import tensorflow as tf
from mlps.common.Common import Common
from mlps.common.exceptions.ParameterError import ParameterError
from mlps.core.apeflow.api.algorithms.tf.keras.TFKerasAlgAbstract im... | [
"tensorflow.keras.layers.Dropout",
"tensorflow.config.list_physical_devices",
"tensorflow.config.experimental.set_memory_growth",
"numpy.array",
"tensorflow.keras.Sequential",
"mlps.core.apeflow.interface.utils.tf.TFUtils.TFUtils.get_units",
"tensorflow.keras.layers.Flatten"
] | [((5970, 6008), 'tensorflow.config.list_physical_devices', 'tf.config.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (6001, 6008), True, 'import tensorflow as tf\n'), ((2685, 2706), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', ([], {}), '()\n', (2704, 2706), True, 'import tensorflow as tf\n'), ((470... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 17 02:03:03 2021
@author: J76747
"""
import requests
import json
import urllib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from sk... | [
"matplotlib.pyplot.title",
"sklearn.model_selection.GridSearchCV",
"pandas.DataFrame",
"numpy.sum",
"numpy.abs",
"timeit.default_timer",
"sklearn.model_selection.train_test_split",
"pandas.get_dummies",
"pandas.read_json",
"sklearn.ensemble.GradientBoostingClassifier",
"urllib.request.urlretriev... | [((4461, 4515), 'urllib.request.urlretrieve', 'urllib.request.urlretrieve', (['url', '"""large_sparkify.json"""'], {}), "(url, 'large_sparkify.json')\n", (4487, 4515), False, 'import urllib\n'), ((10173, 10177), 'timeit.default_timer', 'dt', ([], {}), '()\n', (10175, 10177), True, 'from timeit import default_timer as d... |
# Import Modules
from keras.models import Sequential
from keras.layers import MaxPooling2D
from keras.layers import Conv2D
from keras.layers import Activation, Dropout, Flatten, Dense
import numpy as np
# Set Categories
categories = ["원피스", "블라우스", "코트", "롱자켓", "패딩", "티셔츠", "맨투맨", "니트", "자켓", "가디건",
"점퍼"... | [
"numpy.load",
"keras.layers.Activation",
"keras.layers.Dropout",
"keras.layers.Flatten",
"keras.layers.Dense",
"keras.layers.Conv2D",
"keras.models.Sequential",
"keras.layers.MaxPooling2D"
] | [((505, 554), 'numpy.load', 'np.load', (['"""./detailer_data.npy"""'], {'allow_pickle': '(True)'}), "('./detailer_data.npy', allow_pickle=True)\n", (512, 554), True, 'import numpy as np\n'), ((664, 676), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (674, 676), False, 'from keras.models import Sequential\n... |
import numpy as np
import sys
from .reference_signal import *
from .helper import *
class Amplifier:
"""
A software Lock-in Amplifier
"""
def __init__(self, cutoff, pbar = True):
"""
Takes in a cutoff frequency (float) as an input
as well as whether or not to display the progress
bar.
"""
self.cutoff ... | [
"numpy.asarray",
"numpy.reshape"
] | [((1351, 1383), 'numpy.asarray', 'np.asarray', (["signal_input['time']"], {}), "(signal_input['time'])\n", (1361, 1383), True, 'import numpy as np\n'), ((1397, 1431), 'numpy.asarray', 'np.asarray', (["signal_input['signal']"], {}), "(signal_input['signal'])\n", (1407, 1431), True, 'import numpy as np\n'), ((1640, 1678)... |
# Copyright 2016 The TensorFlow 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 applica... | [
"tensorflow.test.main",
"tensorflow.contrib.learn.python.learn.estimators.head._regression_head",
"numpy.average",
"tensorflow.contrib.learn.python.learn.estimators.head._binary_svm_head",
"tensorflow.trainable_variables",
"six.iterkeys",
"tensorflow.global_variables_initializer",
"tensorflow.contrib.... | [((16038, 16048), 'tensorflow.no_op', 'tf.no_op', ([], {}), '()\n', (16046, 16048), True, 'import tensorflow as tf\n'), ((16079, 16093), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (16091, 16093), True, 'import tensorflow as tf\n'), ((1857, 1884), 'tensorflow.contrib.learn.python.learn.estimators.head._re... |
#!/usr/bin/env python
'''
This script starts an object detection service which uses the filtered pcl data
to detect and recognize the object
'''
from pcl_helper import *
from transform_helper import Transformer
from image_helper import ImagePub
import pcl
import rospy
from sensor_msgs.msg import PointCloud2
from ... | [
"rospy.Subscriber",
"transform_helper.Transformer",
"numpy.mean",
"numpy.asscalar",
"std_srvs.srv.EmptyResponse",
"image_helper.ImagePub",
"rospy.Time.now",
"numpy.max",
"rospy.init_node",
"pcl.PointCloud",
"svmClassifier.Classifier",
"rospy.loginfo",
"numpy.min",
"rospy.Service",
"rospy... | [((547, 658), 'numpy.array', 'np.array', (['[[554.3827128226441, 0.0, 320.5, 0], [0.0, 554.3827128226441, 240.5, 0.0],\n [0.0, 0.0, 1.0, 0.0]]'], {}), '([[554.3827128226441, 0.0, 320.5, 0], [0.0, 554.3827128226441, \n 240.5, 0.0], [0.0, 0.0, 1.0, 0.0]])\n', (555, 658), True, 'import numpy as np\n'), ((774, 790), ... |
"""
Author: Tong
Time: --2021
"""
import json
import numpy as np
with open("data/webred/webred_21.json", "r") as file_in:
original_data = json.load(file_in)
# process data into <x, y>
_pair_data = []
for item in original_data:
_pair_data.append([item['sentence'], item['relation_name']])
pass
len_ = []
for... | [
"numpy.size",
"json.load",
"numpy.max",
"numpy.where",
"numpy.array"
] | [((400, 414), 'numpy.array', 'np.array', (['len_'], {}), '(len_)\n', (408, 414), True, 'import numpy as np\n'), ((146, 164), 'json.load', 'json.load', (['file_in'], {}), '(file_in)\n', (155, 164), False, 'import json\n'), ((442, 454), 'numpy.max', 'np.max', (['len_'], {}), '(len_)\n', (448, 454), True, 'import numpy as... |
from torch.utils.data import Dataset, DataLoader
from tqdm.autonotebook import tqdm
import torch
from PIL import Image
import numpy as np
from torch.nn.utils.rnn import pad_sequence
"""
Write your own dataset here.
The __getitem__ method must return a dict with the following key, value pairs:
'ques': tensor of int... | [
"numpy.moveaxis",
"PIL.Image.open",
"numpy.array",
"torch.nn.utils.rnn.pad_sequence",
"torch.tensor",
"torch.from_numpy"
] | [((2633, 2669), 'torch.nn.utils.rnn.pad_sequence', 'pad_sequence', (['ques'], {'batch_first': '(True)'}), '(ques, batch_first=True)\n', (2645, 2669), False, 'from torch.nn.utils.rnn import pad_sequence\n'), ((2180, 2203), 'numpy.moveaxis', 'np.moveaxis', (['img', '(-1)', '(0)'], {}), '(img, -1, 0)\n', (2191, 2203), Tru... |
import cv2
import numpy as np
from skimage.measure import compare_ssim
import matplotlib.pyplot as plt
import numpy as np
import cv2
import imutils
def warp_flow(img, flow):
h, w = flow.shape[:2]
flow = -flow
flow[:,:,0] += np.arange(w)
flow[:,:,1] += np.arange(h)[:,np.newaxis]
res = cv2.remap(img... | [
"skimage.measure.compare_ssim",
"numpy.zeros_like",
"cv2.cvtColor",
"numpy.fromfile",
"cv2.threshold",
"numpy.std",
"cv2.remap",
"cv2.rectangle",
"cv2.imread",
"numpy.max",
"numpy.mean",
"numpy.arange",
"numpy.min",
"imutils.grab_contours",
"cv2.boundingRect"
] | [((2354, 2394), 'cv2.cvtColor', 'cv2.cvtColor', (['imageA', 'cv2.COLOR_BGR2GRAY'], {}), '(imageA, cv2.COLOR_BGR2GRAY)\n', (2366, 2394), False, 'import cv2\n'), ((2403, 2443), 'cv2.cvtColor', 'cv2.cvtColor', (['imageB', 'cv2.COLOR_BGR2GRAY'], {}), '(imageB, cv2.COLOR_BGR2GRAY)\n', (2415, 2443), False, 'import cv2\n'), (... |
import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
from freeenergyframework import stats
import pandas as pd
class Result(object):
def __init__(self, ligandA, ligandB,
exp_DDG, exp_dDDG,
calc_DDG, mbar_error, other_error):
self.ligandA = str(ligandA)... | [
"pandas.DataFrame",
"matplotlib.pyplot.title",
"networkx.draw_circular",
"matplotlib.pyplot.show",
"networkx.is_connected",
"matplotlib.pyplot.figure",
"freeenergyframework.stats.mle",
"networkx.DiGraph",
"matplotlib.pyplot.savefig",
"numpy.diagonal"
] | [((874, 1160), 'pandas.DataFrame', 'pd.DataFrame', (["{'ligandA': self.ligandA, 'ligandB': self.ligandB, 'exp_DDG': self.exp_DDG,\n 'exp_dDDG': self.dexp_DDG, 'calc_DDG': self.calc_DDG, 'mbar_dDDG': self\n .mbar_dDDG, 'other_dDDG': self.other_dDDG, 'dcalc_DDG': self.dcalc_DDG}"], {'index': "[f'{self.ligandA}_{sel... |
import numpy as np
from allennlp.training.metrics import Metric
from overrides import overrides
from typing import Dict
@Metric.register('cross-entropy')
class CrossEntropyMetric(Metric):
def __init__(self) -> None:
self.total_loss = 0
self.total_num_tokens = 0
@overrides
def __call__(sel... | [
"numpy.exp",
"allennlp.training.metrics.Metric.register"
] | [((123, 155), 'allennlp.training.metrics.Metric.register', 'Metric.register', (['"""cross-entropy"""'], {}), "('cross-entropy')\n", (138, 155), False, 'from allennlp.training.metrics import Metric\n'), ((606, 627), 'numpy.exp', 'np.exp', (['cross_entropy'], {}), '(cross_entropy)\n', (612, 627), True, 'import numpy as n... |
"""
Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-ND 4.0 license (https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode).
"""
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch.autograd import Variable
import math
from torch.... | [
"torch.nn.Embedding",
"torch.cat",
"numpy.random.randint",
"numpy.arange",
"numpy.random.normal",
"torch.nn.BatchNorm3d",
"torch.nn.Conv3d",
"torch.nn.Linear",
"torch.nn.GRUCell",
"numpy.repeat",
"torch.autograd.Variable",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available... | [((376, 401), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (399, 401), False, 'import torch\n'), ((5321, 5341), 'torch.nn.modules.utils._triple', '_triple', (['kernel_size'], {}), '(kernel_size)\n', (5328, 5341), False, 'from torch.nn.modules.utils import _triple\n'), ((5359, 5374), 'torch.nn... |
from keras.models import Sequential
from keras.layers import Dense, Embedding, LSTM
from keras.utils.np_utils import to_categorical
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.callbacks import ModelCheckpoint, EarlyStopping
import pandas as pd
... | [
"pickle.dump",
"json.load",
"pandas.read_csv",
"keras.preprocessing.sequence.pad_sequences",
"keras.callbacks.ModelCheckpoint",
"numpy.asarray",
"keras.layers.LSTM",
"sklearn.preprocessing.LabelEncoder",
"keras.preprocessing.text.Tokenizer",
"random.seed",
"numpy.arange",
"keras.callbacks.Earl... | [((521, 548), 'random.seed', 'random.seed', (["config['seed']"], {}), "(config['seed'])\n", (532, 548), False, 'import random\n'), ((1048, 1123), 'pandas.read_csv', 'pd.read_csv', (['input_file'], {'sep': '""",,,"""', 'header': 'None', 'names': "['question', 'type']"}), "(input_file, sep=',,,', header=None, names=['que... |
# Author: bbrighttaer
# Project: irelease
# Date: 7/15/2020
# Time: 11:59 AM
# File: internal_diversity.py
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import rdkit.Chem as Chem
from rdkit import DataStructs
from rdkit.Chem import AllChem
def verify_sequence(... | [
"numpy.mean",
"rdkit.DataStructs.BulkTanimotoSimilarity",
"rdkit.Chem.MolFromSmiles",
"rdkit.Chem.AllChem.GetMorganFingerprintAsBitVect"
] | [((338, 363), 'rdkit.Chem.MolFromSmiles', 'Chem.MolFromSmiles', (['smile'], {}), '(smile)\n', (356, 363), True, 'import rdkit.Chem as Chem\n'), ((888, 901), 'numpy.mean', 'np.mean', (['vals'], {}), '(vals)\n', (895, 901), True, 'import numpy as np\n'), ((958, 983), 'rdkit.Chem.MolFromSmiles', 'Chem.MolFromSmiles', (['s... |
import argparse
from datetime import datetime
from pathlib import Path
from collections import defaultdict
import numpy as np
import torch as th
import torch.nn as nn
from torch.nn.utils import clip_grad_norm_
from torch.optim.lr_scheduler import StepLR
from torch.utils.data import DataLoader
from tqdm import tqdm
fr... | [
"torch.optim.lr_scheduler.StepLR",
"argparse.ArgumentParser",
"collections.defaultdict",
"pathlib.Path",
"model.Transcriber_ONF",
"numpy.mean",
"torch.device",
"torch.no_grad",
"torch.utils.data.DataLoader",
"numpy.std",
"model.Transcriber_CRNN",
"datetime.datetime.now",
"model.Transcriber_R... | [((1710, 1755), 'torch.utils.data.DataLoader', 'DataLoader', (['dataset', 'batch_size'], {'shuffle': '(True)'}), '(dataset, batch_size, shuffle=True)\n', (1720, 1755), False, 'from torch.utils.data import DataLoader\n'), ((2338, 2383), 'torch.optim.lr_scheduler.StepLR', 'StepLR', (['optimizer'], {'step_size': '(1000)',... |
import shapely
import numpy as np
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
class Obstacle(object):
def __init__(self, frame, width, height):
self.frame = frame
self.width = width
self.height = height
self.shape = np.array([ [-0.5, 0.... | [
"matplotlib.collections.PatchCollection",
"shapely.geometry.Point",
"numpy.array"
] | [((300, 362), 'numpy.array', 'np.array', (['[[-0.5, 0.5], [0.5, 0.5], [0.5, -0.5], [-0.5, -0.5]]'], {}), '([[-0.5, 0.5], [0.5, 0.5], [0.5, -0.5], [-0.5, -0.5]])\n', (308, 362), True, 'import numpy as np\n'), ((386, 411), 'numpy.array', 'np.array', (['[width, height]'], {}), '([width, height])\n', (394, 411), True, 'imp... |
import os
import pprint as pp
import random
import sys
import numpy as np
import networkx as nx
test_app = sys.argv[1]
def convert(integer, length):
bool_list = [0] * length
bool_list[integer] = 1
return bool_list
def maxminnor(cols):
temp = []
for i in range(len(cols)):
temp.append(int(cols[i],16))
... | [
"numpy.save",
"networkx.write_edgelist",
"os.environ.get",
"numpy.array",
"networkx.DiGraph",
"numpy.concatenate"
] | [((653, 665), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (663, 665), True, 'import networkx as nx\n'), ((675, 703), 'os.environ.get', 'os.environ.get', (['"""GRAPHLEARN"""'], {}), "('GRAPHLEARN')\n", (689, 703), False, 'import os\n'), ((3954, 4013), 'networkx.write_edgelist', 'nx.write_edgelist', (['G', "(save... |
from numpy import finfo
from ._make_annotations import _make_annotations
from ._process_target_or_features_for_plotting import (
_process_target_or_features_for_plotting,
)
from ._style import (
ANNOTATION_FONT_SIZE,
ANNOTATION_WIDTH,
LAYOUT_SIDE_MARGIN,
LAYOUT_WIDTH,
ROW_HEIGHT,
)
from .plot.p... | [
"numpy.finfo"
] | [((428, 440), 'numpy.finfo', 'finfo', (['float'], {}), '(float)\n', (433, 440), False, 'from numpy import finfo\n')] |
import os
import random
import numpy as np
import torch.utils.data
import misc
from data.structure import RelationType, ObjectType, AttributeType, Triple, Structure
class PreprocessDataset(torch.utils.data.Dataset):
'''This is only used to load data for preprocessing purposes.'''
def __init__(self, data_fil... | [
"os.mkdir",
"numpy.load",
"misc.load_file",
"random.shuffle",
"os.path.exists",
"misc.save_file",
"data.structure.Structure",
"data.structure.Triple",
"os.listdir",
"numpy.sqrt"
] | [((641, 652), 'data.structure.Structure', 'Structure', ([], {}), '()\n', (650, 652), False, 'from data.structure import RelationType, ObjectType, AttributeType, Triple, Structure\n'), ((1251, 1271), 'os.listdir', 'os.listdir', (['data_dir'], {}), '(data_dir)\n', (1261, 1271), False, 'import os\n'), ((1862, 1900), 'os.p... |
import numpy as np
from .kernels import gaussian
from .utils import estimate_bandwidth
class Ckde:
def __init__(self):
self.y_train = None
self.w_train = None
self.m_train = None
self.n_y = None
self.n_w = None
self.bandwidth_y = None
self.bandwidth_w = No... | [
"numpy.sum",
"numpy.copy",
"numpy.ones",
"numpy.prod",
"numpy.concatenate"
] | [((475, 491), 'numpy.copy', 'np.copy', (['y_train'], {}), '(y_train)\n', (482, 491), True, 'import numpy as np\n'), ((515, 531), 'numpy.copy', 'np.copy', (['w_train'], {}), '(w_train)\n', (522, 531), True, 'import numpy as np\n'), ((1150, 1171), 'numpy.ones', 'np.ones', (['self.m_train'], {}), '(self.m_train)\n', (1157... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 5 16:52:31 2019
@author: amber
"""
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sys
# In[2]:
df = pd.read_csv("iteration_error.txt", sep = "\x1b| |=", header = None, names = range(12), engine='python')... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((571, 585), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (583, 585), True, 'import matplotlib.pyplot as plt\n'), ((587, 607), 'matplotlib.pyplot.plot', 'plt.plot', (['error', '"""b"""'], {}), "(error, 'b')\n", (595, 607), True, 'import matplotlib.pyplot as plt\n'), ((608, 638), 'matplotlib.pyplot.s... |
'''
<NAME>
<EMAIL>
October 28, 2017
'''
import sys
import random
import numpy as np
import scipy as sc
import matplotlib as mlp
import matplotlib.pyplot as plt
from matplotlib import rc
from scipy import special
from scipy import stats
def readFileData(fileName):
'''
Reads in break data from files
@params... | [
"matplotlib.rc",
"numpy.sum",
"numpy.argsort",
"numpy.exp",
"numpy.random.normal",
"sys.exc_info",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.close",
"numpy.power",
"numpy.max",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.asarray",
"numpy.so... | [((977, 998), 'numpy.asarray', 'np.asarray', (['data_list'], {}), '(data_list)\n', (987, 998), True, 'import numpy as np\n'), ((1284, 1300), 'numpy.exp', 'np.exp', (['(-0.5 * e)'], {}), '(-0.5 * e)\n', (1290, 1300), True, 'import numpy as np\n'), ((1733, 1748), 'numpy.sort', 'np.sort', (['weight'], {}), '(weight)\n', (... |
import numpy as np
# Computing a histogram using np.histogram on a uint8 image with bins=256
# doesn't work and results in aliasing problems. We use a fully specified set
# of bins to ensure that each uint8 value false into its own bin.
_DEFAULT_ENTROPY_BINS = tuple(np.arange(-0.5, 255.51, 1))
def cross_entropy(ima... | [
"numpy.sum",
"numpy.log",
"numpy.flatnonzero",
"numpy.histogram",
"numpy.mean",
"numpy.arange",
"numpy.max",
"numpy.min",
"numpy.convolve"
] | [((269, 295), 'numpy.arange', 'np.arange', (['(-0.5)', '(255.51)', '(1)'], {}), '(-0.5, 255.51, 1)\n', (278, 295), True, 'import numpy as np\n'), ((1814, 1858), 'numpy.histogram', 'np.histogram', (['image'], {'bins': 'bins', 'density': '(True)'}), '(image, bins=bins, density=True)\n', (1826, 1858), True, 'import numpy ... |
"""
Introduction to Radar Course
Authors
=======
<NAME>, <NAME>, <NAME>
MIT Lincoln Laboratory
Lexington, MA 02421
Distribution Statement
======================
DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited.
This material is based upon work supported by the United States Air Forc... | [
"rad.toys.cross_range",
"rad.toys.rect_pat",
"rad.toys.rdi",
"rad.toys.roc",
"rad.air.plot_routes",
"rad.toys.sine_prop",
"rad.toys.radar_range_power",
"rad.toys.doppler",
"rad.toys.array",
"rad.radar.Target",
"rad.toys.delay_steer",
"rad.toys.detect_game",
"rad.toys.phase_steer",
"rad.toy... | [((1469, 1500), 'rad.toys.sine', 'ts.sine', ([], {'amp': '(1)', 'freq': '(1)', 'phase': '(0)'}), '(amp=1, freq=1, phase=0)\n', (1476, 1500), True, 'import rad.toys as ts\n'), ((1574, 1617), 'rad.toys.sine', 'ts.sine', ([], {'amp': '(3)', 'freq': '(2)', 'phase': '(0)', 'widgets': '[]'}), '(amp=3, freq=2, phase=0, widget... |
# Function to create a potential profile
import numpy as np
def wire_profile(x,param):
'''
V(x-mean) = peak * log(sqrt(h^2 + x^2)/rho)
'''
(peak,mean,h,rho) = param
return peak*np.log((1.0/(rho))*np.sqrt((x-mean)**2 + h**2))
def V_x_wire(x,list_b):
'''
Input:
x : 1d linear grid
li... | [
"numpy.sum",
"numpy.sqrt"
] | [((534, 563), 'numpy.sum', 'np.sum', (['wire_profiles'], {'axis': '(0)'}), '(wire_profiles, axis=0)\n', (540, 563), True, 'import numpy as np\n'), ((218, 251), 'numpy.sqrt', 'np.sqrt', (['((x - mean) ** 2 + h ** 2)'], {}), '((x - mean) ** 2 + h ** 2)\n', (225, 251), True, 'import numpy as np\n')] |
import sys
import numpy as np
import cv2
import time
import argparse
import yolov2tiny
np_dtype = {
'FP32': np.float32,
'FP16': np.float16,
'INT8': np.int8,
}
def resize_input(im):
imsz = cv2.resize(im, (416, 416))
imsz = imsz / 255.0
imsz = imsz[:, :, ::-1]
return np.asarray(imsz, dtype... | [
"yolov2tiny.YOLO2_TINY",
"numpy.save",
"argparse.ArgumentParser",
"cv2.imwrite",
"numpy.asarray",
"numpy.expand_dims",
"time.time",
"cv2.imread",
"numpy.squeeze",
"cv2.resize"
] | [((208, 234), 'cv2.resize', 'cv2.resize', (['im', '(416, 416)'], {}), '(im, (416, 416))\n', (218, 234), False, 'import cv2\n'), ((298, 332), 'numpy.asarray', 'np.asarray', (['imsz'], {'dtype': 'np.float32'}), '(imsz, dtype=np.float32)\n', (308, 332), True, 'import numpy as np\n'), ((407, 427), 'cv2.imread', 'cv2.imread... |
# pyphenocam
import os as _os
from . import config
import numpy as np
from bs4 import BeautifulSoup as _BS
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import re
import requests
import pandas as pd
from . import utils
from . import imageprocess... | [
"pandas.read_html",
"os.makedirs",
"numpy.ma.masked_where",
"pandas.read_csv",
"ssl.create_default_context",
"numpy.logical_not",
"os.path.exists",
"numpy.arange",
"requests.get",
"bs4.BeautifulSoup",
"os.path.split",
"os.path.join"
] | [((2275, 2303), 'ssl.create_default_context', 'ssl.create_default_context', ([], {}), '()\n', (2301, 2303), False, 'import ssl\n'), ((562, 626), 'requests.get', 'requests.get', (['"""https://phenocam.sr.unh.edu/webcam/network/table"""'], {}), "('https://phenocam.sr.unh.edu/webcam/network/table')\n", (574, 626), False, ... |
import os
os.environ["NUMBA_DISABLE_JIT"] = "1" # reconsider
import pyequion
from dataclasses import dataclass
from dataclasses_json import dataclass_json
import numpy as np
import simplejson
import json
IS_LOCAL = False
# Flask application - For local debugging
if IS_LOCAL:
from flask import Flask
from flas... | [
"pyequion.create_equilibrium",
"json.loads",
"pyequion.rbuilder.fill_reactions_with_solid_name_underscore",
"flask_cors.CORS",
"simplejson.dumps",
"flask.Flask",
"pyequion.utils_api.create_eq_sys_from_serialized",
"json.dumps",
"pyequion.solve_equilibrium",
"numpy.array",
"pyequion.rbuilder.form... | [((426, 441), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (431, 441), False, 'from flask import Flask\n'), ((447, 456), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (451, 456), False, 'from flask_cors import CORS\n'), ((2226, 2244), 'flask.request.get_json', 'request.get_json', ([], {}), '()\n',... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 25 09:44:15 2019
@author: dberke
Code to define a class for a model fit to an absorption line.
"""
import matplotlib
from matplotlib.gridspec import GridSpec
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
fr... | [
"tqdm.tqdm.write",
"matplotlib.ticker.StrMethodFormatter",
"varconlib.miscellaneous.wavelength2index",
"matplotlib.pyplot.close",
"varconlib.fitting.gaussian",
"matplotlib.ticker.FixedLocator",
"scipy.optimize.curve_fit",
"matplotlib.pyplot.figure",
"numpy.linspace",
"varconlib.exceptions.Positive... | [((4497, 4550), 'varconlib.miscellaneous.shift_wavelength', 'shift_wavelength', (['nominal_wavelength', 'radial_velocity'], {}), '(nominal_wavelength, radial_velocity)\n', (4513, 4550), False, 'from varconlib.miscellaneous import shift_wavelength, velocity2wavelength, wavelength2index, wavelength2velocity\n'), ((5290, ... |
import numpy as np
import torch
def permute(x, n_in, kernels_layer, num_channels_to_permute):
x_new = torch.clone(x)
for i in range(num_channels_to_permute):
idx = torch.randperm(kernels_layer)
idx = (idx * n_in) + i
print(idx)
print(np.arange(i, x.shape[1], n_in))
x_ne... | [
"torch.zeros",
"numpy.arange",
"torch.randperm",
"torch.clone"
] | [((402, 428), 'torch.zeros', 'torch.zeros', (['(100)', '(20)', '(5)', '(5)'], {}), '(100, 20, 5, 5)\n', (413, 428), False, 'import torch\n'), ((108, 122), 'torch.clone', 'torch.clone', (['x'], {}), '(x)\n', (119, 122), False, 'import torch\n'), ((182, 211), 'torch.randperm', 'torch.randperm', (['kernels_layer'], {}), '... |
import numpy as np
from pathlib import Path
import gym
from envs.atari.get_avg_score import get_average_score
from algorithms.discrete_policy import DiscretePolicyParams
from algorithms.utils import generate_save_location
def main():
hidden_layers = (32, 32)
date = "09-05-2020"
discrete_polic... | [
"algorithms.utils.generate_save_location",
"gym.make",
"pathlib.Path",
"algorithms.discrete_policy.DiscretePolicyParams",
"numpy.array",
"numpy.mean",
"envs.atari.get_avg_score.get_average_score",
"numpy.round"
] | [((331, 404), 'algorithms.discrete_policy.DiscretePolicyParams', 'DiscretePolicyParams', ([], {'actor_layers': 'hidden_layers', 'actor_activation': '"""tanh"""'}), "(actor_layers=hidden_layers, actor_activation='tanh')\n", (351, 404), False, 'from algorithms.discrete_policy import DiscretePolicyParams\n'), ((443, 455),... |
import numpy
import setuptools
from Cython.Build import cythonize
# True, if annotated Cython source files that highlight Python interactions should be created
ANNOTATE = False
# True, if all Cython compiler optimizations should be disabled
DEBUG = False
sources = [
'**/*.pyx'
]
library_dirs = [
'../cpp/bui... | [
"setuptools.Extension",
"Cython.Build.cythonize",
"numpy.get_include"
] | [((850, 1074), 'setuptools.Extension', 'setuptools.Extension', ([], {'name': '"""*"""', 'language': '"""c++"""', 'sources': 'sources', 'library_dirs': 'library_dirs', 'libraries': 'libraries', 'runtime_library_dirs': 'runtime_library_dirs', 'include_dirs': 'include_dirs', 'define_macros': 'define_macros'}), "(name='*',... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module contains several metric functions.
"""
import numpy as np
from skimage.metrics import structural_similarity as ssim
def SNR(xhat, xref):
"""Computes the SNR metric.
Arguments
---------
xhat: numpy array
The noised data.
xref: ... | [
"numpy.zeros",
"skimage.metrics.structural_similarity",
"numpy.linalg.norm",
"numpy.mean",
"numpy.dot"
] | [((2324, 2367), 'skimage.metrics.structural_similarity', 'ssim', (['xref', 'xhat'], {'multichannel': 'multichannel'}), '(xref, xhat, multichannel=multichannel)\n', (2328, 2367), True, 'from skimage.metrics import structural_similarity as ssim\n'), ((780, 807), 'numpy.linalg.norm', 'np.linalg.norm', (['(xref - xhat)'], ... |
import numpy as np
from plots import plot_legendre_polynomials
x = np.linspace(-1, 1, 1001)
plot_legendre_polynomials(x, n=5)
| [
"plots.plot_legendre_polynomials",
"numpy.linspace"
] | [((69, 93), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', '(1001)'], {}), '(-1, 1, 1001)\n', (80, 93), True, 'import numpy as np\n'), ((94, 127), 'plots.plot_legendre_polynomials', 'plot_legendre_polynomials', (['x'], {'n': '(5)'}), '(x, n=5)\n', (119, 127), False, 'from plots import plot_legendre_polynomials\n')] |
import cv2
import math
import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
import numpy as np
from keras.wrappers.scikit_learn import KerasClassifier
import keras
from keras.utils import np_utils
from keras.utils import to_categorical
from skimage.transform import resize
from sklearn.model_selec... | [
"os.mkdir",
"numpy.arctan2",
"pandas.read_csv",
"numpy.savez_compressed",
"numpy.mean",
"cv2.calcOpticalFlowFarneback",
"os.chdir",
"pandas.DataFrame",
"cv2.imwrite",
"cv2.resize",
"numpy.asarray",
"imutils.rotate",
"os.listdir",
"os.getcwd",
"os.path.isdir",
"numpy.zeros",
"math.flo... | [((13327, 13338), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (13336, 13338), False, 'import os\n'), ((13975, 14020), 'numpy.savez_compressed', 'np.savez_compressed', (['"""natural_data"""'], {'x': 'x', 'y': 'y'}), "('natural_data', x=x, y=y)\n", (13994, 14020), True, 'import numpy as np\n'), ((1190, 1201), 'os.getcwd'... |
from __future__ import absolute_import, print_function, division
# Standard
import sys
from os.path import realpath, join, split
from vtool.tests import grabdata
# Scientific
import numpy as np
import cv2
# TPL
import pyhesaff
import utool
utool.inject_colored_exceptions()
def get_test_image():
img_fname = 'zebra... | [
"cv2.cvtColor",
"numpy.empty",
"pyhesaff.detect_feats_list",
"utool.inject_colored_exceptions",
"vtool.tests.grabdata.get_testdata_dir",
"cv2.imread",
"pyhesaff.detect_feats",
"os.path.split",
"os.path.join"
] | [((240, 273), 'utool.inject_colored_exceptions', 'utool.inject_colored_exceptions', ([], {}), '()\n', (271, 273), False, 'import utool\n'), ((533, 560), 'vtool.tests.grabdata.get_testdata_dir', 'grabdata.get_testdata_dir', ([], {}), '()\n', (558, 560), False, 'from vtool.tests import grabdata\n'), ((865, 886), 'cv2.imr... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 18 16:38:05 2019
@author: Peter
"""
import os
import numpy as np
import h5py, PIL
from uclahedp.tools import hdf as hdftools
from uclahedp.tools import csv as csvtools
from uclahedp.tools import util
#Used for natural sorting filenames
import re
#Nice regex natural s... | [
"uclahedp.tools.csv.missingKeys",
"uclahedp.tools.csv.getAllAttrs",
"os.remove",
"h5py.File",
"re.split",
"uclahedp.tools.hdf.writeAttrs",
"os.walk",
"os.path.exists",
"PIL.Image.open",
"uclahedp.tools.util.timeRemaining",
"numpy.rot90",
"numpy.arange",
"numpy.reshape",
"uclahedp.tools.hdf... | [((813, 854), 'uclahedp.tools.csv.getAllAttrs', 'csvtools.getAllAttrs', (['csv_dir', 'run', 'probe'], {}), '(csv_dir, run, probe)\n', (833, 854), True, 'from uclahedp.tools import csv as csvtools\n'), ((959, 1014), 'uclahedp.tools.csv.missingKeys', 'csvtools.missingKeys', (['attrs', 'req_keys'], {'fatal_error': '(True)... |
#persistence_plot_widget.py
import time
import collections
from PySide import QtGui
from PySide import QtCore
import numpy as np
import pyqtgraph as pg
from waterfall_widget import WaterfallModel
#inject a familiar color scheme into pyqtgraph...
# - this makes it available in the stock gradient editor schemes.
# - ... | [
"pyqtgraph.functions.makeQImage",
"pyqtgraph.GradientWidget",
"pyqtgraph.QtCore.QRectF",
"numpy.zeros",
"time.time",
"PySide.QtGui.QPainter",
"PySide.QtGui.QImage",
"numpy.rot90",
"numpy.array",
"collections.OrderedDict",
"pyqtgraph.PlotWidget.__init__",
"numpy.fromstring",
"pyqtgraph.graphi... | [((483, 508), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (506, 508), False, 'import collections\n'), ((876, 933), 'pyqtgraph.graphicsItems.GradientEditorItem.Gradients.iteritems', 'pg.graphicsItems.GradientEditorItem.Gradients.iteritems', ([], {}), '()\n', (931, 933), True, 'import pyqtgrap... |
from utilities import get_spherical_distance
import uuid
import os
import numpy as np
from settings import *
def create_skeleton(gps,skel_folder='skeletons'):
d = 0
trail_length = 0
id = uuid.uuid4()
path = os.path.join(skel_folder,str(id))
print(path)
skel_file = open(path,'w')
n = len(gps)
for ... | [
"os.remove",
"uuid.uuid4",
"numpy.loadtxt",
"os.path.join",
"utilities.get_spherical_distance"
] | [((200, 212), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (210, 212), False, 'import uuid\n'), ((582, 619), 'os.path.join', 'os.path.join', (['data_location', '"""routes"""'], {}), "(data_location, 'routes')\n", (594, 619), False, 'import os\n'), ((926, 986), 'numpy.loadtxt', 'np.loadtxt', (['file'], {'delimiter': '"... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import seaborn as sns
from scipy.spatial import distance
from scipy.spatial.distance import euclidean
from fastdtw import fastdtw
sns.set()
def plot_dtw_dist(x, y, figsize=(12, 12), annotation=True, col_map="P... | [
"mpl_toolkits.axes_grid1.make_axes_locatable",
"scipy.spatial.distance.cdist",
"seaborn.heatmap",
"matplotlib.pyplot.show",
"seaborn.dark_palette",
"numpy.zeros",
"numpy.transpose",
"matplotlib.pyplot.subplots",
"fastdtw.fastdtw",
"seaborn.set"
] | [((239, 248), 'seaborn.set', 'sns.set', ([], {}), '()\n', (246, 248), True, 'import seaborn as sns\n'), ((624, 653), 'fastdtw.fastdtw', 'fastdtw', (['x', 'y'], {'dist': 'euclidean'}), '(x, y, dist=euclidean)\n', (631, 653), False, 'from fastdtw import fastdtw\n'), ((729, 771), 'numpy.zeros', 'np.zeros', (['(n_timestamp... |
"""
@author: <NAME> (2017, Vrije Universiteit Brussel)
Experiments for figure 4 in the paper.
"""
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
sys.path.insert(0, '.')
sys.path.insert(0, '..')
from gp_utilities import utils_experiment, utils_parameters
start_seed = 13
num_queries = 25
num_it... | [
"os.mkdir",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"os.path.exists",
"sys.path.insert",
"gp_utilities.utils_experiment.Experiment",
"matplotlib.pyplot.figure",
"numpy.mea... | [((171, 194), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""."""'], {}), "(0, '.')\n", (186, 194), False, 'import sys\n'), ((195, 219), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (210, 219), False, 'import sys\n'), ((342, 371), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'f... |
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
names = np.chararray( 24,unicode=True, itemsize=15)
percent = np.zeros(24)
f = open('output_c3.txt')
i = 0
for line in f.readlines():
# print(line)
templine = line.split('\t')
# print(templine)
temp = templine[0]
temp = te... | [
"matplotlib.pyplot.xlim",
"numpy.average",
"matplotlib.pyplot.bar",
"numpy.zeros",
"matplotlib.pyplot.ylabel",
"numpy.var",
"matplotlib.pyplot.errorbar",
"numpy.array",
"scipy.stats.sem",
"matplotlib.pyplot.gca",
"numpy.chararray",
"matplotlib.pyplot.xlabel",
"numpy.round",
"scipy.stats.t.... | [((85, 128), 'numpy.chararray', 'np.chararray', (['(24)'], {'unicode': '(True)', 'itemsize': '(15)'}), '(24, unicode=True, itemsize=15)\n', (97, 128), True, 'import numpy as np\n'), ((139, 151), 'numpy.zeros', 'np.zeros', (['(24)'], {}), '(24)\n', (147, 151), True, 'import numpy as np\n'), ((756, 784), 'numpy.array', '... |
"""Nuts and bolts of arim.scat.crack_2d_scat"""
import numpy as np
import numba
import scipy.integrate as si
from numpy.core.umath import sin, cos, pi, exp, sqrt
import ctypes
import scipy
@numba.njit(cache=True)
def basis_function(k):
k_00 = 1e-1
if abs(k) <= k_00:
return 1 - 1 / 18 * k ** 2 + 1 / 7... | [
"numpy.core.umath.cos",
"numpy.full",
"numba.carray",
"scipy.integrate.quad",
"numba.njit",
"numpy.zeros",
"numpy.core.umath.sin",
"scipy.LowLevelCallable",
"numpy.core.umath.exp",
"ctypes.cast",
"numpy.array",
"numba.jit",
"numpy.arange",
"numpy.dot",
"numpy.linalg.solve",
"numpy.core... | [((193, 215), 'numba.njit', 'numba.njit', ([], {'cache': '(True)'}), '(cache=True)\n', (203, 215), False, 'import numba\n'), ((433, 455), 'numba.njit', 'numba.njit', ([], {'cache': '(True)'}), '(cache=True)\n', (443, 455), False, 'import numba\n'), ((534, 556), 'numba.njit', 'numba.njit', ([], {'cache': '(True)'}), '(c... |
import torch
from torch import Tensor
import torch.nn as nn
import numpy as np
import signal_perceptron as sp
from utils import *
import time
#Train loops for first set of experiments (check exp1.py)
def train_pytorch(x_train,y_train,model,PATH,epochs,optimizer,loss_fn):
total_hist=[]
final_loss=[]
learned... | [
"torch.load",
"numpy.asarray",
"numpy.zeros",
"time.time",
"numpy.mean",
"numpy.linalg.inv",
"signal_perceptron.GD_MSE_SP_step",
"torch.no_grad",
"torch.transpose"
] | [((2540, 2570), 'torch.transpose', 'torch.transpose', (['y_train', '(0)', '(1)'], {}), '(y_train, 0, 1)\n', (2555, 2570), False, 'import torch\n'), ((2711, 2727), 'numpy.zeros', 'np.zeros', (['epochs'], {}), '(epochs)\n', (2719, 2727), True, 'import numpy as np\n'), ((3453, 3469), 'numpy.zeros', 'np.zeros', (['epochs']... |
import numpy
from rdkit.ML.Cluster import Murtagh
print('1')
d = numpy.array([[10.0, 5.0], [20.0, 20.0], [30.0, 10.0], [30.0, 15.0], [5.0, 10.0]], numpy.float)
print('2')
# clusters = Murtagh.ClusterData(d,len(d),Murtagh.WARDS)
# for i in range(len(clusters)):
# clusters[i].Print()
# print('3')
dists = []
for i ... | [
"numpy.array"
] | [((69, 168), 'numpy.array', 'numpy.array', (['[[10.0, 5.0], [20.0, 20.0], [30.0, 10.0], [30.0, 15.0], [5.0, 10.0]]', 'numpy.float'], {}), '([[10.0, 5.0], [20.0, 20.0], [30.0, 10.0], [30.0, 15.0], [5.0, \n 10.0]], numpy.float)\n', (80, 168), False, 'import numpy\n'), ((423, 441), 'numpy.array', 'numpy.array', (['dist... |
from pytest import fixture, mark
import qcodes
import numpy as np
from ADCProcessor import (
Unpacker, DigitalDownconversion, Filter, Synchronizer, TvMode
)
def adc(shape, if_freq, signal, noise, markers=False, segment_offset=None):
'''
Generate adc input that simulates a noisy reado... | [
"ADCProcessor.TvMode",
"numpy.roll",
"qcodes.Instrument",
"pytest.fixture",
"ADCProcessor.Unpacker",
"numpy.clip",
"ADCProcessor.Unpacker.sign_extension_factory",
"numpy.random.randint",
"numpy.where",
"numpy.arange",
"numpy.real",
"numpy.array",
"numpy.random.rand",
"numpy.all",
"numpy.... | [((2318, 2341), 'pytest.fixture', 'fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (2325, 2341), False, 'from pytest import fixture, mark\n'), ((1154, 1211), 'numpy.where', 'np.where', (['excited_shot', '(signal * excited)', '(signal * ground)'], {}), '(excited_shot, signal * excited, signal * ground)\... |
import pandas as pd
import numpy as np
import sqlalchemy, os
from matplotlib import pyplot as plt
import datetime as dt
import seaborn as sns
try:
sqlURL = os.environ['DATABASE_URL']
except:
sqlURL = "postgresql://localhost/AVPerformance"
engine = sqlalchemy.create_engine(sqlURL)
conn = engine.connect()
flig... | [
"numpy.sum",
"matplotlib.pyplot.show",
"numpy.median",
"matplotlib.pyplot.scatter",
"datetime.datetime",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.style.use",
"pandas.to_datetime",
"pandas.read_sql",
"sqlalchemy.create_engine",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"... | [((258, 290), 'sqlalchemy.create_engine', 'sqlalchemy.create_engine', (['sqlURL'], {}), '(sqlURL)\n', (282, 290), False, 'import sqlalchemy, os\n'), ((326, 363), 'pandas.read_sql', 'pd.read_sql', (['"""analysed_flights"""', 'conn'], {}), "('analysed_flights', conn)\n", (337, 363), True, 'import pandas as pd\n'), ((395,... |
import os
import cv2
import numpy as np
import torch.utils.data as td
import pandas as pd
import config as cfg
from datasets import ds_utils
from utils import face_processing as fp
from constants import *
from utils.nn import to_numpy, Batch
from landmarks.lmutils import create_landmark_heatmaps
from utils.face_extr... | [
"landmarks.lmutils.create_landmark_heatmaps",
"argparse.ArgumentParser",
"numpy.sum",
"utils.face_extractor.FaceExtractor",
"numpy.argmin",
"utils.vis.vis_square",
"os.path.isfile",
"os.path.join",
"numpy.unique",
"torch.utils.data.DataLoader",
"utils.exprec.get_expression_dists",
"cv2.cvtColo... | [((445, 478), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (468, 478), False, 'import warnings\n'), ((16551, 16576), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (16574, 16576), False, 'import argparse\n'), ((1546, 1561), 'utils.face_extractor.... |
# Copyright (c) 2021, <NAME>, FUNLab, Xiamen University
# All rights reserved.
import os
import torch
import numpy as np
import random
from copy import deepcopy
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
from common import make_env, npz_save, run_preparation
def _save(dir, prefix, pname... | [
"copy.deepcopy",
"numpy.random.seed",
"os.makedirs",
"os.path.isdir",
"torch.manual_seed",
"numpy.zeros",
"common.run_preparation",
"torch.cuda.manual_seed_all",
"torch.set_num_threads",
"random.seed",
"torch.cuda.is_available",
"torch.device",
"common.make_env",
"os.path.join",
"common.... | [((351, 407), 'os.path.join', 'os.path.join', (['dir', 'f"""{prefix}_{pname}_s{seed}_{idx}.npz"""'], {}), "(dir, f'{prefix}_{pname}_s{seed}_{idx}.npz')\n", (363, 407), False, 'import os\n'), ((412, 432), 'common.npz_save', 'npz_save', (['arr', 'fpath'], {}), '(arr, fpath)\n', (420, 432), False, 'from common import make... |
import db
import cv2
import face
import frame
import yaml
import typedef
import utils
import numpy as np
import copy
import pickle
def main(config):
ss = config['source_scale']
frame_drawer = frame.drawer.Drawer()
capturer = cv2.VideoCapture(config['source'])
face_detector = face.detectors.get(**confi... | [
"pickle.dump",
"face.validators.apply",
"frame.drawer.Drawer",
"pickle.load",
"yaml.safe_load",
"cv2.imshow",
"utils.is_tmp_id",
"face.buffer.FaceBuffer",
"face.encoders.get",
"utils.crop",
"db.initialize",
"cv2.destroyAllWindows",
"cv2.resize",
"copy.deepcopy",
"face.trackers.update_fac... | [((202, 223), 'frame.drawer.Drawer', 'frame.drawer.Drawer', ([], {}), '()\n', (221, 223), False, 'import frame\n'), ((239, 273), 'cv2.VideoCapture', 'cv2.VideoCapture', (["config['source']"], {}), "(config['source'])\n", (255, 273), False, 'import cv2\n'), ((294, 339), 'face.detectors.get', 'face.detectors.get', ([], {... |
import glob
import librosa
import IPython.display as ipd
import numpy as np
from scipy import signal
win_length = 0.025
hop_length = 0.005
timit_train_wav_data_path = 'timit/data/TRAIN/*/*/*.WAV.wav'
timit_train_wav = glob.glob(timit_train_wav_data_path)
timit_train_wav.sort()
print(f'Total source train wav files: {l... | [
"librosa.feature.mfcc",
"tensorflow.keras.layers.Dropout",
"librosa.feature.inverse.mel_to_audio",
"numpy.argmax",
"tensorflow.keras.layers.Dense",
"numpy.zeros",
"soundfile.write",
"librosa.load",
"numpy.array",
"tensorflow.keras.layers.LSTM",
"tensorflow.keras.Sequential",
"glob.glob",
"li... | [((220, 256), 'glob.glob', 'glob.glob', (['timit_train_wav_data_path'], {}), '(timit_train_wav_data_path)\n', (229, 256), False, 'import glob\n'), ((421, 458), 'glob.glob', 'glob.glob', (['timit_train_phns_data_path'], {}), '(timit_train_phns_data_path)\n', (430, 458), False, 'import glob\n'), ((560, 595), 'glob.glob',... |
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import seaborn as sns
import pandas as pd
import numpy as np
from sklearn.metrics import mean_absolute_error
from matplotlib import rc
# rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
## for Palatino and other serif fonts use:
rc(... | [
"matplotlib.rc",
"matplotlib.pyplot.show",
"seaborn.scatterplot",
"pandas.read_csv",
"numpy.std",
"numpy.asarray",
"numpy.mean",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.subplots"
] | [((317, 380), 'matplotlib.rc', 'rc', (['"""font"""'], {}), "('font', **{'family': 'serif', 'serif': ['Times New Roman']})\n", (319, 380), False, 'from matplotlib import rc\n'), ((377, 400), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (379, 400), False, 'from matplotlib impo... |
import numpy
arr = numpy.array(tuple(i for i in map(int, input().split())))
arr = numpy.reshape(arr, (3, 3))
print(arr)
| [
"numpy.reshape"
] | [((83, 109), 'numpy.reshape', 'numpy.reshape', (['arr', '(3, 3)'], {}), '(arr, (3, 3))\n', (96, 109), False, 'import numpy\n')] |
# -*- coding: utf-8 -*-
#/usr/bin/python2
'''
By <NAME>. <EMAIL>.
https://www.github.com/kyubyong/cross_vc
'''
from __future__ import print_function
from hparams import Hyperparams as hp
import numpy as np
import tensorflow as tf
from utils import *
import codecs
import re
import os, glob
import tqdm
def load_voca... | [
"tensorflow.py_func",
"numpy.zeros",
"glob.glob",
"tensorflow.train.batch",
"tensorflow.train.slice_input_producer"
] | [((2097, 2146), 'numpy.zeros', 'np.zeros', ([], {'shape': '(mfccs.shape[0],)', 'dtype': 'np.int32'}), '(shape=(mfccs.shape[0],), dtype=np.int32)\n', (2105, 2146), True, 'import numpy as np\n'), ((563, 582), 'glob.glob', 'glob.glob', (['hp.timit'], {}), '(hp.timit)\n', (572, 582), False, 'import os, glob\n'), ((3225, 32... |
from PySide2 import QtWidgets, QtCore, QtGui
# from PySide2.QtWidgets import QApplication, QLabel, QPushButton, QVBoxLayout, QWidget, QGridLayout
# from PySide2.QtCore import Slot, Qt, QSize
# from PySide2.QtGui import QSizePolicy
import sys
from board import Board, BoardSpec
class BoardWindow(QtWidgets.QWidget):
... | [
"PySide2.QtCore.QSize",
"PySide2.QtWidgets.QGridLayout",
"PySide2.QtWidgets.QApplication",
"PySide2.QtWidgets.QWidget.__init__",
"numpy.zeros",
"board.BoardSpec",
"PySide2.QtWidgets.QVBoxLayout",
"board.Board",
"PySide2.QtWidgets.QApplication.processEvents"
] | [((1758, 1790), 'PySide2.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (1780, 1790), False, 'from PySide2 import QtWidgets, QtCore, QtGui\n'), ((1809, 1821), 'board.BoardSpec', 'BoardSpec', (['(9)'], {}), '(9)\n', (1818, 1821), False, 'from board import Board, BoardSpec\n'), ((1... |
"""Module containing peak-detection algorithm and related functionality."""
from collections import defaultdict
import numpy as np
from matplotlib import pyplot
from cycler import cycler
line_colors = ["C1", "C2", "C3", "C4", "C5", "C6"]
line_styles = ["-", "--", ":", "-.", (0, (1, 10)), (0, (5, 10))]
cyl = cycler(co... | [
"cycler.cycler",
"numpy.load",
"numpy.sum",
"numpy.argmax",
"matplotlib.pyplot.close",
"numpy.isinf",
"numpy.clip",
"random.choice",
"numpy.diff",
"random.seed",
"signac.get_project",
"matplotlib.pyplot.subplots"
] | [((311, 336), 'cycler.cycler', 'cycler', ([], {'color': 'line_colors'}), '(color=line_colors)\n', (317, 336), False, 'from cycler import cycler\n'), ((339, 368), 'cycler.cycler', 'cycler', ([], {'linestyle': 'line_styles'}), '(linestyle=line_styles)\n', (345, 368), False, 'from cycler import cycler\n'), ((2451, 2473), ... |
# License: BSD 3 clause
import io, unittest
import numpy as np
import pickle
from scipy.sparse import csr_matrix
from tick.base_model.tests.generalized_linear_model import TestGLM
from tick.prox import ProxL1
from tick.linear_model import ModelLinReg, SimuLinReg
from tick.linear_model import ModelLogReg, SimuLogReg... | [
"unittest.main",
"tick.linear_model.SimuLinReg",
"numpy.random.seed",
"tick.simulation.weights_sparse_gauss",
"numpy.random.randn",
"numpy.ones",
"pickle.dumps"
] | [((2046, 2061), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2059, 2061), False, 'import io, unittest\n'), ((1103, 1121), 'numpy.random.seed', 'np.random.seed', (['(12)'], {}), '(12)\n', (1117, 1121), True, 'import numpy as np\n'), ((1182, 1209), 'numpy.random.randn', 'np.random.randn', (['n_features'], {}), '(... |
import numpy as np
import scipy.stats as st
def model_weights(deviances, b_samples=1000):
"""
Calculate weights of the model that can be used to compare them.
Pseudo-Bayesian Model averaging using Akaike-type
weighting. The weights are stabilized using the Bayesian bootstrap.
The code is taken f... | [
"numpy.zeros_like",
"numpy.sum",
"numpy.zeros",
"scipy.stats.dirichlet.rvs",
"numpy.min",
"numpy.array",
"numpy.dot"
] | [((1071, 1137), 'scipy.stats.dirichlet.rvs', 'st.dirichlet.rvs', ([], {'alpha': '([1] * rows)', 'size': 'b_samples', 'random_state': '(1)'}), '(alpha=[1] * rows, size=b_samples, random_state=1)\n', (1087, 1137), True, 'import scipy.stats as st\n'), ((1188, 1215), 'numpy.zeros', 'np.zeros', (['(b_samples, cols)'], {}), ... |
import pandas as pd
import geopandas as gpd
import shapely as sp
import numpy as np
from scipy.spatial import Voronoi
def convert_point_csv_to_data_frame(path, lat_key='lat', lon_key='lon',
encoding='utf-8', separator='\t',
decimal='.', index_col... | [
"shapely.geometry.Point",
"pandas.read_csv",
"shapely.ops.polygonize",
"geopandas.sjoin",
"scipy.spatial.Voronoi",
"shapely.geometry.LineString",
"geopandas.GeoDataFrame",
"numpy.array"
] | [((1145, 1238), 'pandas.read_csv', 'pd.read_csv', (['path'], {'encoding': 'encoding', 'sep': 'separator', 'index_col': 'index_col', 'decimal': 'decimal'}), '(path, encoding=encoding, sep=separator, index_col=index_col,\n decimal=decimal)\n', (1156, 1238), True, 'import pandas as pd\n'), ((3390, 3408), 'scipy.spatial... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 7 09:24:26 2018
@author: virati
Do a simple synthetic regression to make sure our approaches are working
"""
import numpy as np
import scipy.signal as sig
import matplotlib.pyplot as plt
M_known = np.array([20,2,3.4,-1]).reshape(-1,1)
X_base = ... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"numpy.identity",
"numpy.ones",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.array",
"numpy.random.normal",
... | [((395, 418), 'numpy.dot', 'np.dot', (['X_base', 'M_known'], {}), '(X_base, M_known)\n', (401, 418), True, 'import numpy as np\n'), ((555, 620), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {'copy_X': '(True)', 'normalize': '(True)', 'fit_intercept': '(True)'}), '(copy_X=True, normalize=True, fit_i... |
import os
import sys
import pickle
from tqdm import tqdm
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from lib.metric import get_metrics, train_lr
def compute_fss(model, n_layers, img_size, inp_channel):
model.eval()
model = model.cuda()
n = 100
noise_imgs = np... | [
"tqdm.tqdm",
"torch.LongTensor",
"torch.add",
"torch.cat",
"numpy.random.randint",
"torch.Tensor",
"numpy.array",
"lib.metric.get_metrics",
"torch.no_grad",
"numpy.concatenate",
"lib.metric.train_lr"
] | [((318, 390), 'numpy.random.randint', 'np.random.randint', (['(0)', '(255)', '(n, inp_channel, img_size, img_size)', '"""uint8"""'], {}), "(0, 255, (n, inp_channel, img_size, img_size), 'uint8')\n", (335, 390), True, 'import numpy as np\n'), ((2287, 2325), 'tqdm.tqdm', 'tqdm', (['dataloader'], {'desc': '"""get_FSS_scor... |
"""
Somes utilities function
"""
import numpy as np
def filter_kalman(mutm, Sigtm, Xt, mutilde_tm, expAh, SST, dim_x, dim_h):
"""
Compute the foward step using Kalman filter, predict and update step
Parameters
----------
mutm, Sigtm: Values of the foward distribution at t-1
Xt, mutilde_tm: Va... | [
"numpy.zeros",
"numpy.linalg.inv",
"numpy.matmul",
"numpy.hstack"
] | [((766, 804), 'numpy.linalg.inv', 'np.linalg.inv', (['Sigtemp[:dim_x, :dim_x]'], {}), '(Sigtemp[:dim_x, :dim_x])\n', (779, 804), True, 'import numpy as np\n'), ((1262, 1288), 'numpy.hstack', 'np.hstack', (['(marg_mu, mutm)'], {}), '((marg_mu, mutm))\n', (1271, 1288), True, 'import numpy as np\n'), ((1304, 1336), 'numpy... |
import numpy as np
def hist_equalization(origin_img):
"""Performs histogram equalization on the provided image
Parameters
----------
origin_img : np.ndarray
image to histogram equalize
Returns
-------
out_img
histogram equalized image
"""
# create normalized cumu... | [
"numpy.floor",
"numpy.sum"
] | [((424, 440), 'numpy.sum', 'np.sum', (['hist_arr'], {}), '(hist_arr)\n', (430, 440), True, 'import numpy as np\n'), ((506, 534), 'numpy.floor', 'np.floor', (['(255 * cum_hist_arr)'], {}), '(255 * cum_hist_arr)\n', (514, 534), True, 'import numpy as np\n')] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.