repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ShNadi/OkCupid-project
[ "5eca6571e5c2a65c9cc185fadd24b0724a3cbb1b" ]
[ "src/classifiers.py" ]
[ "from sklearn.model_selection import train_test_split\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom imblearn.pipeline import Pipeline\nfrom sklearn.linear_model import LogisticRegression\nimport matplotlib.pyplot as plt\nplt.rc(\"font\", size=10)\nimport itertools\nimport numpy as np\nfrom skle...
[ [ "matplotlib.pyplot.imshow", "pandas.Series", "matplotlib.pyplot.rc", "sklearn.metrics.confusion_matrix", "pandas.DataFrame", "sklearn.metrics.classification_report", "matplotlib.pyplot.tight_layout", "sklearn.feature_extraction.text.CountVectorizer", "matplotlib.pyplot.close", ...
littlefisherfisher/models
[ "11fd89c0b45853e2ca99b86bf1638d5e8fbd9d34" ]
[ "mobilenetv3/train.py" ]
[ "import oneflow.experimental as flow\nimport argparse\nimport numpy as np\nimport os\nimport time\n\nfrom models.mobilenetv3 import mobilenet_v3_small\nfrom utils.ofrecord_data_utils import OFRecordDataLoader\n\n\ndef _parse_args():\n parser = argparse.ArgumentParser(\"flags for train mobilenetv3\")\n parser....
[ [ "numpy.argmax" ] ]
joshuadeng/torchrec
[ "4b525a1132db70da09e52839bb87575e523bf7b2" ]
[ "torchrec/distributed/tests/test_train_pipeline.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nimport unittest\nfrom dataclasses import dataclass\nfrom typing i...
[ [ "torch.randint", "torch.distributed.is_initialized", "torch.nn.Linear", "torch.nn.BCEWithLogitsLoss", "torch.rand", "torch.optim.SGD", "torch.device", "torch.cuda.device_count" ] ]
ElementAI/synbols
[ "618a171a0b21e8700582636af48a293185c20fc8" ]
[ "synbols/drawing.py" ]
[ "import os\nfrom glob import glob\n\nimport cairo\nimport numpy as np\nfrom PIL import Image as PILImage\n\n\ndef draw_symbol(ctxt, attributes):\n \"\"\"Core function drawing the characters as described in `attributes`\n\n Args:\n ctxt: cairo context to draw the image\n attributes: Object of typ...
[ [ "numpy.clip", "numpy.min", "numpy.cos", "numpy.rad2deg", "numpy.sin", "numpy.concatenate", "numpy.max", "numpy.mean", "numpy.array", "numpy.random.RandomState" ] ]
GBERESEARCH/optionvisualizer
[ "98830c478f7edbacb18f30d679ee4010c7ed7fe6" ]
[ "optionvisualizer/simple_payoffs.py" ]
[ "\"\"\"\nOne and Two Option Payoffs\n\n\"\"\"\nimport numpy as np\nfrom optionvisualizer.multi_payoffs import MultiPayoff\nfrom optionvisualizer.option_formulas import Option\n# pylint: disable=invalid-name\n\nclass SimplePayoff():\n \"\"\"\n Calculate One and Two Option payoffs - Call / Put / Spread / Stradd...
[ [ "numpy.exp", "numpy.linspace" ] ]
leonardohcl/Nature-Inspired-Computing-Algorithms
[ "7227a6516c746b248e861b4c582672cff1864229" ]
[ "project_1_task_1.py" ]
[ "# encoding: utf-8\n\nfrom BinaryString import BinaryString\nfrom InputMethods import readIntMin, readIntInterval, readFloatInterval, readIntInterval, readOption, readFloat, secondsToString\nfrom NatureInspiredAlgorithms import geneticAlgorithm\nimport matplotlib.pyplot as plt\nimport time\nimport math\nfrom random...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.bar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
xxxnell/how-do-vits-work
[ "dbe209871315e7b86d6fe2d7b90592d3ca23fb14" ]
[ "models/pit.py" ]
[ "\"\"\"\nThis model is based on the implementation of https://github.com/lucidrains/vit-pytorch.\n\"\"\"\nfrom math import sqrt\n\nimport torch\nfrom torch import nn\n\nfrom einops import rearrange\n\nfrom models.layers import Lambda\nfrom models.embeddings import ConvEmbedding, CLSToken, AbsPosEmbedding\nfrom mode...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.cat", "torch.nn.Conv2d", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.Identity" ] ]
auesro/ABRS
[ "980ec3e225021a6d1566d51fe0e3a03443233d9f" ]
[ "ST_image_to_ST_feature_batch.py" ]
[ "# extract ST Features from ST images (dim reduction)\r\n\r\nimport numpy as np\r\nimport scipy\r\nfrom scipy import ndimage\r\nfrom scipy import misc\r\nimport pickle\r\nimport time\r\nimport matplotlib.pyplot as plt\r\nimport cv2\r\nimport os\r\nimport natsort\r\n\r\nfrom ABRS_modules import discrete_radon_transf...
[ [ "numpy.dot", "numpy.absolute", "numpy.fft.fft", "numpy.reshape", "numpy.nan_to_num", "numpy.max", "numpy.shape", "numpy.zeros" ] ]
eliaswalyba/2021-deep-learning-gift-course
[ "c17c4370f0d1032ce7c3ea559f331c7318abba9a" ]
[ "exercises/03-object-detection/03-Pedestrian-Counting/src/utils.py" ]
[ "import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport tensorflow as tf\r\n\r\ndef run_inference_for_single_image(image, graph):\r\n \"\"\"Computes the prediction of the object detection on a single image\r\n\r\n Parameters:\r\n image (np.array): An image in shape [height, width, 3]\r\n\tgraph: a...
[ [ "numpy.expand_dims", "tensorflow.greater", "tensorflow.slice", "tensorflow.cast", "tensorflow.expand_dims", "tensorflow.squeeze", "tensorflow.Session", "tensorflow.get_default_graph" ] ]
akshaybahadur21/BigDL
[ "55b60e2a62d89ae62d706833e3bcf8d2674d6eea" ]
[ "python/nano/src/bigdl/nano/pytorch/runtime_binding/onnxrt_inference.py" ]
[ "#\n# Copyright 2016 The BigDL 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 required by applicable law ...
[ [ "torch.onnx.export", "torch.from_numpy" ] ]
WenRichard/EasyTransfer
[ "6909238c45b5708968f955b7d971a79b25434597" ]
[ "scripts/天池大赛专区/convert_csv_to_tfrecords.py" ]
[ "import tensorflow as tf\nfrom easytransfer import base_model\nfrom easytransfer.datasets import CSVReader, TFRecordWriter\nfrom easytransfer import preprocessors\n\nclass FinetuneSerialization(base_model):\n def __init__(self, **kwargs):\n super(FinetuneSerialization, self).__init__(**kwargs)\n\n def ...
[ [ "tensorflow.app.run" ] ]
constantinpape/ome-zarr-py
[ "715f44d2519b6d71f1b79aabfef3fc8287bc87e2" ]
[ "ome_zarr/reader.py" ]
[ "\"\"\"Reading logic for ome-zarr.\"\"\"\n\nimport logging\nimport math\nfrom abc import ABC\nfrom typing import Any, Dict, Iterator, List, Optional, Type, Union, cast\n\nimport dask.array as da\nimport numpy as np\nfrom dask import delayed\nfrom vispy.color import Colormap\n\nfrom .io import ZarrLocation\nfrom .ty...
[ [ "numpy.zeros" ] ]
danich1/annorxiver
[ "8fab17e1c3ebce7b9e3fc54ea64585b37d9b3825" ]
[ "biorxiv/publication_delay_experiment/02_publication_delay_experiment_figure_exploration.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,py:light\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.9.1+dev\n# kernelspec:\n# display_name: Python [conda env:annorxiver]\n# language: python\n# name...
[ [ "matplotlib.pyplot.gca", "pandas.read_csv", "pandas.to_datetime", "matplotlib.colors.LogNorm", "numpy.min", "numpy.unique", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.colorbar", "scipy.stats.linregress", "matplotlib.pyplot.xlim", "nump...
yuvalot/ml_final_project
[ "fefb67c92504ceeb7999e49daa8a8aa5a60f1c61" ]
[ "src/ml_final_project/optimizers/improved_lookahead.py" ]
[ "import tensorflow as tf\r\nfrom tensorflow_addons.utils import types\r\nfrom typeguard import typechecked\r\n\r\n\r\nclass ImprovedLookahead(tf.keras.optimizers.Optimizer):\r\n \"\"\"This class allows to extend optimizers with the lookahead mechanism - with the addition of the momentum concept.\r\n The mecha...
[ [ "tensorflow.control_dependencies", "tensorflow.cast", "tensorflow.keras.optimizers.get", "tensorflow.math.floordiv", "tensorflow.where", "tensorflow.group", "tensorflow.keras.optimizers.serialize" ] ]
hboisgibault/KeyphraseVectorizers
[ "37816e6496c15db891182e5148ecbc9d4e585934" ]
[ "keyphrase_vectorizers/keyphrase_tfidf_vectorizer.py" ]
[ "\"\"\"\n.. _spaCy pipeline: https://spacy.io/models\n.. _stopwords available in NLTK: https://github.com/nltk/nltk_data/blob/gh-pages/packages/corpora/stopwords.zip\n.. _POS-tags: https://github.com/explosion/spaCy/blob/master/spacy/glossary.py\n.. _regex pattern: https://docs.python.org/3/library/re.html#regular-...
[ [ "sklearn.feature_extraction.text.TfidfTransformer", "sklearn.exceptions.NotFittedError" ] ]
krantikiran/EdgeML
[ "e5c7bd7c56884ca61f6d54cedb0074553cfdc896", "e5c7bd7c56884ca61f6d54cedb0074553cfdc896" ]
[ "Tools/SeeDot/seedot/compiler/converter/test.py", "pytorch/examples/FastCells/fastcell_example.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\nimport math\nimport numpy as np\n\n\ndef getScale(maxabs: float, bits):\n return int(np.ceil(np.log2(maxabs) - np.log2((1 << (bits - 2)) - 1)))\n\n\ndef printUspsRNN():\n ite = 16\n print(\"let a0 = (XX[0] * ...
[ [ "numpy.ceil", "numpy.log2", "numpy.ldexp" ], [ "torch.manual_seed", "torch.cuda.is_available", "numpy.random.seed" ] ]
riskaware-ltd/ridt
[ "c0288a2f814b2749bdf73de7157f7477ca271aff" ]
[ "ridt/analysis/exposure.py" ]
[ "from typing import Union\n\nfrom scipy.integrate import cumtrapz\nfrom numpy import ndarray\n\nfrom ridt.config import RIDTConfig\n\nfrom ridt.data import DataStore\nfrom ridt.data import BatchDataStore\n\n\nclass Exposure:\n \"\"\"The Exposure class\n\n The class which takes a :class:`~.DataStore` or :class...
[ [ "scipy.integrate.cumtrapz" ] ]
arplaboratory/python_gp_kalman_hyperparam
[ "4540de21e98185767998a740ca47b20c7b31e563" ]
[ "pssgp/toymodels/gp_samples.py" ]
[ "\"\"\"\nDraw a sample from a GP.\n\n\"\"\"\n\nimport numpy as np\nfrom scipy.linalg import expm\n\n\n# from ..kalman import StateSpaceModel\n\ndef draw_gp_batch(gp: None,\n T: np.ndarray) -> np.ndarray:\n \"\"\"\n Draw a sample from an GP given cov and mean functions.\n \n Args:\n ...
[ [ "scipy.linalg.expm", "numpy.random.randn", "numpy.random.rand", "numpy.interp", "numpy.linalg.cholesky", "numpy.zeros", "numpy.sum" ] ]
yull1860outlook/Data-Analysis
[ "34a48f16f6be757ed3f35cb3fc458569023c9bd8", "34a48f16f6be757ed3f35cb3fc458569023c9bd8" ]
[ "sentdex_data_analysis/pandas_joiningData.py", "sentdex_data_analysis/pandas_intro.py" ]
[ "import pickle\nimport pandas as pd\nimport quandl\nimport matplotlib.pyplot as plt\nfrom matplotlib import style\n\nstyle.use(\"seaborn\")\n\nquandl.ApiConfig.api_key = \"rFsSehe51RLzREtYhLfo\"\n\n\ndef mortgage_30yr():\n df = quandl.get(\"FMAC/MORTG\")\n df = df[df.index > \"1974-12-01\"]\n df = (df[\"Va...
[ [ "matplotlib.pyplot.subplot", "matplotlib.style.use" ], [ "matplotlib.pyplot.show", "matplotlib.style.use" ] ]
evggenshch/EDVR
[ "ffcf0ca6b9f6f526c35b1d59dfdc75eb1757e2ec" ]
[ "codes/test_Vid4_REDS4_with_GT_all.py" ]
[ "\n'''\nTest Vid4 (SR) and REDS4 (SR-clean, SR-blur, deblur-clean, deblur-compression) datasets\n'''\n\nimport os\nimport os.path as osp\nimport glob\nimport logging\nimport numpy as np\nimport cv2\nimport torch\nimport copy\nimport json\n\nimport utils.util as util\nimport data.util as data_util\nimport models.arc...
[ [ "torch.LongTensor", "torch.nn.Parameter", "torch.load", "numpy.copy", "torch.device" ] ]
maxberezov/PaddleOCR
[ "09604c38e42591c240771edbbff43a6dd7ebf592", "09604c38e42591c240771edbbff43a6dd7ebf592" ]
[ "ppocr/data/imaug/gen_table_mask.py", "tools/infer_e2e.py" ]
[ "\"\"\"\n# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Un...
[ [ "numpy.ones_like", "numpy.zeros", "numpy.ones" ], [ "numpy.expand_dims" ] ]
JeshuaT/PsyNeuLink
[ "912f691028e848659055430f37b6c15273c762f1", "912f691028e848659055430f37b6c15273c762f1" ]
[ "psyneulink/library/models/Nieuwenhuis2005Model.py", "Scripts/Debug/markus_test_umemoto.py" ]
[ "# Import all dependencies.\nimport argparse\n\nimport numpy as np\nimport psyneulink as pnl\n# from scipy.special import erfinv # need to import this to make us of the UniformToNormalDist function.\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--no-plot', action='store_false', help='Disable plotting'...
[ [ "matplotlib.pyplot.gca", "numpy.linspace", "matplotlib.pyplot.title", "numpy.concatenate", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ], [ "numpy.arange" ] ]
A-LinCui/Discriminator-Guiding-Knowledge-Distillation-MAR
[ "e8caad8de2a559b9c9532448bdcdedd566cb2cfa" ]
[ "aw_nas/final/ofa_model.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nA cell-based model whose architecture is described by a genotype.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport re\n\nimport torch\nfrom torch import nn\n\nfrom aw_nas.common import genotype_from_str\nfrom aw_nas.final.base import FinalModel\nfrom aw_nas.weights_manage...
[ [ "torch.load" ] ]
StdCarrot/PyAthena
[ "1c4688714ff45f1e9e0127900ee38746e3375975" ]
[ "tests/test_pandas_cursor.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport contextlib\nimport random\nimport string\nimport time\nimport unittest\nfrom concurrent.futures import ThreadPoolExecutor\nfrom datetime import datetime\nfrom decimal import Dec...
[ [ "pandas.Timestamp" ] ]
Frankzd/distiller
[ "931138e2d23989ef9305712e5aa147ae3dff53de" ]
[ "apputils/checkpoint.py" ]
[ "#\n# Copyright (c) 2018 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 ...
[ [ "torch.load", "torch.save" ] ]
JamesPMColeman/Computer-Vision-Practice
[ "bc0c832d275b811a59f135d0a06eea6478945d05" ]
[ "Homework2/homework2_part2.py" ]
[ "#=============================================================================#\n# #\n# James Coleman #\n# CS 3150 ...
[ [ "numpy.square", "matplotlib.pyplot.imshow", "numpy.absolute", "matplotlib.pyplot.title", "scipy.signal.convolve2d", "numpy.max", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
usarawgi911/PD-mlhc
[ "5fc631e74466b3328201eebb212f47bf3e3f5264" ]
[ "dtw_distance.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom matplotlib import pyplot as plt\nfrom tqdm import tqdm\nfrom fastdtw import fastdtw\nimport pickle\n\n# find the distance between a set of samples\n# it take too long to run this on every sample (and it's not very insightful)\n\nsampling_rate = 0.1\n\nbase = '/Users/da...
[ [ "numpy.asarray", "pandas.read_csv", "numpy.random.rand" ] ]
yisyang/stock-prediction
[ "c671a4b32a06c4732d126dc2d8d1ba2bfc021828" ]
[ "data_loader.py" ]
[ "import csv\nimport numpy as np\nimport torch\n\n\nclass DataLoader:\n def __init__(self, x_seq_length, x_features, y_seq_length, mode='train', return_format='keras',\n torch_device=None):\n self.x_seq_length = x_seq_length\n self.x_features = x_features\n self.y_seq_length =...
[ [ "numpy.take", "numpy.array", "torch.from_numpy", "numpy.random.default_rng" ] ]
facebookresearch/MTRF
[ "2fee8f3f1c2150fcecc2db2fa9e122a664a72d72" ]
[ "MTRF/r3l/r3l/utils/camera/kinect_image_service.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates\n# Copyright (c) MTRF authors\n\nfrom sensor_msgs.msg import Image as Image_msg\nimport rospy\nimport numpy as np\nimport skimage\nimport matplotlib.pyplot as plt\n\nimport warnings\nfrom sklearn.exceptions import DataConversionWarning\nwarnings.filterwarnings(acti...
[ [ "numpy.frombuffer", "matplotlib.pyplot.show" ] ]
sxj731533730/shufflenetv2_demo
[ "291edf1ccdf4982b4d1ac230efcc177af5b0b5f1" ]
[ "my_dataset.py" ]
[ "from PIL import Image\nimport torch\nfrom torch.utils.data import Dataset\n\n\nclass MyDataSet(Dataset):\n \"\"\"自定义数据集\"\"\"\n\n def __init__(self, images_path: list, images_class: list, transform=None):\n self.images_path = images_path\n self.images_class = images_class\n self.transfor...
[ [ "torch.stack", "torch.as_tensor" ] ]
Atinary-technologies/experiment_planning_plugins
[ "1c5110abceb456ee19a2924cf58ec3d72cfefbb6" ]
[ "tests/test_chimera.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\n\nfrom chimera import Chimera\n\n# ==============================================================================\n\n\ndef test_chimera_absolutes():\n chim = Chimera(absolutes=np.zeros(2))\n assert len(chim.absolutes) == 2\n assert np.sum(chim.absolutes) == 0\n...
[ [ "numpy.abs", "numpy.random.seed", "numpy.isnan", "numpy.random.uniform", "numpy.zeros", "numpy.sum" ] ]
barretobrock/server-tools
[ "2f2b899994df90817686b2232d3d65e53defd8c2" ]
[ "scripts/weather/daily_weather_and_sig_temp_warn.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nfrom datetime import (\n datetime,\n timedelta\n)\nimport pandas as pd\nfrom kavalkilu import LogWithInflux\nfrom servertools import (\n YrNoWeather,\n YRNOLocation,\n SlackWeatherNotification\n)\nfrom servertools.plants import Plants\n\n\n# Initiate ...
[ [ "pandas.to_datetime" ] ]
m4ta1l/botorch
[ "26a6a511db78dbecae0665755a08afdf3b0fe9b5" ]
[ "test/utils/test_sampling.py" ]
[ "#!/usr/bin/env python3\n# 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 itertools\nimport warnings\n\nimport torch\nfrom botorch import settings\nfrom botorch.exceptions.war...
[ [ "torch.all", "torch.Generator", "torch.Size", "torch.empty", "torch.zeros", "torch.random.get_rng_state", "torch.eye", "torch.equal", "torch.unique", "torch.rand" ] ]
luzgool/ReachMaster
[ "e7ef5087fb4e5c55e0b680fc00391f2f8cdc5367" ]
[ "software/reach_master/build/lib.linux-x86_64-2.7/reachmaster/settings/camera_settings.py" ]
[ "\"\"\"The camera settings window is opened as a child of the \nReachMaster root application. It provides functionality for \nspecifying the number of cameras, setting their intrinsic \nparameters (e.g., exposure, gain, triggers, etc.), and data \noutput parameters (e.g., cropping, pixel resolution, etc.). It \npro...
[ [ "numpy.hstack", "numpy.sqrt" ] ]
vanvalenlab/tf-serving-redis-interface
[ "f696c05ee622ac6cc38dc1afcef2379d2ea9d9f0" ]
[ "redis_consumer/consumers/caliban_consumer_test.py" ]
[ "# Copyright 2016-2022 The Van Valen Lab at the California Institute of\n# Technology (Caltech), with support from the Paul Allen Family Foundation,\n# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.\n# All rights reserved.\n#\n# Licensed under a modified Apache License, Version 2.0 (the \...
[ [ "numpy.random.random", "numpy.zeros", "numpy.random.randint" ] ]
mrelmi/InsightFace-PyTorch
[ "a235c4f6e3f3ea58aac53a0420921431b97995a8" ]
[ "utils.py" ]
[ "import argparse\nimport os\nfrom shutil import copyfile\n\nimport cv2 as cv\nimport numpy as np\nimport torch\n\nfrom align_faces import get_reference_facial_points, warp_and_crop_face\nfrom config import im_size\nfrom retinaface.detector import detector\n\n\ndef clip_gradient(optimizer, grad_clip):\n \"\"\"\n ...
[ [ "numpy.reshape", "torch.save" ] ]
TinasheMTapera/bids-pres
[ "7ad27ec13966b498cee4e55c6c3a47c0ef90e1bd" ]
[ "flywheel_bids_tools/group_query.py" ]
[ "import pandas as pd\nimport argparse\nfrom .query_bids import unlist_item\n\n\ndef read_flywheel_csv(fpath, required_cols=['acquisition.label']):\n '''\n Read in a CSV and also ensure it's one of ours\n\n Input:\n fpath: path to the file\n required_cols: list of columns to ensure csv is a fl...
[ [ "pandas.read_csv" ] ]
houshengyuan/MAN
[ "03912e80b21e0fc40c36515b6893d4244b82e6b6" ]
[ "translation/fairseq/data/data_utils.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport contextlib\nimp...
[ [ "numpy.random.get_state", "numpy.random.set_state", "numpy.random.seed" ] ]
edgarriba/lightning-flash
[ "62472d7615d95990df92a8a2f92f80af1ab737ac" ]
[ "flash_examples/finetuning/summarization.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.cuda.is_available" ] ]
peterdonnelly1/u24_lymphocyte
[ "dff7ceed404c38582feb81aa9b8a55d80ada0f77" ]
[ "archive/lym_pipeline/prediction/pred.py" ]
[ "import pickle\nimport sys\nimport os\nimport urllib\nimport gzip\nimport cPickle\nimport time\nimport lasagne\nimport theano\nimport numpy as np\nimport theano.tensor as T\n\nfrom lasagne import layers\nfrom lasagne.updates import nesterov_momentum\nfrom nolearn.lasagne import NeuralNet\nfrom nolearn.lasagne impor...
[ [ "numpy.int32", "sklearn.metrics.roc_curve", "numpy.copy", "sklearn.metrics.auc", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
ShiroNekoHouse/MyFate
[ "961c0e6e0dff0b3af0fe7186f1429b41ab8c3093" ]
[ "functional_enc_msg_party_test.py" ]
[ "#\n# Copyright 2019 The FATE 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 r...
[ [ "tensorflow.global_variables_initializer", "sklearn.metrics.precision_recall_fscore_support", "tensorflow.reset_default_graph", "tensorflow.Session", "numpy.array" ] ]
apmoore1/allennlp
[ "bdb29a831ed68cb948b18b42fa61646b9ec11bf8" ]
[ "allennlp/tests/modules/masked_layer_norm_test.py" ]
[ "import numpy as np\nimport torch\n\nfrom allennlp.common.testing import AllenNlpTestCase\nfrom allennlp.modules.masked_layer_norm import MaskedLayerNorm\n\n\nclass TestMaskedLayerNorm(AllenNlpTestCase):\n def test_masked_layer_norm(self):\n x_n = np.random.rand(2, 3, 7)\n mask_n = np.array([[1, 1,...
[ [ "torch.from_numpy", "numpy.array", "numpy.expand_dims", "numpy.random.rand" ] ]
ConnorChristie/MonoGRNet
[ "693a7534c0fd4d69e5705bdf23386932b96a87a4" ]
[ "inputs/kitti_input.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport matplotlib\nmatplotlib.use('Agg')\nimport itertools\nimport json\nimport logging\nimport os\nimport sys\nimport random\nfrom random import shuffle\nimport pdb\nfrom PIL import Image, ImageEnhance\...
[ [ "numpy.dot", "tensorflow.image.random_contrast", "tensorflow.minimum", "tensorflow.image.random_saturation", "matplotlib.pyplot.plot", "numpy.arctan2", "tensorflow.image.random_hue", "numpy.clip", "numpy.reshape", "numpy.fliplr", "matplotlib.pyplot.close", "numpy.ze...
guillaumekln/OpenNMT-tf
[ "ca96cb35efd083d0380c05041bc254f81ee383e0" ]
[ "opennmt/models/model.py" ]
[ "\"\"\"Base class for models.\"\"\"\n\nfrom __future__ import print_function\n\nimport time\nimport abc\nimport six\n\nimport tensorflow as tf\n\nfrom opennmt.utils import decay\nfrom opennmt.utils.misc import add_dict_to_collection, item_or_tuple\n\n\ndef learning_rate_decay_fn(decay_type,\n ...
[ [ "tensorflow.to_int64", "tensorflow.constant", "tensorflow.assign_add", "tensorflow.Variable", "tensorflow.greater", "tensorflow.estimator.export.PredictOutput", "tensorflow.maximum", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.reduce_all", "tensorflow.minimu...
koeller21/ma_code
[ "3b31fb7af74cc62e495a6a0ad77d52aa9d7d5b1d" ]
[ "gym_torcs.py" ]
[ "\n\nimport gym\nfrom gym import spaces\nimport numpy as np\n\nimport snakeoil3_gym as snakeoil3\nimport numpy as np\nimport copy\nimport collections as col\nimport os\nimport time\n\n\nclass TorcsEnv:\n terminal_judge_start = 560 # If after 100 timestep still no progress, terminated\n termination_limit_prog...
[ [ "numpy.abs", "numpy.array", "numpy.cos", "numpy.sin" ] ]
jphacks/NG_1703
[ "0c0bec03d71f467f90d8fbe01b31ed4341f3e1a5" ]
[ "komagen/seb_inclient_fordemo.py" ]
[ "#!/usr/bin/env python\n# vim:fileencoding=utf-8\nimport time\nimport numpy as np\nimport pyaudio as pa\nimport requests\nimport sys\nimport json\nimport string, random\nimport cv2\n\n# set Device ID to variable \"id\".\n# Device ID: You can get the id from portal\n# https://www6.arche.blue/portal/\n#id = \"device ...
[ [ "numpy.frombuffer" ] ]
Akorsvang/WIRT-implementation
[ "086a03007687dbb10f48a9228be47c8a2828bc9d" ]
[ "polar/polar_common.py" ]
[ "\"\"\"\nShared functions used for polar encoding and decoding\n\"\"\"\n\nfrom functools import lru_cache\n\nimport numpy as np\n\ndef idx(phi, beta, lamb):\n return phi + (beta << lamb)\n\ndef polar_calculate_weights(N):\n \"\"\"\n Calculate polar weights\n Right now only supports N <= 2**8, for more l...
[ [ "numpy.log2", "numpy.fliplr", "numpy.arange", "numpy.kron", "numpy.mod", "numpy.argsort", "numpy.array", "numpy.empty", "numpy.unpackbits" ] ]
littlepure2333/st-gcn
[ "1b002c6d42902d135da605d649654aa00cad0d06" ]
[ "feeder/feeder_nmv.py" ]
[ "# sys\nimport os\nimport sys\nimport numpy as np\nimport random\nimport pickle\nimport json\n# torch\nimport torch\nimport torch.nn as nn\nfrom torchvision import datasets, transforms\n\n# operation\nfrom . import tools\n\n\nclass Feeder_nmv(torch.utils.data.Dataset):\n \"\"\" Feeder for skeleton-based action r...
[ [ "numpy.zeros" ] ]
rcrehuet/getcontacts
[ "a82354367483f79bdbeaa8d43d47d34dc196f70e" ]
[ "Applications/get_fingerprint_clusters.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\n\n\"\"\"\n\nfrom scipy.cluster.hierarchy import linkage, fcluster\nimport numpy as np\n\n\ndef parse_table(lines):\n col_names = [l.strip() for l in lines[0].split(\"\\t\")[2:]]\n row_names = []\n frequencies = []\n\n for line in lines[1:]:\n tokens = line.split(\...
[ [ "numpy.matrix", "numpy.ix_", "scipy.cluster.hierarchy.linkage", "numpy.sum", "scipy.cluster.hierarchy.fcluster" ] ]
leonyip/GamestonkTerminal
[ "030bec00e5580d90c57e116c8800e773237c5baf", "030bec00e5580d90c57e116c8800e773237c5baf" ]
[ "gamestonk_terminal/helper_funcs.py", "gamestonk_terminal/main_helper.py" ]
[ "import argparse\nfrom datetime import datetime, timedelta, time as Time\nimport os\nimport random\nimport re\nimport sys\nfrom pytz import timezone\nimport iso8601\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom holidays import US as holidaysUS\nfrom colorama import Fore, Style\nimport pandas.io.formats....
[ [ "matplotlib.pyplot.legend", "matplotlib.use", "matplotlib.pyplot.minorticks_on", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "pandas.plotting.register_matplotlib_converters", "matplotlib.pyplot.bar", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "pandas._con...
ninoch/UDAGCN
[ "f1e1111f188b3f4738b7cdefea20d5ca4370e22a" ]
[ "dual_gnn/cached_gcn_conv.py" ]
[ "import torch\nfrom torch.nn import Parameter\nfrom torch_scatter import scatter_add\nfrom torch_geometric.nn.conv import MessagePassing\nfrom torch_geometric.utils import add_remaining_self_loops\n\nfrom torch_geometric.nn.inits import glorot, zeros\n\n\nclass CachedGCNConv(MessagePassing):\n r\"\"\"The graph c...
[ [ "torch.matmul", "torch.Tensor" ] ]
juliob29/BitcoinTalk-Insights
[ "73033791698c67bb1f6268dc0b762832f0e097dd" ]
[ "skill/utils.py" ]
[ "\"\"\"\nUtility functions for testing different search \nalgorithms implemented in this skill.\n\"\"\"\nimport signal\nimport numpy as np\n\nfrom functools import wraps\n\n\nclass LossFunctions:\n \"\"\"\n Loss functions to evaluate the performance\n of search algorithms. All methods available in \n th...
[ [ "numpy.subtract", "numpy.abs" ] ]
dcroote/madic
[ "fb00f312f5abc9f5a0bfc4a00a5a2e6e1c4ee563" ]
[ "madic/interference.py" ]
[ "from __future__ import division\nimport numpy as np\nfrom madic import qc\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _req_tr_for_interference(vals):\n \"\"\" Scaling function for minimum transition ratio deemed interference\n\n Linear scaling between 0.7 and 0.95 for reference transit...
[ [ "numpy.min" ] ]
ksu-is/sports-betting
[ "71d6f128bc516fc8f26decad60c2f7fd6f828945" ]
[ "sportsbet/datasets/_utils.py" ]
[ "\"\"\"\nIncludes utilities to download and transform data.\n\"\"\"\n\nfrom abc import abstractmethod, ABCMeta\nfrom difflib import SequenceMatcher\nfrom datetime import datetime, timedelta\nfrom itertools import product\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import ParameterGrid\n...
[ [ "pandas.concat", "pandas.merge", "sklearn.utils.Bunch", "pandas.to_datetime", "pandas.Index", "pandas.DataFrame", "sklearn.model_selection.ParameterGrid", "sklearn.utils.check_scalar" ] ]
jonzia/Chess
[ "d75dca748f2dba93cbf7d78dd0cef1593ed775c1" ]
[ "test_bench.py" ]
[ "# ----------------------------------------------------\n# Test Bench for Chess AI v1.0.2\n# Created By: Jonathan Zia\n# Last Edited: Thursday, May 10 2018\n# Georgia Institute of Technology\n# ----------------------------------------------------\nimport tensorflow as tf\nimport numpy as np\nimport pieces as p\nimp...
[ [ "numpy.reshape", "tensorflow.placeholder", "tensorflow.contrib.layers.fully_connected", "numpy.mean", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.train.Saver", "numpy.array", "numpy.zeros", "numpy.savetxt" ] ]
cjs220/madminer
[ "5422880d5f05cb551dcf8ace956ef9a365d39c30" ]
[ "madminer/fisherinformation.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport logging\nimport numpy as np\nimport os\nimport random\nfrom scipy.interpolate import griddata, LinearNDInterpolator, CloughTocher2DInterpolator\nfrom scipy.stats import chi2\n\nfrom madminer.analysis import DataAnalyzer\nf...
[ [ "numpy.diag", "numpy.linspace", "numpy.einsum", "numpy.mean", "numpy.searchsorted", "scipy.interpolate.griddata", "numpy.sin", "scipy.interpolate.CloughTocher2DInterpolator", "numpy.ceil", "numpy.zeros", "numpy.logical_not", "numpy.linalg.inv", "numpy.isnan", ...
aume1/SatelliteTracker
[ "62725e1d1a72a1350b2af15d9e33fcd574ceb3a2" ]
[ "GPS.py" ]
[ "import pigpio\nimport numpy as np\n\n\nclass GPS:\n def __init__(self, pi, default_lat_long_alt= [-33.85670, 151.21521, 5]):\n super().__init__()\n self.pi = pi\n self.ser = self.pi.serial_open('/dev/serial0', 9600)\n self.previous_lat_long_alt = default_lat_long_alt\n self.va...
[ [ "numpy.zeros" ] ]
lhmartin/peptimizer
[ "ee96a52d5a7df38cf521c684ac57700d545014f8" ]
[ "utils/utils_common/calc_charge.py" ]
[ "import numpy as np\nimport math\n\ndef net_charge(sequence):\n \n '''\n Utility function to calculate net charge of a sequence\n Reference: http://www.chem.ucalgary.ca/courses/351/Carey5th/Ch27/ch27-1-4-2.html\n\n Parameters\n ----------\n sequence: str\n peptide sequence\n\n ...
[ [ "numpy.multiply" ] ]
jhapreis/MuonDecay
[ "2fc54cc7203f8f5815f8a13b9e8ddbf5253e75e7" ]
[ "Analyze/modules/root_file/assemble_root_files.py" ]
[ "import os\n\nimport ROOT as root\n\nimport pandas as pd\n\nfrom array import array\n\nfrom modules.out_file.read_output_file import Get_AcquisitionParameters\n\nfrom modules.out_file.convert_values import Convert_UnitsToMiliVolts_ScopeParameters\n\n\n\"\"\"\nFolder\n ROOT File\n TTree\n Branch...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
rgooler/MountainCheckHours
[ "13f0d33727a4ba408b0b35bd7ffe348b1edf78c3" ]
[ "MountainCheckHours.py" ]
[ "import numpy\nfrom os import path\nimport os\n\nsavefile = \"apsdfpboasdfhsa.sav\"\n\ndef find_savedir():\n if path.isfile(savefile):\n return '.'\n\n winpath = path.expandvars(r\"%USERPROFILE%\\\\AppData\\\\LocalLow\\\\David OReilly\\\\Mountain\")\n if path.isdir(winpath):\n return winpath\...
[ [ "numpy.fromfile" ] ]
wizelab8/SmartMirror
[ "bad186d4eceb6b6adfdcef90e7d93abfc04d9d61" ]
[ "BLENDER/FacialMotionCapture_v2/OpenCVAnimOperator.py" ]
[ "import bpy\nimport cv2\nimport time\nimport numpy\n\n# Download trained model (lbfmodel.yaml)\n# https://github.com/kurnianggoro/GSOC2017/tree/master/data\n\n# Install prerequisites:\n\n# Linux: (may vary between distro's and installation methods)\n# This is for manjaro with Blender installed from the package mana...
[ [ "numpy.linalg.norm", "numpy.copy", "numpy.delete", "numpy.insert", "numpy.array", "numpy.zeros" ] ]
CGCL-codes/naturalcc
[ "9c3329dd8387c8242deb52bf590ebe3ac795f8de" ]
[ "run/retrieval/nbow/predictor.py" ]
[ "#!/usr/bin/env python3 -u\n# 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\n\"\"\"\nEvaluate the perplexity of a trained language model.\n\"\"\"\nimport os\nimport re\nimport torch\...
[ [ "torch.cuda.device_count", "torch.cuda.empty_cache", "torch.cuda.is_available" ] ]
jakelever/corona-ml
[ "8ceb22af50d7277ebf05f2fd21bbbf68c080ed76" ]
[ "paper/ml_logs.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport json\nimport pandas as pd\n\ndir_name = 'ml_logs'\nlog_files = [ os.path.join(dir_name,f) for f in os.listdir(dir_name) if f.endswith('txt' )]\nprint(len(log_files))\n\nlog_data = []\nfor log_file in log_files:\n with open(log_file) as f:\n curly_lines = [ line for li...
[ [ "pandas.DataFrame" ] ]
timmahrt/ProMo
[ "015c83ca937a967be5b15eec531a7b61e47e176c" ]
[ "promo/morph_utils/interpolation.py" ]
[ "'''\nCreated on Jun 29, 2016\n\n@author: Tim\n'''\n\ntry:\n import numpy as np\nexcept ImportError:\n hasNumpy = False\nelse:\n hasNumpy = True\n\n \ndef _numpyCheck():\n if not hasNumpy:\n raise ImportError(\"Numpy required to do data interpolation. \"\n \"Install numpy...
[ [ "numpy.polyfit", "numpy.linspace" ] ]
LCAV/FRIDA
[ "ff5d51e498805b862c342dd216ccfffb22444b7f" ]
[ "tools/mkl_fft.py" ]
[ "''' \nWrapper for the MKL FFT routines.\n\nInspiration from:\nhttp://stackoverflow.com/questions/11752898/threaded-fft-in-enthought-python\n'''\n\nimport numpy as np\nimport ctypes as _ctypes\nimport os\n\nfrom dftidefs import *\n\ndef load_libmkl():\n if os.name == 'posix':\n try:\n lib_mkl =...
[ [ "numpy.rot90", "numpy.swapaxes", "numpy.pad", "numpy.fft.fft", "numpy.may_share_memory", "numpy.sqrt", "numpy.empty_like", "numpy.seterr", "numpy.random.randn", "numpy.prod", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
chandana1332/incubator-mxnet
[ "3f4f3d578c23388c850c1691e3e77ab5d6e81ee1" ]
[ "tests/python/unittest/test_gluon.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.asarray", "numpy.dtype", "numpy.ones", "numpy.random.rand", "numpy.random.randint" ] ]
alxgrin/kaggle
[ "e460e00490ae3e047b0d8d8f78b680966bc3e8b6" ]
[ "_dlcourse-ai/assignments/assignment2/model.py" ]
[ "import numpy as np\n\nfrom layers import (\n FullyConnectedLayer,\n ReLULayer,\n softmax_with_cross_entropy,\n l2_regularization,\n)\n\n\nclass Param:\n \"\"\"\n Trainable parameter of the model\n Captures both parameter value and the gradient\n \"\"\"\n\n def __init__(self, value):\n ...
[ [ "numpy.max", "numpy.argmax", "numpy.zeros_like", "numpy.zeros", "numpy.sum" ] ]
UoB-HPC/scaling-ml-approaches-to-amg
[ "40bb00f85f49f78a29ae262450967938f1b61b9a" ]
[ "dataset/export_matrices.py" ]
[ "from dolfin import *\nimport time\nfrom mshr import *\nimport numpy as np\nfrom tqdm.notebook import tqdm\nfrom scipy.sparse import csr_matrix, save_npz\nimport matplotlib.pyplot as plt\nimport json\nimport time\nimport dolfin\nimport petsc4py\nfrom pathlib import Path\nimport os\nimport logging\nimport sys\nimpor...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ] ]
aidenylmz/vbm655_car_price_prediction
[ "f577e9b0e7a46f4d16259af70b123f96c4bc9976" ]
[ "sample/dataset.py" ]
[ "import pandas as pd\nfrom datetime import datetime\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.ensemble import ExtraTreesRegressor\nfrom helpers.extensions import sort_features\n\n\ndef load_transformed_car_data():\n '''\n It loads the car data from docs, prints some descriptions,\n...
[ [ "matplotlib.pyplot.yticks", "pandas.read_csv", "matplotlib.pyplot.savefig", "sklearn.ensemble.ExtraTreesRegressor", "matplotlib.pyplot.xticks", "pandas.get_dummies", "matplotlib.pyplot.figure" ] ]
hicala/pyro
[ "bc607f8cf817a8ee7cdebc83dfa51c233d5f13ae" ]
[ "examples/contrib/forecast/bart.py" ]
[ "# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\nimport argparse\nimport logging\n\nimport numpy as np\nimport torch\n\nimport pyro\nimport pyro.distributions as dist\nfrom pyro.contrib.examples.bart import load_bart_od\nfrom pyro.contrib.forecast import ForecastingModel, bac...
[ [ "torch.ones", "torch.full", "torch.zeros", "torch.eye", "numpy.std", "numpy.mean", "torch.stack" ] ]
thepooons/pytorch-lightning
[ "a053d758d03558d2aa5a328b2f6befbc133a0ebc" ]
[ "tests/trainer/optimization/test_parity_manual_optimization.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.abs", "torch.cuda.amp.autocast", "torch.cuda.amp.GradScaler", "torch.cuda.is_available", "numpy.random.randint" ] ]
mathkann/understanding-random-forests
[ "d2c5e0174d1a778be37a495083d756b2829160ec" ]
[ "scripts/ch7_bias_depth.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport brewer2mpl\n\nfrom itertools import product\nfrom functools import partial\nfrom demo import entropy\n\nfrom sklearn.ensemble import ExtraTreesClassifier\nfrom sklearn.ensemble import RandomForestClassifier\nfrom ID3 import Randomized...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplot", "numpy.mean", "numpy.random.permutation", "numpy.array", "matplotlib.pyplot.show", "numpy.zeros", "numpy.sum" ] ]
julietteBrt/CyberbattleSim
[ "37c9befb06f4d6fea733b358fb1e356e4b25bb10" ]
[ "cyberbattle/simulation/generate_network.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\n\"\"\" Generating random graphs\"\"\"\nfrom cyberbattle.simulation.model import Identifiers, NodeID, CredentialID, PortName, FirewallConfiguration, FirewallRule, RulePermission\nimport numpy as np\nimport networkx as nx\nfrom cyberbattle....
[ [ "numpy.random.beta", "numpy.array", "numpy.random.seed", "numpy.float32" ] ]
AppleHolic/multiband_melgan
[ "e0864d0fc205c3bdf5e19c77753e105e29a2641b" ]
[ "multiband_melgan/dataset.py" ]
[ "import numpy as np\nimport librosa\nimport os\nfrom pytorch_sound.data.meta.ljspeech import LJSpeechMeta\nfrom torch.utils.data import Dataset, DataLoader\nfrom typing import Tuple\n\n\nclass AudioDataset(Dataset):\n\n def __init__(self, meta_frame, crop_length: int, seed: int = 1234):\n self.meta_frame ...
[ [ "numpy.ones_like", "numpy.abs", "numpy.random.seed", "torch.utils.data.DataLoader", "numpy.random.randint" ] ]
nce3xin/spam
[ "908421d5cf2dd103e2a7044bf1c8586aaf5f2ada" ]
[ "models/model_RNN_LSTM_GRU.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jun 29 15:07:58 2018\n\n@author: nce3xin\n\"\"\"\n\nimport torch\nimport torch.nn as nn\n\n#use_cuda = not hyperparams.no_cuda and torch.cuda.is_available()\n#device = torch.device(\"cuda\" if use_cuda else \"cpu\")\ndevice = torch.device(\"cuda\" if torch.cuda.is_av...
[ [ "torch.nn.LSTM", "torch.zeros", "torch.nn.GRU", "torch.nn.RNN", "torch.nn.Linear", "torch.cuda.is_available" ] ]
taipahuchu/language-Identification-
[ "68660bc110d374f0d8802b942792b15f8782e647" ]
[ "code/models.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\n\nclass BaseModel(object):\n \"\"\"Holds code shared between all the different model variants.\"\"\"\n\n def __init__(self, batch_size, max_sequence_len, out_vocab_size, c2v,\n dropout_keep_prob=0.0):\n self._batch_size = batch_size\n self._dropo...
[ [ "tensorflow.get_variable", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.to_int32", "tensorflow.pack", "tensorflow.floor", "tensorflow.squeeze", "tensorflow.div", "tensorflow.tile", "tensorflow.nn.xw_plus_b",...
Captain-Hong/UDA-via-joint-adversarial-learning-and-self-learning
[ "628871c19a0e6eeaa5a2ff3a08cbb061d3feae60" ]
[ "main.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Dec 16 17:14:55 2020\r\n\r\n@author: 11627\r\n\"\"\"\r\nimport os.path as osp\r\nfrom networks.discriminator import get_done_entropy_discriminator,get_done_discriminator,get_exit_discriminator\r\nimport numpy as np\r\nfrom torch.utils.data import DataLoader\r\nfr...
[ [ "torch.sigmoid", "numpy.random.seed", "torch.load", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.nn.MaxPool2d", "torch.FloatTensor", "numpy.mean", "torch.cuda.manual_seed_all", "numpy.array", "numpy.zeros", "torch.nn.init.kaiming_normal_" ] ]
bayshore-intelligence-solutions/CogAlg
[ "36d883e5148153986e111e5905d620c901cd929b" ]
[ "frame_2D_alg/alternative versions/frame_classes/angle_blobs.py" ]
[ "import numpy as np\nfrom collections import deque\nfrom frame_2D_alg import Classes\nfrom frame_2D_alg.misc import get_filters\nget_filters(globals()) # imports all filters at once\n# --------------------------------------------------------------------------------\n'''\n angle_blob is a component of intra_blob\...
[ [ "numpy.abs", "numpy.full", "numpy.logical_or", "numpy.arctan2", "numpy.zeros" ] ]
ngninbo/mamphi-administration
[ "8b6e16f6e054e4ed7d9ac7bd99ae413cdd7a007a" ]
[ "mamphi-admin/admin/mamphi.py" ]
[ "import pandas as pd\nimport sqlite3\n\n\nclass Mamphi:\n\n def __init__(self, path_to_center_sheet, path_to_consent_sheet, path_to_rand_w1_sheet, path_to_rand_w2_sheet,\n db_filename):\n self.path_to_center_sheet = path_to_center_sheet\n self.path_to_consent_sheet = path_to_consent...
[ [ "pandas.read_excel" ] ]
vishalbelsare/probability
[ "99bdccd79ff4522427f6add5f436668910275932" ]
[ "tensorflow_probability/python/sts/internal/util_test.py" ]
[ "# Copyright 2018 The TensorFlow Probability 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 required by a...
[ [ "tensorflow.compat.v2.zeros_like", "tensorflow.compat.v2.ones_like", "tensorflow.compat.v2.test.main", "numpy.asarray", "numpy.random.standard_normal", "numpy.ones", "numpy.concatenate", "tensorflow.compat.v2.convert_to_tensor", "tensorflow.compat.v2.shape", "tensorflow.com...
lleon95/NanoSciTracker-Python
[ "f682c1f3b9b9f76a6de8ea816df910715539edf1" ]
[ "src/Matcher/matcher.py" ]
[ "# NanoSciTracker - 2020\n# Author: Luis G. Leon Vega <luis@luisleon.me>\n#\n# 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 ...
[ [ "numpy.argmax", "numpy.array", "numpy.zeros", "numpy.linalg.norm" ] ]
chrwm/OSEMF_Comparison
[ "a44ad3ba69234e2c01588815254f00c6c5970b5e" ]
[ "oemof/T8784O.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\nGeneral description\n-------------------\n\nA basic example to show how to model a simple energy system with oemof.solph.\n\nThe following energy system is modeled:\n\n input/output bgas bel\n | | | |\n ...
[ [ "pandas.concat", "pandas.read_csv", "pandas.date_range" ] ]
pofenghsieh/LPRNet_Pytorch
[ "b1a8c5f0a171962bb7d8b72f9a7c0bfe5faa9f61" ]
[ "train_LPRNet.py" ]
[ "# -*- coding: utf-8 -*-\n# /usr/bin/env/python3\n\n'''\nPytorch implementation for LPRNet.\nAuthor: aiboy.wei@outlook.com .\n'''\n\nfrom data.load_data import CHARS, CHARS_DICT, LPRDataLoader\nfrom model.LPRNet import build_lprnet\n# import torch.backends.cudnn as cudnn\nfrom torch.autograd import Variable\nimport...
[ [ "torch.load", "numpy.asarray", "torch.from_numpy", "torch.autograd.Variable", "numpy.argmax", "torch.device", "torch.nn.init.xavier_uniform", "torch.stack" ] ]
bsl546/energym
[ "0133ca7a19d21352a427e1913755e1ebf6fd8bb6" ]
[ "tests/test_env/test_modelica_FMU.py" ]
[ "import numpy as np\nimport pandas as pd\nimport platform\nimport time\n\nimport matplotlib.pyplot as plt\n\nimport energym\n\n# ============================================================================\n# Constants\n# ============================================================================\nop_sys = platfor...
[ [ "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.close", "numpy.clip" ] ]
kuechenrole/tidal_melting
[ "b71eec6aa502e1eb0570e9fc4a9d0170aa4dc24b" ]
[ "src/preprocessing/grid/smooth_grid.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\n\nimport os\nimport sys\nimport bathy_smoother\nimport xarray as xr\nsrc_dir = os.environ.get('srcdir')\nsys.path.append(src_dir)\nfrom features.log_progress import log_progress\nfrom features.mask_roms_uvp import uvp_masks\nimport numpy as np\n\n\n# In[ ]:\n\n\ngrd_path = os.path....
[ [ "numpy.array", "numpy.ones_like" ] ]
Michaliv/IML.HUJI
[ "ff1bd564cc0575dde6da581c810e847c9cd20f27" ]
[ "exercises/house_price_prediction.py" ]
[ "import math\n\nfrom IMLearn.utils import split_train_test\nfrom IMLearn.learners.regressors import LinearRegression\n\nfrom typing import NoReturn\nimport numpy as np\nimport pandas as pd\nimport plotly.graph_objects as go\nimport plotly.express as px\nimport plotly.io as pio\npio.templates.default = \"simple_whit...
[ [ "pandas.read_csv", "numpy.random.seed", "numpy.arange", "pandas.DataFrame", "numpy.ceil", "numpy.std", "numpy.cov", "numpy.mean", "numpy.select", "numpy.array", "pandas.get_dummies" ] ]
FightingZhen/FCN
[ "ff8de5c0ae2c1ccc0d4e933d8396693a65fc290b" ]
[ "FCN_practical_resize.py" ]
[ "import FCN as FCN4\r\nimport tensorflow as tf\r\nimport numpy as np\r\nimport TensorflowUtils as utils\r\nimport os\r\nimport argparse\r\nimport h5py as h5\r\n\r\nparser = argparse.ArgumentParser()\r\n\r\nparser.add_argument('--MODEL_NAME')\r\nparser.add_argument('--GPU')\r\nparser.add_argument('--threshold', type...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.InteractiveSession", "tensorflow.read_file", "numpy.reshape", "tensorflow.train.start_queue_runners", "tensorflow.image.decode_png", "tensorflow.cast", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.train.Coo...
manojsharma221/Project-SCARA
[ "6757dd5b9668d62f4fd5aeb01c71dba9f91b84a5" ]
[ "SCARA Vision/pyimagesearch/colorlabeler.py" ]
[ "from scipy.spatial import distance as dist\nfrom collections import OrderedDict\nimport numpy as np\nimport cv2\n\nclass ColorLabeler:\n\tdef __init__(self):\n\t\t# initialize the colors dictionary, containing the color\n\t\t# name as the key and the RGB tuple as the value\n\t\tcolors = OrderedDict({\n\t\t\t\"red\...
[ [ "numpy.zeros", "scipy.spatial.distance.euclidean" ] ]
ssaunderss/fire-detection
[ "2a1b5d0d1c709585f181896601461b06b12a41a9" ]
[ "main.py" ]
[ "'''\nProject: Fire-Detection\nFile Name: main.py\nGroup Members: Austin Saunders, Sergiu Iliev, Peng Zeng, Yuan Li\nCapabilities: Visualise all the fires in target region of the word using data from historical NASA satellites and\nmark the most impactful fires.\nMIT License, Copyright (c) 2020, Sergiu Iliev, Austi...
[ [ "pandas.read_csv" ] ]
orestis-z/Mask_RCNN
[ "d590e0f5085f8cbe895a6698e284426fd0116aa4" ]
[ "instance_segmentation/NYU-Depth_V2/generate_np_data.py" ]
[ "\"\"\"\nscript to convert matlab file containing dataset to python readable format \n\"\"\"\nimport os, sys\nimport h5py\nimport numpy as np\n\n\ndataset_dir = '/external_datasets/NYU-Depth_V2'\nfile = 'nyu_depth_v2_labeled.mat'\nfile_path = os.path.join(dataset_dir, file)\n\nincludes = [\"images\", \"depths\", \"...
[ [ "numpy.array" ] ]
DavidMachineLearning/CartPole_RL
[ "a15ceeffa7b7b9ef3d67b386fa16535454e3e2ca" ]
[ "TFDQN.py" ]
[ "from collections import deque\nimport tensorflow as tf\nfrom time import sleep\nimport numpy as np\nimport random\nimport gym\n\n\ndef fully_connected(name, input_tensor, num_units, activation=tf.nn.relu):\n \"\"\"Returns a fully connected layer\"\"\"\n # initialize weights\n w = tf.compat.v1.get_variable...
[ [ "numpy.max", "tensorflow.train.AdamOptimizer", "numpy.exp", "tensorflow.compat.v1.identity", "tensorflow.compat.v1.initializers.he_uniform", "tensorflow.reset_default_graph", "numpy.argmax", "tensorflow.Session", "tensorflow.square", "tensorflow.train.Saver", "numpy.zer...
mukundsood1996/Rahat-Dashboard
[ "906e659e7481643051603753284ed0131895b7c8" ]
[ "app.py" ]
[ "from flask import Flask, render_template, request, url_for, flash, session, jsonify\nfrom flask_googlemaps import GoogleMaps\nfrom flask_googlemaps import Map, icons\nfrom flask import Flask\n\nfrom sklearn.cluster import KMeans\n\nimport numpy as np\nimport rahat_sql as r_data\n\n\nvics = []\nhelps = []\n\napp = ...
[ [ "numpy.array", "sklearn.cluster.KMeans" ] ]
YeYuanS/Object-Detection
[ "ea618670fe991a8f400553b3af8d4367779a9229" ]
[ "train_phone_finder.py" ]
[ "from sklearn.model_selection import train_test_split\r\nfrom sklearn.utils import shuffle\r\nimport sys\r\nimport glob\r\nimport cv2\r\nimport random\r\nimport numpy as np\r\nimport os\r\nimport matplotlib.pyplot as plt\r\n# Keras modules\r\nfrom keras.models import Sequential\r\nfrom keras.layers import Dense\r\n...
[ [ "numpy.rot90", "numpy.random.seed", "numpy.power", "sklearn.utils.shuffle", "sklearn.model_selection.train_test_split", "tensorflow.set_random_seed", "numpy.array", "numpy.vstack" ] ]
bcgazen/zarr-python
[ "6a5903aecf2c33f7c127a55a532e02a2c5006523" ]
[ "zarr/tests/test_core.py" ]
[ "import atexit\nimport os\nimport pickle\nimport shutil\nimport unittest\nfrom itertools import zip_longest\nfrom tempfile import mkdtemp, mktemp\n\nimport numpy as np\nimport pytest\nfrom numcodecs import (BZ2, JSON, LZ4, Blosc, Categorize, Delta,\n FixedScaleOffset, GZip, MsgPack, Pickle, VL...
[ [ "numpy.product", "numpy.take", "numpy.linspace", "numpy.dtype", "numpy.all", "numpy.zeros_like", "numpy.mean", "numpy.iinfo", "numpy.random.randint", "numpy.uint32", "numpy.arange", "numpy.empty_like", "numpy.zeros", "numpy.testing.assert_array_almost_equal"...
LucasGMeneses/OpenGL_labs
[ "ddf753c29cc2fcb07cd0ad04b16f03958b8e452f" ]
[ "OpenGL3/python/cube.py" ]
[ "import sys\nimport numpy as np\nimport math \n\nimport pyrr \nfrom OpenGL.GL import *\nfrom OpenGL.GL import shaders\nfrom OpenGL.GLUT import *\n\nvao = None\nvbo = None\nshaderProgram = None\nuMat = None # variavel uniforme\nmodel = None # matriz de transformação\n\n# le os arquivos do shaders\n...
[ [ "numpy.array" ] ]
OmranAlrawahi/OmranAlrawahi.github.io
[ "ade2bf1bff416425d051eeabbdf4c21f4fc1867c" ]
[ "FinalModel.py" ]
[ "\r\n#This Code is created by Omran ALRawahi, Student No. 201285265, Dec/2018\r\n\r\n# When running in Spyder set graphics prefrences to inline.\r\n\r\n\r\n\"\"\"\r\nThis model is agent based model(ABM) run from GUI (graphical user interface)\r\nwhen you run the model it is expected that window will be appeared in ...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylim", "matplotlib.use", "matplotlib.pyplot.figure", "matplotlib.pyplot.xlim", "matplotlib.animation.FuncAnimation", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg" ] ]
suapapa/khaiii
[ "52603b9fb0aca4be4cd1b87d0f7663d069e94f91" ]
[ "rsc/lib/vocabulary.py" ]
[ "# -*- coding: utf-8 -*-\n\n\n\"\"\"\nvocabulary library\n__author__ = 'Jamie (jamie.lim@kakaocorp.com)'\n__copyright__ = 'Copyright (C) 2018-, Kakao Corp. All rights reserved.'\n\"\"\"\n\n\n###########\n# imports #\n###########\nimport re\nimport codecs\nfrom collections import defaultdict\nimport copy\nimport log...
[ [ "torch.nn.Parameter", "torch.Tensor" ] ]
mmarrkv/spotcheck_ds
[ "db824e5561ac96efe776b12a5531da2612f74faa" ]
[ "kpca_for_ad_memorydumps.py" ]
[ "'''\nFeature scaling: attribute ratio where each row adds up to 1; Rending each row execution sample length insensitive\n'''\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.decomposition i...
[ [ "sklearn.model_selection.GridSearchCV", "pandas.read_csv", "matplotlib.pyplot.scatter", "numpy.linspace", "matplotlib.pyplot.savefig", "sklearn.metrics.mean_squared_error", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "sklearn.decomp...
mathemaphysics/pylearn2
[ "477bf562c387ad9af9a78e876b635afb0d98b3b7" ]
[ "pylearn2/utils/tests/test_mnist_ubyte.py" ]
[ "import struct\nimport tempfile\n\nimport numpy\nimport six\n\nfrom pylearn2.utils.mnist_ubyte import read_mnist_images, read_mnist_labels\nfrom pylearn2.utils.mnist_ubyte import MNIST_LABEL_MAGIC, MNIST_IMAGE_MAGIC\n\n\ndef test_read_labels():\n with tempfile.TemporaryFile() as f:\n data = struct.pack('>...
[ [ "numpy.float32", "numpy.dtype" ] ]
dmwyatt/bookcut
[ "4db9c1f31005e35ccaa3216ebe87be82e319b96f" ]
[ "bookcut/search.py" ]
[ "from bookcut.mirror_checker import main as mirror_checker\nfrom bookcut.downloader import pathfinder\nfrom bs4 import BeautifulSoup as Soup\nimport mechanize\nimport pandas as pd\nimport os\nimport requests\nfrom tqdm import tqdm\n\n\ndef search_downloader(file, href):\n response = requests.get(href, stream=Tru...
[ [ "pandas.DataFrame" ] ]