repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
greymistcube/racing_game_ai | [
"7e5e6ec781eb3c98729d370cbcc0ab6ed053962f"
] | [
"lib/tools/sensor.py"
] | [
"import numpy as np\n\nfrom lib.tools.direction import R\nimport lib.constants as const\n\nclass Sensor:\n def __init__(self):\n pass\n\n @classmethod\n def get_sensor_data(cls, tile, rel_x, rel_y, direction):\n pt = np.array([rel_x, rel_y])\n walls = []\n neighbors = [tile.prev... | [
[
"numpy.array",
"numpy.apply_along_axis"
]
] |
NSanovsky/datasets | [
"fb46d537fdd153494d6a0b500dbcd0ff24801916"
] | [
"tensorflow_datasets/image_classification/oxford_iiit_pet.py"
] | [
"# coding=utf-8\n# Copyright 2020 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"tensorflow.compat.v2.io.gfile.GFile"
]
] |
stonebig/pandas | [
"4947b1fef73424d7ef9da2459d65c861e6cec030"
] | [
"pandas/io/tests/test_stata.py"
] | [
"# pylint: disable=E1101\n\nfrom datetime import datetime\nimport os\nimport unittest\n\nimport warnings\nimport nose\n\nimport numpy as np\n\nfrom pandas.core.frame import DataFrame\nfrom pandas.io.parsers import read_csv\nfrom pandas.io.stata import read_stata, StataReader, StataWriter\nimport pandas.util.testing... | [
[
"pandas.util.testing.assert_frame_equal",
"numpy.testing.assert_equal",
"numpy.testing.assert_almost_equal",
"pandas.io.stata.read_stata",
"pandas.io.stata.StataReader",
"pandas.io.stata.StataWriter",
"pandas.util.testing.get_data_path",
"pandas.io.parsers.read_csv",
"pandas.co... |
simonsobs/ps_py | [
"046c1d68c06fd3e8b7f0d9c068d0ff999bf95a0b",
"046c1d68c06fd3e8b7f0d9c068d0ff999bf95a0b",
"046c1d68c06fd3e8b7f0d9c068d0ff999bf95a0b"
] | [
"project/data_analysis/python/get_best_fit.py",
"project/data_analysis/python/montecarlo/mc_mnms_get_spectra.py",
"project/old/correlation_coeff/systematic_model.py"
] | [
"\"\"\"\nThis script compute best fit from theory and fg power spectra.\nIn our particular case, we use best fit foregrounds from erminia.\n\"\"\"\nimport sys\n\nimport numpy as np\nimport pylab as plt\nfrom pspy import pspy_utils, so_dict\n\nd = so_dict.so_dict()\nd.read_from_file(sys.argv[1])\n\nsurveys = d[\"sur... | [
[
"numpy.loadtxt",
"numpy.transpose"
],
[
"numpy.copyto",
"numpy.empty",
"numpy.random.seed",
"numpy.mean",
"numpy.loadtxt"
],
[
"numpy.log",
"numpy.exp",
"numpy.where",
"numpy.arange",
"numpy.transpose",
"numpy.cos",
"numpy.deg2rad"
]
] |
Larry-u/JAFPro | [
"10e5ee3b77bcdb103709c08c3e7d033396bab5ba"
] | [
"src/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BaseNetwork(nn.Module):\n def __init__(self):\n super(BaseNetwork, self).__init__()\n\n def init_weights(self, init_type='normal', gain=0.02):\n '''\n initialize network's weights\n init_type: normal |... | [
[
"torch.sigmoid",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.init.orthogonal_",
"torch.nn.LeakyReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.ReflectionPad2d",
... |
EmilPi/PuzzleLib | [
"31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9",
"31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9"
] | [
"Modules/Concat.py",
"Converter/OpenVINO/Tests/GraphTest.py"
] | [
"import numpy as np\n\nfrom PuzzleLib.Backend import gpuarray\nfrom PuzzleLib.Modules.Module import ModuleError, Module\n\n\nclass Concat(Module):\n\tdef __init__(self, axis, name=None):\n\t\tsuper().__init__(name)\n\t\tself.registerBlueprint(locals())\n\n\t\tself.axis = axis\n\t\tself.sections = None\n\n\n\tdef up... | [
[
"numpy.random.randint",
"numpy.random.randn"
],
[
"numpy.random.randn"
]
] |
af-ai-center/nerblackbox | [
"a2b751d0b74c3f4779ccf3846e35d8575b488027"
] | [
"nerblackbox/tests/test_data_preprocessing.py"
] | [
"import pytest\nimport torch\nfrom transformers import AutoTokenizer\nfrom typing import List, Dict\nfrom pkg_resources import resource_filename\nfrom nerblackbox.modules.ner_training.data_preprocessing.tools.csv_reader import (\n CsvReader,\n)\nfrom nerblackbox.modules.ner_training.data_preprocessing.tools.inpu... | [
[
"torch.tensor",
"torch.eq"
]
] |
prucehuang/machine-learning-introduction | [
"c543548b9f0f49479bcdf0c8e7b0098c4b7b0cac"
] | [
"scripts/statistics/PlotDistribution.py"
] | [
"#!/usr/bin/python\r\n#coding:utf-8\r\n# ***************************************************************\r\n# 绘制正态分布曲线\r\n# author: pruce\r\n# email: 1756983926@qq.com\r\n# date: 20180919\r\n# ***************************************************************\r\n\r\nimport numpy as np\r\nimport matplotlib.mla... | [
[
"matplotlib.mlab.normpdf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"numpy.random.randn",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots_adjust"
]
] |
deeglaze/conversationai-models | [
"34d4645e5a3c9c632e20d485b783a72e525f8a59"
] | [
"kaggle-classification/keras_trainer/model.py"
] | [
"\"\"\"Classifiers for the Toxic Comment Classification Kaggle challenge, https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge\n\nTo run locally:\n python keras-trainer/model.py\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_functi... | [
[
"tensorflow.gfile.Remove",
"numpy.asarray",
"numpy.zeros",
"tensorflow.gfile.Copy",
"tensorflow.gfile.Open",
"tensorflow.gfile.MakeDirs",
"tensorflow.contrib.training.HParams",
"sklearn.metrics.roc_auc_score",
"pandas.read_csv"
]
] |
artemkush1/Genetic_algoritm | [
"90a45c1737e03925cd85248f0833f5fc52f420ad"
] | [
"flappy_bird/bbnet/nn.py"
] | [
"import numpy as np\nimport scipy.special\n\n\nclass NeuralNetwork:\n def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate=0.1):\n self.inodes = input_nodes\n self.hnodes = hidden_nodes\n self.onodes = output_nodes\n self.lr = learning_rate\n self.weights_i... | [
[
"numpy.array",
"numpy.dot",
"numpy.random.rand",
"numpy.copy",
"numpy.transpose"
]
] |
sinyeeftw/GamestonkTerminal | [
"97b7f03dd8878cad46fee21e2e216ca0f6909694"
] | [
"gamestonk_terminal/cryptocurrency/defi/llama_view.py"
] | [
"\"\"\"Llama View\"\"\"\n__docformat__ = \"numpy\"\n\nimport logging\nimport os\nfrom typing import List, Optional\n\nimport matplotlib.pyplot as plt\nfrom matplotlib import ticker\n\nfrom gamestonk_terminal import config_terminal as cfg\nfrom gamestonk_terminal.config_plot import PLOT_DPI\nfrom gamestonk_terminal.... | [
[
"matplotlib.pyplot.subplots"
]
] |
KolatimiDave/Smart-Queuing-System- | [
"0bc1e32b742bce6585755ee35fc0d2b2b86458f1"
] | [
"person_detect.py"
] | [
"\nimport numpy as np\nimport time\nfrom openvino.inference_engine import IENetwork, IECore\nimport os\nimport cv2\nimport argparse\nimport sys\n\n\nclass Queue:\n '''\n Class for dealing with queues\n '''\n def __init__(self):\n self.queues=[]\n\n def add_queue(self, points):\n self.qu... | [
[
"numpy.load"
]
] |
rossi2018/python-mini-projects | [
"a85c140b990ec9d0fd491da5508fe188278032b0"
] | [
"projects/Compute_IoU/Compute_IoU.py"
] | [
"import numpy as np\n\ndef Cal_IoU(GT_bbox, Pred_bbox):\n '''\n Args:\n GT_bbox: the bounding box of the ground truth\n Pred_bbox: the bounding box of the predicted\n Returns:\n IoU: Intersection over Union\n '''\n #1. Calculate the area of the intersecting area\n ixmin = max... | [
[
"numpy.array",
"numpy.maximum"
]
] |
YzyLmc/AC-GG_0.2 | [
"ddedbbe4062f6646041e24c16593b087d3cf0095"
] | [
"r2r_src/eval.py"
] | [
"''' Evaluation of agent trajectories '''\n\nimport json\nimport os\nimport sys\nsys.path.append('build')\nfrom collections import defaultdict\nimport networkx as nx\nimport numpy as np\nimport pprint\npp = pprint.PrettyPrinter(indent=4)\n\nfrom env import R2RBatch\nfrom utils import load_datasets, load_nav_graphs\... | [
[
"numpy.average",
"numpy.mean"
]
] |
qingfeng10/gpytorch | [
"4d33fbf64594aab2dd6e0cfcb3242510231b3e0e"
] | [
"test/lazy/test_root_lazy_tensor.py"
] | [
"#!/usr/bin/env python3\n\nimport unittest\n\nimport torch\n\nfrom gpytorch.lazy import RootLazyTensor\nfrom gpytorch.test.lazy_tensor_test_case import LazyTensorTestCase\n\n\nclass TestRootLazyTensor(LazyTensorTestCase, unittest.TestCase):\n seed = 0\n should_test_sample = True\n should_call_lanczos = Fal... | [
[
"torch.eye",
"torch.randn"
]
] |
virtan/FAI-PEP | [
"a4089c79ab765e7f05080348c2978a07c3487d4c"
] | [
"libraries/python/coco/generate_im_info.py"
] | [
"#!/usr/bin/env python\n\n##############################################################################\n# Copyright 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n###################... | [
[
"numpy.round"
]
] |
jason022085/AIFER | [
"3d5b8826c41922ed1ea39b7d55446ec44773735d"
] | [
"codes/Day16_EFN_aug.py"
] | [
"# %%\nfrom tensorflow.keras.callbacks import LearningRateScheduler\nfrom tensorflow.keras.preprocessing.image import random_rotation, random_shear, random_zoom\nfrom sklearn.metrics import confusion_matrix, classification_report\nfrom tensorflow.keras.applications.efficientnet import preprocess_input\nfrom tensorf... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.layers.Dense",
"numpy.where",
"tensorflow.keras.losses.CategoricalCrossentropy",
"tensorflow.keras.preprocessing.image.random_rotation",
"pandas.read_csv",
"numpy.fromstring",
"numpy.max",
"tensorflow.random.set_seed",
... |
alfredholmes/cryptocurrency_data_analysis | [
"084aff2f9b9fe676d5743f789d7fb71a344f9db9"
] | [
"PreliminaryAnalysis/Individual Trade Analysis/Further Properties/test_read.py"
] | [
"import ijson\nimport pandas\n\nimport numpy as np\n\n\nfrom scipy.stats import norm, expon\n\nimport matplotlib.pyplot as plt\n\ndef main():\n\twith open('BTCUSDT.json', 'r') as f:\n\t\ttrades = ijson.items(f, 'item')\n\n\t\tprevious_price = None\n\t\tprevious_time = None\n\t\tchanges = []\n\t\tinterarrivals = []\... | [
[
"scipy.stats.norm.pdf",
"matplotlib.pyplot.savefig",
"scipy.stats.expon.fit",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.hist",
"scipy.stats.norm.fit",
"matplotlib.pyplot.show",
"scipy.stats.expon.pdf",
"matplo... |
ElemenTP/Python-Homework | [
"8a73cbc11fb360b0e5fb1dd398a9415e4ece73e6",
"8a73cbc11fb360b0e5fb1dd398a9415e4ece73e6"
] | [
"pyf/pyfserver.py",
"pyf/pyfserver_ram.py"
] | [
"import json\nimport numpy as np\nfrom sanic import Sanic\nfrom sanic import response\nfrom geojson import Polygon\nfrom shapely import geometry as geo\nimport threading\n\napp = Sanic(\"PopulationDataInquireServer\")\n\n\ndef fetchPopulationFromFile(lon, lat):\n global mutex, datafile\n x = int((lat + 90) * ... | [
[
"numpy.arange"
],
[
"numpy.loadtxt",
"numpy.arange"
]
] |
ZhiChen902/DetarNet | [
"7efd1cc62562866feb04f4894306b67d1e65bf1f"
] | [
"test.py"
] | [
"import datetime\nimport numpy as np\nimport time\nfrom transformations import rotation_from_matrix\nimport sklearn.metrics as metrics\nimport pickle\n\nimport os\nfrom registration.registration import initializePointCoud, globalRegistration, selectFunction, refine_registration, makeMatchesSet\n\nimport math\n# fro... | [
[
"tensorflow.Summary",
"numpy.array",
"numpy.linalg.norm",
"numpy.isnan",
"numpy.trace",
"numpy.zeros",
"numpy.asarray",
"numpy.matmul",
"numpy.sum",
"numpy.rad2deg",
"numpy.real",
"numpy.mean",
"numpy.eye",
"sklearn.metrics.accuracy_score",
"numpy.linalg... |
warhuus/method-of-moments | [
"8f4940dfde8f4770eae20e7508a9aba526276e7b"
] | [
"mom/mom.py"
] | [
"from typing import List\n\nimport numpy as np\nimport scipy.linalg\n\n\ndef form_L(B312: List[np.ndarray], k: int, verbose: bool) -> np.ndarray:\n ''' Return L, R3 '''\n L = np.empty((k, k))\n\n # step 1: compute R3 that diagonalizes B312[0]\n L[0], R3 = scipy.linalg.eig(B312[0])\n R3 = R3.real\n ... | [
[
"numpy.random.normal",
"numpy.empty",
"numpy.ones",
"numpy.linalg.det",
"numpy.einsum",
"numpy.diag",
"numpy.linalg.svd",
"numpy.hstack",
"numpy.linalg.inv"
]
] |
omarmaddouri/GCNCC_cross_validated | [
"89576ad2c8459f065604656fd38a786d042f09e0"
] | [
"scripts/SCZ_RNAseq/syn4590909/init_without_local_modules.py"
] | [
"import sys\nfrom os.path import dirname, abspath\nsys.path.append(dirname(dirname(abspath(__file__))))\n\nfrom SCZ_RNAseq.syn4590909.utils import *\nfrom numpy import interp\nfrom sklearn.metrics import roc_curve, auc\nfrom sklearn.model_selection import StratifiedKFold\n\n\npath=\"../../data/SCZ_RNAseq/output/syn... | [
[
"sklearn.metrics.auc",
"sklearn.model_selection.StratifiedKFold",
"numpy.interp",
"sklearn.metrics.roc_curve"
]
] |
NoeLahaye/InTideScat_JGR | [
"6849e82b3cda816ca7bdc6ab207e2c857a3f5f5f"
] | [
"modal_mapping/comp_modal_nrjflux_rechunk.py"
] | [
"''' comp_modal_nrjflux.py\ncompute horizontal flux of vertically integrated energy \nand energy density ; \nread per chunk, compute every modes at the same time per chunk and store in mode-chunked \nfiles (in addition to x-chunked and y-chunked: small files strategy)\nfrom comp_modal_nrjflux_chunked.py ; NJAL Apri... | [
[
"numpy.sum",
"scipy.signal.butter",
"numpy.diff",
"scipy.signal.filtfilt",
"numpy.nanmean",
"numpy.arange",
"numpy.trapz",
"numpy.isfinite"
]
] |
Gitgigabyte/mmd | [
"02cf37884d3ac9a6018656d1871695669966dfb3"
] | [
"mmdet/models/mask_heads/maskiou_head_MH.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nfrom mmcv.cnn import kaiming_init, normal_init\nfrom torch.nn.modules.utils import _pair\nimport torch.nn.functional as F\n\nfrom mmdet.core import force_fp32\nfrom ..builder import build_loss\nfrom ..registry import HEADS\nfrom ..utils import ConvModule\nim... | [
[
"torch.zeros",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.MaxPool2d",
"torch.nn.functional.interpolate",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
luckmoon/pytorch-examples | [
"e6ec2ceafa7de7412a762e8ece0610ade44cf5e2"
] | [
"autograd/two_layer_net_custom_function.py"
] | [
"import torch\n\n\"\"\"\nA fully-connected ReLU network with one hidden layer and no biases, trained to\npredict y from x by minimizing squared Euclidean distance.\n\nThis implementation computes the forward pass using operations on PyTorch\nTensors, and uses PyTorch autograd to compute gradients.\n\nIn this implem... | [
[
"torch.device",
"torch.no_grad",
"torch.randn"
]
] |
Fanzhongjie/ARFE | [
"4b96b8c5bc0895d3d30acec2a490f81a860fe860"
] | [
"mmdet/models/necks/fpn_relation.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule, xavier_init\nimport torch\nimport numpy as np\nfrom mmdet.ops import NonLocal2D\nfrom ..builder import NECKS\n\n\n@NECKS.register_module\nclass FPNRelation(nn.Module):\n \"\"\"by weighting bottom-up and top-down process out... | [
[
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.ModuleList",
"torch.sum"
]
] |
anxingle/nnUNet_simple | [
"9c69bc5a005d5305b27d6d214dc16ac25c4ead76"
] | [
"nnunet/dataset_conversion/Task061_CREMI.py"
] | [
"#\tCopyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\n#\n#\tLicensed under the Apache License, Version 2.0 (the \"License\");\n#\tyou may not use this file except in compliance with the License.\n#\tYou may obtain a copy of the License at\n#\n#\t\thttp://... | [
[
"numpy.array"
]
] |
DanBerrebbi/AISHELL-4 | [
"75ea24e547b671eae05aac365e32b3cd09bb3b3c"
] | [
"asr/cmd/aps/loader/am/utils.py"
] | [
"#!/usr/bin/env python\n\n# Copyright 2019 Jian Wu\n# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\nimport warnings\nimport torch as th\n\nimport torch.utils.data as dat\nimport aps.distributed as dist\n\nfrom typing import Dict, List, Tuple, NoReturn, Optional, Callable\nfrom kaldi_python_io ... | [
[
"torch.Generator",
"torch.randperm",
"torch.arange"
]
] |
palisadoes/pattoo | [
"57bd3e82e49d51e3426b13ad53ed8326a735ce29"
] | [
"tests/pattoo_/db/table/test_agent_xlate.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Test pattoo configuration.\"\"\"\n\nimport os\nimport unittest\nimport sys\nfrom random import random\n\n# PIP3\nimport pandas as pd\nfrom sqlalchemy import and_\n\n# Try to create a working PYTHONPATH\nEXEC_DIR = os.path.dirname(os.path.realpath(__file__))\nROOT_DIR = os.path.abspath... | [
[
"pandas.DataFrame"
]
] |
stefansturlu/FederatedMedical | [
"de6bdeb71b7dc0358871e2a4cfea14b042ac52da",
"d753acda850e0d8cf64fc1d5c19e7018494bc16a"
] | [
"datasetLoaders/COVIDx.py",
"classifiers/MNIST.py"
] | [
"import os\nimport sys\nfrom shutil import copyfile\nimport git\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport pydicom as dicom\nfrom PIL import Image\nfrom torchvision import transforms\nfrom logger import logPrint\nfrom datasetLoaders.DatasetLoader import DatasetLoader\nfrom datasetLoaders.DatasetIn... | [
[
"numpy.array",
"pandas.read_csv"
],
[
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.nn.Dropout"
]
] |
Silas-Asamoah/models | [
"426b2c6e894c22ffb17f32581305ea87c3b8b377"
] | [
"research/slim/train_image_classifier.py"
] | [
"# Copyright 2016 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 required... | [
[
"tensorflow.group",
"tensorflow.train.AdagradOptimizer",
"tensorflow.control_dependencies",
"tensorflow.identity",
"tensorflow.app.flags.DEFINE_bool",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.trainable_variables",
"tensorflow.train.latest_checkpoint",
"tensorflo... |
tonygallen/PnP-MACE | [
"b952aa303a50f4701654bcb8ae65a8cb0d24099f"
] | [
"tests/test_utils.py"
] | [
"import numpy as np\n\nfrom pnp_mace import utils\n\n\nclass TestSet:\n\n def setup_method(self, method):\n np.random.seed(12345)\n\n\n def test_stack_init_image(self):\n x = np.random.randn(8, 8)\n y = utils.stack_init_image(x, 2)\n assert np.linalg.norm(x - y[0]) == 0\n as... | [
[
"numpy.random.seed",
"numpy.linalg.norm",
"numpy.random.randn"
]
] |
huynonstop/steganography-jpeg | [
"8f22264b540994320ae723ecf1323ae04119a62a"
] | [
"jpeg_decoder.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\npico baseline JPEG decoder\n\nCopyright (c) 2017 yohhoy\n\"\"\"\n# Code được chỉnh sửa từ nguồn: https://github.com/yohhoy/picojdec\n\nimport math\nimport struct\nimport sys\nimport numpy as np\n\n\n# Marker symbols (X'FFxx')\nMSYM = {'SOF0': 0xC0, 'SOF1': 0xC1, 'SOF2': 0xC2, 'SOF3'... | [
[
"numpy.array",
"numpy.append"
]
] |
samuel930930/Dual-Manifold-Adversarial-Training | [
"8c7fe4fd7a4763f4aaa7ffa10957d3f81ec3f1d6"
] | [
"defenses/defensegan_improved_fimagenet.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\nimport time\nfrom utils.loaders import get_optimizer, get_scheduler, get_generator, get_transform\nfrom utils.losses import PerceptualLoss, per_pixel_l2_dist\nfrom stylegan_old.stylegan_generator_model import StyleGANGeneratorModel\nimport math\nfrom torch import opt... | [
[
"torch.arange",
"torch.enable_grad",
"torch.argmin",
"torch.no_grad",
"torch.repeat_interleave",
"torch.nn.L1Loss",
"torch.randn_like",
"torch.load",
"torch.randn"
]
] |
wenbingl/sklearn-onnx | [
"b18cf687f3ffa5fe7f6d23e2f06f2095da622e26"
] | [
"skl2onnx/operator_converters/NaiveBayes.py"
] | [
"# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n... | [
[
"numpy.issubdtype"
]
] |
schellmi42/graphics | [
"2e705622c2a6b0007347d2db154ccdf5a0eb73d4"
] | [
"tensorflow_graphics/projects/point_convolutions/pylib/pc/custom_ops/custom_ops_wrapper.py"
] | [
"# Copyright 2020 The TensorFlow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"tensorflow.no_gradient",
"tensorflow.RegisterGradient",
"tensorflow.compat.v1.name_scope",
"tensorflow.math.reciprocal"
]
] |
kyle-rgb/Setting_Lines_and_Making_Dimes | [
"e2c3fbf5de80c51879bb0e9ad4f86f37f021d150"
] | [
"src/data/game.py"
] | [
"import os, requests, bs4, pprint, csv, datetime, time\nimport time, re, numpy, unicodedata, concurrent.futures\n\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.orm import Session\nfrom sqlalchemy import Column, Integer, Float, String, Boolean\nimport sqlalchemy as sql\n\nstart_time = tim... | [
[
"numpy.arange"
]
] |
ShabaniLab/DataAnalysis | [
"e234b7d0e4ff8ecc11e58134e6309a095abcd2c0"
] | [
"scripts/squid/JS124S/fit_squid_oscillations.py"
] | [
"# -----------------------------------------------------------------------------\n# Copyright 2019 by ShabaniPy Authors, see AUTHORS for more details.\n#\n# Distributed under the terms of the MIT license.\n#\n# The full license is in the file LICENCE, distributed with this software.\n# -----------------------------... | [
[
"numpy.ones_like",
"numpy.min",
"numpy.concatenate",
"numpy.max",
"numpy.zeros_like",
"numpy.less",
"matplotlib.pyplot.subplots",
"numpy.nonzero",
"numpy.logical_and",
"numpy.argmax",
"numpy.greater",
"matplotlib.pyplot.FuncFormatter",
"numpy.amax",
"numpy.a... |
RaghavPrabhakar66/pytorch | [
"7f364d39ce65e903d7d7c0e02f50455549fa5cf2"
] | [
"test/test_torch.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nimport numpy as np\n\nimport contextlib\nimport gc\nimport io\nimport inspect\nimport itertools\nimport math\nimport random\nimport re\nimport copy\nimport os\nimport tempfile\nimport unittest\nimport warnings\nimport types\nimport pickle\nimport textwrap\nimport subprocess\n... | [
[
"torch.cat",
"torch.nn.MaxPool3d",
"torch.Generator",
"torch.testing.get_all_complex_dtypes",
"torch.cuda.device",
"torch.bmm",
"torch.squeeze",
"torch.load",
"torch.transpose",
"torch.exp",
"torch.testing._internal.common_utils.DeterministicGuard",
"torch.xcorr3",
... |
lillekemiker/pytorch-lightning | [
"6104a6316afb8cdd9825d77844db456ffa766ca1"
] | [
"pytorch_lightning/core/lightning.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch._C._log_api_usage_once",
"torch.no_grad",
"torch.jit.save",
"torch.onnx.export"
]
] |
bsinghpratap/AGGCN | [
"4481e20ed5bdd13362dae478f35c22b7013bbbdf"
] | [
"model/aggcn.py"
] | [
"\"\"\"\nGCN model for relation extraction.\n\"\"\"\nimport copy\nimport math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\n\nfrom model.tree import head_to_tree, tree_to_adj\nfrom utils import constant, torch_utils\n\n\nclass GCNCl... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.ModuleList",
"torch.nn.utils.rnn.pack_padded_sequence",
"numpy.concatenate",
"torch.autograd.Variable",
"numpy.random.randint",
"torch.nn.functional.relu",
"torch.zeros",
"torch.max",
"torch.nn.Sequential",
... |
marschi/tictactoe_ai | [
"bc92c0c49ad12d93dc8fd0fe532df8106ff734b4"
] | [
"game.py"
] | [
"import numpy as np\n\nclass InvalidMoveException(Exception):\n pass\n\nclass GameOverException(Exception):\n pass\n\nclass TicTacToeGame():\n def __init__(self, agent1, agent2):\n # a random player will have the first turn\n self.turn = np.random.randint(2)\n self.agents = [agent1, ag... | [
[
"numpy.array",
"numpy.copy",
"numpy.ones",
"numpy.random.randint",
"numpy.diag",
"numpy.fliplr"
]
] |
edjacob25/MachineLearningTechniques | [
"748d56dd222423ea1270f1b488e938dfe50fe750"
] | [
"Activity1/scopus_extract_attributes.py"
] | [
"import re\nfrom os import listdir\n\nimport pandas as pd\n\nlists = listdir('/Users/jesusllanogarcia/Downloads/Scopus')\ncount = [[] for uni in lists]\n\n# Names for the Table Attributes.\ntop_countries = ['Documents_by_country_top_1', 'Documents_by_country_top_2', 'Documents_by_country_top_3',\n '... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
ggirelli/radiantkit | [
"df3e57dbcda902f4f7b3796e6b8dbbf623ee36b8",
"df3e57dbcda902f4f7b3796e6b8dbbf623ee36b8"
] | [
"radiantkit/series.py",
"radiantkit/conversion.py"
] | [
"\"\"\"\n@author: Gabriele Girelli\n@contact: gigi.ga90@gmail.com\n\"\"\"\n\nimport argparse\nimport itertools\nfrom joblib import cpu_count, delayed, Parallel # type: ignore\nimport logging\nimport numpy as np # type: ignore\nimport os\nimport pandas as pd # type: ignore\nimport pickle\nfrom radiantkit import a... | [
[
"numpy.append",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"pandas.concat",
"numpy.cumsum"
],
[
"numpy.array",
"numpy.squeeze",
"numpy.diff"
]
] |
ammarhakim/gkyl-paper-inp | [
"1736b7ebaddc97099da6b23d5685f7f8680bba69"
] | [
"2017_PoP_Weibel/vm/highT/megauberplot.py"
] | [
"#!/usr/bin/env python\n\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mtick\nimport numpy as np\nimport postgkyl as pg\nimport scipy.optimize as opt\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\n\n#tIdxs = (117, 142)\ntIdxs = (118,)\nq = -1\nx = 80\n\ndef doubleMaxwell(v, n1, u1, t1, n2... | [
[
"scipy.optimize.curve_fit",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.exp",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.style.use",
"numpy.meshgrid"
]
] |
RobotLocomotion/drake-python3.7 | [
"ae397a4c6985262d23e9675b9bf3927c08d027f5"
] | [
"examples/manipulation_station/differential_ik.py"
] | [
"import numpy as np\n\nfrom pydrake.common.eigen_geometry import AngleAxis\nfrom pydrake.manipulation.planner import DoDifferentialInverseKinematics\nfrom pydrake.math import RigidTransform, RollPitchYaw\nfrom pydrake.systems.framework import BasicVector, LeafSystem, PortDataType\n\n\n# TODO(russt): Clean this up a... | [
[
"numpy.zeros"
]
] |
gpleiss/falkon | [
"36aa6713aff8ee6b9ad922d48b07c994fce30559"
] | [
"falkon/optim/conjgrad.py"
] | [
"import time\nfrom typing import Optional\n\nimport torch\n\nfrom falkon.options import ConjugateGradientOptions, FalkonOptions\nfrom falkon.mmv_ops.fmmv_incore import incore_fdmmv, incore_fmmv\nfrom falkon.utils.tensor_helpers import copy_same_stride, create_same_stride\nfrom falkon.utils import TicToc\n\n# More r... | [
[
"torch.cuda.synchronize",
"torch.cuda.device",
"torch.cuda.stream",
"torch.diag",
"torch.cuda.Stream",
"torch.sum"
]
] |
mateusnbm/ai-conveniences | [
"4a0cd0d761f1d534149f9f0ab03f5f94e4290580"
] | [
"conveniences/demo_kmeans.py"
] | [
"#\n# demo_kmeans.py\n#\n\nimport kmeans\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndata = []\nnumber_of_clusters = 5\npoints_per_cluster = 25\n\n\nnp.random.seed(4)\n\n'''\nGenerate random clusters.\n'''\n\nfor _ in range(number_of_clusters):\n\n ages_centroid = np.random.uniform(20.0, 70.0)\n i... | [
[
"numpy.random.normal",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"numpy.random.uniform",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
Joejiong/models-1 | [
"4d7ec517dbb8862d81e58af8be72b2a423ec2aef"
] | [
"PaddleCV/tracking/pytracking/libs/paddle_utils.py"
] | [
"import numpy as np\r\nimport paddle\r\nfrom paddle.fluid import dygraph\r\nfrom paddle.fluid import layers\r\nfrom paddle.fluid.framework import Variable\r\nimport cv2 as cv\r\nPTensor = Variable\r\n\r\n\r\ndef broadcast_op(a, b, op='mul'):\r\n a_expand_factors = []\r\n b_expand_factors = []\r\n assert le... | [
[
"numpy.pad",
"numpy.array",
"numpy.random.uniform"
]
] |
matech96/pose_refinement | [
"ae09785822d748de16f0b986ed158d12e72add26"
] | [
"src/model/videopose.py"
] | [
"# Based on https://github.com/facebookresearch/VideoPose3D\r\n#\r\n# Copyright (c) 2018-present, Facebook, Inc.\r\n# All rights reserved.\r\n#\r\n# This source code is licensed under the license found in the\r\n# LICENSE file in the root directory of this source tree.\r\n#\r\n\r\nimport torch.nn as nn\r\n\r\n\r\nc... | [
[
"torch.nn.Dropout",
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.nn.GroupNorm",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.nn.LocalResponseNorm"
]
] |
jwallen/ChemPy | [
"c8b7a616548d869c30f36c73cbe21084244d7d09"
] | [
"unittest/geometryTest.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy\nimport unittest\nimport sys\nsys.path.append('.')\n\nfrom chempy.geometry import *\n\n################################################################################\n\nclass GeometryTest(unittest.TestCase):\n\n def testEthaneInternalReducedMoment... | [
[
"numpy.array",
"numpy.zeros"
]
] |
orodrigoaraizabravo/quantum | [
"aa1edea0ed8bf15c0f0a6547d765eda8e5a3afd7"
] | [
"tlquantum/tt_gates.py"
] | [
"import tensorly as tl\ntl.set_backend('pytorch')\nfrom torch import rand, randn, cos, sin, complex64, exp, matrix_exp, sqrt, unsqueeze, pi\nfrom torch.nn import Module, ModuleList, ParameterList, Parameter\nfrom tensorly.tt_matrix import TTMatrix\nfrom copy import deepcopy\nfrom .tt_operators import identity\nfrom... | [
[
"torch.cos",
"torch.rand",
"torch.sqrt",
"torch.sin",
"torch.nn.ModuleList",
"torch.nn.Parameter",
"torch.exp",
"torch.randn"
]
] |
CSCI4850/s22-team6-project | [
"8e290f3725fdea79ed62777dd14ecc9f7d670648"
] | [
"Data/Car_Data/testDriver.py"
] | [
"import argparse\nimport base64\nfrom datetime import datetime\nimport os\nimport shutil\nimport cv2\n\nimport numpy as np\nimport socketio\nimport eventlet\nimport eventlet.wsgi\nfrom PIL import Image\nfrom flask import Flask\nfrom io import BytesIO\n\nfrom keras.models import load_model\n\nimport utils\n\nsio = s... | [
[
"numpy.array",
"numpy.float32",
"numpy.asarray"
]
] |
NikolayZakharevich/music-processing | [
"516a3bca585f211d232cac7ede6cc417fb8878fe"
] | [
"cpanel/models/tests/app/classifiers/common_torch.py"
] | [
"import unittest\n\nimport torch\nfrom torch import Tensor\n\nfrom app.classifiers.common_torch import to_prediction_top1, to_prediction_topk, to_prediction_top1_le, \\\n to_prediction_topk_le\nfrom tests.common import data_provider\n\nimport ignite.engine # ignite import bug workaround\nfrom ignite.metrics imp... | [
[
"torch.equal",
"torch.Tensor",
"torch.tensor",
"torch.reshape"
]
] |
venkatesh-sakthivel/deepnet_lab | [
"502b9f4374c4becb98654df89145f4e4256a4ffb"
] | [
"plot_training_curve.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nLOG_FILE = './log.txt'\r\n\r\ndef get_log(log):\r\n\tf = open(log, 'r')\r\n\tlines = f.readlines()\r\n\tf.close()\r\n\r\n\tloss = []\r\n\tfor line in lines:\r\n\t\tloss.append(float(line.strip('\\n').split(' ')[1]))\r\n\r\n\treturn loss\r\n\r\ndef plot_i... | [
[
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
NiSE-Virginia-Tech/doaa-altarawy-LASCAD | [
"d44c9606c4d9a36979195de811575b74648006d5"
] | [
"LASCAD/LDA/runLDA.py"
] | [
"# ***************** Topic Modeling *******************\n# *****************************************************\n\nfrom __future__ import print_function\nimport os\nimport json\nimport sys\nimport time\nfrom os import listdir\nfrom os.path import isdir\n\nfrom sklearn.feature_extraction.text import TfidfVectorize... | [
[
"pandas.reset_option",
"pandas.set_option",
"pandas.DataFrame",
"sklearn.decomposition.LatentDirichletAllocation",
"sklearn.feature_extraction.text.CountVectorizer"
]
] |
ryabhmd/MLinPractice | [
"83be51be7fffccd0949da631d7426ee6a2ae147b"
] | [
"code/feature_extraction/ner_count.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nClass that counts for each tweet how many NE there are and add this as a feature\n\nCreated on Thu Oct 14 11:07:32 2021\n\n@author: rayaabuahmad\n\"\"\"\nimport nltk\nfrom nltk import pos_tag\nimport numpy as np\nfrom code.feature_extraction.feature_extracto... | [
[
"numpy.array"
]
] |
eitieatgithub/wordlistStatisticsPython | [
"d9525ea1215dfc9116905bf4fcf9694b019245ef"
] | [
"github_analyzeCharactersTextfile_chunks.py"
] | [
"\"\"\"\n# MIT License\n\n# Copyright (c) 2021 eitieatgithub\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 the rights\n# to use,... | [
[
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar"
]
] |
yredwood/episodic_tacotron3 | [
"6274f5950b9079ddccc8ae8cbb288460e5e6c1ab"
] | [
"data_utils.py"
] | [
"import random\nimport os\nimport re\nimport numpy as np\nimport torch\nimport torch.utils.data\nimport librosa\n\nimport layers\nfrom utils import load_wav_to_torch, load_filepaths_and_text\nfrom text import text_to_sequence, cmudict\nfrom yin import compute_yin\n\n\nclass TextMelLoader(torch.utils.data.Dataset):\... | [
[
"numpy.array",
"torch.squeeze",
"numpy.unique",
"torch.from_numpy"
]
] |
harrivle/Mirai | [
"70413de690da36c5878e2e6006711476e166bb1d"
] | [
"onconet/models/cumulative_probability_layer.py"
] | [
"import torch\nimport torch.nn as nn\nimport pdb\n\n\n\nclass Cumulative_Probability_Layer(nn.Module):\n def __init__(self, num_features, args, max_followup):\n super(Cumulative_Probability_Layer, self).__init__()\n self.args = args\n self.hazard_fc = nn.Linear(num_features, max_followup)\n... | [
[
"torch.nn.Linear",
"torch.tril",
"torch.ones",
"torch.nn.ReLU",
"torch.t",
"torch.sum"
]
] |
giovp/Tangram | [
"909d70b04ec57b4edaf11bb55b7f44df6c6c227d"
] | [
"tangram/utils.py"
] | [
"\"\"\"\n Utility functions to pre- and post-process data for Tangram.\n\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom collections import defaultdict\nimport gzip\nimport pickle\nimport scanpy as sc\n\nfrom sklearn.model_selection import LeaveOneOut\nfrom sklearn.model_selection import KFold\nfrom comet_m... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.reshape",
"sklearn.model_selection.LeaveOneOut",
"pandas.DataFrame",
"numpy.sum",
"numpy.nanmean",
"numpy.argwhere",
"sklearn.model_selection.KFold",
"numpy.squeeze"
]
] |
ace-gabriel/chrome-extension | [
"be0b7d7278f56f8218be7f734b3fb1e05a4f3eb9"
] | [
"application/utils/esquery.py"
] | [
"from ..models import Area, Neighborhood\nfrom index import app,redis_store,es\nimport json\nfrom .. import settings\n\nfrom pprint import pprint\nimport pandas as pd\nimport math\nfrom numpy import irr\nimport numpy as np\nimport re\n\nclass EsqueryHelper(object):\n 'You can use this class query the complex query... | [
[
"pandas.DataFrame.transpose",
"numpy.pmt",
"numpy.irr",
"numpy.fv",
"pandas.Series"
]
] |
zhoushiwei/3DDFA | [
"4b825b098911f50f8b81a770b89386445b64d916"
] | [
"utils/ddfa.py"
] | [
"#!/usr/bin/env python3\n# coding: utf-8\n\nimport os.path as osp\nfrom pathlib import Path\nimport numpy as np\n\nimport torch\nimport torch.utils.data as data\nimport cv2\nimport pickle\nimport argparse\nfrom .io import _numpy_to_tensor, _load_cpu, _load_gpu\nfrom utils.params import *\n\n\ndef reconstruct_vertex... | [
[
"numpy.concatenate"
]
] |
lizzzi111/Kaggle_Leaf_Disease_Classification | [
"0ff3904164e81cb03ef0054d3574ac5b6cb3d897"
] | [
"codes/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport timm\n\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\nfrom torch.optim.lr_scheduler import CosineAnnealingWarmRestarts, ReduceLROnPlateau\nfrom warmup_scheduler import GradualWarmupScheduler \n\n\n####### MODEL ARCHI... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.cat",
"torch.max",
"torch.nn.BatchNorm2d",
"torch.optim.lr_scheduler.CosineAnnealingWarmRestarts",
"torch.softmax",
"torch.bmm",
"torch.nn.ReLU",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.BatchN... |
jacobandreas/craft | [
"f9cfca81ce7c489c45e853adcf5ece82466b65e3"
] | [
"models/attentive.py"
] | [
"import net\n\nimport numpy as np\nimport tensorflow as tf\n\nN_BATCH = 20\n\nN_HIDDEN = 256\n\nDISCOUNT = 0.9\nEPS = 0.1\nMAX_REPLAY_LEN = 5\nMAX_EXPERIENCES = 10000\n\nclass AttentiveModel(object):\n def __init__(self, config):\n self.experiences = []\n\n def prepare(self, world):\n self.world... | [
[
"tensorflow.train.AdamOptimizer",
"tensorflow.initialize_all_variables",
"numpy.zeros",
"tensorflow.Session",
"tensorflow.nn.rnn_cell.OutputProjectionWrapper",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.reduce_max",
"tensorflow.variable_scope",
"tensorflow.placeholder",
... |
malloc47/matscicut | [
"f76bee105c69e504fc82789c5523346bbd7a1387"
] | [
"scripts/nonhomeomorphism.py"
] | [
"#!/usr/bin/env python\nimport os,sys\nimport numpy as np\nimport scipy\nfrom scipy import ndimage\n\ndef main(*args):\n if(len(args) < 1):\n return 1\n\n l = []\n\n for f in args[1:]:\n labels = np.genfromtxt(f,dtype='int16')\n l.append(labels.max())\n\n total = np.mean(np.array(l)... | [
[
"numpy.array",
"numpy.genfromtxt"
]
] |
huibinshen/autogluon | [
"18c182c90df89762a916128327a6792b8887c5c6"
] | [
"text/src/autogluon/text/automm/optimization/soft_target_crossentropy.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass SoftTargetCrossEntropy(nn.Module):\n \"\"\"\n The soft target CrossEntropy from timm.\n https://github.com/rwightman/pytorch-image-models/blob/e4360e6125bb0bb4279785810c8eb33b40af3ebd/timm/loss/cross_entropy.py\n It works u... | [
[
"torch.nn.functional.log_softmax"
]
] |
data2health/philter-ucsf | [
"19c1e80efb003e0ced48e63f72d2ab3e5b96ba6f"
] | [
"philter_ucsf/improve_i2b2_notes.py"
] | [
"import pandas \nimport xml.etree.ElementTree as ET\nimport sys\nimport argparse\nsys.path\nsys.path.append('/usr/local/lib/python2.7/site-packages/')\nimport xmltodict\nimport os\nimport pandas as pd\nimport re\n\n# This script removes PHI tags that are not PHI (according to HIPAA) from i2b2 annotations\n\ndef ext... | [
[
"pandas.DataFrame"
]
] |
VanessaDo/cloudml-samples | [
"ae6cd718e583944beef9d8a90db12091ac399432",
"ae6cd718e583944beef9d8a90db12091ac399432",
"ae6cd718e583944beef9d8a90db12091ac399432"
] | [
"cloudml-template/template/trainer/featurizer.py",
"tpu/templates/tpu_gan_estimator/trainer_single.py",
"census/estimator/trainer/featurizer.py"
] | [
"#!/usr/bin/env python\n\n# 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#\... | [
[
"tensorflow.feature_column.categorical_column_with_identity",
"tensorflow.feature_column.categorical_column_with_vocabulary_list",
"tensorflow.feature_column.numeric_column",
"tensorflow.feature_column.indicator_column",
"tensorflow.feature_column.categorical_column_with_hash_bucket"
],
[
... |
lzrvch/pyspikelib | [
"b1f09f916291a1cd45c61d7f963c6cfcc611265b"
] | [
"pyspikelib/train_transformers.py"
] | [
"from functools import partial\n\nimport psutil\nimport numpy as np\nimport pandas as pd\nimport tsfresh.utilities.dataframe_functions as tsfresh_utils\nfrom sklearn.base import TransformerMixin\nfrom sklearn.model_selection import StratifiedShuffleSplit\nfrom sklearn.pipeline import Pipeline\nfrom tsfresh import e... | [
[
"numpy.logical_not",
"numpy.append",
"numpy.array",
"numpy.zeros",
"pandas.DataFrame",
"numpy.roll",
"pandas.concat",
"sklearn.model_selection.StratifiedShuffleSplit",
"sklearn.pipeline.Pipeline",
"numpy.vstack"
]
] |
AhmedDesoky91/SDCND-Capstone-Project | [
"fbe907ad37a916d5618387459f32046cd68e54e7"
] | [
"ros/src/tl_detector/tl_detector.py"
] | [
"#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped, Pose\nfrom styx_msgs.msg import TrafficLightArray, TrafficLight\nfrom styx_msgs.msg import Lane\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom light_classification.tl_classifier... | [
[
"scipy.spatial.KDTree"
]
] |
baobunuo/GraphCL | [
"d857849d51bb168568267e07007c0b0c8bb6d869"
] | [
"unsupervised_Cora_Citeseer/models/dgi.py"
] | [
"import torch\nimport torch.nn as nn\nfrom layers import GCN, AvgReadout, Discriminator, Discriminator2\nimport pdb\n\nclass DGI(nn.Module):\n def __init__(self, n_in, n_h, activation):\n super(DGI, self).__init__()\n self.gcn = GCN(n_in, n_h, activation)\n self.read = AvgReadout()\n ... | [
[
"torch.nn.Sigmoid"
]
] |
WittyOrator/Stanford-CS20si | [
"9155e13147d685a59bf9318d781f7bc83ed493ab"
] | [
"assignments/02_style_transfer/load_vgg.py"
] | [
"\"\"\" Load VGGNet weights needed for the implementation in TensorFlow\nof the paper A Neural Algorithm of Artistic Style (Gatys et al., 2016) \n\nCreated by Chip Huyen (chiphuyen@cs.stanford.edu)\nCS20: \"TensorFlow for Deep Learning Research\"\ncs20.stanford.edu\n\nFor more details, please read the assignment ha... | [
[
"numpy.array",
"tensorflow.nn.relu",
"tensorflow.nn.conv2d",
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.nn.avg_pool"
]
] |
faraday/python-word2vec | [
"853651d710908768d392e323db47a8cc23b13ef3"
] | [
"word2vec/wordvectors.py"
] | [
"from __future__ import division, print_function, unicode_literals\n\nimport numpy as np\n\ntry:\n from sklearn.externals import joblib\nexcept:\n joblib = None\n\nfrom word2vec.utils import unitvec\n\n\nclass WordVectors(object):\n\n def __init__(self, vocab, vectors, clusters=None):\n \"\"\"\n ... | [
[
"numpy.delete",
"numpy.dot",
"numpy.empty",
"numpy.add",
"numpy.linalg.norm",
"numpy.array",
"sklearn.externals.joblib.dump",
"sklearn.externals.joblib.load",
"numpy.argsort",
"numpy.all",
"numpy.dtype",
"numpy.rec.fromarrays"
]
] |
sssimonyang/cnvkit | [
"25d91cdb962639c98d041c3b05c7de659c41dc70"
] | [
"cnvlib/fix.py"
] | [
"\"\"\"Supporting functions for the 'fix' command.\"\"\"\nimport logging\n\nimport numpy as np\nimport pandas as pd\n\nfrom . import descriptives, params, smoothing\n\n\ndef do_fix(target_raw, antitarget_raw, reference,\n do_gc=True, do_edge=True, do_rmask=True, do_cluster=False):\n \"\"\"Combine targe... | [
[
"numpy.concatenate",
"pandas.isnull",
"numpy.random.seed",
"numpy.random.permutation",
"numpy.sqrt",
"numpy.argsort",
"numpy.mod",
"numpy.maximum"
]
] |
orcus25/RoboND-Perception-Project | [
"5de3c44a48cbb05fe106f086f779f358d14cfcbd"
] | [
"sensor_stick/scripts/object_recognition.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport sklearn\nfrom sklearn.preprocessing import LabelEncoder\n\nimport pickle\n\nfrom sensor_stick.srv import GetNormals\nfrom sensor_stick.features import compute_color_histograms\nfrom sensor_stick.features import compute_normal_histograms\nfrom visualization_msgs.m... | [
[
"numpy.concatenate",
"sklearn.preprocessing.LabelEncoder"
]
] |
Aaryadeva/class105 | [
"6283775de69d1ce144decc8f24dd3b69f4e32ed2"
] | [
"class2.py"
] | [
"import csv\r\nimport pandas as pd\r\nimport plotly_express as px\r\n\r\nwith open('graphs/class2.csv',newline='') as f:\r\n reader=csv.reader(f)\r\n file_data=list(reader)\r\n#to remove header from CSV\r\nfile_data.pop(0)\r\n\r\ntotal_entries=len(file_data)\r\n\r\ntotal_marks=0\r\n\r\nfor marks in file_data:... | [
[
"pandas.read_csv"
]
] |
stenvala/gpx-analyzer | [
"243812a4d9415c9e5165af58f8580e358c533de5"
] | [
"analyze.py"
] | [
"import gpxpy\nimport gpxpy.gpx\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef parse_gpx(filename):\n distances = [0]\n speeds = [0]\n times = [0]\n with open(filename, 'r') as gpx_file:\n gpx = gpxpy.parse(gpx_file)\n for track in gpx.tracks:\n ... | [
[
"numpy.isnan",
"matplotlib.pyplot.subplots",
"pandas.Series",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
Gaoqunxia/mne-python | [
"71a854d8eafe21676e545d8286b51422f34b26c3"
] | [
"mne/io/tests/test_meas_info.py"
] | [
"# -*- coding: utf-8 -*-\n# # Authors: MNE Developers\n# Stefan Appelhoff <stefan.appelhoff@mailbox.org>\n#\n# License: BSD (3-clause)\n\nimport hashlib\nimport os.path as op\nfrom datetime import datetime, timedelta, timezone\n\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_array_e... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.savetxt",
"numpy.random.RandomState",
"numpy.testing.assert_array_equal",
"numpy.eye",
"numpy.longlong",
"numpy.arange"
]
] |
sgich/HateSpeechDetection | [
"e6e0dd2ca6956cdb496232196ef292b97e96eb04"
] | [
"streamlit_app.py"
] | [
"# This app is for educational purpose only. Insights gained is not financial advice. Use at your own risk!\nimport streamlit as st\nfrom PIL import Image\nimport pandas as pd\nimport base64\nimport matplotlib.pyplot as plt\nfrom bs4 import BeautifulSoup\nimport requests\nimport json\nimport time\nimport tweepy\nim... | [
[
"pandas.to_datetime",
"torch.device",
"torch.sigmoid",
"pandas.DataFrame",
"matplotlib.pyplot.yticks",
"numpy.where",
"torch.tensor",
"pandas.read_csv",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.imshow"
]
] |
raihaan123/AeroSandbox | [
"1e7c78f04b066415f671237a4833ba98901bb9ec"
] | [
"aerosandbox/library/aerodynamics/unsteady.py"
] | [
"import matplotlib.pyplot as plt\nimport aerosandbox.numpy as np\nfrom typing import Union, Callable\nfrom scipy.integrate import quad\n\n\n# Welcome to the unsteady aerodynamics library!\n# In here you will find analytical, time-domain models for the\n# unsteady lift response of thin airfoils. Here is a qu... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"scipy.integrate.quad"
]
] |
szalpal/DALI | [
"06f611eba21eaf74f938c52388a84e873f4abe64"
] | [
"dali/test/python/test_operator_slice.py"
] | [
"# Copyright (c) 2019-2021, NVIDIA CORPORATION & 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# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.... | [
[
"numpy.full",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.random.choice",
"numpy.asarray",
"numpy.zeros",
"numpy.random.seed",
"numpy.testing.assert_array_equal",
"numpy.float32",
"numpy.transpose",
"numpy.random.randint",
"numpy.random.ranf",
"numpy.... |
Cmartin73/tensorflow | [
"70da85b727c960f62af141770827367f9c5c0117"
] | [
"tensorflow/contrib/kfac/python/ops/fisher_blocks.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.python.ops.math_ops.equal",
"tensorflow.python.ops.math_ops.matmul",
"tensorflow.python.ops.math_ops.reduce_sum",
"tensorflow.python.util.nest.flatten",
"tensorflow.python.ops.math_ops.cast",
"tensorflow.python.ops.array_ops.concat",
"numpy.prod",
"tensorflow.python.ops... |
chiluf/visvis.dev | [
"373846ea25044b7ca50f44c63dab4248e14deacd"
] | [
"examples/polarplots.py"
] | [
"#!/usr/bin/env python\n\nimport visvis as vv\nimport numpy as np\n\n# Define angles\nangs = 0.1 + np.linspace(-90, 90, 181) # 0.1+ get rid of singularity\nangsRads = np.pi * angs / 180.0\n\n# Define magnitude\nmag = 10 * np.log10(np.abs(np.sin(10 * angsRads) / angsRads)) + angsRads\nmag = mag - np.max(mag)\n\n# P... | [
[
"numpy.max",
"numpy.linspace",
"numpy.sin"
]
] |
dendisuhubdy/espresso | [
"7085f757e984e2d1ea93807991c1a46479bfc618"
] | [
"espresso/speech_train.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n# Copyright (c) Yiming Wang\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nTrain a new model on one or across multiple GPUs.\n\"\"\"\n\nimport loggi... | [
[
"numpy.random.seed",
"torch.multiprocessing.spawn",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.cuda.is_available"
]
] |
avgupta456/pytorch_geometric | [
"dd1ffc34d2abe441c536cca33cb2be5ff139e3b0"
] | [
"torch_geometric/data/dataloader.py"
] | [
"import torch.utils.data\nfrom torch.utils.data.dataloader import default_collate\n\nfrom torch_geometric.data import Data, Batch\nfrom torch._six import container_abcs, string_classes, int_classes\n\n\nclass Collater(object):\n def __init__(self, follow_batch, exclude_keys):\n self.follow_batch = follow_... | [
[
"torch.utils.data.dataloader.default_collate"
]
] |
nielsolie/simulator | [
"3e7a272aef148571e971c77c95ce4efce9e0a1f5"
] | [
"simulator/plots/plot.py"
] | [
"import os\nimport warnings\nimport json\nimport matplotlib.pyplot as plt\nfrom ..settings import simulator_settings\nfrom .line import Line\n\nclass Plot:\n def __init__(self, path_to_models, sim):\n if not simulator_settings[\"show_plot\"]:\n return\n self.path_to_models = path_to_mod... | [
[
"matplotlib.pyplot.ion",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.ioff"
]
] |
henriqueftogashi/object-detection-tensorflow-swimmingpool | [
"e3db74d8faa8cfd1eef08c43c2b2db21acac4f23"
] | [
"swimmingpool_model/slim/nets/resnet_utils.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n#... | [
[
"tensorflow.pad",
"tensorflow.variable_scope"
]
] |
ChaseMonsterAway/volkscv | [
"aa7e898cc29e3e5f26363e56bf56f4c56574bbd8"
] | [
"volkscv/utils/parser/coco_parse.py"
] | [
"import json\nimport os\nfrom collections import defaultdict\n\nimport numpy as np\n\nfrom .base import BaseParser\nfrom .utils import filter_imgs\n\n\nclass COCOParser(BaseParser):\n \"\"\"Class of parser for COCO data format.\n\n Args:\n anno_path (str): Path of annotation file.\n ignore (bool... | [
[
"numpy.array",
"numpy.zeros"
]
] |
ThorstenGroh/Qcodes | [
"6b9701bf469421fcf2ced58f67c01f69eba9d1f4"
] | [
"qcodes/data/data_array.py"
] | [
"import numpy as np\nimport collections\n\nfrom qcodes.utils.helpers import DelegateAttributes, full_class, warn_units\n\n\nclass DataArray(DelegateAttributes):\n\n \"\"\"\n A container for one parameter in a measurement loop.\n\n If this is a measured parameter, This object doesn't contain\n the data o... | [
[
"numpy.unravel_index",
"numpy.ndarray",
"numpy.array",
"numpy.fromiter"
]
] |
geetickachauhan/relation-extraction | [
"aa920449b20c7127954eaaaa05244e7fc379e018"
] | [
"scripts/main.py"
] | [
"'''\nAuthor: Geeticka Chauhan\nMain file to be run for replicating experiments in this work\n'''\n\n\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport numpy as np\nimport tensorflow as tf\nimport logging\nimport os\nimport sys\nsys.path.append('..')\nimport time\nimport random\nimpo... | [
[
"tensorflow.Graph",
"numpy.mean",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"numpy.std",
"tensorflow.name_scope",
"tensorflow.train.Supervisor"
]
] |
johnugeorge/medperf | [
"5bc3f643064df14e9476bd4d4c1a4c0cce5337d5"
] | [
"examples/DFCI/model2/project/UNETR.py"
] | [
"# This scripts also follows standard Flower tutorial from\n# https://flower.dev/docs/example-pytorch-from-centralized-to-federated.html\n# =======================================================\n\nimport os\nimport matplotlib.pyplot as plt\n\n# import cv2\n\nfrom PIL import Image\nimport numpy as np\nimport nibab... | [
[
"torch.sigmoid",
"torch.is_tensor",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.no_grad",
"numpy.load",
"torch.clamp",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.log",
"... |
kaipak/xarray | [
"9ae7bce99ce33555d2e40e24e9c0ef5047eeef8f"
] | [
"asv_bench/benchmarks/rolling.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\n\nfrom . import parameterized, randn, requires_dask\n\nnx = 3000\nny = 2000\nnt = 1000\nwindow = 20\n\n\nclass Rolling(object):\n def se... | [
[
"numpy.linspace",
"pandas.date_range",
"numpy.arange"
]
] |
alexwitt2399/uav-austin | [
"ba96063f9c95ae02869fd96b8a611bc8a99513b6"
] | [
"third_party/models/regression.py"
] | [
"\"\"\"Taken from detectron2/blob/master/detectron2/modeling/box_regression.py.\n\nThis class is used to get the the regression offsets between boxes and ground truth \nand apply deltas to original anchors.\"\"\"\n\nimport math\n\nimport torch\n\n# Value for clamping large dw and dh predictions. The heuristic is th... | [
[
"torch.stack",
"torch.clamp",
"torch.zeros_like",
"torch.log",
"torch.exp"
]
] |
mywisdomfly/EVDodgeNet | [
"7d53a9c8e0e5883ac8ad2147da5981db5d9ba7a7"
] | [
"code/DataProcessingUtils/FlowEstimationUtils/FlowUtils.py"
] | [
"#!/usr/bin/python\n\"\"\"\n# ==============================\n# flowlib.py\n# library for optical flow processing\n# Author: Ruoteng Li\n# Date: 6th Aug 2016\n# ==============================\n# Taken from: https://github.com/liruoteng/OpticalFlowToolkit/blob/master/lib/flowlib.py\n\"\"\"\nimport png\n# import pfm\... | [
[
"numpy.min",
"numpy.mean",
"numpy.resize",
"numpy.finfo",
"numpy.size",
"scipy.interpolate.griddata",
"matplotlib.pyplot.imshow",
"numpy.max",
"numpy.uint8",
"matplotlib.colors.hsv_to_rgb",
"numpy.arange",
"numpy.sqrt",
"numpy.logical_or",
"numpy.array",
... |
caranha/gdmc_http_client_python | [
"d07c81eaff71094861da9747bbcfcab729610464"
] | [
"acoEngine.py"
] | [
"import numpy as np\nimport lookup\nfrom toolbox import loop3d\nfrom krakenUtils import mdist2d, idx2coord\n\n## PARAMETERS\nFOODGATHERED = 20\nMAXSTEPS = 50\nPHEROMONEDECAY = 0.8\n\n## BLOCK HARDNESS\nIMPASSABLE = (\"minecraft:stone\", \"minecraft:granite\", \"minecraft:diorite\", \"minecraft:andesite\")\nAIR = (\... | [
[
"numpy.array",
"numpy.ones",
"numpy.zeros"
]
] |
nsridhar1/DeepAb | [
"659bad092e1b56ec9f056d9c031900990436200c"
] | [
"deepab/models/AbResNet/train.py"
] | [
"import argparse\nimport os\nfrom tqdm import tqdm\nfrom datetime import datetime\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.data as data\nfrom torch.utils.tensorboard import SummaryWriter\n\nimport deepab\nfrom deepab.models.AbResNet import AbResNet, load_model\nfrom ... | [
[
"torch.zeros",
"torch.device",
"torch.save",
"torch.no_grad",
"torch.manual_seed",
"torch.nn.functional.cross_entropy",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.load",
"torch.exp"
... |
smillerc/fvleg_2d | [
"b79d59807b8b005a25d7cc25a9fe3d192ecd15a0"
] | [
"tests/integrated/energy_source_target_2d/generate_ic.py"
] | [
"import os\nimport sys\nimport json\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pint\nfrom pathlib import Path\n\nsys.path.append(os.path.abspath(\"../../..\"))\nfrom pycato import *\n\ntwo_pi = (2 * np.pi) * ureg(\"radian\")\n\n# Read grid specs from a json file\nwith open(\"grid_spec.json\", \"r\... | [
[
"matplotlib.pyplot.savefig",
"numpy.exp",
"matplotlib.pyplot.subplots",
"numpy.sqrt",
"numpy.abs",
"numpy.cos"
]
] |
oushu1zhangxiangxuan1/feature-engineering | [
"d36f75342d922bd619b0290893ec37c5398b3b29"
] | [
"feature-importance/warm_start_bigdata.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport pandas as pd\nimport numpy as np\nfrom statsmodels.tools import categorical\n\n# https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.ExtraTreesClassifier.html\nfrom sklearn.ensemb... | [
[
"sklearn.feature_selection.RFECV",
"sklearn.ensemble.RandomForestClassifier",
"numpy.sum",
"sklearn.feature_selection.RFE",
"pandas.read_csv",
"sklearn.ensemble.ExtraTreesClassifier"
]
] |
CharleyGuo/tensorflow-workshop | [
"8f4cd5fc03852cc39aa02d05d1b51df6d289330e"
] | [
"workshop_sections/getting_started/xor/xor/xor_summaries.py"
] | [
"# Copyright 2016 Google Inc. All Rights Reserved.\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 applic... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.local_variables_initializer",
"numpy.array",
"tensorflow.summary.scalar",
"tensorflow.expand_dims",
"tensorflow.summary.histogram",
"tensorflow.Graph",
"tensorflow.matmul",
"tensorflow.Variable",
"tensorflow.Session",
"ten... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.