repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
jmackereth/eaglepy | [
"a1d4e621d04fb9312688588a03babd3fd1028be8"
] | [
"eaglepy/h5read.py"
] | [
"import h5py\nimport os\nimport glob\nimport re\nimport numpy as np\nfrom . import peano\nimport warnings\nfrom scipy.integrate import quad\n\nbase_path = os.environ['EAGLE_BASE_PATH']\nrelease = os.environ['EAGLE_ACCESS_TYPE']\n\nclass Snapshot:\n \"\"\" Basic SnapShot superclass which finds the relevant files ... | [
[
"numpy.dot",
"numpy.median",
"numpy.where",
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.eye",
"numpy.fabs",
"numpy.arange",
"numpy.sqrt",
"numpy.log10",
"numpy.cross",
"numpy.mod",
"numpy.array",
"numpy.matrix",
"numpy.percentile",
"numpy.einsum... |
cgangEE/pva-regression4 | [
"4bc79af0d5a6bd964f2f230ab81ec219c285aeda"
] | [
"lib/datasets/imdb.py"
] | [
"# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\nimport os\nimport os.path as osp\nimport PIL\nfrom utils.cy... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.where",
"numpy.arange",
"numpy.sort",
"numpy.hstack",
"numpy.vstack"
]
] |
iMurfyD/poliastro | [
"d4664854683018ea2420efa3f4a11e5e73d1b876"
] | [
"tests/tests_twobody/test_orbit.py"
] | [
"import pickle\n\nimport matplotlib\nimport numpy as np\nimport pytest\nfrom astropy import units as u\nfrom astropy.coordinates import (\n ITRS,\n CartesianDifferential,\n CartesianRepresentation,\n SkyCoord,\n)\nfrom astropy.tests.helper import assert_quantity_allclose\nfrom astropy.time import Time\n... | [
[
"numpy.testing.assert_allclose",
"numpy.testing.assert_array_equal"
]
] |
yongsukki/keraspp | [
"03fd37cad14dba3f270b226621415938ae77f4ec"
] | [
"tf2/ex2_1_ann_mnist_cl.py"
] | [
"##############################################\n# Modeling\n##############################################\nfrom tensorflow.keras import layers, models\n\n\ndef ANN_models_func(Nin, Nh, Nout):\n x = layers.Input(shape=(Nin,))\n h = layers.Activation('relu')(layers.Dense(Nh)(x))\n y = layers.Activation('so... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.keras.layers.Input",
"matplotlib.pyplot.xlabel",
"tensorflow.keras.layers.Activation",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"tensorflow.... |
Neronjust2017/TransferBed | [
"eaa703a4bc10eaf6216fe1394cd272f6e75489e2"
] | [
"dalib/adaptation/dann.py"
] | [
"from typing import Optional\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..modules.grl import WarmStartGradientReverseLayer\nfrom common.modules.classifier import Classifier as ClassifierBase\nfrom common.utils.metric import binary_accuracy\n\n__all__ = ['DomainAdversarialLoss']\n\... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.ones_like",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.binary_cross_entropy",
"torch.nn.Flatten"
]
] |
mitaki28/onnx-chainer | [
"845aa6c168d912ce044183c6dff6f21ce498d17c"
] | [
"tests/functions_tests/test_activations.py"
] | [
"import unittest\n\nimport numpy as np\n\nimport chainer\nimport chainer.functions as F\nimport chainer.links as L\nimport onnx\nimport onnx_chainer\nfrom chainer import testing\nfrom onnx_chainer.testing import test_onnxruntime\n\n\n@testing.parameterize(\n {'name': 'clipped_relu'},\n {'name': 'elu'},\n {... | [
[
"numpy.random.randn",
"numpy.zeros"
]
] |
Ahiganbana/PCLSTM_implement | [
"54ce2d61312700a1ea58c435e4e5e827d847b148"
] | [
"train_model.py"
] | [
"import os\nimport sys\nimport torch\nimport torch.autograd as autograd\nimport torch.nn.functional as F\nimport torch.nn.utils as utils\nimport torch.optim.lr_scheduler as lr_scheduler\nimport shutil\nimport random\nseed_num = 223\ntorch.manual_seed(seed_num)\nrandom.seed(seed_num)\n\n\ndef train(train_iter, dev_i... | [
[
"torch.manual_seed",
"torch.save",
"torch.max"
]
] |
SP12893678/keras-contrib | [
"88e1ea27896fc4d42952b243dad3841b9e449554"
] | [
"keras_contrib/utils/test_utils.py"
] | [
"\"\"\"Utilities related to Keras unit tests.\"\"\"\nimport sys\nimport numpy as np\nfrom numpy.testing import assert_allclose\nimport inspect\n\nimport keras\nfrom keras.layers import Input\nfrom keras.models import Model\nfrom keras import backend as K\n\n\ndef get_test_data(num_train=1000, num_test=500, input_sh... | [
[
"numpy.testing.assert_allclose",
"numpy.random.normal",
"numpy.zeros",
"tensorflow.TensorShape",
"numpy.random.randint",
"numpy.random.random"
]
] |
EOMYS-Public/SciDataTool | [
"dd74504fbed8e4071582981ff8736c37f1c25bdc"
] | [
"SciDataTool/Classes/RequestedAxis.py"
] | [
"# -*- coding: utf-8 -*-\r\n# File generated according to Generator/ClassesRef/RequestedAxis.csv\r\n# WARNING! All changes made in this file will be lost!\r\n\"\"\"Method code available at https://github.com/Eomys/SciDataTool/tree/master/SciDataTool/Methods//RequestedAxis\r\n\"\"\"\r\n\r\nfrom os import linesep\r\n... | [
[
"numpy.array",
"numpy.array_equal"
]
] |
carlo-cor/DRONE-REPOSITORY | [
"dd09640da997c175bab8d73862a254cdb8537283"
] | [
"ColorDetection.py"
] | [
"import cv2\r\nimport numpy as np\r\nimport numpy as npObj\r\n\r\nwidth = 640\r\nheight = 480\r\nwindow = cv2.VideoCapture(0)\r\nwindow.set(3, width)\r\nwindow.set(4, height)\r\n\r\ndef empty(a):\r\n pass\r\n\r\ncv2.namedWindow(\"HSV\")\r\ncv2.resizeWindow(\"HSV\", 640, 240)\r\ncv2.createTrackbar(\"HUE MIN TRACK... | [
[
"numpy.hstack",
"numpy.array"
]
] |
Deech08/whampy | [
"befc8ff0d9d13f397e1d79a793283be2a7fc1eb9"
] | [
"whampy/tests/test_click_map.py"
] | [
"import pytest\nimport matplotlib.pyplot as plt\nimport astropy.units as u\nimport numpy as np\nfrom ..skySurvey import SkySurvey \nfrom unittest.mock import Mock\n\n# Set up the random number generator.\nnp.random.seed(1234)\n\n# Load survey\nsurvey = SkySurvey()\n\nBASELINE_DIR = 'baseline'\n\n@pytest.mark.mpl_im... | [
[
"numpy.random.seed",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.figure"
]
] |
therooler/pennylane | [
"88a8a5960a2ffd218a12f85ace632021eef2abf5"
] | [
"tests/devices/test_default_qubit_torch.py"
] | [
"# Copyright 2018-2021 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by ap... | [
[
"numpy.random.seed",
"numpy.array",
"numpy.sqrt"
]
] |
AshkanTaghipour/ivadomed | [
"84c4e01831265b311c7b053ffdb19fb393fb135d"
] | [
"ivadomed/testing.py"
] | [
"import os\nimport copy\nimport nibabel as nib\nimport numpy as np\nimport torch\nimport torch.backends.cudnn as cudnn\nfrom torch.utils.data import DataLoader, ConcatDataset\nfrom tqdm import tqdm\n\nfrom ivadomed import metrics as imed_metrics\nfrom ivadomed import utils as imed_utils\nfrom ivadomed import visual... | [
[
"torch.utils.data.ConcatDataset",
"numpy.max",
"numpy.array",
"torch.no_grad",
"numpy.stack",
"numpy.arange",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
2014mchidamb/AdversarialChess | [
"90b2d4245d01dcd4065e72eb201da5092d949da9"
] | [
"train_model.py"
] | [
"from model import Magikarp\nimport numpy as np\nimport tensorflow as tf\n\nconfig = {}\nconfig['batch_size'] = 64\nconfig['datafile'] = '../Data/training_data.hdf5'\nconfig['p_datafile'] = '../Data/tal_data.hdf5'\nconfig['full_boards_file'] = '../Data/full_boards.pkl'\nconfig['num_epochs'] = 10\nconfig['save_file'... | [
[
"tensorflow.Session"
]
] |
USDA-VS/vSNP_archive | [
"a08e5db7f0acdf78af947e84181c559d04269d76"
] | [
"vSNP_version1/functions.py"
] | [
"import os\nimport sys\nimport shutil\nimport subprocess\nimport gzip\nimport glob\nimport csv\nimport json\nimport time\nimport regex\nimport re\nimport numpy as np\nimport pandas as pd\nimport zipfile\nimport xlsxwriter\nimport xlrd\nimport pysam\nimport vcf\nimport smtplib\nfrom multiprocessing import Pool\nfrom... | [
[
"numpy.max",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"pandas.read_excel",
"numpy.mean",
"pandas.concat",
"pandas.IntervalIndex.from_arrays",
"pandas.read_csv",
"pandas.Series"
]
] |
keiranrowan/bugle | [
"05c979296a852ee06512aae2897c30216a3cbb31"
] | [
"bugle.py"
] | [
"import pdfkit\nimport jinja2\nimport json\nimport argparse\nimport matplotlib.pyplot as plt\n\n\ndef main():\n # Initialize STDIN Args\n parser = argparse.ArgumentParser(description='Generate Custom Reports from Templates')\n parser.add_argument('template', help='Report template to render')\n parser.ad... | [
[
"matplotlib.pyplot.figure"
]
] |
Sologa/fairseq_extended | [
"ab9b67319c8fd1388a8b9d1df2c7d3f87976af50"
] | [
"fairseq/checkpoint_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport ast\nimport collections\nimport contextlib\nimport logging\nimport os\nimport re\nimport traceback\nfrom collections import O... | [
[
"torch.device",
"torch.save",
"torch.distributed.barrier"
]
] |
peterhabib/BRCAI | [
"c242c662d623010dfb66c9afcb55aeb9cd6c63ed"
] | [
"Scripts/common_scaler.py"
] | [
"import pickle\nimport numpy as np\nfrom sklearn.preprocessing import StandardScaler\n\nimport Scripts\nfrom Scripts import common\n\n\n# Get Scaler\nx_scaler_file_name = common.root_model_folder + 'x_scaler.sav'\ny_scaler_file_name = common.root_model_folder + 'y_scaler.sav'\n\ndef create_scaler(x_values, y_values... | [
[
"numpy.concatenate",
"sklearn.preprocessing.StandardScaler"
]
] |
markm42/plancklens | [
"3d8830d39d52036e318d89ac1fc42083df2c528c"
] | [
"plancklens/qcinv/opfilt_kk.py"
] | [
"\"\"\"lending map Wiener and inverse variance filtering module.\n\nThis is literally the very same spin-0 inverse variance filtering codes than for temperatures,\nwith indices 'tt' replaced with 'pp' and potential to k remapping\n\n\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import print_func... | [
[
"numpy.zeros_like",
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.copy",
"numpy.linalg.eigh",
"numpy.where",
"numpy.arange",
"numpy.transpose",
"numpy.all",
"numpy.diag"
]
] |
swaroop9ai9/Fintech | [
"a101092634bc04fdc56feb36f54552960ae64767"
] | [
"stock_tweet_polarity/stock_tweet_polarity.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Stock Tweet Polarity\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1y7mnum01SwBEvcCXkV4rpLAJpX9WTLXQ\n\nCreated on Sun June 7 20:54:36 2020\n@author: Sm\n\"\"\"\n\nfrom google.colab import drive\nfrom google.c... | [
[
"numpy.array",
"matplotlib.style.use",
"sklearn.linear_model.LinearRegression",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"sklearn.preprocessing.scale",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_... |
DanielDls-exe/mid-project-euro2020 | [
"1eb120b9d19aaf4578cf9b57d0a151de2577e0fc"
] | [
"streamlit/main.py"
] | [
"from nbformat import write\r\nimport streamlit as st\r\nfrom data.get_data import get_all_name_teams, get_team, get_stadistic_team, get_all_name_players, get_player\r\nimport pages\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\nimport pandas as pd\r\nimport plotly.express as px\r\nfrom pages.compar... | [
[
"pandas.DataFrame"
]
] |
williamFalcon/torchbearer | [
"1d30401468f147bfcecb611f37ab3139beaa3649"
] | [
"tests/callbacks/test_cutout.py"
] | [
"from unittest import TestCase\n\nimport torch\n\nimport torchbearer\nfrom torchbearer.callbacks.cutout import Cutout, RandomErase, CutMix\n\n\nclass TestCutOut(TestCase):\n def test_cutout(self):\n random_image = torch.rand(2, 3, 100, 100)\n co = Cutout(1, 10, seed=7)\n state = {torchbearer... | [
[
"torch.rand",
"torch.from_numpy",
"torch.abs",
"torch.randint",
"torch.tensor"
]
] |
vvviet2908/flowrec | [
"b5077421a187ee7952289c5a39abf65ec041a86d"
] | [
"recommendation/efdt_wrapper.py"
] | [
"from skmultiflow.core import BaseSKMObject, ClassifierMixin\r\nfrom skmultiflow.utils import get_dimensions\r\nfrom collections import deque\r\nfrom collections import defaultdict\r\nimport numpy as np\r\nfrom collections import Counter\r\nfrom skmultiflow.trees import HATT\r\nfrom utils.shared_data import SharedD... | [
[
"numpy.array",
"numpy.flatnonzero",
"numpy.argsort",
"numpy.searchsorted",
"numpy.isin"
]
] |
bench-os/bench-os | [
"38ade08e097ca215f7465047dfa70503af11d612"
] | [
"scripts/pslab_context_switching.py"
] | [
"\"\"\"\nThis script retrieves the context switching time between two tasks.\n\"\"\"\nimport serial\nimport signal\nimport _thread\nimport time\nimport matplotlib.pyplot as plt\nimport sys\nfrom PSL import sciencelab\n\nBENCH_CONTEXT_SWITCHING_FLAG = '[BENCH_CONTEXT_SWITCHING]' \nSER = serial.Serial('/dev/ttyUSB0',... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist"
]
] |
ShivamShrirao/contrastive-unpaired-translation | [
"e81611a5bd8b7aee6aedab10aadf9e22a0804a63"
] | [
"models/custom_unet.py"
] | [
"import numpy as np\nimport functools\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\nfrom torch.nn.utils.parametrizations import spectral_norm\nfrom torchvision.models import vgg16_bn\nfrom torchvision.models.feature_extraction import create_feature_extractor\n\n\ndef icnr_init(x, scale... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LeakyReLU",
"torch.nn.init.kaiming_normal_",
"torch.randperm",
"torch.bmm",
"torch.eye",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.CrossEntropyLoss",
"torch.sum",
"torch.nn.MaxPool2d",
"torch.nn.init.constant_",
"torch.nn.... |
zimfv/rat | [
"d1851d8ae5f69c0e12c852ebb191529813c48f13"
] | [
"rat/ratmath.py"
] | [
"import numpy as np\nimport pandas as pd\nimport cvxpy as cp\nfrom scipy.sparse import dok_matrix\n\ndef get_lines(table, name_cols=[], val_cols=None, sort=True):\n \"\"\"\n Returns lines of table. Line is vectored raw.\n \n Parameters:\n -----------\n table : DataFrame\n Table\n ... | [
[
"numpy.concatenate",
"numpy.setdiff1d",
"scipy.sparse.dok_matrix",
"numpy.min"
]
] |
emenriquez/Springboard-Coursework | [
"7ac89a5b8bf7855bcd5cefaa02367134cb81ce8a"
] | [
"Capstone Project 2/Flask App/engines1.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 23 16:37:55 2018\n\n@author: Erik\n\"\"\"\n\n# import packages to read and work with data\nimport pandas as pd\nimport numpy as np\nfrom collections import defaultdict\n\n# Packages for working with text data\nfrom nltk import tokenize\nfr... | [
[
"pandas.read_pickle",
"numpy.zeros",
"numpy.where",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.neighbors.NearestNeighbors"
]
] |
hfzhang31/I-BAU_Adversarial_Unlearning_of-Backdoors_via_implicit_Hypergradient | [
"19195589caf6649a1c874aa0d3b6c708f9c3772f"
] | [
"Warping-based_Backdoor_Attack-release/defenses/neural_cleanse/neural_cleanse.py"
] | [
"from detecting import *\nfrom config import get_argument\nimport numpy as np\nimport sys\nimport json\n\nsys.path.insert(0, \"../..\")\n\n\ndef create_dir(path_dir):\n list_subdir = path_dir.strip(\".\").split(\"/\")\n list_subdir.remove(\"\")\n base_dir = \"./\"\n for subdir in list_subdir:\n b... | [
[
"numpy.ones"
]
] |
jimdowling/Names-To-Nationality-Predicter | [
"49715aa267d48d92358f11401632e0ab22bc5f97"
] | [
"ML Model/src/serializer_test.py"
] | [
"import unittest\nimport math\nimport numpy as np\nfrom serializer import Serializer\n\nclass SerializerTest(unittest.TestCase):\n def test_serialize_example_given_name_should_return_correct_val_1(self):\n self.check_serialized_name(\"Bob Smith\", [2, 15, 2, 0, 19, 13, 9, 20, 8])\n\n def test_serialize... | [
[
"numpy.all"
]
] |
milaan9/Clustering_Algorithms_from_Scratch | [
"ec119a2522dc1dc7b097ecb269912f8d44387dbb"
] | [
"02_Python/K_Means.py"
] | [
"#================================================================================================================\n#----------------------------------------------------------------------------------------------------------------\n#\t\t\t\t\t\t\t\t\tK MEANS CLUSTERING\n#---------------------------------------------... | [
[
"matplotlib.style.use",
"numpy.linalg.norm",
"numpy.sum",
"matplotlib.pyplot.scatter",
"numpy.average",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
franciscocalderon2/incubator-mxnet | [
"3260862c1ea928e99af5517b8e8ce16e670205a9"
] | [
"python/mxnet/symbol/symbol.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.dtype",
"numpy.hypot"
]
] |
ReReMLclub/cord19utils | [
"2392832ddb7e862a9e475da631f30ca614230fa3"
] | [
"cord19utils/visualizations.py"
] | [
"import networkx as nx\nimport holoviews as hv\nimport pandas as pd\nfrom holoviews import opts, dim\nhv.extension('bokeh')\n\ndef drawChordGraph(sgraph, id2label, nodeOfInterest = False):\n nodeData = {\n 'id' : [],\n 'name' : []\n }\n\n edgeData = {\n 'source' : [],\n 'target'... | [
[
"pandas.DataFrame"
]
] |
jobrajac/ca-es | [
"ef9e4d0f06410e86eb380f049d047b224a216bfb"
] | [
"src/pool.py"
] | [
"import numpy as np\n\n\nclass CustomPool:\n \"\"\"Class for storing and providing samples of different stages of growth.\"\"\"\n def __init__(self, seed, size):\n self.size = size\n self.slots = np.repeat([seed], size, 0)\n self.seed = seed\n\n def commit(self, batch):\n \"\"\"... | [
[
"numpy.repeat",
"numpy.random.choice"
]
] |
neale/bsuite | [
"0430d90bc2d74d604f5a2215bc524de4c614d97e"
] | [
"bsuite/experiments/mnist_noise/mnist_noise_test.py"
] | [
"# pylint: disable=g-bad-file-header\n# Copyright 2019 DeepMind Technologies Limited. 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... | [
[
"numpy.random.RandomState"
]
] |
dgiambra/schrodinger | [
"ac1e283242d662f5bab151b46770f21f0ff0bbe0"
] | [
"schrodinger/schrodinger.py"
] | [
"def schrodinger(V_0 , c, n_basis_set, fxn, d_0 , d_1):\n '''\n This function solves Schrodingers wave equation in two dimensions.\n \n Parameters\n ----------\n V_0 : int\n Potential Energy Constant\n \n c : int\n constant\n \n ... | [
[
"numpy.matrix",
"numpy.zeros",
"numpy.exp",
"numpy.linalg.eig",
"numpy.linspace"
]
] |
markf94/reference-qvm | [
"e4ca313928f72b3d2348a3f9abfec6607944c59e"
] | [
"referenceqvm/tests/test_stabilizer_utils.py"
] | [
"\"\"\"\nTest the infrastructure for building a state by projection onto the +1\neigenspace of a set of generators or stabilizers\n\"\"\"\nimport numpy as np\nfrom referenceqvm.stabilizer_utils import (compute_action, project_stabilized_state,\n binary_stabilizer_to_pauli_s... | [
[
"numpy.array",
"numpy.isclose",
"numpy.zeros",
"numpy.allclose",
"numpy.sqrt"
]
] |
RobinAlgayres/beer | [
"15ad0dad5a49f98e658e948724e05df347ffe3b8"
] | [
"beer/priors/gamma.py"
] | [
"'''Implementation of the Gamma distribution.'''\n\nimport torch\nfrom .baseprior import ExpFamilyPrior\n\n\nclass GammaPrior(ExpFamilyPrior):\n '''Gamma distribution.\n\n parameters:\n a: shape\n b: rate\n\n natural parameters:\n eta1 = -b\n eta2 = a - 1\n\n sufficient stati... | [
[
"torch.digamma",
"torch.log",
"torch.lgamma"
]
] |
Fillipedem/quora-insincere-questions | [
"1ad51be239f41958e7b1b51402f189079048dba1"
] | [
"restapi/net.py"
] | [
"import torch.nn as nn\nfrom transformers import DistilBertModel\n\n\nclass DistilBertModelClass(nn.Module):\n\n def __init__(self):\n super(DistilBertModelClass, self).__init__()\n self.distil_bert = DistilBertModel.from_pretrained(\"distilbert-base-uncased\")\n self.linear1 = nn.Linear(76... | [
[
"torch.nn.Linear",
"torch.nn.Sigmoid"
]
] |
MagicUmom/pattern_recognition_project | [
"f47b9d40baad1431ecdc5981bc1118fb228a34b0"
] | [
"face_recognition.py"
] | [
"\"\"\"\n===================================================\nFaces recognition example using eigenfaces and SVMs\n===================================================\n\nThe dataset used in this example is a preprocessed excerpt of the\n\"Labeled Faces in the Wild\", aka LFW_:\n\n http://vis-www.cs.umass.edu/lfw/l... | [
[
"sklearn.datasets.fetch_lfw_people",
"matplotlib.pyplot.title",
"sklearn.decomposition.PCA",
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",... |
hartvjir/detectron2 | [
"3d6cf5f1212ef432358db751e761491d7f60b6d5"
] | [
"ipalm/patch_architecture.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\n\nimport random\n\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.sampler import SubsetRandomSampler\nimport torchvision\nfrom torchvision import transforms\n\nfrom net.mobilenetv3 import MobileNetV3Large, MobileNetV3Small\n# from trainer imp... | [
[
"torch.nn.LocalResponseNorm",
"torch.randn"
]
] |
oskopek/cil | [
"4c1fd464b5af52aff7a0509f56e21a2671fb8ce8"
] | [
"cil/data/datasets.py"
] | [
"import numpy as np\n\nfrom .twitter_dataset import TwitterDataset\n\n\nclass Datasets:\n X_train = None\n X_train_word = None\n y_train = None\n X_eval = None\n X_eval_word = None\n y_eval = None\n X_test = None\n X_test_word = None\n\n word_vocab = None\n inv_word_vocab = None\n\n ... | [
[
"numpy.random.permutation",
"numpy.arange"
]
] |
JayRGopal/CRAFT-pytorch | [
"a4444ef26c44f16c6fd9054dbf6b74e5a161acfe"
] | [
"file_utils.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport numpy as np\nimport cv2\nimport imgproc\n\n# borrowed from https://github.com/lengstrom/fast-style-transfer/blob/master/src/utils.py\ndef get_files(img_dir):\n imgs, masks, xmls = list_files(img_dir)\n return imgs, masks, xmls\n\ndef list_files(in_path):\n img_fi... | [
[
"numpy.array"
]
] |
choobea/quickdraw_mlp | [
"267f9a6225d69c8fbb086b7814066e91fb56b370"
] | [
"quickdraw_multitask_network_trainer.py"
] | [
"import argparse\nimport numpy as np\nimport tensorflow as tf\nimport tqdm\nfrom data_providers import QuickDrawCombinedDataProvider\nfrom network_builder import MultutaskNetworkGraph\nfrom utils.parser_utils import ParserClass\nfrom utils.storage import build_experiment_folder, save_statistics\n\ntf.reset_default_... | [
[
"numpy.empty",
"numpy.random.RandomState",
"tensorflow.get_default_graph",
"tensorflow.reset_default_graph",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.placeholder",
"numpy.append",
"tensorflow.global_variables_initializer"
]
] |
jhamman/xarray-test-docs | [
"c54123772817875678ec7ad769e6d4d6612aeb92"
] | [
"xarray/core/common.py"
] | [
"from __future__ import annotations\n\nimport warnings\nfrom contextlib import suppress\nfrom html import escape\nfrom textwrap import dedent\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Hashable,\n Iterable,\n Iterator,\n Mapping,\n TypeVar,\n overload,\n)\n\nimport numpy ... | [
[
"numpy.asarray",
"pandas.Grouper",
"numpy.nonzero",
"numpy.issubdtype",
"numpy.dtype",
"numpy.unique",
"numpy.full_like"
]
] |
dsctt/ray | [
"29d94a22114b02adfd3745c4991a3ce70592dd16"
] | [
"python/ray/serve/tests/test_util.py"
] | [
"import json\n\nimport numpy as np\nimport pytest\n\nfrom ray.serve.utils import ServeEncoder\n\n\ndef test_bytes_encoder():\n data_before = {\"inp\": {\"nest\": b\"bytes\"}}\n data_after = {\"inp\": {\"nest\": \"bytes\"}}\n assert json.loads(json.dumps(data_before, cls=ServeEncoder)) == data_after\n\n\nde... | [
[
"numpy.array"
]
] |
knu2xs/deep-learning-population-density | [
"7d359920b708c8fd0c03c2c44b1b3eb6224ec3c6"
] | [
"src/deep_learning_population_density/__init__.py"
] | [
"__title__ = 'deep-learning-population-density'\n__version__ = '0.0.0'\n__author__ = 'Esri Advanced Analytics'\n__license__ = 'Apache 2.0'\n__copyright__ = 'Copyright 2020 by Esri Advanced Analytics'\n\n__all__ = ['example_function', 'ExampleObject']\n\n# add specific imports below if you want to organize your code... | [
[
"pandas.read_csv"
]
] |
robfiras/mushroom-rl | [
"b04026fdb6aa0ea4878a410f8b745f28e71d4fef"
] | [
"mushroom_rl/algorithms/value/dqn/rainbow.py"
] | [
"from copy import deepcopy\n\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom mushroom_rl.algorithms.value.dqn import AbstractDQN\nfrom mushroom_rl.algorithms.value.dqn.categorical_dqn import categorical_loss\nfrom mushroom_rl.algorithms.value.dqn.noisy_dqn import NoisyNetwork\nfrom mushroom_rl.appro... | [
[
"torch.nn.functional.softmax"
]
] |
bryanwweber/poliastro | [
"09bf683c62cc2a3454622bb8c0eb071966953a92"
] | [
"tests/tests_twobody/test_events.py"
] | [
"import numpy as np\nimport pytest\nfrom astropy import units as u\nfrom astropy.tests.helper import assert_quantity_allclose\nfrom astropy.time import Time\nfrom numpy.linalg import norm\n\nfrom poliastro.bodies import Earth\nfrom poliastro.constants import H0_earth, rho0_earth\nfrom poliastro.core.events import l... | [
[
"numpy.allclose",
"numpy.array"
]
] |
pedrobcst/Xerus | [
"09df088e0207176df0d20715e1c9778d09d28250"
] | [
"Xerus/GSASII/exports/G2export_csv.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n########### SVN repository information ###################\n# $Date: 2020-08-20 04:53:47 +0900 (木, 20 8月 2020) $\n# $Author: vondreele $\n# $Revision: 4549 $\n# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/exports/G2export_csv.py $\n# $Id: G2export_csv.py ... | [
[
"numpy.array",
"numpy.sqrt",
"numpy.vstack"
]
] |
crwhite14/NASLib | [
"59927f2a9b80de1b1b346e71795fbbcef3b936b8"
] | [
"naslib/optimizers/discrete/ls/optimizer.py"
] | [
"import collections\nimport logging\nimport torch\nimport copy\nimport random\nimport numpy as np\n\nfrom naslib.optimizers.core.metaclasses import MetaOptimizer\n\nfrom naslib.search_spaces.core.query_metrics import Metric\nfrom naslib.search_spaces.nasbench201.graph import NasBench201SearchSpace\nfrom naslib.util... | [
[
"torch.nn.Module",
"torch.nn.ModuleList"
]
] |
RichardoMrMu/repvgg-xgaze | [
"c32e6bb3b9a53848cd407ce54f8b685390f293d9"
] | [
"models/mixer.py"
] | [
"from torch import nn\nfrom functools import partial\nfrom einops.layers.torch import Rearrange, Reduce\n\nclass PreNormResidual(nn.Module):\n def __init__(self, dim, fn):\n super().__init__()\n self.fn = fn\n self.norm = nn.LayerNorm(dim)\n\n def forward(self, x):\n return self.fn... | [
[
"torch.nn.Linear",
"torch.nn.GELU",
"torch.nn.LayerNorm",
"torch.nn.Dropout"
]
] |
jvamvas/sacrerouge | [
"d3938d15d747707cb92067b1f711b775ddaf211e"
] | [
"sacrerouge/commands/stat_sig_test.py"
] | [
"import argparse\nimport functools\nimport json\nimport logging\nimport numpy as np\nimport os\nimport random\nfrom overrides import overrides\nfrom scipy.stats import kendalltau, pearsonr, spearmanr\nfrom typing import Dict, List, Tuple, Union\n\nfrom sacrerouge.commands import RootSubcommand\nfrom sacrerouge.comm... | [
[
"numpy.random.seed"
]
] |
shivamtundele/dirichlet_python | [
"24d90a804b68231724d171e194e7baf91793ea94"
] | [
"dirichletcal/calib/multinomial.py"
] | [
"from __future__ import division\n\nimport logging\n\nimport jax.numpy as np\nimport jax\nimport numpy as raw_np\nfrom sklearn.base import BaseEstimator, RegressorMixin\nfrom sklearn.preprocessing import label_binarize\n\nimport scipy\nimport scipy.optimize\nimport scipy.linalg\n\nfrom ..utils import clip_jax\n\nfr... | [
[
"scipy.optimize.fmin_l_bfgs_b",
"numpy.float",
"numpy.diff",
"scipy.linalg.pinv2",
"numpy.unique",
"sklearn.preprocessing.label_binarize"
]
] |
erdogant/treeplot | [
"2d9ad3096cd7bec99df1b3df165488310bbb1851"
] | [
"tests/test_treeplot.py"
] | [
"import treeplot\nfrom sklearn.ensemble import RandomForestClassifier\nfrom xgboost import XGBClassifier\n\n\ndef test_randomforest():\n X,y = treeplot.import_example()\n model = RandomForestClassifier(n_estimators=100, max_depth=2, random_state=0).fit(X, y)\n # TEST 1: check output is unchanged\n ax = ... | [
[
"sklearn.ensemble.RandomForestClassifier"
]
] |
davidho95/tfmonopoles | [
"e91e95e786d2812763b71266c0494637f2db67f0"
] | [
"monopoleInstanton/expandInstanton.py"
] | [
"\"\"\"\nTakes an instanton configuration as input and returns the same solution on a\nfield twice the size in every direction. There is no change to the lattice\nspacing; the lattice is simply extended in every direction. The number of flux\nquanta in the input solution must be specified as an argument.\n\"\"\"\n\... | [
[
"tensorflow.shape",
"tensorflow.linspace",
"numpy.load",
"tensorflow.meshgrid",
"numpy.save",
"tensorflow.stack",
"tensorflow.pad",
"tensorflow.cast"
]
] |
PeizeSun/caffe2_tutorials | [
"28523ff1ff33f18eaf8b04cc4e0f308826e1861a"
] | [
"py_gen/create_your_own_dataset.py"
] | [
"#########################################################\n#\n# DO NOT EDIT THIS FILE. IT IS GENERATED AUTOMATICALLY. #\n# PLEASE LOOK INTO THE README FOR MORE INFORMATION. #\n#\n#########################################################\n\n\n# coding: utf-8\n\n# # How do I create my own dataset?\n# \n# So Caff... | [
[
"matplotlib.pyplot.plot",
"numpy.random.permutation",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure"
]
] |
MichalKononenko/T1MachineLearning | [
"5eb91aa465825b067d3e5a7c69115fc9b7545e76"
] | [
"distributions/distributions.py"
] | [
"\"\"\"\nContains blueprints for distributions that inherit from the abstract\ndistribution\n\"\"\"\nfrom abstract_distribution import AbstractDistribution\nfrom scipy import stats\nimport numpy as np\nimport abc\n__author__ = 'Michal Kononenko'\n\n\nclass NormalDistribution(AbstractDistribution):\n\n def __init... | [
[
"scipy.stats.uniform",
"scipy.stats.norm",
"numpy.mean"
]
] |
aditi184/ML-Assignment2 | [
"44a8472f6ab4d1aaedd06c8aaaaf3b2f1c1ca569"
] | [
"All_Notebooks_scripts/VGGNet.py"
] | [
"from __future__ import print_function\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nfrom torch.optim.lr_scheduler import StepLR\nfrom torch.utils.data import Dataset, DataLoader\nfrom torch.autograd... | [
[
"torch.nn.Linear",
"torch.optim.lr_scheduler.StepLR",
"torch.nn.BatchNorm2d",
"numpy.load",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel",
"torch.nn.MaxPool2d",
"matplotlib.pyplot.savefig",
"torch.manual_seed",
"torch.device",
"matp... |
Pandinosaurus/cupy | [
"c98064928c8242d0c6a07e2c714e6c811f684a4e"
] | [
"tests/cupyx_tests/scipy_tests/ndimage_tests/test_measurements.py"
] | [
"import warnings\n\nimport numpy\nimport pytest\n\nimport cupy\nfrom cupy.cuda import runtime\nfrom cupy import testing\nfrom cupy import _util\nfrom cupy._core import _accelerator\nimport cupyx.scipy.ndimage # NOQA\n\ntry:\n import scipy.ndimage # NOQA\nexcept ImportError:\n pass\n\n\ndef _generate_binary_... | [
[
"numpy.array",
"numpy.add.reduce",
"numpy.random.RandomState",
"numpy.random.randint",
"numpy.indices"
]
] |
shancarter/umap | [
"dbe311eb024f7cb8e0182edb121771cc5d1e6d8f"
] | [
"umap/tests/test_umap.py"
] | [
"\"\"\"\nTests for UMAP to ensure things are working as expected.\n\"\"\"\nfrom nose.tools import assert_less\nfrom nose.tools import assert_greater_equal\nimport os.path\nimport numpy as np\nfrom scipy.spatial import distance\nfrom scipy import sparse\nfrom scipy import stats\nfrom sklearn.utils.estimator_checks i... | [
[
"numpy.random.choice",
"sklearn.datasets.load_digits",
"numpy.random.seed",
"numpy.random.randn",
"sklearn.utils.testing.assert_array_almost_equal",
"sklearn.metrics.pairwise_distances",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.argsort",
"sklearn.neighbors.KDT... |
wellsguo/DocHub | [
"ff5db051e55e049e4150a553870d52c6c251a76b"
] | [
"Dev/mongodb/createGovtWorkers.py"
] | [
"import pymongo\nimport pprint\nimport numpy as np\nimport datetime\n\nfrom pymongo import MongoClient\n\nnp.random.seed(2) # set seed so everybody running it gets the same data\n\nclient = MongoClient() # connects on default host\n# client = MongoClient('localhost',27017)) # explicit connect command\n\ndb = cli... | [
[
"numpy.random.seed",
"numpy.random.binomial",
"numpy.random.randint"
]
] |
vanduc103/coral_examples | [
"a514d003a3948cb0888d2dabc0bdd93939f8ddd0"
] | [
"opencv/csv_output/detect_2csv.py"
] | [
"# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.minimum",
"numpy.maximum"
]
] |
Omer-Sella/ldpc | [
"955c0bc32236e171365cbbb88f00574302771610"
] | [
"wifiMatrices.py"
] | [
"import numpy as np\nfrom scipy.linalg import circulant\nWIFI_LDPC_DATA_TYPE = np.int64\n\n\nWIFI_1944_81_5_6 = [[13, 48, 80, 66, 4, 74, 7, 30, 76, 52, 37, 60, None, 49, 73, 31, 74, 73, 23, None, 1, 0, None, None],\n[69, 63, 74, 56, 64, 77, 57, 65, 6, 16, 51, None, 64, None, 68, 9, 48, 62, 54, 27, None, 0, 0, None]... | [
[
"numpy.hstack",
"scipy.linalg.circulant",
"numpy.vstack",
"numpy.zeros"
]
] |
peterdsharpe/FastFlow3D | [
"d02c8ff97fa84adcd9db988b09157695d9e2b318"
] | [
"aerosandbox/tools/pretty_plots/plotting_with_uncertainty.py"
] | [
"from aerosandbox.tools.pretty_plots.utilities.natural_univariate_spline import NaturalUnivariateSpline as Spline\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\n\ndef plot_with_bootstrapped_uncertainty(\n x: np.ndarray,\n y: np.ndarray,\n y_stdev: float,\n c... | [
[
"numpy.isnan",
"numpy.nanquantile",
"numpy.random.seed",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.fill_between",
"numpy.sort",
"numpy.abs",
"numpy.linspace"
]
] |
coderrg/Self-Driving-RPi-Car | [
"41392da6356ff733f2c98feb4fe54941e7df7f30"
] | [
"Base Algorithms/Algorithm1.py"
] | [
"#Code written by Rhythm Garg\r\n\r\n'''\r\n###################################################################################\r\n'''\r\nimport numpy as np\r\nimport cv2\r\n\r\n'''\r\n###################################################################################\r\n'''\r\n\r\ndef makeYsGood(lines):\r\n '''... | [
[
"numpy.array",
"numpy.zeros"
]
] |
rsinghlab/SCOT | [
"ddcbd998687f12c76b4a8cb605ed5435471149cc"
] | [
"src/tlb_sinkhorn_solver.py"
] | [
"import torch\nfrom utils_pytorch import l2_distortion, grad_l2_distortion\nimport numpy as np\n\n\nclass TLBSinkhornSolver(object):\n\n def __init__(self, nits, nits_sinkhorn, gradient=False, tol=1e-7, tol_sinkhorn=1e-7):\n self.nits = nits\n self.nits_sinkhorn = nits_sinkhorn\n self.gradie... | [
[
"torch.zeros_like",
"torch.einsum",
"torch.sum"
]
] |
kskuchin/LinkedSV_debug | [
"c912d193ca4490581735c005a7fea1b7ec62c612"
] | [
"scripts/cluster_weird_reads.py"
] | [
"#!/usr/bin/env python\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n\nimport os\nimport sys\nfrom scipy.spatial import *\nfrom scipy.sparse import csr_matrix # csr_matrix\nfrom scipy.sparse.csgraph import connected_components # connected_compon... | [
[
"scipy.sparse.csr_matrix",
"scipy.sparse.csgraph.connected_components"
]
] |
max0x7ba/ray | [
"bc7d2caa93ca1aef52672da166ce7173afbdbb3d"
] | [
"python/ray/data/dataset.py"
] | [
"import logging\nfrom typing import List, Any, Callable, Iterator, Iterable, Generic, TypeVar, \\\n Dict, Optional, Union, TYPE_CHECKING\nfrom uuid import uuid4\n\nif TYPE_CHECKING:\n import pyarrow\n import pandas\n import mars\n import modin\n import dask\n import pyspark\n import ray.util... | [
[
"tensorflow.data.Dataset.from_generator",
"torch.as_tensor",
"numpy.array_split"
]
] |
cwzrad/openvino | [
"ae4bd370eac7c695bd797a31e62317d328dbe742",
"ae4bd370eac7c695bd797a31e62317d328dbe742"
] | [
"model-optimizer/extensions/middle/ConvertGroupedStridedSlice.py",
"model-optimizer/extensions/back/ShuffleChannelPatternOptimization.py"
] | [
"\"\"\"\n Copyright (C) 2018-2020 Intel Corporation\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... | [
[
"numpy.all",
"numpy.any",
"numpy.array"
],
[
"numpy.all",
"numpy.array_equal"
]
] |
Rohde-Schwarz/examples | [
"e0e776d267613b2cabda9b7196c7427aa06a2a73"
] | [
"SignalGenerators/Python/RsSmbv_ScpiPackage/RsSmbv_FileTransferWithProgress_Example.py"
] | [
"\"\"\"Example showing how you can transfer a big file to the instrument and from the instrument with showing the progress.\nSince the SMBV100B is quite fast on data transfer, we slow it down by waiting for 100ms between each chunk transfer (1MB)\nThis way we see the transfer progress better and we do not need a fi... | [
[
"numpy.random.bytes"
]
] |
rkronberg/ncnt-random-forest | [
"d5f055eaf3485a0f2ad6024f6b818ac7ee3410b4"
] | [
"scripts/rndforest.py"
] | [
"'''\nRandom Forest ML implementation for H adsorption on NCNTs.\nIncludes options for randomized hyperparameter search, calculation\nof SHAP values and learning/validation curve generation.\n\nauthor: Rasmus Kronberg\nemail: rasmus.kronberg@aalto.fi\n'''\n\n# Load necessary packages\nimport pandas as pd\nimport nu... | [
[
"sklearn.metrics.mean_squared_error",
"sklearn.model_selection.StratifiedKFold",
"numpy.random.RandomState",
"numpy.mean",
"scipy.stats.randint",
"sklearn.metrics.mean_absolute_error",
"numpy.std",
"sklearn.ensemble.RandomForestRegressor",
"sklearn.metrics.r2_score",
"numpy... |
ehu-ai/domrand | [
"f1f3b901bd29caa575760335c7cc5d5f4a8cf661"
] | [
"domrand/sim_manager.py"
] | [
"import numpy as np\nimport quaternion\nimport skimage\nimport time\nimport os\nimport yaml\n\n\nimport mujoco_py\nfrom mujoco_py import load_model_from_path, MjSim, MjViewer , functions\nfrom mujoco_py.modder import BaseModder, CameraModder, LightModder, MaterialModder\n\nfrom domrand.define_flags import FLAGS\nfr... | [
[
"numpy.quaternion",
"numpy.random.binomial",
"numpy.random.randint",
"numpy.zeros"
]
] |
DeepESP/gpt2-ml | [
"1ee721f50eca62302a4c19e3ff0f3343c45799cf"
] | [
"train/dataloader.py"
] | [
"# Original work Copyright 2018 The Google AI Language Team Authors.\n# Modified work Copyright 2019 Rowan Zellers\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://w... | [
[
"tensorflow.data.TFRecordDataset",
"tensorflow.train.Int64List",
"tensorflow.train.Features",
"tensorflow.FixedLenFeature",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.data.experimental.parallel_interleave",
"tensorflow.constant",
"tensorflow.parse_single_example",
"tens... |
cmbaker00/optimal-test-allocation | [
"b8ad23a0bde7b360ed8e01af6beac5ba441d6322"
] | [
"plotting_code.py"
] | [
"from SimpleModelsModule import TestOptimisation\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport param_values as scenario\n\ndef make_onward_transmission_vector(close_contact, symptomatic, asymptomatic):\n return tuple((close_contact, symptomatic, asymptomatic) for i in range(4))\n\n\ndef make_popul... | [
[
"numpy.array",
"matplotlib.pyplot.text",
"numpy.round",
"matplotlib.pyplot.fill",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.cumsum",
"matplotlib.pyplot.show"
]
] |
x-zho14/Unified-LTH-GNN | [
"edbb2f9aaa7cb363424dcfcb2ce198cfb66f3d55"
] | [
"LinkPrediction/main_gingat_rp.py"
] | [
"\"Implementation based on https://github.com/PetarV-/DGI\"\nimport numpy as np\nimport scipy.sparse as sp\nimport torch\nimport torch.nn as nn\nfrom models import LogReg, GIC_GCN, GIC_GAT, GIC_GIN\nfrom utils import process\nimport argparse\nimport pdb\nimport pruning\nimport pruning_gin\nimport pruning_gat\nimpor... | [
[
"torch.zeros",
"torch.cat",
"numpy.random.permutation",
"torch.no_grad",
"torch.FloatTensor",
"torch.ones",
"torch.nn.BCELoss",
"torch.nn.BCEWithLogitsLoss"
]
] |
Kokookster/NTPoly | [
"a08ed06b39eca9100364d4a7fa59292d8d2f80dd"
] | [
"Examples/OverlapMatrix/visualize.py"
] | [
"\"\"\"\nVisualize two matrices side by side.\n\"\"\"\nimport matplotlib.pyplot as plt\nfrom scipy.io import mmread\n\n###############################################################################\nif __name__ == \"__main__\":\n input_mat = mmread(\"input.mtx\")\n output_mat = mmread(\"output.mtx\")\n pl... | [
[
"matplotlib.pyplot.show",
"scipy.io.mmread",
"matplotlib.pyplot.subplot"
]
] |
vfilimonov/pandas | [
"b3d1a059fd86577b46f080c3bd3661597530587f"
] | [
"pandas/tests/test_groupby.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nimport nose\n\nfrom numpy.testing.decorators import slow\n\nfrom datetime import datetime\nfrom numpy import nan\n\nfrom pandas import date_range,bdate_range, Timestamp\nfrom pandas.core.index import Index, MultiIndex, Int64Index\nfrom pandas.core.api... | [
[
"numpy.array_equal",
"numpy.tile",
"pandas.compat.OrderedDict",
"pandas.core.common.pprint_thing",
"pandas.util.testing.getSeriesData",
"numpy.random.random",
"pandas.compat.lzip",
"numpy.empty",
"numpy.log",
"pandas.compat.iteritems",
"pandas.DataFrame",
"pandas.ut... |
muhrin/aiida-vasp | [
"641fdc2ccd40bdd041e59af1fa3e1dcf9b037415"
] | [
"aiida_vasp/utils/bands.py"
] | [
"\"\"\"\nUtils for bands structures.\n\n---------------------------\nUtilities for working with band structures. Currently this is legacy and will be\nrewritten or moved.\n\"\"\"\ntry:\n import matplotlib\n matplotlib.use('TKAgg')\n from matplotlib import pyplot as plt\nexcept ImportError:\n raise Impor... | [
[
"matplotlib.use",
"numpy.empty",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks"
]
] |
kieranboyce/asl-ml-immersion | [
"097c31009af9c5b6708b45e25f742a3052e2c3d6"
] | [
"notebooks/kubeflow_pipelines/pipelines/solutions/pipeline/helper_components.py"
] | [
"# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"pandas.read_csv",
"sklearn.metrics.recall_score",
"sklearn.metrics.accuracy_score"
]
] |
ramseylab/cerenkov3 | [
"c7746d80516bc847d0355cda09f5407291e0f952"
] | [
"cerenkov3_data/util_uscs.py"
] | [
"import pandas as pd\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.engine.url import URL\nfrom sqlalchemy.pool import NullPool\n\n_REGULAR_CHR = {\"chr{}\".format(x) for x in (list(range(1, 23)) + [\"X\", \"Y\"])} # range(1,23) = 1,2,...,22\n\n\nclass GenomeBrowserClient:\n # If you are going to use th... | [
[
"pandas.concat"
]
] |
Addy81/BroadWork | [
"9af5316b52154f389f6e84078efc9d37c41cdba4"
] | [
"bin/vcf_compare_GQ_test.py"
] | [
"#!/usr/bin/python3\n#\n#\n#\n#\n# Adriana Toutoudaki (September 2019) contact: atoutoud@broadinstitute.org\n\nimport vcf\nimport os, sys\nimport numpy as np\nfrom vcf.utils import walk_together\n\nclass Comparison:\n\n def __init__(self):\n self.matches = 0\n self.diff_metrics = 0\n self.di... | [
[
"numpy.histogram"
]
] |
mbursa/sim5 | [
"b2f244799b64540de10333eecb631aa316af845b"
] | [
"python/sim5diskspectrum.py"
] | [
"# Spectral models for local emission of accretion disks.\n#\n# Module provides classes that define spectral model for radiation\n# emerging from an accretion disk.\n# \n# This file is a part of SIM5 library. \n# See README and LICENCE file for details.\n\n\nfrom __future__ import division\nimport sys\nimport numpy... | [
[
"numpy.exp",
"numpy.errstate"
]
] |
ujos89/DualRL | [
"0833c0885a29de477f3af6c5f9b871cca64c068a"
] | [
"utils/vocab.py"
] | [
"\"\"\"Standalone script to generate word vocabularies from monolingual corpus.\"\"\"\n\nimport argparse\n\nfrom utils import constants\nfrom opennmt import tokenizers\nfrom opennmt import utils\nimport tensorflow as tf\n\n\ndef build_vocab_from_file(src_file, save_path, min_frequency=5, size=0, without_sequence_to... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.Session",
"tensorflow.tables_initializer",
"tensorflow.contrib.lookup.index_table_from_file",
"tensorflow.global_variables_initializer"
]
] |
manisharmagarg/qymatix | [
"0dc240970359429ae5105db79f9aebf1a99ba6fd"
] | [
"api/qymatix/analytics/new_insights.py"
] | [
"import datetime\nimport logging\n\nimport numpy as np\n\nfrom api.infrastructure.mysql import connection\nfrom api.qymatix import results\nfrom api.qymatix.analytics.performance_analytics import kam\nfrom api.qymatix.analytics.performance_analytics import multiparam\nfrom api.qymatix.analytics.sales_analytics impo... | [
[
"numpy.busday_count"
]
] |
Menosse/python-programmer | [
"101ae0449478f4d266ce8b24ae67f409268b8ac9"
] | [
"1. Spyder python files/practice/sierpinski_triagle.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 19 10:25:58 2020\n\n@author: Fernando\n\nCreate triagles inside triagles by transforming it:\n transformation 1:\n xn+1 = 0.5xn\n yn+1 = 0.5yn\n transformation 2:\n xn+1 = 0.5xn + 0.5\n yn+1 = 0.5yn + 0.5\n transformation 3:\n... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.rc"
]
] |
bsunnquist/jwql | [
"b7623ef81b4aae3d598265b703bc0166e2c1d551"
] | [
"jwql/website/apps/jwql/data_containers.py"
] | [
"\"\"\"Various functions to collect data to be used by the ``views`` of the\n``jwql`` app.\n\nThis module contains several functions that assist in collecting and\nproducing various data to be rendered in ``views.py`` for use by the\n``jwql`` app.\n\nAuthors\n-------\n\n - Lauren Chambers\n - Matthew Bourque\... | [
[
"numpy.sum"
]
] |
Luo1916/frds | [
"b348a3ce5ee0b7e4bf85d6f114e1feffa431beda"
] | [
"frds/data/utils.py"
] | [
"\"\"\"Some utility functions\"\"\"\r\n\r\nimport numpy as np\r\n\r\n\r\ndef filter_funda(funda: np.recarray) -> np.recarray:\r\n \"\"\"Standard filter on the `wrds.comp.funda` dataset\r\n\r\n Parameters\r\n ----------\r\n funda : np.recarray\r\n `wrds.comp.funda` dataset\r\n\r\n Returns\r\n ... | [
[
"numpy.in1d"
]
] |
zhawhjw/Tool_Functions | [
"c462a1466fd2540211f72d234cb59c50602c8f6d"
] | [
"Tool_Functions/twitter-sentiment-analysis/Stanford_Tokenize.py"
] | [
"import json\nimport pandas as pd\nimport string\nimport nltk\nfrom nltk.tokenize.stanford import StanfordTokenizer\nfrom nltk.tag import StanfordPOSTagger\nfrom nltk import word_tokenize\nimport os\n\n# stop words to remove from text\nnltk.download(\"stopwords\")\n# also removing @ in this case since Stanford Toke... | [
[
"pandas.read_json",
"pandas.Series"
]
] |
mdjabc/hyperparameter_hunter | [
"bfbd1faf63272a62e6f971d7e9a0487d71aea8f6"
] | [
"examples/xgboost_examples/regression.py"
] | [
"from hyperparameter_hunter import Environment, CVExperiment\nfrom hyperparameter_hunter import GBRT, Real, Integer, Categorical\nimport pandas as pd\nfrom sklearn.datasets import load_diabetes\nfrom xgboost import XGBRegressor\n\n#################### Format DataFrame ####################\ndata = load_diabetes()\nt... | [
[
"pandas.DataFrame",
"sklearn.datasets.load_diabetes"
]
] |
elyqg/ross | [
"1806842c9cf13482c6054e214a9918e613cb380d"
] | [
"ross/rotor_assembly.py"
] | [
"# fmt: off\nimport os\nimport shutil\nimport warnings\nfrom collections import Counter, namedtuple\nfrom collections.abc import Iterable\nfrom copy import copy, deepcopy\nfrom itertools import chain, cycle\nfrom pathlib import Path\n\nimport bokeh.palettes as bp\nimport matplotlib as mpl\nimport matplotlib.pyplot ... | [
[
"numpy.ones_like",
"scipy.signal.lsim",
"numpy.exp",
"numpy.mean",
"numpy.min",
"scipy.signal.lti",
"pandas.concat",
"numpy.imag",
"numpy.logspace",
"scipy.linalg.solve",
"numpy.max",
"numpy.zeros_like",
"numpy.angle",
"numpy.eye",
"scipy.linalg.eig",
... |
hexiang-hu/cs231n-practice | [
"42c9ea3ff1fafd8dce7838c9afbb06a071292bfd"
] | [
"hw1/cs231n/classifiers/k_nearest_neighbor.py"
] | [
"import numpy as np\n\nclass KNearestNeighbor:\n \"\"\" a kNN classifier with L2 distance \"\"\"\n\n def __init__(self):\n pass\n\n def train(self, X, y):\n \"\"\"\n Train the classifier. For k-nearest neighbors this is just \n memorizing the training data.\n\n Input:\n X - A num_train x dimens... | [
[
"numpy.bincount",
"numpy.zeros",
"numpy.sum",
"numpy.argmax",
"numpy.argsort"
]
] |
remiadon/scikit-mine | [
"769d7d5ea0dda5d4adea33236733f4ce1ea0c815"
] | [
"skmine/utils.py"
] | [
"\"\"\"\nutils functions\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom sortedcontainers import SortedList\n\n\ndef _check_random_state(random_state):\n if random_state is None or isinstance(random_state, int):\n random_state = np.random.RandomState(random_state)\n elif not isinstance(random_... | [
[
"pandas.DataFrame",
"numpy.random.RandomState"
]
] |
YunchuZhang/Visually-Grounded-Library-of-Behaviors-for-Generalizing-Manipulation-Across-Objects-Configurations- | [
"896afda942dfc04e4aaad2ee751c32df1eb17913"
] | [
"pytorch_disco/model.py"
] | [
"import os\nimport time\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport copy\n# from torch.utils.tensorboard import SummaryWriter\nfrom tensorboardX import SummaryWriter\nfrom backend import saverloader, inputs\nfrom backend.inputs import MuJoCoOfflineData\n# from b... | [
[
"torch.stack",
"numpy.set_printoptions",
"numpy.load",
"numpy.mean",
"torch.cuda.is_available",
"torch.reshape",
"numpy.concatenate",
"matplotlib.pyplot.subplots",
"torch.zeros_like",
"numpy.mod",
"matplotlib.use",
"torch.device",
"numpy.array",
"numpy.resha... |
CSMdevs/Picton | [
"943b9c2fdcee971491b10ddd075b8e32e983fb48"
] | [
"train.py"
] | [
"import tensorflow as tf \nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D\nimport pickle\nfrom keras.models import model_from_json\nfrom keras.models import load_model\nimport matplotlib.pyplot as plt\n\n# Opening the fil... | [
[
"tensorflow.keras.layers.Flatten",
"matplotlib.pyplot.xlabel",
"tensorflow.keras.layers.Activation",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Dropout",... |
rsiverd/ultracool | [
"cbeb2e0e4aee0acc9f8ed2bde7ecdf8be5fa85a1"
] | [
"02_clean_all_spitzer.py"
] | [
"#!/usr/bin/env python\n# vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 :\n#\n# Clean CBCD Spitzer images by removing cosmic rays and/or removing\n# large-scale background.\n#\n# NOTE: This script assumes a directory structure as created by the\n# related fetch_sha_data.py script. Specifically, the images to... | [
[
"numpy.median",
"numpy.isnan",
"numpy.isinf",
"numpy.__version__.split"
]
] |
YosephKS/qiskit-terra | [
"3a8e289a26073b16e9bf434b5b2e13cab78b0fa7"
] | [
"test/python/qobj/test_pulse_converter.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio... | [
[
"numpy.arange"
]
] |
varshakirani/thesis | [
"73e832688bac32d89bd4c2f563db8cf980b22712"
] | [
"src/visualization.py"
] | [
"import os\nimport json\nfrom argparse import ArgumentParser\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom numpy import array\nfrom statistics import mean\n\n\n\ndef parse_options():\n parser = ArgumentParser()\n parser.add_argument(\"-o\", \"--output\", required=False,\n d... | [
[
"numpy.array",
"matplotlib.pyplot.get_current_fig_manager",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
]
] |
UBCDingXin/RepDistiller | [
"dcc043277f2820efafd679ffb82b8e8195b7e222"
] | [
"helper/loops.py"
] | [
"from __future__ import print_function, division\n\nimport sys\nimport time\nimport torch\n\nfrom .util import AverageMeter, accuracy\n\n\ndef train_vanilla(epoch, train_loader, model, criterion, optimizer, opt):\n \"\"\"vanilla training\"\"\"\n model.train()\n\n batch_time = AverageMeter()\n data_time ... | [
[
"torch.no_grad",
"torch.cuda.is_available"
]
] |
xlrshop/Parl | [
"5171ed0a3b555846cb5174c99bc6faace3ac1d99"
] | [
"parlai/core/pytorch_data_teacher.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\"\"\"\n (NOTE... | [
[
"torch.utils.data.sampler.RandomSampler",
"torch.multiprocessing.Lock",
"torch.multiprocessing.Value",
"torch.utils.data.sampler.SequentialSampler",
"torch.utils.data.DataLoader"
]
] |
Mohamed-Hamdy/Brain-Tumor-segmentation | [
"183c7b4047f0270ec2b50ec2c17e855e1ce08ac9"
] | [
"Code/GUI.py"
] | [
"\r\nimport sys\r\n\r\nimport imageio\r\nimport nibabel as nib\r\nimport PIL\r\nfrom tkinter import filedialog\r\nimport PIL.Image, PIL.ImageTk\r\nfrom glob import glob\r\n\r\nsys.path.append('..')\r\n\r\ntry:\r\n import Tkinter as tk\r\nexcept ImportError:\r\n import tkinter as tk\r\n\r\ntry:\r\n import t... | [
[
"numpy.uint8",
"numpy.zeros_like",
"numpy.asarray",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.shuffle",
"numpy.flipud",
"numpy.where",
"numpy.dstack",
"numpy.unique"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.