code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
Created on Oct 04, 2017
@author: <NAME>
Description of the file.
"""
import os
import shutil
import numpy as np
import torch
def collate_fn_cad(batch):
edge_features, node_features, adj_mat, node_labels, sequence_id = batch[0]
max_node_num = np.max(np.array([[adj_mat.shape[0]] for (edge_features, nod... | [
"os.makedirs",
"os.path.isdir",
"torch.load",
"torch.FloatTensor",
"torch.save",
"os.path.isfile",
"numpy.array",
"shutil.copyfile",
"os.path.join"
] | [((1713, 1751), 'torch.FloatTensor', 'torch.FloatTensor', (['edge_features_batch'], {}), '(edge_features_batch)\n', (1730, 1751), False, 'import torch\n'), ((1778, 1816), 'torch.FloatTensor', 'torch.FloatTensor', (['node_features_batch'], {}), '(node_features_batch)\n', (1795, 1816), False, 'import torch\n'), ((1837, 1... |
import os
import random
import time
import numpy as np
from memory_profiler import memory_usage
from mpi4py import MPI
from mpi4py.futures import MPICommExecutor
import traceback
from csv_modules.csv_writer import write_in_file
from experiment.utils_general import remove_get_dirs
from general_utils.pdb_utils import g... | [
"os.mkdir",
"os.remove",
"reconstruction.semi_exact_cover.get_semi_exact_s",
"os.path.abspath",
"mpi4py.futures.MPICommExecutor",
"os.path.exists",
"traceback.format_exc",
"reconstruction.DLX.solve",
"numpy.intersect1d",
"experiment.utils_general.remove_get_dirs",
"memory_profiler.memory_usage",... | [((3093, 3104), 'time.time', 'time.time', ([], {}), '()\n', (3102, 3104), False, 'import time\n'), ((3353, 3364), 'time.time', 'time.time', ([], {}), '()\n', (3362, 3364), False, 'import time\n'), ((4079, 4101), 'os.listdir', 'os.listdir', (['local_path'], {}), '(local_path)\n', (4089, 4101), False, 'import os\n'), ((4... |
import ast
import numpy as np
from random import shuffle
with open('same_game_nc_dist') as dist_f:
z = [(int(l.split(' ')[0]), int(l.split(' ')[1])) for l in dist_f.readlines()]
ncs, depths = zip(*z)
print(ncs, depths)
t1 = .000001
t2 = .000001
t3 = .000001
learning_rate = 1e-5
while True:
concat ... | [
"random.shuffle",
"numpy.abs",
"numpy.exp"
] | [((349, 364), 'random.shuffle', 'shuffle', (['concat'], {}), '(concat)\n', (356, 364), False, 'from random import shuffle\n'), ((869, 898), 'numpy.abs', 'np.abs', (['(t3_start - t3 < 0.001)'], {}), '(t3_start - t3 < 0.001)\n', (875, 898), True, 'import numpy as np\n'), ((543, 575), 'numpy.exp', 'np.exp', (['(t1 + t2 * ... |
import pathlib
import pickle
import cartopy.crs as ccrs
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.colors import rgb2hex
from tools.utils import handle_different_country_name, init_geom_infos, get_last_updated_data
# 入口函数
def draw_last_covid_map_c... | [
"matplotlib.colorbar.ColorbarBase",
"matplotlib.pyplot.show",
"matplotlib.colors.Normalize",
"tools.utils.handle_different_country_name",
"matplotlib.colors.rgb2hex",
"tools.utils.init_geom_infos",
"tools.utils.get_last_updated_data",
"cartopy.crs.PlateCarree",
"matplotlib.pyplot.subplots",
"numpy... | [((439, 462), 'tools.utils.get_last_updated_data', 'get_last_updated_data', ([], {}), '()\n', (460, 462), False, 'from tools.utils import handle_different_country_name, init_geom_infos, get_last_updated_data\n'), ((673, 691), 'cartopy.crs.PlateCarree', 'ccrs.PlateCarree', ([], {}), '()\n', (689, 691), True, 'import car... |
# Willowbend DICOM
# <img src="Title.png" align="left" width="45%" height="45%">
# A dialog-based DICOM to video converter.
# **DICOM (Digital Imaging and Communications in Medicine)** is a standard for handling, storing, printing, and transmitting information in medical imaging. DICOM files can be exchanged between ... | [
"tkinter.PhotoImage",
"tkinter.Text",
"cv2.equalizeHist",
"cv2.VideoWriter",
"pydicom.read_file",
"cv2.cvtColor",
"SimpleITK.ReadImage",
"tkinter.messagebox.showwarning",
"tkinter.messagebox.showinfo",
"SimpleITK.GetArrayFromImage",
"tkinter.filedialog.askopenfilename",
"tkinter.filedialog.ask... | [((7771, 7778), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (7776, 7778), True, 'import tkinter as tk\n'), ((8384, 8415), 'tkinter.PhotoImage', 'tk.PhotoImage', ([], {'file': '"""Title.png"""'}), "(file='Title.png')\n", (8397, 8415), True, 'import tkinter as tk\n'), ((8428, 8487), 'tkinter.Label', 'tk.Label', (['root'], {... |
# -*- coding: utf-8 -*-
try:
from functools import lru_cache
except ImportError:
from functools32 import lru_cache
import numpy as np
from .cMinhash import minhash_32, minhash_64
class MinHasher(object):
def __init__(self, seeds, char_ngram=8, random_state=None, hashbytes=8):
"""The MinHasher cr... | [
"functools32.lru_cache",
"numpy.random.RandomState"
] | [((1889, 1913), 'functools32.lru_cache', 'lru_cache', ([], {'maxsize': '(10000)'}), '(maxsize=10000)\n', (1898, 1913), False, 'from functools32 import lru_cache\n'), ((1330, 1365), 'numpy.random.RandomState', 'np.random.RandomState', (['random_state'], {}), '(random_state)\n', (1351, 1365), True, 'import numpy as np\n'... |
from pathlib import Path
import re
import numpy as np
class GenVar:
''' store data for easy comparison with BgenVars
'''
def __init__(self, chrom, varid, rsid, pos, alleles, probs):
self.chrom = chrom
self.varid = varid
self.rsid = rsid
self.pos = int(pos)
self.all... | [
"re.split",
"numpy.isnan",
"pathlib.Path",
"numpy.array",
"numpy.reshape",
"re.compile"
] | [((1533, 1551), 're.compile', 're.compile', (['"""[/|]"""'], {}), "('[/|]')\n", (1543, 1551), False, 'import re\n'), ((1559, 1574), 're.compile', 're.compile', (['""","""'], {}), "(',')\n", (1569, 1574), False, 'import re\n'), ((1582, 1597), 're.compile', 're.compile', (['""","""'], {}), "(',')\n", (1592, 1597), False,... |
import tensorflow
import pandas as pd
import numpy as np
import os
from time import time
from keras.layers import Dense, Dropout, CuDNNLSTM, CuDNNGRU, RNN, LSTM, GRU
from keras import Sequential
from keras.callbacks import TensorBoard, ModelCheckpoint
from kdd_processing import kdd_encoding
from unsw_processing import... | [
"pandas.DataFrame",
"os.makedirs",
"keras.Sequential",
"keras.callbacks.ModelCheckpoint",
"pandas.read_csv",
"keras.layers.Dropout",
"os.path.exists",
"time.time",
"unsw_processing.unsw_encoding",
"keras.layers.Dense",
"keras.callbacks.TensorBoard",
"numpy.array",
"kdd_processing.kdd_encodin... | [((4787, 4799), 'keras.Sequential', 'Sequential', ([], {}), '()\n', (4797, 4799), False, 'from keras import Sequential\n'), ((7056, 7088), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'csv_values'}), '(columns=csv_values)\n', (7068, 7088), True, 'import pandas as pd\n'), ((7158, 7192), 'pandas.DataFrame', 'pd.D... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# plt.switch_backend('agg')
Img_height = 64
Img_width = 64
from dataset import Dataset
# Code by <NAME> (github.com/pkmital/CADL)
def montage(images):
if isinstance(images, list):
images = np.array(images)
img_h = images.sha... | [
"tensorflow.trainable_variables",
"tensorflow.contrib.layers.l2_regularizer",
"tensorflow.get_collection",
"tensorflow.reset_default_graph",
"tensorflow.contrib.layers.flatten",
"tensorflow.reshape",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.zeros_like",
"numpy.ones",
"tensorflow.multiply",... | [((869, 894), 'dataset.Dataset', 'Dataset', (['"""raw/grayscale/"""'], {}), "('raw/grayscale/')\n", (876, 894), False, 'from dataset import Dataset\n'), ((895, 919), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (917, 919), True, 'import tensorflow as tf\n'), ((958, 1037), 'tensorflow.pl... |
import numpy as np
from os import listdir
from os.path import isfile, join
def calculate_score(W, D):
total_distance = 0
for i in range(D.shape[1]):
diff = W + np.random.rand(250, 1) * 0.1 - D[:, i].reshape(250, 1)
total_distance += np.sqrt(np.sum(diff ** 2))
return 1 / total_distance
pa... | [
"numpy.load",
"numpy.save",
"numpy.sum",
"numpy.zeros",
"numpy.random.rand",
"os.path.join",
"os.listdir"
] | [((386, 404), 'numpy.load', 'np.load', (['"""./d.npy"""'], {}), "('./d.npy')\n", (393, 404), True, 'import numpy as np\n'), ((338, 353), 'os.listdir', 'listdir', (['"""data"""'], {}), "('data')\n", (345, 353), False, 'from os import listdir\n'), ((473, 485), 'numpy.zeros', 'np.zeros', (['(72)'], {}), '(72)\n', (481, 48... |
import glob
import numpy as np
from PIL import Image
from natsort import natsorted
import pandas as pd
import cv2
import sklearn
from sklearn.cluster import KMeans
import configparser
def make_image_stats_prep(files, dir_out, filename_out):
images_stats = np.zeros((len(files), 26))
i=0
for file in files:
... | [
"numpy.save",
"pandas.read_csv",
"sklearn.cluster.KMeans",
"PIL.Image.open",
"glob.glob",
"configparser.ConfigParser"
] | [((1809, 1854), 'numpy.save', 'np.save', (['(dir_out + filename_out)', 'images_stats'], {}), '(dir_out + filename_out, images_stats)\n', (1816, 1854), True, 'import numpy as np\n'), ((1918, 1952), 'pandas.read_csv', 'pd.read_csv', (['csv_anno'], {'header': 'None'}), '(csv_anno, header=None)\n', (1929, 1952), True, 'imp... |
import datetime
import logging
import os
import sys
import click
from mesa.batchrunner import BatchRunnerMP
from mesa.visualization.ModularVisualization import ModularServer
from mesa.visualization.UserParam import UserSettableParameter
import numpy as np
import pandas as pd
from model.data_types import ModelState, D... | [
"pandas.read_csv",
"click.option",
"click.echo",
"server.create_canvas_grid",
"numpy.random.default_rng",
"os.path.isfile",
"server.ClassMonitorElement",
"mesa.visualization.UserParam.UserSettableParameter",
"os.path.abspath",
"server.PupilMonitorElement",
"click.command",
"datetime.datetime.n... | [((636, 680), 'os.getenv', 'os.getenv', (['"""CLASSROOM_ABM_LOG_LEVEL"""', '"""INFO"""'], {}), "('CLASSROOM_ABM_LOG_LEVEL', 'INFO')\n", (645, 680), False, 'import os\n'), ((844, 879), 'os.getenv', 'os.getenv', (['"""CLASSROOM_ABM_LOG_FILE"""'], {}), "('CLASSROOM_ABM_LOG_FILE')\n", (853, 879), False, 'import os\n'), ((8... |
#coding= utf-8
import unittest
from time import sleep
from dddd.commen.get_browser import get_browser
from numpy import random
from dddd.commen.db_opterate.device_data import *
from dddd.commen.sys_config import liulanqi_type, web_url, time_out
from dddd.page.delete_device_manage_paga import DeleteDeviceManagePage
... | [
"dddd.commen.get_browser.get_browser",
"dddd.page.delete_device_manage_paga.DeleteDeviceManagePage",
"numpy.random.randint",
"time.sleep"
] | [((456, 482), 'dddd.commen.get_browser.get_browser', 'get_browser', (['liulanqi_type'], {}), '(liulanqi_type)\n', (467, 482), False, 'from dddd.commen.get_browser import get_browser\n'), ((688, 722), 'dddd.page.delete_device_manage_paga.DeleteDeviceManagePage', 'DeleteDeviceManagePage', (['cls.driver'], {}), '(cls.driv... |
import numpy as np
import scipy.sparse as sp
import torch
def encode_onehot(labels):
# The classes must be sorted before encoding to enable s...tatic class encoding.
classes = sorted(list(set(labels)))
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in enumerate(classes)}
labels_onehot = np... | [
"scipy.sparse.diags",
"numpy.power",
"numpy.dtype",
"numpy.isinf",
"numpy.ones",
"scipy.sparse.csr_matrix",
"numpy.array",
"numpy.where",
"scipy.sparse.eye"
] | [((641, 692), 'numpy.array', 'np.array', (['idx_features_labels[:, 0]'], {'dtype': 'np.int32'}), '(idx_features_labels[:, 0], dtype=np.int32)\n', (649, 692), True, 'import numpy as np\n'), ((780, 841), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['idx_features_labels[:, 1:-1]'], {'dtype': 'np.float32'}), '(idx_feature... |
# coding: utf-8
""" demo forward 3D (computation on tetrahedrons) """
# Copyright (c) <NAME>. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division, absolute_import, print_function
import numpy as np
import pyeit.mesh as mesh
from pyeit.mesh imp... | [
"pyeit.mesh.set_perm",
"pyeit.mesh.plot.tetplot",
"pyeit.eit.fem.Forward",
"numpy.real",
"pyeit.mesh.create",
"pyeit.eit.utils.eit_scan_lines",
"pyeit.mesh.quality.stats"
] | [((628, 659), 'pyeit.mesh.create', 'mesh.create', ([], {'h0': '(0.15)', 'bbox': 'bbox'}), '(h0=0.15, bbox=bbox)\n', (639, 659), True, 'import pyeit.mesh as mesh\n'), ((746, 769), 'pyeit.mesh.quality.stats', 'quality.stats', (['pts', 'tri'], {}), '(pts, tri)\n', (759, 769), False, 'from pyeit.mesh import quality\n'), ((... |
from __future__ import print_function
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r"c:\windows\fonts\simsun.ttc", size=14) # 解决windows环境下画图汉字乱码问题
# 加载txt和csv文件
def load_data(fileName, split, dataType):
print(u"加载数据...\n"... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.font_manager.FontProperties",
"matplotlib.pyplot.plot",
"numpy.std",
"matplotlib.pyplot.scatter",
"numpy.zeros",
"numpy.transpose",
"numpy.ones",
"numpy.mean",
"numpy.array",
"numpy.loadtxt",
"numpy.arange",
"numpy.dot",
"m... | [((154, 217), 'matplotlib.font_manager.FontProperties', 'FontProperties', ([], {'fname': '"""c:\\\\windows\\\\fonts\\\\simsun.ttc"""', 'size': '(14)'}), "(fname='c:\\\\windows\\\\fonts\\\\simsun.ttc', size=14)\n", (168, 217), False, 'from matplotlib.font_manager import FontProperties\n'), ((333, 386), 'numpy.loadtxt', ... |
import torch.nn as nn
import torch
from torch.nn import functional as F
import numpy as np
from complexFunctions import complex_relu, complex_max_pool2d
from complexFunctions import complex_dropout, complex_dropout2d
class CoilWeight_net(nn.Module):
def __init__(self,nodes,channels):
super(CoilWeight_net, ... | [
"torch.nn.Parameter",
"complexFunctions.complex_dropout2d",
"torch.nn.ReLU",
"torch.nn.ModuleList",
"torch.nn.Conv3d",
"complexFunctions.complex_relu",
"torch.cat",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"complexFunctions.complex_max_pool2d",
"torch.nn.ELU",
"numpy.sin",
"numpy.cos",
... | [((1529, 1577), 'torch.nn.Linear', 'nn.Linear', (['in_features', 'out_features'], {'bias': '(False)'}), '(in_features, out_features, bias=False)\n', (1538, 1577), True, 'import torch.nn as nn\n'), ((1597, 1645), 'torch.nn.Linear', 'nn.Linear', (['in_features', 'out_features'], {'bias': '(False)'}), '(in_features, out_f... |
import numpy as np
import matplotlib.pyplot as plt
import math
#在[0,2pi]取100个随机方向
dirc = np.random.random(100)*2*np.pi
#竖向排列两个图,第一个为极坐标,第二个为直角坐标
fig, ax = plt.subplots(2,1)
#极坐标下展现了每步的方向和大小(定为单位步长),用每个点与原点连线组成的向量表示
ax[0] = plt.subplot(211, projection='polar')
for i in range(100):
ax[0].plot([dirc[i],dirc[i]],[0,... | [
"matplotlib.pyplot.subplot",
"math.sin",
"numpy.random.random",
"math.cos",
"numpy.random.rand",
"matplotlib.pyplot.subplots"
] | [((157, 175), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(1)'], {}), '(2, 1)\n', (169, 175), True, 'import matplotlib.pyplot as plt\n'), ((226, 262), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(211)'], {'projection': '"""polar"""'}), "(211, projection='polar')\n", (237, 262), True, 'import matplotlib.p... |
# -*- coding: utf-8 -*-
#
# This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda
#
# Copyright © pyFDA Project Contributors
# Licensed under the terms of the MIT License
# (see file LICENSE in root directory for details)
"""
Widget for specifying the parameters of a direct-form DF1 FIR f... | [
"pyfda.pyfda_lib.set_dict_defaults",
"pyfda.pyfda_lib.pprint_log",
"numpy.abs",
"migen.run_simulation",
"migen.fhdl.verilog.convert",
"pyfda.pyfda_qt_lib.qget_cmb_box",
"migen.Signal",
"functools.reduce",
"logging.getLogger"
] | [((365, 392), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (382, 392), False, 'import logging\n'), ((2059, 2169), 'pyfda.pyfda_lib.set_dict_defaults', 'set_dict_defaults', (["fb.fil[0]['fxqc']['QA']", "{'WI': 0, 'WF': 30, 'W': 32, 'ovfl': 'wrap', 'quant': 'floor'}"], {}), "(fb.fil[0]['f... |
##########################################################################
# XXX - Copyright (C) XXX, 2017
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details.
###########... | [
"scipy.signal.convolve2d",
"numpy.asarray",
"numpy.zeros",
"numpy.imag",
"numpy.linalg.norm",
"numpy.array",
"numpy.real",
"numpy.dot",
"pisap.base.utils.extract_paches_from_2d_images",
"numpy.sqrt"
] | [((3641, 3666), 'numpy.asarray', 'numpy.asarray', (['data_shape'], {}), '(data_shape)\n', (3654, 3666), False, 'import numpy\n'), ((3724, 3747), 'numpy.zeros', 'numpy.zeros', (['data_shape'], {}), '(data_shape)\n', (3735, 3747), False, 'import numpy\n'), ((3901, 3924), 'numpy.linalg.norm', 'numpy.linalg.norm', (['data'... |
from __future__ import print_function, division, absolute_import
from .priors import Discriminator as PriorDiscriminator
from .modules import SRLModules
from utils import printRed, detachToNumpy, printYellow
from preprocessing.utils import deNormalize
from preprocessing.data_loader import RobotEnvDataset
from plottin... | [
"numpy.random.seed",
"numpy.sum",
"torch.is_grad_enabled",
"torch.argmax",
"torch.cat",
"numpy.isnan",
"collections.defaultdict",
"pprint.pprint",
"torch.no_grad",
"os.path.join",
"utils.detachToNumpy",
"preprocessing.data_loader.RobotEnvDataset",
"torch.utils.data.DataLoader",
"torch.load... | [((2499, 2519), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (2513, 2519), True, 'import numpy as np\n'), ((2528, 2551), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (2545, 2551), False, 'import torch\n'), ((3562, 3597), 'numpy.concatenate', 'np.concatenate', (['prediction... |
# -*- coding: utf-8 -*-
import unittest
import numpy as np
import numpy.testing as npt
import hyperspy.api as hs
from .. import signals
from .. import dev
class Test_Dev2D(unittest.TestCase):
"""
"""
def setUp(self):
"""
"""
shape = (100, 100)
# Simple data
np.... | [
"numpy.random.seed",
"numpy.allclose",
"numpy.random.rand",
"numpy.testing.assert_allclose",
"hyperspy.api.signals.Signal2D"
] | [((317, 334), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (331, 334), True, 'import numpy as np\n'), ((359, 381), 'numpy.random.rand', 'np.random.rand', (['*shape'], {}), '(*shape)\n', (373, 381), True, 'import numpy as np\n'), ((508, 542), 'hyperspy.api.signals.Signal2D', 'hs.signals.Signal2D', (['s... |
# Copyright 2019 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
"os.path.exists",
"forte.faiss.EmbeddingBasedIndexer",
"numpy.array",
"shutil.rmtree",
"os.listdir"
] | [((917, 986), 'forte.faiss.EmbeddingBasedIndexer', 'EmbeddingBasedIndexer', ([], {'config': "{'index_type': 'IndexFlatL2', 'dim': 2}"}), "(config={'index_type': 'IndexFlatL2', 'dim': 2})\n", (938, 986), False, 'from forte.faiss import EmbeddingBasedIndexer\n'), ((1028, 1080), 'numpy.array', 'np.array', (['[[1, 0], [0, ... |
"""Trains LOLA-PG agents in Escape Room game.
Agents have discrete movement actions and continuous
reward-giving actions.
Supports either 2 or 3 agents only.
"""
import os
import numpy as np
import tensorflow as tf
from . import logger
from .corrections import *
from .networks import *
from .utils import *
from ut... | [
"numpy.sum",
"tensorflow.trainable_variables",
"tensorflow.reset_default_graph",
"tensorflow.ConfigProto",
"numpy.mean",
"numpy.arange",
"os.path.join",
"utils.util.get_action_others_1hot_batch",
"numpy.reshape",
"numpy.random.shuffle",
"tensorflow.global_variables_initializer",
"tensorflow.Se... | [((1019, 1043), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (1041, 1043), True, 'import tensorflow as tf\n'), ((1078, 1103), 'numpy.arange', 'np.arange', (['total_n_agents'], {}), '(total_n_agents)\n', (1087, 1103), True, 'import numpy as np\n'), ((1940, 1973), 'tensorflow.global_varia... |
from fastapi import FastAPI, Request
import json
import numpy as np
import pickle
import os
from google.cloud import storage
from preprocess import MySimpleScaler
from sklearn.datasets import load_iris
import tensorflow as tf
app = FastAPI()
gcs_client = storage.Client()
with open("preprocessor.pkl", 'wb') as prep... | [
"sklearn.datasets.load_iris",
"tensorflow.keras.models.load_model",
"numpy.argmax",
"numpy.asarray",
"pickle.load",
"google.cloud.storage.Client",
"fastapi.FastAPI"
] | [((236, 245), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (243, 245), False, 'from fastapi import FastAPI, Request\n'), ((259, 275), 'google.cloud.storage.Client', 'storage.Client', ([], {}), '()\n', (273, 275), False, 'from google.cloud import storage\n'), ((719, 757), 'tensorflow.keras.models.load_model', 'tf.ker... |
from unprocess import unprocess
from unprocess import random_ccm
from unprocess import random_gains
from process import process
import tensorflow as tf
import cv2
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import glob
import rawpy
tf.config.experimental_run_functions_eagerly(True)
tf.enab... | [
"tensorflow.enable_eager_execution",
"tensorflow.set_random_seed",
"tensorflow.config.experimental_run_functions_eagerly",
"tensorflow.cast",
"unprocess.unprocess",
"numpy.array",
"glob.glob",
"tensorflow.image.decode_jpeg",
"tensorflow.read_file"
] | [((262, 312), 'tensorflow.config.experimental_run_functions_eagerly', 'tf.config.experimental_run_functions_eagerly', (['(True)'], {}), '(True)\n', (306, 312), True, 'import tensorflow as tf\n'), ((313, 340), 'tensorflow.enable_eager_execution', 'tf.enable_eager_execution', ([], {}), '()\n', (338, 340), True, 'import t... |
# FP LDOS, Networks
import os, sys
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
#from torch.utils.tensorboard import SummaryWriter
import torch.optim as optim
import horovod.torch as hvd
sys.path.append("../utils/")
#import ldos_calc
###-------------------------------------------------... | [
"sys.path.append",
"numpy.save",
"horovod.torch.rank",
"numpy.empty",
"torch.nn.functional.mse_loss"
] | [((219, 247), 'sys.path.append', 'sys.path.append', (['"""../utils/"""'], {}), "('../utils/')\n", (234, 247), False, 'import os, sys\n'), ((5565, 5618), 'numpy.empty', 'np.empty', (['[self.args.grid_pts, self.args.ldos_length]'], {}), '([self.args.grid_pts, self.args.ldos_length])\n', (5573, 5618), True, 'import numpy ... |
from sklearn.base import TransformerMixin
from sklearn.utils.validation import check_is_fitted
import numpy as np
class Sbiancare(TransformerMixin):
"""Trasforma i dati rendendoli a media zero e varianza unitaria"""
def __init(self):
pass
def fit(self, X, y=None):
self.media_ = X.mean(ax... | [
"numpy.cov",
"numpy.sqrt",
"numpy.linalg.eig",
"sklearn.utils.validation.check_is_fitted"
] | [((342, 353), 'numpy.cov', 'np.cov', (['X.T'], {}), '(X.T)\n', (348, 353), True, 'import numpy as np\n'), ((428, 448), 'numpy.linalg.eig', 'np.linalg.eig', (['sigma'], {}), '(sigma)\n', (441, 448), True, 'import numpy as np\n'), ((507, 552), 'sklearn.utils.validation.check_is_fitted', 'check_is_fitted', (['self', "['me... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"logging.error",
"numpy.random.seed",
"program_config.OpConfig",
"logging.basicConfig",
"paddle.enable_static",
"logging.warning",
"os.path.dirname",
"paddle.inference.create_predictor",
"numpy.allclose",
"program_config.create_quant_model",
"hypothesis.settings.load_profile",
"logging.info",
... | [((1223, 1284), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(message)s"""'}), "(level=logging.INFO, format='%(message)s')\n", (1242, 1284), False, 'import logging\n'), ((1495, 1522), 'hypothesis.settings.load_profile', 'settings.load_profile', (['"""ci"""'], {}), "('ci')\... |
"""
By setting the transition and observation matrices to the identity, we can use
the Kalman Filter to estimate an exponentially weighted moving average, where
the window is decided by the Kalman Gain K.
See
[1] Quantopian - Kalman Filters:
https://github.com/quantopian/research_public/blob/master/notebooks/lecture... | [
"matplotlib.pyplot.show",
"numpy.random.randn",
"numpy.sin",
"numpy.array",
"numpy.arange",
"kalmanfilter.KalmanFilter",
"matplotlib.pyplot.subplots"
] | [((1030, 1073), 'numpy.arange', 'np.arange', ([], {'start': 'start', 'stop': 'end', 'step': 'step'}), '(start=start, stop=end, step=step)\n', (1039, 1073), True, 'import numpy as np\n'), ((1085, 1099), 'numpy.sin', 'np.sin', (['_space'], {}), '(_space)\n', (1091, 1099), True, 'import numpy as np\n'), ((1545, 1560), 'nu... |
from openeye.oegraphsim import *
from openeye.oechem import *
from collections import defaultdict
import numpy as np
from sklearn.cluster import DBSCAN, MeanShift
from sklearn import metrics
def gen_tid_clusters_list(tid_molecules_list, fptype=OEFPType_MACCS166, lim=10, select_option =0):
# generate tid_clusters_... | [
"openeye.oedepict.OEImageGrid",
"openeye.oedepict.OERenderMolecule",
"openeye.oechem.OESmilesToMol",
"collections.defaultdict",
"numpy.around",
"sklearn.cluster.DBSCAN",
"openeye.oedepict.OEWriteImage",
"openeye.oechem.OEAtomBondSet",
"openeye.oedepict.OEPrepareDepiction",
"matplotlib.pyplot.subpl... | [((399, 416), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (410, 416), False, 'from collections import defaultdict\n'), ((7395, 7421), 'numpy.zeros', 'np.zeros', (['(N, N)', 'np.float'], {}), '((N, N), np.float)\n', (7403, 7421), True, 'import numpy as np\n'), ((8048, 8071), 'numpy.around', 'np... |
import numpy as np
from matplotlib import pyplot as plt
from niscv.clustering.quantile import Quantile
from niscv.real.garch import GARCH
import pandas as pd
import seaborn as sb
import multiprocessing
import os
from datetime import datetime as dt
import pickle
class IP:
def __init__(self, pdf, rvs):
self... | [
"niscv.real.garch.GARCH",
"pickle.dump",
"matplotlib.pyplot.show",
"niscv.clustering.quantile.Quantile",
"matplotlib.pyplot.style.use",
"multiprocessing.Pool",
"numpy.array",
"seaborn.pairplot",
"datetime.datetime.now"
] | [((601, 624), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (614, 624), True, 'from matplotlib import pyplot as plt\n'), ((629, 659), 'seaborn.pairplot', 'sb.pairplot', (['df'], {'hue': '"""cluster"""'}), "(df, hue='cluster')\n", (640, 659), True, 'import seaborn as sb\n'), ((6... |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
from PIL import Image
from itertools import product
import math
import os
import tqdm
import tensorflow as tf
from pathlib import Path
plt.rcParams["pdf.use14corefonts"] = True
def imscatter(x, y, image, a... | [
"PIL.Image.new",
"tqdm.tqdm_notebook",
"os.path.join",
"matplotlib.offsetbox.OffsetImage",
"numpy.column_stack",
"tensorflow.reshape",
"matplotlib.offsetbox.AnnotationBbox",
"matplotlib.pyplot.subplots",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.Variable",
"numpy.array",
"numpy... | [((505, 524), 'numpy.atleast_1d', 'np.atleast_1d', (['x', 'y'], {}), '(x, y)\n', (518, 524), True, 'import numpy as np\n'), ((1197, 1270), 'os.path.join', 'os.path.join', (['image_output_folder', '"""explore_latents/random_normal/frames"""'], {}), "(image_output_folder, 'explore_latents/random_normal/frames')\n", (1209... |
from nipype.interfaces.base import (
BaseInterfaceInputSpec, TraitedSpec, SimpleInterface,
InputMultiPath, OutputMultiPath, File, Directory,
traits, isdefined
)
import numpy as np
import pandas as pd
from nilearn.connectome import sym_matrix_to_vec, vec_to_sym_matrix
from scipy.stats import pearsonr
im... | [
"matplotlib.pyplot.title",
"numpy.load",
"seaborn.kdeplot",
"numpy.nan_to_num",
"numpy.sum",
"pandas.read_csv",
"fmridenoise.utils.plotting.motion_plot",
"numpy.ones",
"os.path.join",
"pandas.DataFrame",
"matplotlib.pyplot.axvline",
"nilearn.connectome.sym_matrix_to_vec",
"nipype.interfaces.... | [((556, 623), 'nipype.interfaces.base.File', 'File', ([], {'exists': '(True)', 'desc': '"""Group connectivity matrix"""', 'mandatory': '(True)'}), "(exists=True, desc='Group connectivity matrix', mandatory=True)\n", (560, 623), False, 'from nipype.interfaces.base import BaseInterfaceInputSpec, TraitedSpec, SimpleInterf... |
import sys
sys.path.append('../..')
from reproduction.joint_cws_parse.data.data_loader import CTBxJointLoader
from fastNLP.embeddings.static_embedding import StaticEmbedding
from torch import nn
from functools import partial
from reproduction.joint_cws_parse.models.CharParser import CharParser
from reproduction.joint_... | [
"sys.path.append",
"functools.partial",
"fastNLP.LRScheduler",
"reproduction.joint_cws_parse.models.callbacks.DevCallback",
"torch.optim.lr_scheduler.StepLR",
"numpy.random.seed",
"torch.random.manual_seed",
"fastNLP.GradientClipCallback",
"fastNLP.Trainer",
"reproduction.joint_cws_parse.models.me... | [((11, 35), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (26, 35), False, 'import sys\n'), ((892, 926), 'functools.partial', 'partial', (['nn.init.normal_'], {'std': '(0.02)'}), '(nn.init.normal_, std=0.02)\n', (899, 926), False, 'from functools import partial\n'), ((4198, 4247), 'reprodu... |
# Required dependencies
# 1. NLTK
# 2. Gensim for word2vec
# 3. Keras with tensorflow/theano backend
import random
import sys
import json
import codecs
import warnings
warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim')
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt... | [
"matplotlib.pyplot.title",
"numpy.random.seed",
"keras.models.Model",
"sklearn.metrics.f1_score",
"numpy.random.randint",
"matplotlib.pyplot.figure",
"keras.layers.Input",
"keras.layers.concatenate",
"nltk.word_tokenize",
"keras.utils.np_utils.to_categorical",
"matplotlib.pyplot.ylim",
"keras.... | [((168, 247), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""ignore"""', 'category': 'UserWarning', 'module': '"""gensim"""'}), "(action='ignore', category=UserWarning, module='gensim')\n", (191, 247), False, 'import warnings\n'), ((267, 288), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'... |
# -*- coding: utf-8 -*-
"""Color Operations
Functions for manipulating colors and color images.
"""
import itertools
from math import floor
from mathics.builtin.base import Builtin
from mathics.builtin.colors.color_directives import (
_ColorObject,
ColorError,
RGBColor,
)
from mathics.builtin.colors.colo... | [
"mathics.algorithm.clusters.PrecomputedDistances",
"mathics.builtin.colors.color_directives._ColorObject.create",
"mathics.builtin.colors.color_directives.color_to_expression",
"mathics.builtin.colors.color_internals.convert_color",
"mathics.builtin.colors.color_directives.expression_to_color",
"numpy.arr... | [((5772, 5798), 'mathics.builtin.colors.color_directives.expression_to_color', 'expression_to_color', (['input'], {}), '(input)\n', (5791, 5798), False, 'from mathics.builtin.colors.color_directives import expression_to_color, color_to_expression\n'), ((6019, 6090), 'mathics.builtin.colors.color_internals.convert_color... |
import numpy as np
import os
import glob
import keras
class DataGenerator(keras.utils.Sequence):
"""Generates data for Keras"""
def __init__(self, data_path, batch_size=16, seqLength=3, featureLength=2048, shuffle=True):
"""Initialization"""
self.data_path = data_path
self... | [
"numpy.load",
"numpy.empty",
"numpy.random.randint",
"glob.glob",
"numpy.vstack",
"os.path.join",
"os.listdir",
"numpy.random.shuffle",
"keras.utils.to_categorical"
] | [((901, 921), 'numpy.vstack', 'np.vstack', (['filenames'], {}), '(filenames)\n', (910, 921), True, 'import numpy as np\n'), ((2371, 2404), 'numpy.empty', 'np.empty', (['(self.batch_size, *dim)'], {}), '((self.batch_size, *dim))\n', (2379, 2404), True, 'import numpy as np\n'), ((2417, 2453), 'numpy.empty', 'np.empty', (... |
import pickle
import sys
import numpy as np
import math
import tensorflow as tf
from tensorflow.contrib import rnn
def load_pkl(path):
with open(path,'rb') as f:
obj = pickle.load(f)
return obj
def RNN(x,weights,biases):
x=tf.unstack(x,1)
lstm_cell=rnn.BasicLSTMCell(n_hidden,forget_bias=1.0... | [
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.global_variables_initializer",
"tensorflow.argmax",
"tensorflow.Session",
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.placeholder",
"tensorflow.contrib.rnn.static_rnn",
"pickle.load",
"tensorflow.matmul",
"tensorflow.cast",
"... | [((249, 265), 'tensorflow.unstack', 'tf.unstack', (['x', '(1)'], {}), '(x, 1)\n', (259, 265), True, 'import tensorflow as tf\n'), ((278, 322), 'tensorflow.contrib.rnn.BasicLSTMCell', 'rnn.BasicLSTMCell', (['n_hidden'], {'forget_bias': '(1.0)'}), '(n_hidden, forget_bias=1.0)\n', (295, 322), False, 'from tensorflow.contr... |
import numpy as np
from essentia import *
from essentia.standard import OnsetDetection
from sklearn import preprocessing
def feature_allframes(input_features, frame_indexer=None):
beats = input_features['beats']
fft_result_mag = input_features['fft_mag']
fft_result_ang = input_features['fft_ang']
od_... | [
"essentia.standard.OnsetDetection",
"numpy.average",
"numpy.sum",
"sklearn.preprocessing.scale",
"numpy.array",
"numpy.correlate"
] | [((326, 355), 'essentia.standard.OnsetDetection', 'OnsetDetection', ([], {'method': '"""flux"""'}), "(method='flux')\n", (340, 355), False, 'from essentia.standard import OnsetDetection\n'), ((3226, 3253), 'sklearn.preprocessing.scale', 'preprocessing.scale', (['result'], {}), '(result)\n', (3245, 3253), False, 'from s... |
# %%
import seaborn as sns
from cadCAD import configs
import pandas as pd
from cadCAD.engine import ExecutionMode, ExecutionContext, Executor
from cadCAD.configuration.utils import config_sim
from cadCAD.configuration import Experiment
from cadCAD_tools.execution import easy_run
from typing import List, Dict
from cadC... | [
"pandas.DataFrame",
"seaborn.lineplot",
"cadCAD_tools.types.Param",
"cadCAD_tools.types.ParamSweep",
"matplotlib.pyplot.show",
"pandas.DataFrame.from_dict",
"random.normalvariate",
"cadCAD_tools.utils.generic_suf",
"numpy.isnan",
"cadCAD_tools.preparation.prepare_params",
"cadCAD_tools.preparati... | [((2012, 2040), 'cadCAD_tools.preparation.prepare_state', 'prepare_state', (['initial_state'], {}), '(initial_state)\n', (2025, 2040), False, 'from cadCAD_tools.preparation import prepare_params, prepare_state\n'), ((2666, 2710), 'cadCAD_tools.preparation.prepare_params', 'prepare_params', (['params'], {'cartesian_swee... |
def amo_index(SY,EY,MON):
#Reads in amo vales for SY (Start Year) till EY (End Year) for the MON (Numpy array of Months)
#from the a txt file called amo.txt downloaded from https://psl.noaa.gov/data/correlation/amon.us.long.data
#We use the unsmoothed long data version
#and remove the last lines till only the ... | [
"pandas.read_table",
"numpy.arange",
"numpy.repeat"
] | [((1381, 1453), 'pandas.read_table', 'pd.read_table', (['"""amo.txt"""'], {'delim_whitespace': '(True)', 'header': 'None', 'skiprows': '(1)'}), "('amo.txt', delim_whitespace=True, header=None, skiprows=1)\n", (1394, 1453), True, 'import pandas as pd\n'), ((1522, 1549), 'numpy.repeat', 'np.repeat', (['df[0].values', '(1... |
from __future__ import absolute_import
import torch.nn as nn
from torch.nn import init
import numpy as np
import torch
from .base import Layer
class Embedding(Layer):
"""Embedding Layer"""
def __init__(self, insize, outsize, name=None, pretrain=None, dictionary=None):
"""
Initialize current ... | [
"torch.nn.Parameter",
"torch.nn.Embedding",
"numpy.asarray",
"torch.cuda.FloatTensor",
"torch.nn.init.xavier_uniform",
"torch.cuda.LongTensor"
] | [((751, 780), 'torch.nn.Embedding', 'nn.Embedding', (['insize', 'outsize'], {}), '(insize, outsize)\n', (763, 780), True, 'import torch.nn as nn\n'), ((789, 828), 'torch.nn.init.xavier_uniform', 'init.xavier_uniform', (['self.kernel.weight'], {}), '(self.kernel.weight)\n', (808, 828), False, 'from torch.nn import init\... |
"""Module dedicated to custom VTK widgets."""
import numpy as np
import collections
import pyvista
from pyvista import _vtk
from pyvista.utilities import (NORMALS, generate_plane, get_array,
try_callback, get_array_association)
from pyvista.plotting.tools import parse_color, FONTS
# fro... | [
"numpy.full",
"pyvista._vtk.vtkButtonWidget",
"pyvista.plotting.tools.parse_color",
"numpy.array",
"pyvista.UniformGrid",
"pyvista._vtk.vtkTextActor",
"pyvista._vtk.vtkCornerAnnotation",
"pyvista._vtk.vtkTexturedButtonRepresentation2D"
] | [((11143, 11183), 'pyvista._vtk.vtkTexturedButtonRepresentation2D', '_vtk.vtkTexturedButtonRepresentation2D', ([], {}), '()\n', (11181, 11183), False, 'from pyvista import _vtk\n'), ((11470, 11492), 'pyvista._vtk.vtkButtonWidget', '_vtk.vtkButtonWidget', ([], {}), '()\n', (11490, 11492), False, 'from pyvista import _vt... |
from zquantum.core.history.recorder import recorder as _recorder
from zquantum.core.interfaces.functions import CallableWithGradient
from zquantum.core.interfaces.optimizer import (
Optimizer,
optimization_result,
construct_history_info,
)
from zquantum.core.typing import RecorderFactory
from ._parameter_g... | [
"zquantum.core.interfaces.optimizer.construct_history_info",
"warnings.warn",
"numpy.array",
"numpy.reshape"
] | [((824, 957), 'warnings.warn', 'warnings.warn', (['"""The GridSearchOptimizer will soon be deprecated in favor of the SearchPointsOptimizer."""', 'DeprecationWarning'], {}), "(\n 'The GridSearchOptimizer will soon be deprecated in favor of the SearchPointsOptimizer.'\n , DeprecationWarning)\n", (837, 957), False,... |
from transformers.data.processors.utils import InputExample, InputFeatures
from transformers.data.processors.utils import DataProcessor
from torch.utils.data import TensorDataset, DataLoader
from torch.utils.data import RandomSampler, SequentialSampler
from transformers import AdamW
from transformers import get_linear_... | [
"numpy.random.seed",
"torch.utils.data.RandomSampler",
"transformers.data.processors.utils.InputExample",
"pandas.read_csv",
"numpy.argmax",
"os.path.isfile",
"numpy.mean",
"torch.utils.data.TensorDataset",
"torch.distributed.get_world_size",
"torch.no_grad",
"os.path.join",
"transformers.data... | [((474, 537), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""example.log"""', 'level': 'logging.INFO'}), "(filename='example.log', level=logging.INFO)\n", (493, 537), False, 'import logging\n'), ((547, 563), 're.compile', 're.compile', (['""" +"""'], {}), "(' +')\n", (557, 563), False, 'import re\n... |
'''
Which Archimedean is Best?
Extreme Value copulas formulas are based on Genest 2009
References
----------
<NAME>., 2009. Rank-based inference for bivariate extreme-value
copulas. The Annals of Statistics, 37(5), pp.2990-3022.
'''
import numpy as np
from scipy.special import expm1
def copula_bv_indep(u, v):
... | [
"numpy.minimum",
"numpy.maximum",
"numpy.power",
"numpy.asarray",
"numpy.column_stack",
"scipy.special.expm1"
] | [((460, 476), 'numpy.minimum', 'np.minimum', (['u', 'v'], {}), '(u, v)\n', (470, 476), True, 'import numpy as np\n'), ((564, 588), 'numpy.maximum', 'np.maximum', (['(u + v - 1)', '(0)'], {}), '(u + v - 1, 0)\n', (574, 588), True, 'import numpy as np\n'), ((1194, 1213), 'numpy.minimum', 'np.minimum', (['cdfv', '(1)'], {... |
"""
G R A D I E N T - E N H A N C E D N E U R A L N E T W O R K S (G E N N)
Author: <NAME> <<EMAIL>>
This package is distributed under New BSD license.
"""
import numpy as np
def linear_activation_forward(A_prev, W, b, activation):
"""
Implement forward propagation for one layer.
Arguments:
:... | [
"numpy.dot",
"numpy.eye",
"numpy.zeros",
"numpy.copy"
] | [((7963, 7987), 'numpy.eye', 'np.eye', (['n_x'], {'dtype': 'float'}), '(n_x, dtype=float)\n', (7969, 7987), True, 'import numpy as np\n'), ((8151, 8174), 'numpy.zeros', 'np.zeros', (['(n_y, n_x, m)'], {}), '((n_y, n_x, m))\n', (8159, 8174), True, 'import numpy as np\n'), ((1979, 1996), 'numpy.dot', 'np.dot', (['W', 'A_... |
'''
Fitting change in rate of spikes to
synapse weight between NN layers
Weight: 0.0
Layer 2 Spikes: 600
_
0.5
1750
_
1.0
2900
________
Found that curve is linear!
y = 0 x2 + 2300 x + 600
'''
import numpy as np
from scipy.optimize import curve_fit
def func(x, a, b, c):
return a * np.exp(-b * x) + c
xdata = np.lin... | [
"numpy.exp",
"numpy.linspace",
"scipy.optimize.curve_fit"
] | [((314, 334), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(3)'], {}), '(0, 1, 3)\n', (325, 334), True, 'import numpy as np\n'), ((486, 515), 'scipy.optimize.curve_fit', 'curve_fit', (['func', 'xdata', 'ydata'], {}), '(func, xdata, ydata)\n', (495, 515), False, 'from scipy.optimize import curve_fit\n'), ((286, 300... |
# -*- coding: utf-8 -*-
"""
Module to handle getting data loading classes and helper functions.
"""
import json
import io
import torch
import numpy as np
from collections import Counter, defaultdict
from torch.utils.data import Dataset
from . import constants as Constants
from .timer import Timer
##################... | [
"json.dump",
"numpy.average",
"json.loads",
"torch.LongTensor",
"torch.ByteTensor",
"torch.set_grad_enabled",
"json.dumps",
"collections.defaultdict",
"numpy.max",
"io.open",
"torch.zeros",
"collections.Counter"
] | [((4877, 4897), 'json.loads', 'json.loads', (['contents'], {}), '(contents)\n', (4887, 4897), False, 'import json\n'), ((5653, 5670), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (5664, 5670), False, 'from collections import Counter, defaultdict\n'), ((8881, 8913), 'torch.set_grad_enabled', 'to... |
"""Utility classes and function for evaluation of SVD/SVD++ models performance with different numbers of factors
and regularization constants.
"""
import os
from typing import List
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.axes import Axes
from matplotlib.figure import Fig... | [
"pandas.DataFrame",
"numpy.meshgrid",
"model.eigen3_svd.Eigen3SVD.compile",
"pandas.merge",
"matplotlib.pyplot.subplots",
"pandas.MultiIndex.from_product",
"util.splits.split_for_eigen3_svd",
"os.path.join"
] | [((1440, 1493), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': '(index_columns + [result_column])'}), '(columns=index_columns + [result_column])\n', (1452, 1493), True, 'import pandas as pd\n'), ((4551, 4688), 'model.eigen3_svd.Eigen3SVD.compile', 'Eigen3SVD.compile', ([], {'factor_counts_list': 'n_factors_list',... |
from __future__ import division
import re
import numpy as np
import uncertainties
from past.utils import old_div
from threeML.io.logging import setup_logger
log = setup_logger(__name__)
def interval_to_errors(value, low_bound, hi_bound):
"""
Convert error intervals to errors
:param value: central val... | [
"past.utils.old_div",
"numpy.log10",
"numpy.isfinite",
"threeML.io.logging.setup_logger"
] | [((167, 189), 'threeML.io.logging.setup_logger', 'setup_logger', (['__name__'], {}), '(__name__)\n', (179, 189), False, 'from threeML.io.logging import setup_logger\n'), ((2847, 2881), 'past.utils.old_div', 'old_div', (['value', 'order_of_magnitude'], {}), '(value, order_of_magnitude)\n', (2854, 2881), False, 'from pas... |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import h5py
import os
import sys
import pandas as pd
def compare_pgram(fname, yr):
# load recovered
true_periods, true_amps = \
np.array(pd.read_csv("simulations/{0}/all_truths.txt"
... | [
"h5py.File",
"numpy.zeros_like",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.clf",
"os.path.exists",
"numpy.genfromtxt",
"numpy.shape",
"numpy.percentile",
"numpy.reshape",
"numpy.exp",
"matplotlib.pyplot.errorbar"
] | [((465, 474), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (472, 474), True, 'import matplotlib.pyplot as plt\n'), ((479, 526), 'matplotlib.pyplot.plot', 'plt.plot', (['true_periods', 'recovered_periods', '"""k."""'], {}), "(true_periods, recovered_periods, 'k.')\n", (487, 526), True, 'import matplotlib.pyplot... |
import numpy as np
from functools import lru_cache
@lru_cache(maxsize=32)
def _normalized_linspace(size):
return np.linspace(0, 1, size)
def interpolate(y, new_length):
"""Resizes the array by linearly interpolating the values"""
if len(y) == new_length:
return y
x_old = _normalized_linspa... | [
"numpy.interp",
"functools.lru_cache",
"numpy.linspace"
] | [((54, 75), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(32)'}), '(maxsize=32)\n', (63, 75), False, 'from functools import lru_cache\n'), ((119, 142), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'size'], {}), '(0, 1, size)\n', (130, 142), True, 'import numpy as np\n'), ((384, 410), 'numpy.interp', 'np.in... |
'''
Test various functions in VoidFinder by running through a pre-set fake galaxy
list with artificial voids removed.
'''
################################################################################
# Import modules
#
# All modules from vast.voidfinder imported here are going to be tested below.
#---------------... | [
"numpy.ravel",
"vast.voidfinder.multizmask.generate_mask",
"numpy.random.default_rng",
"numpy.isclose",
"numpy.sin",
"numpy.arange",
"numpy.mean",
"numpy.meshgrid",
"numpy.std",
"astropy.table.setdiff",
"numpy.max",
"numpy.ceil",
"vast.voidfinder.preprocessing.file_preprocess",
"numpy.min"... | [((1008, 1030), 'numpy.arange', 'np.arange', (['(10)', '(30)', '(0.5)'], {}), '(10, 30, 0.5)\n', (1017, 1030), True, 'import numpy as np\n'), ((1043, 1066), 'numpy.arange', 'np.arange', (['(-10)', '(10)', '(0.5)'], {}), '(-10, 10, 0.5)\n', (1052, 1066), True, 'import numpy as np\n'), ((1084, 1111), 'numpy.arange', 'np.... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 17 20:01:38 2020
@author: JVM
"""
#ISSUE ONLY GETTING FIRST 10,000
import json
import requests
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pandas.io.json import json_normalize
query0 = """
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-... | [
"pandas.pivot_table",
"json.loads",
"pandas.io.json.json_normalize",
"numpy.where",
"requests.post",
"pandas.concat"
] | [((4819, 4835), 'pandas.concat', 'pd.concat', (['afull'], {}), '(afull)\n', (4828, 4835), True, 'import pandas as pd\n'), ((4945, 5004), 'numpy.where', 'np.where', (["(a['role1.value'] == a['role2.value'])", '(True)', '(False)'], {}), "(a['role1.value'] == a['role2.value'], True, False)\n", (4953, 5004), True, 'import ... |
import pytest
import numpy as np
import analysis
from .conf_test import ConfTest
class TestAngles(ConfTest):
@pytest.fixture
def sample_coords(self):
coord1 = [[1, 0, 0], [0, -1, 0], [1, 1, 1], [-1, 2, 4]]
coord2 = [[0, 1, 0], [0, 1, 0], [1, 2, 1], [2, 3, -1]]
coord1 = np.array(coord1,... | [
"numpy.allclose",
"numpy.array",
"numpy.sqrt"
] | [((304, 333), 'numpy.array', 'np.array', (['coord1'], {'dtype': 'float'}), '(coord1, dtype=float)\n', (312, 333), True, 'import numpy as np\n'), ((351, 380), 'numpy.array', 'np.array', (['coord2'], {'dtype': 'float'}), '(coord2, dtype=float)\n', (359, 380), True, 'import numpy as np\n'), ((642, 656), 'numpy.array', 'np... |
"""sensor_util.py
utilities for sensors, currently contains raytracing code
"""
from __future__ import print_function, absolute_import, division
import numpy as np
def bresenham2d_with_intensities(p1, p2, img):
"""
https://stackoverflow.com/questions/32328179/opencv-3-0-python-lineiterator
Produces and a... | [
"numpy.abs",
"numpy.maximum",
"numpy.floor",
"numpy.zeros",
"numpy.cumsum",
"numpy.arange",
"numpy.round",
"numpy.vstack"
] | [((1211, 1221), 'numpy.abs', 'np.abs', (['dx'], {}), '(dx)\n', (1217, 1221), True, 'import numpy as np\n'), ((1235, 1245), 'numpy.abs', 'np.abs', (['dy'], {}), '(dy)\n', (1241, 1245), True, 'import numpy as np\n'), ((3637, 3652), 'numpy.round', 'np.round', (['p0[0]'], {}), '(p0[0])\n', (3645, 3652), True, 'import numpy... |
# Author: <NAME>
# Email: <EMAIL>
# License: MIT License
import numpy as np
from ..base_optimizer import BaseOptimizer
from ...search import Search
def sort_list_idx(list_):
list_np = np.array(list_)
idx_sorted = list(list_np.argsort()[::-1])
return idx_sorted
def centeroid(array_list):
centeroid ... | [
"numpy.array_equal",
"numpy.array"
] | [((192, 207), 'numpy.array', 'np.array', (['list_'], {}), '(list_)\n', (200, 207), True, 'import numpy as np\n'), ((505, 529), 'numpy.array', 'np.array', (['center_dim_pos'], {}), '(center_dim_pos)\n', (513, 529), True, 'import numpy as np\n'), ((1643, 1685), 'numpy.array_equal', 'np.array_equal', (['self.simplex_pos[0... |
from __future__ import print_function
import sys
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import random
import os
import sys
import argparse
import numpy as np
from InceptionResNetV2 import *
from sklearn.mixture import GaussianM... | [
"sys.stdout.write",
"argparse.ArgumentParser",
"numpy.ravel",
"numpy.empty",
"sklearn.mixture.GaussianMixture",
"numpy.clip",
"torch.cat",
"numpy.linalg.svd",
"sys.stdout.flush",
"numpy.mean",
"numpy.inner",
"numpy.linalg.norm",
"torch.no_grad",
"numpy.unique",
"torch.ones",
"torch.sof... | [((407, 472), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch WebVision Training"""'}), "(description='PyTorch WebVision Training')\n", (430, 472), False, 'import argparse\n'), ((1757, 1790), 'torch.cuda.set_device', 'torch.cuda.set_device', (['args.gpuid'], {}), '(args.gpuid)\n',... |
from concurrent.futures import ThreadPoolExecutor, wait
import traceback
import os
import sys
import time
OMP_NUM_THREADS = sys.argv[1]
n = 40000
nruns = 11
from mpi4py import MPI
import numpy as np
import scipy.sparse as sparse
import scipy.sparse.linalg as sla
from test_data import discrete_laplacian
# TODO: tim... | [
"numpy.random.seed",
"mpi4py.MPI.Wtime",
"mpi4py.MPI.COMM_WORLD.Get_rank",
"numpy.asarray",
"scipy.sparse.csr_matrix",
"numpy.random.rand",
"mpi4py.MPI.COMM_WORLD.Barrier",
"test_data.discrete_laplacian"
] | [((382, 403), 'test_data.discrete_laplacian', 'discrete_laplacian', (['n'], {}), '(n)\n', (400, 403), False, 'from test_data import discrete_laplacian\n'), ((647, 664), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (661, 664), True, 'import numpy as np\n'), ((708, 733), 'mpi4py.MPI.COMM_WORLD.Get_rank'... |
#-*- coding:utf-8 -*-
'''
Normal Distribution, also called Gaussian Distribution
'''
import numpy as np
import matplotlib.pyplot as plt
def simple_plot():
x = np.linspace(0, 10, 10000)
y = np.random.normal(0, x)
z = np.cos(x**2)
plt.figure(figsize = (8, 4))
plt.plot(x, y, label = "sin(x)", color ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.random.normal",
"numpy.cos",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.sqrt"
] | [((165, 190), 'numpy.linspace', 'np.linspace', (['(0)', '(10)', '(10000)'], {}), '(0, 10, 10000)\n', (176, 190), True, 'import numpy as np\n'), ((199, 221), 'numpy.random.normal', 'np.random.normal', (['(0)', 'x'], {}), '(0, x)\n', (215, 221), True, 'import numpy as np\n'), ((230, 244), 'numpy.cos', 'np.cos', (['(x ** ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
CS231n Convolutional Neural Networks for Visual Recognition
http://cs231n.github.io/
Python Numpy Tutorial
http://cs231n.github.io/python-numpy-tutorial/
matplotlib
https://matplotlib.org/
 ̄
We will highlight some parts of SciPy that you might find useful for this c... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.sin",
"numpy.arange",
"numpy.cos",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((783, 811), 'numpy.arange', 'np.arange', (['(0)', '(3 * np.pi)', '(0.1)'], {}), '(0, 3 * np.pi, 0.1)\n', (792, 811), True, 'import numpy as np\n'), ((812, 821), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (818, 821), True, 'import numpy as np\n'), ((860, 874), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), ... |
# -*- coding:utf-8 -*-
# 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 ... | [
"StreamManagerApi.StringVector",
"argparse.ArgumentParser",
"numpy.ones",
"src.utils.initialize_vocabulary",
"cv2.normalize",
"os.path.join",
"codecs.open",
"os.path.exists",
"StreamManagerApi.StreamManagerApi",
"cv2.resize",
"MxpiDataType_pb2.MxpiTensorPackageList",
"numpy.frombuffer",
"Mxp... | [((951, 1066), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""tool that takes tfrecord files and extracts all images + labels from it"""'}), "(description=\n 'tool that takes tfrecord files and extracts all images + labels from it')\n", (974, 1066), False, 'import argparse\n'), ((2719... |
import numpy as np
import seaborn as sns
from numpy import genfromtxt
from matplotlib import pyplot as plt
from sklearn.decomposition import FastICA
import pandas as pd
# loc = 'Z:/nani/experiment/cdef/short laugh 1/short laugh 1_2019.06.25_14.02.31.csv'
sn = [
'gav',
'rot',
'ovi',
'ila',
'hrz',
'aldoh',
'cra',
'cips',... | [
"sklearn.decomposition.FastICA",
"pickle.dump",
"seaborn.heatmap",
"matplotlib.pyplot.show",
"pandas.read_csv",
"numpy.transpose",
"numpy.genfromtxt",
"numpy.array"
] | [((13138, 13155), 'seaborn.heatmap', 'sns.heatmap', (['data'], {}), '(data)\n', (13149, 13155), True, 'import seaborn as sns\n'), ((13156, 13166), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (13164, 13166), True, 'from matplotlib import pyplot as plt\n'), ((13200, 13217), 'seaborn.heatmap', 'sns.heatmap', (... |
import numpy as np
import torch
import matplotlib.pyplot as plt
import matplotlib
import tqdm
import re
from typing import Optional
from diffdvr import Renderer, CameraOnASphere, Entropy, ColorMatches, Settings, setup_default_settings, \
fibonacci_sphere, renderer_dtype_torch, renderer_dtype_np
import pyrenderer
de... | [
"numpy.random.seed",
"numpy.argmax",
"diffdvr.fibonacci_sphere",
"numpy.ones",
"numpy.argmin",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.interp",
"diffdvr.ColorMatches",
"torch.no_grad",
"matplotlib.pyplot.tight_layout",
"diffdvr.Entropy",
"torch.nn.MSELoss",
"matplotlib.c... | [((973, 991), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (987, 991), True, 'import numpy as np\n'), ((994, 1022), 'torch.random.manual_seed', 'torch.random.manual_seed', (['(42)'], {}), '(42)\n', (1018, 1022), False, 'import torch\n'), ((1118, 1141), 'diffdvr.Settings', 'Settings', (['settings_fil... |
#------------------------------------------------------------------------------
# hidraulic python script
# based on hidraulic example @ <NAME> [ICECE2000]
#
# <EMAIL> (version 17/11/2020)
#------------------------------------------------------------------------------
import discrete_model as mdl
import numpy as np
... | [
"discrete_model.run",
"numpy.array"
] | [((929, 955), 'discrete_model.run', 'mdl.run', (['node', 'elem', 'alpha'], {}), '(node, elem, alpha)\n', (936, 955), True, 'import discrete_model as mdl\n'), ((463, 523), 'numpy.array', 'np.array', (['[3.0, 5.0, 3.0, 2.0, 2.0, 2.0, 4.0, 2.0, 3.0, 3.0]'], {}), '([3.0, 5.0, 3.0, 2.0, 2.0, 2.0, 4.0, 2.0, 3.0, 3.0])\n', (4... |
""" Reading, processing and converting the KOMODIS dataset into torch features
"""
import os
import json
import copy
import pickle
import numpy as np
from tqdm import tqdm
from itertools import chain
import torch
from torch.utils.data import DataLoader, TensorDataset
SPECIAL_TOKENS = ["<SST>", "<END>", "<PAD>", "<... | [
"tqdm.tqdm",
"copy.deepcopy",
"json.load",
"pickle.dump",
"torch.utils.data.DataLoader",
"os.path.dirname",
"torch.utils.data.distributed.DistributedSampler",
"pickle.load",
"numpy.random.randint",
"torch.utils.data.TensorDataset",
"itertools.chain",
"numpy.random.rand",
"torch.tensor",
"o... | [((4602, 4644), 'os.path.join', 'os.path.join', (['path_to_data', '"""dataset.json"""'], {}), "(path_to_data, 'dataset.json')\n", (4614, 4644), False, 'import os\n'), ((11637, 11667), 'torch.utils.data.TensorDataset', 'TensorDataset', (['*torch_features'], {}), '(*torch_features)\n', (11650, 11667), False, 'from torch.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 04 13:32:31 2017
@author: <NAME>
Collection of functions to import snowpit data stored in the CAAMLv6 xml standard
"""
import sys
from xml.dom import minidom
import snowpyt.pit_class as pc
import numpy as np
import snowpyt.snowflake.sf_dict as sfd... | [
"snowpyt.pit_class.temperature_profile",
"snowpyt.pit_class.metadata",
"xml.dom.minidom.parse",
"snowpyt.pit_class.layer",
"numpy.array",
"snowpyt.pit_class.density_profile",
"snowpyt.snowflake.sf_dict.hardness_dict.get"
] | [((366, 389), 'xml.dom.minidom.parse', 'minidom.parse', (['path_xml'], {}), '(path_xml)\n', (379, 389), False, 'from xml.dom import minidom\n'), ((1416, 1439), 'xml.dom.minidom.parse', 'minidom.parse', (['path_xml'], {}), '(path_xml)\n', (1429, 1439), False, 'from xml.dom import minidom\n'), ((3951, 3964), 'snowpyt.pit... |
# the following are available with Python Anaconda 3
from datetime import datetime
import json
import numpy
import random
import socket
import sys
import time
# scheddl from the fork https://github.com/rfairley/scheddl must be installed
# to your python distribution by yourself
import scheddl
# eth_echo_test.py sends... | [
"json.dump",
"scheddl.set_deadline",
"numpy.sum",
"scheddl.set_rr",
"scheddl.set_fifo",
"socket.socket",
"time.perf_counter",
"time.sleep",
"numpy.array",
"sys.stderr.write",
"datetime.datetime.now"
] | [((7040, 7138), 'scheddl.set_deadline', 'scheddl.set_deadline', (['SCHEDDL_RUNTIME', 'SCHEDDL_DEADLINE', 'SCHEDDL_PERIOD', 'scheddl.RESET_ON_FORK'], {}), '(SCHEDDL_RUNTIME, SCHEDDL_DEADLINE, SCHEDDL_PERIOD,\n scheddl.RESET_ON_FORK)\n', (7060, 7138), False, 'import scheddl\n'), ((10752, 10795), 'json.dump', 'json.dum... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python [conda env:mdd] *
# language: python
# name: conda-env-mdd-py
# ---
# %%
import numpy as np
impo... | [
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.asarray",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((774, 800), 'numpy.arange', 'np.arange', (['(0.0)', '(0.6)', '(0.001)'], {}), '(0.0, 0.6, 0.001)\n', (783, 800), True, 'import numpy as np\n'), ((874, 903), 'numpy.arange', 'np.arange', (['(0.0)', '(0.6)', '(1.0 / fs)'], {}), '(0.0, 0.6, 1.0 / fs)\n', (883, 903), True, 'import numpy as np\n'), ((993, 1020), 'matplotl... |
import numpy as np
import os
from gym_reinmav.envs.mujoco import MujocoQuadEnv
class MujocoQuadHoveringEnv(MujocoQuadEnv):
def __init__(self):
super(MujocoQuadHoveringEnv, self).__init__(xml_name="quadrotor_hovering.xml")
def step(self, a):
self.do_simulation(self.clip_action(a), self.frame_... | [
"numpy.sum",
"numpy.square",
"numpy.zeros",
"numpy.isfinite",
"numpy.array"
] | [((589, 598), 'numpy.sum', 'np.sum', (['a'], {}), '(a)\n', (595, 598), True, 'import numpy as np\n'), ((657, 672), 'numpy.isfinite', 'np.isfinite', (['ob'], {}), '(ob)\n', (668, 672), True, 'import numpy as np\n'), ((554, 566), 'numpy.square', 'np.square', (['a'], {}), '(a)\n', (563, 566), True, 'import numpy as np\n')... |
"""
pysteps.motion.darts
====================
Implementation of the DARTS algorithm.
.. autosummary::
:toctree: ../generated/
DARTS
"""
import sys
import time
import numpy as np
from numpy.linalg import lstsq, svd
from .. import utils
def DARTS(R, **kwargs):
"""Compute the advection field from a sequen... | [
"numpy.stack",
"numpy.moveaxis",
"numpy.zeros",
"numpy.hstack",
"time.time",
"numpy.linalg.svd",
"sys.stdout.flush",
"numpy.arange",
"numpy.dot",
"numpy.diag"
] | [((2969, 3005), 'numpy.moveaxis', 'np.moveaxis', (['R', '(0, 1, 2)', '(2, 0, 1)'], {}), '(R, (0, 1, 2), (2, 0, 1))\n', (2980, 3005), True, 'import numpy as np\n'), ((3696, 3722), 'numpy.zeros', 'np.zeros', (['m'], {'dtype': 'complex'}), '(m, dtype=complex)\n', (3704, 3722), True, 'import numpy as np\n'), ((4068, 4099),... |
for i in range(100): print('')
import os
import compas_vibro
from compas_vibro.structure import Structure
import openseespymac.opensees as ops
import numpy as np
import sys
# TODO: Masses/Mmatrix are zero, think is because they HAVE to be nodal masses...
def ModalAnalysis(numEigen, pflag=1, outname=None):
"""
... | [
"openseespymac.opensees.numberer",
"openseespymac.opensees.integrator",
"openseespymac.opensees.element",
"openseespymac.opensees.mass",
"openseespymac.opensees.eigen",
"openseespymac.opensees.analysis",
"os.path.join",
"openseespymac.opensees.system",
"openseespymac.opensees.node",
"openseespymac... | [((9842, 9852), 'openseespymac.opensees.wipe', 'ops.wipe', ([], {}), '()\n', (9850, 9852), True, 'import openseespymac.opensees as ops\n'), ((9853, 9893), 'openseespymac.opensees.model', 'ops.model', (['"""basic"""', '"""-ndm"""', '(3)', '"""-ndf"""', '(6)'], {}), "('basic', '-ndm', 3, '-ndf', 6)\n", (9862, 9893), True... |
import numpy as np
import pywt
import cv2
from astropy.stats import sigma_clip
from astropy.convolution import convolve, AiryDisk2DKernel,Box2DKernel,Gaussian2DKernel,MexicanHat2DKernel
from astropy.convolution import Ring2DKernel,Tophat2DKernel,TrapezoidDisk2DKernel
import myroutines as myr
from util import standard
... | [
"astropy.convolution.Gaussian2DKernel",
"astropy.convolution.AiryDisk2DKernel",
"pywt.Wavelet",
"pywt.dwt_max_level",
"astropy.convolution.convolve",
"pywt.threshold",
"astropy.convolution.Ring2DKernel",
"numpy.zeros",
"numpy.expand_dims",
"myroutines.curvelet",
"astropy.convolution.Box2DKernel"... | [((332, 351), 'astropy.convolution.AiryDisk2DKernel', 'AiryDisk2DKernel', (['(3)'], {}), '(3)\n', (348, 351), False, 'from astropy.convolution import convolve, AiryDisk2DKernel, Box2DKernel, Gaussian2DKernel, MexicanHat2DKernel\n'), ((352, 366), 'astropy.convolution.Box2DKernel', 'Box2DKernel', (['(5)'], {}), '(5)\n', ... |
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
from pypbl.elicitation import BayesPreference
from pypbl.priors import Normal
def calculate_error(y, y_pred):
if not isinstance(y, np.ndarray):
y = np.array(y)
if not isinstance(y_pred, np.ndarray):
y_pred = np.array(y_pre... | [
"pandas.DataFrame",
"matplotlib.pylab.savefig",
"numpy.random.seed",
"matplotlib.pylab.legend",
"numpy.median",
"numpy.std",
"matplotlib.pylab.ylabel",
"pypbl.priors.Normal",
"numpy.mean",
"numpy.array",
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.dot",
"matplotlib.pylab.xlabel",
"p... | [((441, 468), 'numpy.random.seed', 'np.random.seed', ([], {'seed': '(240786)'}), '(seed=240786)\n', (455, 468), True, 'import numpy as np\n'), ((663, 685), 'numpy.random.rand', 'np.random.rand', (['(100)', '(3)'], {}), '(100, 3)\n', (677, 685), True, 'import numpy as np\n'), ((693, 756), 'pandas.DataFrame', 'pd.DataFra... |
import os.path
import torch
import scipy.io as sio
import tensorflow as tf
from data.base_dataset import BaseDataset, get_transform
from data.image_folder import make_dataset
from PIL import Image
import numpy as np
import random
import sys
class RemoteSensingUnalignedDataset(BaseDataset):
"""
This dataset c... | [
"numpy.pad",
"tensorflow.image.random_crop",
"numpy.size",
"data.base_dataset.BaseDataset.__init__",
"numpy.zeros",
"numpy.transpose",
"tensorflow.image.random_flip_left_right",
"torch.Tensor",
"tensorflow.image.resize",
"numpy.concatenate"
] | [((837, 868), 'data.base_dataset.BaseDataset.__init__', 'BaseDataset.__init__', (['self', 'opt'], {}), '(self, opt)\n', (857, 868), False, 'from data.base_dataset import BaseDataset, get_transform\n'), ((915, 991), 'numpy.concatenate', 'np.concatenate', (['(dataset_s.images_norm[0], dataset_s.images_norm[1])'], {'axis'... |
import numpy as np
import subprocess
import scipy.stats as stats
import time
import sys
from bayes_opt import BayesianOptimization
from bayes_opt.logger import JSONLogger
from bayes_opt.event import Events
from bayes_opt.util import load_logs
from bayes_opt import SequentialDomainReductionTransformer
N=199
kde_domain... | [
"numpy.ceil",
"bayes_opt.BayesianOptimization",
"numpy.floor",
"scipy.stats.gaussian_kde",
"bayes_opt.SequentialDomainReductionTransformer",
"bayes_opt.logger.JSONLogger",
"time.time",
"bayes_opt.util.load_logs",
"numpy.isnan",
"numpy.isinf",
"numpy.loadtxt",
"sys.exit"
] | [((386, 415), 'numpy.loadtxt', 'np.loadtxt', (['"""density-200.csv"""'], {}), "('density-200.csv')\n", (396, 415), True, 'import numpy as np\n'), ((423, 452), 'numpy.loadtxt', 'np.loadtxt', (['"""density-100.csv"""'], {}), "('density-100.csv')\n", (433, 452), True, 'import numpy as np\n'), ((459, 487), 'numpy.loadtxt',... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import csv
import os
import time
from collections import defaultdict
from typing import Dict, List
import numpy as np
from maro.data_lib import BinaryReader
from yaml import safe_load
from .entities import (CimDataCollection, NoisedItem, OrderG... | [
"csv.DictReader",
"os.path.exists",
"maro.data_lib.BinaryReader",
"time.sleep",
"collections.defaultdict",
"yaml.safe_load",
"numpy.loadtxt",
"os.path.join"
] | [((2364, 2402), 'os.path.join', 'os.path.join', (['dumps_folder', '"""misc.yml"""'], {}), "(dumps_folder, 'misc.yml')\n", (2376, 2402), False, 'import os\n'), ((2763, 2820), 'os.path.join', 'os.path.join', (['dumps_folder', '"""global_order_proportion.txt"""'], {}), "(dumps_folder, 'global_order_proportion.txt')\n", (2... |
import numpy as np
from spyne import Tensor, Constant
from spyne.operations import TensorSubtraction, TensorElemMultiply, TensorAddition
from spyne.operations import TensorSquared, TensorSum, TensorNegLog
def mean_squared_error(y, y_hat):
error = TensorSubtraction(y, y_hat)
error_sq = TensorSquared(error)
... | [
"spyne.operations.TensorAddition",
"spyne.operations.TensorSubtraction",
"spyne.operations.TensorSquared",
"numpy.ones",
"spyne.operations.TensorElemMultiply",
"spyne.operations.TensorNegLog",
"spyne.operations.TensorSum"
] | [((253, 280), 'spyne.operations.TensorSubtraction', 'TensorSubtraction', (['y', 'y_hat'], {}), '(y, y_hat)\n', (270, 280), False, 'from spyne.operations import TensorSubtraction, TensorElemMultiply, TensorAddition\n'), ((296, 316), 'spyne.operations.TensorSquared', 'TensorSquared', (['error'], {}), '(error)\n', (309, 3... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 22 20:25:42 2020
@author: user02
"""
import numpy as np
import random
import math
import matplotlib.pyplot as plt
#from pandas import read_csv
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from sklear... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"sklearn.preprocessing.MinMaxScaler",
"numpy.mean",
"pandas.DataFrame",
"numpy.reshape",
"math.log",
"pandas.concat",
"matplotlib.pyplot.show",
"random.random",
"matplotlib.pyplot.ylabel",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"warning... | [((372, 405), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (395, 405), False, 'import warnings\n'), ((546, 564), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (558, 564), True, 'import pandas as pd\n'), ((1084, 1107), 'pandas.concat', 'pd.concat', (['co... |
from collections import OrderedDict
import numpy as np
from mltoolkit.mldp.utils.helpers.validation import equal_vals
from mltoolkit.mldp.utils.errors import DataChunkError
from .data_unit import DataUnit
from mltoolkit.mldp.utils.tools.dc_writers import JsonWriter, CsvWriter
from copy import deepcopy
class DataChunk... | [
"copy.deepcopy",
"mltoolkit.mldp.utils.errors.DataChunkError",
"numpy.append",
"mltoolkit.mldp.utils.tools.dc_writers.JsonWriter",
"numpy.array",
"mltoolkit.mldp.utils.helpers.validation.equal_vals",
"collections.OrderedDict",
"mltoolkit.mldp.utils.tools.dc_writers.CsvWriter",
"numpy.delete"
] | [((938, 951), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (949, 951), False, 'from collections import OrderedDict\n'), ((1026, 1040), 'copy.deepcopy', 'deepcopy', (['fval'], {}), '(fval)\n', (1034, 1040), False, 'from copy import deepcopy\n'), ((1890, 1962), 'mltoolkit.mldp.utils.errors.DataChunkError',... |
import copy
import random
import sys
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.distributed as dist
from . import common
from apex import amp
import pyrannc
from pyrannc.amp import allreduce_grads, allreduce_grads_rannc
ASSERT_DECIMAL = 3
seed = 0
RELATIVE_TOLERAN... | [
"numpy.random.seed",
"torch.device",
"torch.nn.MSELoss",
"apex.amp.master_params",
"pyrannc.RaNNCModule",
"torch.load",
"pyrannc.get_world_size",
"pyrannc.barrier",
"pyrannc.amp.allreduce_grads_rannc",
"random.seed",
"apex.amp.scale_loss",
"torch.nn.Linear",
"torch.nn.Parameter",
"copy.dee... | [((387, 412), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (410, 412), False, 'import torch\n'), ((478, 489), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (486, 489), False, 'import sys\n'), ((1293, 1313), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (1305, 1313), Fa... |
# -*- coding: utf-8 -*-
""" False Nearest Neighbors
|
-----
.. [Kennel1992] <NAME>., <NAME>., & <NAME>. (1992). Determining embedding dimension for phase-space reconstruction using a geometrical construction. Physical review A, 45(6), 3403.
.. [Abarbane2012] <NAME>. (2012). Analysis of observed chaotic data. Sprin... | [
"numpy.roll",
"numpy.std",
"numpy.power",
"numpy.zeros",
"numpy.ones",
"numpy.argsort",
"numpy.sort",
"numpy.where",
"numpy.arange"
] | [((1540, 1550), 'numpy.std', 'np.std', (['ts'], {}), '(ts)\n', (1546, 1550), True, 'import numpy as np\n'), ((3105, 3137), 'numpy.roll', 'np.roll', (['new_ts[offset]', '(l - tau)'], {}), '(new_ts[offset], l - tau)\n', (3112, 3137), True, 'import numpy as np\n'), ((1743, 1777), 'numpy.zeros', 'np.zeros', (['(num_points,... |
import hashlib
from multiprocessing import Pool
import numpy as np
import torch
from PIL import Image, ImageOps
from sklearn.cluster import AffinityPropagation
from tqdm import tqdm
from ..processor import Detector, Encoder
from ..provider import Provider
from .models import Cluster, Face, Group, Photo
from .storage ... | [
"tqdm.tqdm",
"sklearn.cluster.AffinityPropagation",
"numpy.frombuffer",
"torch.cat",
"numpy.split",
"PIL.Image.open",
"hashlib.sha256",
"PIL.ImageOps.mirror",
"multiprocessing.Pool"
] | [((565, 581), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (579, 581), False, 'import hashlib\n'), ((1174, 1190), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (1188, 1190), False, 'import hashlib\n'), ((1621, 1655), 'numpy.frombuffer', 'np.frombuffer', (['b'], {'dtype': 'np.float32'}), '(b, dtype=np.f... |
from collections import deque
from random import shuffle
from .DQN import *
import numpy as np
import os
ACTIONS = ['LEFT', 'RIGHT', 'UP', 'DOWN', "WAIT", "BOMB"]
def get_minimum(current, targets, board_size):
#print(targets)
if targets == []:
return -1
else:
return np.argmin(np.sum(np.... | [
"numpy.stack",
"numpy.random.seed",
"numpy.subtract",
"random.shuffle",
"numpy.ones",
"os.path.isfile",
"numpy.random.random",
"collections.deque"
] | [((7517, 7533), 'numpy.random.seed', 'np.random.seed', ([], {}), '()\n', (7531, 7533), True, 'import numpy as np\n'), ((7625, 7637), 'collections.deque', 'deque', (['[]', '(5)'], {}), '([], 5)\n', (7630, 7637), False, 'from collections import deque\n'), ((7668, 7681), 'collections.deque', 'deque', (['[]', '(20)'], {}),... |
import numpy as np
def Voltages(X,Y,Z,X0,Y0,Z0,I,SigmaXX,SigmaYY,SigmaZZ,*args):
Dx=X-X0
Dy=Y-Y0
Dz=Z-Z0
Sigma=np.sqrt(SigmaXX*SigmaYY*SigmaZZ)
R2=(1.0/SigmaXX)*Dx**2+(1.0/SigmaYY)*Dy**2+(1.0/SigmaZZ)*Dz**2
R1=np.sqrt(R2)
if args:
pass
else:
args={'V','... | [
"numpy.sqrt"
] | [((140, 176), 'numpy.sqrt', 'np.sqrt', (['(SigmaXX * SigmaYY * SigmaZZ)'], {}), '(SigmaXX * SigmaYY * SigmaZZ)\n', (147, 176), True, 'import numpy as np\n'), ((249, 260), 'numpy.sqrt', 'np.sqrt', (['R2'], {}), '(R2)\n', (256, 260), True, 'import numpy as np\n')] |
# MIT License
#
# Copyright (c) 2021 Playtika Ltd.
#
# 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 without restriction, including without limitation the rights
# to use, copy, modify, mer... | [
"numpy.var",
"numpy.sqrt"
] | [((2828, 2888), 'numpy.sqrt', 'np.sqrt', (['(((n1 - 1) * std1 + (n2 - 1) * std2) / (n1 + n2 - 2))'], {}), '(((n1 - 1) * std1 + (n2 - 1) * std2) / (n1 + n2 - 2))\n', (2835, 2888), True, 'import numpy as np\n'), ((2723, 2746), 'numpy.var', 'np.var', (['sample1'], {'ddof': '(1)'}), '(sample1, ddof=1)\n', (2729, 2746), Tru... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 23 01:00:42 2017
@author: chinwei
a simple MADE example
"""
import numpy as np
import torch
import torch.optim as optim
from torch.autograd import Variable
import torchkit.nn as nn_
from torchkit import flows
from torchkit import utils
import ma... | [
"matplotlib.pyplot.xlim",
"numpy.meshgrid",
"numpy.random.shuffle",
"numpy.sum",
"matplotlib.pyplot.ylim",
"torchkit.flows.IAF_DSF",
"numpy.asarray",
"numpy.random.multinomial",
"torch.FloatTensor",
"scipy.stats.multivariate_normal",
"torchkit.utils.log_normal",
"matplotlib.pyplot.figure",
"... | [((3346, 3378), 'numpy.linspace', 'np.linspace', (['(-5)', '(5)', 'nmodesperdim'], {}), '(-5, 5, nmodesperdim)\n', (3357, 3378), True, 'import numpy as np\n'), ((3384, 3407), 'numpy.meshgrid', 'np.meshgrid', (['grid', 'grid'], {}), '(grid, grid)\n', (3395, 3407), True, 'import numpy as np\n'), ((4118, 4130), 'matplotli... |
import matplotlib.pyplot as plt
from matplotlib import rc
import pickle
import numpy as np
rc('font', **{'family': 'sans-serif',
'sans-serif': ['Helvetica'],
'size': 12})
rc('text', usetex=True)
def smooth(y, box_pts):
# smooth curves by moving average
box = np.ones(box_pts)/box_p... | [
"matplotlib.rc",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"numpy.ones",
"numpy.percentile",
"pickle.load",
"numpy.array",
"numpy.arange",
"numpy.convolve"
] | [((92, 171), 'matplotlib.rc', 'rc', (['"""font"""'], {}), "('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica'], 'size': 12})\n", (94, 171), False, 'from matplotlib import rc\n'), ((200, 223), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (202, 223), False, 'from m... |
import gym
import gym_panda #need to be imported !!
import random
import numpy as np
import matplotlib.pyplot as plt
import time
import execnet
from pilco.models import PILCO
from pilco.controllers import RbfController, LinearController
from pilco.rewards import ExponentialReward
import tensorflow as tf
from gpflow ... | [
"numpy.random.seed",
"save_load_utils.save_pilco_model",
"numpy.mean",
"numpy.diag",
"numpy.set_printoptions",
"PILCO_HMFC_utils.plot_run",
"PILCO_HMFC_utils.delete_oldest_rollout",
"numpy.std",
"numpy.savetxt",
"numpy.transpose",
"PILCO_HMFC_utils.rollout_panda_norm",
"execnet.makegateway",
... | [((341, 358), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (355, 358), True, 'import numpy as np\n'), ((701, 733), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)'}), '(precision=2)\n', (720, 733), True, 'import numpy as np\n'), ((1570, 1616), 'execnet.makegateway', 'execnet.m... |
"""colorize models by fps points."""
import os.path as osp
import sys
import numpy as np
from tqdm import tqdm
import copy
from scipy.spatial.distance import cdist
cur_dir = osp.dirname(osp.abspath(__file__))
sys.path.insert(0, osp.join(cur_dir, "../../../../"))
import mmcv
from lib.pysixd import inout, misc
import re... | [
"scipy.spatial.distance.cdist",
"os.path.abspath",
"tqdm.tqdm",
"copy.deepcopy",
"mmcv.mkdir_or_exist",
"numpy.zeros",
"numpy.argmin",
"os.path.join",
"lib.pysixd.inout.load_ply",
"lib.pysixd.inout.save_ply"
] | [((187, 208), 'os.path.abspath', 'osp.abspath', (['__file__'], {}), '(__file__)\n', (198, 208), True, 'import os.path as osp\n'), ((229, 262), 'os.path.join', 'osp.join', (['cur_dir', '"""../../../../"""'], {}), "(cur_dir, '../../../../')\n", (237, 262), True, 'import os.path as osp\n'), ((1222, 1259), 'tqdm.tqdm', 'tq... |
from collections import OrderedDict
from softlearning.models.convnet import convnet_model
import tensorflow as tf
from softlearning.models.feedforward import feedforward_model
from softlearning.utils.keras import PicklableModel, PicklableSequential
from softlearning.preprocessors.utils import get_preprocessor_from_pa... | [
"matplotlib.pyplot.title",
"numpy.abs",
"numpy.sum",
"numpy.arctan2",
"numpy.argsort",
"numpy.argpartition",
"numpy.mean",
"pickle.load",
"numpy.random.randint",
"softlearning.preprocessors.utils.get_preprocessor_from_params",
"os.path.join",
"tensorflow.keras.optimizers.Adam",
"numpy.random... | [((1643, 1873), 'softlearning.models.feedforward.feedforward_model', 'feedforward_model', ([], {'hidden_layer_sizes': '((num_hidden_units,) * num_hidden_layers)', 'output_size': 'output_size', 'output_activation': 'tf.keras.activations.tanh', 'kernel_regularizer': 'kernel_regularizer', 'name': '"""feedforward_state_est... |
# %%
import numpy as np
import pandas as pd
import gurobipy as gp
from gurobipy import GRB
import matplotlib.pyplot as plt
# Global vartiables(sizes):
PV_ARRAY_SIZE_KW = 660 # kWAC rating of the PV array
DIESEL_GEN_SIZE_KW = 1000 # kWAC rating of the diesel generator
# Diesel fuel consumption coefficients from htt... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"gurobipy.Model",
"matplotlib.pyplot.figure",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"pandas.concat"
] | [((752, 793), 'pandas.read_csv', 'pd.read_csv', (['"""resi_load.csv"""'], {'index_col': '(0)'}), "('resi_load.csv', index_col=0)\n", (763, 793), True, 'import pandas as pd\n'), ((803, 844), 'pandas.read_csv', 'pd.read_csv', (['"""bldg_load.csv"""'], {'index_col': '(0)'}), "('bldg_load.csv', index_col=0)\n", (814, 844),... |
import numpy as np
from numba import jit
def lin_mini(vector,sample, no_recon = False):
# wrapper function that sets everything for the @jit later
# In particular, we avoid the np.zeros that are not handled
# by numba
# size of input vectors and sample to be adjusted
sz_sample = sample.shape # 1d... | [
"numpy.zeros_like",
"numpy.sum",
"numpy.zeros",
"numpy.isfinite",
"numpy.isnan",
"numpy.linalg.inv",
"numba.jit",
"numpy.linalg.det"
] | [((2828, 2846), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (2831, 2846), False, 'from numba import jit\n'), ((1417, 1455), 'numpy.zeros', 'np.zeros', (['[sz_sample[0], sz_sample[0]]'], {}), '([sz_sample[0], sz_sample[0]])\n', (1425, 1455), True, 'import numpy as np\n'), ((1522, 1544), 'numpy... |
# -*- coding: utf-8 -*-
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# AudioBooth.py
#
# Implementation of conversion from the isophonics dataset
#
# (C) <NAME> - Eurecat / UPF
# 02/10/2018
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
from pysofaconven... | [
"netCDF4.Dataset",
"soundfile.read",
"numpy.asarray",
"numpy.zeros",
"time.time",
"numpy.shape"
] | [((520, 560), 'netCDF4.Dataset', 'Dataset', (['filePath', '"""w"""'], {'format': '"""NETCDF4"""'}), "(filePath, 'w', format='NETCDF4')\n", (527, 560), False, 'from netCDF4 import Dataset\n'), ((3560, 3581), 'numpy.asarray', 'np.asarray', (['[0, 0, 1]'], {}), '([0, 0, 1])\n', (3570, 3581), True, 'import numpy as np\n'),... |
# code I modified from here: https://stackoverflow.com/questions/29888233/how-to-visualize-a-neural-network
import matplotlib.pyplot as plt
import numpy as np
class Neuron():
def __init__(self, x, y):
self.x = x
self.y = y
def draw(self, neuron_radius):
circle = plt.Circle((self.x, se... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.text",
"matplotlib.pyplot.figure",
"numpy.sin",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.Line2D",
"numpy.cos"
] | [((298, 360), 'matplotlib.pyplot.Circle', 'plt.Circle', (['(self.x, self.y)'], {'radius': 'neuron_radius', 'fill': '(False)'}), '((self.x, self.y), radius=neuron_radius, fill=False)\n', (308, 360), True, 'import matplotlib.pyplot as plt\n'), ((2135, 2268), 'matplotlib.pyplot.Line2D', 'plt.Line2D', (['(neuron1.x - x_adj... |
"""
Based on
https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6163109
Classification of Malicious Web Code by Machine Learning - Komiya et al.
https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6993127
SQL Injection Detection using Machine Learning
https://www.sciencedirect.com/science/article/pii/S0167404816... | [
"wafamole.utils.check.type_check",
"numpy.linalg.norm",
"numpy.array",
"sqlparse.parse",
"wafamole.utils.check.file_exists",
"numpy.unique"
] | [((2210, 2249), 'wafamole.utils.check.type_check', 'type_check', (['sql_query', 'str', '"""sql_query"""'], {}), "(sql_query, str, 'sql_query')\n", (2220, 2249), False, 'from wafamole.utils.check import type_check, file_exists\n'), ((2983, 3012), 'numpy.array', 'np.array', (['[i for i in values]'], {}), '([i for i in va... |
#python standard library
import pickle
import time
from collections import namedtuple
# third party
import matplotlib.pyplot as plot
import numpy
import plotly
import plotly.tools as p_tools
import seaborn
from sklearn.metrics import f1_score
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble i... | [
"sklearn.ensemble.RandomForestClassifier",
"seaborn.set_style",
"plotly.tools.mpl_to_plotly",
"common.print_image_directive",
"plotly.offline",
"time.time",
"sklearn.linear_model.LogisticRegression",
"pickle.load",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.pyplot.figure",
"numpy.min"... | [((656, 680), 'seaborn.set_style', 'seaborn.set_style', (['STYLE'], {}), '(STYLE)\n', (673, 680), False, 'import seaborn\n'), ((592, 614), 'pickle.load', 'pickle.load', (['unpickler'], {}), '(unpickler)\n', (603, 614), False, 'import pickle\n'), ((7046, 7066), 'sklearn.linear_model.LogisticRegression', 'LogisticRegress... |
import time
import traceback
import numpy as np
import pandas as pd
from .agent_api import fetch_target_positions
from .utils import (
fetch_positions,
fetch_tickers,
fetch_collateral,
symbol_to_ccxt_symbol,
normalize_amount,
)
class Bot:
def __init__(self, client=None, logger=None, leverage=N... | [
"numpy.abs",
"pandas.merge",
"time.sleep",
"time.time",
"traceback.format_exc"
] | [((869, 880), 'time.time', 'time.time', ([], {}), '()\n', (878, 880), False, 'import time\n'), ((1591, 1701), 'pandas.merge', 'pd.merge', (['df_target', 'df_current'], {'how': '"""outer"""', 'suffixes': "['', '_current']", 'left_index': '(True)', 'right_index': '(True)'}), "(df_target, df_current, how='outer', suffixes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.