code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import geopandas as gpd from energy_demand.read_write import data_loader, read_data from energy_demand.basic import date_prop from energy_demand.basic import basic_functions from energy_demand.basic import lookup_tables from energy_demand...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "numpy.sum", "os.path.join", "numpy.argmax", "matplotlib.pyplot.margins", "matplotlib.pyplot.legend", "energy_demand.basic.date_prop.get_season", "energy_demand.plotting.basic_plot_functions.smooth_data", "energy_demand.technologies.tech_related.get_fu...
[((779, 822), 'energy_demand.technologies.tech_related.get_fueltype_int', 'tech_related.get_fueltype_int', (['fueltype_str'], {}), '(fueltype_str)\n', (808, 822), False, 'from energy_demand.technologies import tech_related\n'), ((4674, 4705), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'scenarios'}), '(columns...
from __future__ import annotations import h5py from typing import List, Tuple, Dict import pandas as pd import numpy as np from attrbench.metrics.result import AbstractMetricResult from attrbench.lib import NDArrayTree class MaskerActivationMetricResult(AbstractMetricResult): inverted: bool def __init__(self...
[ "numpy.squeeze", "attrbench.lib.NDArrayTree.load_from_hdf", "attrbench.lib.NDArrayTree" ]
[((531, 631), 'attrbench.lib.NDArrayTree', 'NDArrayTree', (["[('masker', maskers), ('activation_fn', activation_fns), ('method',\n method_names)]"], {}), "([('masker', maskers), ('activation_fn', activation_fns), (\n 'method', method_names)])\n", (542, 631), False, 'from attrbench.lib import NDArrayTree\n'), ((11...
import neural_network_lyapunov.barrier as mut import neural_network_lyapunov.control_affine_system as control_affine_system import neural_network_lyapunov.utils as utils import neural_network_lyapunov.gurobi_torch_mip as gurobi_torch_mip import torch import numpy as np import unittest import gurobipy class TestInfNo...
[ "unittest.main", "torch.from_numpy", "neural_network_lyapunov.utils.setup_relu", "neural_network_lyapunov.gurobi_torch_mip.MixedIntegerConstraintsReturn", "torch.zeros_like", "neural_network_lyapunov.gurobi_torch_mip.GurobiTorchMIP", "torch.manual_seed", "neural_network_lyapunov.utils.uniform_sample_i...
[((16110, 16125), 'unittest.main', 'unittest.main', ([], {}), '()\n', (16123, 16125), False, 'import unittest\n'), ((430, 468), 'torch.tensor', 'torch.tensor', (['[-3, -2, 1]'], {'dtype': 'dtype'}), '([-3, -2, 1], dtype=dtype)\n', (442, 468), False, 'import torch\n'), ((484, 521), 'torch.tensor', 'torch.tensor', (['[-1...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import logging import mcubes from icecream import ic def extract_fields(bound_min, bound_max, resolution, query_func): N = 64 X = torch.linspace(bound_min[0], bound_max[0], resolution).split(N) Y = torch.linspace(bound_m...
[ "torch.cat", "torch.arange", "torch.no_grad", "torch.ones", "torch.searchsorted", "torch.Tensor", "torch.linalg.norm", "torch.nn.functional.relu", "torch.zeros", "mcubes.marching_cubes", "torch.zeros_like", "torch.max", "torch.rand", "torch.sum", "torch.sort", "torch.min", "torch.one...
[((443, 507), 'numpy.zeros', 'np.zeros', (['[resolution, resolution, resolution]'], {'dtype': 'np.float32'}), '([resolution, resolution, resolution], dtype=np.float32)\n', (451, 507), True, 'import numpy as np\n'), ((1592, 1627), 'mcubes.marching_cubes', 'mcubes.marching_cubes', (['u', 'threshold'], {}), '(u, threshold...
#!/usr/bin/env python ''' @package ion.services.dm.utility.granule.record_dictionary @file ion/services/dm/utility/granule/record_dictionary.py @author <NAME> @author <NAME> <<EMAIL>> @brief https://confluence.oceanobservatories.org/display/CIDev/Record+Dictionary ''' from pyon.container.cc import Container from pyon...
[ "pprint.pformat", "interface.services.dm.ipubsub_management_service.PubsubManagementServiceClient", "ion.util.stored_values.StoredValueManager", "msgpack.packb", "pyon.core.exception.BadRequest", "pyon.util.log.log.warning", "pyon.core.object.IonObjectSerializer", "numexpr.evaluate", "coverage_model...
[((4434, 4459), 'numpy.atleast_1d', 'np.atleast_1d', (['self[name]'], {}), '(self[name])\n', (4447, 4459), True, 'import numpy as np\n'), ((4577, 4618), 'coverage_model.get_value_class', 'get_value_class', (['ptype'], {'domain_set': 'domain'}), '(ptype, domain_set=domain)\n', (4592, 4618), False, 'from coverage_model i...
# -*- coding: utf-8 -*- from collections import namedtuple import os import typing import numpy as np import torch.utils.data from benzina.utils.file import Track _TrackType = typing.Union[str, Track] _TrackPairType = typing.Tuple[_TrackType, _TrackType] _ClassTracksType = typing.Tuple[_TrackType, _TrackType] cla...
[ "os.path.join", "benzina.utils.file.Track", "numpy.dtype", "os.path.expandvars", "os.path.isfile", "collections.namedtuple", "os.path.expanduser" ]
[((701, 730), 'collections.namedtuple', 'namedtuple', (['"""Item"""', "['input']"], {}), "('Item', ['input'])\n", (711, 730), False, 'from collections import namedtuple\n'), ((2627, 2681), 'collections.namedtuple', 'namedtuple', (['"""Item"""', "['input', 'input_label', 'target']"], {}), "('Item', ['input', 'input_labe...
import numpy as np def kMeans(X, K, maxIters = 30): centroids = X[np.random.choice(np.arange(len(X)), K), :] for i in range(maxIters): C = np.array([np.argmin([np.dot(x_i-y_k, x_i-y_k) for y_k in centroids]) for x_i in X]) centroids = [X[C == k].mean(axis = 0) for k in range(K)] return np.a...
[ "numpy.size", "numpy.transpose", "numpy.ones", "numpy.shape", "numpy.nonzero", "numpy.array", "numpy.dot", "numpy.cov", "numpy.ndarray", "numpy.concatenate" ]
[((390, 404), 'numpy.shape', 'np.shape', (['Data'], {}), '(Data)\n', (398, 404), True, 'import numpy as np\n'), ((418, 449), 'numpy.ndarray', 'np.ndarray', ([], {'shape': '(1, nbStates)'}), '(shape=(1, nbStates))\n', (428, 449), True, 'import numpy as np\n'), ((464, 506), 'numpy.ndarray', 'np.ndarray', ([], {'shape': '...
# MIT License # Copyright (c) 2019 Runway AI, Inc # 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,...
[ "numpy.random.seed", "runway.run", "numpy.zeros", "numpy.clip", "runway.file", "pickle.load", "runway.vector", "runway.number", "runway.command", "tensorflow.random.set_random_seed", "dnnlib.tflib.init_tf" ]
[((1847, 1864), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1861, 1864), True, 'import numpy as np\n'), ((1865, 1893), 'tensorflow.random.set_random_seed', 'tf.random.set_random_seed', (['(0)'], {}), '(0)\n', (1890, 1893), True, 'import tensorflow as tf\n'), ((2690, 2778), 'runway.command', 'runway....
""" vanila policy gradient """ import numpy as np import scipy.signal import tensorflow as tf from gym.spaces import Box, Discrete class VPG: def __init__( self, env, learning_rate=0.01, gamma=0.95, output_graph=False, seed=1, ep_...
[ "tensorflow.reduce_sum", "numpy.random.seed", "numpy.ones", "numpy.mean", "tensorflow.one_hot", "tensorflow.nn.log_softmax", "numpy.std", "tensorflow.set_random_seed", "tensorflow.placeholder", "tensorflow.summary.FileWriter", "tensorflow.exp", "tensorflow.name_scope", "tensorflow.global_var...
[((410, 430), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (424, 430), True, 'import numpy as np\n'), ((439, 463), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['seed'], {}), '(seed)\n', (457, 463), True, 'import tensorflow as tf\n'), ((839, 908), 'tensorflow.placeholder', 'tf.placeholder'...
import numpy as np from mpl_toolkits.mplot3d import Axes3D # Axes3D import has side effects, it enables using projection='3d' in add_subplot import matplotlib import matplotlib.pyplot as plt from matplotlib import cm #from matplotlib.ticker import LinearLocator, FormatStrFormatter #import pdb def surfForcePlot(prob)...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.locator_params", "matplotlib.colors.Normalize", "matplotlib.cm.coolwarm", "matplotlib.cm.ScalarMappable", "matplotlib.pyplot.axis", "matplotlib.pyplot.colorbar", "numpy.shape", "matplotlib.pyplot.figure", "numpy.linalg.norm"...
[((1305, 1320), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (1318, 1320), False, 'import pdb\n'), ((1352, 1390), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {'figsize': '(5, 4)', 'dpi': '(300)'}), '(1, figsize=(5, 4), dpi=300)\n', (1362, 1390), True, 'import matplotlib.pyplot as plt\n'), ((1924, 1934), ...
import numpy as np from . import _sequential, _vectorized, _cuda from .. import settings # Operators map. _operations = None def set_mode(device): """Set The Operation Mode by Switching The Map of Operators. :param device: str, ('default', 'sequential', 'vectorized' or 'gpu'): which device should p...
[ "numpy.sum", "numpy.argmax" ]
[((2772, 2833), 'numpy.sum', 'np.sum', (['a'], {'axis': 'axis', 'dtype': 'dtype', 'out': 'out', 'keepdims': 'keepdims'}), '(a, axis=axis, dtype=dtype, out=out, keepdims=keepdims)\n', (2778, 2833), True, 'import numpy as np\n'), ((2883, 2915), 'numpy.argmax', 'np.argmax', (['a'], {'axis': 'axis', 'out': 'out'}), '(a, ax...
from typing import Callable, Optional, Tuple import numpy as np from numpy import ndarray from skfem.element import (BOUNDARY_ELEMENT_MAP, DiscreteField, Element, ElementHex0, ElementQuad0, ElementTetP0, ElementTriP0) from skfem.mapping import Mapping from skfem.me...
[ "skfem.utils.projection", "numpy.nonzero", "numpy.tile", "numpy.array" ]
[((4615, 4647), 'skfem.utils.projection', 'projection', (['x', 'fbasis', 'self'], {'I': 'I'}), '(x, fbasis, self, I=I)\n', (4625, 4647), False, 'from skfem.utils import projection\n'), ((3032, 3065), 'numpy.tile', 'np.tile', (['self.W', '(self.nelems, 1)'], {}), '(self.W, (self.nelems, 1))\n', (3039, 3065), True, 'impo...
###################################################################################################### # # Organization: Asociacion De Investigacion En Inteligencia Artificial Para La Leucemia Peter Moss # Repository: HIAS: Hospital Intelligent Automation System # Project: TassAI # # Author: <NAME> (<EMA...
[ "os.path.abspath", "Classes.OpenVINO.ie_module.InferenceContext", "Classes.OpenVINO.faces_database.FacesDatabase", "cv2.getTextSize", "numpy.expand_dims", "Classes.OpenVINO.face_identifier.FaceIdentifier", "Classes.OpenVINO.face_detector.FaceDetector", "numpy.array", "os.path.splitext", "Classes.H...
[((1149, 1173), 'Classes.Helpers.Helpers', 'Helpers', (['"""TassAI"""', '(False)'], {}), "('TassAI', False)\n", (1156, 1173), False, 'from Classes.Helpers import Helpers\n'), ((1207, 1429), 'Classes.OpenVINO.ie_module.InferenceContext', 'InferenceContext', (["[self.Helpers.confs['iotJumpWay']['MQTT']['TassAI']['runas']...
from random import randint import random import numpy as np import cv2 import matplotlib.pyplot as plt import pickle import os.path MUTATE_PROBABILITY = 1 # (out of 100) # NUM_PIXELS = 7896 NUM_MOVES = 6 class Strategy(object): def __init__(self, w0 = None, b0 = None, ...
[ "random.randint", "numpy.argmax", "numpy.empty", "cv2.threshold", "numpy.where", "numpy.exp", "numpy.random.rand", "cv2.resize" ]
[((1265, 1318), 'cv2.threshold', 'cv2.threshold', (['observation', '(1)', '(255)', 'cv2.THRESH_BINARY'], {}), '(observation, 1, 255, cv2.THRESH_BINARY)\n', (1278, 1318), False, 'import cv2\n'), ((1375, 1417), 'numpy.where', 'np.where', (['(observation == 0)', 'observation', '(1)'], {}), '(observation == 0, observation,...
import numpy as np def _generate_autoregressive_mask(input_ordering, output_ordering): input_size = len(input_ordering) output_size = len(output_ordering) connections_mask = np.ones((input_size, output_size)) for i in range(input_size): connections_mask[i, :] *= ( input_ordering[i]...
[ "numpy.unique", "numpy.arange", "numpy.ones", "numpy.random.RandomState" ]
[((188, 222), 'numpy.ones', 'np.ones', (['(input_size, output_size)'], {}), '((input_size, output_size))\n', (195, 222), True, 'import numpy as np\n'), ((619, 642), 'numpy.random.RandomState', 'np.random.RandomState', ([], {}), '()\n', (640, 642), True, 'import numpy as np\n'), ((1159, 1185), 'numpy.arange', 'np.arange...
from ..tinyhouse import HaplotypeOperations from ..tinyhouse import BasicHMM from ..tinyhouse import ProbMath from ..tinyhouse import InputOutput from . import FamilySingleLocusPeeling import math import numpy as np from numba import jit, njit import math def imputeFamUsingFullSibs(fam, pedigree, args) : #Pipel...
[ "numpy.full", "numpy.random.random", "numpy.round" ]
[((3746, 3786), 'numpy.full', 'np.full', (['(2, nLoci)', '(0)'], {'dtype': 'np.float32'}), '((2, nLoci), 0, dtype=np.float32)\n', (3753, 3786), True, 'import numpy as np\n'), ((3809, 3849), 'numpy.full', 'np.full', (['(2, nLoci)', '(0)'], {'dtype': 'np.float32'}), '((2, nLoci), 0, dtype=np.float32)\n', (3816, 3849), Tr...
#!/usr/bin/env python import cv2 import numpy as np def main(): cap = cv2.VideoCapture(0) while(cap.isOpened()): ret, img = cap.read() skinMask = HSVBin(img) contours = getContours(skinMask) cv2.drawContours(img, contours, -1, (0, 255, 0), 2) cv2.imshow('capture',...
[ "cv2.contourArea", "cv2.cvtColor", "cv2.morphologyEx", "cv2.waitKey", "numpy.ones", "cv2.VideoCapture", "numpy.array", "cv2.convexHull", "cv2.drawContours", "cv2.imshow", "cv2.inRange", "cv2.findContours" ]
[((75, 94), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (91, 94), False, 'import cv2\n'), ((427, 452), 'numpy.ones', 'np.ones', (['(5, 5)', 'np.uint8'], {}), '((5, 5), np.uint8)\n', (434, 452), True, 'import numpy as np\n'), ((464, 509), 'cv2.morphologyEx', 'cv2.morphologyEx', (['img', 'cv2.MORPH_OP...
import unittest.mock as mock import pytest import numpy as np import tensorflow as tf from unitytrainers.bc.models import BehavioralCloningModel from unityagents import UnityEnvironment from .mock_communicator import MockCommunicator @mock.patch('unityagents.UnityEnvironment.executable_launcher') @mock.patch('unity...
[ "unitytrainers.bc.models.BehavioralCloningModel", "tensorflow.global_variables_initializer", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.variable_scope", "numpy.ones", "pytest.main", "unittest.mock.patch", "numpy.array", "unityagents.UnityEnvironment" ]
[((239, 301), 'unittest.mock.patch', 'mock.patch', (['"""unityagents.UnityEnvironment.executable_launcher"""'], {}), "('unityagents.UnityEnvironment.executable_launcher')\n", (249, 301), True, 'import unittest.mock as mock\n'), ((303, 362), 'unittest.mock.patch', 'mock.patch', (['"""unityagents.UnityEnvironment.get_com...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Community Convolutional Layer Created on Sep 19, 2018. Last edited on Oct 11, 2018. @author: <NAME> """ import logging import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.optim.optimizer import Optimizer from torch.utils.dat...
[ "torch.nn.Dropout", "torch.from_numpy", "logging.debug", "numpy.sum", "torch.zeros_like", "math.sqrt", "torch.nn.Tanh", "torch.nn.BatchNorm1d", "scipy.optimize.fsolve", "torch.cat", "logging.info", "torch.nn.ModuleDict", "torch.empty_like", "torch.nn.Linear", "torch.zeros", "torch.nn.f...
[((8882, 8897), 'torch.nn.ModuleDict', 'nn.ModuleDict', ([], {}), '()\n', (8895, 8897), True, 'import torch.nn as nn\n'), ((8923, 8938), 'torch.nn.ModuleDict', 'nn.ModuleDict', ([], {}), '()\n', (8936, 8938), True, 'import torch.nn as nn\n'), ((8968, 8983), 'torch.nn.ModuleDict', 'nn.ModuleDict', ([], {}), '()\n', (898...
import numpy as np def degrees_to_radians(degrees): """ Converts degrees to radians @param: degrees """ radians = (degrees/360.0)*2*np.pi return radians def V2T( V ): """ V2T converts 1x6 vector into 4x4 transformation matrix @param: V - 1x6 vector of form [x,y,z,rx,ry...
[ "numpy.sum", "numpy.ones", "numpy.shape", "numpy.sin", "numpy.linalg.norm", "numpy.copy", "numpy.insert", "numpy.reshape", "numpy.column_stack", "numpy.linalg.det", "numpy.arccos", "numpy.size", "numpy.cos", "numpy.zeros", "numpy.any", "numpy.where", "numpy.array", "numpy.sign", ...
[((631, 640), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (637, 640), True, 'import numpy as np\n'), ((1122, 1139), 'numpy.linalg.norm', 'np.linalg.norm', (['V'], {}), '(V)\n', (1136, 1139), True, 'import numpy as np\n'), ((1759, 1775), 'numpy.zeros', 'np.zeros', (['(1, 6)'], {}), '((1, 6))\n', (1767, 1775), True, '...
#!/usr/bin/python3 """ A script to test mecanum driver """ import time import numpy as np from drivers.mecanum_driver import MecanumDriver wheels = MecanumDriver() try: while True: act = np.random.randint(0,10) wheels.set_action(int(act)) time.sleep(2) except KeyboardInterrupt: prin...
[ "numpy.random.randint", "drivers.mecanum_driver.MecanumDriver", "time.sleep" ]
[((149, 164), 'drivers.mecanum_driver.MecanumDriver', 'MecanumDriver', ([], {}), '()\n', (162, 164), False, 'from drivers.mecanum_driver import MecanumDriver\n'), ((200, 224), 'numpy.random.randint', 'np.random.randint', (['(0)', '(10)'], {}), '(0, 10)\n', (217, 224), True, 'import numpy as np\n'), ((268, 281), 'time.s...
from . import config import datarobot as dr from datarobot.errors import ClientError import pickle import logging from warnings import warn from warnings import catch_warnings from datarobot.models import featurelist import pandas as pd import numpy as np from statistics import mean from statistics import median f...
[ "matplotlib.pyplot.title", "datarobot.Project.get", "pandas.DataFrame", "datarobot.models.featurelist.lower", "statistics.median", "matplotlib.pyplot.style.context", "datarobot.Client", "collections.defaultdict", "datarobot.Project.list", "seaborn.boxplot", "numpy.array", "warnings.catch_warni...
[((418, 445), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (435, 445), False, 'import logging\n'), ((12260, 12277), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (12271, 12277), False, 'from collections import defaultdict\n'), ((20197, 20208), 'numpy.array', 'np....
from __future__ import print_function import os import sys import pdb import copy import sklearn import tensorflow as tf import pandas as pd import PIL import numpy as np import keras from keras.models import load_model import function as func import function_dl as func_dl def cnn_prediction(cnv_file, model_file, use_...
[ "keras.models.load_model", "copy.deepcopy", "numpy.argmax", "pandas.read_csv", "tensorflow.test.is_built_with_cuda", "function.showDateTime", "tensorflow.config.list_physical_devices", "numpy.isnan", "numpy.max", "function_dl.loadImgs", "function.global_variables", "pdb.set_trace", "sys.exc_...
[((1179, 1202), 'function.showDateTime', 'func.showDateTime', (['"""\t"""'], {}), "('\\t')\n", (1196, 1202), True, 'import function as func\n'), ((1523, 1546), 'function.showDateTime', 'func.showDateTime', (['"""\t"""'], {}), "('\\t')\n", (1540, 1546), True, 'import function as func\n'), ((1610, 1631), 'pandas.read_csv...
import numpy as np import pickle import mltools as ml from homework4.problem_2 import sample_train if __name__ == "__main__": X = np.genfromtxt('data/X_train.txt', delimiter=None) x_xfm = ml.transforms.fpoly(X, 2) Y = np.genfromtxt('data/Y_train.txt', delimiter=None)[:, np.newaxis] raw_data = np.concat...
[ "pickle.dump", "numpy.logspace", "numpy.genfromtxt", "homework4.problem_2.sample_train", "mltools.transforms.fpoly", "numpy.concatenate" ]
[((135, 184), 'numpy.genfromtxt', 'np.genfromtxt', (['"""data/X_train.txt"""'], {'delimiter': 'None'}), "('data/X_train.txt', delimiter=None)\n", (148, 184), True, 'import numpy as np\n'), ((197, 222), 'mltools.transforms.fpoly', 'ml.transforms.fpoly', (['X', '(2)'], {}), '(X, 2)\n', (216, 222), True, 'import mltools a...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The array_analysis test suite. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from future.builtins import * # NOQA import unittest import numpy as np from obspy.signal.array_analysis import array_rota...
[ "unittest.main", "numpy.empty", "unittest.makeSuite", "numpy.zeros", "obspy.signal.array_analysis.get_geometry", "obspy.signal.array_analysis.array_rotation_strain", "numpy.array", "numpy.linspace", "numpy.testing.assert_array_almost_equal" ]
[((8101, 8142), 'unittest.makeSuite', 'unittest.makeSuite', (['ArrayTestCase', '"""test"""'], {}), "(ArrayTestCase, 'test')\n", (8119, 8142), False, 'import unittest\n'), ((8176, 8210), 'unittest.main', 'unittest.main', ([], {'defaultTest': '"""suite"""'}), "(defaultTest='suite')\n", (8189, 8210), False, 'import unitte...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Nov 4 20:25:09 2018 @author: Kazuki """ import numpy as np import pandas as pd #import os #from multiprocessing import cpu_count, Pool #import utils def multi_weighted_logloss(y_true, y_pred, myweight=None, based_true=True): """ @author oliv...
[ "pandas.DataFrame", "numpy.nansum", "numpy.zeros_like", "numpy.sum", "numpy.log", "numpy.ones", "numpy.clip" ]
[((1101, 1133), 'numpy.clip', 'np.clip', ([], {'a': 'y_p', 'a_min': '(0)', 'a_max': '(1)'}), '(a=y_p, a_min=0, a_max=1)\n', (1108, 1133), True, 'import numpy as np\n'), ((1171, 1182), 'numpy.log', 'np.log', (['y_p'], {}), '(y_p)\n', (1177, 1182), True, 'import numpy as np\n'), ((1401, 1433), 'numpy.sum', 'np.sum', (['(...
''' This code include: 1. Training DPDist model, then it can be taken for any comparing point cloud tasks (an example for training registration is in PCRNet folder) 2. Simple auto encoder based on point net (can be replaced in any comparing point cloud task, or any other AUE) 3. Training compone...
[ "os.mkdir", "tensorflow.reduce_sum", "argparse.ArgumentParser", "tensorflow.get_collection", "tensorflow.maximum", "tensorflow.variables_initializer", "tensorflow.constant_initializer", "tensorflow.get_variable_scope", "numpy.ones", "tensorflow.ConfigProto", "tensorflow.global_variables", "num...
[((1029, 1054), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (1044, 1054), False, 'import sys\n'), ((1225, 1250), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1248, 1250), False, 'import argparse\n'), ((5591, 5627), 'importlib.import_module', 'importlib.import_mo...
#!/usr/bin/env python from scipy import stats import os import sys from wfdb import processing from scipy.signal import find_peaks import pyhrv.nonlinear as nl from contextlib import contextmanager import pywt from numpy import cumsum, log, polyfit, sqrt, std, subtract from scipy.signal import butter, filtfilt, iirnot...
[ "numpy.amin", "pyhrv.nonlinear.poincare", "pywt.cwt", "numpy.clip", "scipy.signal.find_peaks", "numpy.linalg.norm", "numpy.mean", "wfdb.processing.gqrs_detect", "numpy.std", "scipy.stats.tvar", "scipy.signal.iirnotch", "scipy.signal.butter", "numpy.median", "numpy.hstack", "numpy.concate...
[((975, 1030), 'scipy.signal.butter', 'butter', (['order', 'normal_cutoff'], {'btype': '"""low"""', 'analog': '(False)'}), "(order, normal_cutoff, btype='low', analog=False)\n", (981, 1030), False, 'from scipy.signal import butter, filtfilt, iirnotch, savgol_filter\n'), ((1172, 1228), 'scipy.signal.butter', 'butter', (...
print("Loading...") import sys import logging logging.getLogger().setLevel(logging.DEBUG) import os import tkinter as tk from tkinter import filedialog import matplotlib.pyplot as plt import numpy as np import pandas as pd import pyabf from numpy import genfromtxt print("Loaded external libraries") from pyAPisolat...
[ "pandas.DataFrame", "pyAPisolation.patch_utils.load_protocols", "logging.basicConfig", "tkinter.filedialog.askdirectory", "numpy.fromstring", "numpy.array", "pyAPisolation.abf_featureextractor.folder_feature_extract", "numpy.float64", "pyAPisolation.abf_featureextractor.save_data_frames", "tkinter...
[((491, 531), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (510, 531), False, 'import logging\n'), ((543, 550), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (548, 550), True, 'import tkinter as tk\n'), ((583, 626), 'tkinter.filedialog.askdirectory', 'filedialog....
""" DFO_MoM.py -- update Mom with DFO -- Read Final_Attributes_yyyymmddhhHWRFUpdated.csv as MOM File and DFO_yyyymmdd.csv as DFO File. -- Write the output Final_Attributes_yyyymmddhhMOM+DFOUpdated.csv and Attributes_clean_yyyymmddhhMOM+DFOUpdated.csv file. """ import csv,sys import pandas...
[ "pandas.DataFrame", "os.remove", "csv.reader", "csv.writer", "numpy.log", "pandas.read_csv", "os.getcwd", "pandas.merge", "os.path.exists", "sys.path.insert", "os.chdir", "HWRF_MoM.update_HWRF_MoM", "os.path.expanduser", "os.listdir" ]
[((499, 516), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (510, 516), True, 'import pandas as pd\n'), ((526, 542), 'pandas.DataFrame', 'pd.DataFrame', (['df'], {}), '(df)\n', (538, 542), True, 'import pandas as pd\n'), ((6890, 7014), 'pandas.merge', 'pd.merge', (['Attributes', "PDC_resilience[['ISO', ...
import numpy as np import numpy.linalg as la class StateSpace(object): def __init__(self, a, b, c=None, d=None, x0=None, u0=None): self.a = a self.b = b self.c = c self.d = d self.x0 = x0 self.x = x0 self.u0 = u0 self.n = self.a.shape[0] s...
[ "numpy.eye", "numpy.zeros", "numpy.linalg.inv", "numpy.arange", "numpy.dot" ]
[((985, 999), 'numpy.eye', 'np.eye', (['self.n'], {}), '(self.n)\n', (991, 999), True, 'import numpy as np\n'), ((1020, 1045), 'numpy.linalg.inv', 'la.inv', (['(eye - dt * self.a)'], {}), '(eye - dt * self.a)\n', (1026, 1045), True, 'import numpy.linalg as la\n'), ((1065, 1094), 'numpy.dot', 'np.dot', (['self.apr', '(d...
# -*- coding: utf-8 -*- # !/usr/bin/python import os import sys import random import cv2 from PIL import Image import cv2 as cv, numpy as np from PIL import ImageFilter type_list = [16, 19] number_list = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] ftp = open("./bank_txt") #不同银行卡号的开头 b_list = [] for line...
[ "PIL.ImageFilter.GaussianBlur", "cv2.bitwise_not", "random.randint", "cv2.bitwise_and", "cv2.cvtColor", "numpy.asarray", "cv2.threshold", "random.choice", "PIL.Image.open", "cv2.imread", "numpy.array", "PIL.Image.blend", "cv2.add", "numpy.concatenate" ]
[((1657, 1677), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (1671, 1677), False, 'import random\n'), ((2592, 2612), 'random.randint', 'random.randint', (['(0)', '(3)'], {}), '(0, 3)\n', (2606, 2612), False, 'import random\n'), ((4087, 4108), 'random.randint', 'random.randint', (['(1)', '(15)']...
#SHARED UTILITY TOOLS AND VARIABLES import numpy import scipy.io.wavfile def pad_signal(signal, sampling_rate, time_step = 0.01, frame_window = 0.025): """segement a signal, 1D audio signal, into frames, such that: output: N by M matrix, in which: each row is a segment of frame_window's audio s...
[ "numpy.full", "numpy.triu", "numpy.tril", "numpy.empty", "numpy.sin", "numpy.random.randint", "numpy.where" ]
[((1340, 1365), 'numpy.full', 'numpy.full', (['length', '(False)'], {}), '(length, False)\n', (1350, 1365), False, 'import numpy\n'), ((3160, 3174), 'numpy.empty', 'numpy.empty', (['N'], {}), '(N)\n', (3171, 3174), False, 'import numpy\n'), ((4487, 4551), 'numpy.sin', 'numpy.sin', (['(2 * numpy.pi * frequency * times /...
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.3 # kernelspec: # display_name: Python 3 # name: python3 # --- # + [markdown] id="view-in-github" colab_type="text" # <a href="https://colab...
[ "matplotlib.pyplot.title", "numpyro.infer.MCMC", "numpyro.infer.init_to_value", "numpyro.distributions.Normal", "pandas.read_csv", "numpyro.distributions.Gamma", "arviz.plot_kde", "jax.random.PRNGKey", "matplotlib.pyplot.figure", "numpy.mean", "numpyro.distributions.Categorical", "numpy.set_pr...
[((1095, 1127), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)'}), '(precision=3)\n', (1114, 1127), True, 'import numpy as np\n'), ((1836, 1853), 'jax.random.PRNGKey', 'random.PRNGKey', (['(0)'], {}), '(0)\n', (1850, 1853), False, 'from jax import random, vmap\n'), ((1874, 1895), 'jax.random.s...
import logging import numpy as np from pomegranate.distributions.DiscreteDistribution import DiscreteDistribution from scipy.stats import entropy class GenerativeModel: """ Predictive Processing Generative Model This is a generative model, implemented as a Bayesian Causal Network. The three functions ...
[ "scipy.stats.entropy", "logging.debug", "numpy.argmax" ]
[((5025, 5043), 'scipy.stats.entropy', 'entropy', (['obs', 'pred'], {}), '(obs, pred)\n', (5032, 5043), False, 'from scipy.stats import entropy\n'), ((5450, 5471), 'scipy.stats.entropy', 'entropy', (['pred'], {'base': '(2)'}), '(pred, base=2)\n', (5457, 5471), False, 'from scipy.stats import entropy\n'), ((6848, 6888),...
import numpy as np import copy from classtestify import Testify from classcapability import Capability from classtable import Table from class2ndmethod import SecondMethod from class2Randr import SecondRate from class1stRandr import FirstRate r""" INPUT: - ''demands'' -- [K*I] matrix: which user is asking for w...
[ "class2ndmethod.SecondMethod", "class2Randr.SecondRate", "classtable.Table", "classcapability.Capability", "numpy.array", "class1stRandr.FirstRate" ]
[((529, 663), 'numpy.array', 'np.array', (['[[1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0,\n 0], [0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1]]'], {}), '([[1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0,\n 0, 1, 0, 0], [0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1]])\n', (537, 663...
import os import time import numpy as np import pandas as pd import torch import torch.nn as nn import torch.optim as optim from torch.optim.lr_scheduler import StepLR from pathlib import Path from copy import deepcopy from ESRNN.utils.config import ModelConfig from ESRNN.utils.ESRNN import _ESRNN f...
[ "numpy.random.seed", "torch.optim.lr_scheduler.StepLR", "ESRNN.utils.data.Iterator", "pathlib.Path", "numpy.mean", "ESRNN.utils.losses.SmylLoss", "torch.no_grad", "os.path.join", "numpy.round", "numpy.unique", "ESRNN.utils_evaluation.owa", "ESRNN.utils.config.ModelConfig", "torch.load", "o...
[((4836, 5707), 'ESRNN.utils.config.ModelConfig', 'ModelConfig', ([], {'max_epochs': 'max_epochs', 'batch_size': 'batch_size', 'batch_size_test': 'batch_size_test', 'freq_of_test': 'freq_of_test', 'learning_rate': 'learning_rate', 'lr_scheduler_step_size': 'lr_scheduler_step_size', 'lr_decay': 'lr_decay', 'per_series_l...
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
[ "numpy.load", "argparse.ArgumentParser", "os.makedirs", "dnnlib.util.open_url", "dnnlib.tflib.init_tf", "pickle.load", "numpy.array", "imageio.get_writer", "re.compile" ]
[((846, 861), 'dnnlib.tflib.init_tf', 'tflib.init_tf', ([], {}), '()\n', (859, 861), True, 'import dnnlib.tflib as tflib\n'), ((1011, 1045), 'os.makedirs', 'os.makedirs', (['outdir'], {'exist_ok': '(True)'}), '(outdir, exist_ok=True)\n', (1022, 1045), False, 'import os\n'), ((2269, 2298), 're.compile', 're.compile', ([...
import numpy as np def is_rated(M: np.array, index: (int, int)): if M[index] < 0 and M[index] != -1: raise ValueError("M[%d, %d] = %f should be -1 denoting null" % (index[0], index[1], M[index])) return M[index] >= 0 def is_null(M: np.array, index: (int, int)): return not is_rated(M, index) de...
[ "numpy.ndindex" ]
[((475, 494), 'numpy.ndindex', 'np.ndindex', (['M.shape'], {}), '(M.shape)\n', (485, 494), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- # # QTPyLib: Quantitative Trading Python Library # https://github.com/ranaroussi/qtpylib # # Copyright 2016-2018 <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 ...
[ "talib.abstract.CDLHAMMER", "numpy.isnan", "talib.abstract.STOCH", "numpy.exp", "talib.abstract.RSI", "freqtrade.vendor.qtpylib.indicators.typical_price", "talib.abstract.SAR" ]
[((1949, 1968), 'talib.abstract.STOCH', 'ta.STOCH', (['dataframe'], {}), '(dataframe)\n', (1957, 1968), True, 'import talib.abstract as ta\n'), ((2055, 2072), 'talib.abstract.RSI', 'ta.RSI', (['dataframe'], {}), '(dataframe)\n', (2061, 2072), True, 'import talib.abstract as ta\n'), ((2513, 2530), 'talib.abstract.SAR', ...
import cv2 import numpy as np from colors import * def get_class_names(label_path): with open(label_path, 'rt') as f: classes = f.read().rstrip('\n').split('\n') return classes if classes else None class DetectBoxes: def __init__(self, label_path, confidence_threshold=0.5, nms_threshold=0, mask_...
[ "cv2.findContours", "cv2.putText", "cv2.dnn.NMSBoxes", "numpy.argmax", "cv2.getTextSize", "cv2.rectangle", "cv2.drawContours", "cv2.resize" ]
[((2729, 2804), 'cv2.dnn.NMSBoxes', 'cv2.dnn.NMSBoxes', (['boxes', 'confidences', 'self.confThreshold', 'self.nmsThreshold'], {}), '(boxes, confidences, self.confThreshold, self.nmsThreshold)\n', (2745, 2804), False, 'import cv2\n'), ((4583, 4659), 'cv2.rectangle', 'cv2.rectangle', (['frame', '(left, top)', '(right, bo...
#!/usr/bin/env python """Functions useful for manipulating atom connectivity. The original use of these functions is to allow for assign_charges to work and be able to give a molecule, cluster or periodic cell of atoms the same charges as another molecule, cluster or periodic cell. Includes a utility to read a molec...
[ "fromage.io.read_file.read_g_char", "numpy.count_nonzero", "argparse.ArgumentParser", "numpy.copy", "numpy.zeros", "fromage.io.read_file.mol_from_gauss", "numpy.array_equal", "fromage.io.read_file.mol_from_file" ]
[((1213, 1252), 'numpy.zeros', 'np.zeros', (['(nat_mol, nat_mol)'], {'dtype': 'int'}), '((nat_mol, nat_mol), dtype=int)\n', (1221, 1252), True, 'import numpy as np\n'), ((2178, 2193), 'numpy.copy', 'np.copy', (['in_mat'], {}), '(in_mat)\n', (2185, 2193), True, 'import numpy as np\n'), ((3064, 3079), 'numpy.copy', 'np.c...
#!/usr/bin/env python """ FakeTui ======== Simply emulates a table for testing It listens to /arm_action_beliefs and maintains a list of current blocks and publishes to /blocks when it updates """ import rospy from std_msgs.msg import String from dautils import get_tuio_bounds, get_arm_bounds, arm_to_tuio, is_arm_cali...
[ "dautils.is_arm_calibrated", "rospy.Subscriber", "json.loads", "rospy.Publisher", "numpy.argmin", "dautils.get_arm_bounds", "rospy.loginfo", "json.dumps", "numpy.min", "numpy.array", "rospy.init_node", "rospy.spin", "dautils.get_tuio_bounds" ]
[((1945, 1957), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (1955, 1957), False, 'import rospy\n'), ((470, 514), 'rospy.init_node', 'rospy.init_node', (['"""fake_tui"""'], {'anonymous': '(False)'}), "('fake_tui', anonymous=False)\n", (485, 514), False, 'import rospy\n'), ((546, 580), 'rospy.Publisher', 'rospy.Publish...
""" This program file contains all the functions implemented to load and preprocess the dataset for OVC """ import torch from torch.autograd import Variable import torch.nn as nn import math import numpy as np from nltk.tokenize import sent_tokenize import re from machine_translation_vision.samplers import BucketBatch...
[ "unicodedata.normalize", "torch.zeros_like", "torch.LongTensor", "random.shuffle", "unicodedata.category", "math.floor", "numpy.zeros", "torch.FloatTensor", "numpy.argsort", "nltk.tokenize.sent_tokenize", "torch.cuda.is_available", "numpy.array", "machine_translation_vision.samplers.BucketBa...
[((494, 519), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (517, 519), False, 'import torch\n'), ((4337, 4371), 'unicodedata.normalize', 'unicodedata.normalize', (['"""NFD"""', 'text'], {}), "('NFD', text)\n", (4358, 4371), False, 'import unicodedata\n'), ((7636, 7670), 'math.floor', 'math.fl...
import grace import grace.mask import grace.times import grace.ols import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.basemap as maps import sklearn.mixture import sklearn.decomposition # Transform grids data shape = grace.grids.shape X = grace.grids.reshape(shape[0] * shape[1], shape[2]) mask = ...
[ "numpy.save", "grace.mask.world", "grace.grids.reshape" ]
[((262, 312), 'grace.grids.reshape', 'grace.grids.reshape', (['(shape[0] * shape[1])', 'shape[2]'], {}), '(shape[0] * shape[1], shape[2])\n', (281, 312), False, 'import grace\n'), ((320, 338), 'grace.mask.world', 'grace.mask.world', ([], {}), '()\n', (336, 338), False, 'import grace\n'), ((514, 571), 'numpy.save', 'np....
import rclpy from rclpy.node import Node from rclpy.qos import qos_profile_sensor_data from sensor_msgs.msg import LaserScan import cv2 import numpy as np import math from sensor_msgs.msg import Imu def euler_from_quaternion(x, y, z, w): """ Convert a quaternion into euler angles (roll, pitch, yaw) ...
[ "math.asin", "math.atan2", "rclpy.shutdown", "numpy.sin", "cv2.rectangle", "cv2.HoughLinesP", "cv2.imshow", "cv2.line", "rclpy.spin", "cv2.cvtColor", "cv2.Canny", "numpy.uint8", "cv2.waitKey", "numpy.square", "numpy.cos", "cv2.flip", "cv2.rotate", "rclpy.init", "numpy.zeros" ]
[((616, 634), 'math.atan2', 'math.atan2', (['t0', 't1'], {}), '(t0, t1)\n', (626, 634), False, 'import math\n'), ((773, 786), 'math.asin', 'math.asin', (['t2'], {}), '(t2)\n', (782, 786), False, 'import math\n'), ((887, 905), 'math.atan2', 'math.atan2', (['t3', 't4'], {}), '(t3, t4)\n', (897, 905), False, 'import math\...
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
[ "numpy.stack", "contours.ContourBox.LevelSetAlignment", "coarse_to_fine.input_reader.InputReaderSemMat2BaseName", "coarse_to_fine.input_reader.InputReaderBaseName", "ast.literal_eval", "argparse.ArgumentParser", "os.makedirs", "os.path.isdir", "numpy.zeros", "numpy.expand_dims", "numpy.any", "...
[((3693, 3718), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3716, 3718), False, 'import argparse\n'), ((5933, 5995), 'coarse_to_fine.input_reader.InputReaderBaseName', 'InputReaderBaseName', (['in_dir', 'val_file_list', 'n_classes_interval'], {}), '(in_dir, val_file_list, n_classes_interval...
import numpy as np import cv2 import os def nothing(x): pass def loadFile(fname): x=np.load(fname) x = x/x.max() (h,w) = x.shape[:2] center = (w/2,h/2) #return x rx = cv2.resize(x, (640,480))# interpolation = cv2.INTER_AREA) return rx def getFilenames(base_dir): my_list=[] fo...
[ "cv2.createTrackbar", "numpy.load", "cv2.waitKey", "os.walk", "cv2.imshow", "numpy.clip", "cv2.namedWindow", "cv2.getTrackbarPos", "cv2.destroyAllWindows", "cv2.resize" ]
[((473, 497), 'cv2.namedWindow', 'cv2.namedWindow', (['"""image"""'], {}), "('image')\n", (488, 497), False, 'import cv2\n'), ((498, 553), 'cv2.createTrackbar', 'cv2.createTrackbar', (['"""val"""', '"""image"""', '(0.0)', '(100.0)', 'nothing'], {}), "('val', 'image', 0.0, 100.0, nothing)\n", (516, 553), False, 'import ...
from pathlib import Path from typing import List import click from PIL import Image # Load image from numpy import zeros, dtype from numpy import asarray def get_neighbors(x: int, y: int, source) -> List[int]: source_height, source_width = source.shape n = [] for n_x_o in (-1, 0, 1): for n_y_o i...
[ "numpy.dtype", "click.command", "click.Choice", "pathlib.Path", "click.Path", "PIL.Image.fromarray" ]
[((1082, 1097), 'click.command', 'click.command', ([], {}), '()\n', (1095, 1097), False, 'import click\n'), ((1486, 1495), 'pathlib.Path', 'Path', (['src'], {}), '(src)\n', (1490, 1495), False, 'from pathlib import Path\n'), ((1518, 1527), 'pathlib.Path', 'Path', (['dst'], {}), '(dst)\n', (1522, 1527), False, 'from pat...
# -*- coding: utf-8 -*- import os import torch from torchtext.data import Field from onmt.inputters.datareader_base import DataReaderBase # domain specific dependencies try: import numpy as np except ImportError: np = None class MatrixDataReader(DataReaderBase): """Read matrix data from disk.""" ...
[ "os.path.exists", "numpy.loadtxt", "onmt.inputters.datareader_base.DataReaderBase._read_file", "os.path.join", "torch.tensor" ]
[((874, 913), 'onmt.inputters.datareader_base.DataReaderBase._read_file', 'DataReaderBase._read_file', (['matrix_files'], {}), '(matrix_files)\n', (899, 913), False, 'from onmt.inputters.datareader_base import DataReaderBase\n'), ((1046, 1078), 'os.path.join', 'os.path.join', (['data_dir', 'filename'], {}), '(data_dir,...
import dolfin as df import numpy as np import os from . import * from common.io import mpi_is_root, load_mesh, mpi_barrier, mpi_comm, mpi_bcast, mpi_gather from common.bcs import Fixed, Pressure, NoSlip, ContactAngle # from ufl import max_value __author__ = "<NAME>" #################### # # This is a 2D demo for simul...
[ "common.io.mpi_is_root", "numpy.amin", "dolfin.MeshValueCollection", "dolfin.Constant", "os.path.join", "common.io.mpi_gather", "common.bcs.ContactAngle", "dolfin.Mesh", "dolfin.Expression", "common.io.mpi_bcast", "dolfin.vertices", "common.io.mpi_barrier", "dolfin.cpp.mesh.MeshFunctionSizet...
[((1127, 1140), 'common.io.mpi_is_root', 'mpi_is_root', ([], {}), '()\n', (1138, 1140), False, 'from common.io import mpi_is_root, load_mesh, mpi_barrier, mpi_comm, mpi_bcast, mpi_gather\n'), ((1308, 1355), 'dolfin.MeshValueCollection', 'df.MeshValueCollection', (['"""size_t"""', 'mesh', '(dim - 1)'], {}), "('size_t', ...
""" Created on 5/2/2015 @author: victor """ import numpy class BaharServerFilesParser(object): """ Reads eigenvalues/vectors generated from http://anm.csb.pitt.edu/cgi-bin/anm2/anm2.cgi """ def __init__(self): pass @classmethod def read(cls, eigenvalues_file_path, eigenvectors_fi...
[ "numpy.loadtxt" ]
[((1142, 1178), 'numpy.loadtxt', 'numpy.loadtxt', (['eigenvalues_file_path'], {}), '(eigenvalues_file_path)\n', (1155, 1178), False, 'import numpy\n'), ((1372, 1409), 'numpy.loadtxt', 'numpy.loadtxt', (['eigenvectors_file_path'], {}), '(eigenvectors_file_path)\n', (1385, 1409), False, 'import numpy\n')]
import numpy as np from pyrr import Vector3 from .mesh import Mesh from .triangle import Triangle def parse_index(value: str, length: int) -> int: vi = value.split("/") n = int(vi[0]) if n < 0: n += length return n def load_obj(path: str) -> Mesh: with open(path, "r") as file: ...
[ "pyrr.Vector3", "numpy.array" ]
[((672, 704), 'numpy.array', 'np.array', (['args'], {'dtype': 'np.float32'}), '(args, dtype=np.float32)\n', (680, 704), True, 'import numpy as np\n'), ((725, 735), 'pyrr.Vector3', 'Vector3', (['f'], {}), '(f)\n', (732, 735), False, 'from pyrr import Vector3\n')]
import sympy as sy import numpy as np from .dhmatrix import DHMatrix class SpeedKinematics: """Speed Kinematics algorithms""" @classmethod def linear_speed(cls, transform, args: dict, delta: list): yak = cls.jacobi_linear(transform, args) return np.dot(yak, np.array(delta).T) @static...
[ "numpy.array" ]
[((289, 304), 'numpy.array', 'np.array', (['delta'], {}), '(delta)\n', (297, 304), True, 'import numpy as np\n'), ((737, 752), 'numpy.array', 'np.array', (['delta'], {}), '(delta)\n', (745, 752), True, 'import numpy as np\n')]
from argparse import ArgumentParser import os import random import string import sys import numpy as np from logger import get_logger logger = get_logger(__name__) ### # file system ### def make_dirs(path, empty=False): """ create dir in path and clear dir if required """ dir_path = os.path.dirnam...
[ "os.remove", "numpy.sum", "os.makedirs", "numpy.roll", "os.path.dirname", "random.choice", "numpy.argsort", "os.path.isfile", "logger.get_logger", "numpy.reshape", "numpy.array", "numpy.eye", "os.path.join", "os.listdir" ]
[((146, 166), 'logger.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (156, 166), False, 'from logger import get_logger\n'), ((306, 327), 'os.path.dirname', 'os.path.dirname', (['path'], {}), '(path)\n', (321, 327), False, 'import os\n'), ((332, 368), 'os.makedirs', 'os.makedirs', (['dir_path'], {'exist_...
# ======================================================================== # # # Copyright (c) 2017 - 2020 scVAE authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
[ "mpl_toolkits.axes_grid1.make_axes_locatable", "seaborn.matrix.dendrogram", "scvae.analyses.figures.saving.build_figure_name", "seaborn.heatmap", "scipy.sparse.issparse", "scipy.spatial.distance.squareform", "numpy.argsort", "scvae.analyses.figures.style.reset_plot_look", "matplotlib.pyplot.figure",...
[((1186, 1228), 'scvae.analyses.figures.saving.build_figure_name', 'saving.build_figure_name', (['"""heat_map"""', 'name'], {}), "('heat_map', name)\n", (1210, 1228), False, 'from scvae.analyses.figures import saving, style\n'), ((1478, 1493), 'matplotlib.pyplot.figure', 'pyplot.figure', ([], {}), '()\n', (1491, 1493),...
""" Module description: """ __version__ = '0.1' __author__ = '<NAME>, <NAME>' __email__ = '<EMAIL>, <EMAIL>' import numpy as np from scipy import sparse as sp from sklearn.utils.extmath import randomized_svd class PureSVDModel(object): """ Simple Matrix Factorization class """ def __init__(self, f...
[ "numpy.argpartition", "scipy.sparse.diags", "numpy.array", "sklearn.utils.extmath.randomized_svd" ]
[((676, 775), 'sklearn.utils.extmath.randomized_svd', 'randomized_svd', (['self._data.sp_i_train'], {'n_components': 'self.factors', 'random_state': 'self.random_seed'}), '(self._data.sp_i_train, n_components=self.factors,\n random_state=self.random_seed)\n', (690, 775), False, 'from sklearn.utils.extmath import ran...
# %% import numpy as np import pandas as pd df = pd.read_csv('data_xhm.csv', sep=',', skiprows=0, names=['t','i','j','W']) print(df.head(5)) # %% T = np.max(df['t']) N = np.max(df['i']) # number of workers M = np.max(df['j']) print('{} periods, {} workers and {} firms.'.format(T,N,M)) # %% i = 0 W_i = df.loc[d...
[ "pandas.read_csv", "numpy.max" ]
[((53, 129), 'pandas.read_csv', 'pd.read_csv', (['"""data_xhm.csv"""'], {'sep': '""","""', 'skiprows': '(0)', 'names': "['t', 'i', 'j', 'W']"}), "('data_xhm.csv', sep=',', skiprows=0, names=['t', 'i', 'j', 'W'])\n", (64, 129), True, 'import pandas as pd\n'), ((155, 170), 'numpy.max', 'np.max', (["df['t']"], {}), "(df['...
import numpy as np import cupy as cp def _fast_expand(complex_array, factor, num_per_block=200): shp = complex_array.shape times = shp[0] expanded_array = np.zeros((shp[0], shp[1], shp[2] * factor)) for k in range(0, times, num_per_block): the_max = min([k + num_per_block, times]) weigh...
[ "cupy.zeros", "cupy.zeros_like", "cupy.array", "numpy.zeros", "cupy.mean", "numpy.arange", "cupy.tile" ]
[((168, 211), 'numpy.zeros', 'np.zeros', (['(shp[0], shp[1], shp[2] * factor)'], {}), '((shp[0], shp[1], shp[2] * factor))\n', (176, 211), True, 'import numpy as np\n'), ((1314, 1344), 'cupy.array', 'cp.array', (['arr[k:the_max, :, :]'], {}), '(arr[k:the_max, :, :])\n', (1322, 1344), True, 'import cupy as cp\n'), ((136...
import numpy as np import math # import matplotlib.pyplot as plt k = 0.1 # 前视距离系数 Lfc = 5.0 # 前视距离 Kp = 1.0 # 速度P控制器系数 dt = 0.1 # 时间间隔,单位:s L = 1.5 # 车辆轴距,单位:m class PurePursuit: def __init__(self, lng=0.0, lat=0.0, yaw=0.0, v=0.0): """ :param x: 经度 :param y: 纬度 :param yaw: 偏...
[ "math.sqrt", "math.atan2", "math.tan", "math.sin", "numpy.arange", "math.cos" ]
[((1907, 1926), 'numpy.arange', 'np.arange', (['(0)', '(50)', '(1)'], {}), '(0, 50, 1)\n', (1916, 1926), True, 'import numpy as np\n'), ((1020, 1048), 'math.sqrt', 'math.sqrt', (['(dx ** 2 + dy ** 2)'], {}), '(dx ** 2 + dy ** 2)\n', (1029, 1048), False, 'import math\n'), ((1512, 1552), 'math.atan2', 'math.atan2', (['(t...
from typing import Optional, Sequence import numpy as np class MoleculeGraphData: """MoleculeGraphData class This data class is almost same as `torch_geometric.data.Data <https://pytorch-geometric.readthedocs.io/en/latest/modules/data.html#torch_geometric.data.Data>`_. Attributes ---------- node_featur...
[ "torch.from_numpy", "numpy.array", "numpy.vstack", "torch_geometric.data.Batch.from_data_list" ]
[((4518, 4579), 'numpy.vstack', 'np.vstack', (['[graph.node_features for graph in molecule_graphs]'], {}), '([graph.node_features for graph in molecule_graphs])\n', (4527, 4579), True, 'import numpy as np\n'), ((4609, 4664), 'numpy.vstack', 'np.vstack', (['[graph.targets for graph in molecule_graphs]'], {}), '([graph.t...
from PIL import Image import os import filecmp import subprocess import re import numpy as np import matplotlib.pyplot as plt def convert_to_raw(file): """ Convert file to raw file. Args: file: file to convert. Returns: name of the raw file on filesystem """ ...
[ "re.match", "PIL.Image.open", "numpy.arange", "os.path.splitext", "PIL.Image.frombuffer", "filecmp.cmp", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((326, 342), 'PIL.Image.open', 'Image.open', (['file'], {}), '(file)\n', (336, 342), False, 'from PIL import Image\n'), ((501, 523), 'os.path.splitext', 'os.path.splitext', (['file'], {}), '(file)\n', (517, 523), False, 'import os\n'), ((916, 972), 're.match', 're.match', (['"""(\\\\d+)x(\\\\d+)x(\\\\d+)x(\\\\d+)_(\\\...
import time import joblib import numpy as np from scipy.stats import ttest_1samp from sklearn.metrics import mean_squared_error as mse from sklearn.preprocessing import StandardScaler from sklearn.model_selection import GridSearchCV from sklearn.model_selection import ShuffleSplit from sklearn.tree import DecisionTre...
[ "sklearn.model_selection.GridSearchCV", "sklearn.preprocessing.StandardScaler", "sklearn.tree.DecisionTreeRegressor", "numpy.random.get_state", "numpy.empty", "numpy.zeros", "scipy.stats.ttest_1samp", "numpy.random.set_state", "time.time", "numpy.arange", "joblib.Parallel", "numpy.random.permu...
[((6550, 6595), 'sklearn.model_selection.ShuffleSplit', 'ShuffleSplit', ([], {'n_splits': '(3)', 'test_size': 'prop_test'}), '(n_splits=3, test_size=prop_test)\n', (6562, 6595), False, 'from sklearn.model_selection import ShuffleSplit\n'), ((6605, 6678), 'sklearn.model_selection.GridSearchCV', 'GridSearchCV', ([], {'es...
import numpy as np import scipy.io as scio u = scio.loadmat('linwave_u.mat')['u'] N = 128 timeFinal = 4 CFL = 0.2 xmin = -1 xmax = 1 m = 1 h = (xmax - xmin) / N x = np.zeros((2,N)) for i in range(0,N): x[0,i] = xmin + i * h x[1,i] = x[0,i] + h def LegendreGL(m): localx = np.zeros((m+1)) localw = np...
[ "scipy.io.loadmat", "numpy.zeros", "numpy.transpose", "numpy.linalg.eig", "numpy.linalg.inv", "numpy.array", "numpy.linspace", "numpy.dot", "numpy.sqrt" ]
[((165, 181), 'numpy.zeros', 'np.zeros', (['(2, N)'], {}), '((2, N))\n', (173, 181), True, 'import numpy as np\n'), ((2330, 2343), 'numpy.dot', 'np.dot', (['Ma', 'D'], {}), '(Ma, D)\n', (2336, 2343), True, 'import numpy as np\n'), ((2350, 2366), 'numpy.linalg.inv', 'np.linalg.inv', (['V'], {}), '(V)\n', (2363, 2366), T...
import matplotlib matplotlib.use("Agg") from pspy import so_dict, pspy_utils import maps_to_params_utils import numpy as np import pylab as plt import sys, os d = so_dict.so_dict() d.read_from_file(sys.argv[1]) cov_dir = "covariances" mc_dir = "montecarlo" cov_plot_dir = "plots/full_covariance" pspy_utils.create_dir...
[ "pylab.close", "numpy.load", "numpy.abs", "numpy.ones", "pylab.figure", "numpy.arange", "numpy.diag", "pylab.legend", "numpy.save", "pspy.so_dict.so_dict", "os.system", "maps_to_params_utils.is_symmetric", "numpy.indices", "matplotlib.use", "pylab.subplot", "pylab.savefig", "numpy.de...
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((164, 181), 'pspy.so_dict.so_dict', 'so_dict.so_dict', ([], {}), '()\n', (179, 181), False, 'from pspy import so_dict, pspy_utils\n'), ((299, 340), 'pspy.pspy_utils.create_directory', 'pspy_utils....
import os import argparse import datetime import re import pandas as pd import numpy as np from . import hgmd from . import visualize as vis from . import quads import sys import multiprocessing import time import math import matplotlib.pyplot as plt import random import scipy.io import csv #from docs.source import c...
[ "pandas.DataFrame", "os.makedirs", "random.randint", "math.ceil", "pandas.read_csv", "argparse.ArgumentParser", "numpy.transpose", "os.system", "numpy.isnan", "time.time", "numpy.array", "pandas.Series", "multiprocessing.Process", "datetime.datetime.now", "re.compile" ]
[((2479, 2568), 'pandas.read_csv', 'pd.read_csv', (['cls_path'], {'sep': '"""\t"""', 'index_col': '(0)', 'names': "['cell', 'cluster']", 'squeeze': '(True)'}), "(cls_path, sep='\\t', index_col=0, names=['cell', 'cluster'],\n squeeze=True)\n", (2490, 2568), True, 'import pandas as pd\n'), ((3075, 3086), 'time.time', ...
import os #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # Load Flask-Related Libraries from flask import Flask, request, redirect, url_for, render_template from werkzeug.utils import secure_filename app = Flask(__name__) #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< impo...
[ "numpy.random.seed", "audio.read_mfcc", "flask.Flask", "numpy.expand_dims", "test.batch_cosine_similarity", "conv_models.DeepSpeakerModel", "random.seed" ]
[((210, 225), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (215, 225), False, 'from flask import Flask, request\n'), ((1741, 1756), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1746, 1756), False, 'from flask import Flask, request\n'), ((785, 852), 'audio.read_mfcc', 'read_mfcc', (['"""sa...
import io import json import random from collections import defaultdict import numpy as np import torch from itertools import chain, groupby from tqdm import tqdm # sys.setdefaultencoding('utf8') # word_lexicon_size = 29172 # word_lexicon_size = 29336 word_lexicon_size = 29571 # pa_path_lexicon_size = 29313 pa_path_...
[ "numpy.random.uniform", "tqdm.tqdm", "torch.stack", "torch.LongTensor", "random.shuffle", "numpy.asarray", "numpy.zeros", "collections.defaultdict", "torch.Tensor", "torch.cuda.is_available", "numpy.array", "io.open", "torch.zeros", "itertools.chain.from_iterable", "torch.from_numpy" ]
[((4858, 4883), 'random.shuffle', 'random.shuffle', (['instances'], {}), '(instances)\n', (4872, 4883), False, 'import random\n'), ((5157, 5180), 'random.shuffle', 'random.shuffle', (['batches'], {}), '(batches)\n', (5171, 5180), False, 'import random\n'), ((12350, 12375), 'tqdm.tqdm', 'tqdm', (['data'], {'mininterval'...
from numpy import matmul x = [ [1, 0, 1, 0], # input 1 [0, 2, 2, 2], # input 2 [1, 1, 1, 1], # input 3 ] W_query = [ [0, 0, 1], [1, 1, 0], [0, 1, 0], [1, 1, 0], ] Q = [ [0, 1, 1], # Query for input 1 [4, 6, 0], # Query for input 2 [2, 3, 1], # Query for input 3 ] print(ma...
[ "numpy.matmul" ]
[((318, 336), 'numpy.matmul', 'matmul', (['x', 'W_query'], {}), '(x, W_query)\n', (324, 336), False, 'from numpy import matmul\n')]
# Copyright 2022 Sony Group 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 ...
[ "numpy.zeros_like", "solver_test_utils.solver_tester", "numpy.asarray", "numpy.iinfo", "numpy.random.RandomState", "numpy.clip", "nbla_test_utils.list_context", "numpy.linalg.norm", "pytest.mark.parametrize", "numpy.sqrt" ]
[((795, 815), 'nbla_test_utils.list_context', 'list_context', (['"""Lamb"""'], {}), "('Lamb')\n", (807, 815), False, 'from nbla_test_utils import list_context\n'), ((2391, 2440), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ctx, solver_name"""', 'ctxs'], {}), "('ctx, solver_name', ctxs)\n", (2414, 2440),...
# -*- coding: utf-8 -*- """ @author: <NAME> """ import numpy as np def load_mnist(return_test = False, min_val = -1., max_val = 1., shuffle=True, seed = 1234567890): """ Loads the MNIST Dataset """ from keras.datasets import mnist # Load data (x_train, y_train), (x_test, y_test) = mnist.load_da...
[ "numpy.random.seed", "keras.datasets.cifar10.load_data", "keras.datasets.mnist.load_data", "keras.datasets.cifar100.load_data", "numpy.random.randint", "numpy.array", "numpy.random.shuffle", "keras.datasets.fashion_mnist.load_data" ]
[((307, 324), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (322, 324), False, 'from keras.datasets import mnist\n'), ((1322, 1347), 'keras.datasets.fashion_mnist.load_data', 'fashion_mnist.load_data', ([], {}), '()\n', (1345, 1347), False, 'from keras.datasets import fashion_mnist\n'), ((2331,...
#!/home/arthurb/bin/anaconda/bin/python # python ax1.py params_file FILEIN FILEOUT # python ax1.py params_file FILEIN FILEOUT START STOP # python ax1.py FS NFFT NW K PVAL FILEIN FILEOUT # python ax1.py FS NFFT NW K PVAL FILEIN FILEOUT START STOP # # analyze a set of time series with multi-taper spectral analysis and #...
[ "dpss.dpss", "wave.open", "os.path.dirname", "struct.pack", "time.time", "numpy.array", "multiprocessing.Pool", "glob.glob", "os.path.join", "ax1b.nextpow2", "multiprocessing.cpu_count" ]
[((1964, 1975), 'time.time', 'time.time', ([], {}), '()\n', (1973, 1975), False, 'import time\n'), ((2760, 2771), 'multiprocessing.cpu_count', 'cpu_count', ([], {}), '()\n', (2769, 2771), False, 'from multiprocessing import Pool, cpu_count\n'), ((3000, 3017), 'dpss.dpss', 'dpss', (['NFFT', 'NW', 'K'], {}), '(NFFT, NW, ...
import simulation import numpy as np import datetime import time as timer """ Description: Given an input time, determine the largest distance the car can travel in that time. [time -> distance] Note: this example assumes constant speed throughout """ start = timer.perf_counter() # ----- Simulation input ----- si...
[ "simulation.BasicLVS", "numpy.full_like", "numpy.sum", "numpy.meshgrid", "numpy.logical_and", "numpy.argmax", "numpy.abs", "time.perf_counter", "numpy.amax", "numpy.cumsum", "simulation.BasicArray", "numpy.arange", "simulation.BasicBattery", "simulation.BasicMotor" ]
[((264, 284), 'time.perf_counter', 'timer.perf_counter', ([], {}), '()\n', (282, 284), True, 'import time as timer\n'), ((562, 602), 'simulation.BasicArray', 'simulation.BasicArray', (['incident_sunlight'], {}), '(incident_sunlight)\n', (583, 602), False, 'import simulation\n'), ((655, 702), 'simulation.BasicBattery', ...
from copy import deepcopy import numpy as np try: import rospy import actionlib from franka_msgs.msg import FrankaState from ros_panda_controller.msg import RobotModel from franka_gripper.msg import GraspAction, GraspGoal, GraspEpsilon, \ HomingAction, HomingGoal, MoveAction, MoveGoal fr...
[ "copy.deepcopy", "franka_gripper.msg.HomingGoal", "rospy.Subscriber", "actionlib.SimpleActionClient", "rospy.loginfo", "franka_gripper.msg.GraspGoal", "franka_gripper.msg.MoveGoal", "numpy.concatenate" ]
[((897, 965), 'actionlib.SimpleActionClient', 'actionlib.SimpleActionClient', (['"""/franka_gripper/homing"""', 'HomingAction'], {}), "('/franka_gripper/homing', HomingAction)\n", (925, 965), False, 'import actionlib\n'), ((1000, 1064), 'actionlib.SimpleActionClient', 'actionlib.SimpleActionClient', (['"""/franka_gripp...
from typing import Tuple import numpy as np def split_dataset(full_ds: np.ndarray, test_split: float = 0.2) -> Tuple[np.ndarray, np.ndarray]: """Splits dataset into train, test datsets. Parameters ---------- full_ds : tf.data.Dataset full dataset to split test_split : float, optional ...
[ "numpy.random.shuffle" ]
[((543, 569), 'numpy.random.shuffle', 'np.random.shuffle', (['full_ds'], {}), '(full_ds)\n', (560, 569), True, 'import numpy as np\n')]
import numpy as np from collections import namedtuple import torch import torch.nn as nn import matplotlib.pyplot as plt import torch.optim as optim import torch.nn.functional as F import random import cv2 Transition = namedtuple('Transition', ('state', 'action', 'next_state', 'reward', 'done'...
[ "matplotlib.pyplot.title", "cv2.resize", "torch.nn.functional.relu", "matplotlib.pyplot.clf", "random.sample", "numpy.all", "matplotlib.pyplot.figure", "numpy.mean", "collections.namedtuple", "matplotlib.pyplot.pause", "torch.nn.Linear", "torch.zeros", "matplotlib.pyplot.ylabel", "matplotl...
[((221, 298), 'collections.namedtuple', 'namedtuple', (['"""Transition"""', "('state', 'action', 'next_state', 'reward', 'done')"], {}), "('Transition', ('state', 'action', 'next_state', 'reward', 'done'))\n", (231, 298), False, 'from collections import namedtuple\n'), ((916, 929), 'matplotlib.pyplot.figure', 'plt.figu...
import csv import numpy as np import re import pandas as pd class PreProcessing: def __init__(self): self.r1 = "[\s+\.\!\-\?\/_,$%^*(+\"]+|[+——!:,。?、~@#¥%……&*()]+" self.r2 = '(\s\'+\s)|(\'(\s|$))|\)' self.node2pap = {} self.text_id = {} self.train = [] self.test = []...
[ "pandas.read_csv", "csv.reader", "numpy.array", "re.sub" ]
[((3069, 3099), 'pandas.read_csv', 'pd.read_csv', (['"""./data/test.csv"""'], {}), "('./data/test.csv')\n", (3080, 3099), True, 'import pandas as pd\n'), ((1385, 1405), 'numpy.array', 'np.array', (['self.train'], {}), '(self.train)\n', (1393, 1405), True, 'import numpy as np\n'), ((2755, 2781), 're.sub', 're.sub', (['s...
import numpy as np def confusion_matrix(y_pred, y_real): """Compute confusion matrix. Args: y_pred (list[int] | np.ndarray[int]): Prediction labels. y_real (list[int] | np.ndarray[int]): Ground truth labels. Returns: np.ndarray: Confusion matrix. """ if isinstance(y_pred,...
[ "numpy.maximum", "numpy.argmax", "numpy.empty", "numpy.isnan", "numpy.argsort", "numpy.mean", "numpy.arange", "numpy.diag", "numpy.logical_or.reduce", "numpy.cumsum", "numpy.linspace", "numpy.trapz", "numpy.minimum", "numpy.dot", "numpy.concatenate", "numpy.zeros", "numpy.expand_dims...
[((1155, 1205), 'numpy.zeros', 'np.zeros', (['(num_labels, num_labels)'], {'dtype': 'np.int64'}), '((num_labels, num_labels), dtype=np.int64)\n', (1163, 1205), True, 'import numpy as np\n'), ((1692, 1717), 'numpy.argmax', 'np.argmax', (['scores'], {'axis': '(1)'}), '(scores, axis=1)\n', (1701, 1717), True, 'import nump...
""" Utilities """ import numpy as np import scipy as sp import os import shutil import tarfile from subfunc.showdata import * from subfunc.munkres import Munkres # ============================================================= # ============================================================= def correlation(x, y, met...
[ "numpy.absolute", "os.makedirs", "numpy.corrcoef", "scipy.stats.spearmanr", "numpy.zeros", "os.path.exists", "shutil.copy", "os.path.isfile", "numpy.arange", "subfunc.munkres.Munkres", "tarfile.open", "shutil.rmtree", "os.path.join", "os.listdir", "numpy.concatenate" ]
[((1165, 1174), 'subfunc.munkres.Munkres', 'Munkres', ([], {}), '()\n', (1172, 1174), False, 'from subfunc.munkres import Munkres\n'), ((1238, 1263), 'numpy.zeros', 'np.zeros', (['dimy'], {'dtype': 'int'}), '(dimy, dtype=int)\n', (1246, 1263), True, 'import numpy as np\n'), ((1405, 1447), 'numpy.concatenate', 'np.conca...
#!/usr/bin/env python # encoding: utf-8 """ @Author: yangwenhao @Contact: <EMAIL> @Software: PyCharm @File: plt_time_weight.py @Time: 2020/11/28 13:35 @Overview: """ import matplotlib.pyplot as plt import numpy as np from matplotlib.backends.backend_pdf import PdfPages from scipy import interpolate import Process_Da...
[ "matplotlib.pyplot.subplot", "numpy.load", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.figure", "numpy.exp" ]
[((438, 510), 'numpy.load', 'np.load', (['"""Lime/LoResNet8/timit/soft/time.data.pickle"""'], {'allow_pickle': '(True)'}), "('Lime/LoResNet8/timit/soft/time.data.pickle', allow_pickle=True)\n", (445, 510), True, 'import numpy as np\n'), ((565, 591), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 6)'}),...
import matplotlib.pyplot as plt import matplotlib.colors as mcolors import numpy as np import numpy as np import matplotlib import matplotlib.pyplot as plt import cmocean import math data = np.zeros((19, 19)) def read_cross_val(file): cvmin = float("inf") cross_val = [] with open(file, "r") as f: ...
[ "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.colorbar", "numpy.min", "matplotlib.colors.LogNorm", "numpy.arange", "numpy.array", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots" ]
[((192, 210), 'numpy.zeros', 'np.zeros', (['(19, 19)'], {}), '((19, 19))\n', (200, 210), True, 'import numpy as np\n'), ((712, 726), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (724, 726), True, 'import matplotlib.pyplot as plt\n'), ((872, 925), 'matplotlib.pyplot.colorbar', 'plt.colorbar', (['im0']...
import numpy as np # todo: # consider making this faster, # per https://stackoverflow.com/questions/12321899/ # this is used in the 'compilation' step # todo: this big docstring isn't necessary... ''' Provides: ortho_map = ((1,0), (0,-1), (-1,0), (0,1)) diag_map = ((1,-1), (-1,-1),(-1,1), (1,1)) These are us...
[ "numpy.zeros" ]
[((10391, 10416), 'numpy.zeros', 'np.zeros', (['(width, height)'], {}), '((width, height))\n', (10399, 10416), True, 'import numpy as np\n'), ((11534, 11574), 'numpy.zeros', 'np.zeros', (['(width, height)'], {'dtype': 'np.bool'}), '((width, height), dtype=np.bool)\n', (11542, 11574), True, 'import numpy as np\n'), ((11...
""" .. Copyright (c) 2014-2017, Magni developers. All rights reserved. See LICENSE.rst for further information. Module providing public functions for the magni.imaging.measurements subpackage. Routine listings ---------------- uniform_line_sample_image(h, w, scan_length, num_points) Function for unifo...
[ "magni.imaging.measurements._util.sample_lines", "numpy.floor", "numpy.zeros", "magni.utils.validation.validate_numeric", "numpy.linspace" ]
[((6778, 6806), 'numpy.zeros', 'np.zeros', (['(2 * num_lines, 2)'], {}), '((2 * num_lines, 2))\n', (6786, 6806), True, 'import numpy as np\n'), ((6889, 6917), 'numpy.linspace', 'np.linspace', (['(0)', 'l', 'num_lines'], {}), '(0, l, num_lines)\n', (6900, 6917), True, 'import numpy as np\n'), ((6930, 6982), 'magni.imagi...
# Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "mindspore.context._Context", "mindspore.context.set_context", "mindspore.ops.operations.Reshape", "mindspore.context.reset_auto_parallel_context", "mindspore.nn.ReLU", "mindspore.common.api._cell_graph_executor.compile", "numpy.zeros", "mindspore.context.set_auto_parallel_context", "numpy.ones", ...
[((2637, 2674), 'mindspore.context.reset_auto_parallel_context', 'context.reset_auto_parallel_context', ([], {}), '()\n', (2672, 2674), False, 'from mindspore import Tensor, context, Parameter\n'), ((2719, 2763), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE'}), '(mode=contex...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging logger = logging.getLogger(__name__) import numpy as np import os.path as op import sklearn import sklearn.mixture # version comparison from pkg_resources import parse_version import scipy.ndimage import scipy.stats from . import features if parse_versio...
[ "pkg_resources.parse_version", "numpy.isscalar", "sklearn.neighbors.KernelDensity", "numpy.asarray", "numpy.unique", "sklearn.mixture.GaussianMixture", "dill.dumps", "numpy.nonzero", "numpy.exp", "sklearn.mixture.DPGMM", "os.path.expanduser", "logging.getLogger", "numpy.in1d" ]
[((71, 98), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (88, 98), False, 'import logging\n'), ((308, 342), 'pkg_resources.parse_version', 'parse_version', (['sklearn.__version__'], {}), '(sklearn.__version__)\n', (321, 342), False, 'from pkg_resources import parse_version\n'), ((345, 3...
import cv2 import numpy as np from scipy.ndimage.filters import gaussian_filter from skimage.transform import warp from .augmentor import DataAugment class Elastic(DataAugment): """Elastic deformation of images as described in [Simard2003]_ (with modifications). Based on https://gist.github.com/erniejunior/60...
[ "numpy.float32", "numpy.array", "numpy.random.RandomState" ]
[((1666, 1689), 'numpy.random.RandomState', 'np.random.RandomState', ([], {}), '()\n', (1687, 1689), True, 'import numpy as np\n'), ((1931, 1954), 'numpy.float32', 'np.float32', (['(self.y + dy)'], {}), '(self.y + dy)\n', (1941, 1954), True, 'import numpy as np\n'), ((1956, 1979), 'numpy.float32', 'np.float32', (['(sel...
import matplotlib.pyplot as plt import numpy as np x_label = "Percentage of computed source vertices" v_size = 3.5 d17_knc_we = [18.6413, 38.0379, 55.209, 74.8671, 84.7064, 108.733, 132.209, 150.944, 159.577, 182.999] d17_knc_hybrid = [19.1711, 34.4665, 52.3645, 75.2577, 91.2469, 107.445, 141.024, 149.422, 156.733, 17...
[ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.savefig" ]
[((2054, 2120), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(4)'], {'sharey': '(True)', 'sharex': '(True)', 'figsize': '(16, v_size)'}), '(1, 4, sharey=True, sharex=True, figsize=(16, v_size))\n', (2066, 2120), True, 'import matplotlib.pyplot as plt\n'), ((2408, 2427), 'numpy.arange', 'np.arange', (['(1)', ...
import os import numpy as np import torch import trimesh from im2mesh import config from im2mesh.utils import binvox_rw, voxels from im2mesh.checkpoints import CheckpointIO from im2mesh.utils.visualize import visualize_pointcloud, visualize_voxels def load_binvox(file_path: str): with open(file_path, "rb") as f...
[ "numpy.load", "trimesh.load", "im2mesh.checkpoints.CheckpointIO", "im2mesh.utils.visualize.visualize_pointcloud", "numpy.random.randint", "trimesh.exchange.binvox.voxelize_mesh", "torch.device", "os.path.join", "im2mesh.config.get_generator", "im2mesh.config.get_model", "im2mesh.utils.voxels.vox...
[((473, 491), 'numpy.load', 'np.load', (['file_path'], {}), '(file_path)\n', (480, 491), True, 'import numpy as np\n'), ((636, 674), 'trimesh.load', 'trimesh.load', (['file_path'], {'process': '(False)'}), '(file_path, process=False)\n', (648, 674), False, 'import trimesh\n'), ((3112, 3155), 'im2mesh.utils.visualize.vi...
#!/usr/bin/python3 # Logistic Equation Library # Copyright (C) 2016-2018 <NAME> <<EMAIL>> # SPDX-License-Identifier: Apache-2.0 from __future__ import print_function __author__ = "<NAME>" __copyright__ = "Copyright (C) 2016-2018 <NAME>" __license__ = "Apache License 2.0" __version__ = "3" __email__ = "<EMAIL>" __sta...
[ "matplotlib.pyplot.title", "numpy.full", "matplotlib.pyplot.xlim", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.yticks", "math.sin", "matplotlib.pyplot.text", "matplotlib.pyplot.figur...
[((10075, 10082), 'lelib_test.tests', 'tests', ([], {}), '()\n', (10080, 10082), False, 'from lelib_test import tests\n'), ((2687, 2781), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {'color': 'color', 'linestyle': '""""""', 'markerfacecolor': 'color', 'marker': '"""o"""', 'markersize': '(5)'}), "(x, y, color=col...
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.2.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # ## Distributed renderin...
[ "lightmetrica.log.setSeverity", "lightmetrica.init", "lightmetrica.dist.init", "lightmetrica.dist.sync", "matplotlib.pyplot.figure", "lightmetrica.log.init", "numpy.full", "lightmetrica.dist.allowWorkerConnection", "lightmetrica.comp.get", "traceback.print_exc", "lightmetrica.dist.shutdown", "...
[((724, 735), 'os.getpid', 'os.getpid', ([], {}), '()\n', (733, 735), False, 'import os\n'), ((1148, 1181), 'lightmetrica.pylm_component', 'lm.pylm_component', (['"""renderer::ao"""'], {}), "('renderer::ao')\n", (1165, 1181), True, 'import lightmetrica as lm\n'), ((3474, 3483), 'lightmetrica.init', 'lm.init', ([], {}),...
""" find peaks in a periodic signal such as ECG Assume: 1. cycle is stable and have one strong period signal 2. target peaks have enough features Proprosal: 1. peak value features 2. cycle priors 3. cycle transition priors 4. autodetect to detech peaks or valleys Implemen...
[ "matplotlib.pyplot.show", "scipy.io.loadmat", "numpy.asarray", "matplotlib.pyplot.figure", "absl.app.run", "collections.deque" ]
[((3332, 3349), 'scipy.io.loadmat', 'loadmat', (['filepath'], {}), '(filepath)\n', (3339, 3349), False, 'from scipy.io import loadmat\n'), ((3567, 3579), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3577, 3579), True, 'import matplotlib.pyplot as plt\n'), ((3665, 3675), 'matplotlib.pyplot.show', 'plt.sh...
import numpy as np import os import time from utils import lp_norm class oracle: def __init__(self,input,lp,radius): self.input = input self.measurement = lp self.radius = radius def passOracle(self,test): n = np.count_nonzero(self.input- test) return np.lin...
[ "numpy.linalg.norm", "numpy.count_nonzero" ]
[((264, 299), 'numpy.count_nonzero', 'np.count_nonzero', (['(self.input - test)'], {}), '(self.input - test)\n', (280, 299), True, 'import numpy as np\n'), ((438, 493), 'numpy.linalg.norm', 'np.linalg.norm', (['(self.input - test)'], {'ord': 'self.measurement'}), '(self.input - test, ord=self.measurement)\n', (452, 493...
import pytest # https://github.com/scikit-learn/scikit-learn/issues/8959 import numpy as np try: np.set_printoptions(sign=' ') except TypeError: pass collect_ignore = ['setup.py', 'docs/conf.py'] pytest.register_assert_rewrite("skfda")
[ "pytest.register_assert_rewrite", "numpy.set_printoptions" ]
[((207, 246), 'pytest.register_assert_rewrite', 'pytest.register_assert_rewrite', (['"""skfda"""'], {}), "('skfda')\n", (237, 246), False, 'import pytest\n'), ((102, 131), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'sign': '""" """'}), "(sign=' ')\n", (121, 131), True, 'import numpy as np\n')]
from bisect import bisect_right from typing import Tuple, List, Dict, Callable, Optional import numpy as np from scipy.optimize import linear_sum_assignment def span_matching(tagging_A: List[Tuple[int, int]], tagging_B: List[Tuple[int, int]], keep_A: bool = False) -> Dict[int, int...
[ "bisect.bisect_right", "numpy.vectorize", "scipy.optimize.linear_sum_assignment" ]
[((2355, 2389), 'scipy.optimize.linear_sum_assignment', 'linear_sum_assignment', (['cost_matrix'], {}), '(cost_matrix)\n', (2376, 2389), False, 'from scipy.optimize import linear_sum_assignment\n'), ((2235, 2256), 'numpy.vectorize', 'np.vectorize', (['overlap'], {}), '(overlap)\n', (2247, 2256), True, 'import numpy as ...
# -*- coding: utf-8 -*- import numpy as np import argparse as ap import re from JorGpi.POSCARloader import POSCARloader from JorGpi.heisenberg import EquationSolver,NaiveHeisenberg,apply_mirrors_xyz from JorGpi.pickup.read_vasprun import MAGMOMloaderXML class Zero(dict): def __missing__(self,key): return...
[ "JorGpi.pickup.read_vasprun.MAGMOMloaderXML", "argparse.ArgumentParser", "JorGpi.heisenberg.EquationSolver", "JorGpi.POSCARloader.POSCARloader", "numpy.copy", "numpy.reciprocal", "numpy.where", "numpy.linalg.norm", "re.search", "JorGpi.heisenberg.NaiveHeisenberg", "re.sub" ]
[((452, 480), 'numpy.reciprocal', 'np.reciprocal', (['(13.6056980659)'], {}), '(13.6056980659)\n', (465, 480), True, 'import numpy as np\n'), ((2035, 2057), 'JorGpi.POSCARloader.POSCARloader', 'POSCARloader', (['*poscars'], {}), '(*poscars)\n', (2047, 2057), False, 'from JorGpi.POSCARloader import POSCARloader\n'), ((2...
""" Extracts features that are based on characters and a condition if the characters should be counted. """ import string import numpy as np from code.feature_extraction.feature_extractor import FeatureExtractor from code.util import SUFFIX_PUNC_NUM, SUFFIX_CAP_LETTERS class ConditionalCharCounter(FeatureExtractor):...
[ "numpy.array" ]
[((914, 936), 'numpy.array', 'np.array', (['num_of_chars'], {}), '(num_of_chars)\n', (922, 936), True, 'import numpy as np\n')]
# Copyright (c) MONAI Consortium # 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 writing, so...
[ "unittest.main", "torch.testing.assert_allclose", "parameterized.parameterized.expand", "numpy.array", "numpy.testing.assert_equal", "monai.transforms.MapLabelValue" ]
[((2517, 2544), 'parameterized.parameterized.expand', 'parameterized.expand', (['TESTS'], {}), '(TESTS)\n', (2537, 2544), False, 'from parameterized import parameterized\n'), ((2962, 2977), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2975, 2977), False, 'import unittest\n'), ((1757, 1811), 'numpy.array', 'np.a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 7 14:02:13 2018 @author: elizabethhutton """ # -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import tensorflow as tf ######################...
[ "matplotlib.pyplot.title", "pandas.read_csv", "matplotlib.pyplot.bar", "tensorflow.matmul", "matplotlib.pyplot.figure", "numpy.mean", "tensorflow.truncated_normal", "tensorflow.subtract", "tensorflow.placeholder", "tensorflow.cast", "tensorflow.name_scope", "matplotlib.pyplot.xticks", "matpl...
[((596, 652), 'pandas.read_csv', 'pd.read_csv', (['in_file'], {'header': 'None', 'delim_whitespace': '(True)'}), '(in_file, header=None, delim_whitespace=True)\n', (607, 652), True, 'import pandas as pd\n'), ((669, 729), 'pandas.read_csv', 'pd.read_csv', (['target_file'], {'header': 'None', 'delim_whitespace': '(True)'...
from multiprocessing import Process import os import subprocess import pandas as pd from rdkit import Chem from rdkit.Chem import Descriptors from random import shuffle import numpy as np import time def read_dev_output(file_name): # read generated SMILES in seq2seq dev output file with open(file_name,'r') as ...
[ "pandas.DataFrame", "random.shuffle", "time.time", "rdkit.Chem.Descriptors.qed", "numpy.mean", "multiprocessing.Process", "rdkit.Chem.MolFromSmiles" ]
[((3222, 3241), 'random.shuffle', 'shuffle', (['base_index'], {}), '(base_index)\n', (3229, 3241), False, 'from random import shuffle\n'), ((4517, 4591), 'pandas.DataFrame', 'pd.DataFrame', (["{'valid_score': vs, 'unique_score': us, 'novelty_score': ns}"], {}), "({'valid_score': vs, 'unique_score': us, 'novelty_score':...
import numpy as np import cv2 from matplotlib import pyplot as plt img = np.array([[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 255, 255, 255, 0, 0], [0, 0, 255, 255, 255, 0, 0], [0, 0, 255, 255, 255, 0, 0], [0, 0, 0, 0, 0, 0, 0], ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "cv2.morphologyEx", "cv2.getStructuringElement", "matplotlib.pyplot.imshow", "matplotlib.pyplot.axis", "numpy.array" ]
[((74, 289), 'numpy.array', 'np.array', (['[[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 255, 255, 255, 0, 0],\n [0, 0, 255, 255, 255, 0, 0], [0, 0, 255, 255, 255, 0, 0], [0, 0, 0, 0, \n 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]]'], {'dtype': 'np.uint8'}), '([[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 255...