code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import nibabel as nib from numpy.testing import (assert_equal, assert_almost_equal, run_module_suite) from dipy.data import get_fnames from dipy.segment.bundles import RecoBundles from dipy.tracking.distances import bundles_distances_mam from dipy...
[ "dipy.tracking.streamline.Streamlines", "dipy.data.get_fnames", "dipy.segment.bundles.RecoBundles", "numpy.testing.run_module_suite", "numpy.random.RandomState", "numpy.array", "dipy.segment.clustering.qbx_and_merge", "dipy.tracking.distances.bundles_distances_mam" ]
[((505, 524), 'dipy.tracking.streamline.Streamlines', 'Streamlines', (['fornix'], {}), '(fornix)\n', (516, 524), False, 'from dipy.tracking.streamline import Streamlines\n'), ((572, 592), 'numpy.array', 'np.array', (['[50, 0, 0]'], {}), '([50, 0, 0])\n', (580, 592), True, 'import numpy as np\n'), ((627, 648), 'numpy.ar...
import numpy as np from .planar_graph import PlanarGraph from .planar_graph_edges import PlanarGraphEdges from .. import common_utils class PlanarGraphConstructor: """ A static class with different planar graph construction methods. """ @staticmethod def construct_subgraph(graph, subgraph_vertice...
[ "numpy.arange", "numpy.ones" ]
[((7463, 7502), 'numpy.arange', 'np.arange', (['graph.edges_count'], {'dtype': 'int'}), '(graph.edges_count, dtype=int)\n', (7472, 7502), True, 'import numpy as np\n'), ((1303, 1333), 'numpy.ones', 'np.ones', (['graph.size'], {'dtype': 'int'}), '(graph.size, dtype=int)\n', (1310, 1333), True, 'import numpy as np\n'), (...
# %% [markdown] """ calculate ODNP using DNPLab =========================== This example demonstrates how to use the dnplab.dnpHydration module """ # %% # %% [markdown] # First import dnplab and numpy, import dnplab import numpy as np # %% # %% [markdown] # To use the dnpHydration module first create a dictionary ...
[ "dnplab.dnpHydration.hydration", "dnplab.create_workspace", "dnplab.dnpHydration.odnp", "numpy.array" ]
[((1386, 1437), 'dnplab.create_workspace', 'dnplab.create_workspace', (['"""hydration_inputs"""', 'inputs'], {}), "('hydration_inputs', inputs)\n", (1409, 1437), False, 'import dnplab\n'), ((2571, 2611), 'dnplab.dnpHydration.hydration', 'dnplab.dnpHydration.hydration', (['workspace'], {}), '(workspace)\n', (2600, 2611)...
# -*- coding: utf-8 -*- """ Created on Fri Sep 18 18:42:30 2020 @author: <NAME> """ import numpy as np import pandas as pd import os from sklearn import metrics # 改变工作目录 os.chdir(r"C:\Users\<NAME>\Desktop\携程网点评内容情感分析") # 读取数据 test_pred = np.load("test_pred.npy") y_test = np.load("y_test.npy") y_train = np.load("y_t...
[ "numpy.load", "sklearn.metrics.accuracy_score", "sklearn.metrics.recall_score", "sklearn.metrics.roc_auc_score", "sklearn.metrics.precision_score", "sklearn.metrics.confusion_matrix", "os.chdir", "numpy.unique" ]
[((174, 225), 'os.chdir', 'os.chdir', (['"""C:\\\\Users\\\\<NAME>\\\\Desktop\\\\携程网点评内容情感分析"""'], {}), "('C:\\\\Users\\\\<NAME>\\\\Desktop\\\\携程网点评内容情感分析')\n", (182, 225), False, 'import os\n'), ((242, 266), 'numpy.load', 'np.load', (['"""test_pred.npy"""'], {}), "('test_pred.npy')\n", (249, 266), True, 'import numpy a...
import numpy as np from . import options import os from .base_gsm import * #from dlc import * from .pes import * import pybel as pb import sys class GSM(Base_Method): def __init__( self, options, ): super(GSM,self).__init__(options) print(" Forming Union of p...
[ "numpy.abs", "numpy.argmax", "numpy.zeros", "numpy.reshape", "numpy.dot" ]
[((3122, 3146), 'numpy.argmax', 'np.argmax', (['self.energies'], {}), '(self.energies)\n', (3131, 3146), True, 'import numpy as np\n'), ((6410, 6438), 'numpy.zeros', 'np.zeros', (['(Vecs.shape[1], 1)'], {}), '((Vecs.shape[1], 1))\n', (6418, 6438), True, 'import numpy as np\n'), ((6454, 6479), 'numpy.dot', 'np.dot', (['...
import os from abc import abstractmethod from datetime import datetime import cv2 import numpy as np from bot import default_timestamp from bot.utils.data import load_dict_from_hdf5, save_dict_to_hdf5 class Predefined(object): _config = None dataset = None version = None assets = None def __ini...
[ "cv2.Canny", "bot.utils.data.load_dict_from_hdf5", "os.path.exists", "bot.utils.data.save_dict_to_hdf5", "numpy.linalg.norm", "cv2.meanStdDev", "datetime.datetime.fromtimestamp", "datetime.datetime.now", "numpy.concatenate" ]
[((680, 721), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (['default_timestamp'], {}), '(default_timestamp)\n', (702, 721), False, 'from datetime import datetime\n'), ((858, 872), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (870, 872), False, 'from datetime import datetime\n'), ((1961, 1...
import json import numpy as np import DataStore as ds class ExperienceReplay(object): def __init__(self, max_memory=100, discount=.9, env = None, sequence_dim=(1,1)): self.max_memory = max_memory self.memory = list() self.discount = discount self.environment = env self.se...
[ "numpy.random.randint", "numpy.zeros" ]
[((874, 914), 'numpy.zeros', 'np.zeros', (['(inputs.shape[0], num_actions)'], {}), '((inputs.shape[0], num_actions))\n', (882, 914), True, 'import numpy as np\n'), ((947, 1001), 'numpy.random.randint', 'np.random.randint', (['(0)', 'len_memory'], {'size': 'inputs.shape[0]'}), '(0, len_memory, size=inputs.shape[0])\n', ...
# Date: 12/06/2019 # Author: <NAME> # System Class import numpy as np import copy import itertools import h5py import glob import os from tvtk.api import tvtk # python wrappers for the C++ vtk ecosystem import shutil import datetime import julian from .timestep import Timestep from .referenceframe import ReferenceFrame...
[ "os.mkdir", "h5py.File", "os.path.exists", "numpy.around", "datetime.timedelta", "numpy.string_", "glob.glob" ]
[((1426, 1446), 'h5py.File', 'h5py.File', (['path', '"""a"""'], {}), "(path, 'a')\n", (1435, 1446), False, 'import h5py\n'), ((2219, 2259), 'glob.glob', 'glob.glob', (["(self.save_directory + '/*.h5')"], {}), "(self.save_directory + '/*.h5')\n", (2228, 2259), False, 'import glob\n'), ((1088, 1122), 'os.path.exists', 'o...
# -*- coding: utf-8 -*- """ Low-level Python bindings to the Minpack library. This module forwards the CFFI generated bindings to the Minpack library and provides a Pythonic interface to the C API. """ import numpy as np import functools import math from typing import Optional from .typing import ( CallableHybrd...
[ "numpy.dtype", "numpy.zeros", "numpy.ones", "numpy.finfo", "numpy.reshape", "functools.wraps" ]
[((5418, 5432), 'numpy.dtype', 'np.dtype', (['"""f8"""'], {}), "('f8')\n", (5426, 5432), True, 'import numpy as np\n'), ((5133, 5154), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (5148, 5154), False, 'import functools\n'), ((8091, 8116), 'numpy.zeros', 'np.zeros', (['lwa'], {'dtype': 'real'}), '(l...
# -*- coding:utf-8 -*- """ Project : numpy File Name : 17_to_18_legend_annotate Author : Focus Date : 8/24/2021 12:42 AM Keywords : legend, annotate Abstract : Param : Usage : py 17_to_18_legend_annotate Reference : """ import pandas_datareader as pdr import numpy as np import matplotlib.pyplot as ...
[ "pandas_datareader.data.get_data_yahoo", "matplotlib.dates.MonthLocator", "matplotlib.pyplot.show", "matplotlib.dates.DayLocator", "numpy.convolve", "numpy.rec.fromrecords", "matplotlib.pyplot.figure", "matplotlib.dates.DateFormatter", "numpy.array", "numpy.linspace", "numpy.compress" ]
[((535, 604), 'pandas_datareader.data.get_data_yahoo', 'pdr.data.get_data_yahoo', (['"""DISH"""'], {'start': '"""2012-12-01"""', 'end': '"""2013-12-01"""'}), "('DISH', start='2012-12-01', end='2013-12-01')\n", (558, 604), True, 'import pandas_datareader as pdr\n'), ((613, 631), 'numpy.array', 'np.array', (['df.index'],...
#!/usr/bin/env python3 import numpy as np RNNCell = __import__('0-rnn_cell').RNNCell rnn = __import__('1-rnn').rnn np.random.seed(1) rnn_cell = RNNCell(10, 15, 5) rnn_cell.bh = np.random.randn(1, 15) rnn_cell.by = np.random.randn(1, 5) X = np.random.randn(6, 8, 10) h_0 = np.zeros((8, 15)) H, Y = rnn(rnn_cell, X, h_0)...
[ "numpy.zeros", "numpy.random.seed", "numpy.random.randn" ]
[((117, 134), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (131, 134), True, 'import numpy as np\n'), ((179, 201), 'numpy.random.randn', 'np.random.randn', (['(1)', '(15)'], {}), '(1, 15)\n', (194, 201), True, 'import numpy as np\n'), ((216, 237), 'numpy.random.randn', 'np.random.randn', (['(1)', '(5)...
from LibrasVideoSegmentation import LibrasVideoSegmentation from os.path import split from tqdm import tqdm import pandas as pd from pathlib import Path from cupy import fft import cupy as cp # from cusignal import firwin from scipy.signal import lfilter, firwin import numpy as np from json import dump from multiproces...
[ "json.dump", "numpy.save", "cupy.asarray", "pandas.read_csv", "cupy.abs", "scipy.signal.firwin", "cupy.sign", "pathlib.Path", "cupy.fft.fftfreq", "cupy.asnumpy", "multiprocessing.Queue", "cupy.fft.fft", "cupy.save", "multiprocessing.Process", "cupy.diff", "multiprocessing.cpu_count" ]
[((624, 641), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (635, 641), True, 'import pandas as pd\n'), ((687, 694), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (692, 694), False, 'from multiprocessing import Queue, Process, cpu_count\n'), ((710, 717), 'multiprocessing.Queue', 'Queue', ([], {}),...
import numpy as np import pytest from helpers import get_expected_if_it_exists from nanomesh.image2mesh._mesher3d import BoundingBox, volume2mesh def compare_mesh_results(mesh_container, expected_fn): """`result_mesh` is an instance of TetraMesh, and `expected_fn` the filename of the mesh to compare to.""" ...
[ "helpers.get_expected_if_it_exists", "nanomesh.image2mesh._mesher3d.BoundingBox", "nanomesh.image2mesh._mesher3d.volume2mesh", "nanomesh.image2mesh._mesher3d.BoundingBox.from_points", "numpy.array", "numpy.testing.assert_equal", "numpy.testing.assert_allclose", "nanomesh.image2mesh._mesher3d.BoundingB...
[((1242, 1424), 'pytest.mark.xfail', 'pytest.mark.xfail', (['pytest.OS_DOES_NOT_MATCH_DATA_GEN'], {'raises': 'AssertionError', 'reason': '"""No way of currently ensuring meshes on OSX / Linux / Windows are exactly the same."""'}), "(pytest.OS_DOES_NOT_MATCH_DATA_GEN, raises=AssertionError,\n reason=\n 'No way of ...
from pathlib import Path from PIL import Image from pycocotools.coco import COCO import os from torchvision import transforms import numpy as np from store.memory_hierarchy import StorageAttributes, StorageComponents from store.store import DataStore, Metadata, MetadataField class CocoDetection(DataStore): def _...
[ "numpy.save", "pycocotools.coco.COCO", "pathlib.Path", "numpy.array", "store.store.Metadata", "torchvision.transforms.RandomResizedCrop", "os.path.join" ]
[((885, 898), 'pycocotools.coco.COCO', 'COCO', (['annFile'], {}), '(annFile)\n', (889, 898), False, 'from pycocotools.coco import COCO\n'), ((4183, 4196), 'numpy.array', 'np.array', (['img'], {}), '(img)\n', (4191, 4196), True, 'import numpy as np\n'), ((5033, 5047), 'store.store.Metadata', 'Metadata', (['self'], {}), ...
# -*- coding: utf-8 -*- """Test utils for processing numeric literals""" import unittest import numpy as np from poem.instance_creation_factories.triples_numeric_literals_factory import TriplesNumericLiteralsFactory from poem.preprocessing.triples_preprocessing_utils.basic_triple_utils import create_entity_and_relati...
[ "poem.instance_creation_factories.triples_numeric_literals_factory.TriplesNumericLiteralsFactory", "numpy.array", "poem.preprocessing.triples_preprocessing_utils.basic_triple_utils.create_entity_and_relation_mappings" ]
[((472, 602), 'numpy.array', 'np.array', (["[['peter', 'likes', 'chocolate_cake'], ['chocolate_cake', 'isA', 'dish'], [\n 'susan', 'likes', 'pizza']]"], {'dtype': 'np.str'}), "([['peter', 'likes', 'chocolate_cake'], ['chocolate_cake', 'isA',\n 'dish'], ['susan', 'likes', 'pizza']], dtype=np.str)\n", (480, 602), T...
"""Probe a voxel dataset at specified points and plot a histogram of the values""" from vedo import * from vedo.pyplot import histogram import numpy as np vol = Volume(dataurl+'embryo.slc') pts = np.random.rand(5000, 3)*256 mpts = probePoints(vol, pts).pointSize(3) mpts.print() # valid = mpts.pointdata['vtkValidPoi...
[ "vedo.pyplot.histogram", "numpy.random.rand" ]
[((371, 431), 'vedo.pyplot.histogram', 'histogram', (['scals'], {'xtitle': '"""probed voxel value"""', 'xlim': '(5, 100)'}), "(scals, xtitle='probed voxel value', xlim=(5, 100))\n", (380, 431), False, 'from vedo.pyplot import histogram\n'), ((198, 221), 'numpy.random.rand', 'np.random.rand', (['(5000)', '(3)'], {}), '(...
import onnxruntime import numpy as np from pprint import pprint ### Batch N test BATCH=5 # ONNX onnx_session = onnxruntime.InferenceSession( 'model_float32_camera_Nx224x224.onnx', providers=[ 'CUDAExecutionProvider', ], ) # Inference input_name = onnx_session.get_inputs()[0].name results = onnx_ses...
[ "onnxruntime.InferenceSession", "numpy.ones", "pprint.pprint" ]
[((112, 220), 'onnxruntime.InferenceSession', 'onnxruntime.InferenceSession', (['"""model_float32_camera_Nx224x224.onnx"""'], {'providers': "['CUDAExecutionProvider']"}), "('model_float32_camera_Nx224x224.onnx',\n providers=['CUDAExecutionProvider'])\n", (140, 220), False, 'import onnxruntime\n'), ((432, 446), 'ppri...
import numpy as np import os import pickle from load_data import load_channels, load_angs, bin_data, bin_angs, load_states, bin_states binsize = 0.5 # resolution in seconds # from metadata; which channels recorded from ADn channeladn = {'28_140313': (8, 11)} # from metadata; which channels recorded from postsubiculu...
[ "load_data.load_angs", "numpy.sum", "load_data.bin_angs", "load_data.bin_data", "numpy.isnan", "load_data.load_states", "load_data.load_channels", "numpy.array", "load_data.bin_states" ]
[((733, 795), 'load_data.load_channels', 'load_channels', ([], {'mouse': 'mouse', 'session': 'session', 'channels': 'channels'}), '(mouse=mouse, session=session, channels=channels)\n', (746, 795), False, 'from load_data import load_channels, load_angs, bin_data, bin_angs, load_states, bin_states\n'), ((844, 883), 'load...
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% from IPython import get_ipython # %% [markdown] # <h2>Minerando Dados - Visualização de Dados</h2> # # **Trabalhando com Seaborn** # # * Biblioteca para Visualização de dados em Matplotlib; # * Interface de alto nível para grá...
[ "seaborn.lmplot", "seaborn.set", "seaborn.catplot", "seaborn.heatmap", "seaborn.load_dataset", "seaborn.swarmplot", "seaborn.distplot", "numpy.random.normal", "seaborn.jointplot", "IPython.get_ipython", "seaborn.pairplot", "seaborn.stripplot" ]
[((655, 679), 'seaborn.load_dataset', 'sns.load_dataset', (['"""tips"""'], {}), "('tips')\n", (671, 679), True, 'import seaborn as sns\n'), ((1110, 1171), 'seaborn.catplot', 'sns.catplot', ([], {'x': '"""sex"""', 'kind': '"""count"""', 'palette': '"""Set2"""', 'data': 'tips'}), "(x='sex', kind='count', palette='Set2', ...
# -*- coding: utf-8 -*- """Recommender_System.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1_yvJ9w2fZE6sxmTSjig7LhQhWl0HOG8p # Importing data and lemmatizing the data """ import numpy as np import pandas as pd import re import scipy import ma...
[ "google.colab.drive.CreateFile", "sklearn.model_selection.GridSearchCV", "pickle.dump", "pandas.read_csv", "sklearn.feature_extraction.text.TfidfVectorizer", "numpy.argsort", "pickle.load", "sklearn.decomposition.LatentDirichletAllocation", "numpy.linalg.norm", "numpy.random.randint", "pydrive.d...
[((525, 565), 'pandas.read_csv', 'pd.read_csv', (['path'], {'skip_blank_lines': '(True)'}), '(path, skip_blank_lines=True)\n', (536, 565), True, 'import pandas as pd\n'), ((566, 609), 'pandas.set_option', 'pd.set_option', (['"""display.max_colwidth"""', 'None'], {}), "('display.max_colwidth', None)\n", (579, 609), True...
import json from pathlib import Path import numpy as np from deepcave.runs import Status from deepcave.runs.converters.deepcave import DeepCAVERun from deepcave.runs.objective import Objective from deepcave.runs.run import Run from deepcave.utils.hash import file_to_hash class SMACRun(Run): prefix = "SMAC" ...
[ "deepcave.utils.hash.file_to_hash", "deepcave.runs.objective.Objective", "numpy.round", "json.load" ]
[((657, 700), 'deepcave.utils.hash.file_to_hash', 'file_to_hash', (["(self.path / 'runhistory.json')"], {}), "(self.path / 'runhistory.json')\n", (669, 700), False, 'from deepcave.utils.hash import file_to_hash\n'), ((1270, 1296), 'deepcave.runs.objective.Objective', 'Objective', (['"""Cost"""'], {'lower': '(0)'}), "('...
"""Single element 2-, 3-, and 2+3-body kernels. The kernel functions to choose: * Two body: * two_body: force kernel * two_body_en: energy kernel * two_body_grad: gradient of kernel function * two_body_force_en: energy force kernel * Three body: * three_body, * three_body_grad, * three_b...
[ "math.exp", "flare.kernels.kernels.three_body_en_helper", "flare.kernels.kernels.three_body_grad_helper_2", "flare.kernels.kernels.force_helper", "flare.kernels.kernels.force_energy_helper", "numpy.zeros", "numpy.array", "flare.kernels.kernels.grad_helper", "flare.kernels.kernels.three_body_helper_1...
[((16441, 16470), 'numpy.array', 'np.array', (['[sig_derv, ls_derv]'], {}), '([sig_derv, ls_derv])\n', (16449, 16470), True, 'import numpy as np\n'), ((21044, 21073), 'numpy.array', 'np.array', (['[sig_derv, ls_derv]'], {}), '([sig_derv, ls_derv])\n', (21052, 21073), True, 'import numpy as np\n'), ((26356, 26385), 'num...
import numpy as np from numpy import allclose from hypothesis import given from hypothesis.strategies import integers, composite, lists from hypothesis.extra.numpy import arrays from fancy_einsum import einsum def tensor(draw, shape): return draw(arrays(dtype=int, shape=shape)) @composite def square_matrix(draw)...
[ "fancy_einsum.einsum", "hypothesis.strategies.integers", "numpy.einsum", "hypothesis.extra.numpy.arrays" ]
[((452, 483), 'fancy_einsum.einsum', 'einsum', (['"""length length ->"""', 'mat'], {}), "('length length ->', mat)\n", (458, 483), False, 'from fancy_einsum import einsum\n'), ((848, 906), 'fancy_einsum.einsum', 'einsum', (['"""...rows temp, ...temp cols -> ...rows cols"""', 'a', 'b'], {}), "('...rows temp, ...temp col...
from collections import defaultdict import numpy as np import pandas as pd from easydict import EasyDict as edict import shapely.affinity from shapely import wkt import networkx as nx import aa.road_networks.wkt_to_graph def get_bigmap_chip_locations(aoi_name, fn_sub, df, aoi_data_path_mapping): cols = [ ...
[ "pandas.DataFrame", "pandas.read_csv", "collections.defaultdict", "numpy.mean", "easydict.EasyDict", "networkx.connected_component_subgraphs", "numpy.round", "pandas.concat", "numpy.sqrt" ]
[((5476, 5509), 'pandas.DataFrame', 'pd.DataFrame', (['connected_component'], {}), '(connected_component)\n', (5488, 5509), True, 'import pandas as pd\n'), ((7646, 7664), 'pandas.DataFrame', 'pd.DataFrame', (['rows'], {}), '(rows)\n', (7658, 7664), True, 'import pandas as pd\n'), ((11425, 11459), 'pandas.concat', 'pd.c...
""" basic functions needed to train and test deep learning models with PyTorch """ import torch import numpy as np import sys def make_fake_side_info(voice_spectro_tensor): voice_energy = torch.sum(voice_spectro_tensor, dim=2, keepdim=True) fake_side_info = torch.ones_like(voice_energy) return fake_side...
[ "torch.ones_like", "numpy.set_printoptions", "numpy.argmax", "numpy.asarray", "numpy.zeros", "torch.sum" ]
[((194, 246), 'torch.sum', 'torch.sum', (['voice_spectro_tensor'], {'dim': '(2)', 'keepdim': '(True)'}), '(voice_spectro_tensor, dim=2, keepdim=True)\n', (203, 246), False, 'import torch\n'), ((269, 298), 'torch.ones_like', 'torch.ones_like', (['voice_energy'], {}), '(voice_energy)\n', (284, 298), False, 'import torch\...
# -------------- import numpy as np data=np.genfromtxt(path,delimiter=",", skip_header=1) new_record=[[50,9,4,1,0,0,40,0]] census=np.concatenate([data,new_record],axis=0) # -------------- import numpy as np age=np.array(census[0:,0]) max_age=np.max(age) min_age=np.min(age) age_mean=age.mean() age_std=np.std(a...
[ "numpy.std", "numpy.genfromtxt", "numpy.max", "numpy.min", "numpy.array", "numpy.array_equal", "numpy.concatenate" ]
[((42, 91), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (55, 91), True, 'import numpy as np\n'), ((133, 175), 'numpy.concatenate', 'np.concatenate', (['[data, new_record]'], {'axis': '(0)'}), '([data, new_record], axis=0)\n',...
from abc import ABC, abstractmethod from collections import defaultdict import numpy as np import torch from utils.additional import storage_saver class GAE: """ Generalized Advantage Estimator. See [Schulman et al., 2016](https://arxiv.org/abs/1506.02438) """ def __init__(self, policy, gamma=0.99,...
[ "numpy.zeros_like", "utils.additional.storage_saver.set_architecture", "numpy.concatenate", "numpy.asarray", "torch.zeros", "collections.defaultdict", "numpy.reshape", "numpy.random.permutation", "numpy.squeeze", "numpy.all" ]
[((1759, 1798), 'numpy.zeros_like', 'np.zeros_like', (['values'], {'dtype': 'np.float32'}), '(values, dtype=np.float32)\n', (1772, 1798), True, 'import numpy as np\n'), ((5407, 5451), 'utils.additional.storage_saver.set_architecture', 'storage_saver.set_architecture', (['architecture'], {}), '(architecture)\n', (5437, ...
# -*- coding=utf-8 -*- import numpy as np import random import gzip import pickle def sigmoid(z): """The sigmoid function.""" return 1.0/(1.0+np.exp(-z)) def sigmoid_prime(z): """Derivative of the sigmoid function.""" return sigmoid(z)*(1-sigmoid(z)) def vectorized_result(j): """Return a 10-di...
[ "gzip.open", "numpy.random.randn", "random.shuffle", "numpy.zeros", "pickle.load", "numpy.exp", "numpy.reshape", "numpy.dot" ]
[((520, 537), 'numpy.zeros', 'np.zeros', (['(10, 1)'], {}), '((10, 1))\n', (528, 537), True, 'import numpy as np\n'), ((5145, 5217), 'gzip.open', 'gzip.open', (['"""./neural-networks-and-deep-learning/data/mnist.pkl.gz"""', '"""rb"""'], {}), "('./neural-networks-and-deep-learning/data/mnist.pkl.gz', 'rb')\n", (5154, 52...
""" Problem 81 ========== """ import numpy as np def load_matrix(filename): file = open(filename, 'r') matrix = [] for line in file: int_line = [int(x) for x in line.split(',')] matrix.append(int_line) file.close() return matrix def minimal_path(M): n = len(M) P = np.inf...
[ "numpy.ones" ]
[((323, 352), 'numpy.ones', 'np.ones', (['(n, n)'], {'dtype': 'np.int'}), '((n, n), dtype=np.int)\n', (330, 352), True, 'import numpy as np\n')]
import os import numpy import keras import sklearn import preprocessing import plotting_utils class EvaluateModel: model_path = 'trained_model' model = '' def __init__( self, ): self.preprocessor = preprocessing.preprocessing.Preprocessing() def run( self, dataset...
[ "plotting_utils.plot_roc_curve.RocCurvePlotter", "sklearn.metrics.roc_auc_score", "preprocessing.preprocessing.Preprocessing", "keras.models.model_from_json", "numpy.mean", "os.path.join" ]
[((233, 276), 'preprocessing.preprocessing.Preprocessing', 'preprocessing.preprocessing.Preprocessing', ([], {}), '()\n', (274, 276), False, 'import preprocessing\n'), ((822, 869), 'plotting_utils.plot_roc_curve.RocCurvePlotter', 'plotting_utils.plot_roc_curve.RocCurvePlotter', ([], {}), '()\n', (867, 869), False, 'imp...
""" This module provides a series of tools that will be used for the study of the Scanning Strategy of the LSPE/STRIP experiment. """ import healpy as hp import numpy as np from astropy import units as u import time as timing from astropy.coordinates import SkyCoord, EarthLocation, AltAz, ICRS from astropy.time impor...
[ "numpy.arctan2", "numpy.abs", "numpy.sum", "healpy.vec2ang", "numpy.floor", "numpy.around", "numpy.sin", "numpy.full_like", "numpy.degrees", "time.clock", "numpy.append", "numpy.int", "numpy.loadtxt", "numpy.linspace", "numpy.rollaxis", "numpy.radians", "healpy.ang2vec", "astropy.t...
[((427, 449), 'numpy.array', 'np.array', (['[28, 16, 24]'], {}), '([28, 16, 24])\n', (435, 449), True, 'import numpy as np\n'), ((462, 485), 'numpy.array', 'np.array', (['[-16, 38, 32]'], {}), '([-16, 38, 32])\n', (470, 485), True, 'import numpy as np\n'), ((1701, 1771), 'numpy.around', 'np.around', (['((((years * 365 ...
# -*- coding: utf-8 -*- import cv2 from keras.models import load_model import matplotlib.pyplot as plt import numpy as np import os from urllib.request import urlopen import sys ### required - do no delete #def user(): return dict(form=auth()) #def download(): return response.download(request,db) #def call(): return se...
[ "keras.models.load_model", "cv2.Canny", "numpy.amin", "cv2.cvtColor", "cv2.imdecode", "urllib.request.urlopen", "numpy.amax", "cv2.imread", "cv2.rectangle", "numpy.array", "cv2.MSER_create", "os.path.join", "cv2.resize" ]
[((2111, 2133), 'numpy.array', 'np.array', (['digit_resize'], {}), '(digit_resize)\n', (2119, 2133), True, 'import numpy as np\n'), ((2152, 2210), 'os.path.join', 'os.path.join', (['request.folder', '"""private"""', '"""number_model.h5"""'], {}), "(request.folder, 'private', 'number_model.h5')\n", (2164, 2210), False, ...
import numpy as np import csv import argparse def H(x): '''The Gaussian Hamiltonian x^2 used in this problem''' return x ** 2 def delta_H(x_old, x_new): '''The difference in Hamiltonian''' return H(x_new) - H(x_old) def uniform_step(x, h): '''Returns a new x in the interval of width 2h around the...
[ "csv.writer", "numpy.random.uniform", "numpy.random.random", "argparse.ArgumentParser" ]
[((1132, 1198), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Runs Metropolis Monte Carlo"""'}), "(description='Runs Metropolis Monte Carlo')\n", (1155, 1198), False, 'import argparse\n'), ((922, 935), 'csv.writer', 'csv.writer', (['f'], {}), '(f)\n', (932, 935), False, 'import csv\n'),...
from __future__ import absolute_import, division, print_function import os.path import torch import torch.utils.data as data import numpy as np from torchvision import transforms as vision_transforms from .common import read_image_as_byte, read_calib_into_dict from .common import kitti_crop_image_list, kitti_adjust_i...
[ "numpy.random.uniform", "torchvision.transforms.ToPILImage", "torchvision.transforms.transforms.ToTensor", "numpy.array", "torchvision.transforms.Resize", "torch.from_numpy" ]
[((4459, 4504), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(w_orig - crop_width + 1)'], {}), '(0, w_orig - crop_width + 1)\n', (4476, 4504), True, 'import numpy as np\n'), ((4521, 4567), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(h_orig - crop_height + 1)'], {}), '(0, h_orig - crop_height + 1)\...
import numpy as np import tensorflow as tf def normalization( input_t, data_or_datalist, name='normalization', err_on_inv_feats=True): if isinstance(data_or_datalist, np.ndarray): datalist = [data_or_datalist] else: datalist = data_or_datalist for data in datalist: assert d...
[ "tensorflow.summary.scalar", "numpy.std", "tensorflow.reduce_mean", "numpy.all", "tensorflow.constant", "numpy.any", "numpy.mean", "numpy.where", "tensorflow.square", "tensorflow.name_scope", "numpy.concatenate" ]
[((401, 433), 'numpy.concatenate', 'np.concatenate', (['datalist'], {'axis': '(0)'}), '(datalist, axis=0)\n', (415, 433), True, 'import numpy as np\n'), ((443, 479), 'numpy.mean', 'np.mean', (['data'], {'axis': '(0)', 'keepdims': '(True)'}), '(data, axis=0, keepdims=True)\n', (450, 479), True, 'import numpy as np\n'), ...
import itertools, sys import numpy as np from tf_rl.env.continuous_gridworld.env import GridWorld dense_goals = [(13.0, 8.0), (18.0, 11.0), (20.0, 15.0), (22.0, 19.0)] env = GridWorld(max_episode_len=500, num_rooms=1, action_limit_max=1.0, silent_mode=True, start_position=(8.0, 8.0), goal_position=(22....
[ "numpy.array", "tf_rl.env.continuous_gridworld.env.GridWorld", "sys.stdout.flush", "itertools.count" ]
[((175, 440), 'tf_rl.env.continuous_gridworld.env.GridWorld', 'GridWorld', ([], {'max_episode_len': '(500)', 'num_rooms': '(1)', 'action_limit_max': '(1.0)', 'silent_mode': '(True)', 'start_position': '(8.0, 8.0)', 'goal_position': '(22.0, 22.0)', 'goal_reward': '(+100.0)', 'dense_goals': 'dense_goals', 'dense_reward':...
import sys import os import time import numpy as np import pyzed.sl as sl import cv2 def main(): path = ["./svo/down/", "./svo/up/", "./svo/obstacle/", "./svo/flatten/", "./svo/test_down/", "./svo/test_up/", "./svo/test_obstacle/", "./svo/test_flatten/", "./svo/test_purity/"] # path ...
[ "numpy.uint8", "numpy.nan_to_num", "pyzed.sl.RuntimeParameters", "pyzed.sl.Camera", "cv2.cvtColor", "cv2.waitKey", "time.time", "pyzed.sl.InputType", "pyzed.sl.InitParameters", "pyzed.sl.Mat", "cv2.destroyAllWindows", "os.listdir" ]
[((467, 487), 'os.listdir', 'os.listdir', (['filepath'], {}), '(filepath)\n', (477, 487), False, 'import os\n'), ((3587, 3644), 'numpy.nan_to_num', 'np.nan_to_num', (['depth_list'], {'posinf': 'max_dis', 'neginf': 'min_dis'}), '(depth_list, posinf=max_dis, neginf=min_dis)\n', (3600, 3644), True, 'import numpy as np\n')...
# -*- coding: utf-8 -*- ''' Copyright ⓒ 2018 TEAM YOLO Video System Capstone Design Description : Auto CNN train face data set maker ''' import cv2 # OpenCV 라이브러리 #import copy # 깊은 복사하기 위한 라이브러리 (컬러 이미지 저장할 경우) from itertools import chain # 이미지 데이터를 string으로 변환하기 위한 라이...
[ "cv2.cvtColor", "cv2.waitKey", "cv2.imshow", "numpy.zeros", "numpy.hstack", "cv2.VideoCapture", "cv2.rectangle", "cv2.CascadeClassifier", "cv2.createCLAHE", "cv2.destroyAllWindows", "itertools.chain.from_iterable", "cv2.resize" ]
[((762, 799), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['CASC_FACE_PATH'], {}), '(CASC_FACE_PATH)\n', (783, 799), False, 'import cv2\n'), ((848, 884), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['CASC_EYE_PATH'], {}), '(CASC_EYE_PATH)\n', (869, 884), False, 'import cv2\n'), ((1349, 1368), 'cv2.VideoCa...
import os import cv2 import numpy as np from scipy.spatial.distance import dice import torch import torch.nn.functional as F import torch.nn as nn # torch.backends.cudnn.benchmark = True import tqdm from dataset.neural_dataset import ValDataset, SequentialDataset from torch.utils.data.dataloader import DataLoader as ...
[ "numpy.moveaxis", "torch.stack", "cv2.waitKey", "cv2.cvtColor", "cv2.imshow", "cv2.addWeighted", "numpy.any", "numpy.mean", "torch.nn.functional.sigmoid", "torch.utils.data.dataloader.DataLoader", "utils.heatmap", "os.path.join", "cv2.resize" ]
[((2437, 2460), 'utils.heatmap', 'heatmap', (['self.full_pred'], {}), '(self.full_pred)\n', (2444, 2460), False, 'from utils import heatmap\n'), ((1316, 1337), 'torch.stack', 'torch.stack', (['masks', '(0)'], {}), '(masks, 0)\n', (1327, 1337), False, 'import torch\n'), ((2541, 2602), 'cv2.addWeighted', 'cv2.addWeighted...
""" voter.py -------- Implementation of voter model dynamics on a network. author: <NAME> Submitted as part of the 2019 NetSI Collabathon. """ from netrd.dynamics import BaseDynamics import numpy as np import networkx as nx from ..utilities import unweighted class VoterModel(BaseDynamics): """Voter dynamics....
[ "numpy.sum", "numpy.random.rand", "numpy.zeros", "numpy.arange", "numpy.random.choice", "networkx.to_numpy_array", "numpy.random.shuffle" ]
[((1687, 1707), 'networkx.to_numpy_array', 'nx.to_numpy_array', (['G'], {}), '(G)\n', (1704, 1707), True, 'import networkx as nx\n'), ((1786, 1802), 'numpy.zeros', 'np.zeros', (['(N, L)'], {}), '((N, L))\n', (1794, 1802), True, 'import numpy as np\n'), ((1890, 1902), 'numpy.arange', 'np.arange', (['N'], {}), '(N)\n', (...
# Given a matrix of 'raw' double mutant score diffs as from 'characterize_by_mutagenesis.py', # get a matrix reducing the 16 values from each pair of bases tested to 1. # Reduction approach: assume that for independent bases, score of double mutant = sum of single mutants. # approach 0: # get (double mut - sum(single m...
[ "sys.path.append", "numpy.sum", "numpy.corrcoef", "numpy.savetxt", "numpy.zeros", "model_trainer.one_hot_encode", "numpy.max", "numpy.where", "numpy.loadtxt", "numpy.cov", "numpy.delete" ]
[((642, 674), 'sys.path.append', 'sys.path.append', (['"""../seq_design"""'], {}), "('../seq_design')\n", (657, 674), False, 'import sys\n'), ((696, 724), 'sys.path.append', 'sys.path.append', (['"""../models"""'], {}), "('../models')\n", (711, 724), False, 'import sys\n'), ((957, 983), 'numpy.max', 'np.max', (['(grid_...
from __future__ import absolute_import from builtins import object import logging import numpy as np import threading import six.moves.queue as queue from relaax.common import profiling from relaax.server.common import session from relaax.common.algorithms.lib import utils from relaax.common.algorithms.lib import obs...
[ "relaax.common.algorithms.lib.utils.discount", "threading.Thread", "relaax.server.common.session.Session", "numpy.tanh", "relaax.common.algorithms.lib.utils.choose_action_continuous", "numpy.asarray", "relaax.common.algorithms.lib.observation.Observation", "relaax.common.algorithms.lib.utils.choose_ac...
[((445, 472), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (462, 472), False, 'import logging\n'), ((484, 516), 'relaax.common.profiling.get_profiler', 'profiling.get_profiler', (['__name__'], {}), '(__name__)\n', (506, 516), False, 'from relaax.common import profiling\n'), ((1601, 1623...
from cpyMSpec import isotopePattern, InstrumentModel from pyMSpec.pyisocalc import pyisocalc import numpy as np import logging from collections import namedtuple logger = logging.getLogger('engine') ISOTOPIC_PEAK_N = 4 SIGMA_TO_FWHM = 2.3548200450309493 # 2 \sqrt{2 \log 2} class IsocalcWrapper(object): """ Wr...
[ "cpyMSpec.InstrumentModel", "numpy.argsort", "numpy.array", "pyMSpec.pyisocalc.pyisocalc.parseSumFormula", "logging.getLogger" ]
[((173, 200), 'logging.getLogger', 'logging.getLogger', (['"""engine"""'], {}), "('engine')\n", (190, 200), False, 'import logging\n'), ((1221, 1236), 'numpy.argsort', 'np.argsort', (['mzs'], {}), '(mzs)\n', (1231, 1236), True, 'import numpy as np\n'), ((1111, 1127), 'numpy.argsort', 'np.argsort', (['ints'], {}), '(int...
from matplotlib import cm from tqdm import tqdm from skimage.filters import threshold_otsu from keras.models import load_model import numpy as np import pandas as pd import matplotlib.pyplot as plt import os.path as osp import openslide from pathlib import Path from skimage.filters import threshold_otsu import glob imp...
[ "pandas.DataFrame", "skimage.filters.threshold_otsu", "os.path.basename", "cv2.cvtColor", "openslide.open_slide", "cv2.inRange", "pathlib.Path", "cv2.split", "numpy.array", "numpy.min", "numpy.max", "pandas.Series", "cv2.boundingRect", "os.path.join", "cv2.findContours" ]
[((622, 666), 'pathlib.Path', 'Path', (['"""/home/wli/Downloads/camelyontestonly"""'], {}), "('/home/wli/Downloads/camelyontestonly')\n", (626, 666), False, 'from pathlib import Path\n'), ((1818, 1847), 'os.path.join', 'osp.join', (['slide_path', '"""*.tif"""'], {}), "(slide_path, '*.tif')\n", (1826, 1847), True, 'impo...
""" A collection of different norms that work on finite-dimensional collections of numbers """ from numpy import array from math import sqrt def l1(x_in): x = array(x_in).flatten() return sum(abs(x)) def l2(x_in): x = array(x_in).flatten() return sqrt(sum(x**2)) def sup(x_in): x = array(x_in).fl...
[ "numpy.array" ]
[((165, 176), 'numpy.array', 'array', (['x_in'], {}), '(x_in)\n', (170, 176), False, 'from numpy import array\n'), ((233, 244), 'numpy.array', 'array', (['x_in'], {}), '(x_in)\n', (238, 244), False, 'from numpy import array\n'), ((306, 317), 'numpy.array', 'array', (['x_in'], {}), '(x_in)\n', (311, 317), False, 'from n...
def addAtoms(input_dat, restart_dat, coords, mol_num, charge): for xyz in coords: restart_dat['mol types'].append( mol_num ) restart_dat['box types'].append( '1' ) # always box 1 restart_dat['coords'].append( [ {'xyz': '%f %f %f\n'%(xyz[0],xyz[1],xyz[2]), 'q'...
[ "copy.deepcopy", "argparse.ArgumentParser", "MCFlow.file_formatting.reader.PDB", "os.getcwd", "MCFlow.file_formatting.writer.write_fort4", "MCFlow.file_formatting.reader.read_restart", "MCFlow.file_formatting.reader.read_fort4", "MCFlow.file_formatting.writer.write_restart", "numpy.cos", "numpy.si...
[((2368, 2432), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""add explicit to unit cell"""'}), "(description='add explicit to unit cell')\n", (2391, 2432), False, 'import argparse, os\n'), ((2760, 2784), 'MCFlow.file_formatting.reader.PDB', 'reader.PDB', (["args['file']"], {}), "(args['...
import numpy as np from sklearn.ensemble import BaggingClassifier from brew.base import Ensemble from brew.combination.combiner import Combiner import sklearn from .base import PoolGenerator class Bagging(PoolGenerator): def __init__(self, base_classifier=None, n_classifiers=1...
[ "sklearn.ensemble.BaggingClassifier", "brew.combination.combiner.Combiner", "brew.base.Ensemble", "numpy.random.choice", "sklearn.base.clone" ]
[((520, 551), 'brew.combination.combiner.Combiner', 'Combiner', ([], {'rule': 'combination_rule'}), '(rule=combination_rule)\n', (528, 551), False, 'from brew.combination.combiner import Combiner\n'), ((602, 612), 'brew.base.Ensemble', 'Ensemble', ([], {}), '()\n', (610, 612), False, 'from brew.base import Ensemble\n')...
from LMmodel.tf2_trm import Transformer import logging import numpy as np from utils.text_featurizers import TextFeaturizer import os logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') class LM(): def __init__(self,config): self.config=config ...
[ "logging.basicConfig", "numpy.ones", "LMmodel.tf2_trm.Transformer", "tensorflow.saved_model.save", "utils.text_featurizers.TextFeaturizer", "numpy.array", "logging.info", "os.path.join", "os.listdir" ]
[((139, 247), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n", (158, 247), False, 'import logging\n'), ((349, 383), 'util...
# Fraud detection models # Call the functions with data, parameters and the hitlist. # The hitlist will be returned, extended with results of the model import numpy as np import numpy.random as rn import pandas as pd import matplotlib.pyplot as plt import datetime as dt import pickle, os, time, sys, itertools, string...
[ "numpy.random.seed", "pandas.pivot_table", "sklearn.preprocessing.StandardScaler", "numpy.sum", "numpy.abs", "numpy.floor", "numpy.argmin", "numpy.mean", "sklearn.cluster.DBSCAN", "numpy.unique", "pandas.DataFrame", "numpy.std", "pandas.merge", "pandas.concat", "numpy.median", "datetim...
[((322, 333), 'numpy.random.seed', 'rn.seed', (['(42)'], {}), '(42)\n', (329, 333), True, 'import numpy.random as rn\n'), ((2386, 2410), 'numpy.unique', 'np.unique', (['data.refgroup'], {}), '(data.refgroup)\n', (2395, 2410), True, 'import numpy as np\n'), ((5655, 5761), 'pandas.pivot_table', 'pd.pivot_table', (['data'...
import numpy as np import base ##TODOs: implement ver.1 straightness function, bootstraping def straightness_moment_time(trial_trajectory, before_time=3): def _straight_line(start, end, length): _x = np.linspace(start[0], end[0], length) _y = np.linspace(start[1], end[1], length) retur...
[ "numpy.flip", "numpy.sum", "numpy.cumsum", "numpy.where", "numpy.array", "numpy.linspace", "numpy.vstack" ]
[((217, 254), 'numpy.linspace', 'np.linspace', (['start[0]', 'end[0]', 'length'], {}), '(start[0], end[0], length)\n', (228, 254), True, 'import numpy as np\n'), ((268, 305), 'numpy.linspace', 'np.linspace', (['start[1]', 'end[1]', 'length'], {}), '(start[1], end[1], length)\n', (279, 305), True, 'import numpy as np\n'...
""" reference: https://github.com/pierluigiferrari/ssd_keras/blob/master/keras_layers/keras_layer_AnchorBoxes.py """ import tensorflow as tf import numpy as np from .bounding_box_utils import convert_coordinates from keras import backend as K def AnchorBoxes(x, img_height, i...
[ "numpy.meshgrid", "numpy.zeros_like", "numpy.zeros", "numpy.expand_dims", "tensorflow.constant", "numpy.any", "numpy.array", "numpy.tile", "numpy.linspace", "numpy.concatenate", "numpy.sqrt" ]
[((3001, 3020), 'numpy.array', 'np.array', (['variances'], {}), '(variances)\n', (3009, 3020), True, 'import numpy as np\n'), ((3029, 3051), 'numpy.any', 'np.any', (['(variances <= 0)'], {}), '(variances <= 0)\n', (3035, 3051), True, 'import numpy as np\n'), ((4285, 4302), 'numpy.array', 'np.array', (['wh_list'], {}), ...
import math import operator import cv2 import numpy as np import dito.core import dito.visual ## ## basic processing ## def gaussian_blur(image, sigma): if sigma <= 0.0: return image return cv2.GaussianBlur(src=image, ksize=None, sigmaX=sigma) def median_blur(image, kernel_size): return cv2....
[ "cv2.GaussianBlur", "numpy.sum", "numpy.abs", "cv2.medianBlur", "cv2.arcLength", "numpy.mean", "numpy.round", "cv2.contourArea", "operator.methodcaller", "numpy.max", "cv2.fitEllipse", "cv2.Subdiv2D", "math.sqrt", "cv2.morphologyEx", "numpy.min", "cv2.getStructuringElement", "cv2.thr...
[((212, 265), 'cv2.GaussianBlur', 'cv2.GaussianBlur', ([], {'src': 'image', 'ksize': 'None', 'sigmaX': 'sigma'}), '(src=image, ksize=None, sigmaX=sigma)\n', (228, 265), False, 'import cv2\n'), ((316, 360), 'cv2.medianBlur', 'cv2.medianBlur', ([], {'src': 'image', 'ksize': 'kernel_size'}), '(src=image, ksize=kernel_size...
# -*- coding: utf-8 -*- import sys import rospy import math import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D,art3d from sensor_msgs.msg import PointCloud2, LaserScan, NavSatFix from sensor_msgs import point_cloud2 from helper.utils import * from helper.ambiente import Pontos ...
[ "rospy.Subscriber", "matplotlib.pyplot.axes", "haversine.haversine", "numpy.clip", "numpy.sin", "statistics.variance", "helper.ambiente.Pontos", "sensor_msgs.point_cloud2.read_points", "math.radians", "numpy.insert", "rospy.init_node", "numpy.linspace", "matplotlib.pyplot.pause", "datetime...
[((45755, 45784), 'rospy.init_node', 'rospy.init_node', (['"""Planejador"""'], {}), "('Planejador')\n", (45770, 45784), False, 'import rospy\n'), ((2540, 2548), 'helper.ambiente.Pontos', 'Pontos', ([], {}), '()\n', (2546, 2548), False, 'from helper.ambiente import Pontos\n'), ((6062, 6136), 'rospy.Subscriber', 'rospy.S...
import numpy as np from deepscratch.models.layers.activations.activation import Activation class Relu(Activation): # https://github.com/eriklindernoren/ML-From-Scratch/blob/master/mlfromscratch/deep_learning/activation_functions.py def __call__(self, data): return np.where(data >= 0, data, 0) ...
[ "numpy.where", "numpy.exp" ]
[((283, 311), 'numpy.where', 'np.where', (['(data >= 0)', 'data', '(0)'], {}), '(data >= 0, data, 0)\n', (291, 311), True, 'import numpy as np\n'), ((359, 384), 'numpy.where', 'np.where', (['(data >= 0)', '(1)', '(0)'], {}), '(data >= 0, 1, 0)\n', (367, 384), True, 'import numpy as np\n'), ((635, 679), 'numpy.where', '...
from __future__ import division, print_function, absolute_import import numpy as np import matplotlib.pyplot as plt import streamlit as st import pandas as pd import seaborn as sns import random from sklearn.model_selection import RepeatedKFold, train_test_split, cross_val_score, StratifiedKFold, RepeatedStratifiedKFo...
[ "pandas.DataFrame", "utils.reporter.report_steps", "streamlit.error", "sklearn.metrics.roc_curve", "models.model_prep.select_features", "models.model_prep.normalize_features", "numpy.std", "sklearn.model_selection.RepeatedStratifiedKFold", "numpy.zeros", "models.model_prep.Model", "streamlit.wri...
[((790, 847), 'models.model_prep.select_features', 'model_prep.select_features', (['method', 'df_data', 'tracts', 'hemi'], {}), '(method, df_data, tracts, hemi)\n', (816, 847), False, 'from models import PCA, autoencoder, model_prep\n'), ((1979, 2047), 'sklearn.model_selection.RepeatedStratifiedKFold', 'RepeatedStratif...
import numpy as np # Shared AGE_RANGES = np.arange(0, 100, 5) # For scalars TREE_SCALARS = { "Arterial": { "All": ["Scalars"], "BloodPressure": ["Scalars"], "Carotids": ["Scalars"], "PWA": ["Scalars"], }, "Biochemistry": {"All": ["Scalars"], "Blood": ["Scalars"], "Urine": [...
[ "numpy.arange" ]
[((42, 62), 'numpy.arange', 'np.arange', (['(0)', '(100)', '(5)'], {}), '(0, 100, 5)\n', (51, 62), True, 'import numpy as np\n')]
''' invsolve/project.py ''' import dolfin import logging import numpy as np import scipy.linalg as linalg from scipy.spatial import cKDTree try: import wlsqm # optimized meshless except: # logging.log(logging.WARNING, repr(ModuleNotFoundError)) HAS_WLSQM = False else: HAS_WLSQM = True MESHLESS_NEIGH...
[ "numpy.stack", "numpy.full", "scipy.linalg.solve", "numpy.ones_like", "numpy.empty", "numpy.allclose", "numpy.zeros", "numpy.ones", "dolfin.Function", "numpy.split", "numpy.isnan", "wlsqm.fit_2D_many_parallel", "numpy.any", "numpy.where", "numpy.array", "scipy.spatial.cKDTree", "wlsq...
[((7952, 7980), 'numpy.split', 'np.split', (['fi', 'len_fk'], {'axis': '(1)'}), '(fi, len_fk, axis=1)\n', (7960, 7980), True, 'import numpy as np\n'), ((7653, 7673), 'numpy.stack', 'np.stack', (['fk'], {'axis': '(1)'}), '(fk, axis=1)\n', (7661, 7673), True, 'import numpy as np\n'), ((7716, 7742), 'numpy.concatenate', '...
import numpy as np import scipy.stats import sklearn def iqr(value: np.ndarray): return np.percentile(value, 75) - np.percentile(value, 25) def cv(value_array: np.ndarray, min_quant_value_num=3, std_ddof=1, make_percentage=True, keep_na=False, decimal_place=None, return_iqr=False): """ :param value_arra...
[ "numpy.argmax", "numpy.nanstd", "numpy.zeros", "numpy.isnan", "numpy.percentile", "numpy.sort", "numpy.max", "numpy.where", "numpy.nanmean" ]
[((2052, 2067), 'numpy.sort', 'np.sort', (['values'], {}), '(values)\n', (2059, 2067), True, 'import numpy as np\n'), ((2238, 2251), 'numpy.max', 'np.max', (['kde_y'], {}), '(kde_y)\n', (2244, 2251), True, 'import numpy as np\n'), ((2269, 2285), 'numpy.argmax', 'np.argmax', (['kde_y'], {}), '(kde_y)\n', (2278, 2285), T...
import pytest import fv3gfs.util import numpy as np from fv3gfs.util._boundary_utils import _shift_boundary_slice, get_boundary_slice def boundary_data(quantity, boundary_type, n_points, interior=True): boundary_slice = get_boundary_slice( quantity.dims, quantity.origin, quantity.extent, ...
[ "fv3gfs.util._boundary_utils.get_boundary_slice", "numpy.random.randn", "fv3gfs.util._boundary_utils._shift_boundary_slice" ]
[((226, 353), 'fv3gfs.util._boundary_utils.get_boundary_slice', 'get_boundary_slice', (['quantity.dims', 'quantity.origin', 'quantity.extent', 'quantity.data.shape', 'boundary_type', 'n_points', 'interior'], {}), '(quantity.dims, quantity.origin, quantity.extent,\n quantity.data.shape, boundary_type, n_points, inter...
#!/usr/bin/env python3 """ A simple test script for the shrinking module. Syntax: ./test.py m n Each run creates an invalid correlation matrix of order m+n, and then calls all five shrinking algorithms and times them. Finally, it draws a plot showing how the minimal eigenvalue of `S(alpha)` changes as `alpha` goes f...
[ "matplotlib.pyplot.suptitle", "shrinking.GEPFB", "shrinking.checkPD", "numpy.random.randn", "shrinking.GEP", "shrinking.bisectionFB", "numpy.identity", "numpy.bmat", "shrinking.bisection", "numpy.linspace", "matplotlib.pyplot.axhline", "numpy.fill_diagonal", "matplotlib.pyplot.show", "shri...
[((1071, 1094), 'numpy.random.randn', 'np.random.randn', (['n', 'dof'], {}), '(n, dof)\n', (1086, 1094), True, 'import numpy as np\n'), ((1193, 1215), 'numpy.fill_diagonal', 'np.fill_diagonal', (['M', '(1)'], {}), '(M, 1)\n', (1209, 1215), True, 'import numpy as np\n'), ((1956, 1962), 'time.time', 'time', ([], {}), '()...
import numpy import IPython class S2N(): def __init__(self):#This class can only be inherited from pass def imageRegions(image,sig,sigfloor=0.5): image[image/sig<significancefloor]=0 masks, multiplicity = ndimage.measurements.label(image) labels=numpy.arange(1, multiplicity+1) ...
[ "numpy.sum", "numpy.random.randn", "scipy.ndimage.measurements.label", "numpy.zeros", "numpy.argsort", "numpy.cumsum", "numpy.sort", "numpy.take", "numpy.arange", "numpy.exp", "RingFinder.RingFinder" ]
[((238, 271), 'scipy.ndimage.measurements.label', 'ndimage.measurements.label', (['image'], {}), '(image)\n', (264, 271), True, 'import scipy.ndimage as ndimage\n'), ((287, 320), 'numpy.arange', 'numpy.arange', (['(1)', '(multiplicity + 1)'], {}), '(1, multiplicity + 1)\n', (299, 320), False, 'import numpy\n'), ((449, ...
import argparse import json from collections import OrderedDict as odict from pathlib import Path import h5py import numpy as np def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "--dataroot", type=str, default="data", help="change datasets root path") ...
[ "h5py.File", "json.load", "argparse.ArgumentParser", "numpy.ceil", "numpy.floor", "pathlib.Path", "collections.OrderedDict" ]
[((157, 201), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (180, 201), False, 'import argparse\n'), ((904, 933), 'h5py.File', 'h5py.File', (['features_file', '"""r"""'], {}), "(features_file, 'r')\n", (913, 933), False, 'import h5py\n'), ((1031, 1038...
import lmfit import numpy as np from scraps.fitsS21 import utils def offset(freqs, re0, im0): """Complex offset re + j*im. Freqs vector is ignored, but required for lmfit Model.""" return re0 + 1j * im0 def mag(freqs, g0, g1, g2): """2nd order polynomial. References the freqs-array midpoint, w...
[ "scraps.fitsS21.utils.reduce_by_midpoint", "numpy.abs", "numpy.ones_like", "numpy.polyfit", "numpy.angle", "numpy.unwrap", "lmfit.models.update_param_vals", "numpy.imag", "scraps.fitsS21.utils.mask_array_ends", "numpy.exp", "numpy.real" ]
[((451, 482), 'scraps.fitsS21.utils.reduce_by_midpoint', 'utils.reduce_by_midpoint', (['freqs'], {}), '(freqs)\n', (475, 482), False, 'from scraps.fitsS21 import utils\n'), ((795, 826), 'scraps.fitsS21.utils.reduce_by_midpoint', 'utils.reduce_by_midpoint', (['freqs'], {}), '(freqs)\n', (819, 826), False, 'from scraps.f...
""" A2C model """ import os, sys import time import argparse import tensorflow.compat.v1 as tf import gym from drl_negotiation.env import SCMLEnv import drl_negotiation.utils as U import numpy as np import pickle from tqdm import tqdm from drl_negotiation.hyperparameters import * import logging class MADDPGModel: ...
[ "argparse.Namespace", "pickle.dump", "drl_negotiation.utils.get_trainers", "drl_negotiation.utils.save_as_scope", "numpy.clip", "drl_negotiation.utils.get_saver", "numpy.mean", "drl_negotiation.utils.save_state", "os.path.join", "logging.error", "tensorflow.compat.v1.train.import_meta_graph", ...
[((3340, 3367), 'drl_negotiation.utils.single_threaded_session', 'U.single_threaded_session', ([], {}), '()\n', (3365, 3367), True, 'import drl_negotiation.utils as U\n'), ((3836, 4098), 'argparse.Namespace', 'argparse.Namespace', ([], {}), "(**{'good_policy': self.good_policy, 'adv_policy': self.\n adv_policy, 'lr'...
from atomicplot.data import XYDataObject import unittest import numpy as np class DataObjectTest(unittest.TestCase): def test_inputtype(self): with self.assertRaises(TypeError): x = 'test_string' y = [1, 2, 3, 4] XYDataObject(x, y) with self.assertR...
[ "unittest.main", "numpy.absolute", "numpy.arange", "numpy.array_equal", "atomicplot.data.XYDataObject" ]
[((5009, 5024), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5022, 5024), False, 'import unittest\n'), ((625, 637), 'numpy.arange', 'np.arange', (['(4)'], {}), '(4)\n', (634, 637), True, 'import numpy as np\n'), ((681, 699), 'atomicplot.data.XYDataObject', 'XYDataObject', (['x', 'y'], {}), '(x, y)\n', (693, 699...
import numpy as np import pytest from nengo.builder import Signal from nengo.builder.operator import SparseDotInc from nengo.exceptions import BuildError def test_sparsedotinc_builderror(): A = Signal(np.ones(2)) X = Signal(np.ones(2)) Y = Signal(np.ones(2)) with pytest.raises(BuildError, match="mus...
[ "pytest.raises", "numpy.ones", "nengo.builder.operator.SparseDotInc" ]
[((208, 218), 'numpy.ones', 'np.ones', (['(2)'], {}), '(2)\n', (215, 218), True, 'import numpy as np\n'), ((235, 245), 'numpy.ones', 'np.ones', (['(2)'], {}), '(2)\n', (242, 245), True, 'import numpy as np\n'), ((262, 272), 'numpy.ones', 'np.ones', (['(2)'], {}), '(2)\n', (269, 272), True, 'import numpy as np\n'), ((28...
import cv2 as cv from bbox import BoundingBox from opticalFlow import OpticalFlowTracker from utils import displayImage, drawBbox, drawVectfromBbox, opticalFlow, euclidianDistance import numpy as np class Trackers(OpticalFlowTracker): def __init__(self,bboxes): self.positions = [box.center for box in bbox...
[ "utils.displayImage", "numpy.ones_like", "utils.drawBbox", "cv2.imread", "bbox.BoundingBox" ]
[((1526, 1570), 'bbox.BoundingBox', 'BoundingBox', ([], {'x0': '(980)', 'x1': '(1026)', 'y0': '(300)', 'y1': '(360)'}), '(x0=980, x1=1026, y0=300, y1=360)\n', (1537, 1570), False, 'from bbox import BoundingBox\n'), ((1588, 1631), 'bbox.BoundingBox', 'BoundingBox', ([], {'x0': '(513)', 'x1': '(560)', 'y0': '(315)', 'y1'...
import numpy as np import itertools as it import os from models.model import AbstractModel from distribution_estimation.approximator import LaplaceApproximation from distribution_estimation.sampler import MonteCarlo from distribution_estimation.kernel_optimiser import HyperParameterOptimiser n_classes = 10 class Ga...
[ "numpy.random.uniform", "utils.data_utils.load_MNIST", "numpy.save", "numpy.load", "distribution_estimation.approximator.LaplaceApproximation", "numpy.sum", "numpy.argmax", "os.path.realpath", "numpy.zeros", "numpy.hstack", "numpy.random.permutation", "numpy.sin", "numpy.arange", "numpy.ra...
[((16242, 16289), 'utils.data_utils.load_MNIST', 'load_MNIST', ([], {'num_training': '(2000)', 'num_validation': '(0)'}), '(num_training=2000, num_validation=0)\n', (16252, 16289), False, 'from utils.data_utils import load_MNIST\n'), ((924, 959), 'distribution_estimation.sampler.MonteCarlo', 'MonteCarlo', ([], {'num_sa...
# Copyright 2018 <NAME> & <NAME>. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "numpy.argmax", "random.shuffle", "scipy.stats.levene", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "sklearn.manifold.MDS", "scipy.stats.ttest_ind_from_stats", "numpy.max", "numpy.random.choice", "keras.utils.to_categorical", "matplotlib.pyplot.show", "pandas.get_dummies", "m...
[((2423, 2442), 'random.shuffle', 'random.shuffle', (['idx'], {}), '(idx)\n', (2437, 2442), False, 'import random\n'), ((3079, 3107), 'numpy.array', 'np.array', (['label'], {'dtype': '"""int"""'}), "(label, dtype='int')\n", (3087, 3107), True, 'import numpy as np\n'), ((3700, 3711), 'numpy.array', 'np.array', (['y'], {...
# -*- coding: utf-8 -*- """ Created on Thu Apr 30 00:52:00 2015 @author: Ziang """ import numpy as np from sklearn import datasets from sklearn.svm import SVC from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier import matplotlib import matplotlib.pyplot as plt from m...
[ "sklearn.ensemble.RandomForestClassifier", "sklearn.cross_validation.train_test_split", "matplotlib.pyplot.subplot", "numpy.random.seed", "numpy.sum", "GPSVI.core.GPClassifier.GPClassifier", "sklearn.datasets.make_moons", "matplotlib.pyplot.figure", "sklearn.linear_model.LogisticRegression", "nump...
[((463, 480), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (477, 480), True, 'import numpy as np\n'), ((497, 542), 'sklearn.datasets.make_moons', 'datasets.make_moons', ([], {'n_samples': '(400)', 'noise': '(0.1)'}), '(n_samples=400, noise=0.1)\n', (516, 542), False, 'from sklearn import datasets\n'),...
#!/usr/bin/env python # coding: utf-8 # In[2]: import gym import numpy as np import json from stable_baselines.sac.policies import MlpPolicy as MlpPolicy_SAC from stable_baselines import SAC from citylearn import CityLearn import matplotlib.pyplot as plt from pathlib import Path import time # In[3]: # Central a...
[ "json.dump", "json.load", "citylearn.CityLearn", "stable_baselines.SAC", "matplotlib.pyplot.plot", "numpy.sum", "numpy.empty", "matplotlib.pyplot.legend", "time.time", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((2561, 2588), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(16, 5)'}), '(figsize=(16, 5))\n', (2571, 2588), True, 'import matplotlib.pyplot as plt\n'), ((2588, 2653), 'matplotlib.pyplot.plot', 'plt.plot', (['env.net_electric_consumption_no_pv_no_storage[interval]'], {}), '(env.net_electric_consumption_...
import numpy as np from .loss import Loss from scipy.special import expit class Logistic(Loss): """Single-task Logistic loss. Attributes ---------- x: array-like The features. y: array-like The responses (0/1). w: array-like The observation weights. L: float Hessian upper bound value. mu: float Hes...
[ "numpy.log", "scipy.special.expit", "numpy.max", "numpy.min", "numpy.sqrt" ]
[((908, 919), 'numpy.max', 'np.max', (['eig'], {}), '(eig)\n', (914, 919), True, 'import numpy as np\n'), ((966, 980), 'numpy.max', 'np.max', (['self.w'], {}), '(self.w)\n', (972, 980), True, 'import numpy as np\n'), ((993, 1004), 'numpy.min', 'np.min', (['eig'], {}), '(eig)\n', (999, 1004), True, 'import numpy as np\n...
# from __future__ import print_function import os import numpy as np import logging import argparse from keras.preprocessing import sequence from keras.utils import np_utils from keras.models import Model from keras.layers import Dense, Dropout, Activation, TimeDistributed, TimeDistributedDense from keras.layers impo...
[ "numpy.load", "numpy.random.seed", "argparse.ArgumentParser", "logging.basicConfig", "numpy.sum", "keras.callbacks.ModelCheckpoint", "keras.layers.Input", "numpy.random.shuffle", "keras.layers.Activation", "keras.layers.LSTM", "numpy.expand_dims", "keras.models.Model", "logging.info", "ker...
[((777, 797), 'numpy.random.seed', 'np.random.seed', (['(1337)'], {}), '(1337)\n', (791, 797), True, 'import numpy as np\n'), ((822, 895), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s %(message)s', level=logging.INFO)\n",...
from biosimulators_test_suite import utils from biosimulators_test_suite.config import Config import math import numpy import os import unittest class UtilsTestCase(unittest.TestCase): def test_get_singularity_image_filename(self): base_dir = Config().singularity_image_dirname filename = utils.get...
[ "biosimulators_test_suite.utils.simulation_results_isnan", "biosimulators_test_suite.utils.get_singularity_image_filename", "numpy.array", "os.path.relpath", "biosimulators_test_suite.config.Config" ]
[((311, 417), 'biosimulators_test_suite.utils.get_singularity_image_filename', 'utils.get_singularity_image_filename', (['"""ghcr.io/biosimulators/biosimulators_tellurium/tellurium:2.2.0"""'], {}), "(\n 'ghcr.io/biosimulators/biosimulators_tellurium/tellurium:2.2.0')\n", (347, 417), False, 'from biosimulators_test_s...
# Copyright (c) 2018, <NAME>. All rights reserved. # # This work is licen sed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain View, CA 94...
[ "tf_model.gan_fingerprint.misc.create_result_subdir", "argparse.ArgumentParser", "numpy.random.seed", "tf_model.gan_fingerprint.tfutil.save_summaries", "tensorflow.identity", "tf_model.gan_fingerprint.tfutil.Network", "numpy.floor", "tensorflow.reshape", "tf_model.gan_fingerprint.tfutil.init_tf", ...
[((6721, 6732), 'time.time', 'time.time', ([], {}), '()\n', (6730, 6732), False, 'import time\n'), ((6752, 6840), 'tf_model.gan_fingerprint.dataset.load_dataset', 'dataset.load_dataset', ([], {'data_dir': 'config.data_dir', 'verbose': '(True)'}), '(data_dir=config.data_dir, verbose=True, **config.\n training_set)\n'...
import os import numpy as np import cv2 as cv import time from PIL import Image BODY_PARTS = { "Head": 0, "Neck": 1, "RShoulder": 2, "RElbow": 3, "RWrist": 4, "LShoulder": 5, "LElbow": 6, "LWrist": 7, "RHip": 8, "RKnee": 9, "RAnkle": 10, "LHip": 11, "LKnee": 12, "LAnkle": 13, "Chest": ...
[ "cv2.line", "numpy.uint8", "cv2.putText", "cv2.getTickFrequency", "cv2.cvtColor", "cv2.imwrite", "cv2.dnn.blobFromImage", "time.time", "cv2.imread", "cv2.ellipse", "cv2.dnn.readNetFromCaffe", "cv2.minMaxLoc", "cv2.imshow", "os.listdir", "cv2.namedWindow" ]
[((883, 920), 'cv2.dnn.readNetFromCaffe', 'cv.dnn.readNetFromCaffe', (['proto', 'model'], {}), '(proto, model)\n', (906, 920), True, 'import cv2 as cv\n'), ((981, 1002), 'os.listdir', 'os.listdir', (['image_dir'], {}), '(image_dir)\n', (991, 1002), False, 'import os\n'), ((1017, 1051), 'cv2.imread', 'cv.imread', (["(im...
import torch import torch.nn as nn import math import json import copy import numpy as np from deepxml.cornet import CorNet #%% def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x ...
[ "torch.nn.Dropout", "copy.deepcopy", "torch.from_numpy", "json.loads", "math.sqrt", "torch.nn.Embedding", "torch.nn.init.xavier_uniform_", "torch.cat", "torch.sigmoid", "torch.nn.Softmax", "torch.arange", "numpy.random.normal", "torch.nn.Linear", "torch.matmul", "deepxml.cornet.CorNet" ]
[((495, 511), 'torch.sigmoid', 'torch.sigmoid', (['x'], {}), '(x)\n', (508, 511), False, 'import torch\n'), ((4343, 4371), 'copy.deepcopy', 'copy.deepcopy', (['self.__dict__'], {}), '(self.__dict__)\n', (4356, 4371), False, 'import copy\n'), ((5930, 5994), 'torch.nn.Embedding', 'nn.Embedding', (['config.max_position_em...
# -*- coding: utf-8 -*- """ @author: <NAME> <<EMAIL>> <NAME> <<EMAIL>> """ import numpy as np NUM_FMT = '{:.4f}' def _table_format(data, headers=None, index=None, extra_spaces=0, h_bars=None): if headers is not None: data.insert(0, headers) if index is not None: index.insert(0, '')...
[ "numpy.asarray", "numpy.vstack" ]
[((2025, 2041), 'numpy.asarray', 'np.asarray', (['data'], {}), '(data)\n', (2035, 2041), True, 'import numpy as np\n'), ((2113, 2141), 'numpy.vstack', 'np.vstack', (['[data, mean, std]'], {}), '([data, mean, std])\n', (2122, 2141), True, 'import numpy as np\n')]
import numpy as np import torch import logging from miso.metrics.continuous_metrics import ContinuousMetric from miso.losses.loss import MSECrossEntropyLoss, Loss from scipy.stats import pearsonr logger = logging.getLogger(__name__) np.set_printoptions(suppress=True) class NodeAttributeDecoder(torch.nn.Module): ...
[ "torch.nn.Dropout", "numpy.set_printoptions", "torch.nn.ReLU", "torch.nn.BCEWithLogitsLoss", "torch.nn.Sequential", "scipy.stats.pearsonr", "torch.gt", "torch.nn.Linear", "miso.metrics.continuous_metrics.ContinuousMetric", "miso.losses.loss.MSECrossEntropyLoss", "logging.getLogger" ]
[((208, 235), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (225, 235), False, 'import logging\n'), ((238, 272), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (257, 272), True, 'import numpy as np\n'), ((558, 573), 'torch.nn.ReLU', 't...
import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') from sklearn import svm, tree, linear_model, neighbors, naive_bayes, ensemble, discriminant_analysis, gaussian_process from xgboost import XGBClassifier from sklearn.model_sele...
[ "sklearn.model_selection.GridSearchCV", "sklearn.preprocessing.StandardScaler", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.model_selection.cross_val_score", "sklearn.svm.SVC", "sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis", "pandas.DataFrame", "pandas.merg...
[((110, 143), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (133, 143), False, 'import warnings\n'), ((20988, 21050), 'sklearn.model_selection.train_test_split', 'train_test_split', (['all_X', 'all_y'], {'test_size': '(0.3)', 'random_state': '(42)'}), '(all_X, all_y, test...
from keras.models import load_model from tensorflow import keras from matplotlib import pyplot as plt import numpy as np import _pickle as pickle import random #loads the test input with open('test_input.pickle', mode='rb') as f: test_input = pickle.load(f) with open('test_output.pickle', mode='rb') as f: test...
[ "_pickle.load", "matplotlib.pyplot.subplot", "tensorflow.keras.models.load_model", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig" ]
[((371, 406), 'tensorflow.keras.models.load_model', 'keras.models.load_model', (['"""model.h5"""'], {}), "('model.h5')\n", (394, 406), False, 'from tensorflow import keras\n'), ((1277, 1316), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""eval.png"""'], {'pad_inches': '(0.1)'}), "('eval.png', pad_inches=0.1)\n", (12...
import argparse import os import gym import numpy as np from stable_baselines3.common.env_checker import check_env from stable_baselines3.common.noise import NormalActionNoise from stable_baselines3.common.utils import set_random_seed from stable_baselines3.sac import SAC from callback_buffer import CheckpointBufferC...
[ "argparse.ArgumentParser", "callback_buffer.CheckpointBufferCallback", "gym.make", "stable_baselines3.common.env_checker.check_env", "numpy.zeros", "numpy.ones", "stable_baselines3.common.utils.set_random_seed", "os.path.isfile", "stable_baselines3.sac.SAC", "stable_baselines3.sac.SAC.load" ]
[((1049, 1070), 'stable_baselines3.common.utils.set_random_seed', 'set_random_seed', (['seed'], {}), '(seed)\n', (1064, 1070), False, 'from stable_baselines3.common.utils import set_random_seed\n'), ((1130, 1155), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1153, 1155), False, 'import argpa...
# Import packages import time import numpy as np import pandas as pd from scipy.sparse import csr_matrix from scipy.sparse.linalg import eigsh ## Functions running netconf graph belief propagation # Adapted from Matlab script found at # https://github.com/dhivyaeswaran/dhivyaeswaran.github.io/tree/master/code ## Imp...
[ "numpy.divide", "numpy.sum", "numpy.eye", "numpy.abs", "pandas.read_csv", "numpy.zeros", "scipy.sparse.linalg.eigsh", "time.time", "numpy.append", "numpy.max", "numpy.dot" ]
[((1418, 1429), 'time.time', 'time.time', ([], {}), '()\n', (1427, 1429), False, 'import time\n'), ((1751, 1764), 'numpy.dot', 'np.dot', (['M', 'M1'], {}), '(M, M1)\n', (1757, 1764), True, 'import numpy as np\n'), ((394, 428), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'header': 'None'}), '(filename, header=None...
import abc import logging import dynesty import numpy as np import gbkfit.fitting.fitter import gbkfit.fitting.params from gbkfit.utils import parseutils log = logging.getLogger(__name__) def _prior_tansform_wrapper(theta): pass def _log_likelihood_wrapper(theta): pass class FitParameterDynesty(gbkfi...
[ "dynesty.NestedSampler", "gbkfit.utils.parseutils.parse_options", "numpy.random.RandomState", "logging.getLogger" ]
[((165, 192), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (182, 192), False, 'import logging\n'), ((2698, 2846), 'dynesty.NestedSampler', 'dynesty.NestedSampler', (['_log_likelihood_wrapper', '_prior_tansform_wrapper', 'ndim'], {'logl_args': '(objective, interpreter)', 'ptform_args': '...
import itertools import os import sys # Add path to python source to path. sys.path.append(os.path.join( os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "python")) import SmoothParticleNets as spn import math import numpy as np import queue import torch import torch.autograd from gradcheck import gr...
[ "torch.autograd.gradcheck", "os.path.abspath", "numpy.random.seed", "numpy.square", "numpy.zeros", "numpy.ones", "torch.FloatTensor", "SmoothParticleNets.ConvSDF", "numpy.finfo", "numpy.sin", "numpy.random.randint", "numpy.arange", "numpy.cos", "numpy.array", "numpy.random.rand", "nump...
[((898, 919), 'queue.PriorityQueue', 'queue.PriorityQueue', ([], {}), '()\n', (917, 919), False, 'import queue\n'), ((2581, 2598), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (2595, 2598), True, 'import numpy as np\n'), ((2611, 2646), 'numpy.random.rand', 'np.random.rand', (['BATCH_SIZE', 'N', 'NDIM'...
""" This file implements some ensemble classifiers. Some algorithms may not work well beacause they are implemented during my early work, including CalibratedLabelRanking and RandomKLabelsets. """ import numpy as np import copy import math import random from sklearn.multiclass import OneVsRestClassifier from scipy.spa...
[ "copy.deepcopy", "numpy.sum", "random.sample", "numpy.zeros", "scipy.sparse.csr_matrix", "sklearn.neighbors.NearestNeighbors", "sklearn.multiclass.OneVsRestClassifier", "numpy.array", "scipy.sparse.hstack" ]
[((538, 568), 'sklearn.multiclass.OneVsRestClassifier', 'OneVsRestClassifier', (['estimator'], {}), '(estimator)\n', (557, 568), False, 'from sklearn.multiclass import OneVsRestClassifier\n'), ((7442, 7455), 'scipy.sparse.csr_matrix', 'csr_matrix', (['X'], {}), '(X)\n', (7452, 7455), False, 'from scipy.sparse import cs...
import numpy as np import os import torch import random from bert_serving.client import BertClient random.seed(31415926) def build_imdb_npy(imdb_path): for file_path in [os.path.join(imdb_path, "train"), os.path.join(imdb_path, "test")]: txt_list = [] y = [] for label...
[ "random.shuffle", "numpy.empty", "numpy.array", "random.seed", "bert_serving.client.BertClient", "os.path.join", "os.listdir", "numpy.concatenate" ]
[((100, 121), 'random.seed', 'random.seed', (['(31415926)'], {}), '(31415926)\n', (111, 121), False, 'import random\n'), ((3431, 3452), 'random.shuffle', 'random.shuffle', (['datas'], {}), '(datas)\n', (3445, 3452), False, 'import random\n'), ((4865, 4897), 'os.path.join', 'os.path.join', (['imdb_path', '"""train"""'],...
#Batch Input Logic with multiple layers import numpy as np np.random.seed(0) X = [[1, 2, 3, 2.5],#Input Data [2.0, 5.0, -1.0, 2.0], [-1.5, 2.7, 3.3, -0.8]] class Layer_Dense: def __init__(self, n_inputs, n_neurons): self.weights = 0.10 * np.random.randn(n_inputs, n_neurons) self....
[ "numpy.zeros", "numpy.dot", "numpy.random.seed", "numpy.random.randn" ]
[((61, 78), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (75, 78), True, 'import numpy as np\n'), ((329, 353), 'numpy.zeros', 'np.zeros', (['(1, n_neurons)'], {}), '((1, n_neurons))\n', (337, 353), True, 'import numpy as np\n'), ((409, 451), 'numpy.dot', 'np.dot', (['inputs', '(self.weights + self.bia...
import matplotlib as mpl import matplotlib.pyplot as plt import sympy as sp import numpy as np material = { 'red800' : '#C62828','red500' : '#F44336','red100' : '#FFCDD2','red50' : '#FFEBEE', 'orange800' : '#EF6C00','orange500' : '#FF9800','orange100' : '#FFCC80','orange50' : '#FFF3E0', 'yellow800' : '#F9A825','yel...
[ "sympy.Symbol", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.axes", "matplotlib.pyplot.close", "matplotlib.pyplot.yticks", "sympy.cos", "sympy.latex", "matplotlib.pyplot.figure", "matplotlib.pyplot.Circle", "matplotlib.pyplot.xticks", "matp...
[((7444, 7458), 'sympy.Symbol', 'sp.Symbol', (['"""x"""'], {}), "('x')\n", (7453, 7458), True, 'import sympy as sp\n'), ((882, 892), 'matplotlib.pyplot.xlim', 'plt.xlim', ([], {}), '()\n', (890, 892), True, 'import matplotlib.pyplot as plt\n'), ((912, 922), 'matplotlib.pyplot.ylim', 'plt.ylim', ([], {}), '()\n', (920, ...
import sys import pandas as pd import numpy as np from sqlalchemy import create_engine import re import time import nltk nltk.download('words') nltk.download('punkt') nltk.download('averaged_perceptron_tagger') nltk.download('maxent_ne_chunker') nltk.download('stopwords') nltk.download('wordnet') from nltk.tokenize imp...
[ "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.GridSearchCV", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.ensemble.AdaBoostClassifier", "nltk.stem.wordnet.WordNetLemmatizer", "sklearn.model_selection.train_test_split", "nltk.stem.porter.PorterStemmer", "numpy.trans...
[((121, 143), 'nltk.download', 'nltk.download', (['"""words"""'], {}), "('words')\n", (134, 143), False, 'import nltk\n'), ((144, 166), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (157, 166), False, 'import nltk\n'), ((167, 210), 'nltk.download', 'nltk.download', (['"""averaged_perceptron_ta...
import dgl import torch import torch.nn as nn import torch.nn.functional as F import dgl.data import numpy as np import pandas as pd from make_dgl_dataset import PmuDataset import warnings from dgl.nn import GraphConv import matplotlib.pyplot as plt warnings.filterwarnings('ignore') # device = torch.devic...
[ "matplotlib.pyplot.subplot", "numpy.load", "dgl.dataloading.GraphDataLoader", "matplotlib.pyplot.show", "warnings.filterwarnings", "networkx.petersen_graph", "torch.nn.functional.cross_entropy", "make_dgl_dataset.PmuDataset", "dgl.DGLGraph", "numpy.array", "numpy.arange", "torch.nn.functional....
[((263, 296), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (286, 296), False, 'import warnings\n'), ((418, 446), 'numpy.load', 'np.load', (['"""data/features.npy"""'], {}), "('data/features.npy')\n", (425, 446), True, 'import numpy as np\n'), ((494, 528), 'numpy.load', '...
"""Utility functions shared across the Aquarius project.""" import ftplib import os import logging import gzip import numpy as np import pandas as pd import yaml import json from datetime import timedelta, date, datetime from dfply import ( X, group_by, summarize, mask, n, transmute, select,...
[ "numpy.sum", "bokeh.models.Line", "numpy.ones", "dfply.arrange", "numpy.argsort", "matplotlib.pyplot.figure", "numpy.arange", "numpy.interp", "matplotlib.pyplot.fill_between", "logging.error", "numpy.max", "datetime.timedelta", "numpy.radians", "pandas.date_range", "datetime.date.today",...
[((2480, 2525), 'logging.debug', 'logging.debug', (['f"""ftp_filename={ftp_filename}"""'], {}), "(f'ftp_filename={ftp_filename}')\n", (2493, 2525), False, 'import logging\n'), ((2530, 2567), 'logging.debug', 'logging.debug', (['f"""save_dir={save_dir}"""'], {}), "(f'save_dir={save_dir}')\n", (2543, 2567), False, 'impor...
# Copyright (c) 2020 <NAME> and <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, d...
[ "os.mkdir", "tqdm.tqdm", "video_utils.VideoProcessor", "argparse.ArgumentParser", "librosa.feature.mfcc", "os.path.basename", "os.makedirs", "os.path.exists", "numpy.array", "os.path.join", "os.listdir" ]
[((1290, 1334), 'os.path.join', 'os.path.join', (['dataset_folder', '"""preprocessed"""'], {}), "(dataset_folder, 'preprocessed')\n", (1302, 1334), False, 'import os\n'), ((1357, 1398), 'os.path.join', 'os.path.join', (['dataset_folder', '"""landmarks"""'], {}), "(dataset_folder, 'landmarks')\n", (1369, 1398), False, '...
# Run me as follows: # cd tests/ # nosetests -v -s test_utils.py import copy import librosa import numpy as np import os # Msaf imports import msaf # Global vars audio_file = os.path.join("fixtures", "chirp.mp3") sr = msaf.config.sample_rate audio, fs = librosa.load(audio_file, sr=sr) y_harmonic, y_percussive = libro...
[ "copy.deepcopy", "msaf.utils.synchronize_labels", "msaf.utils.min_max_normalize", "msaf.utils.get_time_frames", "librosa.effects.hpss", "msaf.utils.get_num_frames", "librosa.load", "numpy.random.random", "msaf.utils.align_end_hierarchies", "numpy.array_equal", "msaf.utils.lognormalize", "os.pa...
[((177, 214), 'os.path.join', 'os.path.join', (['"""fixtures"""', '"""chirp.mp3"""'], {}), "('fixtures', 'chirp.mp3')\n", (189, 214), False, 'import os\n'), ((256, 287), 'librosa.load', 'librosa.load', (['audio_file'], {'sr': 'sr'}), '(audio_file, sr=sr)\n', (268, 287), False, 'import librosa\n'), ((315, 342), 'librosa...
import numpy as np import pandas as pd import geopandas as gpd import jenkspy us_state_abbrev = { 'Alabama': 'AL', 'Alaska': 'AK', 'American Samoa': 'AS', 'Arizona': 'AZ', 'Arkansas': 'AR', 'California': 'CA', 'Colorado': 'CO', 'Connecticut': 'CT', 'Delaware': 'DE', 'District of...
[ "pandas.DataFrame", "jenkspy.jenks_breaks", "pandas.read_csv", "pandas.DatetimeIndex", "pandas.cut", "numpy.append", "numpy.linspace", "pandas.qcut", "geopandas.read_file" ]
[((2530, 2618), 'pandas.read_csv', 'pd.read_csv', (['"""Inputs/PID_Canada.csv"""'], {'parse_dates': "['date']", 'index_col': "['id_victim']"}), "('Inputs/PID_Canada.csv', parse_dates=['date'], index_col=[\n 'id_victim'])\n", (2541, 2618), True, 'import pandas as pd\n'), ((4518, 4585), 'pandas.read_csv', 'pd.read_csv...
import numpy as np def rnn_step_forward(x, prev_h, Wx, Wh, b): """ Inputs: - x: Input data for this timestep, of shape (N, D). - prev_h: Hidden state from previous timestep, of shape (N, H) - Wx: Weight matrix for input-to-hidden connections, of shape (D, H) - Wh: Weight matrix for hidden-to-h...
[ "numpy.zeros", "numpy.sum", "numpy.tanh" ]
[((639, 655), 'numpy.tanh', 'np.tanh', (['forward'], {}), '(forward)\n', (646, 655), True, 'import numpy as np\n'), ((1567, 1591), 'numpy.sum', 'np.sum', (['dforward'], {'axis': '(0)'}), '(dforward, axis=0)\n', (1573, 1591), True, 'import numpy as np\n'), ((2233, 2252), 'numpy.zeros', 'np.zeros', (['(N, T, H)'], {}), '...
import logging import numpy as np from pyrieef.geometry.workspace import Circle, Box, Workspace # temporary importing until complication of install is resolve import os import sys _path_file = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(_path_file, "../../../bewego")) from pybewego impor...
[ "numpy.linalg.norm", "os.path.realpath", "os.path.join", "logging.getLogger" ]
[((212, 238), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (228, 238), False, 'import os\n'), ((256, 299), 'os.path.join', 'os.path.join', (['_path_file', '"""../../../bewego"""'], {}), "(_path_file, '../../../bewego')\n", (268, 299), False, 'import os\n'), ((457, 484), 'logging.getLogger...
import logging import math import time import typing from collections.abc import Sequence import numpy as np from qtpy.QtCore import QModelIndex, Qt, QVariant, QAbstractListModel from scipy import signal WINDOW_MAPPING = { 'Hann': signal.windows.hann, 'Hamming': signal.windows.hamming, 'Blackman-Harris': ...
[ "qtpy.QtCore.QVariant", "numpy.array", "logging.getLogger", "time.time" ]
[((603, 635), 'logging.getLogger', 'logging.getLogger', (['"""measurement"""'], {}), "('measurement')\n", (620, 635), False, 'import logging\n'), ((4858, 4870), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (4866, 4870), True, 'import numpy as np\n'), ((4876, 4888), 'numpy.array', 'np.array', (['[]'], {}), '([])\n...
import torch from tqdm import tqdm import os from tensorboardX import SummaryWriter import numpy as np from config import coordinates_cat, proposalN, set, vis_num from utils.cal_iou import calculate_iou from utils.vis import image_with_boxes def eval(model, testloader, criterion, status, save_path, epoch): model.e...
[ "tqdm.tqdm", "utils.vis.image_with_boxes", "numpy.sum", "torch.no_grad", "os.path.join", "numpy.concatenate" ]
[((519, 534), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (532, 534), False, 'import torch\n'), ((569, 585), 'tqdm.tqdm', 'tqdm', (['testloader'], {}), '(testloader)\n', (573, 585), False, 'from tqdm import tqdm\n'), ((2323, 2341), 'numpy.sum', 'np.sum', (['(iou >= 0.5)'], {}), '(iou >= 0.5)\n', (2329, 2341), T...
import os import netCDF4 as nc4 import numpy as np import matplotlib.pyplot as plt import numpy.ma as ma import glob import xarray as xr import collections def make_yearly_cdf(syear,eyear, sat, dataloc, odir, evars): ''' PURPOSE: This program takes monthly Lbin files and turns them into yearly cumulative distr...
[ "matplotlib.pyplot.title", "os.mkdir", "argparse.ArgumentParser", "numpy.floor", "numpy.isnan", "collections.defaultdict", "numpy.arange", "glob.glob", "numpy.interp", "matplotlib.pyplot.tight_layout", "netCDF4.Dataset", "matplotlib.pyplot.close", "matplotlib.pyplot.colorbar", "matplotlib....
[((3645, 3666), 'numpy.arange', 'np.arange', (['(0)', '(360)', '(10)'], {}), '(0, 360, 10)\n', (3654, 3666), True, 'import numpy as np\n'), ((3710, 3734), 'numpy.arange', 'np.arange', (['(1)', '(8.25)', '(0.25)'], {}), '(1, 8.25, 0.25)\n', (3719, 3734), True, 'import numpy as np\n'), ((3770, 3792), 'numpy.arange', 'np....