repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
IanJoel/qiskit-aqua
[ "7707172d01f0539358f1ce2406f307e830105303" ]
[ "qiskit/finance/ising/portfolio_diversification.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\...
[ [ "numpy.diag", "numpy.dot", "numpy.abs", "numpy.around", "numpy.ones", "numpy.flip", "numpy.trace", "numpy.zeros" ] ]
Rizvi-004/text
[ "a48b63448b0164263bcd9bcaeead6bdd91ff6072" ]
[ "test/data/test_functional.py" ]
[ "import os\nimport unittest\nimport sys\nimport uuid\nimport shutil\nimport tempfile\n\nimport sentencepiece as spm\nimport torch\nfrom torchtext.data.functional import (\n generate_sp_model,\n load_sp_model,\n sentencepiece_numericalizer,\n sentencepiece_tokenizer,\n custom_replace,\n simple_spac...
[ [ "torch.jit.load" ] ]
loriab/QCElemental
[ "7cb0fc8f8454fc35402c92bd595de994b723e7de" ]
[ "qcelemental/models/results.py" ]
[ "from typing import Any, Dict, List, Optional, Union\n\nimport numpy as np\nfrom pydantic import constr, validator\n\nfrom ..util import provenance_stamp\nfrom .basemodels import ProtoModel\nfrom .common_models import ComputeError, DriverEnum, Model, Provenance, qcschema_input_default, qcschema_output_default\nfrom...
[ [ "numpy.asarray" ] ]
jacobhepkema/scvi-tools
[ "83e312e30515df97fe2d55dea915c3e23bf97563" ]
[ "scvi/_settings.py" ]
[ "import logging\nfrom pathlib import Path\nfrom typing import Union\n\nimport numpy as np\nimport torch\nfrom rich.console import Console\nfrom rich.logging import RichHandler\n\nfrom ._compat import Literal\n\nlogger = logging.getLogger(__name__)\nscvi_logger = logging.getLogger(\"scvi\")\n\n\nclass ScviConfig:\n ...
[ [ "torch.manual_seed", "numpy.random.seed" ] ]
chenggroup/aiida-lammps
[ "f91e3c8bc2d8d522b3476f31edbc7e08fbec01de" ]
[ "aiida_lammps/calculations/lammps/combinate.py" ]
[ "# Not working with Aiida 1.0\n\nfrom aiida.common.exceptions import InputValidationError\nfrom aiida_phonopy.common.raw_parsers import get_FORCE_CONSTANTS_txt, get_poscar_txt, get_FORCE_SETS_txt\nfrom aiida_lammps.calculations.lammps import BaseLammpsCalculation\nfrom aiida.orm import Dict, ArrayData\nimport numpy...
[ [ "numpy.array", "numpy.random.randint" ] ]
darshil0193/CSC-522---Object-Recognition
[ "f357e6fd3cd69e7335bc25d55eb57b9b5b4e5d88" ]
[ "Supervised/PlainClassifier/PlainClassifier_Cifar.py" ]
[ "#[2.558237690734863, 0.1, 0.5]\n# val accuarcy 0.7268 - val_top_k_categorical_accuracy: 0.9752\n#[0.16813333340644837, 0.24679999944448472, 0.3005333327317238, 0.34263999973535536, 0.37986666697263716, 0.4105333338499069, 0.43090666827201846, 0.4558666682672501, 0.47877333515167236, 0.4989600015449524, 0.516320001...
[ [ "tensorflow.set_random_seed", "sklearn.model_selection.train_test_split", "numpy.random.seed" ] ]
Desil-sketch/Indicators-for-Jesse
[ "ffe33a217002ea3034696fe38acfa72611d52b4f", "ffe33a217002ea3034696fe38acfa72611d52b4f", "ffe33a217002ea3034696fe38acfa72611d52b4f" ]
[ "Indicators/vv_ma_angles.py", "Indicators/vix_fix.py", "Indicators/vama_volume_adjusted_moving_average.py" ]
[ "from jesse.helpers import get_candle_source, slice_candles, np_shift\nimport numpy as np\nfrom numba import njit\nimport talib \nfrom typing import Union\nfrom jesse.helpers import get_config, same_length, get_candle_source, slice_candles, np_shift\nfrom collections import namedtuple\n\nVVMA = namedtuple('VVMA',['...
[ [ "numpy.full_like", "numpy.abs", "numpy.arctan" ], [ "numpy.full_like" ], [ "numpy.full_like", "numpy.cumsum" ] ]
whonor/NNR
[ "5b54af75ac5d9d6f8c0d53e3efb26c4b9c701e66" ]
[ "config.py" ]
[ "import os\nimport argparse\nimport time\nimport torch\nimport random\nimport numpy as np\nimport json\nfrom prepare_MIND_dataset import prepare_MIND_200k, prepare_MIND_small, prepare_MIND_large\n\n\nclass Config:\n def parse_argument(self):\n parser = argparse.ArgumentParser(description='Neural news reco...
[ [ "torch.cuda.set_device", "numpy.random.seed", "torch.cuda.manual_seed", "torch.manual_seed", "torch.cuda.is_available" ] ]
T-head-Semi/tvm
[ "c1b8e06685c92fb7cacbe989e147b0622aee4503" ]
[ "python/tvm/relay/quantize/kl_divergence.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.max", "numpy.histogram", "numpy.min" ] ]
ModelDBRepository/169457
[ "70595cd3d502f2dd68e1c5bec6943f967641aee5" ]
[ "collectthresholddistalamps.py" ]
[ "# collectthresholddistalamps.py\n# A script for collecting all variants' threshold conductances for spike\n# generation as a response to distal stimulus\n#\n# Tuomo Maki-Marttunen, Jan 2015\n# (CC BY)\nfrom neuron import h\nimport matplotlib\nmatplotlib.use('Agg')\nfrom pylab import *\nimport mytools\nimport pickl...
[ [ "matplotlib.use" ] ]
thekishanpatel/python-trading-robot
[ "f004eb78d7e6933915f571ea897aa575fda5d196" ]
[ "pyrobot/stock_frame.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom datetime import time\nfrom datetime import datetime\nfrom datetime import timezone\n\nfrom typing import List\nfrom typing import Dict\nfrom typing import Union\n\nfrom pandas.core.groupby import DataFrameGroupBy\nfrom pandas.core.window import RollingGroupby\nfrom p...
[ [ "pandas.to_datetime", "pandas.Series", "pandas.DataFrame" ] ]
kocurvik/retinanet_traffic_3D
[ "592ceac767750c65bb3d6678b36e6880a7bb0403" ]
[ "dataset_utils/generate_ablation.py" ]
[ "import pickle\nimport numpy as np\nimport os\nimport cv2\n\n\n# Script to generate the dataset from BoxCars116k for Transform2D and Transform3D approaches from the paper\n\ndef generate_ablation_dataset(dataset_path, images_path, t_dataset_path, t_images_path, im_w, im_h):\n with open(dataset_path, \"rb\") as f...
[ [ "numpy.amin", "numpy.amax", "numpy.array" ] ]
fiskio/icml18-jtnn
[ "9c6fb6c9d8170640923b830f85af7f84ac006d57" ]
[ "jtnn/bo/gen_latent.py" ]
[ "import torch\nfrom optparse import OptionParser\n\nimport rdkit\nfrom rdkit.Chem import Descriptors\nfrom rdkit.Chem import MolFromSmiles, MolToSmiles\nfrom rdkit.Chem import rdmolops\nfrom . import sascorer\n\nimport numpy as np \nfrom jtnn.jtnn import *\n\nlg = rdkit.RDLogger.logger() \nlg.setLevel(rdkit.RDLogg...
[ [ "torch.load", "numpy.std", "numpy.mean", "numpy.savetxt", "numpy.array", "numpy.vstack" ] ]
alercebroker/turbo-fats
[ "0e8f0452ce1bcac69ee876c5598a0e1152374400" ]
[ "turbofats/tests/tests_ignacio.py" ]
[ "import unittest\nfrom turbofats.FeatureFunctionLib import Mean\nfrom turbofats import FeatureSpace\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\nclass TestFeatures(unittest.TestCase):\n def setUp(self):\n self.lc_data = pd.read_pickle('ZTF18aaiopei_detections.pkl')\n ...
[ [ "numpy.abs", "numpy.linspace", "numpy.cos", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplot", "matplotlib.pyplot.errorbar", "pandas.read_pickle", "matplotlib.pyplot.show" ] ]
mingbocui/Human-Motion-Prediction
[ "d005995089a0cc31709c17aae3e8afd2869c73aa", "d005995089a0cc31709c17aae3e8afd2869c73aa", "d005995089a0cc31709c17aae3e8afd2869c73aa" ]
[ "sgan/cgs_ffd_models.py", "scripts/mix_train.py", "teacher/policy_adaptive.py" ]
[ "import torch\nimport torch.nn as nn\nimport math\nfrom torch.autograd import Variable\nimport numpy as np\n\ndef make_mlp(dim_list, activation='relu', batch_norm=True, dropout=0):\n layers = []\n # batch_norm=True\n dropout=0.0\n for dim_in, dim_out in zip(dim_list[:-2], dim_list[1:-1]):\n layer...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.BatchNorm1d", "torch.floor", "torch.nn.LSTM", "torch.zeros", "torch.cat", "torch.randn", "torch.unsqueeze", "torch.nn.Linear", "torch.nn.LeakyReLU", "torch.rand", "torch.arange", "torch.stack", "torch....
anthonynwankwo/fairseq
[ "fb18be00f7c89b7173879784c4d6995a52025ffc" ]
[ "fairseq/options.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport argparse\n\nimp...
[ [ "torch.cuda.device_count" ] ]
jeremygold/hexapod
[ "ffbe24c504504cdebb5fbc0f6d5b31c61a453902" ]
[ "ROS/src/hexapod_app/scripts/Test.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nfrom time import sleep\nfrom Joint import Joint\nfrom Leg import Leg\nfrom Robot import Robot\nfrom numpy import arange\nfrom PressupGait import PressupGait\nfrom WalkGait import WalkGait\nfrom WalkBackGait import WalkBackGait\nfrom TurnRightGait import TurnRightGait\nfrom Tu...
[ [ "numpy.arange" ] ]
naeioi/ProMP
[ "bbdd032449322cfb4de042b2c27ed1b364e593d7" ]
[ "meta_policy_search/samplers/vectorized_env_executor.py" ]
[ "import numpy as np\nimport pickle as pickle\nfrom multiprocessing import Process, Pipe\nimport copy\n\n\nclass MetaIterativeEnvExecutor(object):\n \"\"\"\n Wraps multiple environments of the same kind and provides functionality to reset / step the environments\n in a vectorized manner. Internally, the env...
[ [ "numpy.random.seed", "numpy.asarray", "numpy.argwhere", "numpy.logical_or", "numpy.zeros" ] ]
BehnoodRasti/MiSiCNet
[ "1bc6afc1b0d4dece712825a19ffe67655509ca0b" ]
[ "MiSiCNet_SimGit.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Oct 5 19:13:50 2021\r\n\r\n@author: behnood\r\n\"\"\"\r\n\r\n#from __future__ import print_function\r\nimport matplotlib.pyplot as plt\r\n#%matplotlib inline\r\n# from numpy import linalg as LA\r\nimport os\r\n#os.environ['CUDA_VISIBLE_DEVICES'] = '3'\r\n\r\nimp...
[ [ "numpy.diag", "torch.optim.Adam", "torch.nn.Softmax", "numpy.clip", "numpy.reshape", "torch.cat", "torch.from_numpy", "matplotlib.pyplot.subplots", "numpy.stack", "matplotlib.pyplot.plot", "torch.nn.Linear", "torch.nn.Upsample", "torch.nn.LeakyReLU", "numpy....
sebasj13/topasgraphsim
[ "6027c7c098b319159c32108dd4ec63f4b44e8676" ]
[ "topasgraphsim/src/classes/egs_import.py" ]
[ "from tkinter import simpledialog as sd\n\nimport numpy as np\n\nfrom ..classes.profile import ProfileHandler\nfrom ..functions import dp, egspdd\nfrom ..resources.language import Text\n\n\nclass EGSSimulation:\n def __init__(self, filepath):\n\n self.filepath = filepath\n self.filename = self.file...
[ [ "numpy.array" ] ]
loganlebanoff/correct_summarization
[ "cec0d5401ddb5f7c33aca14f31da68b2f8092c53" ]
[ "bert/run_squad.py" ]
[ "# coding=utf-8\r\n# Copyright 2018 The Google AI Language Team Authors.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE...
[ [ "tensorflow.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.logging.warning", "tensorflow.FixedLenFeature", "tensorflow.nn.log_softmax", "tensorflow.gfile.GFile", "tensorflow.reduce_sum", "tensorflow.train.init_from_checkpoint", "tensorflow.gfile.MakeDirs", "tensorflo...
literatorAI/literator.ai
[ "b2140af087e7100fc99ce1c1245d5d5b83e41edb" ]
[ "app/seq2seq_couplet/seq2seq.py" ]
[ "\n\nimport tensorflow as tf\nfrom tensorflow.contrib import rnn\n\nfrom tensorflow.python.layers import core as layers_core\n\n\ndef getLayeredCell(layer_size, num_units, input_keep_prob,\n output_keep_prob=1.0):\n return rnn.MultiRNNCell([rnn.DropoutWrapper(rnn.BasicLSTMCell(num_units),\n input_k...
[ [ "tensorflow.contrib.seq2seq.TrainingHelper", "tensorflow.contrib.seq2seq.dynamic_decode", "tensorflow.device", "tensorflow.get_variable", "tensorflow.concat", "tensorflow.fill", "tensorflow.shape", "tensorflow.reduce_sum", "tensorflow.contrib.rnn.BasicLSTMCell", "tensorflow...
Ronshm/hebrew-word2vec
[ "3f9bade5fb8759aefeefe1d294672ebf479d0197" ]
[ "w2v_algo.py" ]
[ "from utils import *\nfrom numpy import linalg as LA\nimport itertools\n\n\nclass AlgoContainer:\n def __init__(self):\n self._algos_dict = {}\n self._active_algos = []\n self._num_results = 10\n\n def set_num_results(self, num):\n self._num_results = num\n\n def add_algo(self, ...
[ [ "numpy.linalg.norm" ] ]
xqyzjl/face_parsing
[ "3d6c7b06d67c8fbf01bce22db199bc94a13a1a7c" ]
[ "ibug/face_parsing/rtnet/rtnet.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nfrom ibug.roi_tanh_warping.pytorch_impl import (roi_tanh_polar_to_roi_tanh,\n roi_tanh_to_roi_tanh_polar)\n\n\ndef conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1,\n mix_padding=False, padding_modes=['repli...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.cat", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.rand", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.functional.pad", "torch.nn.init.kaiming_normal_" ] ]
James-Archer/numpy-stl
[ "6696fc4fc0a26704c5facf8374ea85c2b80b9535" ]
[ "setup.py" ]
[ "from __future__ import print_function\n\nimport os\nimport sys\nimport warnings\nfrom setuptools import setup, extension\nfrom setuptools.command.build_ext import build_ext\nfrom setuptools.command.test import test as TestCommand\n\nsetup_kwargs = {}\n\n\ndef error(*lines):\n for line in lines:\n print(l...
[ [ "numpy.get_include" ] ]
Johnnan002/Adaptive-diverse-capsule-network
[ "b7eb92890174e1562dfa50ba9bc7961ae40e0de9" ]
[ "Adaptive-diverse-capsule-network.py" ]
[ "# -*- coding: utf-8 -*\n\"\"\"\n This implement is an improved version of real-valued capsule network from our paper《Cv-CapsNet:complex-valued capsule network》,\n We introduce an attentional mechanism for fusing of three levels of features by weights so as to eliminate the manual setting\n of capsule dimensions in...
[ [ "numpy.reshape", "matplotlib.pyplot.imread", "matplotlib.pyplot.show", "numpy.argmax" ] ]
dyarumokumu/bdpy
[ "65b61b274b1400c9c46984b9c757af255251c244" ]
[ "bdpy/dl/torch/models.py" ]
[ "import torch\nimport torch.nn as nn\n\n\ndef layer_map(net):\n maps = {\n 'vgg19': {\n 'conv1_1': 'features[0]',\n 'conv1_2': 'features[2]',\n 'conv2_1': 'features[5]',\n 'conv2_2': 'features[7]',\n 'conv3_1': 'features[10]',\n 'conv3_2': ...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.ConvTranspose2d", "torch.nn.LocalResponseNorm", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.LeakyReLU", "torch.flatten", "torch.nn.ReLU" ] ]
porasgulati/jina
[ "8b72cd5836ea25a42b2b5f50ddcd1193c46b7e7e" ]
[ "tests/docarray/arrays/documentarray/test_documentarray.py" ]
[ "from copy import deepcopy\n\nimport numpy as np\nimport pytest\nfrom scipy.sparse import coo_matrix\n\nfrom docarray import Document, DocumentArray\n\nDOCUMENTS_PER_LEVEL = 1\n\n\n@pytest.fixture\ndef docarray_for_cache():\n da = DocumentArray()\n d1 = Document(id=1)\n d2 = Document(id='2')\n da.extend...
[ [ "numpy.array" ] ]
baiwuchang/CLM_DR
[ "6ca572680e1f829f2cb181f192bc30e4fed69e36" ]
[ "data/dataloaders/base_trainer.py" ]
[ "import os, json, math, logging, sys, datetime, time\nimport torch\nfrom torch.utils import tensorboard\nfrom utils import helpers\nfrom utils import logger\nimport utils.lr_scheduler\nfrom utils.helpers import dir_exists\n\ndef get_instance(module, name, config, *args):\n return getattr(module, config[name]['ty...
[ [ "torch.cuda.set_device", "torch.load", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.utils.tensorboard.SummaryWriter", "torch.device", "torch.cuda.device_count", "torch.save" ] ]
project-mnist-2018/project
[ "e6dc852c26567766db3a724a0a3c26ecfd6cabae" ]
[ "classifiers/utils/misc.py" ]
[ "\"\"\" Miscellaneous auxiliary functions \"\"\"\nimport os\n\nfrom keras.datasets import mnist\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport numpy\n\n# TODO mock function that creates a dummy feature vector\ndef get_feature_vector():\n return numpy.zeros(28*28)\n\n\ndef ge...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.yticks", "numpy.sqrt", "matplotlib.pyplot.title", "matplotlib.use", "matplotlib.pyplot.savefig", "numpy.concatenate", "matplotlib.pyplot.subplot", "numpy.load", "matplotlib.pyplot.xticks", ...
zhrlove/seq2seq_attention_1
[ "6535820c9381467508ba8dfeb8971173b3998510", "6535820c9381467508ba8dfeb8971173b3998510" ]
[ "translate/utils.py", "translate/models.py" ]
[ "import os\nimport sys\nimport re\nimport numpy as np\nimport logging\nimport struct\nimport random\nimport math\nimport wave\nimport shutil\nimport collections\nimport functools\nimport operator\nimport heapq\n\nfrom collections import namedtuple\nfrom contextlib import contextmanager\n\n# special vocabulary symbo...
[ [ "numpy.array", "matplotlib.pyplot.yticks", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.autoscale", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.rcParams.update", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.xtick...
IlyaLSMmisis/scqubits-1
[ "c4915c998c2d1ef3348db0e4c423e74c7181da40" ]
[ "scqubits/utils/spectrum_utils.py" ]
[ "# spectrum_utils.py\n#\n# This file is part of scqubits.\n#\n# Copyright (c) 2019, Jens Koch and Peter Groszkowski\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n############################...
[ [ "numpy.dot", "numpy.abs", "numpy.asarray", "numpy.exp", "numpy.unravel_index", "numpy.sum", "numpy.empty" ] ]
ejklike/scikit-learn
[ "8cf87a30bbd5cbd6444c6f3ed380a3d2b5f67461" ]
[ "sklearn/neighbors/_lof.py" ]
[ "# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr>\n# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# License: BSD 3 clause\n\nimport numpy as np\nimport warnings\n\nfrom ._base import NeighborsBase\nfrom ._base import KNeighborsMixin\nfrom ..base import OutlierMixin\n\nfrom ..uti...
[ [ "numpy.maximum", "numpy.mean", "numpy.percentile", "numpy.ones" ] ]
NREL/disco
[ "19afa1c397c6c24e37222f6cbf027eb88833beda" ]
[ "disco/postprocess/hosting_capacity_from_pydss.py" ]
[ "\"\"\"\nGoal is to take the PyDSS hd5 store the compute hosting capacity analysis\n\"\"\"\n\n# python standard imports\nfrom pathlib import Path\nimport os\nimport json\nimport copy\nimport logging\nfrom textwrap import indent\n\n# python third-party imports\nimport numpy as np\n\n# python internal imports\nfrom P...
[ [ "numpy.max", "numpy.array" ] ]
Haruhiprprpr/nmt
[ "36adea51526183bd774bf98b1c4887ed379cf426" ]
[ "nmt/utils/common_test_utils.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless ...
[ [ "tensorflow.python.ops.lookup_ops.index_to_string_table_from_tensor", "tensorflow.python.ops.lookup_ops.index_table_from_tensor", "tensorflow.constant" ] ]
mgohde/prednet-saliency-extraction
[ "9deedc89330258c57a66f3381dd1415cf49a6195" ]
[ "data_utils.py" ]
[ "import hickle as hkl\nimport numpy as np\nfrom keras import backend as K\nfrom keras.preprocessing.image import Iterator\n\n\"\"\"\nclass GenericSequence(Iterator):\n def __init__(self, data, output_mode=\"error\", data_format=K.image_data_format(), batch_size=100, shuffle=0, seed=0):\n self.X=hkl.load(d...
[ [ "numpy.random.permutation", "numpy.zeros", "numpy.transpose" ] ]
yokian/csaf
[ "a94f0943541a21a270b753577979989b98e84497" ]
[ "new_csaf/tests/f16_tests/test_acasf16.py" ]
[ "import pytest\nimport csaf\nimport f16lib.systems as f16s\nimport f16lib.components as f16c\nimport f16lib.acas as f16acas\nimport numpy as np\n\n\n@pytest.fixture\ndef acas_shield_balloon_f16():\n \"\"\"create F16Simple for tests\"\"\"\n sys = f16s.F16AcasShieldIntruderBalloon()\n yield sys\n\n\n@pytest....
[ [ "numpy.array" ] ]
piiswrong/fedlearner
[ "8875d30cfeb40d149a26faa5056f9fa6e96b3fac" ]
[ "web_console_v2/api/fedlearner_webconsole/utils/file_manager.py" ]
[ "# Copyright 2020 The FedLearner 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 requ...
[ [ "tensorflow.io.gfile.isdir", "tensorflow.io.gfile.walk", "tensorflow.io.gfile.exists", "tensorflow.io.gfile.stat", "tensorflow.io.gfile.makedirs", "tensorflow.io.gfile.listdir", "tensorflow.io.gfile.rmtree", "tensorflow.io.gfile.copy" ] ]
JRMeyer/nonparaSeq2seqVC_code
[ "cd000fe0021a82b841eccca576484035ba058186" ]
[ "pre-train/model/loss.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom .utils import get_mask_from_lengths\n\nclass ParrotLoss(nn.Module):\n def __init__(self, hparams):\n super(ParrotLoss, self).__init__()\n self.hidden_dim = hparams.encoder_embedding_dim\n self.ce_loss = hparams.c...
[ [ "torch.nn.CrossEntropyLoss", "torch.ones_like", "torch.nn.functional.softmax", "torch.max", "torch.transpose", "torch.cat", "torch.norm", "torch.sum", "torch.eye", "torch.zeros_like", "torch.tensor", "torch.nn.BCEWithLogitsLoss", "torch.nn.L1Loss", "torch.nn...
hulecom/read-GRACE-harmonics
[ "7e7cd756cc1875b4f85bfd516b7df5b44eec7684" ]
[ "gravity_toolkit/grace_date.py" ]
[ "#!/usr/bin/env python\nu\"\"\"\ngrace_date.py\nWritten by Tyler Sutterley (05/2021)\n\nReads index file from podaac_grace_sync.py or gfz_isdc_grace_ftp.py\nParses dates of each GRACE/GRACE-FO file and assigns the month number\nCreates an index of dates for GRACE/GRACE-FO files\n\nINPUTS:\n base_dir: Working dat...
[ [ "numpy.round", "numpy.int64", "numpy.int", "numpy.mean", "numpy.float64", "numpy.zeros", "numpy.float" ] ]
0x5eba/Dueling-DQN-SuperMarioBros
[ "a758ef28b66b222e286bcc5b71748cd84a02e6ed" ]
[ "agent/DQ_agent.py" ]
[ "\"\"\"An implementation of Deep Q-Learning.\"\"\"\nfrom os import listdir\nfrom typing import Callable\nfrom tqdm import tqdm\nfrom keras.optimizers import Adam\nfrom .model.dueling_DQ_agent import build_dueling_deep_q_model\nfrom .replay.annealing_variable import AnnealingVariable\nfrom .model.losses import huber...
[ [ "numpy.random.random", "numpy.eye", "numpy.ones", "numpy.argmax", "numpy.load", "numpy.zeros" ] ]
opi9a/data_accelerator
[ "a0d78b19e5a40874f467ba6d649d7ed55578d355" ]
[ "policy_tools.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom openpyxl import load_workbook\nfrom matplotlib import pyplot as plt\nfrom matplotlib import rcParams\nimport matplotlib.ticker as ticker\nimport projection_funcs as pf\nfrom collections import namedtuple\nimport inspect\nimport os\n\n\ndef spend_mult(sav_rate, k1=None,...
[ [ "matplotlib.ticker.MultipleLocator", "pandas.Series", "numpy.arange", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.ones", "numpy.concatenate", "matplotlib.pyplot.subplots", "pandas.Period", "pandas.ExcelWriter", "numpy.zeros" ] ]
sakehl/kernel_tuner
[ "6353aeafd40854b167d0d4a2943fa1698e0babb6" ]
[ "examples/opencl/convolution_correct.py" ]
[ "#!/usr/bin/env python\n\"\"\" convolution with correctness checks\n\nThis example is mostly the same as the Convolution example. The only\ndifference is that a naive kernel is used to compute a reference\noutput. This reference output is used to check the correctness of\nevery kernel before it is benchmarked.\n\nT...
[ [ "numpy.random.randn", "numpy.zeros", "numpy.prod" ] ]
hj-im/VidCap_vanillaTransformer
[ "b6e915ca3de90b2b7b3c5d4d9711a758bf8f0c7c" ]
[ "make_beam_challenge.py" ]
[ "# Copyright 2021 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\...
[ [ "torch.range", "torch.transpose", "torch.zeros", "torch.cat", "torch.lt", "torch.no_grad", "torch.topk", "torch.logsumexp", "torch.logical_not", "torch.eq", "torch.reshape", "torch.tensor", "numpy.finfo", "torch.squeeze", "torch.empty", "torch.min", ...
CMFell/phd_cnn_code
[ "cb343bc379f5b06241cead64089a41ae5a6fe167" ]
[ "src/postprocess/results_process.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom postprocess.image_process import get_image_file_names\n\n\ndef remove_on_size(gfrc_windows):\n too_small = int(0.75*11)\n too_big = int(1.25*163)\n area_too_small = int(0.75*319)\n area_too_big = int(1.25*24287)\n\n gfrc_windows['xside'] = gfrc_windows...
[ [ "numpy.logical_not", "pandas.concat", "numpy.hstack", "numpy.maximum", "numpy.minimum", "numpy.linspace", "numpy.unique", "numpy.min", "numpy.multiply", "numpy.greater", "numpy.subtract", "pandas.DataFrame", "numpy.max", "numpy.argmax", "numpy.mean", ...
HyperionWang/CarND-Capstone
[ "4a6e74eb7ec21fd92db48e85e406af2d4630eb6b" ]
[ "ros/src/tl_detector/tl_detector.py" ]
[ "#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped, Pose\nfrom styx_msgs.msg import TrafficLightArray, TrafficLight\nfrom styx_msgs.msg import Lane, Waypoint\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom light_classification.tl_...
[ [ "numpy.dot", "numpy.array", "scipy.spatial.KDTree" ] ]
darwinlc/NeoFinRL
[ "fd46d44a2b96220204e9eea469ca16801e2be8a6" ]
[ "rllib/agents/trainer.py" ]
[ "import copy\nfrom datetime import datetime\nimport functools\nimport gym\nimport logging\nimport math\nimport numpy as np\nimport os\nimport pickle\nimport tempfile\nimport time\nfrom typing import Callable, Dict, List, Optional, Type, Union\n\nimport ray\nfrom ray.actor import ActorHandle\nfrom ray.exceptions imp...
[ [ "numpy.stack" ] ]
lover-520/lover-notes
[ "2bd3ce6e3107de241b831a9df92565dd76c6aed4" ]
[ "Project/SemanticSegmentation/dataloader/voc.py" ]
[ "# -*-coding:UTF-8 -*-\n'''\n* voc.py\n* @author wzm\n* created 2021/03/16 18:21:41\n* @function: voc的数据加载文件\n'''\n\nimport numpy as np\nimport os\nimport collections\nimport PIL.Image\nimport cv2\nimport random\n\nimport torch\nfrom torch.utils import data\nimport torchvision.transforms as transforms\n\n\nclass VO...
[ [ "numpy.arange", "numpy.array", "numpy.zeros", "torch.from_numpy" ] ]
wuxiaohua1011/maggma
[ "b7a059b2d12d9b96aa2092c40eb41f121c0a598b" ]
[ "tests/stores/test_gridfs.py" ]
[ "import pytest\nimport numpy as np\nimport numpy.testing.utils as nptu\nfrom datetime import datetime\nfrom maggma.stores import GridFSStore\nfrom maggma.stores import MongoStore\n\n\n@pytest.fixture\ndef mongostore():\n store = MongoStore(\"maggma_test\", \"test\")\n store.connect()\n yield store\n sto...
[ [ "numpy.testing.utils.assert_almost_equal", "numpy.random.rand" ] ]
clazaro97chosen/American-Community-Survey-Project
[ "ac3f8c1231ea71bdd7fc7b8eceb8e69cd6d7b842" ]
[ "src/visualizing/heatmap.py" ]
[ "from matplotlib import pyplot as plt\nimport pandas as pd\nimport seaborn as sns\nimport numpy as np\n\n\ndef heatmap(x, y, **kwargs):\n if 'color' in kwargs:\n color = kwargs['color']\n else:\n color = [1]*len(x)\n\n if 'palette' in kwargs:\n palette = kwargs['palette']\n n_co...
[ [ "matplotlib.pyplot.GridSpec", "matplotlib.pyplot.subplot", "numpy.linspace" ] ]
parall4x/bittensor
[ "abacb0b0f1b078d3103f516aff1328f049f9dc34" ]
[ "bittensor/axon.py" ]
[ "\n# The MIT License (MIT)\n# Copyright © 2021 Yuma Rao\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated \n# documentation files (the “Software”), to deal in the Software without restriction, including without limitation \n# the rights to use, copy, m...
[ [ "torch.sum" ] ]
canishknaik/QuantEcon.py
[ "1c84f6fe0c0c451c974af236618f4cd4f027583b" ]
[ "quantecon/markov/tests/test_random.py" ]
[ "\"\"\"\nTests for markov/random.py\n\n\"\"\"\nimport numpy as np\nfrom numpy.testing import (\n assert_array_equal, assert_raises, assert_array_almost_equal_nulp\n)\nfrom nose.tools import eq_, ok_, raises\n\nfrom quantecon.markov import (\n random_markov_chain, random_stochastic_matrix, random_discrete_dp\n...
[ [ "numpy.testing.assert_array_equal", "numpy.all", "numpy.testing.assert_raises", "numpy.ones" ] ]
bruceravel/xraylarch
[ "a8179208872d43bd23453fa0c64680e11bc2b5ed" ]
[ "plugins/math/fitpeak.py" ]
[ "\"\"\"\nBasic Fitting Models for 1-D data, simplifying fits to many standard line shapes.\n\n usage:\n ------\n param_group = fit_peak(x, y, model, dy=None,\n background='linear', step='linear')\n\n arguments:\n ---------\n x array of values at which to calculate model\n y ...
[ [ "numpy.log", "numpy.polyfit", "numpy.sqrt", "numpy.arctan", "scipy.special.erf", "numpy.zeros_like", "scipy.special.wofz", "numpy.exp", "numpy.where" ] ]
pipepipexiaji/matplotlib
[ "f7a25f22afeceb11f37354ff8249790090ab3df6" ]
[ "notebook/numpy/frac_dimension.py" ]
[ "import sys, os\nimport numpy as np\n\ndef frac_dimension(z, threshold=0.9):\n def pointcount(z,k):\n s=np.add.reduceat(np.add.reduceat(\n z, np.arange(0, z.shape[0], k), axis=0 ),\n np.arange(0, z.shape[1], k), axis=1)\n return len(np.where( ( s>0 ) & (s<k*k) )[0...
[ [ "numpy.log", "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.patches.Rectangle", "matplotlib.pyplot.savefig", "scipy.misc.imread", "matplotlib.pyplot.show", "numpy.where", "matplotlib.pyplot.figure" ] ]
BlueBrain/atlas-interpolation
[ "c19ca081ee5354d72987e8ee4cacb78d96319c34" ]
[ "src/atlinter/vendor/rife/loss.py" ]
[ "# SPDX-License-Identifier: MIT\n# Source: https://github.com/hzwer/arXiv2020-RIFE/tree/6ff174584737a9aa27cd9654443a8a79c76799c9\nimport torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models as models\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available...
[ [ "torch.mean", "torch.abs", "torch.ones", "torch.Tensor", "torch.zeros", "torch.sqrt", "torch.nn.functional.conv2d", "numpy.eye", "torch.eye", "torch.tensor", "numpy.random.normal", "torch.cuda.is_available", "numpy.transpose", "torch.nn.functional.pad" ] ]
COLAB2/midca
[ "18d6b13e3d6b0d980cd3453196e82fad7302e79b" ]
[ "midca/vision/monitor.py" ]
[ "import cv2\nimport numpy as np\nfrom _dbus_bindings import String\nimport math\n\ncap = cv2.VideoCapture(0)\nfrom .baxter import *\nimport time\nbaxter = Baxter()\n\nimport os\nimport sys\nimport argparse\n \nimport rospy\n \nfrom cv_bridge import CvBridge, CvBridgeError\nfrom std_msgs.msg import String\n\nf...
[ [ "numpy.size", "numpy.array", "numpy.linalg.norm" ] ]
Luzeru/TensorFlowTTS
[ "0f02377f679d176ce1223c4c41750985d2d4e8c5" ]
[ "examples/tacotron2/train_tacotron2.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2020 Minh Nguyen (@dathudeptrai)\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.reduce_sum", "tensorflow.config.list_physical_devices", "tensorflow.math.not_equal", "tensorflow.keras.losses.MeanAbsoluteError", "matplotlib.pyplot.tight_layout", "tensorflow.config.experimental.set_memory_growth", "tensorflow.keras.losses.BinaryCrossentropy", "matplot...
mlopsbr/mlops_project
[ "5bca93e21bb8987079977a9b375a85ec865ed556" ]
[ "src/models/train_model.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"This module is responsible by the model creation and model training.\"\"\"\nimport argparse\nfrom pathlib import Path\nfrom collections import namedtuple\nfrom sklearn.base import ClassifierMixin\nfrom sklearn.utils import all_estimators\nfrom rich import print\nimport joblib\nimport...
[ [ "sklearn.utils.all_estimators" ] ]
fuodorov/kenv
[ "dcae5c2e6c43a977e6b32429cbb689df457d7631", "dcae5c2e6c43a977e6b32429cbb689df457d7631" ]
[ "gui/kenv_gui.py", "kenv/solver.py" ]
[ "\n# A. Petrenko (Snezhinsk, 2019)\n# petrenko@inp.nsk.su\n\nimport sys, time\nimport numpy as np\n\n# Kapchinsky-Vladimirsky equation solver developped by V. Fedorov, D. Nikiforov, A. Petrenko\n# https://github.com/fuodorov/kenv\nimport kenv as kv\n\nfrom PyQt5.QtWidgets import QApplication, QPushButton, QVBoxLayo...
[ [ "numpy.abs", "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.figure" ], [ "numpy.sqrt", "scipy.integrate.solve_ivp", "numpy.cos", "numpy.sin", "scipy....
welbertrana/AI_Projects
[ "cfb9140c5de7c583188d36ed21c062d6f1ceaea9" ]
[ "learning/getting-started.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\n# !pip install -q tensorflow==2.0.0-alpha0\n\nimport numpy as np\nimport tensorflow as tf\n\n\nmnist = tf.keras.datasets.mnist\n\nprint(\"Load Dataset\")\n(x_train, y_train), (x_test, y_test) = mnist.load_data()\n\nprint(\"Conver...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dropout" ] ]
seung-lab/chunkflow
[ "0e032cdf4f2ba104af4f7809ac11df17352384ed" ]
[ "chunkflow/flow/write_precomputed.py" ]
[ "import logging\nimport time\nimport os\nimport json\nimport numpy as np\n\nfrom cloudvolume import CloudVolume\nfrom cloudvolume.lib import Vec, Bbox, yellow\nfrom cloudfiles import CloudFiles\n\nfrom chunkflow.lib.igneous.tasks import downsample_and_upload\nfrom chunkflow.chunk import Chunk\n\nfrom .base import O...
[ [ "numpy.maximum", "numpy.issubdtype", "numpy.all", "numpy.transpose", "numpy.zeros" ] ]
tdegeus/pyplot_ext
[ "d084fb6f5a824d9c9c3d1bf9a3c9ef9e579b4d7f" ]
[ "docs/examples/pyplot/plot-cmap.py" ]
[ "import matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nplt.style.use([\"goose\", \"goose-latex\"])\n\nx = np.linspace(0, 5, 100)\nN = 21\ncmap = plt.get_cmap(\"jet\", N)\n\nfig, ax = plt.subplots()\n\nfor i, n in enumerate(np.linspace(0, 2, N)):\n y = np.sin(x) * x**n\n ax.plot(x, y...
[ [ "numpy.linspace", "matplotlib.pyplot.subplots", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.savefig", "numpy.sin", "matplotlib.pyplot.colorbar", "matplotlib.colors.Normalize", "matplotlib.pyplot.close", "matplotlib.pyplot.style.use" ] ]
toshihikoyanase/chainer
[ "894cd5d008f11eccdf6e1d7106f5b8bfff9ce005", "894cd5d008f11eccdf6e1d7106f5b8bfff9ce005" ]
[ "chainer/functions/math/exponential.py", "tests/chainer_tests/test_optimizer.py" ]
[ "import math\n\nimport numpy\n\nfrom chainer import backend\nfrom chainer.backends import cuda\nfrom chainer import function_node\nfrom chainer import utils\nfrom chainer.utils import type_check\n\n\nclass Exp(function_node.FunctionNode):\n\n @property\n def label(self):\n return 'exp'\n\n def check...
[ [ "numpy.log", "numpy.exp" ], [ "numpy.ones_like", "numpy.arange", "numpy.ones", "numpy.copy", "numpy.random.uniform", "numpy.array" ] ]
Tongming0710/DataGenerationPlastic
[ "11cd3f0398f18f1b6c1ab4f63dd6e90aea829642" ]
[ "misesTraining.py" ]
[ "import os\nimport sys\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport time\nfrom torch import nn\nimport pickle\nimport torch.nn.functional as F\nimport copy\n\n\nclass SSP(nn.Softplus):\n def __init__(self, beta=1, threshold=20):\n super(SSP, self).__init__(beta, threshold)\n ...
[ [ "numpy.split", "numpy.sqrt", "torch.cat", "torch.load", "torch.zeros", "numpy.max", "numpy.mean", "torch.cuda.is_available", "torch.device", "matplotlib.pyplot.tight_layout", "torch.ones", "torch.randn", "torch.nn.Sigmoid", "torch.tensor", "numpy.std", ...
d4l3k/ourgraph
[ "9a0f706babf3696a4747d5d4882575ecd9374a63" ]
[ "training/main.py" ]
[ "import multiprocessing\n\nimport torch\nfrom torch import nn\nfrom torch import optim\nfrom adamW import AdamW\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\n\nimport model\nimport dataset\n\ndef all_to(arr, device):\n return [a.to(device, non_blocking=True) for a in arr]\n\ndef main():\n d...
[ [ "torch.device", "torch.no_grad", "torch.nn.CosineEmbeddingLoss", "torch.utils.data.DataLoader" ] ]
minai2020/tensorflow
[ "a6b4474186c906c09cd29b1a7d4d0af714c261e4" ]
[ "tensorflow/python/keras/layers/preprocessing/image_preprocessing_test.py" ]
[ "# Copyright 2019 The TensorFlow 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 requ...
[ [ "numpy.asarray", "tensorflow.python.compat.compat.forward_compatible", "tensorflow.python.keras.utils.generic_utils.CustomObjectScope", "tensorflow.python.keras.layers.preprocessing.image_preprocessing.CenterCrop", "tensorflow.python.platform.test.is_built_with_rocm", "tensorflow.python.ke...
DrInfy/TheHarvester
[ "dd21194ab2220c8edb73352c299d2bfb0f11d7d6" ]
[ "harvester/builds/ml_build.py" ]
[ "from abc import abstractmethod\nfrom typing import List, Union, Tuple\nimport numpy as np\n\nfrom sc2 import Result, UnitTypeId\nfrom sharpy.managers.extensions import ChatManager\nfrom sharpy.plans import BuildOrder\nfrom sharpy.plans.acts import ActBase\nfrom tactics.ml.agents import BaseMLAgent\n\nREWARD_WIN = ...
[ [ "numpy.array" ] ]
CUHK-CSE/logalizer
[ "8f1f1face2c0e270fd9bcecdefe37ebc6ba76e9d" ]
[ "benchmark/LogMine_benchmark.py" ]
[ "#!/usr/bin/env python\r\n\r\nimport sys\r\nsys.path.append('../')\r\nfrom logparser import LogMine, evaluator\r\nimport os\r\nimport pandas as pd\r\n\r\ninput_dir = '../logs/' # The input directory of log file\r\noutput_dir = 'LogMine_result/' # The output directory of parsing results\r\n\r\nbenchmark_settings = {...
[ [ "pandas.DataFrame" ] ]
youworks/arcclimate
[ "62a9eece267e42ccddfc5145e8ee50776470f7bf" ]
[ "src/arcclimate/mixing_ratio.py" ]
[ "\"\"\"\n重量絶対湿度の計算モジュール\n\"\"\"\n\nimport numpy as np\n\n\ndef get_corrected_mixing_ratio(\n MR: np.ndarray, TMP: np.ndarray, PRES: np.ndarray\n) -> np.ndarray:\n \"\"\"重量絶対湿度の標高補正\n\n Args:\n MR(np.ndarray): 補正前重量絶対湿度 (Mixing Ratio) [g/kg(DA)]\n TMP(np.ndarray): 気温 [C]\n PRES(np.ndarray): 気...
[ [ "numpy.log", "numpy.maximum" ] ]
Niteshyadav0331/Stores-Sales-Prediction
[ "dada5db9c33f2a6d059e3e854ce7d94f28b254b9" ]
[ "preprocessing.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import RobustScaler\nfrom imblearn.under_sampling import NearMiss\nfrom application_logging.logging import logger_app\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\nclass Preprocessor:\n \n def __init__(self):\n self.logFile...
[ [ "sklearn.preprocessing.RobustScaler", "pandas.DataFrame" ] ]
ruffsl/habitat-api
[ "0a57aec15889a86fd0a1404dc79d8b93ebc2dc3a" ]
[ "examples/vln_reference_path_follower_example.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\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 os\nimport shutil\n\nimport numpy as np\n\nimport habitat\nfrom examples.shortest_path_follower_exampl...
[ [ "numpy.concatenate" ] ]
cq2019git/PaddleClas
[ "10326f0d0b89dc5aaf711fd0b9f45f6557007208", "10326f0d0b89dc5aaf711fd0b9f45f6557007208" ]
[ "ppcls/modeling/architectures/darts_gs.py", "dataset/flowers102/generate_flowers102_list.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.\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 require...
[ [ "numpy.ones" ], [ "numpy.array" ] ]
TomAugspurger/geopandas
[ "da3aef6d4bbf0b2308aaeed36e0b5904fd7526ec" ]
[ "geopandas/tools/sjoin.py" ]
[ "from warnings import warn\n\nimport numpy as np\nimport pandas as pd\n\nfrom shapely import prepared\n\nfrom geopandas import GeoDataFrame\n\n\ndef sjoin(\n left_df, right_df, how=\"inner\", op=\"intersects\", lsuffix=\"left\", rsuffix=\"right\"\n):\n \"\"\"Spatial join of two GeoDataFrames.\n\n Parameter...
[ [ "numpy.concatenate", "numpy.vectorize", "numpy.empty", "pandas.DataFrame" ] ]
Neel-Renavikar/ivy
[ "644ab189a3a3fc52b1f3f86563226106e549eea3", "644ab189a3a3fc52b1f3f86563226106e549eea3" ]
[ "ivy/functional/backends/numpy/linear_algebra.py", "ivy/functional/backends/tensorflow/old/linear_algebra.py" ]
[ "# global\nimport numpy as np\nfrom typing import Union, Optional, Tuple, Literal\nfrom collections import namedtuple\n\n# local\nfrom ivy import inf\nimport ivy\nfrom collections import namedtuple\n\n\ninv = np.linalg.inv\npinv = np.linalg.pinv\n\n\ndef matrix_transpose(x: np.ndarray)\\\n -> np.ndarray:\n ...
[ [ "numpy.linalg.svd", "numpy.swapaxes", "numpy.expand_dims", "numpy.linalg.slogdet", "numpy.trace", "numpy.matmul", "numpy.linalg.norm", "numpy.linalg.qr", "numpy.diagonal" ], [ "tensorflow.concat", "tensorflow.zeros", "tensorflow.expand_dims", "tensorflow.lin...
iuga/PyStarLog
[ "5c92111e30a070eec0fbe129417b844e38b9bb79" ]
[ "examples/basic.py" ]
[ "from starlog import log_experiment\nfrom sklearn.datasets import load_iris\nimport pandas as pd\n\n# Load a mock dataframe\niris = load_iris()\niris_df = pd.DataFrame(iris.data, columns=iris.feature_names)\n\n# Register the experiment results\nlog_experiment(\n # What did you do?\n # Did you add new features...
[ [ "sklearn.datasets.load_iris", "pandas.DataFrame" ] ]
stanfordnlp/spinn
[ "f2f95f585328ec5cd7da071753f5e0582e7600a0", "f2f95f585328ec5cd7da071753f5e0582e7600a0" ]
[ "python/spinn/tests/test_util.py", "python/spinn/tests/test_plain_rnn.py" ]
[ "import numpy as np\n\nfrom nose.tools import assert_equal\n\nfrom spinn import util\n\n\nTEST_EMBEDDING_MATRIX = \"spinn/tests/test_embedding_matrix.5d.txt\"\n\n\ndef test_build_vocabulary_for_ascii_embedding_file():\n types_in_data = [\"and\", \"the\", \"_\", \"strange_and_exotic_word\"]\n core_vocabulary =...
[ [ "numpy.asarray", "numpy.testing.assert_array_equal" ], [ "numpy.arange", "numpy.testing.assert_almost_equal", "numpy.array" ] ]
benfred/implicit
[ "13bc4c7e287beb204f5f05c806802e76dcc0c663" ]
[ "tests/recommender_base_test.py" ]
[ "\"\"\" Common test functions for all recommendation models \"\"\"\n\nfrom __future__ import print_function\n\nimport pickle\nimport random\n\nimport numpy as np\nfrom scipy.sparse import csr_matrix\n\nfrom implicit.evaluation import precision_at_k\nfrom implicit.nearest_neighbours import ItemItemRecommender\n\n\nd...
[ [ "numpy.allclose", "numpy.arange", "numpy.eye", "scipy.sparse.csr_matrix", "numpy.array", "numpy.zeros" ] ]
nishanrajkantan/snorkel-tutorials
[ "e8b556cd6bdbb74ac177af3c6fa3a6cf9d1b22e1" ]
[ "spouse/job.py" ]
[ "# %% [markdown]\n# # Detecting spouse mentions in sentences\n\n# %% [markdown]\n# In this tutorial, we will see how Snorkel can be used for Information Extraction. We will walk through an example text classification task for information extraction, where we use labeling functions involving keywords and distant sup...
[ [ "pandas.set_option", "numpy.array", "pandas.read_csv" ] ]
kslam07/FMT-Exercise
[ "f219b02f46fea43b2061a96694e2af747c651690" ]
[ "FMT-HWA/HWA_DataAnalysis.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat May 22 14:41:01 2021\n\n@author: Thomas\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\nfrom scipy import stats\n\n################## Calibration Data ###########################\nCalibrationFolder = 'data/Calibration' #...
[ [ "matplotlib.pyplot.legend", "numpy.polyfit", "numpy.linspace", "scipy.stats.zscore", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.mean", "numpy.polyval", "pandas.read_csv", "numpy.arange", "matplotlib.pyplot.figure", "pandas.concat", "matplotlib.pyplot.t...
HesamZamanpour/wapor
[ "553981e78164e7fd326be5f65a46bdd1dc80288a" ]
[ "Collect/SRTM/DataAccess.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nAuthors: Tim Hessels\nModule: Collect/SRTM\n\"\"\"\n\n# General modules\nimport numpy as np\nimport os\nimport urllib\nimport shutil\nimport gdal\nimport sys\n\ndef DownloadData(output_folder, latlim, lonlim):\n \"\"\"\n This function downloads DEM data from SRTM\n\n Keywo...
[ [ "numpy.min", "numpy.arange", "numpy.flipud", "numpy.ones", "numpy.round", "numpy.max", "numpy.ceil", "numpy.append", "numpy.shape", "numpy.floor" ] ]
henriqueribeiro/holoviews
[ "cab8b05e725f6f11fc6ef90f9bc91ddaea2449ff" ]
[ "holoviews/core/data/interface.py" ]
[ "from __future__ import absolute_import\n\nimport warnings\n\nimport param\nimport numpy as np\n\nfrom .. import util\nfrom ..element import Element\nfrom ..ndmapping import OrderedDict, NdMapping\n\n\ndef get_array_types():\n array_types = (np.ndarray,)\n da = dask_array_module()\n if da is not None:\n ...
[ [ "numpy.nanmax", "numpy.abs", "numpy.nanmin", "numpy.logical_or.reduce", "numpy.isscalar", "numpy.array", "numpy.sum" ] ]
yuriyi/devito
[ "d0a29b3ad3653c20f88b35c2780471cef107b7a2" ]
[ "devito/function.py" ]
[ "from collections import OrderedDict\nfrom itertools import product\n\nimport sympy\nimport numpy as np\nfrom psutil import virtual_memory\nfrom cached_property import cached_property\n\nfrom devito.cgen_utils import INT, cast_mapper\nfrom devito.data import Data, default_allocator, first_touch\nfrom devito.dimensi...
[ [ "numpy.ascontiguousarray", "numpy.ndarray", "numpy.cumsum", "numpy.dtype", "numpy.prod", "numpy.array", "numpy.empty" ] ]
lrodri29/ingest-client
[ "548e1891990a70c23f2534eefbdbda35014edab1", "548e1891990a70c23f2534eefbdbda35014edab1" ]
[ "ingestclient/plugins/tile.py", "ingestclient/plugins/intern.py" ]
[ "# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory\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# ...
[ [ "numpy.random.randint" ], [ "numpy.asarray", "numpy.squeeze", "numpy.zeros" ] ]
wuhenbai/hotpot
[ "98652b40e9aff56ce3109074a514b46ec6820105" ]
[ "transformers/modeling_albert.py" ]
[ "# coding=utf-8\n# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team.\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/LIC...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.ones", "torch.zeros", "torch.einsum", "torch.from_numpy", "torch.nn.Embedding", "torch.nn.LayerNorm", "tensorflow.train.load_variable", "torch.nn.Linear", "torch.matmul", "torch.nn.Tanh"...
ClementMaliet/playground-metrics
[ "7a0607c14a830818f9450d2febd8ae5e1709f8cf", "7a0607c14a830818f9450d2febd8ae5e1709f8cf" ]
[ "tests/test_match/test_match_iou/test_match.py", "playground_metrics/map_metric.py" ]
[ "import os.path\nfrom sys import platform\n\nimport numpy as np\nfrom pytest import raises, mark\nfrom tests.test_match.test_match_iou.test_match_bbox import gt_mean_area\nfrom tests.test_match.test_match_iou.test_match_bbox import detections as detections_bbox\nfrom tests.test_match.test_match_iou.test_match_bbox ...
[ [ "numpy.all" ], [ "numpy.logical_not", "numpy.spacing", "numpy.cumsum", "numpy.concatenate", "numpy.argsort", "numpy.array", "numpy.sum" ] ]
Fork-for-Modify/MetaSCI-CVPR2021
[ "375a8b25c1f39351798619f6f5ef67e9f227bc66" ]
[ "main_MetaAdaptModel_test.py" ]
[ "\"\"\"\n@author : Zhihong Zhang\n# Adaptation model test for metaSCI\n# modified: Zhihong Zhang, 2021.6\n\nNote:\n- \n\nTodo:\n\n\n\"\"\"\nimport numpy as np\nfrom datetime import datetime\nimport os\nimport logging\nfrom os.path import join as opj\nfrom os.path import exists as ope\nimport random\nimport scipy.io...
[ [ "numpy.expand_dims", "scipy.io.loadmat", "tensorflow.placeholder", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "numpy.max", "tensorflow.reset_default_graph", "numpy.mean", "numpy.append", "tensorflow.Session", "tensorflow.train.Saver", "nump...
kevinaydin/google-research
[ "fa06fe625608a55406c33dbc0c214dfe0171a17d" ]
[ "wt5/wt5/postprocessors_test.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Google Research 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# Unless requ...
[ [ "tensorflow.compat.v1.compat.as_text", "tensorflow.compat.v1.enable_eager_execution", "tensorflow.compat.v1.disable_v2_behavior" ] ]
scikit-activeml/scikit-activeml
[ "2191ba452ca4d0fe349678d2a86b1906d79cb96a" ]
[ "skactiveml/stream/_uncertainty.py" ]
[ "import numpy as np\n\nfrom sklearn.utils import check_array, check_consistent_length\n\nfrom ..base import SingleAnnotStreamBasedQueryStrategy, SkactivemlClassifier\nfrom ..utils import fit_if_not_fitted, check_type, call_func\n\nfrom .budget_manager import (\n FixedUncertaintyBudget,\n VarUncertaintyBudget,...
[ [ "numpy.max", "numpy.array", "sklearn.utils.check_array", "sklearn.utils.check_consistent_length" ] ]
siddharthtelang/Hand-Written-Digits-Recognition
[ "45f27d0db542aae9cb4ff5681ee775bfe3cd5a66" ]
[ "LogisticRegressionCLassifier.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.preprocessing import OneHotEncoder\nfrom scipy.special import logsumexp\nfrom dimension_reduction import *\nfrom helper_functions import *\nimport argparse\n\nclass LogisticRegression:\n\n def __init__(self, X, Y):\n s...
[ [ "numpy.trace", "sklearn.preprocessing.OneHotEncoder", "pandas.DataFrame", "numpy.argmax", "numpy.where", "numpy.exp", "numpy.zeros", "scipy.special.logsumexp", "matplotlib.pyplot.show" ] ]
bareblackfoot/lddp-tf-faster-rcnn
[ "7f425438d8be17efb95e4d132b9db29bd6b849b4" ]
[ "lib/utils/boxTools.py" ]
[ "#!/usr/bin/env python\n\n# --------------------------------------------------------\n# LDDP\n# Licensed under UC Berkeley's Standard Copyright [see LICENSE for details]\n# Written by Samaneh Azadi\n# --------------------------------------------------------\n\nimport numpy as np\nfrom model.bbox_transform import bb...
[ [ "numpy.hstack", "numpy.maximum", "numpy.minimum", "numpy.nonzero", "numpy.reshape", "numpy.tile", "numpy.repeat" ] ]
gongwu/tf_classification
[ "29dea16f1ed4cd8684e2d5a47068414a433b5385" ]
[ "utils/logger.py" ]
[ "import tensorflow as tf\nimport os\n\n\nclass Logger(object):\n def __init__(self, sess, config):\n self.sess = sess\n self.config = config\n self.summary_placeholders = {}\n self.summary_ops = {}\n self.train_summary_writer = tf.summary.FileWriter(os.path.join(self.config.sum...
[ [ "tensorflow.variable_scope", "tensorflow.summary.image", "tensorflow.summary.scalar", "tensorflow.placeholder" ] ]
hobogalaxy/pytorch-lightning
[ "46540ee260af5137ac38ff0ce1022290cbc120b9", "46540ee260af5137ac38ff0ce1022290cbc120b9" ]
[ "pytorch_lightning/callbacks/early_stopping.py", "tests/overrides/test_data_parallel.py" ]
[ "# Copyright The PyTorch Lightning team.\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 applicable law...
[ [ "torch.tensor" ], [ "torch.ones", "torch.tensor", "torch.rand", "torch.device", "torch.nn.DataParallel" ] ]
CanBul/Parkinson-Disease-Detection
[ "e572b6bf32a1d3beef0a8804a5c3073c28d0fd3c" ]
[ "augmentation/model.py" ]
[ "\nimport numpy as np\nfrom tensorflow.keras.layers import Dense, Dropout, Flatten, Convolution2D, MaxPooling2D\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.optimizers import RMSprop\nfrom tensorflow.keras.callbacks impor...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.optimizers.RMSprop", "tensorflow.keras.callbacks.ReduceLROnPlateau", "tensorflow.keras.callbacks.EarlyStopping", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Convolution2D", "tensorflow.keras.layers.Dropout", "n...
argideritzalpea/lingvo
[ "0b13f9b02f8cf2167a1b80a43222257f2140e1e8", "fb929def2f27cf73a6ee1b1eaa8bee982bd92987" ]
[ "lingvo/core/quant_utils.py", "lingvo/core/ops/beam_search_step_op_test.py" ]
[ "# Lint as: python2, python3\n# Copyright 2018 The TensorFlow 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/...
[ [ "numpy.finfo" ], [ "numpy.log", "numpy.random.seed", "numpy.array_repr", "numpy.testing.assert_array_equal", "numpy.zeros" ] ]
henniekim/cky-parser-with-tree
[ "457c425ea17de83d0346326b1ad5fe45f669d359" ]
[ "fileIO.py" ]
[ "import numpy as np\n\n# 문법 파일 불러오기\nclass Grammar :\n def __init__(self):\n self.contents = None\n self.len = 0\n\n def load(self, filePath):\n try :\n self.contents = np.loadtxt(filePath, dtype='str', delimiter=' -> ', encoding='utf-8')\n self.len = len(self.conten...
[ [ "numpy.loadtxt" ] ]
ChaoLi977/DeepMitosis
[ "db590b91c86621acac8a52bfdaddb1ba8690f486" ]
[ "DeepSeg/mitos_layers_2012.py" ]
[ "import caffe\n\nimport numpy as np\nfrom PIL import Image\n\nimport random\n\nclass MitosDataLayer(caffe.Layer):\n \"\"\"\n Load (input image, label image) pairs from PASCAL VOC\n one-at-a-time while reshaping the net to preserve dimensions.\n\n Use this to feed data to a fully convolutional network.\n...
[ [ "numpy.array" ] ]
amitsou/Multimodal-User-Monitoring
[ "178049485b4afe5fbf9511e74e4c2f78bd89d426" ]
[ "src/Models/Binary_Classification/recordings_level/binary_classification.py" ]
[ "# -*- coding: utf-8 -*-\nfrom imblearn.under_sampling import RandomUnderSampler\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn.svm import SVC\nfrom sklearn.preprocessing import StandardScaler\nfrom sklea...
[ [ "sklearn.preprocessing.StandardScaler", "pandas.concat", "matplotlib.pyplot.show" ] ]
sri-spirited/MLOps
[ "c97f18e9c08d6966e1ab4459adc0cc59ec4da243" ]
[ "tests/tagifai/test_data.py" ]
[ "# tests/tagifai/test_data.py\n# Test tagifai/data.py components.\n\nimport itertools\nimport tempfile\nfrom collections import Counter\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom tagifai import config, data, utils\n\n\n@pytest.fixture\ndef tags():\n tags_list = ut...
[ [ "numpy.array", "numpy.shape", "pandas.DataFrame" ] ]
afry-south/nlp-competence
[ "64ff758e800c6a820726f44ccb968a6ebad3a063" ]
[ "python/20190223 - #2 [TextClassification]/python-code/BaselineOne.py" ]
[ "import numpy as np\nimport pandas as pd\nimport regex as re\nfrom sklearn.svm import LinearSVC\nfrom sklearn.metrics import accuracy_score, f1_score\nfrom sklearn.feature_extraction.text import TfidfVectorizer\n\n\ndef clean_text(text):\n \"\"\"\n Applies some pre-processing on the given text.\n\n Steps :...
[ [ "numpy.random.shuffle", "pandas.DataFrame", "sklearn.svm.LinearSVC", "sklearn.metrics.f1_score", "sklearn.feature_extraction.text.TfidfVectorizer", "sklearn.metrics.accuracy_score" ] ]
Sonu589/Hacktoberfest-2025
[ "06397aa12a41967cb112722666e384007d87dbc4" ]
[ "Air Canvas/aircanvas.py" ]
[ "import cv2\r\nimport time \r\nimport os\r\nimport numpy as np\r\nimport Trackinghandmod as htm\r\n\r\nfolderpath=\"myoptions\"\r\nmylist=os.listdir(folderpath)\r\n\r\noverlayList=[]\r\nfor impath in mylist:\r\n image=cv2.imread(f\"{folderpath}/{impath}\")\r\n overlayList.append(image)\r\n\r\nprint(len(overla...
[ [ "numpy.zeros" ] ]