code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#!/bin/python3
"""
This scripts simulates the Diffusion on a fine grid (N1) and on a coare grid (N2)
The IC in the coarse grid is the interpolated IC of the fine grid. Then we plot
the Diffusion of the fine grid, the Diffusion on the coarse grid, and the difference between
Dffusion of fine grid interpolated on coars... | [
"sys.path.append",
"numpy.abs",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.colorbar",
"matplotlib.use",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.subplots"
] | [((462, 483), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (476, 483), False, 'import matplotlib\n'), ((544, 578), 'sys.path.append', 'sys.path.append', (['"""./../../_model/"""'], {}), "('./../../_model/')\n", (559, 578), False, 'import sys\n'), ((1202, 1241), 'scipy.interpolate.interp1d', 'in... |
# from here: https://github.com/Sentdex/cyberpython2077/blob/main/grabscreen.py
# Done by Frannecklp
import cv2
import numpy as np
import win32gui, win32ui, win32con, win32api
def grab_screen(region=None):
hwin = win32gui.GetDesktopWindow()
if region:
left, top, x2, y2 = region
width = x2 - ... | [
"win32gui.GetDesktopWindow",
"win32gui.ReleaseDC",
"cv2.cvtColor",
"win32gui.GetWindowDC",
"win32ui.CreateBitmap",
"win32ui.CreateDCFromHandle",
"numpy.fromstring",
"win32api.GetSystemMetrics"
] | [((220, 247), 'win32gui.GetDesktopWindow', 'win32gui.GetDesktopWindow', ([], {}), '()\n', (245, 247), False, 'import win32gui, win32ui, win32con, win32api\n'), ((655, 681), 'win32gui.GetWindowDC', 'win32gui.GetWindowDC', (['hwin'], {}), '(hwin)\n', (675, 681), False, 'import win32gui, win32ui, win32con, win32api\n'), (... |
import argparse
import collections
import numpy as np
import utils
from newsroom.analyze.rouge import ROUGE_L, ROUGE_N
def print_mean(results, rouge_types):
for rouge_type in rouge_types:
precs = results[rouge_type]['p']
recalls = results[rouge_type]['r']
fscores = results[rouge_type]['f']... | [
"argparse.ArgumentParser",
"newsroom.analyze.rouge.ROUGE_L",
"collections.defaultdict",
"numpy.mean",
"newsroom.analyze.rouge.ROUGE_N",
"utils.write_json",
"utils.read_jsonl"
] | [((1704, 1734), 'utils.read_jsonl', 'utils.read_jsonl', (['dataset_path'], {}), '(dataset_path)\n', (1720, 1734), False, 'import utils\n'), ((1753, 1780), 'utils.read_jsonl', 'utils.read_jsonl', (['pred_path'], {}), '(pred_path)\n', (1769, 1780), False, 'import utils\n'), ((3017, 3050), 'utils.write_json', 'utils.write... |
import numpy
import torch
import torch.nn.functional as F
from babyai.rl.algos.base import BaseAlgo
class PPOAlgo(BaseAlgo):
"""The class for the Proximal Policy Optimization algorithm
([Schulman et al., 2015](https://arxiv.org/abs/1707.06347))."""
def __init__(self, envs, acmodel, num_frames_per_proc=... | [
"numpy.mean",
"torch.max",
"numpy.arange",
"torch.clamp",
"numpy.random.permutation",
"torch.min"
] | [((6400, 6425), 'numpy.mean', 'numpy.mean', (['log_entropies'], {}), '(log_entropies)\n', (6410, 6425), False, 'import numpy\n'), ((6450, 6472), 'numpy.mean', 'numpy.mean', (['log_values'], {}), '(log_values)\n', (6460, 6472), False, 'import numpy\n'), ((6503, 6532), 'numpy.mean', 'numpy.mean', (['log_policy_losses'], ... |
"""Test script for single agent problems.
This scripts runs the best model found by one of the executions of `singleagent.py`
Example
-------
To run the script, type in a terminal:
$ python test_singleagent.py --exp ./results/save-<env>-<algo>-<obs>-<act>-<time_date>
"""
import sys
sys.path.append('/home/mullin... | [
"sys.path.append",
"stable_baselines3.PPO.load",
"gym.make",
"argparse.ArgumentParser",
"numpy.resize",
"stable_baselines3.common.evaluation.evaluate_policy",
"numpy.floor",
"stable_baselines3.TD3.load",
"numpy.zeros",
"time.time",
"os.path.isfile",
"stable_baselines3.A2C.load",
"stable_base... | [((291, 425), 'sys.path.append', 'sys.path.append', (['"""/home/mullin/WorkSpace/gym-pybullet-drones-master/gym_pybullet_drones/envs/single_agent_rl/FlyToTarget.py"""'], {}), "(\n '/home/mullin/WorkSpace/gym-pybullet-drones-master/gym_pybullet_drones/envs/single_agent_rl/FlyToTarget.py'\n )\n", (306, 425), False,... |
import sys
import multiprocessing as mp
import numpy as np
import scipy.optimize as op
def get_default_executor():
"""
Provide a default executor (a context manager
returning an object with a map method).
This is the multiprocessing Pool object () for python3.
The multiprocessing Pool in python2... | [
"numpy.subtract",
"numpy.copy",
"numpy.zeros",
"numpy.ones",
"numpy.identity",
"numpy.transpose",
"numpy.isnan",
"numpy.random.randint",
"numpy.math.factorial",
"numpy.linalg.norm",
"functools.wraps",
"multiprocessing.Pool",
"numpy.random.rand",
"numpy.dot",
"numpy.linalg.solve",
"nump... | [((2612, 2632), 'numpy.zeros', 'np.zeros', (['(n, d + 1)'], {}), '((n, d + 1))\n', (2620, 2632), True, 'import numpy as np\n'), ((3262, 3276), 'numpy.identity', 'np.identity', (['d'], {}), '(d)\n', (3273, 3276), True, 'import numpy as np\n'), ((6824, 6843), 'numpy.ones', 'np.ones', (['(n, d + 1)'], {}), '((n, d + 1))\n... |
'''This script loads pre-trained word embeddings (GloVe embeddings)
into a frozen Keras Embedding layer, and uses it to
train a text classification model on the 20 Newsgroup dataset
(classication of newsgroup messages into 20 different categories).
GloVe embedding data can be found at:
http://nlp.stanford.edu/data/glo... | [
"keras.preprocessing.sequence.pad_sequences",
"os.path.isdir",
"numpy.asarray",
"numpy.zeros",
"keras.layers.Flatten",
"keras.models.Model",
"keras.layers.Conv1D",
"keras.layers.MaxPooling1D",
"keras.preprocessing.text.Tokenizer",
"numpy.arange",
"keras.layers.Embedding",
"keras.layers.Dense",... | [((2501, 2534), 'keras.preprocessing.text.Tokenizer', 'Tokenizer', ([], {'num_words': 'MAX_NB_WORDS'}), '(num_words=MAX_NB_WORDS)\n', (2510, 2534), False, 'from keras.preprocessing.text import Tokenizer\n'), ((2707, 2759), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['sequences'], {'maxlen': 'MAX_SE... |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.ensemble import RandomForestClassifier
X, y = make_blobs(centers=[[0, 0], [1, 1]], random_state=61526, n_samples=50)
def plot_forest(max_depth=1):
plt.figure()
ax = plt.gca()
h = 0.02
... | [
"sklearn.ensemble.RandomForestClassifier",
"IPython.html.widgets.interactive",
"IPython.html.widgets.IntSlider",
"sklearn.datasets.make_blobs",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.array",
"matplotlib.pyplot.gca"
] | [((160, 230), 'sklearn.datasets.make_blobs', 'make_blobs', ([], {'centers': '[[0, 0], [1, 1]]', 'random_state': '(61526)', 'n_samples': '(50)'}), '(centers=[[0, 0], [1, 1]], random_state=61526, n_samples=50)\n', (170, 230), False, 'from sklearn.datasets import make_blobs\n'), ((271, 283), 'matplotlib.pyplot.figure', 'p... |
# 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... | [
"tensorboard.plugins.audio.metadata.Encoding.Value",
"tensorboard.plugins.image.metadata.create_summary_metadata",
"tensorboard.compat.proto.event_pb2.Event",
"tensorboard.plugins.scalar.metadata.create_summary_metadata",
"tensorboard.plugins.histogram.metadata.create_summary_metadata",
"tensorboard.util.... | [((1705, 1722), 'tensorboard.compat.proto.event_pb2.Event', 'event_pb2.Event', ([], {}), '()\n', (1720, 1722), False, 'from tensorboard.compat.proto import event_pb2\n'), ((3044, 3079), 'tensorboard.util.tensor_util.make_tensor_proto', 'tensor_util.make_tensor_proto', (['data'], {}), '(data)\n', (3073, 3079), False, 'f... |
# pip install https://github.com/fogleman/sdf/archive/refs/heads/main.zip
import math
import numpy as np
import sdf
import zengl
from window import Window
c = sdf.cylinder(0.5)
f = sdf.sphere(1) & sdf.box(1.5)
f -= c.orient(sdf.X) | c.orient(sdf.Y) | c.orient(sdf.Z)
# f = sdf.sphere(2) & sdf.slab(z0=-0.5, z1=0.5).k... | [
"zengl.camera",
"sdf.box",
"numpy.sum",
"sdf.cylinder",
"window.Window",
"numpy.cross",
"math.sin",
"sdf.sphere",
"zengl.bind",
"math.cos",
"zengl.context",
"numpy.concatenate"
] | [((162, 179), 'sdf.cylinder', 'sdf.cylinder', (['(0.5)'], {}), '(0.5)\n', (174, 179), False, 'import sdf\n'), ((1543, 1560), 'window.Window', 'Window', (['(1280)', '(720)'], {}), '(1280, 720)\n', (1549, 1560), False, 'from window import Window\n'), ((1567, 1582), 'zengl.context', 'zengl.context', ([], {}), '()\n', (158... |
import numpy as np
def project_vectors(vx, vy, onto_x, onto_y, eps = 1e-6):
# projected = dot(v,onto/mag(onto))
mag_onto = np.sqrt(onto_x*onto_x+onto_y*onto_y)
sel_valid = np.abs(mag_onto) > eps
vx = vx[sel_valid]
vy = vy[sel_valid]
onto_x = onto_x[sel_valid]
onto_y = onto_y[sel_valid]
... | [
"numpy.abs",
"numpy.sqrt"
] | [((132, 174), 'numpy.sqrt', 'np.sqrt', (['(onto_x * onto_x + onto_y * onto_y)'], {}), '(onto_x * onto_x + onto_y * onto_y)\n', (139, 174), True, 'import numpy as np\n'), ((185, 201), 'numpy.abs', 'np.abs', (['mag_onto'], {}), '(mag_onto)\n', (191, 201), True, 'import numpy as np\n')] |
# Copyright 2019 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.compat.v2.feature_column.indicator_column",
"keras.optimizers.optimizer_v2.gradient_descent.SGD",
"tensorflow.compat.v2.constant",
"tensorflow.compat.v2.SparseTensor",
"numpy.ones",
"numpy.random.randint",
"tensorflow.compat.v2.compat.v1.global_variables_initializer",
"keras.engine.input_l... | [((1180, 1238), 'keras.testing_infra.test_combinations.run_all_keras_modes', 'test_combinations.run_all_keras_modes', ([], {'always_skip_v1': '(True)'}), '(always_skip_v1=True)\n', (1217, 1238), False, 'from keras.testing_infra import test_combinations\n'), ((7680, 7694), 'tensorflow.compat.v2.test.main', 'tf.test.main... |
import unittest
import mock
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer.functions.connection import convolution_2d
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parame... | [
"chainer.Variable",
"chainer.testing.product",
"numpy.random.uniform",
"chainer.cuda.cupy.random.uniform",
"chainer.functions.convolution_2d",
"chainer.cuda.get_array_module",
"mock.patch",
"chainer.functions.connection.convolution_2d.Convolution2DFunction",
"chainer.cuda.to_gpu",
"chainer.testing... | [((6038, 6076), 'chainer.testing.run_module', 'testing.run_module', (['__name__', '__file__'], {}), '(__name__, __file__)\n', (6056, 6076), False, 'from chainer import testing\n'), ((3417, 3435), 'chainer.testing.condition.retry', 'condition.retry', (['(3)'], {}), '(3)\n', (3432, 3435), False, 'from chainer.testing imp... |
from numpy import genfromtxt
import numpy as np
import os
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
import matplotlib as mpl
import math
from scipy.signal import savgol_filter
# yhat = savgol_filter(y, 51, 2) # window size 51, polynomial order 3
window_size = 55
order = 2
# dqn_abs = ... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"numpy.genfromtxt",
"matplotlib.use",
"numpy.arange",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.xticks",
"matplotlib.pyplo... | [((76, 99), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (90, 99), False, 'import matplotlib\n'), ((2033, 2111), 'numpy.genfromtxt', 'genfromtxt', (['"""./data/2Nash_merged_csv/dqn_fic_deepmind_mean.csv"""'], {'delimiter': '""","""'}), "('./data/2Nash_merged_csv/dqn_fic_deepmind_mean.csv', ... |
import numpy as np
from matplotlib import _api, ticker as mticker
from matplotlib.transforms import Bbox, Transform
from .clip_path import clip_line_to_rect
class ExtremeFinderSimple:
"""
A helper class to figure out the range of grid lines that need to be drawn.
"""
def __init__(self, nx, ny):
... | [
"numpy.full_like",
"numpy.ravel",
"matplotlib.transforms.Bbox.from_extents",
"matplotlib._api.deprecated",
"numpy.array",
"numpy.linspace",
"numpy.column_stack",
"matplotlib.ticker.ScalarFormatter"
] | [((8607, 8629), 'matplotlib._api.deprecated', '_api.deprecated', (['"""3.3"""'], {}), "('3.3')\n", (8622, 8629), False, 'from matplotlib import _api, ticker as mticker\n'), ((9001, 9023), 'matplotlib._api.deprecated', '_api.deprecated', (['"""3.3"""'], {}), "('3.3')\n", (9016, 9023), False, 'from matplotlib import _api... |
#!/usr/bin/env python
# Copyright 2019 Calico 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 agr... | [
"os.path.abspath",
"json.load",
"optparse.OptionParser",
"scipy.stats.ttest_rel",
"numpy.std",
"pandas.read_csv",
"slurm.multi_run",
"numpy.min",
"numpy.mean",
"numpy.max",
"os.path.isfile",
"seaborn.jointplot",
"glob.glob",
"slurm.Job",
"scipy.stats.wilcoxon",
"matplotlib.pyplot.tight... | [((1333, 1352), 'optparse.OptionParser', 'OptionParser', (['usage'], {}), '(usage)\n', (1345, 1352), False, 'from optparse import OptionParser, OptionGroup\n'), ((14335, 14377), 'seaborn.jointplot', 'sns.jointplot', (['ref_cors', 'exp_cors'], {'space': '(0)'}), '(ref_cors, exp_cors, space=0)\n', (14348, 14377), True, '... |
# Copyright 2017 Calico 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, sof... | [
"tempfile.NamedTemporaryFile",
"subprocess.Popen",
"os.remove",
"gzip.open",
"os.rename",
"numpy.array",
"subprocess.call",
"pysam.Fastafile"
] | [((1475, 1504), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (1502, 1504), False, 'import tempfile\n'), ((2357, 2478), 'subprocess.Popen', 'subprocess.Popen', (["('bedtools intersect -wo -a %s -b %s' % (vcf_file, seq_bed_file))"], {'shell': '(True)', 'stdout': 'subprocess.PIPE'}), "('... |
from __future__ import absolute_import
import sys
sys.path.append('./')
import argparse
import os
import os.path as osp
import numpy as np
import math
import time
from PIL import Image, ImageFile
import torch
from torch import nn, optim
from torch.backends import cudnn
from torch.utils.data import DataLoader
from to... | [
"numpy.random.seed",
"numpy.floor",
"torch.set_default_tensor_type",
"torch.device",
"torch.no_grad",
"sys.path.append",
"config.get_args",
"lib.evaluation_metrics.metrics.get_str_list",
"lib.models.model_builder.ModelBuilder",
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.is_avai... | [((51, 72), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (66, 72), False, 'import sys\n'), ((959, 981), 'config.get_args', 'get_args', (['sys.argv[1:]'], {}), '(sys.argv[1:])\n', (967, 981), False, 'from config import get_args\n'), ((2098, 2123), 'numpy.random.seed', 'np.random.seed', (['args.s... |
from io import StringIO
import unittest
import pandas as pd
import numpy as np
from connector.stateful import StatefulConnector
from data_manager.base_manager import DataParam
from data_manager.time_series_manager import TimeSeriesDataManager
from proto.aiengine.v1 import aiengine_pb2
class StatefulConnectorTests(u... | [
"unittest.main",
"proto.aiengine.v1.aiengine_pb2.FieldData",
"io.StringIO",
"data_manager.base_manager.DataParam",
"numpy.isnan",
"pandas.to_timedelta",
"pandas.to_datetime",
"connector.stateful.StatefulConnector"
] | [((4705, 4720), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4718, 4720), False, 'import unittest\n'), ((617, 669), 'pandas.to_datetime', 'pd.to_datetime', (["self.original_data['time']"], {'unit': '"""s"""'}), "(self.original_data['time'], unit='s')\n", (631, 669), True, 'import pandas as pd\n'), ((764, 793), ... |
import numpy as np
from market.baselines.baselines.common.runners import AbstractEnvRunner
class Runner(AbstractEnvRunner):
def __init__(self, env, model, nsteps, nstack):
super().__init__(env=env, model=model, nsteps=nsteps)
self.nstack = nstack
nh, nw, nc = env.observation_space.shape
... | [
"numpy.copy",
"numpy.roll",
"numpy.asarray",
"numpy.zeros",
"numpy.split"
] | [((563, 616), 'numpy.zeros', 'np.zeros', (['(nenv, nh, nw, nc * nstack)'], {'dtype': 'np.uint8'}), '((nenv, nh, nw, nc * nstack), dtype=np.uint8)\n', (571, 616), True, 'import numpy as np\n'), ((863, 904), 'numpy.roll', 'np.roll', (['self.obs'], {'shift': '(-self.nc)', 'axis': '(3)'}), '(self.obs, shift=-self.nc, axis=... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | [
"autograd.numpy.sqrt",
"numpy.testing.assert_almost_equal",
"autograd.numpy.array",
"autograd.numpy.ones",
"syne_tune.optimizer.schedulers.searchers.bayesopt.gpautograd.warping.Warping",
"autograd.numpy.hstack",
"syne_tune.optimizer.schedulers.searchers.bayesopt.gpautograd.warping.OneDimensionalWarping"... | [((1073, 1107), 'syne_tune.optimizer.schedulers.searchers.bayesopt.gpautograd.warping.OneDimensionalWarping', 'OneDimensionalWarping', (['input_range'], {}), '(input_range)\n', (1094, 1107), False, 'from syne_tune.optimizer.schedulers.searchers.bayesopt.gpautograd.warping import OneDimensionalWarping, Warping\n'), ((12... |
import numpy as np
from pylearn2.datasets.four_regions import FourRegions
def test_four_regions():
dataset = FourRegions(5000)
X = dataset.get_design_matrix()
np.testing.assert_(((X < 1.) & (X > -1.)).all())
y = dataset.get_targets()
np.testing.assert_equal(np.unique(y), [0, 1, 2, 3])
| [
"pylearn2.datasets.four_regions.FourRegions",
"numpy.unique"
] | [((115, 132), 'pylearn2.datasets.four_regions.FourRegions', 'FourRegions', (['(5000)'], {}), '(5000)\n', (126, 132), False, 'from pylearn2.datasets.four_regions import FourRegions\n'), ((280, 292), 'numpy.unique', 'np.unique', (['y'], {}), '(y)\n', (289, 292), True, 'import numpy as np\n')] |
import cv2
import numpy as np
import matplotlib.pyplot as plt
import sys
from constants import *
import os
import sys
############################################################## Variables ##############################################################
# variables for matching
# Initiate SIFT description detector
Orb... | [
"cv2.GaussianBlur",
"os.path.abspath",
"cv2.SimpleBlobDetector_Params",
"cv2.medianBlur",
"cv2.cvtColor",
"cv2.dilate",
"cv2.threshold",
"cv2.BFMatcher",
"cv2.waitKey",
"numpy.ones",
"cv2.drawMatches",
"cv2.SimpleBlobDetector_create",
"cv2.SimpleBlobDetector",
"numpy.array",
"cv2.ORB_cre... | [((323, 339), 'cv2.ORB_create', 'cv2.ORB_create', ([], {}), '()\n', (337, 339), False, 'import cv2\n'), ((371, 419), 'cv2.BFMatcher', 'cv2.BFMatcher', (['cv2.NORM_HAMMING'], {'crossCheck': '(True)'}), '(cv2.NORM_HAMMING, crossCheck=True)\n', (384, 419), False, 'import cv2\n'), ((1977, 1998), 'numpy.array', 'np.array', ... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2021 by ExopyHqcLegacy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ------... | [
"numpy.array",
"inspect.cleandoc",
"numpy.linspace"
] | [((3861, 3948), 'numpy.linspace', 'np.linspace', (['self.start_frequency_SA', 'self.stop_frequency_SA', 'self.sweep_points_SA'], {}), '(self.start_frequency_SA, self.stop_frequency_SA, self.\n sweep_points_SA)\n', (3872, 3948), True, 'import numpy as np\n'), ((7376, 7464), 'inspect.cleandoc', 'cleandoc', (['"""Agile... |
# -*- coding: utf-8 -*-
"""transferlearning.py
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1oD3EweYMUiNQi9TGbXH8BHenN9vKCLxB
"""
i#loading basic dependencies
import pandas as pd
import numpy as np
import os
import keras
import matplotlib.pyplot as... | [
"keras.models.load_model",
"numpy.expand_dims",
"PIL.Image.open",
"skimage.transform.resize",
"numpy.array"
] | [((1212, 1246), 'keras.models.load_model', 'load_model', (['"""transfer_learning.h5"""'], {}), "('transfer_learning.h5')\n", (1222, 1246), False, 'from keras.models import load_model\n'), ((915, 935), 'PIL.Image.open', 'Image.open', (['filename'], {}), '(filename)\n', (925, 935), False, 'from PIL import Image\n'), ((10... |
import six
import math
import numpy as np
from numba import jit
from .bbox import *
from .mask import *
@jit
def generate_rpn_anchor_target(anchors,
gt_boxes,
is_crowd,
im_info,
rpn_straddle_thr... | [
"numpy.minimum",
"numpy.sum",
"numpy.concatenate",
"numpy.argmax",
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"numpy.hstack",
"numpy.append",
"numpy.where",
"numpy.array",
"numpy.arange",
"numpy.reshape",
"numpy.random.choice",
"numpy.round",
"numpy.vstack"
] | [((2969, 2996), 'numpy.concatenate', 'np.concatenate', (['loc_indexes'], {}), '(loc_indexes)\n', (2983, 2996), True, 'import numpy as np\n'), ((3015, 3042), 'numpy.concatenate', 'np.concatenate', (['cls_indexes'], {}), '(cls_indexes)\n', (3029, 3042), True, 'import numpy as np\n'), ((3190, 3222), 'numpy.vstack', 'np.vs... |
import random
import numpy as np
import dialog_config
import db_helper
class user_simulator():
# init file path and load data
def __init__(self):
self.path_events_db = 'events_db.json'
self.information_slot_names = dialog_config.INFORMATION_SLOTS
self.request_slot_names = dialog_conf... | [
"db_helper.get_training_data",
"numpy.random.randint",
"numpy.random.rand",
"random.choice"
] | [((1132, 1161), 'db_helper.get_training_data', 'db_helper.get_training_data', ([], {}), '()\n', (1159, 1161), False, 'import db_helper\n'), ((1521, 1544), 'numpy.random.randint', 'np.random.randint', (['(6)', '(8)'], {}), '(6, 8)\n', (1538, 1544), True, 'import numpy as np\n'), ((2011, 2034), 'numpy.random.randint', 'n... |
# coding: utf-8
#
# Copyright 2018 <NAME>
"""
Basic module that provides the means for evaluating the B-Splines basis
functions and their derivatives. In order to simplify automatic Fortran code
generation with Pyccel, no object-oriented features are employed.
References
----------
.. [1] <NAME> and <NAME>. The NURBS... | [
"psydac.core.bsplines_pyccel.histopolation_matrix_p",
"psydac.core.bsplines_pyccel.elements_spans_p",
"psydac.core.bsplines_pyccel.basis_funs_all_ders_p",
"psydac.core.bsplines_pyccel.elevate_knots_p",
"psydac.core.bsplines_pyccel.basis_integrals_p",
"psydac.core.bsplines_pyccel.breakpoints_p",
"psydac.... | [((2585, 2615), 'numpy.asarray', 'np.asarray', (['knots'], {'dtype': 'float'}), '(knots, dtype=float)\n', (2595, 2615), True, 'import numpy as np\n'), ((2627, 2656), 'psydac.core.bsplines_pyccel.find_span_p', 'find_span_p', (['knots', 'degree', 'x'], {}), '(knots, degree, x)\n', (2638, 2656), False, 'from psydac.core.b... |
#!/usr/bin/python3
# A demo of ridge noise.
import numpy as np
import sys
import util
def noise_octave(shape, f):
return util.fbm(shape, -1, lower=f, upper=(2 * f))
def main(argv):
shape = (512,) * 2
values = np.zeros(shape)
for p in range(1, 10):
a = 2 ** p
values += np.abs(noise_... | [
"util.normalize",
"numpy.save",
"numpy.zeros",
"util.fbm"
] | [((135, 176), 'util.fbm', 'util.fbm', (['shape', '(-1)'], {'lower': 'f', 'upper': '(2 * f)'}), '(shape, -1, lower=f, upper=2 * f)\n', (143, 176), False, 'import util\n'), ((234, 249), 'numpy.zeros', 'np.zeros', (['shape'], {}), '(shape)\n', (242, 249), True, 'import numpy as np\n'), ((401, 425), 'numpy.save', 'np.save'... |
from functools import partial
from typing import Optional, Tuple
import numpy as np
from gdsfactory.component import Component
from gdsfactory.config import logger
from gdsfactory.port import Port, read_port_markers, sort_ports_clockwise
from gdsfactory.snap import snap_to_grid
from gdsfactory.types import Layer
de... | [
"functools.partial",
"gdsfactory.port.Port",
"gdsfactory.port.read_port_markers",
"gdsfactory.port.sort_ports_clockwise",
"gdsfactory.config.logger.debug",
"gdsfactory.snap.snap_to_grid",
"numpy.round"
] | [((8453, 8504), 'functools.partial', 'partial', (['add_ports_from_markers_center'], {'inside': '(True)'}), '(add_ports_from_markers_center, inside=True)\n', (8460, 8504), False, 'from functools import partial\n'), ((1579, 1620), 'gdsfactory.port.read_port_markers', 'read_port_markers', (['component', '[pin_layer]'], {}... |
from src.config import get_params
from src.utils import init_experiment
from src.dataloader import get_dataloader, get_conll2003_dataloader, get_dataloader_for_bilstmtagger
from src.trainer import BaseTrainer
from src.model import BertTagger, BiLSTMTagger
from src.coach.dataloader import get_dataloader_for_coach
from ... | [
"src.utils.init_experiment",
"numpy.random.seed",
"torch.manual_seed",
"src.coach.trainer.CoachTrainer",
"torch.cuda.manual_seed",
"src.dataloader.get_conll2003_dataloader",
"src.config.get_params",
"src.model.BiLSTMTagger",
"numpy.mean",
"random.seed",
"src.dataloader.get_dataloader_for_bilstmt... | [((500, 517), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (511, 517), False, 'import random\n'), ((522, 542), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (536, 542), True, 'import numpy as np\n'), ((547, 570), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (56... |
# https://github.com/flyingdoog/PGExplainer/blob/master/MUTAG.ipynb
import yaml
import torch
import numpy as np
import pickle as pkl
from pathlib import Path
from torch_geometric.data import InMemoryDataset, Data
class Mutag(InMemoryDataset):
def __init__(self, root):
super().__init__(root=root)
... | [
"torch.zeros_like",
"torch.load",
"numpy.zeros",
"torch.save",
"pickle.load",
"numpy.loadtxt",
"torch.zeros",
"torch.tensor"
] | [((345, 380), 'torch.load', 'torch.load', (['self.processed_paths[0]'], {}), '(self.processed_paths[0])\n', (355, 380), False, 'import torch\n'), ((2418, 2469), 'torch.save', 'torch.save', (['(data, slices)', 'self.processed_paths[0]'], {}), '((data, slices), self.processed_paths[0])\n', (2428, 2469), False, 'import to... |
import numpy as np
import cv2
cam = cv2.VideoCapture(0)
def find_shape(image):
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
blurred = cv2.GaussianBlur(gray, (5, 5), 0)
return cv2.threshold(blurred, 30, 255, cv2.THRESH_BINARY)[1]
def color_mask(image, color = "Red"):
if color == "Blue":
boun... | [
"cv2.GaussianBlur",
"cv2.bitwise_and",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.threshold",
"cv2.imshow",
"numpy.hstack",
"cv2.VideoCapture",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.inRange",
"cv2.resize"
] | [((37, 56), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (53, 56), False, 'import cv2\n'), ((1492, 1515), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1513, 1515), False, 'import cv2\n'), ((92, 131), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(imag... |
"""Multi Transforms.
Applies the same transformation on a COCO dataset image and annotation pair.
"""
from PIL import Image
import random
import torchvision.transforms.functional as F
from torchvision.transforms.transforms import Normalize
import numpy as np
__all__ = ["MultiCompose", "MultiToTensor", "MultiNormali... | [
"torchvision.transforms.functional.to_tensor",
"random.choice",
"torchvision.transforms.functional.to_pil_image",
"numpy.array",
"torchvision.transforms.transforms.Normalize"
] | [((5478, 5539), 'random.choice', 'random.choice', (['(Image.FLIP_LEFT_RIGHT, Image.FLIP_TOP_BOTTOM)'], {}), '((Image.FLIP_LEFT_RIGHT, Image.FLIP_TOP_BOTTOM))\n', (5491, 5539), False, 'import random\n'), ((7844, 7864), 'torchvision.transforms.transforms.Normalize', 'Normalize', (['mean', 'std'], {}), '(mean, std)\n', (7... |
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 6 15:31:23 2019
@author: qls
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 5 20:35:53 2019
@author: qls
"""
import pandas as pd
import os
import pandas
import keras.backend as K
import tensorflow as tf
import random
import numpy as np
import scipy.io
import keras... | [
"keras.layers.Activation",
"keras.callbacks.ModelCheckpoint",
"keras.layers.Dropout",
"pywt.dwt",
"keras.optimizers.Adam",
"keras.models.Model",
"keras.layers.Conv1D",
"keras.layers.UpSampling1D",
"keras.layers.BatchNormalization",
"keras.layers.MaxPooling1D",
"pywt.waverec",
"numpy.array",
... | [((3442, 3474), 'keras.layers.Input', 'Input', (['(5000, 14)'], {'name': '"""inputs"""'}), "((5000, 14), name='inputs')\n", (3447, 3474), False, 'from keras.layers import SimpleRNN, Permute, Reshape, CuDNNLSTM, LSTM, Dropout, Input, Add, Dense, Activation, ZeroPadding1D, BatchNormalization, Flatten, Conv1D, Conv2D, Ave... |
#!/usr/bin/env python3
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# Keyboard controlling for CARLA. Please refer to client_example.py for a si... | [
"argparse.ArgumentParser",
"pygame.event.get",
"numpy.random.randint",
"carla.planner.map.CarlaMap",
"os.path.join",
"carla_utils.MeasurementsDisplayHelper.print_player_measurements",
"logging.error",
"carla.image_converter.to_rgb_array",
"pygame.display.set_mode",
"os.path.exists",
"numpy.ident... | [((1817, 1844), 'os.path.join', 'os.path.join', (['"""_out"""', 'PHASE'], {}), "('_out', PHASE)\n", (1829, 1844), False, 'import os\n'), ((2161, 2209), 'os.path.join', 'os.path.join', (['OUTPUT_FOLDER', '"""planes/{0:06}.txt"""'], {}), "(OUTPUT_FOLDER, 'planes/{0:06}.txt')\n", (2173, 2209), False, 'import os\n'), ((222... |
import math
from datetime import timedelta
import numpy as np
from scipy.signal import convolve
from scipy.signal import cspline1d
from scipy.signal import savgol_filter
from pandas import DataFrame
from utils.SettingsReader import SettingsReader
from utils import Utils
class MultiData():
"""Basic data stru... | [
"scipy.signal.savgol_filter",
"utils.Utils.parseTime",
"utils.Utils.parseTimeV",
"numpy.hstack",
"numpy.diff",
"utils.Utils.getSeparation",
"numpy.array",
"numpy.sign"
] | [((5413, 5446), 'utils.Utils.parseTimeV', 'Utils.parseTimeV', (['data.iloc[:, 0]'], {}), '(data.iloc[:, 0])\n', (5429, 5446), False, 'from utils import Utils\n'), ((5625, 5651), 'utils.Utils.parseTime', 'Utils.parseTime', (['timeStart'], {}), '(timeStart)\n', (5640, 5651), False, 'from utils import Utils\n'), ((5717, 5... |
"""
This file contains a wrapper for sampling environment states
from a set of demonstrations on every reset. The main use case is for
altering the start state distribution of training episodes for
learning RL policies.
"""
import random
import os
import h5py
import time
import numpy as np
from robosuite.utils.mjcf... | [
"h5py.File",
"random.uniform",
"random.sample",
"numpy.asarray",
"random.choice",
"numpy.cumsum",
"random.seed",
"robosuite.utils.mjcf_utils.postprocess_model_xml",
"os.path.join",
"numpy.all"
] | [((3819, 3860), 'os.path.join', 'os.path.join', (['self.demo_path', '"""demo.hdf5"""'], {}), "(self.demo_path, 'demo.hdf5')\n", (3831, 3860), False, 'import os\n'), ((3886, 3911), 'h5py.File', 'h5py.File', (['hdf5_path', '"""r"""'], {}), "(hdf5_path, 'r')\n", (3895, 3911), False, 'import h5py\n'), ((4999, 5024), 'numpy... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# @Version : Python 3.6
import os
import json
import torch
import numpy as np
from torch.utils.data import Dataset, DataLoader
class WordEmbeddingLoader(object):
"""
A loader for pre-trained word embedding
"""
def __init__(self, config):
self.... | [
"config.Config",
"torch.utils.data.DataLoader",
"numpy.asarray",
"torch.max",
"numpy.reshape",
"os.path.join",
"torch.min",
"numpy.concatenate",
"torch.from_numpy"
] | [((7101, 7109), 'config.Config', 'Config', ([], {}), '()\n', (7107, 7109), False, 'from config import Config\n'), ((1707, 1754), 'numpy.concatenate', 'np.concatenate', (['(special_emb, word_vec)'], {'axis': '(0)'}), '((special_emb, word_vec), axis=0)\n', (1721, 1754), True, 'import numpy as np\n'), ((1904, 1930), 'torc... |
import re
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.core.arrays import IntervalArray
class TestSeriesReplace:
def test_replace_explicit_none(self):
# GH#36984 if the user explicitly passes value=None, give it to them
ser = pd.Series([0, 0, ""],... | [
"pandas._testing.assert_equal",
"pandas.Interval",
"numpy.arange",
"pytest.mark.parametrize",
"pandas.Int64Dtype",
"numpy.random.randn",
"pandas.IntervalDtype",
"pandas.Float64Dtype",
"pandas._testing.assert_series_equal",
"pytest.raises",
"pandas.Period",
"pandas.PeriodDtype",
"pandas.isna"... | [((14907, 15084), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ser, to_replace, exp"""', "[([1, 2, 3], {(1): 2, (2): 3, (3): 4}, [2, 3, 4]), (['1', '2', '3'], {'1':\n '2', '2': '3', '3': '4'}, ['2', '3', '4'])]"], {}), "('ser, to_replace, exp', [([1, 2, 3], {(1): 2, (2): \n 3, (3): 4}, [2, 3, 4]), ... |
import pathlib
import imageio
import numpy as np
from PIL import Image
class AttrDict(dict):
__getattr__ = dict.__getitem__
class staticproperty:
def __init__(self, function):
self.function = function
def __get__(self, instance, owner=None):
return self.function()
class World:
def __init__(se... | [
"numpy.zeros",
"numpy.random.RandomState",
"pathlib.Path",
"numpy.array",
"PIL.Image.fromarray"
] | [((362, 386), 'numpy.zeros', 'np.zeros', (['area', 'np.uint8'], {}), '(area, np.uint8)\n', (370, 386), True, 'import numpy as np\n'), ((505, 530), 'numpy.zeros', 'np.zeros', (['area', 'np.uint32'], {}), '(area, np.uint32)\n', (513, 530), True, 'import numpy as np\n'), ((550, 577), 'numpy.random.RandomState', 'np.random... |
import logging
from collections import defaultdict
from copy import deepcopy
from typing import Dict, List, Optional, Union, Generator
from uuid import uuid4
import time
import numpy as np
from scipy.spatial.distance import cosine
from tqdm import tqdm
from haystack import Document, Label
from haystack.document_store... | [
"copy.deepcopy",
"tqdm.tqdm",
"haystack.Label.from_dict",
"scipy.spatial.distance.cosine",
"time.strftime",
"logging.getLogger",
"haystack.document_store.base.DuplicateDocumentError",
"collections.defaultdict",
"haystack.Document.from_dict",
"haystack.utils.get_batches_from_generator",
"numpy.li... | [((489, 516), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (506, 516), False, 'import logging\n'), ((2974, 2991), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (2985, 2991), False, 'from collections import defaultdict\n'), ((5266, 5285), 'copy.deepcopy', 'deepcop... |
# load sentera csv format
import csv
import fileinput
import math
import numpy as np
import os
import re
import navpy
d2r = math.pi / 180.0
g = 9.81
# empty class we'll fill in with data members
class Record: pass
def isFloat(string):
try:
float(string)
return True
except ValueError:
... | [
"fileinput.isfirstline",
"fileinput.input",
"csv.DictReader",
"os.path.exists",
"os.path.isfile",
"numpy.array",
"os.path.join"
] | [((468, 503), 'os.path.join', 'os.path.join', (['flight_dir', '"""imu.csv"""'], {}), "(flight_dir, 'imu.csv')\n", (480, 503), False, 'import os\n'), ((519, 554), 'os.path.join', 'os.path.join', (['flight_dir', '"""gps.csv"""'], {}), "(flight_dir, 'gps.csv')\n", (531, 554), False, 'import os\n'), ((573, 620), 'os.path.j... |
# Copyright 2021 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, ... | [
"numpy.full",
"numpy.count_nonzero",
"jax.numpy.triu",
"jax.numpy.finfo",
"jax.numpy.eye",
"numpy.zeros",
"numpy.isinf",
"numpy.isnan",
"jax.numpy.tril",
"jax.numpy.matmul",
"numpy.linalg.norm",
"jax.numpy.conj",
"numpy.array",
"jax.lax.linalg.lu_pivots_to_permutation",
"numpy.matmul",
... | [((16769, 16800), 'numpy.count_nonzero', 'np.count_nonzero', (['special_cases'], {}), '(special_cases)\n', (16785, 16800), True, 'import numpy as np\n'), ((28662, 28693), 'numpy.count_nonzero', 'np.count_nonzero', (['special_cases'], {}), '(special_cases)\n', (28678, 28693), True, 'import numpy as np\n'), ((29813, 2984... |
import numpy as np
from astropy.io import fits
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
import turbulence as tb
from ROHSApy import ROHSA
#DATA ... | [
"numpy.median",
"astropy.io.fits.PrimaryHDU",
"turbulence.proj.wcs2D",
"numpy.zeros",
"numpy.mean",
"numpy.array",
"astropy.io.fits.open",
"ROHSApy.ROHSA",
"astropy.io.fits.HDUList",
"numpy.sqrt"
] | [((462, 537), 'astropy.io.fits.open', 'fits.open', (['"""/data/amarchal/ROHSA_paper/data/observation/GHIGLS_NEP_Tb.fits"""'], {}), "('/data/amarchal/ROHSA_paper/data/observation/GHIGLS_NEP_Tb.fits')\n", (471, 537), False, 'from astropy.io import fits\n'), ((604, 622), 'turbulence.proj.wcs2D', 'tb.proj.wcs2D', (['hdr'],... |
import numpy as np
import cv2
import os
import matplotlib.pyplot as plt
from multiprocessing import Pool
import pydensecrf.densecrf as dcrf
# File I/O
INPUT_PATH = 'D:/Datasets/penguinguy/%03d%03d.png'
OUTPUT_PATH = "output/penguinguy_crf_8"
# Arch Camera Configurlation
TOTAL_CAMERA = 10
TOTAL_IMAGE_PER_CAMERA = 40
... | [
"os.mkdir",
"numpy.argmax",
"numpy.ones",
"numpy.mean",
"numpy.linalg.norm",
"cv2.floodFill",
"cv2.cvtColor",
"cv2.imwrite",
"os.path.exists",
"numpy.max",
"pydensecrf.densecrf.DenseCRF2D",
"numpy.dstack",
"cv2.morphologyEx",
"numpy.min",
"numpy.log",
"cv2.rotate",
"cv2.getStructurin... | [((1208, 1260), 'cv2.imread', 'cv2.imread', (['(INPUT_PATH % (camerea_id, previous_shot))'], {}), '(INPUT_PATH % (camerea_id, previous_shot))\n', (1218, 1260), False, 'import cv2\n'), ((1286, 1337), 'cv2.imread', 'cv2.imread', (['(INPUT_PATH % (camerea_id, current_shot))'], {}), '(INPUT_PATH % (camerea_id, current_shot... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
from tqdm.auto import tqdm
from multiprocessing import Pool
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.cm import ScalarMappable
from matplotlib.colors import Normalize, LogNorm
fr... | [
"cartopy.crs.LambertConformal",
"matplotlib.offsetbox.AnchoredText",
"cartopy.feature.OCEAN.with_scale",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.close",
"cartopy.feature.LAND.with_scale",
"cartopy.io.shapereader.natural_earth",
"numpy.log10",
"matplotlib.pyplot.figure",
"cartopy.io.shape... | [((6959, 6966), 'multiprocessing.Pool', 'Pool', (['(4)'], {}), '(4)\n', (6963, 6966), False, 'from multiprocessing import Pool\n'), ((5375, 5402), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(14, 5)'}), '(figsize=(14, 5))\n', (5385, 5402), True, 'import matplotlib.pyplot as plt\n'), ((5886, 5991), 'matp... |
from setuptools.command.build_ext import build_ext
from setuptools import dist, setup, Extension, find_packages
import os
dist.Distribution().fetch_build_eggs(['numpy>=1.12'])
import numpy as np # noqa
descr = 'Fast algorithm with dual extrapolation for sparse problems'
version = None
with open(os.path.join('celer',... | [
"setuptools.dist.Distribution",
"os.path.join",
"setuptools.find_packages",
"numpy.get_include"
] | [((122, 141), 'setuptools.dist.Distribution', 'dist.Distribution', ([], {}), '()\n', (139, 141), False, 'from setuptools import dist, setup, Extension, find_packages\n'), ((299, 335), 'os.path.join', 'os.path.join', (['"""celer"""', '"""__init__.py"""'], {}), "('celer', '__init__.py')\n", (311, 335), False, 'import os\... |
#!/usr/bin/env python
"""
Aggregated conformal predictors
"""
# Authors: <NAME>
import numpy as np
from sklearn.model_selection import KFold, StratifiedKFold
from sklearn.model_selection import ShuffleSplit, StratifiedShuffleSplit
from sklearn.base import clone
from cqr.nonconformist_base import BaseEstimator
from c... | [
"cqr.nonconformist_util.calc_p",
"numpy.zeros",
"numpy.ones",
"sklearn.model_selection.KFold",
"sklearn.model_selection.StratifiedShuffleSplit",
"numpy.mean",
"sklearn.model_selection.StratifiedKFold",
"numpy.arange",
"numpy.random.choice",
"numpy.random.permutation",
"sklearn.model_selection.Sh... | [((4463, 4492), 'numpy.random.permutation', 'np.random.permutation', (['y.size'], {}), '(y.size)\n', (4484, 4492), True, 'import numpy as np\n'), ((8165, 8284), 'cqr.nonconformist_util.calc_p', 'calc_p', (['ncal_ngt_neq[:, :, 0]', 'ncal_ngt_neq[:, :, 1]', 'ncal_ngt_neq[:, :, 2]'], {'smoothing': 'self.predictors[0].smoo... |
from polynomial import *
from chebyshev import *
from polyutils import *
from numpy.testing import Tester
test = Tester().test
bench = Tester().bench
| [
"numpy.testing.Tester"
] | [((114, 122), 'numpy.testing.Tester', 'Tester', ([], {}), '()\n', (120, 122), False, 'from numpy.testing import Tester\n'), ((136, 144), 'numpy.testing.Tester', 'Tester', ([], {}), '()\n', (142, 144), False, 'from numpy.testing import Tester\n')] |
# Copyright (C) 2017 <NAME>, Carnegie Mellon University
# Copyright (C) 2020 <NAME>, UCLA
from __future__ import print_function
from __future__ import division
import numpy as np
import torch
from loguru import logger
# Data feed
class LongDataLoader(object):
"""A special efficient data loader for TBPTT"""
b... | [
"numpy.random.shuffle",
"numpy.max",
"numpy.mean",
"numpy.min",
"torch.tensor"
] | [((604, 641), 'numpy.random.shuffle', 'np.random.shuffle', (['self.batch_indexes'], {}), '(self.batch_indexes)\n', (621, 641), True, 'import numpy as np\n'), ((4531, 4562), 'numpy.random.shuffle', 'np.random.shuffle', (['self.indexes'], {}), '(self.indexes)\n', (4548, 4562), True, 'import numpy as np\n'), ((4357, 4373)... |
from __future__ import print_function
import torch
import numpy as np
import os
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
MESH_EXTENSIONS = [
'.vtk',
]
def is_mesh_file(filename):
return any(filename.endswith(extension) for extension in MESH_EXTENSIONS)
def pad(input_arr, ... | [
"numpy.pad",
"numpy.sum",
"numpy.log",
"os.makedirs",
"os.path.exists",
"numpy.min",
"numpy.max"
] | [((478, 549), 'numpy.pad', 'np.pad', (['input_arr'], {'pad_width': 'npad', 'mode': '"""constant"""', 'constant_values': 'val'}), "(input_arr, pad_width=npad, mode='constant', constant_values=val)\n", (484, 549), True, 'import numpy as np\n'), ((1888, 1904), 'numpy.min', 'np.min', (['np_array'], {}), '(np_array)\n', (18... |
#!/usr/bin/env python3
# Copyright 2021 <NAME>
#
# This file is part of WarpX.
#
# License: BSD-3-Clause-LBNL
"""
This script tests the particle boundary conditions.
The input file sets up absorbing, periodic, and reflecting boundary conditions
along each of the three axis. It launches particles heading toward each ... | [
"yt.funcs.mylog.setLevel",
"numpy.abs",
"os.getcwd",
"sys.path.insert",
"checksumAPI.evaluate_checksum",
"numpy.argsort",
"yt.load",
"numpy.all",
"numpy.sqrt"
] | [((497, 523), 'yt.funcs.mylog.setLevel', 'yt.funcs.mylog.setLevel', (['(0)'], {}), '(0)\n', (520, 523), False, 'import yt\n'), ((524, 584), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../../../warpx/Regression/Checksum/"""'], {}), "(1, '../../../../warpx/Regression/Checksum/')\n", (539, 584), False, 'import s... |
# vim: set fileencoding=<utf-8> :
'''Mash functions for database construction'''
# universal
import os
import sys
import subprocess
# additional
import collections
import pickle
import time
from tempfile import mkstemp
from multiprocessing import Pool, Lock
from functools import partial
from itertools import product
f... | [
"os.remove",
"multiprocessing.Lock",
"numpy.ones",
"os.path.isfile",
"numpy.exp",
"glob.glob",
"numpy.std",
"numpy.apply_along_axis",
"sharedmem.empty",
"sharedmem.MapReduce",
"functools.partial",
"subprocess.Popen",
"os.path.basename",
"numpy.asarray",
"numpy.array2string",
"numpy.fli... | [((754, 839), 'subprocess.Popen', 'subprocess.Popen', (["[mash_exec + ' --version']"], {'shell': '(True)', 'stdout': 'subprocess.PIPE'}), "([mash_exec + ' --version'], shell=True, stdout=subprocess.PIPE\n )\n", (770, 839), False, 'import subprocess\n'), ((1735, 1759), 'os.path.isdir', 'os.path.isdir', (['outPrefix']... |
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from matplotlib import pyplot
from numpy import array
# return training data
def get_train():
seq = [[0.0, 0.1], [0.1, 0.2], [0.2, 0.3], [0.3, 0.4], [0.4, 0.5]]
seq = array(seq)
X, y = seq[:, 0], seq[:, 1]
X = X.reshap... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"keras.layers.LSTM",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"keras.layers.Dense",
"numpy.array",
"keras.models.Sequential",
"matplotlib.pyplot.xlabel"
] | [((570, 582), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (580, 582), False, 'from keras.models import Sequential\n'), ((892, 928), 'matplotlib.pyplot.plot', 'pyplot.plot', (["history.history['loss']"], {}), "(history.history['loss'])\n", (903, 928), False, 'from matplotlib import pyplot\n'), ((929, 969)... |
import numpy as np
import logging as log
import tinkerbell.app.make as tbamk
import tinkerbell.app.rcparams as tbarc
import tinkerbell.app.plot as tbapl
import tinkerbell.app.model as tbamd
import tinkerbell.domain.point as tbdpt
import example_regress_on_time_stage_training_set
def do_the_thing():
y0 = tbarc.rcpar... | [
"numpy.zeros_like",
"numpy.random.seed",
"tinkerbell.app.model.Normalizer.load",
"tinkerbell.app.model.Features",
"tinkerbell.app.plot.plot",
"tinkerbell.app.model.predict",
"example_regress_on_time_stage_training_set.do_the_thing",
"tinkerbell.app.model.Targets",
"tinkerbell.domain.point.point_coor... | [((648, 666), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (662, 666), True, 'import numpy as np\n'), ((683, 781), 'tinkerbell.app.make.points_exponential_discontinuous_declinelinear_noisy', 'tbamk.points_exponential_discontinuous_declinelinear_noisy', (['y0', 'd', 'xmax', 'xdisc'], {'num': 'num_poi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 18 2019
Learn behavior policy for this dataset using annoy (approx kNN)
@author: josephfutoma
"""
import numpy as np
import pandas as pd
import os
from datetime import datetime
import pickle
import matplotlib.pyplot as plt
import seaborn as sns
... | [
"numpy.random.seed",
"numpy.unique",
"numpy.zeros",
"numpy.searchsorted",
"time.time",
"numpy.mean",
"numpy.array",
"numpy.arange",
"annoy.AnnoyIndex",
"pandas.set_option",
"os.chdir",
"numpy.concatenate",
"numpy.sqrt"
] | [((512, 553), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', '(101)'], {}), "('display.max_columns', 101)\n", (525, 553), True, 'import pandas as pd\n'), ((553, 578), 'os.chdir', 'os.chdir', (['MIMIC_DATA_PATH'], {}), '(MIMIC_DATA_PATH)\n', (561, 578), False, 'import os\n'), ((1882, 1905), 'numpy.... |
#!/usr/bin/env python
"""
Module containing the main input class
"""
import glob
import inspect
import json
import os
from importlib import import_module
import numpy as np
import pandas as pd
from gwosc.datasets import event_gps
import bilby
from . import utils
from .utils import (
SAMPLER_SETTINGS,
BilbyPi... | [
"numpy.load",
"pandas.read_csv",
"bilby.core.prior.Cosine",
"os.path.isfile",
"glob.glob",
"bilby.core.prior.Uniform",
"os.path.join",
"bilby.gw.prior.CalibrationPriorDict.from_envelope_file",
"pandas.DataFrame",
"bilby.core.prior.Sine",
"os.path.dirname",
"numpy.genfromtxt",
"numpy.loadtxt"... | [((2827, 2850), 'os.path.relpath', 'os.path.relpath', (['outdir'], {}), '(outdir)\n', (2842, 2850), False, 'import os\n'), ((2990, 3026), 'os.path.join', 'os.path.join', (['self._outdir', '"""submit"""'], {}), "(self._outdir, 'submit')\n", (3002, 3026), False, 'import os\n'), ((3693, 3748), 'os.path.join', 'os.path.joi... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | [
"qiskit.circuit.quantumregister.QuantumRegister",
"numpy.array",
"qiskit.circuit.quantumcircuit.QuantumCircuit",
"numpy.sqrt"
] | [((4627, 4744), 'numpy.array', 'numpy.array', (['[[1, 0, 0, 0], [0, _sqrt2o2, 0, _sqrt2o2], [0, 0, 1, 0], [0, _sqrt2o2, 0, -\n _sqrt2o2]]'], {'dtype': 'complex'}), '([[1, 0, 0, 0], [0, _sqrt2o2, 0, _sqrt2o2], [0, 0, 1, 0], [0,\n _sqrt2o2, 0, -_sqrt2o2]], dtype=complex)\n', (4638, 4744), False, 'import numpy\n'), ... |
from astropy.io import fits
import pandas as pd
import numpy as np
from os.path import expanduser
from random import choice as choose_random_item
import os
from lightkurve import KeplerTargetPixelFile
from lightkurve.mast import ArchiveError
#load KeplerTargetPixelFile
# flatten with k2SFF i.e. create LightCurveFile
# ... | [
"lightkurve.KeplerTargetPixelFile",
"numpy.nanmedian",
"os.makedirs",
"pandas.read_csv",
"os.path.isdir",
"numpy.copy",
"random.choice",
"lightkurve.KeplerTargetPixelFile.from_archive",
"numpy.array",
"astropy.io.fits.open",
"os.path.expanduser"
] | [((3035, 3064), 'numpy.nanmedian', 'np.nanmedian', (['(t[1:] - t[0:-1])'], {}), '(t[1:] - t[0:-1])\n', (3047, 3064), True, 'import numpy as np\n'), ((3754, 3769), 'astropy.io.fits.open', 'fits.open', (['file'], {}), '(file)\n', (3763, 3769), False, 'from astropy.io import fits\n'), ((4374, 4408), 'pandas.read_csv', 'pd... |
# pylint: disable=arguments-differ
# pylint: disable=unused-argument
# pylint: disable=abstract-method
import math
import os
from argparse import ArgumentParser
import numpy as np
import pandas as pd
import pytorch_lightning as pl
import torch
import torch.nn.functional as F
import torchtext.datasets as td
from pytor... | [
"torch.nn.Dropout",
"numpy.random.seed",
"argparse.ArgumentParser",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"pytorch_lightning.Trainer.add_argparse_args",
"torch.utils.data.DataLoader",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torchtext.datasets.AG_... | [((1008, 1082), 'sklearn.datasets.fetch_20newsgroups', 'fetch_20newsgroups', ([], {'subset': '"""train"""', 'categories': 'categories', 'return_X_y': '(True)'}), "(subset='train', categories=categories, return_X_y=True)\n", (1026, 1082), False, 'from sklearn.datasets import fetch_20newsgroups\n'), ((1238, 1286), 'torch... |
# Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/Python/Tutorial/Advanced/colored_pointcloud_registration.py
import numpy as np
import copy
from open3d import *
def draw_registration_result_original_color(source, target, transformation):
source_t... | [
"copy.deepcopy",
"numpy.identity"
] | [((326, 347), 'copy.deepcopy', 'copy.deepcopy', (['source'], {}), '(source)\n', (339, 347), False, 'import copy\n'), ((726, 740), 'numpy.identity', 'np.identity', (['(4)'], {}), '(4)\n', (737, 740), True, 'import numpy as np\n'), ((893, 907), 'numpy.identity', 'np.identity', (['(4)'], {}), '(4)\n', (904, 907), True, 'i... |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2017 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from scipy.io import loadmat, mmread
from scipy.sparse import issparse
import numpy as np
import te... | [
"numpy.load",
"scipy.io.loadmat",
"scipy.sparse.issparse",
"tempfile.gettempdir",
"scipy.io.mmread",
"pymor.core.logger.getLogger",
"tempfile.mkdtemp",
"numpy.loadtxt",
"shutil.rmtree",
"os.path.join"
] | [((1396, 1409), 'numpy.load', 'np.load', (['path'], {}), '(path)\n', (1403, 1409), True, 'import numpy as np\n'), ((2357, 2396), 'pymor.core.logger.getLogger', 'getLogger', (['"""pymor.tools.io.load_matrix"""'], {}), "('pymor.tools.io.load_matrix')\n", (2366, 2396), False, 'from pymor.core.logger import getLogger\n'), ... |
import abc
import functools
import itertools
import os
import pickle
import time
import warnings
import weakref
from collections import defaultdict
from stat import ST_CTIME
import numpy as np
from yt.config import ytcfg
from yt.data_objects.data_containers import data_object_registry
from yt.data_objects.particle_fi... | [
"yt.units.unit_systems.create_code_unit_system",
"yt.utilities.exceptions.YTFieldNotFound",
"numpy.geterr",
"os.walk",
"yt.utilities.exceptions.YTGeometryNotSupported",
"numpy.isnan",
"collections.defaultdict",
"yt.fields.fluid_fields.setup_gradient_fields",
"yt.funcs.issue_deprecation_warning",
"... | [((2177, 2206), 'weakref.WeakValueDictionary', 'weakref.WeakValueDictionary', ([], {}), '()\n', (2204, 2206), False, 'import weakref\n'), ((2219, 2239), 'yt.utilities.parameter_file_storage.ParameterFileStore', 'ParameterFileStore', ([], {}), '()\n', (2237, 2239), False, 'from yt.utilities.parameter_file_storage import... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import generators
from __future__ import nested_scopes
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import os
import numpy as np
import ... | [
"numpy.load",
"numpy.save",
"numpy.abs",
"numpy.sum",
"sklearn.cluster.KMeans",
"os.path.exists",
"numpy.ones",
"numpy.zeros",
"numpy.min",
"numpy.mean",
"numpy.array",
"numpy.reshape",
"numpy.where",
"util.preprocess.load_pixels_by_patient",
"matplotlib.pyplot.subplots"
] | [((518, 549), 'numpy.ones', 'np.ones', (['[n, n]'], {'dtype': 'np.int16'}), '([n, n], dtype=np.int16)\n', (525, 549), True, 'import numpy as np\n'), ((1492, 1509), 'numpy.abs', 'np.abs', (['sum_pixel'], {}), '(sum_pixel)\n', (1498, 1509), True, 'import numpy as np\n'), ((3419, 3437), 'matplotlib.pyplot.subplots', 'plt.... |
# Copyright (c) 2019 PaddlePaddle 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 appli... | [
"paddle._C_ops.sum",
"paddle.fluid.core.clear_gradients",
"paddle.get_default_dtype",
"paddle.fluid.framework.device_guard",
"paddle.fluid.framework.default_main_program",
"numpy.array",
"paddle.fluid.core.kNewGradSuffix",
"paddle.fluid.core.op_proto_and_checker_maker.kOpDeviceAttrName",
"paddle.flu... | [((48866, 48899), 'paddle.fluid.framework._in_eager_without_dygraph_check', '_in_eager_without_dygraph_check', ([], {}), '()\n', (48897, 48899), False, 'from paddle.fluid.framework import _in_legacy_dygraph, _in_eager_without_dygraph_check\n'), ((26333, 26353), 'paddle.fluid.framework.device_guard', 'device_guard', (['... |
from typing import TypeVar, Optional, Iterator, Dict, Callable, Iterable, Generic, List
from abc import ABC
from datetime import datetime
import operator, logging
import sys
import numpy as np
from hurry.filesize import size as _hurry
from psutil import virtual_memory
import pandas as pd
K = TypeVar('K')
class Facad... | [
"psutil.virtual_memory",
"numpy.round",
"hurry.filesize.size",
"sys.getsizeof",
"typing.TypeVar",
"operator.itemgetter",
"datetime.datetime.now"
] | [((295, 307), 'typing.TypeVar', 'TypeVar', (['"""K"""'], {}), "('K')\n", (302, 307), False, 'from typing import TypeVar, Optional, Iterator, Dict, Callable, Iterable, Generic, List\n'), ((2031, 2045), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2043, 2045), False, 'from datetime import datetime\n'), ((2... |
import os
import copy
import math
import time
import random
import numpy as np
from PIL import Image
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
def default_loader(path):
img = Image.open(path).convert('L')
return img
def default_list_reader(file... | [
"copy.deepcopy",
"torchvision.transforms.RandomHorizontalFlip",
"random.sample",
"math.floor",
"PIL.Image.open",
"numpy.random.permutation",
"os.path.join",
"torchvision.transforms.RandomCrop",
"torchvision.transforms.ToTensor"
] | [((1763, 1796), 'copy.deepcopy', 'copy.deepcopy', (['self.real_data_idx'], {}), '(self.real_data_idx)\n', (1776, 1796), False, 'import copy\n'), ((2105, 2138), 'copy.deepcopy', 'copy.deepcopy', (['self.real_data_idx'], {}), '(self.real_data_idx)\n', (2118, 2138), False, 'import copy\n'), ((3370, 3407), 'numpy.random.pe... |
"""Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_path, lars_path_gram
from sklearn.linear_m... | [
"sklearn.linear_model.lasso_path",
"numpy.meshgrid",
"sklearn.linear_model.lars_path_gram",
"numpy.asarray",
"sklearn.datasets.make_regression",
"time.time",
"collections.defaultdict",
"gc.collect",
"matplotlib.pyplot.figure",
"sklearn.linear_model.lars_path",
"sys.stdout.flush",
"numpy.linspa... | [((467, 491), 'collections.defaultdict', 'defaultdict', (['(lambda : [])'], {}), '(lambda : [])\n', (478, 491), False, 'from collections import defaultdict\n'), ((3095, 3150), 'matplotlib.pyplot.figure', 'plt.figure', (['"""scikit-learn Lasso path benchmark results"""'], {}), "('scikit-learn Lasso path benchmark result... |
import os
import sys
sys.path.append('.')
import cv2
import math
import torch
import argparse
import numpy as np
from torch.nn import functional as F
from pytorch_msssim import ssim_matlab
from model.RIFE import Model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = Model()
model.load_mode... | [
"sys.path.append",
"numpy.abs",
"os.path.realpath",
"model.RIFE.Model",
"numpy.mean",
"torch.cuda.is_available",
"torch.zeros",
"numpy.round",
"torch.from_numpy"
] | [((21, 41), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (36, 41), False, 'import sys\n'), ((297, 304), 'model.RIFE.Model', 'Model', ([], {}), '()\n', (302, 304), False, 'from model.RIFE import Model\n'), ((884, 913), 'torch.zeros', 'torch.zeros', (['[1, 6, 480, 640]'], {}), '([1, 6, 480, 640])\n... |
from __future__ import annotations
import sys
sys.path += '..'
import ATL
from ATL import num
import numpy as np
import time
@ATL.func
def qform( N : size, x : num[N], A : num[N,N] ):
B[i:N,j:N] = Sum[k:N]( A[k,i] * A[k,j] )
y[i:N] = Sum[j:N]( B[i,j] * x[j] )
return Sum[i:N]( x[i] * y[i] )
DQ = qfor... | [
"numpy.random.rand",
"numpy.zeros",
"time.perf_counter"
] | [((789, 813), 'numpy.zeros', 'np.zeros', (['[1]'], {'order': '"""F"""'}), "([1], order='F')\n", (797, 813), True, 'import numpy as np\n'), ((932, 951), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (949, 951), False, 'import time\n'), ((1024, 1043), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\... |
#encoding=utf8
import os, re, sys
import cv2
import numpy as np
from lib.sky import *
from lib.kmorphology import *
from lib import kalgorithm
from lib import pyheal
repairfile = r"./output_images/phase3/phase3_repair.png"
repairmaskfile = r"./output_images/phase3/phase3_repair_mask.png"
skyfile = r"./input_images/ph... | [
"numpy.sum",
"lib.kalgorithm.thresholdBinarization",
"numpy.clip",
"lib.kalgorithm.meanFilter",
"lib.kalgorithm.imgSave",
"lib.kalgorithm.affineRotation",
"lib.kalgorithm.prewittFilter",
"numpy.mean",
"cv2.imshow",
"lib.kalgorithm.sobelFilter",
"lib.kalgorithm.blInterpolate",
"os.path.exists",... | [((651, 681), 'numpy.arctan', 'np.arctan', (['(1.0 * (lH - rH) / W)'], {}), '(1.0 * (lH - rH) / W)\n', (660, 681), True, 'import numpy as np\n'), ((1108, 1128), 'numpy.sum', 'np.sum', (['imgsrc[y, x]'], {}), '(imgsrc[y, x])\n', (1114, 1128), True, 'import numpy as np\n'), ((2057, 2084), 'lib.kalgorithm.bgr2gray', 'kalg... |
from __future__ import division, print_function
import numpy as np
import datetime
import warnings
# Drawing tools
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
# Custom classes
from .box import *
from .chemistry import *
from .topology... | [
"numpy.maximum",
"matplotlib.pyplot.get_cmap",
"numpy.zeros",
"mpl_toolkits.mplot3d.art3d.Poly3DCollection",
"matplotlib.pyplot.figure",
"numpy.isclose",
"numpy.array",
"numpy.dot",
"datetime.datetime.now"
] | [((4311, 4462), 'numpy.array', 'np.array', (['[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [1.0, 1.0, 0.0], [0.0, 1.0, 0.0], [0.0, \n 0.0, 1.0], [1.0, 0.0, 1.0], [1.0, 1.0, 1.0], [0.0, 1.0, 1.0]]'], {}), '([[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [1.0, 1.0, 0.0], [0.0, 1.0, 0.0\n ], [0.0, 0.0, 1.0], [1.0, 0.0, 1.0], [1.0, 1.0, 1... |
import numpy as np
from Constants import Constants
from TARNet_Manager import TARNet_Manager
from Utils import Utils
class TARNet_Experiments:
def __init__(self, input_nodes, device):
self.data_loader_dict_test = None
self.data_loader_dict_val = None
self.input_nodes = input_nodes
... | [
"TARNet_Manager.TARNet_Manager",
"numpy.zeros",
"numpy.ones",
"Utils.Utils.create_tensors_to_train_DCN_semi_supervised",
"Utils.Utils.create_tensors_from_tuple",
"numpy.concatenate"
] | [((628, 697), 'Utils.Utils.create_tensors_from_tuple', 'Utils.create_tensors_from_tuple', (["data_loader_dict_val['treated_data']"], {}), "(data_loader_dict_val['treated_data'])\n", (659, 697), False, 'from Utils import Utils\n'), ((741, 810), 'Utils.Utils.create_tensors_from_tuple', 'Utils.create_tensors_from_tuple', ... |
"""
This file provides a dataset class for working with the UA-detrac tracking dataset.
Provides:
- plotting of 2D bounding boxes
- training/testing loader mode (random images from across all tracks) using __getitem__()
- track mode - returns a single image, in order, using __next__()
"""
import os,sys
imp... | [
"numpy.moveaxis",
"csv.reader",
"torchvision.transforms.functional.to_tensor",
"torch.sqrt",
"random.shuffle",
"torch.cat",
"numpy.clip",
"cv2.fillPoly",
"numpy.ones",
"torch.cos",
"numpy.random.randint",
"numpy.random.normal",
"cv2.rectangle",
"torchvision.transforms.Normalize",
"cv2.im... | [((4410, 4449), 'os.path.join', 'os.path.join', (['output_dir', '"""labels.cpkl"""'], {}), "(output_dir, 'labels.cpkl')\n", (4422, 4449), False, 'import os, sys\n'), ((4691, 4707), 'numpy.array', 'np.array', (['pil_im'], {}), '(pil_im)\n', (4699, 4707), True, 'import numpy as np\n'), ((5854, 5928), 'cv2.rectangle', 'cv... |
import threading
from collections import OrderedDict
from random import Random
from typing import Dict, Iterator, List, Optional, Union, Tuple
import numpy as np
from torch.utils.data import DataLoader, Dataset, Sampler
from rdkit import Chem
from .scaler import StandardScaler
from chemprop.features import get_featur... | [
"chemprop.features.is_reaction",
"chemprop.rdkit.make_mol",
"random.Random",
"numpy.isnan",
"chemprop.features.is_explicit_h",
"chemprop.features.get_features_generator",
"numpy.append",
"chemprop.features.MolGraph",
"numpy.array",
"rdkit.Chem.MolFromSmiles",
"threading.main_thread",
"threadin... | [((4011, 4024), 'chemprop.features.is_reaction', 'is_reaction', ([], {}), '()\n', (4022, 4024), False, 'from chemprop.features import is_explicit_h, is_reaction\n'), ((4054, 4069), 'chemprop.features.is_explicit_h', 'is_explicit_h', ([], {}), '()\n', (4067, 4069), False, 'from chemprop.features import is_explicit_h, is... |
import os
from platform import python_version_tuple
#if python_version_tuple()[0] == 3:
#xrange = range
xrange = range
import numpy as np
import pandas as pd
import cv2
import imhandle as imh
HEALTHY = 0
GLAUCOMA_OR_SUSPECT = 1
def extract_DRIONS_DB(db_folder, expert=1):
"""
Full images with polygonal ... | [
"imhandle.ImLibException",
"cv2.circle",
"imhandle.load_set",
"numpy.zeros",
"imhandle.resize_image_to_square",
"numpy.array",
"os.path.split",
"os.path.join"
] | [((10579, 10635), 'os.path.join', 'os.path.join', (['db_folder', '"""Drishti-GS1_files"""', '"""Training"""'], {}), "(db_folder, 'Drishti-GS1_files', 'Training')\n", (10591, 10635), False, 'import os\n'), ((10654, 10686), 'os.path.join', 'os.path.join', (['set_path', '"""Images"""'], {}), "(set_path, 'Images')\n", (106... |
# rough work to probe / understand / visualize
# the spherical multilevel grid data structures
# produced for a given input spherical polygon
# hopefully, this will help me discover some issues
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import proj3d
from mpl_tool... | [
"scipy.spatial.geometric_slerp",
"scipy.spatial.distance.cdist",
"copy.deepcopy",
"lib.produce_level_n_grid_centers",
"numpy.empty",
"numpy.allclose",
"numpy.zeros",
"lib.produce_level_1_grid_centers",
"mpl_toolkits.mplot3d.art3d.Poly3DCollection",
"matplotlib.pyplot.figure",
"matplotlib.use",
... | [((213, 234), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (227, 234), False, 'import matplotlib\n'), ((662, 724), 'numpy.array', 'np.array', (['[[0, 1, 0], [0, 0, 1], [-1, 0, 0]]'], {'dtype': 'np.float64'}), '([[0, 1, 0], [0, 0, 1], [-1, 0, 0]], dtype=np.float64)\n', (670, 724), True, 'import ... |
from statsmodels.compat.pandas import Appender, is_numeric_dtype
from typing import Sequence, Union
import numpy as np
import pandas as pd
from pandas.core.dtypes.common import is_categorical_dtype
from scipy import stats
from statsmodels.iolib.table import SimpleTable
from statsmodels.stats.stattools import jarque_... | [
"numpy.nanpercentile",
"numpy.sum",
"numpy.empty",
"numpy.floor",
"numpy.ones",
"numpy.isnan",
"statsmodels.tools.validation.bool_like",
"statsmodels.tools.docstring.Docstring",
"statsmodels.compat.pandas.is_numeric_dtype",
"pandas.core.dtypes.common.is_categorical_dtype",
"numpy.unique",
"sta... | [((19792, 19822), 'statsmodels.tools.docstring.Docstring', 'Docstring', (['Description.__doc__'], {}), '(Description.__doc__)\n', (19801, 19822), False, 'from statsmodels.tools.docstring import Docstring, Parameter\n'), ((610, 631), 'numpy.array', 'np.array', (['PERCENTILES'], {}), '(PERCENTILES)\n', (618, 631), True, ... |
import argparse
import numpy as np
import open3d as o3d
parser = argparse.ArgumentParser()
parser.add_argument('--file', type=str, default='../carla_results/auto_pilot_v3_42/eval_routes_06_12_23_30_25/lidar_360/0000.npy', help='npy point cloud')
def main():
pcd_npy = np.load(args.file)
pcd = o3d.geom... | [
"numpy.load",
"argparse.ArgumentParser",
"numpy.asarray",
"open3d.geometry.PointCloud",
"open3d.visualization.draw_geometries",
"open3d.utility.Vector3dVector"
] | [((70, 95), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (93, 95), False, 'import argparse\n'), ((282, 300), 'numpy.load', 'np.load', (['args.file'], {}), '(args.file)\n', (289, 300), True, 'import numpy as np\n'), ((312, 337), 'open3d.geometry.PointCloud', 'o3d.geometry.PointCloud', ([], {})... |
import gudhi
import numpy as np
from numpy import matlib
import random
import gensim
from gensim.models import Word2Vec
import scipy.sparse
# Some function that will be useful for the rest of the code
def signed_faces(s):
## returns the faces of the simplex s
ret = []
for i in range(0, len(s)):
ret... | [
"numpy.random.seed",
"gensim.models.Word2Vec",
"numpy.arange",
"numpy.random.choice",
"numpy.random.shuffle"
] | [((3892, 3913), 'numpy.arange', 'np.arange', (['P.shape[0]'], {}), '(P.shape[0])\n', (3901, 3913), True, 'import numpy as np\n'), ((5599, 5689), 'gensim.models.Word2Vec', 'Word2Vec', (['walks_str'], {'size': 'emb_dim', 'window': '(3)', 'min_count': '(0)', 'sg': '(1)', 'workers': '(1)', 'iter': 'epochs'}), '(walks_str, ... |
import numpy as np
import random
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import cv2
class EnvMoveTogether(object):
def __init__(self):
self.raw_occupancy = np.zeros((15, 15))
for i in range(15):
self.raw_occupancy[0, i] = 1
self.ra... | [
"matplotlib.pyplot.show",
"cv2.waitKey",
"matplotlib.pyplot.yticks",
"numpy.zeros",
"numpy.ones",
"cv2.imshow",
"matplotlib.pyplot.figure",
"cv2.rectangle",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.xticks"
] | [((210, 228), 'numpy.zeros', 'np.zeros', (['(15, 15)'], {}), '((15, 15))\n', (218, 228), True, 'import numpy as np\n'), ((8824, 8844), 'numpy.ones', 'np.ones', (['(15, 15, 3)'], {}), '((15, 15, 3))\n', (8831, 8844), True, 'import numpy as np\n'), ((9646, 9665), 'numpy.zeros', 'np.zeros', (['(3, 3, 3)'], {}), '((3, 3, 3... |
import numpy as np
from trimesh import Scene
class SmplScene(Scene):
def calculate_regressor(self):
mesh = self.geometry['geometry_0']
joint = self.geometry['joint_0']
ray_direction = np.eye(3)
mesh.clos
locations, index_ray, index_tri = mesh.ray.intersects_location(
... | [
"numpy.eye"
] | [((219, 228), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (225, 228), True, 'import numpy as np\n')] |
import numpy as np
from skimage.color import rgb2hsv
from skimage.io import imread # skimage.io.imsave seems to be broken?
from scipy.misc import imsave
from tempfile import mkdtemp
from os import path
from shutil import rmtree
hsv_dtype = np.dtype([('H', float), ('S', float), ('V', float)])
rgb_dtype = np.dtype([('R'... | [
"numpy.ix_",
"numpy.dtype",
"tempfile.mkdtemp",
"numpy.arange",
"scipy.misc.imsave",
"shutil.rmtree",
"os.path.join",
"skimage.io.imread"
] | [((241, 293), 'numpy.dtype', 'np.dtype', (["[('H', float), ('S', float), ('V', float)]"], {}), "([('H', float), ('S', float), ('V', float)])\n", (249, 293), True, 'import numpy as np\n'), ((306, 358), 'numpy.dtype', 'np.dtype', (["[('R', float), ('G', float), ('B', float)]"], {}), "([('R', float), ('G', float), ('B', f... |
import torch
import numpy as np
from scipy.io.wavfile import write
from audio.audio_processing import griffin_lim
def get_mel_from_wav(audio, _stft):
audio = torch.clip(torch.FloatTensor(audio).unsqueeze(0), -1, 1)
audio = torch.autograd.Variable(audio, requires_grad=False)
melspec, energy = _stft.mel_sp... | [
"numpy.maximum",
"torch.stack",
"torch.autograd.Variable",
"torch.FloatTensor",
"torch.mm",
"scipy.io.wavfile.write",
"torch.squeeze"
] | [((234, 285), 'torch.autograd.Variable', 'torch.autograd.Variable', (['audio'], {'requires_grad': '(False)'}), '(audio, requires_grad=False)\n', (257, 285), False, 'import torch\n'), ((571, 589), 'torch.stack', 'torch.stack', (['[mel]'], {}), '([mel])\n', (582, 589), False, 'import torch\n'), ((760, 804), 'torch.mm', '... |
import numpy as np
from Grid.GridProcessing import grid
from Shapes.ShapesFunctions import *
# Specify the file that includes dynamic systems
from dynamics.DubinsCar4D import *
import scipy.io as sio
import math
""" USER INTERFACES
- Define grid
- Generate initial values for grid using shape functions
- Time le... | [
"numpy.array",
"numpy.zeros",
"numpy.arange"
] | [((1468, 1536), 'numpy.arange', 'np.arange', ([], {'start': '(0)', 'stop': '(lookback_length + small_number)', 'step': 't_step'}), '(start=0, stop=lookback_length + small_number, step=t_step)\n', (1477, 1536), True, 'import numpy as np\n'), ((1105, 1143), 'numpy.array', 'np.array', (['[-5.0, -5.0, -1.0, -math.pi]'], {}... |
# Copyright 2020 The OATomobile 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... | [
"os.remove",
"numpy.load",
"numpy.linalg.norm",
"os.path.join",
"tensorflow.TensorShape",
"numpy.transpose",
"oatomobile.envs.carla.CARLANavEnv",
"numpy.arccos",
"matplotlib.pyplot.subplots",
"tqdm.tqdm",
"numpy.asarray",
"wget.download",
"oatomobile.util.graphics.lidar_2darray_to_rgb",
"o... | [((2559, 2597), 'os.makedirs', 'os.makedirs', (['output_dir'], {'exist_ok': '(True)'}), '(output_dir, exist_ok=True)\n', (2570, 2597), False, 'import os\n'), ((2812, 2851), 'wget.download', 'wget.download', ([], {'url': 'self.url', 'out': 'zfname'}), '(url=self.url, out=zfname)\n', (2825, 2851), False, 'import wget\n')... |
__author__ = "ajshajib", "sibirrer"
"""
Multi-Gaussian expansion fitting, based on Capellari 2002, http://adsabs.harvard.edu/abs/2002MNRAS.333..400C
"""
import numpy as np
from scipy.optimize import nnls
import warnings
from lenstronomy.LightModel.Profiles.gaussian import Gaussian
gaussian_func = Gaussian()
def gaus... | [
"scipy.optimize.nnls",
"numpy.arange",
"numpy.linspace",
"warnings.warn",
"numpy.log10",
"lenstronomy.LightModel.Profiles.gaussian.Gaussian",
"numpy.sqrt"
] | [((299, 309), 'lenstronomy.LightModel.Profiles.gaussian.Gaussian', 'Gaussian', ([], {}), '()\n', (307, 309), False, 'from lenstronomy.LightModel.Profiles.gaussian import Gaussian\n'), ((1757, 1778), 'numpy.arange', 'np.arange', (['A.shape[1]'], {}), '(A.shape[1])\n', (1766, 1778), True, 'import numpy as np\n'), ((1854,... |
from pathlib import Path
import torch
import glob
import numpy as np
from lib.pc_utils import read_plyfile, save_point_cloud
from concurrent.futures import ProcessPoolExecutor
SCANNET_DATA_RAW_PATH = Path('/home/aidrive1/workspace/luoly/dataset/scn/scan_dataset/')
SCANNET_LABEL_RAW_PATH = Path('/home/aidrive1/workspace... | [
"numpy.zeros_like",
"lib.pc_utils.read_plyfile",
"concurrent.futures.ProcessPoolExecutor",
"torch.load",
"lib.pc_utils.save_point_cloud",
"numpy.allclose",
"pathlib.Path",
"numpy.array",
"numpy.unique"
] | [((200, 264), 'pathlib.Path', 'Path', (['"""/home/aidrive1/workspace/luoly/dataset/scn/scan_dataset/"""'], {}), "('/home/aidrive1/workspace/luoly/dataset/scn/scan_dataset/')\n", (204, 264), False, 'from pathlib import Path\n'), ((290, 352), 'pathlib.Path', 'Path', (['"""/home/aidrive1/workspace/luoly/dataset/scn/scan_l... |
import time
import numpy as np
import pandas as pd
"""Function to take user input
1 user input is taken :
1. input_images : As set of 3 input image nodes taken from the user for PPR Algorithm
"""
def userInput():
input_nodes = []
print('Please enter input image IDs :')
for _ in range(0, 3):
... | [
"numpy.sum",
"pandas.read_csv",
"numpy.zeros",
"time.time",
"numpy.linalg.norm",
"numpy.dot"
] | [((1189, 1204), 'numpy.zeros', 'np.zeros', (['nodes'], {}), '(nodes)\n', (1197, 1204), True, 'import numpy as np\n'), ((1226, 1241), 'numpy.zeros', 'np.zeros', (['nodes'], {}), '(nodes)\n', (1234, 1241), True, 'import numpy as np\n'), ((2176, 2187), 'time.time', 'time.time', ([], {}), '()\n', (2185, 2187), False, 'impo... |
# Script to produce plots showing path taken by various optimisers
# from:
#
# <NAME>. 2012. Retreival of Forest Structure and Biomass From Radar Data using
# Backscatter Modelling and Inversion. PhD Thesis. Aberystwyth University.
#
# Using the Rosenbrock function:
# http://en.wikipedia.org/wiki/Rosenbrock_function
#... | [
"matplotlib.pyplot.xlim",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"numpy.ones",
"matplotlib.pyplot.colorbar",
"matplotlib.path.Path",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.contour"... | [((1355, 1372), 'numpy.array', 'np.array', (['allvecs'], {}), '(allvecs)\n', (1363, 1372), True, 'import numpy as np\n'), ((1387, 1412), 'numpy.arange', 'np.arange', (['(-2.1)', '(2.1)', '(0.1)'], {}), '(-2.1, 2.1, 0.1)\n', (1396, 1412), True, 'import numpy as np\n'), ((1420, 1436), 'numpy.ones', 'np.ones', (['x0.size'... |
import os
from astropy.io import fits
from os.path import split, splitext
from random import randint
from glob import glob
import numpy as np
import torch
from scipy.ndimage import rotate
from torch.utils.data import Dataset
from torchvision.transforms import Compose, Lambda, ToTensor, Normalize, Pad
from PIL import Im... | [
"numpy.pad",
"numpy.load",
"random.randint",
"PIL.Image.open",
"numpy.array",
"astropy.io.fits.open",
"torchvision.transforms.Normalize",
"os.path.split",
"os.path.join",
"scipy.ndimage.rotate",
"torch.tensor",
"torchvision.transforms.ToTensor"
] | [((476, 520), 'os.path.join', 'os.path.join', (['"""./datasets"""', 'opt.dataset_name'], {}), "('./datasets', opt.dataset_name)\n", (488, 520), False, 'import os\n'), ((8843, 8854), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (8851, 8854), True, 'import numpy as np\n'), ((9263, 9332), 'numpy.pad', 'np.pad', (['x']... |
import numpy as np
from Graphs import *
## I DON'T THINK THIS WORKS? ##
def makeAcyclic(N):
R = np.zeros([N,N])
for x in range(N):
for y in range(x):
R[x,y] = random.choice([1,1,0,0,0,0])
return R
def booleanProduct(A,B):
n = np.shape(A)[0]
E = np.zeros(np.shap... | [
"numpy.shape",
"numpy.zeros"
] | [((110, 126), 'numpy.zeros', 'np.zeros', (['[N, N]'], {}), '([N, N])\n', (118, 126), True, 'import numpy as np\n'), ((280, 291), 'numpy.shape', 'np.shape', (['A'], {}), '(A)\n', (288, 291), True, 'import numpy as np\n'), ((313, 324), 'numpy.shape', 'np.shape', (['A'], {}), '(A)\n', (321, 324), True, 'import numpy as np... |
# -*- coding: utf-8 -*-
"""
@Title:
Identifiability and predictability of
integer- and fractional-order epidemiological models
using physics-informed neural networks
@author:
<NAME> & <NAME>
Division of Applied Mathematics
Brown University
<EMAIL>
Created on 2020
"""
impo... | [
"matplotlib.pyplot.yscale",
"matplotlib.dates.MonthLocator",
"tensorflow.square",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.multiply",
"tensorflow.Variable",
"numpy.arange",
"tensorflow.ConfigProto",
"tensorflow.truncated_normal",
"scipy.special.jacobi",
"numpy.transpose",
"tens... | [((328, 366), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../Utilities/"""'], {}), "(0, '../../Utilities/')\n", (343, 366), False, 'import sys\n'), ((1096, 1107), 'time.time', 'time.time', ([], {}), '()\n', (1105, 1107), False, 'import time\n'), ((16814, 16847), 'numpy.loadtxt', 'np.loadtxt', (['"""Data/Infec... |
""" modified vibration.py for internal coordinate hessian fitting
"""
from __future__ import division
from builtins import zip
from builtins import range
import os
import shutil
from forcebalance.nifty import col, eqcgmx, flat, floatornan, fqcgmx, invert_svd, kb, printcool, bohr2ang, warn_press_key, pvec1d, pmat2d
imp... | [
"numpy.sum",
"numpy.abs",
"numpy.ones",
"mpl_toolkits.axes_grid1.axes_size.Fraction",
"numpy.linalg.norm",
"os.path.join",
"builtins.range",
"matplotlib.pyplot.tight_layout",
"mpl_toolkits.axes_grid1.axes_size.AxesY",
"numpy.savetxt",
"matplotlib.pyplot.colorbar",
"forcebalance.output.getLogge... | [((925, 944), 'forcebalance.output.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (934, 944), False, 'from forcebalance.output import getLogger\n'), ((9798, 9811), 'numpy.ones', 'np.ones', (['size'], {}), '(size)\n', (9805, 9811), True, 'import numpy as np\n'), ((11585, 11603), 'matplotlib.pyplot.tight_la... |
import gym, random
import numpy as np
import copy
from astar import AStar
from tqdm import tqdm
def _find_stack(stacks, item):
for stack_id, stack in enumerate(stacks):
if stack[0] == item:
return stack, stack_id
return None, None
def _get_state_string(state):
return [tuple(o) for o in state]
def _state_eq... | [
"numpy.delete",
"numpy.empty",
"copy.copy",
"numpy.insert",
"numpy.array",
"boxworld.BoxworldEnv"
] | [((689, 701), 'copy.copy', 'copy.copy', (['s'], {}), '(s)\n', (698, 701), False, 'import copy\n'), ((1004, 1028), 'numpy.delete', 'np.delete', (['stack_from', '(0)'], {}), '(stack_from, 0)\n', (1013, 1028), True, 'import numpy as np\n'), ((1050, 1078), 'numpy.insert', 'np.insert', (['stack_to', '(0)', 'what'], {}), '(s... |
import numpy as np
import copy
from parameters_combinator import ParametersCombinator
import ipdb
def model_factory(model_type, model_config):
if model_type == 'hmmlearn\'s HMM':
import hmmlearn.hmm
model = hmmlearn.hmm.GaussianHMM(
params="mct",
init_params="cmt",
... | [
"parameters_combinator.ParametersCombinator",
"numpy.zeros"
] | [((760, 794), 'parameters_combinator.ParametersCombinator', 'ParametersCombinator', (['model_config'], {}), '(model_config)\n', (780, 794), False, 'from parameters_combinator import ParametersCombinator\n'), ((414, 436), 'numpy.zeros', 'np.zeros', (['n_components'], {}), '(n_components)\n', (422, 436), True, 'import nu... |
import numpy as np
import pandas as pd
from graphviz import Digraph
from math import log2
from sklearn.datasets import load_iris
class TreeNode:
def __init__(self):
self.leftChild = None
self.rightChild = None
def insertLeft(self, newNode):
self.leftChild = newNode
def insertRigh... | [
"pandas.DataFrame",
"sklearn.datasets.load_iris",
"pandas.read_csv",
"numpy.random.randint",
"graphviz.Digraph",
"math.log2"
] | [((537, 548), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (546, 548), False, 'from sklearn.datasets import load_iris\n'), ((557, 583), 'pandas.DataFrame', 'pd.DataFrame', (["iris['data']"], {}), "(iris['data'])\n", (569, 583), True, 'import pandas as pd\n'), ((1061, 1126), 'pandas.read_csv', 'pd.read_c... |
import numpy
from chainer.backends import cuda
from chainer import optimizer
_default_hyperparam = optimizer.Hyperparameter()
_default_hyperparam.lr = 0.001
_default_hyperparam.eps = 1e-16
class SMORMS3Rule(optimizer.UpdateRule):
"""Update rule for <NAME>'s SMORMS3.
See :class:`~chainer.optimizers.SMORMS... | [
"numpy.minimum",
"chainer.backends.cuda.get_array_module",
"chainer.backends.cuda.get_device_from_array",
"chainer.optimizer.HyperparameterProxy",
"numpy.sqrt",
"chainer.backends.cuda.elementwise",
"chainer.optimizer.Hyperparameter"
] | [((102, 128), 'chainer.optimizer.Hyperparameter', 'optimizer.Hyperparameter', ([], {}), '()\n', (126, 128), False, 'from chainer import optimizer\n'), ((3058, 3093), 'chainer.optimizer.HyperparameterProxy', 'optimizer.HyperparameterProxy', (['"""lr"""'], {}), "('lr')\n", (3087, 3093), False, 'from chainer import optimi... |
"""
SMPTE 240M Colourspace
======================
Defines the *SMPTE 240M* colourspace:
- :attr:`colour.models.RGB_COLOURSPACE_SMPTE_240M`.
References
----------
- :cite:`SocietyofMotionPictureandTelevisionEngineers1999b` : Society of
Motion Picture and Television Engineers. (1999). ANSI/SMPTE 240M-1995 -
... | [
"colour.models.rgb.RGB_Colourspace",
"colour.models.rgb.normalised_primary_matrix",
"numpy.linalg.inv",
"numpy.array"
] | [((1266, 1320), 'numpy.array', 'np.array', (['[[0.63, 0.34], [0.31, 0.595], [0.155, 0.07]]'], {}), '([[0.63, 0.34], [0.31, 0.595], [0.155, 0.07]])\n', (1274, 1320), True, 'import numpy as np\n'), ((1737, 1811), 'colour.models.rgb.normalised_primary_matrix', 'normalised_primary_matrix', (['PRIMARIES_SMPTE_240M', 'CCS_WH... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.