code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np from math import log from sklearn.linear_model import LogisticRegression from sklearn.metrics import roc_auc_score, mean_squared_error, mean_absolute_error, classification_report from math import sqrt import json from pprint import pprint import argparse parser = argparse.ArgumentParser(f...
[ "argparse.ArgumentParser", "sklearn.metrics.roc_auc_score", "sklearn.linear_model.LogisticRegression", "sklearn.metrics.mean_squared_error", "numpy.zeros", "math.log", "json.load", "sklearn.metrics.mean_absolute_error" ]
[((295, 374), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n', (318, 374), False, 'import argparse\n'), ((724, 739), 'json.load', 'json.load', (['file'], {}), '(file)\n', (733, 739), F...
from __future__ import unicode_literals import json import numpy as np from builtins import str from abc import ABCMeta, abstractmethod from pychemia import HAS_PYMONGO from pychemia.utils.computing import deep_unicode if HAS_PYMONGO: from pychemia.db import PyChemiaDB class Population: __metaclass__ = ABCMe...
[ "pychemia.utils.computing.deep_unicode", "pychemia.db.PyChemiaDB", "numpy.argsort", "numpy.array", "json.load", "json.dump" ]
[((501, 519), 'pychemia.utils.computing.deep_unicode', 'deep_unicode', (['name'], {}), '(name)\n', (513, 519), False, 'from pychemia.utils.computing import deep_unicode\n'), ((3036, 3054), 'numpy.argsort', 'np.argsort', (['values'], {}), '(values)\n', (3046, 3054), True, 'import numpy as np\n'), ((3193, 3209), 'json.lo...
import os import os.path as osp import pickle import time import numpy as np from multiprocessing import Pool from ..utils import get_bbox_dim from .misc import read_img_info, change_cls_order, get_classes def load_imgs(img_dir, ann_dir=None, classes=None, nproc=10, def_bbox_type='poly'): assert d...
[ "os.path.exists", "os.listdir", "os.makedirs", "os.path.join", "os.path.split", "os.path.isfile", "numpy.zeros", "os.path.isdir", "multiprocessing.Pool", "time.time" ]
[((376, 394), 'os.path.isdir', 'osp.isdir', (['img_dir'], {}), '(img_dir)\n', (385, 394), True, 'import os.path as osp\n'), ((589, 600), 'time.time', 'time.time', ([], {}), '()\n', (598, 600), False, 'import time\n'), ((1281, 1292), 'time.time', 'time.time', ([], {}), '()\n', (1290, 1292), False, 'import time\n'), ((15...
import numpy as np import cv2 import math import datetime from datetime import timedelta as Delta h=300 w=300 cap = cv2.VideoCapture(0) SUN_LOC=(200,70) SUN_RSIZE=20 ORBITAL_R=10 def Orbiral(frame,Centerloc,orbit_r,size_r,phi,color): x_orbit=Centerloc[0]+int(orbit_r*np.cos(np.deg2rad(phi))...
[ "cv2.setWindowProperty", "cv2.imshow", "cv2.circle", "numpy.deg2rad", "cv2.destroyAllWindows", "cv2.VideoCapture", "datetime.datetime.today", "datetime.timedelta", "cv2.waitKey", "cv2.namedWindow" ]
[((125, 144), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (141, 144), False, 'import cv2\n'), ((775, 824), 'cv2.namedWindow', 'cv2.namedWindow', (['"""Frame"""', 'cv2.WND_PROP_FULLSCREEN'], {}), "('Frame', cv2.WND_PROP_FULLSCREEN)\n", (790, 824), False, 'import cv2\n'), ((826, 884), 'cv2.setWindowPr...
import cv2 import urllib import numpy as np import multiprocessing as mp stream = 'http://192.168.53.114:8000/streamLow.mjpg' stream2 = 'http://192.168.53.114:8001/streamLow.mjpg' def procImg(str, wind, stop): bytes = '' stream = urllib.urlopen(str) while not stop.is_set(): try: bytes...
[ "multiprocessing.Event", "multiprocessing.Process", "urllib.urlopen", "cv2.imshow", "numpy.fromstring", "cv2.waitKey" ]
[((241, 260), 'urllib.urlopen', 'urllib.urlopen', (['str'], {}), '(str)\n', (255, 260), False, 'import urllib\n'), ((1203, 1213), 'multiprocessing.Event', 'mp.Event', ([], {}), '()\n', (1211, 1213), True, 'import multiprocessing as mp\n'), ((1228, 1280), 'multiprocessing.Process', 'mp.Process', ([], {'target': 'procImg...
''' This library is used to incorporate ''' import numpy as np def cell_prob_with_nucleus(cell, nucleus): ''' This function is used to figure out whether one region is cell or empty hole (without nucleus) :param cell: segmentations results with different labels :param nucleus: nucleus RawMemb image (...
[ "numpy.zeros_like", "numpy.unique" ]
[((496, 531), 'numpy.zeros_like', 'np.zeros_like', (['cell'], {'dtype': 'np.uint8'}), '(cell, dtype=np.uint8)\n', (509, 531), True, 'import numpy as np\n'), ((439, 454), 'numpy.unique', 'np.unique', (['cell'], {}), '(cell)\n', (448, 454), True, 'import numpy as np\n')]
import numpy as np from .image_transforms import mat_to_gray def rgb2hcv(Blue, Green, Red): """transform red green blue arrays to a color space Parameters ---------- Blue : np.array, size=(m,n) Blue band of satellite image Green : np.array, size=(m,n) Green band of satellite image...
[ "numpy.radians", "numpy.dstack", "numpy.ceil", "numpy.copy", "numpy.sqrt", "numpy.amin", "numpy.divide", "numpy.zeros_like", "numpy.array", "numpy.linalg.inv", "numpy.einsum", "numpy.cos", "numpy.arctan2", "numpy.sin", "numpy.amax", "numpy.remainder" ]
[((2091, 2184), 'numpy.array', 'np.array', (['[(+0.299, +0.587, +0.114), (+0.596, -0.275, -0.321), (+0.212, -0.523, +0.311)]'], {}), '([(+0.299, +0.587, +0.114), (+0.596, -0.275, -0.321), (+0.212, -\n 0.523, +0.311)])\n', (2099, 2184), True, 'import numpy as np\n'), ((2227, 2256), 'numpy.dstack', 'np.dstack', (['(Re...
import sys from os.path import exists from unittest.mock import patch import numpy as np # type: ignore import pytest from despace.spatial_sort import SortND sys.path.append("..") coords_1d = np.array([1.0, 0.1, 1.5, -0.3, 0.0]) sorted_coords_1d = np.array([-0.3, 0.0, 0.1, 1.0, 1.5]) coords_2d = np.array( [[1...
[ "os.path.exists", "numpy.random.rand", "numpy.array", "pytest.raises", "unittest.mock.patch", "sys.path.append", "despace.spatial_sort.SortND" ]
[((162, 183), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (177, 183), False, 'import sys\n'), ((197, 233), 'numpy.array', 'np.array', (['[1.0, 0.1, 1.5, -0.3, 0.0]'], {}), '([1.0, 0.1, 1.5, -0.3, 0.0])\n', (205, 233), True, 'import numpy as np\n'), ((253, 289), 'numpy.array', 'np.array', (['[-...
import numpy as np def main(): from fuzzi.evaluation import pate_train from fuzzi.generated import pate_label predictions = pate_label.outputs truth = [x[-1] for x in pate_label.db_test] print(predictions) print(truth) print('PATE accuracy = %f' % (np.mean(predictions == truth)))
[ "numpy.mean" ]
[((279, 308), 'numpy.mean', 'np.mean', (['(predictions == truth)'], {}), '(predictions == truth)\n', (286, 308), True, 'import numpy as np\n')]
""" Test functions for regular module. """ import pytest import numpy as np from sklearn.linear_model import LinearRegression, LogisticRegression from sklearn.base import clone import tensorflow as tf from tensorflow.keras import Sequential, Model from tensorflow.keras.layers import Dense from tensorflow.keras.optimiz...
[ "numpy.abs", "numpy.prod", "adapt.parameter_based.RegularTransferLR", "tensorflow.random.set_seed", "tensorflow.keras.Sequential", "adapt.parameter_based.RegularTransferNN", "numpy.random.choice", "sklearn.base.clone", "sklearn.linear_model.LogisticRegression", "tensorflow.keras.optimizers.Adam", ...
[((500, 517), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (514, 517), True, 'import numpy as np\n'), ((1173, 1185), 'tensorflow.keras.Sequential', 'Sequential', ([], {}), '()\n', (1183, 1185), False, 'from tensorflow.keras import Sequential, Model\n'), ((1408, 1445), 'sklearn.linear_model.LinearRegre...
''' Created on 4 Feb 2022 @author: ucacsjj ''' import random from enum import Enum import numpy as np from gym import Env, spaces from .robot_states_and_actions import * # This environment affords a much lower level control of the robot than the # battery environment. It is partially inspired by the AI Gymn Frozen...
[ "random.random", "numpy.zeros", "gym.spaces.Discrete" ]
[((457, 504), 'gym.spaces.Discrete', 'spaces.Discrete', (['RobotActions.NUMBER_OF_ACTIONS'], {}), '(RobotActions.NUMBER_OF_ACTIONS)\n', (472, 504), False, 'from gym import Env, spaces\n'), ((547, 598), 'gym.spaces.Discrete', 'spaces.Discrete', (['RobotBatteryState.NUMBER_OF_STATES'], {}), '(RobotBatteryState.NUMBER_OF_...
# coding=utf-8 # National Oceanic and Atmospheric Administration (NOAA) # Alaskan Fisheries Science Center (AFSC) # Resource Assessment and Conservation Engineering (RACE) # Midwater Assessment and Conservation Engineering (MACE) # THIS SOFTWARE AND ITS DOCUMENTATION ARE CONSIDERED TO BE IN THE PUBLI...
[ "numpy.logical_and", "numpy.max", "numpy.resize", "numpy.empty", "numpy.min" ]
[((1558, 1614), 'numpy.empty', 'np.empty', (['bottom_data.CHUNK_SIZE'], {'dtype': '"""datetime64[ms]"""'}), "(bottom_data.CHUNK_SIZE, dtype='datetime64[ms]')\n", (1566, 1614), True, 'import numpy as np\n'), ((1646, 1692), 'numpy.empty', 'np.empty', (['bottom_data.CHUNK_SIZE'], {'dtype': 'object'}), '(bottom_data.CHUNK_...
import tensorflow as tf import numpy as np a = np.arange(15) out = a.reshape(5, 3) c = np.arange(15) / 2 y_onehot = c.reshape(5, 3) out_tensor = tf.convert_to_tensor(out, dtype=tf.float32) y_onehot_tensor = tf.convert_to_tensor(y_onehot, dtype=tf.float32) # y_onehot = tf.one_hot(y_onehot_tensor, depth=3) # one-hot...
[ "tensorflow.convert_to_tensor", "tensorflow.reduce_sum", "numpy.arange", "tensorflow.square" ]
[((48, 61), 'numpy.arange', 'np.arange', (['(15)'], {}), '(15)\n', (57, 61), True, 'import numpy as np\n'), ((148, 191), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['out'], {'dtype': 'tf.float32'}), '(out, dtype=tf.float32)\n', (168, 191), True, 'import tensorflow as tf\n'), ((210, 258), 'tensorflow.conve...
# # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # # Author: <NAME> (<EMAIL>) # Date: 05/15/2019 # import os import numpy as np import math import sys from torch.utils.data import Sampler __all__=['BatchSampler', 'DistributedBatchSampler', '...
[ "numpy.random.RandomState", "numpy.arange" ]
[((1557, 1589), 'numpy.random.RandomState', 'np.random.RandomState', (['data_seed'], {}), '(data_seed)\n', (1578, 1589), True, 'import numpy as np\n'), ((1516, 1540), 'numpy.arange', 'np.arange', (['total_samples'], {}), '(total_samples)\n', (1525, 1540), True, 'import numpy as np\n'), ((1844, 1868), 'numpy.arange', 'n...
# Blurring and Sharpening Images # Import Computer Vision package - cv2 import cv2 # Import Numerical Python package - numpy as np import numpy as np # Read the image using imread built-in function image = cv2.imread('image_6.jpg') # Display original image using imshow built-in function cv2.imshow("Orig...
[ "cv2.filter2D", "cv2.imshow", "numpy.array", "cv2.destroyAllWindows", "cv2.waitKey", "cv2.blur", "cv2.imread" ]
[((218, 243), 'cv2.imread', 'cv2.imread', (['"""image_6.jpg"""'], {}), "('image_6.jpg')\n", (228, 243), False, 'import cv2\n'), ((304, 333), 'cv2.imshow', 'cv2.imshow', (['"""Original"""', 'image'], {}), "('Original', image)\n", (314, 333), False, 'import cv2\n'), ((370, 384), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}...
import os.path import scipy.io as sio import numpy as np # for algebraic operations, matrices import keras.models from keras.models import Sequential from keras.layers.core import Dense, Activation, Flatten, Dropout # , Layer, Flatten # from keras.layers import containers from keras.models import model_from_json,Mode...
[ "keras.layers.core.Flatten", "scipy.io.savemat", "keras.callbacks.ModelCheckpoint", "keras.layers.merge.concatenate", "keras.layers.add", "numpy.argmax", "keras.layers.Input", "keras.layers.core.Dense", "keras.regularizers.l2", "keras.models.Model", "numpy.random.seed", "keras.layers.convoluti...
[((1422, 1442), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1436, 1442), True, 'import numpy as np\n'), ((1450, 1500), 'keras.layers.Input', 'Input', ([], {'shape': '(1, patchSize[0, 0], patchSize[0, 1])'}), '(shape=(1, patchSize[0, 0], patchSize[0, 1]))\n', (1455, 1500), False, 'from keras.laye...
import numpy as np import random import matplotlib.pyplot as plt from load_data import loadLabel,loadImage def der_activation_function(x,type): if type==1: return 1 - np.power(np.tanh(x), 2) elif type==2: return (1/(1+np.exp(-x)))*(1-1/(1+np.exp(-x))) else: x[x<=0]=0.25 x[x>...
[ "random.uniform", "numpy.where", "load_data.loadImage", "numpy.tanh", "random.seed", "numpy.argmax", "numpy.exp", "numpy.zeros", "numpy.dot", "numpy.expand_dims", "load_data.loadLabel" ]
[((630, 663), 'numpy.zeros', 'np.zeros', (['(hidden_nodes, size[1])'], {}), '((hidden_nodes, size[1]))\n', (638, 663), True, 'import numpy as np\n'), ((782, 810), 'numpy.zeros', 'np.zeros', (['(10, hidden_nodes)'], {}), '((10, hidden_nodes))\n', (790, 810), True, 'import numpy as np\n'), ((924, 946), 'numpy.zeros', 'np...
from utils import (load_data, data_to_series_features, apply_weight, is_minimum) from algorithm import (initialize_weights, individual_to_key, pop_to_weights, select, reconstruct_population) from sklearn.metrics import mean_squared_error, mean_absolute_error from tensorflow.ker...
[ "utils.data_to_series_features", "utils.is_minimum", "utils.load_data", "argparse.ArgumentParser", "sklearn.model_selection.train_test_split", "algorithm.initialize_weights", "numpy.size", "algorithm.individual_to_key", "algorithm.pop_to_weights", "model.make_model", "algorithm.select", "tenso...
[((601, 679), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Specify Params for Experimental Setting"""'}), "(description='Specify Params for Experimental Setting')\n", (624, 679), False, 'import argparse\n'), ((2118, 2138), 'utils.load_data', 'load_data', (['args.data'], {}), '(args.dat...
""" Oxford Flowers dataset loader 1020 samples spanning 102 classes (avg 10 per class) http://www.robots.ox.ac.uk/~vgg/data/flowers """ from __future__ import print_function import numpy as np from PIL import Image, ImageFile from os.path import join import os import scipy.io import tarfile import shutil from torc...
[ "matplotlib.pyplot.imshow", "PIL.Image.open", "numpy.unique", "os.makedirs", "os.path.join", "torchvision.datasets.utils.download_url", "utils.debug.set_working_dir", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "shutil.rmtree", "matplotlib.pyplot.subplot", "os.path.expanduser...
[((7147, 7164), 'utils.debug.set_working_dir', 'set_working_dir', ([], {}), '()\n', (7162, 7164), False, 'from utils.debug import set_working_dir\n'), ((7348, 7360), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (7358, 7360), True, 'import matplotlib.pyplot as plt\n'), ((3059, 3100), 'os.makedirs', 'os.ma...
import numpy as np import dace as dc M, N = (dc.symbol(s, dtype=dc.int64) for s in ('M', 'N')) @dc.program def flip(A: dc.float64[M]): B = np.ndarray((M, ), dtype=np.float64) for i in dc.map[0:M]: B[i] = A[M - 1 - i] return B @dc.program def kernel(r: dc.float64[N]): y = np.empty_like(r) ...
[ "numpy.empty_like", "numpy.ndarray", "dace.symbol" ]
[((46, 74), 'dace.symbol', 'dc.symbol', (['s'], {'dtype': 'dc.int64'}), '(s, dtype=dc.int64)\n', (55, 74), True, 'import dace as dc\n'), ((146, 180), 'numpy.ndarray', 'np.ndarray', (['(M,)'], {'dtype': 'np.float64'}), '((M,), dtype=np.float64)\n', (156, 180), True, 'import numpy as np\n'), ((302, 318), 'numpy.empty_lik...
import starry import numpy as np import matplotlib.pyplot as plt import pytest @pytest.mark.parametrize("ydeg,nw", [[0, None], [0, 10], [1, None], [1, 10]]) def test_system(ydeg, nw): # Oblate map map = starry.Map(udeg=2, ydeg=ydeg, oblate=True, nw=nw) map[1] = 0.5 map[2] = 0.25 map.omega = 0.5 ...
[ "numpy.allclose", "starry.Primary", "starry.Map", "starry.System", "pytest.mark.parametrize", "numpy.linspace" ]
[((82, 158), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ydeg,nw"""', '[[0, None], [0, 10], [1, None], [1, 10]]'], {}), "('ydeg,nw', [[0, None], [0, 10], [1, None], [1, 10]])\n", (105, 158), False, 'import pytest\n'), ((214, 263), 'starry.Map', 'starry.Map', ([], {'udeg': '(2)', 'ydeg': 'ydeg', 'oblate'...
"""Utility class for multivariate time series transformation.""" # Author: <NAME> <<EMAIL>> # License: BSD-3-Clause import numpy as np from scipy.sparse import csr_matrix, hstack from sklearn.base import BaseEstimator, TransformerMixin, clone from sklearn.utils.validation import check_is_fitted from ..utils import ch...
[ "sklearn.utils.validation.check_is_fitted", "numpy.unique", "sklearn.base.clone", "numpy.asarray", "scipy.sparse.hstack", "numpy.concatenate", "numpy.transpose" ]
[((3024, 3060), 'sklearn.utils.validation.check_is_fitted', 'check_is_fitted', (['self', '"""estimators_"""'], {}), "(self, 'estimators_')\n", (3039, 3060), False, 'from sklearn.utils.validation import check_is_fitted\n'), ((3377, 3398), 'scipy.sparse.hstack', 'hstack', (['X_transformed'], {}), '(X_transformed)\n', (33...
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error from sklearn.linear_model import LogisticRegression import pdb from sklearn.metrics import * import matplotlib.pyplot as plt from sklearn import preprocessing from sklearn.preproces...
[ "sklearn.model_selection.train_test_split", "numpy.random.choice", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.random.seed", "pandas.DataFrame", "numpy.random.binomial" ]
[((801, 818), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (815, 818), True, 'import numpy as np\n'), ((2715, 2731), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (2729, 2731), False, 'from sklearn.preprocessing import StandardScaler\n'), ((3169, 3223), 'sklearn.model_sel...
# -*- coding: utf-8 -*- """Helper functions for pybaselines. Created on March 5, 2021 @author: <NAME> """ import numpy as np # the minimum positive float values such that a + _MIN_FLOAT != a _MIN_FLOAT = np.finfo(float).eps def relative_difference(old, new, norm_order=None): """ Calculates the relative d...
[ "numpy.polynomial.Polynomial.fit", "numpy.asarray", "numpy.exp", "numpy.sum", "numpy.concatenate", "numpy.linalg.norm", "numpy.finfo", "numpy.pad", "numpy.arange" ]
[((209, 224), 'numpy.finfo', 'np.finfo', (['float'], {}), '(float)\n', (217, 224), True, 'import numpy as np\n'), ((919, 956), 'numpy.linalg.norm', 'np.linalg.norm', (['(new - old)', 'norm_order'], {}), '(new - old, norm_order)\n', (933, 956), True, 'import numpy as np\n'), ((3811, 3827), 'numpy.asarray', 'np.asarray',...
import numpy as np from pykeops.common.lazy_tensor import GenericLazyTensor from pykeops.numpy.utils import numpytools # Convenient aliases: def Var(x_or_ind, dim=None, cat=None): if dim is None: # init via data: we assume x_or_ind is data return LazyTensor(x_or_ind, axis=cat) else: ...
[ "numpy.array" ]
[((2288, 2299), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (2296, 2299), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : tokenzier.py @Time : 2021/09/11 16:00:04 @Author : <NAME> @Version : 1.0 @Contact : <EMAIL> @Desc : None ''' import json import os from typing import List import numpy as np from pypinyin import Style, pinyin from .. import BasicTokeniz...
[ "pypinyin.pinyin", "os.path.join", "os.path.isfile", "numpy.array", "json.load" ]
[((961, 997), 'os.path.join', 'os.path.join', (['bert_path', '"""vocab.txt"""'], {}), "(bert_path, 'vocab.txt')\n", (973, 997), False, 'import os\n'), ((1020, 1053), 'os.path.join', 'os.path.join', (['bert_path', '"""config"""'], {}), "(bert_path, 'config')\n", (1032, 1053), False, 'import os\n'), ((2900, 2919), 'numpy...
import numpy as np class Compressor(): def __init__(self, num_particles: int, num_spin_orbitals: int, rdm_ideal=None) -> None: self.num_particles = num_particles self.num_spin_orbitals = num_spin_orbitals self.rdm_ideal = rdm_ideal pass def compress(self, rdm): ...
[ "numpy.zeros", "numpy.sqrt", "numpy.diag" ]
[((577, 595), 'numpy.zeros', 'np.zeros', (['(3 * S,)'], {}), '((3 * S,))\n', (585, 595), True, 'import numpy as np\n'), ((1132, 1171), 'numpy.zeros', 'np.zeros', (['((self.num_spin_orbitals,) * 4)'], {}), '((self.num_spin_orbitals,) * 4)\n', (1140, 1171), True, 'import numpy as np\n'), ((3642, 3660), 'numpy.zeros', 'np...
import unittest import numpy as np import prml.nn as nn class TestGaussian(unittest.TestCase): def test_gaussian_draw_forward(self): mu = nn.array(0) sigma = nn.softplus(nn.array(-1)) gaussian = nn.Gaussian(mu, sigma) sample = [] for _ in range(1000): sample.ap...
[ "numpy.mean", "numpy.allclose", "prml.nn.softplus", "prml.nn.optimizer.Gradient", "prml.nn.loss.kl_divergence", "numpy.std", "unittest.main", "prml.nn.Gaussian", "prml.nn.array" ]
[((1156, 1171), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1169, 1171), False, 'import unittest\n'), ((153, 164), 'prml.nn.array', 'nn.array', (['(0)'], {}), '(0)\n', (161, 164), True, 'import prml.nn as nn\n'), ((226, 248), 'prml.nn.Gaussian', 'nn.Gaussian', (['mu', 'sigma'], {}), '(mu, sigma)\n', (237, 248)...
import sys import argparse import matplotlib.pyplot as plt import numpy as np import pickle def load_obj(name): pkl_path = "" with open(pkl_path + name + ".pkl", 'rb') as f: return pickle.load(f) def load_prun_obj(name): pkl_path = "" with open(pkl_path + name + ".pkl", 'rb') as f: r...
[ "numpy.mean", "argparse.ArgumentParser", "matplotlib.pyplot.ylabel", "numpy.arange", "matplotlib.pyplot.xticks", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "pickle.load", "matplotlib.pyplot.gca", "matplotlib.pyplot.bar", "matplotlib.pyplot.yticks", "matplotlib.pyplot.subplot", "ma...
[((441, 471), 'matplotlib.pyplot.plot', 'plt.plot', (['results'], {'label': 'label'}), '(results, label=label)\n', (449, 471), True, 'import matplotlib.pyplot as plt\n'), ((1087, 1141), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run figure plot"""'}), "(description='Run figure plot')...
import numpy as np import cv2 import proper from cats.cats_simus import * def vortex(wfo, CAL, charge, f_lens, path, Debug_print): n = int(proper.prop_get_gridsize(wfo)) ofst = 0 # no offset ramp_sign = 1 #sign of charge is positive #sampling = n ramp_oversamp = 11. # vortex is oversampled for a ...
[ "proper.prop_circular_obscuration", "numpy.ones", "proper.prop_lens", "proper.prop_get_gridsize", "proper.prop_multiply", "proper.prop_shift_center", "numpy.exp", "numpy.array", "numpy.zeros", "numpy.outer", "numpy.arctan2", "proper.prop_propagate", "cv2.resize", "numpy.transpose", "nump...
[((146, 175), 'proper.prop_get_gridsize', 'proper.prop_get_gridsize', (['wfo'], {}), '(wfo)\n', (170, 175), False, 'import proper\n'), ((801, 832), 'numpy.ones', 'np.ones', (['(nramp,)'], {'dtype': 'np.int'}), '((nramp,), dtype=np.int)\n', (808, 832), True, 'import numpy as np\n'), ((925, 941), 'numpy.outer', 'np.outer...
bl_info = { "name": "Import Planar Code", "author": "<NAME>", "version": (1, 0), "blender": (2, 80, 0), "location": "File > Import > Planar Code", "description": "Import planar code and construct mesh by assigning vertex positions.", "warning": "", "support": "TESTING", "wik...
[ "bpy.props.StringProperty", "numpy.sqrt", "bpy.data.objects.new", "bmesh.new", "bpy.types.TOPBAR_MT_file_import.remove", "numpy.isfinite", "numpy.linalg.norm", "numpy.sin", "bpy.context.scene.collection.objects.link", "bpy.utils.unregister_class", "bpy.props.BoolProperty", "bpy.types.TOPBAR_MT...
[((7250, 7381), 'bpy.props.StringProperty', 'StringProperty', ([], {'name': '"""File Path"""', 'description': '"""Filepath used for importing the Planar code file"""', 'maxlen': '(1024)', 'default': '""""""'}), "(name='File Path', description=\n 'Filepath used for importing the Planar code file', maxlen=1024, defaul...
import numpy as np import pandas as pd import scipy.stats as scs import itertools from collections import defaultdict import textwrap import pingouin as pg from statsmodels.stats.multicomp import pairwise_tukeyhsd from sklearn.neighbors import NearestNeighbors from sklearn.decomposition import PCA from sklearn.cluster...
[ "numpy.log10", "numpy.sqrt", "numpy.argsort", "numpy.nanmean", "sklearn.metrics.silhouette_samples", "numpy.array", "scipy.stats.ttest_ind", "umap.UMAP", "seaborn.violinplot", "seaborn.scatterplot", "matplotlib.patheffects.withStroke", "numpy.arange", "numpy.mean", "seaborn.regplot", "sk...
[((1130, 1163), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (1153, 1163), False, 'import warnings\n'), ((1164, 1195), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (1185, 1195), False, 'import warnings\n'), ((1725, 1764), 'mat...
import random import numpy as np import torch from torch import nn from torchbenchmark.tasks import OTHER from ...util.model import BenchmarkModel torch.manual_seed(1337) random.seed(1337) np.random.seed(1337) # pretend we are using MLP to predict CIFAR images class MLP(nn.Module): def __init__(self): ...
[ "torch.manual_seed", "torch.nn.ReLU", "torch.nn.CrossEntropyLoss", "torch.nn.Softmax", "torch.nn.Flatten", "random.seed", "torch.randint", "numpy.random.seed", "torch.nn.Linear", "torch.no_grad", "torch.randn" ]
[((150, 173), 'torch.manual_seed', 'torch.manual_seed', (['(1337)'], {}), '(1337)\n', (167, 173), False, 'import torch\n'), ((174, 191), 'random.seed', 'random.seed', (['(1337)'], {}), '(1337)\n', (185, 191), False, 'import random\n'), ((192, 212), 'numpy.random.seed', 'np.random.seed', (['(1337)'], {}), '(1337)\n', (2...
# Importando librerías from numpy import array # Listas y arreglos a = array(['h', 101, 'l', 'l', 'o']) x = ['h', 101, 'l', 'l', 'o'] print(a) print(x) print("Tamaño: ", len(x)) # Condicionales if isinstance(x[1], int): x[1] = chr(x[1]) elif isinstance(x[1], str): pass else: raise TypeError("Tipo no sop...
[ "numpy.array" ]
[((72, 104), 'numpy.array', 'array', (["['h', 101, 'l', 'l', 'o']"], {}), "(['h', 101, 'l', 'l', 'o'])\n", (77, 104), False, 'from numpy import array\n')]
import argparse import collections import os import cv2 import numpy as np import pandas as pd import pretrainedmodels import torch import torch.optim as optim import torchsummary from torch.optim import lr_scheduler from torch.utils.data import DataLoader from torchvision import datasets, models, transforms from tqdm...
[ "pandas.read_csv", "utils.CosineAnnealingLRWithRestarts", "numpy.mean", "argparse.ArgumentParser", "numpy.diff", "numpy.concatenate", "triplet_dataset.TripletDatasetUpdate", "torchvision.transforms.ToTensor", "logger.Logger", "torch.save", "numpy.std", "torch.nn.functional.relu", "torchvisio...
[((1957, 2000), 'os.makedirs', 'os.makedirs', (['checkpoints_dir'], {'exist_ok': '(True)'}), '(checkpoints_dir, exist_ok=True)\n', (1968, 2000), False, 'import os\n'), ((2005, 2048), 'os.makedirs', 'os.makedirs', (['tensorboard_dir'], {'exist_ok': '(True)'}), '(tensorboard_dir, exist_ok=True)\n', (2016, 2048), False, '...
import functools import numpy as np def dft2(f, alpha, npix=None, shift=(0, 0), offset=(0, 0), unitary=True, out=None): """Compute the 2-dimensional discrete Fourier Transform. This function allows independent control over input shape, output shape, and output sampling by implementing the matrix triple p...
[ "numpy.abs", "numpy.arange", "numpy.conj", "numpy.asarray", "numpy.floor", "numpy.can_cast", "numpy.outer", "functools.lru_cache", "numpy.divide" ]
[((3906, 3937), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': '(32)'}), '(maxsize=32)\n', (3925, 3937), False, 'import functools\n'), ((4251, 4282), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': '(32)'}), '(maxsize=32)\n', (4270, 4282), False, 'import functools\n'), ((3198, 3211), 'num...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import math import random import numpy as np import matplotlib.pyplot as plt from scipy.constants import N_A from numba import jit import copy __author__ = "<NAME>, <NAME>, <NAME>" __email__ = "<EMAIL>" __copy...
[ "math.floor", "numpy.log", "numpy.count_nonzero", "numpy.array", "copy.deepcopy", "numpy.mean", "numpy.multiply", "numpy.where", "numpy.diff", "numpy.vstack", "matplotlib.pyplot.savefig", "numpy.ones", "numba.jit", "numpy.std", "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.show",...
[((6251, 6284), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'parallel': '(True)'}), '(nopython=True, parallel=True)\n', (6254, 6284), False, 'from numba import jit\n'), ((9817, 9835), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (9820, 9835), False, 'from numba import jit\n'), ((11607, 116...
# -*- coding: utf-8 -*- """ Created on Fri Apr 23 17:18:39 2021 @author: Koustav """ import os import glob import matplotlib.pyplot as plt import seaborn as sea import numpy as np import pandas as pan import math import collections import matplotlib.ticker as mtick from mpl_toolkits import mplot3d from matplotlib.col...
[ "numpy.log10", "powerlaw.Fit", "matplotlib.pyplot.ylabel", "numpy.array", "seaborn.scatterplot", "math.exp", "numpy.genfromtxt", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.close", "numpy.exp", "numpy.linspace", "os.path.isdir", "os.mkdir", "numpy.concatenate", "pandas.DataFrame", "...
[((627, 713), 'numpy.genfromtxt', 'np.genfromtxt', (['"""PissingAbout15+16.csv"""'], {'delimiter': '""","""', 'comments': '"""#"""', 'skip_header': '(1)'}), "('PissingAbout15+16.csv', delimiter=',', comments='#',\n skip_header=1)\n", (640, 713), True, 'import numpy as np\n'), ((7089, 7175), 'numpy.genfromtxt', 'np.g...
import streamlit as st import numpy as np import pandas as pd import requests import re import altair as alt # Find all available data def find_all_spreadsheets(): available_data = {} r = requests.get('https://www.football-data.co.uk/downloadm.php') if r.status_code != 200: print('Oh dear. Error {}...
[ "streamlit.markdown", "numpy.ceil", "pandas.read_csv", "pandas.merge", "streamlit.write", "requests.get", "streamlit.sidebar.checkbox", "streamlit.text", "numpy.linspace", "pandas.read_excel", "streamlit.sidebar.selectbox", "streamlit.selectbox", "pandas.DataFrame", "re.findall", "pandas...
[((24432, 24443), 'streamlit.text', 'st.text', (['""""""'], {}), "('')\n", (24439, 24443), True, 'import streamlit as st\n'), ((24732, 24772), 'streamlit.sidebar.checkbox', 'st.sidebar.checkbox', (['"""Order specific"""', '(1)'], {}), "('Order specific', 1)\n", (24751, 24772), True, 'import streamlit as st\n'), ((24831...
"""计算分位数""" from scipy import stats import numpy as np S = 47 N = 100 a = S + 1 b = (N -S) + 1 alpha = 0.05 lu = stats.beta.ppf([alpha/2, 1-alpha/2], a, b) print(lu) ## MC方法 S = 1000 X = stats.beta.rvs(a, b, size=S) X = np.sort(X, axis=0) l = X[round(S*alpha/2)] u = X[round(S*(1-alpha)/2)] print(l,u)
[ "numpy.sort", "scipy.stats.beta.rvs", "scipy.stats.beta.ppf" ]
[((115, 163), 'scipy.stats.beta.ppf', 'stats.beta.ppf', (['[alpha / 2, 1 - alpha / 2]', 'a', 'b'], {}), '([alpha / 2, 1 - alpha / 2], a, b)\n', (129, 163), False, 'from scipy import stats\n'), ((190, 218), 'scipy.stats.beta.rvs', 'stats.beta.rvs', (['a', 'b'], {'size': 'S'}), '(a, b, size=S)\n', (204, 218), False, 'fro...
# Copyright (c) 2021 PPViT Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
[ "numpy.clip", "numpy.sqrt", "paddle.matmul", "paddle.nn.Sequential", "paddle.nn.LayerNorm", "paddle.nn.LayerList", "fold.fold", "paddle.nn.AvgPool2D", "numpy.random.beta", "paddle.nn.initializer.XavierUniform", "paddle.nn.Softmax", "paddle.nn.Unfold", "paddle.nn.Linear", "paddle.nn.initial...
[((20249, 20267), 'numpy.sqrt', 'np.sqrt', (['(1.0 - lam)'], {}), '(1.0 - lam)\n', (20256, 20267), True, 'import numpy as np\n'), ((20279, 20298), 'numpy.int', 'np.int', (['(W * cut_rat)'], {}), '(W * cut_rat)\n', (20285, 20298), True, 'import numpy as np\n'), ((20311, 20330), 'numpy.int', 'np.int', (['(H * cut_rat)'],...
# -*- coding: UTF-8 -*- import cv2 import numpy as np # 仿射变换(图像位置校正) def img_three(imgPath): # ---------------------------三点得到一个变换矩阵 --------------------------- """ 三点确定一个平面,通过确定三个点的关系来得到转换矩阵 然后再通过warpAffine来进行变换 """ img = cv2.imread(imgPath) rows,cols,_ = img.shape points1 ...
[ "cv2.warpAffine", "cv2.getPerspectiveTransform", "cv2.imshow", "cv2.waitKey", "cv2.warpPerspective", "cv2.destroyAllWindows", "cv2.getAffineTransform", "cv2.imread", "numpy.float32" ]
[((260, 279), 'cv2.imread', 'cv2.imread', (['imgPath'], {}), '(imgPath)\n', (270, 279), False, 'import cv2\n'), ((322, 366), 'numpy.float32', 'np.float32', (['[[50, 50], [200, 50], [50, 200]]'], {}), '([[50, 50], [200, 50], [50, 200]])\n', (332, 366), True, 'import numpy as np\n'), ((376, 422), 'numpy.float32', 'np.flo...
import matplotlib.pyplot as plt import numpy as np def plot(ac): ac=np.array(ac) ac=ac.reshape((28,28)) ac=[[int(ac2+0.48) for ac2 in ac1] for ac1 in ac] plt.imshow(ac) f=np.load("model.npz",allow_pickle=True) f2=np.load("model2.npz",allow_pickle=True) f3=np.load("model3.npz",allow_pickle=True) f4=np.load...
[ "matplotlib.pyplot.imshow", "numpy.mean", "numpy.where", "numpy.array", "numpy.dot", "numpy.maximum", "numpy.load" ]
[((185, 224), 'numpy.load', 'np.load', (['"""model.npz"""'], {'allow_pickle': '(True)'}), "('model.npz', allow_pickle=True)\n", (192, 224), True, 'import numpy as np\n'), ((227, 267), 'numpy.load', 'np.load', (['"""model2.npz"""'], {'allow_pickle': '(True)'}), "('model2.npz', allow_pickle=True)\n", (234, 267), True, 'i...
import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import time from datetime import timedelta import os # Importing a helper module for the functions of the Inception model. import inception import cifar10 from cifar10 import num_classes from inception import transfer_values_cache #Importing...
[ "tensorflow.equal", "tensorflow.nn.softmax", "cifar10.load_training_data", "inception.Inception", "tensorflow.reduce_mean", "tensorflow.cast", "matplotlib.pyplot.imshow", "numpy.mean", "sklearn.decomposition.PCA", "tensorflow.placeholder", "tensorflow.Session", "inception.maybe_download", "s...
[((574, 610), 'cifar10.maybe_download_and_extract', 'cifar10.maybe_download_and_extract', ([], {}), '()\n', (608, 610), False, 'import cifar10\n'), ((626, 652), 'cifar10.load_class_names', 'cifar10.load_class_names', ([], {}), '()\n', (650, 652), False, 'import cifar10\n'), ((775, 803), 'cifar10.load_training_data', 'c...
#!/usr/bin/env python from __future__ import print_function import sys sys.path.insert(0, "/home/liangjiang/code/keras-jl-mean/") from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator from keras.models import model_from_json from keras.models import Sequential from keras.layers imp...
[ "sys.path.insert", "keras.backend.learning_phase", "keras.optimizers.SGD", "keras.layers.Activation", "numpy.mean", "numpy.reshape", "argparse.ArgumentParser", "keras.layers.Flatten", "keras.datasets.cifar10.load_data", "keras.layers.MaxPooling2D", "keras.models.Sequential", "numpy.savetxt", ...
[((71, 129), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/home/liangjiang/code/keras-jl-mean/"""'], {}), "(0, '/home/liangjiang/code/keras-jl-mean/')\n", (86, 129), False, 'import sys\n'), ((734, 759), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (757, 759), False, 'import argparse\n')...
""" paw_structure.ion ----------------- Ion complex detection using geometric :ref:`algorithm<Control_ION_algorithm>`. Main routine is :func:`.ion_find_parallel`. Dependencies: :py:mod:`functools` :py:mod:`miniutils` :py:mod:`numpy` :py:mod:`pandas` :mod:`.neighbor` :mod:`.utility` :class:...
[ "pandas.DataFrame", "numpy.array", "functools.partial", "numpy.savetxt", "miniutils.progress_bar.parallel_progbar", "pandas.concat" ]
[((3330, 3371), 'pandas.concat', 'pd.concat', (['[id1_list, id2_list, id3_list]'], {}), '([id1_list, id2_list, id3_list])\n', (3339, 3371), True, 'import pandas as pd\n'), ((6036, 6082), 'numpy.savetxt', 'np.savetxt', (['f', 'snapshots[0].cell'], {'fmt': '"""%14.8f"""'}), "(f, snapshots[0].cell, fmt='%14.8f')\n", (6046...
import numpy as np import matplotlib.pyplot as plt import pandas as pd from matplotlib.colors import LinearSegmentedColormap ms_color = [0.12156863, 0.46666667, 0.70588235, 1] hc_color = [1., 0.49803922, 0.05490196, 1] SMALL_SIZE = 12 MEDIUM_SIZE = 14 BIGGER_SIZE = 16 plt.rc('font', size=SMALL_SIZE) # contr...
[ "numpy.mean", "matplotlib.pyplot.plot", "numpy.concatenate", "numpy.min", "pandas.DataFrame", "numpy.abs", "matplotlib.pyplot.xticks", "pandas.merge", "numpy.squeeze", "matplotlib.pyplot.register_cmap", "matplotlib.pyplot.title", "matplotlib.colors.LinearSegmentedColormap.from_list", "matplo...
[((272, 303), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'size': 'SMALL_SIZE'}), "('font', size=SMALL_SIZE)\n", (278, 303), True, 'import matplotlib.pyplot as plt\n'), ((343, 380), 'matplotlib.pyplot.rc', 'plt.rc', (['"""axes"""'], {'titlesize': 'BIGGER_SIZE'}), "('axes', titlesize=BIGGER_SIZE)\n", (349, 380),...
# -*- coding: utf-8 -*- """ Provides functions for data transformation (currently only LLS) and normalization. """ import numpy as np def transform(raw_data, mode, direction='direct', **kwargs): """ Apply mathematical transformations to data. Parameters ---------- raw_data : ndarray 2D n...
[ "numpy.trapz", "numpy.sqrt", "numpy.asarray", "numpy.exp", "numpy.min", "numpy.arange" ]
[((2588, 2608), 'numpy.asarray', 'np.asarray', (['raw_data'], {}), '(raw_data)\n', (2598, 2608), True, 'import numpy as np\n'), ((1677, 1693), 'numpy.min', 'np.min', (['raw_data'], {}), '(raw_data)\n', (1683, 1693), True, 'import numpy as np\n'), ((2814, 2838), 'numpy.arange', 'np.arange', (['x_data_points'], {}), '(x_...
#Predictions performed by this module #dependencies import base64 import numpy as np import io from PIL import Image import keras from keras import backend as K from keras.models import Sequential from keras.models import load_model from keras.preprocessing.image import ImageDataGenerator, img_to_array from model imp...
[ "keras.preprocessing.image.img_to_array", "flask.Flask", "io.BytesIO", "base64.b64decode", "flask.request.get_json", "numpy.expand_dims", "main.infer2", "flask.jsonify" ]
[((478, 493), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (483, 493), False, 'from flask import Flask\n'), ((815, 834), 'keras.preprocessing.image.img_to_array', 'img_to_array', (['image'], {}), '(image)\n', (827, 834), False, 'from keras.preprocessing.image import ImageDataGenerator, img_to_array\n'), ...
from __future__ import division from __future__ import print_function import numpy as np import copy from scipy import stats class QuantizeLayer: def __init__(self, name="None", num_bin=2001): self.name = name self.min = 0.0 self.max = 0.0 self.edge = 0.0 self.num_bins = nu...
[ "numpy.histogram", "scipy.stats.entropy", "copy.deepcopy", "matplotlib.pyplot.plot", "numpy.max", "numpy.array", "numpy.zeros", "scipy.stats.wasserstein_distance", "numpy.min", "numpy.argmin", "numpy.random.randn", "matplotlib.pyplot.show" ]
[((11155, 11177), 'numpy.random.randn', 'np.random.randn', (['(10000)'], {}), '(10000)\n', (11170, 11177), True, 'import numpy as np\n'), ((11703, 11725), 'numpy.random.randn', 'np.random.randn', (['(10000)'], {}), '(10000)\n', (11718, 11725), True, 'import numpy as np\n'), ((11990, 12023), 'matplotlib.pyplot.plot', 'p...
import numpy as np import torch from scipy.stats import truncnorm from pymoo.factory import get_sampling, get_crossover, get_mutation from pymoo.operators.mixed_variable_operator import MixedVariableSampling, MixedVariableMutation, MixedVariableCrossover from pymoo.model.sampling import Sampling class TruncatedNormal...
[ "numpy.random.normal", "numpy.random.random", "pymoo.factory.get_mutation", "pymoo.factory.get_sampling", "pymoo.factory.get_crossover", "scipy.stats.truncnorm.rvs" ]
[((851, 919), 'numpy.random.normal', 'np.random.normal', (['self.mu', 'self.std'], {'size': '(n_samples, problem.n_var)'}), '(self.mu, self.std, size=(n_samples, problem.n_var))\n', (867, 919), True, 'import numpy as np\n'), ((1109, 1153), 'numpy.random.random', 'np.random.random', (['(n_samples, problem.n_var)'], {}),...
import config as cfg import cv2 import numpy as np from keras.models import load_model from keras.preprocessing.image import img_to_array from keras import backend as K import tensorflow as tf import keras ''' esto es necesario para que no haya errores a la hora de exponer el servicio con flask info --> https://github...
[ "keras.preprocessing.image.img_to_array", "keras.models.load_model", "tensorflow.Session", "keras.backend.set_session", "numpy.expand_dims", "cv2.cvtColor", "cv2.resize", "tensorflow.get_default_graph" ]
[((432, 444), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (442, 444), True, 'import tensorflow as tf\n'), ((453, 475), 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), '()\n', (473, 475), True, 'import tensorflow as tf\n'), ((477, 494), 'keras.backend.set_session', 'set_session', (['sess'], {...
import rclpy import json,numpy from numpy import clip from rclpy.node import Node from std_msgs.msg import Float64MultiArray from sensor_msgs.msg import JointState from diagnostic_msgs.msg import DiagnosticStatus, KeyValue import can from tinymovr import Tinymovr from tinymovr.iface.can import CAN from tinymovr.units...
[ "diagnostic_msgs.msg.KeyValue", "numpy.clip", "tinymovr.units.get_registry", "rclpy.spin", "diagnostic_msgs.msg.DiagnosticStatus", "sensor_msgs.msg.JointState", "can.Bus", "numpy.isnan", "json.load", "rclpy.init", "rclpy.shutdown", "tinymovr.iface.can.CAN" ]
[((370, 384), 'tinymovr.units.get_registry', 'get_registry', ([], {}), '()\n', (382, 384), False, 'from tinymovr.units import get_registry\n'), ((5874, 5895), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (5884, 5895), False, 'import rclpy\n'), ((6223, 6239), 'rclpy.shutdown', 'rclpy.shutdown', (...
#!/usr/bin/python from __future__ import print_function from __future__ import absolute_import from past.builtins import basestring import sys import numpy as np import moby2 trace = moby2.util.log.logger.trace # transitional... _fp_formats = { 'det_uid': '%4d', 'ok': '%1d', 'x0': '%9.6f', 'x0_err':...
[ "pylab.title", "pylab.scatter", "numpy.log10", "pylab.subplots_adjust", "moby2.scripting.get_depot", "pylab.MaxNLocator", "pylab.savefig", "pylab.xlabel", "moby2.scripting.execcfg.InputChooser", "numpy.array", "numpy.sin", "moby2.util.StructDB.from_column_file", "pylab.gca", "numpy.arange"...
[((1905, 1935), 'numpy.loadtxt', 'np.loadtxt', (['filename'], {'unpack': '(1)'}), '(filename, unpack=1)\n', (1915, 1935), True, 'import numpy as np\n'), ((3620, 3676), 'moby2.util.StructDB.from_data', 'moby2.util.StructDB.from_data', (['data'], {'formats': '_fp_formats'}), '(data, formats=_fp_formats)\n', (3649, 3676),...
from numpy.random import seed seed(5393) from tensorflow import set_random_seed set_random_seed(12011) import os import numpy as np import pandas as pd from scipy import sparse from sklearn.preprocessing import LabelEncoder, LabelBinarizer from sklearn.pipeline import FeatureUnion from sklearn.feature_extraction.te...
[ "logging.basicConfig", "pandas.read_pickle", "sklearn.preprocessing.LabelEncoder", "sklearn.preprocessing.LabelBinarizer", "scipy.sparse.vstack", "os.makedirs", "sklearn.model_selection.train_test_split", "sklearn.feature_extraction.text.CountVectorizer", "scipy.sparse.issparse", "sklearn.model_se...
[((30, 40), 'numpy.random.seed', 'seed', (['(5393)'], {}), '(5393)\n', (34, 40), False, 'from numpy.random import seed\n'), ((80, 102), 'tensorflow.set_random_seed', 'set_random_seed', (['(12011)'], {}), '(12011)\n', (95, 102), False, 'from tensorflow import set_random_seed\n'), ((509, 548), 'logging.basicConfig', 'log...
""" 参考自https://github.com/bojone/crf/ """ import tensorflow as tf k = tf.keras kl = tf.keras.layers K = tf.keras.backend from sklearn.model_selection import train_test_split import numpy as np import re from tqdm import tqdm import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation class CRF(kl.L...
[ "re.split", "tensorflow.keras.utils.to_categorical", "matplotlib.pyplot.show", "tensorflow.config.experimental.set_memory_growth", "sklearn.model_selection.train_test_split", "numpy.array", "tensorflow.config.experimental.list_physical_devices", "tensorflow.math.reduce_logsumexp", "matplotlib.pyplot...
[((7282, 7333), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (7326, 7333), True, 'import tensorflow as tf\n'), ((7416, 7483), 'tensorflow.config.experimental.set_memory_growth', 'tf.config.experimental.set_memory_growth', (['ph...
import numpy as np import torch import torch.nn as nn from collections import OrderedDict def tf2th(conv_weights): """Possibly convert HWIO to OIHW.""" if conv_weights.ndim == 4: conv_weights = conv_weights.transpose([3, 2, 0, 1]) return torch.from_numpy(conv_weights) def _rename_...
[ "collections.OrderedDict", "re.match", "torch.sqrt", "torch.from_numpy", "torch.var_mean", "numpy.load" ]
[((272, 302), 'torch.from_numpy', 'torch.from_numpy', (['conv_weights'], {}), '(conv_weights)\n', (288, 302), False, 'import torch\n'), ((1609, 1622), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1620, 1622), False, 'from collections import OrderedDict\n'), ((1638, 1648), 'numpy.load', 'np.load', (['f']...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """WCS related utility functions.""" from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np from astropy.wcs import WCS from astropy.coordinates import Angle __all__ = [ 'linear_wcs_to_arrays', 'linea...
[ "numpy.abs", "astropy.wcs.WCS", "numpy.arange", "astropy.coordinates.Angle" ]
[((2472, 2494), 'astropy.coordinates.Angle', 'Angle', (['delta_x', 'unit_x'], {}), '(delta_x, unit_x)\n', (2477, 2494), False, 'from astropy.coordinates import Angle\n'), ((2509, 2531), 'astropy.coordinates.Angle', 'Angle', (['delta_y', 'unit_y'], {}), '(delta_y, unit_y)\n', (2514, 2531), False, 'from astropy.coordinat...
import cv2 import numpy as np import os under_layer_path = '/home/ubuntu/share/cam_lidar/Tu_indoor/red2' upper_layer_path = "/home/ubuntu/share/cam_lidar/Tu_indoor/aisle02_dir" target_files = os.listdir(upper_layer_path) target_imgs = [f for f in target_files if os.path.isfile(os.path.join(upper_layer_path, f))] try: ...
[ "cv2.imwrite", "os.listdir", "cv2.inRange", "cv2.bitwise_and", "os.path.join", "numpy.array", "numpy.zeros", "cv2.bitwise_not", "cv2.add" ]
[((193, 221), 'os.listdir', 'os.listdir', (['upper_layer_path'], {}), '(upper_layer_path)\n', (203, 221), False, 'import os\n'), ((393, 414), 'numpy.array', 'np.array', (['[0, 0, 128]'], {}), '([0, 0, 128])\n', (401, 414), True, 'import numpy as np\n'), ((423, 444), 'numpy.array', 'np.array', (['[0, 0, 128]'], {}), '([...
## -*- coding: utf-8 -*- """ Created on Tue Sep 26 13:38:17 2017 @author: Administrator """ import dlib import cv2 import numpy as np from sklearn.externals import joblib import os import pathAttributes #ap = argparse.ArgumentParser() #ap.add_argument("-p", "--shape-predictor", metavar="D:\\用户目录\\下载\\sh...
[ "cv2.rectangle", "dlib.face_recognition_model_v1", "dlib.rectangle", "sklearn.externals.joblib.load", "dlib.shape_predictor", "cv2.imshow", "numpy.max", "dlib.get_frontal_face_detector", "numpy.array", "cv2.putText", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.cvtColor", "cv2.resize"...
[((1116, 1148), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (1146, 1148), False, 'import dlib\n'), ((1166, 1223), 'dlib.shape_predictor', 'dlib.shape_predictor', (['pathAttributes.face_detection_model'], {}), '(pathAttributes.face_detection_model)\n', (1186, 1223), False, 'impo...
from gamegym.game import Game, Situation from gamegym.utils import get_rng from gamegym.distribution import Explicit from gamegym.value_learning.valuestore import LinearValueStore import numpy as np import pytest from scipy.sparse import csr_matrix def test_init(): LinearValueStore(shape=(3, 3)) LinearValueSt...
[ "pytest.approx", "numpy.ones", "gamegym.value_learning.valuestore.LinearValueStore", "numpy.array", "numpy.zeros", "pytest.raises" ]
[((272, 302), 'gamegym.value_learning.valuestore.LinearValueStore', 'LinearValueStore', ([], {'shape': '(3, 3)'}), '(shape=(3, 3))\n', (288, 302), False, 'from gamegym.value_learning.valuestore import LinearValueStore\n'), ((590, 603), 'numpy.ones', 'np.ones', (['(4,)'], {}), '((4,))\n', (597, 603), True, 'import numpy...
import math from itertools import product from typing import Tuple, List, Optional, Union import numpy as np import torch import torch.nn as nn import torch.nn.init as init class EMA: """ Class that keeps track of exponential moving average of model parameters of a particular model. Also see https://gith...
[ "numpy.clip", "torch.nn.init.constant_", "itertools.product", "math.sqrt", "torch.no_grad", "torch.flatten" ]
[((7623, 7638), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (7636, 7638), False, 'import torch\n'), ((8322, 8364), 'numpy.clip', 'np.clip', (['(current / rampup_length)', '(0.0)', '(1.0)'], {}), '(current / rampup_length, 0.0, 1.0)\n', (8329, 8364), True, 'import numpy as np\n'), ((1390, 1405), 'torch.no_grad',...
import matplotlib import matplotlib.pyplot as plt import numpy as np import csv import seaborn as sns import itertools import pandas as pd import scipy from scipy.signal import savgol_filter from scipy.signal import find_peaks_cwt from scipy.signal import boxcar sns.set(font_scale=1.2) sns.set_style("white") colors = ...
[ "seaborn.set", "numpy.convolve", "seaborn.color_palette", "seaborn.set_style", "scipy.signal.boxcar", "numpy.interp", "numpy.loadtxt", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show" ]
[((264, 287), 'seaborn.set', 'sns.set', ([], {'font_scale': '(1.2)'}), '(font_scale=1.2)\n', (271, 287), True, 'import seaborn as sns\n'), ((288, 310), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (301, 310), True, 'import seaborn as sns\n'), ((387, 433), 'numpy.loadtxt', 'np.loadtxt', ([...
# -*- coding: utf-8 -*- import matplotlib.colors as colorplt import matplotlib.pyplot as plt import numpy as np from sktime.distances._distance import distance_alignment_path, pairwise_distance gray_cmap = colorplt.LinearSegmentedColormap.from_list("", ["#c9cacb", "white"]) def _path_mask(cost_matrix, path, ax, the...
[ "os.path.exists", "os.makedirs", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.colors.LinearSegmentedColormap.from_list", "sktime.distances._distance.pairwise_distance", "numpy.array", "matplotlib.pyplot.figure", "matplotlib.pyplot.axes", "matplotlib.pyplot.tight_layout", "matplotlib.pyp...
[((208, 276), 'matplotlib.colors.LinearSegmentedColormap.from_list', 'colorplt.LinearSegmentedColormap.from_list', (['""""""', "['#c9cacb', 'white']"], {}), "('', ['#c9cacb', 'white'])\n", (250, 276), True, 'import matplotlib.colors as colorplt\n'), ((353, 379), 'numpy.zeros_like', 'np.zeros_like', (['cost_matrix'], {}...
import numpy as np import pytest from src.models.noise_transformation import average_true_var_real, average_true_var_imag, average_true_cov, \ average_true_noise_covariance, naive_noise_covariance test_cases_real_variance = [ (2 - 3j, 0, 0, 0), (0, 1, 1, np.exp(-2) * (2 * np.cosh(2) - np.cosh(1))), (2...
[ "src.models.noise_transformation.naive_noise_covariance", "numpy.sqrt", "src.models.noise_transformation.average_true_var_imag", "numpy.testing.assert_allclose", "src.models.noise_transformation.average_true_cov", "numpy.sinh", "numpy.exp", "pytest.mark.parametrize", "numpy.zeros", "src.models.noi...
[((1045, 1134), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""m,sd_magnitude,sd_phase,expected"""', 'test_cases_real_variance'], {}), "('m,sd_magnitude,sd_phase,expected',\n test_cases_real_variance)\n", (1068, 1134), False, 'import pytest\n'), ((1309, 1398), 'pytest.mark.parametrize', 'pytest.mark.par...
# -*- coding: utf-8 -*- import os import sys # ensure `tests` directory path is on top of Python's module search filedir = os.path.dirname(__file__) sys.path.insert(0, filedir) while filedir in sys.path[1:]: sys.path.pop(sys.path.index(filedir)) # avoid duplication import pytest import numpy as np from copy impor...
[ "numpy.abs", "sys.path.insert", "backend.notify", "backend.tempdir", "os.path.join", "backend._do_test_load", "pytest.main", "os.path.dirname", "numpy.random.randint", "sys.path.index", "backend._get_test_names", "copy.deepcopy", "backend.K.abs", "deeptrain.metrics._standardize", "backen...
[((123, 148), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (138, 148), False, 'import os\n'), ((149, 176), 'sys.path.insert', 'sys.path.insert', (['(0)', 'filedir'], {}), '(0, filedir)\n', (164, 176), False, 'import sys\n'), ((734, 781), 'os.path.join', 'os.path.join', (['BASEDIR', '"""test...
""" Main call. TODO: - parallize the mda processing portion? (dask) """ import numpy as np import matplotlib.pyplot as plt import MDAnalysis as mda from command_line import create_cmd_arguments, handle_command_line from calc_relax import Calc_19F_Relaxation from calc_fh_dists import Calc_FH_Dists from plot_relax imp...
[ "numpy.mean", "calc_fh_dists.Calc_FH_Dists", "calc_relax.Calc_19F_Relaxation", "command_line.handle_command_line", "matplotlib.pyplot.plot", "command_line.create_cmd_arguments", "numpy.savetxt", "MDAnalysis.Universe", "matplotlib.pyplot.show" ]
[((681, 703), 'command_line.create_cmd_arguments', 'create_cmd_arguments', ([], {}), '()\n', (701, 703), False, 'from command_line import create_cmd_arguments, handle_command_line\n'), ((743, 779), 'command_line.handle_command_line', 'handle_command_line', (['argument_parser'], {}), '(argument_parser)\n', (762, 779), F...
import numpy as np class BoundBox: """ Adopted from https://github.com/thtrieu/darkflow/blob/master/darkflow/utils/box.py """ def __init__(self, obj_prob, probs=None, box_coord=[float() for i in range(4)]): self.x, self.y = float(box_coord[0]), float(box_coord[1]) self.w, self.h =...
[ "numpy.array", "numpy.argmax" ]
[((594, 621), 'numpy.argmax', 'np.argmax', (['self.class_probs'], {}), '(self.class_probs)\n', (603, 621), True, 'import numpy as np\n'), ((469, 484), 'numpy.array', 'np.array', (['probs'], {}), '(probs)\n', (477, 484), True, 'import numpy as np\n')]
import pandas as pd import numpy as np import click import os PRIORITY = ('Read-through', 'Protein coding', 'Pseudogene', 'TUCP', 'lncrna', 'lncRNA', 'other', 'ncRNA,other') type_map = { 'other': 'lncRNA', 'ncRNA,other': 'lncRNA', 'lncrna': 'lncRNA', 'protein_coding': 'Protein coding', ...
[ "click.option", "numpy.where", "os.path.join", "click.Path", "pandas.read_table", "pandas.DataFrame", "click.command", "pandas.concat" ]
[((390, 405), 'click.command', 'click.command', ([], {}), '()\n', (403, 405), False, 'import click\n'), ((897, 989), 'click.option', 'click.option', (['"""-n"""', '"""--name"""'], {'type': 'click.STRING', 'help': '"""Summary table name"""', 'default': 'None'}), "('-n', '--name', type=click.STRING, help='Summary table n...
#!/usr/bin/env python """Module for global fitting titrations (pH and cl) on 2 datasets """ import os import sys import argparse import numpy as np from lmfit import Parameters, Minimizer, minimize, conf_interval, report_fit import pandas as pd import matplotlib.pyplot as plt # from scipy import optimize def ci_repo...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "lmfit.Minimizer", "argparse.ArgumentParser", "pandas.read_csv", "lmfit.conf_interval", "os.makedirs", "matplotlib.pyplot.plot", "os.path.split", "seaborn.set_style", "numpy.random.randint", "os.path.isdir", "lmfit.report_fit", "sys.ex...
[((1986, 2034), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (2009, 2034), False, 'import argparse\n'), ((2861, 2883), 'pandas.read_csv', 'pd.read_csv', (['args.file'], {}), '(args.file)\n', (2872, 2883), True, 'import pandas as pd\n'), ((298...
#!/usr/bin/env python from __future__ import division import numpy as np from lfd.environment.simulation import DynamicSimulationRobotWorld from lfd.environment.simulation_object import XmlSimulationObject, BoxSimulationObject from lfd.environment import environment from lfd.environment import sim_util from lfd.demo...
[ "move_rope.create_rope", "lfd.environment.environment.LfdEnvironment", "move_rope.create_augmented_traj", "lfd.transfer.registration_transfer.TwoStepRegistrationAndTrajectoryTransferer", "lfd.environment.sim_util.reset_arms_to_side", "lfd.registration.registration.TpsRpmRegistrationFactory", "lfd.enviro...
[((767, 789), 'move_rope.create_rope', 'create_rope', (['rope_poss'], {}), '(rope_poss)\n', (778, 789), False, 'from move_rope import create_augmented_traj, create_rope\n'), ((1098, 1142), 'numpy.array', 'np.array', (['[[0, 0, 1], [0, 1, 0], [-1, 0, 0]]'], {}), '([[0, 0, 1], [0, 1, 0], [-1, 0, 0]])\n', (1106, 1142), Tr...
import csv import os.path import random import numpy as np import scipy.io import torch import torchvision from torch.utils.data import Dataset # from .util import * from data.util import default_loader, read_img, augment, get_image_paths class PIPALFolder(Dataset): def __init__(self, root=None, ...
[ "data.util.augment", "numpy.array", "torchvision.transforms.Normalize", "data.util.read_img", "numpy.transpose" ]
[((1538, 1630), 'torchvision.transforms.Normalize', 'torchvision.transforms.Normalize', ([], {'mean': '[0.485, 0.456, 0.406]', 'std': '[0.229, 0.224, 0.225]'}), '(mean=[0.485, 0.456, 0.406], std=[0.229, \n 0.224, 0.225])\n', (1570, 1630), False, 'import torchvision\n'), ((1956, 1988), 'data.util.read_img', 'read_img...
import pytest import numpy as np import pandas as pd from SPARTACUS10 import spatial_silhouette as spasi import sklearn.metrics as metrics import os def find_path(name, path = None): if path is None: path = os.getcwd() for root, dirs, files in os.walk(path): if name in files: ...
[ "numpy.random.normal", "numpy.isclose", "SPARTACUS10.spatial_silhouette.simplified_silhouette_coefficient_spatial", "numpy.round", "os.path.join", "SPARTACUS10.spatial_silhouette.silhouette_coefficient_spatial", "os.getcwd", "numpy.array", "numpy.random.randint", "SPARTACUS10.spatial_silhouette.ge...
[((268, 281), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (275, 281), False, 'import os\n'), ((1207, 1237), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(10, V)'}), '(size=(10, V))\n', (1223, 1237), True, 'import numpy as np\n'), ((1882, 1958), 'SPARTACUS10.spatial_silhouette.silhouette_coefficient',...
import numpy as np import pandas as pd import pickle as pk import random from sklearn.metrics import accuracy_score from sklearn import preprocessing from sklearn.ensemble import RandomForestClassifier from sklearn.preprocessing import Imputer def read_csv(csv_path): df = pd.read_csv(csv_path) return df d...
[ "sklearn.preprocessing.LabelEncoder", "pickle.dump", "pandas.read_csv", "numpy.where", "numpy.delete", "pickle.load", "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.accuracy_score" ]
[((281, 302), 'pandas.read_csv', 'pd.read_csv', (['csv_path'], {}), '(csv_path)\n', (292, 302), True, 'import pandas as pd\n'), ((349, 377), 'sklearn.preprocessing.LabelEncoder', 'preprocessing.LabelEncoder', ([], {}), '()\n', (375, 377), False, 'from sklearn import preprocessing\n'), ((2115, 2143), 'sklearn.preprocess...
# -*- coding: utf-8 -*- """ Created on Wed Nov 22 21:44:55 2017 @author: Mike """ import numpy as np import cv2 import glob import pickle import matplotlib.pyplot as plt from matplotlib.pyplot import * import os from scipy import stats from moviepy.editor import VideoFileClip from IPython.display im...
[ "cv2.rectangle", "numpy.polyfit", "numpy.hstack", "numpy.array", "cv2.warpPerspective", "sobel_library.abs_sobel_image", "cv2.destroyAllWindows", "cv2.calibrateCamera", "camera_calibration.calibrate_camera", "numpy.arange", "numpy.mean", "os.listdir", "collections.deque", "camera_calibrati...
[((2065, 2089), 'collections.deque', 'deque', ([], {'maxlen': 'deque_size'}), '(maxlen=deque_size)\n', (2070, 2089), False, 'from collections import deque\n'), ((2133, 2157), 'collections.deque', 'deque', ([], {'maxlen': 'deque_size'}), '(maxlen=deque_size)\n', (2138, 2157), False, 'from collections import deque\n'), (...
from IMLearn.learners import UnivariateGaussian, MultivariateGaussian import numpy as np import plotly.graph_objects as go import plotly.io as pio pio.templates.default = "simple_white" SAMPLES_NUM = 1000 LEFT_CIRCLE = '(' RIGHT_CIRCLE = ')' COMMA = ', ' GRAPH_SIZE = 500 HEATMAP_SIZE = 700 def test_univariate_gaussi...
[ "numpy.random.normal", "numpy.transpose", "plotly.graph_objects.Layout", "numpy.random.multivariate_normal", "numpy.asarray", "numpy.argmax", "numpy.array", "numpy.linspace", "numpy.zeros", "plotly.graph_objects.Scatter", "numpy.random.seed", "IMLearn.learners.UnivariateGaussian", "IMLearn.l...
[((392, 412), 'IMLearn.learners.UnivariateGaussian', 'UnivariateGaussian', ([], {}), '()\n', (410, 412), False, 'from IMLearn.learners import UnivariateGaussian, MultivariateGaussian\n'), ((443, 483), 'numpy.random.normal', 'np.random.normal', (['mu', 'sigma', 'SAMPLES_NUM'], {}), '(mu, sigma, SAMPLES_NUM)\n', (459, 48...
import csv import random from functools import partial from typing import Callable, Optional from pdb import set_trace as st import os import random import pandas as pd from typing import Any, Callable, Dict, Iterable, List, Tuple, Union import numpy as np import tensorflow as tf from foolbox.attacks import ( FGSM...
[ "numpy.prod", "matplotlib.pyplot.ylabel", "sklearn.metrics.auc", "model.config.LENET.network_class.graph", "nninst_utils.numpy.arg_approx", "sklearn.metrics.roc_curve", "numpy.isfinite", "nninst_utils.fs.abspath", "nninst_utils.ray.ray_init", "matplotlib.pyplot.switch_backend", "tensorflow.set_r...
[((724, 749), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""Agg"""'], {}), "('Agg')\n", (742, 749), True, 'import matplotlib.pyplot as plt\n'), ((3011, 3079), 'trace.common.class_trace', 'class_trace', (['trace_name'], {'model_config': 'LENET', 'data_config': 'data_config'}), '(trace_name, model_confi...
import numpy as np from multiagent.core import World, Agent, Landmark from multiagent.scenario import BaseScenario class Scenario(BaseScenario): def make_world(self): world = World() # set any world properties first world.dim_c = 2 num_agents = 2 num_adversaries = 1 ...
[ "multiagent.core.Landmark", "numpy.array", "numpy.zeros", "multiagent.core.World", "numpy.concatenate", "numpy.random.uniform", "multiagent.core.Agent" ]
[((188, 195), 'multiagent.core.World', 'World', ([], {}), '()\n', (193, 195), False, 'from multiagent.core import World, Agent, Landmark\n'), ((3273, 3311), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(+1)', 'world.dim_p'], {}), '(-1, +1, world.dim_p)\n', (3290, 3311), True, 'import numpy as np\n'), ((3353,...
# Imports import numpy as np # Single to double frame # Combines images by 2, returning an array with two frames (one for each image). # # Input: 5 images with step 1. # Output: 4 double-framed images. # FrameA: 1 2 3 4 # FrameB: 2 3 4 5 # # Input: 8 images with step 3. # Output: 5 doubled...
[ "numpy.array" ]
[((1479, 1509), 'numpy.array', 'np.array', (['images_double_framed'], {}), '(images_double_framed)\n', (1487, 1509), True, 'import numpy as np\n'), ((1273, 1324), 'numpy.array', 'np.array', (['double_frame[0][min_y:max_y, min_x:max_x]'], {}), '(double_frame[0][min_y:max_y, min_x:max_x])\n', (1281, 1324), True, 'import ...
#! /usr/bin/env python """ This script parses and cleans up a provided Flow Cytometry Standard (fcs) file and saves it as a Comma Separated Value (csv). """ import os import re import numpy as np import pandas as pd import optparse import fcsparser # ####################################################################...
[ "os.listdir", "optparse.OptionParser", "numpy.array", "os.path.isdir", "fcsparser.parse", "os.mkdir", "re.sub" ]
[((386, 409), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (407, 409), False, 'import optparse\n'), ((1906, 1955), 'numpy.array', 'np.array', (['[(ops.pattern in f) for f in usr_files]'], {}), '([(ops.pattern in f) for f in usr_files])\n', (1914, 1955), True, 'import numpy as np\n'), ((1804, 1828...
from traits.api import HasTraits, Bool, Enum, List, Str from numpy import array, cos, sin class ElementalRotationDefinition(HasTraits): ''' A definition of an elemental rotation and its angle's name ''' angle_name = Str("undefined angle") axis = Enum('around_x', 'around_y', 'around_z') isClock...
[ "traits.api.Enum", "traits.api.Str", "numpy.cos", "numpy.sin", "traits.api.Bool", "traits.api.List" ]
[((234, 256), 'traits.api.Str', 'Str', (['"""undefined angle"""'], {}), "('undefined angle')\n", (237, 256), False, 'from traits.api import HasTraits, Bool, Enum, List, Str\n'), ((268, 308), 'traits.api.Enum', 'Enum', (['"""around_x"""', '"""around_y"""', '"""around_z"""'], {}), "('around_x', 'around_y', 'around_z')\n"...
import torch from torch.utils.data import Dataset, DataLoader from torch.distributions.multivariate_normal import MultivariateNormal import numpy as np from tqdm import tqdm import random def get_rotation(theta): rad = np.radians(theta) c, s = np.cos(rad), np.sin(rad) R = np.array([[c, -s], ...
[ "numpy.radians", "torch.sin", "numpy.array", "torch.cos", "torch.sum", "numpy.sin", "torch.eye", "numpy.random.seed", "torch.randn", "torch.distributions.Normal", "torch.Tensor", "numpy.cos", "torch.Size", "torch.cat", "torch.manual_seed", "torch.full", "random.seed", "torch.tensor...
[((224, 241), 'numpy.radians', 'np.radians', (['theta'], {}), '(theta)\n', (234, 241), True, 'import numpy as np\n'), ((286, 313), 'numpy.array', 'np.array', (['[[c, -s], [s, c]]'], {}), '([[c, -s], [s, c]])\n', (294, 313), True, 'import numpy as np\n'), ((2140, 2187), 'torch.distributions.multivariate_normal.Multivari...
# -*- coding: utf-8 -*- """ Created on Sat May 23 11:28:30 2020 @author: rener """ import numpy as np import pandas as pd import os from datetime import date import time import sys dir_path = os.path.dirname(os.path.realpath(__file__)) os.chdir(dir_path) #%% For the various companies we have data going back differen...
[ "numpy.mean", "os.listdir", "pandas.read_csv", "os.chdir", "os.path.realpath", "pandas.DataFrame", "pandas.concat" ]
[((238, 256), 'os.chdir', 'os.chdir', (['dir_path'], {}), '(dir_path)\n', (246, 256), False, 'import os\n'), ((362, 382), 'os.listdir', 'os.listdir', (['"""Stocks"""'], {}), "('Stocks')\n", (372, 382), False, 'import os\n'), ((856, 873), 'pandas.concat', 'pd.concat', (['frames'], {}), '(frames)\n', (865, 873), True, 'i...
__copyright__ = "Copyright (C) 2019 <NAME>" __license__ = """ 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, modif...
[ "pyopencl.array.empty_like", "loopy.Options", "loopy.ValueArg", "numpy.sqrt", "pymbolic.var", "pystella.elementwise.append_new_args", "numpy.empty_like", "loopy.add_inames_for_unused_hw_axes", "pystella.field.index_fields", "pystella.get_field_args" ]
[((25354, 25421), 'numpy.sqrt', 'np.sqrt', (['(36 * c2 ** 4 + 36 * c2 ** 3 - 135 * c2 ** 2 + 84 * c2 - 12)'], {}), '(36 * c2 ** 4 + 36 * c2 ** 3 - 135 * c2 ** 2 + 84 * c2 - 12)\n', (25361, 25421), True, 'import numpy as np\n'), ((5142, 5198), 'pystella.get_field_args', 'get_field_args', (['self.rhs_dict'], {'prepend_wi...
# -*- coding: utf-8 -*- # # <NAME> 2021 gpSTS ########################################### ###Configuration File###################### ###for gpSTS steering of experiments###### ########################################### import os import numpy as np from gpsts.NanonisInterface.nanonis_interface import Nanonis from gps...
[ "gpsts.NanonisInterface.data_class.PointList", "os.path.exists", "gpsts.NanonisInterface.data_class.SpecCounter", "numpy.sqrt", "os.makedirs", "json.dump", "gpsts.NanonisInterface.nanonis_interface.Nanonis.readheader", "gpsts.NanonisInterface.nanonis_interface.Nanonis.readimage", "gpsts.NanonisInter...
[((1551, 1561), 'gpsts.NanonisInterface.data_class.ScanData', 'ScanData', ([], {}), '()\n', (1559, 1561), False, 'from gpsts.NanonisInterface.data_class import ScanData, SpecCounter, PointList, ImageInfo\n'), ((2616, 2629), 'gpsts.NanonisInterface.data_class.SpecCounter', 'SpecCounter', ([], {}), '()\n', (2627, 2629), ...
import numpy as np from numpy import array from numpy.linalg import det from numpy.linalg import matrix_rank from numpy.linalg import solve """ *** remember the following useful tools*** from numpy import transpose from numpy import dot from numpy import argmax from numpy import abs from numpy.linalg import eig fr...
[ "numpy.linalg.matrix_rank", "numpy.linalg.solve", "sympy.Matrix", "numpy.linalg.det", "numpy.array" ]
[((811, 830), 'numpy.linalg.matrix_rank', 'matrix_rank', (['matrix'], {}), '(matrix)\n', (822, 830), False, 'from numpy.linalg import matrix_rank\n'), ((844, 858), 'numpy.linalg.matrix_rank', 'matrix_rank', (['B'], {}), '(B)\n', (855, 858), False, 'from numpy.linalg import matrix_rank\n'), ((1689, 1708), 'numpy.linalg....
""" Module to execute the simulation for a given instance. """ """ import packages """ import logging from importlib import import_module import numpy.random as rdm import copy import numpy as np """ import project configurations """ import configurations.settings_simulation as config """ import project librar...
[ "logging.getLogger", "modules.simulation.entities.Tram", "modules.simulation.entities.Passengers.reset", "modules.simulation.entities.Passengers.boarding", "modules.simulation.entities.Passengers.alighting", "modules.simulation.entities.Stop", "modules.data.datamgm.initialise_logger", "modules.simulat...
[((506, 537), 'modules.data.datamgm.initialise_logger', 'dtm.initialise_logger', (['__name__'], {}), '(__name__)\n', (527, 537), True, 'import modules.data.datamgm as dtm\n'), ((1746, 1777), 'logging.getLogger', 'logging.getLogger', (['"""simulation"""'], {}), "('simulation')\n", (1763, 1777), False, 'import logging\n'...
import numpy as np import matplotlib.pyplot as plt from scipy import linalg as la def PCA(dat, center=False, percentage=0.8): M, N = dat.shape if center: mu = np.mean(dat,0) dat -= mu U, L, Vh = la.svd(dat, full_matrices=False) V = Vh.T.conjugate() SIGMA = np.diag(L) X = U...
[ "numpy.mean", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.diag", "matplotlib.pyplot.figure", "scipy.linalg.svd" ]
[((225, 257), 'scipy.linalg.svd', 'la.svd', (['dat'], {'full_matrices': '(False)'}), '(dat, full_matrices=False)\n', (231, 257), True, 'from scipy import linalg as la\n'), ((300, 310), 'numpy.diag', 'np.diag', (['L'], {}), '(L)\n', (307, 310), True, 'import numpy as np\n'), ((738, 750), 'matplotlib.pyplot.figure', 'plt...
# -------------------------------------------------------- # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import os import torch import torch.nn.functional as F import numpy as np from core import networks from core.utils import * from core.loss i...
[ "os.path.exists", "torch.ones_like", "torch.unique", "torch.cuda.FloatTensor", "torch.optim.lr_scheduler.MultiStepLR", "os.makedirs", "torch.load", "torch.Tensor", "numpy.array", "torch.no_grad", "torch.device" ]
[((2639, 2654), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2652, 2654), False, 'import torch\n'), ((4199, 4214), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4212, 4214), False, 'import torch\n'), ((3116, 3151), 'torch.cuda.FloatTensor', 'torch.cuda.FloatTensor', (['state[0][1]'], {}), '(state[0][1])\...
import gym import datetime import os import numpy as np from agent import DeepQAgent def main(): env = gym.make("LunarLander-v2") timestamp = '{:%Y-%m-%d-%H:%M}'.format(datetime.datetime.now()) o_dir = "LunarLander-v2/{}/models".format(timestamp) if not os.path.exists(o_dir): os.makedirs(o_d...
[ "os.path.exists", "numpy.reshape", "os.makedirs", "agent.DeepQAgent", "datetime.datetime.now", "gym.make" ]
[((110, 136), 'gym.make', 'gym.make', (['"""LunarLander-v2"""'], {}), "('LunarLander-v2')\n", (118, 136), False, 'import gym\n'), ((487, 531), 'agent.DeepQAgent', 'DeepQAgent', (['state_size', 'action_size'], {'model': '(2)'}), '(state_size, action_size, model=2)\n', (497, 531), False, 'from agent import DeepQAgent\n')...
import glob import os import sys from sgfmill.sgfmill import sgf import global_vars_go as gvg import loader import utils import board3d as go_board import numpy as np kifuPath = "./kifu" num_games = gvg.num_games from_game = gvg.from_test_games lb_size = 250. correct = 0 total = 0 num_lb = int((num_g...
[ "board3d.make_move", "os.path.join", "board3d.get_encoded_board", "board3d.setup_board", "numpy.zeros", "board3d.switch_player_perspec", "loader.load_model_from_file" ]
[((380, 420), 'loader.load_model_from_file', 'loader.load_model_from_file', (['gvg.nn_type'], {}), '(gvg.nn_type)\n', (407, 420), False, 'import loader\n'), ((544, 575), 'os.path.join', 'os.path.join', (['kifuPath', '"""*.sgf"""'], {}), "(kifuPath, '*.sgf')\n", (556, 575), False, 'import os\n'), ((1036, 1075), 'board3d...
import os import numpy as np from allennlp.predictors import Predictor from isanlp.annotation_rst import DiscourseUnit from symbol_map import SYMBOL_MAP class AllenNLPSegmenter: def __init__(self, model_dir_path, cuda_device=-1): self._model_path = os.path.join(model_dir_path, 'segmenter_neural', 'model...
[ "allennlp.predictors.Predictor.from_path", "numpy.array", "os.path.join", "isanlp.annotation_rst.DiscourseUnit" ]
[((265, 329), 'os.path.join', 'os.path.join', (['model_dir_path', '"""segmenter_neural"""', '"""model.tar.gz"""'], {}), "(model_dir_path, 'segmenter_neural', 'model.tar.gz')\n", (277, 329), False, 'import os\n'), ((395, 463), 'allennlp.predictors.Predictor.from_path', 'Predictor.from_path', (['self._model_path'], {'cud...
#!/usr/bin/env python3 # 2次元累積和 S の [x1, x2) × [y1, y2) 総和 def ac2(s, x1, x2, y1, y2): return s[x2][y2] - s[x1][y2] - s[x2][y1] + s[x1][y1] import numpy as np _, *d = open(0) n, k = map(int, _.split()) B = np.zeros((2*k, 2*k)) for e in d: *z, c = e.split() x, y = map(int, z) B[x % (2*k)][(y + k * (z ==...
[ "numpy.tile", "numpy.zeros" ]
[((211, 235), 'numpy.zeros', 'np.zeros', (['(2 * k, 2 * k)'], {}), '((2 * k, 2 * k))\n', (219, 235), True, 'import numpy as np\n'), ((383, 401), 'numpy.tile', 'np.tile', (['B', '(2, 2)'], {}), '(B, (2, 2))\n', (390, 401), True, 'import numpy as np\n')]
from __future__ import print_function, absolute_import, division # makes these scripts backward compatible with python 2.6 and 2.7 # pyKratos imports from .Element import Element # Other imports import numpy as np class TriangleElement(Element): def __init__(self, elem_id, nodes): super(TriangleElement...
[ "numpy.array", "numpy.zeros" ]
[((1609, 1638), 'numpy.zeros', 'np.zeros', (['(3, 2)'], {'dtype': 'float'}), '((3, 2), dtype=float)\n', (1617, 1638), True, 'import numpy as np\n'), ((1958, 2001), 'numpy.array', 'np.array', (['[one_third, one_third, one_third]'], {}), '([one_third, one_third, one_third])\n', (1966, 2001), True, 'import numpy as np\n')...
import os import tempfile from glob import glob import json from collections import OrderedDict import numpy as np from .adding_features import adding_no_features def iterate_json_data(filepath, columns_to_keep=None, feature_adder=adding_no_features, ...
[ "tempfile.TemporaryDirectory", "json.loads", "collections.OrderedDict", "json.dumps", "os.path.join", "numpy.random.seed" ]
[((2255, 2284), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (2282, 2284), False, 'import tempfile\n'), ((480, 496), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (490, 496), False, 'import json\n'), ((1497, 1524), 'os.path.join', 'os.path.join', (['dir', '"""*.json"""'], {}...
# -*- coding: utf-8 -*- """ Combination of http://scipy-central.org/item/52/1/zplane-function and http://www.dsprelated.com/showcode/244.php with my own modifications """ # Copyright (c) 2011 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.margins", "numpy.arange", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.axhline", "numpy.rint", "scipy.signal.tf2zpk", "matplotlib.pyplot.axis", "matplotlib.patches.Circle", "matplotlib.pyplot.s...
[((1321, 1341), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(2)', '(2)', '(1)'], {}), '(2, 2, 1)\n', (1332, 1341), True, 'import matplotlib.pyplot as plt\n'), ((1466, 1552), 'matplotlib.patches.Circle', 'patches.Circle', (['(0, 0)'], {'radius': '(1)', 'fill': '(False)', 'color': '"""black"""', 'ls': '"""solid"""', '...
import os import numpy as np from constants import DATABASE_FILE_NAME, PLAYER_ONE, PLAYER_TWO, POSITION_TO_DATABASE from Agents.random import Random from othello import Othello import multiprocessing as mp class Database: def __init__(self): """ load database data and store them in self._db_data ...
[ "othello.Othello", "Agents.random.Random.get_move", "multiprocessing.cpu_count", "os.path.isfile", "numpy.zeros", "multiprocessing.Pool", "numpy.savetxt", "numpy.loadtxt" ]
[((765, 825), 'numpy.loadtxt', 'np.loadtxt', (['DATABASE_FILE_NAME'], {'delimiter': '""";"""', 'dtype': '"""int64"""'}), "(DATABASE_FILE_NAME, delimiter=';', dtype='int64')\n", (775, 825), True, 'import numpy as np\n'), ((1042, 1083), 'numpy.zeros', 'np.zeros', ([], {'shape': '(60, 9, 3)', 'dtype': '"""int64"""'}), "(s...
import argparse import json import os.path import random import re import time import cv2 import numpy as np import requests from PIL import Image from config import config class GermanLicensePlateImagesGenerator: def __init__(self, output): self.output = output self.COUNTRY_MARKS = np.asarray([...
[ "PIL.Image.fromarray", "random.choice", "argparse.ArgumentParser", "re.compile", "requests.get", "random.seed", "time.sleep", "cv2.imdecode", "cv2.cvtColor", "numpy.fromstring", "random.randint" ]
[((4263, 4288), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4286, 4288), False, 'import argparse\n'), ((819, 832), 'random.seed', 'random.seed', ([], {}), '()\n', (830, 832), False, 'import random\n'), ((1470, 1503), 'random.choice', 'random.choice', (['self.COUNTRY_MARKS'], {}), '(self.COU...
import sys sys.path.append("/home/ly/workspace/mmsa") seed = 1938 import numpy as np import torch from torch import nn from torch import optim np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) from models.bigru_rcnn_gate import * from utils.train import * from t...
[ "torch.cuda.manual_seed_all", "torch.manual_seed", "torch.nn.CrossEntropyLoss", "numpy.random.seed", "torch.cuda.manual_seed", "sys.path.append" ]
[((11, 53), 'sys.path.append', 'sys.path.append', (['"""/home/ly/workspace/mmsa"""'], {}), "('/home/ly/workspace/mmsa')\n", (26, 53), False, 'import sys\n'), ((144, 164), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (158, 164), True, 'import numpy as np\n'), ((165, 188), 'torch.manual_seed', 'torc...
#!/usr/bin/env python # -*- coding: UTF-8 -*- ######################################################################## # GNU General Public License v3.0 # GNU GPLv3 # Copyright (c) 2019, <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licen...
[ "numpy.array", "platform.node" ]
[((1150, 1213), 'numpy.array', 'np.array', (["['caffe', 'tensorflow', 'pytorch', 'keras', 'caffe2']"], {}), "(['caffe', 'tensorflow', 'pytorch', 'keras', 'caffe2'])\n", (1158, 1213), True, 'import numpy as np\n'), ((1271, 1323), 'numpy.array', 'np.array', (['[2048, 2048, 1000, 1024, 1000, 2048, 2048]'], {}), '([2048, 2...