code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#!/usr/bin/env python
import glob
import numpy as np
import astropy.io.fits as fits
import scipy.optimize as opt
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['font.family'] = 'Times New Roman'
mpl.rcParams['font.size'] = '15'
mpl.rcParams['mathtext.default'] = 'regular'
#mpl.rcParams['xtic... | [
"scipy.optimize.curve_fit",
"matplotlib.pyplot.savefig",
"numpy.sqrt",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.clf",
"numpy.argmax",
"glob.glob",
"matplotlib.pyplot.scatter",
"astropy.io.fits.open",
"matplotlib.pyplot.subplots",
"numpy.arange"
] | [((2786, 2843), 'scipy.optimize.curve_fit', 'opt.curve_fit', (['func', 'numof_xrays_mpgrp', 'significance_n250'], {}), '(func, numof_xrays_mpgrp, significance_n250)\n', (2799, 2843), True, 'import scipy.optimize as opt\n'), ((2898, 2907), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (2905, 2907), True, 'import... |
# Importações
import matplotlib.pyplot as plt
import numpy as np
# Acrescentar Sinais
# Mensagem, Portadora, Subportadora
# Descobrir o K
tempo_maximo = 45000
frequencia_mensagem = 5
frequencia_portadora = 40
amplitude_portadora = 1
# Vai dividir cada valor do vetor criado para que se obtenha valores pequenos
tempo ... | [
"numpy.multiply",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((372, 419), 'numpy.sin', 'np.sin', (['(2 * np.pi * frequencia_mensagem * tempo)'], {}), '(2 * np.pi * frequencia_mensagem * tempo)\n', (378, 419), True, 'import numpy as np\n'), ((531, 563), 'numpy.multiply', 'np.multiply', (['mensagem', 'portadora'], {}), '(mensagem, portadora)\n', (542, 563), True, 'import numpy as... |
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
def f(x):
return x[0]+x[1]*x[2]+np.sin(x[3])
def gettestdata(f,n=1000):
x=np.random.normal(0,1,(n,4))
y=np.array([[f(xx)] for xx in x])
return x,y
def traindensemodel(datax,datay,hidden,lr=0.001,batch... | [
"numpy.random.normal",
"tensorflow.keras.Model",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Input",
"numpy.sin",
"time.time"
] | [((189, 219), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)', '(n, 4)'], {}), '(0, 1, (n, 4))\n', (205, 219), True, 'import numpy as np\n'), ((1321, 1332), 'time.time', 'time.time', ([], {}), '()\n', (1330, 1332), False, 'import time\n'), ((1413, 1424), 'time.time', 'time.time', ([], {}), '()\n', (1422, 1424... |
# 相手の駒配置を予測
# これは不完全情報ゲームにおいて動作するようにする
# 正体が不明な相手の駒をとりあえず-1としておく
# board→14R24R34R44R15B25B35B45B41u31u21u11u40u30u20u10u
# move
import numpy as np
import itertools
import time
from game import State
# from pv_mcts import predict
from pathlib import Path
from tensorflow.keras.models import load_model
from test imp... | [
"test.get_policies",
"test.PredictPolicy",
"math.log",
"numpy.array",
"numpy.where",
"numpy.sort",
"test.convert_func_use_in_guess",
"random.randint",
"test.HandyAction",
"random.choice",
"numpy.amin",
"random.randrange",
"numpy.argmax",
"numpy.any",
"time.time",
"numpy.insert",
"num... | [((18826, 18853), 'game.State', 'State', (['pieces', 'enemy_pieces'], {}), '(pieces, enemy_pieces)\n', (18831, 18853), False, 'from game import State\n'), ((21596, 21640), 'numpy.any', 'np.any', (['(ii_state.all_piece == now_coordinate)'], {}), '(ii_state.all_piece == now_coordinate)\n', (21602, 21640), True, 'import n... |
import itertools
from os import path
from pdb import set_trace
import pickle
from typing import Dict, List, Tuple
from explicit import waiter, XPATH
from selenium import webdriver
import selenium
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options
from se... | [
"numpy.random.normal",
"yaml.full_load",
"selenium.webdriver.chrome.options.Options",
"os.path.exists",
"src.profile.get_post_link",
"requests.Session",
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.Chrome",
"explicit.waiter.find_element",
"itertools.count",
"traceback.print... | [((1006, 1026), 'yaml.full_load', 'yaml.full_load', (['file'], {}), '(file)\n', (1020, 1026), False, 'import yaml\n'), ((1101, 1110), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (1108, 1110), False, 'from selenium.webdriver.chrome.options import Options\n'), ((1339, 1372), 'selenium.webdri... |
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
from __future__ import print_function
import dace
import numpy as np
N = dace.symbol('N')
@dace.program
def dot(A, B, out):
@dace.map
def product(i: _[0:N]):
a << A[i]
b << B[i]
o >> out(1, lambda x, y: x + y... | [
"numpy.random.rand",
"dace.symbol",
"dace.scalar",
"numpy.dot",
"dace.ndarray",
"dace.float64"
] | [((151, 167), 'dace.symbol', 'dace.symbol', (['"""N"""'], {}), "('N')\n", (162, 167), False, 'import dace\n'), ((390, 427), 'dace.ndarray', 'dace.ndarray', (['[N]'], {'dtype': 'dace.float32'}), '([N], dtype=dace.float32)\n', (402, 427), False, 'import dace\n'), ((441, 466), 'dace.scalar', 'dace.scalar', (['dace.float64... |
"""Model training/evaluation base interface module.
This module contains the interface required to train and/or evaluate a model based on different tasks. The trainers
based on this interface are instantiated in launched sessions based on configuration dictionaries.
"""
import functools
import json
import logging
impo... | [
"logging.getLogger",
"torch.manual_seed",
"torch.cuda.manual_seed_all",
"os.path.exists",
"cv2.imwrite",
"platform.node",
"os.makedirs",
"logging.Formatter",
"time.strftime",
"os.path.join",
"torch.nn.DataParallel",
"random.seed",
"logging.FileHandler",
"numpy.random.seed",
"torch.save",... | [((638, 665), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (655, 665), False, 'import logging\n'), ((7448, 7487), 'os.makedirs', 'os.makedirs', (['session_dir'], {'exist_ok': '(True)'}), '(session_dir, exist_ok=True)\n', (7459, 7487), False, 'import os\n'), ((7507, 7540), 'os.path.join'... |
from __future__ import print_function
import os
import time
import json
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Lambda
from keras.optimizers import Nadam as Trainer
#from keras.optimizers import Adam as Trainer
from keras.regularizers import WeightRe... | [
"keras.callbacks.LearningRateScheduler",
"genomic_neuralnet.util.get_is_time_stats",
"keras.layers.Lambda",
"genomic_neuralnet.util.get_should_plot",
"keras.regularizers.WeightRegularizer",
"json.dumps",
"keras.models.Sequential",
"keras.layers.Dense",
"keras.optimizers.Nadam",
"keras.layers.Dropo... | [((1574, 1586), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1584, 1586), False, 'from keras.models import Sequential\n'), ((3876, 3908), 'keras.callbacks.LearningRateScheduler', 'LearningRateScheduler', (['rate_func'], {}), '(rate_func)\n', (3897, 3908), False, 'from keras.callbacks import EarlyStopping... |
from __future__ import print_function
import sys
import cv2
import pdb
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as... | [
"dataloader.sintellist_val.dataloader",
"torch.cuda.synchronize",
"models.VCN_exp.WarpModule",
"torch.squeeze",
"utils.flowlib.point_vec",
"numpy.mean",
"argparse.ArgumentParser",
"numpy.asarray",
"numpy.tile",
"numpy.ones",
"utils.io.mkdir_p",
"utils.flowlib.warp_flow",
"cv2.resize",
"tim... | [((494, 546), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""VCN+expansion"""'}), "(description='VCN+expansion')\n", (517, 546), False, 'import argparse\n'), ((3290, 3328), 'torch.nn.DataParallel', 'nn.DataParallel', (['model'], {'device_ids': '[0]'}), '(model, device_ids=[0])\n', (3305,... |
import numpy as np
import keras
import json
from tqdm import tqdm
import cv2
import random
import matplotlib.pyplot as plt
from keras.applications.vgg16 import preprocess_input
from keras.preprocessing import image as keras_image
import pickle
def augment_patch(patch, augmentation):
if augmentation=='H-Flip':
... | [
"numpy.ceil",
"random.choice",
"cv2.imread",
"numpy.flipud",
"numpy.fliplr",
"tqdm.tqdm",
"pickle.load",
"numpy.floor",
"numpy.zeros",
"numpy.empty",
"numpy.concatenate",
"numpy.rot90",
"json.load",
"cv2.resize",
"numpy.zeros_like",
"numpy.random.shuffle"
] | [((1114, 1124), 'tqdm.tqdm', 'tqdm', (['pdfs'], {}), '(pdfs)\n', (1118, 1124), False, 'from tqdm import tqdm\n'), ((1515, 1541), 'numpy.random.shuffle', 'np.random.shuffle', (['indexes'], {}), '(indexes)\n', (1532, 1541), True, 'import numpy as np\n'), ((2050, 2077), 'cv2.resize', 'cv2.resize', (['img', 'resize_dim'], ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 24 11:41:13 2020
@author: roopareddynagilla
"""
import numpy as np
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
fro... | [
"sqlalchemy.func.min",
"flask.Flask",
"datetime.datetime.strptime",
"sqlalchemy.ext.automap.automap_base",
"sqlalchemy.create_engine",
"sqlalchemy.orm.Session",
"sqlalchemy.func.max",
"sqlalchemy.func.avg",
"numpy.ravel",
"datetime.timedelta",
"flask.jsonify"
] | [((539, 589), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///Resources/hawaii.sqlite"""'], {}), "('sqlite:///Resources/hawaii.sqlite')\n", (552, 589), False, 'from sqlalchemy import create_engine, func\n'), ((646, 660), 'sqlalchemy.ext.automap.automap_base', 'automap_base', ([], {}), '()\n', (658, 660), F... |
import numpy as np
import random
def assign_trait_values(organism_type: str, organism_id: int) -> list:
"""
Function takes in the type of organism and returns a list of the various
traits for that organism to be passed to the next list
Parameters
"""
if organism_type == 'Producer':... | [
"random.sample",
"numpy.random.exponential",
"numpy.random.uniform"
] | [((438, 479), 'numpy.random.exponential', 'np.random.exponential', ([], {'scale': '(0.34)', 'size': '(1)'}), '(scale=0.34, size=1)\n', (459, 479), True, 'import numpy as np\n'), ((1154, 1194), 'numpy.random.exponential', 'np.random.exponential', ([], {'scale': '(800)', 'size': '(1)'}), '(scale=800, size=1)\n', (1175, 1... |
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("dark")
plt.rcParams['figure.figsize'] = 16, 12
import pandas as pd
from tqdm import tqdm_notebook, tqdm
import io
from PIL import Image
from glob import glob
from collections import defaultdict
import os
import pic... | [
"torch.nn.CrossEntropyLoss",
"numpy.random.rand",
"imgaug.augmenters.GaussianBlur",
"kaggle_camera_model_id_lib.models.InceptionResNetV2",
"kaggle_camera_model_id_lib.utils.n_pseudorandom_crops",
"kaggle_camera_model_id_lib.models.ResNetX",
"torchvision.transforms.Lambda",
"torch.LongTensor",
"seabo... | [((91, 112), 'seaborn.set_style', 'sns.set_style', (['"""dark"""'], {}), "('dark')\n", (104, 112), True, 'import seaborn as sns\n'), ((462, 488), 'cv2.ocl.setUseOpenCL', 'cv2.ocl.setUseOpenCL', (['(True)'], {}), '(True)\n', (482, 488), False, 'import cv2\n'), ((1459, 1470), 'kaggle_camera_model_id_lib.utils.PechkaBot',... |
""" adaptation of part of <NAME>'s libvaxdata test suite for <NAME>'s PyVAX wrapper
Authors
-------
| <NAME> (<EMAIL>)
<NAME>
University of California, Los Angeles.
"""
import pyvax as pv
import numpy as np
from pytest import approx
def func_i2(x):
fstr = pv.from_vax_i2(x)
print(np.frombuffer(fstr, dtyp... | [
"pytest.approx",
"pyvax.from_vax_g8",
"pyvax.from_vax_i2",
"numpy.frombuffer",
"pyvax.from_vax_d8",
"pyvax.from_vax_r4",
"pyvax.from_vax_i4"
] | [((268, 285), 'pyvax.from_vax_i2', 'pv.from_vax_i2', (['x'], {}), '(x)\n', (282, 285), True, 'import pyvax as pv\n'), ((353, 397), 'numpy.frombuffer', 'np.frombuffer', (['fstr'], {'dtype': 'np.int16', 'count': '(1)'}), '(fstr, dtype=np.int16, count=1)\n', (366, 397), True, 'import numpy as np\n'), ((426, 443), 'pyvax.f... |
import csv
from os import listdir
from os.path import isfile, join
import numpy as np
import pandas as pd
from scipy.io import arff
from clustering_algorithms import CLARA, PAM, get_initial_points
from data_loaders import load_data
from timer import Timer
from visualizers import plot_data
DIRECTORY = "datasets/artif... | [
"clustering_algorithms.get_initial_points",
"numpy.mean",
"os.path.join",
"data_loaders.load_data",
"timer.Timer"
] | [((720, 741), 'os.path.join', 'join', (['DIRECTORY', 'file'], {}), '(DIRECTORY, file)\n', (724, 741), False, 'from os.path import isfile, join\n'), ((761, 780), 'data_loaders.load_data', 'load_data', (['filepath'], {}), '(filepath)\n', (770, 780), False, 'from data_loaders import load_data\n'), ((803, 862), 'clustering... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 8 16:58:10 2020
@author: nephilim
"""
import keras
import numpy as np
import my_Im2col
from matplotlib import pyplot,cm
import skimage.transform
import T_PowerGain
import DataNormalized
import Reshape2Encoder
def GetPatch(Image,patch_size,sliding... | [
"keras.layers.Conv2D",
"numpy.log10",
"Reshape2Encoder.ReshapeData2Encoder",
"numpy.array",
"keras.layers.Dense",
"numpy.arange",
"matplotlib.pyplot.imshow",
"keras.models.Model",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.savefig",
"my_Im2col.my_im2col",
"keras.layers.Flatten",
"keras.lay... | [((341, 391), 'my_Im2col.my_im2col', 'my_Im2col.my_im2col', (['Image', 'patch_size', 'slidingDis'], {}), '(Image, patch_size, slidingDis)\n', (360, 391), False, 'import my_Im2col\n'), ((458, 476), 'numpy.sum', 'np.sum', (['(Image ** 2)'], {}), '(Image ** 2)\n', (464, 476), True, 'import numpy as np\n'), ((489, 517), 'n... |
import sys
import numpy as np
np.set_printoptions(precision=2, threshold=sys.maxsize)
from scipy.linalg import block_diag
from qpsolvers import solve_qp
from util import util
from pnc.data_saver import DataSaver
class IHWBC(object):
"""
Implicit Hierarchy Whole Body Control
------------------
Usage:... | [
"numpy.copy",
"numpy.eye",
"pnc.data_saver.DataSaver",
"qpsolvers.solve_qp",
"numpy.dot",
"numpy.zeros",
"numpy.concatenate",
"scipy.linalg.block_diag",
"util.util.weighted_pinv",
"numpy.set_printoptions"
] | [((31, 86), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)', 'threshold': 'sys.maxsize'}), '(precision=2, threshold=sys.maxsize)\n', (50, 86), True, 'import numpy as np\n'), ((1512, 1524), 'numpy.copy', 'np.copy', (['val'], {}), '(val)\n', (1519, 1524), True, 'import numpy as np\n'), ((1975, 1... |
import os
import sys
import unittest
import HtmlTestRunner
import cv2.cv2 as cv2
import numpy as np
current_path = os.path.dirname(os.path.abspath(__file__))
list_paths = [os.sep.join([current_path, os.pardir, 'src']), os.sep.join([current_path, os.pardir])]
for path in list_paths:
if path not in sys.path:
... | [
"HtmlTestRunner.HTMLTestRunner",
"unittest.TestSuite",
"sys.path.insert",
"cv2.cv2.imread",
"os.path.join",
"MapSlicer.MapSlicer",
"os.sep.join",
"TrafficDetector.TrafficDetector",
"numpy.nonzero",
"os.path.abspath",
"unittest.TextTestRunner"
] | [((441, 479), 'os.path.join', 'os.path.join', (['current_path', '"""../data/"""'], {}), "(current_path, '../data/')\n", (453, 479), False, 'import os\n'), ((132, 157), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (147, 157), False, 'import os\n'), ((173, 218), 'os.sep.join', 'os.sep.join', ... |
#!/usr/bin/env python
"""
Hmm maybe its impossible to get anywhere with integral without first fixing the BetaInverse
In [22]: pw.subs(b, 1.55)
Out[2... | [
"sympy.symbols",
"numpy.array",
"sympy.Piecewise",
"sympy.Max"
] | [((773, 1084), 'numpy.array', 'np.array', (['[[1.55, 1.478], [1.795, 1.48], [2.105, 1.484], [2.271, 1.486], [2.551, \n 1.492], [2.845, 1.496], [3.064, 1.499], [4.133, 1.526], [6.2, 1.619], [\n 6.526, 1.618], [6.889, 1.527], [7.294, 1.554], [7.75, 1.793], [8.267, \n 1.783], [8.857, 1.664], [9.538, 1.554], [10.3... |
import numpy as np
#---------------------------------------------------------
#Read in transition counts between cells (N_alpha_beta)
#---------------------------------------------------------
def compute_Nab_Ta(trajectory_crossings,N,i):
'''
Compute N_a_b and T_a for one individual trajectory at one individ... | [
"numpy.linalg.solve",
"numpy.ones",
"numpy.log",
"numpy.random.exponential",
"numpy.array",
"numpy.sum",
"numpy.zeros",
"numpy.random.randint",
"numpy.random.uniform"
] | [((560, 584), 'numpy.zeros', 'np.zeros', (['(N - 1, N - 1)'], {}), '((N - 1, N - 1))\n', (568, 584), True, 'import numpy as np\n'), ((591, 606), 'numpy.zeros', 'np.zeros', (['(N - 1)'], {}), '(N - 1)\n', (599, 606), True, 'import numpy as np\n'), ((657, 672), 'numpy.sum', 'np.sum', (['l[:, 1]'], {}), '(l[:, 1])\n', (66... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""Provide the wrench task.
The wrench task tries to generate a wrench near the desired one by minimizing:
.. math:: || w - k (w_{des} - w_t) ||^2
where :math:`w = [f \tau] \in \mathbb{R}^6` is the wrench vector being optimized, :math:`k` is a proportional gain,
:math:`... | [
"numpy.asarray"
] | [((3525, 3545), 'numpy.asarray', 'np.asarray', (['wrenches'], {}), '(wrenches)\n', (3535, 3545), True, 'import numpy as np\n'), ((4340, 4360), 'numpy.asarray', 'np.asarray', (['wrenches'], {}), '(wrenches)\n', (4350, 4360), True, 'import numpy as np\n')] |
import numpy as np
def trans():
print("Transpose of matrix:")
#Enter rows and columns
row=int(input("Enter number of rows:"))
column=int(input("Enter number of columns:"))
print("Enter the elements of Matrix:")
matrix_a= [[int(input()) for i in range(column)] for i in range(row)]
print("Matrix is: ")
f... | [
"numpy.array"
] | [((362, 380), 'numpy.array', 'np.array', (['matrix_a'], {}), '(matrix_a)\n', (370, 380), True, 'import numpy as np\n')] |
import numpy as np
import matplotlib.pyplot as plt
x=np.linspace(0,2*np.pi,101)
s=np.sin(x)
c=np.cos(x)
plt.close('all')
plt.subplot(2,2,1)
plt.plot(x,s,'b+',x,c,'r+')
plt.axis('tight')
plt.subplot(2,2,2)
plt.plot(x,s)
plt.grid()
plt.xlabel('radians')
plt.ylabel('amplitudes')
plt.title('sin(x)')
plt.axis('tight')
plt... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.linspace",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot"
] | [((53, 83), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(101)'], {}), '(0, 2 * np.pi, 101)\n', (64, 83), True, 'import numpy as np\n'), ((82, 91), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (88, 91), True, 'import numpy as np\n'), ((94, 103), 'numpy.cos', 'np.cos', (['x'], {}), '(x)\n', (100, 103), True... |
import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn.functional as F
from torch import nn
import os
import matplotlib.pyplot as plt
import sys
import numpy as np
sys.path.append('./')
from args import opt
sys.path.append('./lib/')
from dataset import FruitFlyNeuronDataset
from cv2... | [
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"cv2transforms.composed_transforms",
"numpy.reshape",
"torch.nn.Dropout",
"torch.nn.Sequential",
"utils.initialize_weights",
"utils.show_patches",
"os.path.join",
"torch.nn.Conv2d",
"dataset.FruitFlyNeuronDataset",
"torch.n... | [((201, 222), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (216, 222), False, 'import sys\n'), ((244, 269), 'sys.path.append', 'sys.path.append', (['"""./lib/"""'], {}), "('./lib/')\n", (259, 269), False, 'import sys\n'), ((670, 691), 'cv2transforms.composed_transforms', 'composed_transforms', ... |
import pdb
import copy
import numpy as np
import os
import scipy
import math
import torch
import torch
from pytorch3d.transforms import euler_angles_to_matrix, matrix_to_euler_angles
def read_total_poses(cam_file_path):
with open(cam_file_path) as f:
lines = f.readlines()
index_list = np.array(list(... | [
"numpy.clip",
"pytorch3d.transforms.euler_angles_to_matrix",
"math.floor",
"torch.from_numpy",
"numpy.argsort",
"numpy.array",
"scipy.misc.imresize",
"numpy.linalg.norm",
"numpy.moveaxis",
"numpy.sin",
"copy.copy",
"numpy.arange",
"torch.arange",
"numpy.multiply",
"numpy.repeat",
"nump... | [((358, 387), 'numpy.where', 'np.where', (['(index_list % 5 == 0)'], {}), '(index_list % 5 == 0)\n', (366, 387), True, 'import numpy as np\n'), ((3770, 3828), 'numpy.loadtxt', 'np.loadtxt', (['cameraPO_file'], {'dtype': 'np.float64', 'delimiter': '""" """'}), "(cameraPO_file, dtype=np.float64, delimiter=' ')\n", (3780,... |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
__all__ = ['FixupResNet', 'fixup_resnet18', 'fixup_resnet34', 'fixup_resnet50', 'fixup_resnet101', 'fixup_resnet152']
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_pla... | [
"torch.nn.BatchNorm2d",
"numpy.prod",
"torch.nn.LeakyReLU",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.randn_like",
"torch.nn.functional.interpolate",
"torch.zeros",
"torch.ones"
] | [((304, 393), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_planes', 'out_planes'], {'kernel_size': '(3)', 'stride': 'stride', 'padding': '(1)', 'bias': '(False)'}), '(in_planes, out_planes, kernel_size=3, stride=stride, padding=1,\n bias=False)\n', (313, 393), True, 'import torch.nn as nn\n'), ((508, 597), 'torch.nn.Conv2d... |
# Copyright 2021 The FLAN 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 applicable law or agreed to in wri... | [
"re.fullmatch",
"numpy.any"
] | [((1075, 1140), 'numpy.any', 'np.any', (["[('{options_}' in pattern) for pattern in input_patterns]"], {}), "([('{options_}' in pattern) for pattern in input_patterns])\n", (1081, 1140), True, 'import numpy as np\n'), ((2035, 2080), 're.fullmatch', 're.fullmatch', (['"""^(.+)_type_(\\\\d+)$"""', 'task_name'], {}), "('^... |
"""
Implements modification of human attributes at different levels.
###################### Quarantining / Behavior change logic ########################
Following orders takes care of the person faced with multiple quarantining triggers (each trigger has a suggested duration for quarantine) -
(i) (not app-base... | [
"warnings.warn",
"numpy.zeros",
"datetime.timedelta"
] | [((10598, 10630), 'numpy.zeros', 'np.zeros', (['self.n_behavior_levels'], {}), '(self.n_behavior_levels)\n', (10606, 10630), True, 'import numpy as np\n'), ((10657, 10689), 'numpy.zeros', 'np.zeros', (['self.n_behavior_levels'], {}), '(self.n_behavior_levels)\n', (10665, 10689), True, 'import numpy as np\n'), ((10712, ... |
import numpy
import random
from solution import solution
def elitism(population, scores, bestIndividual, bestScore):
"""
This melitism operator of the population
"""
# get the worst individual
worstFitnessId = selectWorstIndividual(scores)
# replace worst cromosome with best one from previous... | [
"numpy.clip",
"numpy.copy",
"random.uniform",
"numpy.unique",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.empty_like",
"numpy.concatenate",
"numpy.random.uniform",
"random.randint"
] | [((450, 476), 'numpy.copy', 'numpy.copy', (['bestIndividual'], {}), '(bestIndividual)\n', (460, 476), False, 'import numpy\n'), ((510, 531), 'numpy.copy', 'numpy.copy', (['bestScore'], {}), '(bestScore)\n', (520, 531), False, 'import numpy\n'), ((1601, 1637), 'numpy.zeros', 'numpy.zeros', (['(self.popnum, self.dim)'], ... |
# Copyright (c) 2018, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | [
"subprocess.check_call",
"numpy.get_printoptions",
"numpy.array_repr",
"im2col.im2col_indices",
"numpy.max",
"tempfile.mktemp",
"math.log",
"numpy.dot",
"numpy.zeros",
"numpy.pad",
"numpy.load",
"numpy.set_printoptions"
] | [((3925, 3982), 'subprocess.check_call', 'check_call', (['[self.execmd, self.ifilename, self.ofilename]'], {}), '([self.execmd, self.ifilename, self.ofilename])\n', (3935, 3982), False, 'from subprocess import check_call\n'), ((3998, 4021), 'numpy.load', 'np.load', (['self.ofilename'], {}), '(self.ofilename)\n', (4005,... |
import matplotlib.pyplot as plt
import numpy as np
import dynpy
bn = dynpy.bn.BooleanNetwork(rules=dynpy.sample_nets.budding_yeast_bn)
initState = np.zeros(bn.num_vars, 'uint8')
initState[ [1,3,6] ] = 1
plt.spy(bn.get_trajectory(start_state=initState, max_time=15))
plt.xlabel('Node')
plt.ylabel('Time')
| [
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"dynpy.bn.BooleanNetwork",
"matplotlib.pyplot.ylabel"
] | [((70, 135), 'dynpy.bn.BooleanNetwork', 'dynpy.bn.BooleanNetwork', ([], {'rules': 'dynpy.sample_nets.budding_yeast_bn'}), '(rules=dynpy.sample_nets.budding_yeast_bn)\n', (93, 135), False, 'import dynpy\n'), ((149, 179), 'numpy.zeros', 'np.zeros', (['bn.num_vars', '"""uint8"""'], {}), "(bn.num_vars, 'uint8')\n", (157, 1... |
from keras.models import load_model, Model
import numpy as np
import os
from src.data.shl_data import shl_min, shl_max, mean, std
from tqdm import tqdm
import seaborn as sns
import shutil
from loguru import logger
x_min = shl_min()[np.newaxis, np.newaxis, :]
x_max = shl_max()[np.newaxis, np.newaxis, :]
x_mean = mean()... | [
"loguru.logger.add",
"numpy.mean",
"os.listdir",
"keras.models.load_model",
"loguru.logger.info",
"os.makedirs",
"src.data.shl_data.std",
"src.data.shl_data.shl_max",
"src.data.shl_data.shl_min",
"numpy.load",
"numpy.save",
"src.data.shl_data.mean"
] | [((314, 320), 'src.data.shl_data.mean', 'mean', ([], {}), '()\n', (318, 320), False, 'from src.data.shl_data import shl_min, shl_max, mean, std\n'), ((329, 334), 'src.data.shl_data.std', 'std', ([], {}), '()\n', (332, 334), False, 'from src.data.shl_data import shl_min, shl_max, mean, std\n'), ((369, 466), 'loguru.logg... |
import numpy as np
def evaluate(env, agent, num_runs, max_steps=np.inf):
returns = np.zeros(num_runs)
for run_ix in range(num_runs):
env.reset()
cumulative_reward = 0.
step = 0
while env.steps_beyond_done is None and step < max_steps:
next_state_actions = env.get_sa... | [
"numpy.zeros"
] | [((89, 107), 'numpy.zeros', 'np.zeros', (['num_runs'], {}), '(num_runs)\n', (97, 107), True, 'import numpy as np\n')] |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import formatter
# m: number of machines
# n: number of jobs
# T: number of time indices
# S: schedule
# p: integer processing times
# s: inclusive integer earlest starting times
# f: exclusive itneger latest finishing times
def new_schedule(... | [
"numpy.multiply",
"numpy.repeat",
"numpy.any",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.sum",
"formatter.number_to_letters",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((3249, 3268), 'numpy.array', 'np.array', (['[2, 3, 2]'], {}), '([2, 3, 2])\n', (3257, 3268), True, 'import numpy as np\n'), ((3271, 3303), 'numpy.array', 'np.array', (['[[0, 1, 0], [1, 0, 0]]'], {}), '([[0, 1, 0], [1, 0, 0]])\n', (3279, 3303), True, 'import numpy as np\n'), ((3303, 3335), 'numpy.array', 'np.array', (... |
import tempfile, os, glob
from scipy.stats import norm as ndist
from traitlets import (HasTraits,
Integer,
Unicode,
Float,
Integer,
Instance,
Dict,
Bool... | [
"regreg.api.simple_problem",
"numpy.random.standard_normal",
"numpy.sqrt",
"numpy.array",
"scipy.stats.norm.cdf",
"rpy2.robjects.numpy2ri.activate",
"rpy2.robjects.r",
"os.path.exists",
"utils.BHfilter",
"numpy.asarray",
"os.mkdir",
"traitlets.Unicode",
"glob.glob",
"selection.randomized.l... | [((1071, 1081), 'traitlets.Float', 'Float', (['(0.2)'], {}), '(0.2)\n', (1076, 1081), False, 'from traitlets import HasTraits, Integer, Unicode, Float, Integer, Instance, Dict, Bool, default\n'), ((1100, 1125), 'traitlets.Unicode', 'Unicode', (['"""Generic method"""'], {}), "('Generic method')\n", (1107, 1125), False, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 26 21:10:16 2017
@author: dhaval
"""
import argparse
import sys
from io import BytesIO
import matplotlib
import numpy as np
import requests
from PIL import Image
matplotlib.use('agg')
import matplotlib.pyplot as plt
from keras.preprocessing impo... | [
"keras.preprocessing.image.img_to_array",
"keras.applications.inception_v3.preprocess_input",
"io.BytesIO",
"sys.exit",
"matplotlib.pyplot.imshow",
"argparse.ArgumentParser",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.axis",
"matplotlib.p... | [((236, 257), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (250, 257), False, 'import matplotlib\n'), ((830, 853), 'keras.preprocessing.image.img_to_array', 'image.img_to_array', (['img'], {}), '(img)\n', (848, 853), False, 'from keras.preprocessing import image\n'), ((862, 887), 'numpy.expand_... |
from collections import Counter
import networkx as nx
import numpy as np
from features_infra.feature_calculators import NodeFeatureCalculator, FeatureMeta
class BfsMomentsCalculator(NodeFeatureCalculator):
def is_relevant(self):
return True
def weighted_avg_and_std(self, values, weights... | [
"networkx.single_source_shortest_path_length",
"numpy.sqrt",
"numpy.average",
"numpy.asarray",
"features_infra.feature_calculators.FeatureMeta",
"measure_tests.specific_feature_test.test_specific_feature"
] | [((1560, 1602), 'features_infra.feature_calculators.FeatureMeta', 'FeatureMeta', (['BfsMomentsCalculator', "{'bfs'}"], {}), "(BfsMomentsCalculator, {'bfs'})\n", (1571, 1602), False, 'from features_infra.feature_calculators import NodeFeatureCalculator, FeatureMeta\n'), ((1719, 1785), 'measure_tests.specific_feature_tes... |
# -*- coding: utf-8 -*-
"""Oscillators are lifeforms that returns to its initial configuration after
some time"""
# Import modules
import numpy as np
from .base import Lifeform
class Blinker(Lifeform):
"""A horizontal Blinker lifeform"""
def __init__(self, length=3):
"""Initialize the class
... | [
"numpy.array",
"numpy.zeros",
"numpy.ones"
] | [((569, 611), 'numpy.ones', 'np.ones', ([], {'shape': '(self.length, 1)', 'dtype': 'int'}), '(shape=(self.length, 1), dtype=int)\n', (576, 611), True, 'import numpy as np\n'), ((836, 874), 'numpy.array', 'np.array', (['[[1, 1, 1, 0], [0, 1, 1, 1]]'], {}), '([[1, 1, 1, 0], [0, 1, 1, 1]])\n', (844, 874), True, 'import nu... |
from flare.algorithm_zoo.distributional_rl_algorithms import C51
from flare.model_zoo.distributional_rl_models import C51Model
from flare.algorithm_zoo.distributional_rl_algorithms import QRDQN
from flare.model_zoo.distributional_rl_models import QRDQNModel
from flare.algorithm_zoo.distributional_rl_algorithms import I... | [
"torch.nn.ReLU",
"math.ceil",
"flare.model_zoo.distributional_rl_models.QRDQNModel",
"math.floor",
"flare.algorithm_zoo.distributional_rl_algorithms.C51",
"numpy.array",
"torch.tensor",
"flare.algorithm_zoo.distributional_rl_algorithms.IQN",
"torch.nn.Linear",
"unittest.main",
"flare.model_zoo.d... | [((8611, 8626), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8624, 8626), False, 'import unittest\n'), ((702, 807), 'flare.model_zoo.distributional_rl_models.C51Model', 'C51Model', ([], {'dims': 'state_shape', 'num_actions': 'num_actions', 'perception_net': 'mlp', 'vmax': '(10)', 'vmin': '(-10)', 'bins': 'bins'... |
# http://github.com/timestocome
# train a raspberry pi robot to wander the house while avoiding obstacles
# and looking for cats
# this robot uses wheels for steering
# 4 wheel drive with separate controls each side
# change from off policy learning in first try
# adapted from https://morvanzhou.github.io/tutorial... | [
"numpy.zeros",
"numpy.load",
"numpy.argmax"
] | [((1191, 1218), 'numpy.zeros', 'np.zeros', (['n_distance_states'], {}), '(n_distance_states)\n', (1199, 1218), True, 'import numpy as np\n'), ((774, 789), 'numpy.load', 'np.load', (['qTable'], {}), '(qTable)\n', (781, 789), True, 'import numpy as np\n'), ((1336, 1363), 'numpy.argmax', 'np.argmax', (['q_table[i, j, :]']... |
import pandas as pd
import numpy as np
from sklearn.decomposition import PCA
from sklearn import preprocessing
import matplotlib.pyplot as plt
#load and tranpose csv data
#Data fetched on 2021-05-08
csvDataT = pd.read_csv('ticks.norm.csv')
csvData = csvDataT.T
#Symbol column like AEFES,AKBNK,AKSA...
ticks = csvDa... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"sklearn.decomposition.PCA",
"numpy.round",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.scatter",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"sklearn.preprocessing.scale",
"matplotlib.pyplot.show"
] | [((215, 244), 'pandas.read_csv', 'pd.read_csv', (['"""ticks.norm.csv"""'], {}), "('ticks.norm.csv')\n", (226, 244), True, 'import pandas as pd\n'), ((672, 702), 'sklearn.preprocessing.scale', 'preprocessing.scale', (['csvData.T'], {}), '(csvData.T)\n', (691, 702), False, 'from sklearn import preprocessing\n'), ((709, 7... |
import random
import os
import time
import neat
import visualize
import pickle
from bareSnake import snakeGame
import numpy as np
import math
from neat.graphs import feed_forward_layers
from neat.graphs import required_for_output
import tensorflow as tf
tf.config.run_functions_eagerly(True)
import pandas as pd
df = ... | [
"pandas.read_csv",
"neat.Population",
"tensorflow.config.run_functions_eagerly",
"os.path.join",
"neat.nn.FeedForwardNetwork.create",
"numpy.argsort",
"numpy.array",
"os.path.dirname",
"neat.config.Config"
] | [((255, 292), 'tensorflow.config.run_functions_eagerly', 'tf.config.run_functions_eagerly', (['(True)'], {}), '(True)\n', (286, 292), True, 'import tensorflow as tf\n'), ((320, 348), 'pandas.read_csv', 'pd.read_csv', (['"""testData3.csv"""'], {}), "('testData3.csv')\n", (331, 348), True, 'import pandas as pd\n'), ((165... |
import sys
import os
import glob
import logging
import operator
import time
import pickle
import multiprocessing as mp
import numpy as np
from datetime import datetime
from Bio.PDB import *
import copy
import gc
# python 3 compatibility
from functools import reduce
from past.builtins import map
sys.path.append('../..... | [
"numpy.sqrt",
"numpy.array",
"pymol.finish_launching",
"copy.deepcopy",
"sys.exit",
"pymol.cmd.zoom",
"sys.path.append",
"pymol.cmd.png",
"numpy.dot",
"pymol.cmd.color",
"pymol.cmd.show",
"pickle.load",
"pymol.cmd.hide",
"os.path.isfile",
"numpy.linalg.svd",
"pymol.cmd.alignto",
"num... | [((298, 323), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (313, 323), False, 'import sys\n'), ((345, 373), 'sys.path.append', 'sys.path.append', (['scripts_dir'], {}), '(scripts_dir)\n', (360, 373), False, 'import sys\n'), ((629, 646), 'numpy.sqrt', 'np.sqrt', (['(rmsd / N)'], {}), '(r... |
import csv
import numpy as np
def getDataSource(data_path):
coffee_in_ml = []
sleep_in_hours = []
with open(data_path) as csv_file:
csv_reader = csv.DictReader(csv_file)
for row in csv_reader:
coffee_in_ml.append(float(row["Coffee in ml"]))
sleep_in_hours... | [
"csv.DictReader",
"numpy.corrcoef"
] | [((469, 514), 'numpy.corrcoef', 'np.corrcoef', (["datasource['x']", "datasource['y']"], {}), "(datasource['x'], datasource['y'])\n", (480, 514), True, 'import numpy as np\n'), ((175, 199), 'csv.DictReader', 'csv.DictReader', (['csv_file'], {}), '(csv_file)\n', (189, 199), False, 'import csv\n')] |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torchvision.utils as vutils
from torchvision.u... | [
"numpy.array",
"torch.cuda.is_available",
"torchvision.utils.make_grid",
"numpy.save",
"argparse.ArgumentParser",
"shutil.copy2",
"torch.set_default_tensor_type",
"matplotlib.pyplot.close",
"torchvision.transforms.ToTensor",
"torch.autograd.Variable",
"random.randint",
"matplotlib.pyplot.savef... | [((539, 560), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (553, 560), False, 'import matplotlib\n'), ((740, 765), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (763, 765), False, 'import argparse\n'), ((4317, 4369), 'utils.Logger', 'Logger', (["(opt.experiment + '/log... |
import numpy as np
import logging
import time
from stereovis.framed.algorithms import StereoMRF
from spinn_utilities.progress_bar import ProgressBar
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
logger = logging.getLogger(__file__)
class FramebasedStereoMatching(object):
def __init__(... | [
"logging.getLogger",
"matplotlib.use",
"numpy.searchsorted",
"numpy.asarray",
"spinn_utilities.progress_bar.ProgressBar",
"stereovis.framed.algorithms.StereoMRF",
"time.time"
] | [((168, 189), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (182, 189), False, 'import matplotlib\n'), ((233, 260), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (250, 260), False, 'import logging\n'), ((1364, 1393), 'numpy.asarray', 'np.asarray', (['self.depth_fr... |
from __future__ import print_function
import os
import sys
import time
import argparse
import numpy as np
import xml.dom.minidom as xdom
from os.path import realpath, join, isdir, isfile, dirname, splitext
from ..core.environ import environ
U_ROOT = u"SimulationData"
U_JOB = u"job"
U_DATE = u"date"
U_EVAL = u"Evaluati... | [
"xml.dom.minidom.parse",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"numpy.corrcoef",
"numpy.polyfit",
"numpy.delete",
"matplotlib.pyplot.clf",
"os.path.splitext",
"numpy.argsort",
"numpy.array",
"bokeh.plotting.gridplot",
"os.path.realpath",
"os.path.dirname",
"os.path.isfile... | [((3815, 3835), 'xml.dom.minidom.parse', 'xdom.parse', (['filepath'], {}), '(filepath)\n', (3825, 3835), True, 'import xml.dom.minidom as xdom\n'), ((5415, 5429), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (5423, 5429), True, 'import numpy as np\n'), ((6756, 6769), 'numpy.argsort', 'np.argsort', (['y'], {})... |
'''
This code will produce a porkchop plot of the J function over a range of launch times and flight times
'''
import math
import numpy
import PyKEP as pk
import matplotlib.pyplot as plt
import Vector
p1 = pk.planet.jpl_lp('earth')
p2 = pk.planet.mpcorb('99942 19.2 0.15 K107N 202.49545 126.41859 204.43202 3.3... | [
"PyKEP.planet.mpcorb",
"matplotlib.pyplot.colorbar",
"PyKEP.planet.jpl_lp",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.isnan",
"PyKEP.epoch",
"numpy.nanmax",
"numpy.nanmin",
"numpy.meshgrid",
"math.exp",
"PyKEP.lambert_exposin",
"matplotlib.pyplot.show"
] | [((207, 232), 'PyKEP.planet.jpl_lp', 'pk.planet.jpl_lp', (['"""earth"""'], {}), "('earth')\n", (223, 232), True, 'import PyKEP as pk\n'), ((238, 470), 'PyKEP.planet.mpcorb', 'pk.planet.mpcorb', (['"""99942 19.2 0.15 K107N 202.49545 126.41859 204.43202 3.33173 0.1911104 1.11267324 0.9223398 1 MPO164109 13... |
import numpy as np
import scipy.constants as c
import math, cmath
from sympy import *
from math import e
import numba
from numba import jit
import sympy as sp
r, x, a, theta = symbols('r x a theta')
init_printing(use_unicode=True)
@jit(nopython=True, cache=True, parallel=True)
def spherical_to_cartesian(r, theta, phi)... | [
"math.factorial",
"math.sqrt",
"numpy.array",
"cmath.exp",
"numba.jit",
"numpy.linspace",
"numpy.cos",
"numpy.sin",
"numpy.meshgrid",
"numpy.vectorize",
"numpy.round",
"numpy.arctan"
] | [((233, 278), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'cache': '(True)', 'parallel': '(True)'}), '(nopython=True, cache=True, parallel=True)\n', (236, 278), False, 'from numba import jit\n'), ((449, 494), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'cache': '(True)', 'parallel': '(True)'}), '(nopython=True,... |
## Bootstrapped from https://github.com/cfld/locusts
import os
import random
import backoff
import rasterio
import ee
ee.Initialize()
from polygon_geohasher.polygon_geohasher import geohash_to_polygon, polygon_to_geohashes
from shapely import geometry
import urllib
from urllib.request import urlretrieve
import numpy ... | [
"os.makedirs",
"urllib.request.urlretrieve",
"numpy.random.choice",
"rasterio.open",
"os.path.join",
"ee.ImageCollection",
"shapely.geometry.mapping",
"backoff.on_exception",
"scipy.spatial.ConvexHull",
"numpy.array",
"shapely.geometry.Polygon",
"polygon_geohasher.polygon_geohasher.geohash_to_... | [((120, 135), 'ee.Initialize', 'ee.Initialize', ([], {}), '()\n', (133, 135), False, 'import ee\n'), ((849, 940), 'backoff.on_exception', 'backoff.on_exception', (['backoff.constant', 'urllib.error.HTTPError'], {'max_tries': '(4)', 'interval': '(2)'}), '(backoff.constant, urllib.error.HTTPError, max_tries=4,\n inter... |
import pandas as pd
import numpy as np
from misc import data_io
DATA_DIR = 'data/ut-interaction/'
""" Folder structure
<'set1' or 'set2'>/keypoints
<video_name>/
<video_name>_<frame_num>_keypoints.json
...
Ex: DATA_DIR + 'set1/keypoints/0_1_4/0_1_4_000000000042_keypoints.json'
"""
VIDEOS = [
... | [
"pandas.DataFrame",
"misc.data_io.get_data",
"numpy.arange"
] | [((5236, 5295), 'misc.data_io.get_data', 'data_io.get_data', (['gt_split'], {'pose_style': '"""OpenPose"""'}), "(gt_split, pose_style='OpenPose', **kwargs)\n", (5252, 5295), False, 'from misc import data_io\n'), ((2532, 2545), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (2541, 2545), True, 'import numpy as n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Benchmark different GUI image draw times in tkinter
Environment setup instructions:
conda create -n gui-test tk matplotlib pillow vispy
pip install pyopengltk
"""
import time
import tkinter as tk
import numpy as np
from PIL import Image, ImageTk
from matplo... | [
"vispy.app.use_app",
"PIL.Image.fromarray",
"vispy.scene.visuals.Image",
"matplotlib.figure.Figure",
"vispy.scene.SceneCanvas",
"numpy.random.randint",
"tkinter.Tk",
"tkinter.Label",
"vispy.scene.PanZoomCamera",
"time.time",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
] | [((646, 653), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (651, 653), True, 'import tkinter as tk\n'), ((671, 682), 'time.time', 'time.time', ([], {}), '()\n', (680, 682), False, 'import time\n'), ((745, 756), 'time.time', 'time.time', ([], {}), '()\n', (754, 756), False, 'import time\n'), ((817, 842), 'tkinter.Label', 't... |
#!/usr/bin/python
import kaldi_io
import sys
import os
from os.path import join, isdir
from numpy.random import permutation
import itertools
import keras
import numpy as np
from keras.preprocessing.sequence import pad_sequences
import queue
from threading import Thread
import random
import glob
import sys
sys.path.in... | [
"sys.path.insert",
"kaldi_io.read_mat",
"random.shuffle",
"numpy.zeros",
"threading.Thread",
"queue.Queue",
"MT_TransV1.CMVN.CMVN"
] | [((309, 375), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/mnt/matylda3/vydana/HOW2_EXP/MT_Transformer"""'], {}), "(0, '/mnt/matylda3/vydana/HOW2_EXP/MT_Transformer')\n", (324, 375), False, 'import sys\n'), ((1558, 1595), 'queue.Queue', 'queue.Queue', (["input_dict['queue_size']"], {}), "(input_dict['queue_size'... |
"""Standard library imports"""
import numpy as np # 1.19.4
import pandas as pd # 1.2.0
import scipy as sp #
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from scipy.optimize import fsolve
"""Local modules"""
from pyloads.blade_data import BladeFeatures
from pyloads.aerodynamic_profiles impo... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"pyloads.blade_data.BladeFeatures",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.sin",
"pyloads.aerodynamic_profiles.AeroProfiles",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"pandas.DataFrame",
"numpy.rad2... | [((1130, 1596), 'pandas.DataFrame', 'pd.DataFrame', (["{'u': [4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, \n 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0], 'pitch': [\n 2.751, 1.966, 0.896, 0.0, 0.0, 0.0, 0.0, 0.0, 4.502, 7.266, 9.292, \n 10.958, 12.499, 13.896, 15.2, 16.432... |
import numpy as np
from sklearn.metrics import average_precision_score
def load_data(data_path):
"""load array data from data_path"""
data = np.load(data_path)
return data['X_train'], data['y_train'], data['X_test'], data['y_test']
def calculate_average_precision(label, index, similarity, num_search_sam... | [
"numpy.where",
"numpy.array",
"numpy.load",
"sklearn.metrics.average_precision_score"
] | [((151, 169), 'numpy.load', 'np.load', (['data_path'], {}), '(data_path)\n', (158, 169), True, 'import numpy as np\n'), ((473, 512), 'numpy.array', 'np.array', (['[label[idx] for idx in index]'], {}), '([label[idx] for idx in index])\n', (481, 512), True, 'import numpy as np\n'), ((544, 573), 'numpy.where', 'np.where',... |
"""Module that handles shared information for all network objects."""
import xml.etree.ElementTree as et
import numbers
import numpy as np
import pandas as pd
import scipy.sparse as sps
from paminco.utils.readin import parse_number, xml_find_root
from paminco.utils.misc import Cache
from paminco.utils.typing import s... | [
"numpy.hstack",
"paminco.utils.misc.Cache",
"paminco.utils.typing.sparse_format",
"numpy.argsort",
"numpy.array",
"numpy.savez",
"numpy.where",
"numpy.delete",
"numpy.sort",
"scipy.sparse.coo_matrix",
"pandas.DataFrame",
"scipy.sparse.csr_matrix",
"numpy.ones",
"paminco.utils.typing.is_int... | [((7761, 7799), 'numpy.array', 'np.array', (['labels'], {'dtype': 'str', 'copy': 'copy'}), '(labels, dtype=str, copy=copy)\n', (7769, 7799), True, 'import numpy as np\n'), ((7823, 7868), 'numpy.array', 'np.array', (['indices'], {'dtype': 'dtype_int', 'copy': 'copy'}), '(indices, dtype=dtype_int, copy=copy)\n', (7831, 7... |
import functools
import gc
import itertools
import logging
import pathlib
import shutil
import hetnetpy.hetnet
import hetnetpy.matrix
import hetnetpy.permute
import hetnetpy.readwrite
import numpy
import pandas
import scipy.sparse
import hetmatpy.degree_weight
import hetmatpy.matrix
def hetmat_from_graph(
graph... | [
"pandas.read_csv",
"shutil.move",
"pathlib.Path",
"itertools.product",
"logging.warning",
"itertools.count",
"gc.collect",
"shutil.rmtree",
"pandas.DataFrame",
"functools.lru_cache",
"numpy.load",
"pandas.concat",
"numpy.save"
] | [((3935, 3953), 'pathlib.Path', 'pathlib.Path', (['path'], {}), '(path)\n', (3947, 3953), False, 'import pathlib\n'), ((7334, 7355), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (7353, 7355), False, 'import functools\n'), ((10614, 10635), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n'... |
r"""
=========================================================
Utilities Abaqus (:mod:`desicos.abaqus.abaqus_functions`)
=========================================================
.. currentmodule:: desicos.abaqus.abaqus_functions
Includes all utilities functions that must be executed from Abaqus.
"""
from __future__... | [
"abaqus.session.autoColors.setValues",
"numpy.cross",
"abaqus.session.psOptions.setValues",
"abaqus.session.xyDataObjects.keys",
"abaqus.session.xyPlots.keys",
"abaqus.session.XYPlot",
"numpy.array",
"numpy.concatenate",
"abaqus.session.printToFile",
"abaqus.session.printOptions.setValues",
"aba... | [((761, 789), 'abaqus.session.xyDataObjects.keys', 'session.xyDataObjects.keys', ([], {}), '()\n', (787, 789), False, 'from abaqus import session\n'), ((1003, 1031), 'abaqus.session.xyDataObjects.keys', 'session.xyDataObjects.keys', ([], {}), '()\n', (1029, 1031), False, 'from abaqus import session\n'), ((1112, 1137), ... |
__author__ = 'Dante'
import random
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score as acc
import numpy as np
import density_weight as dw
import matplotlib as plt
from matplotlib import pyplot
import math
from sklearn import cross_validation as cv
from collections import Counter
impor... | [
"matplotlib.pyplot.ylabel",
"math.sqrt",
"numpy.array",
"matplotlib.pyplot.errorbar",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"random.sample",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.xlim",
"sklearn.metrics.accuracy_score",
"matplotlib.pyplot.legend",
... | [((5006, 5126), 'matplotlib.pyplot.errorbar', 'pyplot.errorbar', (['n', 'rand_avg'], {'fmt': '"""s-"""', 'yerr': 'rand_err', 'color': '"""darkred"""', 'markersize': '(9)', 'lw': '(2)', 'label': '"""Random Selection"""'}), "(n, rand_avg, fmt='s-', yerr=rand_err, color='darkred',\n markersize=9, lw=2, label='Random Se... |
"""
filename: generic_model.py
author: <NAME>
version: 15.04.2021
description: helper functions (plotting, report generation, vgg base model)
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
import cv2
from glob import glob
from sklearn.metrics import confusion_mat... | [
"matplotlib.pyplot.ylabel",
"sklearn.metrics.classification_report",
"sklearn.metrics.roc_auc_score",
"numpy.array",
"tensorflow.keras.layers.Dense",
"sklearn.preprocessing.LabelBinarizer",
"tensorflow.keras.layers.Input",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.yt... | [((1888, 1947), 'sklearn.model_selection.train_test_split', 'train_test_split', (['covid_images', 'covid_labels'], {'test_size': '(0.2)'}), '(covid_images, covid_labels, test_size=0.2)\n', (1904, 1947), False, 'from sklearn.model_selection import train_test_split\n'), ((2015, 2076), 'sklearn.model_selection.train_test_... |
# -*- coding: utf-8 -*-
"""
femagtools.dxfsl.machine
~~~~~~~~~~~~~~~~~~~~~~~~
a machine consists of 2 parts and has a geometry
Authors: <NAME>, <NAME>
"""
from __future__ import print_function
import numpy as np
import logging
from .shape import Element, Circle, Arc, Line, Shape
from .corner import Cor... | [
"logging.getLogger",
"numpy.abs",
"numpy.isclose"
] | [((640, 676), 'logging.getLogger', 'logging.getLogger', (['"""femagtools.geom"""'], {}), "('femagtools.geom')\n", (657, 676), False, 'import logging\n'), ((3251, 3283), 'numpy.isclose', 'np.isclose', (['self.startangle', '(0.0)'], {}), '(self.startangle, 0.0)\n', (3261, 3283), True, 'import numpy as np\n'), ((9954, 999... |
import torch.nn as nn
import torch
import numpy as np
class VNet(nn.Module):
def __init__(self, nb_classes, in_channels=1, depth=5,
start_filters=16, batchnorm=True, mode="AE", input_size=None):
assert mode in ['AE', 'classifier'], "Unknown mode selected, currently supported are: 'AE' an... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.ConvTranspose3d",
"torch.nn.init.constant_",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.nn.init.xavier_normal_",
"numpy.array",
"torch.nn.init.normal_",
"torch.nn.Linear",
"torch.nn.BatchNorm3d",
"torch.cat",
"torch.nn.Conv3d"
] | [((1836, 1860), 'torch.nn.ModuleList', 'nn.ModuleList', (['self.down'], {}), '(self.down)\n', (1849, 1860), True, 'import torch.nn as nn\n'), ((4131, 4144), 'torch.nn.ReLU', 'nn.ReLU', (['(True)'], {}), '(True)\n', (4138, 4144), True, 'import torch.nn as nn\n'), ((4164, 4208), 'torch.nn.Sequential', 'nn.Sequential', ([... |
"""
Filename: visualization.py
Purpose: Set of go-to plotting functions
Author: <NAME>
Date created: 28.11.2018
Possible problems:
1.
"""
import os
import numpy as np
from tractor.galaxy import ExpGalaxy
from tractor import EllipseE
from tractor.galaxy import ExpGalaxy
import matplotlib
matplotlib.use('Agg')
impor... | [
"logging.getLogger",
"numpy.log10",
"numpy.sqrt",
"numpy.nanpercentile",
"skimage.segmentation.find_boundaries",
"numpy.nanmean",
"numpy.array",
"scipy.stats.normaltest",
"numpy.nanmin",
"numpy.arange",
"matplotlib.colors.LogNorm",
"numpy.mean",
"astropy.visualization.hist",
"numpy.max",
... | [((293, 314), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (307, 314), False, 'import matplotlib\n'), ((728, 769), 'logging.getLogger', 'logging.getLogger', (['"""farmer.visualization"""'], {}), "('farmer.visualization')\n", (745, 769), False, 'import logging\n'), ((857, 875), 'numpy.arange', '... |
import os
from unittest import mock
import idelib
import numpy as np
import pandas as pd
import pytest
import hypothesis as hyp
import hypothesis.strategies as hyp_st
import hypothesis.extra.numpy as hyp_np
import endaq.batch.analyzer
from endaq.calc.stats import rms, L2_norm
np.random.seed(0)
@pytest.fixture()
d... | [
"pandas.Series",
"pytest.approx",
"numpy.mean",
"unittest.mock.Mock",
"unittest.mock.create_autospec",
"numpy.random.random",
"endaq.calc.stats.rms",
"os.path.join",
"hypothesis.strategies.floats",
"numpy.timedelta64",
"numpy.random.seed",
"pytest.fixture",
"pandas.testing.assert_frame_equal... | [((281, 298), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (295, 298), True, 'import numpy as np\n'), ((302, 318), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (316, 318), False, 'import pytest\n'), ((443, 459), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (457, 459), False, 'import ... |
from numpy import array
def scigrid_2011_01_04_13():
ppc = {"version": '2'}
ppc["baseMVA"] = 100.0
ppc["bus"] = array([
[586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ],
[589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ],
[590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,... | [
"numpy.array"
] | [((115, 105634), 'numpy.array', 'array', (['[[586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9], [589, 2, 0, 0, 0, 0, \n 0, 1.0, 0, 380.0, 0, 1.1, 0.9], [590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, \n 0, 1.1, 0.9], [593, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9], [594,\n 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Created on 18/10/11 16:32:52
@author: <NAME>
"""
from collections import Counter
from typing import List
import numpy as np
from antNRE.lib.k_means import KMeans
class DataLoader:
def __init__(self,
datasets: List,
n_bkts: int) -> None:
len_counter = Co... | [
"collections.Counter",
"antNRE.lib.k_means.KMeans",
"numpy.random.shuffle"
] | [((318, 327), 'collections.Counter', 'Counter', ([], {}), '()\n', (325, 327), False, 'from collections import Counter\n'), ((443, 470), 'antNRE.lib.k_means.KMeans', 'KMeans', (['n_bkts', 'len_counter'], {}), '(n_bkts, len_counter)\n', (449, 470), False, 'from antNRE.lib.k_means import KMeans\n'), ((1603, 1629), 'numpy.... |
#!/usr/bin/env python
# coding: utf-8
# In[3]:
from sklearn import svm, datasets
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
url = "C:/Users/USUARIO/Desktop/Tesis/centroides-Apriori4.csv"
datos = pd.read_csv(url, sep=",")
# In[5]:
iris = datos
# Add noisy featur... | [
"sklearn.preprocessing.label_binarize",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"numpy.random.RandomState",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.linspace",
"matplotlib.pyplot.ylim",
"itertools.cycle",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.ave... | [((248, 273), 'pandas.read_csv', 'pd.read_csv', (['url'], {'sep': '""","""'}), "(url, sep=',')\n", (259, 273), True, 'import pandas as pd\n'), ((338, 362), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (359, 362), True, 'import numpy as np\n'), ((560, 638), 'sklearn.model_selection.train_... |
# Hacktoberfest 2021
# Problem: House Prices
#
# You are given an array that represents house prices.
# Calculate and output the percentage of houses that are within one standard deviation from the mean.
# To calculate the percentage, divide the number of houses that satisfy the condition by the total number of h... | [
"numpy.array",
"numpy.mean",
"numpy.std"
] | [((391, 534), 'numpy.array', 'np.array', (['[150000, 125000, 320000, 540000, 200000, 120000, 160000, 230000, 280000, \n 290000, 300000, 500000, 420000, 100000, 150000, 280000]'], {}), '([150000, 125000, 320000, 540000, 200000, 120000, 160000, 230000, \n 280000, 290000, 300000, 500000, 420000, 100000, 150000, 2800... |
#xyz Sep 2017
'''
Data preparation for datsets: stanford_indoor, scannet, ETH_semantic3D
Core idea: store all the information in hdf5 file itself
# The workflow to use this tool:
Raw_H5f -> Sorted_H5f -> merge block to get new block size -> randomnly select n points
-> Normed_H5f -> Net_Provider
## Raw_H5f store ... | [
"datasets_meta.DatasetsMeta",
"numpy.hstack",
"numpy.array2string",
"numpy.array",
"sys.path.append",
"numpy.arange",
"os.path.exists",
"numpy.searchsorted",
"numpy.sort",
"numpy.fix",
"numpy.max",
"numpy.rint",
"numpy.concatenate",
"numpy.min",
"numpy.maximum",
"glob.glob",
"numpy.c... | [((1444, 1469), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (1459, 1469), False, 'import os\n'), ((1470, 1495), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (1485, 1495), False, 'import sys\n'), ((1789, 1835), 'sys.path.append', 'sys.path.append', (["(BASE_DIR ... |
# -*- coding: utf-8 -*-
"""Supports Kp index values. Downloads data from ftp.gfz-potsdam.de or SWPC.
Parameters
----------
platform
'sw'
name
'kp'
tag
- '' : Standard Kp data
- 'forecast' : Grab forecast data from SWPC (next 3 days)
- 'recent' : Grab last 30 days of Kp data from SWPC
Note
----
Sta... | [
"logging.getLogger",
"pandas.read_csv",
"pysat.Files.from_os",
"numpy.array",
"numpy.isfinite",
"pysat.datetime.now",
"pandas.date_range",
"numpy.arange",
"os.remove",
"ftplib.FTP",
"pysat.datetime.strptime",
"numpy.where",
"pandas.DataFrame",
"sys.stdout.flush",
"pandas.read_fwf",
"py... | [((2093, 2120), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2110, 2120), False, 'import logging\n'), ((2384, 2404), 'pysat.datetime.now', 'pysat.datetime.now', ([], {}), '()\n', (2402, 2404), False, 'import pysat\n'), ((2413, 2457), 'pysat.datetime', 'pysat.datetime', (['now.year', 'n... |
from sklearn.preprocessing import MinMaxScaler, StandardScaler
import numpy as np
import pandas as pd
import torch
from torch import nn
import matplotlib.pyplot as plt
import pickle
from IPython import display
from .useful import ts as src
from .useful import iterators
from .models import lstm as models... | [
"matplotlib.pyplot.ylabel",
"numpy.array",
"torch.nn.MSELoss",
"torch.cuda.is_available",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.datetime64",
"pandas.DataFrame",
"sklearn.preprocessing.MinMaxScaler",
"matplotlib.pyplot.axvspan",
"pickle.loa... | [((27389, 27416), 'numpy.datetime64', 'np.datetime64', (['df.index[-1]'], {}), '(df.index[-1])\n', (27402, 27416), True, 'import numpy as np\n'), ((27439, 27482), 'numpy.timedelta64', 'np.timedelta64', (['(df.index[-1] - df.index[-2])'], {}), '(df.index[-1] - df.index[-2])\n', (27453, 27482), True, 'import numpy as np\... |
## Linear Regression Channel
## Ref https://medium.com/coinmonks/trading-bitcoin-with-linear-regression-channels-b84e7e43d984
from google.protobuf import symbol_database
from st_stock.stocky import get_assets
from typing import List
from datetime import datetime
import seaborn as sns
from matplotlib import pyplot a... | [
"seaborn.set",
"seaborn.regplot",
"numpy.log",
"streamlit.write",
"st_stock.misc.load_config",
"st_stock.misc.load_cypto_symbols",
"streamlit.dataframe",
"st_stock.stocky.get_assets",
"streamlit.sidebar.selectbox",
"numpy.std",
"streamlit.header",
"matplotlib.pyplot.subplots"
] | [((931, 976), 'st_stock.stocky.get_assets', 'get_assets', (['symbol', 'period'], {'interval': 'interval'}), '(symbol, period, interval=interval)\n', (941, 976), False, 'from st_stock.stocky import get_assets\n'), ((1113, 1129), 'numpy.log', 'np.log', (['df.Close'], {}), '(df.Close)\n', (1119, 1129), True, 'import numpy... |
'''
Author <NAME>
Date 5/21/2021
utility functions for train and predict data generators
'''
import cv2
import numpy as np
import re
from joblib import Parallel, delayed
def sort_frame_crop_filenames(filenames):
def find_frame_crop_number(filename):
filename = filename.split('/')[-1]
... | [
"re.compile",
"joblib.Parallel",
"numpy.sum",
"numpy.zeros",
"joblib.delayed"
] | [((2277, 2305), 'numpy.zeros', 'np.zeros', (['mask_list.shape[0]'], {}), '(mask_list.shape[0])\n', (2285, 2305), True, 'import numpy as np\n'), ((2582, 2610), 'numpy.zeros', 'np.zeros', (['mask_list.shape[0]'], {}), '(mask_list.shape[0])\n', (2590, 2610), True, 'import numpy as np\n'), ((4390, 4411), 're.compile', 're.... |
import glob, os, pickle, datetime, time, re, pprint
import matplotlib.pyplot as plt
import numpy as np
from src import plotter, graphs
from src.mltoolbox.metrics import METRICS
from src.utils import *
from shutil import copyfile, rmtree
from src.plotter import Plotter
def main():
# SETUP BEGIN
test_folder_pat... | [
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.supt... | [((1867, 1888), 'numpy.array', 'np.array', (['pred_ratios'], {}), '(pred_ratios)\n', (1875, 1888), True, 'import numpy as np\n'), ((1917, 1947), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {'figsize': '(12, 6)'}), '(1, figsize=(12, 6))\n', (1927, 1947), True, 'import matplotlib.pyplot as plt\n'), ((1952, 1982),... |
import matplotlib.pyplot as plt
import numpy as np
from rich.prompt import Confirm
from loguru import logger
from fcutils.progress import track
from slam import Environment, Agent
# create env
env = Environment()
# create agent
agent = Agent(env, x=20, y=10, angle=np.random.uniform(10, 80))
agent.update_map_every ... | [
"rich.prompt.Confirm.ask",
"slam.Environment",
"loguru.logger.warning",
"numpy.random.uniform",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((203, 216), 'slam.Environment', 'Environment', ([], {}), '()\n', (214, 216), False, 'from slam import Environment, Agent\n'), ((362, 392), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(10, 10)'}), '(figsize=(10, 10))\n', (374, 392), True, 'import matplotlib.pyplot as plt\n'), ((464, 474), 'matplotl... |
import pandas as pd
import houghtest
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
import cv2
import numpy as np
import pickle
from multiprocessing import Process
import tim... | [
"cv2.imwrite",
"multiprocessing.Process",
"houghtest.main",
"numpy.array",
"numpy.zeros",
"time.time",
"cv2.imread"
] | [((7165, 7176), 'time.time', 'time.time', ([], {}), '()\n', (7174, 7176), False, 'import time\n'), ((7299, 7322), 'cv2.imread', 'cv2.imread', (['img_path_or'], {}), '(img_path_or)\n', (7309, 7322), False, 'import cv2\n'), ((7518, 7541), 'multiprocessing.Process', 'Process', ([], {'target': 'thread1'}), '(target=thread1... |
import sys, re
import PyQt5
from PyQt5.QtWidgets import QApplication, QLineEdit, QMainWindow, QMessageBox, QDialog, QPushButton, QLabel, QTableWidget, QTableWidgetItem, QVBoxLayout, QHeaderView, QSpinBox, QDoubleSpinBox, QGraphicsView, QTableWidgetItem
from PyQt5 import uic
from PyQt5.QtCore import pyqtSlot, QDate,... | [
"PyQt5.QtWidgets.QSpinBox",
"matplotlib.pyplot.ylabel",
"PyQt5.uic.loadUi",
"PyQt5.QtGui.QPixmap.fromImage",
"PyQt5.QtGui.QImage",
"numpy.array",
"PyQt5.QtWidgets.QMessageBox.question",
"os.remove",
"os.path.exists",
"os.listdir",
"PyQt5.QtCore.QDate.currentDate",
"matplotlib.pyplot.plot",
"... | [((742, 765), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (763, 765), False, 'import datetime\n'), ((1192, 1203), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1201, 1203), False, 'import shutil, os\n'), ((1156, 1172), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (1165, 1172), Fals... |
import numpy as np
import torch
from mmhuman3d.core.filter.builder import build_filter
# test different data type
def test_data_type_torch():
noisy_input = torch.randn((100, 17, 3))
cfg = dict(type='OneEuroFilter', min_cutoff=0.004, beta=0.7)
oneeuro = build_filter(cfg)
out_g = oneeuro(noisy_input)
... | [
"torch.abs",
"numpy.random.rand",
"torch.mean",
"torch.cuda.is_available",
"mmhuman3d.core.filter.builder.build_filter",
"torch.zeros",
"torch.randn"
] | [((164, 189), 'torch.randn', 'torch.randn', (['(100, 17, 3)'], {}), '((100, 17, 3))\n', (175, 189), False, 'import torch\n'), ((269, 286), 'mmhuman3d.core.filter.builder.build_filter', 'build_filter', (['cfg'], {}), '(cfg)\n', (281, 286), False, 'from mmhuman3d.core.filter.builder import build_filter\n'), ((394, 411), ... |
import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
df = pd.read_csv("C:/Users/Elton/Downloads/temperature.csv")
print(df.head())
#Extração de X e Y
x,y = df[['temperatura']].values, df[['classification']].values
print('x:\n',x)
print('y:\n',y)
#Prós processamento
from sklearn.preprocessing ... | [
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"numpy.linspace",
"pandas.DataFrame",
"matplotlib.pyplot.show"
] | [((83, 138), 'pandas.read_csv', 'pd.read_csv', (['"""C:/Users/Elton/Downloads/temperature.csv"""'], {}), "('C:/Users/Elton/Downloads/temperature.csv')\n", (94, 138), True, 'import pandas as pd\n'), ((451, 465), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (463, 465), False, 'from sklearn.prep... |
import cv2
import os
import json
import numpy as np
import editdistance
from spellchecker import SpellChecker
from linesegm2.LineSegmentation import LineSegmentation
from Model import Model
from SamplePreprocessor import preprocess
from DataLoader import Batch
from WordSegmentation import wordSegmentation, prepareImg
... | [
"cv2.rectangle",
"os.path.exists",
"WordSegmentation.prepareImg",
"cv2.imwrite",
"numpy.ones",
"cv2.threshold",
"cv2.erode",
"spellchecker.SpellChecker",
"os.path.join",
"WordSegmentation.wordSegmentation",
"os.mkdir",
"linesegm2.LineSegmentation.LineSegmentation",
"json.load",
"DataLoader... | [((477, 495), 'DataLoader.Batch', 'Batch', (['None', '[img]'], {}), '(None, [img])\n', (482, 495), False, 'from DataLoader import Batch\n'), ((564, 578), 'spellchecker.SpellChecker', 'SpellChecker', ([], {}), '()\n', (576, 578), False, 'from spellchecker import SpellChecker\n'), ((988, 1029), 'os.path.exists', 'os.path... |
import os
import traceback
import cv2
import numpy as np
from keras.models import load_model
from flask import flash, request, redirect, url_for, render_template
from werkzeug.utils import secure_filename
from app import app
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif', 'jfif'}
model = load_model(... | [
"flask.render_template",
"app.app.run",
"keras.models.load_model",
"numpy.reshape",
"flask.flash",
"os.path.join",
"numpy.argmax",
"flask.url_for",
"flask.redirect",
"app.app.route",
"werkzeug.utils.secure_filename",
"cv2.resize",
"traceback.print_exc",
"cv2.imread"
] | [((309, 354), 'keras.models.load_model', 'load_model', (["('model' + os.sep + 'inception_v3')"], {}), "('model' + os.sep + 'inception_v3')\n", (319, 354), False, 'from keras.models import load_model\n'), ((483, 497), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (492, 497), False, 'from app import app\n')... |
import numpy as np
import re
from utils import get_input
class Board:
def __init__(self, grid):
self.array = np.array(grid).astype('int')
self.drawn = np.zeros((5,5))
self.bingo = False
def update(self, draw):
hits = self.array == draw
self.drawn[hits] = 1
... | [
"numpy.array",
"re.split",
"numpy.zeros",
"utils.get_input"
] | [((2241, 2263), 'utils.get_input', 'get_input', (['"""day04.txt"""'], {}), "('day04.txt')\n", (2250, 2263), False, 'from utils import get_input\n'), ((173, 189), 'numpy.zeros', 'np.zeros', (['(5, 5)'], {}), '((5, 5))\n', (181, 189), True, 'import numpy as np\n'), ((725, 746), 're.split', 're.split', (['"""\\\\D+"""', '... |
#!/usr/bin/env python3
# encoding: utf-8
from collections import defaultdict
from copy import deepcopy
from typing import Dict, List
import numpy as np
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.side_channel.engine_configuration_channel import \
EngineConfigurationChannel
... | [
"rls.utils.np_utils.get_discrete_action_list",
"mlagents_envs.side_channel.engine_configuration_channel.EngineConfigurationChannel",
"mlagents_envs.side_channel.environment_parameters_channel.EnvironmentParametersChannel",
"numpy.asarray",
"numpy.logical_or",
"rls.common.specs.SensorSpec",
"numpy.array"... | [((2280, 2310), 'mlagents_envs.environment.UnityEnvironment', 'UnityEnvironment', ([], {}), '(**env_kwargs)\n', (2296, 2310), False, 'from mlagents_envs.environment import UnityEnvironment\n'), ((2543, 2571), 'mlagents_envs.side_channel.engine_configuration_channel.EngineConfigurationChannel', 'EngineConfigurationChann... |
"""
`myplotlib.tests`
commands to help preview the custom styles (function names are self-descriptive). available functions are:
* testColormaps
* testColors
* testScatter
* testPlot
* testErrorbar
* testPlot2d
* testVectorPlot2d
* testAll
"""
import myplotlib.plots as myplt
import myplotlib
import matplotlib
impor... | [
"myplotlib.plots.plot2d",
"numpy.arange",
"numpy.random.random",
"numpy.exp",
"numpy.array",
"numpy.linspace",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.cos",
"matplotlib.pyplot.tight_layout",
"numpy.sin",
"numpy.meshgrid",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.subplots",... | [((2689, 2717), 'matplotlib.pyplot.legend', 'plt.legend', ([], {'loc': '"""lower left"""'}), "(loc='lower left')\n", (2699, 2717), True, 'import matplotlib.pyplot as plt\n'), ((3286, 3310), 'numpy.linspace', 'np.linspace', (['(0)', '(1000)', '(10)'], {}), '(0, 1000, 10)\n', (3297, 3310), True, 'import numpy as np\n'), ... |
# Code adapted from https://github.com/google-research/google-research/tree/master/flax_models/cifar
# Original copyright statement:
# Copyright 2020 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 ... | [
"numpy.prod",
"numpy.sqrt",
"jax.numpy.pad",
"flax.linen.Dense",
"jax.numpy.log",
"jax.nn.initializers.variance_scaling",
"flax.linen.Conv",
"flax.linen.swish",
"jax.nn.relu",
"jax.numpy.mean",
"jax.random.split",
"jax.nn.initializers.normal",
"jax.random.bernoulli",
"jax.numpy.sin",
"ja... | [((2337, 2399), 'jax.nn.initializers.variance_scaling', 'jax.nn.initializers.variance_scaling', (['(2.0)', '"""fan_out"""', '"""normal"""'], {}), "(2.0, 'fan_out', 'normal')\n", (2373, 2399), False, 'import jax\n'), ((3429, 3457), 'jax.random.split', 'jax.random.split', (['rng'], {'num': '(2)'}), '(rng, num=2)\n', (344... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 30 10:05:09 2018
@author: Administrator
"""
from sklearn.datasets import load_files
from keras.utils import np_utils
import numpy as np
from glob import glob
from keras.preprocessing import image
import keras
from sklearn.model_selection import train_tes... | [
"keras.preprocessing.image.img_to_array",
"keras.layers.Conv2D",
"keras.layers.GlobalMaxPooling2D",
"keras.layers.MaxPooling2D",
"sklearn.datasets.load_files",
"numpy.array",
"keras.layers.Input",
"keras.applications.nasnet.NASNetLarge",
"keras.models.Model",
"numpy.expand_dims",
"keras.layers.D... | [((1811, 1950), 'keras.applications.nasnet.NASNetLarge', 'keras.applications.nasnet.NASNetLarge', ([], {'input_shape': '(331, 331, 3)', 'include_top': '(True)', 'weights': '"""imagenet"""', 'input_tensor': 'None', 'pooling': 'None'}), "(input_shape=(331, 331, 3),\n include_top=True, weights='imagenet', input_tensor=... |
import os
import re
import numpy as np
from parsefchk import parse_fchk
LAST_UPDATE = '201706021601'
def gen_fchk(mfn, data, ofn='', title=None, suffix='_rlo', overwrite=False):
# text: info, energy, coeff, rest
# data: energy, coeff, dim
if not ofn:
t, ext = os.path.splitext(mfn)
ofn... | [
"os.path.exists",
"numpy.diagonal",
"parsefchk.parse_fchk",
"os.path.splitext",
"numpy.diag",
"numpy.zeros"
] | [((612, 627), 'parsefchk.parse_fchk', 'parse_fchk', (['mfn'], {}), '(mfn)\n', (622, 627), False, 'from parsefchk import parse_fchk\n'), ((287, 308), 'os.path.splitext', 'os.path.splitext', (['mfn'], {}), '(mfn)\n', (303, 308), False, 'import os\n'), ((365, 384), 'os.path.exists', 'os.path.exists', (['ofn'], {}), '(ofn)... |
from pickle import load
from numpy import array
from numpy import argmax
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.models import load_model
from nltk.translate.bleu_score import corpus_bleu
import sys
import pika
import os
import urllib.parse
# Pa... | [
"keras.preprocessing.text.Tokenizer",
"keras.models.load_model",
"pika.BlockingConnection",
"os.environ.get",
"pika.PlainCredentials",
"numpy.argmax",
"pika.BasicProperties",
"keras.preprocessing.sequence.pad_sequences"
] | [((372, 437), 'os.environ.get', 'os.environ.get', (['"""CLOUDAMQP_URL"""', '"""amqp://guest:guest@localhost//"""'], {}), "('CLOUDAMQP_URL', 'amqp://guest:guest@localhost//')\n", (386, 437), False, 'import os\n'), ((637, 668), 'pika.BlockingConnection', 'pika.BlockingConnection', (['params'], {}), '(params)\n', (660, 66... |
from selfdrive.mapd.lib.geo import DIRECTION, distance_and_bearing, absoule_delta_with_direction, bearing_delta, bearing
from common.numpy_fast import interp
from selfdrive.config import Conversions as CV
import numpy as np
import re
_ACCEPTABLE_BEARING_DELTA_V = [40., 20., 10., 5.]
_ACCEPTABLE_BEARING_DELTA_BP = [30... | [
"selfdrive.mapd.lib.geo.distance_and_bearing",
"numpy.amin",
"selfdrive.mapd.lib.geo.bearing",
"numpy.less_equal",
"re.match",
"common.numpy_fast.interp",
"numpy.array",
"selfdrive.mapd.lib.geo.bearing_delta",
"numpy.concatenate",
"numpy.amax",
"numpy.greater_equal"
] | [((3987, 4029), 'numpy.greater_equal', 'np.greater_equal', (['radians', 'self.bbox[0, :]'], {}), '(radians, self.bbox[0, :])\n', (4003, 4029), True, 'import numpy as np\n'), ((4041, 4080), 'numpy.less_equal', 'np.less_equal', (['radians', 'self.bbox[1, :]'], {}), '(radians, self.bbox[1, :])\n', (4054, 4080), True, 'imp... |
from . import tools
import os
from datetime import datetime
import logging
import matplotlib.cm as mplcm
import matplotlib.pyplot as plt
import numpy as np
from ipywidgets import Layout
import ipywidgets as widgets
from IPython.display import display
import cv2
DEFAULT_EXTENSIONS = ['jpg', 'png', 'tif', 'iff', '... | [
"logging.getLogger",
"IPython.display.display",
"ipywidgets.FloatText",
"ipywidgets.VBox",
"numpy.hstack",
"ipywidgets.Tab",
"ipywidgets.Dropdown",
"ipywidgets.BoundedIntText",
"ipywidgets.FloatSlider",
"matplotlib.pyplot.imshow",
"os.path.exists",
"ipywidgets.HBox",
"os.listdir",
"ipywidg... | [((1281, 1308), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1298, 1308), False, 'import logging\n'), ((3710, 3781), 'cv2.findContours', 'cv2.findContours', (['target_binary', 'cv2.RETR_TREE', 'cv2.CHAIN_APPROX_SIMPLE'], {}), '(target_binary, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n',... |
import os
import caffe
import numpy as np
import skimage
import tensorflow as tf
from Preprocessor import Preprocessor
from datasets.ImageNet import ImageNet
from models.AlexNetConverter import AlexNetConverter
from models.SDNet import SDNet
from train.SDNetTrainer import SDNetTrainer
im_s = 227
def preprocess(img... | [
"datasets.ImageNet.ImageNet",
"numpy.copy",
"Preprocessor.Preprocessor",
"os.path.join",
"numpy.linalg.norm",
"skimage.io.imread",
"models.AlexNetConverter.AlexNetConverter",
"train.SDNetTrainer.SDNetTrainer",
"numpy.random.seed",
"models.SDNet.SDNet",
"caffe.Net",
"tensorflow.constant",
"sk... | [((946, 1033), 'models.SDNet.SDNet', 'SDNet', ([], {'num_layers': '(5)', 'target_shape': '[im_s, im_s, 3]', 'batch_size': '(16)', 'disc_pad': '"""VALID"""'}), "(num_layers=5, target_shape=[im_s, im_s, 3], batch_size=16, disc_pad=\n 'VALID')\n", (951, 1033), False, 'from models.SDNet import SDNet\n'), ((1036, 1046), ... |
'''
间接平差
main.py
'''
import pandas as pd
import numpy as np
import sys
np.set_printoptions(threshold=sys.maxsize) #print显示完整array
from gnssnet import *
import math
def Save2Excel(mats,name):
data = pd.DataFrame(mats)
writer = pd.ExcelWriter("C:\\Users\\sheld\\Desktop\\111\\"+ "间接平差的" +name + ".xlsx")... | [
"numpy.linalg.matrix_rank",
"pandas.ExcelWriter",
"math.sqrt",
"numpy.dot",
"numpy.zeros",
"pandas.DataFrame",
"numpy.matrix",
"numpy.set_printoptions"
] | [((72, 114), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'sys.maxsize'}), '(threshold=sys.maxsize)\n', (91, 114), True, 'import numpy as np\n'), ((1115, 1144), 'numpy.zeros', 'np.zeros', (['[n, n]'], {'dtype': 'float'}), '([n, n], dtype=float)\n', (1123, 1144), True, 'import numpy as np\n'), ((1... |
import argparse
import json
import time
import sys,os, copy
import tensorflow as tf
import numpy as np
# sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from competitor.common.paths import RESULTS_DIR
from competitor.models.loader import load_model, load_env
from competitor.heurist... | [
"os.path.exists",
"competitor.heuristics.loader.load_heuristics",
"tensorflow.reset_default_graph",
"argparse.ArgumentParser",
"os.makedirs",
"competitor.models.loader.load_env",
"competitor.recourse.search.SequenceSearch",
"tensorflow.Session",
"os.path.join",
"numpy.argmax",
"numpy.array",
"... | [((760, 785), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (783, 785), False, 'import argparse\n'), ((6955, 6966), 'time.time', 'time.time', ([], {}), '()\n', (6964, 6966), False, 'import time\n'), ((7382, 7400), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (7398, 7400), False, '... |
# Copyright 2019 United Kingdom Research and Innovation
# Author: <NAME> (<EMAIL>)
"""Architecture-aware wrap for a dense matrix.
"""
import numpy
class AMatrix:
def __init__(self, a, arch='cpu', copy_data=False):
self.__arch = arch
self.__gpu = None
if arch[:3] == 'gpu':
t... | [
"numpy.amax",
"numpy.amin"
] | [((949, 962), 'numpy.amin', 'numpy.amin', (['a'], {}), '(a)\n', (959, 962), False, 'import numpy\n'), ((978, 991), 'numpy.amax', 'numpy.amax', (['a'], {}), '(a)\n', (988, 991), False, 'import numpy\n')] |
import numpy as np
import tensorflow as tf
from keras.preprocessing.image import load_img
import matplotlib.pyplot as plt
IMG_SIZE = 64
SAVE_PATH = "C:\\Users\\schaefer\\Desktop\\ML\\vehicle-detection\\save\\model"
IMG_PATH = "data/vehicles/1.png"
img = load_img(IMG_PATH, target_size=(IMG_SIZE, IMG_SIZE))
img = np.... | [
"matplotlib.pyplot.imshow",
"numpy.asarray",
"keras.preprocessing.image.load_img",
"tensorflow.keras.models.load_model",
"matplotlib.pyplot.show"
] | [((257, 309), 'keras.preprocessing.image.load_img', 'load_img', (['IMG_PATH'], {'target_size': '(IMG_SIZE, IMG_SIZE)'}), '(IMG_PATH, target_size=(IMG_SIZE, IMG_SIZE))\n', (265, 309), False, 'from keras.preprocessing.image import load_img\n'), ((317, 332), 'numpy.asarray', 'np.asarray', (['img'], {}), '(img)\n', (327, 3... |
import cv2 as cv
import numpy as np
import time
from timeit import repeat
from multiprocessing import Pool
import threading
backSub = cv.createBackgroundSubtractorMOG2()
# list to store clicked coordinates
coords = []
# cut the given frame and rect with np array of coords
def cut_image(frame, rect, pts):
x,y,w... | [
"cv2.createBackgroundSubtractorMOG2",
"cv2.drawContours",
"cv2.bitwise_and",
"numpy.asarray",
"numpy.zeros",
"cv2.connectedComponentsWithStats",
"threading.Thread",
"cv2.samples.findFileOrKeep",
"cv2.GaussianBlur",
"time.time",
"cv2.boundingRect"
] | [((138, 173), 'cv2.createBackgroundSubtractorMOG2', 'cv.createBackgroundSubtractorMOG2', ([], {}), '()\n', (171, 173), True, 'import cv2 as cv\n'), ((448, 484), 'numpy.zeros', 'np.zeros', (['croped.shape[:2]', 'np.uint8'], {}), '(croped.shape[:2], np.uint8)\n', (456, 484), True, 'import numpy as np\n'), ((489, 554), 'c... |
import numpy as np
import random
from BoxProposing_utils import *
import scipy.spatial.distance as ssd
class BoxProposalModule(object):
def __init__(self, *args, **kwargs):
self.MinimapRatio = kwargs.get('MinimapRatio', 2) # we down-sample the normal boundary map to save computation cost
self.min_b... | [
"random.shuffle",
"numpy.ones",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.concatenate",
"random.random",
"numpy.zeros_like",
"random.randint",
"numpy.arange",
"numpy.random.shuffle"
] | [((4774, 4792), 'random.shuffle', 'random.shuffle', (['hs'], {}), '(hs)\n', (4788, 4792), False, 'import random\n'), ((4937, 4955), 'random.shuffle', 'random.shuffle', (['ws'], {}), '(ws)\n', (4951, 4955), False, 'import random\n'), ((5903, 5928), 'random.shuffle', 'random.shuffle', (['Proposals'], {}), '(Proposals)\n'... |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... | [
"core.optimizer.Optimizer",
"numpy.abs",
"modules.packer.Packer",
"numpy.random.rand",
"core.data_types.Uint32",
"core.data_types.QUANTIZED_NOT_PACKED",
"core.data_types.Float32",
"numpy.array",
"core.graph.Graph",
"numpy.sign",
"unittest.main"
] | [((20968, 20983), 'unittest.main', 'unittest.main', ([], {}), '()\n', (20981, 20983), False, 'import unittest\n'), ((1370, 1396), 'numpy.random.rand', 'np.random.rand', (['(3)', '(2)', '(2)', '(3)'], {}), '(3, 2, 2, 3)\n', (1384, 1396), True, 'import numpy as np\n'), ((1413, 1439), 'numpy.random.rand', 'np.random.rand'... |
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import optimizers, cuda, serializers, Variable, initializers, Chain
from chainer.functions.connection import convolution_2d
from chainer.links.connection.convolution_2d import Convolution2D
from chainer.functions.connection import deco... | [
"chainer.functions.connection.linear.linear",
"chainer.functions.connection.deconvolution_2d.deconvolution_2d",
"numpy.linalg.svd",
"chainer.functions.connection.convolution_2d.convolution_2d",
"chainer.Parameter",
"chainer.functions.array.transpose.transpose"
] | [((2679, 2754), 'chainer.functions.connection.convolution_2d.convolution_2d', 'convolution_2d.convolution_2d', (['x', 'self.W_bar', 'self.b', 'self.stride', 'self.pad'], {}), '(x, self.W_bar, self.b, self.stride, self.pad)\n', (2708, 2754), False, 'from chainer.functions.connection import convolution_2d\n'), ((4429, 45... |
from ppadb.client import Client
from PIL import Image
from algo import minimax
import math
import numpy as np
from time import sleep
from tabulate import tabulate
# red is 1
# yellow is 2
YELLOW = (255, 243, 0)
RED = (222, 0, 0)
X0, Y0 = (84, 633)
DELTA = 94
ROWS, COLS = (6, 7)
EMPTY = 0
PLAYER_PIECE = 1
AI_PIECE = ... | [
"numpy.flip",
"tabulate.tabulate",
"PIL.Image.open",
"time.sleep",
"algo.minimax",
"numpy.array",
"ppadb.client.Client"
] | [((2996, 3031), 'ppadb.client.Client', 'Client', ([], {'host': '"""127.0.0.1"""', 'port': '(5037)'}), "(host='127.0.0.1', port=5037)\n", (3002, 3031), False, 'from ppadb.client import Client\n'), ((624, 632), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (629, 632), False, 'from time import sleep\n'), ((1643, 1671), '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.