code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
This module contains all routines for evaluating GDML and sGDML models.
"""
# MIT License
#
# Copyright (c) 2018-2020 <NAME>, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software wit... | [
"numpy.load",
"numpy.empty",
"numpy.einsum",
"torch.cuda.device_count",
"numpy.savez_compressed",
"numpy.linalg.norm",
"numpy.exp",
"numpy.tile",
"timeit.timeit",
"os.path.join",
"numpy.unique",
"multiprocessing.cpu_count",
"os.path.abspath",
"os.path.exists",
"numpy.append",
"functool... | [((5221, 5245), 'numpy.empty', 'np.empty', (['(dim_c, dim_d)'], {}), '((dim_c, dim_d))\n', (5229, 5245), True, 'import numpy as np\n'), ((5257, 5275), 'numpy.empty', 'np.empty', (['(dim_c,)'], {}), '((dim_c,))\n', (5265, 5275), True, 'import numpy as np\n'), ((5293, 5311), 'numpy.empty', 'np.empty', (['(dim_c,)'], {}),... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.python.keras.layers.Dense",
"tensorflow.python.framework.op_callbacks.add_op_callback",
"tensorflow.python.eager.test.main",
"tensorflow.python.util.compat.as_bytes",
"tensorflow.python.framework.op_callbacks.clear_op_callbacks",
"numpy.zeros",
"numpy.ones",
"tensorflow.python.keras.layers... | [((7089, 7117), 'tensorflow.python.framework.ops.enable_eager_execution', 'ops.enable_eager_execution', ([], {}), '()\n', (7115, 7117), False, 'from tensorflow.python.framework import ops\n'), ((7120, 7131), 'tensorflow.python.eager.test.main', 'test.main', ([], {}), '()\n', (7129, 7131), False, 'from tensorflow.python... |
import pytesseract
import cv2
import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage import interpolation as inter
class SimpleProcessor:
"""
Preprocess images using OpenCV processing methods
"""
def get_grayscale(self, image):
"""
Convert image to greyscale. Uses ... | [
"numpy.sum",
"cv2.cvtColor",
"cv2.threshold",
"numpy.zeros",
"scipy.ndimage.interpolation.rotate",
"cv2.adaptiveThreshold",
"cv2.fastNlMeansDenoising",
"cv2.warpAffine",
"numpy.arange",
"cv2.erode",
"cv2.getRotationMatrix2D"
] | [((682, 721), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (694, 721), False, 'import cv2\n'), ((1525, 1626), 'cv2.adaptiveThreshold', 'cv2.adaptiveThreshold', (['image', 'maxValue', 'cv2.ADAPTIVE_THRESH_GAUSSIAN_C', 'cv2.THRESH_BINARY', '(11)', '(3)'], {}), '(... |
"""
This code is extended from Hengyuan Hu's repository.
https://github.com/hengyuan-hu/bottom-up-attention-vqa
"""
from __future__ import print_function
import errno
import os
import re
import collections
import numpy as np
import operator
import functools
from PIL import Image
import torch
import torch.nn as nn
impo... | [
"os.mkdir",
"numpy.abs",
"numpy.mean",
"os.path.join",
"os.path.dirname",
"torch.load",
"os.path.exists",
"torch.DoubleTensor",
"torch.is_tensor",
"re.search",
"re.sub",
"torch.utils.data.dataloader.default_collate",
"os.listdir",
"torch.from_numpy",
"os.makedirs",
"torch.stack",
"to... | [((2597, 2625), 'torch.save', 'torch.save', (['model_dict', 'path'], {}), '(model_dict, path)\n', (2607, 2625), False, 'import torch\n'), ((3263, 3288), 'torch.is_tensor', 'torch.is_tensor', (['batch[0]'], {}), '(batch[0])\n', (3278, 3288), False, 'import torch\n'), ((936, 954), 'os.listdir', 'os.listdir', (['folder'],... |
import os
import numpy as np
import cv2
from io import BytesIO
from time import sleep
from picamera import PiCamera
def calibrate_chessboard(imgs_path="./images", width=6, height=9, mode="RT"):
"""Estimate the intrinsic and extrinsic properties of a camera.
This code is written according to:
1- OpenCV... | [
"io.BytesIO",
"cv2.findChessboardCorners",
"cv2.cvtColor",
"cv2.imwrite",
"os.walk",
"numpy.zeros",
"cv2.projectPoints",
"cv2.imdecode",
"time.sleep",
"cv2.cornerSubPix",
"cv2.imread",
"cv2.calibrateCamera",
"cv2.norm",
"cv2.drawChessboardCorners",
"os.path.join",
"numpy.concatenate",
... | [((1473, 1483), 'picamera.PiCamera', 'PiCamera', ([], {}), '()\n', (1481, 1483), False, 'from picamera import PiCamera\n'), ((1584, 1593), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (1591, 1593), False, 'from io import BytesIO\n'), ((1786, 1827), 'numpy.zeros', 'np.zeros', (['(width * height, 3)', 'np.float32'], {}), '... |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. 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 r... | [
"datasets.load_dataset",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"torch.stack",
"accelerate.Accelerator",
"numpy.zeros",
"torch.cat",
"evaluate.load",
"transformers.set_seed",
"transformers.AutoTokenizer.from_pretrained",
"transformers.AutoModelForSequenceClassification.from_pr... | [((2841, 2889), 'transformers.AutoTokenizer.from_pretrained', 'AutoTokenizer.from_pretrained', (['"""bert-base-cased"""'], {}), "('bert-base-cased')\n", (2870, 2889), False, 'from transformers import AdamW, AutoModelForSequenceClassification, AutoTokenizer, get_linear_schedule_with_warmup, set_seed\n'), ((4246, 4349), ... |
"""
Convert ZDF point cloud to TXT format without Zivid Software.
Note: ZIVID_DATA needs to be set to the location of Zivid Sample Data files.
"""
from pathlib import Path
import os
import numpy as np
from netCDF4 import Dataset
def _main():
filename_zdf = Path() / f"{str(os.environ['ZIVID_DATA'])}/Zivid3D.zdf"... | [
"numpy.dstack",
"netCDF4.Dataset",
"numpy.savetxt",
"numpy.isnan",
"pathlib.Path"
] | [((758, 789), 'numpy.dstack', 'np.dstack', (['[xyz, rgb, contrast]'], {}), '([xyz, rgb, contrast])\n', (767, 789), True, 'import numpy as np\n'), ((1184, 1258), 'numpy.savetxt', 'np.savetxt', (['filename_txt', 'flattened_point_cloud'], {'delimiter': '""" """', 'fmt': '"""%.3f"""'}), "(filename_txt, flattened_point_clou... |
import warnings
import numpy as np
import pandas as pd
import numpy.random
rg = numpy.random.default_rng()
import scipy.optimize
import scipy.stats as st
import tqdm
import bebi103
try:
import multiprocess
except:
import multiprocessing as multiprocess
def CDF_double_exp(beta_1, beta_2, t):
frac = beta_1 *... | [
"warnings.simplefilter",
"numpy.log",
"numpy.array",
"numpy.exp",
"warnings.catch_warnings"
] | [((547, 590), 'numpy.log', 'np.log', (['(beta_1 * (beta_1 + d_beta) / d_beta)'], {}), '(beta_1 * (beta_1 + d_beta) / d_beta)\n', (553, 590), True, 'import numpy as np\n'), ((1406, 1431), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {}), '()\n', (1429, 1431), False, 'import warnings\n'), ((1441, 1472), 'wa... |
# Create cover permeability layer
# Script written in Python 3.7
import config as config
import numpy as np
import pandas as pd
from scipy import ndimage
from soil_merger import readHeader
import importlib
importlib.reload(config)
# =====================================================================================... | [
"scipy.ndimage.binary_erosion",
"numpy.invert",
"numpy.savetxt",
"soil_merger.readHeader",
"importlib.reload",
"numpy.where",
"numpy.loadtxt"
] | [((208, 232), 'importlib.reload', 'importlib.reload', (['config'], {}), '(config)\n', (224, 232), False, 'import importlib\n'), ((710, 745), 'numpy.loadtxt', 'np.loadtxt', (['stands_path'], {'skiprows': '(6)'}), '(stands_path, skiprows=6)\n', (720, 745), True, 'import numpy as np\n'), ((908, 941), 'numpy.loadtxt', 'np.... |
# Code for "ActionCLIP: ActionCLIP: A New Paradigm for Action Recognition"
# arXiv:
# <NAME>, <NAME>, <NAME>
import numpy as np
import pytest
import torch
from PIL import Image
import clip
@pytest.mark.parametrize('model_name', clip.available_models())
def test_consistency(model_name):
device = "cpu"
jit_mo... | [
"clip.available_models",
"numpy.allclose",
"clip.tokenize",
"clip.load",
"PIL.Image.open",
"torch.no_grad"
] | [((337, 373), 'clip.load', 'clip.load', (['model_name'], {'device': 'device'}), '(model_name, device=device)\n', (346, 373), False, 'import clip\n'), ((392, 439), 'clip.load', 'clip.load', (['model_name'], {'device': 'device', 'jit': '(False)'}), '(model_name, device=device, jit=False)\n', (401, 439), False, 'import cl... |
import numpy as np
top1 = 0
top5 = 0
top1_wc = 0
top5_wc = 0
top1_cnt = 0
num_act = 0
num_cnt = 0
dataset = 'gtea2salad'
for n_split in range(5, 6):
n_split = str(n_split)
corr_numact = [0, 0, 0, 0, 0, 0, 0]
num_numact = [0, 0, 0, 0, 0, 0, 0]
corr_1 = 0
corr_5 = 0
corr_1_wcnt = 0
corr_5_wcn... | [
"numpy.load",
"numpy.sum"
] | [((363, 440), 'numpy.load', 'np.load', (["('./prompt_test/' + dataset + '/split' + n_split + '/final_act_1.npy')"], {}), "('./prompt_test/' + dataset + '/split' + n_split + '/final_act_1.npy')\n", (370, 440), True, 'import numpy as np\n'), ((451, 528), 'numpy.load', 'np.load', (["('./prompt_test/' + dataset + '/split' ... |
# standard library imports
import os
import re
# third party
import numpy as np
# local application imports
from pygsm import utilities
from .base_lot import Lot
from .file_options import File_Options
class BAGEL(Lot):
def __init__(self,options):
super(BAGEL,self).__init__(options)
print(" ma... | [
"re.finditer",
"numpy.asarray",
"pygsm.utilities.manage_xyz.xyz_to_np",
"os.system",
"re.match",
"os.path.isfile",
"pygsm.utilities.manage_xyz.read_xyz",
"re.compile"
] | [((11988, 12044), 'pygsm.utilities.manage_xyz.read_xyz', 'utilities.manage_xyz.read_xyz', (['"""../../data/ethylene.xyz"""'], {}), "('../../data/ethylene.xyz')\n", (12017, 12044), False, 'from pygsm import utilities\n'), ((12229, 12265), 'pygsm.utilities.manage_xyz.xyz_to_np', 'utilities.manage_xyz.xyz_to_np', (['geom'... |
import os
import pdb
import h5py
import pickle
import numpy as np
from scipy.io import loadmat
import cv2
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import csv
import matplotlib as mpl
import matplotlib.cm as cm
impor... | [
"matplotlib.pyplot.title",
"pickle.dump",
"os.remove",
"tensorflow.image.grayscale_to_rgb",
"scipy.io.loadmat",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.figure",
"pickle.load",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.imsave",
"matplotlib.pyplot.imread",
"numpy.eye",
"matplotlib... | [((910, 932), 'tensorflow.read_file', 'tf.read_file', (['img_path'], {}), '(img_path)\n', (922, 932), True, 'import tensorflow as tf\n'), ((948, 973), 'tensorflow.image.decode_jpeg', 'tf.image.decode_jpeg', (['img'], {}), '(img)\n', (968, 973), True, 'import tensorflow as tf\n'), ((987, 1024), 'tensorflow.image.decode_... |
# -*- coding: utf-8 -*-
"""
Lower-level methods to manage parameters and particle movement.
Particle class for managing the definition of particle attributes and
parameters of the domain as well as iterative movement of the particles
through the domain.
Project Homepage: https://github.com/passaH2O/dorado
"""
from __... | [
"numpy.nanpercentile",
"numpy.arctan2",
"numpy.abs",
"numpy.clip",
"numpy.isnan",
"numpy.shape",
"scipy.spatial.cKDTree",
"builtins.range",
"numpy.pad",
"numpy.meshgrid",
"numpy.zeros_like",
"scipy.ndimage.gaussian_filter",
"dorado.lagrangian_walker.make_weight",
"numpy.flipud",
"numpy.m... | [((36873, 36909), 'numpy.zeros', 'np.zeros', (['[Np_tracer]'], {'dtype': '"""float"""'}), "([Np_tracer], dtype='float')\n", (36881, 36909), True, 'import numpy as np\n'), ((40834, 40855), 'numpy.zeros', 'np.zeros', (['raster_size'], {}), '(raster_size)\n', (40842, 40855), True, 'import numpy as np\n'), ((41209, 41237),... |
import pandas as pd
import numpy as np
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Flatten, Input, Activation, BatchNormalization
from keras.layers import Conv2D, MaxPooling2D
from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau
from keras.layers.normali... | [
"numpy.random.seed",
"keras.models.Model",
"keras.layers.Input",
"keras.layers.concatenate",
"keras.layers.Flatten",
"keras.callbacks.ReduceLROnPlateau",
"keras.layers.MaxPooling2D",
"numpy.dstack",
"keras.callbacks.ModelCheckpoint",
"keras.layers.Dropout",
"keras.optimizers.Adam",
"keras.laye... | [((412, 432), 'numpy.random.seed', 'np.random.seed', (['(1207)'], {}), '(1207)\n', (426, 432), True, 'import numpy as np\n'), ((3894, 3928), 'pandas.read_json', 'pd.read_json', (['"""./input/train.json"""'], {}), "('./input/train.json')\n", (3906, 3928), True, 'import pandas as pd\n'), ((3973, 4005), 'numpy.array', 'np... |
# Copyright 2021 AI Singapore
#
# 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 writin... | [
"numpy.pad",
"cv2.resize",
"numpy.clip"
] | [((1682, 1732), 'cv2.resize', 'cv2.resize', (['image', '(resized_width, resized_height)'], {}), '(image, (resized_width, resized_height))\n', (1692, 1732), False, 'import cv2\n'), ((1922, 1986), 'numpy.pad', 'np.pad', (['image', '[(0, pad_h), (0, pad_w), (0, 0)]'], {'mode': '"""constant"""'}), "(image, [(0, pad_h), (0,... |
import numpy as np
state=np.array([[1,2,3,4],
[3,4,5,6],
[1,1,1,1]])
state_part=state[:2,1]
print(state_part)
target=np.zeros((2,2))
target[1]=[1,2]
print(target)
x=np.random.uniform(0.1, 0.9) * 10
print(x) | [
"numpy.zeros",
"numpy.random.uniform",
"numpy.array"
] | [((26, 78), 'numpy.array', 'np.array', (['[[1, 2, 3, 4], [3, 4, 5, 6], [1, 1, 1, 1]]'], {}), '([[1, 2, 3, 4], [3, 4, 5, 6], [1, 1, 1, 1]])\n', (34, 78), True, 'import numpy as np\n'), ((135, 151), 'numpy.zeros', 'np.zeros', (['(2, 2)'], {}), '((2, 2))\n', (143, 151), True, 'import numpy as np\n'), ((183, 210), 'numpy.r... |
import numpy as np
import torch
import os, sys
from samplers import GenerativeSampler, sample, log_normal_pdf
class Rewarder(object):
rewardfn = None
sampler = None
device = None
logp = None
logps = None
rewardfn_state = {}
obs = {}
@classmethod
def __init__(cls, rewardfn, sampler,... | [
"torch.ones",
"numpy.copy",
"torch.FloatTensor",
"samplers.sample",
"torch.zeros",
"torch.no_grad"
] | [((2404, 2419), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2417, 2419), False, 'import torch\n'), ((4474, 4489), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4487, 4489), False, 'import torch\n'), ((1171, 1192), 'numpy.copy', 'np.copy', (["obs['image']"], {}), "(obs['image'])\n", (1178, 1192), True, '... |
import numpy as np
def softmax(predictions):
'''
Computes probabilities from scores
Arguments:
predictions, np array, shape is either (N) or (batch_size, N) -
classifier output
Returns:
probs, np array of the same shape as predictions -
probability for every class, 0..1
... | [
"numpy.multiply",
"numpy.log",
"numpy.argmax",
"numpy.random.randn",
"numpy.zeros",
"numpy.max",
"numpy.arange",
"numpy.exp",
"numpy.array_split",
"numpy.dot",
"numpy.random.shuffle"
] | [((558, 571), 'numpy.exp', 'np.exp', (['probs'], {}), '(probs)\n', (564, 571), True, 'import numpy as np\n'), ((1322, 1343), 'numpy.zeros', 'np.zeros', (['probs.shape'], {}), '(probs.shape)\n', (1330, 1343), True, 'import numpy as np\n'), ((2710, 2737), 'numpy.zeros', 'np.zeros', (['predictions.shape'], {}), '(predicti... |
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_array_equal
from scipy import linalg
from .. import pick_types, Evoked
from ..io import BaseRaw
from ..io.constants import FIFF
from ..bem import fit_sphere_to_headshape
def _g... | [
"numpy.median",
"numpy.testing.assert_array_equal",
"numpy.clip",
"numpy.mean",
"scipy.linalg.norm",
"numpy.testing.assert_equal",
"numpy.testing.assert_allclose",
"numpy.concatenate"
] | [((887, 935), 'numpy.clip', 'np.clip', (['error_rms', '(1e-60)', 'np.inf'], {'out': 'error_rms'}), '(error_rms, 1e-60, np.inf, out=error_rms)\n', (894, 935), True, 'import numpy as np\n'), ((1340, 1355), 'numpy.median', 'np.median', (['snrs'], {}), '(snrs)\n', (1349, 1355), True, 'import numpy as np\n'), ((1890, 1959),... |
import numpy as np
import pandas as pd
import os.path
import random
import collections
from bisect import bisect_right
from bisect import bisect_left
from .. import multimatch_gaze as mp
dtype = [
("onset", "<f8"),
("duration", "<f8"),
("label", "<U10"),
("start_x", "<f8"),
("start_y", "<f8"),
... | [
"pandas.DataFrame",
"numpy.random.uniform",
"copy.deepcopy",
"numpy.logical_and",
"pandas.read_csv",
"bisect.bisect_right",
"numpy.recfromcsv",
"numpy.recarray",
"numpy.shape",
"numpy.append",
"numpy.where",
"numpy.arange",
"numpy.array",
"collections.OrderedDict",
"bisect.bisect_left",
... | [((976, 1233), 'numpy.recfromcsv', 'np.recfromcsv', (['path'], {'delimiter': '"""\t"""', 'dtype': "{'names': ('onset', 'duration', 'label', 'start_x', 'start_y', 'end_x',\n 'end_y', 'amp', 'peak_vel', 'med_vel', 'avg_vel'), 'formats': ('f8',\n 'f8', 'U10', 'f8', 'f8', 'f8', 'f8', 'f8', 'f8', 'f8', 'f8')}"}), "(pa... |
import numpy as np
import numba as nb
nb_parallel = True # not sure if this makes any difference on the cluster
@nb.njit(parallel=nb_parallel)
def get_sphere_mask(pos, center, radius):
"""Calculate a spherical mask with given center and radius.
Returns a boolean mask that filters out the particles given by... | [
"numpy.zeros_like",
"numpy.sum",
"numpy.multiply",
"numpy.arctan2",
"numba.njit",
"numpy.expand_dims",
"numpy.sin",
"numpy.cos",
"numpy.sqrt"
] | [((117, 146), 'numba.njit', 'nb.njit', ([], {'parallel': 'nb_parallel'}), '(parallel=nb_parallel)\n', (124, 146), True, 'import numba as nb\n'), ((443, 472), 'numba.njit', 'nb.njit', ([], {'parallel': 'nb_parallel'}), '(parallel=nb_parallel)\n', (450, 472), True, 'import numba as nb\n'), ((3233, 3252), 'numpy.zeros_lik... |
import textwrap
from typing import Optional, Dict, Any, Union, TYPE_CHECKING
import numpy as np
import qcodes.utils.validators as vals
from qcodes.utils.validators import Arrays
from .KeysightB1500_sampling_measurement import SamplingMeasurement
from .KeysightB1500_module import B1500Module, parse_spot_measurement_res... | [
"textwrap.dedent",
"numpy.arange",
"qcodes.utils.validators.Arrays",
"qcodes.utils.validators.Numbers"
] | [((1026, 1054), 'qcodes.utils.validators.Numbers', 'vals.Numbers', (['(0.0001)', '(65.535)'], {}), '(0.0001, 65.535)\n', (1038, 1054), True, 'import qcodes.utils.validators as vals\n'), ((4121, 4158), 'numpy.arange', 'np.arange', (['(0)', 'total_time', 'sample_rate'], {}), '(0, total_time, sample_rate)\n', (4130, 4158)... |
# Copyright 2019 Google Inc. 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 or ... | [
"numpy.nonzero",
"numpy.array"
] | [((950, 971), 'numpy.nonzero', 'np.nonzero', (['(lhs - rhs)'], {}), '(lhs - rhs)\n', (960, 971), True, 'import numpy as np\n'), ((1019, 1032), 'numpy.array', 'np.array', (['[e]'], {}), '([e])\n', (1027, 1032), True, 'import numpy as np\n')] |
from train import *
import os
import numpy as np
import torch
from torch.nn import functional as F
from utils import cropping, load_data, get_transform, load_otb_data
import os
os.environ['CUDA_VISIBLE_DEVICES']='0'
def test(env, R, root_dir, data_name='vot'):
R.agent.eval()
if data_name=='vot':
imgl... | [
"utils.cropping",
"utils.load_data",
"utils.load_otb_data",
"torch.argmax",
"torch.load",
"numpy.savetxt",
"os.path.isfile",
"utils.get_transform",
"numpy.vstack"
] | [((1487, 1502), 'utils.get_transform', 'get_transform', ([], {}), '()\n', (1500, 1502), False, 'from utils import cropping, load_data, get_transform, load_otb_data\n'), ((1577, 1604), 'os.path.isfile', 'os.path.isfile', (['args.resume'], {}), '(args.resume)\n', (1591, 1604), False, 'import os\n'), ((2047, 2072), 'numpy... |
import numpy as np
def euclidean_distance(x: np.array, y: np.array) -> float:
"""Calculates euclidean distance.
This function calculates euclidean distance between
two points x and y in Euclidean n-space.
Args:
x, y: points in Euclidean n-space.
Returns:
length of the line s... | [
"numpy.array",
"numpy.sum",
"numpy.in1d"
] | [((3905, 3965), 'numpy.array', 'np.array', (['[(1 if p in actual else 0) for p in predicted[:k]]'], {}), '([(1 if p in actual else 0) for p in predicted[:k]])\n', (3913, 3965), True, 'import numpy as np\n'), ((381, 401), 'numpy.sum', 'np.sum', (['((x - y) ** 2)'], {}), '((x - y) ** 2)\n', (387, 401), True, 'import nump... |
#!/usr/bin/env python3
# dcfac0e3-1ade-11e8-9de3-00505601122b
# 7d179d73-3e93-11e9-b0fd-00505601122b
import argparse
import sys
import matplotlib.pyplot as plt
import numpy as np
import sklearn.datasets
import sklearn.metrics
import sklearn.model_selection
if __name__ == "__main__":
parser = argparse.ArgumentPars... | [
"numpy.minimum",
"numpy.random.seed",
"argparse.ArgumentParser",
"matplotlib.pyplot.show",
"numpy.multiply",
"numpy.maximum",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"numpy.abs",
"numpy.random.RandomState",
"numpy.min",
"numpy.mean",
"matplotlib.pyplot.contourf",
"matplotl... | [((299, 324), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (322, 324), False, 'import argparse\n'), ((1506, 1531), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (1520, 1531), True, 'import numpy as np\n'), ((3274, 3306), 'numpy.random.RandomState', 'np.random.Ra... |
#!/bin/env python3
# -*- coding: utf8 -*-
import math
import click
import numpy as np
import tensorflow as tf
import torch
from model import build_graph
from torch import nn
from torchvision import transforms
from torchvision.datasets import cifar
from utensor_cgen.utils import prepare_meta_graph
def one_hot(labels... | [
"click.help_option",
"torchvision.transforms.RandomAffine",
"torch.utils.data.DataLoader",
"torchvision.transforms.RandomHorizontalFlip",
"model.build_graph",
"tensorflow.global_variables_initializer",
"click.option",
"tensorflow.Session",
"click.command",
"tensorflow.placeholder",
"torchvision.... | [((373, 388), 'click.command', 'click.command', ([], {}), '()\n', (386, 388), False, 'import click\n'), ((390, 423), 'click.help_option', 'click.help_option', (['"""-h"""', '"""--help"""'], {}), "('-h', '--help')\n", (407, 423), False, 'import click\n'), ((425, 528), 'click.option', 'click.option', (['"""--batch-size""... |
"""
.. currentmodule:: pylayers.antprop.diffRT
.. autosummary::
:members:
"""
from __future__ import print_function
import doctest
import os
import glob
#!/usr/bin/python
# -*- coding: latin1 -*-
import numpy as np
import scipy.special as sps
import matplotlib.pyplot as plt
import pdb
def diff(fGHz,phi0,phi,si,s... | [
"numpy.abs",
"numpy.empty",
"numpy.floor",
"numpy.ones",
"numpy.isnan",
"numpy.shape",
"numpy.imag",
"numpy.sin",
"numpy.exp",
"numpy.max",
"numpy.tan",
"numpy.real",
"numpy.log10",
"numpy.mod",
"numpy.cos",
"numpy.where",
"numpy.array",
"pdb.set_trace",
"numpy.sqrt"
] | [((2609, 2648), 'numpy.empty', 'np.empty', (['(fGHz.shape[0], phi.shape[1])'], {}), '((fGHz.shape[0], phi.shape[1]))\n', (2617, 2648), True, 'import numpy as np\n'), ((2659, 2698), 'numpy.empty', 'np.empty', (['(fGHz.shape[0], phi.shape[1])'], {}), '((fGHz.shape[0], phi.shape[1]))\n', (2667, 2698), True, 'import numpy ... |
"""
Given a file --infile pointing to a npz archive with X and y vectors,
and assuming training has been run for both precomputed and computed
GD, plots stuff nicely.
assuming --infile is input.npz, writes plots
input.npz-time.pdf
input.npz-time-avg.pdf
input.npz-samples.pdf
input.npz-samples-avg.pdf
"""
from absl i... | [
"numpy.load",
"numpy.ones_like",
"absl.flags.mark_flag_as_required",
"absl.flags.DEFINE_string",
"numpy.cumsum",
"absl.app.run"
] | [((447, 541), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""infile"""', 'None', '"""the input X, true beta, and y arrays, as a npz file"""'], {}), "('infile', None,\n 'the input X, true beta, and y arrays, as a npz file')\n", (466, 541), False, 'from absl import app, flags\n'), ((544, 581), 'absl.flags.ma... |
import numpy as np
from cwFitter import Simulator
class Evaluator(object):
def __init__(self, sampleData, sim_params, bio_params):
self.sampleData = sampleData
self.sim_params = sim_params
self.bio_params = bio_params
if 'protoco_start_I' in sim_params:
self.steps = ... | [
"cwFitter.Simulator.Simulator",
"numpy.arange"
] | [((320, 427), 'numpy.arange', 'np.arange', (["sim_params['protocol_start_I']", "sim_params['protocol_end_I']", "sim_params['protocol_steps_I']"], {}), "(sim_params['protocol_start_I'], sim_params['protocol_end_I'],\n sim_params['protocol_steps_I'])\n", (329, 427), True, 'import numpy as np\n'), ((463, 564), 'numpy.a... |
# ------------------------------------------------------
# Merge ERA20c and ERA5 by adjusting the mean over 1979.
# Average the results into annual means
# Compute wind stress from wind fields
# ------------------------------------------------------
import numpy as np
from netCDF4 import Dataset
import os
import mod_ge... | [
"netCDF4.Dataset",
"numpy.flipud",
"numpy.fliplr",
"numpy.arange",
"mod_gentools.monthly_time",
"os.getenv",
"numpy.vstack",
"numpy.sqrt"
] | [((700, 721), 'numpy.arange', 'np.arange', (['(1900)', '(2019)'], {}), '(1900, 2019)\n', (709, 721), True, 'import numpy as np\n'), ((964, 975), 'netCDF4.Dataset', 'Dataset', (['fn'], {}), '(fn)\n', (971, 975), False, 'from netCDF4 import Dataset\n'), ((1153, 1200), 'numpy.flipud', 'np.flipud', (["file_handle.variables... |
import tensorflow as tf
import numpy as np
def accuracy_gpu(prediction, target):
pred_label = tf.argmax(prediction, axis=1)
target_label = tf.argmax(target, axis=1)
counts = tf.to_float(tf.equal(pred_label, target_label))
return tf.reduce_mean(counts)
def accuracy_cpu(prediction, target):
pred_l... | [
"numpy.argmax",
"tensorflow.argmax",
"tensorflow.reduce_mean",
"numpy.mean",
"tensorflow.equal"
] | [((100, 129), 'tensorflow.argmax', 'tf.argmax', (['prediction'], {'axis': '(1)'}), '(prediction, axis=1)\n', (109, 129), True, 'import tensorflow as tf\n'), ((149, 174), 'tensorflow.argmax', 'tf.argmax', (['target'], {'axis': '(1)'}), '(target, axis=1)\n', (158, 174), True, 'import tensorflow as tf\n'), ((247, 269), 't... |
import gc
import logging
import traceback
from collections import defaultdict
from datetime import datetime, timedelta
from multiprocessing import Process, Queue
import numpy as np
import pandas as pd
import xarray as xr
from typhon.geodesy import great_circle_distance
from typhon.geographical import GeoIndex
from ty... | [
"numpy.abs",
"numpy.allclose",
"traceback.format_tb",
"collections.defaultdict",
"gc.collect",
"numpy.arange",
"pandas.Grouper",
"multiprocessing.Queue",
"typhon.utils.timeutils.to_datetime",
"typhon.geographical.GeoIndex",
"pandas.DataFrame",
"typhon.utils.timeutils.Timer",
"xarray.merge",
... | [((515, 542), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (532, 542), False, 'import logging\n'), ((58781, 58798), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (58792, 58798), False, 'from collections import defaultdict\n'), ((3233, 3251), 'numpy.array', 'np.ar... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | [
"copy.deepcopy",
"numpy.triu",
"numpy.ceil",
"numpy.sum",
"qiskit.exceptions.QiskitError",
"numpy.transpose",
"qiskit.circuit.QuantumCircuit",
"numpy.array",
"numpy.array_equal",
"numpy.eye",
"numpy.delete"
] | [((3313, 3337), 'qiskit.circuit.QuantumCircuit', 'QuantumCircuit', (['n_qubits'], {}), '(n_qubits)\n', (3327, 3337), False, 'from qiskit.circuit import QuantumCircuit\n'), ((8885, 8900), 'numpy.array', 'np.array', (['state'], {}), '(state)\n', (8893, 8900), True, 'import numpy as np\n'), ((9014, 9033), 'numpy.transpose... |
import argparse
import os
import numpy as np
import tensorflow as tf
import tqdm
import yaml
from mixmatch import mixmatch_ot,mixmatch, semi_loss,linear_rampup,interleave,weight_decay,ema
from model import WideResNet
from preprocess import fetch_dataset
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_gr... | [
"numpy.load",
"yaml.load",
"mixmatch.linear_rampup",
"argparse.ArgumentParser",
"tensorflow.compat.v1.InteractiveSession",
"tensorflow.keras.metrics.Mean",
"tensorflow.Variable",
"os.path.join",
"mixmatch.interleave",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"mixmatch.ema",
"tensorfl... | [((266, 292), 'tensorflow.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ([], {}), '()\n', (290, 292), True, 'import tensorflow as tf\n'), ((342, 388), 'tensorflow.compat.v1.InteractiveSession', 'tf.compat.v1.InteractiveSession', ([], {'config': 'config'}), '(config=config)\n', (373, 388), True, 'import tensorflow... |
# Author: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.testing import assert_allclose
from nose.tools import assert_raises, assert_equal, assert_true
import warnings
from mne.io import read_info, Raw
from mne.io.chpi import _rot_to_quat, _quat_to_rot, get_chpi_positi... | [
"warnings.simplefilter",
"numpy.eye",
"mne.utils._TempDir",
"mne.io.Raw",
"os.path.dirname",
"mne.io.chpi._rot_to_quat",
"mne.utils.run_tests_if_main",
"mne.datasets.testing.data_path",
"mne.io.chpi.get_chpi_positions",
"warnings.catch_warnings",
"nose.tools.assert_raises",
"mne.io.read_info",... | [((489, 522), 'os.path.join', 'op.join', (['base_dir', '"""test_raw.fif"""'], {}), "(base_dir, 'test_raw.fif')\n", (496, 522), True, 'import os.path as op\n'), ((535, 572), 'os.path.join', 'op.join', (['base_dir', '"""test_ctf_raw.fif"""'], {}), "(base_dir, 'test_ctf_raw.fif')\n", (542, 572), True, 'import os.path as o... |
import numpy as np
import matplotlib.pyplot as plt
import sys
import time
from dataclasses import dataclass
testdir = sys.argv[1]
filebase = sys.argv[2]
wallfile = sys.argv[3]
tsave = int(sys.argv[4])
tfinal = int(sys.argv[5])
R = 1.0
NT = int(tfinal/tsave);
theta = np.linspace(0,2*np.pi,100);
xcirc = R*np... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ioff",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.gca",
"time.sleep",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.linspace",
"numpy.cos"
] | [((280, 310), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(100)'], {}), '(0, 2 * np.pi, 100)\n', (291, 310), True, 'import numpy as np\n'), ((365, 378), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (375, 378), True, 'import matplotlib.pyplot as plt\n'), ((380, 389), 'matplotlib.pyplot... |
# Importing libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# lightgbm for classification
from numpy import mean
from numpy import std
#from sklearn.datasets import make_classification
from lightgbm import LGBMClassifier
from sklearn.model_selection import cross_va... | [
"lightgbm.LGBMClassifier",
"pandas.read_csv",
"pandas.get_dummies",
"sklearn.model_selection.train_test_split",
"sklearn.model_selection.RepeatedStratifiedKFold",
"sklearn.model_selection.cross_val_score",
"sklearn.metrics.accuracy_score",
"joblib.dump",
"numpy.std",
"numpy.mean",
"pandas.Series... | [((446, 478), 'pandas.read_csv', 'pd.read_csv', (["(path + '/train.csv')"], {}), "(path + '/train.csv')\n", (457, 478), True, 'import pandas as pd\n'), ((486, 517), 'pandas.read_csv', 'pd.read_csv', (["(path + '/test.csv')"], {}), "(path + '/test.csv')\n", (497, 517), True, 'import pandas as pd\n'), ((1139, 1167), 'pan... |
'''
Etant donnée une liste d'accords, les trie par ordre de concordance, consonance, tension et concordance totale,
en affichant en dessous les valeurs. Prend en entrée dans le fichier paramètre deux listes de même taille : partiels,
qui contient l'emplacement des partiels (éventuellement inharmoniques), et amplitude... | [
"numpy.sum",
"numpy.log2",
"numpy.ones",
"numpy.shape",
"operator.attrgetter",
"numpy.mean",
"numpy.arange",
"numpy.exp"
] | [((2425, 2448), 'numpy.arange', 'np.arange', (['(0)', '(16)', '(0.001)'], {}), '(0, 16, 0.001)\n', (2434, 2448), True, 'import numpy as np\n'), ((6809, 6819), 'numpy.mean', 'np.mean', (['l'], {}), '(l)\n', (6816, 6819), True, 'import numpy as np\n'), ((6978, 6988), 'numpy.mean', 'np.mean', (['l'], {}), '(l)\n', (6985, ... |
"""
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | [
"numpy.sum",
"numpy.errstate",
"numpy.diag",
"numpy.delete",
"numpy.nanmean"
] | [((3867, 3887), 'numpy.diag', 'np.diag', (['conf_matrix'], {}), '(conf_matrix)\n', (3874, 3887), True, 'import numpy as np\n'), ((3913, 3935), 'numpy.sum', 'np.sum', (['conf_matrix', '(0)'], {}), '(conf_matrix, 0)\n', (3919, 3935), True, 'import numpy as np\n'), ((3977, 3999), 'numpy.sum', 'np.sum', (['conf_matrix', '(... |
# -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the ... | [
"mindspore.train.callback.CheckpointConfig",
"vega.common.ClassFactory.register",
"os.makedirs",
"mindspore.train.callback.ModelCheckpoint",
"os.path.isdir",
"os.path.exists",
"mindspore.train.callback.LossMonitor",
"mindspore.train.Model",
"time.sleep",
"numpy.argsort",
"logging.info",
"pycoc... | [((1255, 1282), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1272, 1282), False, 'import logging\n'), ((4237, 4277), 'vega.common.ClassFactory.register', 'ClassFactory.register', (['ClassType.TRAINER'], {}), '(ClassType.TRAINER)\n', (4258, 4277), False, 'from vega.common import ClassFa... |
import argparse
import os
import numpy as np
task_name = ['MNLI', 'QNLI', 'QQP', 'RTE', 'SST-2', 'MRPC', 'CoLA', 'STS-B']
dataset_dir_name = ['MNLI-bin', 'QNLI-bin', 'QQP-bin',
'RTE-bin', 'SST-2-bin', 'MRPC-bin',
'CoLA-bin', 'STS-B-bin']
num_classes = [3,2,2,2,2,2,2,1]
lrs = ... | [
"numpy.random.randint",
"os.system",
"argparse.ArgumentParser"
] | [((593, 618), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (616, 618), False, 'import argparse\n'), ((1176, 1208), 'numpy.random.randint', 'np.random.randint', (['(0)', '(1000000000)'], {}), '(0, 1000000000)\n', (1193, 1208), True, 'import numpy as np\n'), ((2396, 2410), 'os.system', 'os.syst... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw
# https://stackoverflow.com/questions/52540037/create-image-using-matplotlib-imshow-meshgrid-and-custom-colors
def flow_to_rgb(flows):
"""
Convert a flow to a rgb value
Args:
flows: (N, 3) vector flow
... | [
"cv2.cartToPolar",
"matplotlib.pyplot.show",
"cv2.cvtColor",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.reshape",
"numpy.linspace",
"cv2.normalize"
] | [((533, 581), 'numpy.zeros', 'np.zeros', (['(flows.shape[0], 1, 3)'], {'dtype': 'np.uint8'}), '((flows.shape[0], 1, 3), dtype=np.uint8)\n', (541, 581), True, 'import numpy as np\n'), ((620, 665), 'cv2.cartToPolar', 'cv2.cartToPolar', (['flows[..., 0]', 'flows[..., 1]'], {}), '(flows[..., 0], flows[..., 1])\n', (635, 66... |
from __future__ import division
import os.path
import numpy as np
import scipy.stats
import matplotlib
matplotlib.use('Agg')
matplotlib.rc('font',family='serif')
import matplotlib.pyplot as plt
from covar import cov_shrink_ss, cov_shrink_rblw
DIRNAME = os.path.dirname(os.path.realpath(__file__))
def test_1():
ra... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.rc",
"numpy.eye",
"matplotlib.pyplot.legend",
"numpy.zeros",
"numpy.random.RandomState",
"matplotlib.pyplot.figtext",
"numpy.linalg.eigvalsh",
"matplotlib.pyplot.figure",
"matplotlib.use",
"numpy.arange",
"covar.cov_shrink_s... | [((103, 124), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (117, 124), False, 'import matplotlib\n'), ((125, 162), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (138, 162), False, 'import matplotlib\n'), ((327, 351), 'numpy.random.R... |
"""
Training with OCCD and testing with CCD.
Email: <EMAIL>
Dtd: 2 - August - 2020
Parameters
----------
classification_type : string
DESCRIPTION - classification_type == "binary_class" loads binary classification artificial data.
classification_type == "multi_class" loads multiclass artificial data
... | [
"numpy.save",
"os.makedirs",
"os.getcwd",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.classification_report",
"sklearn.metrics.f1_score",
"numpy.max",
"sklearn.svm.LinearSVC",
"sklearn.metrics.confusion_matrix",
"ChaosFEX.feature_extractor.transform",
"numpy.unique",
"load_data_syntheti... | [((1934, 1945), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1943, 1945), False, 'import os\n'), ((2434, 2468), 'load_data_synthetic.get_data', 'get_data', (['classification_type_test'], {}), '(classification_type_test)\n', (2442, 2468), False, 'from load_data_synthetic import get_data\n'), ((2554, 2589), 'load_data_sy... |
# Copyright 2020 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... | [
"mindspore.dataset.PaddedDataset",
"numpy.sum",
"math.ceil",
"os.path.isdir",
"mindspore.dataset.transforms.c_transforms.TypeCast",
"mindspore.dataset.MindDataset",
"numpy.zeros",
"mindspore.dataset.GeneratorDataset",
"numpy.array",
"numpy.reshape",
"mindspore.dataset.TFRecordDataset",
"mindsp... | [((3353, 3373), 'os.listdir', 'os.listdir', (['data_dir'], {}), '(data_dir)\n', (3363, 3373), False, 'import os\n'), ((3538, 3890), 'mindspore.dataset.TFRecordDataset', 'ds.TFRecordDataset', (['data_files', "(schema_dir if schema_dir != '' else None)"], {'columns_list': "['input_ids', 'input_mask', 'segment_ids', 'next... |
from astropy.io import fits
import numpy as np
from . import wcs
#import wcs
class FitsImage(wcs.WCS):
def __init__(self,*args,extension=0):
self.img=None
self.hdr=None
if len(args) !=0:
if isinstance(args[0],str):
filename=args[0]
with fits.ope... | [
"astropy.io.fits.HDUList",
"astropy.io.fits.PrimaryHDU",
"astropy.io.fits.open",
"numpy.clip"
] | [((1319, 1348), 'numpy.clip', 'np.clip', (['x0', '(0)', 'self.naxis[0]'], {}), '(x0, 0, self.naxis[0])\n', (1326, 1348), True, 'import numpy as np\n'), ((1358, 1387), 'numpy.clip', 'np.clip', (['x1', '(0)', 'self.naxis[0]'], {}), '(x1, 0, self.naxis[0])\n', (1365, 1387), True, 'import numpy as np\n'), ((1397, 1426), 'n... |
import numpy as np
import scipy.stats as stats
from pyDOE import lhs
class GaussianInputs:
'A class for Gaussian inputs'
def __init__(self, mean, cov, domain, dim):
self.mean = mean
self.cov = cov
self.domain = domain
self.dim = dim
def sampling(self, num, lh=True, criteri... | [
"pyDOE.lhs",
"numpy.random.multivariate_normal",
"scipy.stats.multivariate_normal"
] | [((367, 406), 'pyDOE.lhs', 'lhs', (['self.dim', 'num'], {'criterion': 'criterion'}), '(self.dim, num, criterion=criterion)\n', (370, 406), False, 'from pyDOE import lhs\n'), ((509, 564), 'numpy.random.multivariate_normal', 'np.random.multivariate_normal', (['self.mean', 'self.cov', 'num'], {}), '(self.mean, self.cov, n... |
import numpy
data=numpy.loadtxt(fname='../data/inflammation-01.csv',
delimiter=',')
from matplotlib import pyplot as plt
figure = plt.figure(figsize=(7.0, 3.0))
figure.add_axes([0,0,1,1])
figure.axes[0].imshow(data)
figure.savefig('image.png')
range_over_days = plt.figure(figsize=(7.0, 3.0))
subplot_average... | [
"matplotlib.pyplot.figure",
"numpy.loadtxt"
] | [((19, 84), 'numpy.loadtxt', 'numpy.loadtxt', ([], {'fname': '"""../data/inflammation-01.csv"""', 'delimiter': '""","""'}), "(fname='../data/inflammation-01.csv', delimiter=',')\n", (32, 84), False, 'import numpy\n'), ((140, 170), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(7.0, 3.0)'}), '(figsize=(7.0... |
from __future__ import print_function
from random import shuffle
import keras # Biblioteca para deep learning - Utilizando tensorflow como backend
import random
import glob
import os
import os.path
import sys
import numpy as np
# Concatenação na variavel de sistema pythonPath para suportar a biblioteca pandas
#sys.path... | [
"numpy.random.seed",
"keras.layers.Activation",
"keras.layers.Dropout",
"keras.layers.Conv1D",
"keras.layers.Dense",
"numpy.array",
"keras.layers.Embedding",
"keras.models.Sequential",
"keras.layers.GlobalMaxPooling1D"
] | [((6955, 6972), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (6969, 6972), True, 'import numpy as np\n'), ((2587, 2599), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (2597, 2599), False, 'from keras.models import Sequential, Model\n'), ((3112, 3172), 'keras.layers.Embedding', 'Embedding'... |
#! -*- coding:utf-8 -*-
import os
import re
import gc
import sys
import json
import codecs
import random
import warnings
import numpy as np
import pandas as pd
from tqdm import tqdm
from random import choice
import tensorflow as tf
import matplotlib.pyplot as plt
from collections import Counter
from sklearn.model_selec... | [
"numpy.random.seed",
"numpy.argmax",
"pandas.read_csv",
"keras.backend.epsilon",
"sklearn.preprocessing.MinMaxScaler",
"tqdm.tqdm.pandas",
"keras.models.Model",
"gc.collect",
"pandas.DataFrame",
"codecs.open",
"keras_bert.load_trained_model_from_checkpoint",
"tensorflow.set_random_seed",
"ra... | [((809, 822), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {}), '()\n', (820, 822), False, 'from tqdm import tqdm\n'), ((835, 852), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (846, 852), False, 'import random\n'), ((853, 877), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['seed'], {}), '(seed)\n', (87... |
# this code is made and distributed by RedScorpion
# need help? contact me on discord RedScorpion#5785
# for visual toturial, open this link on your browser
# https://www.youtube.com/watch?v=g7m6EBFWzKM
# for documentation, open this link on your browser
# https://github.com/redscorpionx/wolves/
import pyautog... | [
"win32api.SetCursorPos",
"time.sleep",
"numpy.random.randint",
"pyautogui.pixel",
"win32api.mouse_event"
] | [((418, 431), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (428, 431), False, 'import time\n'), ((527, 551), 'win32api.SetCursorPos', 'win.SetCursorPos', (['(x, y)'], {}), '((x, y))\n', (543, 551), True, 'import win32api as win\n'), ((557, 609), 'win32api.mouse_event', 'win.mouse_event', (['win32con.MOUSEEVENTF_... |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import torchvision
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.autograd import Variable
import torch.utils.data as data_utils
import numpy as np
import matplotlib.pyplot as plt
f... | [
"matplotlib.pyplot.tight_layout",
"numpy.load",
"matplotlib.pyplot.show",
"wavelets_pytorch_2.alltorch.wavelets.Paul",
"torch.utils.data.DataLoader",
"torch.load",
"unet_network.UNet",
"torch.utils.data.TensorDataset",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"wavelets_pytorch_2.alltorch.... | [((902, 911), 'wavelets_pytorch_2.alltorch.wavelets.Paul', 'Paul', ([], {'m': '(8)'}), '(m=8)\n', (906, 911), False, 'from wavelets_pytorch_2.alltorch.wavelets import Morlet, Ricker, DOG, Paul\n'), ((920, 946), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': '(150)'}), '(0, 1, num=150)\n', (931, 946), True, '... |
# 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 agree... | [
"numpy.sum",
"os.makedirs",
"argparse.ArgumentParser",
"numpy.argmax",
"numpy.expand_dims",
"numpy.nonzero",
"os.path.join",
"os.listdir",
"numpy.concatenate"
] | [((2116, 2190), 'numpy.expand_dims', 'np.expand_dims', (['(predictions_with_boxes[:, :, 4] > confidence_threshold)', '(-1)'], {}), '(predictions_with_boxes[:, :, 4] > confidence_threshold, -1)\n', (2130, 2190), True, 'import numpy as np\n'), ((3878, 3903), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}),... |
import numpy as np
from keras.utils import np_utils
import time
from datetime import timedelta
from sklearn.naive_bayes import GaussianNB
from sklearn.externals import joblib
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
import argparse
import math
import dataset_traditi... | [
"sklearn.naive_bayes.GaussianNB",
"argparse.ArgumentParser",
"numpy.argmax",
"sklearn.metrics.classification_report",
"keras.utils.np_utils.to_categorical",
"time.monotonic",
"datetime.timedelta",
"sklearn.metrics.confusion_matrix"
] | [((505, 543), 'keras.utils.np_utils.to_categorical', 'np_utils.to_categorical', (['y', 'nb_classes'], {}), '(y, nb_classes)\n', (528, 543), False, 'from keras.utils import np_utils\n'), ((639, 651), 'sklearn.naive_bayes.GaussianNB', 'GaussianNB', ([], {}), '()\n', (649, 651), False, 'from sklearn.naive_bayes import Gau... |
#-*- coding:utf-8 -*-
import os
import numpy as np
from scipy.spatial import distance
from variables import POS_TAGS, APPS
from variables import DUPLICATES_CLUSTER_PATH, DUPLICATES_CLUSTER_IMG_PATH
from util_db import select_cluster_combine_tag
from util_db import select_cluster_id_txt, select_cluster_id_img
from uti... | [
"util_db.select_cluster_combine_tag",
"util_pagerank.pageRank",
"scipy.spatial.distance.euclidean",
"util_hist.preprocess_line",
"util_db.select_cluster_id_txt",
"util_pagerank.graphMove",
"util_pagerank.firstPr",
"util_hist.read_hist_img",
"numpy.array",
"util_db.select_cluster_txt_tag",
"util_... | [((1182, 1200), 'util_hist.read_hist_img', 'read_hist_img', (['app'], {}), '(app)\n', (1195, 1200), False, 'from util_hist import read_hist_img, get_img_pos\n'), ((1213, 1236), 'util_hist.get_img_pos', 'get_img_pos', (['img_name_a'], {}), '(img_name_a)\n', (1224, 1236), False, 'from util_hist import read_hist_img, get_... |
import torch
import numpy as np
import yaml, pickle, os, math
from random import shuffle
#from Pattern_Generator import Pattern_Generate
from Pattern_Generator import Pattern_Generate
with open('Hyper_Parameter.yaml') as f:
hp_Dict = yaml.load(f, Loader=yaml.Loader)
class Train_Dataset(torch.utils.data.Dataset):
... | [
"numpy.stack",
"numpy.random.uniform",
"yaml.load",
"numpy.pad",
"numpy.ceil",
"numpy.floor",
"torch.FloatTensor",
"time.sleep",
"numpy.random.randint",
"Pattern_Generator.Pattern_Generate",
"torch.nn.functional.interpolate",
"os.path.join",
"numpy.vstack"
] | [((239, 271), 'yaml.load', 'yaml.load', (['f'], {'Loader': 'yaml.Loader'}), '(f, Loader=yaml.Loader)\n', (248, 271), False, 'import yaml, pickle, os, math\n'), ((3251, 3284), 'Pattern_Generator.Pattern_Generate', 'Pattern_Generate', (['source_Path', '(15)'], {}), '(source_Path, 15)\n', (3267, 3284), False, 'from Patter... |
"""
July 2021
<NAME>, <EMAIL>
<NAME>, <EMAIL>
3D Shape Analysis Lab
Department of Computer Science and Engineering
Ulsan National Institute of Science and Technology
"""
import numpy as np
from joblib import Parallel, delayed
from scipy.spatial import cKDTree as KDTree
from scipy.sparse import coo_matrix
class Tri... | [
"numpy.absolute",
"scipy.sparse.coo_matrix.sum",
"numpy.arctan2",
"numpy.sum",
"numpy.floor",
"numpy.sin",
"numpy.linalg.norm",
"numpy.arange",
"scipy.spatial.cKDTree",
"numpy.unique",
"numpy.multiply",
"numpy.power",
"numpy.finfo",
"numpy.repeat",
"numpy.cross",
"numpy.hstack",
"num... | [((3548, 3570), 'numpy.cross', 'np.cross', (['(a - b)', '(a - c)'], {}), '(a - b, a - c)\n', (3556, 3570), True, 'import numpy as np\n'), ((3582, 3627), 'numpy.linalg.norm', 'np.linalg.norm', (['normal'], {'axis': '(1)', 'keepdims': '(True)'}), '(normal, axis=1, keepdims=True)\n', (3596, 3627), True, 'import numpy as n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# by TR
"""
stack and plot rfs by azimuth
"""
from sito import read, imaging
from glob import glob
import matplotlib.pyplot as plt
from matplotlib import colors
import numpy as np
from matplotlib.colorbar import ColorbarBase
path = '/home/richter/Results/IPOC/receiver/201... | [
"matplotlib.colors.Normalize",
"matplotlib.pyplot.close",
"sito.imaging.getFigure",
"numpy.arange",
"glob.glob",
"matplotlib.colorbar.ColorbarBase",
"sito.read"
] | [((586, 695), 'sito.imaging.getFigure', 'imaging.getFigure', (['axes'], {'width': '(15.0)', 'margin': 'margin', 'ratio': 'ratio', 'fontsize': '(12)', 'labelsize': '"""small"""'}), "(axes, width=15.0, margin=margin, ratio=ratio, fontsize=12,\n labelsize='small', **kwargs)\n", (603, 695), False, 'from sito import read... |
"""ODIN data live view adapter.
This module implements an odin-control adapter capable of rendering odin-data live
view images to users.
Created on 8th October 2018
:author: <NAME>, STFC Application Engineering Gruop
"""
import logging
import re
from collections import OrderedDict
import numpy as np
import cv2
from... | [
"logging.debug",
"re.split",
"logging.warning",
"numpy.dtype",
"tornado.escape.json_decode",
"numpy.clip",
"cv2.imencode",
"numpy.arange",
"cv2.applyColorMap",
"odin.adapters.adapter.ApiAdapterResponse",
"collections.OrderedDict",
"odin_data.ipc_tornado_channel.IpcTornadoChannel",
"odin.adap... | [((1897, 1970), 'odin.adapters.adapter.response_types', 'response_types', (['"""application/json"""', '"""image/*"""'], {'default': '"""application/json"""'}), "('application/json', 'image/*', default='application/json')\n", (1911, 1970), False, 'from odin.adapters.adapter import ApiAdapter, ApiAdapterResponse, respons... |
import argparse
import os
import pickle as pkl
import numpy as np
import torch
from statsmodels.tsa.arima_process import ArmaProcess
from attribution.mask_group import MaskGroup
from attribution.perturbation import GaussianBlur
from baselines.explainers import FO, FP, IG, SVS
from utils.losses import mse
explainers ... | [
"pickle.dump",
"numpy.random.seed",
"argparse.ArgumentParser",
"baselines.explainers.SVS",
"numpy.arange",
"os.path.join",
"os.path.exists",
"baselines.explainers.FO",
"torch.zeros",
"statsmodels.tsa.arima_process.ArmaProcess",
"baselines.explainers.IG",
"baselines.explainers.FP",
"torch.man... | [((1213, 1243), 'torch.manual_seed', 'torch.manual_seed', (['random_seed'], {}), '(random_seed)\n', (1230, 1243), False, 'import torch\n'), ((1248, 1275), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (1262, 1275), True, 'import numpy as np\n'), ((1287, 1314), 'attribution.perturbatio... |
"""Evaluate multiple models in multiple experiments, or evaluate baseline on multiple datasets
TODO: use hydra or another model to manage the experiments
"""
import os
import sys
import json
import argparse
import logging
from glob import glob
import time
import string
logging.basicConfig(format='%(asctime)s: %(leve... | [
"utility.AttrDict",
"pandas.HDFStore",
"argparse.ArgumentParser",
"numpy.around",
"numpy.mean",
"numpy.linalg.norm",
"numpy.arange",
"glob.glob",
"torch.no_grad",
"pandas.set_option",
"pandas.DataFrame",
"logging.warning",
"matplotlib.pyplot.close",
"dill.load",
"numpy.max",
"matplotli... | [((273, 367), '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)\n", (292, 367), False, 'import logging\n'), ((845, 892), 'pandas.set_option', 'pd.set_opti... |
import os
import sys
from copy import deepcopy
import time
import random
import numpy as np
import itertools
# Adding project folder to import modules
import mod.env.Point
root = os.getcwd().replace("\\", "/")
sys.path.append(root)
from mod.env.matching import (
service_trips,
optimal_rebalancing,
play_d... | [
"numpy.load",
"mod.env.matching.service_trips",
"mod.env.visual.EpisodeLog",
"mod.env.adp.adp.AggLevel",
"sys.path.append",
"mod.env.demand.trip_util.get_ny_demand",
"mod.env.demand.trip_util.get_trip_count_step",
"mod.env.config.get_file_paths",
"mod.env.demand.trip_util.get_df_from_sampled_trips",... | [((212, 233), 'sys.path.append', 'sys.path.append', (['root'], {}), '(root)\n', (227, 233), False, 'import sys\n'), ((918, 932), 'random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (929, 932), False, 'import random\n'), ((982, 997), 'mod.env.config.ConfigNetwork', 'ConfigNetwork', ([], {}), '()\n', (995, 997), False,... |
import os
import csv
import cv2
import numpy as np
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from keras.models import Sequential
from keras.layers import Dense,Dropout,Flatten,Conv2D,MaxPooling2D,Lambda,Cropping2D
from keras.callbacks import LearningRateScheduler
def learning_rate(epoch):
re... | [
"matplotlib.pyplot.title",
"csv.reader",
"keras.layers.Cropping2D",
"keras.callbacks.LearningRateScheduler",
"cv2.cvtColor",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"keras.layers.Dropout",
"matplotlib.pyplot.legend",
"numpy.fliplr",
"keras.layers.Conv2D",
"matplotlib.pyplot.ylabel... | [((1361, 1377), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (1369, 1377), True, 'import numpy as np\n'), ((1388, 1404), 'numpy.array', 'np.array', (['angles'], {}), '(angles)\n', (1396, 1404), True, 'import numpy as np\n'), ((1422, 1447), 'sklearn.utils.shuffle', 'shuffle', (['X_train', 'y_train'], {}), ... |
# coding=utf-8
# Copyright 2022 The Google Research 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 by applicab... | [
"numpy.load",
"os.path.abspath",
"scann_pybind.ScannNumpy",
"os.path.isfile",
"scann.scann_ops.py.scann_builder.ScannBuilder",
"os.path.join"
] | [((3354, 3413), 'scann_pybind.ScannNumpy', 'scann_pybind.ScannNumpy', (['db', 'scann_config', 'training_threads'], {}), '(db, scann_config, training_threads)\n', (3377, 3413), False, 'import scann_pybind\n'), ((3574, 3611), 'os.path.join', 'os.path.join', (['artifacts_dir', 'filename'], {}), '(artifacts_dir, filename)\... |
# taken from http://hyperphysics.phy-astr.gsu.edu/hbase/phyopt/antiref.html#c1
import numpy
import pylab
import EMpy_gpu
# define multilayer
n = numpy.array([1., 1.38, 1.9044])
d = numpy.array([numpy.inf, 387.5e-9 / 1.38, numpy.inf])
iso_layers = EMpy_gpu.utils.Multilayer()
for i in xrange(n.size):
n0 = EMpy_gpu... | [
"EMpy_gpu.utils.deg2rad",
"pylab.title",
"pylab.show",
"pylab.ylabel",
"pylab.grid",
"EMpy_gpu.utils.Multilayer",
"pylab.savefig",
"EMpy_gpu.materials.IsotropicMaterial",
"numpy.array",
"pylab.figure",
"numpy.linspace",
"pylab.xlabel",
"EMpy_gpu.transfer_matrix.IsotropicTransferMatrix",
"E... | [((148, 180), 'numpy.array', 'numpy.array', (['[1.0, 1.38, 1.9044]'], {}), '([1.0, 1.38, 1.9044])\n', (159, 180), False, 'import numpy\n'), ((184, 237), 'numpy.array', 'numpy.array', (['[numpy.inf, 3.875e-07 / 1.38, numpy.inf]'], {}), '([numpy.inf, 3.875e-07 / 1.38, numpy.inf])\n', (195, 237), False, 'import numpy\n'),... |
import os
import sys
import warnings
import typing
import time
import keras
import keras.preprocessing.image
import tensorflow as tf
import pandas as pd
import numpy as np
from object_detection_retinanet import layers
from object_detection_retinanet import losses
from object_detection_retinanet import models
from ... | [
"os.path.join",
"pandas.DataFrame",
"keras.optimizers.adam",
"os.path.dirname",
"object_detection_retinanet.models.backbone",
"object_detection_retinanet.models.retinanet.retinanet_bbox",
"d3m.container.DataFrame",
"keras.callbacks.ReduceLROnPlateau",
"pandas.concat",
"object_detection_retinanet.u... | [((8002, 8029), 'pandas.Series', 'pd.Series', (['self.image_paths'], {}), '(self.image_paths)\n', (8011, 8029), True, 'import pandas as pd\n'), ((8431, 8469), 'pandas.Series', 'pd.Series', (["(['class'] * inputs.shape[0])"], {}), "(['class'] * inputs.shape[0])\n", (8440, 8469), True, 'import pandas as pd\n'), ((8534, 8... |
# Copyright 2020 Verily Life Sciences LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Utilities for simulating recruitment and infection of trial participants."""
# I know you mean well, pytype... | [
"jax.numpy.where",
"jax.numpy.einsum",
"bsst.sim_scenarios.get_incidence_flattened",
"xarray.where",
"xarray.ones_like",
"jax.numpy.concatenate",
"bsst.sim_scenarios.generate_scenarios_independently",
"xarray.concat",
"jax.numpy.triu_indices_from",
"flax.nn.sigmoid",
"numpy.issubdtype",
"jax.n... | [((1770, 1804), 'numpy.searchsorted', 'np.searchsorted', (['cumsum', 'threshold'], {}), '(cumsum, threshold)\n', (1785, 1804), True, 'import numpy as np\n'), ((2188, 2203), 'xarray.ones_like', 'xr.ones_like', (['x'], {}), '(x)\n', (2200, 2203), True, 'import xarray as xr\n'), ((2761, 2788), 'jax.numpy.where', 'jnp.wher... |
import pandas as pd
import numpy as np
# import matplotlib.pyplot as plt
# import seaborn as sns
# import all models
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
import sklearn.model_selection as model_selection... | [
"sklearn.ensemble.RandomForestClassifier",
"lightgbm.LGBMClassifier",
"warnings.filterwarnings",
"pandas.read_csv",
"sklearn.model_selection.cross_val_score",
"sklearn.model_selection.RepeatedStratifiedKFold",
"sklearn.tree.DecisionTreeClassifier",
"numpy.mean",
"xgboost.XGBClassifier"
] | [((440, 473), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (463, 473), False, 'import warnings\n'), ((2687, 2716), 'pandas.read_csv', 'pd.read_csv', (['"""data/train.csv"""'], {}), "('data/train.csv')\n", (2698, 2716), True, 'import pandas as pd\n'), ((2728, 2756), 'pand... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
from itertools import islice
import numbers
import numpy as np
import os
import pa... | [
"pandas.DataFrame",
"pyiron_contrib.atomistics.mlip.cfgs.Cfg",
"pyiron_base.Executable",
"os.path.join",
"os.path.basename",
"os.path.exists",
"pyiron_contrib.atomistics.mlip.cfgs.loadcfgs",
"pandas.itertuples",
"posixpath.join",
"numpy.array",
"pyiron_contrib.atomistics.mlip.cfgs.savecfgs",
"... | [((943, 953), 'pyiron_base.Settings', 'Settings', ([], {}), '()\n', (951, 953), False, 'from pyiron_base import Settings, GenericParameters, GenericJob, Executable, FlattenedStorage\n'), ((26579, 26632), 'pyiron_contrib.atomistics.mlip.cfgs.savecfgs', 'savecfgs', ([], {'filename': 'file_name', 'cfgs': 'cfg_lst', 'desc'... |
import numpy as np
from torch.utils.data import Dataset
from fasttext import load_model
import os
import numpy as np
import torch
import h5py
import pickle
import re
import utils
from collections import Counter
from transformers import BertTokenizer
SENTENCE_SPLIT_REGEX = re.compile(r"(\W+)")
class InputFeatures(obje... | [
"h5py.File",
"numpy.save",
"re.compile",
"transformers.BertTokenizer.from_pretrained",
"numpy.array",
"torch.zeros",
"os.path.join",
"torch.tensor",
"torch.from_numpy"
] | [((274, 294), 're.compile', 're.compile', (['"""(\\\\W+)"""'], {}), "('(\\\\W+)')\n", (284, 294), False, 'import re\n'), ((8184, 8236), 'os.path.join', 'os.path.join', (['dataroot', "('imdb_textvqa_%s.npy' % name)"], {}), "(dataroot, 'imdb_textvqa_%s.npy' % name)\n", (8196, 8236), False, 'import os\n'), ((6658, 6715), ... |
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: <EMAIL>
@Software: PyCharm
@File: 4.5_ImplementMultiClassSVM.py
@Time: 2019/1/6 下午5:39
@Overview: Use SVMs to categorize multiple classes instead of two.
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
from te... | [
"matplotlib.pyplot.title",
"sklearn.datasets.load_iris",
"tensorflow.reduce_sum",
"tensorflow.reshape",
"tensorflow.matmul",
"matplotlib.pyplot.figure",
"tensorflow.multiply",
"matplotlib.pyplot.contourf",
"numpy.arange",
"tensorflow.abs",
"tensorflow.subtract",
"tensorflow.placeholder",
"ma... | [((388, 400), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (398, 400), True, 'import tensorflow as tf\n'), ((522, 542), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (540, 542), False, 'from sklearn import datasets\n'), ((552, 595), 'numpy.array', 'np.array', (['[[x[0], x[3]] for x in i... |
# coding: utf-8
#
#def ceti_exp(
# GHZ_inner, GHZ_outer, tau_awakening, tau_survive, D_max, t_max
#):
##{{{
#
# import ceti_tools as ct
#
# random.seed(420)
# np.random.seed(420)
#
# # lista de CETIs alguna vez activas
# CETIs = dict()
#
# # lista de CETIs actualmente activas
# CHATs = []
# ... | [
"ceti_tools.ShowCETIs",
"io.StringIO",
"numpy.random.seed",
"ceti_tools.OrderedList",
"numpy.random.exponential",
"random.random",
"importlib.reload",
"numpy.sin",
"random.seed",
"numpy.array",
"numpy.cos",
"scipy.spatial.cKDTree"
] | [((6661, 6671), 'importlib.reload', 'reload', (['ct'], {}), '(ct)\n', (6667, 6671), False, 'from importlib import reload\n'), ((6835, 6851), 'random.seed', 'random.seed', (['(420)'], {}), '(420)\n', (6846, 6851), False, 'import random\n'), ((6852, 6871), 'numpy.random.seed', 'np.random.seed', (['(420)'], {}), '(420)\n'... |
import os
import json
import numpy as np
from uninas.optimization.benchmarks.mini.tabular import MiniNASTabularBenchmark, explore, plot
from uninas.optimization.benchmarks.mini.result import MiniResult
from uninas.optimization.hpo.uninas.values import DiscreteValues, ValueSpace
from uninas.utils.paths import replace_st... | [
"uninas.utils.parsing.tensorboard_.find_tb_files",
"json.load",
"uninas.optimization.benchmarks.mini.tabular.plot",
"uninas.optimization.benchmarks.mini.result.MiniResult.merge_result_list",
"os.path.dirname",
"uninas.builder.Builder",
"uninas.utils.paths.replace_standard_paths",
"uninas.utils.torch.s... | [((633, 680), 'uninas.register.Register.benchmark_set', 'Register.benchmark_set', ([], {'mini': '(True)', 'tabular': '(True)'}), '(mini=True, tabular=True)\n', (655, 680), False, 'from uninas.register import Register\n'), ((5978, 5987), 'uninas.builder.Builder', 'Builder', ([], {}), '()\n', (5985, 5987), False, 'from u... |
"""
File: _advance.py
Author: <NAME>
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /My_AutoML/_feature_selection/_advance.py
File Created: Tuesday, 5th April 2022 11:36:15 pm
Author: <NAME> (<EMAIL... | [
"numpy.random.seed",
"numpy.abs",
"sklearn.feature_selection.RFE",
"My_AutoML._utils.t_score",
"numpy.isnan",
"numpy.argsort",
"numpy.mean",
"sklearn.svm.SVC",
"My_AutoML._utils._optimize.get_metrics",
"numpy.unique",
"My_AutoML._utils.minloc",
"pandas.DataFrame",
"My_AutoML._utils.Pearson_C... | [((16755, 16773), 'My_AutoML._utils.random_index', 'random_index', (['n', 'p'], {}), '(n, p)\n', (16767, 16773), False, 'from My_AutoML._utils import minloc, maxloc, True_index, Pearson_Corr, MI, t_score, ANOVA, random_index\n'), ((17067, 17075), 'My_AutoML._utils.MI', 'MI', (['X', 'y'], {}), '(X, y)\n', (17069, 17075)... |
import copy
import numpy as np
# There is problem with handling nan and inf values
# Ideally, we should use None but it cannot be sent through
# the interface. Maybe we should adjust add_values() to handle not passing
# the value to all the fields
INVALID_PLACEHOLDER = 1e+100
class LoggingManager:
def __init__(... | [
"numpy.isinf",
"numpy.isnan"
] | [((830, 841), 'numpy.isnan', 'np.isnan', (['v'], {}), '(v)\n', (838, 841), True, 'import numpy as np\n'), ((845, 856), 'numpy.isinf', 'np.isinf', (['v'], {}), '(v)\n', (853, 856), True, 'import numpy as np\n')] |
import copy
import numpy as np
from scipy.spatial.distance import cdist
import free_energy_clustering.GMM as GMM
from sklearn.mixture import GaussianMixture
import free_energy_clustering.cross_validation as CV
import free_energy_clustering as FEC
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mpl... | [
"matplotlib.rc",
"matplotlib.cm.get_cmap",
"numpy.ravel",
"free_energy_clustering.cross_validation.split_train_validation",
"sklearn.mixture.GaussianMixture",
"numpy.ones",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tick_params",
"free_energy_clustering.cross_validation.get_train_validation_set"... | [((6196, 6221), 'numpy.asarray', 'np.asarray', (['free_energies'], {}), '(free_energies)\n', (6206, 6221), True, 'import numpy as np\n'), ((8512, 8525), 'numpy.copy', 'np.copy', (['data'], {}), '(data)\n', (8519, 8525), True, 'import numpy as np\n'), ((8554, 8581), 'numpy.copy', 'np.copy', (['self.data_weights_'], {}),... |
from datetime import datetime
import os
import pickle
import argparse
import numpy as np
import torch
import torch.nn.functional as F
import utils
import models
def get_args():
parser = argparse.ArgumentParser()
utils.add_shared_args(parser)
parser.add_argument('--rm-idx-path', type=str, default=None)
... | [
"torch.cuda.synchronize",
"pickle.dump",
"argparse.ArgumentParser",
"utils.AverageMeter",
"utils.DataLoader",
"utils.DataSampler",
"torch.nn.functional.cross_entropy",
"datetime.datetime.now",
"numpy.where",
"utils.add_log",
"utils.get_mcmc_bnn_arch",
"numpy.array",
"pickle.load",
"utils.g... | [((193, 218), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (216, 218), False, 'import argparse\n'), ((223, 252), 'utils.add_shared_args', 'utils.add_shared_args', (['parser'], {}), '(parser)\n', (244, 252), False, 'import utils\n'), ((887, 907), 'utils.AverageMeter', 'utils.AverageMeter', ([]... |
# coding=utf-8
from __future__ import unicode_literals
import unittest
from datetime import datetime
import lore.encoders
import numpy
import pandas
import lore
class TestEquals(unittest.TestCase):
def setUp(self):
self.encoder = lore.encoders.Equals('left', 'right')
def test_equality(self):
... | [
"lore.encoders.Norm",
"numpy.mean",
"numpy.arange",
"lore.encoders.Enum",
"pandas.DataFrame",
"lore.encoders.Token",
"numpy.std",
"lore.encoders.Discrete",
"lore.encoders.NestedUnique",
"lore.encoders.NestedNorm",
"lore.encoders.Uniform",
"lore.encoders.MiddleOut",
"datetime.datetime",
"lo... | [((247, 284), 'lore.encoders.Equals', 'lore.encoders.Equals', (['"""left"""', '"""right"""'], {}), "('left', 'right')\n", (267, 284), False, 'import lore\n'), ((330, 402), 'pandas.DataFrame', 'pandas.DataFrame', (["{'left': [None, 1, 2, 2], 'right': [None, None, 1, 2]}"], {}), "({'left': [None, 1, 2, 2], 'right': [None... |
"""
Analytical equation of motions for a wind turbine using 1 degree of freedom:
- flexible fore-aft tower
"""
import numpy as np
import unittest
from sympy import Symbol
from sympy.physics.mechanics import dynamicsymbols
from sympy.parsing.sympy_parser import parse_expr
from welib.yams.models.FTNSB_sympy import g... | [
"unittest.main",
"sympy.Symbol",
"sympy.physics.mechanics.dynamicsymbols",
"numpy.set_printoptions",
"welib.yams.models.FTNSB_sympy.get_model",
"sympy.parsing.sympy_parser.parse_expr"
] | [((952, 1119), 'welib.yams.models.FTNSB_sympy.get_model', 'get_model', (['"""F0T1RNA"""'], {'mergeFndTwr': '(True)', 'yaw': '"""zero"""', 'tilt': '"""fixed"""', 'tiltShaft': '(False)', 'rot_elastic_type': '"""SmallRot"""', 'rot_elastic_smallAngle': '(True)', 'aero_torques': '(True)'}), "('F0T1RNA', mergeFndTwr=True, ya... |
import numpy as np
import pytest
from pandas import (
Timedelta,
timedelta_range,
to_timedelta,
)
import pandas._testing as tm
from pandas.tseries.offsets import (
Day,
Second,
)
class TestTimedeltas:
def test_timedelta_range(self):
expected = to_timedelta(np.arange(5), unit="D")
... | [
"pandas.timedelta_range",
"pandas.tseries.offsets.Day",
"pandas.tseries.offsets.Second",
"pytest.raises",
"pandas.to_timedelta",
"pandas._testing.assert_index_equal",
"numpy.arange",
"pandas.Timedelta",
"pytest.mark.parametrize"
] | [((1187, 1294), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""periods, freq"""', "[(3, '2D'), (5, 'D'), (6, '19H12T'), (7, '16H'), (9, '12H')]"], {}), "('periods, freq', [(3, '2D'), (5, 'D'), (6, '19H12T'\n ), (7, '16H'), (9, '12H')])\n", (1210, 1294), False, 'import pytest\n'), ((2304, 2605), 'pytest.... |
import numpy as np
from .BaseDeterioration import BaseDeterioration
class Markovian(BaseDeterioration):
def __init__(self, probs_list):
super().__init__()
"""
The probs_list must contains the transition probabilities of each state ti itself
A system of 5 states must have the probs_list of length equal to 5
... | [
"numpy.random.rand"
] | [((520, 536), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (534, 536), True, 'import numpy as np\n')] |
# adapt from https://github.com/bknyaz/graph_attention_pool/blob/master/graphdata.py
import numpy as np
import os.path as osp
import pickle
import torch
import torch.utils
import torch.utils.data
import torch.nn.functional as F
from scipy.spatial.distance import cdist
from torch_geometric.utils import dense_to_sparse
... | [
"scipy.spatial.distance.cdist",
"numpy.pad",
"numpy.diag_indices_from",
"torch.LongTensor",
"torch.load",
"torch.FloatTensor",
"numpy.ones",
"pickle.load",
"numpy.exp",
"torch.tensor",
"torch_geometric.utils.dense_to_sparse",
"os.path.join",
"numpy.concatenate",
"torch.from_numpy"
] | [((560, 579), 'scipy.spatial.distance.cdist', 'cdist', (['coord', 'coord'], {}), '(coord, coord)\n', (565, 579), False, 'from scipy.spatial.distance import cdist\n'), ((588, 624), 'numpy.exp', 'np.exp', (['(-dist / (sigma * np.pi) ** 2)'], {}), '(-dist / (sigma * np.pi) ** 2)\n', (594, 624), True, 'import numpy as np\n... |
from typing import Callable, Dict, List, Tuple, cast
import Operators as op
import Target as ta
import numpy as np
def toTarget(o: op.Target, weights: Dict[str,float]) -> ta.Target:
print("toTarget:", o)
terms : List[ta.Term] = []
parameters : Dict[str,float] = {}
init: Dict[str,Tuple[ta.Embedding, np.... | [
"Operators.extractOptTermOrCondition",
"Target.Target",
"Target.Max",
"numpy.sum",
"Target.Min",
"typing.cast",
"Target.Embedding",
"numpy.reshape"
] | [((789, 814), 'Target.Embedding', 'ta.Embedding', (['"""id"""', 'idMat'], {}), "('id', idMat)\n", (801, 814), True, 'import Target as ta\n'), ((3408, 3462), 'Target.Target', 'ta.Target', (['terms', 'bs', 'parameters', 'init', 'interpretation'], {}), '(terms, bs, parameters, init, interpretation)\n', (3417, 3462), True,... |
__author__ = '<NAME>, <EMAIL>'
#from .timeseries import AR1Environment
from pybrain.rl.environments.task import Task
from numpy import sign
from math import log
class MaximizeReturnTask(Task):
def getReward(self):
# TODO: make sure to check how to combine the returns (sum or product) depending on whethe... | [
"numpy.sign"
] | [((765, 783), 'numpy.sign', 'sign', (['latestAction'], {}), '(latestAction)\n', (769, 783), False, 'from numpy import sign\n'), ((784, 804), 'numpy.sign', 'sign', (['previousAction'], {}), '(previousAction)\n', (788, 804), False, 'from numpy import sign\n')] |
"""Example use of TwoAlternatingCSTRs unit operation.
In this example we simulate propagation of periodic inlet flow rate
and concentration profiles throughout the unit operation with two
alternating CSTRs. Afterwards we create a bunch of plots.
"""
import numpy as np
from bokeh.layouts import column
from bokeh.mod... | [
"numpy.zeros_like",
"bokeh.plotting.figure",
"numpy.zeros",
"numpy.arange",
"bokeh.models.LinearAxis",
"numpy.linspace",
"bio_rtd.uo.surge_tank.TwoAlternatingCSTRs",
"bokeh.layouts.column"
] | [((482, 507), 'numpy.linspace', 'np.linspace', (['(0)', '(100)', '(1001)'], {}), '(0, 100, 1001)\n', (493, 507), True, 'import numpy as np\n'), ((557, 589), 'bio_rtd.uo.surge_tank.TwoAlternatingCSTRs', 'TwoAlternatingCSTRs', (['t', '"""a2cstr"""'], {}), "(t, 'a2cstr')\n", (576, 589), False, 'from bio_rtd.uo.surge_tank ... |
#!/usr/bin/env python2
import sys
import rospy
import yaml
import numpy as np
from ROSInterface import ROSInterface
from MotorController import MotorController
class RoboticControl:
def __init__(self, t_cam2body):
self.ros_interface = ROSInterface(t_cam2body)
self.time_init = -1.0
max_speed = 0.3 # Param
m... | [
"yaml.load",
"ROSInterface.ROSInterface",
"numpy.asarray",
"rospy.Rate",
"rospy.get_param",
"MotorController.MotorController",
"rospy.is_shutdown",
"numpy.array",
"rospy.init_node"
] | [((241, 265), 'ROSInterface.ROSInterface', 'ROSInterface', (['t_cam2body'], {}), '(t_cam2body)\n', (253, 265), False, 'from ROSInterface import ROSInterface\n'), ((369, 406), 'MotorController.MotorController', 'MotorController', (['max_speed', 'max_omega'], {}), '(max_speed, max_omega)\n', (384, 406), False, 'from Moto... |
from typing import Counter
import cv2
import numpy as np
import mediapipe as mp
from numpy.core.defchararray import count
from numpy.lib.function_base import angle
from numpy.lib.type_check import imag
mp_draw = mp.solutions.drawing_utils
mp_hs = mp.solutions.holistic
mp_pose = mp.solutions.pose
cap = cv2.VideoCaptur... | [
"cv2.putText",
"numpy.abs",
"numpy.arctan2",
"numpy.multiply",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"cv2.VideoCapture",
"numpy.array",
"cv2.rectangle",
"cv2.flip",
"cv2.destroyAllWindows"
] | [((305, 324), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (321, 324), False, 'import cv2\n'), ((7155, 7178), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (7176, 7178), False, 'import cv2\n'), ((663, 681), 'cv2.flip', 'cv2.flip', (['frame', '(1)'], {}), '(frame, 1)\n', (671, 68... |
import tensorflow as tf
import random
import numpy as np
import math
"""implementation by <NAME> (https://github.com/ysmiao/nvdm), adapted with some additional methods by <NAME>"""
def data_set_y(data_url):
data = []
fin = open(data_url)
while True:
line = fin.readline()
if not line:
... | [
"numpy.maximum",
"tensorflow.constant_initializer",
"random.shuffle",
"numpy.zeros",
"math.floor",
"tensorflow.variable_scope",
"tensorflow.matmul",
"tensorflow.get_variable"
] | [((1756, 1794), 'numpy.maximum', 'np.maximum', (['len_labeled', 'len_unlabeled'], {}), '(len_labeled, len_unlabeled)\n', (1766, 1794), True, 'import numpy as np\n'), ((3119, 3150), 'math.floor', 'math.floor', (['(batch_size / n_clss)'], {}), '(batch_size / n_clss)\n', (3129, 3150), False, 'import math\n'), ((3667, 3701... |
import gym
import gym_panda
from gym_panda.wrapper_env.VAE import VAE
import torch
import tensorflow as tf
import numpy as np
import copy
import pickle
import gym_panda
from gym_panda.wrapper_env.wrapper import *
import pdb
import argparse
from itertools import count
import scipy.optimize
from models import *
from repl... | [
"numpy.random.seed",
"gym.make",
"pybullet.addUserDebugLine",
"torch.manual_seed",
"torch.load",
"numpy.array",
"pdb.set_trace",
"SAIL.models.ppo_models.Policy",
"torch.from_numpy"
] | [((818, 846), 'gym.make', 'gym.make', (['"""disabledpanda-v0"""'], {}), "('disabledpanda-v0')\n", (826, 846), False, 'import gym\n'), ((1356, 1379), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (1373, 1379), False, 'import torch\n'), ((1384, 1404), 'numpy.random.seed', 'np.random.seed', (['seed... |
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from mpl_toolkits.mplot3d import Axes3D
from sklearn.manifold import TSNE
csfont = {'fontname': 'Times New Roman'}
sns.set()
sns.set(rc={"figure.figsize": (10, 8)})
resr = np.array([[0, 2], ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"seaborn.set_style",
"mpl_toolkits.mplot3d.Axes3D",
"sklearn.manifold.TSNE",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.figure",
"numpy.diff",
"numpy.array",
"seaborn.color_palette",
"seaborn.set",
"matplotlib.co... | [((244, 253), 'seaborn.set', 'sns.set', ([], {}), '()\n', (251, 253), True, 'import seaborn as sns\n'), ((254, 293), 'seaborn.set', 'sns.set', ([], {'rc': "{'figure.figsize': (10, 8)}"}), "(rc={'figure.figsize': (10, 8)})\n", (261, 293), True, 'import seaborn as sns\n'), ((302, 339), 'numpy.array', 'np.array', (['[[0, ... |
'''
This module performs a few early syntax check on the input AST.
It checks the conformance of the input code to Pythran specific
constraints.
'''
from pythran.tables import MODULES
from pythran.intrinsic import Class
from pythran.typing import Tuple, List, Set, Dict
from pythran.utils import isstr
import beniget
i... | [
"pythran.utils.isstr",
"numpy.iinfo",
"logging.getLogger",
"beniget.Ancestors",
"pythran.types.tog.TypeVariable",
"pythran.types.tog.tr",
"pythran.types.tog.clone",
"pythran.tables.MODULES.values"
] | [((382, 410), 'logging.getLogger', 'logging.getLogger', (['"""pythran"""'], {}), "('pythran')\n", (399, 410), False, 'import logging\n'), ((2716, 2732), 'pythran.tables.MODULES.values', 'MODULES.values', ([], {}), '()\n', (2730, 2732), False, 'from pythran.tables import MODULES\n'), ((3245, 3264), 'beniget.Ancestors', ... |
from __future__ import print_function
import numpy as np
import testing as tm
import unittest
import pytest
import xgboost as xgb
try:
from sklearn.linear_model import ElasticNet
from sklearn.preprocessing import scale
from regression_test_utilities import run_suite, parameter_combinations
except ImportE... | [
"sklearn.linear_model.ElasticNet",
"testing.no_sklearn",
"numpy.isclose",
"regression_test_utilities.parameter_combinations",
"xgboost.DMatrix",
"regression_test_utilities.run_suite"
] | [((1106, 1197), 'sklearn.linear_model.ElasticNet', 'ElasticNet', ([], {'alpha': '(reg_alpha + reg_lambda)', 'l1_ratio': '(reg_alpha / (reg_alpha + reg_lambda))'}), '(alpha=reg_alpha + reg_lambda, l1_ratio=reg_alpha / (reg_alpha +\n reg_lambda))\n', (1116, 1197), False, 'from sklearn.linear_model import ElasticNet\n'... |
from __future__ import absolute_import
import os.path
import numpy as np
from skimage import draw
import cv2
from ocrd_modelfactory import page_from_file
from ocrd_models.ocrd_page import (
to_xml, CoordsType,
TextLineType,
TextRegionType,
SeparatorRegionType,
PageType
)
from ocrd import Processor... | [
"cv2.approxPolyDP",
"numpy.arange",
"numpy.unique",
"cv2.contourArea",
"numpy.zeros_like",
"ocrd_utils.coordinates_of_segment",
"ocrd_utils.points_from_polygon",
"numpy.max",
"ocrd_utils.getLogger",
"skimage.draw.polygon",
"ocrd_models.ocrd_page.to_xml",
"ocrd_utils.concat_padded",
"ocrd_uti... | [((744, 780), 'ocrd_utils.getLogger', 'getLogger', (['"""processor.OcropySegment"""'], {}), "('processor.OcropySegment')\n", (753, 780), False, 'from ocrd_utils import getLogger, concat_padded, coordinates_of_segment, coordinates_for_segment, points_from_polygon, MIMETYPE_PAGE\n'), ((1376, 1398), 'numpy.unique', 'np.un... |
from functools import lru_cache
import numpy as np
from scipy import stats
from .utils import check_args, seaborn_plt, call_shortcut
__all__ = ["CorrelatedTTest", "two_on_single"]
class Posterior:
"""
The posterior distribution of differences on a single data set.
Args:
mean (float): the mean ... | [
"numpy.full",
"numpy.random.standard_t",
"numpy.zeros",
"scipy.stats.t.ppf",
"numpy.mean",
"scipy.stats.t.pdf",
"functools.lru_cache",
"numpy.var",
"scipy.stats.t.cdf",
"numpy.sqrt"
] | [((1179, 1191), 'functools.lru_cache', 'lru_cache', (['(1)'], {}), '(1)\n', (1188, 1191), False, 'from functools import lru_cache\n'), ((5206, 5219), 'numpy.mean', 'np.mean', (['diff'], {}), '(diff)\n', (5213, 5219), True, 'import numpy as np\n'), ((5234, 5254), 'numpy.var', 'np.var', (['diff'], {'ddof': '(1)'}), '(dif... |
import os
import numpy as np
import scipy.io as sio
from PIL import Image
from deephar.utils import *
def load_mpii_mat_annotation(filename):
mat = sio.loadmat(filename)
annot_tr = mat['annot_tr']
annot_val = mat['annot_val']
# Respect the order of TEST (0), TRAIN (1), and VALID (2)
rectidxs = ... | [
"scipy.io.loadmat",
"numpy.empty",
"numpy.isnan",
"numpy.array",
"numpy.linalg.norm",
"os.path.join",
"numpy.concatenate"
] | [((156, 177), 'scipy.io.loadmat', 'sio.loadmat', (['filename'], {}), '(filename)\n', (167, 177), True, 'import scipy.io as sio\n'), ((1281, 1318), 'numpy.linalg.norm', 'np.linalg.norm', (['(head[0:2] - head[2:4])'], {}), '(head[0:2] - head[2:4])\n', (1295, 1318), True, 'import numpy as np\n'), ((3129, 3192), 'numpy.arr... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from collections import Counter
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union... | [
"math.sqrt",
"collections.Counter",
"ax.core.observation.ObservationFeatures.from_arm",
"numpy.mean",
"numpy.linspace",
"ax.modelbridge.transforms.ivw.IVW",
"numpy.log10",
"ax.utils.common.logger.get_logger",
"ax.modelbridge.prediction_utils.predict_at_point",
"ax.utils.common.typeutils.not_none",... | [((914, 934), 'ax.utils.common.logger.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (924, 934), False, 'from ax.utils.common.logger import get_logger\n'), ((7452, 7469), 'ax.modelbridge.transforms.ivw.IVW', 'IVW', (['None', '[]', '[]'], {}), '(None, [], [])\n', (7455, 7469), False, 'from ax.modelbridge... |
"""
Validate calculation bfield calculation from line segments
=================================================================
"""
import numpy as np
import matplotlib.pyplot as plt
import time as t
from bfieldtools.line_magnetics import magnetic_field
""" Bfield calculation from circular current loops using ellipt... | [
"matplotlib.pyplot.title",
"mayavi.mlab.figure",
"numpy.abs",
"numpy.isnan",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.meshgrid",
"mayavi.mlab.quiver3d",
"numpy.power",
"numpy.linspace",
"bfieldtools.line_magnetics.magnetic_field",
"numpy.isinf",
"numpy.cos",
"mayavi.mlab.plot3d",
... | [((3209, 3232), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', '(100)'], {}), '(-1, 1, 100)\n', (3220, 3232), True, 'import numpy as np\n'), ((3256, 3289), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', 'Ntheta'], {}), '(0, 2 * np.pi, Ntheta)\n', (3267, 3289), True, 'import numpy as np\n'), ((3301, 3340), ... |
import numpy as np
import tempfile
import logging
import pandas as pd
from sklearn.metrics import jaccard_score
import rpGraph
######################################################################################################################
############################################## UTILITIES ###############... | [
"pandas.DataFrame",
"logging.debug",
"numpy.count_nonzero",
"numpy.average",
"numpy.abs",
"numpy.std",
"logging.warning",
"sklearn.metrics.jaccard_score",
"numpy.around",
"numpy.mean",
"numpy.max",
"rpGraph.rpGraph"
] | [((1729, 1766), 'pandas.DataFrame', 'pd.DataFrame', (['meas_data'], {'index': 'values'}), '(meas_data, index=values)\n', (1741, 1766), True, 'import pandas as pd\n'), ((1783, 1819), 'pandas.DataFrame', 'pd.DataFrame', (['sim_data'], {'index': 'values'}), '(sim_data, index=values)\n', (1795, 1819), True, 'import pandas ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.