repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
RexBarker/Deep-Flow | [
"6310007009d2bfe150f1e4b29c7588f720c4bba2"
] | [
"dataset/FlowInitial.py"
] | [
"import torch\nimport os\nimport random\nimport cv2\nimport cvbase as cvb\nimport numpy as np\nimport torch.utils.data as data\nimport utils.image as im\nimport utils.region_fill as rf\n\n\nclass FlowSeq(data.Dataset):\n\n def __init__(self, config, isTest=False):\n super(FlowSeq, self).__init__()\n ... | [
[
"numpy.concatenate",
"numpy.expand_dims",
"torch.from_numpy",
"numpy.ones"
]
] |
aibodygym/GAST-Net-3DPoseEstimation | [
"97a364affe5cd4f68fab030e0210187333fff25e"
] | [
"lib/pose/hrnet/pose_estimation/gen_kpts.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport sys\nimport os\nimport os.path as osp\nimport argparse\nimport time\nimport numpy as np\nfrom tqdm import tqdm\nimport json\nimport torch\nimport torch.backends.cudnn as cudnn\nimport cv2\n\nimp... | [
[
"torch.load",
"numpy.asarray",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.array",
"numpy.zeros"
]
] |
lyschoening/tfx | [
"ff87a97db07642e57e2c84cf50682dc5996f99a4",
"ff87a97db07642e57e2c84cf50682dc5996f99a4"
] | [
"tfx/components/base/base_driver.py",
"tfx/experimental/pipeline_testing/pipeline_recorder_utils.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 Google LLC. 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\... | [
[
"tensorflow.io.gfile.exists",
"tensorflow.io.gfile.makedirs"
],
[
"tensorflow.io.gfile.exists"
]
] |
aidandunlop/traffic_light_recognition | [
"497efe7fe678b88db5331ba446fc45c240276e3f"
] | [
"traffic_lights/lib/Evaluator.py"
] | [
"###########################################################################################\n# #\n# Evaluator class: Implements the most popular metrics for object detection #\n# ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.pause",
"numpy.linspace",
"numpy.cumsum",
"numpy.argwhere",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.sum"... |
hanqiu-hq/GFNet | [
"3dfc282831fbfbe25ad01d28e86d7d99056ea2cb"
] | [
"infer.py"
] | [
"import argparse\nimport datetime\nimport numpy as np\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nimport json\n\nfrom pathlib import Path\n\nfrom timm.data import Mixup\nfrom timm.models import create_model\nfrom timm.loss import LabelSmoothingCrossEntropy, SoftTargetCro... | [
[
"torch.no_grad",
"torch.nn.CrossEntropyLoss",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
skywalk163/parl_ball | [
"b1529c2429a1dc9a0805e04acc4719a1b3ad678e"
] | [
"agent.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.squeeze",
"numpy.expand_dims",
"numpy.argmax"
]
] |
l532857663/spark | [
"481f0792944d9a77f0fe8b5e2596da1d600b9d0a"
] | [
"python/pyspark/sql/tests.py"
] | [
"# -*- encoding: utf-8 -*-\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2... | [
[
"numpy.int32",
"numpy.float32",
"pandas.DataFrame"
]
] |
yfur/dl-chainer | [
"c1917710c80fd6b3dc4cded81700b92bbc349302"
] | [
"1_shinno/chapter4_iris3.py"
] | [
"import numpy as np\nimport chainer\nfrom chainer import cuda, Function, gradient_check, Variable\nfrom chainer import optimizers, serializers, utils\nfrom chainer import Link, Chain, ChainList\nimport chainer.functions as F\nimport chainer.links as L\nfrom sklearn import datasets\nimport time\n\n''' 1. Data prepar... | [
[
"numpy.arange",
"numpy.random.permutation",
"sklearn.datasets.load_iris",
"numpy.argmax"
]
] |
RunsStudio/CAV-exclusive-lane-by-VISSIM | [
"a06844384c37468582e8d23463bd7c37d68b7533"
] | [
"source/result_analysis/result_analysis/overall_drawpic.py"
] | [
"import numpy as np\nfrom matplotlib import rcParams\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\ndef ANOVA_cal_by_stat(data_value):\n da = pd.DataFrame(data_value)\n\n da.columns.name = '场景'\n df1 = da.melt().dropna()\n from statsmodels.formula.api import ols\n from statsmodels.stats.a... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylim",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"numpy.std",
"numpy.mean",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
... |
amiralansary/BrainSurfaceTK | [
"17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef",
"17e3ef5e1c5d6e1a75293fbe031977ec3fbe0fef"
] | [
"models/volume3d/main/train_validate.py",
"scripts/classification/PointNet/run_pointnet_classification.py"
] | [
"import os\nimport SimpleITK as sitk\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport torch\nimport torch.nn.functional as F\nfrom sklearn.model_selection import train_test_split\nfrom torch import nn\nfrom torch.nn import Module, Conv3d, ConvTranspose3d, Line... | [
[
"matplotlib.pyplot.legend",
"torch.optim.lr_scheduler.StepLR",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylim",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.savefig",
"numpy.max",
"matplotlib.pyplot.xlim",
"numpy.mean",
"torch.save",
"matplotlib.pyplot.close",
... |
SRatna/Behavioral-Cloning-CNN | [
"5da816d43a5a631f74d6740dd6fcc8a2fb221a9a"
] | [
"model.py"
] | [
"import os\nimport csv\nimport cv2\nimport numpy as np\nfrom math import ceil\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.utils import shuffle\nfrom keras.models import Sequential\nfrom keras.layers.core import Dense, Activation, Flatten, Dropout\nfrom keras.layers.convolutional import Conv2... | [
[
"sklearn.utils.shuffle",
"numpy.array",
"sklearn.model_selection.train_test_split"
]
] |
RuiBai1999/myrepo | [
"ea8d618995a51079c79a6291af2ca02b01b846ea"
] | [
"core/model/meta/anil.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@inproceedings{DBLP:conf/iclr/RaghuRBV20,\n author = {Aniruddh Raghu and\n Maithra Raghu and\n Samy Bengio and\n Oriol Vinyals},\n title = {Rapid Learning or Feature Reuse? Towards Understanding the Effectiveness\n of... | [
[
"torch.nn.Linear",
"torch.nn.CrossEntropyLoss",
"torch.autograd.grad",
"torch.cat"
]
] |
gantech/wind-energy | [
"e9b14dcbf41f9c74bad9dc8593cc683071d6c6ea"
] | [
"Pedersen_N07/compare_cases.py"
] | [
"# coding: utf-8\nimport load_data, sys\nsys.path.insert(1, '../utilities')\nimport windspectra\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\n\nl_cases = {\n 'amrwind-ksgs': load_data.AMRWindStats('AmrWindKsgs'),\n 'naluwind-smag': load_data.NaluWindStats('NaluWindRun... | [
[
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.grid",
"matpl... |
XG293/SupConLoss | [
"04d069a6d5bc37ac4df80c94327bc6f7da891589"
] | [
"main_multi_supcon.py"
] | [
"from __future__ import print_function\n\nimport os\nimport sys\nimport argparse\nimport time\nimport math\n\nimport tensorboard_logger as tb_logger\nimport torch\nimport torch.backends.cudnn as cudnn\nfrom torchvision import transforms, datasets\n\nfrom util import TwoCropTransform, AverageMeter\nfrom util import ... | [
[
"torch.cat",
"torch.utils.data.DataLoader",
"torch.cuda.empty_cache",
"torch.nn.DataParallel",
"torch.cuda.is_available",
"torch.split",
"torch.cuda.device_count"
]
] |
learnerzhang/trade | [
"762ae0eb52562c86da11876b8a3c2660b19b0f7d"
] | [
"api_modules/server/pipeline/syncup_data.py"
] | [
"# -*- encoding: UTF-8 -*-\nfrom api_modules.server.utils import stock_utils\nfrom api_modules.server.utils.config import ConfigUtils\nfrom multiprocessing import Pool\nimport baostock as bs\nimport pandas as pd\nimport logging\nimport os\n\nlogging.basicConfig(format='%(asctime)s %(message)s', filename='sequoia.lo... | [
[
"pandas.DataFrame"
]
] |
Yard1/tune-sklearn | [
"2b9eecc6fb28963b9b4b80ceb89c138e86fb21c7"
] | [
"tests/test_randomizedsearch.py"
] | [
"from tune_sklearn import TuneSearchCV\nimport numpy as np\nfrom numpy.testing import assert_array_equal\nfrom sklearn.datasets import make_classification\nfrom scipy.stats import expon\nfrom sklearn.svm import SVC\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn import datasets\nfrom skopt.space.space... | [
[
"sklearn.datasets.make_classification",
"scipy.stats.expon",
"sklearn.datasets.load_digits",
"sklearn.svm.SVC",
"sklearn.linear_model.SGDClassifier"
]
] |
Lactozilla/corrscope | [
"9d7da86019b20c9aef75d10fcafd028d4b782b46"
] | [
"corrscope/wave.py"
] | [
"import copy\nimport enum\nfrom typing import Union, List\n\nimport numpy as np\n\nimport corrscope.utils.scipy.wavfile as wavfile\nfrom corrscope.config import CorrError, TypedEnumDump\n\nFLOAT = np.single\n\n# Depends on FLOAT\nfrom corrscope.utils.windows import rightpad\n\n\n@enum.unique\nclass Flatten(str, Typ... | [
[
"numpy.abs",
"numpy.eye",
"numpy.issubdtype",
"numpy.ones",
"numpy.iinfo",
"numpy.zeros"
]
] |
joergdietrich/NFW | [
"58b0ff6b5382461e6053e12c75d35543dd3f8b13"
] | [
"NFW/tests/test_mass_concentration.py"
] | [
"import numpy as np\nfrom numpy.testing import (TestCase, assert_array_equal, assert_equal,\n assert_almost_equal, assert_array_almost_equal,\n assert_raises)\nfrom numpy.testing.decorators import knownfailureif\n\nimport astropy.cosmology\nfrom astropy import uni... | [
[
"numpy.testing.assert_almost_equal",
"numpy.testing.assert_allclose",
"numpy.testing.assert_equal"
]
] |
ytyaru/Python.Pyxel.Reversi.20200419000000 | [
"25b715943ad39c20cd6b5e9ee124a2195919a735"
] | [
"src/game.py"
] | [
"#!/usr/bin/env python3\n# coding: utf8\nimport os, enum, random, numpy, pyxel\nfrom abc import ABCMeta, abstractmethod\n\nclass App:\n def __init__(self):\n self.__window = Window()\n globals()['Window'] = self.__window\n self.__scene = SceneManager()\n pyxel.run(self.update, self.dr... | [
[
"numpy.zeros",
"numpy.count_nonzero"
]
] |
alex-ip/metadata_sync | [
"a6b9de7e1fe1d3bae8669ec41cd09407e3e0afbc"
] | [
"metadata_sync/update_acdd_metadata.py"
] | [
"'''\nUtility to update ACDD global attributes in NetCDF files using metadata sourced from GeoNetwork\nCreated on Apr 7, 2016\n\n@author: Alex Ip, Geoscience Australia\n'''\nimport os\nimport netCDF4\nimport logging\nimport yaml\nimport numpy as np\nimport argparse\n\nfrom geophys_utils import NetCDFGridUtils, NetC... | [
[
"numpy.array"
]
] |
ekmungi/ml_courses | [
"b7c0cfc0bcde0c319def0704afc22ca98799e8af"
] | [
"object_detector_ssd/data/coco.py"
] | [
"from .config import HOME\nimport os\nimport os.path as osp\nimport sys\nimport torch\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\nimport cv2\nimport numpy as np\n\nCOCO_ROOT = osp.join(HOME, 'data/coco/')\nIMAGES = 'images'\nANNOTATIONS = 'annotations'\nCOCO_API = 'PythonAPI'\nINS... | [
[
"numpy.array",
"numpy.expand_dims",
"torch.from_numpy"
]
] |
aninda-github/DeepLearning-OpenCV | [
"cd4726fd0a1df35d18695380407bcc9739235edb"
] | [
"classification/classification.py"
] | [
"import tensorflow as tf\nfrom sklearn.datasets import load_breast_cancer\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# We will be using GPU to train our model. I have a Nvidia GTX 1650 card with comp... | [
[
"matplotlib.pyplot.legend",
"sklearn.datasets.load_breast_cancer",
"tensorflow.test.gpu_device_name",
"tensorflow.keras.layers.Dense",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.plot",
"numpy.round",
"numpy.mean",
"sklearn.preprocessing.StandardScaler",
... |
alt113/flow | [
"28224d05acd4b03cdb78105d142619e4a01d3d5f",
"28224d05acd4b03cdb78105d142619e4a01d3d5f"
] | [
"flow/visualize/visualizer_rllib.py",
"flow/scenarios/bottleneck.py"
] | [
"\"\"\"Visualizer for rllib experiments.\n\nAttributes\n----------\nEXAMPLE_USAGE : str\n Example call to the function, which is\n ::\n\n python ./visualizer_rllib.py /tmp/ray/result_dir 1\n\nparser : ArgumentParser\n Command-line argument parser\n\"\"\"\n\nimport argparse\nfrom datetime import date... | [
[
"numpy.std",
"numpy.mean",
"numpy.zeros"
],
[
"numpy.floor"
]
] |
kaijennissen/gluon-ts | [
"754fdd4184e2c19b8d667eb97d5ae20d486e3cd3"
] | [
"src/gluonts/model/rotbaum/_predictor.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\").\n# You may not use this file except in compliance with the License.\n# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ... | [
[
"numpy.array"
]
] |
robin-oval/compas | [
"e4dc751e95648c5ffb9449f239f3879d39f19887"
] | [
"src/compas/geometry/_primitives/curve.py"
] | [
"from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import division\n\nfrom math import factorial\n\nfrom compas.geometry.basic import scale_vector\nfrom compas.geometry.basic import normalize_vector\nfrom compas.geometry.basic import add_vectors\nfrom compas.geometry.bas... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.show"
]
] |
mbollmann/perceptron | [
"05e00af80491bed67859f09a71f15a3f0cf4b51b"
] | [
"test/helper_classes.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Contains helper classes, such as feature extractors, that are used in the tests.\n\"\"\"\n\nimport numpy as np\nfrom mmb_perceptron.feature_extractor import FeatureExtractor\nfrom mmb_perceptron.feature_extractor.generator import GenerativeExtractor\n\nclass BinaryFeatureExtractor(Fe... | [
[
"numpy.array"
]
] |
lh-wang/ACC | [
"3387a2cd585bd9dee581ab53d64cb0e47d870bbd"
] | [
"run_dataset.py"
] | [
"import tensorflow as tf\nimport scipy.misc\nimport model\nimport cv2\nfrom subprocess import call\n\nsess = tf.InteractiveSession()\nsaver = tf.train.Saver()\nsaver.restore(sess, \"save/model.ckpt\")\n\nimg = cv2.imread('steering_wheel_image.jpg',0)\nrows,cols = img.shape\n\nsmoothed_angle = 0\n\ni = 0\nwhile(cv2.... | [
[
"tensorflow.train.Saver",
"tensorflow.InteractiveSession"
]
] |
Mutefish0/graduation-project | [
"b6c47e946a6ed2fe25389881828e15b5e522eeb5"
] | [
"preprocess.py"
] | [
"#coding=utf8\n\nimport numpy as np\nfrom PIL import Image, ImageDraw\nimport sys\nsys.path.append('tools')\nfrom tool import binImg2vectors, img2binImg, random_rgb\nfrom sklearn.cluster import KMeans\n\nim = Image.open('./res/B02_E36518_0.jpg')\n\nwidth, height = im.size\n\ngrey = im.convert('L')\n\nvectors = []\n... | [
[
"sklearn.cluster.KMeans"
]
] |
raghavaro/strategize | [
"d8ec85b487fe5512689755cdc48c3ad7f76cff12"
] | [
"src/strategize/analysis.py"
] | [
"import numpy as np\n\ndef find_pareto_optimal_outcomes(game):\n # Assuming 2p game with 2 choices each \n num_rows = 4\n num_columns = 2\n # change shape from 2,2,2 to 4,2 \n utilities_row = np.reshape(game.u, (num_rows, num_columns))\n # add index to each utility\n numbers = np.vstack(np.aran... | [
[
"numpy.reshape",
"numpy.arange",
"numpy.argsort",
"numpy.concatenate"
]
] |
onlyrichbrain/pyprobml | [
"cc98c88fd6334d65fe5bc7975c4f27ed9fcf21e8"
] | [
"scripts/pcaDemo2d.py"
] | [
"import superimport\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.decomposition import PCA\nimport os\nimport pyprobml_utils as pml\n\nnp.random.seed(42)\n\n# Generate Data\nn = 9\nvar = 3\ncorr = .5\n\ncov_mat = [[var, corr * var], [corr * var, var]]\nX = np.random.multivariate_normal([0, 0]... | [
[
"numpy.random.seed",
"numpy.random.multivariate_normal",
"matplotlib.pyplot.subplots",
"numpy.mean",
"matplotlib.pyplot.show",
"sklearn.decomposition.PCA"
]
] |
gasx-tesla/openpilot | [
"994cc307186146ee65bc41af7744d67a502142d3"
] | [
"selfdrive/controls/lib/longitudinal_planner.py"
] | [
"#!/usr/bin/env python3\nimport math\nimport numpy as np\nfrom common.numpy_fast import interp\n\nimport cereal.messaging as messaging\nfrom common.realtime import DT_MDL\nfrom selfdrive.modeld.constants import T_IDXS\nfrom selfdrive.config import Conversions as CV\nfrom selfdrive.controls.lib.longcontrol import Lo... | [
[
"numpy.exp",
"numpy.zeros",
"numpy.interp"
]
] |
physimals/quantiphyse-perfsim | [
"6cd209e9f9d51b52ffbd2a0b148cec6a0a64f0ca"
] | [
"quantiphyse_datasim/struc_models.py"
] | [
"\"\"\"\nData simulation Quantiphyse plugin\n\nStructural models, i.e. classes which return lists of different\nstructures and the corresponding partial volume maps\n\nAuthor: Martin Craig <martin.craig@eng.ox.ac.uk>\nCopyright (c) 2016-2017 University of Oxford, Martin Craig\n\"\"\"\n\nfrom __future__ import divis... | [
[
"numpy.all",
"numpy.max",
"numpy.identity",
"numpy.count_nonzero",
"numpy.zeros"
]
] |
xuhuan/rasa | [
"19fb70a05e3637efb9512a942c56cd12ad2c738e"
] | [
"rasa/core/policies/unexpected_intent_policy.py"
] | [
"import logging\nfrom rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization\nimport numpy as np\nimport tensorflow as tf\nfrom pathlib import Path\nfrom typing import Any, List, Optional, Text, Dict, Type, TYPE_CHECKING\n\nfrom rasa.engine.graph import ExecutionContext\nfrom rasa.engine.s... | [
[
"numpy.expand_dims",
"numpy.unique",
"tensorflow.shape",
"tensorflow.tensor_scatter_nd_add",
"tensorflow.equal",
"tensorflow.cast",
"numpy.quantile",
"tensorflow.gather",
"numpy.zeros"
]
] |
hongcheq/WADA | [
"56ce48fc26872851b615ecfba7d1aa678faa5a4c"
] | [
"sim2_TOPO_vs_CTR_ENS_HCforcing_h2_Inteference_Modi_test/Modi_plus_macro_and_micro/Code/Q_related/15_g_term123_Amazon_mean_sfc_top_vertical_integral_time_series.py"
] | [
"'''\nFunction: using output files under /DFS-L/DATA/pritchard/hongcheq/OLD/scratch/\nhongcheq/HCforcing_sim2_WADA_CTR_TOPO_ENSEMBLE_post-processing_h2_tapes_New_Modifications/MSE_decomp_Andes_Amazon\nMSE.nc LSE.nc DSE.nc\nDate: 2019/06/17\n'''\n\nimport numpy as np\nimport xarray as xr\nimport matplotlib.pyplot as... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"... |
flohilde/eta_rmdp | [
"3ef9dad0dbbe4f8626dfe7d3a1e6a03b992e9ad1"
] | [
"simulation.py"
] | [
"import numpy as np\nimport parameters as param\nfrom generator import customer_generator\nfrom etd import get_all_restaurants_etd\nfrom dispatcher import Dispatcher, FakeDispatcher\nfrom pathos.multiprocessing import ProcessingPool as Pool\n\n\ndef simulate(state_dict, spatial_distrib, nodes=None):\n r\"\"\"\n ... | [
[
"numpy.hstack",
"numpy.random.normal",
"numpy.array"
]
] |
Sigel1/Mask_RCNN | [
"a0d3a99f9271968936ac7e687e72f6b33f5816b4"
] | [
"mrcnn/model.py"
] | [
"\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict... | [
[
"numpy.amax",
"numpy.expand_dims",
"tensorflow.concat",
"tensorflow.control_dependencies",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.minimum",
"tensorflow.cast",
"tensorflow.image.non_max_suppression",
"tensorflow.equal",
"tensorflow.image.crop_and_resize... |
crocs-muni/DiSSECT | [
"ecd4f5242ee32804fea0029081026c02dbaabdf6"
] | [
"dissect/analysis/detail.py"
] | [
"import sys\nimport pandas as pd\nfrom sklearn.neighbors import NearestNeighbors\n\nif __name__ == \"__main__\":\n if len(sys.argv) != 3:\n print(f\"USAGE: {sys.argv[0]} <FILE> <CURVE>\", file=sys.stderr)\n sys.exit(1)\n\n df = pd.read_csv(sys.argv[1], sep=\";\")\n curve = df[df[\"curve\"] ==... | [
[
"pandas.read_csv",
"sklearn.neighbors.NearestNeighbors"
]
] |
alberto139/CarND-Capstone | [
"4019ce28f01b0c22255e8cd28445fc18608dc735"
] | [
"ros/src/tl_detector/light_classification/tl_classifier.py"
] | [
"from styx_msgs.msg import TrafficLight\nimport tensorflow as tf\nimport numpy as np\nimport cv2\nfrom collections import Counter\nimport object_class\nimport os\n\nclass TLClassifier(object):\n def __init__(self):\n model_path = os.getcwd() + \"/light_classification/frozen_inference_graph.pb\" \n ... | [
[
"tensorflow.Graph",
"tensorflow.import_graph_def",
"numpy.expand_dims",
"tensorflow.gfile.GFile",
"tensorflow.ConfigProto",
"tensorflow.GPUOptions",
"tensorflow.get_default_graph",
"tensorflow.GraphDef"
]
] |
BAI-Yeqi/nuscenes-devkit | [
"f94dcd313feb8adc91e7d01312fb7d27cc77098e"
] | [
"python-sdk/nuscenes/eval/panoptic/evaluate.py"
] | [
"\"\"\"\nCode written by Motional and the Robot Learning Lab, University of Freiburg.\n\nScript to evaluate Panoptic nuScenes panoptic segmentation (PS) or panoptic tracking (PT) metrics.\nArgument \"task\" could be one of [\"segmentation\", \"tracking\"], check eval/panoptic/README.md for more details of the\ntask... | [
[
"numpy.mean"
]
] |
rubeea/pl_mmpose | [
"3b3643c66db636e8f743d0ac8f8fc14b0d5662fc"
] | [
"mmpose/datasets/datasets/animal/animal_fly_dataset.py"
] | [
"import os\nfrom collections import OrderedDict\n\nimport json_tricks as json\nimport numpy as np\n\nfrom mmpose.core.evaluation.top_down_eval import (keypoint_auc, keypoint_epe,\n keypoint_pck_accuracy)\nfrom ...builder import DATASETS\nfrom .animal_base_dataset imp... | [
[
"numpy.minimum",
"numpy.ones",
"numpy.max",
"numpy.array",
"numpy.zeros"
]
] |
syinari0123/tridepth | [
"5e7e90b537b82e731bb6beac1c8c93fc9187fee0"
] | [
"auxiliary/evaluations.py"
] | [
"import csv\nimport math\nimport numpy as np\nimport torch\n\nfrom auxiliary import AverageMeter\n\nworst_scores = {\n \"mse\": np.inf, \"rmse\": np.inf, \"mae\": np.inf,\n \"lg10\": np.inf, \"absrel\": np.inf,\n \"irmse\": np.inf, \"imae\": np.inf,\n \"delta1\": 0., \"delta2\": 0., \"dealta3\": 0.\n}\n... | [
[
"torch.pow",
"torch.log",
"torch.max"
]
] |
zomansud/machine-learning-specialization | [
"8b63eda4194241edc0c493fb74ca6834c9d0792d"
] | [
"ml-clustering-and-retrieval/week-4/em_utilities.py"
] | [
"from scipy.sparse import csr_matrix\nfrom scipy.sparse import spdiags\nfrom scipy.stats import multivariate_normal\nimport graphlab\nimport numpy as np\nimport sys\nimport time\nfrom copy import deepcopy\nfrom sklearn.metrics import pairwise_distances\nfrom sklearn.preprocessing import normalize\n\ndef sframe_to_s... | [
[
"sklearn.metrics.pairwise_distances",
"numpy.log",
"numpy.sqrt",
"scipy.sparse.csr_matrix",
"numpy.ones",
"scipy.sparse.spdiags",
"numpy.max",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
houzhenzhen/chainer | [
"642cb7470f7b3d03e3aea36aa6cf3e614309f2d9"
] | [
"chainer/functions/array/permutate.py"
] | [
"import numpy\nimport six\n\nimport chainer\nfrom chainer import cuda\nfrom chainer import function\nfrom chainer.utils import type_check\n\n\ndef _check_indices(indices):\n if len(indices) == 0:\n return\n # TODO(unno): Check indices without cpu\n indices = cuda.to_cpu(indices)\n for i in indice... | [
[
"numpy.sort"
]
] |
erfanMhi/rlpyt | [
"56574ea209f48075c26179c5b2f1a4676c38efdd"
] | [
"rlpyt/ul/envs/maze.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport os\n\nfrom collections import namedtuple\nfrom rlpyt.envs.base import Env, EnvStep\nfrom rlpyt.spaces.int_box import IntBox\nfrom rlpyt.utils.quick_args import save__init__args\nfrom rlpyt.samplers.collections import TrajInfo\n\n\nEnvInfo = namedtuple(\"E... | [
[
"numpy.rollaxis",
"matplotlib.pyplot.imshow",
"numpy.all",
"numpy.copy",
"numpy.random.randint",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
Goochaozheng/ChunkFusion | [
"7458a8e08886cc76cfeb87881c51e23b1d0674c3"
] | [
"module/fusionIntegrator.py"
] | [
"from network.utils import toSparseInput\nfrom network.fuser import Fuser\nimport open3d as o3d\nimport torch\nimport spconv\nimport numpy as np\nfrom time import time\n\nfrom .chunkManager import ChunkManager\nfrom geometry import transformPoints, pointToPixel\nfrom network import Fuser, Parser\n\n\nclass FusionIn... | [
[
"torch.abs",
"torch.empty",
"torch.load",
"torch.cat",
"numpy.arange",
"torch.zeros_like",
"numpy.ceil",
"torch.no_grad",
"torch.logical_and",
"torch.logical_or",
"torch.ones_like"
]
] |
LCB0B/metric | [
"0686ce80326b60ddde77989b82c218d94a016cd2"
] | [
"main.py"
] | [
"from copy import deepcopy\n# Import all the packages\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport numpy as np\nimport torch.optim as optim\nimport torch.nn.functional as f # create a dummy data\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport timeit\nfrom sklear... | [
[
"torch.set_default_tensor_type",
"torch.autograd.set_detect_anomaly",
"matplotlib.pyplot.scatter",
"torch.randn",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"torch.cuda.is_available",
"numpy.savetxt",
"matplotl... |
nowkim/GeNER | [
"5a34f4f0b32f27a85771b6d7c39ed2e71ece6784"
] | [
"densephrases/utils/open_utils.py"
] | [
"import os\nimport random\nimport logging\nimport json\nimport torch\nimport numpy as np\n\nfrom densephrases import MIPS\nfrom densephrases.utils.single_utils import backward_compat\nfrom densephrases.utils.squad_utils import get_question_dataloader, TrueCaser\nfrom densephrases.utils.embed_utils import get_questi... | [
[
"torch.device",
"torch.nn.Linear",
"torch.nn.ModuleList",
"numpy.array"
]
] |
simsong/dp-demo | [
"c7ae7b96a1d957413b4ede3ce3a0e39803d07f3b"
] | [
"python/demo_bottom_up.py"
] | [
"#!/usr/bin/env python3\n#\n# Demonstrate the bottom-up mechanism\n\nimport math\nimport random\nimport numpy\nimport sys\nimport copy\nimport statistics\nif sys.version < '3':\n raise RuntimeError(\"Requires Python 3\")\n\n\n# \n# misc support functions\n\ndef l1_error(acounts,bcounts):\n error = 0\n for ... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.sign",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"numpy.random.RandomState",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
tatigabru/kaggle-lyft | [
"217be181b1bd2db1f5fd2707ea2cf4c2bf809736",
"217be181b1bd2db1f5fd2707ea2cf4c2bf809736"
] | [
"src/models/pspnet.py",
"src/train_mask.py"
] | [
"\"\"\"Pyramid Scene Parsing Network\r\nhttps://github.com/Tramac/awesome-semantic-segmentation-pytorch/blob/master/core/models/pspnet.py\r\n\"\"\"\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nfrom .segbase import SegBaseModel\r\nfrom .fcn import _FCNHead\r\n\r\n__all__ = ['PSP... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.interpolate",
"torch.device",
"torch.nn.ReLU"
],
[
"pandas.read_csv",
"torch.load",
"torch.nn.functional.cross_entropy",
"torch.utils.data.DataL... |
hooloovooblu/satisfactory-mesh-spawner | [
"d824d13d591af1e7263d8c34389235c70fc0feeb"
] | [
"mesh_spawner.py"
] | [
"import numpy as np\r\nimport json\r\nfrom scipy.spatial.transform import Rotation as R\r\nfrom numpy.linalg import norm\r\nimport trimesh\r\nimport time\r\nimport subprocess\r\n\r\n\r\n# attach to logger so trimesh messages will be printed to console\r\n#trimesh.util.attach_to_log()\r\n\r\nitem_counts = {}\r\n\r\n... | [
[
"numpy.dot",
"numpy.linalg.norm",
"scipy.spatial.transform.Rotation.identity",
"numpy.cross",
"numpy.array"
]
] |
prmiles/mcmcplotly | [
"270112813d6e59ac5d6329d050ed2eb95144e30c"
] | [
"test/general_functions.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jun 29 15:35:08 2018\n\n@author: prmiles\n\"\"\"\nimport numpy as np\nimport os\n\n\ndef removekey(d, key):\n r = dict(d)\n del r[key]\n return r\n\n\n# define test model function\ndef modelfun(xdata, theta):\n m = theta[0]\n b ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.random_sample"
]
] |
dstushar7/easy-tts | [
"da28192b7f117d9c466b594b22468cb4de994a05"
] | [
"listen.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nfrom os.path import isdir, join\nfrom pathlib import Path\nimport pandas as pd\n\n# Math\nimport numpy as np\nfrom scipy.fftpack import fft\nfrom scipy import signal\nfrom scipy.io import wavfile\nimport librosa\n\nfrom sklearn.decomposition import PCA\n\n# Visualization\nimport... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"scipy.signal.spectrogram",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
INM-6/swan | [
"ecd426657d6e0ee67e8ea31f0298daf2ea065158"
] | [
"swan/virtual_unit_map.py"
] | [
"\"\"\"\nCreated on Dec 12, 2013\n\n@author: Christoph Gollan\n\nIn this module you can find the :class:`VirtualUnitMap` which is used to map\nreal units to virtual units. The virtual units can be swapped to have the \nsame units in the same row.\n\"\"\"\nimport numpy as np\nfrom swan.automatic_mapping import SwanI... | [
[
"numpy.array",
"numpy.multiply"
]
] |
fr-og/aphantasia | [
"35062cff300a82393c32a719cd55583c5a151887"
] | [
"illustrip.py"
] | [
"# coding: UTF-8\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nimport argparse\nimport numpy as np\nimport shutil\nimport PIL\nimport time\nfrom imageio import imread, imsave\n\ntry:\n from googletrans import Translator\n googletrans_ok = True\nexcep... | [
[
"torch.view_as_real",
"torch.optim.Adam",
"torch.fft.rfftn",
"torch.cuda.empty_cache",
"torch.rfft",
"torch.view_as_complex",
"torch.clip",
"torch.optim.AdamW",
"torch.no_grad",
"torch.rand",
"torch.fft.irfftn",
"torch.irfft"
]
] |
DesmondZhong/switch | [
"88abc164128b6a7345c7aa8806e2b37f74de54fa"
] | [
"switch_model/upgrade/upgrade_2_0_1.py"
] | [
"# Copyright (c) 2015-2019 The Switch Authors. All rights reserved.\n# Licensed under the Apache License, Version 2.0, which is in the LICENSE file.\n\n\"\"\"\nUpgrade input directories from 2.0.0b4 (final beta) to 2.0.1. (There were no changes for 2.0.0.)\nThis just moves some modules, as listed in the rename_modu... | [
[
"pandas.read_csv"
]
] |
tg12/Python | [
"398d1dbf4b780d1725aeae9a91b4c79f4410e2f0"
] | [
"arithmetic_analysis/in_static_equilibrium.py"
] | [
"'''THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND\nNON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE\nDISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DA... | [
[
"numpy.radians",
"numpy.cos",
"numpy.sin",
"numpy.cross",
"numpy.array"
]
] |
larioandr/thesis-models | [
"ecbc8c01aaeaa69034d6fe1d8577ab655968ea5f"
] | [
"src/pyqumo/tests/test_sim_gg1.py"
] | [
"from dataclasses import dataclass\n\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nfrom pyqumo.arrivals import Poisson\nfrom pyqumo.random import Exponential, Distribution\nfrom pyqumo.sim.gg1 import simulate\n\n\n@dataclass\nclass GG1Props:\n arrival: Distribution\n service... | [
[
"numpy.testing.assert_allclose"
]
] |
akharitonov/mdde | [
"b0443f3c9c3ca948e9dda213572926087c214d8d"
] | [
"mdde/samples/heuristic/sample_heuristic_random_legal.py"
] | [
"import argparse\nimport logging\nimport sys\n\nfrom typing import List\nfrom pathlib import Path\n\nimport numpy as np\n\nfrom mdde.core import Environment\nfrom mdde.agent.default import SingleNodeDefaultAgent\nfrom mdde.registry.workload import EDefaultYCSBWorkload\nfrom mdde.scenario.default import DefaultScena... | [
[
"numpy.where",
"numpy.random.choice"
]
] |
rtmlsh/Future-salary | [
"2d8de49be939c1752e2fb3e6a5a46a9bf42f7ad9"
] | [
"fetch_sj_vacancies.py"
] | [
"from itertools import count\n\nimport numpy\nimport requests\n\nfrom count_average_salaries import predict_salary\n\n\ndef search_sj_vacancies(language, sj_token, page=None,\n job_area=33, publish_period=30, city_num=4):\n url = 'https://api.superjob.ru/2.0/vacancies/'\n header = {'X-A... | [
[
"numpy.mean"
]
] |
sando-io/pdsando | [
"9f9cbf74b4ec189acb17958771149d32b737866a"
] | [
"pdsando/ta/datafeeds/tsdata.py"
] | [
"import pandas as pd\n\n\ndef to_time_series_data(df, timespan, multiplier, index_col=None, source=None, category=None):\n temp = df.copy()\n ts_vals = temp[index_col] if index_col else temp.index.to_series()\n idx_name = index_col or temp.index.name\n\n temp[idx_name] = match_to_resolution(\n ts... | [
[
"pandas.to_datetime",
"pandas.Timedelta",
"pandas.Timestamp"
]
] |
FabioCLima/Predict-Clients-Default | [
"6d5c9879dabffbca60f574ecedaabf5468eda060"
] | [
"src/main.py"
] | [
"# %%\nimport os\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport seaborn as sns\nmpl.rcParams['figure.dpi']=400\n\nSRC = os.path.abspath('.')\nBASE = os.path.dirname(SRC)\nDATA = os.path.join(BASE, 'data')\nMODELS = os.path.join(BASE, 'models')\nFIGS = os.... | [
[
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"numpy.random.seed",
"matplotlib.pyplot.title",
"matplotlib.pyplot.scatter",
"sklearn.dummy.DummyClassifier",
"sklearn.metrics.plot_confusion_matrix",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.plot",
... |
PromodhPinto/anuvaad-corpus-tools | [
"8b7f7ab02c3dea2096e1de17c6853b3456b2bae3"
] | [
"newsonair-crawler/newsonair_scraper.py"
] | [
"#File contains code to scrape & create En-Hi CSV from newsonair\n\nimport re\nimport time\nimport pandas as pd\nfrom ast import literal_eval\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom indicnlp.tokenize impor... | [
[
"pandas.DataFrame"
]
] |
ExcitedStates/qfit-3.0 | [
"8ed8e8f44015e4eb30fed7a5da65819a586c2bbf"
] | [
"setup.py"
] | [
"'''\nExcited States software: qFit 3.0\n\nContributors: Saulo H. P. de Oliveira, Gydo van Zundert, and Henry van den Bedem.\nContact: vdbedem@stanford.edu\n\nCopyright (C) 2009-2019 Stanford University\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated do... | [
[
"numpy.get_include"
]
] |
jiazhi412/Dataset-REPAIR | [
"581df7b0e0408247cc63e411d3ea2bb0191c4148"
] | [
"colored_mnist.py"
] | [
"import torch\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets, transforms\nimport os\n\nfrom utils.datasets import ColoredDataset\nfrom utils.measure import *\nfrom utils.models import *\n\nimport argparse\nparser = argparse.ArgumentParser()\n# parser.add_argument('--gpu', default=0, type... | [
[
"torch.device",
"torch.utils.data.DataLoader"
]
] |
LeeDaeil/Process_A3C | [
"1876fbe1b928e13b9c8766095b2d13abfda94019"
] | [
"Step_1/Pro2.py"
] | [
"import multiprocessing\nfrom matplotlib import pyplot as plt\nfrom matplotlib import animation\n\n\nclass Pro2(multiprocessing.Process):\n def __init__(self, shared_mem):\n multiprocessing.Process.__init__(self)\n\n self.shared_mem = shared_mem # Main.py 에서 선언했던 Shared memory 를 가져옴\n\n ... | [
[
"matplotlib.pyplot.show",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure"
]
] |
bomber8013/h5py | [
"71a82d9fc99245181747a8630b45373ae1606de0"
] | [
"h5py/tests/test_attrs_data.py"
] | [
"# This file is part of h5py, a Python interface to the HDF5 library.\n#\n# http://www.h5py.org\n#\n# Copyright 2008-2013 Andrew Collette and contributors\n#\n# License: Standard 3-clause BSD; see \"license.txt\" for full license terms\n# and contributor agreement.\n\n\"\"\"\n Attribute data transfer ... | [
[
"numpy.array",
"numpy.ndarray",
"numpy.dtype"
]
] |
Business-Wizard/yolov4-custom-functions | [
"daf98d28b40a17306495883425fe04b6e20b5ff6"
] | [
"save_model.py"
] | [
"import tensorflow as tf\r\nfrom absl import app, flags, logging\r\nfrom absl.flags import FLAGS\r\nfrom core.yolov4 import YOLO, decode, filter_boxes\r\nimport core.utils as utils\r\nfrom core.config import cfg\r\n\r\nflags.DEFINE_string('weights', './data/yolov4.weights', 'path to weights file')\r\nflags.DEFINE_s... | [
[
"tensorflow.constant",
"tensorflow.concat",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Input"
]
] |
movchan74/message_prediction_cnn_solution | [
"fd9564a981b8051120d20653426953169809702e"
] | [
"resnet_prediction.py"
] | [
"import json\nimport sys\nimport os\nfrom collections import Counter\nimport tqdm\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.contrib import layers\nfrom tensorflow.python.ops import array_ops\nimport random\nimport pickle\nimport editdistance\nimport soundex \nimport jellyfish\nimport string\nimp... | [
[
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.conv1d",
"tensorflow.summary.scalar",
"tensorflow.ConfigProto",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.train.Saver",
"tensorflow.argmax",
"tensorflow.shape",
"tensorflow.placeholder",
"tensorflow.global_v... |
liuyibin-git/insightface | [
"5b40f4bfce7e2c9d10bb6328c4fed33e9d76c9de"
] | [
"recognition/ArcFace/image_iter.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport random\nimport logging\nimport sys\nimport numbers\nimport math\nimport sklearn\nimport datetime\nimport numpy as np\nimport cv2\n\nimport mxnet as mx\nfrom mxnet import ndarray as nd... | [
[
"numpy.asarray",
"numpy.fliplr",
"numpy.array"
]
] |
zhyhan/pathology-multiresolution | [
"a44e6563dc5bca5998278403e93a4f74dfc3e8e2"
] | [
"api/hdf5_fun.py"
] | [
"import h5py\nimport numpy as np\nimport config_fun\nimport glob\nimport os\nimport random\nimport sys\nfrom PIL import Image\nfrom torch.utils.data import Dataset\nfrom tqdm import tqdm\nimport patch_preprocess_fun\nfrom itertools import izip\nimport random\n\ndef _precoss_patches(cfg, dataset, file_type):\n da... | [
[
"numpy.concatenate",
"numpy.zeros",
"numpy.asarray"
]
] |
pdstrnadJC/seldon-core | [
"76386a01309f41deb6362ffdb6f65ab26219238a"
] | [
"python/tests/test_microservice_tester.py"
] | [
"import os\nimport pytest\nimport json\nimport logging\nimport numpy as np\n\nfrom seldon_core.microservice_tester import (\n run_method,\n run_send_feedback,\n reconciliate_cont_type,\n SeldonTesterException,\n)\nfrom unittest import mock\nfrom seldon_core.utils import array_to_grpc_datadef, seldon_mes... | [
[
"numpy.array",
"numpy.random.rand"
]
] |
roclark/stable-baselines3 | [
"21e9994ff99db306e14bfa19ca36f133c7153df4"
] | [
"stable_baselines3/common/utils.py"
] | [
"import glob\nimport os\nimport random\nfrom collections import deque\nfrom typing import Callable, Iterable, Optional, Union\n\nimport gym\nimport numpy as np\nimport torch as th\n\n# Check if tensorboard is available for pytorch\ntry:\n from torch.utils.tensorboard import SummaryWriter\nexcept ImportError:\n ... | [
[
"torch.add",
"numpy.random.seed",
"torch.manual_seed",
"numpy.mean",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.var",
"torch.device"
]
] |
pulp-platform/kws-on-pulp | [
"3a1e60ef0b8781bd6db1279e465fc0799a789079"
] | [
"quantization/dataset.py"
] | [
"# Copyright 2017 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... | [
[
"tensorflow.signal.linear_to_mel_weight_matrix",
"torch.nn.ConstantPad1d",
"torch.add",
"torch.Tensor",
"numpy.clip",
"tensorflow.cast",
"tensorflow.math.log",
"torch.mul",
"numpy.random.randint",
"tensorflow.signal.mfccs_from_log_mel_spectrograms",
"tensorflow.tensordo... |
stefantaubert/imageclef-lifelog-2019 | [
"e779526583978be828ebc096538d094cc3cc260e"
] | [
"src/segmentation/ClusterTransformer.py"
] | [
"from src.segmentation.CachableTransformerBase import CachableTransformerBase\nimport scipy.cluster.hierarchy as shc\n\nclass ClusterTransformer(CachableTransformerBase):\n \"\"\"\n Perform hierarchical (agglomerative) clustering to the given histograms.\n Parameters:\n - metric: the metric which is use... | [
[
"scipy.cluster.hierarchy.linkage"
]
] |
SuperXiang/bidd-molmap | [
"f0f5da299e4da4ebae83eed81ddfdad31c707d92"
] | [
"molmap/utils/matrixopt.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Aug 25 20:29:36 2019\n\n@author: wanxiang.shen@u.nus.edu\n\nmatrix operation\n\n\"\"\"\n\nimport numpy as np\nfrom lapjv import lapjv\nfrom scipy.signal import convolve2d\nfrom scipy.spatial.distance import cdist\n\n\nclass Scatter2Grid:\n ... | [
[
"numpy.rot90",
"numpy.pad",
"numpy.sqrt",
"numpy.linspace",
"scipy.spatial.distance.cdist",
"numpy.stack",
"numpy.ceil",
"numpy.exp",
"numpy.zeros"
]
] |
sameesayeed007/DSE-MC-Portfolio-Optimization | [
"06a2cd331709134390fd27415a50a8d8cfc0e44d"
] | [
"PreProcessing.py"
] | [
"#importing lib\nimport pandas as pd\n#read csv\ndf = pd.read_csv(\"Data_2015_1.csv\")\n#selecting necessary column\ndf1 = df.iloc[:,1:4]\n#renaming columns\ndf1.columns = ['Date','Tickers','Price']\n#Dropping treasury bill rows\ndf1 = df1[~df1.Tickers.str.contains('|'.join(['T05Y','T10Y','T15Y','T20Y','T5Y']))]\n#... | [
[
"pandas.read_csv",
"pandas.pivot_table"
]
] |
nivedit1/TwitterSentimentAnalysis | [
"972fdb46fab6f07748d685b94b80450cb5131c5f"
] | [
"svm.py"
] | [
"from sklearn import svm,metrics\nimport numpy as np\nimport matplotlib as plt\nfrom sklearn.decomposition import PCA\nimport datetime\n# from mlxtend.plotting import plot_decision_regions\n\ndef predict_svm(x,y,z,clf):\n clf.fit(x, y)\n predicted = clf.predict(z)\n return predicted\n\n# def make_meshgrid(... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.svm.SVC",
"numpy.load",
"sklearn.decomposition.PCA",
"sklearn.metrics.accuracy_score"
]
] |
Kaiseem/PointNu-Net | [
"d56e6638567202e9a75956b74b53e1d4fe599865"
] | [
"losses/focal_loss.py"
] | [
"import numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\ndef binary_focal_loss(x, y, alpha=0.25, gamma=2., reduction='none'):\r\n pt = x.detach() * (y.detach() * 2 - 1)\r\n w = (1 - pt).pow(gamma)\r\n w[y == 0] *= (1 - alpha)\r\n w[y > 0] *= alpha\r\n # a... | [
[
"torch.sigmoid",
"torch.ones",
"torch.sub",
"torch.nn.functional.binary_cross_entropy",
"torch.log",
"torch.clamp"
]
] |
namjiseong/greenfood | [
"c2612a2cb93631cd9e2f543db230a829a35b7fa3"
] | [
"utils/benchmarks.py"
] | [
"# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\n\"\"\"\nRun YOLOv5 benchmarks on all supported export formats\n\nFormat | `export.py --include` | Model\n--- | --- | ---\nPyTorch | - | yolov5s... | [
[
"pandas.DataFrame"
]
] |
alikefia/dask | [
"99ecc8e64cc70b55dc598197574a5b602a82da83"
] | [
"dask/dataframe/io/tests/test_io.py"
] | [
"import contextlib\nfrom concurrent.futures import ThreadPoolExecutor\nfrom threading import Lock\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport dask.array as da\nimport dask.dataframe as dd\nfrom dask.dataframe._compat import tm\nfrom dask.dataframe.io.io import _meta_from_array\nfrom dask.dat... | [
[
"numpy.random.random",
"pandas.Series",
"numpy.random.seed",
"numpy.arange",
"pandas.Index",
"pandas.DataFrame",
"numpy.ones",
"numpy.random.normal",
"numpy.random.randn",
"numpy.random.rand",
"pandas.date_range",
"numpy.array"
]
] |
steven-lang/SPFlow | [
"be7492d4229857454b4e23596be7ba71d7af5960"
] | [
"src/spn/tests/test_layerwise.py"
] | [
"#!/usr/bin/env python3\n\nimport random\nimport unittest\n\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.distributions import Normal as TorchNormal\nfrom torch.nn import functional as F\n\nfrom spn.algorithms.layerwise import layers, distributions\nfrom spn.algorithms.layerwise.type_checks im... | [
[
"torch.nn.functional.softmax",
"torch.randint",
"torch.zeros",
"torch.ones",
"torch.randn",
"numpy.float16",
"numpy.int8",
"torch.tensor",
"torch.rand",
"numpy.float32",
"torch.nn.Parameter",
"numpy.int64",
"torch.log",
"torch.distributions.Normal",
"num... |
dilawarm/AlphaZero | [
"a5e38d49ba24bf9587f5571ad8c1ea7465005d34",
"a5e38d49ba24bf9587f5571ad8c1ea7465005d34"
] | [
"Multiprocessing.py",
"Gamerendering.py"
] | [
"import Train\nfrom multiprocessing import Process, Manager\nimport numpy as np\nimport time\nfrom FourInARow import Config\n# from TicTacToe import Config\nfrom collections import defaultdict\n\n\nclass DataStore:\n def __init__(self, max_epochs_stored):\n self.data = {}\n self.max_epochs_stored =... | [
[
"tensorflow.ConfigProto",
"tensorflow.GPUOptions",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
],
[
"tensorflow.ConfigProto",
"tensorflow.GPUOptions"
]
] |
expertanalytics/fagkveld | [
"96e16b9610e8b60d36425e7bc5435d266de1f8bf"
] | [
"worldmap/test/test_country.py"
] | [
"import pytest\nimport numpy as np\nimport bokeh\n\n\n@pytest.fixture()\ndef dtm():\n dtm = DTM()\n country1 = Country()\n country1.border_x = [np.array([1, 3, 3, 1])]\n country1.border_y = [np.array([0, 0, 1, 1])]\n\n country2 = Country()\n country2.border_x = [np.array([1, 3, 3, 1])]\n countr... | [
[
"numpy.array"
]
] |
CodyJG10/Business-Finder | [
"6e725bff340086417582fffac6493909e287008a"
] | [
"place_searching.py"
] | [
"import googlemaps\nimport pandas as pd\nimport time\nimport sys\nimport json\n\ndef retrieve_places():\n # print(sys.argv[1])\n # print('test')\n print(location_query)\n location = client.geocode(location_query)[0]['geometry']['location']\n\n results = client.places(query = query,\n ... | [
[
"pandas.DataFrame"
]
] |
mberkanbicer/torch-light | [
"facd5e12f45127e81951ca1e6119960e196c6165"
] | [
"voice-conversion/encode/data_loader.py"
] | [
"import pickle \nimport os \n\nfrom torch.utils import data\nimport torch\nimport numpy as np\n\nclass Utterances(data.Dataset):\n def __init__(self, hparams):\n self.len_crop = hparams.len_crop\n self.train_dataset = pickle.load(open(os.path.join(hparams.data_dir, hparams.training_data), \"rb\"... | [
[
"torch.utils.data.DataLoader",
"numpy.pad",
"torch.initial_seed",
"numpy.random.randint"
]
] |
weifanjiang/treeVerification | [
"2a841d24d3f930ffdfae9c554f4c1d9fa8756edc"
] | [
"generate_bound.py"
] | [
"import argparse\nimport numpy as np\n\nparser = argparse.ArgumentParser()\nparser.add_argument('-i', '--input', help='input testing data')\nparser.add_argument('-o', '--output', help='output path for features')\nparser.add_argument('-e', '--epsilon', help='epsilon', type=float)\nargs = vars(parser.parse_args())\n\... | [
[
"numpy.random.uniform"
]
] |
priyansh-1902/olympus | [
"f57ad769918c0d5d805c439ab5ffbd180af698fa"
] | [
"src/olympus/planners/planner_particle_swarms/wrapper_particle_swarms.py"
] | [
"#!/usr/bin/env python\n\nimport time\nfrom olympus.objects import ParameterVector\nfrom olympus.planners import AbstractPlanner\nfrom olympus.utils import daemon\nimport numpy as np\n\n\nclass ParticleSwarms(AbstractPlanner):\n\n def __init__(self, goal='minimize', max_iters=10**8, options={'c1': 0.5, 'c2':... | [
[
"numpy.array"
]
] |
alexandru-dinu/MCMC | [
"c45632a7aba9e78a30c47644b261130b261f6278"
] | [
"src/metropolis_hastings.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.stats as stats\nimport seaborn as sns\n\nmus = np.array([5, 5])\nsigmas = np.array([[1, 0.9], [0.9, 1]])\n\n\ndef circle(x, y):\n return (x - 1) ** 2 + (y - 2) ** 2 - 3 ** 2\n\n\ndef pgauss(x, y):\n return stats.multivariate_normal.pdf([x, y],... | [
[
"matplotlib.pyplot.title",
"numpy.random.normal",
"numpy.random.rand",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.show",
"scipy.stats.multivariate_normal.pdf"
]
] |
dreness/data-wrangling-components | [
"cf1a6eb152bb4f2fd1d3b933b9aa32b965a29610"
] | [
"python/data_wrangling_components/engine/verbs/union.py"
] | [
"#\r\n# Copyright (c) Microsoft. All rights reserved.\r\n# Licensed under the MIT license. See LICENSE file in the project.\r\n#\r\n\r\nimport pandas as pd\r\n\r\nfrom data_wrangling_components.table_store import TableStore\r\nfrom data_wrangling_components.types import SetOperationArgs, Step\r\n\r\n\r\ndef union(s... | [
[
"pandas.concat"
]
] |
congma/libsncompress | [
"ef0c8ee36b8a53b6106ade675d5210fa6e4d5409"
] | [
"tests/test_base_usage.py"
] | [
"\"\"\"Testing usage of libsncompress.base\"\"\"\nimport os\nimport os.path\nimport pytest\nimport six\nimport six.moves as sm\nimport numpy\nfrom numpy.random import shuffle\nimport libsncompress\nfrom lsnz_test_infra import jla_full_paths, outdir\n\n\n@pytest.fixture\ndef extra_file(jla_full_paths):\n fits_dir... | [
[
"numpy.log10",
"numpy.random.shuffle"
]
] |
subshine/tutorials | [
"717320cbec72e3e68acefad9c367fc6c5ffb37b1"
] | [
"matplotlibTUT/plt16_grid_subplot.py"
] | [
"# View more python tutorials on my Youtube and Youku channel!!!\n\n# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg\n# Youku video tutorial: http://i.youku.com/pythontutorial\n\n# 16 - grid\n\"\"\"\nPlease note, this script is for python3+.\nIf you are using python2+, please modif... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplot",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot2grid",
"matplotlib.pyplot.figure"
]
] |
michlkallen/gpx_mapping | [
"8272b8a1d99d9d4c80933163eddf32a6d66583e6"
] | [
"gpx_correct.py"
] | [
"\"\"\"\nScript to correct timestamps on GPX files.\n\nUse if creating a GPX file manually through www.gpxgenerator.com\nand the speed used is incorrect. (Or if you want to modify an existing route.)\n\nTo use:\n-------\n1. Edit the `file_in` name and the `file_out` name if desired.\n2. Edit the average speed (and ... | [
[
"pandas.to_datetime",
"numpy.sqrt",
"numpy.cumsum",
"pandas.Timedelta",
"numpy.array",
"numpy.random.default_rng"
]
] |
decile-team/spear | [
"7629cc46ce738a4a67e5b4a6ba7d1935c4833421"
] | [
"spear/utils/utils_jl.py"
] | [
"import torch.nn as nn\nfrom torch import log\nimport numpy as np\n\nfrom .utils_cage import probability\n\n\ndef log_likelihood_loss_supervised(theta, pi, y, m, s, k, n_classes, continuous_mask, qc, device):\n\t'''\n\t\tJoint Learning utils: Negative log likelihood loss, used in loss 4 in :cite:p:`DBLP:journals/co... | [
[
"torch.nn.NLLLoss",
"numpy.unique",
"torch.log",
"numpy.zeros",
"numpy.where"
]
] |
kammerjager/Yume-Bot | [
"c3099b929e30602deec23967c7a49f389b5a6d2c"
] | [
"modules/sql/rankingsdb.py"
] | [
"# Copyright (c) 2020.\n# MIT License\n#\n# Copyright (c) 2019 YumeNetwork\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation ... | [
[
"numpy.array"
]
] |
stephenfuqua/Ed-Fi-X-Fizz | [
"94597eda585d4f62f69c12e2a58fa8e8846db11b"
] | [
"src/google-classroom-extractor/edfi_google_classroom_extractor/mapping/users.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n# Licensed to the Ed-Fi Alliance under one or more agreements.\n# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.\n# See the LICENSE and NOTICES files in the project root for more information.\n\nfrom pandas import DataFrame, concat\nfrom e... | [
[
"pandas.concat"
]
] |
tdeme/NLP-Partisanship | [
"4a289d1157ac1b96e5af3b38b2676f2d5c84e21b"
] | [
"Notebooks and Scripts/model_testing.py"
] | [
"from transformers import TFAutoModel, AutoTokenizer, AutoModelForSequenceClassification, DistilBertForSequenceClassification\nfrom newspaper import Article\nfrom torch import nn\n\n'''\nThis script will test the model previously trained, and compare\nits performance with that of a similar existing model that was \... | [
[
"torch.nn.functional.softmax"
]
] |
antgonza/qtp-biom | [
"731b5529fc5f559a868c1d3a6e14cecf4e59198b"
] | [
"qtp_biom/tests/test_plugin.py"
] | [
"# -----------------------------------------------------------------------------\n# Copyright (c) 2014--, The Qiita Development Team.\n#\n# Distributed under the terms of the BSD 3-clause License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------... | [
[
"numpy.random.randint"
]
] |
GavinAbercrombie/motion_policy_detection | [
"f7a609f8af8acbe781418edbfec7629b4225b3c0"
] | [
"returns_policy.py"
] | [
"### Matches Hansard HoC debate motions and motion quasi-sentences \n### to policy codes from the Comparative Manifesto Project.\n\nimport os, csv\nfrom collections import Counter, OrderedDict\nfrom nltk import word_tokenize \nfrom nltk.stem import WordNetLemmatizer\nfrom sklearn.feature_extraction.text im... | [
[
"sklearn.metrics.pairwise.cosine_similarity",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
graebe/StatePerception | [
"bba6743ef95ba5f1d693ba9d409188e37b0d95ec"
] | [
"StatePerception/KerasLayer.py"
] | [
"\"\"\"\r\n@author: Torben Gräber\r\n\"\"\"\r\n\r\nimport tensorflow as tf\r\nfrom keras.engine.topology import Layer\r\nfrom keras.losses import mean_squared_error\r\nfrom keras import backend as K\r\nimport numpy as np\r\n\r\n# =============================================================================\r\n# Cus... | [
[
"tensorflow.multiply",
"tensorflow.concat",
"tensorflow.constant",
"numpy.ones",
"tensorflow.constant_initializer",
"tensorflow.divide",
"tensorflow.mean",
"numpy.transpose",
"numpy.array"
]
] |
CAMI-DKFZ/simpa_paper_experiments | [
"f5a37d57692b29b78b85d60a38e4dc0aaa5aadfc"
] | [
"experiments/tissue_generation/forearm.py"
] | [
"# SPDX-FileCopyrightText: 2021 Computer Assisted Medical Interventions Group, DKFZ\n# SPDX-FileCopyrightText: 2021 Janek Groehl\n# SPDX-License-Identifier: MIT\n\nfrom simpa import Tags\nimport simpa as sp\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom simpa.utils.libraries.structure_library import def... | [
[
"matplotlib.pyplot.close",
"numpy.random.seed",
"matplotlib.pyplot.figure"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.