code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import argparse import numpy as np import os import pandas as pd import random import time import torch import torch.cuda.amp as amp import torch.nn as nn import torch.optim as optim from torchvision import datasets, transforms from v2 import mobilenet_v2 from v3 import mobilenetv3_small, mobilenetv3_large try: imp...
[ "numpy.random.seed", "argparse.ArgumentParser", "torchvision.datasets.CIFAR10", "torch.device", "torchvision.transforms.Normalize", "torch.no_grad", "os.path.join", "hfta.optim.consolidate_hyperparams_and_determine_B", "pandas.DataFrame", "torch.cuda.amp.autocast", "torch.utils.data.DataLoader",...
[((657, 723), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MobileNet V2 and V3 Example"""'}), "(description='MobileNet V2 and V3 Example')\n", (680, 723), False, 'import argparse\n'), ((3806, 3828), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (3817, 3828), False...
# # Solution class # import numpy as np import scipy.integrate class Solution: """Module that solves the Pharmokinetic differential equation model taking parameters passed to it from other scripts in the package Parameters ---------- :param model: Specifying the model to be used and the paramete...
[ "numpy.linspace" ]
[((3118, 3141), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(1000)'], {}), '(0, 1, 1000)\n', (3129, 3141), True, 'import numpy as np\n')]
import datetime import os import time import numpy as np from PIL import Image # Hide the Pygame support message os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = str() import pygame from .constants import BLACK, WHITE, DRAWING_SIZE, TITLE_BAR_HEIGHT, BORDER_WIDTH from .helper_fns import get_bezier_curve, alpha_blend cla...
[ "pygame.draw.circle", "pygame.Surface", "numpy.seterr", "pygame.display.set_mode", "pygame.event.get", "numpy.ubyte", "pygame.image.save", "pygame.init", "time.sleep", "pygame.image.tostring", "pygame.display.update", "numpy.where", "pygame.display.Info", "numpy.array", "pygame.draw.poly...
[((769, 782), 'pygame.init', 'pygame.init', ([], {}), '()\n', (780, 782), False, 'import pygame\n'), ((1661, 1716), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(self.pygame_x, self.pygame_y)'], {}), '((self.pygame_x, self.pygame_y))\n', (1684, 1716), False, 'import pygame\n'), ((1725, 1769), 'pygame.displa...
""" Reads cloud cleared GOES-16 data and returns an object with the relevant data. This software is hereby placed in the public domain. <EMAIL> """ import os import sys import numpy as np from datetime import date, datetime, timedelta from glob import glob from netCDF4 import Dataset #--- DATE_START = date...
[ "netCDF4.Dataset", "binObs_.binobs3d", "binObs_.binobs2d", "os.path.isdir", "gfio.GFIO", "numpy.ones", "datetime.datetime", "numpy.ma.array", "pyods.ODS", "os.path.isfile", "datetime.timedelta", "numpy.array", "numpy.ma.concatenate", "glob.glob", "numpy.ma.zeros", "pylab.prctile", "o...
[((316, 346), 'datetime.datetime', 'datetime', (['(2018)', '(2)', '(2)', '(18)', '(0)', '(0)'], {}), '(2018, 2, 2, 18, 0, 0)\n', (324, 346), False, 'from datetime import date, datetime, timedelta\n'), ((20894, 20938), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(12.0 * 60.0 * 60.0 / nsyn)'}), '(seconds=12.0 * ...
import numpy as np from utils import * from datetime import date class Optimizer(): """ Genetic algorithm to optimize hyperparameters of YOLO object detector """ def __init__(self, cfg, data, m, k, max_gen, n = 4, pm = 0.05, pc = 0.8, resume = ''): """ m: Number of individuals in the pop...
[ "numpy.random.uniform", "numpy.load", "numpy.save", "numpy.argmax", "numpy.zeros", "datetime.date.today", "numpy.argsort", "numpy.append", "numpy.max", "numpy.where", "numpy.random.randint", "numpy.vstack", "numpy.round", "numpy.delete", "numpy.concatenate" ]
[((900, 921), 'numpy.zeros', 'np.zeros', (['(1, self.n)'], {}), '((1, self.n))\n', (908, 921), True, 'import numpy as np\n'), ((1024, 1043), 'numpy.zeros', 'np.zeros', (['(self.m,)'], {}), '((self.m,))\n', (1032, 1043), True, 'import numpy as np\n'), ((1065, 1091), 'numpy.zeros', 'np.zeros', (['(self.n, self.m)'], {}),...
import unittest import numpy import chainer from chainer import cuda from chainer import gradient_check from chainer import links as L from chainer import testing from chainer.testing import attr from chainer.testing import condition from chainer.testing import parameterize from chainer.utils import conv def _pair(...
[ "chainer.Variable", "chainer.testing.product", "numpy.random.uniform", "chainer.utils.conv.get_deconv_outsize", "chainer.links.Deconvolution2D", "chainer.cuda.to_gpu", "chainer.using_config", "chainer.testing.run_module", "chainer.gradient_check.check_backward", "chainer.testing.condition.retry" ]
[((5201, 5239), 'chainer.testing.run_module', 'testing.run_module', (['__name__', '__file__'], {}), '(__name__, __file__)\n', (5219, 5239), False, 'from chainer import testing\n'), ((1964, 1982), 'chainer.testing.condition.retry', 'condition.retry', (['(3)'], {}), '(3)\n', (1979, 1982), False, 'from chainer.testing imp...
# -*- coding: utf-8 -*- """ Bar Chart Legend test This tests plots a simple bar chart. Bar charts are plotted as rectangle patches witch are difficult to tell from other rectangle patches that should not be plotted in PGFPlots (e.g. axis, legend) This also tests legends on barcharts. Which are difficult because in P...
[ "helpers.assert_equality", "matplotlib.pyplot.figure", "numpy.arange", "helpers.compare_mpl_latex" ]
[((525, 537), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (535, 537), True, 'import matplotlib.pyplot as plt\n'), ((577, 589), 'numpy.arange', 'np.arange', (['(3)'], {}), '(3)\n', (586, 589), True, 'import numpy as np\n'), ((911, 970), 'helpers.assert_equality', 'assert_equality', (['plot', '"""test_bar...
from os import path import yaml from collections import OrderedDict from profit import defaults from profit.util.base_class import CustomABC import warnings VALID_FORMATS = ('.yaml', '.py') """ yaml has to be configured to represent OrderedDict see https://stackoverflow.com/questions/16782112/can-pyyaml-dump-dict-it...
[ "yaml.safe_load", "numpy.arange", "os.path.join", "importlib.util.module_from_spec", "os.path.abspath", "profit.util.load_includes", "importlib.util.spec_from_file_location", "profit.util.variable.Variable.create", "yaml.add_representer", "profit.defaults.files.copy", "re.match", "os.sched_get...
[((939, 995), 'yaml.add_representer', 'yaml.add_representer', (['OrderedDict', 'represent_ordereddict'], {}), '(OrderedDict, represent_ordereddict)\n', (959, 995), False, 'import yaml\n'), ((996, 1048), 'yaml.add_constructor', 'yaml.add_constructor', (['_mapping_tag', 'dict_constructor'], {}), '(_mapping_tag, dict_cons...
#Author : <NAME> #load libraries import pandas as pd import numpy as np import torch from torch import nn, optim from torch.optim import lr_scheduler import torchvision from torchvision import datasets, transforms, models from collections import OrderedDict from PIL import Image from os import listdir ...
[ "torch.nn.Dropout", "json.load", "torch.nn.ReLU", "argparse.ArgumentParser", "torch.nn.LogSoftmax", "torch.load", "torchvision.models.alexnet", "torchvision.models.densenet121", "PIL.Image.open", "torch.exp", "numpy.array", "torch.cuda.is_available", "pandas.Series", "torch.nn.Linear", "...
[((587, 612), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (610, 612), False, 'import argparse\n'), ((1629, 1641), 'json.load', 'json.load', (['f'], {}), '(f)\n', (1638, 1641), False, 'import json\n'), ((1748, 1775), 'torch.load', 'torch.load', (['checkpoint_path'], {}), '(checkpoint_path)\n'...
import shutil import numpy as np import iric from . import util def case_Complex(): shutil.copy('data/case_init_hdf5.cgn', 'data/case_complex.cgn') fid = iric.cg_iRIC_Open("data/case_complex.cgn", iric.IRIC_MODE_MODIFY) util.verify_log("cg_iRIC_Open() fid != 0", fid != 0) iric.cg_iRIC_Clear_Complex(...
[ "iric.cg_iRIC_Read_Complex_Integer", "iric.cg_iRIC_Write_Grid_Complex_Cell", "iric.cg_iRIC_Read_Complex_Functional", "iric.cg_iRIC_Read_Complex_FunctionalWithName", "iric.cg_iRIC_Write_Complex_FunctionalWithName_String", "shutil.copy", "iric.cg_iRIC_Write_Complex_String", "iric.cg_iRIC_Write_Complex_F...
[((91, 154), 'shutil.copy', 'shutil.copy', (['"""data/case_init_hdf5.cgn"""', '"""data/case_complex.cgn"""'], {}), "('data/case_init_hdf5.cgn', 'data/case_complex.cgn')\n", (102, 154), False, 'import shutil\n'), ((165, 230), 'iric.cg_iRIC_Open', 'iric.cg_iRIC_Open', (['"""data/case_complex.cgn"""', 'iric.IRIC_MODE_MODI...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 11 17:11:04 2019 @author: zzl """ import numpy as np import matplotlib.pyplot as plt import sklearn import time from sklearn.discriminant_analysis import LinearDiscriminantAnalysis #LDA from sklearn.ensemble import RandomForestClassifier,AdaBoostCla...
[ "matplotlib.pyplot.title", "numpy.load", "numpy.ones", "sklearn.tree.DecisionTreeClassifier", "matplotlib.pyplot.figure", "sklearn.neural_network.MLPClassifier", "sklearn.svm.SVC", "sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis", "pandas.DataFrame", "sklearn.ensemble.RandomForestClas...
[((1498, 1535), 'numpy.zeros', 'np.zeros', (['(CML_case_num, feature_num)'], {}), '((CML_case_num, feature_num))\n', (1506, 1535), True, 'import numpy as np\n'), ((1557, 1595), 'numpy.zeros', 'np.zeros', (['(Norm_case_num, feature_num)'], {}), '((Norm_case_num, feature_num))\n', (1565, 1595), True, 'import numpy as np\...
# -*- coding: utf-8 -*- from gimmik import generate_mm import numpy as np from pyfr.backends.base import Kernel, NotSuitableError from pyfr.backends.cuda.provider import (CUDAKernelProvider, get_grid_for_block) class CUDAGiMMiKKernels(CUDAKernelProvider): def __init__(se...
[ "numpy.count_nonzero", "numpy.abs", "gimmik.generate_mm", "pyfr.backends.base.NotSuitableError", "pyfr.backends.cuda.provider.get_grid_for_block" ]
[((1097, 1201), 'gimmik.generate_mm', 'generate_mm', (['arr', 'a.dtype', '"""cuda"""'], {'alpha': 'alpha', 'beta': 'beta', 'n': 'b.ncol', 'ldb': 'b.leaddim', 'ldc': 'out.leaddim'}), "(arr, a.dtype, 'cuda', alpha=alpha, beta=beta, n=b.ncol, ldb=b.\n leaddim, ldc=out.leaddim)\n", (1108, 1201), False, 'from gimmik impo...
import warnings from typing import Callable, Optional, List, Union, Dict, Iterable import cv2 import matplotlib.pyplot as plt import numpy as np import torch import torch.nn.functional as F from catalyst.dl import Callback, CallbackOrder, IRunner, CallbackNode from catalyst.dl.callbacks import TensorboardLogger from c...
[ "numpy.zeros_like", "matplotlib.pyplot.show", "cv2.cvtColor", "matplotlib.pyplot.imshow", "matplotlib.pyplot.axis", "torch.cat", "cv2.addWeighted", "numpy.hstack", "umap.UMAP", "matplotlib.pyplot.figure", "numpy.array", "umap.plot.points", "pytorch_toolbelt.utils.distributed.all_gather", "...
[((6413, 6450), 'torch.nn.functional.interpolate', 'F.interpolate', (['image'], {'size': '(256, 256)'}), '(image, size=(256, 256))\n', (6426, 6450), True, 'import torch.nn.functional as F\n'), ((8518, 8541), 'numpy.array', 'np.array', (['self.features'], {}), '(self.features)\n', (8526, 8541), True, 'import numpy as np...
# # This demo showcases some components of cvui being used to control # the application of the Canny edge algorithm to a loaded image. # # Copyright (c) 2018 <NAME> <<EMAIL>> # Licensed under the MIT license. # import numpy as np import cv2 import cvui WINDOW_NAME = 'CVUI Canny Edge' def main(): lena = cv2.imread('...
[ "cvui.init", "cvui.window", "cv2.Canny", "cvui.checkbox", "cv2.cvtColor", "cv2.waitKey", "numpy.zeros", "cvui.trackbar", "cv2.imread", "cv2.imshow", "cvui.update" ]
[((308, 348), 'cv2.imread', 'cv2.imread', (['"""lena.jpg"""', 'cv2.IMREAD_COLOR'], {}), "('lena.jpg', cv2.IMREAD_COLOR)\n", (318, 348), False, 'import cv2\n'), ((358, 388), 'numpy.zeros', 'np.zeros', (['lena.shape', 'np.uint8'], {}), '(lena.shape, np.uint8)\n', (366, 388), True, 'import numpy as np\n'), ((545, 567), 'c...
"""DMRG-like variational algorithms, but in tensor network language. """ import itertools import numpy as np from ..utils import progbar from ..core import prod from ..linalg.base_linalg import eig, eigh, IdentityLinearOperator from .tensor_core import ( Tensor, tensor_contract, TNLinearOperator, asar...
[ "numpy.abs", "numpy.argmax", "numpy.argmin", "itertools.cycle", "numpy.max", "numpy.dot", "itertools.repeat" ]
[((39999, 40030), 'itertools.cycle', 'itertools.cycle', (['sweep_sequence'], {}), '(sweep_sequence)\n', (40014, 40030), False, 'import itertools\n'), ((46753, 46788), 'numpy.abs', 'np.abs', (['(self._eff_ovlp ^ all).data'], {}), '((self._eff_ovlp ^ all).data)\n', (46759, 46788), True, 'import numpy as np\n'), ((22315, ...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
[ "transformers.trainer_utils.set_seed", "transformers.MODEL_WITH_LM_HEAD_MAPPING.keys", "numpy.mean", "torch.no_grad", "os.path.join", "transformers.trainer_utils.nested_concat", "os.path.exists", "torch.exp", "transformers.trainer_utils.nested_numpify", "transformers.DataCollatorForLanguageModelin...
[((2092, 2119), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2109, 2119), False, 'import logging\n'), ((2150, 2183), 'transformers.MODEL_WITH_LM_HEAD_MAPPING.keys', 'MODEL_WITH_LM_HEAD_MAPPING.keys', ([], {}), '()\n', (2181, 2183), False, 'from transformers import CONFIG_MAPPING, MODEL...
from __future__ import print_function # from builtins import print import numpy as np import scipy.io import tensorflow as tf import scipy.io as scio from timeit import default_timer as timer import matplotlib.pyplot as plt start = timer() trainData = scipy.io.loadmat('Trainset0504_Gul_12Exp_8960_2579.mat')['TrainD...
[ "tensorflow.confusion_matrix", "tensorflow.reshape", "tensorflow.matmul", "tensorflow.ConfigProto", "numpy.arange", "tensorflow.nn.conv2d", "tensorflow.nn.relu", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.placeholder", "tensorflow.cast", "tensorflow.summary.FileWriter", "te...
[((236, 243), 'timeit.default_timer', 'timer', ([], {}), '()\n', (241, 243), True, 'from timeit import default_timer as timer\n'), ((346, 381), 'numpy.reshape', 'np.reshape', (['trainData', '[8960, 2000]'], {}), '(trainData, [8960, 2000])\n', (356, 381), True, 'import numpy as np\n'), ((484, 517), 'numpy.reshape', 'np....
from dask import array import xarray as xr import numpy as np from dask.distributed import Client import copy from .logging_util import get_slug, debug, info, warn, warning def setup_dask_client(workers: int = 2, threads: int = 2, memory_limit_per_worker: str = "2GB"): Client(n_workers=workers, threads_per_worker...
[ "matplotlib.pyplot.title", "xarray.ufuncs.sqrt", "cartopy.feature.NaturalEarthFeature", "matplotlib.pyplot.figure", "xarray.ufuncs.cos", "dask.distributed.Client", "xarray.ufuncs.deg2rad", "matplotlib.pyplot.close", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.clim", "matplotlib.pyplot.show"...
[((276, 372), 'dask.distributed.Client', 'Client', ([], {'n_workers': 'workers', 'threads_per_worker': 'threads', 'memory_limit': 'memory_limit_per_worker'}), '(n_workers=workers, threads_per_worker=threads, memory_limit=\n memory_limit_per_worker)\n', (282, 372), False, 'from dask.distributed import Client\n'), ((2...
from collections.abc import Sequence import cupy import numpy as np import pandas as pd import cudf from cudf.api.types import is_list_like from cudf.core.column import as_column, build_categorical_column from cudf.core.index import IntervalIndex, interval_range def cut( x, bins, right: bool = True, ...
[ "cudf.api.types.is_list_like", "cupy.asarray", "cudf.Series", "cudf.core.index.IntervalIndex.from_breaks", "cudf._lib.labeling.label_bins", "cudf.core.index.as_index", "cudf.core.index.interval_range", "numpy.around", "cudf.CategoricalIndex", "numpy.linspace", "cudf.core.column.as_column", "cu...
[((6982, 6994), 'cudf.core.column.as_column', 'as_column', (['x'], {}), '(x)\n', (6991, 6994), False, 'from cudf.core.column import as_column, build_categorical_column\n'), ((9555, 9657), 'cudf._lib.labeling.label_bins', 'cudf._lib.labeling.label_bins', (['input_arr', 'left_edges', 'left_inclusive', 'right_edges', 'rig...
import os import arrow import logging import argparse import numpy as np import torch import torch as th import torch.nn as nn import cv2 from pathlib import Path from skimage.metrics import structural_similarity as ssim from torch.autograd import Variable from leibniz.unet import resunet from leibniz.unet.hyperbolic...
[ "os.mkdir", "argparse.ArgumentParser", "os.unlink", "pathlib.Path", "numpy.random.normal", "torch.no_grad", "torch.nn.MSELoss", "numpy.set_printoptions", "torch.nn.BCELoss", "torch.utils.data.DataLoader", "arrow.now", "cv2.imwrite", "os.path.exists", "torch.nn.Linear", "torch.zeros", "...
[((401, 426), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (424, 426), False, 'import argparse\n'), ((1262, 1299), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': 'np.inf'}), '(linewidth=np.inf)\n', (1281, 1299), True, 'import numpy as np\n'), ((1381, 1407), 'pathlib.Path'...
""" Author : <NAME>\n email : <EMAIL>\n LICENSE : MIT License """ import torch from torch import nn import pandas as pd import matplotlib.pyplot as plt from msdlib import msd import numpy as np import os import joblib import time plt.rcParams['figure.facecolor'] = 'white' class NNmodel(nn.Module)...
[ "torch.nn.Dropout", "numpy.random.seed", "numpy.argmax", "joblib.dump", "torch.cat", "torch.cuda.device_count", "numpy.mean", "torch.optim.lr_scheduler.LambdaLR", "numpy.arange", "torch.nn.Softmax", "torch.device", "msdlib.msd.class_result", "torch.no_grad", "numpy.round", "pandas.DataFr...
[((883, 909), 'numpy.random.seed', 'np.random.seed', (['seed_value'], {}), '(seed_value)\n', (897, 909), True, 'import numpy as np\n'), ((919, 948), 'torch.manual_seed', 'torch.manual_seed', (['seed_value'], {}), '(seed_value)\n', (936, 948), False, 'import torch\n'), ((1073, 1099), 'torch.nn.ModuleList', 'nn.ModuleLis...
import pandas as pd import numpy as np import ast import matplotlib.pyplot as plt df = pd.read_csv("statistics_correct_51.csv") qtablelist = df["qtable"].values epsionlist = list(df["epsilon"].values) q_tables = [] epsilons = [] for i in range(len(qtablelist)): qtable_string = qtablelist[i] epsilon = epsionli...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.legend", "numpy.array", "ast.literal_eval", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((88, 128), 'pandas.read_csv', 'pd.read_csv', (['"""statistics_correct_51.csv"""'], {}), "('statistics_correct_51.csv')\n", (99, 128), True, 'import pandas as pd\n'), ((513, 531), 'numpy.array', 'np.array', (['q_tables'], {}), '(q_tables)\n', (521, 531), True, 'import numpy as np\n'), ((543, 561), 'numpy.array', 'np.a...
"""Reader for the GMSH file format.""" __copyright__ = "Copyright (C) 2009 <NAME>, <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 withou...
[ "gmsh_interop_b.runner.GmshRunner", "pytools.generate_nonnegative_integer_tuples_summing_to_at_most", "numpy.array", "pytools.factorial", "warnings.warn", "pytools.generate_nonnegative_integer_tuples_below" ]
[((2872, 2921), 'pytools.generate_nonnegative_integer_tuples_below', 'generate_nonnegative_integer_tuples_below', (['(2)', 'dim'], {}), '(2, dim)\n', (2913, 2921), False, 'from pytools import generate_nonnegative_integer_tuples_below\n'), ((14152, 14359), 'gmsh_interop_b.runner.GmshRunner', 'GmshRunner', (['source', 'd...
import numpy as np import pandas as pd from os.path import split import re class ExtractBase: """Container for parameters extracted from a hysteresis loop. A noun not a verb (vanilla extract, not extract the minerals). Attributes: xcoords (numpy.ndarray): List of extracted x-coordinates yc...
[ "pandas.DataFrame", "numpy.abs", "numpy.histogram", "numpy.mean", "numpy.array", "numpy.where", "numpy.arange", "numpy.min", "numpy.max", "os.path.split", "re.search" ]
[((2357, 2377), 'numpy.array', 'np.array', (['hc_indices'], {}), '(hc_indices)\n', (2365, 2377), True, 'import numpy as np\n'), ((3366, 3386), 'numpy.array', 'np.array', (['hc_indices'], {}), '(hc_indices)\n', (3374, 3386), True, 'import numpy as np\n'), ((5420, 5454), 'numpy.array', 'np.array', (['[rem_ind_03, rem_ind...
# bernstein_polynomial.py import math import numpy as np def bernstein_polynomial(i: int, p: int, nti: int = 2, verbose: bool = False): """Computes the Bernstein polynomial Args: i (int): control point, i >= 0 and i <=p p (int): polynomial degree, p >= 1 nti (int): number of time inte...
[ "math.factorial", "numpy.linspace" ]
[((663, 689), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(nti + 1)'], {}), '(0, 1, nti + 1)\n', (674, 689), True, 'import numpy as np\n'), ((717, 734), 'math.factorial', 'math.factorial', (['p'], {}), '(p)\n', (731, 734), False, 'import math\n'), ((750, 767), 'math.factorial', 'math.factorial', (['i'], {}), '(i)...
__author__ = "<NAME>" __license__ = "MIT" import numpy as np class EdgePriorityQueue: def __init__(self, node_id: int, edge_weights: np.ndarray): self.target = np.full(edge_weights.shape, node_id) self.weights = edge_weights self.weights[node_id] = np.nan def __len__(self): ...
[ "numpy.full", "numpy.count_nonzero", "numpy.zeros", "numpy.isinf", "numpy.isnan", "numpy.nanmin", "numpy.arange", "numpy.nanargmax", "numpy.nanmax" ]
[((1523, 1546), 'numpy.arange', 'np.arange', (['max_vertices'], {}), '(max_vertices)\n', (1532, 1546), True, 'import numpy as np\n'), ((1570, 1593), 'numpy.arange', 'np.arange', (['max_vertices'], {}), '(max_vertices)\n', (1579, 1593), True, 'import numpy as np\n'), ((3692, 3715), 'numpy.zeros', 'np.zeros', (['n'], {'d...
#<NAME> <EMAIL> #See the github repository for more information: https://github.com/alexholcombe/twoWords from __future__ import print_function from psychopy import monitors, visual, event, data, logging, core, sound, gui import psychopy.info import numpy as np from math import atan, log, ceil import copy import time, ...
[ "psychopy.logging.warn", "psychopy.logging.error", "stringResponse.collectStringResponse", "psychopy.data.TrialHandler", "numpy.floor", "numpy.ones", "numpy.isnan", "numpy.around", "numpy.random.randint", "psychopy.sound.Sound", "psychopy.gui.DlgFromDict", "os.path.join", "numpy.round", "p...
[((1255, 1291), 'os.path.isdir', 'os.path.isdir', (["('.' + os.sep + 'data')"], {}), "('.' + os.sep + 'data')\n", (1268, 1291), False, 'import os\n'), ((1748, 1815), 'numpy.array', 'np.array', (['[5, 20, 20, 20, 50, 50, 50, 5, 80, 80, 80, 5, 95, 95, 95]'], {}), '([5, 20, 20, 20, 50, 50, 50, 5, 80, 80, 80, 5, 95, 95, 95...
import os import numpy as np import matplotlib.pyplot as plt import scipy.integrate import pandas as pd import math #===INITIALISE=== pltno = 500 # how many gillespie do you want? endTime = 12000 # When should Gillespie stop? 25k seconds is ca 20 cycles (24000) cutoff1 = 25 cutoff2 = 10 cutoff3 = 5 k0 = 0.2 #s^-1 k...
[ "matplotlib.pyplot.title", "numpy.random.uniform", "numpy.average", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.hist", "numpy.std", "matplotlib.pyplot.legend", "numpy.random.exponential", "matplotlib.pyplot.figure", "numpy.max", "numpy.min", "numpy.linspace", "ma...
[((6163, 6181), 'numpy.average', 'np.average', (['flat_m'], {}), '(flat_m)\n', (6173, 6181), True, 'import numpy as np\n'), ((6192, 6206), 'numpy.var', 'np.var', (['flat_m'], {}), '(flat_m)\n', (6198, 6206), True, 'import numpy as np\n'), ((6405, 6426), 'numpy.average', 'np.average', (['flat_newm'], {}), '(flat_newm)\n...
import numpy as np import matplotlib.pyplot as plt from sklearn.decomposition import PCA from sklearn.datasets import make_circles from O5 import rbf_kernel_pca X, y = make_circles(n_samples=1000, random_state=123, noise=0.1, factor=0.2) plt.scatter(X[y == 0, 0], X[y == 0, 1], color=...
[ "sklearn.datasets.make_circles", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "numpy.zeros", "matplotlib.pyplot.subplots", "sklearn.decomposition.PCA", "O5.rbf_kernel_pca", "matplotlib.pyplot.tight_layout" ]
[((171, 240), 'sklearn.datasets.make_circles', 'make_circles', ([], {'n_samples': '(1000)', 'random_state': '(123)', 'noise': '(0.1)', 'factor': '(0.2)'}), '(n_samples=1000, random_state=123, noise=0.1, factor=0.2)\n', (183, 240), False, 'from sklearn.datasets import make_circles\n'), ((262, 337), 'matplotlib.pyplot.sc...
from __future__ import print_function from contextlib import contextmanager import sys import threading import numpy as np from numba.six import reraise from .cudadrv.devicearray import to_device, auto_device from .kernelapi import Dim3, FakeCUDAModule, swapped_cuda_module from ..errors import normalize_kernel_dimen...
[ "numpy.ndindex", "numba.six.reraise", "threading.Event", "sys.exc_info" ]
[((3537, 3554), 'threading.Event', 'threading.Event', ([], {}), '()\n', (3552, 3554), False, 'import threading\n'), ((5526, 5554), 'numpy.ndindex', 'np.ndindex', (['*self._block_dim'], {}), '(*self._block_dim)\n', (5536, 5554), True, 'import numpy as np\n'), ((2353, 2379), 'numpy.ndindex', 'np.ndindex', (['*self.grid_d...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import unittest import pygimli as pg import numpy as np class TestPLCIO(unittest.TestCase): def test_io_triangle(self): """ """ # create tempfile in most secure manner, only accesible by this process # id no execution allo...
[ "unittest.main", "pygimli.Mesh", "pygimli.meshtools.readPLC", "os.remove", "tempfile.mkstemp", "pygimli.load", "pygimli.meshtools.exportPLC", "numpy.array" ]
[((5707, 5722), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5720, 5722), False, 'import unittest\n'), ((504, 531), 'tempfile.mkstemp', 'tmp.mkstemp', ([], {'suffix': '""".poly"""'}), "(suffix='.poly')\n", (515, 531), True, 'import tempfile as tmp\n'), ((588, 598), 'pygimli.Mesh', 'pg.Mesh', (['(2)'], {}), '(2)...
import pandas as pd import numpy as np import sklearn from sklearn.linear_model import LogisticRegression from sklearn.utils import shuffle from sklearn.metrics import classification_report PCOS_DATA_FILENAME = 'PCOS_data_without_infertility.csv' PREDICTION_COLUMN = 'PCOS (Y/N)' TEST_SIZE = 0.05 UNUSED_COLUMNS = [ ...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.classification_report", "sklearn.linear_model.LogisticRegression", "numpy.array" ]
[((730, 768), 'numpy.array', 'np.array', (['pcos_data[PREDICTION_COLUMN]'], {}), '(pcos_data[PREDICTION_COLUMN])\n', (738, 768), True, 'import numpy as np\n'), ((891, 958), 'sklearn.model_selection.train_test_split', 'sklearn.model_selection.train_test_split', (['X', 'y'], {'test_size': 'TEST_SIZE'}), '(X, y, test_size...
"""Classes for odorants, mixtures, chemical orders, etc.""" import base64 import io import json import re import time import warnings from collections import OrderedDict from datetime import datetime from urllib.parse import quote import numpy as np import pandas as pd import pubchempy as pcp import requests from IP...
[ "matplotlib.pyplot.title", "numpy.sum", "numpy.isnan", "rdkit.RDLogger.logger", "matplotlib.pyplot.figure", "rdkit.Chem.AllChem.UFFOptimizeMolecule", "rdkit.Chem.AllChem.EmbedMolecule", "matplotlib.pyplot.gca", "rdkit.Chem.MolToSmiles", "rdkit.Chem.AddHs", "rdkit.Chem.Draw.MolToImage", "json.l...
[((699, 716), 'rdkit.RDLogger.logger', 'RDLogger.logger', ([], {}), '()\n', (714, 716), False, 'from rdkit import RDLogger\n'), ((11495, 11512), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (11507, 11512), False, 'import requests\n'), ((12762, 12788), 'rdkit.Chem.MolFromSmiles', 'Chem.MolFromSmiles', (['sm...
from __future__ import absolute_import from __future__ import division from __future__ import print_function __author__ = "<NAME>" """ Extract BERT contextualized token embedding, using [1]. Modified from [4]. Specially designed for extract TVQA text features. Instructions: 0, This code should be running at Python 3....
[ "argparse.ArgumentParser", "pytorch_pretrained_bert.tokenization.BertTokenizer.from_pretrained", "logging.getLogger", "torch.cuda.device_count", "pytorch_pretrained_bert.modeling.BertModel.from_pretrained", "os.path.join", "torch.utils.data.DataLoader", "torch.utils.data.SequentialSampler", "easydic...
[((1806, 1949), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(name)s - %(message)s"""', 'datefmt': '"""%m/%d/%Y %H:%M:%S"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt=\n '%m/%d/%Y %H:%M:%S', level...
from builtins import range import keras from keras import backend as K from keras import layers from keras import models import logging import numpy as np import pandas as pd import pandas_gbq import tensorflow as tf from tensorflow.python.saved_model import builder as saved_model_builder from tensorflow.python.sav...
[ "tensorflow.python.saved_model.signature_def_utils_impl.predict_signature_def", "numpy.nan_to_num", "tensorflow.python.saved_model.builder.SavedModelBuilder", "tensorflow.io.gfile.GFile", "keras.backend.get_session", "pandas.get_dummies", "keras.layers.Dropout", "keras.optimizers.Adam", "keras.model...
[((1174, 1220), 'pandas_gbq.read_gbq', 'pandas_gbq.read_gbq', (['SQL'], {'project_id': '"""mwpmltr"""'}), "(SQL, project_id='mwpmltr')\n", (1193, 1220), False, 'import pandas_gbq\n'), ((1549, 1595), 'pandas_gbq.read_gbq', 'pandas_gbq.read_gbq', (['SQL'], {'project_id': '"""mwpmltr"""'}), "(SQL, project_id='mwpmltr')\n"...
def example(Simulator): from csdl import Model import csdl import numpy as np class ExampleMultipleTensorRandom(Model): def define(self): n = 3 m = 6 p = 7 q = 10 np.random.seed(0) # Declare a tensor of s...
[ "numpy.random.rand", "csdl.sum", "numpy.random.seed" ]
[((262, 279), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (276, 279), True, 'import numpy as np\n'), ((805, 821), 'csdl.sum', 'csdl.sum', (['T1', 'T2'], {}), '(T1, T2)\n', (813, 821), False, 'import csdl\n'), ((425, 454), 'numpy.random.rand', 'np.random.rand', (['(n * m * p * q)'], {}), '(n * m * p *...
import numpy as np import os import subprocess source_dir = 'imagenet/train' target_dir = 'data/ILSVRC' percentage_train_class = 90 percentage_test_class = 10 train_test_ratio = [ percentage_train_class, percentage_test_class] classes = os.listdir(source_dir) rs = np.random.RandomState(123) rs.shuffle(classes) ...
[ "numpy.sum", "os.makedirs", "os.path.exists", "numpy.random.RandomState", "subprocess.call", "os.path.join", "os.listdir" ]
[((244, 266), 'os.listdir', 'os.listdir', (['source_dir'], {}), '(source_dir)\n', (254, 266), False, 'import os\n'), ((273, 299), 'numpy.random.RandomState', 'np.random.RandomState', (['(123)'], {}), '(123)\n', (294, 299), True, 'import numpy as np\n'), ((998, 1029), 'os.path.join', 'os.path.join', (['target_dir', '"""...
import time import numpy as np class FPSCounter: def __init__(self): current_time = time.time() self.start_time_for_display = current_time self.last_time = current_time self.x = 5 # displays the frame rate every X second self.time_between_calls = [] self.elements_f...
[ "numpy.mean", "time.time" ]
[((98, 109), 'time.time', 'time.time', ([], {}), '()\n', (107, 109), False, 'import time\n'), ((403, 414), 'time.time', 'time.time', ([], {}), '()\n', (412, 414), False, 'import time\n'), ((665, 697), 'numpy.mean', 'np.mean', (['self.time_between_calls'], {}), '(self.time_between_calls)\n', (672, 697), True, 'import nu...
import pandas as pd import numpy import matplotlib.pyplot as plt from keras.wrappers.scikit_learn import KerasRegressor from sklearn.model_selection import cross_val_score from sklearn.model_selection import KFold from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline print("Importing ...
[ "numpy.random.seed", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "sklearn.model_selection.cross_val_score", "sklearn.model_selection.KFold", "matplotlib.pyplot.figure", "keras.layers.Dense", "keras.models.Sequential", "keras.wrappers.scikit_learn.KerasRegressor", "nump...
[((423, 443), 'numpy.random.seed', 'numpy.random.seed', (['(7)'], {}), '(7)\n', (440, 443), False, 'import numpy\n'), ((3831, 3878), 'pandas.read_csv', 'pd.read_csv', (['file_name'], {'header': 'None', 'skiprows': '(2)'}), '(file_name, header=None, skiprows=2)\n', (3842, 3878), True, 'import pandas as pd\n'), ((4114, 4...
from random import randint, shuffle import numpy as np import pytest from mmgroup import MM0, MMSpace, Cocode, GCode, AutPL, MMV #from general import get_case, leech_type, span from mmgroup import mat24 from mmgroup.mat24 import MAT24_ORDER, gcode_weight from mmgroup.generators import gen_leech2_type from mmgroup...
[ "mmgroup.mat24.perm_to_matrix", "mmgroup.mat24.perm_from_heptads", "random.shuffle", "mmgroup.clifford12.leech_matrix_2A_axis_type", "mmgroup.mat24.syndrome", "mmgroup.mat24.perm_to_m24num", "mmgroup.generators.gen_leech2_reduce_type2_ortho", "mmgroup.mat24.cocode_syndrome", "mmgroup.mat24.gcode_wei...
[((644, 651), 'mmgroup.MMV', 'MMV', (['(15)'], {}), '(15)\n', (647, 651), False, 'from mmgroup import MM0, MMSpace, Cocode, GCode, AutPL, MMV\n'), ((1596, 1613), 'mmgroup.mat24.inv_perm', 'mat24.inv_perm', (['p'], {}), '(p)\n', (1610, 1613), False, 'from mmgroup import mat24\n'), ((1631, 1658), 'mmgroup.mat24.perm_to_m...
import nanome import math from .rmsd_calculation import ( centroid, get_atom_types, kabsch, kabsch_rmsd, quaternion_rmsd, reorder_hungarian, reorder_brute, reorder_distance, check_reflections, rmsd) from .rmsd_menu import RMSDMenu from . import rmsd_helpers as help from nanome.util import Logs, ComplexUtils imp...
[ "numpy.count_nonzero", "nanome.util.ComplexUtils.align_to", "numpy.asarray", "nanome.util.Matrix.from_quaternion", "nanome.util.Logs.debug", "nanome.Plugin", "nanome.util.Matrix", "nanome.util.Quaternion.from_matrix" ]
[((15772, 15862), 'nanome.Plugin', 'nanome.Plugin', (['"""RMSD"""', '"""Aligns complexes using RMSD calculations."""', '"""Alignment"""', '(False)'], {}), "('RMSD', 'Aligns complexes using RMSD calculations.',\n 'Alignment', False)\n", (15785, 15862), False, 'import nanome\n'), ((445, 476), 'nanome.util.Logs.debug',...
import logging import numpy as np import threading from ray.rllib.policy.sample_batch import MultiAgentBatch from ray.rllib.utils.annotations import PublicAPI from ray.rllib.utils.framework import try_import_tf from typing import Dict, List from ray.rllib.utils.types import TensorType, SampleBatchType tf1, tf, tfv = ...
[ "threading.Thread.__init__", "ray.rllib.utils.framework.try_import_tf", "numpy.issubdtype", "logging.getLogger" ]
[((320, 335), 'ray.rllib.utils.framework.try_import_tf', 'try_import_tf', ([], {}), '()\n', (333, 335), False, 'from ray.rllib.utils.framework import try_import_tf\n'), ((346, 373), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (363, 373), False, 'import logging\n'), ((3466, 3497), 'thre...
# -*- coding: utf-8 -*- # noqa: D205,D400 """ Run length algorithms submodule =============================== Computation of statistics on runs of True values in boolean arrays. """ from datetime import datetime from functools import partial from typing import Optional, Sequence, Tuple, Union from warnings import warn...
[ "numpy.arange", "xarray.full_like", "numpy.full", "xarray.core.utils.get_temp_dimname", "numpy.power", "numpy.append", "xarray.where", "functools.partial", "numpy.asarray", "numpy.isinf", "xarray.Dataset", "xarray.concat", "datetime.datetime.strptime", "xclim.core.utils.uses_dask", "nump...
[((2867, 2886), 'xarray.broadcast', 'xr.broadcast', (['i', 'da'], {}), '(i, da)\n', (2879, 2886), True, 'import xarray as xr\n'), ((3305, 3338), 'xarray.concat', 'xr.concat', (['[start1, b, end1]', 'dim'], {}), '([start1, b, end1], dim)\n', (3314, 3338), True, 'import xarray as xr\n'), ((14149, 14164), 'xclim.core.util...
import cv2 import torch import numpy as np from tqdm import tqdm from timeit import default_timer as timer from ptflops import get_model_complexity_info from pypapi import papi_high from pypapi import events as papi_events from pypapi.exceptions import PapiNoEventError import argparse from pvdn.detection.model.proposa...
[ "cv2.resize", "pvdn.detection.model.proposals.DynamicBlobDetector.from_yaml", "tqdm.tqdm", "argparse.ArgumentParser", "pvdn.detection.model.single_flow_classifier.Classifier", "numpy.std", "timeit.default_timer", "torch.load", "pvdn.PVDNDataset", "pypapi.papi_high.start_counters", "pypapi.papi_h...
[((4422, 4444), 'pvdn.PVDNDataset', 'PVDNDataset', ([], {'path': 'data'}), '(path=data)\n', (4433, 4444), False, 'from pvdn import PVDNDataset\n'), ((4884, 4897), 'tqdm.tqdm', 'tqdm', (['dataset'], {}), '(dataset)\n', (4888, 4897), False, 'from tqdm import tqdm\n'), ((6435, 6460), 'argparse.ArgumentParser', 'argparse.A...
# Copyright 2020 The PyMC Developers # # 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 ag...
[ "pymc.variational.approximations.Empirical", "numpy.empty", "numpy.asarray", "pymc.modelcontext", "numpy.isfinite", "logging.getLogger", "numpy.isnan", "numpy.mean", "collections.namedtuple", "pymc.variational.approximations.FullRank", "warnings.warn", "pymc.variational.opvi.AEVBInferenceError...
[((928, 955), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (945, 955), False, 'import logging\n'), ((1101, 1158), 'collections.namedtuple', 'collections.namedtuple', (['"""State"""', '"""i,step,callbacks,score"""'], {}), "('State', 'i,step,callbacks,score')\n", (1123, 1158), False, 'imp...
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "numpy.tanh", "tensorflow.compat.v2.test.main", "tensorflow.compat.v2.cast", "tensorflow_probability.python.bijectors.Tanh", "tensorflow_probability.python.bijectors.Sigmoid", "numpy.linspace" ]
[((3519, 3533), 'tensorflow.compat.v2.test.main', 'tf.test.main', ([], {}), '()\n', (3531, 3533), True, 'import tensorflow.compat.v2 as tf\n'), ((1443, 1453), 'numpy.tanh', 'np.tanh', (['x'], {}), '(x)\n', (1450, 1453), True, 'import numpy as np\n'), ((1514, 1524), 'tensorflow_probability.python.bijectors.Tanh', 'tfb.T...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import (assert_allclose, assert_array_almost_equal_nulp, assert_equal) from astropy.stats.biweight import (biweight_location, biweight_scale, ...
[ "astropy.tests.helper.catch_warnings", "numpy.ones", "numpy.isnan", "astropy.utils.misc.NumpyRNGContext", "numpy.arange", "numpy.random.normal", "astropy.stats.biweight.biweight_location", "astropy.stats.biweight.biweight_midcorrelation", "numpy.random.randn", "numpy.testing.assert_array_almost_eq...
[((959, 973), 'numpy.ones', 'np.ones', (['shape'], {}), '(shape)\n', (966, 973), True, 'import numpy as np\n'), ((984, 1015), 'astropy.stats.biweight.biweight_location', 'biweight_location', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (1001, 1015), False, 'from astropy.stats.biweight import biweight_location, biwe...
"""Tests of routines in cells.py.""" import os import numpy as np import pytest from phonopy import Phonopy from phonopy.interface.phonopy_yaml import read_cell_yaml from phonopy.structure.atoms import PhonopyAtoms from phonopy.structure.cells import ( ShortestPairs, TrimmedCell, compute_all_sg_permutatio...
[ "numpy.sum", "phonopy.structure.cells.ShortestPairs", "phonopy.structure.cells.compute_permutation_for_rotation", "pytest.mark.parametrize", "phonopy.structure.cells.sparse_to_dense_svecs", "numpy.diag", "os.path.join", "os.path.abspath", "phonopy.structure.cells.convert_to_phonopy_primitive", "py...
[((2845, 2892), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""nosnf"""', '[True, False]'], {}), "('nosnf', [True, False])\n", (2868, 2892), False, 'import pytest\n'), ((3139, 3186), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""nosnf"""', '[True, False]'], {}), "('nosnf', [True, False])\n", ...
import numpy from chaco.plot import Plot, ArrayPlotData from chaco.api import ToolbarPlot from chaco.tools.api import PanTool, ZoomTool from enable.api import ComponentEditor from traits.api import Instance, HasTraits from traitsui.api import View, Item class ExamplePlotApp(HasTraits): plot = Instance(Plot) ...
[ "traits.api.Instance", "chaco.api.ToolbarPlot", "chaco.tools.api.ZoomTool", "enable.api.ComponentEditor", "numpy.arange", "chaco.tools.api.PanTool", "chaco.plot.ArrayPlotData" ]
[((1120, 1149), 'numpy.arange', 'numpy.arange', (['(1.0)', '(10.0)', '(0.01)'], {}), '(1.0, 10.0, 0.01)\n', (1132, 1149), False, 'import numpy\n'), ((302, 316), 'traits.api.Instance', 'Instance', (['Plot'], {}), '(Plot)\n', (310, 316), False, 'from traits.api import Instance, HasTraits\n'), ((643, 669), 'chaco.plot.Arr...
import pandas as pd import streamlit as st import numpy as np import pickle from sklearn.metrics.pairwise import cosine_similarity from sklearn.preprocessing import MinMaxScaler from PIL import Image # Header header_image = Image.open('Images/ebooks.jpg') st.image(header_image) # Creating sidebar comments st.sidebar...
[ "streamlit.text_input", "streamlit.image", "streamlit.sidebar.subheader", "streamlit.sidebar.write", "streamlit.table", "pandas.read_csv", "streamlit.title", "streamlit.sidebar.title", "streamlit.sidebar.radio", "pandas.DataFrame", "streamlit.subheader", "sklearn.metrics.pairwise.cosine_simila...
[((226, 257), 'PIL.Image.open', 'Image.open', (['"""Images/ebooks.jpg"""'], {}), "('Images/ebooks.jpg')\n", (236, 257), False, 'from PIL import Image\n'), ((258, 280), 'streamlit.image', 'st.image', (['header_image'], {}), '(header_image)\n', (266, 280), True, 'import streamlit as st\n'), ((310, 358), 'streamlit.sideba...
import numpy as np import seaborn as sns from scanorama import * from scipy.sparse import vstack from scipy.stats import ttest_ind from sklearn.metrics import roc_auc_score from sklearn.preprocessing import normalize, LabelEncoder import sys from process import load_names NAMESPACE = 'polarized' data_names = [ 'd...
[ "process.load_names", "numpy.zeros", "scipy.stats.ttest_ind", "sklearn.metrics.roc_auc_score", "numpy.mean", "numpy.array", "sklearn.preprocessing.normalize" ]
[((522, 556), 'process.load_names', 'load_names', (['data_names'], {'log1p': '(True)'}), '(data_names, log1p=True)\n', (532, 556), False, 'from process import load_names\n'), ((898, 925), 'numpy.array', 'np.array', (['labels'], {'dtype': 'int'}), '(labels, dtype=int)\n', (906, 925), True, 'import numpy as np\n'), ((108...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import pandas as pd from sklearn.metrics import mean_squared_error from typing import Dict, Text, Any import numpy as np from ...contrib.eva.alpha import calc_ic from ...workflow.record_temp import RecordTemp from ...workflow.record_temp impor...
[ "sklearn.metrics.mean_squared_error", "numpy.isnan", "numpy.sqrt" ]
[((2989, 3041), 'sklearn.metrics.mean_squared_error', 'mean_squared_error', (['pred.values[masks]', 'label[masks]'], {}), '(pred.values[masks], label[masks])\n', (3007, 3041), False, 'from sklearn.metrics import mean_squared_error\n'), ((2952, 2974), 'numpy.isnan', 'np.isnan', (['label.values'], {}), '(label.values)\n'...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ "tensorflow.train.BytesList", "numpy.sum", "tensorflow.train.Example", "tensorflow_datasets.as_numpy", "random.shuffle", "numpy.asarray", "tensorflow.train.Features", "tensorflow.io.parse_single_example", "jax.process_count", "tensorflow.cast", "tensorflow.data.Dataset.from_generator", "tensor...
[((9758, 9783), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (9781, 9783), False, 'import collections\n'), ((10636, 10688), 'tensorflow.io.parse_single_example', 'tf.io.parse_single_example', (['record', 'name_to_features'], {}), '(record, name_to_features)\n', (10662, 10688), True, 'import t...
import numpy as np import torch import matplotlib.pyplot as plt import tester from hyperparameters import * def train_fully_connected(train_set, model, test_set): optimizer = torch.optim.Adam(model.parameters(), lr=LR) losses = [] test_losses = [] for e in range(0, EPOCHS): print("Epoch: " + ...
[ "tester.test_fully_connected", "numpy.mean", "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ]
[((1092, 1108), 'matplotlib.pyplot.plot', 'plt.plot', (['losses'], {}), '(losses)\n', (1100, 1108), True, 'import matplotlib.pyplot as plt\n'), ((1113, 1134), 'matplotlib.pyplot.plot', 'plt.plot', (['test_losses'], {}), '(test_losses)\n', (1121, 1134), True, 'import matplotlib.pyplot as plt\n'), ((1139, 1149), 'matplot...
""" Class to batch data conveniently """ #------------------------------------------------------------------------------- import pickle import collections import numpy as np from deepnodal.python.cloud.gs import * #------------------------------------------------------------------------------- DEFAULT_SET_NAME ='tra...
[ "numpy.random.seed", "numpy.logical_and", "numpy.mod", "numpy.cumsum", "pickle.load", "numpy.arange", "numpy.array", "numpy.random.permutation", "collections.OrderedDict", "numpy.atleast_1d", "numpy.concatenate" ]
[((1190, 1215), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (1213, 1215), False, 'import collections\n'), ((3124, 3146), 'numpy.concatenate', 'np.concatenate', (['inputs'], {}), '(inputs)\n', (3138, 3146), True, 'import numpy as np\n'), ((3174, 3196), 'numpy.concatenate', 'np.concatenate', (...
import os import sys import json import matplotlib.pyplot as plt import numpy as np import pint from pathlib import Path sys.path.append(os.path.abspath("../../..")) from pycato import * two_pi = (2 * np.pi) * ureg("radian") # Read grid specs from a json file with open("grid_spec.json", "r") as f: grid = json.lo...
[ "os.path.abspath", "json.load", "numpy.abs", "numpy.exp", "numpy.cos", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.sqrt" ]
[((2575, 2605), 'numpy.exp', 'np.exp', (['(-k.m * (x - x0).m ** 2)'], {}), '(-k.m * (x - x0).m ** 2)\n', (2581, 2605), True, 'import numpy as np\n'), ((2746, 2802), 'numpy.abs', 'np.abs', (["(perturbation_loc * grid['perturbation_fraction'])"], {}), "(perturbation_loc * grid['perturbation_fraction'])\n", (2752, 2802), ...
""" Double DQN & Natural DQN comparison, The Pendulum example. View more on my tutorial page: https://morvanzhou.github.io/tutorials/ Using: Tensorflow: 1.0 gym: 0.8.0 """ import gym from RL_brain import DoubleDQN import numpy as np import matplotlib.pyplot as plt import tensorflow as tf env = gym.make('Pendulum-...
[ "RL_brain.DoubleDQN", "matplotlib.pyplot.show", "gym.make", "tensorflow.global_variables_initializer", "matplotlib.pyplot.legend", "tensorflow.Session", "tensorflow.variable_scope", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid" ]
[((301, 324), 'gym.make', 'gym.make', (['"""Pendulum-v0"""'], {}), "('Pendulum-v0')\n", (309, 324), False, 'import gym\n'), ((430, 442), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (440, 442), True, 'import tensorflow as tf\n'), ((2089, 2111), 'matplotlib.pyplot.legend', 'plt.legend', ([], {'loc': '"""best"""...
import numpy as np from skimage.measure import block_reduce def crop_and_resize(img, target_size=32, zoom=1): small_side = int(np.min(img.shape) * zoom) reduce_factor = small_side / target_size crop_size = target_size * reduce_factor mid = np.array(img.shape) / 2 half_crop = crop_size / 2 cente...
[ "skimage.measure.block_reduce", "numpy.min", "numpy.array" ]
[((414, 475), 'skimage.measure.block_reduce', 'block_reduce', (['center', '(reduce_factor, reduce_factor)', 'np.mean'], {}), '(center, (reduce_factor, reduce_factor), np.mean)\n', (426, 475), False, 'from skimage.measure import block_reduce\n'), ((257, 276), 'numpy.array', 'np.array', (['img.shape'], {}), '(img.shape)\...
import numpy as np import numba @numba.jit(cache=True, fastmath=True, nopython=True) def BiCG_solver(A_matrix, f_vector, u0_vector=None, eps=10e-7, n_iter=10000): if A_matrix.shape[0] != A_matrix.shape[1]: print("\n A_matrix is not a square matrix \n") raise ValueError #...
[ "numpy.full", "numpy.random.uniform", "numpy.conj", "numpy.abs", "numba.jit" ]
[((35, 86), 'numba.jit', 'numba.jit', ([], {'cache': '(True)', 'fastmath': '(True)', 'nopython': '(True)'}), '(cache=True, fastmath=True, nopython=True)\n', (44, 86), False, 'import numba\n'), ((875, 900), 'numpy.full', 'np.full', (['(row_size,)', '(0.0)'], {}), '((row_size,), 0.0)\n', (882, 900), True, 'import numpy a...
import os import numpy as np import pandas as pd from keras.preprocessing.image import load_img, save_img, img_to_array from keras.applications.imagenet_utils import preprocess_input from keras.preprocessing import image import cv2 from pathlib import Path import gdown import hashlib import math from PIL import Image i...
[ "os.mkdir", "pathlib.Path.home", "cv2.imdecode", "base64.b64decode", "keras.preprocessing.image.img_to_array", "os.path.isfile", "tensorflow.ConfigProto", "pandas.DataFrame", "cv2.cvtColor", "os.path.exists", "hashlib.sha256", "numpy.arccos", "cv2.resize", "math.sqrt", "subprocess.check_...
[((560, 597), 'cv2.imdecode', 'cv2.imdecode', (['nparr', 'cv2.IMREAD_COLOR'], {}), '(nparr, cv2.IMREAD_COLOR)\n', (572, 597), False, 'import cv2\n'), ((687, 743), 'math.sqrt', 'math.sqrt', (['((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))'], {}), '((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))\n', (696, 743), False, ...
import torch import torchvision import torchvision.transforms as tvt import torch.nn as nn import matplotlib.pyplot as plt import numpy as np from torch import optim import torch.nn.functional as F import math as m import time import os #from google.colab import drive import random from PIL import Image from torch.aut...
[ "test_retrieval.testWbeta", "pickle.dump", "argparse.ArgumentParser", "torch.cat", "time.strftime", "test_retrieval.testWbetaWsaveddata", "test_retrieval.testLoaded", "torch.nn.CosineSimilarity", "pickle.load", "numpy.linalg.norm", "torch.device", "torchvision.transforms.Normalize", "torch.n...
[((1324, 1423), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['trainset'], {'batch_size': 'batch_size_all', 'shuffle': '(False)', 'num_workers': '(2)'}), '(trainset, batch_size=batch_size_all, shuffle=\n False, num_workers=2)\n', (1351, 1423), False, 'import torch\n'), ((1599, 1642), 'scipy.spatial...
import numpy as np import os from chainercv.datasets import VOCSemanticSegmentationDataset from chainercv.evaluations import calc_semantic_segmentation_confusion import imageio def run(args): dataset = VOCSemanticSegmentationDataset(split=args.chainer_eval_set, data_dir=args.voc12_root) labels = [dataset.get_...
[ "chainercv.evaluations.calc_semantic_segmentation_confusion", "chainercv.datasets.VOCSemanticSegmentationDataset", "numpy.mean", "numpy.diag", "os.path.join", "numpy.nanmean" ]
[((208, 298), 'chainercv.datasets.VOCSemanticSegmentationDataset', 'VOCSemanticSegmentationDataset', ([], {'split': 'args.chainer_eval_set', 'data_dir': 'args.voc12_root'}), '(split=args.chainer_eval_set, data_dir=args.\n voc12_root)\n', (238, 298), False, 'from chainercv.datasets import VOCSemanticSegmentationDatas...
# -*- coding: utf-8 -*- import copy import numpy as np import logging try: import cupy as cp cupy = True except: import numpy as cp cupy = False def beam_search(model, X, params, return_alphas=False, eos_sym=0, null_sym=2, model_ensemble=False, n_models=0): """ Beam search method for Cond mode...
[ "numpy.asnumpy", "numpy.log", "numpy.argmax", "numpy.asarray", "numpy.zeros", "numpy.expand_dims", "copy.copy", "numpy.argsort" ]
[((1667, 1700), 'numpy.zeros', 'cp.zeros', (['live_k'], {'dtype': '"""float32"""'}), "(live_k, dtype='float32')\n", (1675, 1700), True, 'import numpy as cp\n'), ((4108, 4121), 'numpy.log', 'cp.log', (['probs'], {}), '(probs)\n', (4114, 4121), True, 'import numpy as cp\n'), ((5082, 5119), 'numpy.zeros', 'cp.zeros', (['(...
# -*- coding: utf-8 -*- """ © <NAME>, <NAME>, 2017 Template and parent classes for creating reader/loader classes for datasets """ import inspect import threading import time from collections import OrderedDict, namedtuple from os import path from typing import Union import numpy as np from PIL import Image from mu...
[ "TeLL.utility.timer.Timer", "multiprocess.Process", "TeLL.dataprocessing.DataProcessing", "numpy.empty", "numpy.iinfo", "numpy.shape", "numpy.sin", "numpy.arange", "multiprocess.Queue", "os.path.join", "numpy.round", "numpy.unique", "numpy.prod", "tensorflow.examples.tutorials.mnist.input_...
[((6000, 6064), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""./samples/MNIST_data"""'], {'one_hot': '(False)'}), "('./samples/MNIST_data', one_hot=False)\n", (6025, 6064), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((6479, 6513), 'numpy...
import os import numpy as np import pandas as pd import cv2 from tqdm import tqdm import gzip import gc from keras.preprocessing import image from scipy.stats import skew, kurtosis, entropy from joblib import Parallel, delayed from utils import * train_file_dir = '../input/train_jpg' test_file_dir = '../input/test_jpg...
[ "pandas.read_csv", "gc.collect", "cv2.imread", "numpy.histogram", "numpy.array", "joblib.Parallel", "joblib.delayed", "os.path.join" ]
[((1165, 1178), 'numpy.array', 'np.array', (['out'], {}), '(out)\n', (1173, 1178), True, 'import numpy as np\n'), ((1204, 1216), 'gc.collect', 'gc.collect', ([], {}), '()\n', (1214, 1216), False, 'import gc\n'), ((1473, 1486), 'numpy.array', 'np.array', (['out'], {}), '(out)\n', (1481, 1486), True, 'import numpy as np\...
import logging import random from threading import Lock from time import time import numpy as np from pepper.framework.backend.abstract.motion import TOPIC_LOOK from pepper.framework.context.api import TOPIC_ON_CHAT_ENTER, TOPIC_ON_CHAT_EXIT, Context from pepper.framework.infra.event.api import Event, EventBus from p...
[ "pepper.framework.infra.resource.api.acquire", "pepper.framework.infra.event.api.Event", "time.time", "threading.Lock", "random.random", "numpy.random.standard_normal", "logging.getLogger" ]
[((580, 607), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (597, 607), False, 'import logging\n'), ((1365, 1371), 'threading.Lock', 'Lock', ([], {}), '()\n', (1369, 1371), False, 'from threading import Lock\n'), ((2633, 2725), 'pepper.framework.infra.event.api.Event', 'Event', (["{'dire...
# Sample code from the TorchVision 0.3 Object Detection Finetuning Tutorial # http://pytorch.org/tutorials/intermediate/torchvision_tutorial.html import os import numpy as np import torch from PIL import Image import torchvision from torchvision.models.detection.faster_rcnn import FastRCNNPredictor from torchvision.m...
[ "torchvision.models.detection.faster_rcnn.FastRCNNPredictor", "torch.optim.lr_scheduler.StepLR", "torch.device", "os.path.join", "numpy.unique", "torch.ones", "torch.utils.data.DataLoader", "torchvision.models.detection.maskrcnn_resnet50_fpn", "numpy.max", "torch.zeros", "engine.train_one_epoch"...
[((2944, 3011), 'torchvision.models.detection.maskrcnn_resnet50_fpn', 'torchvision.models.detection.maskrcnn_resnet50_fpn', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (2994, 3011), False, 'import torchvision\n'), ((3223, 3266), 'torchvision.models.detection.faster_rcnn.FastRCNNPredictor', 'FastRCNNPredictor...
import logging import gym import numpy as np from mlagents.envs import UnityEnvironment from gym import error, spaces class UnityGymException(error.Error): """ Any error related to the gym wrapper of ml-agents. """ pass logging.basicConfig(level=logging.INFO) logger = logging.getLogger("gym_unity") ...
[ "logging.basicConfig", "gym.spaces.Discrete", "gym.spaces.MultiDiscrete", "mlagents.envs.UnityEnvironment", "numpy.array", "gym.spaces.Box", "logging.getLogger" ]
[((240, 279), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (259, 279), False, 'import logging\n'), ((289, 319), 'logging.getLogger', 'logging.getLogger', (['"""gym_unity"""'], {}), "('gym_unity')\n", (306, 319), False, 'import logging\n'), ((1142, 1239), 'mlag...
from Individual import Individual import numpy import random class Population: popSize = 0 individuals = [] fittestScore = 0 fittest = None secondFittest = None def __init__(self, popsize): self.popSize = popsize self.individuals = numpy.empty(popsize, dtype=Indi...
[ "numpy.empty", "Individual.Individual", "random.uniform" ]
[((289, 327), 'numpy.empty', 'numpy.empty', (['popsize'], {'dtype': 'Individual'}), '(popsize, dtype=Individual)\n', (300, 327), False, 'import numpy\n'), ((352, 383), 'Individual.Individual', 'Individual', (['(0)', '(0)', '(0)', '(0)', '(0)', '(0)', '(0)'], {}), '(0, 0, 0, 0, 0, 0, 0)\n', (362, 383), False, 'from Indi...
import argparse import glob import json import math import multiprocessing import os import re import sys from importlib import import_module from multiprocessing import Lock, Pool import matplotlib.pyplot as plt import numpy as np import torch import torch.utils.data as data import tqdm from run_utils.utils import c...
[ "json.dump", "matplotlib.pyplot.get_cmap", "importlib.import_module", "torch.load", "run_utils.utils.convert_pytorch_checkpoint", "numpy.arange", "torch.nn.DataParallel" ]
[((1905, 1946), 'importlib.import_module', 'import_module', (['"""models.hovernet.net_desc"""'], {}), "('models.hovernet.net_desc')\n", (1918, 1946), False, 'from importlib import import_module\n'), ((2165, 2209), 'run_utils.utils.convert_pytorch_checkpoint', 'convert_pytorch_checkpoint', (['saved_state_dict'], {}), '(...
import os import unittest import shutil from atomate.qchem.firetasks.geo_transformations import RotateTorsion from atomate.qchem.firetasks.write_inputs import WriteInputFromIOSet from atomate.qchem.firetasks.parse_outputs import QChemToDb from fireworks import Firework, Workflow, FWorker from fireworks.core.rocket_lau...
[ "unittest.main", "os.path.abspath", "atomate.qchem.firetasks.write_inputs.WriteInputFromIOSet", "fireworks.Workflow", "pymatgen.io.qchem.outputs.QCOutput", "atomate.qchem.firetasks.parse_outputs.QChemToDb", "fireworks.Firework", "numpy.testing.assert_allclose", "numpy.testing.assert_equal", "shuti...
[((660, 726), 'os.path.join', 'os.path.join', (['module_dir', '""".."""', '""".."""', '""".."""', '"""common"""', '"""test_files"""'], {}), "(module_dir, '..', '..', '..', 'common', 'test_files')\n", (672, 726), False, 'import os\n'), ((3646, 3661), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3659, 3661), Fals...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file re-uses implementation from https://github.com/yl-1993/learn-to-cluster """ import os import time import json import pickle import random import numpy as np class TextColors: HEADER = '\033[35m' OKBLUE = '\033[34m' OKGREEN = '\033[32m' WARNIN...
[ "numpy.random.seed", "os.makedirs", "torch.manual_seed", "os.path.dirname", "os.path.exists", "time.time", "torch.cuda.manual_seed_all", "random.seed", "numpy.linalg.norm", "numpy.dot", "os.path.join" ]
[((924, 941), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (935, 941), False, 'import random\n'), ((946, 966), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (960, 966), True, 'import numpy as np\n'), ((971, 994), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (98...
#!/usr/bin/env python """ Displays projection matrix """ import os import copy import numpy as np import lo import csh nk = 3 #kernel = np.ones((nk, nk)) #kernel[kernel.shape[0] / 2, kernel.shape[1] / 2] *= 2 kernel = np.asarray([[.5, 1, .5], [1, 2, 1], [.5, 1., .5]]) n = 16 P = lo.convolve((n, n), kernel, mode="same...
[ "numpy.asarray", "lo.convolve" ]
[((220, 275), 'numpy.asarray', 'np.asarray', (['[[0.5, 1, 0.5], [1, 2, 1], [0.5, 1.0, 0.5]]'], {}), '([[0.5, 1, 0.5], [1, 2, 1], [0.5, 1.0, 0.5]])\n', (230, 275), True, 'import numpy as np\n'), ((282, 322), 'lo.convolve', 'lo.convolve', (['(n, n)', 'kernel'], {'mode': '"""same"""'}), "((n, n), kernel, mode='same')\n", ...
import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt import numpy as np import jigsaw_to_MPAS.mesh_definition_tools as mdt from jigsaw_to_MPAS.coastal_tools import signed_distance_from_geojson, \ mask_from_geojson from geometric_features import read_feature_collection import...
[ "matplotlib.pyplot.title", "numpy.fmax", "matplotlib.pyplot.clf", "numpy.ones", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "numpy.meshgrid", "matplotlib.pyplot.colorbar", "numpy.linspace", "jigsaw_to_MPAS.mesh_definition_tools.mergeCellWidthVsLat", "numpy.tanh", "jigsaw_to_M...
[((346, 367), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (360, 367), False, 'import matplotlib\n'), ((1192, 1224), 'numpy.linspace', 'np.linspace', (['(-180.0)', '(180.0)', 'nlon'], {}), '(-180.0, 180.0, nlon)\n', (1203, 1224), True, 'import numpy as np\n'), ((1233, 1263), 'numpy.linspace', '...
from numpy.distutils.core import setup, Extension import os from subprocess import call setup(name='openaerostruct', version='2.0.0', description='OpenAeroStruct', author='<NAME>', author_email='<EMAIL>', license='BSD-3', packages=[ 'openaerostruct', 'openaerostruc...
[ "numpy.distutils.core.setup" ]
[((95, 605), 'numpy.distutils.core.setup', 'setup', ([], {'name': '"""openaerostruct"""', 'version': '"""2.0.0"""', 'description': '"""OpenAeroStruct"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""BSD-3"""', 'packages': "['openaerostruct', 'openaerostruct/geometry', 'openaerostruct/struc...
"""unittestsAbstractForecast * File for unittests regarding all methods included in AbstractForecast Attributes: * name: SALFIC * date: 26.04.2021 * version: 0.0.1 Beta- free """ import unittest import numpy as np from SARIMAForecast import * from RedisClient import * class TestAbs...
[ "numpy.zeros" ]
[((1330, 1353), 'numpy.zeros', 'np.zeros', (['(50)'], {'dtype': 'int'}), '(50, dtype=int)\n', (1338, 1353), True, 'import numpy as np\n')]
# Copyright 2021 Google LLC # # 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, ...
[ "numpy.abs", "numpy.sum", "numpy.random.seed", "numpy.arange", "numpy.exp", "numpy.copy", "numpy.reshape", "numpy.random.choice", "numpy.random.shuffle", "textwrap.indent", "scipy.stats.gaussian_kde", "numpy.hstack", "reservoir_nn.utils.weight_properties.get_spectral_radius", "numpy.vstack...
[((1134, 1234), 'deprecation.deprecated', 'deprecation.deprecated', ([], {'details': '"""Use WeightTransformation.apply_transform(*args). cl/366874369"""'}), "(details=\n 'Use WeightTransformation.apply_transform(*args). cl/366874369')\n", (1156, 1234), False, 'import deprecation\n'), ((17225, 17258), 'numpy.reshape...
import matplotlib.pyplot as plt import numpy as np import pickle from matplotlib import rc from .draw_utils import COLOR, MARKER_STYLE #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) rc('text', usetex=True) def draw_eao(result): fig = plt.figure() ax = fig.add_subplot(111, projection='polar'...
[ "matplotlib.rc", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.max", "matplotlib.pyplot.figure", "numpy.array", "numpy.min", "numpy.linspace" ]
[((202, 225), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (204, 225), False, 'from matplotlib import rc\n'), ((259, 271), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (269, 271), True, 'import matplotlib.pyplot as plt\n'), ((335, 378), 'numpy.linspace', 'np.l...
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2018 # # 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 # r...
[ "unittest.main", "tests.utils.master_seed", "keras.backend.clear_session", "numpy.amin", "numpy.abs", "numpy.argmax", "numpy.testing.assert_almost_equal", "tests.utils.get_image_classifier_pt", "tests.utils.get_image_classifier_kr", "numpy.amax", "tests.utils.get_image_classifier_tf", "numpy.s...
[((1727, 1754), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1744, 1754), False, 'import logging\n'), ((10097, 10112), 'unittest.main', 'unittest.main', ([], {}), '()\n', (10110, 10112), False, 'import unittest\n'), ((1904, 1926), 'tests.utils.master_seed', 'master_seed', ([], {'seed':...
import pyanthem from numpy.matlib import repmat g=pyanthem.GUI(display=False) import subprocess as sp import numpy as np file = r'C:\Users\dnt21\Downloads\stars.mp4' command = [ 'ffmpeg','-i', file,'-f', 'image2pipe','-pix_fmt', 'rgb24','-vcodec', 'rawvideo', '-'] pipe = sp.Popen(command, stdout = sp.PIPE, bufsize=10**...
[ "subprocess.Popen", "numpy.asarray", "numpy.mean", "pyanthem.GUI", "numpy.fromstring", "numpy.repeat" ]
[((50, 77), 'pyanthem.GUI', 'pyanthem.GUI', ([], {'display': '(False)'}), '(display=False)\n', (62, 77), False, 'import pyanthem\n'), ((272, 322), 'subprocess.Popen', 'sp.Popen', (['command'], {'stdout': 'sp.PIPE', 'bufsize': '(10 ** 8)'}), '(command, stdout=sp.PIPE, bufsize=10 ** 8)\n', (280, 322), True, 'import subpr...
import numpy as np def _assert_shapes(ground_truth: np.ndarray, pred: np.ndarray, confidences: np.ndarray, avails: np.ndarray) -> None: """ Check the shapes of args required by metrics Args: ground_truth (np.ndarray): array of shape (timesteps)x(2D coords) pred (np.ndarray): array of shap...
[ "numpy.sum", "numpy.log", "numpy.expand_dims", "numpy.errstate", "numpy.isfinite", "numpy.min", "numpy.mean", "numpy.exp", "numpy.sqrt" ]
[((2690, 2721), 'numpy.expand_dims', 'np.expand_dims', (['ground_truth', '(0)'], {}), '(ground_truth, 0)\n', (2704, 2721), True, 'import numpy as np\n'), ((2818, 2872), 'numpy.sum', 'np.sum', (['(((ground_truth - pred) * avails) ** 2)'], {'axis': '(-1)'}), '(((ground_truth - pred) * avails) ** 2, axis=-1)\n', (2824, 28...
#!/usr/bin/env python import numpy as np import shogun as sg traindat = '../../../data/uci/housing/fm_housing.dat' label_traindat = '../../../data/uci/housing/housing_label.dat' # set both input attributes as nominal (True) / continuous (False) feat_types=np.array([False,False,False,True,False,False,False,False,False...
[ "shogun.StochasticGBMachine", "numpy.array", "shogun.CSVFile", "shogun.CARTree", "shogun.loss" ]
[((258, 363), 'numpy.array', 'np.array', (['[False, False, False, True, False, False, False, False, False, False, False,\n False, False]'], {}), '([False, False, False, True, False, False, False, False, False, \n False, False, False, False])\n', (266, 363), True, 'import numpy as np\n'), ((920, 929), 'shogun.CART...
import csv as csv import numpy as np import more_itertools as mit import random from copy import deepcopy import math np.random.seed(15) iterations = 100000 N = 128 T = 3356 k = 0 def path_cost(path, N, dist): c = 0 for i in range(0, N - 1): x1 = path[i] x2 = path[i + 1] c = c + ...
[ "copy.deepcopy", "math.exp", "csv.reader", "numpy.random.seed", "random.randint", "random.random", "numpy.random.permutation" ]
[((119, 137), 'numpy.random.seed', 'np.random.seed', (['(15)'], {}), '(15)\n', (133, 137), True, 'import numpy as np\n'), ((382, 406), 'random.randint', 'random.randint', (['(0)', '(N - 1)'], {}), '(0, N - 1)\n', (396, 406), False, 'import random\n'), ((420, 444), 'random.randint', 'random.randint', (['(0)', '(N - 1)']...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "mindspore.dataset.vision.c_transforms.RandomHorizontalFlip", "mindspore.dataset.vision.c_transforms.Resize", "mindspore.dataset.transforms.c_transforms.TypeCast", "numpy.frombuffer", "mindspore.dataset.GeneratorDataset", "mindspore.dataset.vision.c_transforms.Decode", "numpy.array", "mindspore.datase...
[((2416, 2454), 'mindspore.dataset.transforms.c_transforms.TypeCast', 't_ct.TypeCast', (['mindspore.dtype.float32'], {}), '(mindspore.dtype.float32)\n', (2429, 2454), True, 'from mindspore.dataset.transforms import c_transforms as t_ct\n'), ((3276, 3404), 'mindspore.dataset.GeneratorDataset', 'ds.GeneratorDataset', (['...
# Copyright (C) 2019 <NAME> # # This file is a part of BTS. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pro...
[ "os.mkdir", "tensorflow.train.Coordinator", "argparse.ArgumentParser", "tensorflow.local_variables_initializer", "tensorflow.ConfigProto", "os.path.join", "sys.path.append", "cv2.imwrite", "os.path.dirname", "tensorflow.train.start_queue_runners", "tensorflow.placeholder", "numpy.reshape", "...
[((1012, 1081), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""BTS TensorFlow implementation."""'}), "(description='BTS TensorFlow implementation.')\n", (1035, 1081), False, 'import argparse\n'), ((2121, 2158), 'os.path.dirname', 'os.path.dirname', (['args.checkpoint_path'], {}), '(args....
import pathlib from collections import OrderedDict import networkx as nx import numpy as np import torch import torch.nn as nn def activations(activ_name, param=None): """ activation function loader Parameters ---------- activ_name: string, name of activation function param: *dict, possible i...
[ "networkx.write_gpickle", "pathlib.Path", "torch.nn.CELU", "torch.nn.RReLU", "numpy.save", "networkx.set_node_attributes", "torch.nn.Softshrink", "torch.nn.Tanh", "torch.nn.Softplus", "torch.nn.GELU", "torch.nn.ELU", "torch.nn.Softsign", "torch.nn.SELU", "torch.nn.LeakyReLU", "networkx.D...
[((457, 469), 'torch.nn.Sigmoid', 'nn.Sigmoid', ([], {}), '()\n', (467, 469), True, 'import torch.nn as nn\n'), ((522, 531), 'torch.nn.Tanh', 'nn.Tanh', ([], {}), '()\n', (529, 531), True, 'import torch.nn as nn\n'), ((1688, 1774), 'numpy.zeros', 'np.zeros', (['(num_input_nodes + num_output_nodes, num_input_nodes + num...
import os import getpass import numpy as np import pystac import stac2dcache from eratosthenes.generic.mapping_io import read_geo_image rgi_index_url = ( "https://webdav.grid.surfsara.nl:2880" "/pnfs/grid.sara.nl/data/eratosthenes/" "disk/RasterRGI_tiles_sentinel-2" ) tile_id = '5VMG' rgi_id = 'RGI...
[ "os.path.expanduser", "getpass.getuser", "os.path.join", "stac2dcache.configure", "numpy.amin", "numpy.amax", "numpy.min", "numpy.where", "numpy.max", "eratosthenes.generic.mapping_io.read_geo_image", "numpy.round" ]
[((443, 460), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (458, 460), False, 'import getpass\n'), ((955, 987), 'eratosthenes.generic.mapping_io.read_geo_image', 'read_geo_image', (["(tile_id + '.tif')"], {}), "(tile_id + '.tif')\n", (969, 987), False, 'from eratosthenes.generic.mapping_io import read_geo_im...
import numpy as np import torch.optim as optim from torch.optim.lr_scheduler import _LRScheduler class ValueDecay: def __init__(self, start_value, end_value, end_epoch, temp=4, exp=True, eps=1e-7): """ Decays some value from `start_value` to `end_value` for `end_epoch` epochs. Supports...
[ "numpy.exp", "numpy.clip" ]
[((948, 981), 'numpy.clip', 'np.clip', (['epoch', '(0)', 'self.end_epoch'], {}), '(epoch, 0, self.end_epoch)\n', (955, 981), True, 'import numpy as np\n'), ((1446, 1462), 'numpy.exp', 'np.exp', (['(t * temp)'], {}), '(t * temp)\n', (1452, 1462), True, 'import numpy as np\n'), ((1471, 1483), 'numpy.exp', 'np.exp', (['te...
import cv2 import os import cvlog.html_logger as hl import base64 import numpy as np from cvlog.config import Config, Mode html_logger = None def image(level, image): if image is None: return __init() if Config().curent_level().value < level.value: return if Config().curent_mode() == Mo...
[ "cv2.line", "cv2.drawKeypoints", "cv2.circle", "cv2.waitKey", "cv2.setWindowTitle", "cvlog.config.Config", "numpy.sin", "os._exit", "cvlog.html_logger.HtmlLogger", "numpy.cos", "cv2.imencode", "base64.b64encode", "cv2.drawContours", "cv2.imshow", "cv2.namedWindow" ]
[((1155, 1217), 'cv2.drawContours', 'cv2.drawContours', (['debug_image', 'contours', 'index', '(0, 255, 0)', '(2)'], {}), '(debug_image, contours, index, (0, 255, 0), 2)\n', (1171, 1217), False, 'import cv2\n'), ((1332, 1405), 'cv2.drawKeypoints', 'cv2.drawKeypoints', (['debug_image', 'kp', 'debug_image', '(0, 255, 0)'...
# -*- coding:utf-8 -*- import pandas as pd from pandas import Series,DataFrame import numpy as np import os folder="sdf" files=os.listdir(folder) atom_list={"H":1,"C":6,"N":7,"O":8,} for fname in files: print(fname) if fname[-3:-1]+fname[-1]!="sdf": break file_name=fname[0:-4] molecules_fil...
[ "pandas.DataFrame", "numpy.zeros", "os.listdir" ]
[((129, 147), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (139, 147), False, 'import os\n'), ((1433, 1448), 'pandas.DataFrame', 'DataFrame', (['data'], {}), '(data)\n', (1442, 1448), False, 'from pandas import Series, DataFrame\n'), ((769, 794), 'numpy.zeros', 'np.zeros', (['(points_num, 3)'], {}), '((p...
__author__ = "<NAME>, <NAME>, <NAME>" __copyright__ = "Copyright (c) Microsoft Corporation and Mila - Quebec AI " \ "Institute" __license__ = "MIT" from functools import partial from typing import Tuple import jax import jax.numpy as jnp import numpy as np @partial(jax.jit) def calculate_gae(n_steps...
[ "functools.partial", "jax.numpy.array", "numpy.empty" ]
[((278, 294), 'functools.partial', 'partial', (['jax.jit'], {}), '(jax.jit)\n', (285, 294), False, 'from functools import partial\n'), ((891, 912), 'jax.numpy.array', 'jnp.array', (['advantages'], {}), '(advantages)\n', (900, 912), True, 'import jax.numpy as jnp\n'), ((1779, 1857), 'numpy.empty', 'np.empty', (['(self.n...
import numpy as np import math """ The spherical geometry module is a simple collection of calculations on a sphere Sourced from http://williams.best.vwh.net/avform.htm """ earths_radius = 6371.0088 radians_per_degree = np.pi / 180. def sphere_distance(lat1, lon1, lat2, lon2): """ Calculate the great circle ...
[ "math.isnan", "math.fmod", "numpy.arctan2", "numpy.sin", "numpy.cos", "numpy.sqrt" ]
[((2428, 2443), 'numpy.sqrt', 'np.sqrt', (['topbit'], {}), '(topbit)\n', (2435, 2443), True, 'import numpy as np\n'), ((2553, 2582), 'numpy.arctan2', 'np.arctan2', (['topbit', 'bottombit'], {}), '(topbit, bottombit)\n', (2563, 2582), True, 'import numpy as np\n'), ((2213, 2225), 'numpy.cos', 'np.cos', (['lat2'], {}), '...
import yaml import numpy as np import sys, os sys.path.append(os.getcwd()) from motionplanningutils import RobotHelper class UtilsSolutionFile: def __init__(self, robot_type: str) -> None: self.rh = RobotHelper(robot_type) def load(self, filename: str) -> None: with open(filename) as f: self.file = yaml.sa...
[ "motionplanningutils.RobotHelper", "numpy.ceil", "os.getcwd", "numpy.empty", "numpy.floor", "yaml.dump", "numpy.zeros", "numpy.array", "yaml.safe_load", "numpy.linspace" ]
[((63, 74), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (72, 74), False, 'import sys, os\n'), ((2057, 2094), 'motionplanningutils.RobotHelper', 'RobotHelper', (['"""unicycle_first_order_0"""'], {}), "('unicycle_first_order_0')\n", (2068, 2094), False, 'from motionplanningutils import RobotHelper\n'), ((205, 228), 'moti...
# -*- coding: utf-8 -*- """ Projection ========== Provides the definition of *PRISM*'s :class:`~Projection` class, a :class:`~prism.Pipeline` base class that allows for projection figures detailing a model's behavior to be created. """ # %% IMPORTS # Built-in imports from itertools import chain, combinations import...
[ "os.remove", "matplotlib.cm.get_cmap", "numpy.clip", "matplotlib.pyplot.figure", "numpy.product", "numpy.sqrt", "os.path.join", "e13tools.split_seq", "e13tools.lhd", "numpy.meshgrid", "prism._docstrings.set_par_doc.format", "matplotlib.pyplot.close", "scipy.interpolate.UnivariateSpline", "...
[((2006, 2079), 'e13tools.docstring_substitute', 'e13.docstring_substitute', ([], {'emul_i': 'user_emul_i_doc', 'proj_par': 'proj_par_doc_d'}), '(emul_i=user_emul_i_doc, proj_par=proj_par_doc_d)\n', (2030, 2079), True, 'import e13tools as e13\n'), ((15336, 15371), 'e13tools.docstring_append', 'e13.docstring_append', ([...
import cv2 import numpy as np import os from loaders.decompressionModule import DecompressionModule class VideoInputModule: def __init__(self): self.dc = DecompressionModule() self.image_array = None def _walk_directory(self, directory): # we will assume directory is the top folder that contains v...
[ "os.path.abspath", "matplotlib.pyplot.show", "numpy.copy", "os.path.isdir", "cv2.cvtColor", "matplotlib.pyplot.imshow", "loaders.decompressionModule.DecompressionModule", "cv2.imread", "matplotlib.pyplot.figure", "os.path.isfile", "os.path.join", "os.listdir" ]
[((2833, 2858), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (2848, 2858), False, 'import os\n'), ((2872, 2911), 'os.path.join', 'os.path.join', (['eva_dir', '"""data"""', '"""videos"""'], {}), "(eva_dir, 'data', 'videos')\n", (2884, 2911), False, 'import os\n'), ((2927, 2983), 'os.path...
from __future__ import division import numpy as np def array_offset(x): """Get offset of array data from base data in bytes.""" if x.base is None: return 0 base_start = x.base.__array_interface__['data'][0] start = x.__array_interface__['data'][0] return start - base_start def calc_pad...
[ "numpy.pad", "numpy.ceil", "numpy.floor", "numpy.transpose", "numpy.zeros" ]
[((2930, 3026), 'numpy.pad', 'np.pad', (['x', '((0, 0), (ph3, ph2), (pw3, pw2), (0, 0))'], {'mode': '"""constant"""', 'constant_values': '(0.0,)'}), "(x, ((0, 0), (ph3, ph2), (pw3, pw2), (0, 0)), mode='constant',\n constant_values=(0.0,))\n", (2936, 3026), True, 'import numpy as np\n'), ((4777, 4825), 'numpy.zeros',...
import imageio import numpy as np import pickle import modules network_num=99 networks_r=pickle.load(open("networks_r_dump_"+str(network_num)+".p","rb")) networks_g=pickle.load(open("networks_g_dump_"+str(network_num)+".p","rb")) networks_b=pickle.load(open("networks_b_dump_"+str(network_num)+".p","rb")) training...
[ "numpy.dstack", "modules.sigmoid" ]
[((1252, 1287), 'numpy.dstack', 'np.dstack', (['(prev_r, prev_g, prev_b)'], {}), '((prev_r, prev_g, prev_b))\n', (1261, 1287), True, 'import numpy as np\n'), ((757, 780), 'modules.sigmoid', 'modules.sigmoid', (['prev_r'], {}), '(prev_r)\n', (772, 780), False, 'import modules\n'), ((865, 888), 'modules.sigmoid', 'module...
import numpy as np def stratified_sampling(y, n_samples=10): """ Performs a stratified random sampling. Parameters ---------- y : list of int or numpy.ndarray List of labels. Returns ------- indices : numpy.ndarray Indices of the stratified subset. Notes ----...
[ "numpy.zeros", "numpy.argwhere", "numpy.max", "numpy.array", "numpy.random.choice", "numpy.random.permutation", "numpy.unique" ]
[((3262, 3292), 'numpy.random.permutation', 'np.random.permutation', (['indices'], {}), '(indices)\n', (3283, 3292), True, 'import numpy as np\n'), ((3392, 3424), 'numpy.unique', 'np.unique', (['y'], {'return_counts': '(True)'}), '(y, return_counts=True)\n', (3401, 3424), True, 'import numpy as np\n'), ((3461, 3482), '...
import numpy as np import random pi = np.pi from pyrf.vrt import (I_ONLY, VRT_IFDATA_I14Q14, VRT_IFDATA_I14, VRT_IFDATA_I24, VRT_IFDATA_PSD8) def calculate_channel_power(power_spectrum): """ Return a dBm value representing the channel power of the input power spectrum. :param power_spectrum: arr...
[ "numpy.fft.rfft", "numpy.abs", "numpy.argmax", "numpy.imag", "numpy.mean", "numpy.sin", "numpy.inner", "numpy.fft.fft", "numpy.max", "numpy.real", "numpy.log10", "numpy.var", "numpy.divide", "numpy.square", "numpy.flipud", "numpy.min", "numpy.fft.fftshift", "numpy.cos", "numpy.de...
[((6259, 6283), 'numpy.inner', 'np.inner', (['i_data', 'q_data'], {}), '(i_data, q_data)\n', (6267, 6283), True, 'import numpy as np\n'), ((7220, 7241), 'numpy.abs', 'np.abs', (['ampl_spectrum'], {}), '(ampl_spectrum)\n', (7226, 7241), True, 'import numpy as np\n'), ((457, 486), 'numpy.divide', 'np.divide', (['power_sp...
import rawpy import cv2 import os import numpy as np from PIL import Image from os.path import join from metrics import psnr_calculate, ssim_calculate from utils import AverageMeter, img2video def raw2rgb(img_raw): import os Image.fromarray(img_raw, mode="I;16").save('saved.tiff') raw_buf = rawpy.imread('...
[ "os.remove", "utils.AverageMeter", "utils.img2video", "cv2.imwrite", "metrics.psnr_calculate", "cv2.imread", "PIL.Image.fromarray", "rawpy.imread", "os.path.join", "os.listdir", "numpy.concatenate", "metrics.ssim_calculate" ]
[((306, 332), 'rawpy.imread', 'rawpy.imread', (['"""saved.tiff"""'], {}), "('saved.tiff')\n", (318, 332), False, 'import rawpy\n'), ((337, 360), 'os.remove', 'os.remove', (['"""saved.tiff"""'], {}), "('saved.tiff')\n", (346, 360), False, 'import os\n'), ((597, 613), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n...