code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_datasets_genetic_dataset.ipynb (unless otherwise specified). __all__ = ['row_vectorize', 'triplicate_converter', 'GenFileFormat'] # Cell from typing import Any, Dict, List, Optional, Literal, Union from enum import Enum import numpy as np from kedro.io import AbstractVe...
[ "pandas.DataFrame", "copy.deepcopy", "pandas.read_csv", "itertools.count", "functools.wraps", "types.SimpleNamespace", "numpy.select", "pandas.concat", "fastcore.meta.delegates" ]
[((935, 943), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (940, 943), False, 'from functools import partial, wraps, lru_cache\n'), ((1887, 2050), 'numpy.select', 'np.select', (['[homo_ref_cond, het_cond, homo_alt_cond]', "[rsid_genotype_df['homo_ref'], rsid_genotype_df['het'], rsid_genotype_df[\n 'homo_alt']]"...
""" xarray -> List[cog] """ from __future__ import annotations import datetime import os import itertools import operator from typing import Optional, Mapping, List import fsspec import numpy as np import pandas as pd import pystac import rasterio.warp import shapely.geometry import xarray as xr __version__ = "0.0....
[ "pystac.extensions.projection.ProjectionExtension.ext", "fsspec.get_fs_token_paths", "datetime.datetime", "numpy.cumsum", "operator.attrgetter", "numpy.array", "os.path.join", "fsspec.filesystem" ]
[((2115, 2166), 'os.path.join', 'os.path.join', (['prefix', 'f"""time={time}"""', 'f"""{name}.tif"""'], {}), "(prefix, f'time={time}', f'{name}.tif')\n", (2127, 2166), False, 'import os\n'), ((3613, 3682), 'fsspec.get_fs_token_paths', 'fsspec.get_fs_token_paths', (['blob_name'], {'storage_options': 'storage_options'}),...
# # Author: <NAME> # import sys import unittest import numpy as np from machine_learning.decomposition import LDA rng = np.random.RandomState(42) data = rng.normal(0, 1, size=(5000, 2)) labels = np.asarray([0] * 2500 + [1] * 2500) class LDATest(unittest.TestCase): def setUp(self): self.lda = LDA(n_com...
[ "unittest.main", "machine_learning.decomposition.LDA", "numpy.asarray", "numpy.random.RandomState", "numpy.array" ]
[((124, 149), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (145, 149), True, 'import numpy as np\n'), ((199, 234), 'numpy.asarray', 'np.asarray', (['([0] * 2500 + [1] * 2500)'], {}), '([0] * 2500 + [1] * 2500)\n', (209, 234), True, 'import numpy as np\n'), ((1504, 1519), 'unittest.main...
# Copyright 2014 Diamond Light Source 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 t...
[ "h5py.File", "logging.debug", "savu.plugins.savers.utils.hdf5_utils.Hdf5Utils", "os.path.exists", "savu.data.chunking.Chunking", "numpy.random.randint", "numpy.arange", "numpy.linspace", "numpy.prod" ]
[((2077, 2098), 'os.path.exists', 'os.path.exists', (['fname'], {}), '(fname)\n', (2091, 2098), False, 'import os\n'), ((2162, 2181), 'savu.plugins.savers.utils.hdf5_utils.Hdf5Utils', 'Hdf5Utils', (['self.exp'], {}), '(self.exp)\n', (2171, 2181), False, 'from savu.plugins.savers.utils.hdf5_utils import Hdf5Utils\n'), (...
from logging import getLogger from pathlib import Path from re import search try: import numpy except ImportError: numpy = False lg = getLogger(__name__) def read_tsv(filename): filename = Path(filename) if numpy: tsv = numpy.genfromtxt( fname=filename, delimiter='\t'...
[ "pathlib.Path", "re.search", "numpy.genfromtxt", "logging.getLogger" ]
[((144, 163), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (153, 163), False, 'from logging import getLogger\n'), ((205, 219), 'pathlib.Path', 'Path', (['filename'], {}), '(filename)\n', (209, 219), False, 'from pathlib import Path\n'), ((3173, 3203), 're.search', 'search', (['pattern', 'filena...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import numpy as np import cPickle as pk from itertools import izip from sklearn.metrics import confusion_matrix from sklearn.cluster import KMeans, SpectralClustering import matplotlib.pyplot as plt # from neon.datasets.dataset import Dataset # from neon.util....
[ "matplotlib.pyplot.title", "sklearn.metrics.confusion_matrix", "os.path.abspath", "matplotlib.pyplot.show", "numpy.argmax", "sklearn.cluster.SpectralClustering", "matplotlib.pyplot.imshow", "matplotlib.pyplot.close", "sklearn.cluster.KMeans", "numpy.zeros", "cPickle.load", "numpy.argmin", "m...
[((489, 514), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (504, 514), False, 'import os\n'), ((652, 662), 'cPickle.load', 'pk.load', (['f'], {}), '(f)\n', (659, 662), True, 'import cPickle as pk\n'), ((675, 699), 'numpy.argmax', 'np.argmax', (['train'], {'axis': '(1)'}), '(train, axis=1)\n...
import cv2 import dlib import numpy as np def empty(a): pass cv2.namedWindow("BGR") cv2.resizeWindow("BGR",400,240) cv2.createTrackbar("Blue","BGR",0,255,empty) cv2.createTrackbar("Green","BGR",0,255,empty) cv2.createTrackbar("Red","BGR",0,255,empty) def create(img, points,masked = False, cropped = True): if ...
[ "cv2.GaussianBlur", "cv2.bitwise_and", "cv2.fillPoly", "cv2.imshow", "dlib.shape_predictor", "numpy.zeros_like", "cv2.cvtColor", "cv2.getTrackbarPos", "cv2.boundingRect", "cv2.destroyAllWindows", "cv2.resize", "cv2.createTrackbar", "cv2.waitKey", "cv2.addWeighted", "dlib.get_frontal_face...
[((67, 89), 'cv2.namedWindow', 'cv2.namedWindow', (['"""BGR"""'], {}), "('BGR')\n", (82, 89), False, 'import cv2\n'), ((90, 123), 'cv2.resizeWindow', 'cv2.resizeWindow', (['"""BGR"""', '(400)', '(240)'], {}), "('BGR', 400, 240)\n", (106, 123), False, 'import cv2\n'), ((122, 170), 'cv2.createTrackbar', 'cv2.createTrackb...
# Erosion and Dilation are Morphological Operations # Erosion: Removes pixels at the boundaries of objects in an image # Dilation: Adds pixels to the boundaries of objects in an image # Import Computer Vision package - cv2 import cv2 # Import Numerical Python package - numpy as np import numpy as np # Read...
[ "cv2.dilate", "cv2.waitKey", "cv2.destroyAllWindows", "numpy.ones", "cv2.imread", "cv2.erode", "cv2.imshow" ]
[((371, 396), 'cv2.imread', 'cv2.imread', (['"""image_4.jpg"""'], {}), "('image_4.jpg')\n", (381, 396), False, 'import cv2\n'), ((457, 486), 'cv2.imshow', 'cv2.imshow', (['"""Original"""', 'image'], {}), "('Original', image)\n", (467, 486), False, 'import cv2\n'), ((523, 537), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}...
import numpy as np import numpy.random as rand import matplotlib.pyplot as plt from numpy.linalg import norm def derivativetest(fun, x0): """ Test the gradient and Hessian of a function. A large proportion parallel in the middle of both plots means accuraccy. INPUTS: fun: a function handle tha...
[ "matplotlib.pyplot.loglog", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "numpy.log2", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.linalg.norm", "matplotlib.pyplot.gca", "numpy.dot", "matplotlib.pyplot.semilogx" ]
[((518, 534), 'numpy.zeros', 'np.zeros', (['(M, 1)'], {}), '((M, 1))\n', (526, 534), True, 'import numpy as np\n'), ((551, 567), 'numpy.zeros', 'np.zeros', (['(M, 1)'], {}), '((M, 1))\n', (559, 567), True, 'import numpy as np\n'), ((580, 600), 'numpy.zeros', 'np.zeros', (['(M - 1, 1)'], {}), '((M - 1, 1))\n', (588, 600...
import numpy as np # Transforms class PointcloudNoise(object): ''' Point cloud noise transformation class. It adds noise to point cloud data. Args: stddev (int): standard deviation ''' def __init__(self, stddev): self.stddev = stddev def __call__(self, data): ''' Ca...
[ "numpy.random.randn", "numpy.zeros", "numpy.ones", "numpy.random.randint", "numpy.take", "numpy.vstack", "numpy.concatenate" ]
[((1140, 1187), 'numpy.random.randint', 'np.random.randint', (['points.shape[0]'], {'size': 'self.N'}), '(points.shape[0], size=self.N)\n', (1157, 1187), True, 'import numpy as np\n'), ((507, 537), 'numpy.random.randn', 'np.random.randn', (['*points.shape'], {}), '(*points.shape)\n', (522, 537), True, 'import numpy as ...
#!/usr/bin/env python # Brief: This node filters the /tracked_agents from the laser data and publishes the filtered laser scan used for hateb # Author: <NAME> import rospy import sys import tf2_ros import numpy as np from sensor_msgs.msg import LaserScan from cohan_msgs.msg import TrackedAgents, TrackedSegmentType fr...
[ "rospy.Subscriber", "numpy.floor", "rospy.Time", "numpy.sin", "numpy.linalg.norm", "rospy.Duration", "rospy.Time.now", "tf2_ros.TransformListener", "numpy.arcsin", "rospy.Rate", "rospy.init_node", "numpy.ceil", "sensor_msgs.msg.LaserScan", "geometry_msgs.msg.TransformStamped", "numpy.cos...
[((487, 518), 'rospy.init_node', 'rospy.init_node', (['"""agent_filter"""'], {}), "('agent_filter')\n", (502, 518), False, 'import rospy\n'), ((561, 577), 'rospy.Rate', 'rospy.Rate', (['(50.0)'], {}), '(50.0)\n', (571, 577), False, 'import rospy\n'), ((607, 618), 'sensor_msgs.msg.LaserScan', 'LaserScan', ([], {}), '()\...
from core.edge import Edge, Orientation, EdgeFactory import numpy as np class Room(object): def __init__(self, edges): self.edges = edges self.groom = None @property def area(self): x = [] y = [] for edge in self.edges: p = edge.p1_by_sign(self) ...
[ "numpy.roll", "numpy.cross", "numpy.isclose", "numpy.array", "core.edge.Edge" ]
[((3771, 3783), 'core.edge.Edge', 'Edge', (['p0', 'p1'], {}), '(p0, p1)\n', (3775, 3783), False, 'from core.edge import Edge, Orientation, EdgeFactory\n'), ((8456, 8486), 'numpy.array', 'np.array', (['(x_offset, y_offset)'], {}), '((x_offset, y_offset))\n', (8464, 8486), True, 'import numpy as np\n'), ((8500, 8538), 'n...
from types import SimpleNamespace import numpy as np import biorbd from scipy import integrate, interpolate from matplotlib import pyplot as plt def read_acado_output_states(file_path, biorbd_model, nb_nodes, nb_phases): # Get some values from the model nb_dof_total = biorbd_model.nbQ() + biorbd_model.nbQdot...
[ "scipy.interpolate.splrep", "numpy.ndarray", "matplotlib.pyplot.plot", "biorbd.StateDynamics", "biorbd.Model.ForwardDynamicsConstraintsDirect", "biorbd.Model.muscularJointTorque", "biorbd.Model.ForwardDynamics", "numpy.linspace", "scipy.interpolate.splev", "biorbd.VecBiorbdMuscleStateDynamics", ...
[((412, 433), 'numpy.ndarray', 'np.ndarray', (['nb_points'], {}), '(nb_points)\n', (422, 433), True, 'import numpy as np\n'), ((2542, 2578), 'numpy.ndarray', 'np.ndarray', (['(nb_controls, nb_points)'], {}), '((nb_controls, nb_points))\n', (2552, 2578), True, 'import numpy as np\n'), ((4119, 4165), 'biorbd.VecBiorbdMus...
from argparse import ArgumentParser import numpy as np import scipy.stats as sp_stat import pandas as pd def calculate_error_rates(errors_df): rate_dicts = [] for n in pd.unique(errors_df["norm"]): for v in pd.unique(errors_df["var"]): conv_df = errors_df[(errors_df["norm"] == n) & (errors...
[ "pandas.DataFrame", "numpy.log", "argparse.ArgumentParser", "pandas.read_csv", "pandas.unique", "numpy.round" ]
[((1242, 1258), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1256, 1258), False, 'from argparse import ArgumentParser\n'), ((1598, 1632), 'pandas.read_csv', 'pd.read_csv', (['args.convergence_file'], {}), '(args.convergence_file)\n', (1609, 1632), True, 'import pandas as pd\n'), ((178, 206), 'pandas....
from hydroDL import kPath, utils from hydroDL.app import waterQuality from hydroDL.master import basins from hydroDL.data import usgs, gageII, gridMET, ntn, transform from hydroDL.master import slurm from hydroDL.post import axplot, figplot import numpy as np import matplotlib.pyplot as plt dataName = 'ssW' wqData = w...
[ "hydroDL.data.transform.transInAll", "hydroDL.master.basins.loadStat", "numpy.corrcoef", "hydroDL.master.basins.testModel", "hydroDL.app.waterQuality.DataModelWQ", "hydroDL.master.basins.loadMaster", "numpy.mean", "hydroDL.utils.rmNan", "numpy.nanmean" ]
[((319, 353), 'hydroDL.app.waterQuality.DataModelWQ', 'waterQuality.DataModelWQ', (['dataName'], {}), '(dataName)\n', (343, 353), False, 'from hydroDL.app import waterQuality\n'), ((522, 546), 'hydroDL.master.basins.loadStat', 'basins.loadStat', (['outName'], {}), '(outName)\n', (537, 546), False, 'from hydroDL.master ...
import unittest from unittest.mock import patch from unittest.mock import MagicMock import numpy as np from chart_ipynb import utils class TestUtils(unittest.TestCase): def test_clean_dict(self): test2 = np.array([1.0,3.0]) test2.astype(np.floating) result = utils.clean_dict(test1=np.array...
[ "chart_ipynb.utils.color_rgb", "chart_ipynb.utils.config", "numpy.array" ]
[((218, 238), 'numpy.array', 'np.array', (['[1.0, 3.0]'], {}), '([1.0, 3.0])\n', (226, 238), True, 'import numpy as np\n'), ((650, 664), 'chart_ipynb.utils.config', 'utils.config', ([], {}), '()\n', (662, 664), False, 'from chart_ipynb import utils\n'), ((924, 949), 'chart_ipynb.utils.color_rgb', 'utils.color_rgb', (['...
from __future__ import division, print_function import numpy as np from sklearn import datasets import matplotlib.pyplot as plt import sys import os # Import helper functions dir_path = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, dir_path + "/../utils") from data_manipulation import divide_on_featur...
[ "sklearn.datasets.load_iris", "data_manipulation.train_test_split", "numpy.shape", "data_operation.calculate_variance", "numpy.mean", "numpy.unique", "data_operation.calculate_entropy", "sklearn.datasets.make_regression", "data_operation.accuracy_score", "data_operation.mean_squared_error", "mat...
[((231, 273), 'sys.path.insert', 'sys.path.insert', (['(0)', "(dir_path + '/../utils')"], {}), "(0, dir_path + '/../utils')\n", (246, 273), False, 'import sys\n'), ((509, 568), 'sys.path.insert', 'sys.path.insert', (['(0)', "(dir_path + '/../unsupervised_learning/')"], {}), "(0, dir_path + '/../unsupervised_learning/')...
""" This module contains the classes and functions to generate the zmatrix of a molecule. """ from copy import deepcopy import numpy as np from peleffy.topology.elements import DummyAtom class ZMatrix(np.ndarray): """ It generates the zmatrix of a molecule as a numpy.array. Inspired by the PlopRotTemp...
[ "copy.deepcopy", "numpy.fabs", "numpy.arccos", "peleffy.topology.elements.DummyAtom", "numpy.sqrt" ]
[((1300, 1318), 'copy.deepcopy', 'deepcopy', (['topology'], {}), '(topology)\n', (1308, 1318), False, 'from copy import deepcopy\n'), ((1627, 1645), 'copy.deepcopy', 'deepcopy', (['topology'], {}), '(topology)\n', (1635, 1645), False, 'from copy import deepcopy\n'), ((3833, 3869), 'numpy.sqrt', 'np.sqrt', (['(dx * dx +...
# -*- coding: utf-8 -*- """ %% %% Solution Matlab de l'exercice 1 du projet CAO %% Exemple de raccord C1 de deux courbes de Bézier %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% Introduction au calcul scientifique par la pratique %%%%%%% %%%%%%% <NAME>, <NAME>, <NAME> et <...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.axis", "cbezier.cbezier", "matplotlib.pyplot.text", "numpy.arange" ]
[((699, 738), 'numpy.arange', 'np.arange', (['(0.0)', '(1.05)', '(0.05)'], {'dtype': 'float'}), '(0.0, 1.05, 0.05, dtype=float)\n', (708, 738), True, 'import numpy as np\n'), ((748, 768), 'cbezier.cbezier', 'cbezier', (['T', 'XP1', 'YP1'], {}), '(T, XP1, YP1)\n', (755, 768), False, 'from cbezier import cbezier\n'), ((7...
import jax import jax.numpy as jnp import jax.scipy.ndimage as jndi import numpy as np from jax import jit from PIL import Image import cv2 def np_to_gray(ar, floor, ceil): # to uint8 0-255 ar = 255 * (ar - floor) / (ceil - floor) # rgb a = np.array(Image.fromarray(np.uint8(ar)).convert("RGB")) #...
[ "cv2.calcOpticalFlowFarneback", "cv2.DISOpticalFlow_create", "cv2.optflow.createOptFlow_DeepFlow", "cv2.optflow.calcOpticalFlowSparseToDense", "jax.numpy.isfinite", "jax.numpy.size", "cv2.optflow.createOptFlow_PCAFlow", "cv2.cvtColor", "numpy.isfinite", "jax.numpy.add", "jax.numpy.average", "c...
[((338, 372), 'cv2.cvtColor', 'cv2.cvtColor', (['a', 'cv2.COLOR_RGB2BGR'], {}), '(a, cv2.COLOR_RGB2BGR)\n', (350, 372), False, 'import cv2\n'), ((396, 436), 'cv2.cvtColor', 'cv2.cvtColor', (['im_bgr', 'cv2.COLOR_BGR2GRAY'], {}), '(im_bgr, cv2.COLOR_BGR2GRAY)\n', (408, 436), False, 'import cv2\n'), ((1200, 1211), 'jax.n...
import os import re import numpy as np import cv2 import matplotlib.pyplot as plt from mayavi import mlab class KITTI: def __init__(self, image_dir, label_dir, lidar_dir, calib_dir): self.image_dir = image_dir self.calib_dir = calib_dir self.label_dir = label_dir self.lidar_dir = l...
[ "cv2.putText", "matplotlib.pyplot.show", "numpy.copy", "numpy.concatenate", "cv2.cvtColor", "matplotlib.pyplot.imshow", "numpy.fromfile", "re.split", "cv2.imread", "numpy.array", "numpy.matmul", "cv2.rectangle", "os.path.join", "os.listdir", "numpy.vstack" ]
[((9201, 9221), 'os.listdir', 'os.listdir', (['data_dir'], {}), '(data_dir)\n', (9211, 9221), False, 'import os\n'), ((814, 840), 'os.listdir', 'os.listdir', (['self.image_dir'], {}), '(self.image_dir)\n', (824, 840), False, 'import os\n'), ((2671, 2693), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\...
import numpy as np import sys from taylor_approximation import compute_derivatives import json z = float(sys.argv[1]) rmin, rmax, dr = 50, 160, 0.5 # Remake the data grid: order = 4 Npoints = 2*order + 1 # these are OmegaM, h, sigma8 x0s = [0.31, 0.68, 0.73]; Nparams = len(x0s) dxs = [0.01, 0.01, 0.05] rr = np.arang...
[ "json.dump", "taylor_approximation.compute_derivatives", "numpy.zeros", "numpy.arange", "numpy.loadtxt" ]
[((312, 337), 'numpy.arange', 'np.arange', (['rmin', 'rmax', 'dr'], {}), '(rmin, rmax, dr)\n', (321, 337), True, 'import numpy as np\n'), ((404, 449), 'numpy.zeros', 'np.zeros', (['((Npoints,) * Nparams + output_shape)'], {}), '((Npoints,) * Nparams + output_shape)\n', (412, 449), True, 'import numpy as np\n'), ((457, ...
import functools import itertools import numpy as np import torch import torchtuples def apply_leaf(func): """Apply a function to data in TupleTree objects (leaf nodes). E.g.: Two ways to get shapes of all elements in a tuple data = tuplefy([(torch.randn(1, 2), torch.randn(2, 3)), to...
[ "torch.cat", "itertools.count", "numpy.array", "functools.wraps", "functools.reduce", "itertools.chain.from_iterable", "numpy.concatenate", "torch.from_numpy" ]
[((514, 535), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (529, 535), False, 'import functools\n'), ((1299, 1320), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (1314, 1320), False, 'import functools\n'), ((3343, 3365), 'torch.from_numpy', 'torch.from_numpy', (['data'], {}), '(...
""" Old patterns not intended for new code. These patterns are expected to be deleted eventually. """ import param import numpy as np from numpy import pi from param.parameterized import ParamOverrides from .patterngenerator import Constant, PatternGenerator, Composite from . import Gaussian from .image import File...
[ "param.Integer", "param.Number", "numpy.maximum", "param.parameterized.ParamOverrides", "numpy.sin", "numpy.bitwise_and", "numpy.cos", "param.Callable", "numpy.sqrt" ]
[((687, 1330), 'param.Number', 'param.Number', ([], {'default': '(0.0)', 'bounds': '(0, None)', 'softbounds': '(0.0, 1.0)', 'doc': '"""\n Minimum distance to enforce between all pairs of pattern centers.\n\n Useful for ensuring that multiple randomly generated patterns\n do not overlap spatially. ...
# Copyright (c) 2020-2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
[ "numpy.pad", "cuml.dask.preprocessing.LabelEncoder", "cudf.DataFrame", "dask_cudf.from_cudf", "cudf.Series", "pytest.raises", "numpy.random.choice", "pytest.mark.parametrize", "cuml.dask.preprocessing.LabelEncoder.LabelEncoder" ]
[((928, 973), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""length"""', '[10, 1000]'], {}), "('length', [10, 1000])\n", (951, 973), False, 'import pytest\n'), ((975, 1026), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""cardinality"""', '[5, 10, 50]'], {}), "('cardinality', [5, 10, 50])\n", (...
# -*- coding: utf-8 -*- """ Classes and methods for defining a graphical user interface for neural simulations @author: Luka """ import matplotlib.pyplot as plt from matplotlib.widgets import Slider, Button import numpy as np from collections import deque class GUI: """ Graphical user interface class with m...
[ "matplotlib.pyplot.fignum_exists", "matplotlib.pyplot.axes", "matplotlib.pyplot.close", "matplotlib.widgets.Slider", "numpy.nditer", "matplotlib.pyplot.figtext", "matplotlib.widgets.Button", "numpy.append", "matplotlib.pyplot.figure", "numpy.diff", "numpy.arange", "matplotlib.pyplot.get_backen...
[((1629, 1669), 'numpy.arange', 'np.arange', (['self.vmin', 'self.vmax', 'self.dv'], {}), '(self.vmin, self.vmax, self.dv)\n', (1638, 1669), True, 'import numpy as np\n'), ((1793, 1859), 'numpy.arange', 'np.arange', (['(self.vmin - vrange / 2)', '(self.vmax + vrange / 2)', 'self.dv'], {}), '(self.vmin - vrange / 2, sel...
import numpy as np from sklearn.tree import DecisionTreeRegressor from sklearn.neighbors import KDTree from storage_strategy.progressive_bin_sampler import ProgressiveBinSampler from typing import final class DoiApproximator: ''' Helper class for either computing or approximating the doi function over the next chun...
[ "sklearn.tree.DecisionTreeRegressor", "numpy.empty", "numpy.append", "storage_strategy.progressive_bin_sampler.ProgressiveBinSampler", "sklearn.neighbors.KDTree" ]
[((752, 788), 'storage_strategy.progressive_bin_sampler.ProgressiveBinSampler', 'ProgressiveBinSampler', ([], {'n_dims': 'n_dims'}), '(n_dims=n_dims)\n', (773, 788), False, 'from storage_strategy.progressive_bin_sampler import ProgressiveBinSampler\n'), ((2428, 2462), 'numpy.append', 'np.append', (['X_sample', 'chunk']...
#!/usr/bin/env python3 #-*- coding: utf-8 -*- """Use to generate arm task and run.""" import rospy import tf import Queue as queue import copy # import object_distribtion from math import radians, degrees, sin, cos, pi, acos, asin from numpy import multiply from enum import IntEnum # from Queue import Queue import ...
[ "manipulator_h_base_module_msgs.msg.JointPose", "rospy.Subscriber", "rospy.ServiceProxy", "rospy.logwarn", "numpy.multiply", "math.radians", "Queue.Queue", "math.cos", "robotiq_2f_gripper.RobotiqGripper", "rospy.wait_for_service", "copy.deepcopy", "manipulator_h_base_module_msgs.srv.CheckRange...
[((2404, 2417), 'Queue.Queue', 'queue.Queue', ([], {}), '()\n', (2415, 2417), True, 'import Queue as queue\n'), ((2449, 2462), 'Queue.Queue', 'queue.Queue', ([], {}), '()\n', (2460, 2462), True, 'import Queue as queue\n'), ((4152, 4227), 'rospy.Subscriber', 'rospy.Subscriber', (['"""robot/is_stop"""', 'Bool', 'self.__s...
# Copyright 2021 The Distla Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
[ "numpy.random.uniform", "numpy.random.seed", "numpy.transpose", "asic_la.sharded_probability_function.sharded_probability_function.ShardedProbabilityFunction", "numpy.random.normal", "numpy.testing.assert_allclose", "asic_la.sharded_probability_function.complex_workaround.ComplexDeviceArray" ]
[((6691, 6769), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['B.concrete_tensor.real', '(2 * A.concrete_tensor.real)'], {}), '(B.concrete_tensor.real, 2 * A.concrete_tensor.real)\n', (6717, 6769), True, 'import numpy as np\n'), ((1095, 1112), 'numpy.random.seed', 'np.random.seed', (['(3)'], {}), '(3...
from collections import defaultdict from dreamcoder.frontier import * from dreamcoder.program import * from dreamcoder.type import * from dreamcoder.utilities import * import time class GrammarFailure(Exception): pass class SketchEnumerationFailure(Exception): pass class NoCandidates(Exception): pass ...
[ "heapq.heappush", "time.time", "collections.defaultdict", "heapq.heappop", "numpy.array" ]
[((38500, 38518), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (38511, 38518), False, 'from collections import defaultdict\n'), ((38546, 38564), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (38557, 38564), False, 'from collections import defaultdict\n'), ((50504, 50...
import numpy as np import networkx as nx import numpy.linalg as LA from shapely.geometry import Polygon, Point, LineString from sklearn.neighbors import KDTree #============== Random Sampling ==============# def extract_polygons(data): """ Creates polygon objects from obstacles in data Returns: p...
[ "numpy.random.uniform", "shapely.geometry.Point", "shapely.geometry.Polygon", "shapely.geometry.LineString", "numpy.max", "numpy.min", "networkx.Graph", "numpy.array", "numpy.concatenate" ]
[((1549, 1561), 'shapely.geometry.Point', 'Point', (['point'], {}), '(point)\n', (1554, 1561), False, 'from shapely.geometry import Polygon, Point, LineString\n'), ((2574, 2605), 'numpy.min', 'np.min', (['(data[:, 0] - data[:, 3])'], {}), '(data[:, 0] - data[:, 3])\n', (2580, 2605), True, 'import numpy as np\n'), ((261...
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "tensorflow.test.main", "apache_beam.testing.util.assert_that", "apache_beam.Create", "apache_beam.Map", "tensorflow_model_analysis.metrics.metric_types.MetricKey", "tensorflow_model_analysis.metrics.confusion_matrix_at_thresholds.ConfusionMatrixAtThresholds", "apache_beam.Pipeline", "apache_beam.test...
[((4036, 4050), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (4048, 4050), True, 'import tensorflow as tf\n'), ((1513, 1528), 'numpy.array', 'np.array', (['[0.0]'], {}), '([0.0])\n', (1521, 1528), True, 'import numpy as np\n'), ((1553, 1568), 'numpy.array', 'np.array', (['[0.0]'], {}), '([0.0])\n', (1561, ...
import sys import os import numpy as np import tensorflow as tf import pathlib import glob class MNIST : TARGET_DIR = '_dataset/mnist/' @staticmethod def _load_dataset(labels=True): if not os.path.exists(MNIST.TARGET_DIR): os.makedirs(MNIST.TARGET_DIR) if sys.version_info[0] ==...
[ "tensorflow.image.crop_to_bounding_box", "tensorflow.image.resize_images", "gzip.open", "os.makedirs", "numpy.float32", "numpy.unique", "os.path.exists", "tensorflow.constant", "tensorflow.data.Dataset.from_tensor_slices", "urllib.request.urlretrieve", "pathlib.Path", "tensorflow.image.decode_...
[((3316, 3338), 'tensorflow.read_file', 'tf.read_file', (['filename'], {}), '(filename)\n', (3328, 3338), True, 'import tensorflow as tf\n'), ((3352, 3399), 'tensorflow.image.decode_image', 'tf.image.decode_image', (['image_string'], {'channels': '(3)'}), '(image_string, channels=3)\n', (3373, 3399), True, 'import tens...
# """VLA pipeline helper functions""" import numpy as np import os import scipy.constants # import some stuff from CASA if os.getenv('CASAPATH') is not None: # import casadef from taskinit import * msmd = msmdtool() # need for metadata def flagtemplate_add(sdm="", flagcmds=[], outfile=""): """ A...
[ "os.path.exists", "numpy.min", "numpy.max", "numpy.array", "os.getenv" ]
[((125, 146), 'os.getenv', 'os.getenv', (['"""CASAPATH"""'], {}), "('CASAPATH')\n", (134, 146), False, 'import os\n'), ((795, 818), 'os.path.exists', 'os.path.exists', (['outfile'], {}), '(outfile)\n', (809, 818), False, 'import os\n'), ((1629, 1649), 'numpy.array', 'np.array', (['line_freqs'], {}), '(line_freqs)\n', (...
import numpy as np import mdprop class DoubleWell(mdprop.potential.Potential): def __init__(self, a, b): self.a = a self.b = b super(DoubleWell, self).__init__() def compute_energy_per_particle(self, X): X2 = X**2 X4 = X2**2 E = -self.a * X2 + self.b * X4 ...
[ "numpy.sum" ]
[((435, 445), 'numpy.sum', 'np.sum', (['X2'], {}), '(X2)\n', (441, 445), True, 'import numpy as np\n'), ((457, 467), 'numpy.sum', 'np.sum', (['X4'], {}), '(X4)\n', (463, 467), True, 'import numpy as np\n')]
import sys from SALib.analyze import delta from SALib.util import read_param_file import numpy as np sys.path.append('../..') # Read the parameter range file and generate samples # Since this is "given data", the bounds in the parameter file will not be used # but the columns are still expected problem = read_para...
[ "sys.path.append", "SALib.analyze.delta.analyze", "SALib.util.read_param_file", "numpy.loadtxt" ]
[((104, 128), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (119, 128), False, 'import sys\n'), ((311, 380), 'SALib.util.read_param_file', 'read_param_file', (['"""../../src/SALib/test_functions/params/Ishigami.txt"""'], {}), "('../../src/SALib/test_functions/params/Ishigami.txt')\n", (326...
import matplotlib as mp import matplotlib.pyplot as plt import numpy as np from os.path import join as pjoin ##### FIG SIZE CALC ############ figsize = np.array([80,80/1.618]) #Figure size in mm dpi = 300 #Print resolution ppi = np.sqrt(1920**2+1200**2)/24 #Screen resolution mp.rc('text', uset...
[ "matplotlib.rc", "matplotlib.pyplot.show", "os.path.join", "numpy.array", "matplotlib.pyplot.subplots", "numpy.sqrt" ]
[((153, 179), 'numpy.array', 'np.array', (['[80, 80 / 1.618]'], {}), '([80, 80 / 1.618])\n', (161, 179), True, 'import numpy as np\n'), ((302, 328), 'matplotlib.rc', 'mp.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (307, 328), True, 'import matplotlib as mp\n'), ((329, 403), 'matplotlib.rc', ...
""" Credit for ascii art logo to <NAME> (https://ascii.matthewbarber.io/art/python/) Directions: 'esc' to quit 'r' to reset 'click' to poke """ import asyncio import numpy as np from nurses_2.app import App from nurses_2.colors import foreground_rainbow from nurses_2.io import MouseButton from nurses_2.w...
[ "numpy.full", "asyncio.sleep", "nurses_2.colors.foreground_rainbow", "nurses_2.widgets.particle_field.text_field.TextParticleField", "numpy.linspace" ]
[((1808, 1835), 'nurses_2.colors.foreground_rainbow', 'foreground_rainbow', (['NCOLORS'], {}), '(NCOLORS)\n', (1826, 1835), False, 'from nurses_2.colors import foreground_rainbow\n'), ((1946, 1967), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(30)'], {}), '(0, 1, 30)\n', (1957, 1967), True, 'import numpy as np\n'...
#!/usr/bin/env python """"Core serializaion tests.""" import tempfile import os import cv2 as cv import numpy as np from tests_common import NewOpenCVTests class persistence_test(NewOpenCVTests): def test_yml_rw(self): fd, fname = tempfile.mkstemp(prefix="opencv_python_persistence_", suffix=".yml") ...
[ "os.remove", "tempfile.mkstemp", "cv2.FileStorage", "numpy.array", "os.close", "numpy.array_equal" ]
[((245, 313), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'prefix': '"""opencv_python_persistence_"""', 'suffix': '""".yml"""'}), "(prefix='opencv_python_persistence_', suffix='.yml')\n", (261, 313), False, 'import tempfile\n'), ((322, 334), 'os.close', 'os.close', (['fd'], {}), '(fd)\n', (330, 334), False, 'import o...
class Unbuffered(object): def __init__(self, stream): self.stream = stream def write(self, data): self.stream.write(data) self.stream.flush() def __getattr__(self, attr): return getattr(self.stream, attr) import sys sys.stdout = Unbuffered(sys.stdout) from sklearn.base impo...
[ "sys.stdout.write", "nlopt.opt", "numpy.sum", "numpy.copy", "numpy.average", "numpy.log", "numpy.zeros", "numpy.ones", "numpy.clip", "numpy.mod", "numpy.any", "numpy.hstack", "sklearn.linear_model.LogisticRegression", "numpy.mean", "numpy.random.randint", "numpy.vstack" ]
[((4612, 4646), 'numpy.copy', 'numpy.copy', (['unlabeledWeights[:, 0]'], {}), '(unlabeledWeights[:, 0])\n', (4622, 4646), False, 'import numpy\n'), ((4916, 4952), 'numpy.hstack', 'numpy.hstack', (['(labeledy, unlabeledy)'], {}), '((labeledy, unlabeledy))\n', (4928, 4952), False, 'import numpy\n'), ((9924, 9968), 'numpy...
# coding: utf8 from os import path import json from multiprocessing.pool import ThreadPool import datetime import numpy as np import pandas as pd from sklearn.svm import SVC from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from xgboost import XGBClassifier from...
[ "numpy.sum", "clinica.pipelines.machine_learning.ml_utils.evaluate_prediction_multiclass", "numpy.logspace", "numpy.mean", "sklearn.svm.SVC", "os.path.join", "pandas.DataFrame", "numpy.std", "xgboost.XGBClassifier", "itertools.product", "numpy.log10", "clinica.pipelines.machine_learning.ml_uti...
[((1157, 1190), 'sklearn.metrics.roc_auc_score', 'roc_auc_score', (['y_test', 'proba_test'], {}), '(y_test, proba_test)\n', (1170, 1190), False, 'from sklearn.metrics import roc_auc_score\n'), ((1406, 1446), 'clinica.pipelines.machine_learning.ml_utils.evaluate_prediction', 'utils.evaluate_prediction', (['y_test', 'y_h...
from dataclasses import dataclass from math import isclose import GPy import numpy as np import pytest from numpy.testing import assert_allclose from pytest_lazyfixture import lazy_fixture from utils import check_grad from emukit.model_wrappers.gpy_quadrature_wrappers import BaseGaussianProcessGPy, RBFGPy from emukit...
[ "emukit.quadrature.methods.BoundedBayesianQuadrature", "GPy.models.GPRegression", "utils.check_grad", "numpy.testing.assert_allclose", "emukit.quadrature.methods.WSABIL", "numpy.min", "pytest_lazyfixture.lazy_fixture", "numpy.array", "math.isclose", "GPy.kern.RBF", "emukit.quadrature.measures.Is...
[((3528, 3582), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model"""', 'all_models_test_list'], {}), "('model', all_models_test_list)\n", (3551, 3582), False, 'import pytest\n'), ((3795, 3849), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model"""', 'all_models_test_list'], {}), "('model'...
import os import pandas from . import subjective_eval from . import objective_eval from tqdm import tqdm from joblib import Parallel, delayed import numpy as np ANSWER_PATH = './peamt_results/answers_data.csv' MIDI_PATH = './peamt_results/all_midi_cut' def load_pmt_data(): print("Loading csv...") df = pandas...
[ "tqdm.tqdm", "numpy.sum", "numpy.argmax", "pandas.read_csv", "joblib.Parallel", "joblib.delayed", "os.path.join" ]
[((314, 351), 'pandas.read_csv', 'pandas.read_csv', (['ANSWER_PATH'], {'sep': '""";"""'}), "(ANSWER_PATH, sep=';')\n", (329, 351), False, 'import pandas\n'), ((1230, 1262), 'os.path.join', 'os.path.join', (['MIDI_PATH', 'example'], {}), '(MIDI_PATH, example)\n', (1242, 1262), False, 'import os\n'), ((2090, 2109), 'jobl...
#!/usr/bin/env python3 """ @author: <NAME> @email: <EMAIL> * FORCE MODULE * Contains force calculations (and potential energies) using known potentials: - Lennard-Jones Latest update: June 1st 2021 """ import numpy as np import system import matplotlib.pyplot as plt from numba import jit, njit, vectorize fro...
[ "numpy.power", "numba.njit", "numpy.array", "numpy.sign", "concurrent.futures.ThreadPoolExecutor", "itertools.repeat", "numpy.sqrt" ]
[((1069, 1085), 'numba.njit', 'njit', ([], {'nogil': '(True)'}), '(nogil=True)\n', (1073, 1085), False, 'from numba import jit, njit, vectorize\n'), ((3440, 3459), 'numpy.array', 'np.array', (['[0, size]'], {}), '([0, size])\n', (3448, 3459), True, 'import numpy as np\n'), ((3459, 3485), 'numpy.array', 'np.array', (['[...
import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torchvision import datasets, models, transforms import numpy as np import matplotlib.pyplot as plt import time import os import copy from tqdm import tqdm # Data augmentation and normalization for training # Ju...
[ "torchvision.transforms.Normalize", "torch.no_grad", "os.path.join", "torch.utils.data.DataLoader", "torch.nn.Linear", "torchvision.transforms.CenterCrop", "tqdm.tqdm", "numpy.save", "torchvision.transforms.RandomHorizontalFlip", "torch.cuda.is_available", "torch.max", "torch.set_grad_enabled"...
[((1059, 1152), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['image_datasets[x]'], {'batch_size': '(2)', 'shuffle': '(True)', 'num_workers': '(4)'}), '(image_datasets[x], batch_size=2, shuffle=True,\n num_workers=4)\n', (1086, 1152), False, 'import torch\n'), ((1515, 1526), 'time.time', 'time.time...
import os import numpy as np import pandas as pd __dir__ = os.path.abspath(os.path.dirname(__file__)) def load_example_dataset(hierarchical_levels, n_alternatives=2): """Load example dataset for testing and tutorials. Parameters ---------- n_alternatives : int When 2, the dataset of https://d...
[ "pandas.read_csv", "os.path.dirname", "pandas.unique", "numpy.array", "os.path.join" ]
[((76, 101), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (91, 101), False, 'import os\n'), ((686, 749), 'os.path.join', 'os.path.join', (['__dir__', 'os.pardir', '"""data"""', '"""data_experiment.csv"""'], {}), "(__dir__, os.pardir, 'data', 'data_experiment.csv')\n", (698, 749), False, 'im...
import random import gym import numpy as np import tensorflow as tf import os from tensorflow import keras from collections import deque from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.optimizers import Adam # This file is the human input version of l_test...
[ "tensorflow.keras.losses.MeanSquaredError", "gym.make", "numpy.argmax", "random.sample", "tensorflow.keras.layers.Dense", "tensorflow.config.list_physical_devices", "tensorflow.keras.Model", "random.randrange", "tensorflow.keras.models.Sequential", "numpy.reshape", "tensorflow.keras.models.save_...
[((1698, 1731), 'tensorflow.config.list_physical_devices', 'tf.config.list_physical_devices', ([], {}), '()\n', (1729, 1731), True, 'import tensorflow as tf\n'), ((4317, 4335), 'gym.make', 'gym.make', (['ENV_NAME'], {}), '(ENV_NAME)\n', (4325, 4335), False, 'import gym\n'), ((2708, 2733), 'collections.deque', 'deque', ...
import os from sklearn import model_selection #from sklearn.linear_model import LogisticRegression #from sklearn import neighbors #from sklearn.svm import LinearSVC from sklearn.tree import DecisionTreeClassifier import pickle import numpy as np fid=open('input.csv','r') clist=fid.read().split('\n') fid.close() hdr=...
[ "sklearn.model_selection.train_test_split", "numpy.max", "numpy.array", "sklearn.tree.DecisionTreeClassifier" ]
[((728, 747), 'numpy.array', 'np.array', (['trainData'], {}), '(trainData)\n', (736, 747), True, 'import numpy as np\n'), ((931, 1009), 'sklearn.model_selection.train_test_split', 'model_selection.train_test_split', (['X', 'Y'], {'test_size': 'test_size', 'random_state': 'seed'}), '(X, Y, test_size=test_size, random_st...
""" Pythran implementation of columns grouping for finite difference Jacobian estimation. Used by ._numdiff.group_columns and based on the Cython version. """ import numpy as np #pythran export group_dense(int, int, intc[:,:]) #pythran export group_dense(int, int, int[:,:]) def group_dense(m, n, A): B = A.T # Tr...
[ "numpy.empty", "numpy.ones" ]
[((477, 503), 'numpy.empty', 'np.empty', (['m'], {'dtype': 'np.intp'}), '(m, dtype=np.intp)\n', (485, 503), True, 'import numpy as np\n'), ((1659, 1685), 'numpy.empty', 'np.empty', (['m'], {'dtype': 'np.intp'}), '(m, dtype=np.intp)\n', (1667, 1685), True, 'import numpy as np\n'), ((416, 441), 'numpy.ones', 'np.ones', (...
"""Run conjunction tests on csv tables of stats and p-values.""" import os import argparse import pandas as pd import numpy as np from modelmodel.stats import conjunction parser = argparse.ArgumentParser( description="Run conjunction tests on csv tables of stats.", formatter_class=argparse.ArgumentDe...
[ "pandas.read_csv", "numpy.vstack", "argparse.ArgumentParser", "modelmodel.stats.conjunction" ]
[((183, 333), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run conjunction tests on csv tables of stats."""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'Run conjunction tests on csv tables of stats.', formatter_class=\n argparse.ArgumentDefau...
import numpy as np edge_length = (1 << 16) + 1 max_hue = 6 * edge_length max_sat = 0xFFFF max_val = 0xFF def rgb_to_hsv(arr): """ This is an implementation of the algorithm by Chernow, Alander & Bochko (2015): "Integer-based accurate conversion between RGB and HSV color spaces" It takes a numpy arra...
[ "numpy.zeros_like", "numpy.abs", "numpy.errstate" ]
[((913, 959), 'numpy.errstate', 'np.errstate', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='ignore', invalid='ignore')\n", (924, 959), True, 'import numpy as np\n'), ((1044, 1064), 'numpy.zeros_like', 'np.zeros_like', (['arr32'], {}), '(arr32)\n', (1057, 1064), True, 'import numpy as np\n'), (...
import unittest import numpy as np from scipy.stats import norm from scipy.special import expit from sklearn.linear_model import LinearRegression, LogisticRegression from sklearn.ensemble import GradientBoostingClassifier from sklearn import datasets from functools import partial from skater.core.explanations import ...
[ "sklearn.datasets.load_iris", "functools.partial", "unittest.TextTestRunner", "skater.core.explanations.Interpretation", "scipy.stats.norm.rvs", "numpy.unique", "skater.util.dataops.MultiColumnLabelBinarizer", "sklearn.linear_model.LinearRegression", "sklearn.ensemble.GradientBoostingClassifier", ...
[((902, 965), 'scipy.stats.norm.rvs', 'norm.rvs', (['(0)', '(1)'], {'size': '(self.n, self.dim)', 'random_state': 'self.seed'}), '(0, 1, size=(self.n, self.dim), random_state=self.seed)\n', (910, 965), False, 'from scipy.stats import norm\n'), ((983, 1010), 'numpy.array', 'np.array', (['[-10.1, 2.2, 6.1]'], {}), '([-10...
import numpy as np from ..operator import operator as opt from ..tools.distribution import MultiVariateNormalDistribution as MVND from .base import BaseEDAPop EPS = 1e-8 class CMAESPop(BaseEDAPop): """ CMA-ES Population """ def __init__(self, mvnd, size, lb=-float('inf'), ub=float('inf')): s...
[ "numpy.sum", "numpy.log", "numpy.eye", "numpy.zeros", "numpy.argsort", "numpy.arange", "numpy.matmul", "numpy.dot" ]
[((447, 465), 'numpy.zeros', 'np.zeros', (['self.dim'], {}), '(self.dim)\n', (455, 465), True, 'import numpy as np\n'), ((512, 530), 'numpy.zeros', 'np.zeros', (['self.dim'], {}), '(self.dim)\n', (520, 530), True, 'import numpy as np\n'), ((913, 933), 'numpy.argsort', 'np.argsort', (['self.fit'], {}), '(self.fit)\n', (...
# -*- coding: utf-8 -*- # Author: XuMing <<EMAIL>> # Data: 17/9/26 # Brief: get uci housing data import numpy as np import os import paddle.v2.dataset.common URL = "https//archive.ics.uci.edu/ml/a.tar.gz" MD5 = "" feature_names = ['CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE', 'DIS', 'RAD', 'TAX', ...
[ "matplotlib.pyplot.xlim", "os.makedirs", "numpy.fromfile", "matplotlib.pyplot.close", "os.path.exists", "matplotlib.use", "matplotlib.pyplot.subplots" ]
[((459, 480), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (473, 480), False, 'import matplotlib\n'), ((531, 545), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (543, 545), True, 'import matplotlib.pyplot as plt\n'), ((731, 758), 'matplotlib.pyplot.xlim', 'plt.xlim', (['[-1, f...
import data import deepwalk as dw import node2vec as nv import line import aane as aa import numpy as np import sklearn.metrics as sk from functools import reduce import argparse def deep_walk_cora(): print("DEEP WALK") X, A, y = data.load_data(dataset='cora') deepwalk = dw.DeepWalk(A); return deepwal...
[ "numpy.load", "argparse.ArgumentParser", "deepwalk.DeepWalk", "functools.reduce", "sklearn.metrics.roc_auc_score", "aane.AANE", "node2vec.Node2Vec", "line.Line", "numpy.concatenate", "data.load_data" ]
[((240, 270), 'data.load_data', 'data.load_data', ([], {'dataset': '"""cora"""'}), "(dataset='cora')\n", (254, 270), False, 'import data\n'), ((286, 300), 'deepwalk.DeepWalk', 'dw.DeepWalk', (['A'], {}), '(A)\n', (297, 300), True, 'import deepwalk as dw\n'), ((381, 471), 'data.load_data', 'data.load_data', ([], {'datas...
import numpy as np import pytest from eddington import FittingDataError, linear, random_data A = np.array([1, 2]) def test_residuals_data_columns_names(): data = random_data(linear, a=A) residuals_data = data.residuals(fit_func=linear, a=A) assert ( data.x_column == residuals_data.x_column )...
[ "pytest.raises", "numpy.array", "eddington.linear", "pytest.approx", "eddington.random_data" ]
[((99, 115), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (107, 115), True, 'import numpy as np\n'), ((170, 194), 'eddington.random_data', 'random_data', (['linear'], {'a': 'A'}), '(linear, a=A)\n', (181, 194), False, 'from eddington import FittingDataError, linear, random_data\n'), ((784, 808), 'eddingto...
# -*- coding: utf-8 -*- import numpy import pytest import pysteps def _generic_interface_test(method_getter, valid_names_func_pair, invalid_names): for name, expected_function in valid_names_func_pair: error_message = "Error getting '{}' function."...
[ "numpy.abs", "pysteps.io.interface.get_method", "pytest.raises", "numpy.random.random", "numpy.random.rand", "pytest.approx", "numpy.all" ]
[((2120, 2147), 'numpy.random.rand', 'numpy.random.rand', (['(100)', '(100)'], {}), '(100, 100)\n', (2137, 2147), False, 'import numpy\n'), ((2163, 2190), 'numpy.random.rand', 'numpy.random.rand', (['(100)', '(100)'], {}), '(100, 100)\n', (2180, 2190), False, 'import numpy\n'), ((7270, 7297), 'numpy.random.rand', 'nump...
from pandas import read_csv import numpy as np from matplotlib.pyplot import hist, show, scatter from numpy import mean, min, max, median, quantile from scipy.stats import binom, norm, t as student, chi2 from math import sqrt, pow, floor, ceil def variance(values): return np.var(values, ddof=1) def std(values):...
[ "scipy.stats.norm.ppf", "math.sqrt", "numpy.std", "matplotlib.pyplot.scatter", "scipy.stats.chi2.ppf", "scipy.stats.binom.cdf", "numpy.cumsum", "numpy.mean", "numpy.random.choice", "scipy.stats.t.ppf", "numpy.var" ]
[((279, 301), 'numpy.var', 'np.var', (['values'], {'ddof': '(1)'}), '(values, ddof=1)\n', (285, 301), True, 'import numpy as np\n'), ((332, 354), 'numpy.std', 'np.std', (['values'], {'ddof': '(1)'}), '(values, ddof=1)\n', (338, 354), True, 'import numpy as np\n'), ((586, 598), 'numpy.mean', 'mean', (['values'], {}), '(...
import time import logging import numpy as np from qcodes.utils import validators as vals from pycqed.analysis import analysis_toolbox as atools from pycqed.measurement import detector_functions as det from pycqed.measurement import sweep_functions as swf from pycqed.analysis import analysis_toolbox as a_tools impor...
[ "pycqed.analysis.analysis_toolbox.get_data_from_timestamp_list", "qcodes.utils.validators.Enum", "pycqed.analysis.analysis_toolbox.latest_data", "pycqed.measurement.sweep_functions.None_Sweep", "numpy.linspace", "qcodes.utils.validators.Numbers", "pycqed.measurement.detector_functions.Dummy_Detector_Sof...
[((10092, 10215), 'pycqed.analysis.analysis_toolbox.get_data_from_timestamp_list', 'a_tools.get_data_from_timestamp_list', (['[timestamp]', 'params_dict'], {'numeric_params': 'numeric_params', 'filter_no_analysis': '(False)'}), '([timestamp], params_dict,\n numeric_params=numeric_params, filter_no_analysis=False)\n'...
from solt.base_transforms import DataDependentSamplingTransform, PaddingPropertyHolder, ImageTransform from solt.constants import allowed_paddings from solt.data import DataContainer, KeyPoints import numpy as np import cv2 from solt.utils import img_shape_checker import matplotlib.pyplot as plt from localizer.kneel_be...
[ "cv2.GaussianBlur", "solt.base_transforms.DataDependentSamplingTransform.sample_transform_from_data", "numpy.ones_like", "solt.base_transforms.DataDependentSamplingTransform.sample_transform", "cv2.copyMakeBorder", "numpy.random.randint", "numpy.array", "cv2.drawContours", "solt.data.KeyPoints", "...
[((707, 755), 'numpy.random.randint', 'np.random.randint', ([], {'low': 'colors[0]', 'high': 'colors[1]'}), '(low=colors[0], high=colors[1])\n', (724, 755), True, 'import numpy as np\n'), ((1707, 1757), 'solt.base_transforms.DataDependentSamplingTransform.__init__', 'DataDependentSamplingTransform.__init__', (['self'],...
""" Python implementation of the maximum coverage location problem. The program randomly generates a set of candidate sites, among which the K optimal candidates are selected. The optimization problem is solved by integer programming. Author: <NAME> Date: 2019-11-22 MIT License Copyright (c) 2019 <NAME> Permis...
[ "numpy.random.uniform", "shapely.geometry.Polygon", "matplotlib.pyplot.scatter", "time.time", "scipy.spatial.distance_matrix", "sklearn.datasets.make_moons", "matplotlib.pyplot.figure", "numpy.where", "numpy.array", "matplotlib.pyplot.Circle", "matplotlib.pyplot.gca", "scipy.spatial.ConvexHull...
[((1949, 1967), 'scipy.spatial.ConvexHull', 'ConvexHull', (['points'], {}), '(points)\n', (1959, 1967), False, 'from scipy.spatial import ConvexHull\n'), ((2022, 2045), 'shapely.geometry.Polygon', 'Polygon', (['polygon_points'], {}), '(polygon_points)\n', (2029, 2045), False, 'from shapely.geometry import Polygon, Poin...
import importlib import xarray as xr import numpy as np import pandas as pd import sys import os from CASutils import filter_utils as filt from CASutils import calendar_utils as cal importlib.reload(filt) importlib.reload(cal) def calcdeseas(da): datseas = da.groupby('time.dayofyear').mean('time', skipna=True) ...
[ "os.remove", "CASutils.calendar_utils.group_season_daily", "numpy.empty", "xarray.open_dataset", "numpy.zeros", "numpy.percentile", "importlib.reload", "numpy.arange", "numpy.array", "CASutils.filter_utils.calc_season_nharm" ]
[((184, 206), 'importlib.reload', 'importlib.reload', (['filt'], {}), '(filt)\n', (200, 206), False, 'import importlib\n'), ((207, 228), 'importlib.reload', 'importlib.reload', (['cal'], {}), '(cal)\n', (223, 228), False, 'import importlib\n'), ((774, 832), 'xarray.open_dataset', 'xr.open_dataset', (["(basepath + 'TREF...
from panda3d.core import NodePath, TransparencyAttrib, LVecBase3f from structures import DynamicColour, Colour, TRANSPARENT, WHITE, BLACK from simulator.services.services import Services from simulator.services.event_manager.events.event import Event from simulator.services.event_manager.events.colour_update_event imp...
[ "structures.Colour", "numpy.uint8" ]
[((793, 809), 'numpy.uint8', 'np.uint8', (['(1 << 0)'], {}), '(1 << 0)\n', (801, 809), True, 'import numpy as np\n'), ((837, 853), 'numpy.uint8', 'np.uint8', (['(1 << 1)'], {}), '(1 << 1)\n', (845, 853), True, 'import numpy as np\n'), ((881, 897), 'numpy.uint8', 'np.uint8', (['(1 << 2)'], {}), '(1 << 2)\n', (889, 897),...
import numpy as np from astropy import units as u from einsteinpy import constant from einsteinpy.metric import BaseMetric from einsteinpy.utils import CoordinateError _c = constant.c.value _G = constant.G.value _Cc = constant.coulombs_const.value class KerrNewman(BaseMetric): """ Class for defining Kerr-Ne...
[ "astropy.units.quantity_input", "numpy.zeros", "einsteinpy.utils.CoordinateError", "numpy.sin", "numpy.sqrt" ]
[((349, 403), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'M': 'u.kg', 'a': 'u.one', 'Q': 'u.C', 'q': '(u.C / u.kg)'}), '(M=u.kg, a=u.one, Q=u.C, q=u.C / u.kg)\n', (365, 403), True, 'from astropy import units as u\n'), ((3018, 3110), 'einsteinpy.utils.CoordinateError', 'CoordinateError', (['"""Kerr-Newman...
import os # we already use worker threads, limit each process to 1 thread! os.environ['OMP_NUM_THREADS'] = '1' os.environ['MKL_NUM_THREADS'] = '1' from trw.layers.efficient_net import EfficientNet import trw import numpy as np import torch import torch.nn as nn class Net(nn.Module): def __init__(self): ...
[ "trw.train.create_sgd_optimizers_scheduler_step_lr_fn", "trw.train.TrainerV2", "trw.transforms.TransformRandomCropPad", "trw.layers.efficient_net.EfficientNet", "numpy.asarray", "trw.datasets.create_cifar10_dataset", "trw.transforms.TransformRandomFlip", "torch.cuda.device_count", "trw.train.Options...
[((926, 963), 'trw.train.DataParallelExtended', 'trw.train.DataParallelExtended', (['model'], {}), '(model)\n', (956, 963), False, 'import trw\n'), ((1170, 1203), 'trw.train.Options', 'trw.train.Options', ([], {'num_epochs': '(200)'}), '(num_epochs=200)\n', (1187, 1203), False, 'import trw\n'), ((1218, 1296), 'trw.trai...
# -*- coding: utf-8 -*- import json import tempfile from vispy import config from vispy.app import Canvas from vispy.gloo import glir from vispy.testing import requires_application, requires_pyopengl, run_tests_if_main import numpy as np try: from unittest import mock except ImportError: import mock def t...
[ "vispy.gloo.glir.convert_shader", "mock.call", "numpy.zeros", "mock.patch", "vispy.testing.requires_pyopengl", "vispy.config.update", "json.dumps", "vispy.testing.run_tests_if_main", "tempfile.TemporaryFile", "vispy.gloo.glir.GlirParser", "vispy.testing.requires_application", "mock.MagicMock",...
[((2304, 2326), 'vispy.testing.requires_application', 'requires_application', ([], {}), '()\n', (2324, 2326), False, 'from vispy.testing import requires_application, requires_pyopengl, run_tests_if_main\n'), ((3522, 3544), 'vispy.testing.requires_application', 'requires_application', ([], {}), '()\n', (3542, 3544), Fal...
"""Fns to process. These are wrapped in a class in pipeline, which is probably what you want.""" import logging from collections import namedtuple from io import BytesIO from pathlib import Path from typing import Tuple import numpy as np from PIL import Image, ImageChops, ImageOps from PyPDF4 import PdfFileReader, P...
[ "PIL.ImageChops.difference", "PIL.Image.new", "io.BytesIO", "PyPDF4.PdfFileWriter", "numpy.std", "PIL.ImageOps.grayscale", "numpy.mean", "collections.namedtuple", "PIL.ImageOps.autocontrast", "PIL.ImageOps.posterize", "PIL.Image.frombytes", "logging.getLogger" ]
[((377, 404), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (394, 404), False, 'import logging\n'), ((2724, 2775), 'collections.namedtuple', 'namedtuple', (['"""_results"""', "('lh_page', 'crop', 'bbox')"], {}), "('_results', ('lh_page', 'crop', 'bbox'))\n", (2734, 2775), False, 'from co...
import cv2 import numpy as np def compute_box_bev(label): if isinstance(label, list): # gt label ry = label[14] bl = label[10] bw = label[9] t = np.array([[label[11]], [label[12]], [label[13]]]) else: # det label ry = label[...
[ "numpy.full", "numpy.stack", "cv2.resize", "numpy.arctan2", "cv2.polylines", "numpy.argsort", "numpy.linalg.eigh", "numpy.any", "cv2.ellipse", "numpy.array", "numpy.where", "numpy.cos", "numpy.sin", "numpy.repeat", "numpy.round", "numpy.concatenate", "numpy.sqrt" ]
[((553, 720), 'numpy.array', 'np.array', (['[[bl / 2, bl / 2, -bl / 2, -bl / 2, bl / 2, bl / 2 + bw / 2, bl / 2], [0, 0,\n 0, 0, 0, 0, 0], [bw / 2, -bw / 2, -bw / 2, bw / 2, bw / 2, 0, -bw / 2]]'], {}), '([[bl / 2, bl / 2, -bl / 2, -bl / 2, bl / 2, bl / 2 + bw / 2, bl / \n 2], [0, 0, 0, 0, 0, 0, 0], [bw / 2, -bw ...
import os import io import shutil import base64 import subprocess import platform import logging import numpy as np import pandas as pd from tqdm import tqdm from glob import glob from pathlib import Path as P import wget import urllib3, ftplib from urllib.parse import urlparse from bs4 import BeautifulSoup import ...
[ "os.remove", "pandas.read_csv", "base64.b64decode", "numpy.isnan", "os.path.isfile", "pathlib.Path", "shutil.rmtree", "subprocess.getoutput", "os.path.join", "urllib.parse.urlparse", "pandas.DataFrame", "matplotlib.colors.Normalize", "logging.warning", "matplotlib.pyplot.close", "os.path...
[((339, 353), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (346, 353), True, 'import matplotlib as mpl\n'), ((1271, 1303), 'base64.b64decode', 'base64.b64decode', (['content_string'], {}), '(content_string)\n', (1287, 1303), False, 'import base64\n'), ((1317, 1351), 'os.path.join', 'os.path.join', (['...
import numpy as np import warnings from abstract_dummies import * from bayesiancoresets import * warnings.filterwarnings('ignore', category=UserWarning) #tests will generate warnings (due to pathological data design for testing), just ignore them np.seterr(all='raise') np.set_printoptions(linewidth=500) np.random.seed...
[ "numpy.set_printoptions", "numpy.random.seed", "warnings.filterwarnings", "numpy.seterr", "numpy.random.randn", "numpy.fabs", "numpy.all" ]
[((98, 153), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'UserWarning'}), "('ignore', category=UserWarning)\n", (121, 153), False, 'import warnings\n'), ((248, 270), 'numpy.seterr', 'np.seterr', ([], {'all': '"""raise"""'}), "(all='raise')\n", (257, 270), True, 'import numpy as...
import skylark.sketch import numpy, scipy import json, math class LinearizedKernelModel: """ This class allows loading of model file created by skylark_ml into Python and making predicitions. """ def __init__(self, fname): with open(fname, 'r') as f: s = '' for line ...
[ "scipy.dot", "numpy.fromstring", "numpy.zeros", "json.loads" ]
[((1183, 1208), 'numpy.zeros', 'numpy.zeros', (['(n, self._k)'], {}), '((n, self._k))\n', (1194, 1208), False, 'import numpy, scipy\n'), ((436, 449), 'json.loads', 'json.loads', (['s'], {}), '(s)\n', (446, 449), False, 'import json, math\n'), ((1468, 1497), 'numpy.zeros', 'numpy.zeros', (['(X.shape[0], sj)'], {}), '((X...
import typing import contextlib import asyncio import queue import numpy as np from aiofsk.ecc import HAMMING_8_4_CODE from aiofsk.baud import BaudRate, TONES def frequency_counter(wave, sample_rate): was_positive = True period = 0 for i in wave: positive = i[0] > 0 if (positive and was_po...
[ "asyncio.get_event_loop", "aiofsk.ecc.HAMMING_8_4_CODE.decode", "numpy.arange", "asyncio.Queue", "aiofsk.ecc.HAMMING_8_4_CODE.encode" ]
[((776, 808), 'numpy.arange', 'np.arange', (['self._baud.frame_size'], {}), '(self._baud.frame_size)\n', (785, 808), True, 'import numpy as np\n'), ((836, 851), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (849, 851), False, 'import asyncio\n'), ((1622, 1656), 'aiofsk.ecc.HAMMING_8_4_CODE.encode', 'HAMMING_8_4_C...
import numpy as np import tensorflow as tf import matplotlib.pylab as plt import torch import numpy as np from PIL import Image from modules.spectral_pool_test import max_pool from modules.spectral_pool import spectral_pool from modules.frequency_dropout import test_frequency_dropout from modules.create_images import ...
[ "numpy.absolute", "matplotlib.pylab.imshow", "numpy.pad", "modules.create_images.downscale_image", "numpy.max", "modules.frequency_dropout.test_frequency_dropout", "matplotlib.pylab.savefig", "cnns.nnlib.pytorch_layers.pytorch_utils.compress_2D_half_test", "numpy.asarray", "tensorflow.constant", ...
[((524, 535), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (533, 535), False, 'import os\n'), ((977, 1017), 'matplotlib.pylab.imshow', 'plt.imshow', (['grayscale_image'], {'cmap': '"""gray"""'}), "(grayscale_image, cmap='gray')\n", (987, 1017), True, 'import matplotlib.pylab as plt\n'), ((1018, 1064), 'matplotlib.pylab....
from .fixtures import lci_fixture, method_fixture from bw2analyzer.contribution import ContributionAnalysis as CA from bw2calc import LCA from bw2data import Method, Database from bw2data.tests import BW2DataTest from scipy import sparse import numpy as np import unittest class ContributionTestCase(unittest.TestCase)...
[ "bw2analyzer.contribution.ContributionAnalysis", "bw2calc.LCA", "bw2data.Database", "numpy.allclose", "scipy.sparse.lil_matrix", "numpy.array", "bw2data.Method" ]
[((380, 410), 'numpy.array', 'np.array', (['(1.0, 2.0, 4.0, 3.0)'], {}), '((1.0, 2.0, 4.0, 3.0))\n', (388, 410), True, 'import numpy as np\n'), ((428, 462), 'numpy.array', 'np.array', (['((4, 2), (3, 3), (2, 1))'], {}), '(((4, 2), (3, 3), (2, 1)))\n', (436, 462), True, 'import numpy as np\n'), ((561, 565), 'bw2analyzer...
# Copyright 2017 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ "logging.debug", "numpy.random.randn", "tensorflow.argmax", "tensorflow.reshape", "tensorflow.contrib.legacy_seq2seq.rnn_decoder", "tensorflow.concat", "tensorflow.variable_scope", "numpy.linalg.svd", "tensorflow.zeros", "collections.namedtuple", "tensorflow.nn.xw_plus_b", "tensorflow.contrib....
[((3085, 3196), 'collections.namedtuple', 'collections.namedtuple', (['"""SequenceLogitsParams"""', "['num_lstm_units', 'weight_decay', 'lstm_state_clip_value']"], {}), "('SequenceLogitsParams', ['num_lstm_units',\n 'weight_decay', 'lstm_state_clip_value'])\n", (3107, 3196), False, 'import collections\n'), ((2890, 2...
from datetime import datetime import numpy as np from classes.Abstract import Abstract from utils.helpers import smart_plot, remove_offset_from_julian_date, nonP_box_plot from utils.matrix_convert import sort_matrix, insert_column_header class SummerBaseflow(Abstract): def __init__(self, start_date, directory_nam...
[ "utils.matrix_convert.insert_column_header", "numpy.nanpercentile", "utils.helpers.smart_plot", "numpy.savetxt", "classes.Abstract.Abstract.__init__", "utils.helpers.remove_offset_from_julian_date", "utils.matrix_convert.sort_matrix", "utils.helpers.nonP_box_plot" ]
[((377, 471), 'classes.Abstract.Abstract.__init__', 'Abstract.__init__', (['self', 'start_date', 'directory_name', 'end_with', 'class_number', 'gauge_numbers'], {}), '(self, start_date, directory_name, end_with, class_number,\n gauge_numbers)\n', (394, 471), False, 'from classes.Abstract import Abstract\n'), ((4755,...
""" Module for basic utilties with holy grail .. include common links, assuming primary doc root is up one directory .. include:: ../include/links.rst """ import numpy as np import os import numba as nb from matplotlib import pyplot as plt from scipy.ndimage.filters import gaussian_filter from scipy.signal import...
[ "numpy.sum", "numpy.invert", "pypeit.msgs.error", "matplotlib.pyplot.figure", "numpy.histogram", "numpy.arange", "pypeit.msgs.warn", "scipy.interpolate.interp1d", "os.path.join", "numpy.copy", "numpy.power", "numpy.max", "numpy.int", "numpy.reshape", "numpy.linspace", "numpy.log10", ...
[((18870, 18903), 'numba.jit', 'nb.jit', ([], {'nopython': '(True)', 'cache': '(True)'}), '(nopython=True, cache=True)\n', (18876, 18903), True, 'import numba as nb\n'), ((2095, 2116), 'numpy.ma.log10', 'np.ma.log10', (['waves_ma'], {}), '(waves_ma)\n', (2106, 2116), True, 'import numpy as np\n'), ((2133, 2158), 'numpy...
#!/usr/bin/env python u""" test_fes_predict.py (03/2021) Tests that FES2014 data can be downloaded from AWS S3 bucket Tests the read program to verify that constituents are being extracted Tests that interpolated results are comparable to FES2014 program PYTHON DEPENDENCIES: numpy: Scientific Computing Tools For P...
[ "os.path.abspath", "numpy.abs", "os.makedirs", "boto3.Session", "numpy.copy", "pytest.fixture", "numpy.zeros", "numpy.any", "posixpath.join", "numpy.exp", "inspect.currentframe", "numpy.ma.zeros", "shutil.rmtree", "shutil.copyfileobj", "os.path.join", "numpy.all" ]
[((1424, 1468), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'autouse': '(True)'}), "(scope='module', autouse=True)\n", (1438, 1468), False, 'import pytest\n'), ((1333, 1358), 'os.path.abspath', 'os.path.abspath', (['filename'], {}), '(filename)\n', (1348, 1358), False, 'import os\n'), ((1591, 172...
from __future__ import print_function from future import standard_library standard_library.install_aliases() import urllib.request, urllib.error, urllib.parse, io from PIL import Image import matplotlib.pyplot as plt import numpy as np from scipy.misc import imread, imresize """ Utility functions used for viewing and...
[ "numpy.random.uniform", "matplotlib.pyplot.show", "future.standard_library.install_aliases", "numpy.argmin", "numpy.clip", "PIL.Image.open", "numpy.array", "numpy.reshape", "scipy.misc.imresize", "matplotlib.pyplot.subplots", "scipy.misc.imread" ]
[((74, 108), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (106, 108), False, 'from future import standard_library\n'), ((770, 803), 'numpy.reshape', 'np.reshape', (['img', '((1,) + img.shape)'], {}), '(img, (1,) + img.shape)\n', (780, 803), True, 'import numpy as np\n...
# 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 relat...
[ "os.path.abspath", "torch.logical_not", "numpy.zeros", "numpy.expand_dims", "torch.cat", "numpy.ones", "numpy.arange", "numpy.array", "isaacgym.gymtorch.unwrap_tensor", "torch.zeros", "torch.bernoulli" ]
[((13419, 13538), 'torch.cat', 'torch.cat', (['(root_h, root_rot_obs, local_root_vel, local_root_ang_vel, dof_obs, dof_vel,\n flat_local_key_pos)'], {'dim': '(-1)'}), '((root_h, root_rot_obs, local_root_vel, local_root_ang_vel,\n dof_obs, dof_vel, flat_local_key_pos), dim=-1)\n', (13428, 13538), False, 'import to...
# -*- coding: utf-8 -*- """ Created on Sat Nov 18 22:55:29 2017 @author: ybarancan """ import scipy.io as sio from rgb_hs_resnet import * import glob import random import time import os import sys import numpy as np import tensorflow as tf from math import log10 dataset = "/scratch/cany...
[ "tensorflow.train.Saver", "scipy.io.loadmat", "os.path.basename", "numpy.asarray", "tensorflow.Session", "numpy.zeros", "numpy.flipud", "time.time", "tensorflow.placeholder", "tensorflow.ConfigProto", "numpy.mean", "numpy.rot90", "numpy.fliplr", "numpy.reshape", "os.path.join", "tensor...
[((5040, 5106), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[1, None, None, 3]'], {'name': '"""whole_image"""'}), "(tf.float32, [1, None, None, 3], name='whole_image')\n", (5054, 5106), True, 'import tensorflow as tf\n'), ((5169, 5185), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (518...
import numpy as np import sys import nrrd if (len(sys.argv) < 4): print('Error: missing arguments!') print('e.g. python [measure].py image.nrrd template.nrrd results.csv') else: print('Checking alignment for ', str(sys.argv[1]), ' against the template (', str(sys.argv[2]), ')...') readdata, options...
[ "numpy.power", "numpy.mean", "numpy.subtract" ]
[((982, 1021), 'numpy.subtract', 'np.subtract', (['imt', 'im1'], {'dtype': 'np.float64'}), '(imt, im1, dtype=np.float64)\n', (993, 1021), True, 'import numpy as np\n'), ((1094, 1127), 'numpy.power', 'np.power', (['d1', '(2)'], {'dtype': 'np.float64'}), '(d1, 2, dtype=np.float64)\n', (1102, 1127), True, 'import numpy as...
""" Tools for 3DCGA (g3c) 3DCGA Tools ========================================================== Generation Methods -------------------- .. autosummary:: :toctree: generated/ random_bivector standard_point_pair_at_origin random_point_pair_at_origin random_point_pair standard_line_at_origin ...
[ "clifford.MVArray", "numpy.abs", "numba.njit", "numpy.random.default_rng", "numpy.sin", "clifford.tools.g3.random_rotation_rotor", "scipy.interpolate.interp1d", "clifford.grade_obj", "clifford.MVArray.from_value_array", "math.log", "math.sinh", "numpy.vectorize", "math.sqrt", "clifford.too...
[((21055, 21090), 'numba.njit', 'numba.njit', ([], {'parallel': 'NUMBA_PARALLEL'}), '(parallel=NUMBA_PARALLEL)\n', (21065, 21090), False, 'import numba\n'), ((54091, 54141), 'numpy.vectorize', 'np.vectorize', (['fast_dual'], {'otypes': '[ConformalMVArray]'}), '(fast_dual, otypes=[ConformalMVArray])\n', (54103, 54141), ...
import numpy as np from scipy.integrate import odeint from abundance import FractionalAbundance class RateEquations(object): def __init__(self, atomic_data): self.atomic_data = atomic_data self.nuclear_charge = atomic_data.nuclear_charge def _set_temperature_and_density_grid(self, temperature...
[ "numpy.zeros_like", "numpy.ones_like", "numpy.abs", "numpy.roll", "scipy.integrate.odeint", "scipy.integrate.cumtrapz", "numpy.zeros", "numpy.searchsorted", "coronal.CoronalEquilibrium", "numpy.array", "abundance.FractionalAbundance" ]
[((601, 623), 'numpy.zeros', 'np.zeros', (['self.y_shape'], {}), '(self.y_shape)\n', (609, 623), True, 'import numpy as np\n'), ((639, 669), 'numpy.ones_like', 'np.ones_like', (['self.temperature'], {}), '(self.temperature)\n', (651, 669), True, 'import numpy as np\n'), ((717, 739), 'numpy.zeros', 'np.zeros', (['self.y...
import numpy as np class Hist1D(object): def __init__(self, xlow, xhigh, nbins): self.nbins = nbins self.xlow = xlow self.xhigh = xhigh self.hist, edges = np.histogram([], bins=nbins, range=(xlow, xhigh)) self.bins = (edges[:-1] + edges[1:]) / 2. def fill(self, value,...
[ "numpy.histogram" ]
[((194, 243), 'numpy.histogram', 'np.histogram', (['[]'], {'bins': 'nbins', 'range': '(xlow, xhigh)'}), '([], bins=nbins, range=(xlow, xhigh))\n', (206, 243), True, 'import numpy as np\n'), ((354, 423), 'numpy.histogram', 'np.histogram', (['[value]'], {'bins': 'self.nbins', 'range': '(self.xlow, self.xhigh)'}), '([valu...
# Copyright 2016 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "tensorflow.python.platform.flags.DEFINE_string", "Tkinter.Tk", "tensorflow.python.platform.app.run", "tensorflow.python.platform.flags.DEFINE_float", "numpy.zeros_like", "Tkinter.Label", "numpy.random.RandomState", "numpy.max", "render.swiftshader_renderer.get_shaders", "datasets.nav_env_config.n...
[((957, 980), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (971, 980), False, 'import matplotlib\n'), ((1437, 1504), 'tensorflow.python.platform.flags.DEFINE_string', 'flags.DEFINE_string', (['"""dataset_name"""', '"""sbpd"""', '"""Name of the dataset."""'], {}), "('dataset_name', 'sbpd', '...
import cranet import numpy as np from .vision import VisionDataset from pathlib import Path from typing import ( Any, Tuple, Optional, Callable ) from .utils import verify_str_arg class MNIST(VisionDataset): """`MNIST <http://yann.lecun.com/exdb/mnist/>`_ Dataset. Args: root (strin...
[ "cranet.as_tensor", "numpy.array" ]
[((3560, 3583), 'cranet.as_tensor', 'cranet.as_tensor', (['label'], {}), '(label)\n', (3576, 3583), False, 'import cranet\n'), ((2975, 2988), 'numpy.array', 'np.array', (['mat'], {}), '(mat)\n', (2983, 2988), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
[ "os.remove", "megengine._internal.cgtools.get_dep_vars", "megengine.tensor", "megengine.module.ReLU", "tempfile.mkstemp", "numpy.random.randn", "megengine._internal.cgtools.get_inputs", "megengine.module.BatchNorm2d", "numpy.zeros", "megengine._internal.load_comp_graph_from_file", "pytest.raises...
[((770, 788), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (786, 788), False, 'import tempfile\n'), ((927, 963), 'megengine._internal.load_comp_graph_from_file', 'mgb.load_comp_graph_from_file', (['fpath'], {}), '(fpath)\n', (956, 963), True, 'import megengine._internal as mgb\n'), ((977, 1029), 'megengine...
#solution1 """ def gcf(a, b): if b == 0: return a else: return gcf(b, a%b) def lcm(a, b): d = gcf(a, b) return a/d*b numbers = [] key = 20 #key = 10 for x in range(1, key+1): numbers.append(x) while len(numbers) > 1: numbers.append(lcm(numbers[0], numbers[1])) del numbers...
[ "numpy.lcm.reduce" ]
[((510, 532), 'numpy.lcm.reduce', 'np.lcm.reduce', (['numbers'], {}), '(numbers)\n', (523, 532), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- """ Class for reading data from a .kwik dataset Depends on: scipy phy Supported: Read Author: <NAME> @CINPLA """ # TODO: writing to file # needed for python 3 compatibility from __future__ import absolute_import from __future__ import division import numpy as np import quantiti...
[ "neo.io.baseio.BaseIO.__init__", "os.path.abspath", "quantities.Quantity", "neo.core.Block", "numpy.nonzero", "neo.core.AnalogSignal", "neo.core.Segment", "klusta.kwik.KwikModel", "neo.core.SpikeTrain" ]
[((1917, 1938), 'neo.io.baseio.BaseIO.__init__', 'BaseIO.__init__', (['self'], {}), '(self)\n', (1932, 1938), False, 'from neo.io.baseio import BaseIO\n'), ((1963, 1988), 'os.path.abspath', 'os.path.abspath', (['filename'], {}), '(filename)\n', (1978, 1988), False, 'import os\n'), ((2005, 2034), 'klusta.kwik.KwikModel'...
from shapely.geometry import Point, shape import importlib import numpy as np import pandas as pd import shapefile from shapely.geometry import shape, Polygon, box import os import time import argparse from hydroDL.data import gridMET from hydroDL.utils import gis from hydroDL import kPath ncFile = os.path.join(kPat...
[ "os.listdir", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.imshow", "numpy.isnan", "time.time", "hydroDL.data.gridMET.readNcData", "hydroDL.data.gridMET.readNcInfo", "numpy.where", "hydroDL.utils.gis.gridMask", "os.path.join", "shapely.geometry.shape", "shapefile.Reader", "sha...
[((303, 356), 'os.path.join', 'os.path.join', (['kPath.dirData', '"""gridMET"""', '"""etr_1979.nc"""'], {}), "(kPath.dirData, 'gridMET', 'etr_1979.nc')\n", (315, 356), False, 'import os\n'), ((367, 432), 'os.path.join', 'os.path.join', (['kPath.dirData', '"""USGS"""', '"""basins"""', '"""basinAll_prj.shp"""'], {}), "(k...
""" Test the graph_lasso module. """ import sys import numpy as np from scipy import linalg from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_less from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV, empirical_...
[ "sklearn.datasets.load_iris", "sklearn.covariance.graph_lasso", "sklearn.utils.check_random_state", "sklearn.covariance.empirical_covariance", "sklearn.externals.six.moves.StringIO", "numpy.zeros", "sklearn.datasets.samples_generator.make_sparse_spd_matrix", "scipy.linalg.inv", "sklearn.covariance.G...
[((669, 701), 'sklearn.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (687, 701), False, 'from sklearn.utils import check_random_state\n'), ((713, 779), 'sklearn.datasets.samples_generator.make_sparse_spd_matrix', 'make_sparse_spd_matrix', (['dim'], {'alpha': '(0.95)', 'ran...
"""Pared-down, free-standing version of GLWidget from spyke/cluster.py. For use as an OpenGL widget demo. Most of the keyboard commands should work, including the arrow keys, S and D for selection/deselection, F for focus, 0 for centering, and ? for a tooltip. You can zoom in and out with the mouse wheel or the right b...
[ "PyQt4.QtGui.QMainWindow.__init__", "PyQt4.uic.loadUi", "PyQt4.QtOpenGL.QGLWidget.__init__", "numpy.array_repr", "numpy.arange", "OpenGL.GL.glClearColor", "OpenGL.GL.glVertexPointerf", "OpenGL.GL.glDrawArrays", "OpenGL.GL.glLoadIdentity", "OpenGL.GL.glClear", "OpenGL.GL.glTranslate", "OpenGL.G...
[((2996, 3013), 'copy.copy', 'copy', (['PLOTCOLOURS'], {}), '(PLOTCOLOURS)\n', (3000, 3013), False, 'from copy import copy\n'), ((1649, 1662), 'numpy.uint8', 'np.uint8', (['rgb'], {}), '(rgb)\n', (1657, 1662), True, 'import numpy as np\n'), ((33282, 33310), 'PyQt4.QtCore.pyqtRemoveInputHook', 'QtCore.pyqtRemoveInputHoo...
from numpy import random # Este es una pésima implementación de k-means. Retorna centroides aleatorios. def kmeans(puntos,k): # Acá debería ir la lógica correcta de k-means centroides = random.randn(k,2) return centroides
[ "numpy.random.randn" ]
[((195, 213), 'numpy.random.randn', 'random.randn', (['k', '(2)'], {}), '(k, 2)\n', (207, 213), False, 'from numpy import random\n')]
# -*- coding: utf-8 -*- import numpy as np import pytest from pysteps.tracking.tdating import dating from pysteps.utils import to_reflectivity from pysteps.tests.helpers import get_precipitation_fields arg_names = ("source", "dry_input") arg_values = [ ("mch", False), ("mch", False), ("mch", True), ] ...
[ "pysteps.tests.helpers.get_precipitation_fields", "pytest.importorskip", "pysteps.tracking.tdating.dating", "pysteps.utils.to_reflectivity", "numpy.zeros", "pytest.mark.parametrize" ]
[((321, 367), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['arg_names', 'arg_values'], {}), '(arg_names, arg_values)\n', (344, 367), False, 'import pytest\n'), ((425, 455), 'pytest.importorskip', 'pytest.importorskip', (['"""skimage"""'], {}), "('skimage')\n", (444, 455), False, 'import pytest\n'), ((469, 49...
# Created by <NAME> # Date: 27/07/2020 import os import _pickle as pkl import numpy as np from collections import deque class Archive(object): """ This class implements the archive. It only stores the BD and traj of each agent in unordered sets. We do not need to know anything else nor we need an order. """ ...
[ "numpy.full", "_pickle.load", "numpy.argmax", "_pickle.dump", "os.path.exists", "numpy.array", "numpy.linspace", "collections.deque" ]
[((424, 431), 'collections.deque', 'deque', ([], {}), '()\n', (429, 431), False, 'from collections import deque\n'), ((4827, 4900), 'numpy.full', 'np.full', (["([self.grid_params['bins']] * self.bd_dimensions)"], {'fill_value': 'None'}), "([self.grid_params['bins']] * self.bd_dimensions, fill_value=None)\n", (4834, 490...
import numpy as np #imports numpy library #integers i = 10 #integer print(type(i)) #print out the data type of i a_i = np.zeros(i,dtype=int) #declare an array of ints print(type(a_i)) #will return ndarray, n dimensional array print(type(a_i[0])) #will return int64 #floats ...
[ "numpy.zeros" ]
[((134, 156), 'numpy.zeros', 'np.zeros', (['i'], {'dtype': 'int'}), '(i, dtype=int)\n', (142, 156), True, 'import numpy as np\n'), ((514, 538), 'numpy.zeros', 'np.zeros', (['i'], {'dtype': 'float'}), '(i, dtype=float)\n', (522, 538), True, 'import numpy as np\n')]
""" Tests for dit.utils.units. """ import pytest pint = pytest.importorskip('pint') import numpy as np from dit import Distribution, ditParams from dit.algorithms.channelcapacity import channel_capacity_joint from dit.multivariate import entropy from dit.params import reset_params from dit.utils.units import ureg ...
[ "pytest.importorskip", "numpy.log", "dit.algorithms.channelcapacity.channel_capacity_joint", "dit.Distribution", "dit.params.reset_params", "dit.utils.units.ureg.Quantity", "pytest.approx", "dit.multivariate.entropy" ]
[((58, 85), 'pytest.importorskip', 'pytest.importorskip', (['"""pint"""'], {}), "('pint')\n", (77, 85), False, 'import pytest\n'), ((388, 428), 'dit.Distribution', 'Distribution', (["['0', '1']", '[1 / 2, 1 / 2]'], {}), "(['0', '1'], [1 / 2, 1 / 2])\n", (400, 428), False, 'from dit import Distribution, ditParams\n'), (...
import numpy as np from matplotlib import pyplot as plt p = np.array([0,10]) p2 = p*2 p3 = p*3 # row,colomn,index plt.subplot(1,2,1) plt.plot(p,p2,color = 'b',ls = '-.',linewidth = 2) plt.title("Line Plot 1",color = "r") plt.xlabel("X- Axis",color = 'r') plt.ylabel("Y- Axis",color = 'r') plt.grid(True) # ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid" ]
[((60, 77), 'numpy.array', 'np.array', (['[0, 10]'], {}), '([0, 10])\n', (68, 77), True, 'import numpy as np\n'), ((122, 142), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(1)', '(2)', '(1)'], {}), '(1, 2, 1)\n', (133, 142), True, 'from matplotlib import pyplot as plt\n'), ((141, 189), 'matplotlib.pyplot.plot', 'plt....
import numpy as np class pool: def __init__(self, pool_size = 50000, a_dim = 6): self.pool_size = pool_size self.a_dim = a_dim self.buffer = [] # for _ in range(self.a_dim): # self.buffer.append([]) def submit_core(self, s, a): _a = np.argmax(a)...
[ "numpy.random.randint", "numpy.array", "numpy.random.shuffle", "numpy.argmax" ]
[((308, 320), 'numpy.argmax', 'np.argmax', (['a'], {}), '(a)\n', (317, 320), True, 'import numpy as np\n'), ((878, 908), 'numpy.random.shuffle', 'np.random.shuffle', (['self.buffer'], {}), '(self.buffer)\n', (895, 908), True, 'import numpy as np\n'), ((462, 485), 'numpy.random.randint', 'np.random.randint', (['_len'], ...