code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# -*- coding: utf-8 -*- # @Time : 23.03.21 14:42 # @Author : sing_sd import numpy as np import matplotlib.pyplot as plt import numpy as np from rdp import rdp import pickle import src.clustering.COStransforms as ct from frechetdist import frdist ref = {'lon': 12.0, 'lat': 54.35, 'ECEF': ct.WGS84toECEF(12.0, 54.35...
[ "src.clustering.COStransforms.WGS84toECEF", "frechetdist.frdist", "numpy.multiply", "numpy.subtract", "numpy.sum", "numpy.argmax", "numpy.abs", "src.clustering.COStransforms.WGS84toENU", "numpy.transpose", "rdp.rdp", "numpy.argmin", "pickle.load", "numpy.array", "numpy.linalg.norm", "num...
[((294, 321), 'src.clustering.COStransforms.WGS84toECEF', 'ct.WGS84toECEF', (['(12.0)', '(54.35)'], {}), '(12.0, 54.35)\n', (308, 321), True, 'import src.clustering.COStransforms as ct\n'), ((813, 840), 'rdp.rdp', 'rdp', (['ENUcoord_mmsi', 'EPSILON'], {}), '(ENUcoord_mmsi, EPSILON)\n', (816, 840), False, 'from rdp impo...
import math from typing import Tuple import numpy as np import open3d as o3d import open3d.core as o3c import pytest from dq3d import quat, dualquat import nnrt import nnrt.geometry as nnrt_geom from image_processing import compute_normals from image_processing.numba_cuda.preprocessing import cuda_compute_normal fro...
[ "numpy.allclose", "numpy.ones", "numpy.round", "numpy.ndarray", "open3d.core.Device", "open3d.geometry.Image", "image_processing.compute_normals", "dq3d.quat", "numpy.linspace", "nnrt.backproject_depth_ushort", "open3d.core.Tensor.eye", "open3d.core.Tensor", "dq3d.quat.identity", "numpy.co...
[((676, 737), 'numpy.ndarray', 'np.ndarray', (['(resolution[0], resolution[1], 3)'], {'dtype': 'np.uint8'}), '((resolution[0], resolution[1], 3), dtype=np.uint8)\n', (686, 737), True, 'import numpy as np\n'), ((837, 864), 'numpy.eye', 'np.eye', (['(3)'], {'dtype': 'np.float32'}), '(3, dtype=np.float32)\n', (843, 864), ...
############################################################################## # # Copyright (c) 2016, <NAME> # # This file is part of arlpy which is released under Simplified BSD License. # See file LICENSE or go to http://www.opensource.org/licenses/BSD-3-Clause # for full license details. # #########################...
[ "os.stat", "numpy.fromfile", "numpy.take", "numpy.reshape", "scipy.signal.detrend" ]
[((645, 663), 'os.stat', '_os.stat', (['filename'], {}), '(filename)\n', (653, 663), True, 'import os as _os\n'), ((1210, 1228), 'os.stat', '_os.stat', (['filename'], {}), '(filename)\n', (1218, 1228), True, 'import os as _os\n'), ((2181, 2224), 'numpy.reshape', '_np.reshape', (['data', '[length, _framelen // 2]'], {})...
from typing import Collection, Dict, List, Sequence, Type, TypeVar import numpy as np import pandas as pd from athenian.api.controllers.features.metric import Metric, MetricInt from athenian.api.controllers.features.metric_calculator import AnyMetricCalculator, \ BinnedMetricCalculator, \ MetricCalculator, Me...
[ "typing.TypeVar", "numpy.broadcast_to", "numpy.array", "numpy.unique" ]
[((808, 820), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (815, 820), False, 'from typing import Collection, Dict, List, Sequence, Type, TypeVar\n'), ((7516, 7566), 'numpy.broadcast_to', 'np.broadcast_to', (['duplicated[None, :]', 'result.shape'], {}), '(duplicated[None, :], result.shape)\n', (7531, 7566...
''' Test the FFT functions ''' import numpy as np from .. import LombScargle as LS import matplotlib.pyplot as plt import matplotlib.colors as colors from mpl_toolkits.axes_grid1 import make_axes_locatable from ..Tools.mode import mode from ..Tools.DetectGaps import DetectGaps from ..Spectrogram.SpectrogramPlotter imp...
[ "numpy.meshgrid", "matplotlib.colors.Normalize", "matplotlib.pyplot.axes", "numpy.float32", "numpy.zeros", "numpy.isfinite", "numpy.nanmin", "numpy.append", "numpy.max", "numpy.arange", "numpy.cos", "numpy.random.rand", "matplotlib.pyplot.cm.get_cmap", "numpy.nanmax" ]
[((502, 519), 'numpy.arange', 'np.arange', (['(1000.0)'], {}), '(1000.0)\n', (511, 519), True, 'import numpy as np\n'), ((1455, 1473), 'numpy.arange', 'np.arange', (['(10800.0)'], {}), '(10800.0)\n', (1464, 1473), True, 'import numpy as np\n'), ((2364, 2382), 'numpy.arange', 'np.arange', (['(10800.0)'], {}), '(10800.0)...
import numpy as np from unittest import TestCase from diffprivlib.mechanisms import Exponential from diffprivlib.utils import global_seed class TestExponential(TestCase): def setup_method(self, method): if method.__name__ .endswith("prob"): global_seed(314159) self.mech = Exponential...
[ "diffprivlib.utils.global_seed", "numpy.exp", "diffprivlib.mechanisms.Exponential", "numpy.log" ]
[((309, 322), 'diffprivlib.mechanisms.Exponential', 'Exponential', ([], {}), '()\n', (320, 322), False, 'from diffprivlib.mechanisms import Exponential\n'), ((4765, 4774), 'numpy.log', 'np.log', (['(2)'], {}), '(2)\n', (4771, 4774), True, 'import numpy as np\n'), ((268, 287), 'diffprivlib.utils.global_seed', 'global_se...
""" ShakeDrop-ResNet for CIFAR/SVHN, implemented in Gluon. Original paper: 'ShakeDrop Regularization for Deep Residual Learning,' https://arxiv.org/abs/1802.02375. """ __all__ = ['CIFARShakeDropResNet', 'shakedropresnet20_cifar10', 'shakedropresnet20_cifar100', 'shakedropresnet20_svhn'] import os import numpy...
[ "numpy.random.binomial", "mxnet.autograd.is_training", "mxnet.autograd.record", "mxnet.gluon.nn.HybridSequential", "mxnet.gluon.nn.Dense", "mxnet.gluon.nn.Activation", "mxnet.nd.zeros", "mxnet.nd.broadcast_mul", "mxnet.cpu", "mxnet.gluon.nn.AvgPool2D", "os.path.join", "mxnet.gluon.nn.Flatten",...
[((6743, 6748), 'mxnet.cpu', 'cpu', ([], {}), '()\n', (6746, 6748), False, 'from mxnet import cpu\n'), ((6785, 6822), 'os.path.join', 'os.path.join', (['"""~"""', '""".mxnet"""', '"""models"""'], {}), "('~', '.mxnet', 'models')\n", (6797, 6822), False, 'import os\n'), ((834, 859), 'mxnet.autograd.is_training', 'mx.auto...
import numpy as np import pandas as pd import pulp from laptimize.curve_approximation import CurveApproximator from laptimize.log import LogFactory class LAPModel(object): """solve the linear approximated LP problem and sub problems""" def __init__(self, name='nlp_problem'): self.logger = LogFactory...
[ "pandas.DataFrame", "pulp.lpSum", "laptimize.curve_approximation.CurveApproximator", "pulp.LpVariable.dict", "numpy.arange", "pulp.LpProblem", "pulp.PULP_CBC_CMD", "pandas.concat", "laptimize.log.LogFactory.get_logger" ]
[((310, 333), 'laptimize.log.LogFactory.get_logger', 'LogFactory.get_logger', ([], {}), '()\n', (331, 333), False, 'from laptimize.log import LogFactory\n'), ((392, 406), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (404, 406), True, 'import pandas as pd\n'), ((428, 442), 'pandas.DataFrame', 'pd.DataFrame', ([...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `simu_linear` package.""" import pytest import numpy as np from thermo.chemical import Chemical from pandangas import simu_linear as sim from pandangas import topology as top from fixtures import simple_network def test_solve(): # 3 * x0 + x1 = 9 and ...
[ "pandangas.simu_linear.create_b", "pandangas.simu_linear.solve", "pandangas.simu_linear.create_a", "pandangas.simu_linear.run_one_level", "pandangas.simu_linear._operating_pressures_as_dict", "numpy.array", "pandangas.topology.graphs_by_level_as_dict", "thermo.chemical.Chemical", "pandangas.simu_lin...
[((363, 389), 'numpy.array', 'np.array', (['[[3, 1], [1, 2]]'], {}), '([[3, 1], [1, 2]])\n', (371, 389), True, 'import numpy as np\n'), ((398, 414), 'numpy.array', 'np.array', (['[9, 8]'], {}), '([9, 8])\n', (406, 414), True, 'import numpy as np\n'), ((508, 536), 'numpy.array', 'np.array', (['[1, 0, 0, 1, 0, 1]'], {}),...
# Copyright 2019 NeuroData (http://neurodata.io) # # 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 ag...
[ "numpy.min", "numpy.sqrt", "numpy.max", "numpy.hstack" ]
[((5492, 5538), 'numpy.hstack', 'np.hstack', (['[U[:, :best_dimension] for U in Us]'], {}), '([U[:, :best_dimension] for U in Us])\n', (5501, 5538), True, 'import numpy as np\n'), ((5556, 5604), 'numpy.hstack', 'np.hstack', (['[V.T[:, :best_dimension] for V in Vs]'], {}), '([V.T[:, :best_dimension] for V in Vs])\n', (5...
import numpy as np from numpy.core.function_base import linspace EPS = 1e-9 class CameraSensor: """ Defines the camera sensor properties """ def __init__(self, image_size, pitch, RGB=False, name=None, bayer_pattern=None): self.img_size = np.array([image_size[0], image_size[1]]) # image heig...
[ "numpy.meshgrid", "numpy.array", "numpy.float", "numpy.linspace" ]
[((264, 304), 'numpy.array', 'np.array', (['[image_size[0], image_size[1]]'], {}), '([image_size[0], image_size[1]])\n', (272, 304), True, 'import numpy as np\n'), ((1217, 1286), 'numpy.linspace', 'np.linspace', (['(-w / 2 + dw / 2)', '(+w / 2 - dw / 2 + EPS)', 'self.img_size[1]'], {}), '(-w / 2 + dw / 2, +w / 2 - dw /...
#!/usr/bin/env python """ Segmentation methods to find regions of interest in the time and frequency domain. """ # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: New BSD License # ============================================================================= # Load the modules # ...
[ "pandas.DataFrame", "numpy.isin", "numpy.asarray", "numpy.zeros", "maad.util.plot2d", "skimage.measure.label", "numpy.where", "skimage.measure.regionprops" ]
[((12272, 12292), 'skimage.measure.label', 'measure.label', (['im_t2'], {}), '(im_t2)\n', (12285, 12292), False, 'from skimage import measure\n'), ((12354, 12393), 'skimage.measure.regionprops', 'measure.regionprops', (['conncomp_t2', 'im_t3'], {}), '(conncomp_t2, im_t3)\n', (12373, 12393), False, 'from skimage import ...
import logging import os import numpy as np import argparse import open3d as o3d from urllib.request import urlretrieve from util.visualization import get_colored_point_cloud_feature from util.misc import extract_features from model.resunet import ResUNetBN2C import torch if not os.path.isfile('ResUNetBN2C-16feat-3c...
[ "argparse.ArgumentParser", "torch.load", "open3d.io.read_point_cloud", "open3d.geometry.PointCloud", "model.resunet.ResUNetBN2C", "urllib.request.urlretrieve", "os.path.isfile", "torch.cuda.is_available", "numpy.array", "open3d.utility.Vector3dVector" ]
[((283, 329), 'os.path.isfile', 'os.path.isfile', (['"""ResUNetBN2C-16feat-3conv.pth"""'], {}), "('ResUNetBN2C-16feat-3conv.pth')\n", (297, 329), False, 'import os\n'), ((367, 498), 'urllib.request.urlretrieve', 'urlretrieve', (['"""https://node1.chrischoy.org/data/publications/fcgf/2019-09-18_14-15-59.pth"""', '"""Res...
import numpy as np import sys import os, psutil from collections import deque def mem() : process = psutil.Process(os.getpid()) print(process.memory_info().rss / 1000000, "Mb", file=sys.stderr) class Graph: def neighbors(self, node): return self.neighbors_array[self.index[node]:self.index[node]+self....
[ "os.getpid", "numpy.concatenate", "numpy.copy", "numpy.zeros", "numpy.max", "collections.deque" ]
[((1543, 1582), 'numpy.zeros', 'np.zeros', (['estimNbAretes'], {'dtype': 'np.int32'}), '(estimNbAretes, dtype=np.int32)\n', (1551, 1582), True, 'import numpy as np\n'), ((1592, 1631), 'numpy.zeros', 'np.zeros', (['estimNbAretes'], {'dtype': 'np.int32'}), '(estimNbAretes, dtype=np.int32)\n', (1600, 1631), True, 'import ...
from keras import backend as K from keras import optimizers from keras.layers import BatchNormalization as BN, Concatenate, Dense, Input, Lambda,Dropout from keras.models import Model from models.common import sse, bce, mmd, sampling, kl_regu from keras.losses import mean_squared_error,binary_crossentropy import numpy...
[ "keras.backend.stack", "numpy.random.seed", "keras.losses.binary_crossentropy", "keras.layers.Dropout", "keras.optimizers.Adam", "keras.models.Model", "tensorflow.set_random_seed", "keras.layers.Concatenate", "keras.layers.Dense", "keras.backend.mean", "keras.layers.Lambda", "models.common.kl_...
[((531, 549), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (545, 549), True, 'import numpy as np\n'), ((558, 577), 'tensorflow.set_random_seed', 'set_random_seed', (['(42)'], {}), '(42)\n', (573, 577), False, 'from tensorflow import set_random_seed\n'), ((678, 717), 'keras.layers.Input', 'Input', ([...
# -*- coding: utf-8 -*- import numpy as np from DictLearner import DictLearner import scipy.sparse.linalg """The inference code was adapted from <NAME>'s sparsenet implementation, available on github.""" class FISTALearner(DictLearner): def __init__(self, data, learnrate, nunits, lam = 0.4, niter...
[ "numpy.fmin", "numpy.fmax", "numpy.abs", "numpy.zeros", "numpy.sqrt" ]
[((940, 982), 'numpy.zeros', 'np.zeros', (['(self.Q.shape[0], data.shape[1])'], {}), '((self.Q.shape[0], data.shape[1]))\n', (948, 982), True, 'import numpy as np\n'), ((889, 906), 'numpy.fmax', 'np.fmax', (['(x - t)', '(0)'], {}), '(x - t, 0)\n', (896, 906), True, 'import numpy as np\n'), ((907, 924), 'numpy.fmin', 'n...
#!/usr/bin/env python import rospy from math import cos, sin, atan, pi import numpy as np import yaml import sys from sensor_msgs.msg import LaserScan from std_msgs.msg import Float64 import pdb pub = rospy.Publisher('pid_error', Float64, queue_size=10) # You can define constants in Python as uppercase global names ...
[ "rospy.Subscriber", "numpy.asarray", "rospy.Publisher", "math.sin", "std_msgs.msg.Float64", "rospy.init_node", "math.cos", "rospy.spin" ]
[((203, 255), 'rospy.Publisher', 'rospy.Publisher', (['"""pid_error"""', 'Float64'], {'queue_size': '(10)'}), "('pid_error', Float64, queue_size=10)\n", (218, 255), False, 'import rospy\n'), ((712, 735), 'numpy.asarray', 'np.asarray', (['data.ranges'], {}), '(data.ranges)\n', (722, 735), True, 'import numpy as np\n'), ...
from inferelator import amusr_workflow from inferelator import workflow from inferelator.regression.base_regression import _RegressionWorkflowMixin from inferelator.postprocessing.results_processor import ResultsProcessor from inferelator.tests.artifacts.test_data import TestDataSingleCellLike, TEST_DATA, TEST_DATA_SPA...
[ "inferelator.amusr_workflow.create_task_data_class", "inferelator.tests.artifacts.test_data.TEST_DATA_SPARSE.copy", "inferelator.tests.artifacts.test_data.TEST_DATA.copy", "numpy.array", "inferelator.workflow._factory_build_inferelator" ]
[((1835, 1902), 'inferelator.amusr_workflow.create_task_data_class', 'amusr_workflow.create_task_data_class', ([], {'workflow_class': '"""single-cell"""'}), "(workflow_class='single-cell')\n", (1872, 1902), False, 'from inferelator import amusr_workflow\n'), ((867, 957), 'inferelator.workflow._factory_build_inferelator...
from solvers.rigidity_solver.models import * import numpy as np _scale = lambda arr: arr * 15 v = lambda x, y, z: np.array([x, y, z], dtype=np.double) p = lambda x, y, z: (_scale(np.array([x, y, z], dtype=np.double))) def lerp(p, q, weight): return p + (q - p) * weight def define(stage): _p = { "a": ...
[ "numpy.linalg.norm", "numpy.cross", "numpy.array", "numpy.sqrt" ]
[((115, 151), 'numpy.array', 'np.array', (['[x, y, z]'], {'dtype': 'np.double'}), '([x, y, z], dtype=np.double)\n', (123, 151), True, 'import numpy as np\n'), ((180, 216), 'numpy.array', 'np.array', (['[x, y, z]'], {'dtype': 'np.double'}), '([x, y, z], dtype=np.double)\n', (188, 216), True, 'import numpy as np\n'), ((1...
import autoCorrection import numpy as np import unittest class TestEndToEnd(unittest.TestCase): def test_end_to_end(self): counts = np.random.negative_binomial(n=20, p=0.2, size=(10, 8)) sf = np.ones((10, 8)) corrector = autoCorrection.correctors.AECorrector() correction = correct...
[ "unittest.main", "numpy.random.uniform", "numpy.random.negative_binomial", "numpy.ones", "autoCorrection.correctors.AECorrector", "numpy.round" ]
[((2475, 2490), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2488, 2490), False, 'import unittest\n'), ((147, 201), 'numpy.random.negative_binomial', 'np.random.negative_binomial', ([], {'n': '(20)', 'p': '(0.2)', 'size': '(10, 8)'}), '(n=20, p=0.2, size=(10, 8))\n', (174, 201), True, 'import numpy as np\n'), (...
# Import all packages required # Type annotation imports from typing import Union from typing import Tuple # Other imports import os import glob import h5py from datetime import datetime from datetime import timedelta from datetime import timezone import numpy as np import pandas as pd from scipy import interpolate #-...
[ "pandas.read_csv", "numpy.mean", "scipy.interpolate.interp1d", "os.path.join", "pandas.DataFrame", "numpy.pad", "os.path.abspath", "numpy.multiply", "datetime.timedelta", "os.path.normpath", "numpy.linspace", "h5py.File", "os.stat", "os.path.basename", "datetime.datetime.strptime", "pa...
[((6149, 6261), 'pandas.DataFrame', 'pd.DataFrame', (["{'Start_timestamp': file_start_times, 'Filename': self.files,\n 'End_timestamp': file_end_times}"], {}), "({'Start_timestamp': file_start_times, 'Filename': self.files,\n 'End_timestamp': file_end_times})\n", (6161, 6261), True, 'import pandas as pd\n'), ((86...
import json import coreapi import coreschema from django.db.utils import IntegrityError from django.shortcuts import get_object_or_404 from django.utils.datastructures import MultiValueDictKeyError from numpydoc import docscrape from rest_framework import status, schemas from rest_framework.generics import ListAPIView...
[ "AnyTimeGridSearchCV.grids.models.DataSet.objects.get", "json.loads", "AnyTimeGridSearchCV.grids.models.GridSearch.objects.all", "AnyTimeGridSearchCV.grids.anytime_search._convert_clf_param", "AnyTimeGridSearchCV.grids.anytime_search.ESTIMATORS_DICT.keys", "numpydoc.docscrape.ClassDoc", "AnyTimeGridSear...
[((2201, 2225), 'AnyTimeGridSearchCV.grids.models.GridSearch.objects.all', 'GridSearch.objects.all', ([], {}), '()\n', (2223, 2225), False, 'from AnyTimeGridSearchCV.grids.models import GridSearch, CVResult, DataSet, CVResultScore\n'), ((2546, 2570), 'AnyTimeGridSearchCV.grids.models.GridSearch.objects.all', 'GridSearc...
import os import sys import json import logging import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.distributions as D import models import worlds class Executor(object): STOP = 0 def __init__(self, config): self.config = config self.device = ...
[ "numpy.stack", "torch.distributions.Categorical", "torch.load", "torch.nn.CrossEntropyLoss", "numpy.zeros", "models.load", "torch.save", "logging.info", "worlds.load", "numpy.arange", "torch.no_grad", "os.path.join", "torch.tensor", "torch.from_numpy" ]
[((391, 410), 'worlds.load', 'worlds.load', (['config'], {}), '(config)\n', (402, 410), False, 'import worlds\n'), ((1095, 1131), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {'ignore_index': '(-1)'}), '(ignore_index=-1)\n', (1114, 1131), True, 'import torch.nn as nn\n'), ((2302, 2350), 'numpy.zeros', 'np.z...
from typing import Protocol, Union import dataclasses import numpy as np class Motion(Protocol): """Protocol of a 1D motion.""" """Shift of motion along time axis.""" offset: float def at(self, t: Union[float, np.ndarray]) -> Union[float, np.ndarray]: """Returns the position at time(s).""" ...
[ "numpy.vander", "numpy.logical_and", "numpy.isscalar", "numpy.asarray", "numpy.zeros", "numpy.empty_like", "dataclasses.field", "numpy.atleast_1d", "numpy.linalg.solve" ]
[((802, 831), 'dataclasses.field', 'dataclasses.field', ([], {'init': '(False)'}), '(init=False)\n', (819, 831), False, 'import dataclasses\n'), ((2260, 2276), 'numpy.zeros', 'np.zeros', (['(4, 4)'], {}), '((4, 4))\n', (2268, 2276), True, 'import numpy as np\n'), ((2285, 2296), 'numpy.zeros', 'np.zeros', (['(4)'], {}),...
import scipy.sparse as sp import pandas as pd import numpy as np import torch import h5py def get_adj(num_rows, num_cols, row_idx, col_idx, device): adj = torch.zeros((num_rows, num_cols), dtype=torch.float32, device=device) adj[row_idx, col_idx] = 1. adj = adj / adj.sum(dim=1, keepdim=True) adj.mas...
[ "pandas.DataFrame", "h5py.File", "numpy.asarray", "numpy.argwhere", "scipy.sparse.csc_matrix", "torch.zeros", "torch.isnan", "numpy.concatenate" ]
[((162, 231), 'torch.zeros', 'torch.zeros', (['(num_rows, num_cols)'], {'dtype': 'torch.float32', 'device': 'device'}), '((num_rows, num_cols), dtype=torch.float32, device=device)\n', (173, 231), False, 'import torch\n'), ((424, 449), 'h5py.File', 'h5py.File', (['path_file', '"""r"""'], {}), "(path_file, 'r')\n", (433,...
import numpy as np from ...dimensions.dim_linear import DimLinear from ...dimensions.dim_angular import DimAngular from ...dimensions import DimRadian from ..cross_sect_base import CrossSectBase, CrossSectToken __all__ = ['CrossSectParallelogram'] class CrossSectParallelogram(CrossSectBase): def __init__(self, ...
[ "numpy.transpose", "numpy.sin", "numpy.array", "numpy.cos" ]
[((1556, 1572), 'numpy.array', 'np.array', (['[x, y]'], {}), '([x, y])\n', (1564, 1572), True, 'import numpy as np\n'), ((1591, 1606), 'numpy.transpose', 'np.transpose', (['z'], {}), '(z)\n', (1603, 1606), True, 'import numpy as np\n'), ((2036, 2066), 'numpy.array', 'np.array', (['[[x_coord, y_coord]]'], {}), '([[x_coo...
from pyraf import iraf import glob, os import numpy as np import pylab as py import math, datetime import pyfits from gcwork import objects from . import dar def diffDarOnOff(cleanDir1, cleanDir2): files1tmp = glob.glob(cleanDir1 + '/c????.fits') files2tmp = glob.glob(cleanDir2 + '/c????.fits') for f1 in ...
[ "pyraf.iraf.imarith", "numpy.arange", "glob.glob", "pylab.title", "pylab.ylabel", "os.path.exists", "numpy.tan", "datetime.timedelta", "pylab.xlabel", "pylab.legend", "gcwork.objects.Transform", "datetime.datetime", "pylab.subplot", "pylab.savefig", "math.degrees", "pyraf.iraf.imdelete...
[((215, 251), 'glob.glob', 'glob.glob', (["(cleanDir1 + '/c????.fits')"], {}), "(cleanDir1 + '/c????.fits')\n", (224, 251), False, 'import glob, os\n'), ((268, 304), 'glob.glob', 'glob.glob', (["(cleanDir2 + '/c????.fits')"], {}), "(cleanDir2 + '/c????.fits')\n", (277, 304), False, 'import glob, os\n'), ((1292, 1308), ...
from jupyterthemes import jtplot import numpy as np import os import matplotlib.pyplot as plt from pathlib import Path from scipy.ndimage import filters from textwrap import wrap import torch import vectorized_agents as va import vectorized_env as ve jtplot.style() DEVICE = torch.device('cuda') if DEVICE == torch.de...
[ "matplotlib.pyplot.tight_layout", "jupyterthemes.jtplot.style", "vectorized_agents.SavedRLAgent", "textwrap.wrap", "vectorized_agents.run_vectorized_vs", "matplotlib.pyplot.close", "vectorized_agents.PullVegasSlotMachines", "matplotlib.pyplot.subplots", "numpy.cumsum", "pathlib.Path", "scipy.ndi...
[((253, 267), 'jupyterthemes.jtplot.style', 'jtplot.style', ([], {}), '()\n', (265, 267), False, 'from jupyterthemes import jtplot\n'), ((278, 298), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (290, 298), False, 'import torch\n'), ((312, 331), 'torch.device', 'torch.device', (['"""cpu"""'], {}),...
from unittest import TestCase import numpy as np import xarray as xr from xarray.testing import assert_equal, assert_allclose import numpy.testing as npt from sklearn_xarray import wrap from sklearn.base import clone from sklearn.preprocessing import StandardScaler, KernelCenterer from sklearn.linear_model import Li...
[ "sklearn.base.clone", "xarray.testing.assert_equal", "sklearn.preprocessing.StandardScaler", "tests.mocks.ReshapingEstimator", "tests.mocks.DummyEstimator", "xarray.testing.assert_allclose", "numpy.random.random", "xarray.DataArray", "numpy.testing.assert_equal", "sklearn.svm.SVC", "sklearn.deco...
[((10179, 10203), 'sklearn_xarray.wrap', 'wrap', (['LogisticRegression'], {}), '(LogisticRegression)\n', (10183, 10203), False, 'from sklearn_xarray import wrap\n'), ((10432, 10456), 'sklearn_xarray.wrap', 'wrap', (['LogisticRegression'], {}), '(LogisticRegression)\n', (10436, 10456), False, 'from sklearn_xarray import...
#!/usr/bin/env pythonw import numpy as np from astropy.visualization import stretch, interval from astropy.io import fits from astropy import wcs from reproject import reproject_interp from matplotlib import pyplot as plt def scaleImage(image, a=1, stretch_type='asinh'): reagon = interval.AsymmetricPercentileInt...
[ "astropy.visualization.stretch.LogStretch", "astropy.visualization.interval.AsymmetricPercentileInterval", "argparse.ArgumentParser", "astropy.io.fits.PrimaryHDU", "numpy.zeros", "numpy.isfinite", "astropy.visualization.stretch.AsinhStretch", "astropy.wcs.WCS", "reproject.reproject_interp", "astro...
[((288, 338), 'astropy.visualization.interval.AsymmetricPercentileInterval', 'interval.AsymmetricPercentileInterval', (['(10.0)', '(99.95)'], {}), '(10.0, 99.95)\n', (325, 338), False, 'from astropy.visualization import stretch, interval\n'), ((1729, 1796), 'numpy.zeros', 'np.zeros', (['[images_scaled[0].shape[0], imag...
import math import pytz import sys import time from datetime import date from . import wait_times, util, arrival_history, trip_times, errors, constants, timetables, routeconfig import pandas as pd import numpy as np # Represents a range of days with a time range within each day. # RouteMetrics can calculate various s...
[ "numpy.searchsorted", "numpy.isfinite", "time.time", "numpy.sort", "pandas.concat", "numpy.concatenate" ]
[((6056, 6067), 'time.time', 'time.time', ([], {}), '()\n', (6065, 6067), False, 'import time\n'), ((7407, 7440), 'pandas.concat', 'pd.concat', (['compared_timetable_arr'], {}), '(compared_timetable_arr)\n', (7416, 7440), True, 'import pandas as pd\n'), ((7567, 7578), 'time.time', 'time.time', ([], {}), '()\n', (7576, ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import numpy as np PRECISION = 8 # in signs after dot def objective_file_name(output_prefix, input_basename, module_basename): return output_prefix + input_basename + "_F_" + module_basename + ".txt" def jacobian_file_name(output_prefix,...
[ "numpy.format_float_scientific" ]
[((507, 584), 'numpy.format_float_scientific', 'np.format_float_scientific', (['objective_time'], {'unique': '(False)', 'precision': 'PRECISION'}), '(objective_time, unique=False, precision=PRECISION)\n', (533, 584), True, 'import numpy as np\n'), ((635, 713), 'numpy.format_float_scientific', 'np.format_float_scientifi...
#%% import numpy as np import sys sys.path.append('..') from utils.tester import Tester import pickle import os import matplotlib.pyplot as plt import math import networkx as nx import random city_name = 'Phoenix' save_file_name = '2021-04-23_14-02-29' seed = 45 # city_name = 'Seattle' # save_file_name = '2021-03-21...
[ "numpy.random.seed", "matplotlib.pyplot.figure", "pickle.load", "numpy.exp", "networkx.draw_networkx_labels", "os.path.join", "sys.path.append", "numpy.max", "random.seed", "matplotlib.pyplot.show", "numpy.average", "networkx.draw", "networkx.DiGraph", "numpy.log", "os.getcwd", "numpy....
[((34, 55), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (49, 55), False, 'import sys\n'), ((488, 499), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (497, 499), False, 'import os\n'), ((577, 645), 'os.path.join', 'os.path.join', (['base_directory', '"""optimization"""', '"""save"""', 'save_file_...
import numpy as np import pandas as pd import pickle import tensorflow as tf import random import math import os import time from sklearn.metrics import average_precision_score # ------------------------------------------------------ loading libraries ---- # --- setting random seed ----------------------------------...
[ "tensorflow.random.set_seed", "sklearn.metrics.average_precision_score", "random.seed", "numpy.random.seed" ]
[((353, 375), 'numpy.random.seed', 'np.random.seed', (['seed_n'], {}), '(seed_n)\n', (367, 375), True, 'import numpy as np\n'), ((376, 395), 'random.seed', 'random.seed', (['seed_n'], {}), '(seed_n)\n', (387, 395), False, 'import random\n'), ((396, 422), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['seed_n'], ...
import numpy as np def quotient(rri): rri = np.array(rri) L = len(rri) - 1 indices = np.where((rri[:L - 1] / rri[1:L] < 0.8) | (rri[:L - 1] / rri[1:L] > 1.2) | (rri[1:L] / rri[:L - 1] < 0.8) | (rri[1:L] / rri[:L - 1] > 1.2)) return...
[ "numpy.where", "numpy.array", "numpy.delete" ]
[((50, 63), 'numpy.array', 'np.array', (['rri'], {}), '(rri)\n', (58, 63), True, 'import numpy as np\n'), ((100, 243), 'numpy.where', 'np.where', (['((rri[:L - 1] / rri[1:L] < 0.8) | (rri[:L - 1] / rri[1:L] > 1.2) | (rri[1:L\n ] / rri[:L - 1] < 0.8) | (rri[1:L] / rri[:L - 1] > 1.2))'], {}), '((rri[:L - 1] / rri[1:L]...
import itertools import os import re import sys # scans files to construct an empirical prior from bifs import BIFS # numpy >= 1.17 from numpy.random import Generator, PCG64 import numpy as np class RunningMean: """Accepts values one at a time and computes the mean and sd of all values seen so far. The input...
[ "numpy.random.PCG64", "numpy.logical_not", "os.walk", "itertools.count", "bifs.BIFS", "numpy.sqrt", "os.path.join", "numpy.concatenate", "re.compile" ]
[((1426, 1458), 'numpy.sqrt', 'np.sqrt', (['(self._ss / (self.n - 1))'], {}), '(self._ss / (self.n - 1))\n', (1433, 1458), True, 'import numpy as np\n'), ((4677, 4683), 'bifs.BIFS', 'BIFS', ([], {}), '()\n', (4681, 4683), False, 'from bifs import BIFS\n'), ((10015, 10042), 're.compile', 're.compile', (['matchFile', 're...
# -*- coding: utf-8 -*- import cv2 import numpy as np import sys import os from autoaim import helpers class Camera(): def __init__(self, source): self.source = source self.capture = cv2.VideoCapture(source) if type(source) is int: self.__camera = True def snapshot(self, s...
[ "cv2.VideoCapture", "autoaim.helpers.showoff", "numpy.array" ]
[((205, 229), 'cv2.VideoCapture', 'cv2.VideoCapture', (['source'], {}), '(source)\n', (221, 229), False, 'import cv2\n'), ((1730, 1753), 'numpy.array', 'np.array', (['[3600, 60, 1]'], {}), '([3600, 60, 1])\n', (1738, 1753), True, 'import numpy as np\n'), ((936, 987), 'autoaim.helpers.showoff', 'helpers.showoff', (['img...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ model.py: A custom model for CityPersons. """ import numpy as np import torch import torch.utils.data import torchvision from torchvision.models.detection.faster_rcnn import FastRCNNPredictor from engine import train_one_epoch, evaluate import utils import transforms as T...
[ "torchvision.models.detection.faster_rcnn.FastRCNNPredictor", "torch.optim.lr_scheduler.StepLR", "torch.device", "torch.no_grad", "torch.utils.data.DataLoader", "torch.load", "torchvision.models.detection.fasterrcnn_resnet50_fpn", "engine.train_one_epoch", "numpy.uint8", "torch.manual_seed", "tr...
[((496, 565), 'torchvision.models.detection.fasterrcnn_resnet50_fpn', 'torchvision.models.detection.fasterrcnn_resnet50_fpn', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (548, 565), False, 'import torchvision\n'), ((926, 969), 'torchvision.models.detection.faster_rcnn.FastRCNNPredictor', 'FastRCNNPredictor',...
# Code adapted from https://github.com/ClementPinard/SfmLearner-Pytorch/blob/master/inverse_warp.py from __future__ import division from pytorch3d.ops.knn import knn_points import torch import torch.nn.functional as F import cv2 import matplotlib.pyplot as plt import numpy as np from PIL import Image import helper_fun...
[ "torch.ones", "matplotlib.pyplot.show", "torch.stack", "torch.nn.functional.grid_sample", "torch.eye", "matplotlib.pyplot.imshow", "numpy.zeros", "torch.cat", "scipy.spatial.transform.Rotation.random", "PIL.Image.open", "helper_functions.sigmoid_2_depth", "numpy.finfo", "cv2.imread", "torc...
[((339, 357), 'numpy.finfo', 'np.finfo', (['np.float'], {}), '(np.float)\n', (347, 357), True, 'import numpy as np\n'), ((762, 806), 'helper_functions.sigmoid_2_depth', 'helper_functions.sigmoid_2_depth', (['depth_maps'], {}), '(depth_maps)\n', (794, 806), False, 'import helper_functions\n'), ((2657, 2703), 'torch.stac...
import numpy as np import tensorflow as tf from tensorflow.keras import layers import matplotlib.pyplot as plt def many2many(n_gestures=2, n_frames=300, n_features=21, rnn_units=32): """Model for predicting labels for a sequence of multiple gestures Arguments: n_gestures -- int, size of gesture vocabulary...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "tensorflow.keras.layers.Dense", "tensorflow.keras.Input", "matplotlib.pyplot.legend", "tensorflow.keras.Model", "tensorflow.keras.layers.LSTM", "numpy.squeeze", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((526, 570), 'tensorflow.keras.Input', 'tf.keras.Input', ([], {'shape': '(n_frames, n_features)'}), '(shape=(n_frames, n_features))\n', (540, 570), True, 'import tensorflow as tf\n'), ((847, 910), 'tensorflow.keras.Model', 'tf.keras.Model', ([], {'inputs': 'inputs', 'outputs': 'outputs', 'name': '"""many2one"""'}), "(...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on 26/04/2016 Versão 1.0 @author: Ricieri (ELP) Python 3.4.4 """ """ Reviewed on 15/10/2020 Versão 1.0 rev.A - rounded printing values to 3 decimal places and displays '°C' instead of 'ºC'. @author: Marcelo (ELP) Python 3.8.6 """ """ Reviewed on 06/05/2021 Versão 1...
[ "serial.Serial", "siriuspy.magnet.util.get_default_ramp_waveform", "math.isnan", "csv.reader", "csv.writer", "numpy.float32", "struct.unpack", "struct.pack", "time.sleep", "matplotlib.pyplot.figure", "os.path.join", "os.listdir" ]
[((31867, 31882), 'serial.Serial', 'serial.Serial', ([], {}), '()\n', (31880, 31882), False, 'import serial\n'), ((34022, 34045), 'struct.pack', 'struct.pack', (['"""f"""', 'value'], {}), "('f', value)\n", (34033, 34045), False, 'import struct\n'), ((34679, 34702), 'struct.pack', 'struct.pack', (['"""H"""', 'value'], {...
# -*- coding: utf-8 -*- from __future__ import print_function import pytest import irispy.iris_tools as iris_tools import numpy as np import numpy.testing as np_test source_data = np.array([[ 0.563, 1.132, -1.343], [-0.719, 1.441, 1.566]]) source_data1 = np.array([[1, 2, 3], [4, 5, 6]]) def test_conver...
[ "irispy.iris_tools.calculate_intensity_fractional_uncertainty", "pytest.raises", "irispy.iris_tools.convert_DN_to_photons", "numpy.array", "irispy.iris_tools.convert_photons_to_DN", "numpy.testing.assert_allclose" ]
[((181, 239), 'numpy.array', 'np.array', (['[[0.563, 1.132, -1.343], [-0.719, 1.441, 1.566]]'], {}), '([[0.563, 1.132, -1.343], [-0.719, 1.441, 1.566]])\n', (189, 239), True, 'import numpy as np\n'), ((265, 297), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6]]'], {}), '([[1, 2, 3], [4, 5, 6]])\n', (273, 297), True...
""" Copyright (C) 2020, <NAME>, https://www.gagolewski.com 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.median", "numpy.loadtxt" ]
[((1269, 1295), 'numpy.loadtxt', 'np.loadtxt', (['fname'], {'ndmin': '(2)'}), '(fname, ndmin=2)\n', (1279, 1295), True, 'import numpy as np\n'), ((1840, 1860), 'numpy.median', 'np.median', (['X'], {'axis': '(0)'}), '(X, axis=0)\n', (1849, 1860), True, 'import numpy as np\n'), ((1675, 1695), 'numpy.median', 'np.median',...
import numpy as np import random class ExperienceMemory(object): def __init__(self, capacity, stateLength): self.__capacity = capacity self.__usedCapacity = 0 self.__stateLength = stateLength self.__writePosition = 0 self.__writePositionReseted = False self.__ids = ...
[ "numpy.zeros" ]
[((320, 361), 'numpy.zeros', 'np.zeros', (['self.__capacity'], {'dtype': '"""uint64"""'}), "(self.__capacity, dtype='uint64')\n", (328, 361), True, 'import numpy as np\n'), ((388, 452), 'numpy.zeros', 'np.zeros', (['(self.__capacity, self.__stateLength)'], {'dtype': '"""float32"""'}), "((self.__capacity, self.__stateLe...
#!/usr/bin/env python import argparse import sys from typing import List, Optional import bdfparser import numpy as np DRAWING_CHARS = "8,10,176-223" def main(): args = parse_args() font = bdfparser.Font(args.bdf_file) # Choose glyphs from font and convert them to bitmaps bitmaps = [get_bitmap_for_...
[ "argparse.ArgumentParser", "numpy.resize", "numpy.zeros", "numpy.rot90", "bdfparser.Font", "numpy.array_equal", "numpy.concatenate" ]
[((201, 230), 'bdfparser.Font', 'bdfparser.Font', (['args.bdf_file'], {}), '(args.bdf_file)\n', (215, 230), False, 'import bdfparser\n'), ((604, 641), 'numpy.zeros', 'np.zeros', (['(height, 8)'], {'dtype': 'np.uint8'}), '((height, 8), dtype=np.uint8)\n', (612, 641), True, 'import numpy as np\n'), ((1128, 1224), 'argpar...
import tensorflow as tf import numpy as np import math class Position_Encoder(object): def __init__(self, emb_size, max_len=5000): self.emb_size = emb_size self.max_len = max_len pe = np.zeros([max_len, emb_size], np.float32) position = np.expand_dims(np.arange(0, max_len), 1).astyp...
[ "tensorflow.contrib.layers.xavier_initializer", "tensorflow.reduce_all", "tensorflow.Variable", "numpy.sin", "numpy.arange", "tensorflow.greater_equal", "tensorflow.get_variable", "tensorflow.nn.softmax", "tensorflow.variable_scope", "tensorflow.concat", "tensorflow.nn.selu", "math.log", "te...
[((213, 254), 'numpy.zeros', 'np.zeros', (['[max_len, emb_size]', 'np.float32'], {}), '([max_len, emb_size], np.float32)\n', (221, 254), True, 'import numpy as np\n'), ((462, 489), 'numpy.sin', 'np.sin', (['(position * div_term)'], {}), '(position * div_term)\n', (468, 489), True, 'import numpy as np\n'), ((512, 539), ...
import os import unittest import numpy as np import numpy.random as rnd import tensorflow as tf from pymanopt.function import TensorFlow from . import _backend_tests os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" class TestUnaryFunction(_backend_tests.TestUnaryFunction): def setUp(self): super().setUp() ...
[ "tensorflow.reduce_sum", "numpy.random.randn", "pymanopt.function.TensorFlow", "tensorflow.zeros", "tensorflow.tensordot" ]
[((397, 410), 'pymanopt.function.TensorFlow', 'TensorFlow', (['x'], {}), '(x)\n', (407, 410), False, 'from pymanopt.function import TensorFlow\n'), ((764, 780), 'pymanopt.function.TensorFlow', 'TensorFlow', (['x', 'y'], {}), '(x, y)\n', (774, 780), False, 'from pymanopt.function import TensorFlow\n'), ((1225, 1244), 'p...
import numpy as np import robodk import time import queue from scipy.spatial.transform import Rotation, Slerp from PIL import Image from robolink import * from matplotlib import pyplot as plt import multiprocessing from constants import BELT_VELOCITY BOX_RANDOM_ANGLE = np.pi / 8.0 BOX_X_RANDOM = 50.0 GRAVITY = -9.81 ...
[ "numpy.random.uniform", "multiprocessing.Lock", "numpy.ones", "time.sleep", "numpy.array", "multiprocessing.Queue", "multiprocessing.Process" ]
[((504, 540), 'numpy.array', 'np.array', (['[0.0, -BELT_VELOCITY, 0.0]'], {}), '([0.0, -BELT_VELOCITY, 0.0])\n', (512, 540), True, 'import numpy as np\n'), ((3787, 3810), 'multiprocessing.Queue', 'multiprocessing.Queue', ([], {}), '()\n', (3808, 3810), False, 'import multiprocessing\n'), ((3837, 3859), 'multiprocessing...
# # 为 GUI 封装的函数 不可直接运行 # Author: Xiaohei # Updatetime: 2021-12-01 # import cv2 import os import numpy import pickle from enhance import image_enhance def get_descriptors(img): clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8, 8)) img = clahe.apply(img) img = image_enhance.image_enhance(img) img...
[ "os.listdir", "pickle.dump", "enhance.image_enhance.image_enhance", "cv2.threshold", "cv2.BFMatcher", "cv2.normalize", "cv2.imread", "pickle.load", "numpy.array", "cv2.ORB_create", "cv2.KeyPoint", "cv2.createCLAHE", "os.path.join", "cv2.cornerHarris", "cv2.resize" ]
[((191, 242), 'cv2.createCLAHE', 'cv2.createCLAHE', ([], {'clipLimit': '(2.0)', 'tileGridSize': '(8, 8)'}), '(clipLimit=2.0, tileGridSize=(8, 8))\n', (206, 242), False, 'import cv2\n'), ((280, 312), 'enhance.image_enhance.image_enhance', 'image_enhance.image_enhance', (['img'], {}), '(img)\n', (307, 312), False, 'from ...
__author__ = 'aymgal' # implementations of proximal operators adapted to sparsity import numpy as np from slitronomy.Util import util def prox_sparsity_wavelets(coeffs_input, step, level_const=None, level_pixels=None, l_norm=1): """ Apply soft or hard threshold on all wavelets scales excepts the last one (t...
[ "slitronomy.Util.util.soft_threshold", "slitronomy.Util.util.hard_threshold", "numpy.ones", "numpy.copy" ]
[((526, 547), 'numpy.copy', 'np.copy', (['coeffs_input'], {}), '(coeffs_input)\n', (533, 547), True, 'import numpy as np\n'), ((1118, 1138), 'numpy.copy', 'np.copy', (['image_input'], {}), '(image_input)\n', (1125, 1138), True, 'import numpy as np\n'), ((1599, 1616), 'numpy.ones', 'np.ones', (['n_scales'], {}), '(n_sca...
# # キャプチャー画像を推定する # キャプチャー画像を100x100にリサイズする # #--------------------------------------------------------- #import keras import tensorflow as tf from tensorflow.python.keras.models import Model from tensorflow.python.keras.layers import * from tensorflow.python.keras.models import load_model import numpy as np import os...
[ "tensorflow.python.keras.models.load_model", "cv2.waitKey", "numpy.asarray", "cv2.imshow", "PIL.Image.open", "cv2.VideoCapture", "numpy.array", "PIL.Image.fromarray", "cv2.destroyAllWindows", "cv2.resize" ]
[((405, 436), 'tensorflow.python.keras.models.load_model', 'load_model', (['"""./original_img.h5"""'], {}), "('./original_img.h5')\n", (415, 436), False, 'from tensorflow.python.keras.models import load_model\n'), ((520, 547), 'PIL.Image.open', 'Image.open', (['"""./img/g/0.png"""'], {}), "('./img/g/0.png')\n", (530, 5...
import os import logging os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' logging.getLogger('tensorflow').disabled = True import numpy as np import tensorflow as tf import tensorflow_addons as tfa from tqdm import tqdm, tqdm_notebook from augment import CTAugment from tensorflow.python.framework import constant_op from tens...
[ "tensorflow.python.framework.constant_op.constant", "tensorflow.keras.losses.CategoricalCrossentropy", "numpy.arange", "error.test_error", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.random.uniform", "tensorflow.python.ops.math_...
[((67, 98), 'logging.getLogger', 'logging.getLogger', (['"""tensorflow"""'], {}), "('tensorflow')\n", (84, 98), False, 'import logging\n'), ((3844, 3959), 'tensorflow_addons.optimizers.SGDW', 'tfa.optimizers.SGDW', (["hparams['weight_decay']", 'schedule'], {'momentum': "hparams['beta']", 'nesterov': "hparams['nesterov'...
import cv2 import numpy def colorDetection(image): #Converts image HSV type image hsvImage = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) testImage = image #Ranges for color detection lowerYellow = numpy.array([20, 100, 100]) upperYellow = numpy.array([30,255, 255]) lowerBlue = numpy.array([85,1...
[ "cv2.contourArea", "numpy.argmax", "cv2.cvtColor", "cv2.waitKey", "cv2.imshow", "cv2.VideoCapture", "numpy.array", "cv2.rectangle", "cv2.boundingRect", "cv2.inRange", "cv2.findContours" ]
[((103, 141), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2HSV'], {}), '(image, cv2.COLOR_BGR2HSV)\n', (115, 141), False, 'import cv2\n'), ((214, 241), 'numpy.array', 'numpy.array', (['[20, 100, 100]'], {}), '([20, 100, 100])\n', (225, 241), False, 'import numpy\n'), ((260, 287), 'numpy.array', 'numpy.arra...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import contextlib import itertools...
[ "numpy.random.seed", "numpy.random.get_state", "numpy.random.set_state", "time.time", "itertools.islice", "os.listdir", "numpy.random.shuffle" ]
[((761, 777), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (771, 777), False, 'import os\n'), ((24225, 24246), 'numpy.random.get_state', 'np.random.get_state', ([], {}), '()\n', (24244, 24246), True, 'import numpy as np\n'), ((24251, 24271), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', ...
#!/usr/bin/env python import os import roslib; roslib.load_manifest('freemovr_engine') import rosbag import sensor_msgs.msg import geometry_msgs.msg import pymvg import numpy as np def test_bag(): for i in range(1000): bagout = rosbag.Bag('/tmp/testbag.bag', 'w') topic = '/tf' extrinsic...
[ "rosbag.Bag", "pymvg.CameraModel.load_camera_from_file", "pymvg.CameraModel.load_camera_simple", "os.path.exists", "numpy.random.rand", "roslib.load_manifest" ]
[((48, 87), 'roslib.load_manifest', 'roslib.load_manifest', (['"""freemovr_engine"""'], {}), "('freemovr_engine')\n", (68, 87), False, 'import roslib\n'), ((650, 688), 'pymvg.CameraModel.load_camera_simple', 'pymvg.CameraModel.load_camera_simple', ([], {}), '()\n', (686, 688), False, 'import pymvg\n'), ((809, 830), 'os...
from firebase import firebase from datetime import date from datetime import datetime import numpy as np import cv2 import imghdr import base64 import json ''' Stucture of Our Main Object Note that a unique id will be created when we save it for the first time in db, its not show currently. We will use...
[ "firebase.firebase.FirebaseApplication", "datetime.datetime.now", "datetime.date.today", "numpy.array" ]
[((541, 553), 'datetime.date.today', 'date.today', ([], {}), '()\n', (551, 553), False, 'from datetime import date\n'), ((606, 620), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (618, 620), False, 'from datetime import datetime\n'), ((739, 811), 'firebase.firebase.FirebaseApplication', 'firebase.FirebaseA...
import numpy as np import scipy import scipy.sparse import matplotlib.pyplot as plt # part 2 - read sparse matrix from csv file def read_coo(fname): Y = np.loadtxt(fname, delimiter=',') rows = np.array(Y[:, 0], int) cols = np.array(Y[:, 1], int) V = Y[:, 2] return scipy.sparse.coo_matrix((np.array...
[ "matplotlib.pyplot.show", "numpy.abs", "numpy.array", "numpy.loadtxt", "numpy.random.normal", "numpy.linalg.norm", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((1567, 1602), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {'figsize': '(10, 8)'}), '(1, 1, figsize=(10, 8))\n', (1579, 1602), True, 'import matplotlib.pyplot as plt\n'), ((1707, 1729), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""sbm.png"""'], {}), "('sbm.png')\n", (1718, 1729), True, 'import ...
# Thanks to KKiller on Kaggle for designing this model. from torch.utils.data import Dataset, DataLoader from abc import ABC from pathlib import Path from numcodecs import blosc import pandas as pd, numpy as np import bisect import itertools as it from tqdm import tqdm import logzero import json import torch from to...
[ "torch.bmm", "torch.sqrt", "torch.cat", "gc.collect", "pathlib.Path", "torch.no_grad", "torch.square", "torch.utils.data.DataLoader", "torch.nn.Conv1d", "torch.softmax", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.exp", "torch.nn.Linear", "numpy.random.choice", "datetime.datetim...
[((782, 838), 'pathlib.Path', 'Path', (['"""/data/lyft-motion-prediction-autonomous-vehicles"""'], {}), "('/data/lyft-motion-prediction-autonomous-vehicles')\n", (786, 838), False, 'from pathlib import Path\n'), ((748, 768), 'json.load', 'json.load', (['json_file'], {}), '(json_file)\n', (757, 768), False, 'import json...
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. import numpy as np from ..sine_wave_generator import SineWaveChannelConfig, SineWaveGenerator def test_generate_sinusoid() -> None: """ Tests that the samples generated from each channel matches the parameters specified in th...
[ "numpy.testing.assert_almost_equal", "numpy.expand_dims", "numpy.sin", "numpy.array", "numpy.arange" ]
[((477, 497), 'numpy.array', 'np.array', (['[5.0, 3.0]'], {}), '([5.0, 3.0])\n', (485, 497), True, 'import numpy as np\n'), ((516, 533), 'numpy.array', 'np.array', (['[5, 10]'], {}), '([5, 10])\n', (524, 533), True, 'import numpy as np\n'), ((553, 573), 'numpy.array', 'np.array', (['[1.0, 5.0]'], {}), '([1.0, 5.0])\n',...
# coding: utf-8 # --- # @File: model.py # @description: 模型类 # @Author: <NAME> # @E-mail: <EMAIL> # @Time: 3月18, 2019 # --- import tensorflow as tf from PIL import Image import scipy.misc import os from linear_3d_layer import Linear3DLayer class Model_X(tf.keras.Model): """ 继承自基类 tf.keras.Model """ d...
[ "tensorflow.keras.layers.BatchNormalization", "tensorflow.unstack", "os.makedirs", "tensorflow.keras.layers.GRU", "os.path.exists", "tensorflow.concat", "linear_3d_layer.Linear3DLayer", "numpy.hstack", "PIL.Image.fromarray", "tensorflow.squeeze", "numpy.squeeze", "tensorflow.keras.layers.MaxPo...
[((525, 632), 'linear_3d_layer.Linear3DLayer', 'Linear3DLayer', ([], {'filters': '(8)', 'kernel_size': '[1, 3, 75, 6]', 'activate_size': '[3, 1, 2]', 'activate_stride': '[3, 1, 1]'}), '(filters=8, kernel_size=[1, 3, 75, 6], activate_size=[3, 1, 2],\n activate_stride=[3, 1, 1])\n', (538, 632), False, 'from linear_3d_...
import argparse import numpy as np import time from datetime import datetime import os from copy import deepcopy import functools import typing import pickle from .. import Chem from .. import chemutils import rdkit from rdkit.Chem import Draw import rdkit.RDLogger import torch from ..chemutils import get_mol, get_sm...
[ "copy.deepcopy", "pickle.dump", "os.path.abspath", "os.makedirs", "argparse.ArgumentParser", "torch.manual_seed", "os.path.dirname", "torch.load", "os.path.exists", "numpy.random.RandomState", "rdkit.RDLogger.logger", "torch.autograd.set_grad_enabled", "numpy.random.randint", "torch.device...
[((11356, 11391), 'os.makedirs', 'os.makedirs', (['savedir'], {'exist_ok': '(True)'}), '(savedir, exist_ok=True)\n', (11367, 11391), False, 'import os\n'), ((11751, 11774), 'rdkit.RDLogger.logger', 'rdkit.RDLogger.logger', ([], {}), '()\n', (11772, 11774), False, 'import rdkit\n'), ((11830, 11855), 'argparse.ArgumentPa...
import copy import pylab import numpy as np from environment import Env from keras.layers import Dense from keras.optimizers import Adam from keras.models import Sequential from keras import backend as K EPISODES = 2500 class ReinforceAgent: def __init__(self): self.render = False self.load_model...
[ "keras.backend.placeholder", "numpy.random.choice", "numpy.zeros_like", "copy.deepcopy", "numpy.std", "keras.backend.function", "keras.backend.sum", "keras.optimizers.Adam", "numpy.zeros", "pylab.savefig", "keras.backend.log", "numpy.mean", "environment.Env", "numpy.reshape", "keras.laye...
[((2784, 2789), 'environment.Env', 'Env', ([], {}), '()\n', (2787, 2789), False, 'from environment import Env\n'), ((827, 839), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (837, 839), False, 'from keras.models import Sequential\n'), ((1116, 1146), 'keras.backend.placeholder', 'K.placeholder', ([], {'shap...
from pickle import load from bayes_implicit_solvent.continuous_parameter_experiments.gd_vs_langevin.autograd_based_experiment import Experiment, experiments, train_test_split, train_test_rmse, unreduce, expt_means def load_expt_result(path): with open(path, 'rb') as f: result = load(f) return result ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "numpy.load", "bayes_implicit_solvent.continuous_parameter_experiments.gd_vs_langevin.autograd_based_experiment.train_test_split", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.scatter", "matplotlib.pyplot.legend", "ba...
[((387, 414), 'numpy.load', 'np.load', (['"""expt_dataset.npz"""'], {}), "('expt_dataset.npz')\n", (394, 414), True, 'import numpy as np\n'), ((505, 532), 'bayes_implicit_solvent.continuous_parameter_experiments.gd_vs_langevin.autograd_based_experiment.unreduce', 'unreduce', (['predictions[inds]'], {}), '(predictions[i...
import numpy as np import pandas as pd from samplics.sae.eblup_unit_model import EblupUnitModel cornsoybean = pd.read_csv("./tests/sae/cornsoybean.csv") cornsoybean_mean = pd.read_csv("./tests/sae/cornsoybeanmeans.csv") cornsoybean = cornsoybean.sample(frac=1) # shuffle the data to remove the # print(cornsoybean) ...
[ "numpy.random.seed", "pandas.read_csv", "numpy.isclose", "numpy.array", "numpy.linspace", "samplics.sae.eblup_unit_model.EblupUnitModel", "numpy.unique" ]
[((113, 155), 'pandas.read_csv', 'pd.read_csv', (['"""./tests/sae/cornsoybean.csv"""'], {}), "('./tests/sae/cornsoybean.csv')\n", (124, 155), True, 'import pandas as pd\n'), ((175, 222), 'pandas.read_csv', 'pd.read_csv', (['"""./tests/sae/cornsoybeanmeans.csv"""'], {}), "('./tests/sae/cornsoybeanmeans.csv')\n", (186, 2...
''' This file implements the detection algorithms (message passing) on markov random field of graphs generated by ER model. The algorithms defined in this file would be imported by bin/varying_loopy.py For the specifics about the algorithms, please see the description in manuscript/amp.pdf. ''' import numpy as np imp...
[ "factorgraph.Graph", "numpy.sum", "numpy.power", "numpy.array", "numpy.exp", "itertools.product", "alphaBP.alphaGraph", "numpy.eye" ]
[((1426, 1445), 'numpy.array', 'np.array', (['proposals'], {}), '(proposals)\n', (1434, 1445), True, 'import numpy as np\n'), ((1630, 1644), 'numpy.array', 'np.array', (['prob'], {}), '(prob)\n', (1638, 1644), True, 'import numpy as np\n'), ((2155, 2174), 'numpy.array', 'np.array', (['marginals'], {}), '(marginals)\n',...
import torch import torch.nn as nn import numpy as np import json import shutil import sys import torch.nn.functional as F from torch.autograd import Variable from os import path as op from matplotlib import pyplot, patches MAX_LEN = 140 # Lenth of a tweet BATCH_SIZE = 512 EPOCH = 250 # With epoch 0, we ...
[ "matplotlib.pyplot.title", "pandas.read_csv", "torch.nn.Embedding", "numpy.argmin", "matplotlib.patches.Patch", "os.path.join", "numpy.unique", "os.path.dirname", "torch.load", "os.path.exists", "torch.nn.Linear", "shutil.copyfile", "torch.zeros", "torch.nn.GRU", "matplotlib.pyplot.show"...
[((636, 656), 'os.path.dirname', 'op.dirname', (['__file__'], {}), '(__file__)\n', (646, 656), True, 'from os import path as op\n'), ((708, 728), 'os.path.dirname', 'op.dirname', (['__file__'], {}), '(__file__)\n', (718, 728), True, 'from os import path as op\n'), ((879, 940), 'pandas.read_csv', 'pandas.read_csv', (['f...
# Python related libraries import numpy as np import random # ROS2 msgs from autonomous_exploration_msgs.msg import PointGroup class PointsGroup: """ Class similar to the one used in unity, created to handle each area in the interactive map """ def __init__(self, pG : PointGroup) -> None...
[ "numpy.zeros" ]
[((698, 729), 'numpy.zeros', 'np.zeros', (['[self.numOfPoints, 2]'], {}), '([self.numOfPoints, 2])\n', (706, 729), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- from numpy import exp, arcsin, tan, cos, sqrt, sin def comp_surface(self): """Compute the surface of the Hole Parameters ---------- self : HoleMLSRPM A HoleMLSRPM object Returns ------- S: float Surface of the Magnet. [m**2] """ Rbo = sel...
[ "numpy.arcsin", "numpy.tan", "numpy.sin", "numpy.exp", "numpy.cos", "numpy.sqrt" ]
[((355, 404), 'numpy.arcsin', 'arcsin', (['((self.R1 + self.W2) / (self.R1 + self.R3))'], {}), '((self.R1 + self.W2) / (self.R1 + self.R3))\n', (361, 404), False, 'from numpy import exp, arcsin, tan, cos, sqrt, sin\n'), ((454, 473), 'numpy.exp', 'exp', (['(-1.0j * alpha1)'], {}), '(-1.0j * alpha1)\n', (457, 473), False...
import numpy as np import matplotlib.patches class Roi(): """A class to represent a ROI """ def __init__(self, axis:int, first_slice:int, last_slice:int, roi_number:int, type_number:int, list_point:list, volume_dimension:tuple): """constructor Args: axis (int): [1 for axial, ...
[ "numpy.asarray", "numpy.zeros", "numpy.transpose" ]
[((1146, 1173), 'numpy.asarray', 'np.asarray', (['self.list_point'], {}), '(self.list_point)\n', (1156, 1173), True, 'import numpy as np\n'), ((3103, 3137), 'numpy.zeros', 'np.zeros', (['(self.x, self.y, self.z)'], {}), '((self.x, self.y, self.z))\n', (3111, 3137), True, 'import numpy as np\n'), ((3432, 3468), 'numpy.t...
# coding: utf-8 # In[ ]: from __future__ import print_function import numpy as np import tensorflow as tf from autoencoder import model import pickle import os # In[ ]: DEBUG = False PLOTTING_SUPPORT = True RUN_AS_PY_SCRIPT = False SET_EULER_PARAMS = False SET_MARMOT_PARAMS = False # Handle arguments (When ex...
[ "matplotlib.pyplot.title", "visuals.visuals_of_matches", "pickle.dump", "numpy.abs", "random.sample", "numpy.empty", "voxelize.create_twins", "ipywidgets.widgets.Dropdown", "numpy.isnan", "matplotlib.pyplot.figure", "numpy.exp", "matplotlib.pyplot.gca", "voxelize.create_rotations", "iterto...
[((1498, 1517), 'autoencoder.model.ModelParams', 'model.ModelParams', ([], {}), '()\n', (1515, 1517), False, 'from autoencoder import model\n'), ((1587, 1610), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (1605, 1610), False, 'import os\n'), ((4489, 4518), 'utilities.list_runs', 'utilities....
import numpy as np from rllab.core.serializable import Serializable from .replay_buffer import ReplayBuffer class SimpleReplayBuffer(ReplayBuffer, Serializable): def __init__(self, env_spec, max_replay_buffer_size): super(SimpleReplayBuffer, self).__init__() Serializable.quick_init(self, locals(...
[ "numpy.random.randint", "numpy.zeros", "numpy.fromstring" ]
[((630, 687), 'numpy.zeros', 'np.zeros', (['(max_replay_buffer_size, self._observation_dim)'], {}), '((max_replay_buffer_size, self._observation_dim))\n', (638, 687), True, 'import numpy as np\n'), ((944, 1001), 'numpy.zeros', 'np.zeros', (['(max_replay_buffer_size, self._observation_dim)'], {}), '((max_replay_buffer_s...
import tensorflow as tf import os import sklearn.metrics import numpy as np import sys import time def average_gradients(tower_grads): """Calculate the average gradient for each shared variable across all towers. Note that this function provides a synchronization point across all towers. Args: to...
[ "os.mkdir", "tensorflow.get_collection", "tensorflow.ConfigProto", "sys.stdout.flush", "os.path.join", "tensorflow.add_n", "tensorflow.not_equal", "tensorflow.concat", "tensorflow.placeholder", "tensorflow.summary.FileWriter", "tensorflow.name_scope", "tensorflow.summary.merge_all", "tensorf...
[((1196, 1227), 'tensorflow.concat', 'tf.concat', ([], {'axis': '(0)', 'values': 'grads'}), '(axis=0, values=grads)\n', (1205, 1227), True, 'import tensorflow as tf\n'), ((1243, 1266), 'tensorflow.reduce_mean', 'tf.reduce_mean', (['grad', '(0)'], {}), '(grad, 0)\n', (1257, 1266), True, 'import tensorflow as tf\n'), ((2...
import argparse import cv2 import glog import json import numpy as np import os from tqdm import tqdm from pycocotools import coco as coco_loader def parse_args(): """Parse arguments of command line""" parser = argparse.ArgumentParser( description='Merge annotations in COCO representation into one' ...
[ "json.dump", "tqdm.tqdm", "json.load", "cv2.putText", "argparse.ArgumentParser", "os.makedirs", "os.path.basename", "os.path.commonpath", "cv2.imwrite", "glog.info", "os.path.dirname", "os.path.exists", "cv2.imread", "pycocotools.coco.COCO", "numpy.int32", "cv2.rectangle", "os.path.j...
[((223, 316), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Merge annotations in COCO representation into one"""'}), "(description=\n 'Merge annotations in COCO representation into one')\n", (246, 316), False, 'import argparse\n'), ((1246, 1287), 'os.path.join', 'os.path.join', (['in...
from TexGen.Core import * import numpy as np from os import path def export_weave_vtu(filename, weave, domain, max_dim_nvox, round_vox_up=True, export_orientation=True): """ Exporting weave to vtu, to be read by pumapy :param filename: filepath and name :type filename: string :param weave...
[ "numpy.zeros", "numpy.max", "os.path.split", "numpy.array" ]
[((1491, 1593), 'numpy.array', 'np.array', (['[max_bounds.x - min_bounds.x, max_bounds.y - min_bounds.y, max_bounds.z -\n min_bounds.z]'], {}), '([max_bounds.x - min_bounds.x, max_bounds.y - min_bounds.y, \n max_bounds.z - min_bounds.z])\n', (1499, 1593), True, 'import numpy as np\n'), ((1603, 1618), 'numpy.max',...
import cv2 import numpy as np #script que simula o jogo, pra testar um frame #se apertar esc ele fecha, se apertar espaço alterna entre uma tela preta e um frame print("Aperte espaço para mudar frame/tela preta") print("Pressione uma tecla pra selecionar a resolução:") print("A->1280x720 zoom = 75%") print("B->1280x720...
[ "cv2.waitKey", "cv2.destroyAllWindows", "numpy.zeros", "cv2.imread", "cv2.imshow" ]
[((939, 952), 'cv2.waitKey', 'cv2.waitKey', ([], {}), '()\n', (950, 952), False, 'import cv2\n'), ((3298, 3331), 'cv2.imshow', 'cv2.imshow', (['"""Stardew Valley"""', 'img'], {}), "('Stardew Valley', img)\n", (3308, 3331), False, 'import cv2\n'), ((916, 934), 'numpy.zeros', 'np.zeros', (['[20, 20]'], {}), '([20, 20])\n...
import numpy as np def conv(f, g): def h(x): """Input x has to be equidistant! """ # If the support of f or g extends outside x, # we have to evaluate the functions also outside x # to get the values of the convolution for all x. n = len(x) d = x[1] - x[0] ...
[ "numpy.interp", "numpy.tile", "numpy.concatenate" ]
[((336, 386), 'numpy.concatenate', 'np.concatenate', (['[x[-n:] - n * d, x, x[:n] + n * d]'], {}), '([x[-n:] - n * d, x, x[:n] + n * d])\n', (350, 386), True, 'import numpy as np\n'), ((433, 455), 'numpy.tile', 'np.tile', (['x_ext', '(m, 1)'], {}), '(x_ext, (m, 1))\n', (440, 455), True, 'import numpy as np\n'), ((898, ...
#!/usr/bin/env python import numpy as np import rospy import time from sensor_msgs.msg import LaserScan from geometry_msgs.msg import Twist from nav_msgs.msg import Odometry from geometry_msgs.msg import PoseWithCovarianceStamped, PointStamped from tutoriales_basicos.msg import Histogram from tf.transformations import...
[ "numpy.size", "rospy.Subscriber", "numpy.amin", "tutoriales_basicos.msg.Histogram", "numpy.zeros", "rospy.Publisher", "rospy.init_node", "rospy.spin" ]
[((558, 602), 'numpy.amin', 'np.amin', (['[c1 - c2, c1 - c2 - s, c1 - c2 + s]'], {}), '([c1 - c2, c1 - c2 - s, c1 - c2 + s])\n', (565, 602), True, 'import numpy as np\n'), ((673, 749), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/tb3_0/scan"""', 'LaserScan', 'self.scan_callback'], {'queue_size': '(1)'}), "('/tb3_0/sc...
import numpy as np from collections import deque import gym import os import gym.spaces as spaces import cv2 import datalib.trajectories as trajectories cv2.ocl.setUseOpenCL(False) class NoopResetEnv(gym.Wrapper): def __init__(self, env, noop_max=30): """Sample initial states by taking random number of n...
[ "gym.Wrapper.__init__", "datalib.trajectories.load_trajectories_by_score", "numpy.load", "gym.make", "gym.RewardWrapper.__init__", "numpy.concatenate", "cv2.cvtColor", "collections.deque", "numpy.zeros", "cv2.ocl.setUseOpenCL", "numpy.random.RandomState", "gym.ObservationWrapper.__init__", "...
[((155, 182), 'cv2.ocl.setUseOpenCL', 'cv2.ocl.setUseOpenCL', (['(False)'], {}), '(False)\n', (175, 182), False, 'import cv2\n'), ((13187, 13203), 'gym.make', 'gym.make', (['env_id'], {}), '(env_id)\n', (13195, 13203), False, 'import gym\n'), ((13377, 13393), 'gym.make', 'gym.make', (['env_id'], {}), '(env_id)\n', (133...
#!/usr/bin/python #-*- coding: utf-8 -*- from SpeakerNet import * from utils import * from DatasetLoader import loadWAV import sys, time, os, argparse, socket import yaml import numpy import pdb import torch import glob import zipfile import datetime import os import random import subprocess import torch.distributed ...
[ "numpy.load", "os.remove", "argparse.ArgumentParser", "random.randint", "flask.Flask", "werkzeug.utils.secure_filename", "flask.jsonify", "numpy.mean", "subprocess.call", "torch.nn.functional.normalize" ]
[((638, 689), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Prepare Data"""'}), "(description='Prepare Data')\n", (661, 689), False, 'import sys, time, os, argparse, socket\n'), ((4073, 4088), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (4078, 4088), False, 'from flask i...
from functools import singledispatch import json import fsspec from toolz import groupby from loguru import logger from typing import Any, List, Union from pydantic.datetime_parse import datetime_re from pydantic.validators import parse_datetime import numpy as np from ..types import Interval from ..indexes import ...
[ "pydantic.datetime_parse.datetime_re.match", "loguru.logger.debug", "json.load", "numpy.abs", "numpy.flatnonzero", "toolz.groupby", "numpy.array", "rframe.schema.UpdateError", "pydantic.validators.parse_datetime", "fsspec.open" ]
[((9844, 9866), 'pydantic.datetime_parse.datetime_re.match', 'datetime_re.match', (['obj'], {}), '(obj)\n', (9861, 9866), False, 'from pydantic.datetime_parse import datetime_re\n'), ((9935, 9954), 'pydantic.validators.parse_datetime', 'parse_datetime', (['obj'], {}), '(obj)\n', (9949, 9954), False, 'from pydantic.vali...
from __future__ import absolute_import, division import cv2 import numpy as np import time from ..utils.viz import show_frame class Tracker(object): def __init__(self, name): self.name = name def init(self, image, init_rect): raise NotImplementedError() def update(self, image): ...
[ "cv2.cvtColor", "cv2.imread", "numpy.zeros", "time.time" ]
[((465, 489), 'numpy.zeros', 'np.zeros', (['(frame_num, 4)'], {}), '((frame_num, 4))\n', (473, 489), True, 'import numpy as np\n'), ((545, 564), 'numpy.zeros', 'np.zeros', (['frame_num'], {}), '(frame_num)\n', (553, 564), True, 'import numpy as np\n'), ((635, 655), 'cv2.imread', 'cv2.imread', (['img_file'], {}), '(img_...
# Copyright 2019 DeepMind Technologies Limited. 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 ...
[ "absl.testing.absltest.main", "numpy.ones", "jax.random.PRNGKey", "numpy.mean", "numpy.arange", "numpy.testing.assert_array_almost_equal", "numpy.full", "numpy.zeros_like", "numpy.std", "jax.local_device_count", "numpy.empty_like", "haiku._src.batch_norm.BatchNorm", "numpy.testing.assert_all...
[((6809, 6840), 'os.environ.get', 'os.environ.get', (['"""XLA_FLAGS"""', '""""""'], {}), "('XLA_FLAGS', '')\n", (6823, 6840), False, 'import os\n'), ((6960, 6975), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (6973, 6975), False, 'from absl.testing import absltest\n'), ((1117, 1154), 'haiku._src.bat...
import cv2 import numpy as np def canny(image): gray = cv2.cvtColor(lane_image, cv2.COLOR_RGB2GRAY) blur = cv2.GaussianBlur(gray, (5, 5), 0) canny = cv2.Canny(blur, 50, 150) return canny def display_lines(image, lines): line_image = np.zeros_like(image) if lines is not None: for line...
[ "cv2.line", "cv2.GaussianBlur", "cv2.Canny", "numpy.zeros_like", "numpy.copy", "cv2.bitwise_and", "cv2.waitKey", "cv2.cvtColor", "cv2.addWeighted", "cv2.fillPoly", "cv2.imread", "numpy.array", "cv2.imshow" ]
[((776, 804), 'cv2.imread', 'cv2.imread', (['"""test_image.jpg"""'], {}), "('test_image.jpg')\n", (786, 804), False, 'import cv2\n'), ((818, 832), 'numpy.copy', 'np.copy', (['image'], {}), '(image)\n', (825, 832), True, 'import numpy as np\n'), ((1065, 1115), 'cv2.addWeighted', 'cv2.addWeighted', (['lane_image', '(0.8)...
# -*- coding: UTF-8 -*- """ 此脚本用于展示如何利用神经网络解决分类问题 """ import os from mlp import ANN import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs, make_circles, make_moons from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import StandardScaler, OneHotEncod...
[ "sklearn.datasets.make_circles", "numpy.meshgrid", "sklearn.preprocessing.StandardScaler", "numpy.random.seed", "matplotlib.pyplot.show", "mlp.ANN", "sklearn.preprocessing.OneHotEncoder", "sklearn.datasets.make_blobs", "sklearn.datasets.make_moons", "sklearn.linear_model.LogisticRegression", "ma...
[((366, 387), 'numpy.random.seed', 'np.random.seed', (['(12046)'], {}), '(12046)\n', (380, 387), True, 'import numpy as np\n'), ((400, 451), 'sklearn.datasets.make_blobs', 'make_blobs', ([], {'n_samples': 'n', 'centers': '[[-2, -2], [2, 2]]'}), '(n_samples=n, centers=[[-2, -2], [2, 2]])\n', (410, 451), False, 'from skl...
import numpy as np import cv2 import tensorflow as tf import argparse import time from PIL import Image import tf1st if __name__ == "__main__": # Argument parse parser = argparse.ArgumentParser(description='Neural Style Transfer with OpenCV and Tensorflow') parser.add_argument('--input-image', default="./images...
[ "argparse.ArgumentParser", "tensorflow.clip_by_value", "tf1st.gram_matrix", "tensorflow.executing_eagerly", "tensorflow.Variable", "tf1st.get_model", "cv2.imshow", "cv2.imwrite", "cv2.waitKey", "time.sleep", "tensorflow.enable_eager_execution", "tf1st.load_and_process_img", "tf1st.deprocess_...
[((176, 268), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Neural Style Transfer with OpenCV and Tensorflow"""'}), "(description=\n 'Neural Style Transfer with OpenCV and Tensorflow')\n", (199, 268), False, 'import argparse\n'), ((947, 974), 'tensorflow.enable_eager_execution', 'tf....
from functools import partial import importlib import pytest from pathlib import Path import zarr import dask.array as dsa import dask import dask.core import xarray import numpy from rechunker import api _DIMENSION_KEY = "_ARRAY_DIMENSIONS" def requires_import(module, *args): try: importlib.import_mo...
[ "dask.array.equal", "rechunker.api.rechunk", "numpy.ones", "pathlib.Path", "pytest.mark.skipif", "rechunker.executors.pywren.pywren_local_function_executor", "dask.core.istask", "pytest.mark.parametrize", "zarr.Blosc", "numpy.prod", "rechunker.api._get_executor", "zarr.open", "dask.array.one...
[((534, 573), 'functools.partial', 'partial', (['requires_import', '"""apache_beam"""'], {}), "(requires_import, 'apache_beam')\n", (541, 573), False, 'from functools import partial\n'), ((593, 628), 'functools.partial', 'partial', (['requires_import', '"""prefect"""'], {}), "(requires_import, 'prefect')\n", (600, 628)...
#!/usr/bin/env python3 """The main entry point to the PDP trainer/tester/predictor.""" # Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file # in the project root for full license information. import numpy as np import torch import torch.optim as optim import ...
[ "yaml.load", "os.path.abspath", "numpy.random.seed", "csv.writer", "argparse.ArgumentParser", "logging.basicConfig", "os.makedirs", "torch.manual_seed", "os.path.isdir", "os.path.exists", "os.path.relpath", "pdp.trainer.SatFactorGraphTrainer", "os.path.join", "os.listdir", "logging.getLo...
[((1884, 1939), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': 'format'}), '(level=logging.DEBUG, format=format)\n', (1903, 1939), False, 'import logging\n'), ((1958, 2030), 'logging.getLogger', 'logging.getLogger', (["(config['model_name'] + ' (' + config['version'] + ')')"], {...
# -*- coding: utf-8 -*- """ Created on Mon Aug 29 10:58:31 2016 @author: <EMAIL> """ import numpy as np import scipy import matplotlib.pyplot as plt import seaborn as sns from matplotlib.patches import Ellipse def plot_cov_ellipse(cov, pos, nstd=2, ax=None, **kwargs): """ Plots an `nstd` sigma error ellips...
[ "numpy.arctan2", "numpy.linalg.eigh", "matplotlib.pyplot.gca", "matplotlib.patches.Ellipse", "numpy.sqrt" ]
[((1407, 1473), 'matplotlib.patches.Ellipse', 'Ellipse', ([], {'xy': 'pos', 'width': 'width', 'height': 'height', 'angle': 'theta'}), '(xy=pos, width=width, height=height, angle=theta, **kwargs)\n', (1414, 1473), False, 'from matplotlib.patches import Ellipse\n'), ((1068, 1087), 'numpy.linalg.eigh', 'np.linalg.eigh', (...
# Copyright 2018 DeepMind Technologies Limited. 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 ...
[ "absl.testing.absltest.main", "chex.fake_pmap_and_jit", "optax.adam", "acme.types.Transition", "acme.jax.networks.NormalTanhDistribution", "jax.random.PRNGKey", "jax.nn.one_hot", "acme.testing.fakes.transition_dataset", "numpy.prod", "acme.testing.fakes.DiscreteEnvironment", "acme.agents.jax.bc....
[((1951, 1986), 'acme.jax.utils.zeros_like', 'utils.zeros_like', (['spec.observations'], {}), '(spec.observations)\n', (1967, 1986), False, 'from acme.jax import utils\n'), ((2001, 2031), 'acme.jax.utils.add_batch_dim', 'utils.add_batch_dim', (['dummy_obs'], {}), '(dummy_obs)\n', (2020, 2031), False, 'from acme.jax imp...
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
[ "angus_display.blur", "angus_display.displayHair", "cv2.imencode", "cv2.imshow", "angus_display.displayAnimation", "angus_display.displayAge", "angus_display.displayGaze", "cv2.cvtColor", "angus_display.displayAvatar", "angus_display.display_logo", "cv2.destroyAllWindows", "datetime.datetime.n...
[((995, 1025), 'cv2.VideoCapture', 'cv2.VideoCapture', (['stream_index'], {}), '(stream_index)\n', (1011, 1025), False, 'import cv2\n'), ((1407, 1429), 'stats.Stats', 'st.Stats', (['"""stats.json"""'], {}), "('stats.json')\n", (1415, 1429), True, 'import stats as st\n'), ((1478, 1493), 'angus.connect', 'angus.connect',...
# -*- coding: utf-8 -*- import logging import numpy as np import gensim from .common import MultiprocModelsRunner, MultiprocModelsWorkerABC, MultiprocEvaluationRunner, \ MultiprocEvaluationWorkerABC, dtm_to_gensim_corpus from .eval_metrics import metric_cao_juan_2009 AVAILABLE_METRICS = ( 'perplexity', # ...
[ "numpy.exp2", "gensim.models.ldamodel.LdaModel", "logging.getLogger" ]
[((393, 423), 'logging.getLogger', 'logging.getLogger', (['"""tmtoolkit"""'], {}), "('tmtoolkit')\n", (410, 423), False, 'import logging\n'), ((630, 652), 'numpy.exp2', 'np.exp2', (['(-perwordbound)'], {}), '(-perwordbound)\n', (637, 652), True, 'import numpy as np\n'), ((869, 916), 'gensim.models.ldamodel.LdaModel', '...
# -*- coding: utf-8 -*- import warnings import numpy as np import pandas as pd import pytest with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) import xarray as xr from snl_d3d_cec_verify.cases import CaseStudy from snl_d3d_cec_verify.result.faces import (_check_c...
[ "snl_d3d_cec_verify.result.faces._get_quadrilateral_centre", "pandas.read_csv", "numpy.isclose", "snl_d3d_cec_verify.result.faces._faces_frame_to_slice", "snl_d3d_cec_verify.result.faces._trim_to_faces_frame", "pytest.mark.parametrize", "pytest.raises", "warnings.catch_warnings", "snl_d3d_cec_verify...
[((10168, 10233), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""x, y"""', "[('mock', None), (None, 'mock')]"], {}), "('x, y', [('mock', None), (None, 'mock')])\n", (10191, 10233), False, 'import pytest\n'), ((101, 126), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {}), '()\n', (124, 126), Fa...
import colorsys import math import os import random from decimal import Decimal import hpbandster.core.result as hpres import matplotlib.pyplot as plt import numpy as np # smallest value is best -> reverse_loss = True # largest value is best -> reverse_loss = False REVERSE_LOSS = True EXP_LOSS = 1 OUTLIER_PERC_WORST ...
[ "matplotlib.pyplot.title", "numpy.mean", "numpy.arange", "colorsys.hls_to_rgb", "os.path.join", "numpy.std", "matplotlib.pyplot.yticks", "matplotlib.pyplot.subplots", "hpbandster.core.result.logged_results_to_HBS_result", "matplotlib.pyplot.show", "random.random", "matplotlib.pyplot.subplots_a...
[((445, 488), 'hpbandster.core.result.logged_results_to_HBS_result', 'hpres.logged_results_to_HBS_result', (['log_dir'], {}), '(log_dir)\n', (479, 488), True, 'import hpbandster.core.result as hpres\n'), ((2340, 2356), 'matplotlib.pyplot.title', 'plt.title', (['title'], {}), '(title)\n', (2349, 2356), True, 'import mat...
import numpy as np import pandas as pd from pytest import approx from lenskit.topn import precision from lenskit.util.test import demo_recs from lenskit import topn def _test_prec(items, rel, **k): recs = pd.DataFrame({'item': items}) truth = pd.DataFrame({'item': rel}).set_index('item') return precisio...
[ "pandas.DataFrame", "pandas.Index", "numpy.arange", "pandas.Series", "numpy.array", "lenskit.topn.precision", "lenskit.topn.RecListAnalysis", "pytest.approx" ]
[((213, 242), 'pandas.DataFrame', 'pd.DataFrame', (["{'item': items}"], {}), "({'item': items})\n", (225, 242), True, 'import pandas as pd\n'), ((312, 339), 'lenskit.topn.precision', 'precision', (['recs', 'truth'], {}), '(recs, truth, **k)\n', (321, 339), False, 'from lenskit.topn import precision\n'), ((2499, 2513), ...
import numpy as np from skmultiflow.trees.nodes import ActiveLearningNodePerceptron from skmultiflow.trees.attribute_observer import NominalAttributeRegressionObserver from skmultiflow.trees.attribute_observer import NumericAttributeRegressionObserver from skmultiflow.utils import get_dimensions class RandomLearning...
[ "skmultiflow.trees.attribute_observer.NominalAttributeRegressionObserver", "skmultiflow.trees.attribute_observer.NumericAttributeRegressionObserver", "skmultiflow.utils.get_dimensions", "numpy.array" ]
[((1649, 1661), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1657, 1661), True, 'import numpy as np\n'), ((3595, 3612), 'skmultiflow.utils.get_dimensions', 'get_dimensions', (['X'], {}), '(X)\n', (3609, 3612), False, 'from skmultiflow.utils import get_dimensions\n'), ((3867, 3903), 'skmultiflow.trees.attribute_o...
import numpy as np import theano import lasagne ## ALIASES ## L = lasagne.layers T = theano.tensor get_output = L.get_output get_all_params = L.get_all_params cross_entropy = lasagne.objectives.categorical_crossentropy get_layers = L.get_all_layers class Network(object): """ Wrapper for neural networks for M...
[ "numpy.load", "theano.function", "numpy.zeros", "numpy.array", "numpy.savez" ]
[((904, 917), 'numpy.zeros', 'np.zeros', (['(500)'], {}), '(500)\n', (912, 917), True, 'import numpy as np\n'), ((945, 958), 'numpy.zeros', 'np.zeros', (['(500)'], {}), '(500)\n', (953, 958), True, 'import numpy as np\n'), ((2183, 2238), 'theano.function', 'theano.function', (['[self.input_var]', 'self.test_prediction'...
# Copyright 2019 Graphcore Ltd. """ Dataset reader from Datalogue keras-attention tutorial. References: https://github.com/datalogue/keras-attention https://medium.com/datalogue """ import json import csv import random import numpy as np # from keras.utils.np_utils import to_categorical INPUT_PADDING = ...
[ "random.sample", "json.load", "csv.reader", "numpy.array" ]
[((683, 695), 'json.load', 'json.load', (['f'], {}), '(f)\n', (692, 695), False, 'import json\n'), ((3124, 3137), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (3134, 3137), False, 'import csv\n'), ((4146, 4184), 'random.sample', 'random.sample', (['instance_id', 'batch_size'], {}), '(instance_id, batch_size)\n', (...
import pytest import mxnet as mx import numpy as np from mxfusion.components.variables.runtime_variable import add_sample_dimension, array_has_samples, get_num_samples from mxfusion.components.distributions import Laplace from mxfusion.util.testutils import numpy_array_reshape, plot_univariate from mxfusion.util.testut...
[ "numpy.abs", "mxfusion.util.testutils.plot_univariate", "numpy.random.laplace", "mxfusion.components.variables.runtime_variable.array_has_samples", "numpy.random.rand", "mxfusion.components.distributions.Laplace.define_variable", "scipy.stats.laplace.logpdf", "numpy.array", "mxnet.nd.array", "mxfu...
[((391, 426), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""set_seed"""'], {}), "('set_seed')\n", (414, 426), False, 'import pytest\n'), ((1594, 1651), 'mxfusion.util.testutils.numpy_array_reshape', 'numpy_array_reshape', (['location', 'location_is_samples', 'n_dim'], {}), '(location, location_is_samples,...
from __future__ import print_function import argparse import logging import sys import os import numpy as np import matplotlib.pyplot as plt from .config import EXT from .fileio import read_binned_sfh from .utils import convertz, parse_pipeline, float2sci logger = logging.getLogger() def mh2z(num): return 0.02...
[ "matplotlib.pyplot.savefig", "numpy.sum", "argparse.ArgumentParser", "numpy.abs", "os.path.join", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "numpy.nonzero", "numpy.append", "numpy.diff", "numpy.array", "matplotlib.ticker.NullFormatter", "numpy.mean", "matplotlib.pyplot.subplot...
[((268, 287), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (285, 287), False, 'import logging\n'), ((14995, 15048), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Plot match sfh"""'}), "(description='Plot match sfh')\n", (15018, 15048), False, 'import argparse\n'), ((373, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Dec 18 10:12:42 2020 @author: shlomi """ from PW_paths import work_yuval ims_path = work_yuval / 'IMS_T' gis_path = work_yuval / 'gis' awd_path = work_yuval/'AW3D30' def interpolate_var_ds_at_multiple_dts(var_ds, geo_var_df, predict_df, ...
[ "numpy.abs", "numpy.polyfit", "sklearn.metrics.r2_score", "numpy.isnan", "seaborn.regplot", "numpy.mean", "numpy.arange", "numpy.exp", "aux_gps.coarse_dem", "salem.read_shapefile", "sklearn.model_selection.RepeatedKFold", "pandas.DataFrame", "matplotlib.pyplot.axvline", "numpy.meshgrid", ...
[((515, 529), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (527, 529), True, 'import pandas as pd\n'), ((1408, 1438), 'pandas.to_datetime', 'pd.to_datetime', (["df['datetime']"], {}), "(df['datetime'])\n", (1422, 1438), True, 'import pandas as pd\n'), ((2602, 2656), 'xarray.load_dataset', 'xr.load_dataset', ([...