code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import aoc_common as ac import numpy as np from aocd.models import Puzzle puzzle = Puzzle(year=2019, day=11) ram = [int(x) for x in puzzle.input_data.split(",")] pointer = 0 relative_base = 0 painting = {(0, 0): 0} coord = (0, 0) color = 0 # Part One color = 1 # Part Two direction = "N" our_computer = ac.full_intco...
[ "aoc_common.robot_turner", "numpy.zeros", "aoc_common.screen", "aocd.models.Puzzle" ]
[((84, 109), 'aocd.models.Puzzle', 'Puzzle', ([], {'year': '(2019)', 'day': '(11)'}), '(year=2019, day=11)\n', (90, 109), False, 'from aocd.models import Puzzle\n'), ((960, 977), 'numpy.zeros', 'np.zeros', (['[6, 43]'], {}), '([6, 43])\n', (968, 977), True, 'import numpy as np\n'), ((1042, 1061), 'aoc_common.screen', '...
import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import os import plot_voltage import pdn_params as pdn from cython.sim_pdn import sim_throttling_wrapper TEST_LIST_spec=[ "429.mcf", "433.milc", "435.gromacs", "436.cactusADM", "437.leslie3d",...
[ "plot_voltage.print_power", "numpy.set_printoptions", "numpy.copy", "plot_voltage.get_voltage", "plot_voltage.get_data", "plot_voltage.plot", "matplotlib.use", "plot_voltage.get_pwr_scaling", "cython.sim_pdn.sim_throttling_wrapper" ]
[((28, 49), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (42, 49), False, 'import matplotlib\n'), ((899, 1010), 'cython.sim_pdn.sim_throttling_wrapper', 'sim_throttling_wrapper', (['power', 'pwr_throttle', 'THRES', 'L', 'C', 'R', 'VDC', 'CLK', 'CLK_THROTTLE', 'LEADTIME', 'THROTTLE_DUR'], {}), '...
import os import os.path import sys import logging logger = logging.getLogger(__name__) import numpy as np import inspect import datetime import hashlib import functools import h5py import filelock import multiprocessing import itertools import random from tqdm.auto import tqdm # # utilities for my hdf5 dataset...
[ "h5py.File", "numpy.void", "hashlib.sha1", "os.path.basename", "filelock.FileLock", "os.path.dirname", "numpy.all", "logging.getLogger", "inspect.signature", "phfnbutils.TimeThis", "numpy.printoptions", "numpy.issubdtype" ]
[((61, 88), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (78, 88), False, 'import logging\n'), ((19202, 19224), 'inspect.signature', 'inspect.signature', (['fun'], {}), '(fun)\n', (19219, 19224), False, 'import inspect\n'), ((3862, 3890), 'numpy.issubdtype', 'np.issubdtype', (['t', 'np....
''' import numpy as np import pandas as pd import nltk nltk.download('punkt') # one time execution import re we_df = pd.read_hdf('mini.h5', start = 0, stop = 100) # (362891, 300) pi(we_df.shape) words = we_df.index pi(words) pi(words[50000]) pi(we_df.iloc[50000]) mes = 'This is some demo text,...
[ "pandas.read_hdf", "networkx.pagerank", "pandas.read_csv", "numpy.zeros", "networkx.from_numpy_array", "nltk.tokenize.sent_tokenize", "pandas.Series", "nltk.corpus.stopwords.words" ]
[((772, 794), 'pandas.read_hdf', 'pd.read_hdf', (['"""mini.h5"""'], {}), "('mini.h5')\n", (783, 794), True, 'import pandas as pd\n'), ((1847, 1879), 'pandas.read_csv', 'pd.read_csv', (['"""demo_articles.csv"""'], {}), "('demo_articles.csv')\n", (1858, 1879), True, 'import pandas as pd\n'), ((2488, 2514), 'nltk.corpus.s...
import numpy as np import torch import torch.nn.init as init from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from .layer_norm import LayerNorm def maybe_mask(attn, attn_mask): if attn_mask is not None: assert attn_mask.size() == attn.size(), \ 'Atten...
[ "torch.nn.Dropout", "torch.nn.init.xavier_normal", "torch.bmm", "numpy.power", "torch.split", "torch.FloatTensor", "torch.cat", "torch.nn.functional.softmax", "torch.nn.Softmax", "torch.nn.Linear", "torch.tanh" ]
[((2039, 2057), 'numpy.power', 'np.power', (['dim', '(0.5)'], {}), '(dim, 0.5)\n', (2047, 2057), True, 'import numpy as np\n'), ((2081, 2105), 'torch.nn.Dropout', 'nn.Dropout', (['attn_dropout'], {}), '(attn_dropout)\n', (2091, 2105), True, 'import torch.nn as nn\n'), ((2129, 2147), 'torch.nn.Softmax', 'nn.Softmax', ([...
# 根据图片和音乐合成带节奏的相册视频 from typing import Tuple, Union, Any import moviepy.editor from moviepy.video.fx.speedx import speedx import wave import numpy as np import re from progressbar import * from common import python_box from common import gui import psutil import time import math import moviepy.audio.fx.all class Ffm...
[ "wave.open", "common.tools.plot_list", "numpy.abs", "math.fabs", "common.python_box.write_file", "moviepy.video.fx.speedx.speedx", "common.python_box.FileSys", "common.python_box.dir_list", "time.time", "numpy.append", "common.gui.select_file", "numpy.where", "numpy.array", "common.gui.sel...
[((2845, 2882), 'common.python_box.dir_list', 'python_box.dir_list', (['directory', '"""mp4"""'], {}), "(directory, 'mp4')\n", (2864, 2882), False, 'from common import python_box\n'), ((3636, 3648), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3644, 3648), True, 'import numpy as np\n'), ((4129, 4156), 'numpy.whe...
import decimal import math import warnings from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor from decimal import Decimal, localcontext from itertools import repeat from pathlib import Path from time import time from typing import List, Optional, Union import numpy as np import pandas as pd from tq...
[ "pandas.DataFrame", "numpy.random.seed", "decimal.Decimal", "concurrent.futures.ProcessPoolExecutor", "math.floor", "time.time", "numpy.random.randint", "numpy.arange", "decimal.localcontext", "pandas.Series", "warnings.warn", "concurrent.futures.ThreadPoolExecutor", "pandas.concat", "iter...
[((4358, 4404), 'pandas.DataFrame', 'pd.DataFrame', (['ssn_outcomes'], {'columns': "['L_RAND']"}), "(ssn_outcomes, columns=['L_RAND'])\n", (4370, 4404), True, 'import pandas as pd\n'), ((5383, 5410), 'numpy.arange', 'np.arange', (['ssn_min', 'ssn_max'], {}), '(ssn_min, ssn_max)\n', (5392, 5410), True, 'import numpy as ...
# Once for All: Train One Network and Specialize it for Efficient Deployment # <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # International Conference on Learning Representations (ICLR), 2020. import os import torch import argparse from ofa.stereo_matching.data_providers.stereo import StereoDataProvider from ofa.stereo_mat...
[ "ofa.stereo_matching.elastic_nn.networks.ofa_aanet.OFAAANet", "torch.cuda.synchronize", "torch.cuda.Event", "numpy.sum", "argparse.ArgumentParser", "numpy.std", "torch.load", "numpy.zeros", "torch.randn", "torch.cuda.device_count", "ofa.utils.pytorch_utils.get_net_info", "torch.no_grad" ]
[((608, 633), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (631, 633), False, 'import argparse\n'), ((1213, 1321), 'ofa.stereo_matching.elastic_nn.networks.ofa_aanet.OFAAANet', 'OFAAANet', ([], {'ks_list': '[3, 5, 7]', 'expand_ratio_list': '[2, 4, 6, 8]', 'depth_list': '[2, 3, 4]', 'scale_lis...
import os import sys from PIL import Image import numpy as np import random import matplotlib.pyplot as plt size_image = (256, 256) class LSB: # convert integer to 8-bit binary def int2bin(self, image): r, g, b = image return (f'{r:08b}', f'{g:08b}', f'{b:08b}') # conve...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "PIL.Image.new", "matplotlib.pyplot.show", "numpy.random.shuffle", "matplotlib.pyplot.imshow", "PIL.Image.open", "matplotlib.pyplot.figure", "os.listdir", "matplotlib.pyplot.savefig" ]
[((1580, 1608), 'os.listdir', 'os.listdir', (['"""./images_test/"""'], {}), "('./images_test/')\n", (1590, 1608), False, 'import os\n'), ((1722, 1752), 'numpy.random.shuffle', 'np.random.shuffle', (['test_images'], {}), '(test_images)\n', (1739, 1752), True, 'import numpy as np\n'), ((2470, 2497), 'matplotlib.pyplot.fi...
import numpy as np import torch import torch.nn as nn def conv(in_channels, out_channels, kernel_size, bias=True): return nn.Conv2d( in_channels, out_channels, kernel_size, padding=(kernel_size//2), bias=bias) class MappingNet(nn.Module): def __init__(self, opt): super().__init__() ...
[ "torch.nn.ReLU", "torch.nn.Sequential", "numpy.log2", "torch.nn.Conv2d", "torch.nn.Upsample", "torch.nn.BatchNorm2d", "torch.nn.Linear" ]
[((129, 219), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels', 'kernel_size'], {'padding': '(kernel_size // 2)', 'bias': 'bias'}), '(in_channels, out_channels, kernel_size, padding=kernel_size // 2,\n bias=bias)\n', (138, 219), True, 'import torch.nn as nn\n'), ((782, 804), 'torch.nn.Sequential', 'nn...
import numpy as np from copy import copy from .utils.thresholdcurator import ThresholdCurator from .quality_metric import QualityMetric import spiketoolkit as st import spikemetrics.metrics as metrics from spikemetrics.utils import printProgressBar from spikemetrics.metrics import find_neighboring_channels from collect...
[ "spikemetrics.metrics.find_neighboring_channels", "numpy.random.seed", "numpy.sum", "numpy.concatenate", "numpy.abs", "numpy.median", "numpy.asarray", "spiketoolkit.postprocessing.get_unit_waveforms", "numpy.zeros", "numpy.sort", "numpy.linalg.svd", "numpy.mean", "numpy.arange", "collectio...
[((611, 754), 'collections.OrderedDict', 'OrderedDict', (["[('num_channels_to_compare', 13), ('max_spikes_per_unit_for_noise_overlap',\n 1000), ('num_features', 10), ('num_knn', 6)]"], {}), "([('num_channels_to_compare', 13), (\n 'max_spikes_per_unit_for_noise_overlap', 1000), ('num_features', 10), (\n 'num_kn...
""" FLAME - Fuzzy clustering by Local Approximation of MEmbership """ from __future__ import print_function import numpy as np from scipy import sparse from scipy.sparse import csr_matrix, lil_matrix from sklearn.base import BaseEstimator, ClusterMixin from sklearn.utils import check_array from sklearn.metrics.pairw...
[ "numpy.absolute", "sklearn.metrics.pairwise.pairwise_distances", "math.sqrt", "numpy.argmax", "sklearn.utils.check_array", "scipy.sparse.issparse", "numpy.asarray", "numpy.zeros", "numpy.argpartition", "scipy.sparse.lil_matrix", "numpy.where", "numpy.array", "sklearn.preprocessing.normalize"...
[((7213, 7338), 'numpy.array', 'np.array', (['[[0, 0, 0], [1.1, 0, 0], [0, 0.8, 0], [0, 0, 1.3], [10, 10, 10], [11.1, 10,\n 10], [10, 10.8, 10], [10, 11, 12]]'], {}), '([[0, 0, 0], [1.1, 0, 0], [0, 0.8, 0], [0, 0, 1.3], [10, 10, 10], [\n 11.1, 10, 10], [10, 10.8, 10], [10, 11, 12]])\n', (7221, 7338), True, 'impor...
import copy import numpy as np import tensorflow as tf from ammf.utils.wavedata.tools.obj_detection import obj_utils from ammf.utils.wavedata.tools.obj_detection import evaluation from ammf.core import anchor_projector from ammf.core import box_3d_encoder COLOUR_SCHEME_PREDICTIONS = { "Easy GT": (255, 255, 0), ...
[ "ammf.core.box_3d_encoder.box_3d_to_3d_iou_format", "copy.deepcopy", "tensorflow.convert_to_tensor", "ammf.core.anchor_projector.tf_project_to_image_space", "tensorflow.Session", "ammf.utils.wavedata.tools.obj_detection.evaluation.three_d_iou", "numpy.amax", "ammf.utils.wavedata.tools.obj_detection.ob...
[((632, 681), 'ammf.utils.wavedata.tools.obj_detection.obj_utils.read_labels', 'obj_utils.read_labels', (['dataset.label_dir', 'img_idx'], {}), '(dataset.label_dir, img_idx)\n', (653, 681), False, 'from ammf.utils.wavedata.tools.obj_detection import obj_utils\n'), ((2679, 2720), 'tensorflow.convert_to_tensor', 'tf.conv...
""" Utilities based on building baseline machine learning models. """ from typing import Union, Optional from pandas import DataFrame, Series from numpy import mean, tile, empty, std, square, sqrt, log as nplog, reciprocal from scipy.stats import boxcox, normaltest, mode from sklearn.compose import ColumnTransformer f...
[ "sklearn.preprocessing.FunctionTransformer", "sklearn.preprocessing.StandardScaler", "sklearn.model_selection.train_test_split", "numpy.empty", "sklearn.mixture.GaussianMixture", "sklearn.compose.ColumnTransformer", "numpy.mean", "sklearn.impute.SimpleImputer", "numpy.std", "scipy.stats.normaltest...
[((1737, 1781), 'sklearn.utils._testing.ignore_warnings', 'ignore_warnings', ([], {'category': 'ConvergenceWarning'}), '(category=ConvergenceWarning)\n', (1752, 1781), False, 'from sklearn.utils._testing import ignore_warnings\n'), ((2755, 2802), 'sklearn.utils._testing.ignore_warnings', 'ignore_warnings', ([], {'categ...
from pathlib import Path import numpy as np from PIL import ImageFont from scipy.ndimage import convolve from scipy.spatial import cKDTree resource_dir = (Path(__file__) / "../resources").absolute() class Particle: def __init__(self, x, y, color, ball_size=1): self.pos = np.array([x, y]).astype(float) ...
[ "numpy.empty", "numpy.zeros", "scipy.ndimage.convolve", "pathlib.Path", "numpy.where", "numpy.array", "numpy.rot90", "numpy.linalg.norm", "scipy.spatial.cKDTree" ]
[((1668, 1684), 'numpy.empty', 'np.empty', (['a.size'], {}), '(a.size)\n', (1676, 1684), True, 'import numpy as np\n'), ((1825, 1848), 'numpy.where', 'np.where', (['(out > 0)', '(1)', '(0)'], {}), '(out > 0, 1, 0)\n', (1833, 1848), True, 'import numpy as np\n'), ((1859, 1872), 'numpy.rot90', 'np.rot90', (['out'], {}), ...
#!/usr/bin/python3 """Calculate IoU of part segmentation task.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import argparse import data_utils import numpy as np def main(): parser = argparse.ArgumentParser() ...
[ "numpy.sum", "numpy.amin", "argparse.ArgumentParser", "numpy.logical_and", "numpy.amax", "numpy.finfo", "numpy.array", "numpy.loadtxt", "numpy.logical_or", "os.path.join", "os.listdir" ]
[((293, 318), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (316, 318), False, 'import argparse\n'), ((1247, 1273), 'os.listdir', 'os.listdir', (['args.folder_gt'], {}), '(args.folder_gt)\n', (1257, 1273), False, 'import os\n'), ((1369, 1407), 'os.path.join', 'os.path.join', (['args.folder_gt'...
from __future__ import print_function import os import numpy as np import torch from torchvision import datasets, transforms from .smallnorb_dataset_helper import smallnorb, smallnorb_equivariance from .utils import random_split, CustomDataset def get_dataset(args): if args.dataset == "cifar10": ...
[ "torchvision.transforms.ColorJitter", "torchvision.datasets.FashionMNIST", "torch.utils.data.DataLoader", "torchvision.transforms.RandomHorizontalFlip", "os.path.join", "torchvision.transforms.ToPILImage", "torchvision.datasets.CIFAR10", "torchvision.transforms.Pad", "numpy.array", "numpy.repeat",...
[((1265, 1350), 'torchvision.datasets.CIFAR10', 'datasets.CIFAR10', (['"""./data"""'], {'train': '(True)', 'download': '(True)', 'transform': 'train_transform'}), "('./data', train=True, download=True, transform=train_transform\n )\n", (1281, 1350), False, 'from torchvision import datasets, transforms\n'), ((1369, 1...
import datetime import logging import tushare as ts import numpy as np import pandas as pd import matplotlib.pyplot as plt from tensorflow import keras import tensorflow as tf from ts.build_model import BuildModel from ts.db_utils import get_daily_by_trade_date from ts.simulation_history import SimulationHistory fro...
[ "logging.debug", "tensorflow.keras.models.load_model", "tensorflow.train.RMSPropOptimizer", "datetime.datetime.strptime", "ts.st_history_data.x_train_col_index", "numpy.array" ]
[((532, 588), 'logging.debug', 'logging.debug', (['"""index: %s, date: %s"""', 'index', "row['date']"], {}), "('index: %s, date: %s', index, row['date'])\n", (545, 588), False, 'import logging\n'), ((605, 665), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (["row['date']", '"""%Y-%m-%d %H:%M:%S"""'], {}),...
import numpy as np from tensorflow.keras.models import load_model from buffer import ( ReplayBuffer, build ) class DQNAgent: def __init__(self, alpha, gamma, n_actions, epsilon, batch_size, input_dims, fc1_dims, fc2_dims, epsilon_dec=0.996, epsilon_end=0.01,...
[ "tensorflow.keras.models.load_model", "numpy.argmax", "buffer.build", "numpy.max", "numpy.random.random", "numpy.array", "numpy.arange", "numpy.random.choice", "numpy.dot", "buffer.ReplayBuffer" ]
[((717, 777), 'buffer.ReplayBuffer', 'ReplayBuffer', (['mem_size', 'input_dims', 'n_actions'], {'discrete': '(True)'}), '(mem_size, input_dims, n_actions, discrete=True)\n', (729, 777), False, 'from buffer import ReplayBuffer, build\n'), ((809, 864), 'buffer.build', 'build', (['alpha', 'n_actions', 'input_dims', 'fc1_d...
'''H5 data prep''' ## External modules. import csv import numpy as np import os import tables ## Internal modules. from mml.config import dir_data_toread from mml.config import dir_data_towrite from mml.utils import makedir_safe ############################################################################### ## Cl...
[ "csv.reader", "numpy.zeros", "tables.Float32Atom", "numpy.vstack", "mml.utils.makedir_safe", "numpy.array", "tables.UInt8Atom", "tables.open_file", "os.path.join", "numpy.concatenate" ]
[((368, 422), 'os.path.join', 'os.path.join', (['dir_data_toread', 'data_name', '"""adult.data"""'], {}), "(dir_data_toread, data_name, 'adult.data')\n", (380, 422), False, 'import os\n'), ((435, 489), 'os.path.join', 'os.path.join', (['dir_data_toread', 'data_name', '"""adult.test"""'], {}), "(dir_data_toread, data_na...
import numpy as np import random as rd import tensorflow as tf from tensorflow import keras class Brain(): def __init__(self,brain_spec, random = True, weights = None): self.brain_spec = brain_spec ##INIT #This is a new brai, self.neurones = keras.Sequential() for i in ...
[ "tensorflow.keras.layers.Dense", "random.uniform", "numpy.expand_dims", "numpy.random.randint", "numpy.array", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.Sequential" ]
[((284, 302), 'tensorflow.keras.Sequential', 'keras.Sequential', ([], {}), '()\n', (300, 302), False, 'from tensorflow import keras\n'), ((941, 982), 'tensorflow.keras.optimizers.Adam', 'keras.optimizers.Adam', ([], {'learning_rate': '(0.01)'}), '(learning_rate=0.01)\n', (962, 982), False, 'from tensorflow import keras...
import time from abc import abstractmethod from typing import List from alfi.models import LFM import torch import numpy as np import gpytorch from torch.utils.data.dataloader import DataLoader from alfi.utilities.torch import is_cuda from alfi.datasets import LFMDataset class Trainer: """ An abstract LFM t...
[ "numpy.concatenate", "numpy.empty", "time.time", "torch.utils.data.dataloader.DataLoader", "torch.tensor" ]
[((1499, 1556), 'torch.utils.data.dataloader.DataLoader', 'DataLoader', (['dataset'], {'batch_size': 'batch_size', 'shuffle': '(False)'}), '(dataset, batch_size=batch_size, shuffle=False)\n', (1509, 1556), False, 'from torch.utils.data.dataloader import DataLoader\n'), ((3636, 3681), 'numpy.concatenate', 'np.concatenat...
import os import torch import pickle import numpy as np from lib import inteutil from lib import posematcher from lib.models import networkinte from tqdm import tqdm from TorchSUL import Model as M from collections import defaultdict if __name__=='__main__': ## step 1: match the poses print('Matching poses ...
[ "numpy.stack", "tqdm.tqdm", "torch.from_numpy", "os.makedirs", "lib.models.networkinte.IntegrationNet", "os.path.exists", "lib.posematcher.PoseMatcher", "collections.defaultdict", "TorchSUL.Model.Saver", "torch.zeros", "torch.no_grad", "lib.inteutil.InteDataset" ]
[((354, 473), 'lib.posematcher.PoseMatcher', 'posematcher.PoseMatcher', ([], {'top_down_path': '"""./mupots/pred/"""', 'btm_up_path': '"""./mupots/MUPOTS_Preds_btmup_transformed.pkl"""'}), "(top_down_path='./mupots/pred/', btm_up_path=\n './mupots/MUPOTS_Preds_btmup_transformed.pkl')\n", (377, 473), False, 'from lib...
import numpy as np from PIL import Image from src.data.rand_augment import RandAugmentMC import torchvision.transforms as transforms def pad(x, border=4): return np.pad(x, [(0, 0), (border, border), (border, border)], mode='reflect') class RandomPadandCrop(object): """Crop randomly the image. Args: ...
[ "numpy.pad", "torchvision.transforms.RandomHorizontalFlip", "torchvision.transforms.Normalize", "numpy.transpose", "torchvision.transforms.RandomResizedCrop", "numpy.random.randint", "torchvision.transforms.Compose", "torchvision.transforms.CenterCrop", "torchvision.transforms.Resize", "src.data.r...
[((168, 239), 'numpy.pad', 'np.pad', (['x', '[(0, 0), (border, border), (border, border)]'], {'mode': '"""reflect"""'}), "(x, [(0, 0), (border, border), (border, border)], mode='reflect')\n", (174, 239), True, 'import numpy as np\n'), ((3549, 3579), 'torchvision.transforms.Compose', 'transforms.Compose', (['transform_'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Dec 13 14:13:10 2018 @author: antony """ import numpy as np import pandas as pd import sys import matplotlib from matplotlib.colors import Normalize import matplotlib.pyplot as plt import matplotlib.transforms as transforms import libplot import matplo...
[ "numpy.abs", "numpy.sum", "numpy.ones", "numpy.argsort", "numpy.mean", "libplot.setup", "numpy.cumsum", "numpy.max", "matplotlib.transforms.blended_transform_factory", "libplot.new_base_fig", "numpy.sort", "libplot.invisible_axes", "numpy.min", "numpy.random.permutation", "numpy.concaten...
[((643, 695), 'numpy.concatenate', 'np.concatenate', (['(ranked_gene_list, ranked_gene_list)'], {}), '((ranked_gene_list, ranked_gene_list))\n', (657, 695), True, 'import numpy as np\n'), ((710, 763), 'numpy.concatenate', 'np.concatenate', (['(ranked_score, -ranked_score)'], {'axis': '(0)'}), '((ranked_score, -ranked_s...
from torchvision import transforms from torch.utils.data import DataLoader from torch.utils.data.sampler import BatchSampler import numpy as np import torch import os from elbo_functions import deviance_upper_bound, elbo, KL_closed, minibatch_KLD_upper_bound, minibatch_KLD_upper_bound_iter from model_test import MSE_...
[ "elbo_functions.minibatch_KLD_upper_bound_iter", "torch.eye", "torch.autograd.grad", "numpy.empty", "torch.cat", "model_test.MSE_test_GPapprox", "predict_HealthMNIST.variational_complete_gen", "torch.device", "torch.no_grad", "os.path.join", "predict_HealthMNIST.recon_complete_gen", "torch.uti...
[((3853, 3869), 'numpy.empty', 'np.empty', (['(0, 1)'], {}), '((0, 1))\n', (3861, 3869), True, 'import numpy as np\n'), ((3891, 3907), 'numpy.empty', 'np.empty', (['(0, 1)'], {}), '((0, 1))\n', (3899, 3907), True, 'import numpy as np\n'), ((3927, 3943), 'numpy.empty', 'np.empty', (['(0, 1)'], {}), '((0, 1))\n', (3935, ...
""" WebObs class """ from astropy.table import Table from astropy import units as u from astropy.coordinates import SkyCoord import numpy as np import matplotlib.pyplot as plt from bs4 import BeautifulSoup import os import io import wget import requests class WebObs(object): """ Class for AAVSO web observati...
[ "matplotlib.pyplot.title", "os.remove", "astropy.table.Table", "matplotlib.pyplot.show", "numpy.polyfit", "matplotlib.pyplot.gca", "matplotlib.pyplot.scatter", "os.path.exists", "matplotlib.pyplot.vlines", "wget.download", "requests.get", "numpy.linspace", "bs4.BeautifulSoup", "matplotlib....
[((647, 654), 'astropy.table.Table', 'Table', ([], {}), '()\n', (652, 654), False, 'from astropy.table import Table\n'), ((675, 690), 'bs4.BeautifulSoup', 'BeautifulSoup', ([], {}), '()\n', (688, 690), False, 'from bs4 import BeautifulSoup\n'), ((1024, 1055), 'os.path.exists', 'os.path.exists', (['self.fileoutput'], {}...
import sys sys.path.append('../core') import argparse import torch import cv2 import numpy as np from viz import sim3_visualization from lietorch import SO3, SE3, Sim3 from networks.sim3_net import Sim3Net def normalize_images(images): images = images[:, :, [2,1,0]] mean = torch.as_tensor([0.485, 0.456, 0.40...
[ "sys.path.append", "numpy.stack", "numpy.load", "argparse.ArgumentParser", "lietorch.SE3.Identity", "lietorch.Sim3.Identity", "torch.load", "viz.sim3_visualization", "cv2.imread", "networks.sim3_net.Sim3Net", "numpy.array", "numpy.tile", "torch.rand", "torch.as_tensor", "torch.no_grad", ...
[((11, 37), 'sys.path.append', 'sys.path.append', (['"""../core"""'], {}), "('../core')\n", (26, 37), False, 'import sys\n'), ((1469, 1484), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1482, 1484), False, 'import torch\n'), ((285, 345), 'torch.as_tensor', 'torch.as_tensor', (['[0.485, 0.456, 0.406]'], {'device...
import numpy as np import matplotlib.cm as cm import matplotlib.pylab as plt def generate_colors(count): cm = plt.get_cmap('gist_rainbow') return np.array([cm(1. * i / count) for i in range(count)]).astype(float) def get_q_color(id, ant_num): from PyQt4 import QtGui r, g, b = get_color(id, ant_num) ...
[ "PyQt4.QtGui.QColor", "matplotlib.cm", "numpy.linspace", "matplotlib.pylab.get_cmap" ]
[((116, 144), 'matplotlib.pylab.get_cmap', 'plt.get_cmap', (['"""gist_rainbow"""'], {}), "('gist_rainbow')\n", (128, 144), True, 'import matplotlib.pylab as plt\n'), ((331, 352), 'PyQt4.QtGui.QColor', 'QtGui.QColor', (['r', 'g', 'b'], {}), '(r, g, b)\n', (343, 352), False, 'from PyQt4 import QtGui\n'), ((407, 433), 'nu...
import numpy as np from SOM import SOM data = np.loadtxt('Data/output.txt', delimiter=';', usecols=range(40)) ###SOM som = SOM(10, 10) # initialize the SOM som.fit(data, 10000, decay='hill') # som = SOM(10, 10) # initialize the SOM # som.load('Data/SOM') targets = np.loadtxt('Data/target.txt', dtype='int') targ...
[ "SOM.SOM", "numpy.loadtxt" ]
[((126, 137), 'SOM.SOM', 'SOM', (['(10)', '(10)'], {}), '(10, 10)\n', (129, 137), False, 'from SOM import SOM\n'), ((272, 314), 'numpy.loadtxt', 'np.loadtxt', (['"""Data/target.txt"""'], {'dtype': '"""int"""'}), "('Data/target.txt', dtype='int')\n", (282, 314), True, 'import numpy as np\n')]
from .tractography import Tractography from .trackvis import tractography_from_trackvis_file, tractography_to_trackvis_file from warnings import warn import numpy __all__ = [ 'Tractography', 'tractography_from_trackvis_file', 'tractography_to_trackvis_file', 'tractography_from_files', 'tractography_fr...
[ "warnings.warn", "numpy.ones", "numpy.eye" ]
[((688, 798), 'warnings.warn', 'warn', (['"""VTK support not installed in this python distribution, VTK files will not be read or written"""'], {}), "(\n 'VTK support not installed in this python distribution, VTK files will not be read or written'\n )\n", (692, 798), False, 'from warnings import warn\n'), ((1992...
# encoding: utf-8 __author__ = "<NAME>" # Taken and adapted from: https://github.com/wdika/NeMo/blob/main/tests/core/test_optimizers_schedulers.py import math import os import random import shutil from abc import ABC import numpy as np import omegaconf import pytest import pytorch_lightning as pl import torch import...
[ "pytorch_lightning.Trainer", "mridc.core.optim.lr_scheduler.register_scheduler", "torch.randn", "mridc.core.optim.optimizers.register_optimizer", "mridc.core.optim.lr_scheduler.WarmupHoldPolicy", "pytest.mark.run_only_on", "mridc.core.optim.lr_scheduler.WarmupPolicy", "mridc.core.optim.lr_scheduler.Sq...
[((32233, 32263), 'pytest.mark.run_only_on', 'pytest.mark.run_only_on', (['"""CPU"""'], {}), "('CPU')\n", (32256, 32263), False, 'import pytest\n'), ((35520, 35550), 'pytest.mark.run_only_on', 'pytest.mark.run_only_on', (['"""CPU"""'], {}), "('CPU')\n", (35543, 35550), False, 'import pytest\n'), ((977, 998), 'torch.nn....
#!/usr/bin/env python3 # Author: <NAME> # INFO521 Homeword 3 Problem 6 import numpy as np import matplotlib.pyplot as plt # -------------------------------------------------- def true_function(x): """$t = 5x+x^2-0.5x^3$""" return (5 * x) + x**2 - (0.5 * x**3) # --------------------------------------------...
[ "numpy.random.uniform", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.random.randn", "numpy.power", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.linspace", "numpy.dot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.pause", "matplotlib.pyplot.sav...
[((571, 603), 'numpy.random.uniform', 'np.random.uniform', (['xmin', 'xmax', 'N'], {}), '(xmin, xmax, N)\n', (588, 603), True, 'import numpy as np\n'), ((1166, 1192), 'numpy.linspace', 'np.linspace', (['xmin', 'xmax', 'N'], {}), '(xmin, xmax, N)\n', (1177, 1192), True, 'import numpy as np\n'), ((1258, 1271), 'matplotli...
import os import glob import numpy as np from datetime import datetime from scipy.io import loadmat from PIL import Image np.random.seed(42) def calc_age(taken, dob): birth = datetime.fromordinal(max(int(dob) - 366, 1)) # assume the photo was taken in the middle of the year if birth.month < 7: ...
[ "numpy.random.seed", "os.path.basename", "scipy.io.loadmat", "numpy.asarray", "numpy.isnan", "os.path.join", "numpy.random.shuffle" ]
[((124, 142), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (138, 142), True, 'import numpy as np\n'), ((435, 452), 'scipy.io.loadmat', 'loadmat', (['mat_path'], {}), '(mat_path)\n', (442, 452), False, 'from scipy.io import loadmat\n'), ((2190, 2216), 'numpy.random.shuffle', 'np.random.shuffle', (['i...
import numpy as np from fym.core import BaseEnv, BaseSystem from fym.utils import rot def hat(v): v1, v2, v3 = v.squeeze() return np.array([ [0, -v3, v2], [v3, 0, -v1], [-v2, v1, 0] ]) class Quadrotor(BaseEnv): """ Prof. <NAME>'s model for quadrotor UAV is used. - ht...
[ "numpy.eye", "fym.core.BaseSystem", "numpy.ravel", "numpy.zeros", "fym.utils.rot.dcm2angle", "numpy.array", "numpy.linalg.inv", "numpy.diag", "numpy.linalg.pinv", "numpy.vstack" ]
[((141, 193), 'numpy.array', 'np.array', (['[[0, -v3, v2], [v3, 0, -v1], [-v2, v1, 0]]'], {}), '([[0, -v3, v2], [v3, 0, -v1], [-v2, v1, 0]])\n', (149, 193), True, 'import numpy as np\n'), ((897, 917), 'numpy.vstack', 'np.vstack', (['(0, 0, 1)'], {}), '((0, 0, 1))\n', (906, 917), True, 'import numpy as np\n'), ((926, 95...
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import math import numpy as np import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data from torch.utils.data import DataLoader import torchvision.transforms as transfor...
[ "numpy.mean", "torch.no_grad", "data_load_mix.get_dataset_deform", "torch.utils.data.DataLoader", "os.path.exists", "torch.optim.lr_scheduler.CosineAnnealingLR", "math.log10", "skimage.measure.compare_ssim", "utils.count_parameters_in_MB", "csv.writer", "torch.manual_seed", "torch.autograd.Var...
[((2975, 2998), 'torch.manual_seed', 'torch.manual_seed', (['(2018)'], {}), '(2018)\n', (2992, 2998), False, 'import torch\n'), ((3007, 3035), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['(2018)'], {}), '(2018)\n', (3029, 3035), False, 'import torch\n'), ((3144, 3155), 'torch.nn.L1Loss', 'nn.L1Loss', ([], {})...
""" Script goal, Open land cover data and build a simple cover map """ #============================================================================== __title__ = "LandCover" __author__ = "<NAME>" __version__ = "v1.0(12.03.2021)" __email__ = "<EMAIL>" #=================================================...
[ "pandas.Timestamp", "matplotlib.pyplot.show", "scipy.stats.mode", "os.getcwd", "pandas.read_csv", "xarray.open_rasterio", "cartopy.feature.GSHHSFeature", "cartopy.crs.PlateCarree", "xarray.open_dataset", "dask.diagnostics.ProgressBar", "xarray.Dataset", "os.path.isfile", "numpy.mean", "pan...
[((705, 716), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (714, 716), False, 'import os\n'), ((9710, 9757), 'scipy.stats.mode', 'sp.stats.mode', (['da'], {'axis': 'None', 'nan_policy': '"""omit"""'}), "(da, axis=None, nan_policy='omit')\n", (9723, 9757), True, 'import scipy as sp\n'), ((9855, 9876), 'numpy.mean', 'np.m...
import torch import matplotlib as mpl mpl.use('agg') import numpy as np import os import scipy.integrate as integrate import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib.lines import Line2D from matplotlib import rc def plotPred(args, t, xT, uPred, uTarget, epoch, bidx=0): ''' Plots a s...
[ "torch.mean", "matplotlib.rc", "numpy.abs", "matplotlib.pyplot.close", "matplotlib.pyplot.subplot2grid", "numpy.insert", "numpy.max", "matplotlib.use", "matplotlib.pyplot.figure", "numpy.min", "numpy.linspace", "torch.pow", "matplotlib.colorbar.ColorbarBase", "matplotlib.pyplot.savefig", ...
[((38, 52), 'matplotlib.use', 'mpl.use', (['"""agg"""'], {}), "('agg')\n", (45, 52), True, 'import matplotlib as mpl\n'), ((357, 373), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (366, 373), True, 'import matplotlib.pyplot as plt\n'), ((467, 491), 'matplotlib.rc', 'rc', (['"""text"""'], {'...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from builtins import range import utils import argparse import time import os import sys import random import math import json import codecs import numpy as np import utils from util...
[ "json.dump", "numpy.save", "argparse.ArgumentParser", "utils.build_lang", "codecs.open", "random.shuffle", "random.seed", "sys.exit" ]
[((376, 435), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Dialog2Vec Generator"""'}), "(description='Dialog2Vec Generator')\n", (399, 435), False, 'import argparse\n'), ((878, 900), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (889, 900), False, 'import random\n...
import more_itertools as mit import functools as ftl from recipes.testing import Expect from astropy.io.fits.hdu.base import _BaseHDU from pathlib import Path from pySHOC import shocCampaign, shocHDU, shocNewHDU, shocBiasHDU, shocFlatHDU import pytest import numpy as np import os import tempfile as tmp # TODO: old + n...
[ "numpy.random.seed", "recipes.testing.Expect", "tempfile.mkstemp", "astropy.io.fits.hdu.base._BaseHDU.readfrom", "pathlib.Path", "numpy.random.randint", "os.close", "numpy.arange", "pytest.mark.parametrize", "pySHOC.shocCampaign.load" ]
[((648, 669), 'numpy.random.seed', 'np.random.seed', (['(12345)'], {}), '(12345)\n', (662, 669), True, 'import numpy as np\n'), ((854, 873), 'tempfile.mkstemp', 'tmp.mkstemp', (['""".txt"""'], {}), "('.txt')\n", (865, 873), True, 'import tempfile as tmp\n'), ((967, 979), 'os.close', 'os.close', (['fp'], {}), '(fp)\n', ...
import numpy as np import open3d as o3d import os from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("--red", type = float, default = 0.5) parser.add_argument("--blue", type = float, default = 0.4) parser.add_argument("--green", type = float, default = 0.4) parser.add_argument("--source_...
[ "argparse.ArgumentParser", "numpy.asarray", "open3d.geometry.PointCloud", "open3d.io.read_point_cloud", "open3d.io.write_point_cloud", "open3d.visualization.draw_geometries", "numpy.array", "open3d.utility.Vector3dVector", "os.listdir" ]
[((96, 112), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (110, 112), False, 'from argparse import ArgumentParser\n'), ((1053, 1111), 'os.listdir', 'os.listdir', (['f"""./pointcloud_transformed/{args.source_dir}/"""'], {}), "(f'./pointcloud_transformed/{args.source_dir}/')\n", (1063, 1111), False, 'im...
# Initial setup following http://docs.chainer.org/en/stable/tutorial/basic.html import numpy as np import chainer from chainer import cuda, Function, gradient_check, report, training, utils, Variable from chainer import datasets, iterators, optimizers, serializers from chainer import Link, Chain, ChainList import chain...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "chainer.serializers.load_npz", "matplotlib.pyplot.clf", "matplotlib.pyplot.scatter", "matplotlib.pyplot.legend", "numpy.frompyfunc", "numpy.arange", "chainer.functions.sigmoid", "numpy.random.rand", "chainer.links.Linear" ]
[((976, 1020), 'chainer.serializers.load_npz', 'serializers.load_npz', (['model_save_path', 'model'], {}), '(model_save_path, model)\n', (996, 1020), False, 'from chainer import datasets, iterators, optimizers, serializers\n'), ((1366, 1398), 'numpy.frompyfunc', 'np.frompyfunc', (['target_func', '(1)', '(1)'], {}), '(t...
import nibabel as nib import glob import os import numpy as np import tensorlayer as tl ''' Before normalization, run N4 bias correction (https://www.ncbi.nlm.nih.gov/pubmed/20378467), then save the data under folder ./CamCAN_unbiased/CamCAN ''' modalities = ['T1w', 'T2w'] BraTS_modalities = ['T1w'] folders = ['HGG'...
[ "numpy.pad", "nibabel.load", "numpy.std", "numpy.transpose", "numpy.rot90", "numpy.mean", "glob.glob", "numpy.eye", "os.chdir" ]
[((468, 484), 'os.chdir', 'os.chdir', (['wd_mod'], {}), '(wd_mod)\n', (476, 484), False, 'import os\n'), ((614, 627), 'nibabel.load', 'nib.load', (['img'], {}), '(img)\n', (622, 627), True, 'import nibabel as nib\n'), ((797, 830), 'numpy.transpose', 'np.transpose', (['img_data', '[2, 0, 1]'], {}), '(img_data, [2, 0, 1]...
import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np from pylab import cm mpl.rcParams['font.family'] = 'STIXGeneral' plt.rcParams['xtick.labelsize'] = 16 plt.rcParams['ytick.labelsize'] = 16 plt.rcParams['font.size'] = 16 plt.rcParams['figure.figsize'] = [5.6, 4] plt.rcParams['axes.titlesize'] ...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.figure", "numpy.loadtxt", "pylab.cm.get_cmap", "matplotlib.pyplot.tight_layout" ]
[((558, 580), 'pylab.cm.get_cmap', 'cm.get_cmap', (['"""Set1"""', '(9)'], {}), "('Set1', 9)\n", (569, 580), False, 'from pylab import cm\n'), ((588, 600), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (598, 600), True, 'import matplotlib.pyplot as plt\n'), ((1086, 1120), 'numpy.loadtxt', 'np.loadtxt', (['...
# -*- coding: utf-8 -*- # # JSON osu! map analysis # import numpy as np; def get_map_timing_array(map_json, length=-1, divisor=4): if length == -1: length = map_json["obj"][-1]["time"] + 1000; # it has an extra time interval after the last note if map_json["obj"][-1]["type"] & 8: # spinner end ...
[ "numpy.min", "numpy.array", "numpy.arange", "numpy.concatenate" ]
[((4069, 4101), 'numpy.array', 'np.array', (["[note['x'], note['y']]"], {}), "([note['x'], note['y']])\n", (4077, 4101), True, 'import numpy as np\n'), ((4621, 4663), 'numpy.array', 'np.array', (["[prev_note['x'], prev_note['y']]"], {}), "([prev_note['x'], prev_note['y']])\n", (4629, 4663), True, 'import numpy as np\n'...
### IMPORTS from __future__ import print_function import os import fnmatch import numpy as np import skimage.data import cv2 import sys import matplotlib.pyplot as plt import matplotlib.patches as mpatches from PIL import Image from keras import applications from keras.preprocessing.image import ImageDataGenerator fr...
[ "keras.preprocessing.image.ImageDataGenerator", "PIL.Image.new", "os.walk", "keras.applications.VGG16", "keras.layers.Input", "os.path.join", "keras.optimizers.SGD", "os.path.exists", "keras.layers.Flatten", "os.listdir", "selective_search.selective_search_bbox", "fnmatch.filter", "logging.d...
[((647, 702), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': 'FORMAT'}), '(level=logging.DEBUG, format=FORMAT)\n', (666, 702), False, 'import logging\n'), ((948, 983), 'os.path.join', 'os.path.join', (['dataset_path', '"""train"""'], {}), "(dataset_path, 'train')\n", (960, 983),...
# Copyright 2020 Graphcore Ltd. import argparse import os import time as time import numpy as np import tensorflow as tf from tensorflow.python.ipu import ipu_compiler, ipu_infeed_queue, loops, utils from tensorflow.python.ipu.scopes import ipu_scope, ipu_shard import tensorflow_probability as tfp # ...
[ "argparse.ArgumentParser", "tensorflow.reset_default_graph", "tensorflow.reshape", "tensorflow.get_variable_scope", "tensorflow.ConfigProto", "tensorflow_probability.mcmc.sample_chain", "os.path.join", "numpy.savetxt", "numpy.genfromtxt", "tensorflow.variable_scope", "tensorflow.python.ipu.ipu_c...
[((645, 670), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (668, 670), False, 'import argparse\n'), ((824, 891), 'os.path.join', 'os.path.join', (['args.dataset_dir', '"""returns_and_features_for_mcmc.txt"""'], {}), "(args.dataset_dir, 'returns_and_features_for_mcmc.txt')\n", (836, 891), Fals...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID' # os.environ['CUDA_VISIBLE_DEVICES'] = '0' import json import time import argparse from pathlib import Path import random import numpy as np import tensorflow as tf tf.autograph.set_verbosity(3) # 0: deb...
[ "tensorflow.random.set_seed", "json.dump", "numpy.random.seed", "argparse.ArgumentParser", "src.models.RACL.RACL", "src.utils.dict2html", "time.time", "pathlib.Path", "src.utils.split_documents", "random.seed", "src.models.encoder.Encoder", "numpy.reshape", "src.utils.reverse_unk", "src.ut...
[((282, 311), 'tensorflow.autograph.set_verbosity', 'tf.autograph.set_verbosity', (['(3)'], {}), '(3)\n', (308, 311), True, 'import tensorflow as tf\n'), ((1851, 1879), 'random.seed', 'random.seed', (['opt.random_seed'], {}), '(opt.random_seed)\n', (1862, 1879), False, 'import random\n'), ((1885, 1916), 'numpy.random.s...
# -*- coding: utf-8 -*- """ Created on Tue Sep 29 17:41:44 2020 @author: salman """ from PIL import Image import pandas as pd import numpy as np import cv2 import os d={} data = pd.read_csv('E:\\fyp data\\ADEK-20\\new_se_new\\new.txt', sep="\t") arr=np.zeros(151) print(arr) for point in data.values: (key,name,...
[ "pandas.read_csv", "cv2.imwrite", "numpy.zeros", "cv2.imread", "numpy.unique" ]
[((182, 249), 'pandas.read_csv', 'pd.read_csv', (['"""E:\\\\fyp data\\\\ADEK-20\\\\new_se_new\\\\new.txt"""'], {'sep': '"""\t"""'}), "('E:\\\\fyp data\\\\ADEK-20\\\\new_se_new\\\\new.txt', sep='\\t')\n", (193, 249), True, 'import pandas as pd\n'), ((255, 268), 'numpy.zeros', 'np.zeros', (['(151)'], {}), '(151)\n', (263...
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor, GradientBoostingClassifier from sklearn.metrics import mean_absolute_error, accuracy_score, roc_curve, roc_auc_score from src.utils import calc_annual_return_vec, ...
[ "matplotlib.pyplot.title", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.bar", "sklearn.metrics.mean_absolute_error", "numpy.argsort", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "os.path.join", "numpy.round", "pandas.DataFrame", "numpy.std", "matplotlib.pyplot.xticks"...
[((696, 723), 'numpy.array', 'np.array', (["train['good_bad']"], {}), "(train['good_bad'])\n", (704, 723), True, 'import numpy as np\n'), ((790, 816), 'numpy.array', 'np.array', (["test['good_bad']"], {}), "(test['good_bad'])\n", (798, 816), True, 'import numpy as np\n'), ((1294, 1322), 'sklearn.ensemble.GradientBoosti...
import numpy as np import torch import torch.nn as nn def soft_update(target: nn.Module, source: nn.Module, tau): with torch.no_grad(): for target_param, param in zip(target.parameters(), source.parameters()): target_param.data.copy_(target_param.data * (1.0 - tau) + param.data * tau) def ha...
[ "tensorflow.nest.map_structure", "torch.no_grad", "numpy.ndim" ]
[((1652, 1715), 'tensorflow.nest.map_structure', 'tf.nest.map_structure', (['_to_single_numpy_or_python_type', 'tensors'], {}), '(_to_single_numpy_or_python_type, tensors)\n', (1673, 1715), True, 'import tensorflow as tf\n'), ((125, 140), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (138, 140), False, 'import to...
"""Submodule containing frequency-based models.""" from freqtools.freq_data import OscillatorNoise import numpy as np import matplotlib.pyplot as plt class FreqModel: """ Base class for frequency based models, i.e. values (y axis) as a function of frequency (x axis). Its functionality is purposfully kept...
[ "numpy.trapz", "numpy.log", "numpy.logical_and", "matplotlib.pyplot.subplots", "numpy.array", "numpy.sign", "numpy.log10", "matplotlib.pyplot.grid", "numpy.sqrt" ]
[((1841, 1877), 'matplotlib.pyplot.grid', 'plt.grid', (['(True)'], {'which': '"""both"""', 'ls': '"""-"""'}), "(True, which='both', ls='-')\n", (1849, 1877), True, 'import matplotlib.pyplot as plt\n'), ((21402, 21439), 'numpy.trapz', 'np.trapz', (['psd_vals_over_line'], {'x': 'freqs'}), '(psd_vals_over_line, x=freqs)\n...
"""Code for setting up the optimization problem for certification.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os import numpy as np from scipy.sparse.linalg import eigs, LinearOperator import tensorflow as tf from tensorflow.contr...
[ "tensorflow.cond", "tensorflow.reduce_sum", "numpy.abs", "tensorflow.logging.info", "tensorflow.logging.debug", "tensorflow.maximum", "tensorflow.reshape", "json.dumps", "tensorflow.multiply", "tensorflow.argmin", "tensorflow.Variable", "tensorflow.divide", "scipy.sparse.linalg.LinearOperato...
[((1580, 1616), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[]'}), '(tf.float32, shape=[])\n', (1594, 1616), True, 'import tensorflow as tf\n'), ((1808, 1882), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[1 + self.dual_object.dual_index[-1], 1]'}), '(tf.float32, s...
"""Test NMS. Run the examples described in `ONNX docs`_. .. _ONNX docs: https://github.com/onnx/onnx/blob/main/docs/Operators.md#NonMaxSuppression """ # import pytest import numpy as np import box_utils._c.box_nms as box_nms def test_nms_suppress_by_iou(): """Test NMS - suppress by IoU.""" # -- boxes =...
[ "box_utils._c.box_nms.ltrb_nms", "numpy.testing.assert_array_equal", "box_utils._c.box_nms.xywh_nms", "numpy.array" ]
[((928, 1032), 'box_utils._c.box_nms.ltrb_nms', 'box_nms.ltrb_nms', (['boxes', 'scores', 'score_threshold[0]', 'iou_threshold[0]', 'max_output_boxes_per_class[0]'], {}), '(boxes, scores, score_threshold[0], iou_threshold[0],\n max_output_boxes_per_class[0])\n', (944, 1032), True, 'import box_utils._c.box_nms as box_...
# ------------------------------------------------------------------ # PyTorch implementation of # "ROAM: Recurrently Optimizing Tracking Model", CVPR, 2020 # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------ imp...
[ "numpy.random.seed", "numpy.floor", "utils.get_search_patch", "numpy.random.randint", "numpy.arange", "torchvision.transforms.Normalize", "os.path.join", "numpy.round", "cv2.resize", "numpy.ceil", "utils.get_search_size", "utils.gaussian_shaped_labels", "utils.default_loader", "numpy.conca...
[((1309, 1330), 'numpy.array', 'np.array', (['config.mean'], {}), '(config.mean)\n', (1317, 1330), True, 'import numpy as np\n'), ((1357, 1413), 'numpy.array', 'np.array', (['[config.base_target_sz, config.base_target_sz]'], {}), '([config.base_target_sz, config.base_target_sz])\n', (1365, 1413), True, 'import numpy as...
"""Creates a custom kinematics body with two links and one joint """ from openravepy import * from numpy import eye, array, zeros env = Environment() # create openrave environment env.SetViewer('qtcoin') # attach viewer (optional) with env: robot=RaveCreateRobot(env,'') robot.SetName('camera') linkinfo=Ki...
[ "numpy.zeros", "numpy.eye", "numpy.array" ]
[((533, 539), 'numpy.eye', 'eye', (['(4)'], {}), '(4)\n', (536, 539), False, 'from numpy import eye, array, zeros\n'), ((780, 786), 'numpy.eye', 'eye', (['(4)'], {}), '(4)\n', (783, 786), False, 'from numpy import eye, array, zeros\n'), ((1020, 1070), 'numpy.array', 'array', (['[[640.0, 0, 320], [0, 640, 240], [0, 0, 1...
# main imports import numpy as np import pandas as pd import json import os, sys, argparse, subprocess # model imports from keras.models import model_from_json from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler from joblib import dump, load # image processing imports f...
[ "ipfml.metrics.coefficient_of_determination", "json.load", "argparse.ArgumentParser", "os.makedirs", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.MinMaxScaler", "os.path.exists", "sys.path.insert", "PIL.Image.open", "keras.models.model_from_json", "numpy.loadtxt", "numpy....
[((423, 445), 'sys.path.insert', 'sys.path.insert', (['(0)', '""""""'], {}), "(0, '')\n", (438, 445), False, 'import os, sys, argparse, subprocess\n'), ((779, 816), 'numpy.loadtxt', 'np.loadtxt', (['_data_file'], {'delimiter': '""";"""'}), "(_data_file, delimiter=';')\n", (789, 816), True, 'import numpy as np\n'), ((86...
# -*- coding: utf-8 -*- import tensorflow as tf from nlp.chatbot.dataset import data_utils from nltk.translate.bleu_score import sentence_bleu from tqdm import tqdm import os,sys import numpy as np from nlp.chatbot import model as s2s_model def test_bleu(count, args): print('准备数据') bucket_dbs = data_utils.re...
[ "nlp.chatbot.model.create_model", "sys.stdout.write", "numpy.random.random_sample", "numpy.argmax", "tensorflow.Session", "nlp.chatbot.dataset.data_utils.indice_sentence", "nlp.chatbot.dataset.data_utils.read_bucket_dbs", "sys.stdout.flush", "tensorflow.initialize_all_variables", "os.path.join", ...
[((307, 351), 'nlp.chatbot.dataset.data_utils.read_bucket_dbs', 'data_utils.read_bucket_dbs', (['args.buckets_dir'], {}), '(args.buckets_dir)\n', (333, 351), False, 'from nlp.chatbot.dataset import data_utils\n'), ((833, 845), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (843, 845), True, 'import tensorflow as...
import numpy as np import pyaudio from pyaudio import PyAudio from queue import Queue import struct from time import sleep def get_steinberg_device_idx(pa: PyAudio) -> int: """ looks up the steinberg device index """ for i in range(pa.get_device_count()): name = pa.get_device_info_by_index(i)...
[ "struct.Struct", "time.sleep", "numpy.array", "pyaudio.PyAudio", "queue.Queue" ]
[((2126, 2134), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (2131, 2134), False, 'from time import sleep\n'), ((859, 868), 'pyaudio.PyAudio', 'PyAudio', ([], {}), '()\n', (866, 868), False, 'from pyaudio import PyAudio\n'), ((896, 903), 'queue.Queue', 'Queue', ([], {}), '()\n', (901, 903), False, 'from queue import ...
import tensorflow as tf from nets.network import Network import numpy as np # !! The default data format used here is NHWC !! # TODO: scope def conv_bn(X, inChannel, outChannel, kernel, istrain, stride=1, name=None): out = tf.layers.conv2d(X, outChannel, kernel, stride, 'same', use_bias=False, name=name) out =...
[ "numpy.load", "tensorflow.nn.relu", "tensorflow.get_collection", "tensorflow.layers.dense", "tensorflow.layers.flatten", "tensorflow.layers.average_pooling2d", "tensorflow.layers.conv2d", "tensorflow.layers.max_pooling2d" ]
[((228, 314), 'tensorflow.layers.conv2d', 'tf.layers.conv2d', (['X', 'outChannel', 'kernel', 'stride', '"""same"""'], {'use_bias': '(False)', 'name': 'name'}), "(X, outChannel, kernel, stride, 'same', use_bias=False,\n name=name)\n", (244, 314), True, 'import tensorflow as tf\n'), ((661, 676), 'tensorflow.nn.relu', ...
# -*- coding: utf-8 -*- # This is the part of the codes used for the article entitled "A Deep Learning # Approach for Assessment of Regional Wall Motion Abnormality from # Echocardiographic Images" for JACC CV imaging. # # Before using this code, please prepare image data at "./data_folder" dir. # # ./data_folder/trai...
[ "keras.applications.xception.Xception", "keras.applications.inception_resnet_v2.InceptionResNetV2", "keras.layers.Activation", "keras.layers.Dropout", "keras.optimizers.Adam", "PIL.Image.open", "keras.applications.vgg19.VGG19", "keras.applications.resnet50.ResNet50", "keras.utils.np_utils.to_categor...
[((2248, 2279), 'os.listdir', 'os.listdir', (['"""data_folder/train"""'], {}), "('data_folder/train')\n", (2258, 2279), False, 'import os, keras\n'), ((2895, 2915), 'numpy.array', 'np.array', (['image_list'], {}), '(image_list)\n', (2903, 2915), True, 'import numpy as np\n'), ((2929, 2955), 'keras.utils.np_utils.to_cat...
import os import numpy as np import torch import torch.nn as nn from .pu_net import PUNet class SORDefense(nn.Module): """Statistical outlier removal as defense. """ def __init__(self, k=2, alpha=1.1): """SOR defense. Args: k (int, optional): kNN. Defaults to 2. ...
[ "torch.mean", "torch.cat", "torch.std", "numpy.random.choice", "torch.zeros", "torch.no_grad", "torch.sum", "torch.from_numpy" ]
[((938, 977), 'torch.sum', 'torch.sum', (['(pc ** 2)'], {'dim': '(1)', 'keepdim': '(True)'}), '(pc ** 2, dim=1, keepdim=True)\n', (947, 977), False, 'import torch\n'), ((1284, 1309), 'torch.mean', 'torch.mean', (['value'], {'dim': '(-1)'}), '(value, dim=-1)\n', (1294, 1309), False, 'import torch\n'), ((1335, 1360), 'to...
## @ingroup Methods-Weights-Correlations-FLOPS # operating_items.py # # Created: May 2020, <NAME> # Modified: # ---------------------------------------------------------------------- # Imports # ---------------------------------------------------------------------- from SUAVE.Core import Units, Data import numpy as ...
[ "numpy.floor", "numpy.ceil", "SUAVE.Core.Data" ]
[((4650, 4656), 'SUAVE.Core.Data', 'Data', ([], {}), '()\n', (4654, 4656), False, 'from SUAVE.Core import Units, Data\n'), ((4016, 4078), 'numpy.ceil', 'np.ceil', (['(vehicle.mass_properties.cargo / Units.lbs * 1.0 / 950)'], {}), '(vehicle.mass_properties.cargo / Units.lbs * 1.0 / 950)\n', (4023, 4078), True, 'import n...
import os import numpy as np import tensorflow as tf def save_weights_resnet152_10channel(): # Initialize configuration required_input_shape = (7, 7, 10, 64) output_file_prefix = "resnet152_10channel" # Initialize a model of choice model_pretrained_conv = tf.keras.applications.ResNet152(weights=...
[ "tensorflow.keras.applications.ResNet152", "os.getcwd", "os.path.join", "numpy.random.normal" ]
[((280, 350), 'tensorflow.keras.applications.ResNet152', 'tf.keras.applications.ResNet152', ([], {'weights': '"""imagenet"""', 'include_top': '(False)'}), "(weights='imagenet', include_top=False)\n", (311, 350), True, 'import tensorflow as tf\n'), ((645, 693), 'numpy.random.normal', 'np.random.normal', (['(0)', '(0.001...
''' ========================================= Inference for Non-Linear Gaussian Systems ========================================= This module contains the Unscented Kalman Filter (Wan, <NAME> 2000) for state estimation in systems with non-Gaussian noise and non-linear dynamics ''' from collections import namedtuple i...
[ "numpy.diag", "numpy.concatenate", "numpy.copy", "numpy.eye", "scipy.linalg.block_diag", "scipy.linalg.cholesky", "numpy.zeros", "numpy.ones", "numpy.ma.atleast_2d", "numpy.tile", "collections.namedtuple", "numpy.ma.getmask", "numpy.ma.asarray", "scipy.linalg.pinv", "numpy.vstack", "nu...
[((681, 756), 'collections.namedtuple', 'namedtuple', (['"""SigmaPoints"""', "['points', 'weights_mean', 'weights_covariance']"], {}), "('SigmaPoints', ['points', 'weights_mean', 'weights_covariance'])\n", (691, 756), False, 'from collections import namedtuple\n'), ((850, 895), 'collections.namedtuple', 'namedtuple', (...
# -*- coding: utf-8 -*- """1-Step Advantage Actor-Critic agent for episodic tasks in OpenAI Gym. - Author: <NAME> - Contact: <EMAIL> """ import argparse from typing import Tuple import gym import numpy as np import torch import wandb from rl_algorithms.common.abstract.agent import Agent from rl_algorithms.common.he...
[ "wandb.log", "rl_algorithms.common.abstract.agent.Agent.__init__", "rl_algorithms.registry.build_learner", "rl_algorithms.common.helper_functions.numpy2floattensor", "numpy.array" ]
[((1661, 1711), 'rl_algorithms.common.abstract.agent.Agent.__init__', 'Agent.__init__', (['self', 'env', 'env_info', 'args', 'log_cfg'], {}), '(self, env, env_info, args, log_cfg)\n', (1675, 1711), False, 'from rl_algorithms.common.abstract.agent import Agent\n'), ((2112, 2143), 'rl_algorithms.registry.build_learner', ...
import typing import torch import torchvision import numpy as np from PIL import Image from torch.autograd import Variable from src.final_work.transformer import Transformer from enum import Enum class ModelType(Enum): HOSODA = "hosoda_mamoru" KON = "kon_satoshi" MIYAZAKI = "miyazaki_hayao" SHINKAI = ...
[ "src.final_work.transformer.Transformer", "torch.autograd.Variable", "torch.load", "numpy.asarray", "torchvision.transforms.ToPILImage", "torch.cuda.is_available", "torch.device", "torchvision.transforms.ToTensor" ]
[((385, 405), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (397, 405), False, 'import torch\n'), ((749, 774), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (772, 774), False, 'import torch\n'), ((1118, 1193), 'torch.load', 'torch.load', (['f"""{self.MODELS_DIRECTORY}/{mo...
# -*- coding: utf-8 -*- """ Created on 2017-6-27 @author: cheng.li """ from typing import Dict from typing import Optional from typing import Tuple from typing import Union import numpy as np from alphamind.portfolio.optimizers import ( QuadraticOptimizer, TargetVolOptimizer ) from alphamind.exceptions.excep...
[ "alphamind.portfolio.optimizers.TargetVolOptimizer", "numpy.concatenate", "alphamind.portfolio.optimizers.QuadraticOptimizer" ]
[((2311, 2507), 'alphamind.portfolio.optimizers.QuadraticOptimizer', 'QuadraticOptimizer', ([], {'objective': '(-er)', 'cons_matrix': 'cons_matrix', 'lbound': 'lbound', 'ubound': 'ubound', 'penalty': 'lam', 'cov': 'cov', 'factor_cov': 'risk_cov', 'factor_load': 'risk_exposure', 'factor_special': 'special_risk'}), '(obj...
import pytest import numpy as np from unpackqa import (unpack_to_array, unpack_to_dict, list_products, list_qa_flags, list_sensors, ) from unpackqa.tools.validation import (product_info_has_require...
[ "unpackqa.list_sensors", "unpackqa.list_qa_flags", "pytest.raises", "unpackqa.list_products", "numpy.array", "pytest.mark.parametrize" ]
[((1116, 1168), 'numpy.array', 'np.array', (['[[8, 8, 8], [16, 16, 16], [255, 255, 255]]'], {}), '([[8, 8, 8], [16, 16, 16], [255, 255, 255]])\n', (1124, 1168), True, 'import numpy as np\n'), ((1232, 1259), 'unpackqa.list_products', 'list_products', ([], {'sensor': '"""all"""'}), "(sensor='all')\n", (1245, 1259), False...
# -*- encoding: utf-8 -*- """ @Author : zYx.Tom @Contact : <EMAIL> @site : https://zhuyuanxiang.github.io --------------------------- @Software : PyCharm @Project : deep-learning-with-python-notebooks @File : ch0602_recurrent_neural_network.py @Version : v0.1 @Time : ...
[ "keras.optimizers.rmsprop", "numpy.random.seed", "keras.preprocessing.sequence.pad_sequences", "numpy.set_printoptions", "tools.plot_classes_results", "matplotlib.pyplot.get_fignums", "keras.datasets.imdb.load_data", "numpy.stack", "keras.layers.SimpleRNN", "matplotlib.pyplot.show", "numpy.asarr...
[((1218, 1303), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)', 'suppress': '(True)', 'threshold': 'np.inf', 'linewidth': '(200)'}), '(precision=3, suppress=True, threshold=np.inf, linewidth=200\n )\n', (1237, 1303), True, 'import numpy as np\n'), ((1369, 1389), 'numpy.random.seed', 'np.ra...
import numpy as np from Classes.Uncertainty import Uncertainty from Classes.QComp import QComp class QAData(object): """Evaluates and stores quality assurance characteristics and messages. Attributes ---------- q_run_threshold_caution: int Caution threshold for interpolated discharge for a ru...
[ "numpy.sum", "numpy.abs", "numpy.greater", "numpy.isnan", "numpy.tile", "numpy.round", "numpy.unique", "numpy.nanmean", "Classes.Uncertainty.Uncertainty.uncertainty_extrapolation", "numpy.logical_not", "numpy.append", "Classes.QComp.QComp.edge_ensembles", "numpy.less", "numpy.nansum", "C...
[((11642, 11657), 'numpy.any', 'np.any', (['checked'], {}), '(checked)\n', (11648, 11657), True, 'import numpy as np\n'), ((23573, 23585), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (23581, 23585), True, 'import numpy as np\n'), ((24064, 24079), 'numpy.any', 'np.any', (['checked'], {}), '(checked)\n', (24070, 2...
from utils import * from chinese_checkers.TinyChineseCheckersGame import ChineseCheckersGame from chinese_checkers.tensorflow.ResNet import NNetWrapper as nn from chinese_checkers.Evaluator import Evaluator from MCTS import MCTS from chinese_checkers.InitializeAgent import InitializeAgent from chinese_checkers.GreedyAg...
[ "chinese_checkers.Evaluator.Evaluator", "chinese_checkers.GreedyAgent.GreedyAgent", "chinese_checkers.InitializeAgent.InitializeAgent", "chinese_checkers.TinyChineseCheckersGame.ChineseCheckersGame", "numpy.zeros", "MCTS.MCTS", "chinese_checkers.tensorflow.ResNet.NNetWrapper", "chinese_checkers.TinyGU...
[((667, 688), 'chinese_checkers.TinyChineseCheckersGame.ChineseCheckersGame', 'ChineseCheckersGame', ([], {}), '()\n', (686, 688), False, 'from chinese_checkers.TinyChineseCheckersGame import ChineseCheckersGame\n'), ((695, 701), 'chinese_checkers.TinyGUI.GUI', 'GUI', (['(1)'], {}), '(1)\n', (698, 701), False, 'from ch...
from tensorflow.keras.utils import Sequence import os import pandas as pd import random import numpy as np class DataGenerator(Sequence): def __init__(self, path_args, batch_size: int, shuffle: bool, mode: str): self.x_img_path = './train...
[ "numpy.stack", "os.listdir", "numpy.random.shuffle" ]
[((425, 452), 'os.listdir', 'os.listdir', (['self.x_img_path'], {}), '(self.x_img_path)\n', (435, 452), False, 'import os\n'), ((476, 505), 'os.listdir', 'os.listdir', (['self.x_label_path'], {}), '(self.x_label_path)\n', (486, 505), False, 'import os\n'), ((1198, 1229), 'numpy.random.shuffle', 'np.random.shuffle', (['...
root = 'data/' import numpy as np from ffjord.datasets.power import POWER from ffjord.datasets.gas import GAS from ffjord.datasets.hepmass import HEPMASS from ffjord.datasets.miniboone import MINIBOONE from ffjord.datasets.bsds300 import BSDS300 from .synthetic import EightGaussians from .synthetic import Checkerboard...
[ "ffjord.datasets.gas.GAS", "ffjord.datasets.miniboone.MINIBOONE", "numpy.random.RandomState", "ffjord.datasets.hepmass.HEPMASS", "ffjord.datasets.power.POWER", "ffjord.datasets.bsds300.BSDS300", "utils.order_variables_partial_correlation" ]
[((738, 768), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': '(42)'}), '(seed=42)\n', (759, 768), True, 'import numpy as np\n'), ((899, 953), 'utils.order_variables_partial_correlation', 'order_variables_partial_correlation', (['data.trn.x'], {'tr': 'tr'}), '(data.trn.x, tr=tr)\n', (934, 953), False...
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np df = pd.DataFrame({'Group': ['A', 'A', 'A', 'B', 'C', 'B', 'B', 'C', 'A', 'C'], 'Apple': np.random.rand(10),'Orange': np.random.rand(10)}) # df = df[['Group','Apple','Orange']] dd = pd.melt(df, id_vars=['Gr...
[ "numpy.random.rand", "pandas.melt", "seaborn.boxplot", "matplotlib.pyplot.show" ]
[((296, 382), 'pandas.melt', 'pd.melt', (['df'], {'id_vars': "['Group']", 'value_vars': "['Apple', 'Orange']", 'var_name': '"""Fruits"""'}), "(df, id_vars=['Group'], value_vars=['Apple', 'Orange'], var_name=\n 'Fruits')\n", (303, 382), True, 'import pandas as pd\n'), ((378, 434), 'seaborn.boxplot', 'sns.boxplot', ([...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' import keras import keras.backend as K import re import cv2 import numpy as np np.set_printoptions(threshold='nan') def list_pictures(directory, ext='jpg|jpeg|bmp|png|ppm'): return [os.path.join(root, f) f...
[ "numpy.load", "os.walk", "keras.layers.Input", "keras.callbacks.LearningRateScheduler", "os.path.join", "numpy.set_printoptions", "keras.backend.constant", "cv2.imwrite", "os.path.exists", "keras.Model", "keras.callbacks.ModelCheckpoint", "keras.applications.xception.preprocess_input", "kera...
[((176, 212), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': '"""nan"""'}), "(threshold='nan')\n", (195, 212), True, 'import numpy as np\n'), ((4558, 4605), 'cv2.imread', 'cv2.imread', (['"""./data/uv-data/uv_weight_mask.png"""'], {}), "('./data/uv-data/uv_weight_mask.png')\n", (4568, 4605), False,...
import cv2 import numpy as np def label2rgb(label_np): print(label_np) label_color = np.argmax(label_np, axis=0) label_color = label_color / np.max(label_color) * 255 print(label_color) n = label_color.astype(np.uint8) n = np.array(n) print(type(n)) label_color = cv2.applyColorMap(n, '...
[ "cv2.applyColorMap", "numpy.max", "numpy.array", "numpy.argmax" ]
[((95, 122), 'numpy.argmax', 'np.argmax', (['label_np'], {'axis': '(0)'}), '(label_np, axis=0)\n', (104, 122), True, 'import numpy as np\n'), ((249, 260), 'numpy.array', 'np.array', (['n'], {}), '(n)\n', (257, 260), True, 'import numpy as np\n'), ((298, 325), 'cv2.applyColorMap', 'cv2.applyColorMap', (['n', '"""jet"""'...
import pandas as pd import numpy as np from tpot import TPOTClassifier from sklearn.model_selection import train_test_split benchmark = pd.read_pickle('us_pct.pickle') # us overall housing price index percentage change HPI = pd.read_pickle('HPI_complete.pickle') # all of the state data, thirty year mortgage, unempl...
[ "pandas.read_pickle", "sklearn.model_selection.train_test_split", "numpy.array", "tpot.TPOTClassifier" ]
[((139, 170), 'pandas.read_pickle', 'pd.read_pickle', (['"""us_pct.pickle"""'], {}), "('us_pct.pickle')\n", (153, 170), True, 'import pandas as pd\n'), ((229, 266), 'pandas.read_pickle', 'pd.read_pickle', (['"""HPI_complete.pickle"""'], {}), "('HPI_complete.pickle')\n", (243, 266), True, 'import pandas as pd\n'), ((108...
#Important Modules from flask import Flask,render_template, url_for ,flash , redirect import pickle from flask import request import numpy as np import os from flask import send_from_directory #from this import SQLAlchemy app=Flask(__name__,template_folder='template') @app.route("/") @app.route("/home") def...
[ "numpy.array", "flask.Flask", "flask.request.form.to_dict", "flask.render_template" ]
[((233, 276), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""template"""'}), "(__name__, template_folder='template')\n", (238, 276), False, 'from flask import Flask, render_template, url_for, flash, redirect\n'), ((340, 368), 'flask.render_template', 'render_template', (['"""home.html"""'], {}), "('home...
import cv2 as cv import numpy as np if __name__ == "__main__": img = cv.imread('../../assets/test1.jpg') height, width = img.shape[:2] # rows, columns # translating the img 200 pixels right (x axis) translation_matrix = np.float32([[1, 0, 200], [0, 1, 0]]) output = cv.warpAffine(img, transl...
[ "cv2.waitKey", "cv2.destroyAllWindows", "numpy.float32", "cv2.imread", "cv2.warpAffine", "cv2.imshow" ]
[((79, 114), 'cv2.imread', 'cv.imread', (['"""../../assets/test1.jpg"""'], {}), "('../../assets/test1.jpg')\n", (88, 114), True, 'import cv2 as cv\n'), ((245, 281), 'numpy.float32', 'np.float32', (['[[1, 0, 200], [0, 1, 0]]'], {}), '([[1, 0, 200], [0, 1, 0]])\n', (255, 281), True, 'import numpy as np\n'), ((295, 350), ...
import numpy as np import vrep import ctypes import math import sys import time sim_dt = 0.01 dt = 0.001 SYNC = True vrep_mode = vrep.simx_opmode_oneshot def b( num ): """ forces magnitude to be 1 or less """ if abs( num ) > 1.0: return math.copysign( 1.0, num ) else: return num def convert_angles( a...
[ "vrep.simxGetObjectVelocity", "vrep.simxSynchronousTrigger", "math.copysign", "vrep.simxStart", "vrep.simxSynchronous", "vrep.simxGetObjectHandle", "vrep.simxSetStringSignal", "math.cos", "vrep.simxGetObjectPosition", "vrep.simxStopSimulation", "math.sqrt", "vrep.simxFinish", "math.sin", "...
[((396, 412), 'math.sin', 'math.sin', (['ang[0]'], {}), '(ang[0])\n', (404, 412), False, 'import math\n'), ((420, 436), 'math.sin', 'math.sin', (['ang[1]'], {}), '(ang[1])\n', (428, 436), False, 'import math\n'), ((444, 460), 'math.sin', 'math.sin', (['ang[2]'], {}), '(ang[2])\n', (452, 460), False, 'import math\n'), (...
from typing import Any import pytest from pytestqt.qtbot import QtBot from qtpy.QtCore import Signal, QObject import numpy as np from pydm.application import PyDMApplication from pydm.data_plugins.calc_plugin import epics_string, epics_unsigned from pydm.widgets.channel import PyDMChannel @pytest.mark.parametrize( ...
[ "pydm.data_plugins.calc_plugin.epics_string", "pydm.widgets.channel.PyDMChannel", "pydm.data_plugins.calc_plugin.epics_unsigned", "numpy.array", "pytest.mark.parametrize" ]
[((698, 797), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""input_int,bits,expected"""', '[(100, 32, 100), (-1, 8, 255), (-2, 4, 14)]'], {}), "('input_int,bits,expected', [(100, 32, 100), (-1, 8,\n 255), (-2, 4, 14)])\n", (721, 797), False, 'import pytest\n'), ((1717, 1816), 'pydm.widgets.channel.PyDMC...
import cv2 import numpy as np import matplotlib.pyplot as plt def main(): path = "C:\\Users\\enesa\\Documents\\MATLAB\\blobs_objects.jpg" img = cv2.imread(path, 1) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) filter1 = np.array(([0, -1, 0], [-1, 5, -1], [0, -1, 0]), np.float32) #Sharpening Filter o...
[ "cv2.GaussianBlur", "cv2.boundingRect", "matplotlib.pyplot.show", "cv2.filter2D", "cv2.dilate", "cv2.cvtColor", "cv2.getStructuringElement", "cv2.threshold", "cv2.morphologyEx", "cv2.waitKey", "numpy.ones", "cv2.destroyAllWindows", "cv2.imread", "numpy.array", "cv2.rectangle", "cv2.ero...
[((158, 177), 'cv2.imread', 'cv2.imread', (['path', '(1)'], {}), '(path, 1)\n', (168, 177), False, 'import cv2\n'), ((186, 222), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2RGB'], {}), '(img, cv2.COLOR_BGR2RGB)\n', (198, 222), False, 'import cv2\n'), ((238, 297), 'numpy.array', 'np.array', (['([0, -1, 0], [...
# Copyright 2020 <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 writing...
[ "imitation.util.util.make_unique_timestamp", "ray.init", "evaluating_rewards.scripts.script_utils.sanitize_path", "evaluating_rewards.scripts.rl_common.parallel_training", "math.sqrt", "numpy.argmax", "evaluating_rewards.scripts.rl_common.make_config", "evaluating_rewards.scripts.script_utils.experime...
[((1039, 1073), 'sacred.Experiment', 'sacred.Experiment', (['"""train_experts"""'], {}), "('train_experts')\n", (1056, 1073), False, 'import sacred\n'), ((1074, 1107), 'evaluating_rewards.scripts.rl_common.make_config', 'rl_common.make_config', (['experts_ex'], {}), '(experts_ex)\n', (1095, 1107), False, 'from evaluati...
import numpy as np from sklearn.preprocessing import FunctionTransformer from ..wrappers import wrap def linearize(X): X = np.asarray(X) return np.reshape(X, (X.shape[0], -1)) class Linearize(FunctionTransformer): """Extracts features by simply concatenating all elements of the data into one long ...
[ "numpy.asarray", "numpy.reshape" ]
[((131, 144), 'numpy.asarray', 'np.asarray', (['X'], {}), '(X)\n', (141, 144), True, 'import numpy as np\n'), ((156, 187), 'numpy.reshape', 'np.reshape', (['X', '(X.shape[0], -1)'], {}), '(X, (X.shape[0], -1))\n', (166, 187), True, 'import numpy as np\n')]
import matplotlib matplotlib.use('Agg') #matplotlib.use("gtk") #matplotlib.use('Qt5Agg') from rectify_vars_and_wald_functions import * import pickle import os import pandas as pd import matplotlib.pyplot as plt import sys sys.path.insert(1, '../../le_experiments/') # print(data) import numpy as np import os from sci...
[ "numpy.load", "numpy.abs", "matplotlib.pyplot.clf", "ipdb.set_trace", "matplotlib.pyplot.close", "scipy.stats.spearmanr", "sys.path.insert", "scipy.stats.pearsonr", "pathlib.Path", "matplotlib.use", "numpy.arange", "matplotlib.pyplot.rc", "pickle.load", "numpy.round", "matplotlib.pyplot....
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((225, 268), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../le_experiments/"""'], {}), "(1, '../../le_experiments/')\n", (240, 268), False, 'import sys\n'), ((1001, 1032), 'matplotlib.pyp...
"""LogRegression trains a logistic regression model implemented by Scikit-Learn on the given dataset. Before training, the user is prompted for parameter input. After training, model metrics are displayed, and the user can make new predictions. View the documentation at https://manufacturingnet.readthedocs.io/. """ i...
[ "matplotlib.pyplot.title", "sklearn.model_selection.GridSearchCV", "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "sklearn.metrics.roc_curve", "numpy.ravel", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score", "sklearn.model_select...
[((27414, 27747), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {'penalty': 'penalty', 'dual': 'dual', 'tol': 'tol', 'C': 'C', 'fit_intercept': 'fit_intercept', 'intercept_scaling': 'intercept_scaling', 'class_weight': 'class_weight', 'random_state': 'random_state', 'solver': 'solver', 'max_iter...
from __future__ import division from builtins import str import numpy import os import sys import logging from ektelo.algorithm.dawa.cutils import cutil from ektelo.algorithm.dawa.partition_engines import partition_engine from ektelo import util class l1partition_engine(partition_engine.partition_engine): """Use ...
[ "numpy.dtype", "numpy.zeros", "numpy.random.RandomState", "ektelo.util.old_div", "builtins.str" ]
[((1623, 1653), 'numpy.random.RandomState', 'numpy.random.RandomState', (['seed'], {}), '(seed)\n', (1647, 1653), False, 'import numpy\n'), ((2051, 2065), 'numpy.zeros', 'numpy.zeros', (['n'], {}), '(n)\n', (2062, 2065), False, 'import numpy\n'), ((3345, 3375), 'numpy.random.RandomState', 'numpy.random.RandomState', ([...
import os, io, csv, json import requests, argparse import pandas as pd import numpy as np from ast import literal_eval from datetime import datetime from panoptes_client import Project, Panoptes from collections import OrderedDict, Counter from sklearn.cluster import DBSCAN import kso_utils.db_utils as db_utils from ks...
[ "pandas.DataFrame", "numpy.isin", "kso_utils.db_utils.combine_duplicates", "argparse.ArgumentParser", "kso_utils.zooniverse_utils.auth_session", "json.loads", "pandas.merge", "kso_utils.db_utils.create_connection", "numpy.where", "numpy.array", "pandas.Series", "pandas.read_sql_query", "ast....
[((2739, 2764), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2762, 2764), False, 'import requests, argparse\n'), ((4562, 4600), 'kso_utils.zooniverse_utils.auth_session', 'auth_session', (['args.user', 'args.password'], {}), '(args.user, args.password)\n', (4574, 4600), False, 'from kso_util...
# -*- coding: utf-8 -*- # ***************************************************************************** # ufit, a universal scattering fitting suite # # Copyright (c) 2013-2019, <NAME> and contributors. All rights reserved. # Licensed under a 2-clause BSD license, see LICENSE. # **************************************...
[ "numpy.log", "numpy.sin", "numpy.exp", "numpy.cos", "numpy.sqrt" ]
[((2370, 2382), 'numpy.sqrt', 'sqrt', (['(2 * pi)'], {}), '(2 * pi)\n', (2374, 2382), False, 'from numpy import exp, log, sqrt, sin, cos, pi\n'), ((8778, 8789), 'numpy.cos', 'cos', (['p[pth]'], {}), '(p[pth])\n', (8781, 8789), False, 'from numpy import exp, log, sqrt, sin, cos, pi\n'), ((8791, 8802), 'numpy.sin', 'sin'...
import numpy as np from skopt.space import Space from skopt.sampler import Grid import matplotlib.pyplot as plt import seaborn as sns def plot_teacher_action(): space = Space([(-1., 1.), (-1., 1.)]) grid = Grid(border="include", use_full_layout=False) action_manipulated = grid.generate(space.dimensions, 1...
[ "seaborn.set_style", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "seaborn.scatterplot", "matplotlib.pyplot.ylim", "skopt.sampler.Grid", "skopt.space.Space", "numpy.append", "matplotlib.pyplot.figure", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib....
[((175, 208), 'skopt.space.Space', 'Space', (['[(-1.0, 1.0), (-1.0, 1.0)]'], {}), '([(-1.0, 1.0), (-1.0, 1.0)])\n', (180, 208), False, 'from skopt.space import Space\n'), ((216, 261), 'skopt.sampler.Grid', 'Grid', ([], {'border': '"""include"""', 'use_full_layout': '(False)'}), "(border='include', use_full_layout=False...
# Test convolving to different resolutions # Test the effect of convolving straight to 20000 and convolving first to an intermediate resolution say 80000. import matplotlib.pyplot as plt import numpy as np from IP_multi_Convolution import ip_convolution, unitary_Gauss def main(): # fwhm = lambda/R fwhm = 2...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "numpy.ones_like", "matplotlib.pyplot.legend", "IP_multi_Convolution.unitary_Gauss", "matplotlib.pyplot.figure", "numpy.max", "IP_multi_Convolution.ip_convolution", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((367, 397), 'numpy.linspace', 'np.linspace', (['(2040)', '(2050)', '(20000)'], {}), '(2040, 2050, 20000)\n', (378, 397), True, 'import numpy as np\n'), ((678, 764), 'IP_multi_Convolution.ip_convolution', 'ip_convolution', (['wav', 'flux', 'chip_limits', 'R'], {'fwhm_lim': '(5.0)', 'plot': '(False)', 'verbose': '(True...
import os import random import re import ssl import tempfile from urllib import request import cv2 import imageio import numpy as np import tensorflow as tf import tensorflow_hub as tfhub UCF_ROOT = 'https://www.crcv.ucf.edu/THUMOS14/UCF101/UCF101/' KINETICS_URL = ('https://raw.githubusercontent.com/deepmind/' ...
[ "cv2.resize", "tensorflow.nn.softmax", "tensorflow_hub.load", "os.path.join", "cv2.cvtColor", "os.path.exists", "random.choice", "tensorflow.constant", "numpy.clip", "cv2.VideoCapture", "urllib.request.urlopen", "numpy.argsort", "tempfile.mkdtemp", "re.findall", "numpy.array", "ssl._cr...
[((385, 403), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (401, 403), False, 'import tempfile\n'), ((425, 457), 'ssl._create_unverified_context', 'ssl._create_unverified_context', ([], {}), '()\n', (455, 457), False, 'import ssl\n'), ((3091, 3113), 'tensorflow_hub.load', 'tfhub.load', (['model_path'], {})...
from Main.Environments.Connect4 import Constants, Utils from Tests.Environments.Connect4 import testCasesRawEvaluate from unittest import TestCase import numpy as np class TestCreateMirroredStateAndPolicy(TestCase): def testMirrorState(self): AMOUNT_OF_TESTS_PER_CASE = 10 for case in te...
[ "Main.Environments.Connect4.Utils.state2ConvState", "Main.Environments.Connect4.Utils.createMirroredStateAndPolicy", "numpy.random.random", "numpy.array", "numpy.array_equal" ]
[((372, 389), 'numpy.array', 'np.array', (['case[0]'], {}), '(case[0])\n', (380, 389), True, 'import numpy as np\n'), ((450, 481), 'Main.Environments.Connect4.Utils.state2ConvState', 'Utils.state2ConvState', (['board', 'p'], {}), '(board, p)\n', (471, 481), False, 'from Main.Environments.Connect4 import Constants, Util...
''' VizUtil.py Utilities for displaying satellite images, with (optional) bound-box annotations ''' import numpy as np from matplotlib import pylab import os import skimage.color def imshow(Im, block=False, figID=1): figH = pylab.figure(num=figID) figH.clf() pylab.imshow(Im) pylab.draw() pylab.show(block=bl...
[ "matplotlib.pylab.savefig", "matplotlib.pylab.xticks", "numpy.minimum", "numpy.maximum", "matplotlib.pylab.subplot", "matplotlib.pylab.imshow", "numpy.asarray", "matplotlib.pylab.figure", "os.path.exists", "matplotlib.pylab.axis", "matplotlib.pylab.yticks", "matplotlib.pylab.subplots", "nump...
[((228, 251), 'matplotlib.pylab.figure', 'pylab.figure', ([], {'num': 'figID'}), '(num=figID)\n', (240, 251), False, 'from matplotlib import pylab\n'), ((267, 283), 'matplotlib.pylab.imshow', 'pylab.imshow', (['Im'], {}), '(Im)\n', (279, 283), False, 'from matplotlib import pylab\n'), ((286, 298), 'matplotlib.pylab.dra...
#coding:utf-8 # return candidate position set of one pitch duration near center of the frame # by differential change point and threshold from bottom line. # return 0 if there is no. # # 中心付近の1ピッチ分の候補インデックス[sp,ep]を返す。 # 候補が無いときは零を返す。 # # 微分の変化点と閾値により候補を選出する。 import numpy as np import matplotlib.pyplot as ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "numpy.amin", "numpy.amax", "matplotlib.pyplot.figure", "numpy.where", "numpy.array", "numpy.sign", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.gradient" ]
[((477, 491), 'numpy.gradient', 'np.gradient', (['y'], {}), '(y)\n', (488, 491), True, 'import numpy as np\n'), ((1440, 1458), 'numpy.array', 'np.array', (['[sp, ep]'], {}), '([sp, ep])\n', (1448, 1458), True, 'import numpy as np\n'), ((679, 689), 'numpy.amin', 'np.amin', (['y'], {}), '(y)\n', (686, 689), True, 'import...
import numpy as np from sklearn.ensemble import ExtraTreesRegressor, RandomForestRegressor import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn import preprocessing, svm from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn ...
[ "matplotlib.pyplot.title", "pandas.read_csv", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.Lasso", "sklearn.linear_model.Ridge", "matplotlib.pyplot.show", "pandas.get_dummies", "matplo...
[((836, 876), 'pandas.read_csv', 'pd.read_csv', (['"""Original_with_dummies.csv"""'], {}), "('Original_with_dummies.csv')\n", (847, 876), True, 'import pandas as pd\n'), ((1157, 1197), 'pandas.read_csv', 'pd.read_csv', (['"""Original_with_dummies.csv"""'], {}), "('Original_with_dummies.csv')\n", (1168, 1197), True, 'im...
import random import numpy as np import matplotlib.pyplot as plt from torch import tensor from torch import cat from torch import clamp from torch.distributions import normal from torch import nn import torch.nn.functional as F from torch import optim from torch.utils.tensorboard import SummaryWriter import torch imp...
[ "matplotlib.pyplot.title", "gym.make", "matplotlib.pyplot.hist", "numpy.asarray", "random.choices", "torch.cat", "torch.distributions.normal.Normal", "torch.nn.Linear", "torch.exp", "numpy.mean", "torch.utils.tensorboard.SummaryWriter", "torch.device", "matplotlib.pyplot.ylabel", "torch.te...
[((672, 751), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', ([], {'log_dir': '"""./runs/v0-1mil-iter-256-node-hidden-layers-buffer-1mil"""'}), "(log_dir='./runs/v0-1mil-iter-256-node-hidden-layers-buffer-1mil')\n", (685, 751), False, 'from torch.utils.tensorboard import SummaryWriter\n'), ((836, 855), 'torc...
import h5py import os, sys, glob import numpy as np import plotly.offline as offline from preprocessing import analysis_pp from analysis.general_utils import aqua_utils, saving_utils, plotly_utils, general_utils, compare_astro_utils, correlation_utils, stat_utils from scipy.stats.stats import power_divergence from scip...
[ "matplotlib.rc", "scipy.stats.skewnorm.pdf", "numpy.sum", "powerlaw.Fit", "scipy.stats.skewnorm.fit", "analysis.general_utils.plotly_utils.plot_scatter_mult_with_avg", "numpy.histogram", "os.path.isfile", "scipy.stats.skewnorm.stats", "analysis.general_utils.plotly_utils.apply_fun_axis_fig", "an...
[((1460, 1527), 'os.path.join', 'os.path.join', (['output_experiment_path', '"""plots"""', '"""behaviour_heatmaps"""'], {}), "(output_experiment_path, 'plots', 'behaviour_heatmaps')\n", (1472, 1527), False, 'import os, sys, glob\n'), ((1988, 2066), 'os.path.join', 'os.path.join', (['output_experiment_path', '"""plots""...
# 2018/11/01~2018/07/12 # <NAME>, <EMAIL>. """ graphML.py Module for basic GSP and graph machine learning functions. Functionals LSIGF: Applies a linear shift-invariant graph filter spectralGF: Applies a linear shift-invariant graph filter in spectral form NVGF: Applies a node-variant graph filter EVGF: Applies an ed...
[ "torch.eye", "torch.empty", "torch.cat", "torch.arange", "torch.nn.functional.leaky_relu", "torch.ones", "torch.median", "torch.gather", "numpy.linalg.eig", "torch.Tensor", "utils.graphUtils.graphTools.splineBasis", "torch.zeros", "torch.matmul", "utils.graphUtils.graphTools.computeNeighbo...
[((10592, 10617), 'torch.matmul', 'torch.matmul', (['Vdiagh', 'VHx'], {}), '(Vdiagh, VHx)\n', (10604, 10617), False, 'import torch\n'), ((10781, 10800), 'torch.sum', 'torch.sum', (['y'], {'dim': '(3)'}), '(y, dim=3)\n', (10790, 10800), False, 'import torch\n'), ((10844, 10863), 'torch.sum', 'torch.sum', (['y'], {'dim':...