repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ricklentz/pytorchvideo
[ "874d27cb55b9d7e9df6cd0881e2d7fe9f262532b" ]
[ "tests/benchmark_accelerator_efficient_blocks.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport logging\nimport unittest\nfrom typing import Callable, Tuple\n\nimport torch\nimport torch.nn as nn\nfrom fvcore.common.benchmark import benchmark\nfrom pytorchvideo.layers.accelerator.mobile_cpu.convolutions import (\n Conv3d3x3x...
[ [ "torch.quantization.convert", "torch.__version__.split", "torch.quantization.fuse_modules", "torch.utils.mobile_optimizer.optimize_for_mobile", "torch.quantization.QuantStub", "torch.quantization.prepare", "torch.quantization.DeQuantStub", "torch.manual_seed", "torch.jit.trace"...
shalei120/AutoInsert
[ "89ec5dadd252d79586fe3e44f1d315c5ec938c1f" ]
[ "fairseq/examples/speech_recognition/new/infer.py" ]
[ "#!/usr/bin/env python -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport ast\nimport hashlib\nimport logging\nimport os\nimport shutil\nimport sys\nfrom dataclasses import ...
[ [ "torch.autograd.profiler.emit_nvtx", "torch.cuda.profiler.profile", "torch.cuda.is_available", "torch.LongTensor", "torch.distributed.all_reduce", "torch.distributed.barrier" ] ]
majkelx/astwro
[ "4a9bbe3e4757c4076ad7c0d90cf08e38dab4e794" ]
[ "astwro/timeseries/tests/test_fnpeaks.py" ]
[ "# coding=utf-8\nfrom __future__ import absolute_import, division, print_function\n#import matplotlib.pyplot as plt\n\n\n\n__metaclass__ = type\n\nimport numpy as np\n\nfrom ..fnpeaks import *\n\nclass TestFNpeaks:\n\n def setup_class(self):\n self.N = 10\n self.M = 1000\n self.lc = np.rando...
[ [ "numpy.random.normal", "numpy.sin", "numpy.random.uniform", "numpy.arange" ] ]
dmitryv56/stgelpDP
[ "5dcdf6720211ad9d2a26f6bea122962d4b42c3eb" ]
[ "stgelpDL/dsetanalyse/programmed.py" ]
[ "#!/usr/bin/python3\n\n\"\"\" Generation 'programmed power' data for a DER power time series.\n\n\"\"\"\n\nimport os\nimport sys\n\nimport pandas as pd\nfrom pathlib import Path\nimport numpy as np\nimport copy\n\nfrom dsetanalyse.simpleHMM import simpleHMM,poissonHMM\n\n# constants\nDIESEL_PWR = \"Diesel_Power\"...
[ [ "numpy.array", "numpy.delete", "numpy.append", "pandas.read_csv", "numpy.unique" ] ]
UserAB1236872/mdp-decomp
[ "975ec25721f023c2f8ed2d392cec3b29519c9df1" ]
[ "gridworld/worlds/cliff.py" ]
[ "from gridworld import Gridworld\nimport numpy as np\n\n\nclass CliffWorld(Gridworld):\n def __init__(self, misfire_prob=0.1):\n cliff = np.array([\n [0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0],\n [0, -10, -10, -10, 0],\n [0, 0, 0, 0, 0]\n ], dtype=float)\n\n ...
[ [ "numpy.full", "numpy.array" ] ]
TomAugspurger/dask
[ "c2ee030ab2c3e73092a8d7de78f7ab01b087baa6" ]
[ "dask/array/core.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nfrom bisect import bisect\nfrom functools import partial, wraps\nfrom itertools import product\nimport math\nfrom numbers import Number\nimport operator\nfrom operator import add, getitem, mul\nimport os\nimport sys\nimport traceback\nimport pickl...
[ [ "numpy.max", "numpy.array", "numpy.isnan", "numpy.empty", "numpy.asarray", "numpy.errstate", "numpy.median", "numpy.ones", "numpy.asanyarray", "numpy.can_cast", "numpy.isscalar", "numpy.cumsum", "numpy.searchsorted", "numpy.dtype" ] ]
ma1112/keras-triplet-loss
[ "efd0fce049245af0f23e8df3d95b3de1016ebf06" ]
[ "triplet_loss.py" ]
[ "\"\"\"\nDisclaimer:\nThis file is coped as-is from https://github.com/omoindrot/tensorflow-triplet-loss/blob/fc698369bb6c9acdc9f0e9e1ea00de0ddf782f12/model/triplet_loss.py\n\"\"\"\n\n\n\"\"\"Define functions to create the triplet loss with online triplet mining.\"\"\"\n\nimport tensorflow as tf\n\n\ndef _pairwise_...
[ [ "tensorflow.multiply", "tensorflow.reduce_min", "tensorflow.shape", "tensorflow.expand_dims", "tensorflow.diag_part", "tensorflow.equal", "tensorflow.logical_not", "tensorflow.transpose", "tensorflow.sqrt", "tensorflow.reduce_max", "tensorflow.reduce_sum", "tensorfl...
DP6/customer-journey-analysis-toolbox
[ "80ca5a71dc65c9e70bdefce75aa4333a0c868ba4" ]
[ "src/jatoolbox/jatoolbox.py" ]
[ "import pandas as pd\nfrom collections import Counter\n\nclass JAToolbox:\n \"\"\"\n A class to gather some methods often used in costumer journey analysis at DP6.\n \n Attributes\n ----------\n This class does not have any attribute.\n\n Methods \n -------\n get_size(j,separator = ' > ')\n Calculates ...
[ [ "pandas.Series" ] ]
arvindrvs/nsfw_face
[ "8d617c8bf68f411703b3570097b2a18b71a4bab3" ]
[ "ser.py" ]
[ "import socket\r\nimport cv2\r\nimport numpy as np\r\nfrom PIL import Image\r\n\r\ns = socket.socket() \r\nport = 12345 \r\n\r\ns.bind(('', port)) \r\ns.listen(5)\r\n\r\nrecognizer = cv2.face.LBPHFaceRecognizer_create()\r\nrecognizer.read('trainner/trainner.yml')\r\ncascadePath = \"ha...
[ [ "numpy.array" ] ]
ChristinaTan0704/transTSP
[ "b97cd7ed8ae97e91b687d5007d13a021781f3d1d" ]
[ "nets/attention_model.py" ]
[ "# import torch\n# from torch import nn\n# from torch.utils.checkpoint import checkpoint\n# import math\n# from typing import NamedTuple\n# from mapd.lib.transTSP.utils.tensor_functions import compute_in_batches\n\n# from mapd.lib.transTSP.nets.graph_encoder import GraphAttentionEncoder\n# from torch.nn import Data...
[ [ "torch.nn.Linear", "torch.nonzero", "torch.cat", "torch.stack", "torch.log_softmax", "torch.isnan", "torch.is_tensor", "torch.softmax", "torch.zeros_like", "torch.tanh", "torch.Tensor" ] ]
vikasTmz/tk3dv
[ "48430cbc80113ed9c51bdcd3fb577da22af66473" ]
[ "tk3dv/ptTools/models/modules.py" ]
[ "# Borrowed from https://github.com/meetshah1995/pytorch-semseg\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport torch.nn.functional as F\n\nfrom torch.autograd import Variable\n\n\nclass conv2DBatchNorm(nn.Module):\n def __init__(\n self,\n in_channels,\n n_filters,\n ...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.nn.MaxUnpool2d", "torch.nn.functional.pad" ] ]
ChenZhannnnn/chenzhan
[ "b26a9512bbd1efe86c35c91a625da40b6f94dfc7" ]
[ "data.py" ]
[ "import configparser\nimport os\nimport re\nimport string\nimport pickle\nimport copy\nimport random\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader\nfrom fastNLP import Vocabulary\nfrom dataset_my import Dataset\nfrom dataloader import TrainDataLoader\nfrom utils import padding, batch_pa...
[ [ "torch.cat", "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "torch.tensor" ] ]
mohamadmansourX/TextBPN-Training
[ "9ca6831dde4aba859d9fafc2e704592562eb900a" ]
[ "cfglib/config.py" ]
[ "from easydict import EasyDict\nimport torch\nimport os\nimport yaml\nimport collections\n\ndef flatten(d, parent_key='', sep='_'):\n items = []\n for k, v in d.items():\n new_key = parent_key + sep + k if parent_key else k\n if isinstance(v, collections.MutableMapping):\n items.exten...
[ [ "torch.device" ] ]
jaemyungkim/hls4ml
[ "c739c0e05885a7908cbe65cd5cfc62eb6b33fdd0" ]
[ "test/pytest/test_cnn_mnist.py" ]
[ "from hls4ml.converters.keras_to_hls import keras_to_hls\nimport pytest\nimport hls4ml\nimport numpy as np\nfrom sklearn.metrics import accuracy_score\nimport tensorflow as tf\nfrom tensorflow.keras.models import model_from_json\nfrom qkeras.utils import _add_supported_quantized_objects; co = {}; _add_supported_qua...
[ [ "tensorflow.keras.utils.to_categorical", "tensorflow.keras.datasets.mnist.load_data", "numpy.argmax", "numpy.expand_dims", "tensorflow.keras.models.model_from_json" ] ]
awslabs/syne-tune
[ "1dd8e157477b86db01047a9a7821780ea04389bc", "1dd8e157477b86db01047a9a7821780ea04389bc" ]
[ "syne_tune/optimizer/schedulers/searchers/bayesopt/gpautograd/custom_op.py", "syne_tune/optimizer/schedulers/multiobjective/multiobjective_priority.py" ]
[ "# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\").\n# You may not use this file except in compliance with the License.\n# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ...
[ [ "numpy.ones", "numpy.diag", "numpy.reshape", "scipy.linalg.cholesky" ], [ "numpy.ones", "numpy.expand_dims" ] ]
m-agour/fury
[ "dadbb8e66938e964c25d01e6bed427e1fe7efc0c" ]
[ "fury/tests/test_shaders.py" ]
[ "import os\n\nimport numpy as np\nimport numpy.testing as npt\nimport pytest\n\nfrom fury import window\nimport fury.shaders as fs\nfrom fury.lib import PolyDataMapper, Actor, ConeSource\n\n\ndef test_load():\n dummy_file_name = 'dummy.txt'\n dummy_file_contents = 'This is some dummy text.'\n\n dummy_file ...
[ [ "numpy.abs" ] ]
niujunyu/mmskeleton
[ "0936b610f0c44e87f6886d34a9f43eda872ed6d8" ]
[ "mmskeleton/models/backbones/ALN38.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nfrom mmskeleton.ops.st_gcn import ConvTemporalGraphicalBatchA, Graph\n\n\"\"\"\nchange from 21\nA矩阵对称版本 \nA 3*25*25\na.triu !!!!\n\n\n\nbesides the max link , other link do not set 1\n\"\"\"\n\ndef zero(...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.nn.Conv1d", "torch.nn.BatchNorm2d", "torch.softmax", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.tensor", "torch.argmax" ] ]
M1kol4j/helita
[ "3babcbe592d1cfb640127751e133b2f7a1d3b895" ]
[ "helita/utils/utilsmath.py" ]
[ "import numpy as np\nfrom numba import vectorize, float32, float64\nfrom math import exp\n\n\ndef hist2d(x, y, nbins=30, norm=False, rx=0.08):\n ''' Computes the 2D histogram of the data and the x,y coordinates\n of the middle of the bins. OPTIONS; nbins (number of bins), norm,\n rx (range in x as % of the...
[ [ "numpy.min", "numpy.exp", "numpy.mean", "numpy.where", "numpy.nanmean", "numpy.sort", "numpy.dtype", "numpy.max", "numpy.empty", "numpy.log", "scipy.ndimage.map_coordinates", "numpy.nanmin", "numpy.transpose", "numpy.sqrt", "numpy.nanmax", "numpy.nan...
yoninachmany/us-shooting-tracker
[ "eef1e2a3d0fcb62cd72ffe8bd2f38a8c42234987" ]
[ "utils/geocode.py" ]
[ "import pandas as pd\nimport googlemaps\nfrom geocodio import GeocodioClient\nfrom geocodio.exceptions import GeocodioDataError\nimport spacy\nfrom spacy import displacy\n\nimport collections\nimport time\nimport pickle\n\n# BEGIN UTILITIES\n\nus_state_abbrev = {\n 'AL': 'Alabama',\n 'AK': 'Alaska',\n 'AZ'...
[ [ "pandas.read_csv" ] ]
mpriessner/VFIN
[ "a027c02cc9e28a4db493358654dc5f1ef7928fe2" ]
[ "DAIN/PWCNet/correlation_package_pytorch1_0/setup.py" ]
[ "import os\nimport json\nfrom setuptools import setup, find_packages\n\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension\nimport torch\n\nwith open('../../compiler_args.json') as f:\n extra_compile_args = json.load(f)\nsetup(\n name='correlation_cuda',\n ext_modules=[\n CUDAExtens...
[ [ "torch.utils.cpp_extension.CUDAExtension" ] ]
seqcode/iTF
[ "1c2559898686ea1fa70b40666e6087ef95dc1410" ]
[ "manuscript_analysis/sequence_attribution.py" ]
[ "import numpy as np\nfrom keras import backend as K\n\n# The GradientSaliency class is modified from:\n# https://github.com/experiencor/deep-viz-keras/blob/master/saliency.py\n\n\nclass GradientSaliency(object):\n \"\"\" Compute saliency masks with gradient.\"\"\"\n def __init__(self, model, output_index=0):\...
[ [ "numpy.zeros_like", "numpy.array", "numpy.add", "numpy.sum", "numpy.linspace", "numpy.expand_dims" ] ]
delemottelab/gpcr-string-method-2019
[ "b50786a4a8747d56ad04ede525592eb31f1890fd" ]
[ "string-method/src/notebooks/trajclassifier.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport logging\nimport sys\n\nlogging.basicConfig(\n stream=sys.stdout,\n level=logging.DEBUG,\n format='%(asctime)s %(name)s-%(levelname)s: %(message)s',\n datefmt='%Y-%m-%d %H:%M:%S')\nfr...
[ [ "sklearn.neural_network.MLPClassifier", "sklearn.preprocessing.StandardScaler" ] ]
We-Union/FaceDetection
[ "5f0d0010fc24d801101cea0a03c95cf5a91f8f90" ]
[ "face_detection/utils/loss.py" ]
[ "import torch\nfrom face_detection.Config import cig\n\ndef smooth_l1_loss(x, t, in_weight, sigma : float):\n sigma2 = sigma ** 2\n diff = in_weight * (x - t)\n abs_diff = diff.abs()\n flag = (abs_diff.data < (1. / sigma2)).float()\n y = (flag * (sigma2 / 2.) * (diff ** 2) +\n (1 - flag) * (a...
[ [ "torch.zeros" ] ]
mandt-lab/improving-inference-for-neural-image-compression
[ "c9b5c1354a38e0bb505fc34c6c8f27170f62a75b" ]
[ "bb_sga.py" ]
[ "\"\"\"Perform inference/compression on a pre-trained mean-scale hyperprior model modified for lossy bits-back.\nImplement SGA + BB (M2 in Table 1 of paper), in\nYibo Yang, Robert Bamler, Stephan Mandt:\n\"Improving Inference for Neural Image Compression\", NeurIPS 2020\nhttps://arxiv.org/pdf/2006.04240.pdf\n\"\"\"...
[ [ "tensorflow.compat.v1.log", "numpy.load", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.image.psnr", "tensorflow.compat.v1.reduce_sum", "tensorflow.compat.v1.set_random_seed", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.floor", "tensorflow.compat.v1.exp", ...
jlab/qiita
[ "8f37b8acbb5f8a6a03b1d022c7ab9a140be50ce8", "8f37b8acbb5f8a6a03b1d022c7ab9a140be50ce8" ]
[ "qiita_db/meta_util.py", "qiita_pet/handlers/study_handlers/tests/test_sample_template.py" ]
[ "r\"\"\"\nUtil functions (:mod: `qiita_db.meta_util`)\n===========================================\n\n..currentmodule:: qiita_db.meta_util\n\nThis module provides utility functions that use the ORM objects. ORM objects\nCANNOT import from this file.\n\nMethods\n-------\n\n..autosummary::\n :toctree: generated/\n...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.locator_params", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.ticker.FuncFormatter", "matplotlib.pyplot.ylabel", "matplotli...
PeterQiu0516/Funding-Recommendation-System
[ "90b28e9d179b012946bbd0888cd8a292585942c7" ]
[ "Final Version/app.py" ]
[ "# -*- coding: utf-8 -*- \nfrom flask import Flask, render_template, request, redirect, url_for\nimport json\nimport pandas as pd\nimport numpy as np\nimport datetime\nimport time\nimport math\nfrom pypfopt.efficient_frontier import EfficientFrontier\nfrom pypfopt import risk_models\nfrom pypfopt import expected_re...
[ [ "numpy.max", "numpy.array", "numpy.isnan", "numpy.zeros", "pandas.merge", "pandas.DataFrame", "numpy.sum", "numpy.corrcoef", "numpy.mean", "numpy.diff", "numpy.std", "numpy.sqrt", "pandas.concat", "numpy.ndim", "numpy.around", "pandas.read_csv", ...
Baidi96/hateful-user-detection
[ "416c2b77b6786ce964212e7a36caae347b10bd20" ]
[ "GraphMix/semisupervised/codes/train.py" ]
[ "import sys\nimport os\nimport copy\nfrom datetime import datetime\nimport time\nimport numpy as np\nimport random\nimport argparse\nfrom shutil import copyfile\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\n\nfrom trainer import Trainer\nfrom gnn import GNN\nfro...
[ [ "torch.zeros", "torch.cuda.manual_seed", "numpy.random.seed", "torch.unsqueeze", "torch.manual_seed", "torch.randint", "torch.cuda.is_available", "torch.LongTensor", "torch.Tensor", "torch.pow" ] ]
alibaba/SUMN-universal-user-representation
[ "1b5b17605d756d262c7fb25f3b01b73acfe79107" ]
[ "data_loader/loader.py" ]
[ "# -*- coding: utf-8 -*-#\nimport tensorflow as tf\n\n\nclass OdpsDataLoader:\n def __init__(self, table_name, max_query_per_week, max_words_per_query, target_length, mode, repeat=None, batch_size=128, shuffle=2000, slice_id=0, slice_count=1, weighted_target=0):\n # Avoid destroying input parameter\n ...
[ [ "tensorflow.string_to_number", "tensorflow.SparseTensor", "tensorflow.shape", "tensorflow.reshape", "tensorflow.sparse_tensor_to_dense", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.device", "tensorflow.pad", "tensorflow.string_split",...
a-rahman/gpt-2
[ "afe2f087c243823885f714c53b5f910585f54878" ]
[ "src/grpc_test.py" ]
[ "import numpy as np\n\n# Communication to TensorFlow server via gRPC\nimport grpc\nimport tensorflow as tf\n\n# TensorFlow serving stuff to send messages\nfrom tensorflow_serving.apis import predict_pb2\nfrom tensorflow_serving.apis import prediction_service_pb2_grpc\nfrom tensorflow.contrib.util import make_tensor...
[ [ "tensorflow.contrib.util.make_tensor_proto", "numpy.array", "tensorflow.make_ndarray" ] ]
karinseve/bert_score
[ "926c516ac516411c560918dddce7755e6ea9aa70" ]
[ "tests/test_bert_score.py" ]
[ "import unittest\nimport torch\nimport bert_score\nfrom transformers import __version__ as ht_version\n\nEPS = 1e-5\n\ncands = [\n \"28-year-old chef found dead in San Francisco mall\",\n \"A 28-year-old chef who recently moved to San Francisco was found dead in the staircase of a local shopping center.\",\n ...
[ [ "torch.is_tensor", "torch.tensor" ] ]
tehwalris/mpi-myers-diff
[ "9d6dafc9dc16dcf97b4c712dbb8c6dace25eeee5" ]
[ "scripts/gen_random_input.py" ]
[ "import numpy as np\nfrom pathlib import Path\nimport os\nimport math\nimport random\nimport itertools\n\n\ndef generate_input_1(\n length,\n distribution,\n values_range=None,\n):\n if values_range is None:\n values_range = length\n\n if distribution == \"uniform\":\n weights = np.ones...
[ [ "numpy.concatenate", "numpy.random.choice", "numpy.random.rand", "numpy.zeros", "numpy.ones", "numpy.arange", "numpy.append", "numpy.cumsum", "numpy.unique" ] ]
lahplover/nnef
[ "dcabf31337e5849593f343e6502fe0b8dc20452e", "dcabf31337e5849593f343e6502fe0b8dc20452e" ]
[ "nnef/scripts/designed_seq.py", "nnef/physics/grad_minimizer.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as pl\nfrom scipy import stats\nimport h5py\nimport os\n\n\n######################################################\namino_acids = pd.read_csv('data/amino_acids.csv')\nidx2aa = {x-1: y for x, y in zip(amino_acids.idx, amino_acids.AA)}\naa = amino_aci...
[ [ "numpy.argmin", "numpy.mean", "pandas.read_csv", "numpy.concatenate", "matplotlib.pyplot.colorbar", "numpy.log", "matplotlib.pyplot.savefig", "pandas.DataFrame", "numpy.save", "numpy.arange", "numpy.append", "numpy.vstack", "pandas.value_counts", "numpy.arra...
yongbowin/DuReader_annotation
[ "138f60558f3a4810c0f83d2e8fcac150220bab60" ]
[ "utils/rouge_metric/rouge.py" ]
[ "#!/usr/bin/env python\n# \n# File Name : rouge.py\n#\n# Description : Computes ROUGE-L metric as described by Lin and Hovey (2004)\n#\n# Creation Date : 2015-01-07 06:03\n# Author : Ramakrishna Vedantam <vrama91@vt.edu>\n\nimport numpy as np\nimport pdb\nfrom tqdm import tqdm\nimport logging\n\nlogging.basicConfig...
[ [ "numpy.array" ] ]
BrunoGupa/gym-cellular-automata
[ "6b5d96f2ccf13d1c1da9e2dc4d5273553cfbc89f" ]
[ "gym_cellular_automata/forest_fire/bulldozer/bulldozer_v1.py" ]
[ "import numpy as np\nfrom gym import spaces\n\nfrom gym_cellular_automata import CAEnv, GridSpace, Operator\nfrom gym_cellular_automata.forest_fire.operators import (\n Modify,\n Move,\n MoveModify,\n RepeatCA,\n WindyForestFire,\n)\n\nfrom .utils.config import CONFIG\n\n\nclass ForestFireEnvBulldoze...
[ [ "numpy.any", "numpy.array" ] ]
felixdivo/pytorch
[ "bf233aa049c4b479fd6cb19f9b8672bb2d42b0e2" ]
[ "torch/utils/data/datapipes/iter/routeddecoder.py" ]
[ "from io import BufferedIOBase\nfrom typing import Any, Callable, Iterable, Iterator, Sized, Tuple\n\nfrom torch.utils.data import IterDataPipe, functional_datapipe\nfrom torch.utils.data.datapipes.utils.common import deprecation_warning\nfrom torch.utils.data.datapipes.utils.decoder import (\n Decoder,\n bas...
[ [ "torch.utils.data.functional_datapipe", "torch.utils.data.datapipes.utils.decoder.Decoder", "torch.utils.data.datapipes.utils.decoder.imagehandler" ] ]
YuxuanXie/ma-gym
[ "dac30805ddcdfe3dee5f7cac520868505a9bcd5e" ]
[ "run.py" ]
[ "import gym\nimport ma_gym \nimport random\nimport datetime\nimport numpy as np\nimport tensorflow as tf\n\ndef get_variable(name, shape):\n\n return tf.get_variable(name, shape, tf.float32,\n tf.initializers.truncated_normal(0,0.01))\n\ndef Qmix_mixer(agent_qs, state, state_dim, n_agen...
[ [ "tensorflow.constant_initializer", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.global_variables_initializer", "tensorflow.random_normal_initializer", "numpy.max", "tensorflow.trainable_variables", "tensorflow.variable_scope", "numpy.random.randint", "numpy.argmax...
Ningsir/torch-quiver
[ "9734547288ec1550086336c759e5d58bb12d0148" ]
[ "examples/dgl/ogbn_products_sage_dgl.py" ]
[ "import dgl\nimport numpy as np\nimport torch as th\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport dgl.nn.pytorch as dglnn\nimport time\nimport argparse\nimport tqdm\nfrom ogb.nodeproppred import DglNodePropPredDataset\n\nclass SAGE(nn.Module):\n def __init__(self,\n...
[ [ "torch.device", "torch.nn.Dropout", "torch.argmax", "torch.nn.ModuleList", "torch.no_grad", "torch.cuda.max_memory_allocated", "numpy.mean", "numpy.std", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ] ]
lijian10086/nlp-tutorial
[ "4b3773b13d975e7ca812dec6b9409e43dac44534" ]
[ "code/layers/Attention.py" ]
[ "import torch\n\n# refer to https://github.com/kh-kim/nlp_with_pytorch/blob/master/neural-machine-translation/attention.md\n\nclass Attention(nn.Module):\n def __init__(self, hidden_size):\n super(Attention, self).__init__()\n \n self.linear = nn.Linear(hidden_size, hidden_size, bias=False)\...
[ [ "torch.bmm" ] ]
ArturMarekNowak/kNN
[ "fe0e0a4db243c78ea2de7f3cd50a98b9b2877002" ]
[ "src/knn/main.py" ]
[ "import math\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import ListedColormap\nimport numpy as np\nimport time\nimport csv\nimport pprint\nimport random\nfrom sklearn import neighbors\n\n\n# ==============================================================================\n# This is a functions which hel...
[ [ "numpy.array", "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.tight_layout", ...
vitan/blaze
[ "0cddb630ad1cf6be3967943337529adafa006ef5" ]
[ "blaze/compute/tests/test_pandas_compute.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport pytest\n\nfrom datetime import datetime\nimport pandas as pd\nimport numpy as np\nfrom pandas import DataFrame, Series\n\nfrom blaze.compute.core import compute\nfrom blaze import dshape, discover, transform\nfrom blaze.expr import Symbol, ...
[ [ "pandas.merge", "pandas.DataFrame", "numpy.sum", "pandas.date_range", "numpy.exp", "pandas.util.testing.assert_series_equal", "pandas.Series", "numpy.all" ] ]
rjrussell77/arrow
[ "0930b1d0ed9b649ba3e538a13960c8407ac6bc12" ]
[ "integration/integration_test.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.random.choice", "numpy.random.seed", "numpy.round", "numpy.ones", "numpy.random.randn", "numpy.random.randint", "numpy.iinfo", "numpy.dtype" ] ]
ovshake/mmaction2
[ "71e92e9d4c28190d485ba153aae5200bf71f70b1" ]
[ "mmaction/models/recognizers/mocorecognizer2d.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nfrom torch import nn\n\nfrom ..builder import RECOGNIZERS\nfrom .base import BaseRecognizer\nfrom .. import builder\nfrom einops import rearrange\nfrom .recognizer2d import Recognizer2D\n\n@torch.no_grad()\ndef concat_all_gather(tensor):\n \"\"\"\n ...
[ [ "torch.zeros", "torch.nn.functional.normalize", "torch.cat", "torch.distributed.get_world_size", "torch.nn.Identity", "torch.no_grad", "torch.distributed.all_gather", "torch.ones_like", "torch.nn.AdaptiveAvgPool2d", "torch.randn" ] ]
SleepyTT/Detectron
[ "fc9cc08893e15da9d292d6269318ffed54197332" ]
[ "detectron/core/test_engine.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl...
[ [ "numpy.float" ] ]
ReneeDress/19Sp-DAIC
[ "265247e74a747afabdef6b953c6467e7aa1ca399" ]
[ "DAIC+W2/1+1.py" ]
[ "import numpy as np\nnames = np.array(['王微', '肖良英', '方绮雯', '刘旭阳', '钱易铭'])\nsubjects = np.array(['Math', 'English', 'Python', 'Chinese', 'Art', 'Database', 'Physics'])\n# subjects数组中选择并显示序号1、2、4门课的名称\nprint(\"subjects数组中选择并显示序号1、2、4门课的名称\")\nprint(subjects[ [1, 2, 4] ])\n# 使用倒序索引选择并显示names数组中\"方绮雯\"\nprint(\"使用倒序索引选...
[ [ "numpy.array" ] ]
ncihtan/gcs-synapse-sync
[ "86dc8027532ef78fc51cf078199e87856b7bac6d" ]
[ "docker/save_exhibit_pyramid.py" ]
[ "# render_jpg.py\nfrom __future__ import print_function, division\nimport itertools\nimport pathlib\nimport json\nimport os\n# Opener\nimport zarr\nimport numpy as np\nfrom PIL import Image\nfrom matplotlib import colors\nfrom tifffile import TiffFile\nfrom openslide import OpenSlide\nfrom openslide.deepzoom import...
[ [ "numpy.ceil", "numpy.zeros", "numpy.clip", "matplotlib.colors.to_rgb", "numpy.squeeze" ] ]
karianjahi/advent_of_code
[ "16939cc7c475465c35d8750328b9b7aef60fc4d6" ]
[ "src/sonar_sweep.py" ]
[ "\"\"\"\nfinding sleight keys\n\"\"\"\nimport utils\nfrom utils import use_tuples\nimport numpy as np\nimport pandas as pd\n\n\nclass SleightKeys:\n \"\"\"\n we need to find slight keys:\n day one: count the number of times\n there is an increase in the depth\n \"\"\"\n\n def __init__(self, data):...
[ [ "numpy.array" ] ]
jhu99/vipcca_paper
[ "480515dd96c374251f7774799947d19c725e9449" ]
[ "code/pancreas_scripts/run_desc_on_pancreas.py" ]
[ "import scxx.preprocessing as pp\nimport scanpy as sc\nimport desc \n\ntest_input_file=\"./data/panc8/panc8.h5ad\"\ntest_result_path=\"./results/pancreas/desc/\"\n\nadata = pp.read_sc_data(test_input_file)\n\nsc.pp.normalize_per_cell(adata,counts_per_cell_after=1e6)\nsc.pp.log1p(adata)\nimport pandas as pd\ngenelis...
[ [ "pandas.read_csv" ] ]
Jeffrey28/Paddle
[ "c560a7d57aad990f374ebadd330351f18e2ca65f" ]
[ "python/paddle/fluid/contrib/slim/tests/test_imperative_qat.py" ]
[ "# copyright (c) 2018 paddlepaddle authors. all rights reserved.\n#\n# licensed under the apache license, version 2.0 (the \"license\");\n# you may not use this file except in compliance with the license.\n# you may obtain a copy of the license at\n#\n# http://www.apache.org/licenses/license-2.0\n#\n# unless ...
[ [ "numpy.product", "numpy.zeros_like", "numpy.array", "numpy.random.seed", "numpy.abs" ] ]
rohitkamble0159/repos
[ "28415c9e5c41afaaeafd41c57cef508df9ffdae6" ]
[ "lstm2.py" ]
[ "'''\nMultiple hidden layer LSTM RNN\n'''\nfrom ainit import *\nfrom init import *\nimport numpy, math\nimport matplotlib.pyplot as plt\nimport pandas\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers.core import Dense, Activation, Dropout\nfrom keras.layers.recurrent import LS...
[ [ "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "sklearn.preprocessing.MinMaxScaler", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
fanglu01/cDNA_Cupcake
[ "60f56dc291661a2b84e40b64d469fba658889c34" ]
[ "phasing/io/MPileUpVariantCaller.py" ]
[ "\n\"\"\"\nCall variant based on a list of SAMMPileUpRecord where list[i] is the record of i-th position\n\nMost of the code follows Juliet's code at\nhttps://github.com/PacificBiosciences/minorseq/blob/develop/src/AminoAcidCaller.cpp\n\n\"\"\"\nimport os, sys\nimport scipy.stats as stats\nfrom collections import C...
[ [ "scipy.stats.fisher_exact" ] ]
des-science/eastlake
[ "bbfd28a1426d178cc7ce2f1cd87e7245779c5527" ]
[ "eastlake/steps/newish_metacal/metacal/metacal_fitter.py" ]
[ "from __future__ import print_function\nimport logging\nimport numpy as np\nimport esutil as eu\n\nfrom ..ngmix_compat import NGMIX_V2\nfrom ngmix import ObsList, MultiBandObsList\nfrom ngmix.gexceptions import BootPSFFailure, BootGalFailure\nfrom . import procflags\n\nif NGMIX_V2:\n from ngmix.runners import Ru...
[ [ "numpy.rot90", "numpy.array", "numpy.zeros", "numpy.median", "numpy.sum", "numpy.any" ] ]
jpm343/RetinaX
[ "63f84209b4f8bdcdc88f35c54a03e7b7c56f4ab3" ]
[ "neuron_simulator_service/playground/test_alphaCSynNR.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jun 6 13:42:48 2017\n\nThis script compares alphaCSyn synapse with and w/o NET_RECEIVE\nIt also demonstrates the usefulness of NET_RECEIVE in that by using\nNetCon/NetStim you can apply multiple stimuli, which was not possible\nwith the origi...
[ [ "numpy.arange", "matplotlib.pyplot.subplots" ] ]
ivapanic/sketch-to-image-pix2pix
[ "646a9961b1b23e249f30d653aa21f5d7cb3a70ce" ]
[ "datasets/combine_A_and_B.py" ]
[ "import os\nimport numpy as np\nimport cv2\nimport argparse\nfrom multiprocessing import Pool\n\n\ndef image_write(path_A, path_B, path_AB):\n im_A = cv2.imread(path_A, 1) # python2: cv2.CV_LOAD_IMAGE_COLOR; python3: cv2.IMREAD_COLOR\n im_B = cv2.imread(path_B, 1) # python2: cv2.CV_LOAD_IMAGE_COLOR; python3: ...
[ [ "numpy.concatenate" ] ]
PhilippThoelke/mne-python
[ "5409a89233b764f3f3f3136cf9bf6b8d5fb0a4fe", "c289690d3ad732c746424807c445038ae5402c43", "c289690d3ad732c746424807c445038ae5402c43" ]
[ "mne/io/kit/tests/test_coreg.py", "doc/conf.py", "mne/minimum_norm/tests/test_inverse.py" ]
[ "# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>\n#\n# License: BSD (3-clause)\n\nimport inspect\nimport os\nimport pickle\n\nimport pytest\nfrom numpy.testing import assert_array_equal\n\nfrom mne.io.kit import read_mrk\nfrom mne.digitization._utils import _write_dig_points\nfrom mne.utils import _TempDi...
[ [ "numpy.testing.assert_array_equal" ], [ "matplotlib.use", "matplotlib.pyplot.ioff" ], [ "numpy.max", "numpy.testing.assert_allclose", "numpy.linalg.norm", "numpy.dot", "numpy.random.RandomState", "numpy.testing.assert_equal", "numpy.testing.assert_array_equal", ...
ZindiAfrica/Computer-Vision
[ "bf4c00a0633506270dc6d07df938a100a10ee799" ]
[ "Image Classification/CGIAR Wheat Growth Stage Challenge/neurofitting/zindi_cgiar_wheat_growth_stage_challenge/src_ensemble/model.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom efficientnet_pytorch import EfficientNet\r\nfrom torch.nn.parameter import Parameter\r\n\r\nclass SE_BLOCK(nn.Module):\r\n def __init__(self, input_dim=1280): \r\n super(SE_BLOCK,self).__init__()\r\n self.layer...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Sigmoid", "torch.ones", "torch.nn.ReLU", "torch.nn.BatchNorm1d" ] ]
cmacdonald/DeepCT
[ "1e04b259a51eb23c5242037b1536df51c2b90f3a" ]
[ "deepct/run_deepct.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.contrib.tpu.TPUEstimatorSpec", "tensorflow.data.TFRecordDataset", "tensorflow.train.Features", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.losses.mean_squared_error", "tensorflow.to_float", "tensorflow.parse_single_e...
dionman/beta-cores
[ "d8b09a8f9ee2daf56aa5b7e7dc1ed3baf845117a" ]
[ "examples/common/model_neurlinr.py" ]
[ "import numpy as np\nimport scipy.linalg as sl\nimport pandas\nfrom sklearn.preprocessing import MinMaxScaler\n\ndef load_data(name, data_dir):\n \"\"\"\n Return data from UCI sets\n :return: Inputs, outputs\n \"\"\"\n if name in ['boston']:\n from sklearn.datasets import load_boston\n data = load_boston...
[ [ "numpy.random.normal", "numpy.int", "numpy.isclose", "numpy.random.choice", "numpy.dot", "numpy.log", "numpy.random.randn", "numpy.exp", "numpy.mean", "numpy.eye", "numpy.std", "sklearn.preprocessing.MinMaxScaler", "numpy.sqrt", "sklearn.datasets.load_boston...
cyy0523xc/keras-yolo3
[ "22cfa1645f6ed308f98ec3c5b816c24933887227" ]
[ "yolo.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nClass definition of YOLO_v3 style detection model on image and video\n\"\"\"\nimport colorsys\nimport os\nfrom timeit import default_timer as timer\n\nimport numpy as np\nimport tensorflow as tf\nfrom keras import backend as K\nfrom keras.models import load_model\nfrom keras.layers...
[ [ "numpy.array", "numpy.asarray", "tensorflow.get_default_graph", "numpy.random.seed", "tensorflow.Session", "numpy.random.shuffle", "tensorflow.ConfigProto", "numpy.expand_dims", "numpy.floor" ] ]
Zhenye-Na/crnn-pytorch
[ "2af43d4ce2ddf31978b41d1e402e220df8189230" ]
[ "src/text_recognizer/datasets/sentence_generator.py" ]
[ "\"\"\"SentenceGenerator class and supporting functions.\"\"\"\nimport itertools\nimport re\nimport string\nfrom typing import Optional\n\nimport nltk\nimport numpy as np\n\nfrom text_recognizer.datasets.dataset import Dataset\n\nNLTK_DATA_DIRNAME = Dataset.data_dirname() / 'raw' / 'nltk'\n\n\nclass SentenceGenerat...
[ [ "numpy.random.choice" ] ]
theovincent/xport
[ "6f06128e05f83aea546bde708f69ed83fc6c78cc" ]
[ "test/test_xport.py" ]
[ "\"\"\"\nTests for the core interface.\n\"\"\"\n\n# Standard Library\nfrom io import BytesIO\n\n# Community Packages\nimport pandas as pd\nimport pytest\n\n# Xport Modules\nimport xport\n\n\nclass TestInformat:\n \"\"\"\n Verify parsing and display of input formats.\n \"\"\"\n\n def test_spec_character(...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
sgaoshang/seeker
[ "bb96ab9835abddf076dfe61f4ffc4fd8d5933b6f" ]
[ "app/case_new/naivebayes/naivebayes.py" ]
[ "import re\nimport numpy as np\nfrom flask import current_app\n\n\ndef pre_handle_text(text):\n # only words reserved\n regEx = re.compile(r'[^a-zA-Z]|\\d')\n words = regEx.split(text)\n # lower words, strip blank\n words = [word.lower() for word in words if len(word) > 0]\n return words\n\n\ndef ...
[ [ "numpy.array", "numpy.ones", "numpy.loadtxt", "numpy.log" ] ]
PaddlePaddle/PaddleSpeech
[ "9f84d3a047120111a9a9355925fdfa66fd3a22b6" ]
[ "paddlespeech/server/engine/asr/online/asr_engine.py" ]
[ "# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.frombuffer" ] ]
broadinstitute/temporal-rna-seq-deconvolution
[ "f9d1282753b79be86db7d60d8b1eb60da10b0d78" ]
[ "ternadecov/cli_tools.py" ]
[ "\"\"\"Helper functions for command-line functionality\"\"\"\n\nimport torch\nimport numpy as np\nimport anndata\nfrom ternadecov.time_deconv import TimeRegularizedDeconvolutionModel\nfrom ternadecov.dataset import DeconvolutionDataset\nfrom ternadecov.parametrization import (\n DeconvolutionDatatypeParametrizat...
[ [ "torch.device", "torch.cuda.is_available" ] ]
tttthomasssss/wolkenatlas
[ "29e651e731daff4db4ca89373abd4837361979fa" ]
[ "wolkenatlas/encoder.py" ]
[ "import numpy as np\n\n\ndef average_encoder(X):\n return sum_encoder(X=X, normalise=True)\n\n\ndef sum_encoder(X, normalise=False):\n if isinstance(X, list):\n X = np.array(X)\n\n if isinstance(X, np.ndarray):\n if len(X.shape) > 1 and X.shape[0] > 1:\n C = np.sum(X, axis=0) if no...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.sum", "numpy.min", "numpy.average" ] ]
missing-semicolon/ibis
[ "2cfd38503489242e268830e1fc93ae2c61019db5" ]
[ "ibis/pandas/execution/tests/test_arrays.py" ]
[ "import operator\n\nimport pandas as pd\nimport pandas.util.testing as tm\n\nimport pytest\n\nimport ibis\nfrom ibis.common import IbisTypeError\n\n\ndef test_array_length(t, df):\n expr = t.projection([\n t.array_of_float64.length().name('array_of_float64_length'),\n t.array_of_int64.length().name...
[ [ "pandas.DataFrame", "pandas.util.testing.assert_frame_equal", "pandas.util.testing.assert_series_equal" ] ]
jmrohwer/pysces
[ "a9212900a7b95489ae2494b831420633e3763b46" ]
[ "devtest/test_state_mca_scans.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nTest steady state (HYBRD and NLEQ2), MCA and parameter scans\n\"\"\"\n\n# input\nmodel_file = 'rohwer_sucrose2'\n\n# environment\nimport os\ncDir = os.path.dirname(os.path.abspath(os.sys.argv[0]))\nimport pysces\nimport numpy as np\nimport pickle\n\nmodel_dir = os.path.join(cDir, 'm...
[ [ "numpy.allclose", "numpy.copy", "numpy.linspace" ] ]
laprej/dask-ml
[ "78b1d942eae14db442a744f8812c3e94a8f31272" ]
[ "tests/linear_model/test_neural_network.py" ]
[ "import pytest\n\nfrom sklearn import neural_network as nn_\nfrom dask_ml import neural_network as nn\n\nfrom dask_ml.utils import assert_estimator_equal\n\n\n@pytest.mark.filterwarnings(\"ignore::FutureWarning\")\nclass TestMLPClassifier(object):\n\n def test_basic(self, single_chunk_classification):\n X...
[ [ "sklearn.neural_network.MLPClassifier", "sklearn.neural_network.MLPRegressor" ] ]
loostrum/darc
[ "977f43652ff4fc873340d09ac0fddeb81b889541" ]
[ "darc/processor.py" ]
[ "#!/usr/bin/env python3\n#\n# real-time data processor\n\nimport os\nimport ast\nfrom textwrap import dedent\nimport socket\nimport threading\nimport multiprocessing as mp\nfrom queue import Empty\nfrom time import sleep\nfrom astropy.time import Time, TimeDelta\nimport numpy as np\nimport yaml\nimport h5py\n\nfrom...
[ [ "numpy.argsort" ] ]
suyz526/ZebraPose
[ "c7d4f2495326265c34fd9007d29a8658c44b7dd4" ]
[ "Binary_Code_GT_Generator/generate_training_labels_for_BOP.py" ]
[ "import os\nimport sys\nimport argparse\n\nsys.path.append(\"../Tools_for_BOP\")\nimport bop_io\n\nimport cv2\nimport Render\nimport numpy as np\n\nfrom tqdm import tqdm\n\ndef generate_GT_images(bop_path, dataset_name, force_rewrite, is_training_data, data_folder, start_obj_id, end_obj_id):\n dataset_dir,source...
[ [ "numpy.array" ] ]
rhewett/distdl-examples
[ "5ad375eae03a8e10904e134c3d0e4947ce75f513" ]
[ "lenet5/data_loader.py" ]
[ "# Adapted from https://github.com/activatedgeek/LeNet-5/blob/master/run.py\n# ---\nimport numpy as np\nimport torchvision.transforms as transforms\nfrom torch.utils.data import DataLoader\nfrom torchvision.datasets.mnist import MNIST\n\nimport distdl\n\n\nclass DummyLoader:\n\n def __init__(self, batch_size, n_...
[ [ "torch.utils.data.DataLoader", "numpy.zeros" ] ]
alpha-leo/ComputationalPhysics-Fall2020
[ "737769d4a046b4ecea885cafeaf26e26075f7320" ]
[ "PSet1/P3/cells.py" ]
[ "\"\"\"This module provides the things we need for the evolution of cells\"\"\"\n\nimport numpy as np\n\n\ndef state(row, i):\n \"\"\"This function takes in the current row and the index of the item,\n and returns its state as and 0 =< integer =< 7 \"\"\"\n length = len(row)\n return row[i - 1] * 4 +...
[ [ "numpy.zeros" ] ]
michaelowenliu/MedicalSeg
[ "121c6ea65b3096f8922607f4e0fa26fdbe7c4ed9" ]
[ "train.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req...
[ [ "numpy.random.seed" ] ]
pdwaggoner/datar
[ "a03f1c0ca0de1270059178e59cea151a51a6e7aa" ]
[ "datar/tidyr/chop.py" ]
[ "\"\"\"Chop and unchop\n\nhttps://github.com/tidyverse/tidyr/blob/master/R/chop.R\n\"\"\"\nfrom collections import defaultdict\nfrom typing import Iterable\n\nimport numpy\nimport pandas\nfrom ..core.backends.pandas import DataFrame, Series\nfrom ..core.backends.pandas.api.types import is_scalar\nfrom pipda import ...
[ [ "numpy.repeat", "numpy.concatenate", "pandas.isnull" ] ]
gmt710/CIFAR-ZOO
[ "5d3c90bd7b3b8d6e764180777e0b59cffbe644a9" ]
[ "models/senet.py" ]
[ "# -*-coding:utf-8-*-\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n__all__ = [\"se_resnext29_8x64d\", \"se_resnext29_16x64d\"]\n\n\nclass SEModule(nn.Module):\n def __init__(self, channels, reduction=16):\n super(SEModule, self).__init__()\n self.avg_pool = nn.AdaptiveAvgPool2d(1)\n ...
[ [ "torch.nn.Linear", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
DongshuoYin/garbage_dump_detection
[ "1087f2cd35f781c5d973db5a59ecf8eb3bfa2537" ]
[ "mmdet/models/roi_heads/trident_roi_head.py" ]
[ "import torch\nfrom mmcv.ops import batched_nms\n\nfrom mmdet.core import (bbox2result, bbox2roi, bbox_mapping, merge_aug_bboxes,\n multiclass_nms)\nfrom mmdet.models.roi_heads.standard_roi_head import StandardRoIHead\nfrom ..builder import HEADS\n\n\n@HEADS.register_module()\nclass TridentRo...
[ [ "torch.cat" ] ]
SocratesNFR/neat-nagi-python
[ "dab506184d464c9e7194c58eb912526d9d080bb2" ]
[ "scripts/visualize_test_run.py" ]
[ "import pickle\n\nimport matplotlib.pyplot as plt\nfrom easygui import fileopenbox\nfrom matplotlib.lines import Line2D\n\nfrom definitions import ROOT_PATH\nfrom nagi.constants import YELLOW, GREEN, GOLD\n\nalpha = 0.8\n\n\ndef get_handles(with_test: bool):\n handles = (Line2D([0], [0], marker='o', color='b', l...
[ [ "matplotlib.lines.Line2D", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
richinvest/Test1
[ "ee49ae6d9fb941209ab894b42aae4e83abc16eb4" ]
[ "python-package/mlbox/model/supervised/regression/regressor.py" ]
[ "# coding: utf-8\n# Author: Axel ARONIO DE ROMBLAY <axelderomblay@gmail.com>\n# License: BSD 3 clause\n\nimport warnings\nfrom copy import copy\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.ensemble import (AdaBoostRegressor, BaggingRegressor,\n ExtraTreesRegressor, RandomFor...
[ [ "sklearn.ensemble.AdaBoostRegressor", "sklearn.ensemble.ExtraTreesRegressor", "sklearn.linear_model.Ridge", "sklearn.ensemble.RandomForestRegressor", "sklearn.ensemble.BaggingRegressor", "sklearn.tree.DecisionTreeRegressor", "numpy.abs" ] ]
zmehdiz97/Object-DGCNN
[ "b1561db745575ffa0528402d66511f64670f8d7f" ]
[ "test.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport argparse\nimport mmcv\nimport os\nimport torch\nimport warnings\nfrom mmcv import Config, DictAction\nfrom mmcv.cnn import fuse_conv_bn\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import (get_dist_info, init_dist, lo...
[ [ "torch.cuda.current_device" ] ]
clwgg/tskit
[ "9006f53452f41df712faf26692177a957129dd52" ]
[ "python/tests/test_file_format.py" ]
[ "# MIT License\n#\n# Copyright (c) 2018-2021 Tskit Developers\n# Copyright (c) 2016-2018 University of Oxford\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, ...
[ [ "numpy.zeros_like", "numpy.array", "numpy.array_equal", "numpy.zeros", "numpy.full_like" ] ]
rryoung98/ogb
[ "34a8ac53dc6dab215938b5b54caeff37a06300d6" ]
[ "examples/nodeproppred/mag/rgcn.py" ]
[ "import copy\nimport argparse\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.nn import Parameter, ModuleDict, ModuleList, Linear, ParameterDict\nfrom torch_sparse import SparseTensor\n\nfrom ogb.nodeproppred import PygNodePropPredDataset, Evaluator\n\nfrom logger import Logger\n\n\nclass RGCNConv(torc...
[ [ "torch.nn.Linear", "torch.device", "torch.nn.ModuleList", "torch.no_grad", "torch.nn.functional.dropout", "torch.nn.init.xavier_uniform_", "torch.cuda.is_available", "torch.nn.functional.relu", "torch.Tensor" ] ]
ZhangLe59151/ds_utils
[ "f88b66076a61355d659f7d0be479c1eaf94d87a8" ]
[ "utils_for_ds/model_customize.py" ]
[ "from tensorflow.keras.layers import LSTM, Dropout, Dense, Layer, Concatenate, LayerNormalization, Conv1D, GlobalAveragePooling1D\nfrom tensorflow.keras import Input, Model\nfrom tensorflow.keras.models import Sequential\nimport time\nimport xgboost as xgb\nfrom sklearn.model_selection import train_test_split\nfrom...
[ [ "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.GlobalAveragePooling1D", "tensorflow.keras.layers.LayerNormalization", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.Model", "tensorflow.keras.models.Sequential", "sklearn.model_selec...
Caoang327/GAN_Compression
[ "6cfdd771de58c7b90bbe39d99d9dfcaeb2591c02" ]
[ "Data_Processing/Generate_Dataset_8k_various_noise_LibriSpeech.py" ]
[ "import librosa\nimport numpy as np\nimport os\nfrom ourLTFATStft import LTFATStft\nimport ltfatpy\nimport imageio\nimport math\nfrom ADC_Sampling import ADC_Sampling\nimport numpy as np\nfft_hop_size = 64\nfft_window_length = 256\nclipBelow = -10\nanStftWrapper = LTFATStft()\nsampling_org = 16000\nsampling_fre = 8...
[ [ "numpy.pad", "numpy.dot", "numpy.round", "numpy.exp", "numpy.mean", "numpy.random.randint", "numpy.abs" ] ]
Suitceyes-Project/Keep-Your-Distance
[ "184f9eb01b34b24a01801a3cefa59703120f3ad6" ]
[ "camera_calibration.py" ]
[ "import numpy as np\nimport cv2 as cv\nfrom cv2 import aruco\nimport matplotlib as mpl\nimport matplotlib.pyplot as py_mpl\nfrom PIL import Image\nimport os, os.path\nimport config as cfg\n\n# get charuco board from predefined dictionary\npredef_aruco_dict = aruco.Dictionary_get(aruco.DICT_4X4_50)\nboard = aruco.Ch...
[ [ "matplotlib.pyplot.subplot", "numpy.array", "numpy.zeros", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
Matchoc/python_env
[ "859d84d1717a265a4085ad29706b12c19c62d36f" ]
[ "python35/Lib/site-packages/sklearn/utils/fixes.py" ]
[ "\"\"\"Compatibility fixes for older version of python, numpy and scipy\n\nIf you add content to this file, please give the version of the package\nat which the fixe is no longer needed.\n\"\"\"\n# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>\n# Gael Varoquaux <gael.varoquaux@normale...
[ [ "numpy.product", "numpy.compress", "numpy.copy", "numpy.sort", "numpy.frombuffer", "numpy.concatenate", "numpy.bincount", "numpy.divide", "numpy.zeros_like", "numpy.empty", "numpy.nonzero", "numpy.tanh", "numpy.arange", "numpy.asscalar", "scipy.sparse.cs...
adrn/SuperFreq
[ "e1f60a6cf5926489d8293742c979443b85ddba03" ]
[ "superfreq/tests/helpers.py" ]
[ "# coding: utf-8\n\nfrom __future__ import division, print_function\n\n__author__ = \"adrn <adrn@astro.columbia.edu>\"\n\n# Third-party\nimport numpy as np\n\ndef cartesian_to_poincare(xy, vxy):\n # assuming z == 0\n R = np.sqrt(xy[0]**2 + xy[1]**2)\n phi = np.arctan2(xy[0], xy[1])\n\n vR = (xy[0]*vxy[0...
[ [ "numpy.sin", "numpy.arctan2", "numpy.abs", "numpy.sqrt", "numpy.cos", "numpy.vstack" ] ]
ayush-mundra/Hair_Style_Recommendation
[ "9a6e75da6adc5d4c86c1ae98bb0844acd68d4f1c" ]
[ "functions_only.py" ]
[ "\nimport requests\nfrom bs4 import BeautifulSoup\nimport time\nfrom PIL import Image, ImageDraw\nimport face_recognition\nimport pandas as pd\nimport numpy as np\nfrom os.path import basename\nimport math\nimport pathlib\nfrom pathlib import Path\nimport os\nimport random\n\n# The function in the py file (make_fac...
[ [ "numpy.square", "numpy.array", "numpy.absolute" ] ]
oxfordni/storm-analysis
[ "835a5c17497c563c3632db561ae7e7c9144a8dd1" ]
[ "storm_analysis/diagnostics/cramera_rao/configure.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nConfigure folder for testing Cramer-Rao bounds calculations. Ideally \nthis should be a unit test, but calculating splines takes too long and\nthey are a bit big to include in a project, so such is life.\n\nHazen 10/17\n\"\"\"\nimport argparse\nimport inspect\nimport numpy\nimport os...
[ [ "numpy.savetxt", "numpy.zeros", "numpy.ones", "numpy.arange", "numpy.vstack" ] ]
vishwesh5/Linear-Algebra---LAFF
[ "8d8e711628ff99c544b01c93072f35bf6cb06d1e" ]
[ "notebooks/laff/vecvec/norm2.py" ]
[ "import laff\nimport numpy as np\nfrom math import sqrt\n\ndef norm2( x ):\n\n\t\"\"\"\n Compute the 2-norm of a vector, returning alpha\n \n x can be a row or column vector.\n \"\"\"\n\tassert type(x) is np.matrix and len(x.shape) is 2, \\\n\t\t\"laff.norm2: vector x must be a 2D numpy.matrix\"\n\t\n\t...
[ [ "numpy.zeros", "numpy.shape" ] ]
onlytailei/DeepRL
[ "aef2e71ed1f4e2cf4c576b93df8c19c37c90cb94" ]
[ "component/task.py" ]
[ "#######################################################################\n# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# Permission given to modify the code as long as you keep this #\n# declaration at the top #\n#######################...
[ [ "numpy.asarray", "numpy.random.seed", "numpy.stack", "numpy.random.randint", "numpy.clip" ] ]
anderkve/gambit_np
[ "3183fff753376523730eda1920711f221224a9b5" ]
[ "Backends/patches/montepythonlike/3.3.0/__init__eBOSS_DR14_Lya_combined.py" ]
[ "import sys \nimport os\nsys.path.append('../../')\nimport numpy as np\n#from montepython import io_mp\nfrom MontePythonLike_3_3_0 import Likelihood\nimport scipy.constants as const\nfrom scipy.interpolate import RectBivariateSpline\n\nclass eBOSS_DR14_Lya_combined(Likelihood):\n\n # initialization routine\n\n ...
[ [ "numpy.array", "numpy.zeros", "scipy.interpolate.RectBivariateSpline", "numpy.shape", "numpy.loadtxt" ] ]
nik1806/TorchSeg
[ "c5d370778349d9438ed8c854f267d3ba11ffd72f", "c5d370778349d9438ed8c854f267d3ba11ffd72f" ]
[ "model/bisenet/cityscapes.bisenet.X39.speed/config.py", "furnace/datasets/ade/ade.py" ]
[ "# encoding: utf-8\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os.path as osp\nimport sys\nimport time\nimport numpy as np\nfrom easydict import EasyDict as edict\nimport argparse\n\nimport torch.utils.model_zoo as model_zoo\n\nC = edic...
[ [ "numpy.array" ], [ "numpy.array" ] ]
dedsecurity/gpt-ded
[ "0ac5a12418c0eb0906ba6072c141a1323ee6470b", "0ac5a12418c0eb0906ba6072c141a1323ee6470b" ]
[ "metaseq/tasks/language_modeling.py", "metaseq/data/indexed_dataset.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport logging\nimport os\nfrom dataclasses import dataclass, field\nfrom typing import Optional\n\nimport nu...
[ [ "numpy.array", "torch.no_grad" ], [ "numpy.array", "numpy.copyto", "numpy.empty", "torch.from_numpy", "numpy.memmap", "numpy.frombuffer" ] ]
MatthieuJoulot/clinica
[ "c82f8ba6fd3d3c11076cb175ada13a4810c39d8b", "c82f8ba6fd3d3c11076cb175ada13a4810c39d8b" ]
[ "test/nonregression/pipelines/test_run_pipelines_dwi.py", "clinica/utils/filemanip.py" ]
[ "# coding: utf8\n\n\"\"\"\nThis file contains a set of functional tests designed to check the correct execution of the pipeline and the\ndifferent functions available in Clinica\n\"\"\"\n\nimport warnings\nfrom os import fspath\nfrom test.nonregression.testing_tools import *\n\nimport pytest\n\n# Determine location...
[ [ "numpy.allclose", "numpy.array", "pandas.read_csv" ], [ "pandas.io.parsers.read_csv", "pandas.DataFrame" ] ]
SeungHeonDoh/music_zeroshot_models
[ "38f80df868da357f3cb30522ad2e2031f0bc184e" ]
[ "loader/dataloader.py" ]
[ "import pickle\nfrom typing import Callable, Optional\n\nfrom omegaconf import DictConfig\nfrom pytorch_lightning import LightningDataModule\nfrom torch.utils.data import DataLoader, Dataset\n\nfrom .dataset import MSD_Dataset\n\n\nclass DataPipeline(LightningDataModule):\n def __init__(self, data_dir, msd_dir, ...
[ [ "torch.utils.data.DataLoader" ] ]
vicyor/wct-based-style-transfer
[ "89b1afadb21580c41ba6dd12a593f769b0315661" ]
[ "wct.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Mar 19 14:55:51 2018\n\n@author: zwx\n\"\"\"\n\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\ndef wct_tf(content, style, alpha, eps=1e-8):\n '''TensorFlow version of Whiten-Color Transform\n Assume that content/style en...
[ [ "tensorflow.compat.v1.reshape", "tensorflow.compat.v1.pow", "tensorflow.compat.v1.cast", "tensorflow.compat.v1.squeeze", "tensorflow.compat.v1.nn.moments", "tensorflow.compat.v1.transpose", "tensorflow.compat.v1.greater", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow....
yuuu14/multi-exit-network
[ "eabf7b23fe93e261a5350ed03075dcb49fdeb0f8" ]
[ "deeplearning/evasion_experiments.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport collections\nimport itertools\nimport deeplearning.aux_funcs as af\nimport deeplearning.model_funcs as mf\nfrom deeplearning import network_architectures as arcs\nfrom deeplearning.profiler import profile_sdn, profile\nimport numpy as np...
[ [ "numpy.array", "numpy.reshape", "numpy.argmin", "pandas.DataFrame", "numpy.exp", "numpy.argmax", "numpy.argsort", "torch.nn.CrossEntropyLoss" ] ]
bokulich-lab/q2-fondue
[ "8afd9f61d4faff9a5210b8105d039551685329ab" ]
[ "q2_fondue/sequences.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2022, Bokulich Laboratories.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# ---------------------------------------------...
[ [ "pandas.concat" ] ]
takesi0627/ddc
[ "c9a9cd8a8858f6fe8842585ea7fefd523b818691" ]
[ "infer/onset_net.py" ]
[ "import random\n\nimport tensorflow as tf\nimport numpy as np\n\ndtype = tf.float32\nnp_dtype = dtype.as_numpy_dtype\n\nclass OnsetNet:\n def __init__(self,\n mode,\n batch_size,\n audio_context_radius,\n audio_nbands,\n audio_nchann...
[ [ "numpy.ones_like", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.ones", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.gradients", "numpy.where", "tensorflow.nn.tanh", "tensorflow.train.GradientDescentOptimizer", "tensorflow.trainable_va...
BCampforts/terrainbento
[ "3758d3526a3a134e2cee5263ccff5d51d3ea13d1" ]
[ "terrainbento/derived_models/model_basicStVs.py" ]
[ "# coding: utf8\n# !/usr/env/python\n\"\"\"terrainbento Model **BasicStVs** program.\n\nErosion model program using linear diffusion and stream power. Precipitation is\nmodeled as a stochastic process. Discharge is calculated from precipitation\nusing a simple variable source-area formulation.\n\nLandlab components...
[ [ "numpy.any", "numpy.exp", "numpy.where" ] ]
phil-mansfield/minnow
[ "86669c376dedc74d3641e44170012c158b425c2d" ]
[ "python/bit.py" ]
[ "import cy_bit\nimport numpy as np\n\ndef precision_needed(max):\n return cy_bit.precision_needed(np.uint64(max))\n\ndef array_bytes(bits, length):\n return cy_bit.array_bytes(np.uint64(bits), np.uint64(length))\n\ndef array(bits, x):\n return cy_bit.array(np.uint64(bits), np.asarray(x, dtype=np.uint64))\n...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.uint64", "numpy.int64" ] ]