code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Tests for reverberation time related things. """
from pytest import raises
import numpy as np
import numpy.testing as npt
import roomacoustics as ra
def test_rt_from_edc():
times = np.linspace(0, 1.5, 2**9)
m = -60
edc = times * m
edc_exp = 10**(edc... | [
"numpy.testing.assert_allclose",
"numpy.linspace",
"pytest.raises",
"roomacoustics.reverberation_time_energy_decay_curve"
] | [((240, 267), 'numpy.linspace', 'np.linspace', (['(0)', '(1.5)', '(2 ** 9)'], {}), '(0, 1.5, 2 ** 9)\n', (251, 267), True, 'import numpy as np\n'), ((576, 603), 'numpy.linspace', 'np.linspace', (['(0)', '(1.5)', '(2 ** 9)'], {}), '(0, 1.5, 2 ** 9)\n', (587, 603), True, 'import numpy as np\n'), ((430, 491), 'roomacousti... |
# -*- coding: utf-8 -*-
import unittest
import logging
import numpy as np
from votesim.votemethods import irv
import votesim
logger = logging.getLogger(__name__)
class TestIRV(unittest.TestCase):
def test_tie(self):
print('TEST TIE #1')
d = [[1, 2,],
[2, 1,]]
... | [
"logging.getLogger",
"votesim.votemethods.tools.score2rank",
"votesim.votemethods.irv.irv_stv",
"votesim.votemethods.irv.irv_eliminate",
"votesim.votemethods.irv.rcv_reorder",
"numpy.sort",
"numpy.in1d",
"numpy.array",
"numpy.all",
"votesim.votemethods.irv.irv",
"numpy.random.RandomState"
] | [((137, 164), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (154, 164), False, 'import logging\n'), ((341, 358), 'votesim.votemethods.irv.irv_stv', 'irv.irv_stv', (['d', '(1)'], {}), '(d, 1)\n', (352, 358), False, 'from votesim.votemethods import irv\n'), ((393, 406), 'votesim.votemethod... |
# -*- coding: utf-8 -*-
# @Time : 16/1/2019 10:26 AM
# @Description :
# @Author : <NAME>
# @Email : <EMAIL>
# @File : loss_utils.py
import tensorflow as tf
import os
import sys
sys.path.append(os.path.dirname(os.getcwd()))
from Common import pc_util
sys.path.append(os.path.join(os.getcwd(),"... | [
"tensorflow.unstack",
"tensorflow.shape",
"numpy.sqrt",
"tensorflow.transpose",
"tensorflow.reduce_sum",
"tensorflow.nn.moments",
"math.sqrt",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits",
"tensorflow.negative",
"numpy.array",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tf_appr... | [((1310, 1388), 'tensorflow.nn.sparse_softmax_cross_entropy_with_logits', 'tf.nn.sparse_softmax_cross_entropy_with_logits', ([], {'logits': 'pre_label', 'labels': 'label'}), '(logits=pre_label, labels=label)\n', (1356, 1388), True, 'import tensorflow as tf\n'), ((1409, 1429), 'tensorflow.reduce_mean', 'tf.reduce_mean',... |
# tests.dataset
# Helper functions for tests that utilize downloadable datasets.
#
# Author: <NAME> <<EMAIL>>
# Created: Thu Oct 13 19:55:53 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: dataset.py [8f4de77] <EMAIL> $
"""
Helper functions for tests that util... | [
"os.path.exists",
"hashlib.sha256",
"os.listdir",
"zipfile.ZipFile",
"os.path.join",
"requests.get",
"os.path.dirname",
"os.path.basename",
"os.mkdir",
"shutil.rmtree",
"sklearn.datasets.base.Bunch",
"numpy.genfromtxt"
] | [((2665, 2690), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (2680, 2690), False, 'import os\n'), ((3328, 3344), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (3342, 3344), False, 'import hashlib\n'), ((4303, 4324), 'os.path.basename', 'os.path.basename', (['url'], {}), '(url)\n', (... |
from __future__ import division
from nose.tools import *
import numpy as np
import causalinference.causal as c
from utils import random_data
def test_est_propensity():
D = np.array([0, 0, 0, 1, 1, 1])
X = np.array([[7, 8], [3, 10], [7, 10], [4, 7], [5, 10], [9, 8]])
Y = random_data(D_cur=D, X_cur=X)
causal = c.... | [
"causalinference.causal.sumlessthan",
"causalinference.causal.select_cutoff",
"numpy.allclose",
"causalinference.causal.parse_qua_terms",
"numpy.log",
"numpy.array",
"utils.random_data",
"causalinference.causal.CausalModel",
"causalinference.causal.parse_lin_terms",
"causalinference.causal.split_e... | [((177, 205), 'numpy.array', 'np.array', (['[0, 0, 0, 1, 1, 1]'], {}), '([0, 0, 0, 1, 1, 1])\n', (185, 205), True, 'import numpy as np\n'), ((211, 272), 'numpy.array', 'np.array', (['[[7, 8], [3, 10], [7, 10], [4, 7], [5, 10], [9, 8]]'], {}), '([[7, 8], [3, 10], [7, 10], [4, 7], [5, 10], [9, 8]])\n', (219, 272), True, ... |
"""
utility functions for narps analysis
"""
import os
import glob
import nilearn.input_data
import numpy
import pandas
import nibabel
from scipy.stats import norm, t
import scipy.stats
from datetime import datetime
from sklearn.metrics import cohen_kappa_score
def stringify_dict(d):
"""create a pretty version o... | [
"numpy.sqrt",
"pandas.read_csv",
"nibabel.load",
"pandas.read_excel",
"os.remove",
"os.path.exists",
"numpy.mean",
"pandas.melt",
"scipy.stats.t.cdf",
"numpy.eye",
"nibabel.save",
"numpy.ones",
"scipy.stats.norm.ppf",
"os.path.dirname",
"numpy.random.randn",
"os.path.join",
"sklearn.... | [((1838, 1864), 'numpy.nan_to_num', 'numpy.nan_to_num', (['maskdata'], {}), '(maskdata)\n', (1854, 1864), False, 'import numpy\n'), ((2549, 2638), 'os.path.join', 'os.path.join', (['output_dir', "('%s_concat_%s' % (imgtype, dataset))", "('hypo%d.nii.gz' % hyp)"], {}), "(output_dir, '%s_concat_%s' % (imgtype, dataset), ... |
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 01 19:20:16 2010
Author: josef-pktd
"""
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
nobs = 1000
r = stats.pareto.rvs(1, size=nobs)
#rhisto = np.histogram(r, bins=20)
rhisto, e = np.histogram(np.clip(r, 0 , 1000), bins=50)
plt.figure()
pl... | [
"numpy.clip",
"scipy.stats.pareto.rvs",
"numpy.log",
"numpy.diff",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((182, 212), 'scipy.stats.pareto.rvs', 'stats.pareto.rvs', (['(1)'], {'size': 'nobs'}), '(1, size=nobs)\n', (198, 212), False, 'from scipy import stats\n'), ((305, 317), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (315, 317), True, 'import matplotlib.pyplot as plt\n'), ((364, 376), 'matplotlib.pyplot.f... |
# -*- coding: utf-8 -*-
"""Created on Mon Oct 19.
@author: dejh
"""
import numpy as np
from landlab import Component
class SteepnessFinder(Component):
"""This component calculates steepness indices, sensu Wobus et al. 2006,
for a Landlab landscape. Follows broadly the approach used in
GeomorphTools, g... | [
"numpy.mean",
"numpy.log10",
"numpy.logical_and",
"numpy.ma.array",
"numpy.searchsorted",
"numpy.arange",
"numpy.array",
"numpy.empty_like",
"numpy.interp",
"numpy.cumsum",
"numpy.all",
"numpy.divide"
] | [((13743, 13779), 'numpy.empty_like', 'np.empty_like', (['ch_nodes'], {'dtype': 'float'}), '(ch_nodes, dtype=float)\n', (13756, 13779), True, 'import numpy as np\n'), ((13864, 13931), 'numpy.cumsum', 'np.cumsum', (['self._grid.length_of_d8[ch_links[:-1]]'], {'out': 'ch_dists[1:]'}), '(self._grid.length_of_d8[ch_links[:... |
import os
from typing import List, NamedTuple
import numpy as np
import torch
from torch.optim import Optimizer
from torch.optim.lr_scheduler import _LRScheduler
from mcp.config.evaluation import BestWeightsMetric
from mcp.data.dataloader.dataloader import DataLoader, FewShotDataLoader
from mcp.model.base import Mode... | [
"numpy.asarray",
"os.path.join",
"mcp.utils.logging.create_logger"
] | [((493, 516), 'mcp.utils.logging.create_logger', 'create_logger', (['__name__'], {}), '(__name__)\n', (506, 516), False, 'from mcp.utils.logging import create_logger\n'), ((6313, 6363), 'os.path.join', 'os.path.join', (['self.save_path', 'f"""model-{epoch}.pth"""'], {}), "(self.save_path, f'model-{epoch}.pth')\n", (632... |
import numpy
from shapely.geometry import Point
import geopandas
def simulated_geo_points(in_data, needed, seed) -> geopandas.GeoDataFrame:
"""
Simulate points using a geopandas dataframse with geometry as reference.
Parameters
----------
in_data: geopandas.GeoDataFrame
the geodataframe c... | [
"shapely.geometry.Point",
"geopandas.GeoDataFrame",
"numpy.random.seed",
"numpy.random.uniform"
] | [((1456, 1479), 'numpy.random.seed', 'numpy.random.seed', (['seed'], {}), '(seed)\n', (1473, 1479), False, 'import numpy\n'), ((2198, 2287), 'geopandas.GeoDataFrame', 'geopandas.GeoDataFrame', (['simulated_points_list'], {'columns': "['geometry']", 'crs': 'in_data.crs'}), "(simulated_points_list, columns=['geometry'], ... |
import numpy as np
from math import ceil
def deriveSizeFromScale(img_shape, scale):
output_shape = []
for k in range(2):
output_shape.append(int(ceil(scale[k] * img_shape[k])))
return output_shape
def deriveScaleFromSize(img_shape_in, img_shape_out):
scale = []
for k in range(2):
s... | [
"numpy.clip",
"numpy.argsort",
"numpy.array",
"numpy.mod",
"numpy.arange",
"numpy.multiply",
"numpy.random.random",
"numpy.linspace",
"numpy.floor",
"numpy.any",
"numpy.squeeze",
"numpy.around",
"matplotlib.pyplot.show",
"numpy.copy",
"math.ceil",
"numpy.absolute",
"numpy.sum",
"nu... | [((456, 470), 'numpy.absolute', 'np.absolute', (['x'], {}), '(x)\n', (467, 470), True, 'import numpy as np\n'), ((483, 506), 'numpy.multiply', 'np.multiply', (['absx', 'absx'], {}), '(absx, absx)\n', (494, 506), True, 'import numpy as np\n'), ((519, 543), 'numpy.multiply', 'np.multiply', (['absx2', 'absx'], {}), '(absx... |
import gym
import gym.spaces
import numpy as np
class NormalizeActionSpace(gym.ActionWrapper):
"""Normalize a Box action space to [-1, 1]^n."""
def __init__(self, env):
super().__init__(env)
assert isinstance(env.action_space, gym.spaces.Box)
self.action_space = gym.spaces.Box(
... | [
"numpy.ones_like"
] | [((384, 418), 'numpy.ones_like', 'np.ones_like', (['env.action_space.low'], {}), '(env.action_space.low)\n', (396, 418), True, 'import numpy as np\n'), ((331, 365), 'numpy.ones_like', 'np.ones_like', (['env.action_space.low'], {}), '(env.action_space.low)\n', (343, 365), True, 'import numpy as np\n')] |
import tensorflow as tf
import algos_tf14.models
from common import tr_helpers, experience, env_configurations
import numpy as np
import collections
import time
from collections import deque
from tensorboardX import SummaryWriter
from datetime import datetime
from algos_tf14.tensorflow_utils import TensorFlowVariables
... | [
"common.tr_helpers.free_mem",
"tensorflow.reduce_sum",
"tensorflow.nn.softmax",
"common.tr_helpers.LinearValueProcessor",
"tensorflow.reduce_mean",
"algos_tf14.tensorflow_utils.TensorFlowVariables",
"numpy.mean",
"collections.deque",
"common.experience.ReplayBuffer",
"numpy.random.random",
"comm... | [((854, 896), 'tensorflow.constant', 'tf.constant', (['(1)'], {'shape': '()', 'dtype': 'tf.float32'}), '(1, shape=(), dtype=tf.float32)\n', (865, 896), True, 'import tensorflow as tf\n'), ((929, 972), 'tensorflow.placeholder', 'tf.placeholder', (['"""float32"""', '()'], {'name': '"""lr_ph"""'}), "('float32', (), name='... |
import itertools
import numpy as np
from scipy import ndimage
class ObjectiveFunction:
def __init__(self, msg=True):
self.flist = [
"totalWeight",
"solSize",
"crossCount",
"fillCount",
"maxConnectedEmpties"
]
self.registeredFuncs ... | [
"numpy.sum",
"scipy.ndimage.label"
] | [((820, 845), 'numpy.sum', 'np.sum', (['(puzzle.cover == 2)'], {}), '(puzzle.cover == 2)\n', (826, 845), True, 'import numpy as np\n'), ((991, 1016), 'numpy.sum', 'np.sum', (['(puzzle.cover >= 1)'], {}), '(puzzle.cover >= 1)\n', (997, 1016), True, 'import numpy as np\n'), ((1411, 1439), 'scipy.ndimage.label', 'ndimage.... |
import argparse
import numpy as np
import time
from brainflow.board_shim import BoardShim, BrainFlowInputParams, LogLevels, BoardIds
def initialize_board(name='SYNTHETIC',port = None):
if name == 'SYNTHETIC':
BoardShim.enable_dev_board_logger()
# use synthetic board for demo
params = Brain... | [
"brainflow.board_shim.BoardShim.enable_dev_board_logger",
"brainflow.board_shim.BoardShim",
"brainflow.board_shim.BoardShim.get_accel_channels",
"brainflow.board_shim.BrainFlowInputParams",
"brainflow.board_shim.BoardShim.get_sampling_rate",
"numpy.floor",
"brainflow.board_shim.BoardShim.log_message",
... | [((1565, 1576), 'time.time', 'time.time', ([], {}), '()\n', (1574, 1576), False, 'import time\n'), ((1581, 1671), 'brainflow.board_shim.BoardShim.log_message', 'BoardShim.log_message', (['LogLevels.LEVEL_INFO.value', '"""start sleeping in the main thread"""'], {}), "(LogLevels.LEVEL_INFO.value,\n 'start sleeping in ... |
"""
This code is based on https://github.com/ekwebb/fNRI which in turn is based on https://github.com/ethanfetaya/NRI
(MIT licence)
"""
from __future__ import division
from __future__ import print_function
import torch
import argparse
import csv
import datetime
import os
import pickle
import time
import numpy as np
i... | [
"numpy.prod",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"torch.LongTensor",
"numpy.log",
"torch.max",
"torch.exp",
"torch.min",
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"numpy.arange",
"numpy.mean",
"argparse.ArgumentParser",
"trajectory_plot.draw_lines",... | [((455, 480), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (478, 480), False, 'import argparse\n'), ((8263, 8288), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (8277, 8288), True, 'import numpy as np\n'), ((8289, 8317), 'torch.manual_seed', 'torch.manual_seed',... |
# Copyright 2018 The trfl Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
"tensorflow.compat.v1.placeholder",
"tree.flatten",
"tensorflow.compat.v1.reduce_sum",
"tensorflow.compat.v1.TensorShape",
"numpy.log",
"absl.testing.parameterized.named_parameters",
"trfl.discrete_policy_gradient_ops.sequence_advantage_actor_critic_loss",
"trfl.discrete_policy_gradient_ops.discrete_p... | [((6516, 6595), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["('SingleAction', False)", "('MultiActions', True)"], {}), "(('SingleAction', False), ('MultiActions', True))\n", (6546, 6595), False, 'from absl.testing import parameterized\n'), ((1228, 1307), 'absl.testing.parameterize... |
from __future__ import print_function
import logging
import pprint
import math
import numpy
import traceback
import operator
import theano
from six.moves import input
from picklable_itertools.extras import equizip
from theano import tensor
from blocks.bricks import Tanh, Initializable
from blocks.bricks.base import a... | [
"logging.getLogger",
"blocks.initialization.Orthogonal",
"theano.tensor.ones",
"blocks.bricks.attention.SequenceContentAttention",
"fuel.datasets.OneBillionWord",
"numpy.array",
"blocks.bricks.parallel.Fork",
"blocks.graph.ComputationGraph",
"fuel.transformers.Filter",
"operator.itemgetter",
"si... | [((1600, 1627), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1617, 1627), False, 'import logging\n'), ((2539, 2589), 'math.isnan', 'math.isnan', (["log.current_row['total_gradient_norm']"], {}), "(log.current_row['total_gradient_norm'])\n", (2549, 2589), False, 'import math\n'), ((2986... |
import math
import random
import matplotlib.pyplot as plt
import numpy as np
from collections import deque, namedtuple
from PIL import Image
from th10.game import TH10
from config import *
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision.transforms as ... | [
"torch.max",
"torchvision.transforms.Grayscale",
"torch.min",
"numpy.array",
"torch.cuda.is_available",
"math.exp",
"torch.nn.BatchNorm2d",
"collections.deque",
"random.sample",
"collections.namedtuple",
"random.randrange",
"torchvision.transforms.Resize",
"torch.cat",
"torch.load",
"tor... | [((400, 406), 'th10.game.TH10', 'TH10', ([], {}), '()\n', (404, 406), False, 'from th10.game import TH10\n'), ((416, 423), 'collections.deque', 'deque', ([], {}), '()\n', (421, 423), False, 'from collections import deque, namedtuple\n'), ((2297, 2385), 'collections.namedtuple', 'namedtuple', (['"""Transition"""', "('st... |
# -*- coding: utf-8 -*-
"""
eTOX ALLIES Applicability Domain Analysis
As described in:
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>.,
<NAME>. and <NAME>. "eTOX ALLIES: an automated pipeLine for linear
interaction energy-based simulations" Journal of Cheminformatics, 2017, 9, 58.
http://doi.org/10.1186/s13321-017-0243-x... | [
"pylie.model.liemdframe.LIEMDFrame",
"pandas.read_csv",
"re.compile",
"numpy.array",
"numpy.dot",
"pandas.DataFrame",
"numpy.divide"
] | [((988, 1036), 'pandas.read_csv', 'pandas.read_csv', (['ene_file'], {'delim_whitespace': '(True)'}), '(ene_file, delim_whitespace=True)\n', (1003, 1036), False, 'import pandas\n'), ((1094, 1108), 'pylie.model.liemdframe.LIEMDFrame', 'LIEMDFrame', (['df'], {}), '(df)\n', (1104, 1108), False, 'from pylie.model.liemdframe... |
import numpy as np
import argparse
import imutils
import sys
import cv2
from utils.recorder import Recorder
import os
from detectors.get_path import getPath
ap = argparse.ArgumentParser()
ap.add_argument("--video", type=str, default="",
help="optional path to video file")
args = vars(ap.parse_args())
recorder = Rec... | [
"cv2.rectangle",
"argparse.ArgumentParser",
"utils.recorder.Recorder",
"numpy.argmax",
"cv2.dnn.blobFromImages",
"cv2.putText",
"cv2.imshow",
"imutils.resize",
"os.path.dirname",
"detectors.get_path.getPath",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"numpy.expand_dims",
"sys.exit",
"... | [((164, 189), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (187, 189), False, 'import argparse\n'), ((317, 327), 'utils.recorder.Recorder', 'Recorder', ([], {}), '()\n', (325, 327), False, 'from utils.recorder import Recorder\n'), ((342, 397), 'detectors.get_path.getPath', 'getPath', (['"""ki... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | [
"numpy.ones_like",
"numpy.broadcast_to",
"numpy.ones",
"numpy.full_like",
"improver.synthetic_data.set_up_test_cubes.set_up_variable_cube",
"iris.cube.CubeList",
"improver.synthetic_data.set_up_test_cubes.add_coordinate",
"cf_units.Unit",
"improver.psychrometric_calculations.psychrometric_calculatio... | [((26262, 26277), 'unittest.main', 'unittest.main', ([], {}), '()\n', (26275, 26277), False, 'import unittest\n'), ((2424, 2475), 'improver.psychrometric_calculations.psychrometric_calculations.PhaseChangeLevel', 'PhaseChangeLevel', (['phase_change'], {'grid_point_radius': '(3)'}), '(phase_change, grid_point_radius=3)\... |
"""
author:zhangyu
email:<EMAIL>
"""
from __future__ import division
from scipy.sparse import coo_matrix
import numpy as np
import PR.read as read
import sys
def graph_to_m(graph):
"""
Args:
graph:用户商品图
Return:
coo_matrix
list
dict
"""
vertex = graph.keys()
addres... | [
"PR.read.get_graph_from_data",
"numpy.array",
"scipy.sparse.coo_matrix"
] | [((805, 818), 'numpy.array', 'np.array', (['row'], {}), '(row)\n', (813, 818), True, 'import numpy as np\n'), ((829, 842), 'numpy.array', 'np.array', (['col'], {}), '(col)\n', (837, 842), True, 'import numpy as np\n'), ((854, 868), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (862, 868), True, 'import numpy a... |
__all__ = ['FixedDelay']
import numpy as np
from .core import Signal, signal
from .misc import Ramp # NOQA
class CircularBuffer:
def __init__(self, buffer_size):
self.buffer_size = buffer_size
self.buffer = np.zeros([self.buffer_size])
self.buffer_p = 0
def add(self, samples):
... | [
"numpy.zeros"
] | [((232, 260), 'numpy.zeros', 'np.zeros', (['[self.buffer_size]'], {}), '([self.buffer_size])\n', (240, 260), True, 'import numpy as np\n')] |
import sys
import numpy as np
from gcodeBuddy import angle, Arc, centers_from_params
class Command:
"""
represents line of Marlin g-code
:param init_string: line of Marlin g-code
:type init_string: str
"""
def __init__(self, init_string):
"""
initialization method
"... | [
"numpy.abs",
"numpy.sqrt",
"sys.exit",
"gcodeBuddy.centers_from_params",
"gcodeBuddy.angle",
"gcodeBuddy.Arc"
] | [((6212, 6223), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (6220, 6223), False, 'import sys\n'), ((6455, 6466), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (6463, 6466), False, 'import sys\n'), ((6600, 6611), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (6608, 6611), False, 'import sys\n'), ((11068, 11092),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 26 12:43:03 2019
@author: bressler
"""
import SBCcode as sbc
import numpy as np
import matplotlib.pyplot as plt
dt = []
datadir = '/bluearc/storage/SBC-17-data'
run = '20170710_0'
for k in range(90):
en = k
mu = 4e7
e = sbc.DataHand... | [
"matplotlib.pyplot.hist",
"numpy.diff",
"matplotlib.pyplot.figure",
"SBCcode.DataHandling.GetSBCEvent.GetEvent",
"SBCcode.AnalysisModules.PMTfastDAQalignment.PMTandFastDAQalignment"
] | [((1299, 1311), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1309, 1311), True, 'import matplotlib.pyplot as plt\n'), ((1320, 1337), 'matplotlib.pyplot.hist', 'plt.hist', (['dt', '(800)'], {}), '(dt, 800)\n', (1328, 1337), True, 'import matplotlib.pyplot as plt\n'), ((308, 370), 'SBCcode.DataHandling.Ge... |
from neuronmi.simulators.solver.aux import SiteCurrent, surface_normal
from neuronmi.simulators.solver.linear_algebra import LinearSystemSolver
from neuronmi.simulators.solver.transferring import SubMeshTransfer
from neuronmi.simulators.solver.embedding import EmbeddedMesh
from neuronmi.simulators.solver.membrane impor... | [
"numpy.where",
"neuronmi.simulators.solver.transferring.SubMeshTransfer",
"neuronmi.simulators.solver.embedding.EmbeddedMesh",
"neuronmi.mesh.mesh_utils.load_h5_mesh",
"itertools.izip",
"neuronmi.simulators.solver.aux.surface_normal",
"neuronmi.simulators.solver.linear_algebra.LinearSystemSolver",
"ne... | [((1413, 1450), 'neuronmi.mesh.mesh_utils.load_h5_mesh', 'load_h5_mesh', (['mesh_path', 'scale_factor'], {}), '(mesh_path, scale_factor)\n', (1425, 1450), False, 'from neuronmi.mesh.mesh_utils import load_h5_mesh\n'), ((9421, 9464), 'neuronmi.simulators.solver.linear_algebra.LinearSystemSolver', 'LinearSystemSolver', (... |
import properties
import numpy as np
import matplotlib.pyplot as plt
import warnings
import os
import scipy.sparse as sp
from ..data_misfit import BaseDataMisfit
from ..objective_function import ComboObjectiveFunction
from ..maps import IdentityMap, Wires
from ..regularization import (
BaseComboRegularization,
... | [
"numpy.hstack",
"properties.Bool",
"numpy.linalg.norm",
"numpy.mean",
"numpy.where",
"numpy.asarray",
"properties.Float",
"numpy.max",
"os.path.isdir",
"numpy.random.seed",
"os.mkdir",
"warnings.warn",
"numpy.maximum",
"scipy.sparse.csr_matrix.diagonal",
"os.path.expanduser",
"properti... | [((28606, 28668), 'properties.String', 'properties.String', (['"""directory to save results in"""'], {'default': '"""."""'}), "('directory to save results in', default='.')\n", (28623, 28668), False, 'import properties\n'), ((28681, 28760), 'properties.String', 'properties.String', (['"""root of the filename to be save... |
#Laget av <NAME> og <NAME>
import numpy as np
import matplotlib.pyplot as plt
#beregner generell polynomfunksjon
def g(koeffisienter, x):
res = 0
for i in range(len(koeffisienter)):
res += koeffisienter[i]*x**(len(koeffisienter)-i-1)
return res
#plotter generell polynomfunksjon
def plotFunc(param... | [
"matplotlib.pyplot.grid",
"numpy.polyfit",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.random.uniform",
"matplotlib.pyplot.show"
] | [((710, 720), 'matplotlib.pyplot.grid', 'plt.grid', ([], {}), '()\n', (718, 720), True, 'import matplotlib.pyplot as plt\n'), ((721, 731), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (729, 731), True, 'import matplotlib.pyplot as plt\n'), ((1065, 1075), 'matplotlib.pyplot.grid', 'plt.grid', ([], {}), '()\n'... |
import quicklb
import numpy as np
import time
import copy
class Loadbalancer():
def __init__(self,objects, algorithm, max_abs_li, max_rel_li, max_it):
"""
Create a Loadbalancer object
Parameters
----------
objects: list<Cell>
A list of objects which implement all functions specified in t... | [
"quicklb.partitioning_info",
"quicklb.info",
"quicklb.init",
"time.monotonic",
"quicklb.set_weights",
"quicklb.set_partition_algorithm",
"numpy.frombuffer",
"quicklb.partition"
] | [((1778, 1865), 'quicklb.set_partition_algorithm', 'quicklb.set_partition_algorithm', (['self.lb', 'algorithm', 'max_abs_li', 'max_rel_li', 'max_it'], {}), '(self.lb, algorithm, max_abs_li, max_rel_li,\n max_it)\n', (1809, 1865), False, 'import quicklb\n'), ((1866, 1887), 'quicklb.info', 'quicklb.info', (['self.lb']... |
import os
import sys
import logging
import numpy as np
import json
import re
import random
work_dir = os.getcwd() # 当前路径
sys.path.extend([os.path.abspath(".."), work_dir])
from basic.basic_task import Basic_task, Task_Mode
from basic.register import register_task, find_task
from utils.build_vocab import Vocab
from u... | [
"logging.getLogger",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.softmax",
"logging.info",
"re.split",
"transformers.BertModel",
"os.path.split",
"numpy.random.seed",
"torch.nn.Embedding",
"basic.register.find_task",
"json.loads",
"numpy.argmax",
"torch.einsum",
"re.findall",... | [((103, 114), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (112, 114), False, 'import os\n'), ((820, 913), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s:%(levelname)s: %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s:%(levelname)s: %(message)s', level=\n logging.INFO)\... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import copy
from dace import properties, symbolic
import dace.library
import dace.sdfg.nodes
from dace.sdfg import SDFG, SDFGState
from dace import memlet as mm, data as dt
from dace.transformation.transformation import ExpandTransformation
fro... | [
"dace.libraries.blas.nodes.matmul._get_matmul_operands",
"dace.sdfg.scope.is_devicelevel_gpu",
"dace.libraries.blas.blas_helpers.cublas_type_metadata",
"dace.memlet.Memlet",
"dace.frontend.common.op_repository.replaces",
"dace.properties.SymbolicProperty",
"dace.libraries.blas.environments.cublas.cuBLAS... | [((42195, 42238), 'dace.frontend.common.op_repository.replaces', 'oprepo.replaces', (['"""dace.libraries.blas.gemv"""'], {}), "('dace.libraries.blas.gemv')\n", (42210, 42238), True, 'from dace.frontend.common import op_repository as oprepo\n'), ((42240, 42283), 'dace.frontend.common.op_repository.replaces', 'oprepo.rep... |
# You are at the top. If you attempt to go any higher
# you will go beyond the known limits of the code
# universe where there are most certainly monsters
# might be able to get a speedup where I'm appending move and -move
# to do:
# use point raycaster to make a cloth_wrap option
# self colisions
# maybe d... | [
"numpy.clip",
"bpy.context.scene.objects.link",
"numpy.sqrt",
"numpy.arccos",
"numpy.hstack",
"bpy.data.objects.new",
"webbrowser.open",
"bmesh.new",
"numpy.array",
"bpy.app.handlers.load_post.append",
"numpy.einsum",
"sys.exc_info",
"numpy.add.at",
"numpy.sin",
"bpy.ops.object.material_... | [((3656, 3667), 'bmesh.new', 'bmesh.new', ([], {}), '()\n', (3665, 3667), False, 'import bmesh\n'), ((3702, 3745), 'bmesh.ops.triangulate', 'bmesh.ops.triangulate', (['obm'], {'faces': 'obm.faces'}), '(obm, faces=obm.faces)\n', (3723, 3745), False, 'import bmesh\n'), ((3929, 3986), 'numpy.array', 'np.array', (['[[v.ind... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 22 12:04:32 2016
@author: Charles
"""
from __future__ import division
from past.utils import old_div
import numpy as np
import matplotlib.pyplot as plt
def gaussian(x, mu, sig):
return np.exp(old_div(-np.power(x - mu, 2.), (2 * np.power(sig, 2.))))
t = np.arange(... | [
"matplotlib.pyplot.ylabel",
"numpy.power",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.fft.fft",
"numpy.sort",
"numpy.angle",
"matplotlib.pyplot.figure",
"numpy.vstack",
"numpy.savetxt",
"numpy.sin",
"numpy.fft.ifft",
"numpy.arange",
"matplotl... | [((310, 324), 'numpy.arange', 'np.arange', (['(256)'], {}), '(256)\n', (319, 324), True, 'import numpy as np\n'), ((998, 1010), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1008, 1010), True, 'import matplotlib.pyplot as plt\n'), ((1143, 1178), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['u"""Fréquence ... |
#!/usr/bin/env python
#ATTENTION IF PYTHON OR PYTHON 3
# coding: utf-8
#/******************************************
#*MIT License
#*
#*Copyright (c) [2020] [<NAME>, <NAME>, <NAME>]
#*
#*Permission is hereby granted, free of charge, to any person obtaining a copy
#*of this software and associated documentation files (t... | [
"numpy.dtype",
"numpy.mean",
"math.ceil",
"argparse.ArgumentParser",
"os.path.join",
"numpy.random.randint",
"numpy.std",
"numpy.all",
"time.time",
"ddrbenchmark_handler.my_accel_map",
"pynq.Overlay"
] | [((1572, 1628), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Python-based host"""'}), "(description='Python-based host')\n", (1595, 1628), False, 'import argparse\n'), ((2629, 2650), 'pynq.Overlay', 'Overlay', (['args.overlay'], {}), '(args.overlay)\n', (2636, 2650), False, 'from pynq ... |
import pandas as pd
import numpy as np
import statsmodels as sm
import statsmodels.api as smapi
import math
from pyqstrat.pq_utils import monotonically_increasing, infer_frequency
from pyqstrat.plot import TimeSeries, DateLine, Subplot, HorizontalLine, BucketedValues, Plot
import matplotlib as mpl
import matplotlib.fig... | [
"numpy.sqrt",
"IPython.core.display.display",
"numpy.log",
"math.sqrt",
"math.log",
"numpy.nanmean",
"numpy.array",
"numpy.isfinite",
"datetime.timedelta",
"pandas.to_datetime",
"datetime.datetime",
"numpy.mean",
"numpy.where",
"pyqstrat.plot.Subplot",
"numpy.exp",
"numpy.issubdtype",
... | [((1059, 1086), 'pyqstrat.pq_utils.infer_frequency', 'infer_frequency', (['timestamps'], {}), '(timestamps)\n', (1074, 1086), False, 'from pyqstrat.pq_utils import monotonically_increasing, infer_frequency\n'), ((2343, 2379), 'pyqstrat.pq_utils.monotonically_increasing', 'monotonically_increasing', (['timestamps'], {})... |
##############################################################################
#
# Copyright (c) 2003-2020 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unt... | [
"numpy.dot",
"numpy.zeros",
"math.sqrt"
] | [((18362, 18383), 'math.sqrt', 'math.sqrt', (['rhat_dot_r'], {}), '(rhat_dot_r)\n', (18371, 18383), False, 'import math\n'), ((27064, 27120), 'numpy.zeros', 'numpy.zeros', (['(iter_restart, iter_restart)', 'numpy.float64'], {}), '((iter_restart, iter_restart), numpy.float64)\n', (27075, 27120), False, 'import numpy\n')... |
# coding=UTF-8
from numpy import concatenate, size, ones, zeros
import numpy as np
import maxflow
import cv2
from seamcarving.utils import cli_progress_bar, cli_progress_bar_end
class seam_carving_decomposition(object):
#
# X: input image
# deleteNumberW : Number of columns to be deleted
# deleteNumberH : N... | [
"numpy.abs",
"numpy.copy",
"seamcarving.utils.cli_progress_bar_end",
"numpy.ones",
"numpy.ravel_multi_index",
"numpy.size",
"numpy.array",
"numpy.zeros",
"numpy.unravel_index",
"numpy.vstack",
"cv2.cvtColor",
"numpy.arange",
"seamcarving.utils.cli_progress_bar"
] | [((752, 787), 'numpy.unravel_index', 'np.unravel_index', (['node', 'image.shape'], {}), '(node, image.shape)\n', (768, 787), True, 'import numpy as np\n'), ((1383, 1417), 'numpy.zeros', 'zeros', (['(I.shape[0], I.shape[1], 4)'], {}), '((I.shape[0], I.shape[1], 4))\n', (1388, 1417), False, 'from numpy import concatenate... |
import pathlib
import numpy as np
import xarray as xr
from numpy import ma
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.style
from matplotlib.colors import LogNorm
from ._base_saver import _BaseSaver
def save_loss(loss_data_dir, img_dir, run_number, vmin=0, vmax=0.01):
... | [
"xarray.open_mfdataset",
"matplotlib.use",
"numpy.where",
"numpy.logical_or",
"numpy.ma.masked_where",
"matplotlib.pyplot.close",
"numpy.linspace",
"matplotlib.style.use",
"numpy.argmin",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.rc",
"matplotlib.colors.LogNorm"
] | [((100, 114), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (107, 114), True, 'import matplotlib as mpl\n'), ((320, 344), 'matplotlib.style.use', 'mpl.style.use', (['"""classic"""'], {}), "('classic')\n", (333, 344), True, 'import matplotlib as mpl\n'), ((400, 435), 'matplotlib.pyplot.rc', 'plt.rc', ([... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
from scipy import sparse
import matplotlib.pyplot as plt
import seaborn as sns
import sys
import matplotlib.colors as colors
from matplotlib import cm
def load_detected_cartels(years, cartel_dir):
cartel_table_list = []
group_id_off... | [
"seaborn.set",
"matplotlib.pyplot.savefig",
"seaborn.color_palette",
"numpy.max",
"seaborn.set_style",
"seaborn.boxplot",
"pandas.concat",
"matplotlib.pyplot.subplots",
"numpy.arange"
] | [((703, 750), 'pandas.concat', 'pd.concat', (['cartel_table_list'], {'ignore_index': '(True)'}), '(cartel_table_list, ignore_index=True)\n', (712, 750), True, 'import pandas as pd\n'), ((1653, 1675), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (1666, 1675), True, 'import seaborn as sns\n... |
import numpy as np
import spectral
from matplotlib import pyplot as plt
# minimum noise filter
def MNF(hydata, output_bands=20, denoise_bands=40, band_range=None, inplace=False):
"""
Apply a minimum noise filter to a hyperspectral image.
*Arguments*:
- hydata = A HyData instance containing the sourc... | [
"numpy.mean",
"numpy.abs",
"numpy.nanpercentile",
"numpy.hstack",
"numpy.array",
"spectral.GaussianStats",
"numpy.sum",
"numpy.isfinite",
"numpy.nanmax",
"numpy.nanmin",
"numpy.cov",
"matplotlib.pyplot.subplots",
"numpy.arange",
"spectral.mnf"
] | [((2395, 2427), 'numpy.array', 'np.array', (['data[..., valid_bands]'], {}), '(data[..., valid_bands])\n', (2403, 2427), True, 'import numpy as np\n'), ((2933, 2951), 'numpy.mean', 'np.mean', (['X'], {'axis': '(1)'}), '(X, axis=1)\n', (2940, 2951), True, 'import numpy as np\n'), ((2964, 2973), 'numpy.cov', 'np.cov', ([... |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | [
"tensorflow.device",
"tensorflow.shape",
"tvm.te.var",
"numpy.testing.assert_equal",
"tensorflow.placeholder",
"tensorflow.Session",
"tvm.te.create_schedule",
"numpy.asarray",
"tvm.te.thread_axis",
"tvm.te.placeholder",
"tempfile.mktemp",
"tvm.build",
"tvm.contrib.tf_op.OpModule",
"tvm.te.... | [((1123, 1134), 'tvm.te.var', 'te.var', (['"""n"""'], {}), "('n')\n", (1129, 1134), False, 'from tvm import te\n'), ((1150, 1183), 'tvm.te.placeholder', 'te.placeholder', (['(n,)'], {'name': '"""ph_a"""'}), "((n,), name='ph_a')\n", (1164, 1183), False, 'from tvm import te\n'), ((1199, 1232), 'tvm.te.placeholder', 'te.p... |
import numpy as np
from id3 import id3
test_playtennis = np.array(
[
[0, 2, 1, 0, 0],
[0, 2, 1, 1, 0],
[1, 2, 1, 0, 1],
[2, 1, 1, 0, 1],
[2, 0, 0, 0, 1],
[2, 0, 0, 1, 0],
[1, 0, 0, 1, 1],
[0, 1, 1, 0, 0],
[0, 0, 0, 0, 1],
[2, 1, 0, 0,... | [
"numpy.array",
"id3.id3"
] | [((59, 320), 'numpy.array', 'np.array', (['[[0, 2, 1, 0, 0], [0, 2, 1, 1, 0], [1, 2, 1, 0, 1], [2, 1, 1, 0, 1], [2, 0,\n 0, 0, 1], [2, 0, 0, 1, 0], [1, 0, 0, 1, 1], [0, 1, 1, 0, 0], [0, 0, 0, \n 0, 1], [2, 1, 0, 0, 1], [0, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 2, 0, 0, \n 1], [2, 1, 1, 1, 0]]'], {}), '([[0, 2, 1, ... |
# coding=utf-8
# Copyright 2018 Google LLC & <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"tensorflow.div",
"tensorflow.tile",
"numpy.mean",
"six.moves.range",
"compare_gan.src.image_similarity.MultiscaleSSIM"
] | [((1700, 1748), 'tensorflow.tile', 'tf.tile', (['generated_images', '[batch_size, 1, 1, 1]'], {}), '(generated_images, [batch_size, 1, 1, 1])\n', (1707, 1748), True, 'import tensorflow as tf\n'), ((2236, 2287), 'tensorflow.div', 'tf.div', (['score', '(batch_size * batch_size - batch_size)'], {}), '(score, batch_size * ... |
import random
from kaggle_environments.envs.halite.helpers import *
import numpy as np
###################
# Helper Function #
###################
def index_to_position(index: int, size: int):
"""
Converts an index in the observation.halite list to a 2d position in the form (x, y).
"""
y, x = divm... | [
"random.choice",
"numpy.reshape",
"numpy.zeros",
"numpy.sign",
"numpy.min"
] | [((2795, 2827), 'numpy.zeros', 'np.zeros', (['(self.size, self.size)'], {}), '((self.size, self.size))\n', (2803, 2827), True, 'import numpy as np\n'), ((2650, 2718), 'numpy.reshape', 'np.reshape', (["self.board.observation['halite']", '(self.size, self.size)'], {}), "(self.board.observation['halite'], (self.size, self... |
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
import dynet as dy
import dynet_modules as dm
import numpy as np
import random
from utils import *
from data import flatten
from time import time
from modules.seq_encoder import SeqEncoder
from modules.bag_encoder imp... | [
"data.flatten",
"ortools.constraint_solver.pywrapcp.RoutingModel",
"modules.bag_encoder.BagEncoder",
"dynet_modules.BiaffineAttention",
"dynet.VanillaLSTMBuilder",
"ortools.constraint_solver.pywrapcp.DefaultRoutingSearchParameters",
"dynet.average",
"dynet.transpose",
"numpy.argsort",
"modules.tre... | [((7525, 7555), 'ortools.constraint_solver.pywrapcp.RoutingModel', 'pywrapcp.RoutingModel', (['manager'], {}), '(manager)\n', (7546, 7555), False, 'from ortools.constraint_solver import pywrapcp\n'), ((8537, 8578), 'ortools.constraint_solver.pywrapcp.DefaultRoutingSearchParameters', 'pywrapcp.DefaultRoutingSearchParame... |
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.preprocessing import image
import sys
#This function will require that Unix directory naming convention is applied, Directories start with a capital letter
#whatOrgan = sys.... | [
"tensorflow.keras.preprocessing.image.load_img",
"tensorflow.keras.models.load_model",
"numpy.vstack",
"numpy.expand_dims",
"tensorflow.keras.preprocessing.image.img_to_array"
] | [((805, 861), 'tensorflow.keras.preprocessing.image.load_img', 'image.load_img', (['img'], {'target_size': '(img_width, img_height)'}), '(img, target_size=(img_width, img_height))\n', (819, 861), False, 'from tensorflow.keras.preprocessing import image\n'), ((870, 892), 'tensorflow.keras.preprocessing.image.img_to_arra... |
# -*- coding: utf-8 -*-
# plot de la marche aléatoire
from metropolis import metropolis
import numpy as np
import matplotlib.pyplot as plt
# création du modèle :
def model(param, x):
return param[0] * x + param[1]
# génération des données :
x = np.linspace(-5, 15, 120)
y = 4.5 * x + 12 + 5 * np.random.randn(len(x))... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.linspace",
"matplotlib.pyplot.figure",
"metropolis.metropolis",
"matplotlib.pyplot.show"
] | [((249, 273), 'numpy.linspace', 'np.linspace', (['(-5)', '(15)', '(120)'], {}), '(-5, 15, 120)\n', (260, 273), True, 'import numpy as np\n'), ((336, 395), 'metropolis.metropolis', 'metropolis', (['model', 'x', 'y', '[5, 10]', '[0.1, 0.2]', '(5000)', '(500)', '(20)'], {}), '(model, x, y, [5, 10], [0.1, 0.2], 5000, 500, ... |
import copy
import operator
import os
import numpy as np
import wandb
import sys
from importlib import import_module
import keras
import keras.backend as K
class WandbCallback(keras.callbacks.Callback):
"""WandB Keras Callback.
Automatically saves history and summary data. Optionally logs gradients, writes ... | [
"numpy.mean",
"wandb.Image",
"numpy.random.choice",
"keras.backend.learning_phase",
"os.path.join",
"wandb.run.history.add",
"wandb.Error",
"wandb.run.summary.update",
"numpy.std",
"keras.backend.function",
"copy.copy"
] | [((2204, 2248), 'os.path.join', 'os.path.join', (['wandb.run.dir', '"""model-best.h5"""'], {}), "(wandb.run.dir, 'model-best.h5')\n", (2216, 2248), False, 'import os\n'), ((3534, 3566), 'copy.copy', 'copy.copy', (['wandb.run.history.row'], {}), '(wandb.run.history.row)\n', (3543, 3566), False, 'import copy\n'), ((4026,... |
# Copyright 2020 The SQLFlow Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"runtime.feature.compile.compile_ir_feature_columns",
"runtime.dbapi.paiio.PaiIOConnection.from_table",
"runtime.xgboost.dataset.xgb_dataset",
"os.path.join",
"runtime.db.connect_with_data_source",
"runtime.pai.pai_distributed.define_tf_flags",
"runtime.temp_file.TemporaryDirectory",
"numpy.array",
... | [((1146, 1163), 'runtime.pai.pai_distributed.define_tf_flags', 'define_tf_flags', ([], {}), '()\n', (1161, 1163), False, 'from runtime.pai.pai_distributed import define_tf_flags\n'), ((1409, 1422), 'xgboost.Booster', 'xgb.Booster', ([], {}), '()\n', (1420, 1422), True, 'import xgboost as xgb\n'), ((2063, 2123), 'runtim... |
#!/usr/bin/env python
"""
A component of a findNeighbour4 server which provides relatedness information for bacterial genomes.
It does so using PCA, and supports PCA based cluster generation.
he associated classes compute a variation model for samples in a findNeighbour4 server.
Computation uses data in MongoDb, and ... | [
"pandas.DataFrame.from_records",
"numpy.median",
"scipy.stats.median_abs_deviation",
"hashlib.md5",
"random.shuffle",
"pathlib.Path",
"sklearn.decomposition.PCA",
"pandas.DataFrame",
"pandas.DataFrame.from_dict",
"scipy.stats.poisson.ppf",
"datetime.datetime.now",
"collections.defaultdict",
... | [((7940, 7953), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (7951, 7953), False, 'import hashlib\n'), ((12582, 12617), 'pandas.DataFrame.from_records', 'pd.DataFrame.from_records', (['metadata'], {}), '(metadata)\n', (12607, 12617), True, 'import pandas as pd\n'), ((15387, 15403), 'collections.defaultdict', 'defaul... |
"""State distinguishability."""
from typing import List
import cvxpy
import numpy as np
from .state_helper import __is_states_valid, __is_probs_valid
def state_distinguishability(
states: List[np.ndarray], probs: List[float] = None, dist_method: str = "min-error"
) -> float:
r"""
Compute probability of s... | [
"numpy.identity",
"cvxpy.Variable",
"cvxpy.Problem"
] | [((4962, 4999), 'cvxpy.Problem', 'cvxpy.Problem', (['objective', 'constraints'], {}), '(objective, constraints)\n', (4975, 4999), False, 'import cvxpy\n'), ((4881, 4899), 'numpy.identity', 'np.identity', (['dim_x'], {}), '(dim_x)\n', (4892, 4899), True, 'import numpy as np\n'), ((4163, 4203), 'cvxpy.Variable', 'cvxpy.V... |
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.nn import init
import numpy as np
import json
import os.path
import subprocess
import random
from operator import itemgetter
import sklearn.metrics as metrics
np.set_printoptions... | [
"torch.nn.Dropout",
"torch.mean",
"sklearn.metrics.auc",
"torch.LongTensor",
"torch.nn.init.xavier_normal",
"numpy.sum",
"sklearn.metrics.roc_curve",
"torch.nn.NLLLoss",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.functional.log_softmax",
"operator.itemgetter",
"torch.cuda.manua... | [((301, 342), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(1000000000)'}), '(linewidth=1000000000)\n', (320, 342), True, 'import numpy as np\n'), ((343, 368), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['(1)'], {}), '(1)\n', (365, 368), False, 'import torch\n'), ((4918, 4930), 'torch.... |
import os
import numpy
import pygeoprocessing
from osgeo import gdal
from osgeo import osr
# I'm assuming that our synthetic raster here will cover the globe, just not
# have any real-world values.
# These details are copied from another raster I have, so roughly 5 arcseconds
# resolution
ORIGIN = (-180, 90)
PIXELSIZ... | [
"pygeoprocessing.iterblocks",
"osgeo.osr.SpatialReference",
"osgeo.gdal.SetConfigOption",
"os.path.dirname",
"numpy.random.randint",
"numpy.finfo",
"numpy.full",
"osgeo.gdal.GetDriverByName",
"osgeo.gdal.OpenEx"
] | [((396, 418), 'osgeo.osr.SpatialReference', 'osr.SpatialReference', ([], {}), '()\n', (416, 418), False, 'from osgeo import osr\n'), ((474, 499), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (489, 499), False, 'import os\n'), ((736, 765), 'osgeo.gdal.GetDriverByName', 'gdal.GetDriverByName'... |
"""
Distance measures that can be used for various torch.tensor operations
"""
import torch
import numpy as np
import torch.nn.functional as F
from torch.distributions import Categorical
from torch.autograd import Variable
from scipy.spatial.distance import cosine
def get_predict_token_vector(pred, target, k=10, s=1,... | [
"torch.mul",
"scipy.spatial.distance.cosine",
"torch.distributions.Categorical",
"torch.topk",
"torch.transpose",
"numpy.count_nonzero",
"torch.mm",
"torch.sum",
"torch.autograd.Variable",
"torch.nn.functional.softmax",
"torch.clamp",
"torch.randn"
] | [((734, 757), 'torch.topk', 'torch.topk', (['cos_sims', 'k'], {}), '(cos_sims, k)\n', (744, 757), False, 'import torch\n'), ((777, 801), 'torch.nn.functional.softmax', 'F.softmax', (['(vals / tau)', '(1)'], {}), '(vals / tau, 1)\n', (786, 801), True, 'import torch.nn.functional as F\n'), ((1117, 1163), 'torch.autograd.... |
import numpy as np
from PIL import Image
from numpy import array
class ImgUtils(object):
@staticmethod
def read_image_bytes(filename):
with open(filename, mode='rb') as file:
return file.read()
@staticmethod
def read_image_numpy(filename, w, h):
img = Image.open(filename)... | [
"numpy.ceil",
"PIL.Image.open",
"numpy.ones",
"numpy.floor",
"numpy.array"
] | [((384, 394), 'numpy.array', 'array', (['img'], {}), '(img)\n', (389, 394), False, 'from numpy import array\n'), ((650, 689), 'numpy.ceil', 'np.ceil', (['(images_tensor.shape[0] / ncols)'], {}), '(images_tensor.shape[0] / ncols)\n', (657, 689), True, 'import numpy as np\n'), ((780, 809), 'numpy.ones', 'np.ones', (['(ro... |
import copy
import numpy as np
import torch
from mmpose.core import (aggregate_results, get_group_preds,
get_multi_stage_outputs)
def test_get_multi_stage_outputs():
fake_outputs = [torch.zeros((1, 4, 2, 2))]
fake_flip_outputs = [torch.ones((1, 4, 2, 2))]
# outputs_flip
outp... | [
"mmpose.core.aggregate_results",
"torch.tensor",
"numpy.array",
"copy.deepcopy",
"torch.Size",
"torch.zeros",
"torch.ones"
] | [((3884, 4060), 'mmpose.core.aggregate_results', 'aggregate_results', ([], {'scale': '(1)', 'aggregated_heatmaps': 'None', 'tags_list': '[]', 'heatmaps': 'fake_heatmaps', 'tags': 'fake_tags', 'test_scale_factor': '[1]', 'project2image': '(True)', 'flip_test': '(False)'}), '(scale=1, aggregated_heatmaps=None, tags_list=... |
import torchvision.transforms as transforms
from torch.autograd import Variable
import os
from PIL import Image
import numpy as np
def image_loader(image_name, imsize):
loader = transforms.Compose([
transforms.Resize((imsize, imsize)), # scale imported image
transforms.ToTensor()]) # transform i... | [
"numpy.uint8",
"os.path.exists",
"PIL.Image.open",
"torchvision.transforms.ToPILImage",
"os.path.join",
"numpy.asarray",
"os.mkdir",
"torchvision.transforms.Resize",
"torchvision.transforms.ToTensor"
] | [((355, 377), 'PIL.Image.open', 'Image.open', (['image_name'], {}), '(image_name)\n', (365, 377), False, 'from PIL import Image\n'), ((1191, 1208), 'numpy.asarray', 'np.asarray', (['image'], {}), '(image)\n', (1201, 1208), True, 'import numpy as np\n'), ((1221, 1254), 'numpy.asarray', 'np.asarray', (['[image, image, im... |
"""
A visual class containing multiple axes.
"""
import numpy as np
from vispy.visuals import CompoundVisual, LineVisual, TextVisual
class HyperAxisVisual(CompoundVisual):
def __init__(self, pos, color="black", labels=None):
self.pos = np.zeros((pos.shape[0]*2, 3))
for i in range(pos.shape[0]):
... | [
"vispy.visuals.TextVisual",
"numpy.zeros",
"vispy.visuals.CompoundVisual.__init__",
"vispy.visuals.LineVisual"
] | [((252, 283), 'numpy.zeros', 'np.zeros', (['(pos.shape[0] * 2, 3)'], {}), '((pos.shape[0] * 2, 3))\n', (260, 283), True, 'import numpy as np\n'), ((380, 470), 'vispy.visuals.LineVisual', 'LineVisual', ([], {'pos': 'self.pos', 'method': '"""gl"""', 'color': 'color', 'connect': '"""segments"""', 'antialias': '(True)'}), ... |
#-*-coding:utf-8-*-
# date:2021-06-15
# Author: Eric.Lee
# function: easy 3d handpose data iter
import glob
import math
import os
import random
from tqdm import tqdm
import cv2
import numpy as np
import torch
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import json
#--------------------... | [
"numpy.clip",
"numpy.sqrt",
"utils.AIK.adaptive_IK",
"cv2.imshow",
"torch.from_numpy",
"numpy.array",
"cv2.destroyAllWindows",
"numpy.linalg.norm",
"numpy.arange",
"numpy.mean",
"os.listdir",
"torch.eye",
"open3d.visualization.Visualizer",
"numpy.asarray",
"numpy.subtract",
"numpy.exp"... | [((3618, 3654), 'numpy.zeros', 'np.zeros', (['img_.shape'], {'dtype': 'np.uint8'}), '(img_.shape, dtype=np.uint8)\n', (3626, 3654), True, 'import numpy as np\n'), ((3668, 3706), 'cv2.cvtColor', 'cv2.cvtColor', (['img_', 'cv2.COLOR_RGB2GRAY'], {}), '(img_, cv2.COLOR_RGB2GRAY)\n', (3680, 3706), False, 'import cv2\n'), ((... |
"""
desispec.quicklook.palib
Low level functions to be from top level PAs
"""
import numpy as np
from desispec.quicklook import qlexceptions,qllogger
qlog=qllogger.QLLogger("QuickLook",20)
log=qlog.getlog()
def project(x1,x2):
"""
return a projection matrix so that arrays are related by linear interpolation
... | [
"numpy.where",
"numpy.sort",
"numpy.zeros",
"desispec.quicklook.qlresolution.QuickResolution",
"desispec.quicklook.qllogger.QLLogger",
"numpy.gradient"
] | [((155, 189), 'desispec.quicklook.qllogger.QLLogger', 'qllogger.QLLogger', (['"""QuickLook"""', '(20)'], {}), "('QuickLook', 20)\n", (172, 189), False, 'from desispec.quicklook import qlexceptions, qllogger\n'), ((442, 453), 'numpy.sort', 'np.sort', (['x1'], {}), '(x1)\n', (449, 453), True, 'import numpy as np\n'), ((4... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 8 16:45:36 2019
Copyright © 2019 DataRock S.A.S. All rights reserved.
@author: DavidFelipe
Select the objects that would be analized for each layer
"""
try:
import numpy as np
from operator import itemgetter
import time
import progr... | [
"progressbar.Bar",
"numpy.copy",
"numpy.mean",
"numpy.sqrt",
"numpy.average",
"cv2.boundingRect",
"numpy.zeros_like",
"numpy.array",
"cv2.circle",
"progressbar.Percentage",
"numpy.vstack",
"cv2.cvtColor",
"progressbar.ETA",
"cv2.findContours",
"progressbar.AdaptiveETA",
"time.time",
... | [((1436, 1486), 'progressbar.ProgressBar', 'progressbar.ProgressBar', ([], {'widgets': 'widgets', 'maxval': '(3)'}), '(widgets=widgets, maxval=3)\n', (1459, 1486), False, 'import progressbar\n'), ((1524, 1535), 'time.time', 'time.time', ([], {}), '()\n', (1533, 1535), False, 'import time\n'), ((3631, 3653), 'numpy.arra... |
import numpy as np
import pickle
class MinMaxScaler():
"""Reimplementation of scikit.learn MinMaxSaler. Avoids the need for pickling scikitlearn objects."""
def __init__(self,x_scale,x_min):
self.x_scale = np.array(x_scale).astype(float)
self.x_min = np.array(x_min).astype(float)
def trans... | [
"numpy.array"
] | [((223, 240), 'numpy.array', 'np.array', (['x_scale'], {}), '(x_scale)\n', (231, 240), True, 'import numpy as np\n'), ((276, 291), 'numpy.array', 'np.array', (['x_min'], {}), '(x_min)\n', (284, 291), True, 'import numpy as np\n'), ((346, 357), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (354, 357), True, 'import n... |
#!/usr/bin/env python3
"""
Created on Fri Mar 30 22:03:29 2018
@author: mohammad
"""
import sys
import os
import glob
import numpy as np
import pandas as pd
import scipy.io
from sklearn.externals import joblib
import physionetchallenge2018_lib as phyc
def classify_record(record_name):
header_file = record_name + ... | [
"numpy.transpose",
"numpy.ones",
"numpy.size",
"sklearn.externals.joblib.load",
"physionetchallenge2018_lib.import_signal_names",
"numpy.zeros",
"os.path.basename",
"numpy.concatenate",
"numpy.savetxt",
"physionetchallenge2018_lib.get_subject_data_test",
"glob.glob"
] | [((506, 537), 'glob.glob', 'glob.glob', (['"""models/*_model.pkl"""'], {}), "('models/*_model.pkl')\n", (515, 537), False, 'import glob\n'), ((1341, 1378), 'physionetchallenge2018_lib.import_signal_names', 'phyc.import_signal_names', (['header_file'], {}), '(header_file)\n', (1365, 1378), True, 'import physionetchallen... |
# %% IMPORTS
# Package imports
from astropy.units import Quantity
from astropy.time import Time
from astropy.coordinates import Angle, SkyCoord
import astropy.constants as apc
from astropy.table import Table
import numpy as np
from py.path import local
# hickle imports
import hickle as hkl
# Set the current working d... | [
"numpy.allclose",
"astropy.table.Table",
"astropy.coordinates.Angle",
"astropy.coordinates.SkyCoord",
"astropy.time.Time",
"py.path.local.get_temproot",
"hickle.load",
"hickle.dump",
"astropy.units.Quantity"
] | [((817, 846), 'hickle.dump', 'hkl.dump', (['apc.G', '"""test_ap.h5"""'], {}), "(apc.G, 'test_ap.h5')\n", (825, 846), True, 'import hickle as hkl\n'), ((856, 878), 'hickle.load', 'hkl.load', (['"""test_ap.h5"""'], {}), "('test_ap.h5')\n", (864, 878), True, 'import hickle as hkl\n'), ((907, 940), 'hickle.dump', 'hkl.dump... |
"""
Module which contains all the imports and data available to unit tests
"""
import os
import sys
import json
import time
import shutil
import timeit
import inspect
import logging
import platform
import tempfile
import unittest
import itertools
import subprocess
import numpy as np
import sympy as sp
import trimesh
... | [
"logging.getLogger",
"logging.NullHandler",
"trimesh.util.is_instance_named",
"os.listdir",
"collections.deque",
"trimesh.util.split_extension",
"inspect.currentframe",
"os.path.join",
"io.BytesIO",
"os.path.splitext",
"numpy.append",
"numpy.array",
"platform.system",
"trimesh.load",
"tr... | [((606, 664), 'numpy.array', 'np.array', (['[sys.version_info.major, sys.version_info.minor]'], {}), '([sys.version_info.major, sys.version_info.minor])\n', (614, 664), True, 'import numpy as np\n'), ((1228, 1256), 'logging.getLogger', 'logging.getLogger', (['"""trimesh"""'], {}), "('trimesh')\n", (1245, 1256), False, ... |
"""Helper functions for the Taylor-Green vortices application."""
import numpy
def taylor_green_vortex(x, y, t, nu):
"""Return the solution of the Taylor-Green vortex at given time.
Parameters
----------
x : numpy.ndarray
Gridline locations in the x direction as a 1D array of floats.
y :... | [
"numpy.exp",
"numpy.meshgrid",
"numpy.sin",
"numpy.cos"
] | [((770, 790), 'numpy.meshgrid', 'numpy.meshgrid', (['x', 'y'], {}), '(x, y)\n', (784, 790), False, 'import numpy\n'), ((859, 890), 'numpy.exp', 'numpy.exp', (['(-2 * a ** 2 * nu * t)'], {}), '(-2 * a ** 2 * nu * t)\n', (868, 890), False, 'import numpy\n'), ((936, 967), 'numpy.exp', 'numpy.exp', (['(-2 * a ** 2 * nu * t... |
# Copyright 2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | [
"thewalrus.perm",
"numpy.sqrt",
"scipy.special.factorial",
"numpy.array",
"thewalrus._permanent.fock_threshold_prob",
"numpy.arange",
"scipy.stats.unitary_group.rvs",
"thewalrus._permanent.fock_prob",
"numpy.random.random",
"numpy.where",
"numpy.float64",
"itertools.product",
"numpy.ix_",
... | [((6470, 6520), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""eta"""', '[0.2, 0.5, 0.9, 1]'], {}), "('eta', [0.2, 0.5, 0.9, 1])\n", (6493, 6520), False, 'import pytest\n'), ((7586, 7636), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""eta"""', '[0.2, 0.5, 0.9, 1]'], {}), "('eta', [0.2, 0.5, 0... |
# @Time : 2019/5/21 19:24
# @Author : shakespere
# @FileName: baseline3.py
import sys, os, re, csv, codecs, numpy as np, pandas as pd
# =================Keras==============
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.layers import Dense, ... | [
"keras.layers.Conv2D",
"keras.backend.sum",
"pandas.read_csv",
"re.compile",
"keras.backend.reshape",
"keras.layers.CuDNNGRU",
"keras.backend.floatx",
"sklearn.metrics.roc_auc_score",
"keras.layers.Activation",
"keras.layers.Dense",
"keras.preprocessing.sequence.pad_sequences",
"sklearn.model_... | [((1436, 1485), 'pandas.read_csv', 'pd.read_csv', (['TRAIN_DATA_FILE'], {'lineterminator': '"""\n"""'}), "(TRAIN_DATA_FILE, lineterminator='\\n')\n", (1447, 1485), True, 'import sys, os, re, csv, codecs, numpy as np, pandas as pd\n'), ((1493, 1541), 'pandas.read_csv', 'pd.read_csv', (['TEST_DATA_FILE'], {'lineterminato... |
import bagel
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from typing import Sequence, Tuple, Dict, Optional
class AutoencoderLayer(tf.keras.layers.Layer):
def __init__(self, hidden_dims: Sequence[int], output_dim: int):
super().__init__()
self._hidden = tf.ker... | [
"tensorflow.train.Checkpoint",
"tensorflow.math.add_n",
"bagel.data.KPIDataset",
"tensorflow.GradientTape",
"tensorflow.cast",
"numpy.mean",
"tensorflow.keras.Sequential",
"numpy.asarray",
"tensorflow.math.reduce_mean",
"numpy.min",
"tensorflow.zeros",
"tensorflow_probability.distributions.Nor... | [((314, 335), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', ([], {}), '()\n', (333, 335), True, 'import tensorflow as tf\n'), ((1397, 1436), 'tensorflow_probability.distributions.Normal', 'tfp.distributions.Normal', (['z_mean', 'z_std'], {}), '(z_mean, z_std)\n', (1421, 1436), True, 'import tensorflow_probabili... |
import os
import sys
import json
import copy
import numpy as np
import pandas as pd
import random
import tensorflow as tf
# import PIL
seed_value = 123
os.environ['PYTHONHASHSEED']=str(seed_value)
random.seed(seed_value)
np.random.seed(seed_value)
tf.set_random_seed(seed_value)
from keras.utils import to_categorical
... | [
"pandas.Index",
"numpy.array",
"copy.deepcopy",
"tensorflow.set_random_seed",
"numpy.arange",
"ornstein_auto_encoder.fid.get_fid",
"numpy.mean",
"numpy.repeat",
"numpy.where",
"tensorflow.Session",
"numpy.random.seed",
"tensorflow.ConfigProto",
"numpy.identity",
"ornstein_auto_encoder.ince... | [((198, 221), 'random.seed', 'random.seed', (['seed_value'], {}), '(seed_value)\n', (209, 221), False, 'import random\n'), ((222, 248), 'numpy.random.seed', 'np.random.seed', (['seed_value'], {}), '(seed_value)\n', (236, 248), True, 'import numpy as np\n'), ((249, 279), 'tensorflow.set_random_seed', 'tf.set_random_seed... |
import numpy as np
import pickle
from copy import deepcopy
from det3d.core import box_np_ops
from det3d.datasets.custom import PointCloudDataset
from det3d.datasets.registry import DATASETS
from .eval import get_lyft_eval_result
@DATASETS.register_module
class LyftDataset(PointCloudDataset):
NumPointFeatures =... | [
"numpy.array",
"numpy.zeros",
"pickle.load"
] | [((1242, 1256), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1253, 1256), False, 'import pickle\n'), ((2909, 2923), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (2920, 2923), False, 'import pickle\n'), ((3581, 3603), 'numpy.zeros', 'np.zeros', (['(box_num, 4)'], {}), '((box_num, 4))\n', (3589, 3603), Tru... |
# Copyright 2019 The Cirq Developers
#
# 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 ... | [
"cirq.value.Duration",
"sympy.Symbol",
"numpy.abs",
"cirq.ops.X",
"pandas.crosstab",
"numpy.exp",
"numpy.isnan",
"matplotlib.pyplot.subplots",
"cirq._compat.proper_repr",
"warnings.warn",
"cirq.ops.wait",
"cirq.ops.measure",
"matplotlib.pyplot.legend"
] | [((2040, 2065), 'cirq.value.Duration', 'value.Duration', (['min_delay'], {}), '(min_delay)\n', (2054, 2065), False, 'from cirq import circuits, ops, study, value, _import\n'), ((2086, 2111), 'cirq.value.Duration', 'value.Duration', (['max_delay'], {}), '(max_delay)\n', (2100, 2111), False, 'from cirq import circuits, o... |
import numpy as np
import torch
import torch.optim as optim
from collections import OrderedDict
import copy
import lifelong_rl.torch.pytorch_util as ptu
from lifelong_rl.envs.env_utils import get_dim
from lifelong_rl.util.eval_util import create_stats_ordered_dict
from lifelong_rl.core.rl_algorithms.torch_rl_algorith... | [
"numpy.clip",
"lifelong_rl.samplers.utils.path_functions.calculate_advantages",
"collections.OrderedDict",
"lifelong_rl.torch.pytorch_util.get_numpy",
"lifelong_rl.samplers.utils.path_functions.calculate_baselines",
"lifelong_rl.torch.pytorch_util.from_numpy",
"lifelong_rl.samplers.utils.path_functions.... | [((2050, 2085), 'lifelong_rl.envs.env_utils.get_dim', 'get_dim', (['self.env.observation_space'], {}), '(self.env.observation_space)\n', (2057, 2085), False, 'from lifelong_rl.envs.env_utils import get_dim\n'), ((3261, 3274), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3272, 3274), False, 'from collect... |
# -*- coding: utf-8 -*-
'''
Author: <NAME> <<EMAIL>>
Date: 2012-08-25
This example file implements 5 variations of the negative binomial regression
model for count data: NB-P, NB-1, NB-2, geometric and left-truncated.
The NBin class inherits from the GenericMaximumLikelihood statsmodels class
which provides automatic... | [
"scipy.special.digamma",
"statsmodels.compat.python.urlopen",
"numpy.log",
"numpy.append",
"numpy.testing.assert_almost_equal",
"numpy.dot",
"scipy.stats.nbinom.logpmf",
"numpy.array",
"numpy.zeros",
"scipy.stats.nbinom.cdf",
"patsy.dmatrices",
"statsmodels.iolib.summary.Summary"
] | [((2112, 2140), 'scipy.stats.nbinom.logpmf', 'nbinom.logpmf', (['y', 'size', 'prob'], {}), '(y, size, prob)\n', (2125, 2140), False, 'from scipy.stats import nbinom\n'), ((8878, 8982), 'statsmodels.compat.python.urlopen', 'urlopen', (['"""https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/csv/COUNT/medpar.c... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
from dace.memlet import Memlet
import dace.libraries.mpi as mpi
import numpy as np
import pytest
###############################################################################
def make_sdfg(dtype):
n = dace.symbol("n")
... | [
"dace.memlet.Memlet.simple",
"dace.symbol",
"pytest.param",
"numpy.array",
"dace.libraries.mpi.nodes.scatter.Scatter",
"dace.SDFG",
"numpy.empty_like",
"numpy.full",
"dace.comm.Scatter",
"numpy.random.randn",
"dace.comm.Gather"
] | [((2641, 2675), 'dace.symbol', 'dace.symbol', (['"""N"""'], {'dtype': 'dace.int64'}), "('N', dtype=dace.int64)\n", (2652, 2675), False, 'import dace\n'), ((2680, 2714), 'dace.symbol', 'dace.symbol', (['"""P"""'], {'dtype': 'dace.int64'}), "('P', dtype=dace.int64)\n", (2691, 2714), False, 'import dace\n'), ((299, 315), ... |
import pandas as pd
import numpy as np
from scipy.signal import find_peaks
import matplotlib.pyplot as plt
def stride_times(Accel,fs,plot=False):
#split filt_signal in windows of 12.8s size, see Activity recognition using a single accelerometer placed at the wrist or ankle
window_size = int(12.8 * fs)
d... | [
"numpy.mean",
"numpy.sqrt",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.array",
"numpy.empty_like",
"numpy.concatenate",
"scipy.signal.find_peaks",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((1537, 1560), 'numpy.empty_like', 'np.empty_like', (['peaks[0]'], {}), '(peaks[0])\n', (1550, 1560), True, 'import numpy as np\n'), ((2380, 2593), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\Users\\\\Σπύρος\\\\Documents\\\\ΣΠΥΡΟΣ\\\\Pycharm Projects\\\\Parkinson dfa app\\\\Android-Sensor-Stride\\\\code\\\\python sc... |
"""
mpld3 Logo Idea
===============
This example shows how mpld3 can be used to generate relatively intricate
vector graphics in the browser. This is an adaptation of a logo proposal by
github user debjan, in turn based on both the matplotlib and D3js logos.
"""
# Author: <NAME>
import matplotlib.pyplot as plt
from ma... | [
"numpy.radians",
"matplotlib.patches.Rectangle",
"matplotlib.patches.Wedge",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.cos",
"numpy.sin",
"mpld3.show",
"matplotlib.colors.LinearSegmentedColormap.from_list",
"matplotlib.patches.Circle",
"numpy.arange"
] | [((446, 466), 'numpy.array', 'np.array', (['[319, 217]'], {}), '([319, 217])\n', (454, 466), True, 'import numpy as np\n'), ((518, 548), 'numpy.linspace', 'np.linspace', (['(16)', 'max_radius', '(5)'], {}), '(16, max_radius, 5)\n', (529, 548), True, 'import numpy as np\n'), ((558, 579), 'numpy.arange', 'np.arange', (['... |
import myutil as mu
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import TensorDataset # 텐서데이터셋
from torch.utils.data import DataLoader # 데이터로더
from torch.utils.data import Dataset
#################################################################... | [
"torch.manual_seed",
"torch.optim.SGD",
"torch.log",
"myutil.plt_init",
"myutil.log_epoch",
"myutil.plt_show",
"matplotlib.pyplot.plot",
"torch.nn.functional.binary_cross_entropy",
"myutil.get_regression_accuracy",
"numpy.exp",
"torch.zeros",
"myutil.log",
"matplotlib.pyplot.title",
"torch... | [((1436, 1461), 'numpy.arange', 'np.arange', (['(-5.0)', '(5.0)', '(0.1)'], {}), '(-5.0, 5.0, 0.1)\n', (1445, 1461), True, 'import numpy as np\n'), ((1478, 1497), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y', '"""g"""'], {}), "(x, y, 'g')\n", (1486, 1497), True, 'import matplotlib.pyplot as plt\n'), ((1498, 1527), ... |
from __future__ import print_function
import argparse
import os
import numpy as np
import torch
from torchvision import transforms
import dataset
from darknet import Darknet
from utils import get_all_boxes, nms, read_data_cfg, logging, map_iou
# etc parameters
use_cuda = True
seed = 22222
eps = 1e-5
FLAGS = None
de... | [
"utils.map_iou",
"torch.manual_seed",
"darknet.Darknet",
"argparse.ArgumentParser",
"utils.get_all_boxes",
"torch.load",
"torch.nn.DataParallel",
"utils.logging",
"numpy.array",
"numpy.stack",
"torch.cuda.is_available",
"utils.read_data_cfg",
"utils.nms",
"torch.cuda.manual_seed",
"torch... | [((617, 639), 'utils.read_data_cfg', 'read_data_cfg', (['datacfg'], {}), '(datacfg)\n', (630, 639), False, 'from utils import get_all_boxes, nms, read_data_cfg, logging, map_iou\n'), ((993, 1016), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (1010, 1016), False, 'import torch\n'), ((1151, 1167)... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016, French National Center for Scientific Research (CNRS)
# Distributed under the (new) BSD License. See LICENSE for more info.
import threading, time, logging
from teleprox import RPCClient, RemoteCallException, RPCServer, QtRPCServer, ObjectProxy, ProcessSpawner
from telepro... | [
"logging.getLogger",
"teleprox.RPCClient",
"time.sleep",
"teleprox.ProcessSpawner",
"teleprox.QtRPCServer",
"numpy.arange",
"threading.Thread.__init__",
"threading.Lock",
"teleprox.log.set_process_name",
"numpy.ones",
"teleprox.log.start_log_server",
"teleprox.log.RPCLogHandler",
"os.path.di... | [((558, 577), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (575, 577), False, 'import threading, time, logging\n'), ((608, 632), 'teleprox.log.start_log_server', 'start_log_server', (['logger'], {}), '(logger)\n', (624, 632), False, 'from teleprox.log import RPCLogHandler, set_process_name, set_thread_na... |
import os,sys
#Please specify the mask_rcnn directory [todo: using json for specify the folder]
#github:https://github.com/matterport/Mask_RCNN
#MASKRCNN_DIR="/home/kiru/common_ws/Mask_RCNN_Mod/"
#sys.path.append(MASKRCNN_DIR)
#sys.path.append(".")
#sys.path.append("./bop_toolkit")
import numpy as np
from mrcnn.confi... | [
"os.listdir",
"os.path.join",
"numpy.max",
"numpy.array",
"skimage.io.imread",
"numpy.sum",
"numpy.load"
] | [((1306, 1356), 'numpy.array', 'np.array', (['[self.IMAGE_MAX_DIM, self.IMAGE_MAX_DIM]'], {}), '([self.IMAGE_MAX_DIM, self.IMAGE_MAX_DIM])\n', (1314, 1356), True, 'import numpy as np\n'), ((2320, 2370), 'numpy.array', 'np.array', (['[self.IMAGE_MAX_DIM, self.IMAGE_MAX_DIM]'], {}), '([self.IMAGE_MAX_DIM, self.IMAGE_MAX_... |
#
# cmap.py -- color maps for fits viewing
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import absolute_import, print_function
from .util import six
import warnings
import numpy as np
__all__ = ['ColorMap', 'add_cmap', 'get_cmap', 'ha... | [
"numpy.float",
"warnings.catch_warnings",
"numpy.asarray",
"warnings.simplefilter",
"matplotlib.cm.get_cmap",
"numpy.arange"
] | [((613155, 613174), 'numpy.asarray', 'np.asarray', (['cm.clst'], {}), '(cm.clst)\n', (613165, 613174), True, 'import numpy as np\n'), ((612842, 612868), 'numpy.arange', 'np.arange', (['(0)', 'min_cmap_len'], {}), '(0, min_cmap_len)\n', (612851, 612868), True, 'import numpy as np\n'), ((612871, 612897), 'numpy.float', '... |
import numpy as np
import ray
import torch
from gym_ds3.schedulers.models.simple_model import SimpleModel
from gym_ds3.envs.utils.helper_envs import num_pes, get_env
from gym_ds3.envs.utils.helper_training import calculate_returns
@ray.remote
class ACWorker(object):
def __init__(self, args, _id):
self.a... | [
"torch.manual_seed",
"gym_ds3.envs.utils.helper_envs.get_env",
"gym_ds3.schedulers.models.simple_model.SimpleModel",
"gym_ds3.envs.utils.helper_envs.num_pes",
"torch.exp",
"gym_ds3.envs.utils.helper_training.calculate_returns",
"numpy.sum",
"torch.cuda.is_available",
"torch.tensor",
"numpy.random.... | [((423, 451), 'torch.manual_seed', 'torch.manual_seed', (['self.seed'], {}), '(self.seed)\n', (440, 451), False, 'import torch\n'), ((460, 485), 'numpy.random.seed', 'np.random.seed', (['self.seed'], {}), '(self.seed)\n', (474, 485), True, 'import numpy as np\n'), ((691, 704), 'gym_ds3.envs.utils.helper_envs.num_pes', ... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import numpy as np
import spiceminer as sm
from spiceminer.extra import angle
def car2sphere(xyz):
'''Convert cartesian to spherical coordinates.'''
r = np.sqrt(np.sum(xyz ** 2, 0))
theta = np.arccos(xyz[2] / r)
phi = np.arctan(xyz[1] / xyz[0])
return r... | [
"numpy.identity",
"numpy.arccos",
"numpy.arctan",
"spiceminer.Time",
"spiceminer.load",
"numpy.sum",
"spiceminer.extra.angle",
"numpy.degrees",
"spiceminer.Body",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((465, 480), 'spiceminer.load', 'sm.load', (['"""data"""'], {}), "('data')\n", (472, 480), True, 'import spiceminer as sm\n'), ((512, 527), 'spiceminer.Body', 'sm.Body', (['"""mars"""'], {}), "('mars')\n", (519, 527), True, 'import spiceminer as sm\n'), ((536, 556), 'spiceminer.Body', 'sm.Body', (['"""msl_rover"""'], ... |
"""Runs a random policy for the random object KukaObjectEnv.
"""
import tigercontrol
import numpy as np
import time
from gym import spaces
class ContinuousDownwardBiasPolicy(object):
"""Policy which takes continuous actions, and is biased to move down.
"""
def __init__(self, height_hack_prob=0.9):
... | [
"numpy.random.random",
"tigercontrol.environment",
"time.time",
"gym.spaces.Box"
] | [((935, 976), 'tigercontrol.environment', 'tigercontrol.environment', (['"""PyBullet-Kuka"""'], {}), "('PyBullet-Kuka')\n", (959, 976), False, 'import tigercontrol\n'), ((1080, 1091), 'time.time', 'time.time', ([], {}), '()\n', (1089, 1091), False, 'import time\n'), ((548, 586), 'gym.spaces.Box', 'spaces.Box', ([], {'l... |
from utils import initialize
import numpy as np
import random
import copy
import time
import sys
import os
class GA(object):
def __init__(self, terminal_symb, x, y, size, num_generations=400, crossover_rate=0.7, mutation_rate=0.05, early_stop=0.1, history_len=20):
self.primitive_symbol = ['+','-','*','/',... | [
"numpy.random.random",
"numpy.std",
"utils.initialize",
"numpy.array",
"numpy.zeros",
"numpy.random.randint",
"numpy.isnan",
"copy.deepcopy",
"numpy.argmin",
"random.random",
"time.time"
] | [((792, 825), 'numpy.zeros', 'np.zeros', (['(self.size,)'], {'dtype': 'int'}), '((self.size,), dtype=int)\n', (800, 825), True, 'import numpy as np\n'), ((1154, 1169), 'numpy.array', 'np.array', (['error'], {}), '(error)\n', (1162, 1169), True, 'import numpy as np\n'), ((1248, 1263), 'numpy.isnan', 'np.isnan', (['error... |
# SK model
import math
import pickle
import sys
import numpy as np
import torch
class SKModel():
def __init__(self, n, beta, device, field=0, seed=0):
self.n = n
self.beta = beta
self.field = field
self.seed = seed
if seed > 0:
torch.manual_seed(seed)
... | [
"torch.manual_seed",
"torch.triu",
"pickle.dump",
"torch.log",
"math.pow",
"torch.mean",
"math.sqrt",
"numpy.binary_repr",
"torch.exp",
"math.log",
"torch.from_numpy",
"torch.sum",
"torch.zeros",
"sys.stdout.flush",
"torch.randn",
"torch.device"
] | [((3274, 3293), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (3286, 3293), False, 'import torch\n'), ((434, 464), 'torch.triu', 'torch.triu', (['self.J'], {'diagonal': '(1)'}), '(self.J, diagonal=1)\n', (444, 464), False, 'import torch\n'), ((288, 311), 'torch.manual_seed', 'torch.manual_seed', (['... |
# standard libraries
import os
import shutil
import typing
import unittest
# third party libraries
import h5py
import numpy
# local libraries
from nion.data import Image
_ImageDataType = Image._ImageDataType
class TestImageClass(unittest.TestCase):
def setUp(self) -> None:
pass
def tearDown(self... | [
"os.path.exists",
"numpy.mean",
"numpy.ones",
"os.makedirs",
"os.path.join",
"os.getcwd",
"numpy.zeros",
"numpy.var",
"numpy.array_equal",
"shutil.rmtree",
"nion.data.Image.create_rgba_image_from_array",
"nion.data.Image.rebin_1d",
"nion.data.Image.scaled",
"numpy.arange"
] | [((424, 462), 'numpy.zeros', 'numpy.zeros', (['(16,)'], {'dtype': 'numpy.double'}), '((16,), dtype=numpy.double)\n', (435, 462), False, 'import numpy\n'), ((488, 528), 'numpy.zeros', 'numpy.zeros', (['(16, 1)'], {'dtype': 'numpy.double'}), '((16, 1), dtype=numpy.double)\n', (499, 528), False, 'import numpy\n'), ((710, ... |
import numpy as np
from bayesnet.array.broadcast import broadcast_to
from bayesnet.math.exp import exp
from bayesnet.math.log import log
from bayesnet.math.sqrt import sqrt
from bayesnet.math.square import square
from bayesnet.random.random import RandomVariable
from bayesnet.tensor.constant import Constant
from bayesn... | [
"numpy.random.normal",
"bayesnet.tensor.constant.Constant",
"bayesnet.math.sqrt.sqrt",
"bayesnet.tensor.tensor.Tensor",
"bayesnet.math.square.square",
"numpy.random.choice",
"numpy.broadcast",
"bayesnet.array.broadcast.broadcast_to"
] | [((2993, 3022), 'bayesnet.math.square.square', 'square', (["self.parameter['std']"], {}), "(self.parameter['std'])\n", (2999, 3022), False, 'from bayesnet.math.square import square\n'), ((3251, 3326), 'numpy.random.normal', 'np.random.normal', ([], {'loc': 'self.mu.value[indices]', 'scale': 'self.std.value[indices]'}),... |
"""combine multiple images into one using a sliding window of vertical strips"""
import glob
import os
import sys
from typing import List, Tuple
import numpy as np
from PIL import Image
def get_files(directory: str, name_filter: str = "*.jpg") -> List:
"""
List files in specified directory matching filter
... | [
"numpy.dstack",
"os.path.join",
"os.path.split",
"numpy.array",
"numpy.zeros_like",
"glob.glob"
] | [((506, 542), 'os.path.join', 'os.path.join', (['directory', 'name_filter'], {}), '(directory, name_filter)\n', (518, 542), False, 'import os\n'), ((2073, 2104), 'numpy.zeros_like', 'np.zeros_like', (['first_image_data'], {}), '(first_image_data)\n', (2086, 2104), True, 'import numpy as np\n'), ((2119, 2150), 'numpy.ze... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms, datasets
import time, os, argparse
from torch.autograd import Variable
from modules import *
class MNIST:
def __init__(self, bs=1):
dataset_transform = transforms.Compose([
... | [
"os.path.exists",
"torch.optim.SGD",
"torch.nn.functional.softmax",
"argparse.ArgumentParser",
"os.makedirs",
"torch.eye",
"numpy.sum",
"torchvision.datasets.MNIST",
"torch.utils.data.DataLoader",
"torch.save",
"torchvision.transforms.Normalize",
"torchvision.transforms.ToTensor",
"torch.aut... | [((970, 1021), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Cupy Capsnet"""'}), "(description='Cupy Capsnet')\n", (993, 1021), False, 'import time, os, argparse\n'), ((2632, 2652), 'torch.FloatTensor', 'torch.FloatTensor', (['(1)'], {}), '(1)\n', (2649, 2652), False, 'import torch\n'),... |
import numpy as np
import random
BLOCK_SIZE_IN_BYTE = 16 # bytes
BLOCK_SIZE_IN_HEX = BLOCK_SIZE_IN_BYTE*2 # hex
class Chill:
def __init__(self, plain_text_src = 'text', plain_text = '', plain_text_path = '', key = 'key', mode = 'ECB', cipher_text_path = '', cipher_text=''):
# constructor
if mode.upper() in [... | [
"numpy.copy",
"numpy.roll",
"random.randrange",
"numpy.asarray",
"random.seed",
"numpy.zeros",
"numpy.rot90"
] | [((3627, 3645), 'numpy.asarray', 'np.asarray', (['result'], {}), '(result)\n', (3637, 3645), True, 'import numpy as np\n'), ((3741, 3763), 'numpy.zeros', 'np.zeros', (['(4, 4)', '"""U2"""'], {}), "((4, 4), 'U2')\n", (3749, 3763), True, 'import numpy as np\n'), ((4817, 4831), 'numpy.copy', 'np.copy', (['input'], {}), '(... |
# Authors: <NAME>
# License: BSD 3 Clause
"""
PyMF Principal Component Analysis.
PCA: Class for Principal Component Analysis
"""
import numpy as np
from .base import PyMFBase
from .svd import SVD
__all__ = ["PCA"]
class PCA(PyMFBase):
"""
PCA(data, num_bases=4, center_mean=True)
Princi... | [
"numpy.argsort",
"numpy.dot",
"doctest.testmod",
"numpy.diag"
] | [((4222, 4239), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (4237, 4239), False, 'import doctest\n'), ((2555, 2588), 'numpy.dot', 'np.dot', (['self.W.T', 'self.data[:, :]'], {}), '(self.W.T, self.data[:, :])\n', (2561, 2588), True, 'import numpy as np\n'), ((2898, 2916), 'numpy.diag', 'np.diag', (['svd_mdl.... |
from flask import Flask, render_template, request
import pickle
import numpy as np
model = pickle.load(open('Regressor_task2_model.pkl','rb'))
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['POST'])
def predict():
if request.method == ... | [
"flask.render_template",
"numpy.array",
"flask.Flask"
] | [((151, 166), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (156, 166), False, 'from flask import Flask, render_template, request\n'), ((206, 235), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (221, 235), False, 'from flask import Flask, render_template, requ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements classes for detecting stars in an astronomical
image. The convention is that all star-finding classes are subclasses of
an abstract base class called ``StarFinderBase``. Each star-finding
class should define a method called ``f... | [
"numpy.log10",
"numpy.sqrt",
"astropy.table.Table",
"numpy.log",
"math.sqrt",
"numpy.count_nonzero",
"numpy.array",
"numpy.argsort",
"numpy.arctan2",
"numpy.sin",
"numpy.arange",
"numpy.isscalar",
"numpy.where",
"numpy.max",
"numpy.exp",
"warnings.warn",
"numpy.meshgrid",
"numpy.ab... | [((21867, 21911), 'numpy.transpose', 'np.transpose', (["[tbl['y_peak'], tbl['x_peak']]"], {}), "([tbl['y_peak'], tbl['x_peak']])\n", (21879, 21911), True, 'import numpy as np\n'), ((3089, 3111), 'numpy.deg2rad', 'np.deg2rad', (['self.theta'], {}), '(self.theta)\n', (3099, 3111), True, 'import numpy as np\n'), ((3127, 3... |
from __future__ import division
'''
***********************************************************
File: softmaxModels.py
Allows for the creation, and use of Softmax functions
Version 1.3.0: Added Discretization function
Version 1.3.1: Added Likelihood weighted Importance sampling
**********************************... | [
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"numpy.hstack",
"numpy.log",
"math.sqrt",
"math.cos",
"numpy.array",
"copy.deepcopy",
"math.exp",
"matplotlib.pyplot.contourf",
"numpy.atleast_2d",
"scipy.linalg.lstsq",
"numpy.random.random",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",... | [((23704, 23734), 'gaussianMixtures.GM', 'GM', (['[2, 4]', '[1, 0.5]', '[1, 0.5]'], {}), '([2, 4], [1, 0.5], [1, 0.5])\n', (23706, 23734), False, 'from gaussianMixtures import GM\n'), ((24283, 24315), 'matplotlib.pyplot.plot', 'plt.plot', (['x0', 'classes[softClass]'], {}), '(x0, classes[softClass])\n', (24291, 24315),... |
# map-ephys interative shell module
import os
import sys
import logging
from code import interact
import time
import numpy as np
import pandas as pd
import datetime
import datajoint as dj
from pipeline import lab
from pipeline import experiment
from pipeline import ccf
from pipeline import ephys
from pipeline import... | [
"logging.getLogger",
"pipeline.ephys.ProbeInsertion.InsertionLocation.insert",
"logging.StreamHandler",
"pipeline.psth.UnitSelectivity.populate",
"pipeline.lab.Subject.proj",
"pipeline.ephys.ProbeInsertion.RecordableBrainRegion.insert",
"pipeline.ingest.tracking.TrackingIngest",
"time.sleep",
"pipel... | [((561, 588), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (578, 588), False, 'import logging\n'), ((753, 764), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (761, 764), False, 'import sys\n'), ((1302, 1361), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.ERROR'... |
import numpy as np
import rllab.misc.logger as logger
from rllab.misc import special2 as special
class SimpleReplayPool(object):
def __init__(
self,
max_pool_size,
observation_dim,
action_dim,
replacement_policy='stochastic',
replacement_p... | [
"rllab.misc.special2.to_onehot_n",
"rllab.misc.special2.from_onehot",
"rllab.misc.logger.log",
"numpy.zeros",
"numpy.random.randint",
"numpy.concatenate",
"numpy.random.uniform"
] | [((698, 740), 'numpy.zeros', 'np.zeros', (['(max_pool_size, observation_dim)'], {}), '((max_pool_size, observation_dim))\n', (706, 740), True, 'import numpy as np\n'), ((1108, 1131), 'numpy.zeros', 'np.zeros', (['max_pool_size'], {}), '(max_pool_size)\n', (1116, 1131), True, 'import numpy as np\n'), ((1158, 1196), 'num... |
# Freddy @DC, uWaterloo, ON, Canada
# Nov 13, 2017
import torch
import torch.nn as nn
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
import numpy as np
import pandas as pd
import sys
import math
import time
from tqdm import *
from data_preprocess ... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"pandas.DataFrame",
"torch.load",
"torch.nn.Conv2d",
"torch.nn.MSELoss",
"torch.cuda.is_available",
"torch.nn.MaxPool2d",
"logger.Logger",
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"numpy.sign",
"torch.autograd.Variable"
] | [((698, 723), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (721, 723), False, 'import torch\n'), ((1519, 1606), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', ([], {'dataset': 'train_set', 'batch_size': 'batch_size', 'shuffle': '(True)'}), '(dataset=train_set, batch_size=batch_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.