code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 6 00:11:55 2020
@author: andreas
"""
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from PlotScatter import hue_order
from Basefolder import basefolder
import pickle
import numpy as np
my_pal = {'FINDER_1D_loop':'#701a... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"pickle.load",
"seaborn.histplot",
"numpy.min",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((2941, 2996), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(4)', '(2)'], {'gridspec_kw': 'gs_kw', 'figsize': '(12, 12)'}), '(4, 2, gridspec_kw=gs_kw, figsize=(12, 12))\n', (2953, 2996), True, 'import matplotlib.pyplot as plt\n'), ((4180, 4208), 'pandas.read_csv', 'pd.read_csv', (['(base + filename)'], {}), '(base... |
# Code behind module for DCAL_Vegetation_Phenology.ipynb
################################
##
## Import Statments
##
################################
# Import standard Python modules
import sys
import datacube
import numpy as np
# Import DCAL utilities containing function definitions used generally across DCAL
sys.... | [
"dc_time._n64_datetime_to_scalar",
"numpy.argmax",
"numpy.array",
"numpy.gradient",
"sys.path.append"
] | [((316, 348), 'sys.path.append', 'sys.path.append', (['"""../DCAL_utils"""'], {}), "('../DCAL_utils')\n", (331, 348), False, 'import sys\n'), ((1961, 2012), 'dc_time._n64_datetime_to_scalar', '_n64_datetime_to_scalar', (['dataarray[time_dim].values'], {}), '(dataarray[time_dim].values)\n', (1984, 2012), False, 'from dc... |
import numpy as np
import matplotlib.pyplot as plt
colors = ['gold', 'yellowgreen', 'c', 'royalblue', 'pink']
# randomly generate the number of occurrences of each color
occurrences = np.random.randint(10, size=len(colors)) + 1
# pmf of the distribution
sum = np.sum(occurrences)
pmf = occurrences / sum
print(pmf)
#... | [
"numpy.sum",
"numpy.cumsum",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((262, 281), 'numpy.sum', 'np.sum', (['occurrences'], {}), '(occurrences)\n', (268, 281), True, 'import numpy as np\n'), ((370, 385), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {}), '(2)\n', (382, 385), True, 'import matplotlib.pyplot as plt\n'), ((493, 507), 'numpy.cumsum', 'np.cumsum', (['pmf'], {}), '(... |
"""
Use the library to calculate stiffness matrices for Zysset-Curnier Model based orthotropic materials
and extract the engineering constants from the stiffness matrices.
"""
from collections import namedtuple
import numpy as np
import tenseng.tenseng.tenseng as t
cubic = namedtuple('CubicAnisotropic', ['E', 'nu', ... | [
"numpy.trace",
"numpy.eye",
"collections.namedtuple",
"numpy.isclose",
"numpy.linalg.eig",
"tenseng.tenseng.tenseng.to_matrix",
"tenseng.tenseng.tenseng.Vector",
"tenseng.tenseng.tenseng.double_tensor_product",
"tenseng.tenseng.tenseng.identity",
"tenseng.tenseng.tenseng.dyad",
"tenseng.tenseng.... | [((277, 325), 'collections.namedtuple', 'namedtuple', (['"""CubicAnisotropic"""', "['E', 'nu', 'G']"], {}), "('CubicAnisotropic', ['E', 'nu', 'G'])\n", (287, 325), False, 'from collections import namedtuple\n'), ((332, 368), 'collections.namedtuple', 'namedtuple', (['"""Isotropic"""', "['E', 'nu']"], {}), "('Isotropic'... |
from meas_exponential import mechanism_exponential_discrete
import numpy as np
def score_auction_price_discrete(x, candidates):
return candidates * (x[None] >= candidates[:, None]).sum(axis=1)
def release_dp_auction_price_via_de(x, candidate_prices, epsilon):
"""Release a price for a digital auction that ma... | [
"numpy.random.randint",
"numpy.random.uniform"
] | [((1783, 1816), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(1000, 4)'}), '(size=(1000, 4))\n', (1800, 1816), True, 'import numpy as np\n'), ((2175, 2202), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(100)'}), '(size=100)\n', (2192, 2202), True, 'import numpy as np\n'), ((2220, 2245), 'n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Brno University of Technology FIT
# Author: <NAME> <<EMAIL>>
# All Rights Reserved
import os
import re
import random
from os import listdir
from os.path import isfile, join
import fnmatch
import math
import numpy as np
import yaml
class Utils(obje... | [
"os.listdir",
"os.walk",
"math.sqrt",
"yaml.load",
"os.path.join",
"numpy.array_split",
"doctest.testmod",
"fnmatch.filter",
"os.path.abspath",
"re.sub",
"numpy.load",
"numpy.save"
] | [((14989, 15006), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (15004, 15006), False, 'import doctest\n'), ((1368, 1394), 'os.path.abspath', 'os.path.abspath', (['directory'], {}), '(directory)\n', (1383, 1394), False, 'import os\n'), ((2349, 2375), 'os.path.abspath', 'os.path.abspath', (['directory'], {}), ... |
import numpy as np
from mcfa import utils
np.random.seed(42)
def test_latent_factor_rotation(D=15, J=10, noise=0.05):
# Generate fake factors.
A = np.random.uniform(-1, 1, size=(D, J))
# Randomly flip them.
true_signs = np.sign(np.random.uniform(-1, 1, size=J)).astype(int)
# Add a little n... | [
"numpy.random.normal",
"mcfa.utils.rotation_matrix",
"numpy.alltrue",
"numpy.random.choice",
"numpy.where",
"numpy.random.seed",
"numpy.random.uniform"
] | [((47, 65), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (61, 65), True, 'import numpy as np\n'), ((163, 200), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(1)'], {'size': '(D, J)'}), '(-1, 1, size=(D, J))\n', (180, 200), True, 'import numpy as np\n'), ((346, 384), 'numpy.random.normal', ... |
#!/usr/bin/env python3
import os
import numpy as np
import astropy.io.fits as fits
from stella.catalog.base import _str_to_float
inputfile = os.path.join(os.getenv('ASTRO_DATA'), 'catalog/I/239/hip_main.dat')
types = [
('HIP', np.int32),
('RAdeg', np.float64),
('DEdeg', np.float64),
... | [
"os.path.exists",
"astropy.io.fits.HDUList",
"astropy.io.fits.PrimaryHDU",
"os.getenv",
"astropy.io.fits.BinTableHDU",
"numpy.array",
"stella.catalog.base._str_to_float",
"numpy.isnan",
"numpy.dtype",
"os.remove"
] | [((1185, 1231), 'numpy.dtype', 'np.dtype', (["{'names': tmp[0], 'formats': tmp[1]}"], {}), "({'names': tmp[0], 'formats': tmp[1]})\n", (1193, 1231), True, 'import numpy as np\n'), ((1242, 1462), 'numpy.array', 'np.array', (["(0, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN, np.NaN,\n np.NaN, np.NaN... |
import astropy.units as u
from astropy.coordinates import EarthLocation,SkyCoord
from pytz import timezone
import numpy as np
from collections import Sequence
import matplotlib.pyplot as plt
from matplotlib import dates
from astroplan import Observer
from astroplan import FixedTarget
from datetime import datetime, ... | [
"matplotlib.dates.date2num",
"pytz.timezone",
"re.compile",
"matplotlib.dates.DateFormatter",
"astropy.coordinates.EarthLocation.from_geodetic",
"astropy.coordinates.SkyCoord",
"bs4.BeautifulSoup",
"numpy.zeros",
"numpy.linspace",
"datetime.datetime.fromisoformat",
"datetime.timedelta",
"numpy... | [((1639, 1655), 'bs4.BeautifulSoup', 'bs', (['text', '"""lxml"""'], {}), "(text, 'lxml')\n", (1641, 1655), True, 'from bs4 import BeautifulSoup as bs\n'), ((3202, 3244), 're.compile', 're.compile', (['"""top: (.*)px; bottom: (.*)px;"""'], {}), "('top: (.*)px; bottom: (.*)px;')\n", (3212, 3244), False, 'import re\n'), (... |
# -*- coding: utf-8 -*-
"""
fix alpha blending of font_control
===================================
"""
# import standard libraries
from operator import sub
import os
from pathlib import Path
from colour.models.cie_lab import Lab_to_LCHab
# import third-party libraries
import numpy as np
from colour import LUT3D, RGB_... | [
"numpy.dstack",
"pathlib.Path",
"colour.RGB_to_XYZ",
"colour.XYZ_to_Lab",
"numpy.stack",
"numpy.array",
"colour.LUT3D.linear_table",
"numpy.save",
"os.path.abspath",
"colour.difference.delta_E_CIE2000",
"numpy.arange",
"numpy.load"
] | [((926, 1001), 'colour.RGB_to_XYZ', 'RGB_to_XYZ', (['rgb_linear', 'cs.D65', 'cs.D65', 'BT709_COLOURSPACE.RGB_to_XYZ_matrix'], {}), '(rgb_linear, cs.D65, cs.D65, BT709_COLOURSPACE.RGB_to_XYZ_matrix)\n', (936, 1001), False, 'from colour import LUT3D, RGB_to_XYZ, XYZ_to_Lab\n'), ((1021, 1042), 'colour.XYZ_to_Lab', 'XYZ_to... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import random
import itertools
import mccd
## Extracting the EigenPSFs from the fitted models
vignets_noiseless = np.zeros((19665, 51, 51))
i=0
for j in list(range(2000000, 2000287)) + list(range(2100000, 2100150)):
path_fitted_model = '/n05data/a... | [
"mccd.mccd_utils.save_to_fits",
"numpy.zeros",
"mccd.utils.reg_format",
"numpy.load",
"numpy.random.shuffle"
] | [((176, 201), 'numpy.zeros', 'np.zeros', (['(19665, 51, 51)'], {}), '((19665, 51, 51))\n', (184, 201), True, 'import numpy as np\n'), ((639, 675), 'numpy.random.shuffle', 'np.random.shuffle', (['vignets_noiseless'], {}), '(vignets_noiseless)\n', (656, 675), True, 'import numpy as np\n'), ((763, 863), 'mccd.mccd_utils.s... |
import numpy as np
from sklearn.base import BaseEstimator, clone
from sklearn.metrics import r2_score
from .utils import my_fit
class EraBoostXgbRegressor(BaseEstimator):
def __init__(self, base_estimator=None, num_iterations=3, proportion=0.5, n_estimators=None):
self.base_estimator = base_estimator
... | [
"sklearn.base.clone",
"numpy.quantile",
"numpy.concatenate",
"sklearn.metrics.r2_score",
"numpy.arange"
] | [((575, 601), 'sklearn.base.clone', 'clone', (['self.base_estimator'], {}), '(self.base_estimator)\n', (580, 601), False, 'from sklearn.base import BaseEstimator, clone\n'), ((1287, 1327), 'numpy.quantile', 'np.quantile', (['era_scores', 'self.proportion'], {}), '(era_scores, self.proportion)\n', (1298, 1327), True, 'i... |
import gc
import time
from typing import Optional
import numpy
from aydin.features.base import FeatureGeneratorBase
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.it.balancing.data_histogram_balancer import DataHistogramBalancer
from aydin.it.base import ImageTranslatorBase
from aydin... | [
"numpy.copyto",
"aydin.features.base.FeatureGeneratorBase.load",
"numpy.moveaxis",
"aydin.util.log.log.lsection",
"aydin.regression.cb.CBRegressor",
"aydin.regression.base.RegressorBase.load",
"numpy.random.permutation",
"aydin.util.array.nd.nd_split_slices",
"aydin.util.offcore.offcore.offcore_arra... | [((17235, 17378), 'aydin.util.log.log.lprint', 'lprint', (['f"""Image has: {num_of_voxels} voxels, at most: {self.max_voxels_for_training} voxels will be used for training or validation."""'], {}), "(\n f'Image has: {num_of_voxels} voxels, at most: {self.max_voxels_for_training} voxels will be used for training or v... |
#!/usr/bin/env python
# from __future__ import division
import torch
import math
import random
from PIL import Image, ImageOps, ImageEnhance
import numbers
import torchvision.transforms.functional as F
import numpy as np
class RandomCrop(object):
"""Crop the given PIL Image at a random location.
Args:
... | [
"random.uniform",
"math.sqrt",
"torchvision.transforms.functional.pad",
"torchvision.transforms.functional.rotate",
"torchvision.transforms.functional.resized_crop",
"numpy.random.uniform",
"random.random",
"random.randint"
] | [((1649, 1674), 'random.randint', 'random.randint', (['(0)', '(h - th)'], {}), '(0, h - th)\n', (1663, 1674), False, 'import random\n'), ((1687, 1712), 'random.randint', 'random.randint', (['(0)', '(w - tw)'], {}), '(0, w - tw)\n', (1701, 1712), False, 'import random\n'), ((7516, 7557), 'numpy.random.uniform', 'np.rand... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 24 16:57:31 2017
@author: Jean-Michel
"""
import AstarClass as AC
import sys
sys.path.append("../model")
from WeatherClass import Weather
import numpy as np
import SimulatorTLKT as SimC
from SimulatorTLKT import Simulator
import matplotlib.pyplot as plt
im... | [
"SimulatorTLKT.Simulator",
"matplotlib.rcParams.update",
"AstarClass.Node",
"copy.copy",
"AstarClass.Pathfinder",
"WeatherClass.Weather.load",
"sys.path.append",
"numpy.arange"
] | [((135, 162), 'sys.path.append', 'sys.path.append', (['"""../model"""'], {}), "('../model')\n", (150, 162), False, 'import sys\n'), ((434, 479), 'matplotlib.rcParams.update', 'matplotlib.rcParams.update', (["{'font.size': 16}"], {}), "({'font.size': 16})\n", (460, 479), False, 'import matplotlib\n'), ((523, 551), 'sys.... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import ConnectionPatch
from matplotlib.transforms import Bbox
import seaborn as sns
import utils
from utils import filters, maxima, segment, merge
import warnings
def pipeline(img, low, high, roi_percentile=85, focal_scope='global', maxima_are... | [
"utils.filters.blur",
"numpy.ones",
"utils.percentile",
"utils.resize",
"utils.maxima.remove_small_holes",
"utils.merge.merge_images",
"utils.merge.keep_percentage",
"matplotlib.transforms.Bbox",
"matplotlib.pyplot.figure",
"utils.segment.region_growing",
"matplotlib.patches.ConnectionPatch",
... | [((5729, 5766), 'numpy.ones', 'np.ones', (['img[0].shape'], {'dtype': 'np.uint8'}), '(img[0].shape, dtype=np.uint8)\n', (5736, 5766), True, 'import numpy as np\n'), ((5836, 5872), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(5)', '(7)'], {'figsize': '(16, 16)'}), '(5, 7, figsize=(16, 16))\n', (5848, 5872), True, '... |
import sys
import numpy
import six.moves
import cellprofiler_core.image
import cellprofiler.modules.measuregranularity
import cellprofiler_core.object
import cellprofiler_core.pipeline
import cellprofiler_core.workspace
import tests.modules
print((sys.path))
IMAGE_NAME = "myimage"
OBJECTS_NAME = "myobjects"
def... | [
"numpy.ones",
"numpy.testing.assert_almost_equal",
"numpy.zeros",
"numpy.isnan",
"numpy.all"
] | [((9229, 9254), 'numpy.ones', 'numpy.ones', (['(40, 40)', 'int'], {}), '((40, 40), int)\n', (9239, 9254), False, 'import numpy\n'), ((10892, 10917), 'numpy.ones', 'numpy.ones', (['(40, 40)', 'int'], {}), '((40, 40), int)\n', (10902, 10917), False, 'import numpy\n'), ((11988, 12013), 'numpy.ones', 'numpy.ones', (['(40, ... |
import os
import numpy as np
import imageio
import cv2
from backend import Config
def pre_proc(img, params):
"""
Description
Keyword arguments:
img --
params --
"""
interpolation = params['interpolation']
# img: read in by imageio.imread
# with shape (x,y,3), in the format of RG... | [
"cv2.resize",
"numpy.minimum",
"numpy.asarray",
"numpy.array",
"numpy.zeros",
"imageio.imread",
"numpy.maximum",
"numpy.transpose"
] | [((384, 425), 'cv2.resize', 'cv2.resize', (['img', '(112, 96)', 'interpolation'], {}), '(img, (112, 96), interpolation)\n', (394, 425), False, 'import cv2\n'), ((2090, 2105), 'numpy.array', 'np.array', (['faces'], {}), '(faces)\n', (2098, 2105), True, 'import numpy as np\n'), ((2308, 2335), 'numpy.zeros', 'np.zeros', (... |
r"""
Basic analysis of a MD simulation
=================================
In this example, we will analyze a trajectory of a *Gromacs* MD
simulation:
The trajectory contains simulation data of lysozyme over the course of
1 ns.
The data is the result of the famous *Gromacs*
'`Lysozyme in Water <http://www.mdtutorials.co... | [
"biotite.structure.io.load_structure",
"numpy.arange",
"numpy.where",
"biotite.structure.rmsd",
"biotite.structure.filter_amino_acids",
"matplotlib.pyplot.figure",
"biotite.structure.average",
"biotite.structure.get_residue_count",
"biotite.structure.remove_pbc",
"biotite.structure.gyration_radius... | [((1222, 1261), 'biotite.structure.io.load_structure', 'strucio.load_structure', (['templ_file_path'], {}), '(templ_file_path)\n', (1244, 1261), True, 'import biotite.structure.io as strucio\n'), ((1487, 1521), 'biotite.structure.filter_amino_acids', 'struc.filter_amino_acids', (['template'], {}), '(template)\n', (1511... |
"""
Split ramps into individual FLT exposures.
To use, download *just* the RAW files for a given visit/program.
>>> from wfc3dash import process_raw
>>> process_raw.run_all()
"""
def run_all(skip_first_read=True):
"""
Run splitting script on all RAW files in the working directory.
First ... | [
"numpy.sqrt",
"os.getenv",
"astropy.io.fits.PrimaryHDU",
"reprocess_wfc3.reprocess_wfc3.get_flat",
"astropy.io.fits.ImageHDU",
"numpy.diff",
"numpy.zeros",
"glob.glob",
"astropy.io.fits.open",
"reprocess_wfc3.reprocess_wfc3.split_multiaccum",
"wfc3tools.calwf3"
] | [((505, 527), 'glob.glob', 'glob.glob', (['"""*raw.fits"""'], {}), "('*raw.fits')\n", (514, 527), False, 'import glob\n'), ((1610, 1627), 'astropy.io.fits.open', 'pyfits.open', (['file'], {}), '(file)\n', (1621, 1627), True, 'import astropy.io.fits as pyfits\n'), ((1794, 1833), 'reprocess_wfc3.reprocess_wfc3.split_mult... |
# -*- coding:utf-8 -*-
"""
Created on Wed Nov 20 12:40 2019
@author <NAME> - <EMAIL>
Agent - Recycler
"""
from mesa import Agent
import numpy as np
class Recyclers(Agent):
"""
A recycler which sells recycled materials and improve its processes.
Attributes:
unique_id: agent #, also relate to th... | [
"numpy.random.triangular",
"numpy.random.random",
"numpy.isnan",
"numpy.random.uniform"
] | [((1276, 1384), 'numpy.random.triangular', 'np.random.triangular', (['original_recycling_cost[0]', 'original_recycling_cost[2]', 'original_recycling_cost[1]'], {}), '(original_recycling_cost[0], original_recycling_cost[2],\n original_recycling_cost[1])\n', (1296, 1384), True, 'import numpy as np\n'), ((2479, 2576), ... |
import numpy as np
from torch.utils.data import DataLoader, SequentialSampler
HIDDEN_SIZE_BERT = 768
def flat_accuracy(preds, labels):
preds = preds.squeeze()
my_round = lambda x: 1 if x >= 0.5 else 0
pred_flat = np.fromiter(map(my_round, preds), dtype=np.int).flatten()
labels_flat = labels.flatten()
... | [
"numpy.sum",
"datetime.timedelta",
"torch.utils.data.SequentialSampler"
] | [((331, 363), 'numpy.sum', 'np.sum', (['(pred_flat == labels_flat)'], {}), '(pred_flat == labels_flat)\n', (337, 363), True, 'import numpy as np\n'), ((2377, 2420), 'datetime.timedelta', 'datetime.timedelta', ([], {'seconds': 'elapsed_rounded'}), '(seconds=elapsed_rounded)\n', (2395, 2420), False, 'import datetime\n'),... |
import numpy as np
import scipy.fftpack as fft
import sys
sys.path.append('../laplace_solver/')
import laplace_solver as lsolve
from scipy.integrate import cumtrapz
def fourier_inverse_curl(Bx, By, Bz, x, y, z, method='fourier', pad=True):
r"""
Invert curl with pseudo-spectral method described in MacKay 2006.
... | [
"numpy.mean",
"numpy.repeat",
"scipy.fftpack.fftfreq",
"numpy.asarray",
"scipy.integrate.cumtrapz",
"numpy.fft.fftn",
"numpy.array",
"numpy.zeros",
"laplace_solver.dct_3d",
"laplace_solver.idct_3d",
"numpy.expand_dims",
"numpy.meshgrid",
"numpy.fft.ifftn",
"sys.path.append"
] | [((58, 95), 'sys.path.append', 'sys.path.append', (['"""../laplace_solver/"""'], {}), "('../laplace_solver/')\n", (73, 95), False, 'import sys\n'), ((363, 375), 'numpy.array', 'np.array', (['Bx'], {}), '(Bx)\n', (371, 375), True, 'import numpy as np\n'), ((390, 402), 'numpy.array', 'np.array', (['By'], {}), '(By)\n', (... |
import numpy as np
import sys
import tensorflow as tf
import cv2
import time
import sys
from .utils import cv2_letterbox_resize, download_from_url
import zipfile
import os
@tf.function
def transform_targets_for_output(y_true, grid_y, grid_x, anchor_idxs, classes):
# y_true: (N, boxes, (x1, y1, x2, y2, class, best... | [
"tensorflow.equal",
"tensorflow.shape",
"zipfile.ZipFile",
"time.sleep",
"numpy.array",
"tensorflow.cast",
"os.path.exists",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.py_function",
"tensorflow.concat",
"numpy.stack",
"numpy.dot",
"tensorflow.reduce_any",
"tensorflow.stack",... | [((523, 553), 'tensorflow.cast', 'tf.cast', (['anchor_idxs', 'tf.int32'], {}), '(anchor_idxs, tf.int32)\n', (530, 553), True, 'import tensorflow as tf\n'), ((569, 615), 'tensorflow.TensorArray', 'tf.TensorArray', (['tf.int32', '(1)'], {'dynamic_size': '(True)'}), '(tf.int32, 1, dynamic_size=True)\n', (583, 615), True, ... |
"""
Bridging Composite and Real: Towards End-to-end Deep Image Matting [IJCV-2021]
Dataset processing.
Copyright (c) 2021, <NAME> (<EMAIL>)
Licensed under the MIT License (see LICENSE for details)
Github repo: https://github.com/JizhiziLi/GFM
Paper link (Arxiv): https://arxiv.org/abs/2010.16188
"""
from config impor... | [
"PIL.Image.open",
"cv2.resize",
"cv2.flip",
"numpy.where",
"random.random",
"random.randint"
] | [((3715, 3737), 'random.randint', 'random.randint', (['(25)', '(35)'], {}), '(25, 35)\n', (3729, 3737), False, 'import random\n'), ((1181, 1209), 'numpy.where', 'np.where', (['(trimap_crop == 128)'], {}), '(trimap_crop == 128)\n', (1189, 1209), True, 'import numpy as np\n'), ((1240, 1268), 'numpy.where', 'np.where', ([... |
import numpy as np
from astropy import units as u
from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
from json_to_dict import constants
from PS2.Ass1.ass1_utils import *
E = 80*u.keV
m = constants["m_e"]
q = constants["q_e"]
B =45000*u.nT
V = getV(E, m)
r_lam = getr_lam(m, V, q, B)
print("Larmor radi... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.deg2rad",
"numpy.linspace",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.figure",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.show"
] | [((711, 725), 'numpy.deg2rad', 'np.deg2rad', (['(25)'], {}), '(25)\n', (721, 725), True, 'import numpy as np\n'), ((878, 905), 'numpy.linspace', 'np.linspace', (['(0)', '(1e-05)', '(1001)'], {}), '(0, 1e-05, 1001)\n', (889, 905), True, 'import numpy as np\n'), ((1091, 1103), 'matplotlib.pyplot.figure', 'plt.figure', ([... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
import numpy as np
import os
app = Flask(__name__)
# DB
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3'
db = SQLAlchemy(app)
# MA
ma = Marshmallow(app)
# CONFIG
app.config['MAX_CONTENT_LENGTH'] =... | [
"os.path.exists",
"flask.Flask",
"flask_marshmallow.Marshmallow",
"os.path.join",
"numpy.asarray",
"os.mkdir",
"flask_sqlalchemy.SQLAlchemy"
] | [((142, 157), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (147, 157), False, 'from flask import Flask\n'), ((232, 247), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (242, 247), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((259, 275), 'flask_marshmallow.Marshmallow', 'M... |
#!/usr/bin/python
#####
# applies model predictions to tiled CR predictor data
#####
import gdal
import scipy
import numpy as np
from sklearn import tree
from sklearn import ensemble
from sklearn import linear_model
from sklearn import svm
from sklearn import metrics
from sklearn.model_selection import train_test_spli... | [
"numpy.where",
"numpy.zeros",
"gdal.Open",
"gdal.GetDriverByName"
] | [((1820, 1839), 'gdal.Open', 'gdal.Open', (['tiles[i]'], {}), '(tiles[i])\n', (1829, 1839), False, 'import gdal\n'), ((2104, 2127), 'numpy.where', 'np.where', (['(band != ndval)'], {}), '(band != ndval)\n', (2112, 2127), True, 'import numpy as np\n'), ((2776, 2794), 'numpy.zeros', 'np.zeros', (['(ny, nx)'], {}), '((ny,... |
import torch.utils.data as data
import torch
import h5py
import numpy as np
def data_augment(im,num):
org_image = im.transpose(1,2,0)
if num ==0:
ud_image = np.flipud(org_image)
tranform = ud_image
elif num ==1:
lr_image = np.fliplr(org_image)
tranform = lr_image... | [
"numpy.flipud",
"numpy.fliplr",
"h5py.File",
"numpy.random.randint",
"numpy.rot90"
] | [((182, 202), 'numpy.flipud', 'np.flipud', (['org_image'], {}), '(org_image)\n', (191, 202), True, 'import numpy as np\n'), ((1191, 1211), 'h5py.File', 'h5py.File', (['file_path'], {}), '(file_path)\n', (1200, 1211), False, 'import h5py\n'), ((1374, 1397), 'numpy.random.randint', 'np.random.randint', (['(0)', '(8)'], {... |
import numpy as np
from .. import inf
from ... import blm
from . import learning
from .prior import prior
class model:
def __init__(self, lik, mean, cov, inf='exact'):
self.lik = lik
self.prior = prior(mean=mean, cov=cov)
self.inf = inf
self.num_params = self.lik.num_params + self.... | [
"numpy.copy",
"numpy.random.multivariate_normal",
"numpy.append",
"numpy.zeros",
"numpy.random.permutation"
] | [((569, 604), 'numpy.append', 'np.append', (['lik_params', 'prior_params'], {}), '(lik_params, prior_params)\n', (578, 604), True, 'import numpy as np\n'), ((3818, 3876), 'numpy.random.multivariate_normal', 'np.random.multivariate_normal', (['fmean', '(fcov * alpha ** 2)', 'N'], {}), '(fmean, fcov * alpha ** 2, N)\n', ... |
import numpy as np
import labels as L
import sys
import tensorflow.contrib.keras as keras
import tensorflow as tf
from keras import backend as K
K.set_learning_phase(0)
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from... | [
"labels.LABELS.items",
"pickle.load",
"numpy.asarray",
"numpy.argmax",
"keras.metrics.top_k_categorical_accuracy",
"keras.preprocessing.sequence.pad_sequences",
"keras.backend.set_learning_phase"
] | [((149, 172), 'keras.backend.set_learning_phase', 'K.set_learning_phase', (['(0)'], {}), '(0)\n', (169, 172), True, 'from keras import backend as K\n'), ((2058, 2110), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['sequences'], {'maxlen': 'MAX_SEQUENCE_LENGTH'}), '(sequences, maxlen=MAX_SEQUENCE_LENG... |
# -*- coding: utf-8 -*-
"""
This is the module for normalizing the frequency of membrane potential.
You normalize the frequency of burst firings (1st~6th burst firing) and
plot normalized membrane potential, Ca, and so on.
"""
__author__ = '<NAME>'
__status__ = 'Prepared'
__version__ = '1.0.0'
__date__ = '24 Aug ... | [
"numpy.sqrt",
"anmodel.models.Xmodel",
"numpy.array_split",
"copy.copy",
"sys.path.append",
"numpy.arange",
"numpy.mean",
"numpy.linspace",
"pandas.DataFrame",
"anmodel.models.SANmodel",
"matplotlib.pyplot.savefig",
"pathlib.Path.cwd",
"analysistools.norm_fre_mp.Normalization",
"pickle.loa... | [((549, 571), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (564, 571), False, 'import sys\n'), ((572, 601), 'sys.path.append', 'sys.path.append', (['"""../anmodel"""'], {}), "('../anmodel')\n", (587, 601), False, 'import sys\n'), ((6301, 6329), 'anmodel.analysis.FreqSpike', 'anmodel.analysis.... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@AUTHOR:<NAME>
@CONTACT:<EMAIL>
@HOME_PAGE:joselynzhao.top
@SOFTWERE:PyCharm
@FILE:3.py
@TIME:2020/5/13 20:13
@DES:
'''
#
# num_book = int(input())
# num_reader = int(input())
# requeir_list = []
# for n in range(num_reader):
# info = list(map(int,input().strip().split(... | [
"numpy.array",
"numpy.ones"
] | [((1026, 1048), 'numpy.array', 'np.array', (['requeir_list'], {}), '(requeir_list)\n', (1034, 1048), True, 'import numpy as np\n'), ((1115, 1134), 'numpy.ones', 'np.ones', (['num_reader'], {}), '(num_reader)\n', (1122, 1134), True, 'import numpy as np\n')] |
from unittest import TestCase
import numpy as np
from source.analysis.performance.curve_performance import ROCPerformance, PrecisionRecallPerformance
class TestROCPerformance(TestCase):
def test_properties(self):
true_positive_rates = np.array([1, 2])
false_positive_rates = np.array([3, 4])
... | [
"numpy.array",
"source.analysis.performance.curve_performance.PrecisionRecallPerformance",
"source.analysis.performance.curve_performance.ROCPerformance"
] | [((252, 268), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (260, 268), True, 'import numpy as np\n'), ((300, 316), 'numpy.array', 'np.array', (['[3, 4]'], {}), '([3, 4])\n', (308, 316), True, 'import numpy as np\n'), ((343, 445), 'source.analysis.performance.curve_performance.ROCPerformance', 'ROCPerforma... |
# coding: utf-8
# Copyright 2015 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 req... | [
"numpy.array",
"six.moves.xrange",
"uh_sensor_values.loss",
"tensorflow.app.run",
"tensorflow.Graph",
"numpy.reshape",
"argparse.ArgumentParser",
"tensorflow.placeholder",
"tensorflow.Session",
"glob.glob",
"tensorflow.summary.merge_all",
"uh_sensor_values.inference",
"random.shuffle",
"te... | [((1981, 2011), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float32'}), '([], dtype=np.float32)\n', (1989, 2011), True, 'import numpy as np\n'), ((2039, 2069), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float32'}), '([], dtype=np.float32)\n', (2047, 2069), True, 'import numpy as np\n'), ((4184, 4253), 'ten... |
from __future__ import print_function
import numpy as np
import pandas as pd
import inspect
import os
import time
from . import Model
from . import Utils as U
#------------------------------
#FINDING NEAREST NEIGHBOR
#------------------------------
def mindistance(x,xma,Nx):
distx = 0
mindist = 1000000 * U.P... | [
"numpy.ones",
"inspect.stack",
"numpy.where",
"numpy.zeros",
"os.popen",
"numpy.loadtxt",
"time.time",
"numpy.arange"
] | [((834, 845), 'time.time', 'time.time', ([], {}), '()\n', (843, 845), False, 'import time\n'), ((1781, 1797), 'numpy.zeros', 'np.zeros', (['NTotal'], {}), '(NTotal)\n', (1789, 1797), True, 'import numpy as np\n'), ((1853, 1869), 'numpy.zeros', 'np.zeros', (['NTotal'], {}), '(NTotal)\n', (1861, 1869), True, 'import nump... |
"""
Tests of Tax-Calculator using puf.csv input.
Note that the puf.csv file that is required to run this program has
been constructed by the Tax-Calculator development team by merging
information from the most recent publicly available IRS SOI PUF file
and from the Census CPS file for the corresponding year. If you h... | [
"taxcalc.Records",
"taxcalc.Calculator",
"numpy.allclose",
"pandas.read_csv",
"os.path.join",
"numpy.sum",
"json.load",
"taxcalc.Policy"
] | [((1187, 1195), 'taxcalc.Policy', 'Policy', ([], {}), '()\n', (1193, 1195), False, 'from taxcalc import Policy, Records, Calculator\n'), ((1280, 1308), 'taxcalc.Records', 'Records', ([], {'data': 'puf_fullsample'}), '(data=puf_fullsample)\n', (1287, 1308), False, 'from taxcalc import Policy, Records, Calculator\n'), ((... |
import sys
import traceback
import numpy as np
from shapely import geometry as g
import multiprocessing as mp
from . import abCellSize
from . import abUtils
class abLongBreakWaterLocAlphaAdjust:
def __init__(self, cell, neighbors, coastPolygons, directions, alphas, betas):
self.cell = cell
self.neigh... | [
"numpy.ones",
"numpy.array",
"shapely.geometry.Polygon",
"sys.exc_info",
"multiprocessing.Pool",
"sys.stdout.flush"
] | [((783, 799), 'numpy.array', 'np.array', (['alphas'], {}), '(alphas)\n', (791, 799), True, 'import numpy as np\n'), ((817, 832), 'numpy.array', 'np.array', (['betas'], {}), '(betas)\n', (825, 832), True, 'import numpy as np\n'), ((4959, 4988), 'multiprocessing.Pool', 'mp.Pool', (['self.nParallelWorker'], {}), '(self.nP... |
import gym
import numpy as np
import tensorflow as tf
import time
from actor_critic import RandomActorCritic
from common.multiprocessing_env import SubprocVecEnv
from common.model import NetworkBase, model_play_games
from environment_model.network import EMBuilder
from tqdm import tqdm
class EnvironmentModel(Networ... | [
"environment_model.network.EMBuilder",
"tensorflow.gradients",
"common.model.model_play_games",
"tensorflow.placeholder",
"common.multiprocessing_env.SubprocVecEnv",
"tensorflow.Session",
"numpy.concatenate",
"tensorflow.square",
"tensorflow.ConfigProto",
"tensorflow.summary.scalar",
"tensorflow... | [((3561, 3580), 'common.multiprocessing_env.SubprocVecEnv', 'SubprocVecEnv', (['envs'], {}), '(envs)\n', (3574, 3580), False, 'from common.multiprocessing_env import SubprocVecEnv\n'), ((3837, 3935), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'inter_op_parallelism_threads': 'cpu_cores', 'intra_op_parallelism_thr... |
import sys, csv
import numpy as np
from keras import models
from keras import layers
from keras.utils.np_utils import to_categorical
# import matplotlib.pyplot as plt
# from keras.datasets import boston_housing
Train_Data_List = []
Train_Target_List = []
with open('train.txt', 'r') as f:
reader = csv.DictReader(f... | [
"csv.DictReader",
"keras.models.Sequential",
"numpy.array",
"keras.utils.np_utils.to_categorical",
"keras.layers.Dense"
] | [((1463, 1488), 'numpy.array', 'np.array', (['Train_Data_List'], {}), '(Train_Data_List)\n', (1471, 1488), True, 'import numpy as np\n'), ((1514, 1541), 'numpy.array', 'np.array', (['Train_Target_List'], {}), '(Train_Target_List)\n', (1522, 1541), True, 'import numpy as np\n'), ((1559, 1596), 'keras.utils.np_utils.to_c... |
import numpy as np
import pandas as pd
import math
import math
import matplotlib.pyplot as plt
import networkx as nx
from sklearn.cluster import KMeans as KMeans
from scipy import sparse
from numpy import linalg
# picture has been attached in the mail
df1 = pd.read_csv("./../data/11_twoCirclesData.csv") # rea... | [
"sklearn.cluster.KMeans",
"pandas.read_csv",
"numpy.linalg.norm",
"numpy.argsort",
"numpy.exp",
"numpy.zeros",
"networkx.normalized_laplacian_matrix",
"numpy.vstack",
"matplotlib.pyplot.scatter",
"networkx.from_numpy_matrix",
"matplotlib.pyplot.show"
] | [((263, 309), 'pandas.read_csv', 'pd.read_csv', (['"""./../data/11_twoCirclesData.csv"""'], {}), "('./../data/11_twoCirclesData.csv')\n", (274, 309), True, 'import pandas as pd\n'), ((468, 484), 'numpy.zeros', 'np.zeros', (['(m, m)'], {}), '((m, m))\n', (476, 484), True, 'import numpy as np\n'), ((681, 704), 'networkx.... |
import numpy as np
import matplotlib.pyplot as plt
def QR_fact(A):
"""
I spent 4 hours on this. This still does
not work properly. Ultimately I just cries
and left this as is in remembrance.
"""
if A is None:
raise RuntimeError("A cannot be NoneType")
ncols = A.shape[1]
nrows = A.shape[0]
Q = np.... | [
"numpy.ones",
"numpy.random.random",
"numpy.dot",
"numpy.zeros",
"numpy.linalg.norm"
] | [((317, 334), 'numpy.zeros', 'np.zeros', (['A.shape'], {}), '(A.shape)\n', (325, 334), True, 'import numpy as np\n'), ((340, 364), 'numpy.zeros', 'np.zeros', (['(ncols, ncols)'], {}), '((ncols, ncols))\n', (348, 364), True, 'import numpy as np\n'), ((728, 745), 'numpy.zeros', 'np.zeros', (['A.shape'], {}), '(A.shape)\n... |
# 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 applica... | [
"tensorflow.nn.bidirectional_dynamic_rnn",
"tensorflow.pad",
"tensorflow.shape",
"tensorflow.transpose",
"tensorflow.keras.backend.ctc_label_dense_to_sparse",
"tensorflow.keras.backend.epsilon",
"tensorflow.multiply",
"six.moves.xrange",
"tensorflow.nn.softmax",
"tensorflow.reduce_mean",
"tensor... | [((3526, 3700), 'tensorflow.layers.batch_normalization', 'tf.layers.batch_normalization', ([], {'inputs': 'inputs', 'momentum': 'DeepSpeech2Model.BATCH_NORM_DECAY', 'epsilon': 'DeepSpeech2Model.BATCH_NORM_EPSILON', 'fused': '(True)', 'training': 'training'}), '(inputs=inputs, momentum=DeepSpeech2Model.\n BATCH_NORM_... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.pipeline import Pipeline
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.preprocessing import StandardScaler, Imputer
from wakeful import log_munger, pipelining, preprocessing
def get_feature_impor... | [
"matplotlib.pyplot.grid",
"sklearn.ensemble.ExtraTreesClassifier",
"matplotlib.pyplot.ylabel",
"numpy.argsort",
"matplotlib.pyplot.style.context",
"wakeful.preprocessing.split_X_y",
"seaborn.despine",
"seaborn.color_palette",
"wakeful.log_munger.hdf5_to_df",
"matplotlib.pyplot.barh",
"matplotlib... | [((346, 368), 'sklearn.ensemble.ExtraTreesClassifier', 'ExtraTreesClassifier', ([], {}), '()\n', (366, 368), False, 'from sklearn.ensemble import ExtraTreesClassifier\n'), ((593, 626), 'wakeful.preprocessing.split_X_y', 'preprocessing.split_X_y', (['train_df'], {}), '(train_df)\n', (616, 626), False, 'from wakeful impo... |
import sys # for sys.argv
import numpy # NumPy math library
# Sigmoid function (S-curve), and its derivative
def sigmoid(x, deriv):
if(deriv == True):
return x * (1 - x)
return 1 / (1 + numpy.exp(-x))
# Implementation of a simple neural network with configurable input size, output size, number of lay... | [
"numpy.random.random",
"numpy.exp",
"numpy.array",
"numpy.dot",
"numpy.random.seed"
] | [((3244, 3301), 'numpy.array', 'numpy.array', (['[[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]]'], {}), '([[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])\n', (3255, 3301), False, 'import numpy\n'), ((3462, 3495), 'numpy.array', 'numpy.array', (['[[0], [1], [1], [0]]'], {}), '([[0], [1], [1], [0]])\n', (3473, 3495), False, ... |
import logging
import numpy as np
from plunc.exceptions import InsufficientPrecisionError, OutsideDomainError
class WaryInterpolator(object):
"""Interpolate (and optionally extrapolation) between points,
raising exception if error larger than desired precision
"""
def __init__(self,
... | [
"logging.getLogger",
"plunc.exceptions.InsufficientPrecisionError",
"numpy.log10",
"numpy.searchsorted",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.argsort",
"numpy.array",
"numpy.concatenate",
"numpy.min",
"numpy.nonzero",
"numpy.logspace"
] | [((1013, 1050), 'logging.getLogger', 'logging.getLogger', (['"""WaryInterpolator"""'], {}), "('WaryInterpolator')\n", (1030, 1050), False, 'import logging\n'), ((1074, 1090), 'numpy.array', 'np.array', (['points'], {}), '(points)\n', (1082, 1090), True, 'import numpy as np\n'), ((1113, 1129), 'numpy.array', 'np.array',... |
#!/usr/bin/env python3
import numpy as np
import tensorflow as tf
import cart_pole_evaluator
class Network:
def __init__(self, env, args):
inputs = tf.keras.layers.Input(shape=env.state_shape)
for i in range(args.hidden_layers):
if i == 0:
x_common = tf.keras.layers.D... | [
"tensorflow.keras.layers.Input",
"tensorflow.config.threading.set_intra_op_parallelism_threads",
"tensorflow.random.set_seed",
"argparse.ArgumentParser",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"numpy.argmax",
"tensorflow.keras.optimizers.Ad... | [((3147, 3172), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3170, 3172), False, 'import argparse\n'), ((4101, 4119), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (4115, 4119), True, 'import numpy as np\n'), ((4124, 4146), 'tensorflow.random.set_seed', 'tf.random.set_seed... |
import logging
import numpy as np
logger = logging.getLogger("FederatedAveraging")
class DefaultFederatedAveraging:
def __init__(self, buflength=5):
self.buflength = buflength
def __call__(self, metadata, weights, weight_buffer):
logger.debug("Federated avg: call with buffer length %s", len... | [
"logging.getLogger",
"numpy.array"
] | [((45, 84), 'logging.getLogger', 'logging.getLogger', (['"""FederatedAveraging"""'], {}), "('FederatedAveraging')\n", (62, 84), False, 'import logging\n'), ((651, 662), 'numpy.array', 'np.array', (['w'], {}), '(w)\n', (659, 662), True, 'import numpy as np\n'), ((1043, 1054), 'numpy.array', 'np.array', (['w'], {}), '(w)... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 01 15:21:46 2018
@author: <NAME>, <NAME>
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from os import path, remove
import sys
import numpy as np
import h5py
from sidpy.sid import Translator
from sidpy.hdf.hdf_utils import write_s... | [
"pyUSID.io.write_utils.Dimension",
"os.path.exists",
"gwyfile.load",
"sidpy.hdf.hdf_utils.write_simple_attrs",
"os.path.join",
"h5py.File",
"os.path.split",
"os.remove",
"numpy.linspace",
"os.path.abspath",
"pyUSID.io.hdf_utils.create_indexed_group",
"pyUSID.io.hdf_utils.write_main_dataset"
] | [((1578, 1601), 'os.path.abspath', 'path.abspath', (['file_path'], {}), '(file_path)\n', (1590, 1601), False, 'from os import path, remove\n'), ((1635, 1656), 'os.path.split', 'path.split', (['file_path'], {}), '(file_path)\n', (1645, 1656), False, 'from os import path, remove\n'), ((1710, 1751), 'os.path.join', 'path.... |
#!/usr/bin/env python
from time import time
import rospy
import mavros
import numpy as np
import matplotlib.pyplot as plt
from geometry_msgs.msg import PoseStamped, TwistStamped
import mavros_msgs.msg
class dieptran():
def __init__(self):
rospy.init_node('listener_results', anonymous=True)
self.ra... | [
"mavros.get_topic",
"matplotlib.pyplot.ylabel",
"rospy.is_shutdown",
"rospy.init_node",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"mavros.set_namespace",
"numpy.append",
"rospy.Rate",
"rospy.spin",
"time.time",
"rospy.loginfo",
"matplotlib.pyplot.legend"
] | [((253, 304), 'rospy.init_node', 'rospy.init_node', (['"""listener_results"""'], {'anonymous': '(True)'}), "('listener_results', anonymous=True)\n", (268, 304), False, 'import rospy\n'), ((325, 341), 'rospy.Rate', 'rospy.Rate', (['(20.0)'], {}), '(20.0)\n', (335, 341), False, 'import rospy\n'), ((375, 405), 'mavros.set... |
#!/usr/bin/python
import numpy as np
class GC:
'Gamma Correction'
def __init__(self, img, lut, mode):
self.img = img
self.lut = lut
self.mode = mode
def execute(self):
img_h = self.img.shape[0]
img_w = self.img.shape[1]
img_c = self.img.shape[2]
gc_... | [
"numpy.empty"
] | [((326, 368), 'numpy.empty', 'np.empty', (['(img_h, img_w, img_c)', 'np.uint16'], {}), '((img_h, img_w, img_c), np.uint16)\n', (334, 368), True, 'import numpy as np\n')] |
from __future__ import print_function, absolute_import
import posixpath
import pickle
import numpy as np
import numpy.testing as npt
from utils import *
def test_bytes(hdfs, request):
testname = request.node.name
fname = posixpath.join(TEST_DIR, testname)
data = b'a' * 10 * 2**20
data += b'b' * 10... | [
"numpy.random.normal",
"posixpath.join",
"numpy.testing.assert_equal",
"pickle.dumps",
"pickle.loads"
] | [((234, 268), 'posixpath.join', 'posixpath.join', (['TEST_DIR', 'testname'], {}), '(TEST_DIR, testname)\n', (248, 268), False, 'import posixpath\n'), ((650, 684), 'posixpath.join', 'posixpath.join', (['TEST_DIR', 'testname'], {}), '(TEST_DIR, testname)\n', (664, 684), False, 'import posixpath\n'), ((696, 736), 'numpy.r... |
# adapted from yolor/test.py
import argparse
import glob
import json
import os
from pathlib import Path
import numpy as np
import torch
import yaml
from tqdm import tqdm
from yolor.utils.google_utils import attempt_load
from yolor.utils.datasets import create_dataloader
from yolor.utils.general import coco80_to_coco9... | [
"yolor.utils.general.scale_coords",
"yolor.utils.general.coco80_to_coco91_class",
"yolor.utils.general.check_file",
"yolor.utils.general.set_logging",
"yaml.load",
"objseeker.defense.YOLO_wrapper",
"yolor.utils.general.check_img_size",
"os.path.exists",
"argparse.ArgumentParser",
"pathlib.Path",
... | [((1713, 1721), 'pathlib.Path', 'Path', (['""""""'], {}), "('')\n", (1717, 1721), False, 'from pathlib import Path\n'), ((3492, 3511), 'yolor.utils.general.check_dataset', 'check_dataset', (['data'], {}), '(data)\n', (3505, 3511), False, 'from yolor.utils.general import coco80_to_coco91_class, check_dataset, check_file... |
"""
============================
Typing (:mod:`numpy.typing`)
============================
.. warning::
Some of the types in this module rely on features only present in
the standard library in Python 3.8 and greater. If you want to use
these types in earlier versions of Python, you should install the
typing-... | [
"numpy._pytesttester.PytestTester"
] | [((5781, 5803), 'numpy._pytesttester.PytestTester', 'PytestTester', (['__name__'], {}), '(__name__)\n', (5793, 5803), False, 'from numpy._pytesttester import PytestTester\n')] |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 12:58:13 2016
@author: benny
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (
assert_, TestCase, run_module_suite, assert_array_almost_equal,
assert_raises, assert_allclose, assert_array_equa... | [
"numpy.allclose",
"numpy.sqrt",
"scikits.odes.ode",
"numpy.array",
"numpy.zeros",
"numpy.dot",
"numpy.cos",
"numpy.sin"
] | [((682, 709), 'numpy.array', 'np.array', (['[1.0, 0.1]', 'float'], {}), '([1.0, 0.1], float)\n', (690, 709), True, 'import numpy as np\n'), ((810, 833), 'numpy.zeros', 'np.zeros', (['(2, 2)', 'float'], {}), '((2, 2), float)\n', (818, 833), True, 'import numpy as np\n'), ((975, 999), 'numpy.sqrt', 'np.sqrt', (['(self.k ... |
"""
Code inspired from: https://github.com/jchibane/if-net/blob/master/data_processing/voxelized_pointcloud_sampling.py
"""
import utils.implicit_waterproofing as iw
from scipy.spatial import cKDTree as KDTree
import numpy as np
import trimesh
import glob
import os
from os.path import join, split, exists
import argpar... | [
"os.path.exists",
"argparse.ArgumentParser",
"utils.voxelized_pointcloud_sampling.voxelize",
"os.path.split",
"trimesh.load",
"opendr.renderer.DepthRenderer",
"numpy.array",
"numpy.zeros",
"numpy.min"
] | [((805, 880), 'opendr.renderer.DepthRenderer', 'DepthRenderer', ([], {'camera': 'camera', 'frustum': 'frustum', 'f': 'mesh.faces', 'overdraw': '(False)'}), '(camera=camera, frustum=frustum, f=mesh.faces, overdraw=False)\n', (818, 880), False, 'from opendr.renderer import DepthRenderer\n'), ((1520, 1543), 'trimesh.load'... |
import numpy
import cupy
from cupy import elementwise
def arange(start, stop=None, step=1, dtype=None):
"""Rerurns an array with evenly spaced values within a given interval.
Values are generated within the half-open interval [start, stop). The first
three arguments are mapped like the ``range`` built-i... | [
"numpy.dtype",
"cupy.empty",
"numpy.ceil",
"cupy.elementwise.create_ufunc"
] | [((2940, 3130), 'cupy.elementwise.create_ufunc', 'elementwise.create_ufunc', (['"""cupy_arange"""', "('bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',\n 'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d')", '"""out0 = in0 + i * in1"""'], {}), "('cupy_arange', ('bb->b', 'BB->B', 'hh->h', 'HH->H',\n ... |
# CPLEX model for the choice-based facility location
# and pricing problem with discrete prices (compact formulation)
# Alternatives are duplicated to account for different possible price levels.
# General
import time
import numpy as np
# CPLEX
import cplex
from cplex.exceptions import CplexSolverError
#... | [
"data_N08_I10.printCustomers",
"data_N08_I10.getData",
"cplex.Cplex",
"numpy.empty",
"data_N08_I10.preprocessUtilities",
"functions.calcDuplicatedUtilities",
"functions.discretePriceAlternativeDuplication",
"time.time"
] | [((493, 504), 'time.time', 'time.time', ([], {}), '()\n', (502, 504), False, 'import time\n'), ((518, 531), 'cplex.Cplex', 'cplex.Cplex', ([], {}), '()\n', (529, 531), False, 'import cplex\n'), ((9536, 9549), 'cplex.Cplex', 'cplex.Cplex', ([], {}), '()\n', (9547, 9549), False, 'import cplex\n'), ((15631, 15644), 'cplex... |
"""
This is an example of the application of DeepESN model for multivariate time-series prediction task
on Piano-midi.de (see http://www-etud.iro.umontreal.ca/~boulanni/icml2012) dataset.
The dataset is a polyphonic music task characterized by 88-dimensional sequences representing musical compositions.
Starting from p... | [
"numpy.mean",
"pathlib.Path",
"time.perf_counter",
"utils.select_indexes",
"numpy.random.seed",
"DeepESN.DeepESN",
"utils.load_pianomidi"
] | [((1454, 1473), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1471, 1473), False, 'import time\n'), ((1535, 1552), 'numpy.random.seed', 'np.random.seed', (['(7)'], {}), '(7)\n', (1549, 1552), True, 'import numpy as np\n'), ((1588, 1600), 'pathlib.Path', 'Path', (['"""data"""'], {}), "('data')\n", (1592, ... |
import numpy as np
import pandas as pd
import util
from othello import Othello
from constants import COLUMN_NAMES
class StartTables:
_start_tables = []
def _init_start_tables(self):
"""
read start tables from csv file 'start_moves.csv'
and store them in _start_tables
"""
... | [
"util.translate_move_to_pair",
"numpy.array",
"pandas.read_csv"
] | [((329, 359), 'pandas.read_csv', 'pd.read_csv', (['"""start_moves.csv"""'], {}), "('start_moves.csv')\n", (340, 359), True, 'import pandas as pd\n'), ((389, 415), 'numpy.array', 'np.array', (['csv'], {'dtype': '"""str"""'}), "(csv, dtype='str')\n", (397, 415), True, 'import numpy as np\n'), ((4459, 4492), 'util.transla... |
# coding=utf-8
import numpy as np
import pytest
from matplotlib import pyplot as plt
from ..algorithms import density_profiles
from ..classes import Species, Simulation
from pythonpic.classes import PeriodicTestGrid
from pythonpic.classes import TestSpecies as Species
from ..visualization.time_snapshots import Spatial... | [
"numpy.allclose",
"pythonpic.classes.TestSpecies",
"pytest.mark.parametrize",
"numpy.linspace",
"numpy.random.seed",
"matplotlib.pyplot.subplots",
"pytest.fixture",
"pythonpic.classes.PeriodicTestGrid",
"matplotlib.pyplot.show"
] | [((815, 831), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (829, 831), False, 'import pytest\n'), ((1358, 1397), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""std"""', '[1e-05]'], {}), "('std', [1e-05])\n", (1381, 1397), False, 'import pytest\n'), ((919, 948), 'pythonpic.classes.PeriodicTestGrid'... |
import numpy as np
import torch
import torch.nn as nn
from PIL import Image
from loader.dataloader import ColorSpace2RGB
from torchvision import transforms
from torchvision.transforms.functional import InterpolationMode as IM
# Only for inference
class plt2pix(object):
def __init__(self, args):
... | [
"network.Generator",
"torchvision.transforms.Resize",
"torch.nn.DataParallel",
"torch.cuda.device_count",
"loader.dataloader.ColorSpace2RGB",
"numpy.zeros",
"torch.cuda.is_available",
"network.ColorPredictor",
"torchvision.transforms.ToTensor",
"torch.FloatTensor",
"torch.device"
] | [((622, 654), 'loader.dataloader.ColorSpace2RGB', 'ColorSpace2RGB', (['args.color_space'], {}), '(args.color_space)\n', (636, 654), False, 'from loader.dataloader import ColorSpace2RGB\n'), ((1259, 1373), 'network.Generator', 'Generator', ([], {'input_size': 'args.input_size', 'layers': 'args.layers', 'palette_num': 's... |
import numpy as np
import random
import copy
from collections import namedtuple, deque
from models import Actor, Critic
from noise import NoiseReducer
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e5) # replay buffer size
WEIGHT_DECAY = 0 # L2 weight decay
device... | [
"numpy.clip",
"models.Critic",
"random.sample",
"torch.nn.functional.mse_loss",
"noise.NoiseReducer",
"collections.deque",
"collections.namedtuple",
"random.seed",
"torch.from_numpy",
"torch.cuda.is_available",
"models.Actor",
"numpy.vstack",
"torch.no_grad"
] | [((348, 373), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (371, 373), False, 'import torch\n'), ((959, 976), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (970, 976), False, 'import random\n'), ((2583, 2641), 'noise.NoiseReducer', 'NoiseReducer', (['factor_reduction', 'min_factor... |
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
x = pd.period_range(pd.datetime.now(), periods=200, freq='d')
x = x.to_timestamp().to_pydatetime()
# 產生三組,每組 200 個隨機常態分布元素
y = np.random.randn(200, 3).cumsum(0)
plt.plot(x, y)
plt.show()
# Matplotlib 使用點 point 而非 pixel 為圖... | [
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"numpy.polyfit",
"matplotlib.pyplot.figtext",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.random.normal",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.title",
"numpy.... | [((259, 273), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (267, 273), True, 'import matplotlib.pyplot as plt\n'), ((274, 284), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (282, 284), True, 'import matplotlib.pyplot as plt\n'), ((574, 588), 'matplotlib.pyplot.plot', 'plt.plot', (['x',... |
from transformers import (AutoModelForTokenClassification,
AutoModelForSequenceClassification,
TrainingArguments,
AutoTokenizer,
AutoConfig,
Trainer)
from biobert_ner.utils_ner import (con... | [
"logging.getLogger",
"biobert_ner.utils_ner.NerTestDataset",
"utils.display_knowledge_graph",
"transformers.TrainingArguments",
"torch.nn.CrossEntropyLoss",
"os.path.join",
"numpy.argmax",
"utils.get_long_relation_table",
"ehr.HealthRecord",
"annotations.Entity",
"utils.get_relation_table",
"b... | [((831, 858), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (848, 858), False, 'import logging\n'), ((1201, 1245), 'logging.getLogger', 'logging.getLogger', (['"""matplotlib.font_manager"""'], {}), "('matplotlib.font_manager')\n", (1218, 1245), False, 'import logging\n'), ((1470, 1514), ... |
import os
os.environ['basedir_a'] = '/gpfs/home/cj3272/tmp/'
os.environ["CUDA_VISIBLE_DEVICES"] = '0'
import keras
import PIL
import numpy as np
import scipy
# set tf backend to allow memory to grow, instead of claiming everything
import tensorflow as tf
def get_session():
config = tf.ConfigProto()
config.... | [
"PIL.Image.fromarray",
"keras.models.load_model",
"pathlib.Path",
"tensorflow.Session",
"luccauchon.data.Generators.AmateurDataFrameDataGenerator",
"luccauchon.data.C.generate_X_y_raw_from_amateur_dataset",
"luccauchon.data.Generators.amateur_test",
"numpy.expand_dims",
"tensorflow.ConfigProto"
] | [((292, 308), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (306, 308), True, 'import tensorflow as tf\n'), ((363, 388), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (373, 388), True, 'import tensorflow as tf\n'), ((1249, 1420), 'luccauchon.data.C.generate_X_y_raw... |
from lightgbm import LGBMClassifier
from sklearn.model_selection import RandomizedSearchCV, PredefinedSplit
from sklearn import metrics
import pandas as pd
from data import get_data
import numpy as np
import pickle
import hydra
@hydra.main(config_path="config", config_name="config")
def random_forest(cfg):
# Load... | [
"sklearn.metrics.f1_score",
"sklearn.model_selection.PredefinedSplit",
"pickle.dump",
"hydra.main",
"data.get_data",
"lightgbm.LGBMClassifier",
"sklearn.metrics.roc_auc_score",
"pandas.concat",
"numpy.arange",
"sklearn.model_selection.RandomizedSearchCV"
] | [((231, 285), 'hydra.main', 'hydra.main', ([], {'config_path': '"""config"""', 'config_name': '"""config"""'}), "(config_path='config', config_name='config')\n", (241, 285), False, 'import hydra\n'), ((360, 373), 'data.get_data', 'get_data', (['cfg'], {}), '(cfg)\n', (368, 373), False, 'from data import get_data\n'), (... |
import pprint
import re
from typing import Any, Dict
import numpy as np
import pytest
from qcelemental.molutil import compute_scramble
from qcengine.programs.tests.standard_suite_contracts import (
contractual_accsd_prt_pr,
contractual_ccd,
contractual_ccsd,
contractual_ccsd_prt_pr,
contractual_ccs... | [
"qcengine.programs.util.mill_qcvars",
"qcdb.Molecule.from_schema",
"numpy.printoptions",
"pytest.raises",
"pprint.PrettyPrinter",
"qcengine.programs.tests.standard_suite_contracts.query_qcvar",
"qcengine.programs.tests.standard_suite_contracts.query_has_qcvar",
"pytest.skip",
"pytest.xfail",
"qcdb... | [((1056, 1087), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'width': '(120)'}), '(width=120)\n', (1076, 1087), False, 'import pprint\n'), ((6921, 6980), 'qcdb.set_options', 'qcdb.set_options', (["{'e_convergence': 10, 'd_convergence': 9}"], {}), "({'e_convergence': 10, 'd_convergence': 9})\n", (6937, 6980), F... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 6 09:44:54 2019
@author: thomas
"""
import numpy as np
import matplotlib.pyplot as plt
plt.close('all')
def graycode(M):
if (M==1):
g=['0','1']
elif (M>1):
gs=graycode(M-1)
gsr=gs[::-1]
gs0=['0'+x for x in... | [
"matplotlib.pyplot.text",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.max",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.stem",
"matplotlib.pyplot.tight_layout",
"numpy.min",
"matplotlib.pyplot.ylim",
"numpy.log2",
... | [((160, 176), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (169, 176), True, 'import matplotlib.pyplot as plt\n'), ((527, 542), 'numpy.arange', 'np.arange', (['(0)', 'M'], {}), '(0, M)\n', (536, 542), True, 'import numpy as np\n'), ((691, 703), 'matplotlib.pyplot.figure', 'plt.figure', ([],... |
import torch
import unittest
from qtorch.quant import *
from qtorch import FixedPoint, BlockFloatingPoint, FloatingPoint
DEBUG = False
log = lambda m: print(m) if DEBUG else False
class TestStochastic(unittest.TestCase):
"""
invariant: quantized numbers cannot be greater than the maximum representable number... | [
"unittest.main",
"torch.Tensor",
"torch.linspace",
"numpy.arange"
] | [((3957, 3972), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3970, 3972), False, 'import unittest\n'), ((697, 739), 'torch.linspace', 'torch.linspace', (['(-2)', '(2)'], {'steps': '(100)', 'device': 'd'}), '(-2, 2, steps=100, device=d)\n', (711, 739), False, 'import torch\n'), ((973, 1015), 'torch.linspace', 't... |
import numpy as np
import random
import copy
class Environment():
def __init__(self, agents, n_players=4, tiles_per_player=7):
self.tiles_per_player = tiles_per_player
self.hand_sizes = []
self.n_players = n_players
self.agents = agents
self.pile = generate_tiles()
for agent in agents:
for i in range... | [
"random.shuffle",
"numpy.random.random",
"numpy.argmax",
"numpy.random.randint",
"numpy.expand_dims",
"copy.copy"
] | [((8798, 8819), 'random.shuffle', 'random.shuffle', (['tiles'], {}), '(tiles)\n', (8812, 8819), False, 'import random\n'), ((4260, 4290), 'numpy.expand_dims', 'np.expand_dims', (['self.frames', '(0)'], {}), '(self.frames, 0)\n', (4274, 4290), True, 'import numpy as np\n'), ((8518, 8530), 'numpy.argmax', 'np.argmax', ([... |
import os
from pyBigstick.nucleus import Nucleus
import streamlit as st
import numpy as np
import plotly.express as px
from barChartPlotly import plotly_barcharts_3d
from PIL import Image
he4_image = Image.open('assets/he4.png')
nucl_image = Image.open('assets/nucl_symbol.png')
table_image = Image.open('assets/table.... | [
"streamlit.image",
"streamlit.table",
"streamlit.button",
"numpy.arange",
"streamlit.title",
"streamlit.columns",
"streamlit.markdown",
"streamlit.write",
"streamlit.text",
"barChartPlotly.plotly_barcharts_3d",
"streamlit.subheader",
"streamlit.selectbox",
"streamlit.container",
"streamlit... | [((202, 230), 'PIL.Image.open', 'Image.open', (['"""assets/he4.png"""'], {}), "('assets/he4.png')\n", (212, 230), False, 'from PIL import Image\n'), ((244, 280), 'PIL.Image.open', 'Image.open', (['"""assets/nucl_symbol.png"""'], {}), "('assets/nucl_symbol.png')\n", (254, 280), False, 'from PIL import Image\n'), ((295, ... |
import numpy as np
import matplotlib.pyplot as plt
theta = np.arange(0.01, 10., 0.04)
ytan = np.tan(theta)
ytanM = np.ma.masked_where(np.abs(ytan)>20., ytan)
plt.figure()
plt.plot(theta, ytanM)
plt.ylim(-8, 8)
plt.axhline(color="gray", zorder=-1)
plt.savefig('plotLimits3.pdf')
plt.show() | [
"numpy.abs",
"matplotlib.pyplot.savefig",
"numpy.tan",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylim",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((60, 87), 'numpy.arange', 'np.arange', (['(0.01)', '(10.0)', '(0.04)'], {}), '(0.01, 10.0, 0.04)\n', (69, 87), True, 'import numpy as np\n'), ((94, 107), 'numpy.tan', 'np.tan', (['theta'], {}), '(theta)\n', (100, 107), True, 'import numpy as np\n'), ((160, 172), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()... |
# -*- coding: utf-8 -*-
import logging
import numpy as np
class phandim(object):
"""
class to hold phantom dimensions
"""
def __init__(self, bx, by, bz):
"""
Constructor. Builds object from boundary vectors
Parameters
----------
bx: array of f... | [
"numpy.sort",
"logging.info",
"numpy.float32"
] | [((1354, 1389), 'logging.info', 'logging.info', (['"""phandim initialized"""'], {}), "('phandim initialized')\n", (1366, 1389), False, 'import logging\n'), ((2006, 2018), 'numpy.sort', 'np.sort', (['bnp'], {}), '(bnp)\n', (2013, 2018), True, 'import numpy as np\n'), ((1920, 1936), 'numpy.float32', 'np.float32', (['b[k]... |
import sys
import numpy as np
import argparse
from mung.data import DataSet, Partition
PART_NAMES = ["train", "dev", "test"]
parser = argparse.ArgumentParser()
parser.add_argument('data_dir', action="store")
parser.add_argument('split_output_file', action="store")
parser.add_argument('train_size', action="s... | [
"mung.data.DataSet.load",
"mung.data.Partition.load",
"numpy.random.seed",
"argparse.ArgumentParser"
] | [((143, 168), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (166, 168), False, 'import argparse\n'), ((686, 711), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (700, 711), True, 'import numpy as np\n'), ((983, 1022), 'mung.data.DataSet.load', 'DataSet.load', (['d... |
import tensorflow as tf
import numpy as np
ds = tf.contrib.distributions
def decode(z, observable_space_dims):
with tf.variable_scope('Decoder', [z]):
logits = tf.layers.dense(z, 200, activation=tf.nn.tanh)
logits = tf.layers.dense(logits, np.prod(observable_space_dims))
p_x_given_z = ds.Ber... | [
"tensorflow.layers.dense",
"tensorflow.variable_scope",
"numpy.prod"
] | [((123, 156), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""Decoder"""', '[z]'], {}), "('Decoder', [z])\n", (140, 156), True, 'import tensorflow as tf\n'), ((175, 221), 'tensorflow.layers.dense', 'tf.layers.dense', (['z', '(200)'], {'activation': 'tf.nn.tanh'}), '(z, 200, activation=tf.nn.tanh)\n', (190, 221)... |
import gym
from gym import spaces
import cv2
import pygame
import copy
import numpy as np
from overcooked_ai_py.mdp.overcooked_env import OvercookedEnv as OriginalEnv
from overcooked_ai_py.mdp.overcooked_mdp import OvercookedGridworld
from overcooked_ai_py.visualization.state_visualizer import StateVisualizer
from ov... | [
"pygame.surfarray.array3d",
"cv2.resize",
"gym.spaces.Discrete",
"numpy.array",
"overcooked_ai_py.mdp.overcooked_env.OvercookedEnv.from_mdp",
"cv2.cvtColor",
"copy.deepcopy",
"numpy.rot90",
"overcooked_ai_py.visualization.state_visualizer.StateVisualizer.default_hud_data",
"overcooked_ai_py.visual... | [((844, 890), 'overcooked_ai_py.mdp.overcooked_mdp.OvercookedGridworld.from_layout_name', 'OvercookedGridworld.from_layout_name', (['scenario'], {}), '(scenario)\n', (880, 890), False, 'from overcooked_ai_py.mdp.overcooked_mdp import OvercookedGridworld\n'), ((917, 971), 'overcooked_ai_py.mdp.overcooked_env.OvercookedE... |
print('Gathering psychic powers...')
import re
import numpy as np
from gensim.models.keyedvectors import KeyedVectors
word_vectors = KeyedVectors.load_word2vec_format('GoogleNews-vectors-negative300.bin.gz', binary=True, limit=200000)
# word_vectors.save('wvsubset')
# word_vectors = KeyedVectors.load("wvsubset... | [
"re.split",
"nltk.pos_tag",
"gensim.models.keyedvectors.KeyedVectors.load_word2vec_format",
"nltk.stem.WordNetLemmatizer",
"numpy.argsort",
"numpy.array",
"numpy.dot",
"nltk.tokenize.RegexpTokenizer",
"numpy.load",
"numpy.save"
] | [((139, 244), 'gensim.models.keyedvectors.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word2vec_format', (['"""GoogleNews-vectors-negative300.bin.gz"""'], {'binary': '(True)', 'limit': '(200000)'}), "('GoogleNews-vectors-negative300.bin.gz',\n binary=True, limit=200000)\n", (172, 244), False, 'from gensim.... |
from math import sin, pi
import random
import numpy as np
from scipy.stats import norm
def black_box_projectile(theta, v0=10, g=9.81):
assert theta >= 0
assert theta <= 90
return (v0 ** 2) * sin(2 * pi * theta / 180) / g
def random_shooting(n=1, min_a=0, max_a=90):
assert min_a <= max_a
return [r... | [
"numpy.clip",
"numpy.mean",
"random.uniform",
"scipy.stats.norm.rvs",
"scipy.stats.norm.fit",
"numpy.array",
"numpy.argsort",
"numpy.std",
"math.sin",
"numpy.round"
] | [((419, 436), 'numpy.array', 'np.array', (['actions'], {}), '(actions)\n', (427, 436), True, 'import numpy as np\n'), ((319, 347), 'random.uniform', 'random.uniform', (['min_a', 'max_a'], {}), '(min_a, max_a)\n', (333, 347), False, 'import random\n'), ((2290, 2310), 'scipy.stats.norm.fit', 'norm.fit', (['elite_acts'], ... |
#!/usr/bin/env python
# Needed to set seed for random generators for making reproducible experiments
from numpy.random import seed
seed(1)
from tensorflow import set_random_seed
set_random_seed(1)
import numpy as np
import tifffile as tiff
import os
import random
import shutil
from PIL import Image
from ..utils impor... | [
"numpy.mean",
"numpy.all",
"os.listdir",
"tifffile.imread",
"random.shuffle",
"os.makedirs",
"shutil.move",
"PIL.Image.open",
"numpy.shape",
"numpy.size",
"random.seed",
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"shutil.rmtree",
"numpy.pad",
"tensorflow.set_random_seed",
"... | [((132, 139), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (136, 139), False, 'from numpy.random import seed\n'), ((179, 197), 'tensorflow.set_random_seed', 'set_random_seed', (['(1)'], {}), '(1)\n', (194, 197), False, 'from tensorflow import set_random_seed\n'), ((1500, 1554), 'numpy.zeros', 'np.zeros', (['(im... |
import os
import json
import numpy as np
from SoccerNet.Downloader import getListGames
from config.classes import EVENT_DICTIONARY_V2, INVERSE_EVENT_DICTIONARY_V2
def label2vector(folder_path, num_classes=17, framerate=2):
label_path = folder_path + "/Labels-v2.json"
# Load labels
labels = json.load(open... | [
"os.makedirs",
"numpy.where",
"SoccerNet.Downloader.getListGames",
"numpy.zeros",
"json.dump"
] | [((388, 424), 'numpy.zeros', 'np.zeros', (['(vector_size, num_classes)'], {}), '((vector_size, num_classes))\n', (396, 424), True, 'import numpy as np\n'), ((443, 479), 'numpy.zeros', 'np.zeros', (['(vector_size, num_classes)'], {}), '((vector_size, num_classes))\n', (451, 479), True, 'import numpy as np\n'), ((1386, 1... |
import csv
import numpy as np
def cargar_datos(nombre_archivo):
datos_entrenamiento = []
nombres_entrenamiento = []
with open(nombre_archivo, newline='') as csvfile:
for fila in csv.reader(csvfile):
datos_entrenamiento.append(list(map(lambda x: float(x), fila[:-1])))
nombre... | [
"numpy.array",
"csv.reader"
] | [((200, 219), 'csv.reader', 'csv.reader', (['csvfile'], {}), '(csvfile)\n', (210, 219), False, 'import csv\n'), ((372, 401), 'numpy.array', 'np.array', (['datos_entrenamiento'], {}), '(datos_entrenamiento)\n', (380, 401), True, 'import numpy as np\n'), ((403, 434), 'numpy.array', 'np.array', (['nombres_entrenamiento'],... |
'''
Examples using Sense HAT animations: circle, triangle, line, and square functions.
By <NAME>, 5/15/2017
'''
from sense_hat import SenseHat
import time
import numpy as np
import time
import ect
from random import randint
import sys
sense = SenseHat()
w = [150, 150, 150]
b = [0, 0, 255]
e = [0, 0, 0]
# create... | [
"sense_hat.SenseHat",
"ect.circle",
"ect.square",
"numpy.array",
"ect.triangle",
"ect.clear",
"ect.cell",
"random.randint"
] | [((248, 258), 'sense_hat.SenseHat', 'SenseHat', ([], {}), '()\n', (256, 258), False, 'from sense_hat import SenseHat\n'), ((342, 552), 'numpy.array', 'np.array', (['[e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e,\n e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e, e,\n ... |
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 5 17:05:49 2017
@author: thuzhang
"""
import numpy as np
import pandas as pd
File='DataBase/DataBaseNECA.csv'
OriginData=pd.read_table(File,sep=",")
for i in range(0,int(len(OriginData)/24)):
_DailyData=OriginData["SYSLoad"][24*i:24*i+24]
_DryData=OriginData["Dr... | [
"numpy.where",
"numpy.mean",
"pandas.read_table",
"numpy.max"
] | [((171, 199), 'pandas.read_table', 'pd.read_table', (['File'], {'sep': '""","""'}), "(File, sep=',')\n", (184, 199), True, 'import pandas as pd\n'), ((409, 427), 'numpy.max', 'np.max', (['_DailyData'], {}), '(_DailyData)\n', (415, 427), True, 'import numpy as np\n'), ((507, 524), 'numpy.mean', 'np.mean', (['_DryData'],... |
import numpy as np
from scipy import signal, ndimage
from hexrd import convolution
def fast_snip1d(y, w=4, numiter=2):
"""
"""
bkg = np.zeros_like(y)
zfull = np.log(np.log(np.sqrt(y + 1.) + 1.) + 1.)
for k, z in enumerate(zfull):
b = z
for i in range(numiter):
for p in... | [
"numpy.sqrt",
"numpy.minimum",
"scipy.signal.fft",
"numpy.log",
"hexrd.convolution.convolve",
"scipy.ndimage.convolve",
"numpy.indices",
"numpy.exp",
"numpy.zeros",
"numpy.isnan",
"numpy.hypot",
"numpy.all",
"numpy.zeros_like"
] | [((148, 164), 'numpy.zeros_like', 'np.zeros_like', (['y'], {}), '(y)\n', (161, 164), True, 'import numpy as np\n'), ((887, 907), 'numpy.zeros_like', 'np.zeros_like', (['zfull'], {}), '(zfull)\n', (900, 907), True, 'import numpy as np\n'), ((1533, 1546), 'numpy.isnan', 'np.isnan', (['bkg'], {}), '(bkg)\n', (1541, 1546),... |
import pandas as pd
import numpy as np
import seaborn as sb
import base64
from io import BytesIO
from flask import send_file
from flask import request
from napa import player_information as pi
import matplotlib
matplotlib.use('Agg') # required to solve multithreading issues with matplotlib within flask
import matplotli... | [
"pandas.read_sql_query",
"matplotlib.pyplot.savefig",
"seaborn.despine",
"pandas.DataFrame",
"matplotlib.use",
"napa.player_information.create_rand_team",
"napa.player_information.create_two_rand_teams",
"seaborn.set_context",
"io.BytesIO",
"numpy.floor",
"napa.player_information.team_data",
"... | [((211, 232), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (225, 232), False, 'import matplotlib\n'), ((369, 405), 'seaborn.set_context', 'sb.set_context', (['"""talk"""'], {'font_scale': '(1)'}), "('talk', font_scale=1)\n", (383, 405), True, 'import seaborn as sb\n'), ((408, 438), 'matplotlib.... |
import numpy as np
from torch.utils.data import Dataset
import sys
import torch
from ppo_and_friends.utils.mpi_utils import rank_print
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
num_procs = comm.Get_size()
class EpisodeInfo(object):
def __init__(self,
starting_... | [
"numpy.clip",
"torch.transpose",
"numpy.array",
"torch.tensor",
"numpy.zeros",
"numpy.empty",
"numpy.concatenate",
"ppo_and_friends.utils.mpi_utils.rank_print"
] | [((5083, 5094), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (5091, 5094), True, 'import numpy as np\n'), ((5134, 5145), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (5142, 5145), True, 'import numpy as np\n'), ((5185, 5196), 'numpy.empty', 'np.empty', (['(0)'], {}), '(0)\n', (5193, 5196), True, 'import num... |
"""
author: <NAME>
"""
import numpy as np
import time
import copy
from numba import njit
from numba.typed import List
from gglasso.solver.ggl_helper import phiplus, prox_od_1norm, prox_2norm, prox_rank_norm
from gglasso.helper.ext_admm_helper import check_G
def ext_ADMM_MGL(S, lambda1, lambda2, reg , Omega_0, G,\... | [
"numpy.sqrt",
"numpy.ones",
"numpy.maximum",
"gglasso.solver.ggl_helper.phiplus",
"numba.typed.List",
"gglasso.helper.ext_admm_helper.check_G",
"gglasso.solver.ggl_helper.prox_od_1norm",
"gglasso.solver.ggl_helper.prox_rank_norm",
"numpy.linalg.eigvalsh",
"numpy.zeros",
"numpy.isnan",
"numpy.l... | [((5244, 5266), 'numpy.zeros', 'np.zeros', (['K'], {'dtype': 'int'}), '(K, dtype=int)\n', (5252, 5266), True, 'import numpy as np\n'), ((5281, 5293), 'numpy.arange', 'np.arange', (['K'], {}), '(K)\n', (5290, 5293), True, 'import numpy as np\n'), ((5700, 5713), 'gglasso.helper.ext_admm_helper.check_G', 'check_G', (['G',... |
from collections import namedtuple
import cv2
import matplotlib.pylab as plt
import numpy as np
import pandas as pd
import random
from os.path import join
from prettyparse import Usage
from torch.utils.data.dataset import Dataset as TorchDataset
from autodo.dataset import Dataset
k = np.array([[2304.5479, 0, 1686.23... | [
"matplotlib.pylab.imread",
"collections.namedtuple",
"random.shuffle",
"pandas.read_csv",
"os.path.join",
"random.seed",
"numpy.array",
"numpy.zeros",
"numpy.concatenate",
"autodo.dataset.Dataset.from_folder",
"prettyparse.Usage",
"cv2.resize"
] | [((288, 385), 'numpy.array', 'np.array', (['[[2304.5479, 0, 1686.2379], [0, 2305.8757, 1354.9849], [0, 0, 1]]'], {'dtype': 'np.float32'}), '([[2304.5479, 0, 1686.2379], [0, 2305.8757, 1354.9849], [0, 0, 1]],\n dtype=np.float32)\n', (296, 385), True, 'import numpy as np\n'), ((462, 500), 'collections.namedtuple', 'na... |
import numpy as np
import torch
import torch.nn.functional as F
from maskrcnn_benchmark.modeling.utils import cat
from maskrcnn_benchmark.structures.bounding_box import BoxList
from siammot.utils import registry
from .feature_extractor import EMMFeatureExtractor, EMMPredictor
from .track_loss import EMMLossCom... | [
"torch.ger",
"siammot.utils.registry.SIAMESE_TRACKER.register",
"numpy.sqrt",
"torch.max",
"torch.stack",
"torch.hann_window",
"torch.exp",
"torch.nn.functional.sigmoid",
"maskrcnn_benchmark.structures.bounding_box.BoxList",
"numpy.floor",
"torch.arange",
"torch.meshgrid",
"torch.nn.function... | [((371, 411), 'siammot.utils.registry.SIAMESE_TRACKER.register', 'registry.SIAMESE_TRACKER.register', (['"""EMM"""'], {}), "('EMM')\n", (404, 411), False, 'from siammot.utils import registry\n'), ((4603, 4631), 'torch.nn.functional.softmax', 'F.softmax', (['cls_logits'], {'dim': '(1)'}), '(cls_logits, dim=1)\n', (4612,... |
import numpy as np
import scipy.signal
from tqdm import tqdm
possible_motion_estimation_methods = ['decentralized_registration', ]
def init_kwargs_dict(method, method_kwargs):
# handle kwargs by method
if method == 'decentralized_registration':
method_kwargs_ = dict(pairwise_displacement_method='con... | [
"numpy.abs",
"numpy.tile",
"numpy.allclose",
"numpy.ceil",
"numpy.histogramdd",
"numpy.ones",
"numpy.convolve",
"tqdm.tqdm",
"numpy.linalg.norm",
"numpy.argmax",
"numpy.max",
"numpy.exp",
"numpy.diag",
"numpy.zeros",
"numpy.concatenate",
"numpy.min",
"numpy.arange"
] | [((7004, 7039), 'numpy.arange', 'np.arange', (['(0)', '(num_sample + bin)', 'bin'], {}), '(0, num_sample + bin, bin)\n', (7013, 7039), True, 'import numpy as np\n'), ((7351, 7389), 'numpy.arange', 'np.arange', (['min_', '(max_ + bin_um)', 'bin_um'], {}), '(min_, max_ + bin_um, bin_um)\n', (7360, 7389), True, 'import nu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 7 21:32:49 2020
@author: alfredocu
"""
# Bibliotecas.
import numpy as np
import numpy.random as rnd
import matplotlib.pyplot as plt
# Algoritmos.
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeature... | [
"sklearn.preprocessing.PolynomialFeatures",
"numpy.random.rand",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"sklearn.preprocessing.StandardScaler",
"numpy.linspace",
"numpy.random.seed",
"matplotlib.pyplot.axis",
... | [((474, 492), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (488, 492), True, 'import numpy as np\n'), ((713, 735), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {}), '(x, y)\n', (729, 735), False, 'from sklearn.model_selection import train_test_split\n'), ((1239, 1269)... |
import numpy as np
import plotext as plt
from typing import List
from rich.jupyter import JupyterMixin
from rich.ansi import AnsiDecoder
from rich.console import Group as RenderGroup
from rich.layout import Layout
from rich.panel import Panel
def plot_race(gender: str, length: int, names: List[str], lap_times: np.ar... | [
"plotext.subplot",
"plotext.plotsize",
"rich.panel.Panel",
"plotext.plot",
"plotext.build",
"plotext.ylim",
"plotext.subplots",
"plotext.title",
"rich.ansi.AnsiDecoder",
"numpy.cumsum",
"plotext.xlim"
] | [((1131, 1149), 'plotext.subplots', 'plt.subplots', (['(2)', '(1)'], {}), '(2, 1)\n', (1143, 1149), True, 'import plotext as plt\n'), ((1168, 1196), 'numpy.cumsum', 'np.cumsum', (['lap_times'], {'axis': '(1)'}), '(lap_times, axis=1)\n', (1177, 1196), True, 'import numpy as np\n'), ((1261, 1278), 'plotext.subplot', 'plt... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from mne_connectivity.io import read_connectivity
import numpy as np
import pytest
from numpy.testing import (assert_allclose, assert_array_equal,
asser... | [
"numpy.ravel_multi_index",
"numpy.array",
"numpy.random.RandomState",
"numpy.testing.assert_array_less",
"numpy.mean",
"numpy.testing.assert_allclose",
"numpy.triu",
"numpy.abs",
"numpy.eye",
"numpy.triu_indices",
"mne_connectivity.envelope.envelope_correlation",
"numpy.corrcoef",
"mne_conne... | [((6280, 6359), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ndim, generator"""', '[(2, False), (3, False), (3, True)]'], {}), "('ndim, generator', [(2, False), (3, False), (3, True)])\n", (6303, 6359), False, 'import pytest\n'), ((716, 746), 'numpy.zeros', 'np.zeros', (['(n_labels, n_labels)'], {}), '((... |
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import numpy as np
import random
class TenArmedBanditGaussianRewardEnv(gym.Env):
metadata = {'render.modes': ['human']}
def __init__(self, seed=42):
self._seed(seed)
self.num_bandits = 10
# each reward distri... | [
"numpy.random.normal",
"random.uniform",
"gym.spaces.Discrete",
"gym.utils.seeding.np_random"
] | [((503, 536), 'gym.spaces.Discrete', 'spaces.Discrete', (['self.num_bandits'], {}), '(self.num_bandits)\n', (518, 536), False, 'from gym import error, spaces, utils\n'), ((570, 588), 'gym.spaces.Discrete', 'spaces.Discrete', (['(1)'], {}), '(1)\n', (585, 588), False, 'from gym import error, spaces, utils\n'), ((653, 67... |
import h5py as hdf
from functions import *
from sklearn.cluster import DBSCAN
from astLib import vec_astCalc
from astLib import astCoords
from numpy.lib import recfunctions as rfns
from calc_cluster_props import *
import pylab as pyl
# load RA/DEC/z data
f = hdf.File('../data/truth/Aardvark_v1.0c_truth_des_rotated.86... | [
"pylab.where",
"numpy.lib.recfunctions.stack_arrays",
"pylab.column_stack",
"pylab.mean",
"astLib.vec_astCalc.dm",
"sklearn.cluster.DBSCAN",
"pylab.intersect1d",
"pylab.array",
"h5py.File",
"pylab.zeros_like",
"pylab.append",
"pylab.in1d"
] | [((261, 332), 'h5py.File', 'hdf.File', (['"""../data/truth/Aardvark_v1.0c_truth_des_rotated.86.hdf5"""', '"""r"""'], {}), "('../data/truth/Aardvark_v1.0c_truth_des_rotated.86.hdf5', 'r')\n", (269, 332), True, 'import h5py as hdf\n'), ((405, 473), 'h5py.File', 'hdf.File', (['"""../data/halos/Aardvark_v1.0_halos_r1_rotat... |
import numpy as np
import time
class PacketModel(object):
"""Convert data to packets"""
def __init__(self, data, rowsPerPacket):
"""
# Arguments
data: 4-D tensor to be packetized
rowsPerPacket: number of rows of the feature map to be considered as one packet
... | [
"numpy.zeros",
"numpy.reshape",
"numpy.concatenate"
] | [((1036, 1123), 'numpy.zeros', 'np.zeros', (['(self.dataShape[0], self.numZeros, self.dataShape[2], self.dataShape[3])'], {}), '((self.dataShape[0], self.numZeros, self.dataShape[2], self.\n dataShape[3]))\n', (1044, 1123), True, 'import numpy as np\n'), ((1143, 1180), 'numpy.concatenate', 'np.concatenate', (['(data... |
#set matplotlib backend so figures can be saved in the background
import matplotlib
matplotlib.use("Agg")
#import the necessary packages
from sklearn.preprocessing import LabelBinarizer
from sklearn.metrics import classification_report
from utilities.nn.conv.minivggnet import MiniVGGNet
from keras.callbacks import Lea... | [
"sklearn.preprocessing.LabelBinarizer",
"keras.callbacks.LearningRateScheduler",
"matplotlib.pyplot.savefig",
"keras.datasets.cifar10.load_data",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"numpy.floor",
"matplotlib.pyplot.style.use",
"m... | [((84, 105), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (98, 105), False, 'import matplotlib\n'), ((1208, 1227), 'keras.datasets.cifar10.load_data', 'cifar10.load_data', ([], {}), '()\n', (1225, 1227), False, 'from keras.datasets import cifar10\n'), ((1350, 1366), 'sklearn.preprocessing.Label... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import fenics as fe
import time
from Core.HSolver import *
from Core.InvFun import *
from Core.AddNoise import *
plt.close()
# load the measuring data
# [sol_all, theta_all, kappa_all, qStrT]
dAR = np.load('/home/jjx323/Proj... | [
"fenics.Constant",
"fenics.interpolate",
"fenics.Point",
"matplotlib.pyplot.savefig",
"fenics.inner",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.colorbar",
"fenics.FunctionSpace",
"numpy.max",
"matplotlib.pyplot.close",
"fenics.grad",
"matplotlib.pyplot.figure",
"fenics.Expression",
"fen... | [((209, 220), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (218, 220), True, 'import matplotlib.pyplot as plt\n'), ((294, 346), 'numpy.load', 'np.load', (['"""/home/jjx323/Projects/ISP/Data/dataRc.npy"""'], {}), "('/home/jjx323/Projects/ISP/Data/dataRc.npy')\n", (301, 346), True, 'import numpy as np\n'), (... |
"""The :mod:`search` module defines algorithms to search for Push programs."""
from abc import ABC, abstractmethod
from typing import Union, Tuple, Optional
import numpy as np
import math
from functools import partial
from multiprocessing import Pool, Manager
from pyshgp.push.program import ProgramSignature
from pysh... | [
"pyshgp.gp.genome.GenomeSimplifier",
"pyshgp.gp.variation.get_variation_operator",
"numpy.random.random",
"pyshgp.utils.instantiate_using",
"pyshgp.gp.population.Population",
"functools.partial",
"multiprocessing.Pool",
"multiprocessing.Manager",
"pyshgp.utils.DiscreteProbDistrib",
"numpy.isinf",
... | [((13319, 13350), 'pyshgp.utils.instantiate_using', 'instantiate_using', (['_cls', 'kwargs'], {}), '(_cls, kwargs)\n', (13336, 13350), False, 'from pyshgp.utils import instantiate_using\n'), ((1005, 1014), 'multiprocessing.Manager', 'Manager', ([], {}), '()\n', (1012, 1014), False, 'from multiprocessing import Pool, Ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.