code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#!/usr/bin/env python
# coding: utf-8
# ### - Plot BIC and Silhouette scores across all clusters for Cell painting & L1000
# In[1]:
from collections import defaultdict
import os
import requests
import pickle
import argparse
import pandas as pd
import numpy as np
import re
from os import walk
from collections import... | [
"seaborn.set_context",
"numpy.warnings.filterwarnings",
"os.path.join",
"seaborn.set_style",
"warnings.simplefilter",
"pandas.concat",
"seaborn.relplot"
] | [((464, 489), 'seaborn.set_style', 'sns.set_style', (['"""darkgrid"""'], {}), "('darkgrid')\n", (477, 489), True, 'import seaborn as sns\n'), ((559, 582), 'seaborn.set_context', 'sns.set_context', (['"""talk"""'], {}), "('talk')\n", (574, 582), True, 'import seaborn as sns\n'), ((644, 706), 'warnings.simplefilter', 'wa... |
import numpy as np
import networkx as nx
import json
class SIRNetwork:
def __init__(self, datafiles, travel_rate, beta, gamma, travel_infection_rate = 1):
self.graph, self.A, self.pos = self.load_graph(datafiles['data'], datafiles['position'])
self.nodes = list(self.graph.nodes())
self.nod... | [
"networkx.node_link_graph",
"networkx.to_numpy_array",
"numpy.sum",
"json.load",
"networkx.number_of_nodes"
] | [((331, 348), 'numpy.sum', 'np.sum', (['self.A', '(0)'], {}), '(self.A, 0)\n', (337, 348), True, 'import numpy as np\n'), ((859, 890), 'networkx.node_link_graph', 'nx.node_link_graph', (['import_data'], {}), '(import_data)\n', (877, 890), True, 'import networkx as nx\n'), ((960, 981), 'networkx.number_of_nodes', 'nx.nu... |
#######################################
import numpy as np
import pylab
from scipy.interpolate import interp1d
from scipy import optimize
from numba import jit
#######################################
@jit(nopython=True)
def qr(t00,Start_time,heatscale): #interior radiogenic heatproduction
t = t00 - Start... | [
"numpy.copy",
"numpy.log10",
"numpy.log",
"scipy.optimize.newton",
"numpy.exp",
"numpy.sum",
"numpy.linspace",
"numba.jit"
] | [((210, 228), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (213, 228), False, 'from numba import jit\n'), ((886, 904), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (889, 904), False, 'from numba import jit\n'), ((1534, 1552), 'numba.jit', 'jit', ([], {'nopython': '(Tr... |
import os
import re
import cv2
import numpy as np
import pandas as pd
from Scripts.Experiments import RESULTS
# ------------------------------------------------------------------------------------------------------------------ #
# -------------------------------------------------- Restructure UNBC Data ------------... | [
"numpy.array_split",
"numpy.array",
"numpy.divide",
"os.walk",
"os.listdir",
"os.path.isdir",
"os.mkdir",
"numpy.concatenate",
"pandas.DataFrame",
"os.rename",
"os.path.splitext",
"re.findall",
"cv2.imread",
"numpy.minimum",
"numpy.unique",
"os.path.join",
"os.rmdir",
"os.path.base... | [((427, 457), 're.findall', 're.findall', (['regex', 'folder_name'], {}), '(regex, folder_name)\n', (437, 457), False, 'import re\n'), ((605, 632), 're.findall', 're.findall', (['regex', 'filename'], {}), '(regex, filename)\n', (615, 632), False, 'import re\n'), ((783, 810), 're.findall', 're.findall', (['regex', 'file... |
"""Visualization for sequential tracks."""
import numpy as np
import open3d as o3d
from ..data.loadmodels import track_palette
def make_geometries_from_dict(tracks, old_track_geometries=None,
palette=track_palette):
track_line_sets = {}
for track_id, points in tracks.items():
... | [
"numpy.asarray",
"numpy.reshape",
"open3d.geometry.LineSet",
"open3d.utility.Vector3dVector"
] | [((340, 391), 'numpy.reshape', 'np.reshape', (['[point[0] for point in points]', '(-1, 3)'], {}), '([point[0] for point in points], (-1, 3))\n', (350, 391), True, 'import numpy as np\n'), ((452, 474), 'open3d.geometry.LineSet', 'o3d.geometry.LineSet', ([], {}), '()\n', (472, 474), True, 'import open3d as o3d\n'), ((506... |
import numpy as np
import pandas as pd
from pyopenms import FeatureMap, FeatureXMLFile
def extractNamesAndIntensities(feature_dir, sample_names, database):
"""
This function takes .featureXML files, the output of SmartPeak
pre-processing, and extracts the metabolite's reference and its measured
intens... | [
"pyopenms.FeatureMap",
"numpy.mean",
"numpy.sqrt",
"pyopenms.FeatureXMLFile",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"numpy.var"
] | [((2150, 2202), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['extracted_data_dict', '"""index"""'], {}), "(extracted_data_dict, 'index')\n", (2172, 2202), True, 'import pandas as pd\n'), ((5513, 5560), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['stats_all_dict', '"""index"""'], {}), "(stats_... |
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
def save_ani(episode, reward, frames, fps=50, skip_frames=4,
out_path='./animations/', mode='train'):
if not os.path.exists(out_path):
os.makedirs(out_path)
fig = plt.figu... | [
"matplotlib.pyplot.imshow",
"os.path.exists",
"os.listdir",
"os.makedirs",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"numpy.load"
] | [((312, 324), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (322, 324), True, 'import matplotlib.pyplot as plt\n'), ((329, 386), 'matplotlib.pyplot.title', 'plt.title', (['f"""{mode} episode: {episode}, reward: {reward}"""'], {}), "(f'{mode} episode: {episode}, reward: {reward}')\n", (338, 386), True, 'im... |
from __future__ import absolute_import, print_function, division
import copy
import unittest
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
import numpy
from six.moves import xrange
import theano
import theano.sandbox.cuda as cuda_ndarray
from theano.tensor.basic import _allclose... | [
"numpy.random.rand",
"theano.sandbox.cuda.CudaNdarray.zeros",
"six.moves.xrange",
"copy.deepcopy",
"theano.tensor.basic._allclose",
"copy.copy",
"numpy.arange",
"theano.sandbox.cuda.CudaNdarray",
"theano.sandbox.cuda.dot",
"numpy.int64",
"numpy.asarray",
"theano.tests.unittest_tools.fetch_seed... | [((415, 457), 'nose.plugins.skip.SkipTest', 'SkipTest', (['"""Optional package cuda disabled"""'], {}), "('Optional package cuda disabled')\n", (423, 457), False, 'from nose.plugins.skip import SkipTest\n'), ((6103, 6130), 'theano.sandbox.cuda.CudaNdarray', 'cuda_ndarray.CudaNdarray', (['a'], {}), '(a)\n', (6127, 6130)... |
from .base import Strategy, Transform
from summit.domain import *
from summit.domain import Domain
from summit.utils.dataset import DataSet
from summit.utils import jsonify_dict, unjsonify_dict
import numpy as np
import pandas as pd
from scipy.optimize import OptimizeResult
class NelderMead(Strategy):
"""Nelder-... | [
"numpy.log10",
"numpy.random.rand",
"numpy.argsort",
"numpy.asfarray",
"numpy.array",
"summit.utils.jsonify_dict",
"numpy.add.reduce",
"numpy.where",
"numpy.delete",
"numpy.asarray",
"numpy.take",
"pandas.DataFrame",
"numpy.maximum",
"numpy.round",
"numpy.abs",
"numpy.ones",
"summit.... | [((11690, 11721), 'numpy.asarray', 'np.asarray', (['bounds'], {'dtype': 'float'}), '(bounds, dtype=float)\n', (11700, 11721), True, 'import numpy as np\n'), ((27909, 27934), 'numpy.zeros', 'np.zeros', (['(N + 1,)', 'float'], {}), '((N + 1,), float)\n', (27917, 27934), True, 'import numpy as np\n'), ((28009, 28025), 'nu... |
import json
from time import process_time
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import accuracy_score
from PCA.reductionPCA import reductionPCA, plotting, standardise
from RBFN.classifierRBFN import train_data, make_prediction, get_XY, amount_centroids, plot_centroids
from Resou... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"numpy.array",
"RBFN.classifierRBFN.train_data",
"time.process_time",
"numpy.mean",
"PCA.reductionPCA.plotting",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylim",
"PCA.reductionPCA.reductionPCA",
"matplotlib.... | [((3380, 3397), 'PCA.reductionPCA.plotting', 'plotting', (['pca_all'], {}), '(pca_all)\n', (3388, 3397), False, 'from PCA.reductionPCA import reductionPCA, plotting, standardise\n'), ((4237, 4251), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (4249, 4251), True, 'from matplotlib import pyplot as plt\... |
import os
import tempfile
import mock
import numpy as np
from yt.testing import assert_equal, fake_random_ds
from yt.units.unit_object import Unit
def setup():
from yt.config import ytcfg
ytcfg["yt", "__withintesting"] = "True"
def teardown_func(fns):
for fn in fns:
try:
os.remove... | [
"mock.patch",
"yt.testing.assert_equal",
"numpy.unique",
"os.close",
"yt.testing.fake_random_ds",
"yt.units.unit_object.Unit",
"numpy.finfo",
"tempfile.mkstemp",
"os.remove"
] | [((369, 441), 'mock.patch', 'mock.patch', (['"""yt.visualization._mpl_imports.FigureCanvasAgg.print_figure"""'], {}), "('yt.visualization._mpl_imports.FigureCanvasAgg.print_figure')\n", (379, 441), False, 'import mock\n'), ((3032, 3098), 'yt.testing.fake_random_ds', 'fake_random_ds', (['(64)'], {'nprocs': '(8)', 'field... |
# Copyright 2022 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | [
"numpy.random.randint",
"numpy.array_equal",
"cunumeric.array.convert_to_cunumeric_ndarray"
] | [((2028, 2079), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(0)', 'high': '(100)', 'size': 'input_size'}), '(low=0, high=100, size=input_size)\n', (2045, 2079), True, 'import numpy as np\n'), ((2094, 2125), 'cunumeric.array.convert_to_cunumeric_ndarray', 'convert_to_cunumeric_ndarray', (['a'], {}), '(a)\... |
#!/anaconda/envs/tensorflow/bin/python
# -*- coding: utf-8 -*-
"""
Yet another one of the simplest implementation of neural network.
It supports layer structure configuration via a list.
Created on Wed Mar 28 20:07:33 2018
@author: <NAME>
"""
import numpy as np
from LogisticRegression import traincsv2matrix, onezero
... | [
"numpy.random.rand",
"LogisticRegression.traincsv2matrix",
"numpy.exp",
"LogisticRegression.onezero",
"pprint.pprint"
] | [((9679, 9718), 'LogisticRegression.traincsv2matrix', 'traincsv2matrix', (['"""diabetes_dataset.csv"""'], {}), "('diabetes_dataset.csv')\n", (9694, 9718), False, 'from LogisticRegression import traincsv2matrix, onezero\n'), ((9809, 9827), 'pprint.pprint', 'pprint', (['mlp.hidden'], {}), '(mlp.hidden)\n', (9815, 9827), ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 8 20:05:36 2016
@author: JSong
"""
import os
import time
import pandas as pd
import numpy as np
pd.set_option('display.float_format', lambda x: '%.2f' % x)
from . import config
from .utils import Delaunay2D
import matplotlib.image as mpimg
import seaborn as sns
from... | [
"numpy.sqrt",
"numpy.random.rand",
"matplotlib.image.imread",
"io.BytesIO",
"pptx.Presentation",
"pptx.chart.data.XyChartData",
"numpy.mean",
"pptx.dml.color.RGBColor",
"os.path.exists",
"pptx.util.Emu",
"os.path.split",
"pandas.set_option",
"pptx.chart.data.ChartData",
"numpy.linspace",
... | [((147, 206), 'pandas.set_option', 'pd.set_option', (['"""display.float_format"""', "(lambda x: '%.2f' % x)"], {}), "('display.float_format', lambda x: '%.2f' % x)\n", (160, 206), True, 'import pandas as pd\n'), ((634, 657), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (647, 657), False, 'impor... |
from keras_audio.library.utility.audio_utils import compute_melgram
from keras_audio.library.utility.gtzan_loader import download_gtzan_genres_if_not_found
import numpy as np
def load_audio_path_label_pairs(max_allowed_pairs=None):
download_gtzan_genres_if_not_found('../very_large_data/gtzan')
audio_paths = []... | [
"keras_audio.library.utility.gtzan_loader.download_gtzan_genres_if_not_found",
"keras_audio.library.utility.audio_utils.compute_melgram",
"numpy.min",
"numpy.max"
] | [((237, 299), 'keras_audio.library.utility.gtzan_loader.download_gtzan_genres_if_not_found', 'download_gtzan_genres_if_not_found', (['"""../very_large_data/gtzan"""'], {}), "('../very_large_data/gtzan')\n", (271, 299), False, 'from keras_audio.library.utility.gtzan_loader import download_gtzan_genres_if_not_found\n'), ... |
from copy import deepcopy
from ray import tune
import numpy as np
from softlearning.misc.utils import get_git_rev, deep_update
import os
DEFAULT_KEY = '__DEFAULT_KEY__'
M = 256
N = 2
REPARAMETERIZE = True
NUM_COUPLING_LAYERS = 2
"""
Policy params
"""
GAUSSIAN_POLICY_PARAMS_BASE = {
'type': 'GaussianPolicy',
... | [
"ray.tune.sample_from",
"ray.tune.grid_search",
"numpy.random.randint",
"softlearning.misc.utils.get_git_rev",
"copy.deepcopy"
] | [((12928, 13230), 'ray.tune.grid_search', 'tune.grid_search', (["[{'type': 'ConvnetPreprocessor', 'kwargs': {'conv_filters': (64,) * 3,\n 'conv_kernel_sizes': (3,) * 3, 'conv_strides': (2,) * 3,\n 'normalization_type': normalization_type, 'downsampling_type': 'conv',\n 'output_kwargs': {'type': 'flatten'}}} fo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 <NAME>
# Copyright (C) 2015 <NAME>
#
# 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... | [
"cv2.getPerspectiveTransform",
"cv2.findHomography",
"pickle.load",
"numpy.sum",
"cv2.warpPerspective",
"cv2.cvtColor",
"ikalog.inputs.filters.WarpFilterModel",
"cv2.KeyPoint",
"numpy.float32"
] | [((3835, 3869), 'numpy.float32', 'np.float32', (['[kp.pt for kp in mkp1]'], {}), '([kp.pt for kp in mkp1])\n', (3845, 3869), True, 'import numpy as np\n'), ((3883, 3917), 'numpy.float32', 'np.float32', (['[kp.pt for kp in mkp2]'], {}), '([kp.pt for kp in mkp2])\n', (3893, 3917), True, 'import numpy as np\n'), ((4040, 4... |
# coding=utf-8
# Copyright 2022 HuggingFace Inc. team.
#
# 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... | [
"transformers.FlaxSpeechEncoderDecoderModel.from_pretrained",
"jax.nn.log_softmax",
"transformers.FlaxGPT2LMHeadModel",
"numpy.array",
"transformers.is_flax_available",
"transformers.FlaxWav2Vec2Model",
"flax.training.common_utils.onehot",
"transformers.modeling_flax_pytorch_utils.load_flax_weights_in... | [((1190, 1209), 'transformers.is_flax_available', 'is_flax_available', ([], {}), '()\n', (1207, 1209), False, 'from transformers import is_flax_available, is_torch_available\n'), ((1806, 1826), 'transformers.is_torch_available', 'is_torch_available', ([], {}), '()\n', (1824, 1826), False, 'from transformers import is_f... |
# This contains a catalog of explicit solutions to some SDEs.
from sampi.sdes.base import StochDiffEq
import numpy as np
def basic_linear(a=1, b=1):
"""Returns a function implementing the explicit solution to the SDE
dX_t = a X_t dt + b X_t dW_t.
"""
drift = lambda x, t : a*x
diffusio... | [
"numpy.exp",
"numpy.arccos",
"numpy.sqrt",
"sampi.sdes.base.StochDiffEq"
] | [((422, 527), 'sampi.sdes.base.StochDiffEq', 'StochDiffEq', ([], {'drift': 'drift', 'diffusion': 'diffusion', 'true_sol': 'true_sol', 'eqn': '"""dX_t = a X_t dt + b X_t dW_t"""'}), "(drift=drift, diffusion=diffusion, true_sol=true_sol, eqn=\n 'dX_t = a X_t dt + b X_t dW_t')\n", (433, 527), False, 'from sampi.sdes.ba... |
import bokeh
import pandas as pd
import numpy as np
import os
from bokeh import events
from bokeh.io import show
from bokeh.plotting import figure, output_file, ColumnDataSource
from bokeh.models.widgets import ColorPicker, Select, Toggle, Dropdown, DataTable, NumberFormatter, TableColumn,TextInput, Button, TextAreaInp... | [
"bokeh.models.widgets.Dropdown",
"bokeh.plotting.figure",
"pandas.read_csv",
"bokeh.models.widgets.Slider",
"bokeh.layouts.Row",
"bokeh.models.widgets.Button",
"bokeh.layouts.Column",
"numpy.array",
"bokeh.models.widgets.Div",
"bokeh.models.widgets.NumberFormatter",
"bokeh.models.ToolbarBox",
... | [((758, 805), 'bokeh.plotting.output_file', 'output_file', (['"""index.html"""'], {'title': '"""NaViA v 1.0"""'}), "('index.html', title='NaViA v 1.0')\n", (769, 805), False, 'from bokeh.plotting import figure, output_file, ColumnDataSource\n'), ((1177, 1349), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': '(... |
import netket as nk
import numpy as np
from numpy import linalg as la
import pandas as pd
import os
from netket.hilbert import Fock
from tqdm import tqdm
# Model params
model = 'mbl'
N = 8
seed = 3
W = 15.0
U = 1.0
J = 1.0
dt = 1
gamma = 0.1
# Ansatz params
beta = 2
alpha = 2
n_samples = 5000
n_iter = 1000
np.random... | [
"netket.operator.LocalOperator",
"numpy.sqrt",
"netket.optimizer.Sgd",
"netket.models.NDM",
"numpy.linalg.norm",
"os.path.exists",
"netket.graph.disjoint_union",
"netket.optimizer.SR",
"netket.operator.boson.number",
"netket.operator.LocalLiouvillian",
"netket.operator.boson.create",
"numpy.li... | [((311, 331), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (325, 331), True, 'import numpy as np\n'), ((590, 621), 'numpy.random.uniform', 'np.random.uniform', (['(-1.0)', '(1.0)', 'N'], {}), '(-1.0, 1.0, N)\n', (607, 621), True, 'import numpy as np\n'), ((644, 682), 'netket.hilbert.Fock', 'Fock',... |
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
def vis_causal_net(adata, key='RDI', layout = 'circular', top_n_edges = 10, edge_color = 'gray', figsize=(6, 6)):
"""Visualize inferred causal regulatory network
This plotting function visualize the inferred causal regulatory network inf... | [
"numpy.where",
"networkx.DiGraph",
"numpy.max",
"numpy.argsort",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((1402, 1447), 'numpy.where', 'np.where', (['(df_mat.values - df_mat.T.values < 0)'], {}), '(df_mat.values - df_mat.T.values < 0)\n', (1410, 1447), True, 'import numpy as np\n'), ((1459, 1504), 'numpy.where', 'np.where', (['(df_mat.values - df_mat.T.values < 0)'], {}), '(df_mat.values - df_mat.T.values < 0)\n', (1467,... |
from collections import namedtuple
import numpy as np
import pytest
from numpy.testing import assert_allclose
from pytest_lazyfixture import lazy_fixture
from emukit.quadrature.methods.warpings import IdentityWarping, SquareRootWarping
def create_fixture_parameters():
return [pytest.param(lazy_fixture(warping.n... | [
"collections.namedtuple",
"numpy.ones",
"numpy.random.rand",
"emukit.quadrature.methods.warpings.IdentityWarping",
"emukit.quadrature.methods.warpings.SquareRootWarping",
"pytest_lazyfixture.lazy_fixture",
"numpy.random.seed"
] | [((697, 732), 'collections.namedtuple', 'namedtuple', (['"""WarpingTest"""', "['name']"], {}), "('WarpingTest', ['name'])\n", (707, 732), False, 'from collections import namedtuple\n'), ((421, 438), 'emukit.quadrature.methods.warpings.IdentityWarping', 'IdentityWarping', ([], {}), '()\n', (436, 438), False, 'from emuki... |
import numpy as np
from molsysmt import puw
def atomic_radius(molecular_system, selection='all', type='vdw'):
from molsysmt.basic import get
from molsysmt.physico_chemical_properties.atoms.radius import units
from molsysmt._private_tools._digestion import digest_target
if type=='vdw':
from mo... | [
"molsysmt.basic.get",
"numpy.array"
] | [((454, 522), 'molsysmt.basic.get', 'get', (['molecular_system'], {'target': '"""atom"""', 'selection': 'selection', 'type': '(True)'}), "(molecular_system, target='atom', selection=selection, type=True)\n", (457, 522), False, 'from molsysmt.basic import get\n'), ((667, 683), 'numpy.array', 'np.array', (['output'], {})... |
import numpy as np
import sys
from sklearn.metrics import label_ranking_average_precision_score
if len(sys.argv) != 4:
print("Usage: python compute_lrap.py preds_file test_file all_class_file")
exit(-1)
preds_file = sys.argv[1]
test_file = sys.argv[2]
all_class_file = sys.argv[3]
class2index = {}
with open(... | [
"numpy.loadtxt",
"sklearn.metrics.label_ranking_average_precision_score",
"numpy.zeros"
] | [((437, 459), 'numpy.loadtxt', 'np.loadtxt', (['preds_file'], {}), '(preds_file)\n', (447, 459), True, 'import numpy as np\n'), ((469, 492), 'numpy.zeros', 'np.zeros', (['y_score.shape'], {}), '(y_score.shape)\n', (477, 492), True, 'import numpy as np\n'), ((659, 713), 'sklearn.metrics.label_ranking_average_precision_s... |
# coding: utf-8
# See notebook:
# https://github.com/paninski-lab/yass-examples/blob/master/batch/multi_channel_apply_memory.ipynb
"""
Applying transformations to large files in batches:
BatchProcessor.multi_channel_apply lets you apply transformations to
batches of data where every batch has observations from every... | [
"logging.basicConfig",
"yass.batch.BatchProcessor",
"numpy.max",
"numpy.stack",
"os.path.expanduser"
] | [((571, 610), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (590, 610), False, 'import logging\n'), ((656, 717), 'os.path.expanduser', 'os.path.expanduser', (['"""~/data/ucl-neuropixel/rawDataSample.bin"""'], {}), "('~/data/ucl-neuropixel/rawDataSample.bin')\n"... |
#!/usr/bin/env python
# coding=utf-8
'''
@Author: John
@Email: <EMAIL>
@Date: 2020-06-12 00:50:49
@LastEditor: John
LastEditTime: 2021-12-22 14:01:37
@Discription:
@Environment: python 3.7.7
'''
'''off-policy
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import ran... | [
"random.sample",
"random.randrange",
"torch.load",
"torch.tensor",
"torch.nn.MSELoss",
"torch.nn.Linear",
"torch.no_grad",
"random.random",
"numpy.float32",
"math.exp"
] | [((602, 634), 'torch.nn.Linear', 'nn.Linear', (['state_dim', 'hidden_dim'], {}), '(state_dim, hidden_dim)\n', (611, 634), True, 'import torch.nn as nn\n'), ((660, 693), 'torch.nn.Linear', 'nn.Linear', (['hidden_dim', 'hidden_dim'], {}), '(hidden_dim, hidden_dim)\n', (669, 693), True, 'import torch.nn as nn\n'), ((718, ... |
# Copyright 1999-2021 Alibaba Group Holding 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 a... | [
"numpy.random.bytes",
"numpy.random.rand",
"mars.config.option_context",
"mars.core.tile",
"pandas.Index",
"numpy.array",
"pandas.RangeIndex",
"numpy.random.RandomState",
"pandas.date_range",
"mars.dataframe.base.astype",
"numpy.empty",
"pandas.DataFrame",
"numpy.dtype",
"mars.dataframe.da... | [((1558, 1578), 'mars.dataframe.datasource.dataframe.from_pandas', 'from_pandas_df', (['data'], {}), '(data)\n', (1572, 1578), True, 'from mars.dataframe.datasource.dataframe import from_pandas as from_pandas_df\n'), ((1589, 1599), 'mars.dataframe.base.to_gpu', 'to_gpu', (['df'], {}), '(df)\n', (1595, 1599), False, 'fr... |
__author__ = 'jparedes'
import numpy as np
from itertools import combinations, product, chain
from .support_filter import support_basic_premises, support_premises_derived
from .similarity_filter import similarity_basic_premises, similarity_derived_premises
from .pcd_filter import pcd_basic_premises, pcd_derived_premis... | [
"itertools.combinations",
"itertools.chain",
"itertools.product",
"numpy.hstack"
] | [((4456, 4485), 'itertools.combinations', 'combinations', (['ref_premises', '(2)'], {}), '(ref_premises, 2)\n', (4468, 4485), False, 'from itertools import combinations, product, chain\n'), ((6264, 6286), 'numpy.hstack', 'np.hstack', (['new_ux_prev'], {}), '(new_ux_prev)\n', (6273, 6286), True, 'import numpy as np\n'),... |
import chord_recognition
import numpy as np
import miditoolkit
import copy
# parameters for input
DEFAULT_VELOCITY_BINS = np.linspace(0, 128, 32+1, dtype=np.int)
DEFAULT_FRACTION = 16
DEFAULT_DURATION_BINS = np.arange(60, 3841, 60, dtype=int)
DEFAULT_TEMPO_INTERVALS = [range(30, 90), range(90, 150), range(150, 210)]
... | [
"miditoolkit.Note",
"miditoolkit.midi.containers.TempoChange",
"numpy.searchsorted",
"chord_recognition.MIDIChord",
"miditoolkit.midi.containers.Marker",
"numpy.linspace",
"miditoolkit.midi.containers.Instrument",
"miditoolkit.midi.parser.MidiFile",
"numpy.arange"
] | [((123, 164), 'numpy.linspace', 'np.linspace', (['(0)', '(128)', '(32 + 1)'], {'dtype': 'np.int'}), '(0, 128, 32 + 1, dtype=np.int)\n', (134, 164), True, 'import numpy as np\n'), ((209, 243), 'numpy.arange', 'np.arange', (['(60)', '(3841)', '(60)'], {'dtype': 'int'}), '(60, 3841, 60, dtype=int)\n', (218, 243), True, 'i... |
import numpy as np
import math
from data_parser import loadData
def c(t):
return math.cos(math.radians(t))
def s(t):
return math.sin(math.radians(t))
def generate_angles(num_dofs):
angles = np.random.uniform(low = -360, high = 360, size = (num_dofs,))
return angles
#TODO find the right imp... | [
"data_parser.loadData",
"math.radians",
"math.cos",
"numpy.array",
"math.atan2",
"numpy.random.uniform",
"math.sin"
] | [((3186, 3223), 'data_parser.loadData', 'loadData', (['"""inputs.txt"""', '"""outputs.txt"""'], {}), "('inputs.txt', 'outputs.txt')\n", (3194, 3223), False, 'from data_parser import loadData\n'), ((214, 269), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-360)', 'high': '(360)', 'size': '(num_dofs,)'}), '... |
"""
Classes for visualizing echo data
"""
import numpy as np
import matplotlib.colors as colors
# import datetime as dt
from matplotlib.dates import date2num
from collections import defaultdict
import echopype_model
# Colormap: multi-frequency availability from Jech & Michaels 2006
MF_COLORS = np.array([[0,0,0],\
... | [
"matplotlib.dates.date2num",
"numpy.searchsorted",
"matplotlib.colors.ListedColormap",
"numpy.array",
"numpy.linspace",
"collections.defaultdict",
"numpy.around",
"matplotlib.colors.BoundaryNorm",
"numpy.arange"
] | [((588, 620), 'matplotlib.colors.ListedColormap', 'colors.ListedColormap', (['MF_COLORS'], {}), '(MF_COLORS)\n', (609, 620), True, 'import matplotlib.colors as colors\n'), ((1338, 1372), 'matplotlib.colors.ListedColormap', 'colors.ListedColormap', (['EK60_COLORS'], {}), '(EK60_COLORS)\n', (1359, 1372), True, 'import ma... |
# ===========================================================================
# This module is created based on the code from 2 libraries: Lasagne and keras
# Original work Copyright (c) 2014-2015 keras contributors
# Original work Copyright (c) 2014-2015 Lasagne contributors
# Modified work Copyright 2016-2017 TrungNT... | [
"numpy.prod",
"numpy.sqrt",
"numpy.asarray",
"numpy.max",
"numpy.zeros",
"numpy.nonzero",
"numpy.linalg.svd",
"numpy.random.RandomState"
] | [((745, 779), 'numpy.random.RandomState', 'np.random.RandomState', (['_MAGIC_SEED'], {}), '(_MAGIC_SEED)\n', (766, 779), True, 'import numpy as np\n'), ((893, 927), 'numpy.random.RandomState', 'np.random.RandomState', (['_MAGIC_SEED'], {}), '(_MAGIC_SEED)\n', (914, 927), True, 'import numpy as np\n'), ((1848, 1876), 'n... |
'''
Collection of algorithms for transforming coordinates commoly used in
Geophysics.
Glossary:
---------
Geocentric Geodetic Coordinates (GGC)
Geocentric Geodetic System (GGS)
Geocentric Cartesian Coordinates (GCC)
Geocentric Cartesian System (GCS)
Geocentric Spherical Coordinates (GSC)
Geocentric Spherical System (G... | [
"numpy.abs",
"numpy.sqrt",
"numpy.isscalar",
"numpy.tan",
"numpy.logical_not",
"numpy.asarray",
"numpy.arcsin",
"numpy.max",
"numpy.deg2rad",
"numpy.arctan2",
"numpy.cos",
"numpy.sign",
"numpy.min",
"numpy.sin",
"numpy.rad2deg",
"numpy.zeros_like",
"numpy.arctan"
] | [((1405, 1423), 'numpy.asarray', 'np.asarray', (['height'], {}), '(height)\n', (1415, 1423), True, 'import numpy as np\n'), ((1434, 1454), 'numpy.asarray', 'np.asarray', (['latitude'], {}), '(latitude)\n', (1444, 1454), True, 'import numpy as np\n'), ((1465, 1486), 'numpy.asarray', 'np.asarray', (['longitude'], {}), '(... |
import pandas as pd
import numpy as np
from PIL import Image, ImageDraw, ImageFont
import h5py
import os
from sortedcontainers import SortedDict
from scipy.ndimage.filters import gaussian_filter
import scipy.spatial
from itertools import islice
def generate_gaussian_kernels(round_decimals=3, sigma_threshold=4, sigma_... | [
"numpy.mean",
"numpy.ceil",
"PIL.Image.open",
"scipy.ndimage.filters.gaussian_filter",
"pandas.read_csv",
"os.path.splitext",
"h5py.File",
"os.path.split",
"numpy.linspace",
"numpy.zeros",
"pandas.DataFrame",
"sortedcontainers.SortedDict",
"numpy.round"
] | [((620, 665), 'numpy.linspace', 'np.linspace', (['sigma_min', 'sigma_max', 'num_sigmas'], {}), '(sigma_min, sigma_max, num_sigmas)\n', (631, 665), True, 'import numpy as np\n'), ((1144, 1168), 'sortedcontainers.SortedDict', 'SortedDict', (['kernels_dict'], {}), '(kernels_dict)\n', (1154, 1168), False, 'from sortedconta... |
# this file contains the invert() function that defines the right-side
# vector of the normal equations and calls the conjugate-gradient solver
from conj_grad import cg_solve
from operators import (forward_w,forward_beta,adjoint_w,adjoint_beta,Hc,
adjoint_Ub,adjoint_Uw,adjoint_Vb,adjoint_Vw,for... | [
"conj_grad.cg_solve",
"operators.forward_U",
"scipy.fft.fft2",
"operators.forward_beta",
"numpy.max",
"numpy.array",
"operators.Hc",
"operators.forward_V",
"operators.forward_w"
] | [((705, 721), 'numpy.max', 'np.max', (['vel_locs'], {}), '(vel_locs)\n', (711, 721), True, 'import numpy as np\n'), ((1030, 1085), 'conj_grad.cg_solve', 'cg_solve', (['b', 'inv_w', 'inv_beta', 'eps_w', 'eps_beta', 'vel_locs'], {}), '(b, inv_w, inv_beta, eps_w, eps_beta, vel_locs)\n', (1038, 1085), False, 'from conj_gra... |
## regression.py
## scalar regression
## note that `calcMargiProb`, `calcJointProb`, `calcCondiProb`, and `estEntropy` aren't currently used in any methods.
import numpy as np
import pandas as pd
import tensorflow as tf
import itertools as it
import scipy.special as ss
import time
def eNet(alpha, lam, v)... | [
"scipy.special.xlogy",
"tensorflow.reduce_sum",
"numpy.log",
"tensorflow.reduce_mean",
"tensorflow.sign",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.random.seed",
"tensorflow.matmul",
"tensorflow.square",
"pandas.DataFrame",
"tensorflow.train.AdamOptimizer",
"tensorflow.zeros",
... | [((744, 760), 'numpy.zeros', 'np.zeros', (['(M, M)'], {}), '((M, M))\n', (752, 760), True, 'import numpy as np\n'), ((856, 880), 'numpy.sum', 'np.sum', (['G[cadId == i, j]'], {}), '(G[cadId == i, j])\n', (862, 880), True, 'import numpy as np\n'), ((1270, 1279), 'numpy.log', 'np.log', (['(2)'], {}), '(2)\n', (1276, 1279... |
import torch
import random
import numpy as np
# MAX_SEQ = 200
# MIN_SEQ = 3
# SEED = 2021
def set_random_seeds(seed=0):
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
random.seed(seed)
np.random.seed(seed)
torch.backends.cudnn.deterministic = True
to... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"random.seed",
"numpy.random.seed",
"torch.cuda.manual_seed"
] | [((126, 149), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (143, 149), False, 'import torch\n'), ((154, 182), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['seed'], {}), '(seed)\n', (176, 182), False, 'import torch\n'), ((187, 219), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_... |
import os
import cv2
import matplotlib.pyplot as plt
import numpy as np
import pykitti
import torch
import torchvision.transforms.functional as F
from torch import hub
from torchvision.datasets import Cityscapes
from autolabeling import autolabel
from autolabeling.classes import get_lidar_colormap
from lilanet.utils ... | [
"numpy.clip",
"torch.as_tensor",
"autolabeling.autolabel.get_points_in_fov_90",
"numpy.sqrt",
"autolabeling.autolabel.transfer_labels",
"autolabeling.autolabel.semantic_segmentation",
"numpy.array",
"torch.cuda.is_available",
"matplotlib.pyplot.imshow",
"autolabeling.autolabel.spherical_projection... | [((384, 424), 'torch.zeros', 'torch.zeros', (['[256, 3]'], {'dtype': 'torch.uint8'}), '([256, 3], dtype=torch.uint8)\n', (395, 424), False, 'import torch\n'), ((800, 852), 'autolabeling.autolabel.pinhole_projection', 'autolabel.pinhole_projection', (['points', 'T_cam0', 'K_cam0'], {}), '(points, T_cam0, K_cam0)\n', (82... |
'''
Psychophysics.py: Script containing functions to measure relevant psychophysical metrics for various tasks.
'''
import matplotlib.pyplot as plt
import numpy as np
import numpy.random as npr
import time
def dRSG_metronomic(RNN, ntrials=1, threshold=0.1, showtrialplots=1, **kwargs):
'''
Function designed fo... | [
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.argmax",
"inspect.getfullargspec",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.zeros",
"JazNets.Tasks.RHY",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((1646, 1673), 'inspect.getfullargspec', 'inspect.getfullargspec', (['RHY'], {}), '(RHY)\n', (1668, 1673), False, 'import inspect\n'), ((1921, 1954), 'numpy.linspace', 'np.linspace', (['int_min', 'int_max', '(11)'], {}), '(int_min, int_max, 11)\n', (1932, 1954), True, 'import numpy as np\n'), ((2023, 2053), 'numpy.zer... |
from functools import partial
from typing import Callable, Union
import numpy as np
from numpy.typing import NDArray
from scipy import ndimage
from scipy.sparse import lil_matrix
from sklearn.ensemble import IsolationForest
from sklearn.ensemble._iforest import _average_path_length
from sklearn.utils import check_X_y
... | [
"numpy.abs",
"scipy.sparse.lil_matrix",
"numpy.unique",
"sklearn.ensemble._iforest._average_path_length",
"sklearn.utils.check_X_y",
"scipy.ndimage.mean",
"numpy.zeros",
"functools.partial",
"scipy.ndimage.sum_labels",
"scipy.ndimage.labeled_comprehension",
"numpy.all"
] | [((2063, 2121), 'scipy.ndimage.mean', 'ndimage.mean', (['values'], {'labels': 'indices', 'index': 'unique_indices'}), '(values, labels=indices, index=unique_indices)\n', (2075, 2121), False, 'from scipy import ndimage\n'), ((2391, 2455), 'scipy.ndimage.sum_labels', 'ndimage.sum_labels', (['values'], {'labels': 'indices... |
# import unittest
import numpy as np
# require: pip install flaml[blendsearch, ray]
# require: pip install flaml[ray]
import time
from flaml import tune
def evaluate_config(config):
"""evaluate a hyperparameter configuration"""
# we uss a toy example with 2 hyperparameters
metric = (round(config["x"]) - ... | [
"flaml.tune.lograndint",
"flaml.tune.run",
"ray.tune.suggest.ConcurrencyLimiter",
"time.sleep",
"flaml.searcher.blendsearch.RandomSearch",
"flaml.searcher.blendsearch.CFO",
"flaml.searcher.blendsearch.BlendSearch",
"numpy.random.seed",
"flaml.tune.randint",
"ray.tune.run",
"flaml.tune.report"
] | [((539, 571), 'time.sleep', 'time.sleep', (["(config['x'] / 100000)"], {}), "(config['x'] / 100000)\n", (549, 571), False, 'import time\n'), ((631, 657), 'flaml.tune.report', 'tune.report', ([], {'metric': 'metric'}), '(metric=metric)\n', (642, 657), False, 'from flaml import tune\n'), ((693, 731), 'flaml.tune.lograndi... |
import numpy as numpy
a = numpy.arange(10)
b = a[5]
c = a[2:]
d = a[2:5]
print (b)
print (c)
print (d)
| [
"numpy.arange"
] | [((27, 43), 'numpy.arange', 'numpy.arange', (['(10)'], {}), '(10)\n', (39, 43), True, 'import numpy as numpy\n')] |
""" **Description**
A principal component model analyzes an incident signal to define
transformation matrices which consume an incident signal to produce a
reference signal, normalized and ordered to define orthogonal axes of
descending variance.
A principal component model is a... | [
"numpy.array",
"numpy.matmul",
"numpy.isscalar"
] | [((3129, 3144), 'numpy.array', 'numpy.array', (['[]'], {}), '([])\n', (3140, 3144), False, 'import numpy\n'), ((3339, 3354), 'numpy.array', 'numpy.array', (['[]'], {}), '([])\n', (3350, 3354), False, 'import numpy\n'), ((4464, 4487), 'numpy.matmul', 'numpy.matmul', (['self.v', 'z'], {}), '(self.v, z)\n', (4476, 4487), ... |
"""
Challenge Exercises for Chapter 4.
"""
import timeit
from algs.modeling import numpy_error
from algs.table import DataTable, ExerciseNum, comma, caption
from algs.modeling import n_log_n_model
def merged_arrays(heap1, heap2):
"""Return combined array with sorted values."""
result = [None] * (heap1.N + he... | [
"random.shuffle",
"ch04.heap.PQ",
"algs.modeling.n_log_n_model",
"algs.table.caption",
"ch04.timing.trial_factorial_heap",
"numpy.array",
"algs.table.ExerciseNum",
"scipy.stats.stats.pearsonr",
"random.randint",
"algs.table.comma"
] | [((2968, 2973), 'ch04.heap.PQ', 'PQ', (['k'], {}), '(k)\n', (2970, 2973), False, 'from ch04.heap import PQ\n'), ((3705, 3718), 'random.shuffle', 'shuffle', (['vals'], {}), '(vals)\n', (3712, 3718), False, 'from random import shuffle\n'), ((4351, 4356), 'ch04.heap.PQ', 'PQ', (['N'], {}), '(N)\n', (4353, 4356), False, 'f... |
import sys
import tensorflow as tf
from tensorflow.python.ops import summary_ops_v2
from tensorflow.python.eager import context
import numpy as np
from VOClabelcolormap import color_map
from common import blend_from_3d_one_hots
class MyTensorBoardCallback(tf.keras.callbacks.TensorBoard):
def __init__(self, args... | [
"tensorflow.python.eager.context.eager_mode",
"tensorflow.python.ops.summary_ops_v2.always_record_summaries",
"numpy.array",
"tensorflow.summary.text",
"common.blend_from_3d_one_hots",
"VOClabelcolormap.color_map"
] | [((745, 756), 'VOClabelcolormap.color_map', 'color_map', ([], {}), '()\n', (754, 756), False, 'from VOClabelcolormap import color_map\n'), ((2315, 2335), 'tensorflow.python.eager.context.eager_mode', 'context.eager_mode', ([], {}), '()\n', (2333, 2335), False, 'from tensorflow.python.eager import context\n'), ((2945, 3... |
##########################################################################
# NSAp - Copyright (C) CEA, 2013
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details.
##########... | [
"numpy.mean",
"nibabel.save",
"nibabel.load",
"numpy.where",
"numpy.asarray",
"os.path.join",
"numpy.sum",
"numpy.zeros",
"os.path.isdir",
"os.mkdir",
"numpy.concatenate",
"numpy.savetxt",
"numpy.loadtxt"
] | [((1205, 1231), 'nibabel.load', 'nibabel.load', (['dwi_nii_path'], {}), '(dwi_nii_path)\n', (1217, 1231), False, 'import nibabel\n'), ((1669, 1715), 'numpy.mean', 'numpy.mean', (['dwi_array[..., b0_indices]'], {'axis': '(3)'}), '(dwi_array[..., b0_indices], axis=3)\n', (1679, 1715), False, 'import numpy\n'), ((1792, 18... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2017-2018 Red Hat, Inc.
# Copyright © 2014-2015 eNovance
#
# 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/LICE... | [
"gnocchi.utils.get_driver_class",
"collections.namedtuple",
"six.moves.range",
"numpy.array",
"daiquiri.getLogger",
"numpy.concatenate",
"numpy.frombuffer",
"six.iteritems",
"gnocchi.utils.retry_on_exception_and_log"
] | [((857, 885), 'daiquiri.getLogger', 'daiquiri.getLogger', (['__name__'], {}), '(__name__)\n', (875, 885), False, 'import daiquiri\n'), ((898, 955), 'collections.namedtuple', 'collections.namedtuple', (['"""Measure"""', "['timestamp', 'value']"], {}), "('Measure', ['timestamp', 'value'])\n", (920, 955), False, 'import c... |
#!/usr/bin/env python3 -u
# coding: utf-8
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
__all__ = ["NaiveForecaster"]
__author__ = "<NAME>"
from warnings import warn
import numpy as np
from sktime.forecasting.base._base import DEFAULT_ALPHA
from sktime.forecasting.base._sktime import BaseLa... | [
"numpy.tile",
"numpy.ceil",
"sktime.utils.validation.forecasting.check_sp",
"numpy.nanmean",
"sktime.utils.validation.forecasting.check_window_length",
"numpy.isnan",
"warnings.warn"
] | [((3381, 3398), 'sktime.utils.validation.forecasting.check_sp', 'check_sp', (['self.sp'], {}), '(self.sp)\n', (3389, 3398), False, 'from sktime.utils.validation.forecasting import check_sp\n'), ((3621, 3660), 'sktime.utils.validation.forecasting.check_window_length', 'check_window_length', (['self.window_length'], {}),... |
import os
import logging
from xml.dom.pulldom import parseString
import IPython.display as ipyd
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
from sklearn.feature_extraction import img_to_graph
import torchvisio... | [
"logging.getLogger",
"plotly.graph_objects.Surface",
"PIL.Image.fromarray",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.text",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.close",
"n... | [((370, 397), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (387, 397), False, 'import logging\n'), ((681, 716), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'first'], {'label': 'labels[0]'}), '(x, first, label=labels[0])\n', (689, 716), True, 'import matplotlib.pyplot as plt\n'), ((721,... |
import numpy as np
from warnings import warn
from typing import List, Callable
from desdeo_emo.selection.SelectionBase import SelectionBase
from desdeo_emo.population.Population import Population
from desdeo_emo.othertools.ReferenceVectors import ReferenceVectors
from typing import TYPE_CHECKING
from desdeo_emo.otherto... | [
"numpy.mean",
"numpy.arccos",
"numpy.amin",
"numpy.hstack",
"numpy.where",
"numpy.power",
"numpy.asarray",
"numpy.argmax",
"desdeo_emo.othertools.ProbabilityWrong.Probability_wrong",
"numpy.array",
"numpy.dot",
"numpy.isnan",
"numpy.linalg.norm",
"numpy.nanmin",
"numpy.shape",
"numpy.t... | [((2344, 2368), 'numpy.amin', 'np.amin', (['fitness'], {'axis': '(0)'}), '(fitness, axis=0)\n', (2351, 2368), True, 'import numpy as np\n'), ((2436, 2478), 'numpy.linalg.norm', 'np.linalg.norm', (['translated_fitness'], {'axis': '(1)'}), '(translated_fitness, axis=1)\n', (2450, 2478), True, 'import numpy as np\n'), ((2... |
from ..utils import to_value, len_batch
from .callback_tensorboard import CallbackTensorboardBased
from ..train import utilities
from ..train import outputs_trw as O
import functools
import collections
import torch
import numpy as np
import logging
logger = logging.getLogger(__name__)
def get_as_image(images):
... | [
"logging.getLogger",
"torch.Tensor",
"numpy.stack",
"collections.defaultdict",
"functools.partial",
"numpy.concatenate"
] | [((260, 287), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'import logging\n'), ((7154, 7183), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (7177, 7183), False, 'import collections\n'), ((10363, 10385), 'numpy.concatenate', 'np.con... |
from __future__ import division
import numpy as np
from dolo.algos.dtcscc.simulations import simulate
from dolo.numeric.discretization.quadrature import gauss_hermite_nodes
from dolo.numeric.misc import mlinspace
class EulerErrors(dict):
@property
def max_errors(self):
return self['max_errors']
... | [
"numpy.ravel_multi_index",
"numpy.array",
"numpy.isfinite",
"numpy.row_stack",
"numpy.repeat",
"numpy.max",
"numpy.dot",
"numpy.linspace",
"numpy.random.seed",
"numpy.maximum",
"numpy.tile",
"numpy.ones",
"numpy.random.multivariate_normal",
"numpy.floor",
"time.time",
"dolo.numeric.mis... | [((1533, 1557), 'numpy.zeros', 'np.zeros', (['sigma.shape[0]'], {}), '(sigma.shape[0])\n', (1541, 1557), True, 'import numpy as np\n'), ((1563, 1583), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1577, 1583), True, 'import numpy as np\n'), ((1599, 1650), 'numpy.random.multivariate_normal', 'np.ra... |
import numpy as np
import os
import paddle.fluid as fluid
import logging
import args
import random
import time
from evaluator import BiRNN
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger("fluid")
logger.setLevel(logging.INFO)
user_id = 0
class Dataset(object):
def... | [
"logging.basicConfig",
"evaluator.BiRNN",
"logging.getLogger",
"paddle.fluid.save",
"paddle.fluid.io.DataLoader.from_generator",
"paddle.fluid.default_startup_program",
"time.time",
"paddle.fluid.CPUPlace",
"paddle.fluid.default_main_program",
"numpy.random.randint",
"paddle.fluid.Executor",
"... | [((140, 211), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(message)s"""'}), "(format='%(asctime)s - %(levelname)s - %(message)s')\n", (159, 211), False, 'import logging\n'), ((221, 247), 'logging.getLogger', 'logging.getLogger', (['"""fluid"""'], {}), "('fluid')\n", ... |
#!/usr/bin/env python3
import logging
import random as rnd
import numpy as np
import cliffords
import copy
import itertools
import gates
from sequence import Sequence
log = logging.getLogger('LabberDriver')
import os
path_currentdir = os.path.dirname(os.path.realpath(__file__)) # curret directory
def CheckIdentit... | [
"logging.getLogger",
"numpy.sqrt",
"os.path.exists",
"numpy.matmul",
"random.randint",
"numpy.abs",
"cliffords.strGate_to_Gate",
"cliffords.loadData",
"itertools.zip_longest",
"numpy.kron",
"numpy.set_printoptions",
"os.makedirs",
"os.path.join",
"random.seed",
"cliffords.get_stabilizer"... | [((177, 210), 'logging.getLogger', 'logging.getLogger', (['"""LabberDriver"""'], {}), "('LabberDriver')\n", (194, 210), False, 'import logging\n'), ((256, 282), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (272, 282), False, 'import os\n'), ((12591, 12610), 'random.seed', 'rnd.seed', (['r... |
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from matplotlib.animation import FuncAnimation
from functools import partial
#system
def kuramoto(theta, t, A, N):
difference_matrix = np.column_stack([theta - theta[k] for k in range(N)])
theta_prime = np.array([np.dot(A[:, ... | [
"numpy.dot",
"matplotlib.pyplot.grid",
"numpy.random.rand",
"numpy.sin",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"numpy.linspace",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.random.seed",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.axes",
"numpy.cos",
"matplotlib.pyp... | [((1329, 1349), 'numpy.random.seed', 'np.random.seed', (['(1000)'], {}), '(1000)\n', (1343, 1349), True, 'import numpy as np\n'), ((1357, 1377), 'numpy.random.rand', 'np.random.rand', (['N', 'N'], {}), '(N, N)\n', (1371, 1377), True, 'import numpy as np\n'), ((1382, 1398), 'numpy.zeros', 'np.zeros', (['(N, N)'], {}), '... |
import numpy as np
from matplotlib import pyplot as plt
from time import time as t
def sieve(n):
prime = np.array([True for i in range(n+1)])
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * p, n+1, p):
prime[i] = False
p += 1
... | [
"matplotlib.pyplot.imsave",
"time.time",
"numpy.zeros"
] | [((2118, 2121), 'time.time', 't', ([], {}), '()\n', (2119, 2121), True, 'from time import time as t\n'), ((2288, 2343), 'matplotlib.pyplot.imsave', 'plt.imsave', (['f"""./pg_tests/pg{grid_size}.pdf"""', 'prime_grid'], {}), "(f'./pg_tests/pg{grid_size}.pdf', prime_grid)\n", (2298, 2343), True, 'from matplotlib import py... |
import unittest
import os
from os.path import exists, join
import numpy as np
from test_helper import TESTDIR, TESTDATA, TMPDATA
import datetime
from copy import copy
import warnings
from karta.vector import shp, read_shapefile
from karta.vector.geometry import (Point, Line, Polygon,
... | [
"datetime.datetime",
"datetime.time",
"karta.vector.geometry.Polygon",
"karta.vector.geometry.Line",
"karta.vector.geometry.Multiline",
"os.path.join",
"warnings.catch_warnings",
"karta.vector.geometry.Point",
"numpy.array",
"warnings.simplefilter",
"datetime.date",
"karta.vector.geometry.Mult... | [((15145, 15160), 'unittest.main', 'unittest.main', ([], {}), '()\n', (15158, 15160), False, 'import unittest\n'), ((1003, 1146), 'karta.vector.geometry.Multipoint', 'Multipoint', (['[(1, 1), (3, 1), (4, 3), (2, 2)]'], {'data': "{'species': ['T. officianale', 'C. tectorum', 'M. alba', 'V. cracca']}", 'crs': 'LonLatWGS8... |
import numpy as np
from mapper_0000 import Mapper_0000
class Cartridge:
def __init__(self, name: str):
# Variables for values about the cartridge
self.bImageValid = False
self.nMapperID = np.uint8(0)
self.nPRGBanks = np.uint8(0)
self.nCHRBanks = np.uint8(0)
... | [
"numpy.uint8",
"numpy.fromfile",
"mapper_0000.Mapper_0000"
] | [((228, 239), 'numpy.uint8', 'np.uint8', (['(0)'], {}), '(0)\n', (236, 239), True, 'import numpy as np\n'), ((266, 277), 'numpy.uint8', 'np.uint8', (['(0)'], {}), '(0)\n', (274, 277), True, 'import numpy as np\n'), ((304, 315), 'numpy.uint8', 'np.uint8', (['(0)'], {}), '(0)\n', (312, 315), True, 'import numpy as np\n')... |
# -*- coding: utf-8 -*-
import numpy as np
import operator
import matplotlib.pyplot as plt
from os import listdir
# 《机器学习实战》 - 第2章 - k-近邻算法
def classify0(inX, dataSet, labels, k):
"""
利用k-近邻算法实现分类,采用欧式距离
inX: 用于分类的输入向量
dataSet: 训练集
labels: 标签向量
k: 选择最近邻数目
"""
dataSetSize = dataSet.shap... | [
"numpy.tile",
"os.listdir",
"numpy.array",
"numpy.zeros",
"operator.itemgetter",
"numpy.shape"
] | [((1504, 1532), 'numpy.zeros', 'np.zeros', (['(numberOfLines, 3)'], {}), '((numberOfLines, 3))\n', (1512, 1532), True, 'import numpy as np\n'), ((3883, 3925), 'numpy.array', 'np.array', (['[ffMiles, percentTats, iceCream]'], {}), '([ffMiles, percentTats, iceCream])\n', (3891, 3925), True, 'import numpy as np\n'), ((454... |
# -*- coding: utf-8 -*-
"""

Source: <NAME>
"""
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from sklearn.utils import shuffle
from tensorflow.keras.datasets import mnist
from tensorflow.keras.datasets import fashion_m... | [
"tensorflow.contrib.layers.flatten",
"tensorflow.get_default_session",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits",
"tensorflow.train.write_graph",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tensorflow.set_random_seed",
"os.path.exists",
"tensorflow.placeholder",
"tensorflow.Sessio... | [((416, 433), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (430, 433), True, 'import numpy as np\n'), ((434, 455), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(2)'], {}), '(2)\n', (452, 455), True, 'import tensorflow as tf\n'), ((811, 842), 'numpy.expand_dims', 'np.expand_dims', (['X_train'... |
"""
Implementation of Exercises/Examples from Chapter 6 of Sutton and Barto's
"Reinforcement Learning"
"""
from gridworld import WindyGridworld
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
#%%
def gen_zero_q_table(env):
'''
Generate q table with zeros as initial values
Returns... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.argmax",
"matplotlib.pyplot.figure",
"gridworld.WindyGridworld",
"numpy.random.uniform"
] | [((615, 627), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (625, 627), True, 'import matplotlib.pyplot as plt\n'), ((679, 700), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Episode"""'], {}), "('Episode')\n", (689, 700), True, 'import matplotlib.pyplot as plt\n'), ((705, 736), 'matplotlib.pyplot.ylabe... |
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from ..utils import logger, verbose
from ..fixes import Counter
from ..parallel import parallel_func
from .. import pick_types, pick_info
@verbose
def compute_ems(epochs, conditions=None, picks=None, n_jobs=1, verbo... | [
"numpy.mean",
"numpy.intersect1d",
"numpy.where",
"numpy.array",
"numpy.sum",
"numpy.zeros",
"sklearn.cross_validation.LeaveOneOut",
"numpy.std"
] | [((4052, 4078), 'numpy.array', 'np.array', (['surrogate_trials'], {}), '(surrogate_trials)\n', (4060, 4078), True, 'import numpy as np\n'), ((4100, 4131), 'numpy.mean', 'np.mean', (['spatial_filter'], {'axis': '(0)'}), '(spatial_filter, axis=0)\n', (4107, 4131), True, 'import numpy as np\n'), ((4282, 4304), 'numpy.mean... |
"""
This script goes along my blog post:
'Keras Cats Dogs Tutorial' (https://jkjung-avt.github.io/keras-tutorial/)
"""
import argparse
import glob
import os
import sys
import numpy as np
from keras import backend as K
from keras.applications.resnet50 import preprocess_input
from keras.models import load_model
from k... | [
"keras.preprocessing.image.img_to_array",
"keras.models.load_model",
"argparse.ArgumentParser",
"keras.applications.resnet50.preprocess_input",
"os.path.join",
"os.path.isdir",
"os.path.basename",
"numpy.expand_dims",
"sys.exit",
"glob.glob",
"keras.preprocessing.image.load_img"
] | [((423, 448), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (446, 448), False, 'import argparse\n'), ((558, 577), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (571, 577), False, 'import os\n'), ((1053, 1090), 'keras.models.load_model', 'load_model', (['"""model-resnet50-final.... |
import numpy.random
import milk.unsupervised.pca
import numpy as np
def test_pca():
numpy.random.seed(123)
X = numpy.random.rand(10,4)
X[:,1] += numpy.random.rand(10)**2*X[:,0]
X[:,1] += numpy.random.rand(10)**2*X[:,0]
X[:,2] += numpy.random.rand(10)**2*X[:,0]
Y,V = milk.unsupervised.pca(X)
... | [
"numpy.mean",
"numpy.random.random_sample",
"milk.unsupervised.pdist",
"numpy.dot",
"numpy.random.seed"
] | [((532, 551), 'numpy.random.seed', 'np.random.seed', (['(232)'], {}), '(232)\n', (546, 551), True, 'import numpy as np\n'), ((596, 628), 'numpy.random.random_sample', 'np.random.random_sample', (['(12, 4)'], {}), '((12, 4))\n', (619, 628), True, 'import numpy as np\n'), ((686, 701), 'milk.unsupervised.pdist', 'pdist', ... |
### Code by <NAME>
###
###
import pyautogui
import PIL
def average_image_color(image):
"""
Code by olooney on GitHub
> https://gist.github.com/olooney/1246268
Returns the average color from a given image (PIL)
"""
i = image
h = i.histogram()
# split into red, green, blue
r = h[0:256]
g = h[256:256*2]
b = ... | [
"matplotlib.pyplot.title",
"numpy.random.random",
"matplotlib.pyplot.gcf",
"pyautogui.screenshot",
"matplotlib.pyplot.eventplot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.ion",
"os.system",
"matplotlib.pyplot.pause"
] | [((731, 779), 'os.system', 'os.system', (["('cls' if os.name == 'nt' else 'clear')"], {}), "('cls' if os.name == 'nt' else 'clear')\n", (740, 779), False, 'import os\n'), ((941, 950), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (948, 950), True, 'import matplotlib.pyplot as plt\n'), ((962, 971), 'matplotlib.p... |
# This file contains all the training functionality including
# dataset parsing and snapshot export
# Author: <NAME>, 2018, Chemnitz University of Technology
import os
import operator
import time
import numpy as np
from sklearn.utils import shuffle
import config as cfg
from model import lasagne_net as birdnet
from m... | [
"utils.log.i",
"model.lasagne_io.loadModel",
"utils.metrics.lrap",
"utils.stats.tic",
"model.lasagne_io.saveParams",
"operator.itemgetter",
"model.learning_rate.dynamicLearningRate",
"utils.stats.getValue",
"numpy.mean",
"os.listdir",
"model.lasagne_io.saveModel",
"model.lasagne_net.build_mode... | [((946, 966), 'config.getRandomState', 'cfg.getRandomState', ([], {}), '()\n', (964, 966), True, 'import config as cfg\n'), ((2207, 2243), 'sklearn.utils.shuffle', 'shuffle', (['images'], {'random_state': 'random'}), '(images, random_state=random)\n', (2214, 2243), False, 'from sklearn.utils import shuffle\n'), ((2758,... |
import cv2
import sys
import numpy as np
import scipy.spatial.distance as ssd
from tstab import *
def get_bijective_pairs(pairs,costmat):
bij_pairs = bij_pairs_one_dim(pairs, costmat,0)
bij_pairs = bij_pairs_one_dim(bij_pairs, costmat.T,1)
return bij_pairs
def bij_pairs_one_dim(pairs, costmat, left_or_right):
b... | [
"numpy.mean",
"numpy.prod",
"numpy.log10",
"numpy.roll",
"numpy.unique",
"numpy.ones",
"numpy.average",
"scipy.spatial.distance.pdist",
"numpy.floor",
"numpy.ascontiguousarray",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.arctan2",
"numpy.fmod",
"numpy.argmin",
"numpy.mod",
"... | [((347, 381), 'numpy.unique', 'np.unique', (['pairs[:, left_or_right]'], {}), '(pairs[:, left_or_right])\n', (356, 381), True, 'import numpy as np\n'), ((637, 656), 'numpy.array', 'np.array', (['bij_pairs'], {}), '(bij_pairs)\n', (645, 656), True, 'import numpy as np\n'), ((1827, 1851), 'numpy.zeros', 'np.zeros', (['(n... |
import cmocean
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
from scipy import interpolate
cmap = cm.ScalarMappable(cmap=cmocean.cm.phase)
cmap.to_rgba([0., 0.5, 1.])
def make_item(c, f, n=None):
theta = [0]
clr = cmap.to_rgba(c)
if not n:
n = np.random.randint(3, 9... | [
"matplotlib.pyplot.box",
"numpy.sqrt",
"matplotlib.pyplot.savefig",
"scipy.interpolate.splprep",
"numpy.random.rand",
"numpy.sin",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.linspace",
"matplotlib.cm.ScalarMappable",
"scipy.interpolate.splev",
"numpy.ra... | [((130, 170), 'matplotlib.cm.ScalarMappable', 'cm.ScalarMappable', ([], {'cmap': 'cmocean.cm.phase'}), '(cmap=cmocean.cm.phase)\n', (147, 170), False, 'from matplotlib import cm\n'), ((654, 691), 'scipy.interpolate.splprep', 'interpolate.splprep', (['[x, y]'], {'s': '(0)', 't': '(1)'}), '([x, y], s=0, t=1)\n', (673, 69... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
# built-in modules
import logging
import argparse
# Standard modules
import cv2
import numpy as np
import skimage
import skimage.measure
import skimage.segmentation
# Custom modules
import scripts
logger = logging.getLogger('main')
def get_masks(im... | [
"logging.getLogger",
"cv2.destroyAllWindows",
"cv2.getStructuringElement",
"numpy.mean",
"cv2.erode",
"numpy.fft.fft2",
"numpy.max",
"skimage.img_as_ubyte",
"cv2.waitKey",
"cv2.add",
"numpy.abs",
"skimage.measure.regionprops",
"cv2.morphologyEx",
"scripts.gen_args",
"cv2.cvtColor",
"nu... | [((276, 301), 'logging.getLogger', 'logging.getLogger', (['"""main"""'], {}), "('main')\n", (293, 301), False, 'import logging\n'), ((549, 622), 'skimage.segmentation.slic', 'skimage.segmentation.slic', (['img'], {'n_segments': 'n_seg', 'compactness': '(10)', 'sigma': '(1)'}), '(img, n_segments=n_seg, compactness=10, s... |
# Use Streamlit in Sagemaker Studio Lab
# Author: https://github.com/machinelearnear
# import dependencies
import streamlit as st
import numpy as np
import requests
import io
import json
import base64
import matplotlib.pyplot as plt
from PIL import Image
from pathlib import Path
from layers import BilinearUpSampling2... | [
"streamlit.image",
"streamlit.button",
"io.BytesIO",
"streamlit_image_comparison.image_comparison",
"tensorflow.keras.models.load_model",
"streamlit.text_input",
"streamlit.header",
"streamlit.title",
"matplotlib.pyplot.imshow",
"streamlit.cache",
"pathlib.Path",
"streamlit.warning",
"utils.... | [((1089, 1125), 'streamlit.cache', 'st.cache', ([], {'allow_output_mutation': '(True)'}), '(allow_output_mutation=True)\n', (1097, 1125), True, 'import streamlit as st\n'), ((568, 588), 'utils.load_images', 'load_images', (['[image]'], {}), '([image])\n', (579, 588), False, 'from utils import load_images, predict\n'), ... |
# coding: utf-8
# pylint: disable=too-many-branches
"""Initialization helper for mxnet"""
from __future__ import absolute_import
import re
import logging
import numpy as np
from .base import string_types
from .ndarray import NDArray, load
from . import random
class Initializer(object):
"""Base class for Initializ... | [
"numpy.random.normal",
"numpy.prod",
"numpy.ceil",
"numpy.sqrt",
"re.compile",
"numpy.array",
"numpy.random.uniform",
"numpy.linalg.svd",
"logging.info"
] | [((2223, 2246), 'numpy.ceil', 'np.ceil', (['(shape[3] / 2.0)'], {}), '(shape[3] / 2.0)\n', (2230, 2246), True, 'import numpy as np\n'), ((2619, 2651), 'numpy.array', 'np.array', (['[1.0, 0, 0, 0, 1.0, 0]'], {}), '([1.0, 0, 0, 0, 1.0, 0])\n', (2627, 2651), True, 'import numpy as np\n'), ((7083, 7105), 'numpy.prod', 'np.... |
"""
ScanNet
This file help you generate point clouds from RGB_D images.
"""
from __future__ import division
import numpy as np
import os, cv2, time, math, scipy
import scipy.io as io
import argparse
def CameraParameterRead(dir):
intrinsic_color_path = dir + 'intrinsic_color.txt'
intrinsic_depth_path = dir ... | [
"scipy.io.savemat",
"scipy.io.loadmat",
"numpy.array",
"os.remove",
"os.listdir",
"numpy.reshape",
"numpy.where",
"os.path.isdir",
"numpy.empty",
"numpy.concatenate",
"numpy.ones",
"os.path.isfile",
"numpy.transpose",
"cv2.imread",
"time.time",
"numpy.ones_like",
"os.makedirs",
"nu... | [((727, 770), 'numpy.array', 'np.array', (['intrinsic_color'], {'dtype': 'np.float32'}), '(intrinsic_color, dtype=np.float32)\n', (735, 770), True, 'import numpy as np\n'), ((944, 987), 'numpy.array', 'np.array', (['intrinsic_depth'], {'dtype': 'np.float32'}), '(intrinsic_depth, dtype=np.float32)\n', (952, 987), True, ... |
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil import Builder as mb
from coremltools.converters.mil.testing_util... | [
"numpy.random.rand",
"coremltools.converters.mil.testing_utils.apply_pass_and_basic_check",
"numpy.array",
"coremltools.converters.mil.testing_utils.get_op_types_in_program",
"coremltools.converters.mil.mil.Builder.TensorSpec",
"coremltools.converters.mil.mil.Builder.identity",
"numpy.random.seed",
"c... | [((499, 519), 'numpy.random.seed', 'np.random.seed', (['(1984)'], {}), '(1984)\n', (513, 519), True, 'import numpy as np\n'), ((1054, 1115), 'coremltools.converters.mil.testing_utils.apply_pass_and_basic_check', 'apply_pass_and_basic_check', (['prog', '"""common::reduce_transposes"""'], {}), "(prog, 'common::reduce_tra... |
import os
import cv2
import math
import shutil
import pytesseract
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
#Module to detect whether the object in the video sequence is moving or not.
def MovementDetection(VideoPath):
if(os.path.exists(... | [
"numpy.array",
"cv2.HoughLines",
"cv2.dnn.NMSBoxes",
"os.path.exists",
"cv2.threshold",
"cv2.erode",
"cv2.line",
"cv2.contourArea",
"cv2.minAreaRect",
"numpy.stack",
"cv2.dnn.blobFromImage",
"cv2.warpAffine",
"numpy.argmax",
"cv2.morphologyEx",
"scipy.stats.zscore",
"cv2.cvtColor",
"... | [((437, 464), 'cv2.VideoCapture', 'cv2.VideoCapture', (['VideoPath'], {}), '(VideoPath)\n', (453, 464), False, 'import cv2\n'), ((1981, 2014), 'cv2.resize', 'cv2.resize', (['img', 'None'], {'fx': '(1)', 'fy': '(1)'}), '(img, None, fx=1, fy=1)\n', (1991, 2014), False, 'import cv2\n'), ((2067, 2143), 'cv2.dnn.blobFromIma... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
from pytorch_transformers import (WEIGHTS_NAME, BertConfig, BertForSequenceClassification, BertTokenizer,
XLMConfig, XLMForSequenceClassification, XLMTokenizer,
XLNetConfig,... | [
"pandas.read_csv",
"torch.cuda.device_count",
"numpy.argsort",
"numpy.array",
"torch.cuda.is_available",
"keras.preprocessing.sequence.pad_sequences",
"math.exp",
"argparse.ArgumentParser",
"numpy.empty",
"numpy.concatenate",
"pickle.load",
"torch.utils.data.SequentialSampler",
"torch.utils.... | [((820, 845), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (843, 845), False, 'import argparse\n'), ((2467, 2523), 'pandas.read_csv', 'pd.read_csv', (['query_doc_file'], {'delimiter': '"""\t"""', 'header': 'None'}), "(query_doc_file, delimiter='\\t', header=None)\n", (2478, 2523), True, 'impo... |
import re
import os
import glob
import subprocess
from subprocess import Popen, PIPE
import numpy as np
# generates the string with the selected integrator
def set_integrator(scene, integrator_str):
start = '##INTEGRATOR-DEF-START'
end = '##INTEGRATOR-DEF-END'
replacement = integrator_str
match = re.ma... | [
"os.path.exists",
"numpy.sqrt",
"os.makedirs",
"subprocess.Popen",
"re.match",
"os.path.isfile",
"numpy.array",
"subprocess.call",
"math.log10"
] | [((315, 383), 're.match', 're.match', (["('(.+%s\\\\s*).+?(\\\\s*%s.+)' % (start, end))", 'scene', 're.DOTALL'], {}), "('(.+%s\\\\s*).+?(\\\\s*%s.+)' % (start, end), scene, re.DOTALL)\n", (323, 383), False, 'import re\n'), ((584, 652), 're.match', 're.match', (["('(.+%s\\\\s*).+?(\\\\s*%s.+)' % (start, end))", 'scene',... |
# RS_SGS100A.py class, to perform the communication between the Wrapper and the device
# <NAME> <<EMAIL>>, 2015
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License,... | [
"logging.debug",
"visa.ResourceManager",
"instrument.Instrument.__init__",
"numpy.finfo",
"logging.info",
"numpy.round"
] | [((1437, 1501), 'logging.info', 'logging.info', (["(__name__ + ' : Initializing instrument RS_SGS100A')"], {}), "(__name__ + ' : Initializing instrument RS_SGS100A')\n", (1449, 1501), False, 'import logging\n'), ((1510, 1560), 'instrument.Instrument.__init__', 'Instrument.__init__', (['self', 'name'], {'tags': "['physi... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | [
"qiskit_dynamics.type_utils.to_array",
"qiskit_dynamics.type_utils.to_numeric_matrix_type",
"scipy.sparse.issparse",
"numpy.diag",
"numpy.exp",
"qiskit.QiskitError",
"scipy.sparse.csr_matrix",
"qiskit_dynamics.type_utils.to_BCOO",
"numpy.linalg.eigh",
"jax.experimental.sparse.sparsify",
"qiskit.... | [((1052, 1080), 'jax.experimental.sparse.sparsify', 'jsparse.sparsify', (['jnp.matmul'], {}), '(jnp.matmul)\n', (1068, 1080), True, 'from jax.experimental import sparse as jsparse\n'), ((23189, 23202), 'qiskit_dynamics.type_utils.to_array', 'to_array', (['mat'], {}), '(mat)\n', (23197, 23202), False, 'from qiskit_dynam... |
import gym
import numpy as np
from metaworlds.core import Serializable
from metaworlds.envs import Step
from metaworlds.misc.overrides import overrides
class SlidingMemEnv(gym.Wrapper, Serializable):
def __init__(
self,
env,
n_steps=4,
axis=0,
):
super(... | [
"numpy.zeros",
"numpy.repeat",
"metaworlds.envs.Step"
] | [((608, 664), 'numpy.zeros', 'np.zeros', (['self.observation_space.shape'], {'dtype': 'np.float32'}), '(self.observation_space.shape, dtype=np.float32)\n', (616, 664), True, 'import numpy as np\n'), ((1708, 1747), 'metaworlds.envs.Step', 'Step', (['self.buffer', 'reward', 'done'], {}), '(self.buffer, reward, done, **in... |
from __future__ import annotations
import pyqtgraph as pg
from pyqtgraph import colormap as cmap
from typing import Generic, Iterator, Sequence, TypeVar, overload, MutableSequence
import numpy as np
from ._utils import convert_color_code, to_rgba
from .components import Legend, Region, ScaleBar, TextItem
from .graph_i... | [
"pyqtgraph.icons.getGraphPixmap",
"pyqtgraph.colormap.get",
"numpy.isscalar",
"pyqtgraph.PlotItem",
"pyqtgraph.ROI",
"pyqtgraph.ImageItem",
"numpy.asarray",
"pyqtgraph.HistogramLUTItem",
"pyqtgraph.mkBrush",
"numpy.array",
"numpy.arctan",
"pyqtgraph.GraphicsLayoutWidget",
"pyqtgraph.ViewBox"... | [((26167, 26198), 'typing.TypeVar', 'TypeVar', (['"""_C"""'], {'bound': 'HasViewBox'}), "('_C', bound=HasViewBox)\n", (26174, 26198), False, 'from typing import Generic, Iterator, Sequence, TypeVar, overload, MutableSequence\n'), ((13600, 13614), 'pyqtgraph.ROI', 'pg.ROI', (['(0, 0)'], {}), '((0, 0))\n', (13606, 13614)... |
"""
Name: coloredComponents
Date: Jun 2019
Programmer: <NAME>, <NAME>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
If you use the 'NMF toolbox' please refer to:
[1] <NAME>, <NAME>, <NAME>, and <NAME>
NMF Toolbox: Music Processing Applications of Nonne... | [
"matplotlib.colors.rgb_to_hsv",
"matplotlib.cm.hsv",
"numpy.zeros",
"matplotlib.colors.hsv_to_rgb",
"numpy.mod"
] | [((2195, 2228), 'numpy.zeros', 'np.zeros', (['(numBins, numFrames, 3)'], {}), '((numBins, numFrames, 3))\n', (2203, 2228), True, 'import numpy as np\n'), ((2696, 2729), 'numpy.zeros', 'np.zeros', (['(numBins, numFrames, 3)'], {}), '((numBins, numFrames, 3))\n', (2704, 2729), True, 'import numpy as np\n'), ((3040, 3056)... |
# coding: utf-8
# # Mask R-CNN - Train on Shapes Dataset
#
#
# This notebook shows how to train Mask R-CNN on your own dataset. To keep things simple we use a synthetic dataset of shapes (squares, triangles, and circles) which enables fast training. You'd still need a GPU, though, because the network backbone is a ... | [
"mrcnn.model.MaskRCNN",
"numpy.random.choice",
"os.path.join",
"os.getcwd",
"mrcnn.shapes.ShapesDataset",
"mrcnn.shapes.ShapesConfig",
"matplotlib.pyplot.subplots"
] | [((1305, 1316), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1314, 1316), False, 'import os\n'), ((1400, 1438), 'os.path.join', 'os.path.join', (['MODEL_PATH', '"""mrcnn_logs"""'], {}), "(MODEL_PATH, 'mrcnn_logs')\n", (1412, 1438), False, 'import os\n'), ((1489, 1534), 'os.path.join', 'os.path.join', (['MODEL_PATH', '"... |
import pandas as pd
import numpy as np
from pandas.api.types import is_numeric_dtype
from datetime import date, datetime
import calendar
def add_datetime_features(df, datetime_columns: list, add_time_features=False, scale_0_to_1=True,
cos_sin_transform=True, return_new_cols=True) -> pd.DataFrame:
... | [
"numpy.sin",
"numpy.cos",
"pandas.to_datetime"
] | [((670, 693), 'pandas.to_datetime', 'pd.to_datetime', (['df[col]'], {}), '(df[col])\n', (684, 693), True, 'import pandas as pd\n'), ((2722, 2773), 'numpy.cos', 'np.cos', (["(df[f'ft_{col}_{seasonal_part}'] * 2 * np.pi)"], {}), "(df[f'ft_{col}_{seasonal_part}'] * 2 * np.pi)\n", (2728, 2773), True, 'import numpy as np\n'... |
"""tests the NastranIO class"""
import os
from copy import deepcopy
import unittest
import numpy as np
try:
import matplotlib
matplotlib.use('Agg')
IS_MATPLOTLIB = True
except ModuleNotFoundError: # pyparsing is missing
IS_MATPLOTLIB = False
#except ImportError:
#pass
import vtk
from cpylog impor... | [
"unittest.skipIf",
"numpy.array",
"copy.deepcopy",
"unittest.main",
"os.remove",
"os.path.exists",
"cpylog.SimpleLogger",
"vtk.vtkRenderLargeImage",
"pyNastran.gui.testing_methods.FakeGUIMethods.__init__",
"vtk.vtkAxesActor",
"pyNastran.converters.nastran.nastran_to_vtk.nastran_to_vtk",
"numpy... | [((987, 1030), 'os.path.join', 'os.path.join', (['PKG_PATH', '"""converters"""', '"""stl"""'], {}), "(PKG_PATH, 'converters', 'stl')\n", (999, 1030), False, 'import os\n'), ((1044, 1082), 'os.path.join', 'os.path.join', (['PKG_PATH', '""".."""', '"""models"""'], {}), "(PKG_PATH, '..', 'models')\n", (1056, 1082), False,... |
from time import time
from random import randrange, seed
import numpy as np
#import pandas as pd
import cv2
#import sys
from sklearn.cluster import KMeans
from scipy.optimize import linear_sum_assignment
from scipy.spatial.distance import cdist
#from random import randrange, seed
class Tracktor():
def __init__(... | [
"numpy.sqrt",
"numpy.array",
"cv2.ocl.useOpenCL",
"cv2.ocl.setUseOpenCL",
"scipy.optimize.linear_sum_assignment",
"numpy.where",
"numpy.delete",
"cv2.contourArea",
"numpy.vstack",
"cv2.VideoWriter_fourcc",
"cv2.blur",
"cv2.drawContours",
"numpy.ones",
"random.randrange",
"cv2.cvtColor",
... | [((2861, 2886), 'numpy.ones', 'np.ones', (['(5, 5)', 'np.uint8'], {}), '((5, 5), np.uint8)\n', (2868, 2886), True, 'import numpy as np\n'), ((3489, 3519), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (['*codec'], {}), '(*codec)\n', (3511, 3519), False, 'import cv2\n'), ((4933, 4956), 'cv2.blur', 'cv2.blur', (['f... |
# functions that implement transformations using the sineModel
import numpy as np
from scipy.interpolate import interp1d
def sineTimeScaling(sfreq, smag, timeScaling):
"""
Time scaling of sinusoidal tracks
sfreq, smag: frequencies and magnitudes of input sinusoidal tracks
timeScaling: scaling factors, in time-val... | [
"numpy.where",
"numpy.zeros_like",
"numpy.arange",
"scipy.interpolate.interp1d"
] | [((1122, 1165), 'scipy.interpolate.interp1d', 'interp1d', (['outFrames', 'inFrames'], {'fill_value': '(0)'}), '(outFrames, inFrames, fill_value=0)\n', (1130, 1165), False, 'from scipy.interpolate import interp1d\n'), ((2456, 2476), 'numpy.zeros_like', 'np.zeros_like', (['sfreq'], {}), '(sfreq)\n', (2469, 2476), True, '... |
import numpy as np
import tensorflow as tf
from flask import Flask, render_template, jsonify, request, make_response, send_from_directory, abort
from mnist import module as model
from cnocr import CnOcr
import mxnet as mx
from werkzeug.utils import secure_filename
import datetime
import random
import os
import base64
... | [
"flask.render_template",
"flask.Flask",
"numpy.array",
"werkzeug.utils.secure_filename",
"tensorflow.GPUOptions",
"flask.jsonify",
"os.path.exists",
"flask.send_from_directory",
"mnist.module.convolutional",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.ConfigProto",
"random.ra... | [((931, 972), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'allow_soft_placement': '(True)'}), '(allow_soft_placement=True)\n', (945, 972), True, 'import tensorflow as tf\n'), ((1003, 1053), 'tensorflow.GPUOptions', 'tf.GPUOptions', ([], {'per_process_gpu_memory_fraction': '(0.7)'}), '(per_process_gpu_memory_fract... |
import numpy as np
import cv2
# This file is a set of commonly used functions by the viz scripts. It
# is not meant to be run on its own
def unblockshaped(arr, h, w, rgb=False):
if rgb:
n, nrows, ncols, nchannels = arr.shape
return (arr.reshape(h//nrows, -1, nrows, ncols, nchannels)
... | [
"numpy.sqrt",
"numpy.reshape"
] | [((1030, 1052), 'numpy.sqrt', 'np.sqrt', (['grid.shape[0]'], {}), '(grid.shape[0])\n', (1037, 1052), True, 'import numpy as np\n'), ((582, 614), 'numpy.reshape', 'np.reshape', (['img', '(side, side, 3)'], {}), '(img, (side, side, 3))\n', (592, 614), True, 'import numpy as np\n'), ((667, 696), 'numpy.reshape', 'np.resha... |
# -*- coding: utf-8 -*-
"""
201901, Dr. <NAME>, Beijing & Xinglong, NAOC
Light_Curve
"""
import numpy as np
import astropy.io.fits as fits
from .utils import loadlist, datestr, logfile, conf, meanclip
from .cata import match
def offset(ini_file, sci_lst, catalog_suffix, offset_file, ref_id=0, out_path="", l... | [
"numpy.where",
"numpy.zeros",
"numpy.sqrt",
"astropy.io.fits.getdata"
] | [((944, 961), 'numpy.zeros', 'np.zeros', (['(6, nf)'], {}), '((6, nf))\n', (952, 961), True, 'import numpy as np\n'), ((974, 997), 'numpy.zeros', 'np.zeros', (['nf'], {'dtype': 'int'}), '(nf, dtype=int)\n', (982, 997), True, 'import numpy as np\n'), ((1012, 1041), 'astropy.io.fits.getdata', 'fits.getdata', (['catf[ref_... |
# This is functions to repick
import numpy as np
# generate recombined spots
def generate_recombined_spots(repeat_cand_spots, repeat_ids, original_cand_spots, original_ids):
"""Function to re-assemble fitted original candidate spots and repeat candidate spots
to perform spot repick to determine relabeli... | [
"numpy.array"
] | [((822, 844), 'numpy.array', 'np.array', (['original_ids'], {}), '(original_ids)\n', (830, 844), True, 'import numpy as np\n')] |
import numpy as np
import scipy
# from sksparse.cholmod import cholesky # It works (from Terminal).
from scipy.sparse.linalg import spsolve
import time
import sys, os
sys.path.append(os.path.dirname(sys.path[0]))
from elementLibrary import stiffnessMatrix, shapeFunction
from otherFunctions import numericalIntegration
... | [
"scipy.sparse.linalg.spsolve",
"meshTools.toDC.nodeElementList",
"elementLibrary.stiffnessMatrix.triFE",
"numpy.delete",
"elementLibrary.stiffnessMatrix.quadFE",
"elementLibrary.shapeFunction.oneDQuadratic",
"elementLibrary.stiffnessMatrix.triQuadFE",
"os.path.dirname",
"numpy.array",
"numpy.zeros... | [((184, 212), 'os.path.dirname', 'os.path.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (199, 212), False, 'import sys, os\n'), ((511, 522), 'time.time', 'time.time', ([], {}), '()\n', (520, 522), False, 'import time\n'), ((1499, 1524), 'numpy.array', 'np.array', (['Iglo'], {'dtype': 'int'}), '(Iglo, dtype=int)\n... |
import numpy as np
def l2_regularization(W, reg_strength):
'''
Computes L2 regularization loss on weights and its gradient
Arguments:
W, np array - weights
reg_strength - float value
Returns:
loss, single value - l2 regularization loss
gradient, np.array same shape as W - gra... | [
"numpy.mean",
"numpy.abs",
"numpy.ones",
"numpy.log",
"numpy.max",
"numpy.exp",
"numpy.sum",
"numpy.dot",
"numpy.random.randn",
"numpy.zeros_like",
"numpy.arange"
] | [((2301, 2315), 'numpy.mean', 'np.mean', (['value'], {}), '(value)\n', (2308, 2315), True, 'import numpy as np\n'), ((2738, 2770), 'numpy.arange', 'np.arange', (['target_index.shape[0]'], {}), '(target_index.shape[0])\n', (2747, 2770), True, 'import numpy as np\n'), ((621, 634), 'numpy.sum', 'np.sum', (['(W * W)'], {})... |
import numpy as np
import torch
from rlpyt.utils.tensor import infer_leading_dims, restore_leading_dims
from rlpyt.models.mlp import MlpModel
from rlpyt.utils.collections import namedarraytuple
RnnState = namedarraytuple("RnnState", ["h", "c"])
class MujocoLstmModel(torch.nn.Module):
def __init__(
... | [
"numpy.prod",
"rlpyt.utils.tensor.restore_leading_dims",
"rlpyt.models.mlp.MlpModel",
"torch.nn.LSTM",
"rlpyt.utils.tensor.infer_leading_dims",
"torch.nn.Linear",
"rlpyt.utils.collections.namedarraytuple"
] | [((208, 247), 'rlpyt.utils.collections.namedarraytuple', 'namedarraytuple', (['"""RnnState"""', "['h', 'c']"], {}), "('RnnState', ['h', 'c'])\n", (223, 247), False, 'from rlpyt.utils.collections import namedarraytuple\n'), ((771, 883), 'rlpyt.models.mlp.MlpModel', 'MlpModel', ([], {'input_size': 'mlp_input_size', 'hidd... |
#!/usr/bin/env python
from __future__ import print_function
# Copyright 2019 <NAME> - juliane.mai(at)uwaterloo.ca
#
# License
# This file is part of the EEE code library for "Computationally inexpensive identification
# of noninformative model parameters by sequential screening: Efficient Elementary Effects (EEE)".
#
... | [
"raven_templates.RVH.format",
"raven_templates.RVP.format",
"raven_templates.RVC.format",
"os.path.exists",
"raven_templates.RVT.format",
"argparse.ArgumentParser",
"subprocess.Popen",
"raven_templates.RVI.format",
"numpy.diff",
"numpy.max",
"pathlib2.Path",
"numpy.min",
"numpy.shape",
"nu... | [((3253, 3682), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'description': '"""An example calling sequence to derive model outputs for previously sampled parameter sets stored in an ASCII file (option -i) where some lines might be skipped (optio... |
# -*- coding: utf-8 -*-
import argparse
import logging
from array import array
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
from pylab import contour, contourf
from il2fb.maps.heightmaps.constants import HEIGHT_PACK_FORMAT
from i... | [
"logging.getLogger",
"pylab.contourf",
"array.array",
"argparse.ArgumentParser",
"pathlib.Path",
"matplotlib.pyplot.clf",
"il2fb.maps.heightmaps.logging.setup_logging",
"numpy.array",
"matplotlib.pyplot.figure",
"pylab.contour",
"matplotlib.pyplot.axis",
"matplotlib.colors.LinearSegmentedColor... | [((432, 459), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (449, 459), False, 'import logging\n'), ((1223, 1289), 'matplotlib.colors.LinearSegmentedColormap.from_list', 'LinearSegmentedColormap.from_list', (['"""il2fb-heights"""', 'CMAP_DATA', '(256)'], {}), "('il2fb-heights', CMAP_DATA... |
from __future__ import division
import os
import time
from shutil import copyfile
from glob import glob
import tensorflow as tf
import numpy as np
# import config
from collections import namedtuple
# from module import *
# from utils import *
# from ops import *
# from metrics import *
import tensorflow_addons as tfa
i... | [
"tensorflow.pad",
"numpy.random.rand",
"numpy.array",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.load_model",
"numpy.save",
"matplotlib.pyplot.imshow",
"numpy.mean",
"os.listdir",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Sequential",
"numpy.asarray",
"numpy.max",
... | [((23309, 23337), 'os.listdir', 'os.listdir', (['directory_path_A'], {}), '(directory_path_A)\n', (23319, 23337), False, 'import os\n'), ((23818, 23846), 'os.listdir', 'os.listdir', (['directory_path_B'], {}), '(directory_path_B)\n', (23828, 23846), False, 'import os\n'), ((25643, 25687), 'os.path.join', 'os.path.join'... |
import numpy as np
import matplotlib.pyplot as plt
import numpy.fft as nf
from dataset import data_load
feat = 'O3'
def plotfft(arr):
plt.subplot(2, 1, 1)
plt.plot(arr)
plt.subplot(2, 1, 2)
plt.ylim([0,400])
plt.xlim([0,300])
comp_arr = nf.fft(arr)
y2 = nf.ifft(comp_arr).real
freqs ... | [
"matplotlib.pyplot.grid",
"numpy.array",
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.fft.fft",
"numpy.linspace",
"matplotlib.pyplot.ylim",
"numpy.abs",
"matplotlib.pyplot.savefig",
"dataset.data_load",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"numpy.fft.ifft",
"matplotlib.pyp... | [((141, 161), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(2)', '(1)', '(1)'], {}), '(2, 1, 1)\n', (152, 161), True, 'import matplotlib.pyplot as plt\n'), ((166, 179), 'matplotlib.pyplot.plot', 'plt.plot', (['arr'], {}), '(arr)\n', (174, 179), True, 'import matplotlib.pyplot as plt\n'), ((184, 204), 'matplotlib.pypl... |
from __future__ import division
import numpy as np
import scipy.sparse as sp
import numpy.polynomial.legendre as leg
from scipy.linalg import lu
import scipy.interpolate as intpl
from pymg.collocation_base import CollBase
class CollGaussLegendre(CollBase):
"""
Implements Gauss-Legendre Quadrature by deriving... | [
"numpy.sqrt",
"numpy.linalg.eig",
"numpy.roll",
"scipy.interpolate.splint",
"numpy.diag",
"numpy.argsort",
"numpy.linalg.eigvals",
"numpy.linspace",
"numpy.zeros",
"numpy.array",
"numpy.append",
"numpy.concatenate",
"scipy.sparse.spdiags"
] | [((2538, 2566), 'numpy.linspace', 'np.linspace', (['(1)', '(M - 1)', '(M - 1)'], {}), '(1, M - 1, M - 1)\n', (2549, 2566), True, 'import numpy as np\n'), ((2890, 2913), 'numpy.linalg.eig', 'np.linalg.eig', (['comp_mat'], {}), '(comp_mat)\n', (2903, 2913), True, 'import numpy as np\n'), ((2932, 2952), 'numpy.argsort', '... |
import pandas as pd
from matplotlib import pyplot as plt
import datetime
import pickle
import matplotlib.dates as mdates
# Read the files
dfsonde = pd.read_csv('sonde.txt',
#skiprows= 10,
#header = 11, #use the second row (index 1) as column headings
... | [
"matplotlib.dates.ConciseDateFormatter",
"datetime.datetime",
"pandas.read_csv",
"pickle.dumps",
"matplotlib.dates.DateFormatter",
"numpy.ma.masked_where",
"numpy.array",
"pickle.loads",
"matplotlib.dates.AutoDateLocator",
"matplotlib.pyplot.subplots"
] | [((149, 207), 'pandas.read_csv', 'pd.read_csv', (['"""sonde.txt"""'], {'parse_dates': "{'datetime': [0, 1]}"}), "('sonde.txt', parse_dates={'datetime': [0, 1]})\n", (160, 207), True, 'import pandas as pd\n'), ((558, 625), 'pandas.read_csv', 'pd.read_csv', (['"""datalogCTD_su1.txt"""'], {'parse_dates': "{'datetime': [0,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.