code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import json import os import re from pathlib import Path import numpy as np import pandas as pd SIMRAD_FILENAME_MATCHER = re.compile( r"(?P<survey>.+)?-?D(?P<date>\w{1,8})-T(?P<time>\w{1,6})-?(?P<postfix>\w+)?\..+" ) def from_JSON(j): """Opens a JSON file Parameters ---------- j : str V...
[ "json.load", "pandas.Timestamp", "json.loads", "os.path.isfile", "pathlib.Path", "pandas.to_datetime", "pandas.Timedelta", "numpy.issubdtype", "re.compile" ]
[((124, 229), 're.compile', 're.compile', (['"""(?P<survey>.+)?-?D(?P<date>\\\\w{1,8})-T(?P<time>\\\\w{1,6})-?(?P<postfix>\\\\w+)?\\\\..+"""'], {}), "(\n '(?P<survey>.+)?-?D(?P<date>\\\\w{1,8})-T(?P<time>\\\\w{1,6})-?(?P<postfix>\\\\w+)?\\\\..+'\n )\n", (134, 229), False, 'import re\n'), ((373, 390), 'os.path.isf...
import copy import dace import dace.sdfg.nodes import numpy as np # Python version of the SDFG below # @dace.program # def reduce_with_offsets(A: dace.float64[50, 50], B: dace.float64[25]): # B[4:11] = dace.reduce(lambda a,b: a+b, A[25:50, 13:20], axis=0, # identity=0) reduce_with_offset...
[ "copy.deepcopy", "numpy.sum", "dace.Memlet.simple", "numpy.max", "numpy.random.rand", "dace.SDFG", "numpy.ndarray" ]
[((324, 356), 'dace.SDFG', 'dace.SDFG', (['"""reduce_with_offsets"""'], {}), "('reduce_with_offsets')\n", (333, 356), False, 'import dace\n'), ((650, 689), 'dace.Memlet.simple', 'dace.Memlet.simple', (['"""A"""', '"""25:50, 13:20"""'], {}), "('A', '25:50, 13:20')\n", (668, 689), False, 'import dace\n'), ((720, 751), 'd...
from setuptools import setup from Cython.Build import cythonize import numpy setup( name='matmul', ext_modules=cythonize('matmul.pyx', language_level=3), include_dirs=[numpy.get_include()], setup_requires=[ 'Cython', 'NumPy', ], install_requires=[ 'NumPy', ], )
[ "Cython.Build.cythonize", "numpy.get_include" ]
[((120, 161), 'Cython.Build.cythonize', 'cythonize', (['"""matmul.pyx"""'], {'language_level': '(3)'}), "('matmul.pyx', language_level=3)\n", (129, 161), False, 'from Cython.Build import cythonize\n'), ((181, 200), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (198, 200), False, 'import numpy\n')]
# -*- coding: utf-8 -*- """ Functions to train the readout module to perform tasks @author: <NAME> """ import numpy as np import pandas as pd import scipy as sp import mdp from sklearn import metrics from sklearn.model_selection import ParameterGrid from sklearn.linear_model import Ridge, RidgeClassifier from sklear...
[ "pandas.DataFrame", "numpy.sum", "numpy.corrcoef", "sklearn.linear_model.RidgeClassifier", "sklearn.linear_model.Ridge" ]
[((2131, 2144), 'numpy.sum', 'np.sum', (['score'], {}), '(score)\n', (2137, 2144), True, 'import numpy as np\n'), ((4265, 4310), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': '[score]', 'columns': "['score']"}), "(data=[score], columns=['score'])\n", (4277, 4310), True, 'import pandas as pd\n'), ((1213, 1260), 'skl...
import pickle import numpy as np import matplotlib.pyplot as plt def running_average(data, subset_size=10): new_data = np.zeros(data.shape[0] - subset_size + 1) for i in range(new_data.shape[0]): new_data[i] = np.mean(data[i : i + subset_size]) return new_data path_name = "models/wall/maac_ccr1/ru...
[ "matplotlib.pyplot.plot", "numpy.zeros", "pickle.load", "numpy.mean", "matplotlib.pyplot.savefig" ]
[((602, 623), 'matplotlib.pyplot.plot', 'plt.plot', (['reward_data'], {}), '(reward_data)\n', (610, 623), True, 'import matplotlib.pyplot as plt\n'), ((625, 667), 'matplotlib.pyplot.savefig', 'plt.savefig', (["(path_name + 'new_rewards.png')"], {}), "(path_name + 'new_rewards.png')\n", (636, 667), True, 'import matplot...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 29 16:53:19 2019 @author: gparkes """ from numba import jit import numpy as np import matplotlib.pyplot as plt # task 1 @jit(nopython=True) def calc_positional_e(spins, J): """ In this strategy, we use pure Python and beef up our code with...
[ "numpy.zeros_like", "matplotlib.pyplot.show", "numpy.sum", "matplotlib.pyplot.plot", "numpy.zeros", "numpy.ones", "matplotlib.pyplot.figure", "numpy.random.randint", "numba.jit", "numpy.exp", "numpy.linspace", "numpy.random.choice", "numpy.random.rand", "matplotlib.pyplot.ylabel", "matpl...
[((194, 212), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (197, 212), False, 'from numba import jit\n'), ((375, 395), 'numpy.zeros_like', 'np.zeros_like', (['spins'], {}), '(spins)\n', (388, 395), True, 'import numpy as np\n'), ((1880, 1918), 'numpy.random.choice', 'np.random.choice', (['[-1,...
""" Tests for the Deep explainer. """ from distutils.version import LooseVersion from urllib.error import HTTPError import numpy as np import pandas as pd import pytest import shap from shap import DeepExplainer #os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # pylint: disable=import-outside-toplevel def test_tf_eager()...
[ "numpy.random.seed", "tensorflow.keras.layers.MaxPooling2D", "numpy.abs", "tensorflow.keras.layers.Dense", "numpy.allclose", "tensorflow.keras.optimizers.SGD", "torch.nn.MaxPool1d", "sklearn.datasets.load_boston", "torch.nn.Softmax", "tensorflow.keras.models.Sequential", "numpy.random.normal", ...
[((390, 423), 'pytest.importorskip', 'pytest.importorskip', (['"""tensorflow"""'], {}), "('tensorflow')\n", (409, 423), False, 'import pytest\n'), ((1063, 1097), 'shap.DeepExplainer', 'DeepExplainer', (['model', 'x.values[:1]'], {}), '(model, x.values[:1])\n', (1076, 1097), False, 'from shap import DeepExplainer\n'), (...
from http.server import BaseHTTPRequestHandler, HTTPServer from urllib.parse import urlparse import time import tensorflow as tf import json import tensorflow_hub as hub import numpy as np hostName = "192.168.1.3" hostPort = 80 module_url = "https://tfhub.dev/google/universal-sentence-encoder/4" model = hub.load(mod...
[ "time.asctime", "http.server.HTTPServer", "tensorflow_hub.load", "numpy.inner", "urllib.parse.urlparse" ]
[((308, 328), 'tensorflow_hub.load', 'hub.load', (['module_url'], {}), '(module_url)\n', (316, 328), True, 'import tensorflow_hub as hub\n'), ((1508, 1550), 'http.server.HTTPServer', 'HTTPServer', (['(hostName, hostPort)', 'MyServer'], {}), '((hostName, hostPort), MyServer)\n', (1518, 1550), False, 'from http.server im...
""" Copyright (c) 2020 University of Massachusetts All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Authors: <NAME> <<EMAIL>> """ """ Run WASR inference on a single image, return the segmented image mask Based on wasr_i...
[ "tensorflow.train.Saver", "wasr_models.wasr_NOIMU2", "tensorflow.argmax", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.concat", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.global_variables", "tensorflow.ConfigProto", "numpy.array", "tensor...
[((628, 684), 'numpy.array', 'np.array', (['(148.843, 171.026, 162.4082)'], {'dtype': 'np.float32'}), '((148.843, 171.026, 162.4082), dtype=np.float32)\n', (636, 684), True, 'import numpy as np\n'), ((1011, 1078), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.uint8', 'shape': '(IMG_SIZE[0], IMG_SIZE[1]...
"""Classes to compute cluster centers with different algorithms. This file contains the generic centering class and various different implementations of different centering algorithms. The main algorithm is CenteringWcenZred, but others are included as part of the centering training procedure. """ import fitsio impor...
[ "numpy.sum", "numpy.abs", "numpy.argmin", "numpy.clip", "numpy.argsort", "numpy.sin", "numpy.prod", "numpy.isfinite", "numpy.cumsum", "numpy.log10", "numpy.radians", "numpy.cos", "numpy.random.uniform", "numpy.log", "numpy.zeros", "numpy.where", "numpy.array", "numpy.random.random"...
[((1621, 1661), 'numpy.zeros', 'np.zeros', (['self.config.percolation_maxcen'], {}), '(self.config.percolation_maxcen)\n', (1629, 1661), True, 'import numpy as np\n'), ((1683, 1723), 'numpy.zeros', 'np.zeros', (['self.config.percolation_maxcen'], {}), '(self.config.percolation_maxcen)\n', (1691, 1723), True, 'import nu...
# -*- coding: utf-8 -*- """ Created on Fri Nov 12 16:48:58 2021 @author: Alex """ reset -f import os import pandas as pd import numpy as np import matplotlib.pyplot as plt #change working directory os.chdir('C:/Programacion E...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.hist", "os.getcwd", "pandas.read_csv", "numpy.std", "pandas.merge", "matplotlib.pyplot.bar", "matplotlib.pyplot.text", "numpy.mean", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "os.chdir", ...
[((293, 350), 'os.chdir', 'os.chdir', (['"""C:/Programacion Estadistica PEP/code_and_data"""'], {}), "('C:/Programacion Estadistica PEP/code_and_data')\n", (301, 350), False, 'import os\n'), ((351, 362), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (360, 362), False, 'import os\n'), ((404, 473), 'pandas.read_csv', 'pd.r...
import scipy.optimize as sopt import scipy.linalg as slin import numpy as np import networkx as nx from multidag.common.consts import DEVICE import torch # from notears.linear import notears_linear from tqdm import tqdm import math import torch.nn.functional as F def matrix_poly(W): if len(W.shape) == 2: ...
[ "numpy.trace", "numpy.abs", "torch.eye", "torch.matrix_exp", "numpy.ones", "scipy.optimize.minimize", "networkx.topological_sort", "torch.zeros", "numpy.intersect1d", "torch.is_tensor", "math.log", "torch.log", "torch.trace", "torch.matrix_power", "torch.normal", "torch.einsum", "net...
[((7429, 7448), 'torch.zeros', 'torch.zeros', (['[n, d]'], {}), '([n, d])\n', (7440, 7448), False, 'import torch\n'), ((7474, 7493), 'torch.zeros', 'torch.zeros', (['[n, d]'], {}), '([n, d])\n', (7485, 7493), False, 'import torch\n'), ((9931, 9958), 'numpy.flatnonzero', 'np.flatnonzero', (['(B_est == -1)'], {}), '(B_es...
# Author: <NAME> # Last modification: 2021/22/09 import numpy as np import torch import pycuda.autoinit from pycuda.gpuarray import to_gpu from cufinufft import cufinufft from nufftbindings.basenufft import * # Note: in order for cuFINUFFT to work with pytorch tensor (and not GPUArray from pycuda), we have to do the ...
[ "cufinufft.cufinufft", "numpy.meshgrid", "torch.zeros_like", "torch.mul", "numpy.arange", "torch.zeros", "torch.tensor" ]
[((949, 992), 'torch.tensor', 'torch.tensor', (['self.XX.T'], {'device': 'self.device'}), '(self.XX.T, device=self.device)\n', (961, 992), False, 'import torch\n'), ((1011, 1054), 'torch.tensor', 'torch.tensor', (['self.XY.T'], {'device': 'self.device'}), '(self.XY.T, device=self.device)\n', (1023, 1054), False, 'impor...
# Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC San Diego. # Created by <NAME>, <NAME> from final_env import FinalEnv, SolutionBase...
[ "transforms3d.euler.euler2quat", "numpy.random.seed", "numpy.abs", "numpy.log", "numpy.concatenate", "final_env.FinalEnv", "transforms3d.euler.quat2euler", "sapien.core.Pose", "numpy.where", "numpy.linalg.norm", "transforms3d.quaternions.qinverse", "numpy.linalg.inv", "numpy.array", "numpy...
[((9204, 9221), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (9218, 9221), True, 'import numpy as np\n'), ((9232, 9242), 'final_env.FinalEnv', 'FinalEnv', ([], {}), '()\n', (9240, 9242), False, 'from final_env import FinalEnv, SolutionBase\n'), ((5776, 5797), 'transforms3d.quaternions.quat2axangle', '...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import onnxruntime from PIL import Image, ImageDraw, ImageFont import numpy as np import time import io import json import os from datetime import datetime # Imports for the REST API from flask import Flask, request, jsonify, Response session =...
[ "os.mkdir", "PIL.Image.new", "io.BytesIO", "PIL.ImageFont.load_default", "flask.Flask", "os.path.exists", "numpy.transpose", "numpy.expand_dims", "time.time", "onnxruntime.InferenceSession", "PIL.Image.open", "datetime.datetime.now", "flask.request.get_data", "numpy.array", "json.dumps",...
[((4119, 4134), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (4124, 4134), False, 'from flask import Flask, request, jsonify, Response\n'), ((584, 624), 'onnxruntime.InferenceSession', 'onnxruntime.InferenceSession', (['model_path'], {}), '(model_path)\n', (612, 624), False, 'import onnxruntime\n'), ((90...
#!/usr/bin/env python3 import numpy as np matrix = np.array([[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12], [13, 14, 15, 16, 17, 18], [19, 20, 21, 22, 23, 24]]) mat1 = matrix[1:3, ...] mat2 = matrix[..., 2:4] mat3 = matrix[-3:, 3:] print("The middle two rows of the matrix are:\n{}".format(mat1)) print("T...
[ "numpy.array" ]
[((51, 161), 'numpy.array', 'np.array', (['[[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12], [13, 14, 15, 16, 17, 18], [19, \n 20, 21, 22, 23, 24]]'], {}), '([[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12], [13, 14, 15, 16, 17, \n 18], [19, 20, 21, 22, 23, 24]])\n', (59, 161), True, 'import numpy as np\n')]
from typing import List, Tuple, Union import numpy as np from numpy.core.fromnumeric import resize from .base import Transformer from .crop import RandomCenterCrop, RandomCrop from .resize import Resize from .padding import ZeroPadding class _ResizeCroPad(Transformer): def __init__( self, final_si...
[ "numpy.random.uniform" ]
[((824, 854), 'numpy.random.uniform', 'np.random.uniform', (['*self.range'], {}), '(*self.range)\n', (841, 854), True, 'import numpy as np\n')]
############################################################################ # Copyright ESIEE Paris (2018) # # # # Contributor(s) : <NAME> # # ...
[ "higra.labelisation_horizontal_cut_from_num_regions", "numpy.amin", "higra.accumulate_parallel", "higra.saliency", "higra.filter_non_relevant_node_from_tree", "higra.get_4_adjacency_graph", "higra.quasi_flat_zone_hierarchy", "unittest.main", "higra.test_altitudes_increasingness", "higra.component_...
[((11872, 11887), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11885, 11887), False, 'import unittest\n'), ((906, 1002), 'numpy.asarray', 'np.asarray', (['((1, 8), (2, 7), (3, 6), (4, 5), (5, 4), (6, 3), (7, 2), (8, 1))'], {'dtype': 'np.int32'}), '(((1, 8), (2, 7), (3, 6), (4, 5), (5, 4), (6, 3), (7, 2), (8, 1)...
import numpy as np from skimage import img_as_float from skimage.color import rgb2grey from skimage.morphology import remove_small_holes, remove_small_objects, disk, skeletonize from skimage.filters import threshold_sauvola, threshold_local, gaussian from skimage.util import invert from scipy.sparse import dok_matrix...
[ "scipy.signal.convolve2d", "skimage.morphology.remove_small_holes", "numpy.zeros", "skimage.morphology.skeletonize", "skimage.filters.threshold_sauvola", "skimage.morphology.remove_small_objects", "skimage.color.rgb2grey", "scipy.ndimage.morphology.distance_transform_edt", "skimage.filters.gaussian"...
[((1065, 1094), 'skimage.filters.gaussian', 'gaussian', (['self.input'], {'sigma': '(4)'}), '(self.input, sigma=4)\n', (1073, 1094), False, 'from skimage.filters import threshold_sauvola, threshold_local, gaussian\n'), ((1296, 1353), 'skimage.filters.threshold_sauvola', 'threshold_sauvola', (['self.input', "self.config...
# imu_moving_average.py """ Author: <NAME> (<EMAIL>), 2022 Brief: Code to load IMU data (ADXL327 3-axis accelerometer) from file and plot raw and moving-average filtered pitch angle data Course: ENPM809T - Autonomous Robotics [HW01] Date: 3rd February, 2022 """ # Required packages import numpy as np ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "numpy.average", "numpy.std", "matplotlib.pyplot.legend", "numpy.shape", "matplotlib.pyplot.text", "numpy.mean", "numpy.loadtxt", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((437, 484), 'numpy.loadtxt', 'np.loadtxt', (['file_name'], {'delimiter': '""" """', 'dtype': 'str'}), "(file_name, delimiter=' ', dtype=str)\n", (447, 484), True, 'import numpy as np\n'), ((584, 606), 'numpy.shape', 'np.shape', (['imu_raw_data'], {}), '(imu_raw_data)\n', (592, 606), True, 'import numpy as np\n'), ((1...
"""Testing visualization with fvtk.""" import os import warnings import numpy as np from distutils.version import LooseVersion from dipy.viz import fvtk from dipy import data import numpy.testing as npt from dipy.testing.decorators import xvfb_it from dipy.utils.optpkg import optional_package use_xvfb = os.environ.g...
[ "dipy.data.get_cmap", "dipy.viz.fvtk.streamtube", "dipy.viz.fvtk.line", "dipy.viz.fvtk.volume", "dipy.data.get_sphere", "numpy.ones", "numpy.allclose", "dipy.viz.fvtk.create_colormap", "dipy.viz.fvtk.tensor", "numpy.testing.assert_array_almost_equal", "numpy.testing.dec.skipif", "dipy.viz.fvtk...
[((308, 347), 'os.environ.get', 'os.environ.get', (['"""TEST_WITH_XVFB"""', '(False)'], {}), "('TEST_WITH_XVFB', False)\n", (322, 347), False, 'import os\n'), ((442, 475), 'dipy.utils.optpkg.optional_package', 'optional_package', (['"""matplotlib.cm"""'], {}), "('matplotlib.cm')\n", (458, 475), False, 'from dipy.utils....
# *************************************************************** # Copyright (c) 2020 Jittor. Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>>. # All Rights Reserved. # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this source code package. # ***************...
[ "unittest.main", "unittest.skipIf", "jittor.array", "jittor.dirty_fix_pytorch_runtime_error", "torch.searchsorted", "numpy.random.rand", "jittor.flag_scope", "jittor.searchsorted", "torch.from_numpy" ]
[((548, 597), 'unittest.skipIf', 'unittest.skipIf', (['skip_this_test', '"""No Torch Found"""'], {}), "(skip_this_test, 'No Torch Found')\n", (563, 597), False, 'import unittest\n'), ((457, 493), 'jittor.dirty_fix_pytorch_runtime_error', 'jt.dirty_fix_pytorch_runtime_error', ([], {}), '()\n', (491, 493), True, 'import ...
from embeddings import PositionalEncoding from utils.pad import pad_masking, subsequent_masking import torch from torch import nn import numpy as np from collections import defaultdict PAD_TOKEN_ID = 0 def build_model(config, source_vocabulary_size, target_vocabulary_size): if config['positional_encoding']: ...
[ "torch.nn.Dropout", "utils.pad.subsequent_masking", "torch.ones", "torch.nn.ReLU", "torch.nn.Embedding", "embeddings.PositionalEncoding", "torch.cat", "utils.pad.pad_masking", "collections.defaultdict", "torch.nn.Softmax", "torch.nn.Linear", "torch.zeros", "torch.matmul", "torch.tensor", ...
[((344, 462), 'embeddings.PositionalEncoding', 'PositionalEncoding', ([], {'num_embeddings': 'source_vocabulary_size', 'embedding_dim': "config['d_model']", 'dim': "config['d_model']"}), "(num_embeddings=source_vocabulary_size, embedding_dim=\n config['d_model'], dim=config['d_model'])\n", (362, 462), False, 'from e...
#!/usr/bin/env python # Policy gradient algorithm and agent with neural network policy # Chapter 2, TensorFlow 2 Reinforcement Learning Cookbook | <NAME> import tensorflow as tf import tensorflow_probability as tfp from tensorflow import keras from tensorflow.keras import layers import numpy as np import gym class P...
[ "tensorflow.math.log", "gym.make", "tensorflow.keras.layers.Dense", "tensorflow.convert_to_tensor", "tensorflow_probability.distributions.Categorical", "tensorflow.keras.optimizers.Adam", "numpy.array", "tensorflow.GradientTape" ]
[((3953, 3979), 'gym.make', 'gym.make', (['"""MountainCar-v0"""'], {}), "('MountainCar-v0')\n", (3961, 3979), False, 'import gym\n'), ((442, 477), 'tensorflow.keras.layers.Dense', 'layers.Dense', (['(24)'], {'activation': '"""relu"""'}), "(24, activation='relu')\n", (454, 477), False, 'from tensorflow.keras import laye...
import numpy as np import matplotlib.pyplot as plt import itbl._itbl as _itbl def uniform_sample_maze(maze_dims, hall_width, wall_width): # Create set of all possible walls. walls = set() for i in range(maze_dims[0]): for j in range(maze_dims[1]): p = (i, j) q = (i, j - 1)...
[ "itbl._itbl.CollisionManager2D", "numpy.prod", "numpy.random.randint", "numpy.array", "itbl._itbl.Rectangle" ]
[((2373, 2399), 'itbl._itbl.CollisionManager2D', '_itbl.CollisionManager2D', ([], {}), '()\n', (2397, 2399), True, 'import itbl._itbl as _itbl\n'), ((2943, 2969), 'itbl._itbl.CollisionManager2D', '_itbl.CollisionManager2D', ([], {}), '()\n', (2967, 2969), True, 'import itbl._itbl as _itbl\n'), ((2982, 3033), 'itbl._itb...
# Copyright 2017 Battelle Energy Alliance, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
[ "numpy.zeros" ]
[((931, 956), 'numpy.zeros', 'np.zeros', (['numberTimeSteps'], {}), '(numberTimeSteps)\n', (939, 956), True, 'import numpy as np\n'), ((971, 996), 'numpy.zeros', 'np.zeros', (['numberTimeSteps'], {}), '(numberTimeSteps)\n', (979, 996), True, 'import numpy as np\n'), ((1011, 1036), 'numpy.zeros', 'np.zeros', (['numberTi...
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import DeepSparseCoding.tf1x.utils.plot_functions as pf import DeepSparseCoding.tf1x.utils.data_processing as dp import DeepSparseCoding.tf1x.utils.entropy_functions as ef from DeepSparseCoding.tf1x.models.ae_model import AeModel from DeepSpars...
[ "DeepSparseCoding.tf1x.modules.vae_module.VaeModule", "numpy.arange", "numpy.random.normal", "numpy.round", "tensorflow.compat.v1.variable_scope", "tensorflow.compat.v1.placeholder", "matplotlib.pyplot.close", "DeepSparseCoding.tf1x.utils.plot_functions.plot_data_tiled", "numpy.max", "DeepSparseCo...
[((1645, 2453), 'DeepSparseCoding.tf1x.modules.vae_module.VaeModule', 'VaeModule', (['input_node', 'self.params.ae_layer_types', 'self.params.ae_enc_channels', 'self.params.ae_dec_channels', 'self.params.ae_patch_size', 'self.params.ae_conv_strides', 'self.vae_mean_act_funcs', 'self.params.vae_mean_layer_types', 'self....
#!/usr/bin/python import numpy as np import math # import fppy class Cell: def __init__(self, name=None, symbols=None, typt=None, types=None, lattice=None, positions=None, cart_positions=None, ...
[ "math.sqrt", "math.sin", "math.acos", "numpy.sin", "numpy.array", "math.cos", "numpy.linalg.inv", "numpy.dot", "numpy.linalg.det" ]
[((3370, 3457), 'numpy.array', 'np.array', (['[lat[0][0], lat[1][1], lat[2][2], lat[1][0], lat[2][0], lat[2][1]]', 'float'], {}), '([lat[0][0], lat[1][1], lat[2][2], lat[1][0], lat[2][0], lat[2][1]],\n float)\n', (3378, 3457), True, 'import numpy as np\n'), ((3506, 3597), 'numpy.array', 'np.array', (['[[vec[0], 0.0,...
import os import sys import time import numpy as np from tqdm import tqdm sys.path.append('../../') from utils import * from NeuralNet import NeuralNet import torch import torch.optim as optim from .CheckersNNet import CheckersNNet as chnet from ..CheckersGame import CheckersGame args = dotdict({ 'lr': 0.01, ...
[ "sys.path.append", "os.mkdir", "torch.sum", "torch.load", "os.path.exists", "time.time", "torch.exp", "torch.cuda.is_available", "numpy.array", "torch.device", "torch.no_grad", "os.path.join" ]
[((76, 101), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (91, 101), False, 'import sys\n'), ((392, 417), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (415, 417), False, 'import torch\n'), ((2760, 2771), 'time.time', 'time.time', ([], {}), '()\n', (2769, 2771)...
import numpy as np import warnings from agents.agent import Agent from agents.basis import SimpleBasis, ScaledBasis, PolynomialBasis from agents.sarsa_lambda import SarsaLambdaAgent class QPAMDPAgent(Agent): """ Defines an agent to optimize H(theta) using the episodic natural actor critic (eNAC) algorithm fo...
[ "agents.basis.PolynomialBasis", "numpy.outer", "agents.sarsa_lambda.SarsaLambdaAgent", "numpy.zeros", "numpy.random.RandomState", "numpy.ones", "numpy.append", "numpy.linalg.norm", "numpy.tile", "numpy.array", "warnings.warn", "numpy.linalg.pinv", "agents.basis.SimpleBasis" ]
[((8449, 8481), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': 'seed'}), '(seed=seed)\n', (8470, 8481), True, 'import numpy as np\n'), ((9600, 9654), 'numpy.outer', 'np.outer', (['(param - mean)', '(features / self.variances[act])'], {}), '(param - mean, features / self.variances[act])\n', (9608, 96...
''' submodules to handle Catalogs used in the project ''' import os import numpy as np import h5py from astropy.io import fits from astropy.table import Table as aTable from astropy.cosmology import FlatLambdaCDM # -- local -- from . import util as UT class Catalog(object): ''' parent object for the objects...
[ "numpy.uint64", "numpy.sum", "numpy.abs", "h5py.special_dtype", "numpy.ones", "os.path.isfile", "glob.glob", "os.path.join", "numpy.unique", "numpy.loadtxt", "pydl.pydlutils.spheregroup.spherematch", "numpy.log10", "astropy.cosmology.FlatLambdaCDM", "h5py.File", "numpy.radians", "os.pa...
[((2259, 2280), 'h5py.File', 'h5py.File', (['_file', '"""r"""'], {}), "(_file, 'r')\n", (2268, 2280), False, 'import h5py\n'), ((7417, 7460), 'numpy.in1d', 'np.in1d', (["gama_p['cataid']", "gama_s['cataid']"], {}), "(gama_p['cataid'], gama_s['cataid'])\n", (7424, 7460), True, 'import numpy as np\n'), ((7521, 7573), 'nu...
import pandas as pd import numpy as np import pyranges as pr from pyranges.multithreaded import pyrange_apply from pyranges.methods.statistics import _relative_distance def simes(df, groupby, pcol): if isinstance(groupby, str): groupby = [groupby] sorter = groupby + [pcol] sdf = df[sorter].so...
[ "numpy.sum", "numpy.empty", "numpy.floor", "numpy.isnan", "pyranges.pyranges.fill_kwargs", "numpy.arange", "pandas.DataFrame", "numpy.add.reduce", "scipy.stats.rankdata", "numpy.apply_along_axis", "itertools.chain", "pandas.concat", "numpy.repeat", "pyranges.concat", "pandas.DataFrame.fr...
[((442, 463), 'numpy.repeat', 'np.repeat', (['size', 'size'], {}), '(size, size)\n', (451, 463), True, 'import numpy as np\n'), ((703, 716), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (713, 716), True, 'import numpy as np\n'), ((725, 738), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (735, 738), True,...
import numpy as np import tensorflow as tf from sklearn.metrics import confusion_matrix from time import time from include.data import get_data_set # from include.model import model from include.model import model from utils import progress_bar x, y, output, global_step, y_pred_cls, keep_prob = model() _IMG_SIZE =...
[ "tensorflow.trainable_variables", "numpy.argmax", "tensorflow.train.RMSPropOptimizer", "tensorflow.train.latest_checkpoint", "numpy.arange", "include.data.get_data_set", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.cast", "tensorflow.summary.FileWriter", "tensorflow.train.piecewi...
[((300, 307), 'include.model.model', 'model', ([], {}), '()\n', (305, 307), False, 'from include.model import model\n'), ((533, 570), 'include.data.get_data_set', 'get_data_set', ([], {'cifar': '(10)', 'whitten': '(False)'}), '(cifar=10, whitten=False)\n', (545, 570), False, 'from include.data import get_data_set\n'), ...
# -*- coding: utf-8 -*- import re import collections import numpy as np import sklearn from tabulate import tabulate BaseAtom = collections.namedtuple("Atom", ["predicate", "arguments"]) class Atom(BaseAtom): def __hash__(self): hash_value = hash(self.predicate) for a in self.arguments: ...
[ "re.split", "numpy.array", "collections.namedtuple", "tabulate.tabulate", "sklearn.metrics.average_precision_score", "re.sub" ]
[((132, 190), 'collections.namedtuple', 'collections.namedtuple', (['"""Atom"""', "['predicate', 'arguments']"], {}), "('Atom', ['predicate', 'arguments'])\n", (154, 190), False, 'import collections\n'), ((642, 679), 're.sub', 're.sub', (['"""\\\\A\\\\s+|\\\\s+\\\\Z"""', '""""""', 'string'], {}), "('\\\\A\\\\s+|\\\\s+\...
import numpy as np import scipy from scipy import sparse import pandas as pd import matplotlib.pyplot as plt from tqdm import tqdm import os import scanpy as sc import scanpy.external as sce import sys import scrublet as scr from typing import Union from anndata import AnnData from inspect import signature from .utils...
[ "numpy.sum", "scanpy.pp.highly_variable_genes", "scanpy.pp.neighbors", "numpy.mean", "scanpy.tl.louvain", "scanpy.external.pp.bbknn", "numpy.std", "scanpy.pp.filter_genes", "inspect.signature", "scanpy.pp.scale", "scanpy.pp.normalize_per_cell", "scanpy.tl.pca", "scanpy.pp.calculate_qc_metric...
[((445, 478), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (468, 478), False, 'import warnings\n'), ((2125, 2185), 'scanpy.pp.normalize_per_cell', 'sc.pp.normalize_per_cell', (['adata'], {'counts_per_cell_after': '(10000)'}), '(adata, counts_per_cell_after=10000)\n', (21...
""" This file is part of the rgf_grape python package. Copyright (C) 2017-2018 <NAME> For details of the rgf_grape algorithm and applications see: <NAME>, <NAME>, and <NAME>, Majorana bound state engineering via efficient real-space parameter optimization, ArXiv 1804.03170 (2018). """ import subprocess import os impo...
[ "os.path.abspath", "pickle.dump", "numpy.random.seed", "subprocess.Popen", "os.getcwd", "os.path.realpath", "numpy.savetxt", "os.environ.get", "pickle.load", "numpy.random.rand", "datetime.datetime.now", "os.chdir" ]
[((2281, 2301), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (2295, 2301), True, 'import numpy as np\n'), ((946, 957), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (955, 957), False, 'import os\n'), ((1151, 1164), 'os.chdir', 'os.chdir', (['cwd'], {}), '(cwd)\n', (1159, 1164), False, 'import os\n')...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "os.path.join", "numpy.random.seed", "argparse.ArgumentParser", "numpy.random.shuffle" ]
[((836, 886), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""prepare txt"""'}), "(description='prepare txt')\n", (859, 886), False, 'import argparse\n'), ((1647, 1672), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (1661, 1672), True, 'import numpy as np\n'...
''' convert to Tusimple json/txt format. ''' import cv2 import json import numpy as np import os ''' datasets name:vil-100 paper link: https://arxiv.org/abs/2108.08482 reference: https://github.com/yujun0-0/MMA-Net/tree/main/dataset datasets structure: VIL-100 |----Annotations |----data ...
[ "cv2.line", "json.load", "numpy.zeros", "os.path.exists", "json.dumps", "cv2.imread", "numpy.where" ]
[((1091, 1115), 'json.load', 'json.load', (['label_content'], {}), '(label_content)\n', (1100, 1115), False, 'import json\n'), ((2167, 2210), 'numpy.where', 'np.where', (['(label_gray[hstep][:] == pix_value)'], {}), '(label_gray[hstep][:] == pix_value)\n', (2175, 2210), True, 'import numpy as np\n'), ((3462, 3487), 'cv...
from context import ROOT_DIR, nnUtils import numpy as np import tensorflow as tf import ast import CAME import csv import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' def get_save_path(antipattern, history_length, net_number): models_dir = os.path.join(ROOT_DIR, 'approaches', 'came', 'trained_models', ...
[ "tensorflow.train.Saver", "csv.DictReader", "context.nnUtils.get_came_instances", "tensorflow.reset_default_graph", "tensorflow.Session", "numpy.array", "CAME.CAME", "ast.literal_eval" ]
[((929, 996), 'context.nnUtils.get_came_instances', 'nnUtils.get_came_instances', (['systemName', '"""god_class"""', 'history_length'], {}), "(systemName, 'god_class', history_length)\n", (955, 996), False, 'from context import ROOT_DIR, nnUtils\n'), ((1012, 1036), 'tensorflow.reset_default_graph', 'tf.reset_default_gr...
# # This file is part of qa_explorer. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (http://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: yo...
[ "pandas.DataFrame", "lsst.pipe.tasks.parquetTable.ParquetTable", "numpy.isfinite", "pandas.MultiIndex.from_product", "lsst.pex.config.Field", "lsst.qa.explorer.match.match_lists", "lsst.pipe.base.ArgumentParser" ]
[((1522, 1575), 'lsst.pex.config.Field', 'Field', ([], {'dtype': 'str', 'default': '"""deep"""', 'doc': '"""Name of coadd"""'}), "(dtype=str, default='deep', doc='Name of coadd')\n", (1527, 1575), False, 'from lsst.pex.config import Config, Field\n'), ((1594, 1659), 'lsst.pex.config.Field', 'Field', ([], {'dtype': 'flo...
#import random from random import uniform import numpy as np #random.seed(100) #np.random.seed(100) def randi(N): """ get random integer in range [0, N) """ return int(uniform(0, N)) def merge_init_structs(s0, s1): """ merge struct s1 into s0 """ for k in s1['model']: assert (not k in s0['model']), 'Erro...
[ "numpy.random.rand", "random.uniform" ]
[((174, 187), 'random.uniform', 'uniform', (['(0)', 'N'], {}), '(0, N)\n', (181, 187), False, 'from random import uniform\n'), ((612, 632), 'numpy.random.rand', 'np.random.rand', (['n', 'd'], {}), '(n, d)\n', (626, 632), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 4 08:56:58 2021 @author: Thore """ import numpy as np from numpy.random import exponential from random import randint, uniform class GeneticAlgorithm: def __init__(self, cost_func, bounds, N = 8000, mutation_rate = 0.05, survi...
[ "random.randint", "numpy.concatenate", "random.uniform", "numpy.random.exponential", "numpy.argsort", "numpy.array", "numpy.unique" ]
[((2308, 2328), 'numpy.array', 'np.array', (['population'], {}), '(population)\n', (2316, 2328), True, 'import numpy as np\n'), ((3045, 3064), 'numpy.argsort', 'np.argsort', (['fitness'], {}), '(fitness)\n', (3055, 3064), True, 'import numpy as np\n'), ((4397, 4424), 'numpy.array', 'np.array', (['population_newgen'], {...
""" Constraints class used to specify the density constraints of the topology optimisation problem. It contains functions for minimum and maximum element density in the upcomming iteration and the magnitude of the volume constraint function itself of the current design. This version of the code is used for the global c...
[ "numpy.sum", "numpy.minimum", "numpy.maximum", "numpy.ones" ]
[((2849, 2880), 'numpy.maximum', 'np.maximum', (['xmin', '(x - self.move)'], {}), '(xmin, x - self.move)\n', (2859, 2880), True, 'import numpy as np\n'), ((3406, 3437), 'numpy.minimum', 'np.minimum', (['xmax', '(x + self.move)'], {}), '(xmax, x + self.move)\n', (3416, 3437), True, 'import numpy as np\n'), ((2235, 2260)...
import numpy as np import pandas as pd from primitives_ubc.regCCFS.src.utils.commonUtils import sVT from primitives_ubc.regCCFS.src.utils.commonUtils import is_numeric from primitives_ubc.regCCFS.src.utils.commonUtils import makeSureString from primitives_ubc.regCCFS.src.prediction_utils.replicate_input_process import ...
[ "numpy.sum", "numpy.concatenate", "primitives_ubc.regCCFS.src.utils.commonUtils.is_numeric", "numpy.subtract", "numpy.nanstd", "numpy.unique", "numpy.zeros", "numpy.ones", "numpy.isnan", "primitives_ubc.regCCFS.src.utils.commonUtils.makeSureString", "numpy.array", "numpy.arange", "primitives...
[((7270, 7346), 'primitives_ubc.regCCFS.src.prediction_utils.replicate_input_process.replicateInputProcess', 'replicateInputProcess', ([], {'Xraw': 'XTestRC', 'InputProcessDetails': 'inputProcessDetails'}), '(Xraw=XTestRC, InputProcessDetails=inputProcessDetails)\n', (7291, 7346), False, 'from primitives_ubc.regCCFS.sr...
import numpy as np import os from tqdm import tqdm from src.readers.reader_support_functions import * from src.readers.reader import * __all__=['get_tke_per_unit_area'] def get_tke_per_unit_area(configFile): ''' Input ----- configFile: path of configuration file Output ------ coord...
[ "os.getcwd", "numpy.zeros", "numpy.sum" ]
[((534, 545), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (543, 545), False, 'import os\n'), ((1290, 1307), 'numpy.zeros', 'np.zeros', (['nPlanes'], {}), '(nPlanes)\n', (1298, 1307), True, 'import numpy as np\n'), ((1325, 1342), 'numpy.zeros', 'np.zeros', (['nPlanes'], {}), '(nPlanes)\n', (1333, 1342), True, 'import nu...
# %% import numpy as np import pygaps as pg import matplotlib.pyplot as plt plt.rcParams['mathtext.fontset'] = 'dejavusans' plt.style.use('seaborn-muted') # read files d4_30 = pg.isotherm_from_csv("../data/d4sorp/iso_PCN777_D4_303_c1.csv") d4_40 = pg.isotherm_from_csv("../data/d4sorp/iso_PCN777_D4_313.csv") isos = [...
[ "pygaps.plot_iso", "pygaps.isotherm_from_csv", "matplotlib.pyplot.style.use", "numpy.linspace", "matplotlib.pyplot.subplots" ]
[((125, 155), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-muted"""'], {}), "('seaborn-muted')\n", (138, 155), True, 'import matplotlib.pyplot as plt\n'), ((179, 242), 'pygaps.isotherm_from_csv', 'pg.isotherm_from_csv', (['"""../data/d4sorp/iso_PCN777_D4_303_c1.csv"""'], {}), "('../data/d4sorp/iso_PCN7...
import numpy as np import matplotlib.pyplot as plt from scipy import signal import os fs = 31250.0 #Samplings frekvens cutoff_lpass = 3 #Nedre knekkfrekvens cutoff_hpass = 500 #Øvre knekkfrekvens ch1 = 3 ch2 = 4 remove_samples = 10000 #Antall samples som fjernes fra begynnelsen def ra...
[ "os.listdir", "matplotlib.pyplot.show", "matplotlib.pyplot.magnitude_spectrum", "scipy.signal.sosfilt", "matplotlib.pyplot.plot", "scipy.signal.lfilter", "numpy.fft.fft", "numpy.fromfile", "numpy.asanyarray", "numpy.argmax", "os.path.join", "numpy.log10", "numpy.fft.fftfreq", "scipy.signal...
[((897, 959), 'scipy.signal.butter', 'signal.butter', (['order', 'normal_cutoff'], {'btype': '"""low"""', 'analog': '(False)'}), "(order, normal_cutoff, btype='low', analog=False)\n", (910, 959), False, 'from scipy import signal\n'), ((1109, 1135), 'scipy.signal.lfilter', 'signal.lfilter', (['b', 'a', 'data'], {}), '(b...
from dataloaders.visual_genome import VGDataLoader, VG import numpy as np import torch from config import ModelConfig from lib.pytorch_misc import optimistic_restore from lib.evaluation.sg_eval import BasicSceneGraphEvaluator from tqdm import tqdm from config import BOX_SCALE, IM_SCALE import dill as pkl import os c...
[ "lib.evaluation.sg_eval.BasicSceneGraphEvaluator.all_modes", "tqdm.tqdm", "lib.rel_model_stanford.RelModelStanford", "dataloaders.visual_genome.VG.splits", "torch.load", "os.path.exists", "dataloaders.visual_genome.VGDataLoader.splits", "dill.load", "lib.pytorch_misc.optimistic_restore", "dill.dum...
[((326, 339), 'config.ModelConfig', 'ModelConfig', ([], {}), '()\n', (337, 339), False, 'from config import ModelConfig\n'), ((556, 698), 'dataloaders.visual_genome.VG.splits', 'VG.splits', ([], {'num_val_im': 'conf.val_size', 'filter_duplicate_rels': '(True)', 'use_proposals': 'conf.use_proposals', 'filter_non_overlap...
import sys import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt try: from plyfile import PlyData, PlyElement except: print('Install python-plyfile from https://github.com/dranjan/python-plyfile (using pip: pip install plyfile') sys.exit(1) import time def main(argv=None):...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.figure", "numpy.array", "plyfile.PlyData.read", "sys.exit" ]
[((1312, 1375), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]]'], {}), '([[1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]])\n', (1320, 1375), True, 'import numpy as np\n'), ((1591, 1603), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1601, 1603), True, 'import mat...
import cv2 import numpy as np import os import math from scipy.spatial import distance as dist from collections import OrderedDict from scipy.optimize import linear_sum_assignment from filterpy.kalman import KalmanFilter, UnscentedKalmanFilter, MerweScaledSigmaPoints class Kalman_filter(): def __init__(self, d...
[ "numpy.array", "filterpy.kalman.KalmanFilter", "collections.OrderedDict", "numpy.eye", "scipy.optimize.linear_sum_assignment" ]
[((492, 522), 'filterpy.kalman.KalmanFilter', 'KalmanFilter', ([], {'dim_x': '(4)', 'dim_z': '(2)'}), '(dim_x=4, dim_z=2)\n', (504, 522), False, 'from filterpy.kalman import KalmanFilter, UnscentedKalmanFilter, MerweScaledSigmaPoints\n'), ((542, 592), 'numpy.array', 'np.array', (['[[self.init_x], [self.init_y], [0], [0...
"""Functions to calculate spherical/cilyndrical power spectrum.""" import numpy as np def ps1D( lc, cell_size, n_psbins=12, logk=True, convert_to_delta=True, chunk_skip=None, calculate_variance=False, ): """Calculating 1D PS for a series of redshifts for one lightcone. Parameters ...
[ "numpy.conj", "numpy.meshgrid", "numpy.abs", "numpy.fft.fftn", "numpy.log10", "numpy.fft.fftfreq", "numpy.array", "numpy.logical_or", "numpy.linspace", "numpy.bincount", "numpy.sqrt" ]
[((4438, 4474), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['HII_DIM'], {'d': 'cell_size'}), '(HII_DIM, d=cell_size)\n', (4452, 4474), True, 'import numpy as np\n'), ((4950, 4970), 'numpy.meshgrid', 'np.meshgrid', (['k', 'k', 'k'], {}), '(k, k, k)\n', (4961, 4970), True, 'import numpy as np\n'), ((5045, 5102), 'numpy.sqrt...
import pytest import pandas as pd import numpy as np from cobra.evaluation import plot_incidence from cobra.evaluation import ClassificationEvaluator, RegressionEvaluator def mock_data(): d = {'variable': ['education', 'education', 'education', 'education'], 'label': ['1st-4th', '5th-6th', '7th-8th', '9...
[ "pandas.DataFrame", "numpy.random.uniform", "numpy.random.seed", "cobra.evaluation.RegressionEvaluator", "cobra.evaluation.ClassificationEvaluator._compute_lift_per_bin", "cobra.evaluation.plot_incidence", "pytest.raises", "cobra.evaluation.ClassificationEvaluator" ]
[((493, 508), 'pandas.DataFrame', 'pd.DataFrame', (['d'], {}), '(d)\n', (505, 508), True, 'import pandas as pd\n'), ((545, 565), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (559, 565), True, 'import numpy as np\n'), ((580, 605), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': 'n'}), '(...
from __future__ import division from keras.layers.recurrent import Recurrent, time_distributed_dense from keras.layers import Dense from keras import activations, initializations, regularizers, constraints from keras.engine.topology import Layer, InputSpec from keras import backend as K import numpy as np #Leaky Recu...
[ "keras.backend.dot", "keras.layers.recurrent.time_distributed_dense", "keras.regularizers.get", "numpy.ones", "keras.backend.abs", "keras.backend.shape", "numpy.diag", "keras.activations.get", "keras.backend.reshape", "keras.constraints.get", "keras.backend.cast_to_floatx", "keras.backend.drop...
[((981, 1006), 'keras.initializations.get', 'initializations.get', (['init'], {}), '(init)\n', (1000, 1006), False, 'from keras import activations, initializations, regularizers, constraints\n'), ((1033, 1064), 'keras.initializations.get', 'initializations.get', (['inner_init'], {}), '(inner_init)\n', (1052, 1064), Fal...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ "tensorflow.python.platform.test.main", "tensorflow.python.ops.variables.global_variables_initializer", "tensorflow.python.ops.math_ops.reduce_sum", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.layers.core.Dense", "tensorflow.python.layers.core.Dropout", "numpy.ones", "numpy.zeros", "t...
[((14065, 14076), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (14074, 14076), False, 'from tensorflow.python.platform import test\n'), ((1486, 1547), 'tensorflow.python.layers.core.Dense', 'core_layers.Dense', (['(2)'], {'activation': 'nn_ops.relu', 'name': '"""my_dense"""'}), "(2, activation...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class AngularLoss(nn.Module): """ Implementation of https://arxiv.org/abs/1708.01682 Args: alpha: The angle (as described in the paper), specified in degrees. """ def __init__(self, alpha): super(...
[ "torch.tan", "numpy.radians", "torch.nn.functional.relu" ]
[((764, 843), 'torch.nn.functional.relu', 'F.relu', (['(distance_anchor_positive - 4 * sq_tan_alpha * distance_negative_cluster)'], {}), '(distance_anchor_positive - 4 * sq_tan_alpha * distance_negative_cluster)\n', (770, 843), True, 'import torch.nn.functional as F\n'), ((384, 401), 'numpy.radians', 'np.radians', (['a...
""" Functions for quantum parameters, including electron degenerate gases and warm dense matter. """ __all__ = [ "chemical_potential", "deBroglie_wavelength", "Ef_", "Fermi_energy", "lambdaDB_", "lambdaDB_th_", "Thomas_Fermi_length", "thermal_deBroglie_wavelength", "Wigner_Seitz_rad...
[ "astropy.units.temperature_energy", "plasmapy.utils.decorators.validate_quantities", "numpy.abs", "numpy.log", "plasmapy.utils.RelativityError", "plasmapy.particles.particle_mass", "astropy.units.UnitConversionError", "numpy.ones", "plasmapy.formulary.mathematics.Fermi_integral", "plasmapy.formula...
[((726, 829), 'plasmapy.utils.decorators.validate_quantities', 'validate_quantities', ([], {'V': "{'can_be_negative': True}", 'validations_on_return': "{'can_be_negative': False}"}), "(V={'can_be_negative': True}, validations_on_return={\n 'can_be_negative': False})\n", (745, 829), False, 'from plasmapy.utils.decora...
import astropy from astropy import units as u from astropy.cosmology import Planck15 import numpy as np from scipy.special import sici import warnings from .core import Profile from .helpers.decorators import array, inMpc from .helpers.lensing import BaseLensing from .helpers.spherical import mass_from_radius, radius_...
[ "numpy.arctanh", "numpy.abs", "numpy.ones_like", "numpy.log", "numpy.unique", "scipy.special.sici", "numpy.argmin", "numpy.any", "numpy.sin", "numpy.array", "numpy.linspace", "numpy.iterable", "numpy.cos", "warnings.warn", "numpy.arctan", "numpy.prod", "numpy.diagonal" ]
[((3958, 4012), 'numpy.linspace', 'np.linspace', (['(0.5 * c_guess)', '(1.5 * c_guess)', 'n_guess_rng'], {}), '(0.5 * c_guess, 1.5 * c_guess, n_guess_rng)\n', (3969, 4012), True, 'import numpy as np\n'), ((4090, 4128), 'numpy.abs', 'np.abs', (['(delta_c_rng / self_delta_c - 1)'], {}), '(delta_c_rng / self_delta_c - 1)\...
""" Defines the DataSet class and supporting classes and functions """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, th...
[ "pickle.dump", "numpy.empty", "numpy.ones", "collections.defaultdict", "pygsti.circuits.circuit.CompressedCircuit.expand_op_label_tuple", "pygsti.circuits.circuit.Circuit", "numpy.mean", "pygsti.tools.legacytools.deprecate", "pickle.load", "numpy.isclose", "pygsti.baseobjs._compatibility.patched...
[((22499, 22537), 'pygsti.tools.legacytools.deprecate', '_deprecated_fn', (['"""DataSetRow.fractions"""'], {}), "('DataSetRow.fractions')\n", (22513, 22537), True, 'from pygsti.tools.legacytools import deprecate as _deprecated_fn\n'), ((115927, 115957), 'pygsti.tools.legacytools.deprecate', '_deprecated_fn', (['"""writ...
import pandas as pd import numpy as np import glob import matplotlib.pyplot as plt ## constants c = 2.99e10 ## speed of light in cm/s secyr = 3.154e7 ## seconds per year Myr = 1e6 ## years per Myr Msun = 1.989e33 ## grams per solar mass Lsun = 3.839e33 ## erg/sec per solar luminosity def cal...
[ "numpy.save", "numpy.abs", "pandas.read_csv", "numpy.where", "glob.glob", "numpy.sqrt" ]
[((877, 895), 'glob.glob', 'glob.glob', (['binpath'], {}), '(binpath)\n', (886, 895), False, 'import glob\n'), ((3512, 3569), 'numpy.save', 'np.save', (["(path + 'final_merger_luminosities')", 'luminosities'], {}), "(path + 'final_merger_luminosities', luminosities)\n", (3519, 3569), True, 'import numpy as np\n'), ((35...
import math import logging import cv2 import numpy from scipy.ndimage.filters import maximum_filter import os.path import sys import numpy as np from os import listdir from os.path import join if sys.version_info[0] != 2: raise Exception("This script was written for Python version 2. You're running Python %s." % s...
[ "cv2.max", "argparse.ArgumentParser", "cv2.absdiff", "cv2.pyrDown", "os.path.join", "numpy.multiply", "cv2.filter2D", "cv2.cvtColor", "cv2.split", "math.cos", "cv2.resize", "math.sin", "cv2.merge", "cv2.add", "sys.exit", "os.listdir", "math.exp", "scipy.ndimage.filters.maximum_filt...
[((342, 369), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (359, 369), False, 'import logging\n'), ((2071, 2110), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_RGB2GRAY'], {}), '(image, cv2.COLOR_RGB2GRAY)\n', (2083, 2110), False, 'import cv2\n'), ((3404, 3450), 'numpy.zeros', '...
# 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 # "License"); you may not u...
[ "mxnet.callback.Speedometer", "mxnet.symbol.Activation", "mxnet.symbol.FullyConnected", "mxnet.symbol.Custom", "logging.basicConfig", "mxnet.operator.register", "mxnet.symbol.Variable", "numpy.arange", "mxnet.cpu", "mxnet.nd.array", "data.mnist_iterator" ]
[((1471, 1502), 'mxnet.operator.register', 'mx.operator.register', (['"""softmax"""'], {}), "('softmax')\n", (1491, 1502), True, 'import mxnet as mx\n'), ((2138, 2164), 'mxnet.symbol.Variable', 'mx.symbol.Variable', (['"""data"""'], {}), "('data')\n", (2156, 2164), True, 'import mxnet as mx\n'), ((2171, 2234), 'mxnet.s...
from __future__ import print_function, division import matplotlib.pyplot as plt import numpy as np import scipy from keras.datasets import mnist from keras.layers import BatchNormalization from keras.layers import Concatenate from keras.layers import Input, Dense, Flatten, Dropout from keras.layers.advanced_activation...
[ "numpy.ones", "keras.models.Model", "numpy.random.randint", "keras_contrib.layers.normalization.InstanceNormalization", "keras.layers.Input", "numpy.full", "keras.layers.convolutional.UpSampling2D", "matplotlib.pyplot.close", "numpy.empty_like", "keras.layers.Flatten", "numpy.add", "matplotlib...
[((1619, 1646), 'keras.layers.Input', 'Input', ([], {'shape': 'self.img_shape'}), '(shape=self.img_shape)\n', (1624, 1646), False, 'from keras.layers import Input, Dense, Flatten, Dropout\n'), ((2078, 2102), 'keras.models.Model', 'Model', (['masked_img', 'valid'], {}), '(masked_img, valid)\n', (2083, 2102), False, 'fro...
from tensorflow.keras.layers import Conv1D as _Conv1D from tensorflow.keras.layers import Conv2D as _Conv2D from tensorflow.keras.layers import MaxPooling2D as _MaxPooling2D from tensorflow.keras.layers import Dense as _Dense from tensorflow.keras.layers import Embedding as _Embedding from tensorflow.keras.layers impor...
[ "numpy.log2", "autogoal.grammar.ContinuousValue", "tensorflow.keras.layers.LSTM", "tensorflow.keras.regularizers.l1_l2", "autogoal.grammar.CategoricalValue", "autogoal.grammar.DiscreteValue" ]
[((7287, 7310), 'numpy.log2', 'log2', (["config['filters']"], {}), "(config['filters'])\n", (7291, 7310), False, 'from numpy import log2\n'), ((8149, 8172), 'numpy.log2', 'log2', (["config['filters']"], {}), "(config['filters'])\n", (8153, 8172), False, 'from numpy import log2\n'), ((1069, 1092), 'autogoal.grammar.Disc...
# Copyright 2020 The Private Cardinality Estimation Framework Authors # # 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 b...
[ "absl.testing.absltest.main", "wfa_cardinality_estimation_evaluation_framework.simulations.set_generator.IndependentSetGenerator", "wfa_cardinality_estimation_evaluation_framework.simulations.set_generator.SequentiallyCorrelatedSetGenerator", "numpy.ones_like", "wfa_cardinality_estimation_evaluation_framewo...
[((4539, 5088), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (["(set_generator.FullyOverlapSetGenerator, {'num_sets': 10, 'set_size': 5})", "(set_generator.SubSetGenerator, {'order': 'original', 'num_large_sets': 2,\n 'num_small_sets': 3, 'large_set_size': 5, 'small_set_size': 2})", "(set_gen...
from my_pybullet_envs.inmoov_shadow_hand_v2 import InmoovShadowNew import pybullet as p import time import gym, gym.utils.seeding, gym.spaces import numpy as np import math import pickle import random from typing import * import sys import os import inspect currentdir = os.path.dirname( os.path.abspath(inspect.g...
[ "my_pybullet_envs.inmoov_shadow_hand_v2.InmoovShadowNew", "numpy.abs", "pybullet.resetSimulation", "numpy.maximum", "pybullet.createVisualShape", "ns_vqa_dart.bullet.vision_inference.VisionInference", "pickle.load", "numpy.linalg.norm", "pybullet.getBaseVelocity", "os.path.join", "pybullet.creat...
[((27951, 28003), 'pybullet.setPhysicsEngineParameter', 'p.setPhysicsEngineParameter', ([], {'numSolverIterations': '(200)'}), '(numSolverIterations=200)\n', (27978, 28003), True, 'import pybullet as p\n'), ((28879, 28893), 'pybullet.disconnect', 'p.disconnect', ([], {}), '()\n', (28891, 28893), True, 'import pybullet ...
""" run the Coding Potential Assessment Tool (CPAT) http://nar.oxfordjournals.org/content/early/2013/01/17/nar.gkt006.full """ import numpy import shutil import tempfile import os from bcbio import utils from bcbio.rnaseq import gtf from bcbio.utils import file_exists, safe_makedir from bcbio.distributed.transaction i...
[ "bcbio.utils.file_exists", "bcbio.rnaseq.gtf.split_gtf", "tempfile.NamedTemporaryFile", "bcbio.rnaseq.gtf.is_cpat_compatible", "os.path.join", "bcbio.rnaseq.gtf.get_coding_noncoding_transcript_ids", "bcbio.rnaseq.gtf.partition_gtf", "bcbio.bam.fasta.sequence_length", "bcbio.utils.safe_makedir", "b...
[((524, 565), 'bcbio.pipeline.config_utils.get_program', 'config_utils.get_program', (['"""cpat.py"""', 'data'], {}), "('cpat.py', data)\n", (548, 565), False, 'from bcbio.pipeline import config_utils\n'), ((772, 814), 'bcbio.rnaseq.gtf.gtf_to_fasta', 'gtf.gtf_to_fasta', (['assembled_gtf', 'ref_fasta'], {}), '(assemble...
import os import json import random from tqdm import tqdm, trange import numpy as np import torch from apex import amp from torch.utils.data import DataLoader, RandomSampler, SequentialSampler from transformers.models.bert import BertTokenizer from transformers import AutoTokenizer, AutoModelForMultipl...
[ "numpy.random.seed", "numpy.sum", "torch.utils.data.RandomSampler", "numpy.argmax", "data_processor.DataProcessor", "transformers.optimization.get_linear_schedule_with_warmup", "torch.no_grad", "os.path.join", "torch.utils.data.DataLoader", "apex.amp.master_params", "os.path.exists", "apex.amp...
[((538, 560), 'numpy.argmax', 'np.argmax', (['out'], {'axis': '(1)'}), '(out, axis=1)\n', (547, 560), True, 'import numpy as np\n'), ((573, 598), 'numpy.sum', 'np.sum', (['(outputs == labels)'], {}), '(outputs == labels)\n', (579, 598), True, 'import numpy as np\n'), ((625, 642), 'random.seed', 'random.seed', (['seed']...
import numpy as np import tensorly as tl def random_matrix_generator(n, k, typ="g", target='col'): """ routine for usage: A \Omega or \Omega^\top x : n >> m :param n: first dimension of random matrix to be generated :param k: second dimension of random matrix to be generated :param type: :para...
[ "numpy.random.uniform", "tensorly.tenalg.khatri_rao", "numpy.asarray", "numpy.mean", "numpy.linalg.norm", "numpy.random.normal", "numpy.random.choice", "numpy.prod", "numpy.sqrt" ]
[((501, 511), 'numpy.prod', 'np.prod', (['n'], {}), '(n)\n', (508, 511), True, 'import numpy as np\n'), ((737, 772), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)'], {'size': '(n, k)'}), '(0, 1, size=(n, k))\n', (753, 772), True, 'import numpy as np\n'), ((1249, 1259), 'numpy.sqrt', 'np.sqrt', (['k'], {}), '...
import math import numpy as np import random,pickle import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt Nc = 2 # number of cycle cyclelength = 14 # cycle length result_f1 = np.array(pickle.load(open('case1.p', 'rb'))) # no butyrate result_f2 = np.array(pickle.load(ope...
[ "numpy.trapz", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.rcParams.update", "matplotlib.use", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.errorbar" ]
[((70, 93), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (84, 93), False, 'import matplotlib\n'), ((1354, 1393), 'numpy.arange', 'np.arange', (['(0.0)', '(Nc * cyclelength)', '(0.001)'], {}), '(0.0, Nc * cyclelength, 0.001)\n', (1363, 1393), True, 'import numpy as np\n'), ((2208, 2246), 'ma...
# coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # 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 la...
[ "tensorflow.compat.v2.config.list_physical_devices", "tensorflow.compat.v2.nest.map_structure", "tf_agents.specs.tensor_spec.TensorSpec", "tf_agents.environments.suite_gym.load", "tf_agents.policies.py_tf_eager_policy.PyTFEagerPolicy", "tensorflow.compat.v2.constant", "tensorflow.compat.v2.keras.optimiz...
[((3022, 3051), 'tf_agents.environments.suite_gym.load', 'suite_gym.load', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (3036, 3051), False, 'from tf_agents.environments import suite_gym\n'), ((3110, 3142), 'tf_agents.train.utils.spec_utils.get_tensor_specs', 'spec_utils.get_tensor_specs', (['env'], {}), '(env)\n'...
#!/usr/bin/env python # coding: utf-8 """ ===================================== 4 - Sampling methods: particle filter ===================================== """ # %% # In the previous tutorials we encountered some shortcomings in describing distributions as # Gaussians, albeit with considerable flexibility in coping w...
[ "numpy.radians", "stonesoup.types.hypothesis.SingleHypothesis", "numpy.random.seed", "stonesoup.types.groundtruth.GroundTruthState", "stonesoup.resampler.particle.SystematicResampler", "stonesoup.plotter.Plotter", "stonesoup.predictor.particle.ParticlePredictor", "stonesoup.updater.particle.ParticleUp...
[((3279, 3293), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (3291, 3293), False, 'from datetime import datetime\n'), ((3301, 3321), 'numpy.random.seed', 'np.random.seed', (['(1991)'], {}), '(1991)\n', (3315, 3321), True, 'import numpy as np\n'), ((4132, 4141), 'stonesoup.plotter.Plotter', 'Plotter', ([],...
import paddle import paddle.nn as nn import paddle.nn.functional as F import numpy as np from .tools import k_adjacency, normalize_adjacency_matrix from .mlp import MLP from .activation import activation_factory class MultiScale_GraphConv(nn.Layer): def __init__(self, num_scales, ...
[ "paddle.nn.initializer.Uniform", "paddle.matmul", "numpy.linalg.matrix_power", "paddle.to_tensor", "numpy.concatenate" ]
[((2654, 2673), 'paddle.matmul', 'paddle.matmul', (['x', 'A'], {}), '(x, A)\n', (2667, 2673), False, 'import paddle\n'), ((1171, 1197), 'paddle.to_tensor', 'paddle.to_tensor', (['A_powers'], {}), '(A_powers)\n', (1187, 1197), False, 'import paddle\n'), ((1119, 1143), 'numpy.concatenate', 'np.concatenate', (['A_powers']...
''' TensorFlow Dataset API Example Reinitializable Iterator <NAME> Department of Computer Science University of Chicago <EMAIL> ''' import tensorflow as tf import numpy as np import time class Preprocessor(object): def __init__(self, num_classes): self.num_classes = num_classes def preprocess(...
[ "numpy.random.seed", "tensorflow.reshape", "numpy.mean", "tensorflow.layers.max_pooling2d", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.variable_scope", "tensorflow.set_random_seed", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.cast", "tensorflow.data.Iterator...
[((5449, 5501), 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['(images, labels)'], {}), '((images, labels))\n', (5483, 5501), True, 'import tensorflow as tf\n'), ((5897, 5928), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['random_seed'], {}), '(random_seed)\n', (5915, 59...
#!/usr/bin/env python # -*- coding: utf-8 -*- def any_above_alpha(l, alpha): filter_great_than = list(filter(lambda x: abs(x) >= alpha, l)) return len(filter_great_than) > 0 def compute_theta(params, theta_list, y): ret = [] import numpy as np # 补1 s = [1] + list(params) t = np.asarray(s...
[ "numpy.shape", "numpy.asarray" ]
[((691, 702), 'numpy.shape', 'np.shape', (['m'], {}), '(m)\n', (699, 702), True, 'import numpy as np\n'), ((308, 321), 'numpy.asarray', 'np.asarray', (['s'], {}), '(s)\n', (318, 321), True, 'import numpy as np\n'), ((567, 580), 'numpy.asarray', 'np.asarray', (['s'], {}), '(s)\n', (577, 580), True, 'import numpy as np\n...
# TestEvaluator.py # Written <NAME> January 2021 # # import numpy as np import matplotlib.pyplot as plt import rdml_graph as gr import pdb x_axis = 40 y_axis = 40 path = np.array([[3.1,4.2], [8, 5], [13,12], [-10,13], [-15, -5], [15, -5]]) budget = 0 for i in range(1, path.shape[0]): budget += np.linalg.norm(...
[ "matplotlib.pyplot.show", "numpy.ones", "rdml_graph.MaskedEvaluator", "rdml_graph.plot_multi", "numpy.array", "numpy.arange", "numpy.linalg.norm" ]
[((175, 247), 'numpy.array', 'np.array', (['[[3.1, 4.2], [8, 5], [13, 12], [-10, 13], [-15, -5], [15, -5]]'], {}), '([[3.1, 4.2], [8, 5], [13, 12], [-10, 13], [-15, -5], [15, -5]])\n', (183, 247), True, 'import numpy as np\n'), ((418, 452), 'numpy.arange', 'np.arange', (['(-x_axis / 2)', '(x_axis / 2)'], {}), '(-x_axis...
# coding: utf-8 """Tools to compute equations of states with different models.""" from __future__ import unicode_literals, division, print_function import collections import numpy as np import pymatgen.core.units as units from monty.functools import return_none_if_raise from pymatgen.core.units import FloatWithUnit f...
[ "numpy.roots", "numpy.poly1d", "pymatgen.core.units.FloatWithUnit", "numpy.average", "numpy.log", "numpy.polyfit", "numpy.polyval", "numpy.polyder", "pymatgen.core.units.EnergyArray", "scipy.optimize.leastsq", "pymatgen.util.plotting_utils.get_ax_fig_plt", "pymatgen.core.units.ArrayWithUnit", ...
[((416, 443), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (433, 443), False, 'import logging\n'), ((1931, 1990), 'numpy.polyfit', 'np.polyfit', (['(volumes ** (-2.0 / 3.0))', 'energies', '(3)'], {'full': '(True)'}), '(volumes ** (-2.0 / 3.0), energies, 3, full=True)\n', (1941, 1990), T...
import numpy as np from .base import Operation from ..utils import as_numpy class Cast(Operation): def __init__(self, x, to): self.x = x self.to = to @classmethod def from_onnx(cls, onnx_node, *inputs): attributes = {a.name: as_numpy(a) for a in onnx_node.attribute} axis ...
[ "numpy.array", "numpy.expand_dims" ]
[((2533, 2563), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float32'}), '([], dtype=np.float32)\n', (2541, 2563), True, 'import numpy as np\n'), ((2580, 2608), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float'}), '([], dtype=np.float)\n', (2588, 2608), True, 'import numpy as np\n'), ((2624, 2652), 'numpy.a...
import aubio import numpy as np import pyaudio import time import argparse import queue import music21 # yes! new favorite library parser = argparse.ArgumentParser() parser.add_argument("-input", required=False, type=int, help="Audio Input Device") args = parser.parse_args() if not args.input: print("No input...
[ "numpy.sum", "argparse.ArgumentParser", "time.sleep", "numpy.fromstring", "pyaudio.PyAudio", "music21.pitch.Pitch", "aubio.pitch", "queue.Queue" ]
[((145, 170), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (168, 170), False, 'import argparse\n'), ((660, 677), 'pyaudio.PyAudio', 'pyaudio.PyAudio', ([], {}), '()\n', (675, 677), False, 'import pyaudio\n'), ((859, 872), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (869, 872), False, ...
#!/usr/bin/env python3 # coding=utf-8 import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from matplotlib import cm x = np.array([1, 2]) y = np.array([1, 2]) z = np.array([[1, -1], [-1, 1]]) # plt.xlim(1, 2) # plt.ylim(1, 2) colors = ('red', 'blue', 'lightgreen', 'gray', '...
[ "numpy.array", "matplotlib.pyplot.contour", "numpy.unique", "matplotlib.pyplot.show" ]
[((167, 183), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (175, 183), True, 'import numpy as np\n'), ((188, 204), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (196, 204), True, 'import numpy as np\n'), ((209, 237), 'numpy.array', 'np.array', (['[[1, -1], [-1, 1]]'], {}), '([[1, -1], [-1, 1]...
import numpy as np from multiprocessing import Pool, cpu_count import statsmodels.api as sm from scipy.stats import norm from tqdm import tqdm from itertools import product import pandas as pd from ananke.graphs import ADMG from ananke.models import LinearGaussianSEM from statsmodels.stats.proportion import proportion_...
[ "numpy.random.seed", "statsmodels.api.OLS", "ananke.graphs.ADMG", "numpy.isnan", "numpy.random.normal", "multiprocessing.cpu_count", "pandas.DataFrame", "os.path.abspath", "wrapper_resampler.ShiftedTester", "itertools.product", "numpy.linalg.det", "numpy.cov", "numpy.nansum", "statsmodels....
[((532, 549), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (546, 549), True, 'import numpy as np\n'), ((1548, 1600), 'ananke.graphs.ADMG', 'ADMG', (['vertices'], {'di_edges': 'di_edges', 'bi_edges': 'bi_edges'}), '(vertices, di_edges=di_edges, bi_edges=bi_edges)\n', (1552, 1600), False, 'from ananke.g...
"""Makes animation to explain multivariate convolution.""" import argparse import numpy import matplotlib matplotlib.use('agg') import matplotlib.colors from matplotlib.patches import ConnectionPatch import matplotlib.pyplot as pyplot from gewittergefahr.gg_utils import file_system_utils from gewittergefahr.deep_learn...
[ "matplotlib.colors.to_rgba", "numpy.full", "numpy.stack", "argparse.ArgumentParser", "matplotlib.pyplot.close", "gewittergefahr.plotting.plotting_utils.create_paneled_figure", "numpy.expand_dims", "numpy.isnan", "gewittergefahr.deep_learning.standalone_utils.do_2d_convolution", "matplotlib.use", ...
[((107, 128), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (121, 128), False, 'import matplotlib\n'), ((501, 542), 'matplotlib.pyplot.rc', 'pyplot.rc', (['"""font"""'], {'size': 'DEFAULT_FONT_SIZE'}), "('font', size=DEFAULT_FONT_SIZE)\n", (510, 542), True, 'import matplotlib.pyplot as pyplot\n'...
import tensorflow as tf import numpy as np from collections import deque import gym import random from Agent import Agent from Layers import DenseEmbeddingNet, QNet class DQN(tf.keras.Model): def __init__(self, embedding_net: tf.keras.layers.Layer, q_net: tf.keras.layers.Layer): super().__init__() ...
[ "tensorflow.one_hot", "tensorflow.square", "gym.make", "numpy.argmax", "random.sample", "tensorflow.argmax", "Layers.QNet", "tensorflow.keras.optimizers.Adam", "numpy.array", "Layers.DenseEmbeddingNet", "numpy.random.choice", "numpy.random.rand", "tensorflow.GradientTape", "collections.deq...
[((4808, 4831), 'gym.make', 'gym.make', (['"""CartPole-v1"""'], {}), "('CartPole-v1')\n", (4816, 4831), False, 'import gym\n'), ((978, 1011), 'tensorflow.keras.optimizers.Adam', 'tf.keras.optimizers.Adam', (['self.lr'], {}), '(self.lr)\n', (1002, 1011), True, 'import tensorflow as tf\n'), ((1142, 1167), 'collections.de...
import os from os.path import basename, join from setuptools import setup, find_packages from setuptools.extension import Extension from Cython.Build import cythonize import eigency import numpy as np __package_name__ = "eigency" __eigen_dir__ = eigency.__eigen_dir__ __eigen_lib_dir__ = join(basename(__eigen_dir__), ...
[ "Cython.Build.cythonize", "os.path.basename", "pypandoc.convert", "numpy.get_include", "os.path.join", "setuptools.find_packages" ]
[((295, 318), 'os.path.basename', 'basename', (['__eigen_dir__'], {}), '(__eigen_dir__)\n', (303, 318), False, 'from os.path import basename, join\n'), ((713, 749), 'pypandoc.convert', 'pypandoc.convert', (['"""README.md"""', '"""rst"""'], {}), "('README.md', 'rst')\n", (729, 749), False, 'import pypandoc\n'), ((884, 9...
import numpy as np import time def sample(basis, random_initial, optimizer, solver, tol=1.0e-14, maxiter=80): ''' Model constrained adaptive sampler to create trial basis for ROM Parameters ---------- basis : numpy.ndarray Initial reduced basis z_0 : dolfin.Function ...
[ "time.time", "numpy.sqrt", "numpy.hstack" ]
[((2005, 2026), 'numpy.hstack', 'np.hstack', (['(basis, w)'], {}), '((basis, w))\n', (2014, 2026), True, 'import numpy as np\n'), ((857, 868), 'time.time', 'time.time', ([], {}), '()\n', (866, 868), False, 'import time\n'), ((973, 984), 'time.time', 'time.time', ([], {}), '()\n', (982, 984), False, 'import time\n'), ((...
import tensorflow as tf import numpy as np from PIL import Image from keras import backend as K from keras.engine import Layer from keras import activations # https://software.intel.com/en-us/articles/keras-implementation-of-siamese-like-networks class Normalized_Correlation_Layer(Layer): def __init__(self, patc...
[ "keras.backend.concatenate", "keras.activations.get", "tensorflow.global_variables_initializer", "keras.backend.spatial_2d_padding", "keras.backend.reshape", "numpy.asarray", "tensorflow.Session", "keras.backend.batch_dot", "keras.backend.mean", "keras.backend.std", "tensorflow.cross", "tensor...
[((5074, 5107), 'tensorflow.global_variables_initializer', 'tf.global_variables_initializer', ([], {}), '()\n', (5105, 5107), True, 'import tensorflow as tf\n'), ((5113, 5125), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (5123, 5125), True, 'import tensorflow as tf\n'), ((5481, 5526), 'tensorflow.image.conver...
# -*- coding: utf-8 -*- # file: train.py # author: yangheng <<EMAIL>> # Copyright (C) 2019. All Rights Reserved. import argparse import json import logging import os, sys import random from sklearn.metrics import f1_score from time import strftime, localtime import numpy as np import torch import torch.nn.functional ...
[ "numpy.random.seed", "utils.data_utils.ATEPCProcessor", "torch.utils.data.RandomSampler", "argparse.ArgumentParser", "torch.argmax", "model.lcf_atepc.LCF_ATEPC", "torch.cat", "logging.getLogger", "transformers.optimization.AdamW", "torch.utils.data.TensorDataset", "torch.no_grad", "os.path.joi...
[((913, 932), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (930, 932), False, 'import logging\n'), ((1017, 1051), 'os.makedirs', 'os.makedirs', (['"""logs"""'], {'exist_ok': '(True)'}), "('logs', exist_ok=True)\n", (1028, 1051), False, 'import os, sys\n'), ((981, 1014), 'logging.StreamHandler', 'logging....
from __future__ import absolute_import from __future__ import division from __future__ import print_function import pycocotools.coco as coco from pycocotools.cocoeval import COCOeval import numpy as np import json import os import torch.utils.data as data class NUSCENESHP(data.Dataset): num_classes = 10 num_jo...
[ "numpy.array", "pycocotools.coco.COCO", "os.path.join", "numpy.random.RandomState" ]
[((839, 874), 'os.path.join', 'os.path.join', (['opt.data_dir', '"""kitti"""'], {}), "(opt.data_dir, 'kitti')\n", (851, 874), False, 'import os\n'), ((897, 933), 'os.path.join', 'os.path.join', (['self.data_dir', '"""image"""'], {}), "(self.data_dir, 'image')\n", (909, 933), False, 'import os\n'), ((958, 994), 'os.path...
import numpy as np from scipy.special import expit from ..envs.configuration import Configuration from . import ( AbstractFeatureProvider, Model, ModelBasedAgent, ViewsFeaturesProvider ) from .organic_count import to_categorical bayesian_poly_args = { 'num_products': 10, 'random_seed': np.rand...
[ "scipy.rand", "numpy.argmax", "numpy.zeros", "numpy.ones", "numpy.random.randint", "numpy.linalg.inv", "numpy.kron", "numpy.matmul", "numpy.exp", "numpy.eye" ]
[((313, 343), 'numpy.random.randint', 'np.random.randint', (['(2 ** 31 - 1)'], {}), '(2 ** 31 - 1)\n', (330, 343), True, 'import numpy as np\n'), ((782, 800), 'scipy.rand', 'rand', (['Psi.shape[0]'], {}), '(Psi.shape[0])\n', (786, 800), False, 'from scipy import rand\n'), ((849, 864), 'numpy.linalg.inv', 'inv', (['Sigm...
# by <NAME>, 2021. MIT license ############################################################################## ### Volumetric processing of fibers ############################################################################## import time import os from tifffile import TiffFile import pickle from random import shuf...
[ "mayavi.mlab.figure", "combineFunctions.findCollisions", "random.shuffle", "numpy.empty", "mayavi.mlab.pipeline.scalar_field", "tifffile.imwrite", "numpy.ones", "extractCenterPoints.getTiffProperties", "numpy.mean", "pickle.load", "numpy.linalg.norm", "os.path.join", "numpy.unique", "multi...
[((2221, 2254), 'numpy.where', 'np.where', (['(V_thisMarkerOnly == 255)'], {}), '(V_thisMarkerOnly == 255)\n', (2229, 2254), True, 'import numpy as np\n'), ((3390, 3411), 'numpy.mean', 'np.mean', (['[xMin, xMax]'], {}), '([xMin, xMax])\n', (3397, 3411), True, 'import numpy as np\n'), ((3421, 3442), 'numpy.mean', 'np.me...
import cellpylib as cpl import numpy as np from matplotlib.colors import ListedColormap def wireworld_rule(n, c, t): current_activity = n[1][1] if current_activity == 0: # empty return 0 if current_activity == 1: # electron head return 2 if current_activity == 2: # electron tail ...
[ "numpy.count_nonzero", "cellpylib.evolve2d", "numpy.array", "matplotlib.colors.ListedColormap" ]
[((534, 1573), 'numpy.array', 'np.array', (['[[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n ], [0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0], [0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2...
import unittest import aspecd.model import lmfit import numpy as np import fitpy.dataset class TestCalculatedDataset(unittest.TestCase): def setUp(self): self.dataset = fitpy.dataset.CalculatedDataset() def test_instantiate_class(self): pass def test_data_has_residual_property(self): ...
[ "lmfit.minimizer.MinimizerResult", "numpy.random.seed", "numpy.zeros", "numpy.sign", "lmfit.minimize", "numpy.sin", "numpy.exp", "numpy.linspace", "numpy.random.normal", "lmfit.Parameters" ]
[((2111, 2122), 'numpy.zeros', 'np.zeros', (['(5)'], {}), '(5)\n', (2119, 2122), True, 'import numpy as np\n'), ((2152, 2163), 'numpy.zeros', 'np.zeros', (['(5)'], {}), '(5)\n', (2160, 2163), True, 'import numpy as np\n'), ((4533, 4566), 'lmfit.minimizer.MinimizerResult', 'lmfit.minimizer.MinimizerResult', ([], {}), '(...
from functools import lru_cache import cv2 import numpy as np def visualize_instances( imask, bg_color=255, boundaries_color=None, boundaries_width=1, boundaries_alpha=0.8 ): num_objects = imask.max() + 1 palette = get_palette(num_objects) if bg_color is not None: palette[0] = bg_color r...
[ "cv2.circle", "numpy.logical_and", "cv2.getStructuringElement", "numpy.zeros", "numpy.max", "numpy.array", "numpy.logical_or", "functools.lru_cache" ]
[((718, 739), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(16)'}), '(maxsize=16)\n', (727, 739), False, 'from functools import lru_cache\n'), ((777, 837), 'numpy.array', 'np.array', (['[[0, 0, 0], [128, 0, 0], [0, 128, 0], [0, 0, 128]]'], {}), '([[0, 0, 0], [128, 0, 0], [0, 128, 0], [0, 0, 128]])\n', (785, 83...
import argparse import copy import random from rom_generator.generator import makeSpriteSheet, makeBasicProject, addSpriteSheet, makeBackground, makeScene, makeActor, addSymmetricSceneConnections, makeMusic, reverse_direction, initializeGenerator, writeProjectToDisk, addActor, makeCol, makeLock, makeKey import rom_gene...
[ "rom_generator.generator.makeBackground", "rom_generator.generator.makeMusic", "argparse.ArgumentParser", "rom_generator.generator.writeProjectToDisk", "random.randint", "rom_generator.background.getTileList", "rom_generator.mazes.mazeGen.run", "rom_generator.generator.makeKey", "rom_generator.backg...
[((1560, 1599), 'rom_generator.background.getTileList', 'background.getTileList', (['maze_tile_names'], {}), '(maze_tile_names)\n', (1582, 1599), True, 'import rom_generator.background as background\n'), ((2027, 2038), 'rom_generator.mazes.mazeGen.run', 'run', (['size_x'], {}), '(size_x)\n', (2030, 2038), False, 'from ...
from numpy import asarray, block, clip, inf, kron, sqrt from numpy.linalg import pinv from glimix_core._util import rsolve, unvec, vec from .._util import cached_property, log2pi, safe_log class KronFastScanner: """ Approximated fast inference over several covariates. Specifically, it maximizes the log...
[ "glimix_core._util.vec", "glimix_core._util.unvec", "numpy.block", "numpy_sugar.is_all_finite", "numpy.asarray", "scipy.linalg.cho_solve", "numpy.empty", "glimix_core._util.rsolve", "numpy.clip", "numpy.kron", "numpy.linalg.pinv", "numpy.linalg.multi_dot" ]
[((1110, 1127), 'numpy.asarray', 'asarray', (['Y', 'float'], {}), '(Y, float)\n', (1117, 1127), False, 'from numpy import asarray, block, clip, inf, kron, sqrt\n'), ((1146, 1163), 'numpy.asarray', 'asarray', (['A', 'float'], {}), '(A, float)\n', (1153, 1163), False, 'from numpy import asarray, block, clip, inf, kron, s...
import os import pickle import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from utils import config_reference as cfg sns.set() LOGIT_DIFFERENCE_PATH = "/Users/blakeedwards/Desktop/Repos/research/neural-distiller/post-experiment/ESKD-Analysis/experiment3_logit_diffs.pkl" with o...
[ "matplotlib.pyplot.title", "seaborn.heatmap", "matplotlib.pyplot.show", "os.path.join", "numpy.transpose", "numpy.mean", "pickle.load", "seaborn.set" ]
[((159, 168), 'seaborn.set', 'sns.set', ([], {}), '()\n', (166, 168), True, 'import seaborn as sns\n'), ((509, 539), 'numpy.transpose', 'np.transpose', (['train_difference'], {}), '(train_difference)\n', (521, 539), True, 'import numpy as np\n'), ((558, 587), 'numpy.transpose', 'np.transpose', (['test_difference'], {})...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
[ "traceml.processors.df_processors.get_df_columns", "pandas.date_range", "traceml.processors.df_processors.get_median_absolute_deviation", "numpy.count_nonzero", "traceml.processors.df_processors.get_deviation_of_mean", "random.shuffle", "traceml.processors.df_processors.get_df_column_summary", "pandas...
[((1121, 1137), 'random.shuffle', 'shuffle', (['missing'], {}), '(missing)\n', (1128, 1137), False, 'from random import shuffle\n'), ((2680, 2722), 'traceml.processors.df_processors.get_df_column_stats', 'df_processors.get_df_column_stats', (['self.df'], {}), '(self.df)\n', (2713, 2722), False, 'from traceml.processors...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module implements an interface to enumlib, <NAME>"s excellent Fortran code for enumerating derivative structures. This module depends on a compiled enumlib with the executables enum.x and makestr.x av...
[ "subprocess.Popen", "monty.dev.requires", "pymatgen.core.periodic_table.DummySpecies", "pymatgen.io.vasp.inputs.Poscar.from_string", "monty.tempfile.ScratchDir", "pymatgen.core.sites.PeriodicSite", "math.floor", "pymatgen.core.structure.Structure", "re.sub", "monty.os.path.which", "numpy.linalg....
[((1617, 1644), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1634, 1644), False, 'import logging\n'), ((1893, 2210), 'monty.dev.requires', 'requires', (['(enum_cmd and makestr_cmd)', '"""EnumlibAdaptor requires the executables \'enum.x\' or \'multienum.x\' and \'makestr.x\' or \'makeSt...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2019 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) import numpy as np from pymor.algorithms.basic import almost_equal from pymor.algorithms.gram_sch...
[ "pymor.algorithms.gram_schmidt.gram_schmidt_biorth", "pymor.algorithms.basic.almost_equal", "pymor.algorithms.gram_schmidt.gram_schmidt", "numpy.all" ]
[((616, 642), 'pymor.algorithms.gram_schmidt.gram_schmidt', 'gram_schmidt', (['U'], {'copy': '(True)'}), '(U, copy=True)\n', (628, 642), False, 'from pymor.algorithms.gram_schmidt import gram_schmidt, gram_schmidt_biorth\n'), ((822, 849), 'pymor.algorithms.gram_schmidt.gram_schmidt', 'gram_schmidt', (['U'], {'copy': '(...
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(111, projection='3d') n = 1000 x = np.random.rand(n) y = np.random.rand(n) z = np.random.rand(n) ax.scatter(x, y, z, color="black", marker="*") ax.set_xlabel('X Label') ax.set_ylabel('...
[ "numpy.random.rand", "matplotlib.pyplot.figure", "matplotlib.pyplot.show" ]
[((99, 111), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (109, 111), True, 'import matplotlib.pyplot as plt\n'), ((170, 187), 'numpy.random.rand', 'np.random.rand', (['n'], {}), '(n)\n', (184, 187), True, 'import numpy as np\n'), ((192, 209), 'numpy.random.rand', 'np.random.rand', (['n'], {}), '(n)\n', ...
''' This module will attempt to predict model parameters by using a trained model. ''' import tensorflow as tf import os import h5py import numpy as np import pickle base_dir = os.path.expanduser('~/fluoro/data/compilation') file_base_name = 'vox_fluoro_min_max_1' hist_path = os.path.join(os.path.expanduser('~/fluo...
[ "pickle.dump", "os.makedirs", "os.path.join", "numpy.expand_dims", "numpy.min", "pickle.load", "numpy.where", "numpy.max", "numpy.random.choice", "os.path.expanduser" ]
[((179, 226), 'os.path.expanduser', 'os.path.expanduser', (['"""~/fluoro/data/compilation"""'], {}), "('~/fluoro/data/compilation')\n", (197, 226), False, 'import os\n'), ((565, 601), 'os.makedirs', 'os.makedirs', (['save_dir'], {'exist_ok': '(True)'}), '(save_dir, exist_ok=True)\n', (576, 601), False, 'import os\n'), ...