repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Becky-pty/Wind | [
"af19aca04f9967f85c2a471293b6ca827b4ffe71"
] | [
"windpowerlib/wind_turbine.py"
] | [
"\"\"\"\nThe ``wind_turbine`` module contains the class WindTurbine that implements\na wind turbine in the windpowerlib and functions needed for the modelling of a\nwind turbine.\n\nSPDX-FileCopyrightText: 2019 oemof developer group <contact@oemof.org>\nSPDX-License-Identifier: MIT\n\"\"\"\nimport pandas as pd\nimp... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.merge",
"pandas.reset_option"
]
] |
amandalynne/Seattle-Mobility-Index | [
"f21d2fa6913ce9474aedc298e9e4a6e7c9390e64"
] | [
"seamo/tests/test_geocoder.py"
] | [
"\"\"\"\nThis is a test file for universal_geocoder.py\n\"\"\"\nimport init\nimport geocoder \nimport constants as cn\nimport unittest\nimport pandas as pd\nimport os\n#from scripts.core import geopandas_geocoder\n# from .core import geopandas_geocoder\n# import core.geopandas_geocoder as gg\n\nclass UniGeoTest(uni... | [
[
"pandas.read_csv"
]
] |
castacks/cvar-energy-risk-deep-model | [
"a0b2295e45139d19570a82daeb081f63d6f9b671"
] | [
"Risk.py"
] | [
"import numpy as np\n \nclass Risk:\n \"\"\"\n A class to find the risk.\n\n ...\n\n Attributes\n ----------\n powers : np.ndarray\n array of power on a path across several monte carlo runs\n limit : float\n value for confidence\n a : float\n coeff a of risk profile\n ... | [
[
"numpy.percentile",
"numpy.log",
"numpy.maximum"
]
] |
joshuawall/amuse | [
"c2034074ee76c08057c4faa96c32044ab40952e9"
] | [
"src/amuse/datamodel/grids.py"
] | [
"from amuse.support.core import CompositeDictionary, late\nfrom amuse.units import constants\nfrom amuse.units import units\nfrom amuse.units import generic_unit_system\nfrom amuse.units import quantities\nfrom amuse.units.quantities import Quantity\nfrom amuse.units.quantities import VectorQuantity\nfrom amuse.uni... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.where",
"numpy.prod",
"numpy.ndim",
"numpy.all",
"numpy.indices",
"numpy.floor"
]
] |
Michaelzhouisnotwhite/motion-detection-dashboard-restfulapi | [
"772064e9d2a53855488ad66b34abc2fd9edb1f7c"
] | [
"video_streamer/utils/augmentations.py"
] | [
"# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\n\"\"\"\nImage augmentation functions\n\"\"\"\n\nimport math\nimport random\n\nimport cv2\nimport numpy as np\n\nfrom .general import LOGGER, check_version, colorstr, resample_segments, segment2box\nfrom .metrics import bbox_ioa\n\n\nclass Albumentations:\n # YOLOv5 ... | [
[
"numpy.concatenate",
"numpy.clip",
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.random.beta",
"numpy.random.uniform",
"numpy.arange",
"numpy.append",
"numpy.mod",
"numpy.maximum"
]
] |
paulfjacobs/py-mep | [
"da418a10f0c13537560c91b05b699c433076f314"
] | [
"tests/mep/genetics/test_gene.py"
] | [
"import unittest\nfrom mep.genetics.gene import VariableGene, OperatorGene\nimport numpy as np\n\n\nclass TestGene(unittest.TestCase):\n \"\"\"\n Tests for the genes.\n \"\"\"\n\n def test_basic_constant(self):\n \"\"\"\n Simple check of a constant gene with just 1 gene in the chromosome.\... | [
[
"numpy.array",
"numpy.array_equal",
"numpy.zeros"
]
] |
mcusi/pytorch-faster-rcnn | [
"da2df26ff1386a5c7df16f3845e9154a0ad1aa44"
] | [
"tools/combineNetAnswers.py"
] | [
"#!/usr/bin/env python\n\n# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen, based on code from Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"\nDemo script s... | [
[
"matplotlib.use",
"numpy.zeros",
"numpy.log",
"matplotlib.pyplot.savefig",
"numpy.hstack",
"matplotlib.pyplot.subplots",
"numpy.shape",
"torch.from_numpy",
"numpy.where",
"numpy.float64",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.vstack",
"tor... |
portchester1989/neural-style-keras | [
"7f6b6784c4b28d82cf844928402ae01ff3fe877e"
] | [
"layers.py"
] | [
"'''\nCustom Keras layers used on the pastiche model.\n'''\n\nimport tensorflow as tf\nimport keras\nfrom keras import initializers\nfrom keras.layers import ZeroPadding2D, Layer, InputSpec\n\n# Extending the ZeroPadding2D layer to do reflection padding instead.\nclass ReflectionPadding2D(ZeroPadding2D):\n def c... | [
[
"tensorflow.pad",
"tensorflow.nn.batch_normalization",
"tensorflow.nn.moments",
"tensorflow.gather"
]
] |
hawkaa/trimesh | [
"f4c152208dd197443162f1e2ddf8fbd226bdafb1"
] | [
"examples/offscreen_render.py"
] | [
"\nimport numpy as np\nimport trimesh\n\n\nif __name__ == '__main__':\n # print logged messages\n trimesh.util.attach_to_log()\n\n # load a mesh\n mesh = trimesh.load('../models/featuretype.STL')\n\n # get a scene object containing the mesh, this is equivalent to:\n # scene = trimesh.scene.Scene(m... | [
[
"numpy.radians",
"numpy.dot"
]
] |
YichaoOU/pyDNA_melting | [
"78744c8849fef8bca99a9868bffef772d6853e70"
] | [
"pyDNA_melting/utils.py"
] | [
"\r\n\r\nimport os\r\nimport uuid\r\nimport pandas as pd\r\nimport numpy as np\r\nimport argparse\r\np_dir = os.path.dirname(os.path.realpath(__file__)) + \"/\"\r\ncode_dir = p_dir+\"scripts/\"\r\ndef run_matlab_code(seq):\r\n\t\r\n\t# step 1: copy matlab code to users folder because matlab scripts can't take param... | [
[
"pandas.read_csv",
"numpy.log2"
]
] |
BuildJet/distdl | [
"28b0dcf2c0a762de924cc310398a2eab9c35297f"
] | [
"examples/ex_halo_mixin.py"
] | [
"import numpy as np\nfrom mpi4py import MPI\n\nfrom distdl.backends.mpi.partition import MPIPartition\nfrom distdl.nn.mixins.halo_mixin import HaloMixin\nfrom distdl.nn.mixins.pooling_mixin import PoolingMixin\nfrom distdl.utilities.debug import print_sequential\n\n\nclass MockPoolLayer(HaloMixin, PoolingMixin):\n ... | [
[
"numpy.array",
"numpy.prod",
"numpy.arange"
]
] |
sns-chops/multiphonon | [
"508ab3111e584eb5684f1c6f1408f81e0b0c9ce5"
] | [
"tests/dos/dos_interp_TestCase.py"
] | [
"#!/usr/bin/env python\n#\n\ninteractive = False\n\nimport os, numpy as np, histogram.hdf as hh\nhere = os.path.dirname(__file__)\n\nfrom multiphonon.dos import interp\n\nimport unittest\nclass TestCase(unittest.TestCase):\n\n def test1(self):\n \"interp\"\n dos = hh.load(os.path.join(here, 'dos_to... | [
[
"numpy.testing.assert_allclose",
"numpy.arange"
]
] |
AIVIS-inc/SegPC2021 | [
"d73a6b1c7818f756f2dc8cded972adf27f04a108"
] | [
"demo/getResultImage2.py"
] | [
"from argparse import ArgumentParser\n\nfrom mmdet.apis import inference_detector, init_detector, show_result_pyplot\nimport numpy as np\nimport os\nfrom PIL import Image, ImageOps\nimport pycocotools.mask as maskUtils\nfrom fvcore.common.file_io import PathManager\nimport mmcv\nimport cv2\nimport math\n\n\ndef all... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.array",
"numpy.add",
"numpy.asarray",
"numpy.ones",
"numpy.multiply",
"numpy.where",
"numpy.vstack",
"numpy.argwhere",
"numpy.expand_dims"
]
] |
Michaelrising/sac-discrete.pytorch | [
"93ae779f5980726db0302c3471fd143c7d1d35ed"
] | [
"sacd/agent/sacd.py"
] | [
"import os\nimport numpy as np\nimport torch\nfrom torch.optim import Adam\n\nfrom .base import BaseAgent\nfrom sacd.model import TwinnedQNetwork, CateoricalPolicy\nfrom sacd.utils import disable_gradients\n\n\nclass SacdAgent(BaseAgent):\n\n def __init__(self, env, test_env, log_dir, num_steps=100000, batch_siz... | [
[
"torch.zeros",
"torch.min",
"numpy.log",
"torch.no_grad",
"torch.optim.Adam",
"torch.ByteTensor",
"torch.mean",
"torch.sum"
]
] |
coreyryanhanson/tanzania_water_project | [
"ec00a62181d2ebf33d0571e1fbc0fa563e0169c1"
] | [
"visualization_functions.py"
] | [
"import functools\nimport pandas as pd\nimport seaborn as sns\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass Multiplot(object):\n \"\"\"An object to quickly generate multiple plots for each column in a DataFrame\"\"\"\n\n def __init__(self, df, n_cols=3, figsize=(15, 15), style=\"darkgrid\"):... | [
[
"numpy.zeros_like",
"pandas.Index",
"pandas.DataFrame",
"numpy.triu_indices_from",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.stack",
"numpy.arange",
"pandas.Series",
"matplotlib.pyplot.show"
]
] |
techthiyanes/annotated_deep_learning_paper_implementations | [
"8af24da2dd39a9a87482a4d18c2dc829bbd3fd47"
] | [
"labml_nn/optimizers/adam_warmup_cosine_decay.py"
] | [
"\"\"\"\n---\ntitle: Adam optimizer with warm-up and cosine decay\nsummary: A PyTorch implementation/tutorial of Adam optimizer with warm-up and cosine decay for GPT.\n---\n\n# Adam Optimizer with Warmup and Cosine Decay\n\nThis extends [AMSGrad optimizer](adam.html) and adds a warmup stage.\n\"\"\"\nimport math\nf... | [
[
"torch.nn.Linear",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.show"
]
] |
joanRVAllen/drowsiness_detector | [
"af3b7b567134369a43343edc06303b6251beefd5"
] | [
"video_feed/video.py"
] | [
"import cv2\nimport numpy as np\nimport time\nimport tensorflow as tf\nfrom keras.preprocessing.image import array_to_img, img_to_array\nfrom tensorflow.keras.models import load_model\n\nclass Drowsiness:\n def __init__(self):\n self.model = load_model('../model/model_trial')\n self.face_cascade = ... | [
[
"tensorflow.keras.models.load_model",
"numpy.size",
"tensorflow.reshape"
]
] |
h521822/zvt | [
"c6bcc2b340406da55d920a411f59ab8d4cc7e76d"
] | [
"zvt/factors/pattern/pattern.py"
] | [
"# -*- coding: utf-8 -*-\nfrom enum import Enum\nfrom typing import List, Union, Optional\n\nimport pandas as pd\n\nfrom zvt.contract import EntityMixin\nfrom zvt.contract import IntervalLevel, AdjustType\nfrom zvt.contract.drawer import Rect\nfrom zvt.contract.factor import Transformer, Accumulator\nfrom zvt.domai... | [
[
"pandas.concat"
]
] |
Elgyii/earthengine-api | [
"8650c1f58f3abc502ea5296d1f628b69bc295243"
] | [
"python/ee/cli/commands.py"
] | [
"#!/usr/bin/env python\n# Lint as: python2, python3\n\"\"\"Commands supported by the Earth Engine command line interface.\n\nEach command is implemented by extending the Command class. Each class\ndefines the supported positional and optional arguments, as well as\nthe actions to be taken when the command is execut... | [
[
"tensorflow.compat.v1.train.import_meta_graph",
"tensorflow.compat.v1.io.decode_base64",
"tensorflow.compat.v1.saved_model.utils.build_tensor_info",
"tensorflow.compat.v1.dtypes.DType",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.serialize_tensor",
"tensorflow.com... |
colour-science/trimesh | [
"ee5db2ac81b2357886d854dfa1436b5e4ec5e8d8"
] | [
"trimesh/exchange/dae.py"
] | [
"import io\nimport copy\nimport uuid\n\nimport numpy as np\n\ntry:\n # pip install pycollada\n import collada\nexcept BaseException:\n collada = None\n\ntry:\n import PIL.Image\nexcept ImportError:\n pass\n\nfrom .. import util\nfrom .. import visual\n\nfrom ..constants import log\n\n\ndef load_colla... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.arange",
"numpy.sqrt"
]
] |
rovany706/interpret | [
"5ecf05aa894f1e778a3f0b7fa40af9075afe1b8a"
] | [
"python/interpret-core/interpret/glassbox/ebm/ebm.py"
] | [
"# Copyright (c) 2019 Microsoft Corporation\n# Distributed under the MIT software license\n\n\nfrom ...utils import gen_perf_dicts\nfrom .utils import EBMUtils\nfrom .internal import NativeHelper\nfrom .postprocessing import multiclass_postprocess\nfrom ...utils import unify_data, autogen_schema\nfrom ...api.base i... | [
[
"numpy.copy",
"numpy.min",
"numpy.mean",
"sklearn.base.is_classifier",
"numpy.max",
"numpy.histogram",
"numpy.vectorize",
"numpy.sqrt",
"numpy.array",
"sklearn.utils.validation.check_is_fitted",
"numpy.float64",
"numpy.argsort",
"sklearn.metrics.mean_squared_err... |
godblessforhimself/nmt | [
"1d71bbe4d69932fbe92998abc6c23443c75ebbf9"
] | [
"nmt/utils/misc_utils.py"
] | [
"# Copyright 2017 Google Inc. 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 required by appl... | [
[
"tensorflow.io.gfile.GFile",
"tensorflow.shape",
"tensorflow.io.gfile.exists",
"tensorflow.ConfigProto",
"tensorflow.Summary.Value",
"tensorflow.contrib.training.HParams"
]
] |
scan33scan33/nts2020 | [
"aeda4c5668b9ac62ba74752e3cc9aa2ab56c2fe8"
] | [
"xtreme/bert_singletask.py"
] | [
"import os\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport tensorflow as tf\n\nimport tensorflow_hub as hub\n\nos.environ[\"TFHUB_CACHE_DIR\"] = \"gs://nts2020-tpu\"\n\nfrom official import nlp\nfrom official.modeling import tf_utils\nfrom official.nlp import bert\n\n# Load the required submodules\... | [
[
"tensorflow.data.TFRecordDataset",
"tensorflow.keras.layers.Input",
"tensorflow.data.Options",
"tensorflow.io.FixedLenFeature",
"tensorflow.config.experimental_connect_to_cluster",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Dropout",
"tensorflow.io.parse_single_examp... |
XiaoyuanGuo/TEND_MedicalNoveltyDetection | [
"5c2144f0592373d814540cc0fa8e60197ea51756"
] | [
"train.py"
] | [
"import os\nimport time\nimport copy\nimport torch\nimport logging\nimport numpy as np\n\ndef load_ckpt(checkpoint_fpath, model, optimizer):\n checkpoint = torch.load(checkpoint_fpath)\n model.load_state_dict(checkpoint['model_state_dict'])\n optimizer.load_state_dict(checkpoint['optimizer_state_dict'])\n ... | [
[
"torch.zeros",
"torch.nonzero",
"torch.cat",
"torch.save",
"torch.no_grad",
"torch.unsqueeze",
"torch.nn.functional.relu",
"torch.load",
"torch.mean",
"torch.set_grad_enabled",
"torch.sum"
]
] |
Eggiverse/FAE | [
"1b953ba6dfcced83e5929eeaa8f525ec4acde5ed"
] | [
"FAE/FeatureAnalysis/DimensionReduction.py"
] | [
"from abc import abstractmethod\nimport numpy as np\nimport os\nfrom copy import deepcopy\nimport pandas as pd\nfrom scipy.stats import pearsonr\n\nfrom FAE.DataContainer.DataContainer import DataContainer\nfrom sklearn.decomposition import PCA\n\nclass DimensionReduction:\n def __init__(self, model=None, number... | [
[
"pandas.DataFrame",
"numpy.linalg.norm",
"numpy.min",
"scipy.stats.pearsonr"
]
] |
Metri-Co/AnfisTensorflow2.0 | [
"574f643d38119ee4cc38e3b1d6908eddc484f99d"
] | [
"Datagenerator/markov_process.py"
] | [
"\"\"\"\nThis module simulates a Markov Regime-Switching process\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nclass MRS:\n def __init__(self,\n P = np.array([ [0.989, 0.01, 0.001], ## Transition Matrix\n ... | [
[
"numpy.repeat",
"numpy.append",
"numpy.array",
"numpy.random.rand",
"numpy.sum",
"numpy.random.randn",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.style.use",
"numpy.cumsum",
"numpy.sqrt",
"matplotlib.pyplot.show"
]
] |
baby636/devdocs | [
"406a0989ab7a31f11e0b0da3e50503c0ad6193cd"
] | [
"reference/random/generated/numpy-random-Generator-standard_t-1.py"
] | [
"# From Dalgaard page 83 [Rb7c952f3992e-1]_, suppose the daily energy intake for 11\n# women in kilojoules (kJ) is:\n\nintake = np.array([5260., 5470, 5640, 6180, 6390, 6515, 6805, 7515, \\\n 7515, 8230, 8770])\n\n# Does their energy intake deviate systematically from the recommended\n# value of 7... | [
[
"matplotlib.pyplot.hist"
]
] |
tomresearcher/roberta_fine_tuning | [
"411029dbe938c117494bbab74714cc28b8e8dd3d"
] | [
"src/scripts/predict_stance_model.py"
] | [
"import argparse\nfrom common.loadData import load_data\nfrom model.roberta.roberta_model import predict_task\nimport pandas as pd\nfrom common.score import scorePredict\n\n\ndef main(parser):\n args = parser.parse_args()\n test_set = args.test_set\n use_cuda = args.use_cuda\n model_dir_1_stage = args.m... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
QAMCAS/Clustering_Vehicle_data | [
"e4fc977d6c31608e3dad7e945d49b5ccc8433701"
] | [
"Clustering_approach/Data_Clustering.py"
] | [
"import traceback\nimport weka.core.jvm as jvm\nimport os\nimport json\n\nfrom weka.core.dataset import Instances\nfrom weka.clusterers import Clusterer\nfrom weka.clusterers import ClusterEvaluation\nfrom weka.core.converters import Loader\nfrom weka.filters import Filter, MultiFilter\nimport weka.plot as plot\n\n... | [
[
"numpy.zeros_like",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
reinforcementdriving/JS3C-Net | [
"40326fdbebc688c10a6247f46ed08463de0db206"
] | [
"lib/sparseconvnet/inputBatch.py"
] | [
"# Copyright 2016-present, Facebook, Inc.\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\nimport torch\nfrom .metadata import Metadata\nfrom .utils import toLongTensor\nfrom .sparseConvNetTensor import ... | [
[
"torch.FloatTensor"
]
] |
zer01ike/HoleFilling | [
"b1591485f37975c0793839880dbb6185a132d3f9"
] | [
"Refine/TextureRefine.py"
] | [
"import numpy as np\nimport cv2\nimport math\n\nclass TextureRefine():\n def __init__(self,TextureImage,IniatialImage,DepthImage,HoleList):\n self.TextureImage = cv2.imread(TextureImage)\n self.InitialImage = cv2.imread(IniatialImage)\n self.DepthImage = cv2.imread(DepthImage,0)\n sel... | [
[
"numpy.square",
"numpy.add",
"numpy.zeros",
"numpy.sqrt"
]
] |
ashkanalinejad/SFU-Fairseq | [
"e96301bf49dce7ba23dc4c46dddfdd1ae0f95e10"
] | [
"train.py"
] | [
"#!/usr/bin/env python3 -u\n# 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... | [
[
"torch.manual_seed",
"torch.cuda.set_device",
"torch.cuda.is_available"
]
] |
Yuricst/trajplotlib | [
"30c06d922cb4d7bf2b57e3cf11b84fe510f00e1f"
] | [
"examples/test_3d_traj.py"
] | [
"\"\"\"\nExample 3D trajectory\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport sys\nsys.path.append(\"../\") # provide path to library\nimport trajplotlib\n\n\nif __name__==\"__main__\":\n\t# load data\n\tdata = np.loadtxt('data_traj.csv', delimiter=',')\n\txs = data[:, 0]\n\tys = data[:, 1]... | [
[
"matplotlib.pyplot.show",
"numpy.loadtxt"
]
] |
yutiansut/Quantitative_Finance | [
"7097ed399fd31b7e15dba8fc816626884aeba8de"
] | [
"Binomial Trees/BinomialAmericanOption.py"
] | [
"\"\"\" C++ For Quantitative Finance \"\"\" \n\"\"\" Binomial American Option \"\"\"\n\"\"\" David Li \"\"\"\n\nimport math\nimport numpy as np\n\nclass StockOption(object):\n def __init__(self, S0, K, r, T, N, params):\n self.S0 = S0\n self.K = K\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.maximum"
]
] |
Magixxxxxx/detectron2 | [
"c1ee8cf73777c96cc8a89463d0dca6e0ffe148f4"
] | [
"detectron2/solver/build.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nfrom enum import Enum\nfrom typing import Any, Callable, Dict, Iterable, List, Set, Type, Union\nimport torch\n\nfrom detectron2.config import CfgNode\n\nfrom .lr_scheduler import WarmupCosineLR, WarmupMultiStepLR\n\n_GradientClipperInput = Un... | [
[
"torch.optim.Adam",
"torch.optim.SGD",
"torch.nn.utils.clip_grad_value_",
"torch.nn.utils.clip_grad_norm_"
]
] |
bvegaus/electric | [
"bfb7d5644e30faad8a791489a7525252fba0972d"
] | [
"experiments/obtain_metrics_predictions.py"
] | [
"import openpyxl\nimport os\nimport pandas as pd\nimport numpy as np\nfrom metrics import METRICS\n\n\ndef get_models(datasets):\n \"\"\"It obtains the models used into the experiments\"\"\"\n dataframe = pd.read_csv('../results/' + datasets[0] + '/results.csv', sep=';')\n models = dataframe['MODEL'].uniqu... | [
[
"pandas.DataFrame",
"numpy.load",
"numpy.str",
"pandas.ExcelWriter",
"pandas.read_csv"
]
] |
GavinHuttley/c3test | [
"c5bf7f8252b4f7b75a851e28275536a8c378897a"
] | [
"src/cogent3/maths/stats/distribution.py"
] | [
"#!/usr/bin/env python\n\"\"\"Translations of functions from Release 2.3 of the Cephes Math Library,\nwhich is (c) Stephen L. Moshier 1984, 1995.\n\"\"\"\n\nfrom numpy import arctan as atan\nfrom numpy import exp, sqrt\n\nfrom cogent3.maths.stats.special import (\n MACHEP,\n MAXNUM,\n PI,\n SQRTH,\n ... | [
[
"numpy.arctan",
"numpy.sqrt"
]
] |
knaaptime/healthacc | [
"0ffae2a7a223e9b319bff4920ca3a29a63dd0494"
] | [
"healthacc/network.py"
] | [
"import osmnet\nimport pandas as pd\nimport pandana as pdna\nimport urbanaccess as ua\nfrom . import feeds_from_bbox\n\n\ndef multimodal_from_bbox(\n bbox,\n gtfs_dir=None,\n save_osm=None,\n save_gtfs=None,\n excluded_feeds=None,\n transit_net_kwargs=None,\n headways=False,\n additional_fee... | [
[
"pandas.HDFStore"
]
] |
TIFOSI528/icefall | [
"6f7860a0a60b53026216fa4ba19048955951333e"
] | [
"egs/librispeech/ASR/pruned_transducer_stateless3/train.py"
] | [
"#!/usr/bin/env python3\n# Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang,\n# Wei Kang\n# Mingshuang Luo)\n#\n# See ../../../../LICENSE for clarification regarding multiple authors\n#\n# Licensed under ... | [
[
"torch.device",
"torch.utils.tensorboard.SummaryWriter",
"torch.cuda.amp.autocast",
"torch.multiprocessing.spawn",
"torch.set_num_interop_threads",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.is_available",
"torch.cuda.amp.GradScaler",
"torch.distributed.barrier",
... |
SumeetBatra/crazyswarm-nn | [
"027a9de353c39ffa702c915acdf0cdbfda0b0eca"
] | [
"ros_ws/src/crazyswarm/scripts/logPositions.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nfrom pycrazyswarm import *\nimport rospy\nfrom crazyflie_driver.msg import GenericLogData\nimport uav_trajectory\nimport argparse\n\nfile = None\nHEIGHT = 1.0 #0.75\n\n\n# \"ctrltarget.x\", \"ctrltarget.y\", \"ctrltarget.z\", \"stateEstimate.x\", \"stateEstimate.y\", \"... | [
[
"numpy.array"
]
] |
Team-Project-OKG/kge | [
"d09e41ccc30b54c1de983e8c4f6f95b92983bcb3"
] | [
"data/olpbench_small/olpbench-small_dataset_creation/reset_ids.py"
] | [
"import os\r\nimport pandas as pd\r\n\r\nfiles_directory = './'\r\nreset_id_map_directory = './resetted_mapped_to_ids/'\r\n\r\ntoken_id_map_header = pd.read_csv(\"./token_id_map_header.txt\", delimiter=\"\\t\", names=[\"token\", \"token_id\"])\r\nentity_id_map = pd.read_csv(\"./entity_id_map.del\", delimiter=\"\\t\... | [
[
"pandas.read_csv"
]
] |
Bleuje/pytorch-CycleGAN-and-pix2pix | [
"20070a7df7c6549a96461970c809405a8acd5c1f"
] | [
"models/base_model.py"
] | [
"import os\nimport torch\nfrom collections import OrderedDict\nfrom . import networks\n\nimport numpy as np\n\nclass BaseModel():\n\n # modify parser to add command line options,\n # and also change the default values if needed\n @staticmethod\n def modify_commandline_options(parser, is_train):\n ... | [
[
"torch.device",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.random.randint"
]
] |
FunmiKesa/JLA | [
"4fcd6a0a382d451a54703e432e476c3a16166232"
] | [
"src/gen_labels_15.py"
] | [
"import os.path as osp\nimport os\nimport numpy as np\n\n\ndef mkdirs(d):\n if not osp.exists(d):\n os.makedirs(d)\n\n\nseq_root = '/media2/funmi/MOT/MOT15/images/train'\nlabel_root = '/media2/funmi/MOT/MOT15/labels_with_ids/train'\nmkdirs(label_root)\n#seqs = [s for s in os.listdir(seq_root)]\nseqs = ['A... | [
[
"numpy.loadtxt",
"numpy.lexsort"
]
] |
n3urovirtual/EyeTracking_Experiment | [
"00a534540a524db8606d54e33ebc43de49a959ac"
] | [
"Memory Scripts/Mem_collation.py"
] | [
"''' MEMORY DATA COLLATION (VARIABLES OF INTEREST FOR EACH PARTICIPANT/TRIAL)'''\n\nimport os\nimport itertools\nimport pandas as pd\nimport numpy as np\nfrom helper import *\n\ncollation=pd.DataFrame()\n\n##TO DO: check why it omits subject 1, image 1.\n\nfor i,k in itertools.product(sub_id, img_id):\n file='Su... | [
[
"pandas.DataFrame"
]
] |
JerryMa90/whitenoise-system | [
"66c99c8108e7a73c1b5a3fa5cb3729a5d8f95e20"
] | [
"sdk/opendp/whitenoise/evaluation/_dp_verification.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\nimport copy\nimport os\nfrom scipy import stats\nimport opendp.whitenoise.evaluation._aggregation as agg\nimport opendp.whitenoise.evaluation._exploration as exp\nfrom opendp.whitenoise.metadata.collection import *\n\nclass DPVe... | [
[
"numpy.random.choice",
"scipy.stats.ttest_1samp",
"scipy.stats.anderson_ksamp",
"pandas.read_csv",
"numpy.concatenate",
"numpy.histogram",
"numpy.divide",
"numpy.log",
"numpy.sqrt",
"numpy.greater",
"matplotlib.pyplot.subplot",
"numpy.array",
"numpy.zeros",
... |
SKKU-ESLAB/Latency-Predictor | [
"c09ee81606a2f7263568a8704d9bd3e4e0721b86"
] | [
"incubator-tvm/topi/tests/python/test_topi_broadcast.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.array",
"numpy.empty",
"numpy.random.uniform",
"numpy.arange",
"numpy.broadcast_to"
]
] |
BunsenFeng/BotRGCN | [
"c48cf903fe3f875b11fa1557e5a66a947a360832"
] | [
"Dataset.py"
] | [
"import torch\nimport numpy as np\nimport pandas as pd\nimport json\nimport os\nfrom transformers import pipeline\nfrom datetime import datetime as dt\nfrom torch.utils.data import Dataset\nfrom tqdm import tqdm\n\n\nclass Twibot20(Dataset):\n def __init__(self,root='./Data/',device='cpu',process=True,save=True)... | [
[
"numpy.array",
"torch.stack",
"torch.save",
"numpy.load",
"numpy.save",
"pandas.read_json",
"torch.LongTensor",
"torch.tensor",
"torch.load",
"pandas.concat"
]
] |
yhzhang1/deep_rl_trader_modified | [
"5ef1b776bb54048d42deb59396b3112113ca4d60"
] | [
"util.py"
] | [
"import numpy as np\nfrom rl.core import Processor\nfrom rl.util import WhiteningNormalizer\nfrom sklearn.preprocessing import MinMaxScaler, StandardScaler\n\nfrom time import sleep\n\nADDITIONAL_STATE = 2\nclass NormalizerProcessor(Processor):\n def __init__(self):\n self.scaler = StandardScaler()\n ... | [
[
"numpy.concatenate",
"numpy.clip",
"sklearn.preprocessing.StandardScaler"
]
] |
FilippoAleotti/unsupervised_detection | [
"aeb673ac34eb80b1fb22bc28af8148bd7fc8ee77"
] | [
"models/nets.py"
] | [
"import tensorflow as tf\nfrom .utils.convolution_utils import gen_conv, gen_deconv, conv, deconv\n\ndef generator_net(images, flows, scope, reuse=None, training=True):\n \"\"\"Mask network.\n Args:\n image: input rgb image [-0.5, +0.5]\n flows: rgb flow image masked [-0.5, +0.5]\n Returns:\n... | [
[
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.ones_like",
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.nn.softmax",
"tensorflow.image.resize_images"
]
] |
goruck/nilm | [
"6c1a18b9a3fda1f204c92ae1958e99cf07091585"
] | [
"ml/predict.py"
] | [
"\"\"\"\nPredict appliance type and power using novel data from my home.\n\nCopyright (c) 2022 Lindo St. Angel\n\"\"\"\n\nimport os\nimport argparse\nimport socket\n\nimport numpy as np\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nfrom logger import log\nfrom common import Windo... | [
[
"numpy.zeros_like",
"numpy.array",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"tensorflow.keras.models.load_model",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
BigDataHa/Nonlinear_Face_3DMM | [
"1c0c7d388231e26460303134ad9b0f87357d010c"
] | [
"model_non_linear_3DMM.py"
] | [
"'''\r\nOutline of the main training script\r\nPart of data/input pipeline is ommitted\r\n\r\n'''\r\n\r\n\r\nfrom __future__ import division\r\nimport os\r\nimport time\r\nimport csv\r\nimport random\r\nfrom random import randint\r\nfrom math import floor\r\nfrom glob import glob\r\nimport tensorflow as tf\r\nimpor... | [
[
"tensorflow.ones_like",
"numpy.load",
"tensorflow.train.get_checkpoint_state",
"numpy.mean",
"tensorflow.reshape",
"tensorflow.ones",
"tensorflow.stack",
"tensorflow.global_variables_initializer",
"tensorflow.nn.avg_pool",
"numpy.concatenate",
"tensorflow.trainable_vari... |
JayantBenjamin/wordle-solver | [
"3c83dfb9c0300ed402601cfb12b704fec66e7478"
] | [
"wordle-app.py"
] | [
"import pandas as pd \nfrom wordfreq import word_frequency\n\nwords = pd.read_csv(\"subdhkosh.csv\") \n# Preview the first 5 lines of the loaded data \nrows, columns = words.shape\n#print(columns)\n#print(rows)\n#print(type(words.iat[1,0]))\n\n\n#print(l_inc_pos)\n#print(l_inc_pos[0])\n#print(words.iat[12477,0])\n\... | [
[
"pandas.read_csv"
]
] |
sk-aravind/3D-Bounding-Boxes-From-Monocular-Images | [
"98e9e7caf98edc6a6841d3eac7bd6f62b6866e10"
] | [
"Run_with_2D.py"
] | [
"\"\"\"\n\nThis script utilises the a yolo network to detect pedestrians and cars \nfrom and images. The 2D detections are crop out and fed it into the model so that \nit can predict a 3D bounding box for each of the 2D detections\n\nThe script will plot the results of the 3D bounding box onto the image and display... | [
[
"numpy.concatenate",
"torch.device",
"torch.zeros",
"numpy.copy",
"torch.cuda.is_available",
"numpy.argmax",
"numpy.arctan2",
"torch.load"
]
] |
rzhangpku/EMAV | [
"91c364a359f698528f35966c89d47b1ccc2cfb64",
"91c364a359f698528f35966c89d47b1ccc2cfb64"
] | [
"top_esim_quora.py",
"top_bert_quora.py"
] | [
"\"\"\"\nTrain the ESIM model on the preprocessed SNLI dataset.\n\"\"\"\n# Aurelien Coet, 2018.\n\nfrom utils.utils_top_esim import train, validate\nfrom vaa.model import ESIM\nfrom vaa.model_top import TOP\nfrom vaa.data import NLIDataset\nfrom torch.utils.data import DataLoader\nimport torch.nn as nn\nimport matp... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.utils.data.DataLoader",
"matplotlib.pyp... |
D-own-T-o-P-rogramme/PK_Model | [
"a413a4c8edc2dc76513afb07b312acb34f3f6729"
] | [
"interactive_pkmodel.py"
] | [
"import matplotlib.pylab as plt\nimport pathlib\n\n\ndef make_model():\n from pkmodel import model\n from pkmodel import protocol\n from pkmodel import solution\n Vc, Vps, Qps, CL = input_model()\n model = model.Model(Vc=Vc, Vps=Vps, Qps=Qps, CL=CL)\n dose, sub, k_a, cont, cont_period, inst, dose_... | [
[
"matplotlib.pylab.show"
]
] |
thw17/fibermorph | [
"19db9d7e04c98648ab3e8f5999e47cf14249e4c7"
] | [
"fibermorph/demo.py"
] | [
"# %% import\n\nimport os\nimport pathlib\nimport requests\nimport shutil\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom datetime import datetime\n\n# sys.path.append(os.path.join(os.path.dirname(__file__), '../'))\nimport dummy_data\nimport fibermorph\n\n\n\n\n\n# %% functions\n\ndef create_results_cac... | [
[
"pandas.DataFrame",
"numpy.asarray",
"numpy.sqrt"
]
] |
xqdan/akg | [
"e28501611d73d3957a1f3c58eeb6b028f2f2765d"
] | [
"tests/operators/ci_gpu/test_fused_bn_reduce_grad.py"
] | [
"# Copyright 2020 Huawei Technologies Co., Ltd\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 l... | [
[
"numpy.allclose",
"numpy.full",
"numpy.transpose"
]
] |
ikibalin/rhochi | [
"1ca03f18dc72006322a101ed877cdbba33ed61e7"
] | [
"cryspy/A_functions_base/function_3_den_file.py"
] | [
"\"\"\"Module define operations with density file: file.den\n\nFunctions\n---------\n - read_den_file\n - save_to_den_file\n - recalc_den_file_to_p1\n\n\"\"\"\nimport numpy\n\nfrom cryspy.A_functions_base.function_2_sym_elems import \\\n form_symm_elems_by_b_i_r_ij, calc_numerators_denominator_for_b_i, ... | [
[
"numpy.logical_not",
"numpy.array",
"numpy.stack",
"numpy.zeros"
]
] |
Bellomia/pyDrude | [
"cd2d6980008ddbe247f1aa50dc238e0d7cf0904f"
] | [
"HeVanderbiltModel/OBC/OBCsData.py"
] | [
"import numpy\nimport pylab\n\nL = numpy.array([10,14,20,24,26,30,32,34,40,42,46,50])\nD = numpy.array([0.7495521937409436,0.748133095630968,0.7551880187600327,0.753688557716125,0.690564577980913,0.728280401470924,0.6950535214361949,0.6326486809343935,0.7794025403496738,0.6853505319229404,0.6899417389825953,0.70331... | [
[
"numpy.array"
]
] |
iQua/fl-lottery | [
"360d9c2d54c12e2631ac123a4dd5ac9184d913f0"
] | [
"rl/agent.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.distributions as distributions\nimport numpy as np\n\n\nclass MLP(nn.Module):\n def __init__(self, input_dim, hidden_dim, output_dim, dropout = 0.5):\n super().__init__()\n\n self.fc_1 =... | [
[
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.Dropout"
]
] |
luyuliu/unsupervised_llamas | [
"9b99f464e1983195b922e2df8bb57760182206e7"
] | [
"evaluation/segmentation_metrics.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nCalculates\n true positives (tp)\n false positives (fp)\n true negatives (tn)\n false negatives (fn)\n precision\n recall\n average precision / AUC / PR curves\n\nAdditional metrics are welcome\nOne problem with lane marker segmentation is that the absolute number of correctl... | [
[
"numpy.stack",
"numpy.logical_and",
"numpy.zeros"
]
] |
DevisPatel/Python-Programs | [
"9c975e35b4d2b89bc9e9d206830e7ad60e38c34a"
] | [
"PCA Algorithm (Dimensionality Reduction).py"
] | [
"import pandas as pd\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.decomposition import PCA\r\n\r\n\r\ndata = pd.read_csv('C:/Users/Devis Patel/AppData/Local/Programs/Python/Python37/Programs/Assignment Programs/Day 8/Data Set/trans_us.csv', index_col = 0, thousands = ',')\r\n\r\ndata.index.names = ['stations... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"sklearn.decomposition.PCA"
]
] |
yeonju7kim/Industrial-AI | [
"66073c136e7bb6964dd80e2e63970b86eed4b669"
] | [
"main.py"
] | [
"import torch\nfrom torch.utils.data import DataLoader, Dataset\n\nclass CategoryDataset(Dataset):\n def __init__(self, id_list, digit1_list, digit2_list, digit3_list, text_obj_list, text_mthd_list, text_deal_list):\n self.id_list = id_list\n self.digit1_list = digit1_list\n self.digit2_list... | [
[
"torch.utils.data.random_split",
"torch.utils.data.DataLoader"
]
] |
yahiasaqer/Association_Rules | [
"e75735e85750179fc537445afa926e14daa1e5b7"
] | [
"AssociationRules1.py"
] | [
"import pandas as pd\r\nfrom mlxtend.preprocessing import TransactionEncoder\r\nfrom mlxtend.frequent_patterns import apriori\r\n\r\ndataset = [['Milk', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'],\r\n ['Dill', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'],\r\n ['Milk', 'Apple', ... | [
[
"pandas.DataFrame"
]
] |
skatsuta/pandas-gbq | [
"81ab6b8f01c5a2cd1033e687a3d8bb7fe3f43c98"
] | [
"tests/system/test_gbq.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport datetime\nimport sys\n\nimport numpy as np\nimport pandas\nimport pandas.api.types\nimport pandas.util.testing as tm\nfrom pandas import DataFrame, NaT\n\ntry:\n import pkg_resources # noqa\nexcept ImportError:\n raise ImportError(\"Could not import pkg_resources (setuptool... | [
[
"pandas.util.testing.assert_numpy_array_equal",
"pandas.util.testing.assert_frame_equal",
"pandas.DataFrame",
"numpy.random.randn",
"pandas.util.testing.makeMixedDataFrame",
"pandas.util.testing.assert_series_equal",
"numpy.random.randint",
"pandas.Series",
"numpy.dtype",
"... |
ariashahverdi/DC2019 | [
"6078c2a337b5c30d67cf63cf16a5434b51ee8d37"
] | [
"Aria/main.py"
] | [
"import numpy as np\nimport pandas as pd\n\ndf = pd.read_csv('../sbdc_data.csv')\n\n\nprint(df[\"Total Counseling Time, hrs\"].mean())\n\n\n# Counting Number of NonZero in each column\nprint(df.astype(bool).sum(axis=0))\n\n# Counting Whether They started business or Not\ndf_start_bs = df[df[\"Impact: Started Busine... | [
[
"pandas.read_csv"
]
] |
surf-sci-bc/uspy | [
"76af9bee19b3fdf3af431e77756e196284cdd7a1"
] | [
"uspy/xps/models.py"
] | [
"\"\"\"Models for the peaks.\"\"\"\n# pylint: disable=invalid-name\n# pylint: disable=abstract-method\n# pylint: disable=too-many-arguments\n\nimport numpy as np\nimport scipy.special as ss\nfrom lmfit.model import Model\nfrom lmfit.models import guess_from_peak, update_param_vals\n\n\ns2 = np.sqrt(2)\ns2pi = np.sq... | [
[
"scipy.special.gamma",
"numpy.log",
"scipy.special.wofz",
"numpy.tan",
"numpy.exp",
"scipy.special.erfc",
"numpy.arctan",
"numpy.sqrt",
"numpy.maximum"
]
] |
SanzharMrz/language-models-are-knowledge-graphs-pytorch | [
"375f20ed17df40af9486faddbf153919f503f33d"
] | [
"utils.py"
] | [
"from collections import OrderedDict\nimport numpy as np\nimport torch\nimport re\n\nalphabet = re.compile(r'^[a-zA-Z]+$')\n\nfrom copy import copy\nfrom collections import defaultdict\n\ndef build_graph(matrix):\n graph = defaultdict(list) \n\n for idx in range(0, len(matrix)):\n for col in range(idx+... | [
[
"numpy.array"
]
] |
stalbrec/coffea | [
"c298f24952d7e493f5a5921e39b64f44fd579a3c"
] | [
"tests/test_hist_tools.py"
] | [
"from __future__ import print_function, division\n\nfrom coffea import hist\nimport numpy as np\nimport awkward as ak\n\nfrom dummy_distributions import dummy_jagged_eta_pt\nimport pytest\nimport sys\n\n\ndef test_hist():\n counts, test_eta, test_pt = dummy_jagged_eta_pt()\n\n h_nothing = hist.Hist(\"empty in... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.isnan",
"numpy.ones_like",
"numpy.sum",
"numpy.arange",
"numpy.cumsum",
"numpy.all"
]
] |
timoteogb/BNN-PYNQ-ZCU104 | [
"ea5396bfa041623259bd59b7d622d82e81e19d20"
] | [
"bnn/bnn.py"
] | [
"# Copyright (c) 2016, Xilinx, Inc.\n# All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without \n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, \n# t... | [
[
"numpy.identity",
"numpy.array",
"numpy.frombuffer"
]
] |
siravan/fib_tf | [
"7505a494875d880a6d49d480cb82e1fa55677f2c"
] | [
"fenton.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n A TensorFlow-based 2D Cardiac Electrophysiology Modeler\n\n Copyright 2017-2018 Shahriar Iravanian (siravan@emory.edu)\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\"... | [
[
"numpy.zeros",
"tensorflow.where",
"numpy.ones",
"tensorflow.Variable",
"numpy.save",
"tensorflow.sign",
"tensorflow.device",
"tensorflow.tanh"
]
] |
ProfesseurIssou/Easy-QLearning | [
"0c67ab96230776988b4193314f5cb039e93afa07"
] | [
"Easy-QLearning 1.0.0/src/EQL.py"
] | [
"import random\nimport numpy as np\n\nclass QLearning:\n def __init__(self,nbAction:int,nbState:int,gamma:float=0.9,learningRate:float=0.1):\n \"\"\"\n nbParam : Number of action in state\n gamma : Reward power [0;1] (0.1 long path priority, 0.9 short path priority)\n learningRate : L... | [
[
"numpy.argmax"
]
] |
sarang-IITKgp/plot-shapes | [
"33aff54515eabd55afe42bf0091395dc3e6e6829"
] | [
"src/plotshapes/conic_sections.py"
] | [
"import numpy as np\nfrom . import transform\n\nclass circle:\n\t\"\"\"This class defines an object of type circle. \n\tAttributes: \n\t\tcenter: (0,0) by default.\n\t\tradius: 1 by default.\n\t\t\"\"\"\n\t\n\tdef __init__(self, radius=1, center=(0,0),pts=100,text_tag='Circle'):\n\t\tself.text_tag = text_tag\n\t\ts... | [
[
"numpy.linspace",
"numpy.sin",
"numpy.cos"
]
] |
AFansGH/pysteps | [
"ee5cd10ed9058808f934cb1992913055fbcbb3d2"
] | [
"pysteps/tests/test_plt_precipfields.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom pysteps.visualization import plot_precip_field\nfrom pysteps.utils import conversion\nfrom pysteps.postprocessing import ensemblestats\nfrom pysteps.tests.helpers import get_precipitation_fields\nimport matplotlib.pyplot as pl\n\nplt_arg_names = (\n \"source\",\n... | [
[
"matplotlib.pyplot.show"
]
] |
LJOVO/TranSalNet | [
"a2aba83e3b8f54c47b712511bf4f515f236326ed"
] | [
"TranSalNet_Res.py"
] | [
"import os\nimport torch\nimport numpy as np\nimport pandas as pd\nfrom torch.utils.data import Dataset, DataLoader\nfrom skimage import io, transform\nfrom PIL import Image\nimport torch.nn as nn\nfrom torchvision import transforms, utils, models\nimport torch.nn.functional as F\nimport utils.resnet as resnet\n\nf... | [
[
"torch.zeros",
"torch.nn.ModuleList",
"torch.nn.Sigmoid",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Upsample",
"torch.nn.Conv2d"
]
] |
Animadversio/Visual_Neuro_InSilico_Exp | [
"39b1e65e5613b064361c09c7d3f88496f3a7efd2"
] | [
"Hessian/StyleGAN_hess_spectrum.py"
] | [
"#%%\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\nfrom tqdm import tqdm\nfrom time import time\nimport os\nfrom os.path import join\nimport sys\nimport lpips\nfrom Hessian.GAN_hessian_compute import hessian_compute\nfrom torchvision.transforms import ToPILImage\nfrom torchvision.utils import ... | [
[
"matplotlib.pylab.ylabel",
"matplotlib.pylab.show",
"torch.cuda.is_available",
"torch.load",
"torch.hub.load",
"torch.tensor",
"numpy.sqrt",
"matplotlib.pylab.title",
"numpy.log10",
"matplotlib.pylab.plot",
"matplotlib.pylab.suptitle",
"numpy.array",
"numpy.perc... |
mtosity/CameraTrapHCMUS | [
"9b4215e505f97bb5240e1dec852595c9fdeac725"
] | [
"yolo/general_json2yolo.py"
] | [
"import json\n\nimport cv2\nimport pandas as pd\nfrom PIL import Image\n\nfrom utils import *\n\n\n# Convert INFOLKS JSON file into YOLO-format labels ----------------------------\ndef convert_infolks_json(name, files, img_path):\n # Create folders\n path = make_dirs()\n\n # Import json\n data = []\n ... | [
[
"pandas.unique"
]
] |
jj-chung/caltech-ee148-spring2020-hw01 | [
"c260232376a973d7346f0da4d06ae93cf7de1dcf"
] | [
"run_predictions.py"
] | [
"import os\nimport numpy as np\nimport json\nfrom PIL import Image, ImageDraw\n\nimport time\nimport sys\nnp.set_printoptions(threshold=sys.maxsize)\n\n\ndef rgb_to_hsv(r, g, b):\n r0 = r / 255.0\n g0 = g / 255.0\n b0 = b / 255.0\n\n c_max = max(r0, g0, b0)\n c_min = min(r0, g0, b0)\n delta = c_ma... | [
[
"numpy.linalg.norm",
"numpy.dot",
"numpy.asarray",
"numpy.zeros",
"numpy.set_printoptions",
"numpy.shape"
]
] |
sisgandarli/text-similarity-checker-system | [
"2c7c5475642304c3fa842e36f0ef50887f0d5467"
] | [
"misc/ann_model_with_new_preprocessed_dataset.py"
] | [
"# -*- coding: utf-8 -*-\nimport pandas as pd\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.metrics import classification_report,confusion_matrix\nimport pickle\nfrom random import random\n\nd... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.preprocessing.StandardScaler",
"sklearn.neural_network.MLPClassifier",
"sklearn.metrics.classification_report",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
nerdk312/AMDIM_Decoder | [
"7ca7eb869801d5fbe80b6bc3bb9ca4a2ba4b7238"
] | [
"stats.py"
] | [
"import torch\nfrom tensorboardX import SummaryWriter\n\n\nclass AverageMeterSet: # Nawid - Calculates averages\n def __init__(self):\n self.sums = {}\n self.counts = {}\n self.avgs = {}\n\n def _compute_avgs(self): # Nawid - Calculate average\n for name in self.sums:\n ... | [
[
"torch.max"
]
] |
abaisero/asym-porl | [
"8a76d920e51d783bbeeeea3cd2b02efffbb33c72"
] | [
"asym_rlpo/algorithms/a2c/base.py"
] | [
"import abc\nimport random\nfrom typing import Optional, Tuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom asym_rlpo.data import Episode\nfrom asym_rlpo.features import make_history_integrator\nfrom asym_rlpo.policies.base import PartiallyObservablePolicy\nfrom asym_rlpo.q_estima... | [
[
"torch.nn.functional.mse_loss",
"torch.no_grad",
"torch.distributions.Categorical"
]
] |
Achazwl/BMTrain | [
"776c10b21886f12137641c56b12ebf8d601aa9e0"
] | [
"bmtrain/optim/adam_offload.py"
] | [
"import torch\nfrom ..global_var import config\nfrom . import _cpu as C\nfrom . import _cuda as G\nfrom .. import nccl\n\nclass AdamOffloadOptimizer(torch.optim.Optimizer):\n \"\"\"\n Adam optimizer\n \"\"\"\n def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0, scale=65536,... | [
[
"torch.zeros",
"torch.cuda.Event",
"torch.cuda.current_stream",
"torch.no_grad",
"torch.enable_grad"
]
] |
fourmi1995/IronExperiment-DCN | [
"5292539764588e0168016c7e7b4df038358e9f38"
] | [
"fpn/core/metric.py"
] | [
"# --------------------------------------------------------\r\n# Deformable Convolutional Networks\r\n# Copyright (c) 2017 Microsoft\r\n# Licensed under The MIT License [see LICENSE for details]\r\n# Modified by Haozhi Qi\r\n# --------------------------------------------------------\r\n# Based on:\r\n# MX-RCNN\r\n#... | [
[
"numpy.equal",
"numpy.where",
"numpy.sum",
"numpy.log"
]
] |
pva701/text-classification-tf | [
"10b07c1a9c56b2662bf4539aab5fd3a75f1204d4"
] | [
"data_helpers.py"
] | [
"import re\n\nimport numpy as np\nfrom gensim.models import word2vec\nimport json\nimport pickle\n\n\ndef clean_str(string):\n \"\"\"\n Tokenization/string cleaning for all datasets except for SST.\n Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py\n \"\"\"\n st... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.uniform",
"numpy.arange"
]
] |
zjpoh/pyjanitor | [
"3768d8054a2e370262de06a9be617ff790b04ab0"
] | [
"tests/utils/test_skipna.py"
] | [
"import pandas as pd\nfrom janitor.utils import skipna\nimport numpy as np\n\nimport pytest\n\n\n@pytest.mark.functions\ndef test_skipna():\n df = pd.DataFrame({\"x\": [\"a\", \"b\", \"c\", np.nan], \"y\": [1, 2, 3, np.nan]})\n\n def func(s):\n return s + \"1\"\n\n # Verify that applying function ca... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.isnan"
]
] |
erwincoumans/temprepo | [
"bc46dee3355c6a0c0f491f2b0f59cb4ed3f34046"
] | [
"examples/SharedMemory/plugins/eglPlugin/bullet.py"
] | [
"import os \nimport sys\nimport time\nimport subprocess\nimport pybullet as p\nfrom pdb import set_trace\nimport matplotlib.pyplot as plt\nimport numpy as np\n#subprocess.call([\"hardening-check\", p.__file__])\n\n\n\np.connect(p.DIRECT)\nlogId = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS, \"debugTimings\"... | [
[
"matplotlib.pyplot.ion",
"numpy.random.rand",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.imshow"
]
] |
ruchirjain86/professional-services | [
"739ac0f5ffc8237f750804fa9f0f14d4d918a0fa"
] | [
"examples/cloudml-bee-health-detection/trainer/inputs.py"
] | [
"#!/usr/bin/env python\n# Copyright 2018 Google LLC\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 app... | [
[
"tensorflow.decode_csv",
"tensorflow.expand_dims",
"tensorflow.read_file",
"tensorflow.reshape",
"tensorflow.constant",
"tensorflow.estimator.export.ServingInputReceiver",
"tensorflow.image.decode_png",
"tensorflow.data.TextLineDataset",
"tensorflow.placeholder",
"tensorflo... |
PacktPublishing/Practical-Convolutional-Neural-Networks | [
"365aa803d38316ed9749e4c8c0f3ae2667788781"
] | [
"Chapter01/code files/tf_basics_5.py"
] | [
"import tensorflow as tf\n\nx = tf.placeholder(\"float\", [None, 3])\ny = x * 2\n\nwith tf.Session() as session:\n input_data = [[1, 2, 3],\n [4, 5, 6],]\n result = session.run(y, feed_dict={x: input_data})\n print(result)\n"
] | [
[
"tensorflow.Session",
"tensorflow.placeholder"
]
] |
UKPLab/acl2022-structure-batches | [
"d7e116c1254ad00d8b59da3116043424a30f6f64"
] | [
"src/util/training_util.py"
] | [
"import random\n\nimport itertools\nimport numpy\nimport torch\n\nfrom util.strategies import STRATEGIES\nfrom util.evaluators import BiF1Evaluator, CrossF1Evaluator, BiRegressionEvaluator, CrossRegressionEvaluator, \\\n BiAccuracyEvaluator, CrossAccuracyEvaluator\n\n\ndef seed_all(seed = 0):\n torch.manual_s... | [
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"numpy.random.seed"
]
] |
MaybeS/MOT | [
"bae66c46c0cd74b29a0e66c5af58422ad050977b"
] | [
"utils/image.py"
] | [
"from typing import Tuple\n\nimport cv2\nimport numpy as np\n\n\ndef factor_crop(image: np.ndarray, dest_size,\n factor: int = 32, padding: int = 0, based: str = 'min') \\\n -> Tuple[np.ndarray, float, tuple]:\n\n def closest(num: int) \\\n -> int:\n return int(np.ceil(flo... | [
[
"numpy.max",
"numpy.full",
"numpy.min"
]
] |
jangedoo/jange | [
"7f6ee5c341f417cae9e60318fb00716b39b02c00"
] | [
"tests/ops/test_neighbors.py"
] | [
"from unittest.mock import ANY\n\nimport numpy as np\nimport pytest\n\nfrom jange import ops, stream\n\n\n@pytest.mark.parametrize(\"metric\", [\"cosine\", \"euclidean\"])\ndef test_nearest_neighbors(metric):\n # create a features vector where 1st and 3rd item are in same direction\n # and are near to each ot... | [
[
"numpy.array"
]
] |
zjuchenll/dataflow-multithreading-on-tia | [
"8ed7238655d2a63c8ca3d730da52fe9fd6edf396"
] | [
"tools/simulator/memory.py"
] | [
"\"\"\"\nMemories and related utilities.\n\"\"\"\n\nfrom enum import IntEnum\n\nimport numpy as np\n\nfrom simulator.interconnect import Packet, SenderChannelBuffer, ReceiverChannelBuffer\n\n\nclass ReadPort:\n \"\"\"\n Read port interface.\n \"\"\"\n\n def __init__(self, name, buffer_depth):\n \... | [
[
"numpy.zeros"
]
] |
nflanner/lumin | [
"9713f5d18cae43f6d3ef5badeca785eb21e00510"
] | [
"lumin/nn/models/blocks/conv_blocks.py"
] | [
"from typing import Callable, Union, Optional, Any\n\nimport torch.nn as nn\nfrom torch.tensor import Tensor\n\nfrom ..initialisations import lookup_normal_init\nfrom ..layers.activations import lookup_act\n\n\n__all__ = ['Conv1DBlock', 'Res1DBlock', 'ResNeXt1DBlock']\n\n\nclass Conv1DBlock(nn.Module):\n r'''\n ... | [
[
"torch.nn.Sequential",
"torch.nn.init.zeros_",
"torch.nn.BatchNorm1d",
"torch.nn.Conv1d"
]
] |
jonaan99/LEDband | [
"8d576817f15074b06d29a620517f4201ca372b31"
] | [
"client/libs/color_service.py"
] | [
"import numpy as np\n\nclass ColorService():\n def __init__(self, config):\n\n self._config = config\n self.full_gradients = {}\n\n def build_gradients(self):\n\n self.full_gradients = {}\n\n for gradient in self._config[\"gradients\"]:\n not_mirrored_gradient = self._ea... | [
[
"numpy.concatenate",
"numpy.empty",
"numpy.asarray",
"numpy.zeros"
]
] |
BinhMisfit/PSRMTE | [
"dead57779d56d1ec19eec77b763dbda128be53c6"
] | [
"xlnet-paper/classifier_utils.py"
] | [
"from absl import flags\n\nimport re\nimport numpy as np\n\nimport tensorflow as tf\nfrom data_utils import SEP_ID, CLS_ID\n\nFLAGS = flags.FLAGS\n\nSEG_ID_A = 0\nSEG_ID_B = 1\nSEG_ID_CLS = 2\nSEG_ID_SEP = 3\nSEG_ID_PAD = 4\n\nclass PaddingInputExample(object):\n \"\"\"Fake example so the num input examples is... | [
[
"tensorflow.logging.info"
]
] |
shenw33/generate_CFD | [
"4ce47ab75fa15343712430bcde59eee88f45c293"
] | [
"dataset_creator.py"
] | [
"import torch\nimport numpy as np\nfrom torch.utils import data\n\n\ndef dataset_creater(domain_size, velocity_mag = 0.5, early_time_steps=20, num_samples = 2000):\n \n size = domain_size\n num_nodes = 100\n lidVecList = np.linspace(0, velocity_mag, num_nodes)\n \n\n L = 1 # dimensionless LX / LX\... | [
[
"torch.zeros",
"numpy.random.choice",
"numpy.zeros",
"torch.save",
"torch.from_numpy",
"torch.load",
"numpy.linspace"
]
] |
xiaochunxin/athena | [
"42a12252a07d9638f8e3bcbba788fe48e25e8548"
] | [
"athena/transform/feats/framepow_test.py"
] | [
"# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.\n# 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.o... | [
[
"numpy.array",
"tensorflow.executing_eagerly",
"tensorflow.test.main",
"tensorflow.compat.v1.enable_eager_execution",
"tensorflow.python.framework.ops.disable_eager_execution"
]
] |
joshloyal/pydata-amazon-products | [
"fdfe4d0cd49b12fa5a74b05f5d862bb13e7bd72d"
] | [
"amazon_products/image_utils.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\nimport glob\nimport os\nimport functools\nimport itertools\n\nimport pandas as pd\nimport numpy as np\nfrom joblib import Parallel, delayed\nfrom PIL import Image as pil_image\n\n\nimage_extensions =... | [
[
"pandas.cut",
"numpy.asarray",
"numpy.random.RandomState",
"numpy.stack",
"numpy.sqrt",
"numpy.abs",
"numpy.floor"
]
] |
bramreinders97/fairlearn | [
"3335c33117993843252b4adeaeac3ac18683b2ca"
] | [
"test_othermlpackages/test_tensorflow.py"
] | [
"# Copyright (c) Microsoft Corporation and Fairlearn contributors.\n# Licensed under the MIT License.\n\nimport pytest\nfrom . import package_test_common as ptc\n\nfrom fairlearn.reductions import DemographicParity\n\ntf = pytest.importorskip(\"tensorflow\")\nfrom tensorflow.keras.layers import Dense # noqa\nfrom t... | [
[
"tensorflow.keras.models.Sequential",
"tensorflow.keras.layers.Dense"
]
] |
edyeung4/scikit-learn | [
"bb547a2646573f6f95673d0a6b471fe947424345"
] | [
"sklearn/utils/validation.py"
] | [
"\"\"\"Utilities for input validation\"\"\"\n\n# Authors: Olivier Grisel\n# Gael Varoquaux\n# Andreas Mueller\n# Lars Buitinck\n# Alexandre Gramfort\n# Nicolas Tresegnie\n# Sylvain Marie\n# License: BSD 3 clause\n\nfrom functools import wraps\nimport warnings\ni... | [
[
"numpy.array_equal",
"numpy.imag",
"numpy.dtype",
"numpy.full",
"numpy.isreal",
"numpy.isfinite",
"scipy.sparse.issparse",
"numpy.array",
"numpy.real",
"numpy.shape",
"numpy.allclose",
"numpy.isinf",
"numpy.result_type",
"numpy.asarray",
"numpy.random.Ra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.