repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
PVoodoo/RLDQTrading
[ "caac2965bfb62c026af531b0dd5a74c1f3ee4c6a" ]
[ "agent/PVAgent.py" ]
[ "# mainly keras model to RLDQ model, some important settings here so far\n# Programming marko.rantala@pvoodoo.com\n# v1.0.0.1 20190305\n# 1.0.0.3 20190308 model changed \n# v1.0.1.0 20190310 Start of \n##############################\n# own ad: For NinjaTrader related stuff: check https://pvoodoo.com or blog: https...
[ [ "numpy.argmax", "numpy.random.rand", "numpy.vstack" ] ]
david-ryan-alviola/utilities
[ "e14d384cdf5fb849c9e0d4a50960db0c099d382d" ]
[ "evaluation/evaluate_utils.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom statsmodels.formula.api import ols\nfrom sklearn.metrics import mean_squared_error, classification_report, accuracy_score\nfrom math import sqrt\n\ndef _compare_sum_squared_errors(model_sse2, baseline_sse2):\n delta = model_sse2...
[ [ "pandas.crosstab", "matplotlib.pyplot.title", "sklearn.metrics.accuracy_score", "sklearn.metrics.mean_squared_error", "matplotlib.pyplot.show", "sklearn.metrics.classification_report", "matplotlib.pyplot.ylabel" ] ]
NathanHowell/kornia
[ "777e2e03ba61f2a69ad686a01de72a1829f780fd" ]
[ "test/filters/test_median.py" ]
[ "from typing import Tuple\n\nimport pytest\n\nimport kornia\nimport kornia.testing as utils # test utils\n\nimport torch\nfrom torch.testing import assert_allclose\nfrom torch.autograd import gradcheck\n\n\nclass TestMedianBlur:\n def test_shape(self, device, dtype):\n inp = torch.zeros(1, 3, 4, 4, devic...
[ [ "torch.jit.script", "torch.testing.assert_allclose", "torch.zeros", "torch.tensor", "torch.rand", "torch.autograd.gradcheck" ] ]
saswatpp/lightning-flash
[ "d0e6ee65419e140ea7894f1c03a5955919d66310" ]
[ "tests/image/classification/test_model.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.jit.save", "torch.jit.load", "torch.Size", "torch.randint", "torch.utils.data.DataLoader", "torch.tensor", "torch.unique", "torch.rand" ] ]
ZhenyuZhangUSTC/deit
[ "ce09a7241e663cd1cc3455ea727637fc6a85e7f7" ]
[ "pruning_utils.py" ]
[ "import copy \nimport torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.utils.prune as prune\nfrom layers import Conv2d, Linear\n\n__all__ = ['masked_parameters', 'SynFlow', 'Mag', 'check_sparsity', 'check_sparsity_dict', \n 'prune_model_identity', 'prune_model_custom', 'extract_mask', 'prune...
[ [ "torch.ones", "torch.sign", "torch.kthvalue", "torch.clone", "torch.sum", "torch.nn.utils.prune.Identity.apply", "torch.tensor", "torch.no_grad", "torch.where", "torch.flatten", "torch.nn.utils.prune.CustomFromMask.apply" ] ]
jrrwll/demopy
[ "f8ef302b85801ed63fbdda1627b97a153f28bc5c" ]
[ "demopy/numpy/get-start.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy as np\n\n# 1D Array\na = np.array([0, 1, 2, 3, 4])\nb = np.array((0, 1, 2, 3, 4))\nc = np.arange(5)\nd = np.linspace(0, 2 * np.pi, 5)\n\nprint(a) # >>>[0 1 2 3 4]\nprint(b) # >>>[0 1 2 3 4]\nprint(c) # >>>[0 1 2 3 4]\nprint(d) # >>>[ 0. 1.57079633 3.14159265 4....
[ [ "numpy.arange", "numpy.array", "numpy.where", "numpy.linspace" ] ]
dineshbabusv/SeqGenSQL
[ "e42d63b10097bc92105485d21ec913c3d150d128" ]
[ "data/dataset2.py" ]
[ "import argparse\nimport glob\nimport os\nimport json\nimport time\nimport logging\nimport random\nimport re\nimport copy\nfrom itertools import chain\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport tqdm\nimport pickle\n\nimport multiprocessing as mtp\nfrom transformers...
[ [ "numpy.random.randint", "torch.Tensor", "numpy.random.choice" ] ]
pandeyab/create_your_own_image_classifier
[ "2829d1d77be5162316b68b92f54f3f6bf31f594b" ]
[ "predict.py" ]
[ "#!/usr/bin/env python3\n# \n# author: Abhishek Pandey\n# date: 09-08-2020 \n# description: Use a trained network to predict the class for an input image.Prints the most likely classes.\n#\n# Use argparse Expected Call with <> indicating exp...
[ [ "torch.load", "torch.from_numpy", "torch.no_grad", "torch.cuda.is_available", "torch.device", "numpy.array" ] ]
fayalalebrun/pyquante2
[ "e0a4a8ba038b3c702a620f069999798f2259c1c6" ]
[ "pyquante2/ints/integrals.py" ]
[ "\"\"\"\nGeneral module for integral generation and access.\n\"\"\"\ntry:\n from pyquante2.ctwo import ERI_hgp as ERI\nexcept:\n print(\"Couldn't find cython int routine\")\n from pyquante2.ints.hgp import ERI_hgp as ERI\n\ntry:\n from pyquante2.cone import S,T,V\nexcept:\n print(\"Couldn't find cyth...
[ [ "numpy.reshape", "numpy.dot", "numpy.einsum", "numpy.empty" ] ]
Michael0711/quantopian
[ "0848a8a4862fd8bbe7ba64654e6bc731b4b622b7" ]
[ "tests/calendars/test_trading_calendar.py" ]
[ "#\n# Copyright 2016 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or...
[ [ "pandas.tslib.Timedelta", "pandas.Timedelta", "numpy.testing.assert_array_equal", "numpy.concatenate", "pandas.util.testing.assert_index_equal", "pandas.date_range", "pandas.Timestamp" ] ]
JackChuBoy/ML-Exercises
[ "39c48c07bb3831d8625bbe37da828e032dd62327", "39c48c07bb3831d8625bbe37da828e032dd62327" ]
[ "Deep Learning/diff_gradient.py", "Deep Learning/gradient_demo.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Sep 4 21:11:42 2021\n\n@author: user\n\"\"\"\nimport numpy as np\nfrom matplotlib import pyplot as plt\n# from mpl_toolkits.mplot3d import Axes3D\n\n# # 函數微分 中央分差\ndef num_diff(f, x):\n h = 1e-4 # 0.0001\n return (f(x + h) - f(x - h)) / (2 * h)\n\n# 函數1\ndef f...
[ [ "matplotlib.pyplot.legend", "numpy.meshgrid", "numpy.arange", "matplotlib.pyplot.ylim", "matplotlib.pyplot.draw", "matplotlib.pyplot.plot", "matplotlib.pyplot.axes", "matplotlib.pyplot.xlim", "matplotlib.pyplot.colorbar", "numpy.zeros_like", "matplotlib.pyplot.grid", ...
eryuehouniao/mmdetection
[ "e80df144aeb2000116f1a8deb98fa4916b1fe5c3" ]
[ "tools/get_dense.py" ]
[ "import json\nimport pandas\nimport numpy as np\nimport os\nfrom PIL import Image\n\n\n\ndef get_dense(defces):\n\n # get the dense iamge id-------------------------------------------------------------------------------------------\n num_img = 2795\n per_num_defces = np.zeros(num_img)\n anns = defces[\"...
[ [ "numpy.zeros", "numpy.where" ] ]
vishwa-pr/python-sentiment-analysis
[ "eb69e0d28b27a809bbd273341bb0de2f532c5798" ]
[ "sentiment_analyzer.py" ]
[ "import pandas as pd\r\nimport json\r\nimport nltk\r\nnltk.download('vader_lexicon')\r\nfrom nltk.sentiment.vader import SentimentIntensityAnalyzer\r\nfrom textblob import TextBlob\r\nimport flair\r\n\r\n\r\n#flair model will be downloaded first time . After download change to downloaded path\r\nflair_sentiment = f...
[ [ "pandas.DataFrame" ] ]
AlexsLemonade/compendium-processing
[ "fb0316339475442c2219a7f5a7ee781bdbb48425" ]
[ "select_imputation_method/scripts/run_fancyimpute.py" ]
[ "import argparse\nimport pandas as pd\nimport numpy as np\nimport random\nfrom fancyimpute import KNN, BiScaler, SoftImpute, IterativeSVD\nfrom sklearn import preprocessing\n\n# parse arguments\nparser = argparse.ArgumentParser()\nparser.add_argument(\"-f\", \"--file\", help = \"Masked .pcl file\")\nargs = parser.p...
[ [ "sklearn.preprocessing.StandardScaler", "pandas.read_csv", "numpy.random.seed", "pandas.DataFrame" ] ]
swing-research/xtdoa
[ "6b2abf9c244207c8e05232e883288f80038ff2b2" ]
[ "python/plot_real_data.py" ]
[ "import numpy as np\nfrom scipy.io import loadmat\nimport os\nfrom pathlib import Path\n# from mpl_toolkits.mplot3d import Axes3D \nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nimport pandas as pd\n\n\n# plotting parameters\nsns.set(font_scale=1.1)\nsns.set_context(\"talk\")\nsns.set_palette(['#701f...
[ [ "matplotlib.pyplot.legend", "pandas.concat", "matplotlib.pyplot.tight_layout", "numpy.min", "pandas.DataFrame", "numpy.real" ] ]
harmslab/epistasis
[ "1eea1d0639db90cb08a60f583fa660bb309ffde6" ]
[ "epistasis/models/linear/elastic_net.py" ]
[ "import numpy as np\nfrom sklearn.linear_model import ElasticNet\n\nfrom ..base import BaseModel, use_sklearn\nfrom ..utils import arghandler\n\n# Suppress an annoying error from scikit-learn\nimport warnings\nwarnings.filterwarnings(action=\"ignore\", module=\"scipy\",\n message=\"^internal ...
[ [ "numpy.reshape", "numpy.dot", "numpy.asfortranarray" ] ]
doylew/datamining
[ "94c96ab6401fa8106a7e9b32ef303d41da30c9d5" ]
[ "format_py/n_gram_knn.py" ]
[ "##################################################\n######scikit_learn to do the classifications######\n##################################################\n##################################################\n##test change\n\n\nfrom sklearn import neighbors\n\n##################################################\n###...
[ [ "sklearn.neighbors.KNeighborsClassifier" ] ]
AK391/kornia
[ "a2535eb7593ee2fed94d23cc720804a16f9f0e7e" ]
[ "examples/train/image_classifier/main.py" ]
[ "import hydra\nimport torch\nimport torch.nn as nn\nimport torchvision\nimport torchvision.transforms as T\nfrom hydra.core.config_store import ConfigStore\nfrom hydra.utils import to_absolute_path\n\nimport kornia as K\nfrom kornia.x import Configuration, EarlyStopping, ImageClassifierTrainer, ModelCheckpoint\n\nc...
[ [ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader" ] ]
Treblegold/GraphSAINT
[ "a051742ff2de4094c97eb523d7108a4fc1d22739" ]
[ "graphsaint/tensorflow_version/model.py" ]
[ "import tensorflow as tf\r\nfrom graphsaint.globals import *\r\nfrom graphsaint.tensorflow_version.inits import *\r\nimport graphsaint.tensorflow_version.layers as layers\r\nfrom graphsaint.utils import *\r\nimport pdb\r\n\r\n\r\nclass GraphSAINT:\r\n\r\n def __init__(self, num_classes, placeholders, features,\r...
[ [ "tensorflow.nn.l2_normalize", "tensorflow.clip_by_value", "tensorflow.device", "tensorflow.nn.softmax", "tensorflow.constant", "tensorflow.transpose", "tensorflow.control_dependencies", "tensorflow.nn.sigmoid", "tensorflow.get_collection", "tensorflow.reduce_sum", "tens...
ProxMaq/ProxVision
[ "26a336b4821582331c4f55657fea4d9928acadae" ]
[ "TRR & CDI/Cam integration for TRR & CDI .py" ]
[ "# Script implements capturing of images through webcam on click of 'Space' key\r\n# Image detection model classifies the image to 4 of the classses : \r\n #1. Handwritten text , 2.Printed Text , 3. Paper Currency or 4. Metal coin currency \r\n# Based on detection text and curreny/coins value is converted to spe...
[ [ "tensorflow.keras.models.load_model", "numpy.expand_dims", "numpy.reshape", "numpy.asanyarray", "numpy.argmax" ] ]
act65/Autonav-RL-Gym
[ "30b767ced682d70457d5f19ebc19633af1ea85f8" ]
[ "src/plotter.py" ]
[ "import os\nimport json\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\npath = '/home/act65/catkin_ws/src/Autonav-RL-Gym/src/env/training_logs/'\nlogs = (os.path.join(path, fname) for fname in os.listdir(path))\n\ndef is_longer_than_N(fname, min=190, max=210):\n with open(fname, 'r') as f:\n log ...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.show", "pandas.DataFrame" ] ]
PBarde/IBoatPIE
[ "dd8038f981940b732be979b49e9b14102c3d4cca" ]
[ "code/solver/worker.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 31 10:06:46 2017\n\n@author: paul\n\"\"\"\nimport sys\nimport math\nfrom math import exp, sqrt, asin, log\nimport random as rand\nimport numpy as np\nfrom utils import Hist\nfrom master_node import MasterNode\n\nsys.path.append(\"../model/...
[ [ "numpy.dot", "numpy.array" ] ]
wiseodd/pytorch-classification
[ "31b97bdba56fadaca585ee947b7aca1bf5cc79c3" ]
[ "models/cifar/densenet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\n\n\n__all__ = ['densenet', 'densenetbc121', 'densenetbc121_Alt']\n\n\nfrom torch.autograd import Variable\n\nclass Bottleneck(nn.Module):\n def __init__(self, inplanes, expansion=4, growthRate=12, dropRate=0):\n super(Bott...
[ [ "torch.nn.Sequential", "torch.cat", "torch.nn.functional.dropout", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d", "torch.nn.Flatten", "torch.nn.Linear", "torch.nn.AvgPool2d", "torch.nn.functional.relu", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
XiongPengNUS/rsome
[ "c8308870dd8338d792a0001ac6e64e9012fc709c" ]
[ "lp.py" ]
[ "from .subroutines import *\nimport numpy as np\nimport pandas as pd\nimport scipy.sparse as sp\nimport warnings\nfrom numbers import Real\nfrom scipy.sparse import csr_matrix\nfrom scipy.sparse import coo_matrix\nfrom collections import Iterable, Sized\nfrom .lpg_solver import solve as def_sol\n\n\nclass Model:\n ...
[ [ "scipy.sparse.coo_matrix", "numpy.minimum", "pandas.Series", "numpy.maximum", "numpy.arange", "numpy.tile", "scipy.sparse.csr_matrix", "numpy.ones", "numpy.concatenate", "numpy.sign", "numpy.prod", "numpy.array", "numpy.zeros", "numpy.where" ] ]
ebadkamil/nicos
[ "94cb4d172815919481f8c6ee686f21ebb76f2068" ]
[ "nicos/devices/datasinks/fits.py" ]
[ "# -*- coding: utf-8 -*-\n# *****************************************************************************\n# NICOS, the Networked Instrument Control System of the MLZ\n# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)\n#\n# This program is free software; you can redistribute it and/or modify it und...
[ [ "numpy.array" ] ]
verypluming/SyGNS
[ "bc082193812e4b13c1486ccdfd1cad9acb25e507" ]
[ "scripts/evaluate.py" ]
[ "# -*- coding: utf-8 -*-\nimport pandas as pd\nfrom statistics import stdev\nimport argparse\nimport glob\n\nparser = argparse.ArgumentParser(\n formatter_class=argparse.RawDescriptionHelpFormatter)\nparser.add_argument(\"--outdir\", nargs='?', type=str, help=\"output dir\")\nparser.add_argument(\"--setting\...
[ [ "pandas.read_csv" ] ]
yaicv/predict-solar-power-generation
[ "c8d09cd1ee5ef239bf3470dd450e5b4f0b843f31" ]
[ "sunlight-main/v1.py" ]
[ "import pandas as pd\nimport numpy as np\nimport os\nimport glob\nimport random\nimport math\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\ntrain = pd.read_csv('./data/train/train.csv')\nsubmission = pd.read_csv('./data/sample_submission.csv')\n\ndef preprocess_data(data, is_train=True):\n \n temp =...
[ [ "pandas.concat", "pandas.read_csv", "numpy.cos", "sklearn.model_selection.train_test_split", "pandas.DataFrame" ] ]
qkaren/texar
[ "38bbb70ea9d389e3e2c092d213389e9c6b99b824" ]
[ "examples/chat/utils/preprocess.py" ]
[ "# Copyright 2018 The Texar Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required...
[ [ "numpy.array" ] ]
Abhinav-Patidar/datasciencecoursera
[ "5802881a6fbad52924f42c09973a99db5239a54b" ]
[ "detect_recognize.py" ]
[ "import dlib\nfrom skimage import io, transform\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport glob\nimport openface\nimport pickle \nimport os\nimport sys\nimport argparse\nimport time\n\nfrom sklearn.svm import SVC\nfrom sklearn.preprocessing import LabelEncoder\n\nf...
[ [ "pandas.concat", "pandas.DataFrame", "numpy.sort", "numpy.max", "numpy.copy", "numpy.append", "numpy.argmax", "sklearn.svm.SVC", "numpy.argsort", "numpy.array", "sklearn.preprocessing.LabelEncoder" ] ]
stacktracehq/scispacy
[ "81a19bf20520a63dea444787fad6dec4238a7adf" ]
[ "scripts/linking.py" ]
[ "\"\"\"\nLinking using char-n-gram with approximate nearest neighbors.\n\"\"\"\nimport os\nimport os.path\nimport sys\nsys.path.insert(0, os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir))))\nfrom typing import List, Dict, Tuple, NamedTuple, Any, Set\nimport json\nimport argparse\nimport datetime\nf...
[ [ "numpy.min", "scipy.sparse.load_npz", "numpy.max", "numpy.std", "numpy.mean", "numpy.argsort", "numpy.array", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
astonzhang/gluon-nlp
[ "e7a8b9fdad1e02a7b3c581215b55b765176ae7e6" ]
[ "scripts/bert/dataset.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and DMLC.\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\...
[ [ "numpy.array" ] ]
efogliatto/Tesis
[ "058fa0c2e23cd538621d17d41bb216a4db4d211a" ]
[ "Imagenes/FC72/Fint/Coexistencia/postMaxwell.py" ]
[ "import os\n\nimport numpy as np\n\nimport matplotlib.pyplot as plt\n\nimport argparse\n\nimport collections\n\nimport glob\n\nimport MaxwellConstruction as mx\n\nfrom paraview.simple import *\n\nimport locale\n\n\n\n\n\n\nif __name__ == \"__main__\":\n\n\n\n # Argumentos de consola\n \n parser = argparse....
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.xscale", "numpy.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.style.use", "matplotlib.pyplot.ylabel" ] ]
djmango/bumblebeetrashcan
[ "ebb05f207801dd93b01e77e85b66324cabef8ce2" ]
[ "train.py" ]
[ "import os\nfrom pathlib import Path\nimport os\nimport torch\nimport pandas as pd\nfrom skimage import io, transform\nimport numpy as np\nimport time\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils\n\nHERE = Path(__file__).parent.absolute()\n\nclass ClockDataset(Dataset...
[ [ "torch.from_numpy", "numpy.array", "pandas.read_csv", "torch.is_tensor" ] ]
yogeshk4/EduMeet
[ "b86dfbe525a2f4da6946d8684816333cdda6654b" ]
[ "src/train.py" ]
[ "import argparse\nfrom pathlib import Path\n\nfrom tensorflow.keras.applications import Xception\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.layers import GlobalAveragePooling2D, Dense\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.optimizers import RMSprop\nfrom tensorflow.ke...
[ [ "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.layers.Dense", "tensorflow.keras.optimizers.RMSprop", "tensorflow.keras.Model", "tensorflow.keras.callbacks.EarlyStopping" ] ]
eric11eca/inference-information-probing
[ "f55156201992cb024edf112e06dd2d7fe09381e4" ]
[ "inform_prob/process.py" ]
[ "import os\nimport sys\nimport argparse\nimport logging\nimport torch\nimport fasttext\nimport fasttext.util\nfrom conllu import parse_incr\nfrom scipy.sparse import lil_matrix\nfrom transformers import BertTokenizer, BertModel\n\n\ndef get_args():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"...
[ [ "torch.no_grad" ] ]
jamesxwang/monitoring-athletes-performance
[ "7df504711202a31a408ae1072ca5e8fbaf1cb5f9" ]
[ "main/fit_file_convert/check_empty.py" ]
[ "import os\nimport pandas as pd\n\n\ndef check_empty():\n fit_csv_path = '{}/fit_processing/subject_data/mysubjectname/fit_csv'.format(os.path.pardir)\n # fit_csv_path = '{}/fit_processing/activities'.format(os.path.pardir)\n dirs = os.listdir(fit_csv_path)\n total_count = 0\n empty_count = 0\n fo...
[ [ "pandas.read_csv" ] ]
SuperCowPowers/zat
[ "fed88c4310cf70c8b01c9a7eb0918b8c4d117e77" ]
[ "zat/data_generator.py" ]
[ "\"\"\"Silly data generator (Faker (https://github.com/joke2k/faker) and others\n are much better, but we just need something simple\"\"\"\n\nimport string\n\n# Third Party\nimport pandas as pd\nimport numpy as np\n\n\ndef df_random(num_numeric=3, num_categorical=3, num_rows=100):\n \"\"\"Generate a dataframe ...
[ [ "pandas.Categorical.from_codes", "numpy.random.uniform", "numpy.random.normal", "pandas.DataFrame" ] ]
Rahul-Dwivedi-07/Autonomous-Vehicle-Self-Driving-Car-
[ "1441bcbf71187cdf8e8250eb0c0a0556fa08b8f5" ]
[ "lanes_coordinates_print.py" ]
[ "import cv2\r\nimport numpy as np\r\n\r\ndef canny(image):\r\n gray = cv2.cvtColor(image,cv2.COLOR_RGB2GRAY)\r\n blur = cv2.GaussianBlur(gray,(5,5),0)\r\n #canny = cv2.Canny(blur,low_threshold,high_threshold)\r\n canny = cv2.Canny(blur,50,150)\r\n return canny\r\n\r\ndef region_of_interest(image):\r\...
[ [ "numpy.copy", "numpy.array", "numpy.zeros_like", "numpy.polyfit" ] ]
SeanAchtatou/deepjanusexperiments
[ "c14585b7aef4c89e03a30e69b5d8bbac896d6a6a" ]
[ "DeepJanus-MNIST/archive_manager2.py" ]
[ "import csv\nimport json\nfrom os.path import join\n\nfrom folder import Folder\nfrom timer import Timer\nfrom utils import get_distance\nfrom evaluator import eval_archive_dist\nimport numpy as np\n\nfrom config import ARCHIVE_THRESHOLD, POPSIZE, NGEN, MUTLOWERBOUND, MUTUPPERBOUND, \\\n RESEEDUPPERBOUND, K_SD, ...
[ [ "numpy.min", "numpy.linalg.norm", "numpy.max", "numpy.std", "numpy.mean", "numpy.load" ] ]
ludwigwinkler/pytorch_MCMC
[ "4637cfea7e25031a85b1956446e4faa48e17918e" ]
[ "src/MCMC_Chain.py" ]
[ "import future, sys, os, datetime, argparse, copy, warnings, time\nfrom collections import MutableSequence, Iterable, OrderedDict\nfrom itertools import compress\nimport numpy as np\nfrom tqdm import tqdm\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.lines import Line2D\nmatplotlib.rcParams...
[ [ "torch.enable_grad", "torch.isnan", "torch.set_printoptions", "numpy.set_printoptions", "numpy.where" ] ]
xlouba/Transfer-Optimization
[ "a6131cd43a920b5d7005cb08b95626fb2e4280ea" ]
[ "problems/knapsack_generator.py" ]
[ "import os\r\n\r\nimport numpy as np\r\nfrom utils.data_manipulators import Tools\r\n\r\n\r\ndef is_positive_integer(X):\r\n return np.logical_and((X>0),(np.floor(X)==X))\r\n\r\ndef knapsack(weights, values, W):\r\n \"\"\"KNAPSACK Solves the 0-1 knapsack problem for positive integer weights\r\n\r\n [BEST AMO...
[ [ "numpy.sum", "numpy.random.rand", "numpy.floor" ] ]
CalvinYan/smashscan
[ "354b4be6b40117d84ad292806341b84f4c905df8" ]
[ "ocr.py" ]
[ "import time\nimport cv2\nimport pytesseract\nimport numpy as np\n\n# SmashScan libraries\nimport util\n\n# https://github.com/tesseract-ocr/tesseract/wiki/Command-Line-Usage\n# 7 - single text line, 8 - single word, 8 works well with background blobs.\n\ndef show_ocr_result(frame):\n start_time = time.time()\n ...
[ [ "numpy.zeros" ] ]
UlovHer/LearnTransformer
[ "c696f108ea2ba623f0a06f8449f1d27af10c332f" ]
[ "BERT/BERT.py" ]
[ "\"\"\"\norginal from :\nhttps://github.com/graykode/nlp-tutorial/tree/master/5-2.BERT\n\"\"\"\nimport math\nimport re\nfrom random import *\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\n# sample IsNext and NotNext to be same in small batch size\ndef make_batch():\n bat...
[ [ "torch.nn.Softmax", "torch.nn.CrossEntropyLoss", "numpy.sqrt", "torch.zeros", "torch.nn.Embedding", "torch.nn.LayerNorm", "torch.nn.Tanh", "torch.matmul", "torch.nn.Linear", "torch.arange", "torch.gather" ] ]
Goobley/MsLightweaver2d
[ "8d36b2a47fb7c447fc78240a56bc496d1ac629aa" ]
[ "MsLightweaverInterpQSManager.py" ]
[ "import pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom lightweaver.rh_atoms import H_6_atom, C_atom, O_atom, OI_ord_atom, Si_atom, Al_atom, Fe_atom, FeI_atom, MgII_atom, N_atom, Na_atom, S_atom, CaII_atom\nfrom lightweaver.atmosphere import Atmosphere, ScaleType\nfrom lightweaver.atomic_table imp...
[ [ "numpy.linalg.solve", "numpy.expand_dims", "numpy.abs", "numpy.ones_like", "numpy.empty_like", "numpy.eye", "numpy.ones", "numpy.copy", "numpy.zeros", "numpy.sum" ] ]
damo-cv/ELSA
[ "3abc389221a0fe2737372c0fd5db92951a9d3f84" ]
[ "cls/utils/utils.py" ]
[ "\"\"\"\nThis file is copied from VOLO: https://github.com/sail-sg/volo\n\"\"\"\nimport torch\nimport math\n\nimport logging\nimport os\nfrom collections import OrderedDict\nimport torch.nn.functional as F\n\n_logger = logging.getLogger(__name__)\n\n\ndef resize_pos_embed(posemb, posemb_new):\n '''\n resize p...
[ [ "torch.load", "torch.zeros", "torch.cat", "torch.utils.data.DataLoader", "torch.nn.functional.interpolate" ] ]
MamoruDS/darts
[ "5d146e0f85080a370ec5d8bec9dbae9c5a7da84c" ]
[ "cnn/architect.py" ]
[ "import torch\nimport numpy as np\nimport torch.autograd\nimport torch.optim\nimport torch.nn as nn\n\nfrom model_search import Network\n\n\ndef _concat(xs):\n return torch.cat([x.view(-1) for x in xs])\n\n\nclass Architect(object):\n def __init__(self, model: Network, args):\n self.network_momentum: f...
[ [ "torch.zeros_like", "torch.sub" ] ]
YoelPH/Adaptive-fractionation
[ "4e04062089848c6bec740d71188b262cc708ee4c" ]
[ "adaptfx/t_distribution/3D_GUI.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nGUI for 3D adaptive fractionation with minimum and maximum dose\n\"\"\"\n\nimport tkinter as tk\nimport numpy as np\nfrom scipy.stats import invgamma\nfrom tkinter import filedialog as fd\nfrom tkinter.messagebox import showinfo\nimport tkinter.ttk as ttk\nimport pandas as pd\nimpo...
[ [ "numpy.round", "scipy.stats.invgamma.fit", "numpy.zeros", "numpy.sum" ] ]
zuston/submarine
[ "71ef07de51b01a4b6896b2aa0db05fb071eaf145" ]
[ "submarine-sdk/pysubmarine/submarine/ml/model/deepfm.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you ma...
[ [ "tensorflow.multiply", "tensorflow.glorot_normal_initializer", "numpy.random.seed", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.reshape", "tensorflow.ones_like", "tensorflow.set_random_seed", "tensorflow.constant_initializer", "tensorflow.subtract", "tensorf...
blakete/Cool-GAN
[ "de52b04419292fabe68282a8c0e3046dfa32c0ca" ]
[ "use-gan.py" ]
[ "# example of loading the generator model and generating images\nfrom tensorflow.keras.models import load_model\nfrom numpy.random import randn\nfrom matplotlib import pyplot\n \n# generate points in latent space as input for the generator\ndef generate_latent_points(latent_dim, n_samples):\n\t# generate points in ...
[ [ "tensorflow.keras.models.load_model", "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplot", "numpy.random.randn", "matplotlib.pyplot.axis", "matplotlib.pyplot.show" ] ]
ZongwuYang/tf-imagenet
[ "7ffdc3059df5e515d891c3722c7229fc72a99705", "7ffdc3059df5e515d891c3722c7229fc72a99705" ]
[ "preprocessing/preprocessing_cifar10.py", "preprocessing/preprocessing_imagenet.py" ]
[ "# ==============================================================================\n# Copyright 2018 Paul Balanca. 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 a...
[ [ "tensorflow.image.resize_image_with_crop_or_pad", "tensorflow.constant", "tensorflow.image.random_flip_left_right", "tensorflow.unstack", "tensorflow.transpose", "tensorflow.cast", "tensorflow.reshape", "tensorflow.expand_dims", "tensorflow.random_crop", "tensorflow.name_sc...
dchaves/audioshow
[ "2016378ed83b56f4934cc7854cbd6275adf84675" ]
[ "input.py" ]
[ "#!/usr/bin/env python\nimport struct\nimport numpy as np\nimport time\nimport matplotlib\nmatplotlib.use('GTKAgg')\nfrom matplotlib import pyplot as plt\n\n\nclass dynaplot:\n def __init__(self, max_x = 4096, window_size = 512):\n self.y_values = []\n self.x_values = []\n self.max_x = max_x...
[ [ "numpy.fft.fft", "matplotlib.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.draw", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.pause" ] ]
Alive12321/Maze-PyQt5
[ "7516a83f11c1dfef662fef5c1f5d294bf60c7bf2" ]
[ "Maze1.2.py" ]
[ "# -*- coding: utf-8 -*-\r\nfrom PyQt5 import QtCore, QtGui, QtWidgets\r\nimport sys,random\r\nfrom PyQt5.QtWidgets import QApplication,QMainWindow,QGraphicsItem\r\nfrom PyQt5.QtCore import Qt,QRectF\r\nimport numpy as np\r\nfrom queue import Queue,PriorityQueue\r\n\r\nWIDTH,HEIGHT=800,800 #Graphicsview的尺寸\r\nCOL_I...
[ [ "numpy.random.randint", "numpy.random.shuffle", "numpy.ones" ] ]
cltl/robustness-albert
[ "47029cbac0c770e2e4fbad44534097305b0b609e" ]
[ "robustness_albert/train.py" ]
[ "# Code modified from:\n# https://github.com/huggingface/transformers/blob/master/examples/pytorch/text-classification/run_glue_no_trainer.py\n# Changed structure of the file, removed unnecessary code (e.g. creating new functions and removing non SST-2\n# related code), added comments, and added other necessary cod...
[ [ "torch.optim.lr_scheduler.CyclicLR", "torch.utils.data.DataLoader", "numpy.ceil", "torch.no_grad", "numpy.mean", "torch.device", "torch.optim.swa_utils.AveragedModel" ] ]
dingcycle/depc
[ "5ff0a5322684daf715e1171a259b9c643925cf73" ]
[ "depc/sources/fake/__init__.py" ]
[ "import hashlib\nimport logging\n\nimport numpy as np\n\nfrom depc.sources import BaseSource, SourceRegister\nfrom depc.sources.exceptions import BadConfigurationException\nfrom depc.sources.fake.metrics import (\n generate_fake_db_connections,\n generate_fake_http_status,\n generate_fake_oco_status,\n ...
[ [ "numpy.arange", "numpy.random.RandomState" ] ]
palchicz/flytekit
[ "726762e1cbe39d216480374b7efb99c339ec63f5" ]
[ "tests/flytekit/unit/core/test_type_engine.py" ]
[ "import datetime\nimport os\nimport tempfile\nimport typing\nfrom dataclasses import asdict, dataclass\nfrom datetime import timedelta\nfrom enum import Enum\n\nimport pandas as pd\nimport pytest\nfrom dataclasses_json import DataClassJsonMixin, dataclass_json\nfrom flyteidl.core import errors_pb2\nfrom google.prot...
[ [ "pandas.DataFrame" ] ]
GuoxiaWang/InstanceLabelTool
[ "ece37a0dfe1467ad24d6d3472adb50b20b6abd24" ]
[ "lib/annotation.py" ]
[ "\"\"\"\nCopyright (c) 2018- Guoxia Wang\nmingzilaochongtu at gmail com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, subject to the following conditions: ...
[ [ "numpy.array" ] ]
diegowendel/TSAP
[ "b7f00dabd924b824ffb16fb612306f84f6a8e4ca" ]
[ "src/analyzer/main.py" ]
[ "from random import random, shuffle\n\nfrom src.analyzer.classifier import Classifier\nfrom src.analyzer.preprocessor import PreProcessor\nfrom src.analyzer.sentilex import Sentilex\nfrom src.database.database_mongo import DatabaseMongo\nfrom src.utils.logger import Logger\nfrom src.utils.utils import Tweet\nfrom s...
[ [ "pandas.read_csv" ] ]
Hamzeluie/tensortrade
[ "e81c94c7048d4a57e2a2d5c76f5d6005f96406fc" ]
[ "tensortrade/data/cdd.py" ]
[ "\"\"\"Contains methods and classes to collect data from\nhttps://www.cryptodatadownload.com.\n\"\"\"\n\nimport ssl\n\nimport pandas as pd\n\n\nssl._create_default_https_context = ssl._create_unverified_context\n\n\nclass CryptoDataDownload:\n \"\"\"Provides methods for retrieving data on different cryptocurrenc...
[ [ "pandas.read_csv", "pandas.to_datetime" ] ]
sohailhabib/SecurityMetrics
[ "7de3f462e89d97592e0c28a623bd6f7112b9a3b1", "7de3f462e89d97592e0c28a623bd6f7112b9a3b1" ]
[ "source_code/dataset/dim_red_pca_operation.py", "source_code/adversaries/mk_attack.py" ]
[ "\"\"\"\nMIT License\n\nCopyright (c) 2021, Sohail Habib\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\nrights to use, copy, modify...
[ [ "sklearn.decomposition.PCA", "pandas.DataFrame" ], [ "numpy.round", "numpy.arange", "pandas.DataFrame" ] ]
ichaelm/MusicPrediction
[ "df495410d5f956eb7656045363479ad378ef71f6" ]
[ "src/TensionModule.py" ]
[ "# Tension Module (numpy)\n# Zicheng Gao\n\nimport numpy as np\n\nv_basis = np.r_[:12]\n\nvalToNote = ['A','Bb','B','C','C#','D','Eb','E','F','F#','G','G#']\n\n# from Robert Rowe's \"Machine Musicianship\" p 48\nclass metric:\n\tdissonance = [1, 6, 5, 4, 3, 2, 7, 2, 3, 4, 5, 6]\n\twestern = [1, 8, 6, 2.1, 2, 4.5, 5...
[ [ "numpy.tile", "numpy.all", "numpy.max", "numpy.diff", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.vstack" ] ]
ash22194/stable-baselines3
[ "b2729e0b2df2f9026d7587c5506ea3b60e316fed" ]
[ "examples/testCartPole.py" ]
[ "\nimport torch\nfrom torch import nn\nimport os\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom ipdb import set_trace\nfrom scipy.linalg import solve_continuous_are\nfrom scipy.io import loadmat\nfrom scipy.interpolate import interpn\n\nfrom systems.cartpole import CartPole\nfrom stable_baselines3 imp...
[ [ "numpy.diag", "numpy.log", "numpy.minimum", "numpy.linalg.inv", "numpy.eye", "numpy.matmul", "numpy.array", "numpy.zeros" ] ]
brandongk-ubco/ensembler
[ "9d4ab1a07f686eee8b5a4e721a6acc44da3ef94d" ]
[ "tests/test_sample_dataframe.py" ]
[ "from ensembler.datasets.helpers import sample_dataset\nimport pandas as pd\nimport uuid\nimport os\n\n\nclass TestSampleDataFrame:\n def test_sample_single_class(self):\n df = pd.DataFrame([{\n \"sample\": uuid.uuid4(),\n \"background\": 0.1,\n \"1\": 0.9\n }, {\n ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
fotavio16/PycharmProjects
[ "f5be49db941de69159ec543e8a6dde61f9f94d86" ]
[ "OpenCV/bookIntroCV_008_binarizacao.py" ]
[ "'''\n\n Livro-Introdução-a-Visão-Computacional-com-Python-e-OpenCV-3\n\nRepositório de imagens\nhttps://github.com/opencv/opencv/tree/master/samples/data\n'''\n\nimport cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n#import mahotas\n\nVERMELHO = (0, 0, 255)\nVERDE = (0, 255, 0)\nAZUL = (255, 0, 0)...
[ [ "numpy.hstack" ] ]
zedhed/PYNQ-DL
[ "c80b50bcaebe096ac1df4b635977620e90b263dd" ]
[ "darius/lib/darius_lib.py" ]
[ "# Copyright (c) 2018, Xilinx, Inc.\r\n# All rights reserved.\r\n#\r\n# Redistribution and use in source and binary forms, with or without\r\n# modification, are permitted provided that the following conditions are met:\r\n#\r\n# 1. Redistributions of source code must retain the above copyright notice,\r...
[ [ "numpy.array", "numpy.zeros" ] ]
SethKitchen/open_spiel
[ "d38c935020c625438b62278523bf692b964cabc7" ]
[ "open_spiel/python/algorithms/tabular_qlearner.py" ]
[ "# Copyright 2019 DeepMind Technologies Ltd. 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...
[ [ "numpy.zeros" ] ]
jialin-wu-02/skyportal
[ "29d606ad8567b2230fb0553b18dd3cb9d3ab2d84" ]
[ "skyportal/handlers/api/photometry.py" ]
[ "import numpy as np\nimport arrow\nfrom astropy.time import Time\nfrom astropy.table import Table\nimport pandas as pd\nfrom marshmallow.exceptions import ValidationError\nfrom baselayer.app.access import permissions, auth_or_token\nfrom ..base import BaseHandler\nfrom ...models import (\n DBSession, Photometry,...
[ [ "numpy.isnan", "numpy.isscalar", "numpy.log10", "pandas.DataFrame" ] ]
0gubanov/robinbot
[ "59c9520cf47165c62fc87fd7d5587c3105290f05" ]
[ "robinhoodbot/misc.py" ]
[ "import robin_stocks as r\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as plticker\n\ndef show_plot(price, firstIndicator, secondIndicator, dates, label1=\"\", label2=\"\"):\n \"\"\"Displays a chart of the price and indicators for a stock\n\n Args:\n price(Pandas series): Series containin...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
rdbch/COVID-19-Forecast
[ "3aa9730ce07e935a87565d00052868dffdb430d9" ]
[ "core/nn/loss.py" ]
[ "import numpy as np\n\nimport torch\nfrom torch import nn\n\n# =============================================== L1 NORM =====================================================\ndef l1_norm_error(source, candidate):\n\n error = np.abs(source - candidate)\n source[source == 0] = 1e-30 # add for numerical stabilit...
[ [ "numpy.sqrt", "numpy.abs", "numpy.linspace", "torch.from_numpy", "numpy.log10", "torch.clamp" ] ]
Unity-Technologies/datasetinsights
[ "0c6e2407f3b6ceb7a38cb82e3bbcf41a6c2d4672" ]
[ "datasetinsights/datasets/unity_perception/references.py" ]
[ "\"\"\" Load Synthetic dataset references tables\n\"\"\"\nimport pandas as pd\n\nfrom .tables import DATASET_TABLES, SCHEMA_VERSION, glob, load_table\nfrom .validation import DuplicateRecordError, NoRecordError\n\n\nclass AnnotationDefinitions:\n \"\"\"Load annotation_definitions table\n\n For more detail, se...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
Aniruddha120/qiskit-aqua
[ "9806a31819bbc7160568a5cb36b38b9e3dd1a78e" ]
[ "qiskit/aqua/operators/primitive_ops/pauli_op.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\...
[ [ "numpy.logical_xor", "numpy.conj", "numpy.logical_or", "numpy.real", "numpy.logical_and", "numpy.sum" ] ]
kiwicom/catboost-cxx
[ "7ae872fe9418215b6592e1a947d1cd4bc5b10b3d" ]
[ "unittest/testdata/gen_catboost_tests.py" ]
[ "#!/usr/bin/env python3\n\nimport catboost as cb\nimport numpy as np\nimport numpy.matlib as mlib\nimport json\nimport os, sys\n\ndef xor_dataset():\n x = np.array([ [0, 0], [0, 1], [1, 0], [1, 1] ])\n y = np.array([ 0, 1, 1, 0 ])\n return x, y\n\ndef or_dataset():\n x = np.array([ [0, 0], [0, 1], [1, 0...
[ [ "numpy.array", "numpy.matlib.dot", "numpy.random.rand" ] ]
StanczakDominik/fbpic
[ "8b03d1f3182c1cd2b14c7add92cb6063c84f78a5" ]
[ "fbpic/openpmd_diag/data_dict.py" ]
[ "# Copyright 2016, FBPIC contributors\n# Authors: Remi Lehe, Manuel Kirchen\n# License: 3-Clause-BSD-LBNL\n\"\"\"\nThis file defines useful correspondance dictionaries\nwhich are used in the openPMD writer\n\"\"\"\nimport numpy as np\n\n# Correspondance between quantity and corresponding dimensions\n# As specified ...
[ [ "numpy.array", "numpy.uint32" ] ]
ajabri/rlpyt
[ "a2e347153421e2d7b23a08ef6eec94f3c9f9ffa9" ]
[ "rlpyt/runners/minibatch_rl.py" ]
[ "\nimport psutil\nimport time\nimport torch\nimport math\nfrom collections import deque\n\nfrom rlpyt.runners.base import BaseRunner\nfrom rlpyt.utils.quick_args import save__init__args\nfrom rlpyt.utils.seed import set_seed, make_seed\nfrom rlpyt.utils.logging import logger\nfrom rlpyt.utils.prog_bar import ProgBa...
[ [ "torch.get_num_threads", "torch.set_num_threads" ] ]
brandon-m-booth/2018_continuous_annotations
[ "f5621d5d7da56d62e06d8e40afa152cccb40930e" ]
[ "src/linear_segmented_regression/continuous_opt.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport sys\nimport pdb\nimport math\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'util')))\nimport util\n\n# For debugging\nshow_debug_plots =...
[ [ "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "numpy.array", "matplotlib.pyplot.show", "numpy.zeros", "numpy.isinf", "matplotlib.pyplot.figure" ] ]
eddiejessup/spatious
[ "b7ae91bec029e85a45a7f303ee184076433723cd" ]
[ "spatious/distance.py" ]
[ "\"\"\"\nDistance finding functions inspired by scipy.spatial.distance.\n\"\"\"\n\nfrom __future__ import print_function, division\nimport numpy as np\nfrom spatious import vector\nfrom spatious.distance_numerics import pdist_angle\n\n\ndef csep(ra, rb):\n \"\"\"Return separation vectors between each pair of the...
[ [ "numpy.square", "numpy.dot", "numpy.argmin", "numpy.cross" ] ]
fhoeb/py-tmps
[ "b7eced582acb4042815a775090a59f569975e3be" ]
[ "tmps/star/itime/factory.py" ]
[ "\"\"\"\n Main interface factory functions for imaginary time evolution propagators (ITMPS, ITMPO, ITPMPS)\n\"\"\"\n\nfrom tmps.star.itime.itmps import StarITMPS\nfrom tmps.star.itime.itpmps import StarITPMPS\nfrom tmps.star.itime.itmpo import StarITMPO\nimport numpy as np\nfrom tmps.utils.shape import check_sha...
[ [ "numpy.real", "numpy.imag" ] ]
willthefrog/models
[ "6b296d7319f27eee4437b7916dae8cf0d9e94970" ]
[ "PaddleCV/object_detection/ppdet/utils/visualizer.py" ]
[ "# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.array", "numpy.nonzero" ] ]
davWilk/udemy_courses
[ "916f42eddd02400e4b8a1600e86514f28e7009b1" ]
[ "udemy Model Predictive Control/assignment3.py" ]
[ "from pyexpat.errors import XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING\nfrom re import X\nimport numpy as np\nfrom sim.sim2d import sim_run\n\n# Simulator options.\noptions = {}\noptions['FIG_SIZE'] = [8,8]\noptions['OBSTACLES'] = True\n\nclass Point:\n def __init__(self, r, theta):\n self.r = r\n ...
[ [ "numpy.tan", "numpy.sqrt", "numpy.cos", "numpy.sin" ] ]
jungokasai/deep-shallow
[ "605cac3bd282d814f67774b394f722cbc064c69f" ]
[ "fairseq/models/nat/cmlm_at.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nThis file implements:\nFast Structured Decoding of Non-autoregressive Transformers\n\"\"\"\nimport torch\nimport torch.nn.fu...
[ [ "torch.arange", "torch.empty", "torch.nn.functional.log_softmax", "torch.nn.functional.dropout" ] ]
Shoebhabeeb/Image_Superresolution
[ "47605afb4a4723a5f4d46c2d27213930af12974f" ]
[ "src/models/Deep BackProp NN.py" ]
[ "import torch\nimport math\nimport torch.nn as nn\n\n\nclass DBPN(nn.Module):\n def __init__(self, num_channels, base_channels, feat_channels, num_stages, scale_factor):\n super(DBPN, self).__init__()\n\n if scale_factor == 2:\n kernel_size = 6\n stride = 2\n paddin...
[ [ "torch.nn.init.kaiming_normal", "torch.nn.Sequential", "torch.nn.BatchNorm1d", "torch.add", "torch.nn.ConvTranspose2d", "torch.cat", "torch.nn.InstanceNorm1d", "torch.nn.PReLU", "torch.nn.Conv2d", "torch.nn.PixelShuffle", "torch.nn.Tanh", "torch.nn.Sigmoid", "to...
avartak/qiskit-terra
[ "44462a8b13ea6c2cce0f9c7345c26c15fb0d4ce3" ]
[ "qiskit/quantum_info/states/densitymatrix.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.dot", "numpy.product", "numpy.allclose", "numpy.conj", "numpy.reshape", "numpy.linalg.eig", "numpy.asarray", "numpy.kron", "numpy.argmax", "numpy.array2string", "numpy.zeros", "numpy.trace", "numpy.isclose" ] ]
mateus-shima/robot-manipulator-sandbox
[ "a01de40d306d304c2603e86897fc498b780f4a84" ]
[ "scripts/robot_controlling_node.py" ]
[ "#!/usr/bin/env python\n\nfrom dqrobotics import *\nfrom dqrobotics.robots import KukaLw4Robot\nimport numpy as np\nfrom dqrobotics.utils import *\nimport math\nimport time\npinv = DQ_LinearAlgebra.pinv\nimport rospy\nfrom controller import PseudoinverseController\nfrom interface import Interface\n\n\ndef control()...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
drknotter/trimesh
[ "f486bc6cf0e2dc775d9384799b806f2f2c8ac284" ]
[ "trimesh/repair.py" ]
[ "\"\"\"\nrepair.py\n-------------\n\nFill holes and fix winding and normals of meshes.\n\"\"\"\n\nimport numpy as np\n\nfrom . import graph\nfrom . import triangles\n\nfrom .constants import log\nfrom .grouping import group_rows\nfrom .geometry import faces_to_edges\n\n\ntry:\n import networkx as nx\nexcept Base...
[ [ "numpy.fliplr", "numpy.sort", "numpy.asanyarray", "numpy.shape", "numpy.column_stack", "numpy.ravel", "numpy.array", "numpy.sum", "numpy.vstack" ] ]
ChengF-Lab/CoV-KGE
[ "3fdf7109ac5c0f82bb5a7b3e8bb928ae5a8beeac" ]
[ "gnbr/concat.py" ]
[ "import pandas as pd\r\npd.set_option(\"precision\",10)\r\ndef triples():\r\n che_dis = pd.read_csv(\"triples_che_rel_dis\", delimiter='\\t', names=[\"ent1\", 'rel', 'ent2', 'score'])\r\n\r\n che_gen = pd.read_csv(\"triples_che_rel_gen\", delimiter='\\t', names=[\"ent1\", 'rel', 'ent2', 'score'])\r\n gen_d...
[ [ "pandas.set_option", "pandas.read_csv", "pandas.concat" ] ]
DavidStirling/centrosome
[ "c1ea6629d510e376cd34d229ba3ba5079b3a7093" ]
[ "centrosome/kirsch.py" ]
[ "from __future__ import absolute_import\nimport numpy\nimport scipy.ndimage.filters\nfrom six.moves import range\n\n\ndef kirsch(image):\n convolution_mask = [5, -3, -3, -3, -3, -3, 5, 5]\n\n derivatives = numpy.zeros(image.shape)\n\n kernel = numpy.zeros((3, 3), image.dtype)\n kindex = numpy.array([[0,...
[ [ "numpy.array", "numpy.zeros" ] ]
SbstnErhrdt/fastnode2vec
[ "42609fb418f5e76935332c3f0ec81f65f672a977" ]
[ "fastnode2vec/graph.py" ]
[ "from collections import defaultdict\n\nimport numpy as np\n\nfrom numba import njit\nfrom scipy.sparse import csr_matrix\nfrom tqdm import tqdm\n\n\n@njit(nogil=True)\ndef _csr_row_cumsum(indptr, data):\n out = np.empty_like(data)\n for i in range(len(indptr) - 1):\n acc = 0\n for j in range(in...
[ [ "numpy.random.choice", "numpy.empty_like", "scipy.sparse.csr_matrix", "numpy.diff", "numpy.random.rand", "numpy.searchsorted", "numpy.array", "numpy.empty" ] ]
Stimson-Center/stimson-web-scraper
[ "c2e6c3ae4abb8e8697b10d844bfb0fa3d305d05f" ]
[ "scraper/named_entity_recognition.py" ]
[ "import re\nfrom collections import OrderedDict\n\nimport dateparser\nimport numpy as np\nfrom date_extractor import extract_dates\nfrom spacy.lang.en.stop_words import STOP_WORDS\nfrom spacy.matcher import Matcher\n\n\n# https://gist.github.com/BrambleXu/3d47bbdbd1ee4e6fc695b0ddb88cbf99\n# https://spacy.io/usage/l...
[ [ "numpy.dot", "numpy.zeros", "numpy.sum", "numpy.divide" ] ]
Solrovivrus/MedicalApp
[ "2dd819d0f89d9162c5cab35b224b9118e0000e63" ]
[ "src/Python_Files/testing_playground/depreciated_files/json_pretty_print.py" ]
[ "import pandas\nimport json\n\nfiles = [\n \"Central_Montana_Medical_Center\"\n]\n\nfor item in files:\n print(\"Scanning: \", item)\n \n excel_data_df = pandas.read_excel(item + '.xlsx', sheet_name=item)\n\n #Add hospital name to each row\n excel_data_df[\"Hospital\"] = item.replace(\"_\", \" \")...
[ [ "pandas.read_excel" ] ]
Shuijing725/VAE_trait_inference
[ "a018455f992a9270092ac925bfbd1f3680ed2b20" ]
[ "rl/rl_models/rnn_base.py" ]
[ "import torch.nn as nn\nimport torch\n\n\n'''\nbase class for all RNN policies\n\ndifference from default RNNs in pytorch: RNNBase can use masks to reset the RNN hidden states appropriately, when an episode is done\n'''\nclass RNNBase(nn.Module):\n\n def __init__(self, config):\n super(RNNBase, self).__in...
[ [ "torch.nn.init.constant_", "torch.nn.GRU", "torch.nn.init.orthogonal_", "torch.cat" ] ]
czbiohub/fluorophore_backward_dp
[ "b8292cb5ebc7443fa159fef624d597c4e35f6eb0" ]
[ "test_fluorophore_backward_dp.py" ]
[ "import numpy as np\n\nfrom fluorophore_backward_dp import *\n\ndef test_mle():\n np.random.seed(12345)\n b = 1\n r = 1000\n N = 10\n t = simulate_emission_times(r, simulate_bleaching_times(b, N))\n l = emission_times_loglik(t, b, r, truncate=1000)\n assert np.argmax(l) == N\n" ]
[ [ "numpy.argmax", "numpy.random.seed" ] ]
nabeelsana/DataCamp-courses
[ "383b644907cca1c14befb4706a32579bec01a134" ]
[ "Importing Data in Python pt1/Chapter 2 - Importing data from other file types.py" ]
[ "\n#Chapter 2 - Importing data from other file types\n\n\n\n\n#Loading a pickled file\n# Import pickle package\nimport pickle\n\n# Open pickle file and load data: d\nwith open('data.pkl', 'rb') as file:\n d = pickle.load(file)\n\n# Print d\nprint(d)\n\n# Print datatype of d\nprint(type(d))\n\n#Listing sheets in ...
[ [ "pandas.DataFrame.hist", "numpy.arange", "numpy.shape", "pandas.ExcelFile", "pandas.read_stata" ] ]
JosepLeder/Lekai-Reinforcement-Learning-Notes
[ "d9476cf1f959cca43880886104e4aa9892e970fc" ]
[ "code/utils.py" ]
[ "import numpy as np\nfrom torch.utils.data.sampler import BatchSampler, SubsetRandomSampler\nimport torch as th\nfrom torch import nn\nfrom typing import Generator, Optional, Union, Tuple, NamedTuple\nfrom gym import spaces\n\n\ndef init(module, weight_init, bias_init, gain=1):\n weight_init(module.weight.data, ...
[ [ "torch.ones", "torch.zeros", "torch.FloatTensor", "torch.device", "numpy.zeros", "numpy.random.randint" ] ]
IST-DASLab/ACDC
[ "ac53210b6adc1f2506ff909de08172ed9cad25d5" ]
[ "policies/pruners.py" ]
[ "\"\"\"\nImplement Pruners here.\n\n\"\"\"\nimport numpy as np\n\nfrom policies.policy import PolicyBase\nfrom utils import (get_total_sparsity,\n recompute_bn_stats,\n percentile,\n get_prunable_children)\n\n\nimport torch\nimport torch.optim as optim\nfrom ...
[ [ "torch.ones", "torch.zeros", "torch.sign", "torch.nn.functional.cross_entropy", "torch.utils.data.sampler.SubsetRandomSampler", "numpy.mean", "torch.argsort", "torch.ones_like" ] ]
tjcdev/bipedal-walker-with-tl
[ "828fdca6caea9e8e15dcb9de920ad1be2f4ed8fb" ]
[ "baselines/ppo2/model.py" ]
[ "import tensorflow as tf\nimport functools\n\nimport sys\n\nfrom baselines.common.tf_util import get_session, save_variables, load_variables\nfrom baselines.common.tf_util import initialize\n\ntry:\n from baselines.common.mpi_adam_optimizer import MpiAdamOptimizer\n from mpi4py import MPI\n from baselines....
[ [ "tensorflow.clip_by_value", "tensorflow.train.latest_checkpoint", "tensorflow.get_collection", "tensorflow.maximum", "tensorflow.exp", "tensorflow.placeholder", "tensorflow.trainable_variables", "tensorflow.contrib.framework.filter_variables", "tensorflow.clip_by_global_norm", ...
leonardoandresgaray/wheat-quality-detector-2
[ "8dce39befdc2177b7de64e5e711125f9e92ce6fb" ]
[ "classifier_2_v2.py" ]
[ "import warnings\nwarnings.filterwarnings(\"ignore\", message=\"numpy.dtype size changed\")\nwarnings.filterwarnings(\"ignore\", message=\"numpy.ufunc size changed\")\n\n\nimport cv2, numpy as np, random, os, pickle, keras, itertools\nfrom mlp import train\nfrom PCA import pca\nfrom util_ import get_boundry_img_mat...
[ [ "numpy.array", "numpy.sum" ] ]
yathindrakodithuwakku/AGC_sample
[ "9963de5430585b448e16e441550e900d7005b589" ]
[ "model.py" ]
[ "\"\"\"Code for constructing the model and get the outputs from the model.\"\"\"\n\nimport tensorflow as tf\nimport numpy as np\nimport layers\n\n# The number of samples per batch.\nBATCH_SIZE = 1\n\n# The height of each image.\nIMG_HEIGHT = 256\n\n# The width of each image.\nIMG_WIDTH = 256\n\n# The number of colo...
[ [ "tensorflow.nn.relu", "tensorflow.multiply", "tensorflow.concat", "tensorflow.nn.sigmoid", "tensorflow.constant", "tensorflow.nn.tanh", "tensorflow.pad", "tensorflow.greater_equal", "tensorflow.compat.v1.variable_scope" ] ]
mymakar/causally_motivated_shortcut_removal
[ "06cc5f0cdefe17dfb543d3cfd046437f5255d092" ]
[ "chexpert/cohort_creation.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "pandas.set_option", "pandas.read_csv" ] ]
tasptz/pytorch-smooth
[ "cb2a2845afbdf5524648eed066b6dea9ac594cfd" ]
[ "smooth/kernel.py" ]
[ "import numpy as np\n\ndef sobel(k:int):\n '''\n Generate a horizontal sobel kernel with shape `(k, k)`\n '''\n if k % 2 == 0:\n y, x = np.mgrid[:k, :k] + 0.5 - k / 2\n else:\n y, x = np.mgrid[:k, :k] - k // 2\n norm = np.square(x) + np.square(y)\n norm[norm == 0.] = 1.\n f = x...
[ [ "numpy.square", "numpy.arange" ] ]
chaohuaM/deeplabv3-plus-pytorch
[ "71aba5db71247c6e649460705819bd9ac8bab611" ]
[ "nets/mobilenetv2.py" ]
[ "import math\r\nimport os\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.utils.model_zoo as model_zoo\r\n\r\nBatchNorm2d = nn.BatchNorm2d\r\n\r\ndef conv_bn(inp, oup, stride):\r\n return nn.Sequential(\r\n nn.Conv2d(inp, oup, 3, stride, 1, bias=False),\r\n BatchNorm2d(oup),\r\n ...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.ReLU6", "torch.load", "torch.nn.Conv2d", "torch.nn.Linear", "torch.utils.model_zoo.load_url" ] ]
bmkramer/automated-systematic-review
[ "f99079926f381bc7895ff6fefa9e6e729a2c26b8" ]
[ "asreview/query_strategies/uncertainty.py" ]
[ "# Copyright 2019 The ASReview 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 requir...
[ [ "numpy.max" ] ]