repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
mialona/Stomatal-segmentation
[ "149d469ec572c41a13d62149d7d62d6805d19697" ]
[ "E03 - Learning programs and models/Architectures/models/backbones/hrnet.py" ]
[ "import os\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport logging\n\nimport numpy as np\n\nfrom typing import List\n\nfrom .build import BACKBONE_REGISTRY\n\nBN_MOMENTUM = 0.01\nlogger = logging.getLogger(__name__)\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 conv...
[ [ "torch.nn.Sequential", "torch.cat", "torch.load", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.Identity", "torch.nn.init.normal_", "torch.nn.functional.interpolate", "torch.nn.ReLU", "numpy.sum" ] ]
irvifa/tensorflow
[ "b5973195532a786343de6a4278322056574b207c" ]
[ "tensorflow/tools/api/tests/api_compatibility_test.py" ]
[ "# Lint as: python2, python3\n# Copyright 2015 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/...
[ [ "tensorflow.python.platform.resource_loader.get_path_to_datafile", "tensorflow.python.platform.tf_logging.warning", "tensorflow.python.platform.tf_logging.error", "tensorflow.python.platform.tf_logging.info", "tensorflow.python.lib.io.file_io.read_file_to_string", "tensorflow.tools.common....
empty16/hardnet.pytorch
[ "39242bc1db52ec13a3b07d92ff2559809ac0a557" ]
[ "hardnet/pytorch_sift.py" ]
[ "import torch\nimport math\nimport torch.nn.init\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.backends.cudnn as cudnn\nimport numpy as np\nimport torch.nn.functional as F\nfrom Utils import L2Norm\n\ndef getPoolingKernel(kernel_size = 25):\n step = 1. / float(np.floor( kernel_size / ...
[ [ "torch.nn.functional.pad", "numpy.hstack", "numpy.maximum", "torch.floor", "torch.cat", "torch.sqrt", "numpy.arange", "torch.nn.Conv2d", "numpy.floor", "numpy.outer", "numpy.array", "numpy.zeros", "torch.atan2", "torch.autograd.Variable" ] ]
Rahul-chunduru/meanfield-theory-of-activation-functions
[ "97abc52b25d7a57dc75ce21dcccc419f58a393d4" ]
[ "TF/esp_tf_utils.py" ]
[ "\"\"\"\nHelper functions for FFN with ESP\n=================================================================\nAuthor: Mirco Milletari <mirco@bambu.life> (2018)\n\nTensorflow implementation of a Feed Forward Deep network with ESP\nactivation, as defined in\n\n\"Expectation propagation: a probabilistic view of Deep ...
[ [ "tensorflow.concat", "numpy.squeeze", "tensorflow.equal", "tensorflow.cast", "tensorflow.train.AdamOptimizer", "tensorflow.Variable", "tensorflow.greater", "numpy.unique", "tensorflow.gradients", "tensorflow.train.exponential_decay", "tensorflow.subtract", "tensorfl...
benw1/WINGS
[ "32d4bfd073da0b86d2340cde25a5601d0a1ec95e" ]
[ "archive/scripts/STIPS_Input_from_Sims/wingtips.py" ]
[ "#! /usr/bin/env python\n'''\nWFIRST Infrared Nearby Galaxies Test Image Product Simulator\nProduces input files for the WFIRST STIPS simulator\n'''\nimport time\nimport numpy as np\nfrom astropy import wcs\nfrom astropy.io import fits, ascii\nfrom astropy.table import Table\n\nclass WingTips:\n '''\n Initial...
[ [ "numpy.hstack", "numpy.ones_like", "numpy.linspace", "numpy.delete", "numpy.log10", "numpy.insert", "numpy.random.rand", "numpy.array", "numpy.vstack", "numpy.random.randint" ] ]
davidiommi/MONAI_0_7_0
[ "c288dd065ab18aaf018ea01b54f3ec515e6444dd" ]
[ "monai/transforms/croppad/array.py" ]
[ "# Copyright 2020 - 2021 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre...
[ [ "numpy.maximum", "numpy.pad", "numpy.asarray", "torch.zeros_like", "numpy.stack", "torch.as_tensor" ] ]
jaehyek/deformable-DETR-2
[ "7f1f4ffd1d716f681c7cbb2570e2c7a3d4bcf417" ]
[ "models/.ipynb_checkpoints/position_encoding-checkpoint.py" ]
[ "\n\"\"\"\nVarious positional encodings for the transformer.\n\"\"\"\nimport math\nimport torch\nfrom torch import nn\n\nfrom util.misc import NestedTensor\n\n\nclass PositionEmbeddingSine(nn.Module):\n \"\"\"\n This is a more standard version of the position embedding, very similar to the one\n used by th...
[ [ "torch.nn.init.uniform_", "torch.cat", "torch.nn.Embedding", "torch.arange" ] ]
AcharyaRakesh/Baldness-Prediction
[ "f97c3bf1f068b167405f3bc711a7f6630905da2e" ]
[ "app.py" ]
[ "\r\nfrom main import load_model\r\n\r\nmodel = load_model('model.h5')\r\n\r\nimport numpy as np\r\nfrom tensorflow.keras.preprocessing import image\r\ntest_image = image.load_img('',target_size=(64,64) )\r\ntest_image = image.img_to_array(test_image)\r\ntest_image = test_image/255\r\ntest_image=np.expand_dims(test...
[ [ "numpy.expand_dims", "tensorflow.keras.preprocessing.image.img_to_array", "tensorflow.keras.preprocessing.image.load_img" ] ]
rockenbf/ze_oss
[ "ee04158e2d51acb07a267196f618e9afbc3ffd83" ]
[ "ze_trajectory_analysis/py/ze_trajectory_analysis/consistency_single_run.py" ]
[ "#!/usr/bin/python3\n\"\"\"\nZurich Eye\n\"\"\"\n\nimport os\nimport yaml\nimport logging\nimport argparse\nimport numpy as np\nimport ze_trajectory_analysis.analyse as traj_analysis\nimport ze_py.transformations as tf\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport vikit_py.transfo...
[ [ "numpy.sqrt", "numpy.reshape", "numpy.linalg.inv", "numpy.finfo", "numpy.concatenate", "matplotlib.gridspec.GridSpec", "numpy.transpose", "matplotlib.ticker.FuncFormatter", "numpy.zeros", "matplotlib.rc", "matplotlib.pyplot.figure" ] ]
eriknw/xray
[ "19df8d202b1d8054019e7e42365c67cdde6ff448" ]
[ "xray/backends/common.py" ]
[ "import numpy as np\nimport itertools\n\nfrom collections import Mapping\n\nfrom ..core.utils import FrozenOrderedDict\nfrom ..core.pycompat import iteritems\nfrom ..core.variable import Coordinate\n\n\nNONE_VAR_NAME = '__values__'\n\n\ndef _encode_variable_name(name):\n if name is None:\n name = NONE_VAR...
[ [ "numpy.arange", "numpy.any" ] ]
nsobczak/tic-tac-toe
[ "6b44ed29bdba4d9ddaa680591c8cc6aa9e06f22e" ]
[ "main.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n###############\r\n# tic-tac-toe #\r\n###############\r\nCreated on Tue Apr 14 17:08:22 2015\r\n\r\n@author: Nicolas Sobczak\r\n\"\"\"\r\n\r\n# %%____________________________________________________________________________________________________\r\n# Config\r\n\r\n# Import\r\...
[ [ "numpy.array" ] ]
ShivangiPatel102/Python_and_the_Web
[ "6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2" ]
[ "Scripts/Miscellaneous/Automatic Birthday Wisher/main.py" ]
[ "# import required packages\nimport pandas as pd\nimport datetime\nimport smtplib\n\n# your gmail credentials here\nGMAIL_ID = \"Your-Gmail-Id\"\nGMAIL_PWD = \"Your-Gmail-Password\"\n\n# function for sending email\ndef sendEmail(to, sub, msg):\n # conncection to gmail\n gmail_obj = smtplib.SMTP(\"smtp.gmail.c...
[ [ "pandas.read_excel" ] ]
mpu-creare/ipyvolume
[ "ad7eca3a994fad9532a0c3eb52223c10eb4ee586" ]
[ "ipyvolume/test_all.py" ]
[ "from __future__ import absolute_import\nimport ipyvolume\nimport ipyvolume.pylab as p3\nimport ipyvolume as ipv\nimport ipyvolume.examples\nimport ipyvolume.datasets\nimport ipyvolume.utils\nimport ipyvolume.serialize\nimport numpy as np\nimport os\nimport shutil\nimport json\nimport pytest\n\n\n# helpful to remov...
[ [ "numpy.random.random", "numpy.meshgrid", "numpy.asarray", "numpy.arange", "numpy.random.rand", "numpy.array", "numpy.zeros" ] ]
yongjin-shin/homework
[ "0ec67386066be1b1499565d715b6b99dd39954e9" ]
[ "hw3/dqn.py" ]
[ "import uuid\nimport time\nimport pickle\nimport sys\nimport gym.spaces\nimport itertools\nimport numpy as np\nimport random\nimport tensorflow as tf\nimport tensorflow.contrib.layers as layers\nfrom collections import namedtuple\nfrom dqn_utils import *\n\nOptimizerSpec = namedtuple(\"OptimizerSpec\", [\"construct...
[ [ "tensorflow.reduce_max", "tensorflow.get_collection", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.placeholder", "numpy.mean", "tensorflow.one_hot", "numpy.random.randn", "tensorflow.variable_scope", "tensorflow.group" ] ]
rosenbrockc/dft
[ "39193cc4c4ac6b151b7ee98f34adb609e412acb4" ]
[ "pydft/geometry.py" ]
[ "\"\"\"Methods and classes for storing and manipulating the global\ngeometry of the physical problem.\n\"\"\"\nimport numpy as np\nfrom pydft.base import testmode\ncell = None\n\"\"\"Cell: default geometry to use globally throughout the code when no other\ngeometry is explicitly specified.\n\"\"\"\ndef get_cell(cel...
[ [ "numpy.diag", "numpy.fmod", "numpy.dot", "numpy.cross", "matplotlib.pyplot.title", "numpy.linalg.inv", "numpy.vstack", "numpy.linalg.norm", "numpy.linalg.det", "numpy.prod", "numpy.floor", "numpy.ma.array", "numpy.array", "numpy.sum", "matplotlib.pyplot....
6abi/pi08
[ "fa49d256569ba359ecde0f82a8f03d01db6d6a65" ]
[ "detect.py" ]
[ "import tensorflow as tf\nphysical_devices = tf.config.experimental.list_physical_devices('GPU')\nif len(physical_devices) > 0:\n tf.config.experimental.set_memory_growth(physical_devices[0], True)\nfrom absl import app, flags, logging\nfrom absl.flags import FLAGS\nimport core.utils as utils\nfrom core.yolov4 i...
[ [ "tensorflow.compat.v1.ConfigProto", "tensorflow.constant", "tensorflow.saved_model.load", "tensorflow.config.experimental.set_memory_growth", "numpy.asarray", "tensorflow.lite.Interpreter", "tensorflow.config.experimental.list_physical_devices", "tensorflow.shape", "tensorflow....
apmoore1/tdsa_augmentation
[ "71c9ffa79ea48e817408d0dc496cc146ce75a942" ]
[ "tdsa_augmentation/data_augmentation/target_extraction_train_predict.py" ]
[ "import argparse\nfrom pathlib import Path\nimport json\nfrom typing import Iterable\nimport tempfile\nimport random\n\nfrom allennlp.models import Model\nfrom sklearn.model_selection import train_test_split\nimport target_extraction\nfrom target_extraction.data_types import TargetTextCollection\nfrom target_extrac...
[ [ "sklearn.model_selection.train_test_split" ] ]
alexalemi/datasets
[ "45282fbf6b42aac0ff58d40a7941a983be7c9f18" ]
[ "tensorflow_datasets/translate/wmt.py" ]
[ "# coding=utf-8\n# Copyright 2019 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.io.gfile.GFile" ] ]
codeformuenster/COVID-19-NRW
[ "6e35f28fc29e76b2839145880f4d796b70950661" ]
[ "plot_barchart.py" ]
[ "from functools import reduce\nfrom datetime import datetime as dt\n\nimport pandas as pd\nimport numpy as np\n\nimport seaborn as sns\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.figure import Figure\n\n\nmatplotlib.use(\"agg\")\n\nCOLOR_DEATHS = \"#dd6600\"\nCOLOR_RECOVERED = \"#dbcd00\"...
[ [ "pandas.merge", "pandas.read_csv", "pandas.to_datetime", "numpy.isnan", "matplotlib.use" ] ]
Tak-Man/ML-rapid-text-labeling-app
[ "3741253c4fadef6e4450ad1874c40c311344b309" ]
[ "web_app_utilities.py" ]
[ "import pandas as pd\nimport random\nimport sklearn.preprocessing as pp\nfrom datetime import datetime\nimport itertools\nimport re\nfrom scipy.stats import entropy\nimport uuid\nimport pickle\nimport os\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.cluster import KMeans\nimport sqlite3...
[ [ "numpy.dot", "pandas.read_csv", "pandas.Series", "numpy.random.seed", "pandas.DataFrame", "numpy.std", "scipy.stats.entropy", "numpy.mean", "pandas.DataFrame.sparse.from_spmatrix", "pandas.DataFrame.from_dict", "pandas.set_option", "numpy.array", "sklearn.featur...
bbruzos/Web-scraping-challenge
[ "1c432b80cb368b7c233927b46542f87fe8933f2d" ]
[ "scrape_mars.py" ]
[ "from bs4 import BeautifulSoup as bs\nimport requests\nimport pandas as pd\nfrom splinter import Browser\nfrom webdriver_manager.chrome import ChromeDriverManager\n\ndef init_browser():\n # @NOTE: Replace the path with your actual path to the chromedriver\n executable_path = {'executable_path': ChromeDriverMa...
[ [ "pandas.read_html" ] ]
dg46/pgmpy
[ "caea6ef7c914464736818fb185a1d395937ed52f" ]
[ "pgmpy/estimators/EM.py" ]
[ "import warnings\nfrom itertools import product, chain\n\nimport numpy as np\nimport pandas as pd\nfrom tqdm.auto import tqdm\n\nfrom pgmpy.estimators import ParameterEstimator, MaximumLikelihoodEstimator\nfrom pgmpy.models import BayesianNetwork\nfrom pgmpy.factors.discrete import TabularCPD\nfrom pgmpy.global_var...
[ [ "pandas.concat", "numpy.array", "numpy.random.seed" ] ]
Steven177/intra_batch
[ "7fa9340ee39f5970f308153931620bcf061d6285" ]
[ "net/gnn_base.py" ]
[ "from torch_scatter import scatter_mean, scatter_max, scatter_add\nimport torch\nfrom torch import nn\nimport math\nimport torch.nn.functional as F\nimport numpy as np\nimport torch\nimport logging\nfrom .utils import *\nfrom .attentions import MultiHeadDotProduct\nimport torch.utils.checkpoint as checkpoint\nlogge...
[ [ "torch.nn.functional.normalize", "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.ones", "torch.cat", "torch.nn.Linear" ] ]
dodler/torchcv
[ "10fd69bbb9180e399d93ee5c70abd5072401ea84" ]
[ "examples/ssd_mobilenet2/train.py" ]
[ "from __future__ import print_function\n\nimport argparse\nimport os\nimport random\n\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torchvision.transforms as transforms\n\nfrom torchcv.datasets import ListDataset\nfrom torchcv.loss import SSDLoss\nfrom torchcv.models.mobil...
[ [ "torch.save", "torch.utils.data.DataLoader", "torch.load" ] ]
shelleyyyyu/sentence-transformers
[ "f004fba1dc23bbbe3caebd044748cbea3b2257e2" ]
[ "examples/applications/clustering/kmeans.py" ]
[ "\"\"\"\nThis is a simple application for sentence embeddings: clustering\n\nSentences are mapped to sentence embeddings and then k-mean clustering is applied.\n\"\"\"\nfrom sentence_transformers import SentenceTransformer\nfrom sklearn.cluster import KMeans\n\nembedder = SentenceTransformer('distilroberta-base-par...
[ [ "sklearn.cluster.KMeans" ] ]
abhimanyudubey/DomainBed
[ "5c8373e40a04035081937b0fa3eb4fa5339dae32" ]
[ "domainbed/lib/misc.py" ]
[ "\"\"\"\nThings that don't belong anywhere else\n\"\"\"\n\nimport hashlib\nimport json\nimport os\nimport sys\nfrom shutil import copyfile\nfrom collections import OrderedDict\nfrom numbers import Number\nimport operator\n\nimport numpy as np\nimport torch\nimport tqdm\nfrom collections import Counter\nimport torch...
[ [ "torch.nn.functional.binary_cross_entropy_with_logits", "torch.nn.functional.cross_entropy", "torch.sum", "torch.no_grad", "numpy.random.RandomState" ] ]
spaghettix/DissP_RL_OCTSC
[ "e03df1ebc5c3ccef66ddf7cd2b05d0106855215f" ]
[ "src/DistPCAE.py" ]
[ "\n\n\n\"\"\"\nABOUT: DISTANCE PRESERVING CONVOLUTIONAL AUTO-ENCODER\n for UNIVARIATE TIME SERIES.\n\"\"\"\n\n\n__author__ = 'Stefano Mauceri'\n__email__ = 'mauceri.stefano@gmail.com'\n\n\n\n# =============================================================================\n# IMPORT\n# ==========================...
[ [ "matplotlib.pyplot.legend", "tensorflow.keras.layers.UpSampling1D", "tensorflow.keras.Sequential", "tensorflow.keras.layers.MaxPooling1D", "matplotlib.pyplot.plot", "tensorflow.linalg.normalize", "tensorflow.keras.layers.Lambda", "tensorflow.squeeze", "tensorflow.gather", "...
yt87/pywgrib2_xr
[ "5c49eaaee12948ecc2f2aff526a9e51e6d4d98b5" ]
[ "pywgrib2_xr/template.py" ]
[ "from datetime import datetime, timedelta\nfrom functools import partial\nfrom typing import (\n Any,\n Callable,\n Dict,\n List,\n NamedTuple,\n Optional,\n Sequence,\n Set,\n Tuple,\n)\n\n# For older Pythons\ntry:\n from typing import TypedDict\nexcept ImportError:\n from mypy_ext...
[ [ "numpy.array" ] ]
akashsengupta1997/ProHMR
[ "7015a3d070c79b4571d43abdf5e522468091a94d", "7015a3d070c79b4571d43abdf5e522468091a94d" ]
[ "dataset_preprocessing/preprocess_h36m.py", "eval/eval_regression.py" ]
[ "import os\nimport sys\nimport cv2\nimport glob\nimport h5py\nimport numpy as np\nimport argparse\nfrom spacepy import pycdf\nimport pickle\n\nfrom prohmr.configs import prohmr_config, dataset_config\n\nparser = argparse.ArgumentParser(description='Generate H36M dataset files')\nparser.add_argument('--split', type=...
[ [ "numpy.savez", "numpy.min", "numpy.reshape", "numpy.max", "numpy.load", "numpy.where", "numpy.zeros" ], [ "torch.device", "torch.no_grad", "torch.utils.data.DataLoader", "torch.cuda.is_available" ] ]
thomasthechen/rlcard
[ "0139d0e403b6d844a8f9107237887d73c7e8d752" ]
[ "rlcard/envs/leducholdem.py" ]
[ "import json\nimport os\nimport numpy as np\n\nimport rlcard\nfrom rlcard.envs import Env\nfrom rlcard.games.leducholdem import Game\nfrom rlcard.utils import *\nfrom rlcard import models\n\n\nclass LeducholdemEnv(Env):\n ''' Leduc Hold'em Environment\n '''\n\n def __init__(self, config):\n ''' Init...
[ [ "numpy.zeros" ] ]
GreenGilad/VIA
[ "01b408f3abaf3b42ea13cccd49748cafdca56f07" ]
[ "OldVersions/Viav021.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom scipy.sparse import csr_matrix, csgraph\nimport scipy\nimport igraph as ig\nimport leidenalg\nimport time\nimport hnswlib\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport math\nimport multiprocessing\nfrom scipy.sparse.csgraph import minimum_spanning_tree\nf...
[ [ "numpy.dot", "numpy.polyfit", "numpy.poly1d", "matplotlib.pyplot.legend", "pandas.Series", "numpy.linspace", "numpy.sqrt", "numpy.asarray", "numpy.cumsum", "pandas.DataFrame", "numpy.concatenate", "numpy.max", "numpy.all", "matplotlib.pyplot.axes", "nump...
markmelnic/VU-Lib
[ "78f403d54bce1d4b82912a6daffebf15a96f64c6" ]
[ "vu_lib/ipy_lib3.py" ]
[ "'''\nCreated on 30 Jan. 2012\nFinished on 6 Feb. 2012\n\nImprovements:\n - 31 Mar. 2020 to 31 Mar. 2020: fixed compatibility issues of Matplotlib and Tinker on OS X machines.\n - 19 Nov. 2019 to 22 Nov. 2019: rewrote Programming for Economists ipy_lib to Python 3.7 and merged with this one.\n - 15 Nov. 20...
[ [ "matplotlib.use" ] ]
ArminKaramzade/SequenceMixup
[ "52eb053bd21f81db0aba0932da83dc06aaaee46f" ]
[ "src/training_utils.py" ]
[ "import numpy as np\n\ndef pad_sequence(sequences, batch_first=True, padding_value=0, padding='post'):\n max_size = sequences[0].size()\n trailing_dims = max_size[1:]\n max_len = max([s.size(0) for s in sequences])\n if batch_first:\n out_dims = (len(sequences), max_len) + trailing_dims\n else...
[ [ "numpy.random.beta", "numpy.zeros", "numpy.tile" ] ]
RoteKekse/FDAsandbox
[ "4668ea3b7adf4908175719caf1fded808f012b85" ]
[ "dbscan/dbscan_ex_1.py" ]
[ "print(__doc__)\n\nimport numpy as np\n\nfrom sklearn.cluster import DBSCAN\nfrom sklearn import metrics\nfrom sklearn.datasets.samples_generator import make_blobs\nfrom sklearn.preprocessing import StandardScaler\n\n\n# #############################################################################\n# Generate sampl...
[ [ "matplotlib.pyplot.cm.Spectral", "matplotlib.pyplot.title", "sklearn.metrics.silhouette_score", "sklearn.metrics.v_measure_score", "sklearn.cluster.DBSCAN", "sklearn.metrics.homogeneity_score", "matplotlib.pyplot.plot", "sklearn.metrics.completeness_score", "sklearn.preprocessi...
shambhavit14/Olympic-hero
[ "58aa58a46daeaf4486fcdf9fc4aa9e026f683f92" ]
[ "code.py" ]
[ "# --------------\n#Importing header files\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n#Path of the file\r\ndata = pd.read_csv(path)\r\ndata.rename(columns = {'Total':'Total_Medals'},inplace = True)\r\ndata.head(10)\r\n\r\n#Code starts here\r\n\n\n\n# --------------\n#Code...
[ [ "pandas.read_csv", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "numpy.where", "matplotlib.pyplot.ylabel" ] ]
hippke/betelbot
[ "8cd9292f272d504627c1def7bf99ace8d1a6a4cc" ]
[ "betellib.py" ]
[ "import os\nimport requests\nimport numpy as np\nfrom twython import Twython\nfrom bs4 import BeautifulSoup\nfrom astropy.stats import biweight_location\n\n\nconsumer_key = os.environ.get('consumer_key')\nconsumer_secret = os.environ.get('consumer_secret')\naccess_token = os.environ.get('access_token')\naccess_toke...
[ [ "numpy.sqrt", "numpy.std", "numpy.size", "numpy.array", "numpy.where" ] ]
rdnetto/roxbot
[ "8b59126272704ffbb0986b3b410502a4ea9cb2ed" ]
[ "roxbot/cogs/image.py" ]
[ "# -*- coding: utf-8 -*-\n\n# MIT License\n#\n# Copyright (c) 2017-2018 Roxanne Gibson\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 limit...
[ [ "numpy.zeros" ] ]
tsutaj/sandbox
[ "c7046f2973ce23f84085c6697c6752483cdcda71" ]
[ "compro/atcoder_problems/fetch_specific_difficulty_problem_lists.py" ]
[ "import argparse\nimport logging\nimport pandas as pd\nimport pathlib\nimport requests\n\ndiff_info = (\"https://kenkoooo.com/atcoder/resources/problem-models.json\", \"./difficulty.json\")\nprob_info = (\"https://kenkoooo.com/atcoder/resources/problems.json\", \"./problems.json\")\nresult_json_info = (\"hoge\", \"...
[ [ "pandas.read_json" ] ]
hotchilianalytics/hca-resources
[ "051fcad7bf94ff0b7543adb227a769f0b9cead67" ]
[ "HCA_In_and_Out/Q_In_and_Out_orig.py" ]
[ "# Vlad Code from: Aleksei Dremov in\n# https://www.quantopian.com/posts/live-slash-paper-trade-the-in-out-stragegy\n\n# Price relative ratios (intersection) with wait days\nimport numpy as np\n# -----------------------------------------------------------------------------------------------\nSTOCKS = symbols('QQQ'...
[ [ "numpy.sqrt" ] ]
anjohan/dscribe
[ "9daf60453076d0a18088a5d70deddd737903e665" ]
[ "regtests/soap.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Copyright 2019 DScribe developers\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap...
[ [ "numpy.dot", "numpy.imag", "numpy.sqrt", "numpy.linspace", "numpy.exp", "numpy.trapz", "numpy.hstack", "numpy.allclose", "numpy.clip", "numpy.reshape", "numpy.eye", "numpy.sin", "numpy.real", "numpy.zeros", "numpy.linalg.inv", "scipy.integrate.tplqua...
TannerRogalsky/pennylane-qiskit
[ "4d1646d17d36cc28bfd61c03d32f130e3e14e278" ]
[ "tests/test_inverses.py" ]
[ "import pytest\n\nimport pennylane as qml\nimport math\nimport cmath\nimport numpy as np\n\n# defaults\ntol = 1e-5\n\n\nclass TestInverses:\n \"\"\"Tests that the inverse of the operations are applied.\"\"\"\n\n # This test is ran against the state |0> with one Z expval\n @pytest.mark.parametrize(\n ...
[ [ "numpy.negative", "numpy.array" ] ]
aki34/learnable-triangulation-pytorch
[ "4ada88f871078c8d27ea92d422d16c7104818169" ]
[ "train.py" ]
[ "import os\nimport shutil\nimport argparse\nimport time\nimport json\nfrom datetime import datetime\nfrom collections import defaultdict\nfrom itertools import islice\nimport pickle\nimport copy\n\nimport numpy as np\nimport cv2\n\nimport torch\nfrom torch import nn\nfrom torch import autograd\nimport torch.nn.func...
[ [ "torch.distributed.init_process_group", "torch.cuda.set_device", "torch.load", "torch.utils.data.distributed.DistributedSampler", "torch.manual_seed", "torch.sum", "numpy.concatenate", "numpy.mean", "torch.arange", "torch.device", "torch.cuda.device_count", "torch.a...
cherryc/dynet
[ "54bf3fa04f55f0730a9a21b5708e94dc153394da" ]
[ "python_tests/test_input.py" ]
[ "from __future__ import print_function\nimport dynet as dy\nimport numpy as np\n\ninput_vals = np.arange(81)\nsquared_norm = (input_vals**2).sum()\nshapes = [(81,), (3, 27), (3, 3, 9), (3, 3, 3, 3)]\nfor i in range(4):\n # Not batched\n dy.renew_cg()\n input_tensor = input_vals.reshape(shapes[i])\n x = ...
[ [ "numpy.asarray", "numpy.arange" ] ]
mondrasovic/siam-mot
[ "f06ce0ba6c80fcfbc3830a38f69c93674d3c74ac" ]
[ "siammot/engine/inferencer.py" ]
[ "import logging\r\nimport os\r\nimport time\r\n\r\nimport numpy as np\r\nimport torch\r\nfrom gluoncv.torch.data.gluoncv_motion_dataset.dataset import DataSample\r\nfrom tqdm import tqdm\r\n\r\nfrom ..data.adapters.augmentation.build_augmentation import \\\r\n build_siam_augmentation\r\nfrom ..data.build_inferen...
[ [ "torch.cuda.synchronize", "numpy.arange", "torch.no_grad", "numpy.mean", "torch.device", "torch.squeeze" ] ]
PointCloudYC/PointNet-modern.pytorch
[ "1a0b373fcb21f24b667a0bb4831211da5b92f98d" ]
[ "scripts/train_s3dis.py" ]
[ "\"\"\"\nDistributed training script for semantic segmentation on S3DIS dataset\n\"\"\"\nimport os\nimport sys\nimport time\nfrom datetime import datetime\nimport json\nimport random\nimport numpy as np\n\n# pytorch\nimport torch\nimport torch.nn as nn\nfrom torchvision import transforms\nimport torch.distributed a...
[ [ "torch.distributed.init_process_group", "numpy.random.seed", "torch.utils.data.distributed.DistributedSampler", "torch.load", "torch.manual_seed", "torch.cuda.set_device", "torch.utils.data.DataLoader", "torch.cuda.empty_cache", "torch.no_grad", "torch.utils.tensorboard.Sum...
s05252/course-2018-2
[ "4695bf1556603fc2549464512afc96765f45132e" ]
[ "python-programming/unit34.py" ]
[ "import pandas as pd\nimport numpy as np\n\nalco2009 = pd.read_csv(\"niaaa-report2009.csv\", index_col=\"State\")\nalco2009\n\npopulation = pd.read_csv(\"population.csv\", index_col=\"State\")\npopulation.head()\n\ndf = pd.merge(alco2009, population, left_index=True,\nright_index=True)\ndf.head()\n\n\n" ]
[ [ "pandas.merge", "pandas.read_csv" ] ]
chenyangh/DialogueGenerationWithEmotion
[ "88433fa3ad32da5eab7923aef11fe34105a3e1f9" ]
[ "model/dec_rep.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport numpy as np\nUSE_CUDA = True\nNUM_EMO = 9\n\nclass SoftDotAttention(nn.Module):\n \"\"\"Soft Dot Attention.\n Ref: http://www.aclweb.org/anthology/D15-1166\n Adapted from PyTorch OPEN NMT.\n ...
[ [ "torch.nn.Softmax", "torch.nn.functional.softmax", "torch.cat", "torch.nn.LSTM", "torch.zeros", "torch.nn.Embedding", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.functional.sigmoid", "torch.FloatTensor", "torch.bmm", "numpy.random.uniform", "torch.nn.functiona...
ghacupha/fastapi-ml-quickstart
[ "866068eb2b2ea7f08003947e80f57bdacb24db81" ]
[ "api/ml/model.py" ]
[ "import joblib\nimport numpy as np\nfrom pathlib import Path\n\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.datasets import load_boston\n\n\nclass Model:\n \"\"\"\n Models Definition.\n \n This is a general representation of what we do with a model that we are serving, hence...
[ [ "sklearn.ensemble.RandomForestRegressor", "sklearn.datasets.load_boston" ] ]
thowell332/DAME-FLAME-Python-Package
[ "860e7b0443903c0b79f3b214c359fdddb9718caf" ]
[ "dame_flame/flame_algorithm.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"The main file for the FLAME algorithm\"\"\"\n\n# author: Neha Gupta, Duke University\n# Copyright Duke University 2020\n# License: MIT\n\nimport pandas as pd\nimport numpy as np\n\nfrom . import grouped_mr\nfrom . import dame_algorithm\nfrom . import flame_dame_helpers\n\ndef decide_...
[ [ "numpy.concatenate", "pandas.DataFrame", "numpy.unique" ] ]
deshwalmahesh/CURL---cpu-gpu
[ "f4e87275b6cce556b9e04a188cf7ae13d810d82a" ]
[ "raw_ted.py" ]
[ "# -*- coding: utf-8 -*-\r\n'''\r\nThis is a PyTorch implementation of CURL: Neural Curve Layers for Global Image Enhancement\r\nhttps://arxiv.org/pdf/1911.13175.pdf\r\n\r\nPlease cite paper if you use this code.\r\n\r\nTested with Pytorch 1.7.1, Python 3.7.9\r\n\r\nAuthors: Sean Moran (sean.j.moran@gmail.com), 202...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.ReflectionPad2d", "torch.cat", "torch.nn.Conv2d", "torch.nn.PixelShuffle", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.nn.LeakyReLU", "torch.nn.UpsamplingNearest2d", "torch.nn.fun...
keijikage/openpilot
[ "4ed31ab245bdfc8a38566ed24e275b6bd8a06c23" ]
[ "selfdrive/controls/lib/lateral_planner.py" ]
[ "import os\nimport math\nimport numpy as np\nfrom common.realtime import sec_since_boot, DT_MDL\nfrom common.numpy_fast import interp\nfrom selfdrive.swaglog import cloudlog\nfrom selfdrive.controls.lib.lateral_mpc import libmpc_py\nfrom selfdrive.controls.lib.drive_helpers import CONTROL_N, MPC_COST_LAT, LAT_MPC_N...
[ [ "numpy.arange", "numpy.linalg.norm", "numpy.ones", "numpy.column_stack", "numpy.array", "numpy.zeros" ] ]
LoveThinkinghard/MCM-2019-Problem-C-drug-spread-maps
[ "2fe2a6eaaa6c5fdbeab972ffd82a71b60259737e" ]
[ "solution/model2.py" ]
[ "# -*- coding: utf-8 -*-\n# if you run 'model1.py' just now, you need to restart your kernel. \n# or you might have some trouble when you fit the model\n\nimport keras.layers as kl\nfrom keras import Model\nimport numpy as np\nimport matplotlib.pyplot as plt\n#%%\ndis_mat = np.load('./data/distance_matrix.npy')\ndr...
[ [ "matplotlib.pyplot.plot", "numpy.load", "numpy.matmul" ] ]
PIA-Group/epibox
[ "9b12ae27e73c69845d2418b2a2ba00c10e2c99f5" ]
[ "epibox/common/write_file.py" ]
[ "# built-in\nfrom datetime import datetime\nimport os\n\n# third-party\nimport numpy as np\n\n\ndef write_file(t, a_file, sync_param, time, fmt):\n write_acq_file(a_file, t, time, fmt)\n\n\ndef write_acq_file(a_file, t, time, fmt):\n\tnp.savetxt(a_file, t, fmt=fmt, delimiter='\t', newline='\\n', header='', foote...
[ [ "numpy.savetxt" ] ]
Robert-Hammond/Super-SloMo
[ "393bfb3ae15a901ad511635f569e409de5c8f5f9" ]
[ "eval.py" ]
[ "\"\"\"\nConverts a Video to SuperSloMo version\n\"\"\"\nfrom time import time\nimport click\nimport cv2\nimport torch\nfrom PIL import Image\nimport numpy as np\nimport model\nfrom torchvision import transforms\nfrom torch.functional import F\n\n\ntorch.set_grad_enabled(False)\ndevice = torch.device(\"cuda\" if to...
[ [ "torch.cat", "torch.load", "torch.functional.F.sigmoid", "torch.set_grad_enabled", "torch.cuda.is_available", "torch.stack", "numpy.array" ] ]
eunjilisa/CSE291DRL
[ "6b548673e1a974eb9448bb92d6fad9a1ca81bf3c" ]
[ "gym_compete/policy.py" ]
[ "\"\"\"Abstract policy class and some concrete implementations.\"\"\"\n\nfrom gym.spaces import Box\nimport numpy as np\nfrom stable_baselines.common.tf_layers import ortho_init\nfrom stable_baselines.common.tf_util import seq_to_batch\nfrom stable_baselines.common.distributions import DiagGaussianProbabilityDistri...
[ [ "tensorflow.nn.raw_rnn", "tensorflow.concat", "tensorflow.zeros", "tensorflow.group", "tensorflow.to_float", "tensorflow.square", "numpy.zeros", "tensorflow.matmul", "tensorflow.TensorArray", "tensorflow.zeros_initializer", "tensorflow.placeholder", "tensorflow.nn.t...
johnmous/sfaira
[ "c50240a74530e614ab7681bf9c63b04cb815b361", "c50240a74530e614ab7681bf9c63b04cb815b361" ]
[ "sfaira/data/dataloaders/loaders/d10_1101_753806/human_lungparenchyma_2020_10xsequencing_habermann_001.py", "sfaira/models/embedding/output_layers.py" ]
[ "import anndata\nimport os\nimport pandas as pd\n\nfrom sfaira.data import DatasetBase\n\n\nclass Dataset(DatasetBase):\n\n \"\"\"\n TODO extra meta data in obs2\n\n age: columns \"Age\" contains integer entries and Unknown\n diseases: column \"Diagnosis\" contains entries NSIP, cHP, Control, IPF, ILD, ...
[ [ "pandas.read_csv" ], [ "tensorflow.clip_by_value", "tensorflow.constant", "tensorflow.shape", "tensorflow.keras.layers.Dense", "tensorflow.exp" ] ]
KOPFYF/pytorchTutorial
[ "4ed7642049a0fba46edd505a23ffcea9d8e03679" ]
[ "02_tensor_basics.py" ]
[ "import re\nimport torch\n\n# Everything in pytorch is based on Tensor operations.\n# A tensor can have different dimensions\n# so it can be 1d, 2d, or even 3d and higher\n\n# scalar, vector, matrix, tensor\n\n# torch.empty(size): uninitiallized\nx = torch.empty(1) # scalar\n\nprint(x)\nx = torch.empty(3) # vector,...
[ [ "torch.div", "torch.ones", "torch.add", "torch.empty", "torch.zeros", "torch.randn", "torch.sub", "torch.from_numpy", "torch.tensor", "numpy.ones", "torch.mul", "torch.rand", "torch.cuda.is_available", "torch.device", "torch.ones_like" ] ]
kholohan/chexnet
[ "e8cb9bf2365326210d64b09ccfd503a858485941" ]
[ "chexnet_client.py" ]
[ "import cv2\nimport grpc\nfrom configparser import ConfigParser\nfrom confluent_kafka import Producer, Consumer, KafkaError, KafkaException\nimport generator\nimport io\nimport json\nimport keras.backend as K\nimport logging\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nfrom PIL import Image\nimp...
[ [ "tensorflow.convert_to_tensor", "tensorflow.python.framework.tensor_util.MakeNdarray", "matplotlib.pyplot.title", "numpy.min", "numpy.uint8", "matplotlib.pyplot.barh", "matplotlib.pyplot.savefig", "numpy.max", "tensorflow.contrib.util.make_tensor_proto", "matplotlib.pyplot....
Karanshade/moonshade
[ "4e119af40cd694396afd2d6a5bffdcc65b8bff09" ]
[ "MshNeo4j/__init__.py" ]
[ "import os\nfrom subprocess import check_output\nimport pandas as pd\nfrom py2neo import Graph, Node, Relationship\nimport karmahutils as kut\n\nversion_info = \"v0.1\"\nversion_type = 'moonshade library'\nauthors = ['Yann Girard']\ncontact = 'yann.girard@gmail.com'\nlib_name = 'MshNeo4j'\npurpose = \"\"\"QoL tools...
[ [ "pandas.DataFrame" ] ]
JulianBMunoz/eor_limits
[ "780eef1d46862a69e6d249a90a9a230517436cea" ]
[ "eor_limits/plot_eor_limits.py" ]
[ "#! /usr/bin/env python\n# -*- mode: python; coding: utf-8 -*\n# Copyright (c) 2019 Nichole Barry, Bryna Hazelton\n# Licensed under the 2-clause BSD License\n\"\"\"Code for plotting EoR Limits.\"\"\"\n\nimport glob\nimport os\nimport copy\n\nimport yaml\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport m...
[ [ "matplotlib.pyplot.legend", "numpy.asarray", "numpy.squeeze", "numpy.nanmin", "matplotlib.pyplot.plot", "numpy.max", "matplotlib.pyplot.rcParams.update", "numpy.where", "numpy.ceil", "matplotlib.cm.ScalarMappable", "matplotlib.pyplot.subplots_adjust", "numpy.repeat"...
trungngv/CHAID
[ "794756560872e944cec6a6dcc780feeeeadc51ed" ]
[ "tests/setup_tests.py" ]
[ "\"\"\"\nThis module provides helper functions for the rest of the testing module\n\"\"\"\n\nfrom collections import Iterable\nimport os\nimport sys\nfrom math import isnan\nimport numpy as np\n\nROOT_FOLDER = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))\n\nsys.path = [ROOT_FOLD...
[ [ "numpy.seterr" ] ]
bainbrid/icenet
[ "0b261dc97451fd7f896ed27f2b90dd2668e635ca" ]
[ "icebrk/fasthistos.py" ]
[ "# Raw \"fast\" observable containers for B/RK analyzer\n# \n# \n# Mikael Mieskolainen, 2020\n# m.mieskolainen@imperial.ac.uk\n\n\nimport bz2\nimport copy\nimport numpy as np\nimport iceplot\nimport icebrk.tools as tools\n\n\nobs_template = {\n\n# Axis limits\n'xlim' : None,\n'ylim' : None,\n'xlabel' : r'',\...
[ [ "numpy.linspace" ] ]
HaoranDennis/pandapower
[ "22c8680d3373879e792fe7478bd2dde4ea8cb018" ]
[ "pandapower/estimation/ppc_conversions.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016-2019 by University of Kassel and Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IEE), Kassel. All rights reserved.\n\n\nimport numpy as np\nimport pandas as pd\nfrom pandapower.auxiliary import _select_is_elements_numba, _add_ppc_options, ...
[ [ "numpy.hstack", "pandas.Series", "numpy.unique", "numpy.isnan", "numpy.arange", "pandas.DataFrame", "numpy.full", "numpy.argwhere", "numpy.concatenate", "numpy.any", "numpy.sum" ] ]
i-machine-think/diagnnose
[ "4533347d1f2cc2959903ae667f99dccd4dda73ee" ]
[ "diagnnose/models/recurrent_lm.py" ]
[ "import os\nfrom itertools import product\nfrom typing import Dict, List, Optional, Tuple, Union\n\nimport torch\nfrom torch import Tensor\nfrom torch.nn.functional import log_softmax\nfrom torch.nn.utils.rnn import PackedSequence, pack_padded_sequence\nfrom transformers import PreTrainedTokenizer\n\nfrom diagnnose...
[ [ "torch.sigmoid", "torch.nn.functional.log_softmax", "torch.cat", "torch.tensor", "torch.tanh", "torch.split", "torch.gather" ] ]
alexaway/object_detection_tf
[ "b564b0a0b4e2bbfa82daf0b88becbd271296aff4" ]
[ "research/object_detection/models/embedded_ssd_mobilenet_v2_feature_extractor.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.variable_scope", "tensorflow.control_dependencies", "tensorflow.shape" ] ]
nulano/osm-map-viewer
[ "1a4a4f3473cb83ce714fe3de370c7a0e904a5ea9" ]
[ "geometry/geometry.py" ]
[ "from collections import namedtuple\nfrom typing import List, Tuple\n\nimport numpy as np\n\n\n_Point = Tuple[float, float]\n_Polygon = List[_Point]\n\n\ndef _norm_polygon(polygon: _Polygon):\n if len(polygon) == 0:\n raise ValueError('Empty polygon')\n if polygon[0] != polygon[-1]:\n polygon = ...
[ [ "numpy.dot", "numpy.linalg.norm", "numpy.concatenate", "numpy.cross", "numpy.array", "numpy.flip", "numpy.sum" ] ]
navekshasood/HuBMAP---Hacking-the-Kidney
[ "018100fe4bfa5e8764b9df5a9d188e2c670ac061" ]
[ "models/2-Gleb/train/src/sampler.py" ]
[ "import random \nimport numpy as np\nfrom PIL import Image\nfrom typing import List, Tuple\nfrom functools import partial\n\nimport rasterio\nfrom shapely import geometry\nfrom rasterio.windows import Window\nfrom tf_reader import TFReader\n\n\nfrom utils import jread, get_basics_rasterio, json_record_to_poly, flat...
[ [ "numpy.round", "numpy.array", "numpy.random.random", "numpy.sum" ] ]
Jpe230/DDatingApp
[ "b515d35e63ac137ed5b3eefecf992d67f3c28eee" ]
[ "neuralnetwork/prepareData.py" ]
[ "# System lib\nimport os\n\n# Libraries for manipulating Dataset\nimport cv2\nimport pickle\nimport numpy as np\nimport numpy\nfrom PIL import ImageEnhance\n\n# Libraries for downloading Dataset\nimport zipfile\nimport gdown\nimport random\n\nfrom numpy.core.fromnumeric import resize\n\n# User-defined const\nimport...
[ [ "numpy.asarray_chkfinite" ] ]
Jianyang-Hu/numpypractice
[ "f4d4a3e28f5dd10f9722f83b1ac66f0f2ccef8b9" ]
[ "linalg_0424.py" ]
[ "# -*- coding: utf-8 -*-\n# @version : Python3.6\n# @Time : 2017/4/24 16:31\n# @Author : Jianyang-Hu\n# @contact : jianyang1993@163.com\n# @File : linalg_0424.py\n# @Software: PyCharm\nimport numpy as np\nfrom numpy import *\nimport sys\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import plot\nfr...
[ [ "numpy.exp", "numpy.random.normal", "matplotlib.pyplot.show", "numpy.sqrt" ] ]
danielballan/pandas
[ "576818f169c0d494e74f787f7486d090e5e6662f" ]
[ "pandas/tools/rplot.py" ]
[ "import random\nfrom copy import deepcopy\nfrom pandas.core.common import _values_from_object\n\nimport numpy as np\nfrom pandas.compat import range, zip\n#\n# TODO:\n# * Make sure legends work properly\n#\n\nclass Scale:\n \"\"\"\n Base class for mapping between graphical and data attributes.\n \"\"\"\n ...
[ [ "numpy.polynomial.polynomial.polyfit", "matplotlib.pyplot.gcf", "scipy.stats.gaussian_kde", "numpy.polynomial.polynomial.polyval", "pandas.core.common._values_from_object", "pandas.compat.zip", "numpy.array", "numpy.vstack", "pandas.compat.range" ] ]
davemfish/invest
[ "5b0391fd456df5a6afd2fdfbaed542a090f58f17" ]
[ "tests/test_scenic_quality.py" ]
[ "\"\"\"Module for Regression Testing the InVEST Scenic Quality module.\"\"\"\r\nimport unittest\r\nimport tempfile\r\nimport shutil\r\nimport os\r\nimport glob\r\n\r\nfrom osgeo import gdal\r\nfrom osgeo import osr\r\nimport pygeoprocessing.testing\r\nfrom pygeoprocessing.testing import sampledata\r\nfrom shapely.g...
[ [ "numpy.testing.assert_equal", "numpy.ones", "numpy.full", "numpy.testing.assert_allclose", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
vedantja/spark-sklearn
[ "349f8485382d76417593b178036de2a9f9dbba63" ]
[ "python/spark_sklearn/tests/test_keyed_models.py" ]
[ "\nfrom itertools import chain, repeat, cycle\nimport numpy as np\nimport pandas as pd\nfrom sklearn.cluster import DBSCAN, KMeans\nfrom sklearn.decomposition import PCA\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.linear_model import LogisticRegression\nimport unittest\n\nfrom pyspark.sql.types...
[ [ "numpy.random.random", "sklearn.linear_model.LogisticRegression", "sklearn.cluster.KMeans", "pandas.DataFrame", "sklearn.cluster.DBSCAN", "sklearn.linear_model.LinearRegression", "numpy.array", "sklearn.decomposition.PCA", "numpy.vstack", "numpy.random.randint" ] ]
xikasan/xair
[ "c10f7a5d6a279eb5d2498b2f2df489ccc85ee36c" ]
[ "xair/envs/lvaircraft_random_pitch.py" ]
[ "# coding: utf-8\n\nimport gym\nimport xsim\nimport numpy as np\nimport xtools as xt\nfrom .base import BaseEnv\nfrom ..models.lvaircraft import LVAircraft\nfrom .lvaircraft_pitch import LVAircraftPitchV3\n\n\nclass LVAircraftPitchV4(LVAircraftPitchV3):\n\n IX_T = 0\n IX_q = 1\n IX_r = 2\n IX_dt = 0\n ...
[ [ "numpy.max", "numpy.min" ] ]
hyterazzb/micronet
[ "351d184527e9867e0394878cf91b64ffd5c6b109" ]
[ "micronet/compression/pruning/main.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport sys\nsys.path.append(\"../..\")\nimport math\nimport os\nimport argparse\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torchvision\nimport torchvi...
[ [ "torch.optim.Adam", "torch.nn.CrossEntropyLoss", "numpy.random.seed", "torch.load", "torch.sign", "torch.manual_seed", "torch.nn.init.zeros_", "torch.utils.data.DataLoader", "torch.autograd.Variable", "torch.nn.init.normal_", "torch.cuda.manual_seed_all", "torch.nn....
HebertWP/star_tracker
[ "4d6fe9e353222f22d0b8e0cfc823be51a7110d43" ]
[ "tests/test_loadfile.py" ]
[ "from numpy.core.fromnumeric import size\nimport pandas\nimport pytest\nimport star_tracker.modules.loadfile as loadfile\nfrom star_tracker.modules.loadfile import Movements\nimport matplotlib.pyplot as plt\n\ndef test_dat2csv():\n loadfile.dat2csv(\"data/hip_main.dat\",\"data/stars.csv\")\n try:\n sta...
[ [ "pandas.read_csv", "numpy.core.fromnumeric.size" ] ]
roopchansinghv/gadgetron
[ "073e84dabe77d2dae3b3dd9aa4bf9edbf1f890f2" ]
[ "test/integration/run_gadgetron_test.py" ]
[ "#!/usr/bin/python3\n\nimport os\n\n# Importing h5py on windows will mess with your environment. When we pass the messed up environment to gadgetron\n# child processes, they won't load properly. We're saving our environment here to spare our children from the\n# crimes of h5py.\nenvironment = dict(os.environ)\n\nim...
[ [ "numpy.dot", "numpy.squeeze", "numpy.linalg.norm" ] ]
vcarlosrb/STRAPS-3DHumanShapePose
[ "a62853a7c0831d5a54c56e707d231f5300d20fda" ]
[ "predict/predict_3D.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport torch\nfrom smplx.lbs import batch_rodrigues\n\nfrom detectron2.config import get_cfg\nfrom detectron2 import model_zoo\nfrom detectron2.engine import DefaultPredictor\n\nfrom PointRend.point_rend import add_pointrend_config\nfrom DensePose.densepose import add_den...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.imshow", "matplotlib.pyplot.scatter", "matplotlib.use", "matplotlib.pyplot.margins", "torch.from_numpy", "numpy.concatenate", "torch.no_grad", "matplotlib.pyplot.subplots_adjust", "numpy.transpose", "numpy.array", "matplot...
IsaiahPressman/Kaggle_Hungry_Geese
[ "f4d9fcb0811704bd339ad5c7ff937dd0d9e25763" ]
[ "start_alphagoose_trainer.py" ]
[ "from pathlib import Path\nimport torch\nfrom torch import nn\nfrom torchvision import transforms\n\nfrom hungry_geese.training.alphagoose.alphagoose_trainer import AlphaGooseTrainer\nfrom hungry_geese.training.alphagoose.alphagoose_data import AlphaGooseRandomReflect, ChannelShuffle, ToTensor\nfrom hungry_geese.en...
[ [ "torch.device", "torch.optim.lr_scheduler.MultiStepLR" ] ]
urbanriskmap/timeseries-analysis
[ "6b9a8d1a916ff784cb0de93d6997cd072d1ca6ae" ]
[ "jakarta_pic_and_text_config.py" ]
[ "# Jakarta config: where only those reports with images included\n# import this file and then overwrite whatever you need in\n# the default_config object\nimport logging\nimport pandas as pd\nfrom sqlalchemy import create_engine\nDATABASE = \"cognicity\"\nengine = create_engine(\n \"postgresql://postgres:pos...
[ [ "pandas.read_sql_query" ] ]
PinDanil/open_model_zoo
[ "9ca5dbeff80464bf5728e8be25daedfe9a9208d7" ]
[ "tools/accuracy_checker/accuracy_checker/annotation_converters/imagenet.py" ]
[ "\"\"\"\nCopyright (c) 2018-2021 Intel Corporation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law ...
[ [ "numpy.int64" ] ]
roxanneluo/colorization-pytorch
[ "4b5cab85ea2f503f17d13241ae2b7ba54158ccac" ]
[ "make_ilsvrc_dataset.py" ]
[ "\nimport os\nimport sys\nfrom util import util\nimport numpy as np\nimport argparse\n\nparser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\nparser.add_argument('--in_path', type=str, default='/data/big/dataset/ILSVRC2012')\nparser.add_argument('--out_path', type=str, default='....
[ [ "numpy.load" ] ]
RobbieEarle/robustness
[ "2f4381900015bf7fcd9975d43b8104d2d14f8568" ]
[ "ImageNet-C/test.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport argparse\nimport os\nimport time\nimport torch\nfrom torch.autograd import Variable as V\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\nimport torchvision.datasets as dset\nimport torchvision.transforms as trn\nimport torchvision.models as models\nimport t...
[ [ "torch.mean", "torch.cuda.manual_seed", "numpy.random.seed", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.sum", "torch.no_grad", "numpy.mean" ] ]
yuanCnD/Model-parameter-analysis
[ "9fabef4f434087a56e13aa28514fe1d4065ecc4d" ]
[ "data_txt.py" ]
[ "# Copyright 2018 yuanCnD.\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 to ...
[ [ "numpy.zeros", "numpy.abs" ] ]
foerstner-lab/READemption
[ "a2d698fc52567837953780eb31c461dd576f26af" ]
[ "reademptionlib/genewisequanti.py" ]
[ "import csv\nfrom reademptionlib.gff3 import Gff3Parser\nimport pysam\nimport pandas as pd\n\n\nclass GeneWiseQuantification(object):\n def __init__(\n self,\n min_overlap=1,\n read_region=\"global\",\n clip_length=11,\n norm_by_alignment_freq=True,\n norm_by_overlap_fre...
[ [ "pandas.read_csv" ] ]
JKutt/simpeg
[ "a0d9cf88e4551bfbfda3792521f4c85724686103" ]
[ "tutorials/05-dcr/plot_inv_1_dcr_sounding_irls.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSparse 1D Inversion of Sounding Data\n====================================\n\nHere we use the module *SimPEG.electromangetics.static.resistivity* to invert\nDC resistivity sounding data and recover a 1D electrical resistivity model.\nIn this tutorial, we focus on the following:\n\n...
[ [ "numpy.abs", "numpy.unique", "numpy.min", "numpy.logspace", "numpy.sort", "numpy.max", "matplotlib.rcParams.update", "matplotlib.pyplot.show", "numpy.sum", "matplotlib.pyplot.figure" ] ]
IanYeung/mangogogo
[ "d0bbed28116257a64518140ba6a1320bf1f50904" ]
[ "codes/models/archs/EDVR_arch.py" ]
[ "''' network architecture for EDVR '''\nimport functools\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport models.archs.arch_util as arch_util\ntry:\n from models.archs.dcn.deform_conv import ModulatedDeformConvPack as DCN\nexcept ImportError:\n raise ImportError('Failed to import ...
[ [ "torch.sigmoid", "torch.cat", "torch.randn", "torch.nn.Conv2d", "torch.nn.PixelShuffle", "torch.sum", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.no_grad", "torch.nn.LeakyReLU", "torch.nn.functional.interpolate", "torch.stack", "torch.device" ] ]
sarrrrry/ImageClassifier
[ "0c491a64ef31b74bc3228bb9bc49cbbe23e32b0e" ]
[ "image_classifier/ml/device.py" ]
[ "import torch\n\n\nclass Device:\n def __init__(self) -> None:\n self.device = torch.device(\"cpu\")\n\n def __call__(self) -> torch.device:\n return self.device\n\n @property\n def is_cuda(self) -> bool:\n return self.device == \"cuda\"" ]
[ [ "torch.device" ] ]
sparisi/habitat-lab
[ "9126cccc26e352135b8273ddfc167a9bec4b43fd" ]
[ "habitat/tasks/nav/nav.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n# TODO, lots of typing errors in here\n\nfrom typing import Any, List, Optional, Tuple\n\nimport attr\nimport...
[ [ "numpy.allclose", "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.round", "numpy.ceil", "numpy.deg2rad", "numpy.finfo", "numpy.zeros_like", "numpy.array", "numpy.random.RandomState" ] ]
JamesPHoughton/pysd
[ "5885d622144dd81af96e3c875bac74c51ddba62f" ]
[ "pysd/py_backend/functions.py" ]
[ "\"\"\"\nThese functions have no direct analog in the standard python data analytics\nstack, or require information about the internal state of the system beyond\nwhat is present in the function call. We provide them in a structure that\nmakes it easy for the model elements to call.\n\"\"\"\n\nimport inspect\nimpor...
[ [ "numpy.log", "numpy.abs", "numpy.logical_and", "numpy.linalg.inv", "numpy.arange", "pandas.DataFrame", "numpy.logical_or", "numpy.append", "scipy.stats.truncnorm.rvs", "numpy.interp", "numpy.random.uniform", "numpy.array", "numpy.roll" ] ]
ParthPatel-ES/Quantized_PoolNet
[ "926ab290e68f3564a456d69d00665a5615fe20da" ]
[ "testCode.py" ]
[ "from PIL import Image\nimport torchvision.transforms as T\nimport torchvision\nimport os\nfrom PIL import Image\nimport cv2\nimport torch\nfrom torch.utils import data\nfrom torchvision import transforms\nfrom torchvision.transforms import functional as F\nimport numbers\nimport numpy as np\nimport random\n\nimg_p...
[ [ "torch.sigmoid", "torch.load", "numpy.asarray", "torch.utils.data.DataLoader", "torch.no_grad" ] ]
zenanz/ChemTables
[ "050eb5eb7ace73862352b759cc2b597fdfe1bfe1" ]
[ "1dmodel/train.py" ]
[ "from tqdm import tqdm\nimport os\nimport sys\nimport pickle\nimport logging\nimport numpy as np\nimport random\nimport torch\nimport json\nfrom torch.utils.data import DataLoader\nfrom torch.nn import CrossEntropyLoss\nfrom transformers import AdamW, get_linear_schedule_with_warmup\n# from pytorch_transformers imp...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.utils.data.DataLoader", "sklearn.metrics.confusion_matrix", "torch.nn.DataParallel", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "sklearn.metrics.f1_score", "torch.cuda.device_count", "sklearn.metrics.classificat...
lucaskeiler/AlgoritmosTCC
[ "eccf14c2c872acb9e0728eb8948eee121b274f2e" ]
[ "Algorithms/t(G)_n-k/Correctness/testsVisualization.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import interpolate\n\ndef loadFile(fileName):\n totalTestsList = []\n correctTestsList = []\n with open(fileName) as file:\n line = file.readline()\n while line:\n s = line.split(' ')\n total = int(s[0])\n ...
[ [ "matplotlib.pyplot.ylim", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ] ]
aksarkar/scmodes
[ "a05a81d69a1e4b2b21ee072c3cf0bcef65360f33" ]
[ "tests/benchmark/test_gof.py" ]
[ "import anndata\nimport multiprocessing as mp\nimport numpy as np\nimport os\nimport pandas as pd\nimport pytest\nimport rpy2.robjects.packages\nimport rpy2.robjects.pandas2ri\nimport scipy.sparse as ss\nimport scipy.stats as st\nimport scmodes\nimport scmodes.benchmark.gof\n\nfrom .fixtures import test_data\n\nash...
[ [ "pandas.Series", "numpy.isfinite", "numpy.random.seed", "numpy.arange", "numpy.median", "pandas.DataFrame", "scipy.stats.poisson", "numpy.zeros", "scipy.stats.nbinom", "numpy.isclose" ] ]
jonathan-taylor/l0bnb
[ "0c2beef67b92861ec51bc3514d485eabad43c611" ]
[ "l0bnb/tree.py" ]
[ "import time\nimport queue\nimport sys\nfrom collections import namedtuple\n\nimport numpy as np\n\nfrom .node import Node, upper_bound_solve\nfrom .utilities import branch, is_integral\n\n\nclass BNBTree:\n def __init__(self, x, y, int_tol=1e-4, rel_tol=1e-4):\n \"\"\"\n Initiate a BnB Tree to sol...
[ [ "numpy.zeros", "numpy.linalg.norm", "numpy.nonzero" ] ]
cankucuksozen/COMP551--ComputerVision-with-DL
[ "44c4510a7163ad4bcf00ce0e9d112ae1ba59b143", "44c4510a7163ad4bcf00ce0e9d112ae1ba59b143" ]
[ "models/ResEVANet_v4.py", "layers/attn1d_v4.py" ]
[ "\"\"\"\n\nResNet + Expanding Visual Attention (ResEVANet) for CIFAR10 Image Classification.\n\nResNet backbone is adopted from Yerlan Idelbayev's implementation, \naccessed at: https://github.com/akamaster/pytorch_ResNet_cifar10/blob/master/ResNet.py\n\nby Can Küçüksözen\n\n\"\"\"\n\n\nimport torch\nimport torch.n...
[ [ "torch.nn.Sequential", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.BatchNorm2d", "torch.nn.functional.pad", "torch.nn.init.kaiming_normal_" ], [ "torch.nn.Softmax", "torch.reshape", "torch.nn.Embedding", "torch.nn.LayerNorm", "tor...
debug314/coursework
[ "beb732d0d06b5a338ba8115d59ed1c75edbb1bdb" ]
[ "K-Means Clustering in Python/friend-of-the-bank.py" ]
[ "# Foundations of Data Science: K-Means Clustering in Python\n# by University of London & Goldsmiths, Coursera\n# Week 5: A Data Clustering Project\n\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patch\nfrom sklearn.cluster import KMeans\n\n# V1. Variance ...
[ [ "matplotlib.pyplot.legend", "matplotlib.patches.Ellipse", "pandas.read_csv", "matplotlib.pyplot.title", "sklearn.cluster.KMeans", "matplotlib.pyplot.subplots", "numpy.std", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ...
filipmazurek/Quantum-Workspace
[ "e2df6cfafa8664cd5fba8786ccf6e0540a0584fd" ]
[ "rigetti_result_analysis.py" ]
[ "\"\"\"\nFilip Mazurek - 9/1/2019\n\nUtility to make analyzing results from pyquil easier\n\"\"\"\n\nfrom collections import Counter\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef convert_result(measurements):\n # TODO: please note the endian-ness and how that affects everything else. Right now le...
[ [ "numpy.array", "matplotlib.pyplot.show" ] ]
ziyi-yang/deepxde
[ "61af63c3eeb6ea625670b2886be1bf51fa1df554" ]
[ "deepxde/model.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\n\nfrom . import display\nfrom . import losses as losses_module\nfrom . import metrics as metrics_module\nfrom . import train as train_module\nfrom .backend import tf\nfrom .callback...
[ [ "numpy.hstack", "numpy.std", "numpy.mean", "numpy.sum" ] ]
harmsm/epistasis
[ "741b25b3e28015aeeba8d4efc94af1e1d811cd63" ]
[ "epistasis/pyplot/coefs.py" ]
[ "__description__ = \\\n\"\"\"\nPlot barplot with epistatic coefficients.\n\"\"\"\n__author__ = \"Zach Sailer\"\n\nimport gpmap\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.path import Path\nimport matplotlib.patches as patches\nimport matplotlib as mpl\n\nimport numpy as np\nfrom scipy.stats import norm as s...
[ [ "matplotlib.colors.BoundaryNorm", "scipy.stats.norm.cdf", "matplotlib.path.Path", "matplotlib.lines.Line2D", "matplotlib.pyplot.subplots", "matplotlib.pyplot.subplot", "matplotlib.colors.ListedColormap", "matplotlib.gridspec.GridSpec", "matplotlib.colors.colorConverter.to_rgba"...
nasa/Plot3D_utilities
[ "f71d612ff1c6969059cc199b4b84c2d85fdf0a87" ]
[ "python/plot3d/face.py" ]
[ "import itertools\nfrom typing import Dict, List, Tuple\nimport numpy as np\nfrom numpy.lib import math\nfrom .block import Block\n\nclass Face:\n \"\"\"Defines a Face of a block for example IMIN,JMIN,JMIN to IMAX,JMIN,JMIN\n \"\"\"\n def __init__(self,nvertex:int=4):\n \"\"\" Defines a face using n...
[ [ "numpy.argsort", "numpy.where", "numpy.zeros", "numpy.lib.math.sqrt" ] ]