code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import matplotlib
matplotlib.use('Agg')
import argparse
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser()
parser.add_argument('-in', '--input', help="Full path to the input csv file")
parser.add_argument('-outdir', '--output', help="Full path to the output direc... | [
"numpy.unique",
"argparse.ArgumentParser",
"pandas.read_csv",
"matplotlib.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.arange",
"numpy.column_stack",
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.legend"
] | [((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((138, 163), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (161, 163), False, 'import argparse\n'), ((582, 605), 'pandas.read_csv', 'pd.read_csv', (['input_file'], {}), '(... |
import torch
import torch.nn as nn
from torch.utils.data import Dataset
from torch.autograd import Variable
import os
import cv2
import numpy as np
from torchvision import datasets, models, transforms
label_len = 36
# vocab="<,.+:-?$ <aAàÀảẢãÃáÁạẠăĂằẰẳẲẵẴắẮặẶâÂầẦẩẨẫẪấẤậẬbBcCdDđĐeEèÈẻẺẽẼéÉẹẸêÊềỀểỂễỄếẾệỆfFgGhHiIìÌỉỈĩĨí... | [
"numpy.ones",
"torch.from_numpy",
"numpy.zeros",
"torch.utils.data.DataLoader",
"cv2.resize",
"numpy.transpose",
"cv2.imread"
] | [((4235, 4323), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['listdataset'], {'batch_size': '(2)', 'shuffle': '(False)', 'num_workers': '(0)'}), '(listdataset, batch_size=2, shuffle=False,\n num_workers=0)\n', (4262, 4323), False, 'import torch\n'), ((1653, 1679), 'cv2.resize', 'cv2.resize', (['im... |
#!/usr/bin/env python
import pandas as pd
import numpy as np
from scipy.sparse import csc_matrix
import os, sys
import functools as fct
# import from parent directory
nb_dir = os.path.split(os.getcwd())[0]
if nb_dir not in sys.path:
print('Appending directory as path: {}'.format(nb_dir))
sys.path.append(nb_dir... | [
"pmRecUtils.single_to_fm_format",
"numpy.asarray",
"os.getcwd",
"numpy.append",
"numpy.zeros",
"pmRecUtils.multiple_to_fm_format",
"numpy.int",
"numpy.random.seed",
"numpy.concatenate",
"sys.path.append"
] | [((298, 321), 'sys.path.append', 'sys.path.append', (['nb_dir'], {}), '(nb_dir)\n', (313, 321), False, 'import os, sys\n'), ((647, 667), 'numpy.zeros', 'np.zeros', ([], {'shape': '(2,)'}), '(shape=(2,))\n', (655, 667), True, 'import numpy as np\n'), ((2448, 2496), 'pmRecUtils.single_to_fm_format', 'rutils.single_to_fm_... |
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from tensorflow.python.keras.layers import Flatten
from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras.layers import Dropout
from tensorflow.python.keras.... | [
"numpy.mean",
"tensorflow.python.keras.models.Model",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.math.squared_difference",
"numpy.asarray",
"tensorflow.keras.optimizers.Adam",
"tensorflow.python.keras.layers.Dense",
"tensorflow.python.keras.layers.Flatten",
"tensorflow.GradientTape",
... | [((616, 668), 'tensorflow.keras.losses.BinaryCrossentropy', 'tf.keras.losses.BinaryCrossentropy', ([], {'from_logits': '(True)'}), '(from_logits=True)\n', (650, 668), True, 'import tensorflow as tf\n'), ((1649, 1680), 'tensorflow.keras.optimizers.Adam', 'tf.keras.optimizers.Adam', (['(1e-05)'], {}), '(1e-05)\n', (1673,... |
import os
import numpy as np
from .config import Config
class model:
def __init__(self, config, *args):
if len(args) == 1:
file = args[0]
if os.path.exists(file):
self.load(file)
else:
print(file)
elif len(args) == 2:
... | [
"numpy.random.random",
"os.path.exists",
"numpy.zeros",
"numpy.zeros_like"
] | [((1254, 1269), 'numpy.zeros', 'np.zeros', (['wsize'], {}), '(wsize)\n', (1262, 1269), True, 'import numpy as np\n'), ((179, 199), 'os.path.exists', 'os.path.exists', (['file'], {}), '(file)\n', (193, 199), False, 'import os\n'), ((530, 548), 'numpy.zeros_like', 'np.zeros_like', (['m.W'], {}), '(m.W)\n', (543, 548), Tr... |
from __future__ import annotations
from copy import deepcopy
from typing import Tuple, Callable
import numpy as np
from IMLearn import BaseEstimator
def cross_validate(estimator: BaseEstimator, X: np.ndarray, y: np.ndarray,
scoring: Callable[[np.ndarray, np.ndarray, ...], float],
... | [
"numpy.array_split"
] | [((1175, 1196), 'numpy.array_split', 'np.array_split', (['X', 'cv'], {}), '(X, cv)\n', (1189, 1196), True, 'import numpy as np\n'), ((1208, 1229), 'numpy.array_split', 'np.array_split', (['y', 'cv'], {}), '(y, cv)\n', (1222, 1229), True, 'import numpy as np\n')] |
import shutil
import struct
from collections import defaultdict
from pathlib import Path
import lmdb
import numpy as np
import torch.utils.data
from tqdm import tqdm
class AvazuDataset(torch.utils.data.Dataset):
"""
Avazu Click-Through Rate Prediction Dataset
Dataset preparation
... | [
"pathlib.Path",
"tqdm.tqdm",
"struct.pack",
"numpy.zeros",
"lmdb.open",
"collections.defaultdict",
"shutil.rmtree"
] | [((1206, 1268), 'lmdb.open', 'lmdb.open', (['cache_path'], {'create': '(False)', 'lock': '(False)', 'readonly': '(True)'}), '(cache_path, create=False, lock=False, readonly=True)\n', (1215, 1268), False, 'import lmdb\n'), ((964, 1009), 'shutil.rmtree', 'shutil.rmtree', (['cache_path'], {'ignore_errors': '(True)'}), '(c... |
#Aici este citirea exact ca la svm si la naive bayes doar ca testez parametri diferite pentru mlpclassifier.
#Rezultatul nu a trecut de 0.72 din ce imi amintesc (stiu ca era mai slaba solutia decat svm si nu am notat-o).
#Am luat MLPCLASSIFIER-ul din laborator si m-am jucat cu valorile ce erau oferite in documentat... | [
"sklearn.neural_network.MLPClassifier",
"matplotlib.pyplot.imread",
"numpy.array",
"numpy.zeros",
"glob.glob"
] | [((4970, 5094), 'sklearn.neural_network.MLPClassifier', 'MLPClassifier', ([], {'hidden_layer_sizes': '(50, 100, 50)', 'activation': '"""relu"""', 'learning_rate_init': '(0.001)', 'max_iter': '(2000)', 'alpha': '(0.005)'}), "(hidden_layer_sizes=(50, 100, 50), activation='relu',\n learning_rate_init=0.001, max_iter=20... |
import tensorflow as tf
import numpy as np
from thermal_barrierlife_prediction.load_data import read_data
class Estimator:
"""
Estimator class. Contains all necessary methods for data loading,
model initialization, training, evaluation and prediction.
"""
def prepare_data(
self,
... | [
"thermal_barrierlife_prediction.load_data.read_data",
"numpy.abs",
"numpy.random.beta",
"numpy.random.choice",
"tensorflow.GradientTape",
"numpy.argwhere",
"numpy.concatenate",
"matplotlib.pyplot.tight_layout",
"tensorflow.expand_dims",
"matplotlib.pyplot.subplots"
] | [((810, 883), 'thermal_barrierlife_prediction.load_data.read_data', 'read_data', ([], {'csv_file_path': 'csv_file_path', 'tiff_folder_path': 'tiff_folder_path'}), '(csv_file_path=csv_file_path, tiff_folder_path=tiff_folder_path)\n', (819, 883), False, 'from thermal_barrierlife_prediction.load_data import read_data\n'),... |
from sklearn import svm
from sklearn.model_selection import train_test_split
from sklearn import metrics
import numpy as np
import pickle
import cv2 as cv
from tensorflow import keras
from keras import optimizers
from tensorflow.keras import layers
from feature_extractor import get_pos_neg_samples_from_pickle
from an... | [
"tensorflow.keras.utils.to_categorical",
"sklearn.svm.SVC",
"sklearn.metrics.confusion_matrix",
"annotation_parser.parseDataset",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"sklearn.svm.LinearSVC",
"tensorflow.keras.layers.Dropout",
"numpy.append",
"numpy.... | [((468, 501), 'feature_extractor.get_pos_neg_samples_from_pickle', 'get_pos_neg_samples_from_pickle', ([], {}), '()\n', (499, 501), False, 'from feature_extractor import get_pos_neg_samples_from_pickle\n'), ((513, 561), 'numpy.array', 'np.array', (['(positives + negatives)'], {'dtype': '"""float32"""'}), "(positives + ... |
import cv2 as cv
import numpy as np
def contrast_brightness(image, c, b):
h, w = image.shape
blank = np.zeros([h, w], image.dtype)
dst = cv.addWeighted(image, c, blank, 1-c, b)
return dst
def delate_then_erode(img, times, dilate, erode):
dst = img
for i in range(times):
... | [
"cv2.normalize",
"cv2.filter2D",
"cv2.imshow",
"cv2.HoughLines",
"cv2.destroyAllWindows",
"numpy.sin",
"cv2.threshold",
"cv2.erode",
"cv2.line",
"cv2.medianBlur",
"cv2.minMaxLoc",
"cv2.addWeighted",
"cv2.waitKey",
"cv2.add",
"numpy.ones",
"cv2.morphologyEx",
"numpy.cos",
"cv2.cvtCo... | [((4146, 4168), 'cv2.destroyAllWindows', 'cv.destroyAllWindows', ([], {}), '()\n', (4166, 4168), True, 'import cv2 as cv\n'), ((117, 146), 'numpy.zeros', 'np.zeros', (['[h, w]', 'image.dtype'], {}), '([h, w], image.dtype)\n', (125, 146), True, 'import numpy as np\n'), ((158, 199), 'cv2.addWeighted', 'cv.addWeighted', (... |
import pyk4a
from pyk4a import Config, PyK4A, ColorResolution
import cv2
import numpy as np
k4a = PyK4A(Config(color_resolution=ColorResolution.RES_720P,
depth_mode=pyk4a.DepthMode.NFOV_UNBINNED,
synchronized_images_only=True, ))
k4a.connect()
# getters and setters directly get ... | [
"pyk4a.Config",
"numpy.any",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.waitKey"
] | [((106, 233), 'pyk4a.Config', 'Config', ([], {'color_resolution': 'ColorResolution.RES_720P', 'depth_mode': 'pyk4a.DepthMode.NFOV_UNBINNED', 'synchronized_images_only': '(True)'}), '(color_resolution=ColorResolution.RES_720P, depth_mode=pyk4a.\n DepthMode.NFOV_UNBINNED, synchronized_images_only=True)\n', (112, 233),... |
# Copyright 2019 <NAME> and <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"torchvision.transforms.Compose",
"torchvision.transforms.CenterCrop",
"os.listdir",
"copy.deepcopy",
"numpy.unique",
"PIL.Image.open",
"torch.utils.data.DataLoader",
"torchvision.transforms.RandomResizedCrop",
"torchvision.transforms.Resize",
"torchvision.transforms.RandomHorizontalFlip",
"nump... | [((739, 772), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (762, 772), False, 'import warnings\n'), ((7958, 8048), 'pandas.read_table', 'pd.read_table', (["(opt.source_path + '/Info_Files/Ebay_train.txt')"], {'header': '(0)', 'delimiter': '""" """'}), "(opt.source_path +... |
"""
Copyright 2020, <NAME>, <EMAIL>, All rights reserved.
Borrowed from https://github.com/sidhantagar/ConnectX under the MIT license.
"""
import numpy as np
import random
max_score = None
def score_move_a(grid, col, mark, config, start_score, n_steps=1):
global max_score
next_grid, pos = drop_piece(grid, co... | [
"numpy.zeros",
"random.choice",
"numpy.asarray"
] | [((3675, 3702), 'numpy.zeros', 'np.zeros', (['(config.inarow + 1)'], {}), '(config.inarow + 1)\n', (3683, 3702), True, 'import numpy as np\n'), ((5178, 5205), 'numpy.zeros', 'np.zeros', (['(config.inarow + 1)'], {}), '(config.inarow + 1)\n', (5186, 5205), True, 'import numpy as np\n'), ((7398, 7421), 'random.choice', '... |
import tensorflow as tf
import numpy as np
slim = tf.contrib.slim
# custom layers
def deconv_layer(net, up_scale, n_channel, method='transpose'):
nh = tf.shape(net)[-3] * up_scale
nw = tf.shape(net)[-2] * up_scale
if method == 'transpose':
net = slim.conv2d_transpose(net, n_channel, (up_scale, u... | [
"tensorflow.image.resize_images",
"tensorflow.shape",
"tensorflow.pad",
"tensorflow.variable_scope",
"tensorflow.concat",
"numpy.array",
"tensorflow.add_n",
"tensorflow.name_scope",
"tensorflow.reduce_mean"
] | [((4444, 4468), 'tensorflow.variable_scope', 'tf.variable_scope', (['scope'], {}), '(scope)\n', (4461, 4468), True, 'import tensorflow as tf\n'), ((5426, 5492), 'tensorflow.concat', 'tf.concat', ([], {'axis': '(3)', 'values': '[branch_0, branch_1, branch_2, branch_3]'}), '(axis=3, values=[branch_0, branch_1, branch_2, ... |
import os
import argparse
import torch
import torchvision
import numpy as np
from utils import yaml_config_hook
from modules import resnet, network, transform
from evaluation import evaluation
from torch.utils import data
import copy
def inference(loader, model, device):
model.eval()
feature_vector = []
l... | [
"torch.utils.data.ConcatDataset",
"argparse.ArgumentParser",
"modules.resnet.get_resnet",
"torch.load",
"utils.yaml_config_hook",
"numpy.array",
"torch.cuda.is_available",
"evaluation.evaluation.evaluate",
"modules.transform.Transforms",
"torch.utils.data.DataLoader",
"torch.no_grad",
"copy.co... | [((832, 856), 'numpy.array', 'np.array', (['feature_vector'], {}), '(feature_vector)\n', (840, 856), True, 'import numpy as np\n'), ((877, 900), 'numpy.array', 'np.array', (['labels_vector'], {}), '(labels_vector)\n', (885, 900), True, 'import numpy as np\n'), ((926, 954), 'numpy.array', 'np.array', (['extracted_featur... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import numpy as np
from pycuda import gpuarray
import pycuda.driver as cuda
from svirl import config as cfg
from svirl.storage import GArray
class Vars(object):
"""This class contains setters and getters for solution variables
order p... | [
"numpy.ones",
"numpy.random.rand",
"svirl.config.dtype_complex",
"numpy.zeros",
"numpy.random.seed",
"svirl.storage.GArray",
"numpy.uintp",
"numpy.isposinf"
] | [((1560, 1597), 'svirl.storage.GArray', 'GArray', ([], {'shape': 'shapes', 'dtype': 'cfg.dtype'}), '(shape=shapes, dtype=cfg.dtype)\n', (1566, 1597), False, 'from svirl.storage import GArray\n'), ((3903, 3914), 'numpy.uintp', 'np.uintp', (['(0)'], {}), '(0)\n', (3911, 3914), True, 'import numpy as np\n'), ((4827, 4838)... |
"""
"""
import os, sys
import re
import logging
import datetime
from functools import reduce
from collections import namedtuple
from glob import glob
from copy import deepcopy
from typing import Union, Optional, List, Dict, Tuple, Sequence, Iterable, NoReturn, Any
from numbers import Real, Number
import numpy as np
np... | [
"logging.getLogger",
"logging.StreamHandler",
"numpy.convolve",
"re.compile",
"numpy.array",
"wfdb.io._header._parse_signal_lines",
"matplotlib.pyplot.MultipleLocator",
"sklearn.utils.compute_class_weight",
"copy.deepcopy",
"wfdb.io._header._read_segment_lines",
"wfdb.io._header._parse_record_li... | [((318, 365), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(5)', 'suppress': '(True)'}), '(precision=5, suppress=True)\n', (337, 365), True, 'import numpy as np\n'), ((23807, 23906), 'collections.namedtuple', 'namedtuple', ([], {'typename': '"""ECGWaveForm"""', 'field_names': "['name', 'onset', ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import normal_init
from mmcv.ops import batched_nms
from mmdet.core import vectorize_labels, bbox_overlaps
from ..builder import HEADS
from .anchor_head import AnchorHead
from .rpn_test_mixin import RPNTestMixin
import numpy as np
import c... | [
"torch.cumsum",
"numpy.mean",
"collections.deque",
"torch.stack",
"numpy.log",
"torch.exp",
"mmcv.cnn.normal_init",
"torch.nn.Conv2d",
"torch.nonzero",
"mmdet.models.losses.ranking_losses.RankSort",
"torch.tensor",
"torch.sum",
"torch.nn.functional.relu",
"mmcv.ops.batched_nms",
"torch.c... | [((1493, 1554), 'torch.nn.Conv2d', 'nn.Conv2d', (['self.in_channels', 'self.feat_channels', '(3)'], {'padding': '(1)'}), '(self.in_channels, self.feat_channels, 3, padding=1)\n', (1502, 1554), True, 'import torch.nn as nn\n'), ((1591, 1665), 'torch.nn.Conv2d', 'nn.Conv2d', (['self.feat_channels', '(self.num_anchors * s... |
import sys,os
import pandas as pd
import numpy as np
from sklearn.metrics import confusion_matrix
from networkx import DiGraph
from networkx import relabel_nodes
from sklearn_hierarchical_classification.constants import ROOT
from tqdm import tqdm
import itertools
import matplotlib
matplotlib.use('Agg')
import matplotli... | [
"matplotlib.pyplot.imshow",
"networkx.relabel_nodes",
"pandas.read_csv",
"matplotlib.pyplot.xticks",
"matplotlib.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"networkx.DiGraph",
"matplotlib.pyplot.colorbar",
"numpy.argmax",
"matplotlib.pyplot.rcParams.update",
"numpy.zeros",
... | [((282, 303), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (296, 303), False, 'import matplotlib\n'), ((336, 374), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 12}"], {}), "({'font.size': 12})\n", (355, 374), True, 'import matplotlib.pyplot as plt\n'), ((657, 673... |
import numpy as np
import json
from turorials.perlin_noise.obstacle_generation import flood_grid
class EnvironmentRepresentation:
def __init__(self):
self.obstacle_map = None
self.terrain_map = None
self.start_positions = None
self.nb_free_tiles = 0
self.dim = (8, 8)
... | [
"json.dump",
"numpy.array",
"turorials.perlin_noise.obstacle_generation.flood_grid",
"json.load",
"numpy.load",
"numpy.save"
] | [((5488, 5513), 'numpy.load', 'np.load', (['(save_path + name)'], {}), '(save_path + name)\n', (5495, 5513), True, 'import numpy as np\n'), ((5615, 5640), 'turorials.perlin_noise.obstacle_generation.flood_grid', 'flood_grid', (['obstacle_grid'], {}), '(obstacle_grid)\n', (5625, 5640), False, 'from turorials.perlin_nois... |
import cv2
import argparse
import numpy as np
from model import Model
from plot_history import plot_model
from tensorflow.keras.optimizers import Adam
from FER2013_data_prep import train_generator, validation_generator
epoch = 50
num_val = 7178
batch_size = 64
num_train = 28709
model = Model()
# Temporarily disable ... | [
"cv2.ocl.setUseOpenCL",
"cv2.rectangle",
"model.Model",
"cv2.flip",
"argparse.ArgumentParser",
"numpy.argmax",
"cv2.putText",
"tensorflow.keras.optimizers.Adam",
"plot_history.plot_model",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.CascadeClassifier",
"cv2.resize",
... | [((289, 296), 'model.Model', 'Model', ([], {}), '()\n', (294, 296), False, 'from model import Model\n'), ((365, 403), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Choose mode"""'], {}), "('Choose mode')\n", (388, 403), False, 'import argparse\n'), ((1005, 1027), 'plot_history.plot_model', 'plot_model', (... |
import os
import unittest
import numpy as np
from PIL import Image
from src.constants.constants import NumericalMetrics
from src.evaluators.habitat_evaluator import HabitatEvaluator
class TestHabitatEvaluatorContinuousCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.evaluator_continuous... | [
"unittest.main",
"src.evaluators.habitat_evaluator.HabitatEvaluator",
"numpy.linalg.norm"
] | [((1177, 1192), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1190, 1192), False, 'import unittest\n'), ((323, 499), 'src.evaluators.habitat_evaluator.HabitatEvaluator', 'HabitatEvaluator', ([], {'config_paths': '"""configs/pointnav_rgbd_with_physics.yaml"""', 'input_type': '"""rgbd"""', 'model_path': '"""data/c... |
import pymc3 as pm
import numpy as np
from tabulate import tabulate
from scipy.optimize import linprog
import scipy.stats as stats
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.animation as animation
d0 = [20, 28, 24, 20, 23] # observed demand samples
with pm.Model() as m:
... | [
"pymc3.Poisson",
"matplotlib.pyplot.plot",
"numpy.log",
"numpy.linspace",
"pymc3.sample",
"pymc3.Model",
"pymc3.Gamma",
"matplotlib.pyplot.show"
] | [((590, 609), 'numpy.linspace', 'np.linspace', (['(10)', '(16)'], {}), '(10, 16)\n', (601, 609), True, 'import numpy as np\n'), ((686, 725), 'matplotlib.pyplot.plot', 'plt.plot', (['p', 'd_means'], {'c': '"""k"""', 'alpha': '(0.01)'}), "(p, d_means, c='k', alpha=0.01)\n", (694, 725), True, 'from matplotlib import pyplo... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation, cm
from mpl_toolkits.mplot3d import Axes3D
# create a figure
fig = plt.figure()
# initialise 3D Axes
ax = Axes3D(fig)
# remove background grid, fill and axis
ax.grid(False)
ax.xaxis.pane.fill = ax.yaxis.pane.fill = ax.zaxis... | [
"numpy.sqrt",
"matplotlib.animation.FuncAnimation",
"mpl_toolkits.mplot3d.Axes3D",
"matplotlib.pyplot.figure",
"numpy.meshgrid",
"numpy.cos",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis",
"numpy.arange"
] | [((159, 171), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (169, 171), True, 'import matplotlib.pyplot as plt\n'), ((200, 211), 'mpl_toolkits.mplot3d.Axes3D', 'Axes3D', (['fig'], {}), '(fig)\n', (206, 211), False, 'from mpl_toolkits.mplot3d import Axes3D\n'), ((340, 355), 'matplotlib.pyplot.axis', 'plt.a... |
import tensorflow as tf
import numpy as np
from sklearn.metrics import balanced_accuracy_score
import time
import os
def create_graph_placeholders(dataset, use_desc=True, with_tags=True, with_attention=True, use_subgraph=False):
'''
dataset: should be a sequence (list, tuple or array) whose order is [V, A, La... | [
"sklearn.metrics.balanced_accuracy_score",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits",
"tensorflow.compat.v1.add_to_collection",
"tensorflow.control_dependencies",
"tensorflow.compat.v1.get_collection",
"tensorflow.reduce_mean",
"tensorflow.com... | [((5266, 5328), 'tensorflow.compat.v1.get_collection', 'tf.compat.v1.get_collection', (['tf.compat.v1.GraphKeys.UPDATE_OPS'], {}), '(tf.compat.v1.GraphKeys.UPDATE_OPS)\n', (5293, 5328), True, 'import tensorflow as tf\n'), ((477, 506), 'tensorflow.as_dtype', 'tf.as_dtype', (['dataset[0].dtype'], {}), '(dataset[0].dtype)... |
import collections
import functools
import os
import pickle
from typing import (Callable, Dict, Hashable, List, NamedTuple, Optional,
Sequence, Union)
import numpy as np
from stable_baselines.common.base_class import BaseRLModel
from stable_baselines.common.policies import BasePolicy
from stable_ba... | [
"pickle.dump",
"numpy.asarray",
"os.path.dirname",
"numpy.stack",
"functools.partial",
"collections.defaultdict",
"numpy.concatenate",
"numpy.zeros_like"
] | [((3555, 3584), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (3578, 3584), False, 'import collections\n'), ((4654, 4683), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (4677, 4683), False, 'import collections\n'), ((10203, 10247), 'functools.parti... |
import os
import sqlite3 as sql
import numpy as np
def mhc_datasets(table='mhc_data', path='./iedb/', remove_c=False,
remove_u=False, remove_modes=False):
"""
Parameters: 'table' is the table that the data is retrieved
- must be 'mhc_data', 'mhc_test1', 'mhc_test2', or 'mhc_t... | [
"numpy.array",
"numpy.log10",
"os.path.join",
"pandas.read_csv"
] | [((2282, 2327), 'os.path.join', 'os.path.join', (['path', '"""IEDB Benchmark Data.txt"""'], {}), "(path, 'IEDB Benchmark Data.txt')\n", (2294, 2327), False, 'import os\n'), ((2416, 2487), 'pandas.read_csv', 'pd.read_csv', (['file_path'], {'sep': '"""\t"""', 'header': '(0)', 'na_values': '"""-"""', 'usecols': 'cols'}), ... |
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# ??/??/?? xxxxxxxx Initial Creation.
# 05/28/13 2023 dgilling Implement __str__().
# 01/22/14 ... | [
"datetime.datetime.utcfromtimestamp",
"time.strptime",
"re.compile",
"dynamicserialize.dstypes.java.util.EnumSet",
"numpy.float64",
"calendar.timegm",
"dynamicserialize.dstypes.java.util.Date",
"six.moves.cStringIO"
] | [((1655, 1740), 're.compile', 're.compile', (['(REFTIME_PATTERN_STR + FORECAST_PATTERN_STR + VALID_PERIOD_PATTERN_STR)'], {}), '(REFTIME_PATTERN_STR + FORECAST_PATTERN_STR +\n VALID_PERIOD_PATTERN_STR)\n', (1665, 1740), False, 'import re\n'), ((2755, 2807), 'dynamicserialize.dstypes.java.util.EnumSet', 'EnumSet', ([... |
"""
Authors: The Vollab Developers 2004-2021
License: BSD 3 clause
Calculate the local volatility surface for given characteristic function in three steps:
1. For a given characteristic function use Fast Fourier Transform to get call price surface.
2. Uses the Lets Be Rational function for ... | [
"numpy.sqrt",
"scipy.interpolate.CubicSpline",
"numpy.log",
"numpy.square",
"numpy.array"
] | [((1160, 1177), 'numpy.array', 'np.array', (['strikes'], {}), '(strikes)\n', (1168, 1177), True, 'import numpy as np\n'), ((1231, 1254), 'numpy.log', 'np.log', (['rel_log_strikes'], {}), '(rel_log_strikes)\n', (1237, 1254), True, 'import numpy as np\n'), ((1271, 1287), 'numpy.square', 'np.square', (['smile'], {}), '(sm... |
from __future__ import print_function
import os
import sys
import torch
import os.path
import numpy as np
from utils import *
from PIL import Image
import torch.utils.data as data
import torchvision.transforms as transforms
utils_path = '/home/parker/code/AtlasNet/utils/'
open3d_path = '/home/parker/packages/Open3D/bu... | [
"os.listdir",
"numpy.where",
"os.path.join",
"numpy.asarray",
"numpy.count_nonzero",
"sys.path.append",
"cloud.ScanData"
] | [((330, 357), 'sys.path.append', 'sys.path.append', (['utils_path'], {}), '(utils_path)\n', (345, 357), False, 'import sys\n'), ((358, 386), 'sys.path.append', 'sys.path.append', (['open3d_path'], {}), '(open3d_path)\n', (373, 386), False, 'import sys\n'), ((5024, 5047), 'numpy.where', 'np.where', (['(a > 625)', '(1)',... |
import sys,os,urllib,subprocess
import numpy as np
import requests
from tqdm import tqdm
from shapely.geometry import Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon,GeometryCollection
from shapely.ops import transform,cascaded_union,unary_union
from functools import partial
import pyproj
from pyproj i... | [
"mshapely.DF",
"os.path.exists",
"shapely.ops.transform",
"numpy.power",
"tqdm.tqdm",
"os.path.join",
"os.path.splitext",
"requests.get",
"numpy.min",
"shapely.geometry.Point",
"os.path.dirname",
"mshapely.DF.read",
"subprocess.call",
"os.path.basename",
"pyproj.Proj",
"mshapely.DF.get... | [((6611, 6659), 'os.path.join', 'os.path.join', (['self.localFolder', '"""domain.geojson"""'], {}), "(self.localFolder, 'domain.geojson')\n", (6623, 6659), False, 'import sys, os, urllib, subprocess\n'), ((6666, 6688), 'os.path.exists', 'os.path.exists', (['output'], {}), '(output)\n', (6680, 6688), False, 'import sys,... |
#!/usr/bin/env python
#==========================================================================
import numpy as np
from gryffin import Gryffin
# choose the synthetic function from
# ... Dejong:
# ...
from benchmark_functions import Dejong as Benchmark
from category_writer import CategoryWriter
#=============... | [
"numpy.amax",
"numpy.amin",
"seaborn.color_palette",
"benchmark_functions.Dejong",
"seaborn.set_context",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.linspace",
"gryffin.Gryffin",
"matplotlib.pyplot.ion",
"numpy.meshgrid",
"matplotlib.pyplot.pause",
"category_writer.CategoryWriter",
... | [((598, 650), 'category_writer.CategoryWriter', 'CategoryWriter', ([], {'num_opts': 'NUM_OPTS', 'num_dims': 'NUM_DIMS'}), '(num_opts=NUM_OPTS, num_dims=NUM_DIMS)\n', (612, 650), False, 'from category_writer import CategoryWriter\n'), ((792, 839), 'benchmark_functions.Dejong', 'Benchmark', ([], {'num_dims': 'NUM_DIMS', ... |
try:
from .model import NNModel
from PIL import Image
from scipy.misc import imsave, imresize
# Importing the required Keras modules containing models, layers, optimizers, losses, etc
from keras.models import Model
from keras.layers import Input, Conv2D, Dropout, MaxPooling2D, UpSampling2D, Co... | [
"keras.layers.Conv2D",
"numpy.array",
"keras.layers.Activation",
"scipy.misc.imresize",
"keras.preprocessing.image.array_to_img",
"os.path.exists",
"os.path.split",
"keras.models.Model",
"keras.optimizers.Adam",
"keras.layers.MaxPooling2D",
"keras.layers.normalization.BatchNormalization",
"ker... | [((2124, 2150), 'os.path.join', 'join', (['base_dir', '"""training"""'], {}), "(base_dir, 'training')\n", (2128, 2150), False, 'from os.path import isfile, exists, join, realpath, splitext, basename\n'), ((2169, 2197), 'os.path.join', 'join', (['base_dir', '"""validation"""'], {}), "(base_dir, 'validation')\n", (2173, ... |
# train a simple MLP on the synthetic sklearn data
import numpy as np
import pandas as pd
import os
from pathlib import Path
from tqdm import tqdm
import torch
from torch import nn, optim, tensor, FloatTensor
from torch.utils.data import Dataset, TensorDataset, DataLoader
from data.skl_synthetic import load_skl_data... | [
"torch.manual_seed",
"os.path.exists",
"models.linear.LinearMLP",
"plotting.plot_predicted_vs_actual",
"numpy.mean",
"pathlib.Path.home",
"data.skl_synthetic.load_skl_data",
"torch.utils.data.TensorDataset",
"plotting.plot_losses",
"torch.nn.MSELoss",
"numpy.random.randint",
"torch.utils.data.... | [((502, 524), 'torch.manual_seed', 'torch.manual_seed', (['(123)'], {}), '(123)\n', (519, 524), False, 'import torch\n'), ((617, 628), 'pathlib.Path.home', 'Path.home', ([], {}), '()\n', (626, 628), False, 'from pathlib import Path\n'), ((892, 921), 'os.path.exists', 'os.path.exists', (['path_for_data'], {}), '(path_fo... |
import numpy as np
from src.data.DataBase import DataBase
from src.vectoring.VectorBuilderBase import VectorBuilderBase
class ImageVectorBuilder(VectorBuilderBase):
def __init__(self, extracted_data: DataBase):
extracted_data.assert_is_extracted()
self.__data__ = extracted_data
self.__labe... | [
"numpy.array",
"numpy.zeros"
] | [((414, 441), 'numpy.zeros', 'np.zeros', (['self.__labels_c__'], {}), '(self.__labels_c__)\n', (422, 441), True, 'import numpy as np\n'), ((876, 889), 'numpy.array', 'np.array', (['vec'], {}), '(vec)\n', (884, 889), True, 'import numpy as np\n'), ((955, 982), 'numpy.zeros', 'np.zeros', (['self.__labels_c__'], {}), '(se... |
"""Numeric features transformers."""
from typing import Union
import numpy as np
from ..dataset.base import LAMLDataset
from ..dataset.np_pd_dataset import NumpyDataset
from ..dataset.np_pd_dataset import PandasDataset
from ..dataset.roles import CategoryRole
from ..dataset.roles import NumericRole
from .base import... | [
"numpy.clip",
"numpy.nanstd",
"numpy.unique",
"numpy.nanmedian",
"numpy.where",
"numpy.log",
"numpy.nanmean",
"numpy.zeros",
"numpy.linspace",
"numpy.isnan",
"numpy.quantile",
"numpy.isinf"
] | [((3209, 3235), 'numpy.nanmedian', 'np.nanmedian', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (3221, 3235), True, 'import numpy as np\n'), ((5578, 5609), 'numpy.clip', 'np.clip', (['data', '(1e-07)', '(1 - 1e-07)'], {}), '(data, 1e-07, 1 - 1e-07)\n', (5585, 5609), True, 'import numpy as np\n'), ((5623, 5648), 'nu... |
#%%
import os
cwd = os.getcwd()
dir_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(dir_path)
import argparse
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import torchvision.utils
import numpy as np
i... | [
"torch.exp",
"torch.nn.MSELoss",
"torch.cuda.is_available",
"torch.squeeze",
"numpy.mean",
"torch.utils.tensorboard.SummaryWriter",
"argparse.ArgumentParser",
"torch.unsqueeze",
"numpy.linspace",
"numpy.concatenate",
"torch.zeros_like",
"sklearn.model_selection.train_test_split",
"torch.Tens... | [((20, 31), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (29, 31), False, 'import os\n'), ((88, 106), 'os.chdir', 'os.chdir', (['dir_path'], {}), '(dir_path)\n', (96, 106), False, 'import os\n'), ((60, 86), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (76, 86), False, 'import os\n'), ((124... |
import ctypes as ct
import numpy as np
import scipy.interpolate as interpolate
import sharpy.utils.controller_interface as controller_interface
import sharpy.utils.settings as settings
import sharpy.utils.control_utils as control_utils
import sharpy.utils.cout_utils as cout
import sharpy.structure.utils.lagrangeconstr... | [
"scipy.interpolate.UnivariateSpline",
"sharpy.utils.settings.SettingsTable",
"numpy.max",
"numpy.zeros",
"sharpy.structure.utils.lagrangeconstraints.remove_constraint",
"pdb.set_trace",
"numpy.min",
"ctypes.c_int",
"numpy.loadtxt",
"sharpy.utils.settings.to_custom_types"
] | [((2957, 2981), 'sharpy.utils.settings.SettingsTable', 'settings.SettingsTable', ([], {}), '()\n', (2979, 2981), True, 'import sharpy.utils.settings as settings\n'), ((3401, 3415), 'numpy.zeros', 'np.zeros', (['(2,)'], {}), '((2,))\n', (3409, 3415), True, 'import numpy as np\n'), ((3609, 3696), 'sharpy.utils.settings.t... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"numpy.reshape",
"numpy.where",
"math.sqrt",
"numpy.argmax",
"numpy.sum",
"numpy.array",
"numpy.concatenate"
] | [((1001, 1023), 'numpy.reshape', 'np.reshape', (['labels', '(-1)'], {}), '(labels, -1)\n', (1011, 1023), True, 'import numpy as np\n'), ((1077, 1103), 'numpy.argmax', 'np.argmax', (['logits'], {'axis': '(-1)'}), '(logits, axis=-1)\n', (1086, 1103), True, 'import numpy as np\n'), ((1128, 1154), 'numpy.sum', 'np.sum', ([... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import os
import json
import pandas as pd
import re
import ir_thermography.thermometry as irt
import matplotlib.ticker as ticker
from scipy import interpolate
from scipy.signal import savgol_filter
from scipy import interpolate
import platform
... | [
"os.path.exists",
"numpy.abs",
"matplotlib.rcParams.update",
"matplotlib.pyplot.show",
"os.makedirs",
"matplotlib.ticker.MultipleLocator",
"pandas.read_csv",
"re.compile",
"os.path.join",
"scipy.signal.savgol_filter",
"json.load",
"platform.system",
"pandas.DataFrame",
"numpy.gradient",
... | [((898, 939), 'scipy.signal.savgol_filter', 'savgol_filter', (['measured_temperature', 'k', '(2)'], {}), '(measured_temperature, k, 2)\n', (911, 939), False, 'from scipy.signal import savgol_filter\n'), ((951, 994), 'numpy.gradient', 'np.gradient', (['T', 'measured_time'], {'edge_order': '(2)'}), '(T, measured_time, ed... |
import os
import sys
root_path = os.path.abspath("../../")
if root_path not in sys.path:
sys.path.append(root_path)
import numpy as np
from math import pi
from Util.Timing import Timing
from Util.Bases import ClassifierBase
sqrt_pi = (2 * pi) ** 0.5
class NBFunctions:
@staticmethod
def gaussian(x, mu, ... | [
"Util.Timing.Timing",
"numpy.exp",
"numpy.array",
"numpy.sum",
"os.path.abspath",
"sys.path.append"
] | [((33, 58), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (48, 58), False, 'import os\n'), ((93, 119), 'sys.path.append', 'sys.path.append', (['root_path'], {}), '(root_path)\n', (108, 119), False, 'import sys\n'), ((976, 984), 'Util.Timing.Timing', 'Timing', ([], {}), '()\n', (982, 984)... |
import numpy as np
import matplotlib.pyplot as plt
import torch
def plot_weight_graph(epochs, loss_lists, labels, name=''):
epochs_array = np.arange(epochs)
ax = plt.axes(xlabel='epoch', ylabel='weight', xticks=np.arange(0, epochs, 10),
yticks=np.arange(0, 10.0, 0.1))
ax.set_title(name)
... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"numpy.arange"
] | [((145, 162), 'numpy.arange', 'np.arange', (['epochs'], {}), '(epochs)\n', (154, 162), True, 'import numpy as np\n'), ((605, 629), 'matplotlib.pyplot.grid', 'plt.grid', (['(True)'], {'axis': '"""y"""'}), "(True, axis='y')\n", (613, 629), True, 'import matplotlib.pyplot as plt\n'), ((634, 671), 'matplotlib.pyplot.ylim',... |
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from scipy.ndimage import gaussian_filter1d
import tensorflow as tf
import os
from scipy import signal
import scipy
from skued import baseline_dt
def make_prediction(X, model, crystal_system)... | [
"numpy.random.rand",
"scipy.interpolate.interp1d",
"numpy.array",
"tensorflow.keras.models.load_model",
"numpy.sin",
"numpy.arange",
"numpy.mean",
"numpy.reshape",
"numpy.max",
"numpy.linspace",
"numpy.min",
"scipy.ndimage.gaussian_filter1d",
"numpy.random.permutation",
"numpy.random.norma... | [((1843, 1857), 'numpy.array', 'np.array', (['Xnew'], {}), '(Xnew)\n', (1851, 1857), True, 'import numpy as np\n'), ((2665, 2707), 'numpy.reshape', 'np.reshape', (['X', '(X.shape[0], X.shape[1], 1)'], {}), '(X, (X.shape[0], X.shape[1], 1))\n', (2675, 2707), True, 'import numpy as np\n'), ((2985, 3001), 'numpy.empty_lik... |
"""
Phase Estimation Benchmark Program - Qiskit
"""
import sys
import time
import numpy as np
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
sys.path[1:1] = ["_common", "_common/qiskit", "quantum-fourier-transform/qiskit"]
sys.path[1:1] = ["../../_common", "../../_common/qiskit", "../../quantu... | [
"metrics.store_metric",
"execute.submit_circuit",
"metrics.uniform_dist",
"qiskit.ClassicalRegister",
"qft_benchmark.inv_qft_gate",
"metrics.init_metrics",
"execute.init_execution",
"numpy.random.choice",
"metrics.plot_metrics_aq",
"execute.finalize_execution",
"metrics.polarization_fidelity",
... | [((436, 453), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (450, 453), True, 'import numpy as np\n'), ((639, 666), 'qiskit.QuantumRegister', 'QuantumRegister', (['num_qubits'], {}), '(num_qubits)\n', (654, 666), False, 'from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister\n'), ((748, ... |
'''
Utility mesh function for batch generation
Author: <NAME>
Date: Novemebr 2019
Input: root : data path
num_faces : number of sampled faces, default 8000
nb_classes : number of classes, default 8
scale : scale to unite sphere for PointNet, default False
sampling : sam... | [
"numpy.copy",
"os.listdir",
"numpy.ones",
"scipy.spatial.cKDTree",
"open3d.Vector3dVector",
"open3d.PointCloud",
"numpy.argmax",
"open3d.draw_geometries",
"numpy.array",
"numpy.zeros",
"numpy.take",
"numpy.sum",
"numpy.expand_dims",
"numpy.concatenate",
"sklearn.preprocessing.MinMaxScale... | [((1116, 1137), 'os.listdir', 'os.listdir', (['self.root'], {}), '(self.root)\n', (1126, 1137), False, 'import os\n'), ((3179, 3206), 'numpy.zeros', 'np.zeros', (['(n, pts.shape[1])'], {}), '((n, pts.shape[1]))\n', (3187, 3206), True, 'import numpy as np\n'), ((2337, 2369), 'numpy.expand_dims', 'np.expand_dims', (['fac... |
import numpy as np
import pandas as pd
import pytest
from plotnine import ggplot, aes, geom_point, facet_grid, facet_wrap
from plotnine import geom_abline, annotate
from plotnine.data import mpg
from plotnine.exceptions import PlotnineWarning
n = 10
df = pd.DataFrame({'x': range(n),
'y': range(n),
... | [
"plotnine.facet_grid",
"numpy.tile",
"plotnine.ggplot",
"plotnine.annotate",
"plotnine.aes",
"plotnine.facet_wrap",
"plotnine.geom_point",
"plotnine.geom_abline",
"pytest.warns"
] | [((401, 428), 'numpy.tile', 'np.tile', (["['a', 'b']", '(n // 2)'], {}), "(['a', 'b'], n // 2)\n", (408, 428), True, 'import numpy as np\n'), ((569, 582), 'plotnine.aes', 'aes', (['"""x"""', '"""y"""'], {}), "('x', 'y')\n", (572, 582), False, 'from plotnine import ggplot, aes, geom_point, facet_grid, facet_wrap\n'), ((... |
import json
import tempfile
from fastapi import Depends, FastAPI
import numpy as np
import requests
from requests.adapters import HTTPAdapter, Retry
from ray._private.test_utils import wait_for_condition
from ray.air.checkpoint import Checkpoint
from ray.air.predictor import DataBatchType, Predictor
from ray.serve.mo... | [
"ray.serve.ingress",
"fastapi.FastAPI",
"requests.post",
"requests.Session",
"ray.get",
"ray.serve.dag.InputNode",
"requests.adapters.HTTPAdapter",
"ray.serve.deployment",
"numpy.array",
"fastapi.Depends",
"ray.serve.model_wrappers.ModelWrapperDeployment.options",
"ray.serve.model_wrappers.Mod... | [((2317, 2326), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (2324, 2326), False, 'from fastapi import Depends, FastAPI\n'), ((2330, 2371), 'ray.serve.deployment', 'serve.deployment', ([], {'route_prefix': '"""/ingress"""'}), "(route_prefix='/ingress')\n", (2346, 2371), False, 'from ray import serve\n'), ((2373, 239... |
import cv2
from social_distancing import *
import numpy as np
birds_eye = cv2.imread('test_street_bird.jpg')
boxes_image = cv2.imread('test_street_boxes.jpg')
points = [[191, 487], [254, 388], [55, 387], [330, 370], [450, 330], [377, 274]]
birds, matrix = full_social_distancing(boxes_image, points, 80)
inv = np.linal... | [
"cv2.imwrite",
"cv2.imshow",
"cv2.warpPerspective",
"numpy.linalg.inv",
"cv2.waitKey",
"cv2.imread",
"cv2.add"
] | [((75, 109), 'cv2.imread', 'cv2.imread', (['"""test_street_bird.jpg"""'], {}), "('test_street_bird.jpg')\n", (85, 109), False, 'import cv2\n'), ((124, 159), 'cv2.imread', 'cv2.imread', (['"""test_street_boxes.jpg"""'], {}), "('test_street_boxes.jpg')\n", (134, 159), False, 'import cv2\n'), ((312, 333), 'numpy.linalg.in... |
import datetime
import os
import tempfile
from collections import OrderedDict
import boto3
import pandas as pd
import pytest
import yaml
from moto import mock_s3
from numpy.testing import assert_almost_equal
from pandas.testing import assert_frame_equal
from unittest import mock
from triage.component.catwalk.storage ... | [
"triage.component.catwalk.storage.S3Store",
"tempfile.TemporaryDirectory",
"tests.utils.CallSpy",
"triage.component.catwalk.storage.ModelStorageEngine",
"boto3.client",
"yaml.dump",
"triage.component.catwalk.storage.ProjectStorage",
"triage.component.catwalk.storage.FSStore",
"os.path.join",
"pand... | [((1040, 1058), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (1052, 1058), False, 'import boto3\n'), ((1144, 1178), 'triage.component.catwalk.storage.S3Store', 'S3Store', (['"""s3://test_bucket/a_path"""'], {}), "('s3://test_bucket/a_path')\n", (1151, 1178), False, 'from triage.component.catwalk.stor... |
import numpy
import matplotlib as mpl
mpl.use('Agg')
from matplotlib import pyplot as plt
import matplotlib as mpl
from libKMCUDA import kmeans_cuda
# numpy.random.seed(0)
# arr = numpy.empty((10000, 2), dtype=numpy.float32)
# arr[:2500] = numpy.random.rand(2500, 2) + [0, 2]
# arr[2500:5000] = numpy.random.rand(2500, ... | [
"numpy.random.normal",
"matplotlib.pyplot.savefig",
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.empty",
"numpy.random.seed",
"matplotlib.pyplot.scatter",
"libKMCUDA.kmeans_cuda"
] | [((38, 52), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (45, 52), True, 'import matplotlib as mpl\n'), ((734, 754), 'numpy.random.seed', 'numpy.random.seed', (['(0)'], {}), '(0)\n', (751, 754), False, 'import numpy\n'), ((761, 805), 'numpy.empty', 'numpy.empty', (['(10000, 2)'], {'dtype': 'numpy.floa... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import time
import numpy as np
from acq4.devices.Stage import Stage, MoveFuture
from pyqtgraph import ptime
from acq4.util import Qt
from acq4.util.Mutex import Mutex
from acq4.util.Thread import Thread
class MockStage(Stage):
def __init__(self, dm... | [
"acq4.util.Mutex.Mutex",
"numpy.all",
"acq4.util.Thread.Thread.__init__",
"pyqtgraph.ptime.time",
"acq4.util.Qt.QCoreApplication.instance",
"time.sleep",
"numpy.array",
"numpy.zeros",
"acq4.util.Thread.Thread.start",
"numpy.linalg.norm",
"acq4.devices.Stage.Stage.__init__",
"acq4.util.Qt.Signa... | [((5479, 5496), 'acq4.util.Qt.Signal', 'Qt.Signal', (['object'], {}), '(object)\n', (5488, 5496), False, 'from acq4.util import Qt\n'), ((345, 383), 'acq4.devices.Stage.Stage.__init__', 'Stage.__init__', (['self', 'dm', 'config', 'name'], {}), '(self, dm, config, name)\n', (359, 383), False, 'from acq4.devices.Stage im... |
# Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"tensorflow_graphics.geometry.transformation.look_at.right_handed",
"absl.testing.parameterized.parameters",
"numpy.array",
"numpy.random.randint",
"numpy.random.uniform"
] | [((1729, 1857), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['((3,), (3,), (3,))', '((None, 3), (None, 3), (None, 3))', '((None, 2, 3), (None, 2, 3), (None, 2, 3))'], {}), '(((3,), (3,), (3,)), ((None, 3), (None, 3), (None, \n 3)), ((None, 2, 3), (None, 2, 3), (None, 2, 3)))\n', (1753, 1857... |
import cv2 as cv2
import numpy as np
import os
def getCoordinates(top_left, w, h, best_val):
bottom_right = (top_left[0] + w, top_left[1] + h)
center = (top_left[0] + (w/2), top_left[1] + (h/2))
return [
{
'top_left': top_left,
'bottom_right': bottom_right,
'cent... | [
"os.listdir",
"os.path.join",
"numpy.array",
"cv2.cvtColor",
"cv2.split"
] | [((535, 549), 'cv2.split', 'cv2.split', (['img'], {}), '(img)\n', (544, 549), True, 'import cv2 as cv2\n'), ((561, 582), 'numpy.array', 'np.array', (['channels[3]'], {}), '(channels[3])\n', (569, 582), True, 'import numpy as np\n'), ((712, 750), 'cv2.cvtColor', 'cv2.cvtColor', (['mask', 'cv2.COLOR_GRAY2BGR'], {}), '(ma... |
# Copyright 2019 Baidu Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | [
"numpy.random.normal",
"scipy.ndimage.filters.median_filter",
"numpy.add",
"numpy.zeros",
"numpy.sign"
] | [((3044, 3135), 'scipy.ndimage.filters.median_filter', 'ndimage.filters.median_filter', (['img_batch_np'], {'size': '(1, width, height, 1)', 'mode': '"""reflect"""'}), "(img_batch_np, size=(1, width, height, 1),\n mode='reflect')\n", (3073, 3135), False, 'from scipy import ndimage\n'), ((1295, 1328), 'numpy.sign', '... |
import numpy as np
from tqdm import tqdm
# setup rpy2 on Windows
# edit the path here according to your machine
import platform
if platform.system() == 'Windows':
import os
os.environ['PATH'] = 'C:/Program Files/R/R-3.6.0/bin/' + os.pathsep + 'C:/Program Files/R/R-3.6.0/bin/x64/' + os.pathsep + os.environ['PAT... | [
"numpy.reshape",
"numpy.unique",
"numpy.ones",
"numpy.arccos",
"numpy.where",
"numpy.array",
"platform.system",
"numpy.zeros",
"numpy.empty",
"numpy.cos",
"numpy.argwhere",
"numpy.sin",
"numpy.load",
"numpy.zeros_like",
"numpy.save"
] | [((132, 149), 'platform.system', 'platform.system', ([], {}), '()\n', (147, 149), False, 'import platform\n'), ((1064, 1090), 'numpy.load', 'np.load', (['"""./data/year.npy"""'], {}), "('./data/year.npy')\n", (1071, 1090), True, 'import numpy as np\n'), ((1103, 1130), 'numpy.load', 'np.load', (['"""./data/month.npy"""'... |
"""
Setup file for package `petitRADTRANS`.
"""
from setuptools import find_packages
from numpy.distutils.core import Extension, setup
import os
import warnings
use_compiler_flags = True
if use_compiler_flags:
extra_compile_args = ["-O3",
"-funroll-loops",
"-ftree-v... | [
"os.path.dirname",
"numpy.distutils.core.Extension",
"setuptools.find_packages"
] | [((483, 609), 'numpy.distutils.core.Extension', 'Extension', ([], {'name': '"""petitRADTRANS.fort_spec"""', 'sources': "['petitRADTRANS/fort_spec.f90']", 'extra_compile_args': 'extra_compile_args'}), "(name='petitRADTRANS.fort_spec', sources=[\n 'petitRADTRANS/fort_spec.f90'], extra_compile_args=extra_compile_args)\... |
import pandas as pd
import numpy as np
from autoscalingsim.load.regional_load_model.load_models.parsers.patterns_parsers.leveled_load_parser import LeveledLoadPatternParser
from autoscalingsim.utils.error_check import ErrorChecker
@LeveledLoadPatternParser.register('step')
class StepLoadPatternParser(LeveledLoadPatte... | [
"pandas.Timedelta",
"numpy.floor",
"autoscalingsim.utils.error_check.ErrorChecker.key_check_and_load",
"numpy.random.randint",
"autoscalingsim.load.regional_load_model.load_models.parsers.patterns_parsers.leveled_load_parser.LeveledLoadPatternParser.register"
] | [((234, 275), 'autoscalingsim.load.regional_load_model.load_models.parsers.patterns_parsers.leveled_load_parser.LeveledLoadPatternParser.register', 'LeveledLoadPatternParser.register', (['"""step"""'], {}), "('step')\n", (267, 275), False, 'from autoscalingsim.load.regional_load_model.load_models.parsers.patterns_parse... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 16:54:33 2019
@author: TMaysGGS
"""
'''Updated on 07/31/2019 11:14'''
'''Problem
There is an intermediate layer that has the shape (m, m), which means a 26928 * 26928 matrix.
Each element takes 32 bit so that the total space needed is more than 21G, which w... | [
"keras.layers.Conv2D",
"keras.utils.to_categorical",
"keras.layers.PReLU",
"math.cos",
"numpy.array",
"keras.backend.dot",
"keras.layers.Dense",
"os.listdir",
"keras.backend.image_data_format",
"keras.backend.square",
"keras.models.Model",
"keras.callbacks.EarlyStopping",
"keras.backend.epsi... | [((8748, 8777), 'keras.models.Model', 'Model', (['model.input[0]', 'output'], {}), '(model.input[0], output)\n', (8753, 8777), False, 'from keras.models import Model\n'), ((8889, 8909), 'keras.layers.Input', 'Input', (['(NUM_LABELS,)'], {}), '((NUM_LABELS,))\n', (8894, 8909), False, 'from keras.layers import BatchNorma... |
# Draw 3d plots of LUT cube file.
# Usage: python plot_cube.py [lut file] [skip(optional)]
# -Only LUT_3D type of cube format is supported.
# -If the generated plot is too messy, try larger skip value (default 4) to generate sparse meshgrid.
import sys
import os.path
import re
from mpl_toolkits.mplot3d import Axes... | [
"numpy.float64",
"re.match",
"matplotlib.cm.hsv",
"matplotlib.pyplot.figure",
"numpy.zeros",
"numpy.meshgrid",
"mpl_toolkits.mplot3d.Axes3D",
"matplotlib.pyplot.show"
] | [((858, 881), 're.match', 're.match', (['pattern', 'line'], {}), '(pattern, line)\n', (866, 881), False, 'import re\n'), ((1123, 1146), 're.match', 're.match', (['pattern', 'line'], {}), '(pattern, line)\n', (1131, 1146), False, 'import re\n'), ((1593, 1616), 're.match', 're.match', (['pattern', 'line'], {}), '(pattern... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: ogouvert
x_l \sim Log(p) (logarithmic distribution)
which implies: y \sim sumLog(n,p)
"""
import numpy as np
import scipy.special as special
import scipy.sparse as sparse
import dcpf
class dcpf_Log(dcpf.dcpf):
def __init__(self, K, p, t=1.,
... | [
"matplotlib.pyplot.imshow",
"numpy.ones_like",
"scipy.special.digamma",
"numpy.random.poisson",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.plot",
"numpy.log",
"numpy.dot",
"numpy.random.gamma",
"matplotlib.pyplot.figure",
"numpy.random.seed",
"scipy.sparse.csr_matrix",
"dcpf.dcpf.__ini... | [((2368, 2386), 'numpy.random.seed', 'np.random.seed', (['(93)'], {}), '(93)\n', (2382, 2386), True, 'import numpy as np\n'), ((2395, 2428), 'numpy.random.gamma', 'np.random.gamma', (['(1.0)', '(0.1)', '(U, K)'], {}), '(1.0, 0.1, (U, K))\n', (2410, 2428), True, 'import numpy as np\n'), ((2433, 2466), 'numpy.random.gamm... |
import os
import tempfile
import zipfile
from io import BytesIO
import cv2
import click
import numpy as np
from skimage import filters
from tqdm import tqdm
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from dataset import rtranspose
from loader import get_loaders
from loss import ... | [
"numpy.uint8",
"numpy.mean",
"numpy.greater",
"numpy.unique",
"zipfile.ZipFile",
"os.makedirs",
"click.option",
"numpy.std",
"io.BytesIO",
"numpy.stack",
"loss.fmicro_np",
"loss.dice_np",
"os.path.basename",
"numpy.savetxt",
"tempfile.NamedTemporaryFile",
"click.command",
"numpy.zero... | [((1262, 1277), 'click.command', 'click.command', ([], {}), '()\n', (1275, 1277), False, 'import click\n'), ((1279, 1349), 'click.option', 'click.option', (['"""-n"""', '"""--name"""'], {'default': '"""invalid9000"""', 'help': '"""Model name"""'}), "('-n', '--name', default='invalid9000', help='Model name')\n", (1291, ... |
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, ... | [
"numpy.max",
"numpy.array",
"sys.exit",
"math.floor"
] | [((1451, 1593), 'numpy.array', 'numpy.array', (['[[1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0]]', 'numpy.double'], {}), '([[1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0, 0.0,\n 0.0, 0.0], [0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0]], numpy.doub... |
from sklearn import neural_network
import numpy as np
from sklearn.metrics import accuracy_score, precision_score
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from plots import makeAndPlotLearningCurve, plotConfusionMatrix, plotPerformance, plotValidationCurve
from load_data im... | [
"matplotlib.pyplot.savefig",
"sklearn.neural_network.MLPClassifier",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"plots.plotValidationCurve",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.clf",
"plots.makeAndPlotLearningCurve",
"matplotlib.pyplot.plot",
"load_data.PenDigitsDataset",
"sklearn.pr... | [((475, 513), 'numpy.linspace', 'np.linspace', (['(0.1)', '(1)', '(40)'], {'endpoint': '(True)'}), '(0.1, 1, 40, endpoint=True)\n', (486, 513), True, 'import numpy as np\n'), ((600, 770), 'plots.makeAndPlotLearningCurve', 'makeAndPlotLearningCurve', (['best_estimator', '"""decisionTree"""', 'dataset.xtrain', 'dataset.y... |
# -*- coding: utf-8 -*-
"""
Tests for the audiotsm.io.array package.
"""
import pytest
import numpy as np
from numpy.testing import assert_almost_equal
from audiotsm.io.array import ArrayReader, ArrayWriter, FixedArrayWriter
@pytest.mark.parametrize("data_in, read_out, n_out, data_out", [
([[]], [[]], 0, [[]])... | [
"audiotsm.io.array.FixedArrayWriter",
"pytest.mark.parametrize",
"numpy.array",
"numpy.testing.assert_almost_equal",
"numpy.zeros_like"
] | [((231, 675), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""data_in, read_out, n_out, data_out"""', '[([[]], [[]], 0, [[]]), ([[]], [[0]], 0, [[]]), ([[1, 2, 3], [4, 5, 6]], [[\n ], []], 0, [[1, 2, 3], [4, 5, 6]]), ([[1, 2, 3], [4, 5, 6]], [[1], [4]],\n 1, [[2, 3], [5, 6]]), ([[1, 2, 3], [4, 5, 6]],... |
import torch
import random
import numpy as np
from sklearn.model_selection import KFold
from Reader import Reader
from NejiAnnotator import readPickle
from models.utils import classListToTensor, classDictToList, getSentenceList, mergeDictionaries
from models.clinicalBERT.utils import BERT_ENTITY_CLASSES, loadModelCo... | [
"models.utils.mergeDictionaries",
"torch.manual_seed",
"torch.cuda.get_device_name",
"models.utils.classListToTensor",
"torch.cuda.memory_allocated",
"torch.LongTensor",
"torch.cuda.memory_cached",
"random.seed",
"sklearn.model_selection.KFold",
"Reader.Reader",
"NejiAnnotator.readPickle",
"to... | [((921, 945), 'random.seed', 'random.seed', (['random_seed'], {}), '(random_seed)\n', (932, 945), False, 'import random\n'), ((950, 977), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (964, 977), True, 'import numpy as np\n'), ((982, 1012), 'torch.manual_seed', 'torch.manual_seed', ([... |
# -*- coding: utf-8 -*-
# Copyright 2022, SERTIT-ICube - France, https://sertit.unistra.fr/
# This file is part of eoreader project
# https://github.com/sertit/eoreader
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | [
"logging.getLogger",
"datetime.datetime.strptime",
"cloudpathlib.AnyPath",
"shapely.geometry.box",
"numpy.zeros",
"shapely.geometry.Polygon",
"sertit.strings.str_to_list",
"sertit.files.get_filename",
"geopandas.GeoDataFrame",
"warnings.filterwarnings",
"eoreader.exceptions.InvalidProductError"
... | [((1496, 1528), 'logging.getLogger', 'logging.getLogger', (['EOREADER_NAME'], {}), '(EOREADER_NAME)\n', (1513, 1528), False, 'import logging\n'), ((1603, 1691), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'rasterio.errors.NotGeoreferencedWarning'}), "('ignore', category=rasteri... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
from io import open
import sys
import platform
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext as _build_ext
class build_ext(_build_ext):
... | [
"setuptools.find_packages",
"os.path.join",
"sys.platform.startswith",
"imp.reload",
"setuptools.Extension",
"os.path.dirname",
"importlib.reload",
"numpy.get_include",
"platform.machine",
"setuptools.command.build_ext.build_ext.finalize_options"
] | [((1013, 1038), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1028, 1038), False, 'import os\n'), ((1064, 1094), 'sys.platform.startswith', 'sys.platform.startswith', (['"""win"""'], {}), "('win')\n", (1087, 1094), False, 'import sys\n'), ((359, 392), 'setuptools.command.build_ext.build_ext... |
# -*- coding: utf-8 -*-
import numpy as np
from mabwiser.mab import LearningPolicy, NeighborhoodPolicy
from tests.test_base import BaseTest
class ParallelTest(BaseTest):
def test_greedy_t1(self):
arms, mab = self.predict(arms=[1, 2, 3],
decisions=[1, 1, 1, 3, 2, 2, 3, ... | [
"mabwiser.mab.NeighborhoodPolicy.KNearest",
"mabwiser.mab.LearningPolicy.UCB1",
"mabwiser.mab.NeighborhoodPolicy.Clusters",
"mabwiser.mab.LearningPolicy.LinUCB",
"mabwiser.mab.LearningPolicy.Popularity",
"mabwiser.mab.LearningPolicy.ThompsonSampling",
"mabwiser.mab.NeighborhoodPolicy.Radius",
"mabwise... | [((9655, 9686), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': '(111)'}), '(seed=111)\n', (9676, 9686), True, 'import numpy as np\n'), ((12061, 12090), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': '(7)'}), '(seed=7)\n', (12082, 12090), True, 'import numpy as np\n'), ((16983, 17... |
# -*- coding: utf-8 -*-
import argparse
import logging
import random
from collections import Counter
import math
import numpy as np
import pandas as pd
import torch
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping
from pytorch_lightning.core.lightning import ... | [
"logging.getLogger",
"torch.nn.CrossEntropyLoss",
"pandas.read_csv",
"torch.LongTensor",
"torch.exp",
"numpy.array",
"transformers.GPT2LMHeadModel.from_pretrained",
"pytorch_lightning.Trainer.from_argparse_args",
"logging.info",
"pytorch_lightning.callbacks.ModelCheckpoint",
"pytorch_lightning.T... | [((588, 651), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Simsimi based on KoGPT-2"""'}), "(description='Simsimi based on KoGPT-2')\n", (611, 651), False, 'import argparse\n'), ((1365, 1384), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1382, 1384), False, 'import logg... |
#!/usr/bin/env python
import numpy
from functools import reduce
from pyscf.pbc import gto, scf
from pyscf.pbc import tools as pbctools
alat0 = 3.6
cell = gto.Cell()
cell.a = (numpy.ones((3,3))-numpy.eye(3))*alat0/2.0
cell.atom = (('C',0,0,0),('C',numpy.array([0.25,0.25,0.25])*alat0))
cell.basis = 'gth-dzvp'
cell.ps... | [
"pyscf.pbc.scf.RHF",
"numpy.eye",
"numpy.ones",
"pyscf.tools.fcidump.from_integrals",
"numpy.array",
"numpy.zeros",
"pyscf.pbc.gto.Cell"
] | [((158, 168), 'pyscf.pbc.gto.Cell', 'gto.Cell', ([], {}), '()\n', (166, 168), False, 'from pyscf.pbc import gto, scf\n'), ((393, 406), 'pyscf.pbc.scf.RHF', 'scf.RHF', (['cell'], {}), '(cell)\n', (400, 406), False, 'from pyscf.pbc import gto, scf\n'), ((700, 816), 'pyscf.tools.fcidump.from_integrals', 'tools.fcidump.fro... |
# coding=utf-8
import numpy as np
from bilstm_crf_add_word import BiLSTM_CRF
from keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau, \
TensorBoard
from keras.optimizers import Adam, Nadam
import os
# os.environ["CUDA_VISIBLE_DEVICES"] = "1"
char_embedding_mat = np.load('data/char_embedding_... | [
"keras.optimizers.Adam",
"keras.callbacks.ReduceLROnPlateau",
"os.path.join",
"os.getcwd",
"keras.callbacks.TensorBoard",
"keras.callbacks.EarlyStopping",
"bilstm_crf_add_word.BiLSTM_CRF",
"numpy.load"
] | [((291, 332), 'numpy.load', 'np.load', (['"""data/char_embedding_matrix.npy"""'], {}), "('data/char_embedding_matrix.npy')\n", (298, 332), True, 'import numpy as np\n'), ((354, 395), 'numpy.load', 'np.load', (['"""data/word_embedding_matrix.npy"""'], {}), "('data/word_embedding_matrix.npy')\n", (361, 395), True, 'impor... |
from typing import List, Dict, DefaultDict
from pathlib import Path
import joblib
import collections
from tqdm import trange
import yaml
import datetime
import numpy as np
from scipy import stats
from poker_ai.games.short_deck.state import ShortDeckPokerState, new_game
from poker_ai.poker.card import Card
def _calc... | [
"numpy.abs",
"yaml.safe_dump",
"numpy.sqrt",
"yaml.dump",
"pathlib.Path",
"numpy.random.choice",
"poker_ai.games.short_deck.state.new_game",
"numpy.array",
"datetime.datetime.now",
"numpy.append",
"collections.defaultdict",
"joblib.load",
"tqdm.trange"
] | [((1599, 1636), 'pathlib.Path', 'Path', (['f"""./{folder_id}_results_{time}"""'], {}), "(f'./{folder_id}_results_{time}')\n", (1603, 1636), False, 'from pathlib import Path\n'), ((3093, 3105), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3101, 3105), True, 'import numpy as np\n'), ((3119, 3143), 'tqdm.trange', '... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from logging import getLogger
from random import randrange
import os
import numpy as np
from sklearn.feature_extraction ... | [
"logging.getLogger",
"torchvision.transforms.CenterCrop",
"numpy.flipud",
"torchvision.transforms.RandomHorizontalFlip",
"numpy.asarray",
"torchvision.datasets.ImageFolder",
"numpy.zeros",
"torchvision.transforms.Normalize",
"torchvision.transforms.Resize",
"torchvision.transforms.ToTensor",
"nu... | [((547, 558), 'logging.getLogger', 'getLogger', ([], {}), '()\n', (556, 558), False, 'from logging import getLogger\n'), ((736, 772), 'torchvision.datasets.ImageFolder', 'datasets.ImageFolder', (['args.data_path'], {}), '(args.data_path)\n', (756, 772), True, 'import torchvision.datasets as datasets\n'), ((917, 992), '... |
"""
simPlot.py
<NAME>
Date of creation 17. feb 2016
"""
import springMassSystem as sms
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm #Color map
import matplotlib.animation as animation
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import gridspec
import matplotlib.tri as tri
imp... | [
"springMassSystem.Cloth",
"matplotlib.animation.FuncAnimation",
"matplotlib.tri.Triangulation",
"numpy.append",
"matplotlib.pyplot.figure",
"numpy.zeros",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((2024, 2061), 'springMassSystem.Cloth', 'sms.Cloth', (['CONST_X', 'CONST_Y', '(0.3)', '(0.1)'], {}), '(CONST_X, CONST_Y, 0.3, 0.1)\n', (2033, 2061), True, 'import springMassSystem as sms\n'), ((2068, 2087), 'numpy.arange', 'np.arange', (['(2 * c.dY)'], {}), '(2 * c.dY)\n', (2077, 2087), True, 'import numpy as np\n'),... |
# Copyright 2018 The TensorFlow Probability 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 o... | [
"tensorflow_probability.python.bijectors.bijector_test_util.assert_bijective_and_finite",
"numpy.int32",
"tensorflow_probability.python.bijectors.Permute",
"tensorflow.test.main",
"tensorflow.keras.Input",
"tensorflow.compat.v1.placeholder_with_default",
"numpy.random.randn",
"numpy.random.RandomState... | [((4051, 4065), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (4063, 4065), True, 'import tensorflow as tf\n'), ((1400, 1425), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (1421, 1425), True, 'import numpy as np\n'), ((1480, 1499), 'numpy.int32', 'np.int32', (['[2, 0, 1]'],... |
import os
import numpy as np
import pytest
import torch
import torch.nn.functional as F
import torchvision.transforms as transforms
import ignite.distributed as idist
from ignite.metrics.gan.inception_score import InceptionScore
torch.manual_seed(42)
class IgnoreLabelDataset(torch.utils.data.Dataset):
def __in... | [
"numpy.log",
"torch.cuda.device_count",
"ignite.engine.Engine",
"torch.cuda.is_available",
"torchvision.models.inception_v3",
"ignite.distributed.device",
"torch.nn.functional.softmax",
"numpy.mean",
"numpy.exp",
"numpy.vstack",
"pytest.mark.skipif",
"torchvision.transforms.ToTensor",
"torch... | [((232, 253), 'torch.manual_seed', 'torch.manual_seed', (['(42)'], {}), '(42)\n', (249, 253), False, 'import torch\n'), ((2303, 2402), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not idist.has_native_dist_support)'], {'reason': '"""Skip if no native dist support"""'}), "(not idist.has_native_dist_support, reason=\n... |
#
# Experiment class
#
import numpy as np
examples = """
Discharge at 1C for 0.5 hours,
Discharge at C/20 for 0.5 hours,
Charge at 0.5 C for 45 minutes,
Discharge at 1 A for 90 seconds,
Charge at 200mA for 45 minutes (1 minute period),
Discharge at 1 W for 0.5 hours,
Charge at 200 mW for ... | [
"numpy.append",
"numpy.tile",
"numpy.diff",
"numpy.column_stack"
] | [((12237, 12266), 'numpy.tile', 'np.tile', (['drive_cycle[:, 1]', 'i'], {}), '(drive_cycle[:, 1], i)\n', (12244, 12266), True, 'import numpy as np\n'), ((12341, 12376), 'numpy.column_stack', 'np.column_stack', (['(time, drive_data)'], {}), '((time, drive_data))\n', (12356, 12376), True, 'import numpy as np\n'), ((12040... |
"""
This is is a part of the DeepLearning.AI TensorFlow Developer Professional Certificate offered on Coursera.
All copyrights belong to them. I am sharing this work here to showcase the projects I have worked on
Course: Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning
... | [
"numpy.array",
"tensorflow.keras.layers.Dense"
] | [((871, 899), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6]'], {}), '([1, 2, 3, 4, 5, 6])\n', (879, 899), True, 'import numpy as np\n'), ((910, 944), 'numpy.array', 'np.array', (['[1, 1.5, 2, 2.5, 3, 3.5]'], {}), '([1, 1.5, 2, 2.5, 3, 3.5])\n', (918, 944), True, 'import numpy as np\n'), ((979, 1023), 'tensorflow.ker... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 30 12:26:38 2012
Author: <NAME>
"""
'''
function jc = c_sja(n,p)
% PURPOSE: find critical values for Johansen maximum eigenvalue statistic
% ------------------------------------------------------------
% USAGE: jc = c_sja(n,p)
% where: n = dimension of the VAR system
... | [
"numpy.full"
] | [((3080, 3098), 'numpy.full', 'np.full', (['(3)', 'np.nan'], {}), '(3, np.nan)\n', (3087, 3098), True, 'import numpy as np\n'), ((6813, 6831), 'numpy.full', 'np.full', (['(3)', 'np.nan'], {}), '(3, np.nan)\n', (6820, 6831), True, 'import numpy as np\n'), ((3144, 3162), 'numpy.full', 'np.full', (['(3)', 'np.nan'], {}), ... |
from multiml.storegate import StoreGate
import numpy as np
def get_storegate(data_path='/tmp/onlyDiTau/', max_events=50000):
# Index for signal/background shuffle
cur_seed = np.random.get_state()
np.random.seed(1)
permute = np.random.permutation(2 * max_events)
np.random.set_state(cur_s... | [
"numpy.random.get_state",
"numpy.transpose",
"numpy.random.set_state",
"multiml.storegate.StoreGate",
"numpy.ones",
"numpy.zeros",
"numpy.random.seed",
"numpy.concatenate",
"numpy.load",
"numpy.random.permutation"
] | [((195, 216), 'numpy.random.get_state', 'np.random.get_state', ([], {}), '()\n', (214, 216), True, 'import numpy as np\n'), ((221, 238), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (235, 238), True, 'import numpy as np\n'), ((253, 290), 'numpy.random.permutation', 'np.random.permutation', (['(2 * max... |
# -*- coding: utf-8 -*-
import numpy as np
import torch
from utils import utils_image as util
import re
import glob
import os
'''
# --------------------------------------------
# Model
# --------------------------------------------
# <NAME> (github: https://github.com/cszn)
# 03/Mar/2019
# ------------... | [
"torch.cuda.Event",
"numpy.ceil",
"torch.stack",
"utils.utils_image.augment_img_tensor4",
"torch.nn.Conv2d",
"torch.zeros",
"torch.no_grad",
"torch.nn.ReplicationPad2d",
"torch.cuda.empty_cache",
"torch.randn"
] | [((6013, 6039), 'torch.stack', 'torch.stack', (['E_list'], {'dim': '(0)'}), '(E_list, dim=0)\n', (6024, 6039), False, 'import torch\n'), ((6704, 6730), 'torch.stack', 'torch.stack', (['E_list'], {'dim': '(0)'}), '(E_list, dim=0)\n', (6715, 6730), False, 'import torch\n'), ((9648, 9684), 'torch.cuda.Event', 'torch.cuda.... |
import unittest
import shutil
import tempfile
import numpy as np
import pandas as pd
import pymc3 as pm
from pymc3 import summary
from sklearn.gaussian_process import GaussianProcessRegressor as skGaussianProcessRegressor
from sklearn.model_selection import train_test_split
from pymc3_models.exc import PyMC3ModelsEr... | [
"sklearn.gaussian_process.GaussianProcessRegressor",
"pymc3_models.models.GaussianProcessRegression.GaussianProcessRegression",
"pymc3.gp.cov.ExpQuad",
"numpy.eye",
"sklearn.model_selection.train_test_split",
"pymc3.summary",
"pymc3.gp.mean.Zero",
"numpy.linspace",
"tempfile.mkdtemp",
"shutil.rmtr... | [((924, 941), 'pymc3.gp.mean.Zero', 'pm.gp.mean.Zero', ([], {}), '()\n', (939, 941), True, 'import pymc3 as pm\n'), ((1370, 1407), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.3)'}), '(X, y, test_size=0.3)\n', (1386, 1407), False, 'from sklearn.model_selection import tr... |
from collections import defaultdict
import numpy as np
# Grafted from
# https://github.com/maartenbreddels/ipyvolume/blob/d13828dfd8b57739004d5daf7a1d93ad0839ed0f/ipyvolume/serialize.py#L219
def array_to_binary(ar, obj=None, force_contiguous=True):
if ar is None:
return None
if ar.dtype.kind not in [... | [
"collections.defaultdict",
"numpy.ascontiguousarray"
] | [((1202, 1219), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (1213, 1219), False, 'from collections import defaultdict\n'), ((732, 756), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['ar'], {}), '(ar)\n', (752, 756), True, 'import numpy as np\n')] |
import random
import numpy as np
from MAIN.Basics import Processor, Space
from operator import itemgetter
class StateSpace(Processor, Space):
def __init__(self, agent):
self.agent = agent
super().__init__(agent.config['StateSpaceState'])
def process(self):
self.agent.dat... | [
"numpy.random.choice",
"random.random",
"numpy.argmax",
"random.randrange"
] | [((3017, 3043), 'random.randrange', 'random.randrange', (['n_action'], {}), '(n_action)\n', (3033, 3043), False, 'import random\n'), ((3349, 3367), 'numpy.argmax', 'np.argmax', (['q_value'], {}), '(q_value)\n', (3358, 3367), True, 'import numpy as np\n'), ((3978, 4041), 'numpy.random.choice', 'np.random.choice', (['sel... |
#!/usr/bin/env python3
#
# Pocket SDR Python AP - GNSS Signal Tracking Log Plot
#
# Author:
# T.TAKASU
#
# History:
# 2022-02-11 1.0 new
#
import sys, re
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import sdr_rtk
mpl.rcParams['toolbar'] = 'None';
mpl.rcParams['font.size'] = 9
# ... | [
"sdr_rtk.satpos",
"re.split",
"sdr_rtk.readrnx",
"sdr_rtk.GTIME",
"sdr_rtk.timediff",
"sdr_rtk.geodist",
"sdr_rtk.satazel",
"numpy.floor",
"sdr_rtk.pos2ecef",
"numpy.array",
"matplotlib.pyplot.figure",
"sdr_rtk.utc2gpst",
"sdr_rtk.satno",
"sdr_rtk.timeadd",
"sdr_rtk.navfree",
"numpy.ar... | [((894, 915), 'sdr_rtk.pos2ecef', 'sdr_rtk.pos2ecef', (['pos'], {}), '(pos)\n', (910, 915), False, 'import sdr_rtk\n'), ((940, 964), 'sdr_rtk.timediff', 'sdr_rtk.timediff', (['te', 'ts'], {}), '(te, ts)\n', (956, 964), False, 'import sdr_rtk\n'), ((978, 1011), 'numpy.arange', 'np.arange', (['(0.0)', '(span + 30.0)', '(... |
# -*- coding: utf-8 -*-
"""
201901, Dr. <NAME>, Beijing & Xinglong, NAOC
202101-? Dr. <NAME> & Dr./Prof. <NAME>
Light_Curve_Pipeline
v3 (2021A) Upgrade from former version, remove unused code
Qx_xxxx_ is the working part of the step, while Qx_xxxx is the shell
"""
import numpy as np
import astropy... | [
"numpy.median",
"astropy.io.fits.getheader",
"numpy.nanmedian",
"astropy.io.fits.PrimaryHDU",
"astropy.io.fits.getdata",
"numpy.empty"
] | [((504, 526), 'astropy.io.fits.getheader', 'fits.getheader', (['lst[0]'], {}), '(lst[0])\n', (518, 526), True, 'import astropy.io.fits as fits\n'), ((763, 786), 'astropy.io.fits.getdata', 'fits.getdata', (['bias_fits'], {}), '(bias_fits)\n', (775, 786), True, 'import astropy.io.fits as fits\n'), ((822, 862), 'numpy.emp... |
import os
import time
import numpy as np
import tensorflow as tf
from config_api.config_utils import Config as Config
from data_apis.corpus import ConvAI2DialogCorpus
from data_apis.data_utils import ConvAI2DataLoader
from models.model import perCVAE
import argparse
parser = argparse.ArgumentParser()
parser.add_argume... | [
"os.path.exists",
"config_api.config_utils.Config",
"tensorflow.variable_scope",
"argparse.ArgumentParser",
"models.model.perCVAE",
"tensorflow.Session",
"time.strftime",
"os.path.join",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.train.get_checkpoint_state",
"tensorflow.global_variables_i... | [((277, 302), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (300, 302), False, 'import argparse\n'), ((1581, 1681), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""word2vec_path"""', 'word2vec_path', '"""The path to word2vec. Can be None."""'], {}), "('word2vec_path',... |
#from planenet code is adapted for planercnn code
import cv2
import numpy as np
WIDTH = 256
HEIGHT = 192
ALL_TITLES = ['PlaneNet']
ALL_METHODS = [('sample_np10_hybrid3_bl0_dl0_ds0_crfrnn5_sm0', '', 0, 2)]
def predict3D(folder, index, image, depth, segmentation, planes, info):
writePLYFile(folder, index, ima... | [
"cv2.imwrite",
"cv2.resize",
"numpy.minimum",
"numpy.arange",
"numpy.argmax",
"numpy.array",
"numpy.stack",
"numpy.deg2rad",
"numpy.zeros",
"numpy.dot",
"numpy.expand_dims",
"numpy.linalg.norm",
"numpy.concatenate",
"numpy.full",
"numpy.maximum",
"numpy.load",
"cv2.imread",
"numpy.... | [((995, 1043), 'cv2.imwrite', 'cv2.imwrite', (["(folder + '/' + imageFilename)", 'image'], {}), "(folder + '/' + imageFilename, image)\n", (1006, 1043), False, 'import cv2\n'), ((1637, 1664), 'numpy.stack', 'np.stack', (['[X, Y, Z]'], {'axis': '(2)'}), '([X, Y, Z], axis=2)\n', (1645, 1664), True, 'import numpy as np\n'... |
# Copyright (c) 2018 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 app... | [
"reader.Settings",
"paddle.fluid.metrics.DetectionMAP",
"paddle.fluid.layers.py_reader",
"utility.check_cuda",
"multiprocessing.cpu_count",
"numpy.array",
"paddle.fluid.Executor",
"paddle.fluid.layers.ssd_loss",
"paddle.fluid.layers.piecewise_decay",
"reader.train",
"numpy.mean",
"paddle.fluid... | [((1280, 1324), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (1303, 1324), False, 'import argparse\n'), ((1335, 1385), 'functools.partial', 'functools.partial', (['add_arguments'], {'argparser': 'parser'}), '(add_arguments, argparser=parser)\n', (135... |
"""
This module contains all functions that are used the load the data.
Todo:
* Clean the code.
.. _Google Python Style Guide:
http://google.github.io/styleguide/pyguide.html
Format for data loaders:
p, x, h, n_full, cate_name
"""
import numpy as np
import scipy as sp
import pickle
from scipy import ... | [
"numpy.log10",
"numpy.random.rand",
"matplotlib.pyplot.ylabel",
"numpy.array",
"scipy.stats.ttest_ind",
"scipy.stats.norm.cdf",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.random.seed",
"numpy.concatenate",
"numpy.meshgrid",
... | [((629, 677), 'numpy.loadtxt', 'np.loadtxt', (['file_name'], {'skiprows': '(0)', 'delimiter': '""","""'}), "(file_name, skiprows=0, delimiter=',')\n", (639, 677), True, 'import numpy as np\n'), ((844, 892), 'numpy.loadtxt', 'np.loadtxt', (['file_name'], {'skiprows': '(0)', 'delimiter': '""","""'}), "(file_name, skiprow... |
import numpy as np
#pythran export _Aij(float[:,:], int, int)
#pythran export _Aij(int[:,:], int, int)
def _Aij(A, i, j):
"""Sum of upper-left and lower right blocks of contingency table."""
# See `somersd` References [2] bottom of page 309
return A[:i, :j].sum() + A[i+1:, j+1:].sum()
#pythran export _Dij... | [
"numpy.ceil",
"numpy.floor",
"numpy.ones"
] | [((4510, 4536), 'numpy.ones', 'np.ones', (['lenA'], {'dtype': 'dtype'}), '(lenA, dtype=dtype)\n', (4517, 4536), True, 'import numpy as np\n'), ((3757, 3772), 'numpy.ceil', 'np.ceil', (['(h / mg)'], {}), '(h / mg)\n', (3764, 3772), True, 'import numpy as np\n'), ((4857, 4883), 'numpy.ceil', 'np.ceil', (['((ng * i + h) /... |
import random
import torch
import os
import numpy as np
def seed_everything(seed=1234):
"""
Sets a random seed for OS, NumPy, PyTorch and CUDA.
:dwi_params seed: random seed to apply
:return: None
"""
random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
np.ran... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"numpy.random.seed",
"random.seed"
] | [((227, 244), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (238, 244), False, 'import random\n'), ((249, 272), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (266, 272), False, 'import torch\n'), ((277, 309), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_all', (['seed'], {}),... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | [
"numpy.abs",
"typing.cast"
] | [((1663, 1687), 'typing.cast', 'cast', (['SummedOp', 'operator'], {}), '(SummedOp, operator)\n', (1667, 1687), False, 'from typing import cast\n'), ((1796, 1841), 'numpy.abs', 'np.abs', (['[op.coeff for op in summed_op.oplist]'], {}), '([op.coeff for op in summed_op.oplist])\n', (1802, 1841), True, 'import numpy as np\... |
import utils
import torch
import numpy as np
from torch import nn
import torchgeometry
from kornia import color
import torch.nn.functional as F
from time import time
from torchvision.transforms import RandomResizedCrop
class Dense(nn.Module):
def __init__(self, in_features, out_features, activation='relu'):
... | [
"torch.nn.ReLU",
"torch.nn.Tanh",
"torch.nn.InstanceNorm1d",
"torch.nn.InstanceNorm2d",
"torch.sum",
"utils.random_blur_kernel",
"kornia.color.rgb_to_yuv",
"torch.nn.functional.grid_sample",
"torch.nn.Sigmoid",
"torch.mean",
"torch.nn.init.kaiming_normal_",
"torchgeometry.warp_perspective",
... | [((7505, 7570), 'utils.get_rnd_brightness_torch', 'utils.get_rnd_brightness_torch', (['rnd_bri', 'rnd_hue', 'args.batch_size'], {}), '(rnd_bri, rnd_hue, args.batch_size)\n', (7535, 7570), False, 'import utils\n'), ((8109, 8240), 'utils.random_blur_kernel', 'utils.random_blur_kernel', ([], {'probs': '[0.25, 0.25]', 'N_b... |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 25 21:23:38 2011
Author: <NAME> and Scipy developers
License : BSD-3
"""
import numpy as np
from scipy import stats
from statsmodels.tools.validation import array_like, bool_like, int_like
def anderson_statistic(x, dist='norm', fit=True, params=(), axis=0):
"""
... | [
"numpy.ones_like",
"numpy.mean",
"statsmodels.tools.validation.int_like",
"statsmodels.tools.validation.bool_like",
"numpy.searchsorted",
"numpy.sort",
"numpy.size",
"numpy.log",
"statsmodels.tools.validation.array_like",
"numpy.array",
"numpy.exp",
"numpy.std",
"scipy.stats.norm.cdf",
"nu... | [((1011, 1040), 'statsmodels.tools.validation.array_like', 'array_like', (['x', '"""x"""'], {'ndim': 'None'}), "(x, 'x', ndim=None)\n", (1021, 1040), False, 'from statsmodels.tools.validation import array_like, bool_like, int_like\n'), ((1051, 1072), 'statsmodels.tools.validation.bool_like', 'bool_like', (['fit', '"""f... |
#!/usr/bin/env python
# coding=utf-8
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# parameters
learning_rate = 0.01
trainint_epochs = 2000
display_step = 50
# Training Data
train_X = np.array([3.3, 4.4, 5.5, 6.7, 7.0, 4.2, 9.8, 6.2, 7.6, 2.2, 7.0, 10.8, 5.3, 8.0, 5.7, 9.3, 3.1])
train_Y... | [
"tensorflow.pow",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.multiply",
"matplotlib.pyplot.plot",
"tensorflow.global_variables_initializer",
"numpy.array",
"tensorflow.train.GradientDescentOptimizer",
"numpy.random.randn",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((216, 316), 'numpy.array', 'np.array', (['[3.3, 4.4, 5.5, 6.7, 7.0, 4.2, 9.8, 6.2, 7.6, 2.2, 7.0, 10.8, 5.3, 8.0, 5.7,\n 9.3, 3.1]'], {}), '([3.3, 4.4, 5.5, 6.7, 7.0, 4.2, 9.8, 6.2, 7.6, 2.2, 7.0, 10.8, 5.3,\n 8.0, 5.7, 9.3, 3.1])\n', (224, 316), True, 'import numpy as np\n'), ((323, 423), 'numpy.array', 'np.ar... |
import numpy as np
def normalize(x: np.ndarray) -> np.ndarray:
assert x.ndim == 1, 'x must be a vector (ndim: 1)'
return x / np.linalg.norm(x)
def look_at(
eye,
target,
up,
) -> np.ndarray:
"""Returns transformation matrix with eye, at and up.
Parameters
----------
eye: (3,) floa... | [
"numpy.cross",
"numpy.asarray",
"numpy.array",
"numpy.zeros",
"numpy.vstack",
"numpy.linalg.norm"
] | [((948, 976), 'numpy.asarray', 'np.asarray', (['eye'], {'dtype': 'float'}), '(eye, dtype=float)\n', (958, 976), True, 'import numpy as np\n'), ((1602, 1637), 'numpy.vstack', 'np.vstack', (['(x_axis, y_axis, z_axis)'], {}), '((x_axis, y_axis, z_axis))\n', (1611, 1637), True, 'import numpy as np\n'), ((1669, 1685), 'nump... |
"""Module containing python functions, which generate first order Pauli kernel."""
import numpy as np
import itertools
from ...wrappers.mytypes import doublenp
from ...specfunc.specfunc_elph import FuncPauliElPh
from ..aprclass import ApproachElPh
from ..base.pauli import ApproachPauli as ApproachPauliBase
# ----... | [
"itertools.permutations",
"numpy.zeros"
] | [((844, 884), 'numpy.zeros', 'np.zeros', (['(nbaths, ndm0)'], {'dtype': 'doublenp'}), '((nbaths, ndm0), dtype=doublenp)\n', (852, 884), True, 'import numpy as np\n'), ((1581, 1624), 'itertools.permutations', 'itertools.permutations', (['statesdm[charge]', '(2)'], {}), '(statesdm[charge], 2)\n', (1603, 1624), False, 'im... |
import numpy as np
from spinup.envs.pointbot_const import *
import pickle
class ReacherRewardBrex():
# Daniel's Suggested Reward
def __init__(self):
with open('brex_reacher.pickle', 'rb') as handle:
b = pickle.load(handle)
#print(b)
self.posterior = []
self.target_pe... | [
"numpy.array",
"numpy.asarray",
"pickle.load"
] | [((645, 669), 'numpy.array', 'np.array', (['self.posterior'], {}), '(self.posterior)\n', (653, 669), True, 'import numpy as np\n'), ((702, 733), 'numpy.array', 'np.array', (['self.obstacle_penalty'], {}), '(self.obstacle_penalty)\n', (710, 733), True, 'import numpy as np\n'), ((764, 793), 'numpy.array', 'np.array', (['... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.