repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
haoyang-insitro/ABC-Enhancer-Gene-Prediction
[ "48038167b1bf746cca0716f6202f6a90e56bb273" ]
[ "src/hic.py" ]
[ "# from insitro_core.utils.storage import makedirs\nimport os\nimport time\nfrom os.path import basename, join\n\nimport numpy as np\nimport pandas as pd\nimport scipy.sparse as ssp\n\nfrom insitro_core.utils.cloud.bucket_utils import check_exists, download_file\n\n\ndef get_hic_file(chromosome, hic_dir, allow_vc=T...
[ [ "numpy.nan_to_num", "pandas.DataFrame", "numpy.all", "numpy.max", "numpy.mean", "scipy.sparse.dia_matrix", "numpy.exp", "numpy.hstack", "pandas.read_csv", "numpy.clip", "numpy.log", "numpy.min", "numpy.isnan", "scipy.sparse.csr_matrix", "pandas.read_tabl...
Spacider/UNSW_2021T1
[ "bc59ca2dc048ee695217e6da09f32e2a82961bb7" ]
[ "COMP9318/lab2/test.py" ]
[ "## import modules here \nimport pandas as pd\nimport numpy as np\nimport helper\n\n\n################### Question 1 ###################\n\ndef buc_rec_optimized(df): # do not change the heading of the function\n res = pd.DataFrame(columns=df.columns.values)\n pre = []\n my_buc_rec_optimized(df, pre, res)...
[ [ "pandas.DataFrame" ] ]
JesseyXujin/Paddle
[ "843bdbaae1253d6dc964e6beddce239a88add113" ]
[ "python/paddle/fluid/contrib/slim/graph/graph_wrapper.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.product" ] ]
davidgraymi/tetris-ai
[ "e406ac13ecf2aae018478acc06e815b77f483d09" ]
[ "src/run.py" ]
[ "from dqn_agent import DQNAgent\nfrom tetris import Tetris\nfrom datetime import datetime\nfrom statistics import mean, median\nimport random\nfrom tqdm import tqdm\nimport pandas as pd\n \n\n# Run dqn with Tetris\ndef dqn():\n env = Tetris()\n episodes = 500\n max_steps = None\n epsilon_stop_epi...
[ [ "pandas.DataFrame" ] ]
krystophny/profit
[ "c6316c9df7cfaa7b30332fdbbf85ad27175eaf92", "c6316c9df7cfaa7b30332fdbbf85ad27175eaf92" ]
[ "draft/pendulum/prod_extended/prod_extended.py", "draft/Pendulum/cosine_gpy.py" ]
[ "import numpy as np\nimport GPy\n\nk0 = GPy.kern.RBF(1, active_dims=0)\nk1 = GPy.kern.RBF(1, active_dims=1)\n\nk0_der = GPy.kern.DiffKern(k0, 0)\n\n# Extended class for product kernel,\n# can be merged with Prod class when finished\n\nclass ProdExtended(GPy.kern.Prod): \n def dK_dX(self, X, X2, dimX):\n ...
[ [ "numpy.zeros", "numpy.prod" ], [ "numpy.hstack", "matplotlib.pyplot.imshow", "numpy.linspace", "numpy.cos", "numpy.sin", "matplotlib.pyplot.plot", "numpy.ones", "numpy.array", "numpy.where", "matplotlib.pyplot.figure" ] ]
yasuyuky/optuna
[ "f9d7b65f4a5918ec717cfc70fa005975b6a23190" ]
[ "examples/pytorch_lightning_simple.py" ]
[ "\"\"\"\nOptuna example that optimizes multi-layer perceptrons using PyTorch Lightning.\n\nIn this example, we optimize the validation accuracy of hand-written digit recognition using\nPyTorch Lightning, and MNIST. We optimize the neural network architecture. As it is too time\nconsuming to use the whole MNIST data...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cuda.is_available", "torch.nn.functional.nll_loss" ] ]
RobbeDePrins/bosonic
[ "036e537421255793a165742e9af678bc0f31f9b7" ]
[ "bosonic/phi_dispatch.py" ]
[ "\n\nimport sys\nimport numpy as np\n\nfrom .aa_phi import aa_phi as aa_phi_cpu\nfrom .aa_phi import binom\n\n# Try to import cuda library & test\ngpu_avail = True\ntry:\n from .gpu_phi import GpuPhiDispatcher\n from .util import haar_rand\n\n aa_phi_gpu = GpuPhiDispatcher()\n U = haar_rand(4)\n phiU...
[ [ "numpy.abs" ] ]
Mortal/smb-frames
[ "5e6377a724e58c84ead9c95c1c5abf9e7c8eca2b" ]
[ "smb-frames.py" ]
[ "#!/usr/bin/env python3\nimport json\nimport argparse\nimport datetime\nimport numpy as np\n\nfrom smb_timer import timestamp, crop_string, find_levels_streaming\n\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument('--plot', '-p', action='store_true')\n parser.add_argument('--from', ...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ] ]
sukritws40/TSP-GPwith2-OPT
[ "cdc7b7b7c8088da7f4e8b940bc35454295d8551c" ]
[ "TSP/tsp_with_improvement.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nimport math\r\nimport matplotlib.pyplot as plt\r\n\r\nfrom time import time\r\nfrom random import shuffle, randrange, randint\r\n#number of generation\r\nn = 10\r\n\r\ndef main():\r\n \r\n #Data preparation\r\n df = pd.read_csv('test_200.csv', header = 0)\r\n ...
[ [ "matplotlib.pyplot.gca", "pandas.read_csv", "matplotlib.pyplot.show" ] ]
oblanchet/mlpack
[ "e02ab3be544694294d2f73bd12a98d0d162ef3af" ]
[ "src/mlpack/bindings/python/mlpack/matrix_utils.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nmatrix_utils.py: utilities for matrix conversion\n\nThis file defines the to_matrix() function, which can be used to convert Pandas\ndataframes or other types of array-like objects to numpy ndarrays for use in\nmlpack bindings.\n\nmlpack is free software; you may redistribute it and/...
[ [ "numpy.ndarray", "numpy.dtype", "pandas.__version__.split", "numpy.array", "numpy.zeros" ] ]
jborchma/xgboost
[ "7a99f8f27f7dd7fadd7e7729952eaa2e4424f6c9" ]
[ "tests/python-gpu/test_gpu_basic_models.py" ]
[ "import sys\nimport os\nimport unittest\nimport numpy as np\nimport xgboost as xgb\nsys.path.append(\"tests/python\")\n# Don't import the test class, otherwise they will run twice.\nimport test_basic_models as test_bm # noqa\nrng = np.random.RandomState(1994)\n\n\nclass TestGPUBasicModels(unittest.TestCase):\n ...
[ [ "numpy.random.RandomState", "numpy.random.randn", "numpy.random.randint" ] ]
danipozo/practicas-mnii
[ "f4afe725316c694a4cd06e2ce3c0019f4f68652f", "f4afe725316c694a4cd06e2ce3c0019f4f68652f" ]
[ "practica3/12c.py", "practica3/12.py" ]
[ "# PROGRAMA 8\n# -*- coding: utf-8 -*-\n\nfrom math import fabs, exp\nfrom scipy.interpolate import lagrange\nfrom scipy.integrate import quad\nfrom decimal import *\n\n\na = 0.0\nb = 1.0\nn = 10\nk = 4\n\n# Función f de dos variables\ndef f(t,y):\n\treturn (2-2*t*y)/(1+pow(t,2))\n\n# Solución exacta\nsol_exacta = ...
[ [ "scipy.integrate.quad", "scipy.interpolate.lagrange" ], [ "scipy.integrate.quad", "scipy.interpolate.lagrange" ] ]
deepset-ai/Haystack
[ "4a63707f1a177123c13929eb316d3ecaa7fd6c5f" ]
[ "test/document_stores/test_weaviate.py" ]
[ "import uuid\n\nimport numpy as np\nimport pytest\n\nfrom haystack.schema import Document\nfrom ..conftest import get_document_store\n\n\nembedding_dim = 768\n\n\ndef get_uuid():\n return str(uuid.uuid4())\n\n\nDOCUMENTS = [\n {\"content\": \"text1\", \"id\": \"not a correct uuid\", \"key\": \"a\"},\n {\"c...
[ [ "numpy.random.rand" ] ]
bertsky/ocrd_typegroups_classifier
[ "245be86af76826bb3e7d1c5b2cfe638b6395d30c" ]
[ "ocrd_typegroups_classifier/network/densenet.py" ]
[ "import re\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\n\n__all__ = ['DenseNet', 'densenet121', 'densenet169', 'densenet201', 'densenet161']\n\nmodel_urls = {\n 'densenet121': 'https://download.pytorch.org/models/densenet121-a639ec97.pth',\n 'dens...
[ [ "torch.nn.functional.dropout", "torch.cat", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.Linear", "torch.nn.AvgPool2d", "torch.nn.functional.relu", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "...
mreso/pytorch
[ "4f32bdd80217a51d9bb8d6c4d55b97159bc1f02d" ]
[ "torch/testing/_internal/common_fx2trt.py" ]
[ "import unittest\nfrom typing import Callable, List, Tuple\n\nimport torch\nimport torch.fx\nimport fx2trt_oss.tracer.acc_tracer.acc_tracer as acc_tracer\nfrom fx2trt_oss.fx import (\n TRTInterpreter,\n InputTensorSpec,\n TRTModule,\n)\nfrom fx2trt_oss.fx.passes.pass_utils import chain_passes\nfrom fx2trt_...
[ [ "torch.fx.passes.shape_prop.ShapeProp", "torch.manual_seed", "torch.fx.experimental.normalize.NormalizeArgs", "torch.fx.symbolic_trace", "torch.no_grad", "torch.cuda.is_available" ] ]
dongchirua/Feat2Vec
[ "32f2345065f767be2ba61ec62ba6c89540eb83d6" ]
[ "feat2vec/sampler.py" ]
[ "from keras.utils import Sequence\nimport numpy as np\nimport math\nimport scipy\n\nclass FMData(Sequence):\n\n def __init__(self, inputs, output, batch_size, implicit_samples=0,splits=None, feature_extraction=None, sample_probabilities={}, mask=None, shuffle=True, nce=None):\n #validate inputs:\n ...
[ [ "numpy.random.shuffle", "numpy.concatenate", "numpy.repeat", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
vikash06131721/autoMltext
[ "96f41161947d78c663e7f6b4ff452fc5bf2462e8" ]
[ "textClassifier/all_features.py" ]
[ "from sklearn.base import BaseEstimator, TransformerMixin\nimport pandas as pd\nimport joblib\nimport numpy as np\nimport ast\nimport nltk\nimport re\nimport argparse\nfrom textClassifier.statistical_features_pipeline import stats_models\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.feature_ex...
[ [ "sklearn.model_selection.GridSearchCV", "sklearn.linear_model.LogisticRegression", "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "sklearn.tree.DecisionTreeClassifier", "sklearn.ensemble.AdaBoostClassifier", "sklearn.svm.LinearSVC", "sklearn.ensemble.GradientBoostin...
techthiyanes/adapter-transformers
[ "04aeaf63c4c54856d416925258393d9e06866b46", "04aeaf63c4c54856d416925258393d9e06866b46" ]
[ "tests_adapters/test_adapter_composition.py", "src/transformers/adapters/prefix_tuning.py" ]
[ "import copy\nimport random\nimport unittest\n\nimport torch\n\nfrom tests.test_modeling_common import ids_tensor\nfrom transformers import (\n MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,\n AutoAdapterModel,\n AutoTokenizer,\n BertConfig,\n BertForSequenceClassification,\n T5AdapterModel,\n Trai...
[ [ "torch.randint", "torch.ones", "torch.manual_seed", "torch.equal", "torch.allclose" ], [ "torch.nn.Dropout", "torch.nn.Parameter", "torch.cat", "torch.randn", "torch.nn.ModuleDict", "torch.nn.Embedding", "torch.nn.Linear", "torch.arange" ] ]
Schoyen/FYS4460
[ "0c6ba1deefbfd5e9d1657910243afc2297c695a3" ]
[ "project-3/percolation.py" ]
[ "import warnings\nimport numpy as np\nimport scipy.ndimage\nimport scipy.optimize\nimport skimage\n\n\ndef compute_percolation_probability(L, p, num_samples):\n num_percolating = 0\n\n for i in range(num_samples):\n system = np.random.rand(L, L) < p\n\n labels, num_features = scipy.ndimage.measu...
[ [ "numpy.random.rand" ] ]
Injector-Spenral/libswervedrive
[ "4981d7103aaded08464b8c78b65b452f2ac41b0d" ]
[ "icrestimator.py" ]
[ "import numpy as np\nimport math\n\n\nclass ICREstimator:\n\n # constants used in the lmda estimation algo\n eta_lmda: float = 1e-3 # TODO: figure out what values this should be\n eta_delta: float = 1e-3 # TODO: figure out what values this should be\n min_delta_size: float = 1e-3 # TODO: figure out what...
[ [ "numpy.linalg.solve", "numpy.linalg.norm", "numpy.sign", "numpy.cross", "numpy.array", "numpy.zeros" ] ]
i9nn/demucs
[ "f17a7af8cd99d0b275d399f55b3ca5bf8dea2e4f" ]
[ "demucs/wav.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"Loading wav based datasets, including MusdbHQ.\"\"\"\n\nfrom collections import OrderedDict\nimport hashlib\...
[ [ "torch.stack", "torch.nn.functional.pad", "torch.distributed.barrier" ] ]
thomasbrockmeier-ams/Open3D-ML
[ "1e362bbf133537668923905a12a15c540d9b689d" ]
[ "ml3d/torch/models/sparseconvnet.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom .base_model import BaseModel\nfrom ...utils import MODEL\nfrom ..modules.losses import filter_valid_label\nfrom ...datasets.augment import SemsegAugmentation\nfrom open3d.ml.torch.layers import SparseConv, SparseConvTranspose\nfrom open3d.ml.torch.ops...
[ [ "torch.nn.Softmax", "torch.nn.functional.softmax", "torch.cat", "torch.load", "torch.unique", "numpy.clip", "numpy.reshape", "numpy.arange", "torch.reshape", "torch.from_numpy", "numpy.argmax", "numpy.zeros", "torch.nn.BatchNorm1d", "torch.full", "torch....
lverwimp/state_gradients
[ "1dfa42df068d009d2dddbab7484c87bd7177ec1f" ]
[ "aux_scripts/relative_memory.py" ]
[ "#! /usr/bin/env python\n# calculate relative memory =\n# norm(avg gradient matrix * normalized difference vector) / largest singular value for avg gradient matrix\n\nimport sys, glob, os\nimport numpy as np\n\ndiff_vector = sys.argv[1]\ngrad_dir = sys.argv[2]\nnorm_emb_f = sys.argv[3]\nif len(sys.argv) > 4:\n n...
[ [ "numpy.dot", "numpy.linalg.svd", "numpy.matmul", "numpy.linalg.norm", "numpy.load" ] ]
ysk24ok/espnet
[ "cf91a45e2a2c0b0c1ebf807d9dc107247fb73e3f" ]
[ "espnet/lm/pytorch_backend/lm.py" ]
[ "#!/usr/bin/env python3\n# Copyright 2017 Johns Hopkins University (Shinji Watanabe)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n# This code is ported from the following implementation written in Torch.\n# https://github.com/chainer/chainer/blob/master/examples/ptb/train_ptb_custom_loop.py\n\n\"\"...
[ [ "torch.nn.parallel.data_parallel", "torch.from_numpy", "torch.no_grad", "torch.cuda.is_available", "numpy.exp" ] ]
MuhammetALAPAN/Kaggle.com-Sql-BigQuery-Studies
[ "b17568dd9cd074629a8789ca3c2fc351030f76a7" ]
[ "venv/Lib/site-packages/bigquery/core/Table.py" ]
[ "import pandas as pd\n\nfrom bigquery.core.Column import detect_type, find_sample_value\n\n\ndef get_table_info(_dbstream, table_and_schema_name):\n split = table_and_schema_name.split(\".\")\n if len(split) == 2:\n table_name = split[1]\n schema_name = split[0]\n else:\n raise Excepti...
[ [ "pandas.notnull", "pandas.DataFrame" ] ]
ksboy/fairseq
[ "bba33ad64e10efd7d3d95b5a0b6ad125216542cf" ]
[ "fairseq/optim/adafactor.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nimport torch\nimport torch.optim\n\nfrom . import FairseqOptimizer, register_optimizer\n\n\n@register_optimizer('adafac...
[ [ "torch.rsqrt", "torch.mul", "torch.zeros_like", "torch.zeros" ] ]
sailfish009/FLAML
[ "492990655d09a144d99e91de4dedda761a70302e" ]
[ "test/test_automl.py" ]
[ "import unittest\n\nimport numpy as np\nimport scipy.sparse\nfrom sklearn.datasets import load_boston, load_iris\n\nfrom flaml import AutoML, get_output_from_log\n\n\ndef custom_metric(X_test, y_test, estimator, labels, X_train, y_train):\n from sklearn.metrics import log_loss\n y_pred = estimator.predict_pro...
[ [ "sklearn.datasets.load_iris", "sklearn.metrics.log_loss", "sklearn.datasets.load_boston", "numpy.random.uniform", "numpy.random.randint" ] ]
yathomasi/Fantasy-Premier-League
[ "892eb610fb081f56af7fa93cd72446e9a17db7e5" ]
[ "parsers.py" ]
[ "import csv\nimport os\n\n# from utility import uprint\nimport pandas as pd\n\n\ndef extract_stat_names(dict_of_stats):\n \"\"\"Extracts all the names of the statistics\n\n Args:\n dict_of_stats (dict): Dictionary containing key-alue pair of stats\n \"\"\"\n stat_names = []\n for key, val in d...
[ [ "pandas.DataFrame.from_records" ] ]
tijsmaas/SWaveNet
[ "4f34fc7b2c1b5139387bfec8d32266270e881b38" ]
[ "models/Regressor.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass Regressor(nn.Module):\n def __init__(self, Loss, hid, m):\n super(Regressor, self).__init__()\n self.loss_function = Loss;\n self.m = m\n if (self.loss_function == 'uni-Gaussian-novar'):\n self.m...
[ [ "torch.nn.Linear", "torch.nn.functional.softmax", "torch.rand", "torch.nn.functional.log_softmax" ] ]
katetolstaya/gym-flock
[ "b09bdfbbe4a96fe052958d1f9e1e9dd314f58419" ]
[ "gym_flock/envs/old/mapping.py" ]
[ "import gym\nfrom gym import spaces, error, utils\nfrom gym.utils import seeding\nimport numpy as np\nimport configparser\nfrom os import path\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import gca\n\nfont = {'family': 'sans-serif',\n 'weight': 'bold',\n 'size': 14}\n\n\nclass MappingEnv(...
[ [ "numpy.linspace", "numpy.mean", "numpy.fill_diagonal", "numpy.any", "numpy.hstack", "matplotlib.pyplot.gca", "numpy.clip", "numpy.stack", "numpy.copy", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.logical_not", "numpy.multiply", "matplotlib.pyplot.title...
kspurlock/CS430-Demos
[ "81a1ee923aa3e9ea27d67a412aef1f49a7204932", "81a1ee923aa3e9ea27d67a412aef1f49a7204932" ]
[ "code/dataset_creation.py", "code/image_collector.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 6 16:37:04 2021\n\n@author: kylei\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import make_blobs\n\nif __name__ == \"__main__\":\n n_classes = 2\n data, labels = make_blobs(\n n_samples=1...
[ [ "numpy.random.seed", "matplotlib.pyplot.subplots", "pandas.DataFrame", "numpy.random.uniform", "matplotlib.pyplot.show", "sklearn.datasets.make_blobs" ], [ "matplotlib.pyplot.imshow", "numpy.asarray", "numpy.save", "numpy.full", "numpy.array", "numpy.vstack" ]...
open-biotech/bio-rtd
[ "c3e2cf4d7d646bda719e5fc6f694a1cae0e412c0" ]
[ "bio_rtd/peak_shapes.py" ]
[ "\"\"\"\nPeak shapes based on mean residence time (`rt_mean`).\n\nNotes\n-----\nFunctions are evaluated for given time vectors. Peaks are considered\nclipped if they do not fully fit on the time vector.\n\nFor un-clipped peak, the integral over the peak over time == 1.\n\nFor un-clipped peak, first momentum == `rt_...
[ [ "numpy.sqrt", "numpy.clip", "numpy.math.factorial", "scipy.special.erfc", "numpy.any", "numpy.exp", "numpy.sum" ] ]
mwhitehill/Tacotron-2
[ "62c7f32b6620ff427d396be56ff60d5fc0bc0bb2" ]
[ "code/tacotron/models/attention.py" ]
[ "\"\"\"Attention file for location based attention (compatible with tensorflow attention wrapper)\"\"\"\n\nimport tensorflow as tf\nfrom tensorflow.contrib.seq2seq.python.ops.attention_wrapper import BahdanauAttention\nfrom tensorflow.python.layers import core as layers_core\nfrom tensorflow.python.ops import array...
[ [ "tensorflow.convert_to_tensor", "tensorflow.python.ops.array_ops.shape", "tensorflow.reduce_sum", "tensorflow.equal", "tensorflow.python.ops.array_ops.squeeze", "tensorflow.tanh", "tensorflow.logical_or", "tensorflow.squeeze", "tensorflow.contrib.layers.xavier_initializer", ...
edunasci/FlexAEAD
[ "a9a3225f6edb4a42a1733a4a69e42e1f8ac42c99" ]
[ "flexaeadv11/ref/python/test.py" ]
[ "#!/usr/bin/env python3\n\nfrom FlexAEADv11SBox import FlexAEADv11SBox\nfrom FlexAEADv11 import FlexAEADv11\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\n\n#\"\"\"\ndef dirShuffleLayer( a1 ):\n half = int(len(a1)/2)\n state = np.zeros(np.shape(a1),dtype=int)\n for i in range(half):\n ...
[ [ "matplotlib.pyplot.imshow", "numpy.min", "numpy.set_printoptions", "numpy.max", "numpy.identity", "numpy.shape", "matplotlib.pyplot.show" ] ]
Sheriff-A/OpenCV
[ "3f1864d921b39a87f802a6b2d1ffef95fc45d813" ]
[ "shape-detection.py" ]
[ "import cv2 as cv\nimport numpy as np\n\nframeWidth = 640\nframeHeight = 480\ncap = cv.VideoCapture(0)\ncap.set(3, frameWidth)\ncap.set(3, frameHeight)\n\n\ndef empty(a):\n pass\n\n\ncv.namedWindow('Parameters')\ncv.resizeWindow('Parameters', frameWidth, frameHeight // 2)\ncv.createTrackbar('Threshold1', 'Parame...
[ [ "numpy.ones" ] ]
LosWochos76/haushalt_wetter_extractor
[ "1132c38ed3fd132262b7263368db7a7eebe6086d" ]
[ "budget.py" ]
[ "import pdfplumber\nimport xlsxwriter\nimport sys\nimport os\nimport pandas as pd\nfrom page import Page\n\nclass Budget:\n\tdef __init__(self, pdf_filename, year):\n\t\tself.pdf_filename = pdf_filename\n\t\tself.source_year = year\n\t\tself.cache_dir = \"page_cache_\" + str(year)\n\t\tself.pages = []\n\t\tself.dat...
[ [ "pandas.DataFrame", "pandas.ExcelWriter" ] ]
acdick/endangered_species_classification
[ "cb022785a3dde20082c9c4ef18aa6d3e75f4ee1b" ]
[ "Source/classifiers.py" ]
[ "from sklearn.model_selection import GridSearchCV\n\nfrom sklearn.dummy import DummyClassifier\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.naive_bayes import MultinomialNB\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.tree import DecisionTreeClassifier\n...
[ [ "sklearn.dummy.DummyClassifier", "sklearn.linear_model.LogisticRegression", "sklearn.ensemble.RandomForestClassifier", "sklearn.naive_bayes.MultinomialNB", "sklearn.metrics.precision_score", "matplotlib.pyplot.subplots", "pandas.DataFrame", "sklearn.neighbors.KNeighborsClassifier",...
jaehobang/Eva
[ "e7f649990b8bca3bc29b3832c0ecf32efb402647" ]
[ "eva_storage/baselines/indexing/external/ssd/open_images_downloader.py" ]
[ "import time\nimport boto3\nfrom botocore import UNSIGNED\nfrom botocore.config import Config\nimport botocore\nimport logging\nfrom multiprocessing import Pool, Manager\nimport pandas as pd\nimport os\nimport argparse\nimport sys\nimport functools\nfrom urllib import request\n\n\ns3 = boto3.client('s3', config=Con...
[ [ "pandas.merge", "pandas.read_csv", "pandas.concat" ] ]
keiserlab/consensus-learning-paper
[ "2d204362569489b9ab4c861b6cb6c5b819659ada" ]
[ "data_prep.py" ]
[ "\"\"\"\nScript to generate various CSVs and get things ready for the deep learning pipeline \n\"\"\"\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport copy\nfrom PIL import Image\nimport os\nfrom sklearn.metrics import roc_curve, auc, precision_recall_curve, roc_auc_sco...
[ [ "pandas.concat", "pandas.read_csv", "numpy.maximum", "numpy.minimum", "numpy.matmul", "pandas.DataFrame", "numpy.ones", "numpy.random.shuffle", "numpy.array", "numpy.zeros" ] ]
apaniukov/workbench
[ "2f2653ecfd0143d2d53e33ad84379f13443fdfaa" ]
[ "wb/main/dataset_utils/dataset_adapters.py" ]
[ "\"\"\"\n OpenVINO DL Workbench\n Dataset adapter classes.\n\n Copyright (c) 2018-2021 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 http://www.apache.org/lic...
[ [ "pandas.read_csv" ] ]
carderne/descarteslabs-python
[ "757b480efb8d58474a3bf07f1dbd90652b46ed64" ]
[ "descarteslabs/scenes/tests/test_scene.py" ]
[ "import pytest\nimport unittest\nimport mock\nimport datetime\nimport collections\nimport textwrap\nimport warnings\nimport shapely.geometry\nimport numpy as np\n\nfrom descarteslabs.common.dotdict import DotDict\nfrom descarteslabs.scenes import Scene, geocontext\nfrom descarteslabs.scenes.scene import _strptime_h...
[ [ "numpy.sqrt" ] ]
meghbhalerao/cnnormaliztion
[ "90cf80d4de5cf86dd8bba625bd757c9540cded48" ]
[ "code/criterion.py" ]
[ "import torch\nimport torch.nn.functional as F\ndef marginal_loss(score,labels):\n \"\"\"\n args:\n score:batch * top_k\n labels: batch * top_k\n \"\"\"\n predict = F.softmax(score, dim=-1)\n loss = predict * labels #element-wise\n loss = loss.sum(dim=-1) # sum all ...
[ [ "torch.clamp", "torch.nn.functional.softmax", "torch.log" ] ]
Purg/SMQTK-Indexing
[ "24b5f875ec01a93f1c4842381a6de88041166604" ]
[ "tests/impls/nn_index/test_lsh.py" ]
[ "import collections\nimport json\nimport random\nimport types\nfrom typing import Any, Callable, Dict, Iterable, Optional, Tuple\nimport unittest.mock as mock\nimport unittest\n\nimport numpy as np\nimport pytest\n\nfrom smqtk_core.configuration import configuration_test_helper\n\nfrom smqtk_dataprovider.exceptions...
[ [ "numpy.random.seed", "numpy.asarray", "numpy.ones", "numpy.random.rand", "numpy.array", "numpy.zeros" ] ]
huimlight/SoftTeacher
[ "97064fbcce1ab87b40977544ba7a9c488274d66f" ]
[ "ssod/datasets/builder.py" ]
[ "from collections.abc import Mapping, Sequence\nfrom functools import partial\n\nimport torch\nfrom mmcv.parallel import DataContainer\nfrom mmcv.runner import get_dist_info\nfrom mmcv.utils import Registry, build_from_cfg\nfrom mmdet.datasets.builder import worker_init_fn\nfrom mmdet.datasets.samplers import (\n ...
[ [ "torch.nn.functional.pad", "torch.utils.data.dataloader.default_collate" ] ]
DecretumWang/sfft
[ "a0f64a76ff57bae78637df62feb1c6ce7578950f" ]
[ "sfft/EasyCrowdedPacket.py" ]
[ "import os\nimport time\nimport numpy as np\nimport os.path as pa\nfrom astropy.io import fits\nfrom tempfile import mkdtemp\nfrom astropy.time import Time\nfrom sfft.utils.meta.FileLockKit import FileLock\nfrom sfft.AutoCrowdedPrep import Auto_CrowdedPrep\n\n__author__ = \"Lei Hu <hulei@pmo.ac.cn>\"\n__version__ =...
[ [ "numpy.logical_or", "numpy.max", "numpy.clip" ] ]
mirlomusica/neural_training
[ "6864e8bfa39190e92284bff697a419a16d5e6450" ]
[ "models/definitions/transformer_net.py" ]
[ "\"\"\"\n Modifications to the original J.Johnson's architecture:\n 1. Instance normalization is used instead of batch normalization *\n 2. Instead of learned up-sampling use nearest-neighbor up-sampling followed by convolution **\n 3. No scaled tanh at the output of the network ***\n\n *...
[ [ "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.InstanceNorm2d", "torch.nn.functional.interpolate" ] ]
gicsaw/VHTS
[ "dd23cbb0216dd628bb95bf4bb7e93ce49514c89d" ]
[ "bin/sub_dock.py" ]
[ "#!/usr/bin/env python\nimport sys\nimport os\nimport argparse\nimport vhts.pydock as pydock\nfrom filelock import FileLock\nimport pandas as pd\n\n\ndef get_job_from_list(list_dir):\n list_file = list_dir + '/list.txt'\n if not os.path.exists(list_file):\n job_idx = None\n return job_idx\n f...
[ [ "pandas.read_pickle", "pandas.read_csv" ] ]
JiayinL/Dropout-Prediction
[ "fd1de819579b641ff8c7aa416c1fb5cb6c6a7114" ]
[ "LR_GRU.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n\nimport pandas as pd\nimport pandas_profiling\nfrom sklearn.preprocessing import LabelEncoder\nfrom tqdm import tqdm\nfrom joblib import Parallel,delayed\nimport numpy as np\nimport json\nimport re\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.nn.paralle...
[ [ "pandas.read_csv", "torch.cat", "sklearn.utils.shuffle", "torch.nn.GRU", "torch.nn.Embedding", "torch.tensor", "torch.nn.BCELoss", "numpy.max", "numpy.std", "torch.nn.Linear", "numpy.mean", "torch.nn.Tanh", "torch.nn.Sigmoid", "torch.nn.init.xavier_uniform_"...
SamVanhoutte/azure-time-travel
[ "a87a6c96025bea4123859d5f739bbd90ea5fcd30" ]
[ "ml/EngineFailurePrediction/score.py" ]
[ "import json\nimport numpy as np\nimport pandas as pd\nimport os\nimport tensorflow as tf\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Activation\nfrom tensorflow.keras.optimizers import SGD\nfrom tensorflow.keras.layers import Dense, Dropout, Flatten\nfrom tensorflow.keras.l...
[ [ "tensorflow.keras.models.load_model", "numpy.array", "numpy.random.rand", "numpy.pad" ] ]
enesmsahin/ML_Decoder
[ "a6aef44c029d6ee69c507e4609a86093a25f219f", "a6aef44c029d6ee69c507e4609a86093a25f219f" ]
[ "save_results_oi.py", "src_files/models/utils/factory.py" ]
[ "import json\nimport os\nimport os.path as op\nimport argparse\nimport time\n\nimport torch\nimport torch.nn.parallel\nimport torch.optim\nimport torch.utils.data.distributed\n\nfrom src_files.helper_functions.bn_fusion import fuse_bn_recursively\nfrom src_files.models import create_model\nimport matplotlib\n\nfrom...
[ [ "torch.load", "matplotlib.use", "torch.from_numpy", "torch.unsqueeze", "numpy.argmax", "numpy.argsort", "numpy.repeat", "numpy.array" ], [ "torch.load" ] ]
rknightly/neural-mnist
[ "42189508f6e41b8b8f93d30fc78bd598c7d47dc5" ]
[ "Train Size MNIST MLP.py" ]
[ "from __future__ import print_function\nimport keras\nfrom keras.datasets import mnist\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.optimizers import RMSprop\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Prepare Data\nbatch_size = 128\nnum_classes = 10\nepochs = 20\n\...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "numpy.insert", "matplotlib.pyplot.grid", "matplotlib.pyplot.bar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xtick...
NoVarlok/sova-tts-vocoder
[ "1d44a7247341e404e503fb0de386af5f16d36806" ]
[ "convert_model.py" ]
[ "# *****************************************************************************\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# * Redis...
[ [ "torch.nn.Parameter", "torch.load", "torch.cat", "torch.nn.utils.weight_norm", "torch.nn.ModuleList", "torch.nn.utils.remove_weight_norm", "torch.nn.Conv1d", "torch.save" ] ]
akshaykurmi/neural-networks-from-scratch
[ "54d62d9f5adb102d14267a922a515fa79bf52bd6", "54d62d9f5adb102d14267a922a515fa79bf52bd6" ]
[ "nnfs/initializers/random.py", "nnfs/initializers/he.py" ]
[ "import numpy as np\n\n\nclass RandomUniform:\n def __init__(self, min_value=-0.05, max_value=0.05, seed=None):\n self.min_value = min_value\n self.max_value = max_value\n np.random.seed(seed)\n\n def initialize(self, shape):\n return np.random.uniform(self.min_value, self.max_valu...
[ [ "numpy.random.uniform", "numpy.random.normal", "numpy.random.seed" ], [ "numpy.random.uniform", "numpy.random.randn", "numpy.sqrt", "numpy.prod" ] ]
ArgentLo/PPNW-KAIS
[ "5e69bdd3a3b9c5f90134663a52696094d8b54b15" ]
[ "pretrain.py" ]
[ "import argparse\nimport os\nimport numpy as np\nimport tensorflow as tf\nfrom tqdm import tqdm\nfrom util.gmf import PairwiseGMF\nfrom util.helper import BaseConfig\nfrom util.data import Dataset\n\nfrom util.evaluation import evaluate_model, get_eval, get_model_scores\n\nparser = argparse.ArgumentParser(formatter...
[ [ "numpy.savez", "numpy.mean", "tensorflow.GPUOptions", "tensorflow.logging.info", "tensorflow.train.Supervisor" ] ]
ctralie/Math412S2017
[ "27b32eabf079a7f8bc5dadf1acbc1e8442cfa639" ]
[ "MusicSpeech.py" ]
[ "\"\"\"\nProgrammer: Chris Tralie (ctralie@alumni.princeton.edu)\nPurpose: To show how TDA can be used to quantify how periodic\nan audio clip is. Simple example with music versus speech.\nShow how doing a delay embedding on raw audio is a bad idea when\nthe length of the period is on the order of seconds, and how...
[ [ "numpy.sum", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "numpy.mean", "matplotlib.pyplot.show", "sklearn.decomposition.PCA", "matplotlib.pyplot.figure" ] ]
kourgeorge/deep_anomalies
[ "04352a2a49197ec8cf3a2165014d79e3cf0511be" ]
[ "auto_encoder/train_autoencoder_all.py" ]
[ "import auto_encoder.network as network\nimport tensorflow as tf\nimport utils\nimport numpy as np\n\nnum_epochs = 30\nbatch_size = 100\nmodel_path = \"./model/model.ckpt\"\n\nsaver = tf.train.Saver()\n\n\n\nwith tf.Session() as sess:\n sess.run(network.init)\n num_iterations = int(utils.mnist.train.num_examp...
[ [ "tensorflow.train.Saver", "tensorflow.Session" ] ]
swapnil96/ML-NeuralNetworks
[ "025b6990e4a43989e865ca72425958cfd33a06b5" ]
[ "Convolutional Neural Networks/ensemble/ensemble.py" ]
[ "import numpy as np\nfrom keras.models import Sequential, Model, Input\nfrom keras.models import load_model\nfrom sklearn.utils import shuffle\nfrom keras.utils.np_utils import to_categorical\nfrom keras.layers import Dense, Dropout, Activation, Flatten, Average\nfrom keras.optimizers import Adam\nfrom keras.layers...
[ [ "numpy.hstack", "sklearn.utils.shuffle", "numpy.vstack", "numpy.argmax", "numpy.not_equal", "numpy.load", "numpy.array", "numpy.divide" ] ]
michiboo/jax
[ "7083b0a78edd8f2e88abe3f395ee0f51ac915082" ]
[ "jax/abstract_arrays.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.dtype", "numpy.all", "numpy.result_type", "numpy.shape", "numpy.array", "numpy.zeros" ] ]
PidgeyBE/ray
[ "7a2d7964d8f944bd60c1f03d58d6cc190c7a7015" ]
[ "rllib/agents/ddpg/tests/test_td3.py" ]
[ "import numpy as np\nimport unittest\n\nimport ray.rllib.agents.ddpg.td3 as td3\nfrom ray.rllib.utils.framework import try_import_tf\nfrom ray.rllib.utils.test_utils import check, check_compute_single_action, \\\n framework_iterator\n\ntf1, tf, tfv = try_import_tf()\n\n\nclass TestTD3(unittest.TestCase):\n de...
[ [ "numpy.std", "numpy.array" ] ]
denisuzhva/ML_task2
[ "49220c370256be66a7e3eb98ae069259aa2f48fc" ]
[ "Src/Evaluator.py" ]
[ "import numpy as np\r\n\r\n\r\n\r\ndef mseMetric(fx_batch, z_batch):\r\n batch_size = fx_batch.shape[0]\r\n metric = np.sum(np.square(z_batch - fx_batch)) / batch_size\r\n return metric\r\n\r\n\r\ndef rmseMetric(fx_batch, z_batch):\r\n batch_size = fx_batch.shape[0]\r\n metric = np.sum(np.square(z_ba...
[ [ "numpy.square", "numpy.mean", "numpy.linalg.norm", "numpy.sqrt" ] ]
Corie96/fairseq-dev
[ "24be7a63db5de078f81487544385feb51aea9453" ]
[ "generate.py" ]
[ "#!/usr/bin/env python3 -u\n# 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...
[ [ "torch.cuda.is_available" ] ]
ZichaoGuo/PaddleSlim
[ "2550fb4ec86aee6155c1c8a2c9ab174e239918a3" ]
[ "demo/unstructured_prune/train.py" ]
[ "import os\nimport sys\nimport logging\nimport paddle\nimport argparse\nimport functools\nimport time\nimport numpy as np\nimport paddle.fluid as fluid\nfrom paddleslim.prune.unstructured_pruner import UnstructuredPruner, GMPUnstructuredPruner\nfrom paddleslim.common import get_logger\nsys.path.append(os.path.join(...
[ [ "numpy.array", "numpy.mean" ] ]
wenxichen/donkeycar
[ "5a23b0fee170596e29c80826c3db0d3a4c4c5392" ]
[ "donkeycar/parts/camera.py" ]
[ "import os\nimport time\nimport numpy as np\nfrom PIL import Image\nimport glob\nfrom donkeycar.utils import rgb2gray\n\nclass BaseCamera:\n\n def run_threaded(self):\n return self.frame\n\nclass PiCamera(BaseCamera):\n def __init__(self, image_w=160, image_h=120, image_d=3, framerate=20, vflip=False, ...
[ [ "numpy.asarray" ] ]
aiwithqasim/tensorflow-specialization
[ "4355d00bcb88aa39ca5dfa2daed5f306d2043d55" ]
[ "Pycharm code/C1/W2/C1_W2_Assignment_Solution.py" ]
[ "import tensorflow as tf\nprint(tf.__version__)\n\n\n# GRADED FUNCTION: train_mnist\ndef train_mnist():\n # Please write your code only where you are indicated.\n # please do not remove # model fitting inline comments.\n\n # YOUR CODE SHOULD START HERE\n class myCallback(tf.keras.callbacks.Callback):\n ...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Flatten" ] ]
Jasplet/SKS_Splitting
[ "d5c3ea442e75fd9643c31575158cf350aa41a5e2" ]
[ "src/plot_splitting.py" ]
[ "#! /usr/bin/env python\n### Script containing varous plotting functions for splitting Measurements\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport cartopy.crs as cart\nimport cartopy\nimport matplotlib.gridspec as gridspec\nimport obspy\nfrom obspy import taup\n\ndef load(stat,pha...
[ [ "matplotlib.pyplot.tight_layout", "numpy.isnan", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.axes", "matplotlib.pyplot.subplot", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
KamalGalrani/h2o-3
[ "5d5b6b319569b03ad1bca004a6d1a5dc6972d433" ]
[ "h2o-py/h2o/model/model_base.py" ]
[ "# -*- encoding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nimport traceback\nimport warnings\n\nimport h2o\nfrom h2o.base import Keyed\nfrom h2o.exceptions import H2OValueError\nfrom h2o.job import H2OJob\nfrom h2o.utils.backward_compatibility import...
[ [ "matplotlib.use", "matplotlib.gridspec.GridSpec", "pandas.DataFrame" ] ]
tkhirianov/TopicNet
[ "41318897d25b622da16f20d68fe9c315cd177b3c" ]
[ "topicnet/viewers/spectrum.py" ]
[ "\"\"\"\nA few ways to obtain \"decent\" solution to TSP problem\nwhich returns a spectre of topics in our case. \nIf speed is the essence I recommend to use functions providing\ngood initial solution. Which are, get_nearest_neighbour_init. \nIf that solution is not good enough use annealing heuristic (get_anneal...
[ [ "numpy.random.choice", "numpy.min", "numpy.arange", "scipy.spatial.distance.cdist", "numpy.max", "numpy.delete", "scipy.spatial.distance.pdist", "numpy.argmin", "numpy.random.rand", "numpy.exp", "numpy.zeros", "numpy.sum" ] ]
lem0nle/PyGCL
[ "340b0201a5edf4236fef4c96b958ff373ceb7f28" ]
[ "GCL/models/samplers.py" ]
[ "import torch\nfrom abc import ABC, abstractmethod\nfrom torch_scatter import scatter\n\n\nclass Sampler(ABC):\n def __init__(self, intraview_negs=False):\n self.intraview_negs = intraview_negs\n\n def __call__(self, anchor, sample, *args, **kwargs):\n ret = self.sample(anchor, sample, *args, **...
[ [ "torch.ones", "torch.cat", "torch.zeros", "torch.eye", "torch.zeros_like", "torch.ones_like" ] ]
Arctickirillas/Rubrication
[ "35d2d7362aaf4776dcb28d13d7e07942ac8bad85" ]
[ "competition.py" ]
[ "# coding: utf-8\n__author__ = 'Kirill Rudakov'\n\nimport read as r\nimport quantify as q\nfrom nltk.stem.snowball import SnowballStemmer\nfrom nltk import word_tokenize\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom nltk.tokenize import TweetTokenizer\nfrom nltk.corpus import stopwords\nfrom sk...
[ [ "numpy.log", "sklearn.cross_validation.train_test_split", "numpy.asarray", "numpy.array", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
alejandroviegener/copy-test
[ "c9b32380ce85ec11488092d9f692c63ce51bd9eb", "c9b32380ce85ec11488092d9f692c63ce51bd9eb" ]
[ "tests/test_plotting.py", "muttlib/forecast.py" ]
[ "\"\"\"muttlib.plotting test suite.\n\n`muttlib` uses `pytest-mpl` to plots testing.\n\nTo use, you simply need to mark the function where you want to compare images using\n@pytest.mark.mpl_image_compare, and make sure that the function returns\na Matplotlib figure (or any figure object that has a savefig method):\...
[ [ "numpy.array", "pandas.concat", "pandas.to_datetime", "numpy.random.default_rng" ], [ "numpy.asarray" ] ]
kperrynrel/bifacial_radiance
[ "cf5ae46b4ef93990e3e1619956a186376cb4fd8a" ]
[ "bifacial_radiance/HPCScripts/simulate_improvedArray_Oct2127.py" ]
[ "import numpy as np\nimport os\nimport pandas as pd\nimport time\nimport math\nfrom itertools import chain\nfrom itertools import product\n\nfrom bifacial_radiance import AnalysisObj, load, MetObj, RadianceObj\nfrom bifacial_radiance.spectral_utils import (spectral_property,\n ...
[ [ "pandas.concat", "pandas.to_datetime", "numpy.sum", "pandas.read_csv" ] ]
iturov/rov2018
[ "ca1949806d105a2caddf2cf7a1361e2d3f6a1246" ]
[ "groundstation/ROV/OCR/old-studies/atahan.py" ]
[ "import pyscreenshot as ImageGrab\nimport cv2\nimport numpy as np\nimport pytesseract\nfrom PIL import Image\n\nsrc_path = \"C:\\\\Users\\\\Public\\\\ROV\\\\OCR\\\\\"\nif __name__ == \"__main__\":\n # fullscreen\n im=ImageGrab.grab()\n im.show()\n im.save('init.png')\n\ntext=[]\na = pytesseract.image_to...
[ [ "numpy.ones" ] ]
ChengIC/ryan-sad
[ "09a93245ae6917911bd0f9d39d533d825c23c259" ]
[ "networks/layers/standard.py" ]
[ "import torch\r\n\r\nfrom torch.nn import Module\r\nfrom torch.nn import init\r\nfrom torch.nn.parameter import Parameter\r\n\r\n\r\n# Acknowledgements: https://github.com/wohlert/semi-supervised-pytorch\r\nclass Standardize(Module):\r\n \"\"\"\r\n Applies (element-wise) standardization with trainable transla...
[ [ "torch.nn.init.constant_", "torch.div", "torch.Tensor" ] ]
SchneiderDaniel/data
[ "741f5d912eb9a62b77ec3cecf4fc54f21133784c" ]
[ "flask/Dashapps/world/Dash_App13.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom dash import Dash\nfrom dash.dependencies import Input, Output, ALL, State, MATCH, ALLSMALLER, ClientsideFunction\nfrom Dashapps.Dash_fun import apply_layout_with_auth, load_object, save_object\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport dash_boot...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
koya-ken/pose-ae-train
[ "e6147778ac4da079db03abb286becaae29653dac" ]
[ "task/pose.py" ]
[ "\"\"\"\n__config__ contains the options for training and testing\nBasically all of the variables related to training are put in __config__['train'] \n\"\"\"\nimport torch\nimport numpy as np\nfrom torch import nn\nimport os\nfrom torch.nn import DataParallel\nfrom utils.misc import make_input, make_output, importN...
[ [ "torch.mean" ] ]
patalen/daqhats
[ "90d5a47f5cf5dd8103632df70a9266c4245d9862" ]
[ "daqhats/mcc172.py" ]
[ "# pylint: disable=too-many-lines\n\"\"\"\nWraps all of the methods from the MCC 172 library for use in Python.\n\"\"\"\nimport sys\nfrom collections import namedtuple\nfrom ctypes import c_ubyte, c_int, c_ushort, c_ulong, c_long, c_double, \\\n POINTER, c_char_p, byref, create_string_buffer\nfrom enum import In...
[ [ "numpy.ctypeslib.ndpointer", "numpy.resize", "numpy.empty" ] ]
guanhuaw/BLIPSrecon
[ "b46667861f036eeddc138d97430c6fd7154f6654" ]
[ "Supervised learning/test.py" ]
[ "import os\nfrom options.test_options import TestOptions\nfrom data import CreateDataLoader\nfrom models import create_model\nfrom util.visualizer import save_images\nfrom util import html\nimport ntpath\nimport numpy as np\n\nif __name__ == '__main__':\n opt = TestOptions().parse()\n opt.nThreads = 1 # test...
[ [ "numpy.append", "numpy.sum", "numpy.save" ] ]
yuj09161/group
[ "69ff6e1d988a979968d267c83a901a0567828fd9" ]
[ "load.py" ]
[ "import matplotlib.pyplot as plt,json\n\nwith open('export.json','w') as file:\n json.dump(res,file)\n\nfor k in range(len(res)):\n x=[]\n y=[]\n for j in range(len(res[k])):\n x.append(res[k][j][0])\n y.append(res[k][j][1])\n plt.scatter(x,y)\nplt.show()" ]
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.scatter" ] ]
buridiaditya/gym
[ "99d4555e1862cb0bc88971fa6bc3402aa295b859" ]
[ "gym/envs/madras/gym_madras.py" ]
[ "\"\"\"\nGym Madras Env Wrapper.\n\nThis is an OpenAI gym environment wrapper for the MADRaS simulator. For more information on the OpenAI Gym interface, please refer to: https://gym.openai.com\n\nBuilt on top of gym_torcs https://github.com/ugo-nama-kun/gym_torcs/blob/master/gym_torcs.py\n\nThe following enhanceme...
[ [ "numpy.hstack", "numpy.array" ] ]
Hekstra-Lab/microutil
[ "ab3b7b51754bf90ef35d6eea1c7b35cece638f0e", "ab3b7b51754bf90ef35d6eea1c7b35cece638f0e" ]
[ "microutil/leica/leica.py", "microutil/loading.py" ]
[ "# flake8: noqa E741\nimport glob\nimport re\nimport xml.etree.ElementTree as ET\n\nimport dask.array as da\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport tifffile as tiff\nimport xarray as xr\nfrom cycler import cycler\n\n__all__ = [\n \"delay_to_wns\",\n \"get_standard_met...
[ [ "numpy.isnan", "pandas.to_datetime", "pandas.Series", "numpy.linspace" ], [ "numpy.linspace", "pandas.DataFrame" ] ]
fpthink/V2B
[ "87561d5cd00ebf31326e8364167a787681ded367" ]
[ "nuscenes-devkit-master/python-sdk/nuscenes/utils/kitti.py" ]
[ "# nuScenes dev-kit.\n# Code written by Alex Lang and Holger Caesar, 2019.\n\nimport os\nfrom os import path as osp\nfrom typing import List, Tuple, Any, Union\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom PIL import Image\nfrom matplotlib.axes import Axes\nfrom pyquaternion import Quaternion\nimport...
[ [ "numpy.dot", "matplotlib.pyplot.tight_layout", "numpy.fromfile", "numpy.min", "numpy.isnan", "numpy.eye", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.arctan2", "numpy.max", "numpy.array", "numpy.sum" ] ]
Litchichu/Deniable-Steganography
[ "e39dc71b049b0051e6e16eee9a6eea55a526459b" ]
[ "main.py" ]
[ "import os\nimport pprint\nimport argparse\nimport torch\nimport pickle\nimport utils\nimport logging\nimport sys\n\nfrom options import *\nfrom model.hidden import Hidden\nfrom noise_layers.noiser import Noiser\nfrom noise_argparser import NoiseArgParser\n\nfrom train import train\nimport torchsnooper\n\n\ndef mai...
[ [ "torch.device", "torch.cuda.is_available" ] ]
rostoker/sagemaker-battlesnake-ai
[ "789036399cfdc034d8b79c00feec134834476a9b" ]
[ "source/BattlesnakeGym/battlesnake_gym/snake.py" ]
[ "# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\").\n# You may not use this file except in compliance with the License.\n# A copy of the License is located at\n# \n# http://www.apache.org/licenses/LICENSE-2.0\n# \n# or in...
[ [ "numpy.copy", "numpy.array", "numpy.zeros" ] ]
PoCFrance/Pool2019
[ "b043a2a06886d72d51d829942a657145020afcf7" ]
[ "ai/exercices/day01/blood_model.py" ]
[ "import csv\nimport numpy as np\nimport random\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\n\n\nPARAM_MIN_INIT = -1.0\nPARAM_MAX_INIT = 1.0\nLEARNING_RATE = 0.001\nMU = 0.57 # Limit of loss (when the loss become lower than MU, we can stop the training)\n\n# Normalize numpy array\nde...
[ [ "matplotlib.use", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
aister2020/KDDCUP_2020_MultimodalitiesRecall_3st_Place
[ "508c263e72184e28ad6c5eadf637095761e5e035" ]
[ "code/v1/src/run.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\nimport datetime\nimport os\n\nimport utils.flag_setup as flag_setup\nimport utils.json_reader as json_reader\nimport model.estimator_builder as estimator_builder\n\ntf.logging.set_verbosity(tf.logging.INFO)\n\n\ndef local_run(model_json):\n epoch_steps = int(f...
[ [ "tensorflow.logging.info", "tensorflow.logging.set_verbosity", "tensorflow.estimator.train_and_evaluate", "tensorflow.disable_chief_training", "tensorflow.app.run" ] ]
coltekin/emoji2018
[ "a6795e248ada9a3cebdb4987574038e4e5affa93" ]
[ "tune-rnn.py" ]
[ "#!/usr/bin/env python3\nfrom emoji_data import load\nfrom features import doc_to_numseq\nimport random\nimport numpy as np\nfrom sklearn.model_selection import StratifiedShuffleSplit\nfrom collections import Counter\nfrom keras.preprocessing.sequence import pad_sequences\nfrom keras.utils.np_utils import to_catego...
[ [ "numpy.max", "sklearn.metrics.precision_recall_fscore_support", "numpy.argmax", "sklearn.model_selection.StratifiedShuffleSplit", "numpy.array", "sklearn.metrics.accuracy_score" ] ]
inspire-group/PatchGuard
[ "5ca61b8a3d3814d72ee64d5587d02147fc216478" ]
[ "nets/bagnet.py" ]
[ "#################################################################################################################\n# Adapted from https://github.com/wielandbrendel/bag-of-local-features-models/blob/master/bagnets/pytorchnet.py #\n# Mainly changed the model forward() function ...
[ [ "torch.nn.Sequential", "torch.clamp", "torch.mean", "torch.max", "torch.median", "torch.nn.Conv2d", "torch.sum", "torch.arange", "torch.tanh", "torch.nn.Linear", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.utils.model_zoo.load_url" ...
jireh-father/KoBERT
[ "13b10589979d9a17137edcbd34c5dcee7eb552f7" ]
[ "train_extractive_summary.py" ]
[ "import os\nimport argparse\nimport random\nimport numpy as np\nimport torch\nfrom kobert.pytorch_kobert import get_pytorch_kobert_model\nimport jsonlines\nfrom torch.utils import data\nfrom gluonnlp.data import SentencepieceTokenizer\nfrom kobert.utils import get_tokenizer\nfrom torch import nn\nfrom torch.nn.util...
[ [ "matplotlib.pyplot.imshow", "torch.max", "torch.nn.functional.nll_loss", "torch.load", "torch.autograd.set_detect_anomaly", "torch.nn.utils.rnn.pad_sequence", "torch.utils.data.DataLoader", "sklearn.metrics.confusion_matrix", "torch.set_grad_enabled", "torch.FloatTensor", ...
silviomori/udacity-deep-reinforcement-learning-nanodegree
[ "4b217ad39d119361fad84e1eaae6396432de341a" ]
[ "dqn/exercise/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass QNetwork(nn.Module):\n \"\"\"Actor (Policy) Model.\"\"\"\n\n def __init__(self, state_size, action_size, seed, hidden_nodes=64):\n \"\"\"Initialize parameters and build model.\n Params\n ======\n sta...
[ [ "torch.nn.Linear", "torch.manual_seed" ] ]
mnfienen/sfrmaker
[ "7e66d67d6cb0ad84fbb9994402f0baaf5b3fcd01" ]
[ "sfrmaker/test/test_version.py" ]
[ "\"\"\"\ncheck for consistancy in package version\n\"\"\"\nimport os\nfrom packaging import version\nimport pandas as pd\nimport sfrmaker\nimport pytest\n\n\ndef get_readme_version(project_root_path):\n readme_file = os.path.join(project_root_path, 'Readme.md')\n with open(readme_file) as src:\n for li...
[ [ "pandas.Timestamp" ] ]
vishalbelsare/SLAPP3
[ "da187b771831aaaabaee16a26ad341db2e968104" ]
[ "6 objectSwarmObserverAgents_AESOP_turtleLib_NetworkX/$$slapp$$/graphicControl.py" ]
[ "import sys\nimport os\nimport commonVar as common\n\ncommon.graphicStatus = \"\"\n\n\ndef checkRunningIn():\n try:\n __IPYTHON__\n return True\n except NameError:\n return False\n\n\ndef graphicControl():\n # IPython/Python\n IPython = checkRunningIn()\n\n # running in Python (n...
[ [ "matplotlib.get_backend" ] ]
trungnt13/sisua
[ "27c01002aaac5b33947946a483bfb6678273bc83" ]
[ "sisua/analysis/sc_metrics.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nfrom abc import ABCMeta, abstractmethod\nfrom collections import defaultdict\nfrom numbers import Number\nfrom typing import List, Union\n\nimport numpy as np\nimport tensorflow as tf\nfrom six import add_metaclass\nfrom tensorflow.python.keras.ca...
[ [ "tensorflow.is_tensor", "tensorflow.reduce_mean", "numpy.median", "numpy.argmax", "numpy.mean" ] ]
gs512/inferelator
[ "391223bd8d07476db72c4c7b1cd5fb5bf7494b9c" ]
[ "inferelator/tests/test_crossvalidation_wrapper.py" ]
[ "import unittest\nimport pandas as pd\nimport types\nimport numpy as np\nimport tempfile\nimport os\n\nfrom inferelator import crossvalidation_workflow\nfrom inferelator.workflow import WorkflowBase\n\nfake_metadata = pd.DataFrame({\"CONST\": [\"A\"] * 1000,\n \"VAR\": [\"A\"] * 100 + [...
[ [ "numpy.random.RandomState", "pandas.DataFrame" ] ]
buzzCraft/RobTek-prosjekt
[ "12edd1d83a621a10d74421e51cf8dbf861ee9abe" ]
[ "pyueye_utils.py" ]
[ "#!/usr/bin/env python\n\n#------------------------------------------------------------------------------\n# PyuEye example - utilities modul\n#\n# Copyright (c) 2017 by IDS Imaging Development Systems GmbH.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or wit...
[ [ "numpy.reshape" ] ]
sh8/kornia
[ "b340559dea9c2e01a01fb6062511a23cd175fbde" ]
[ "test/geometry/test_ransac.py" ]
[ "import random\n\nimport pytest\nimport torch\nfrom torch.autograd import gradcheck\n\nimport kornia\nimport kornia.testing as utils\nfrom kornia.geometry import RANSAC\nfrom kornia.testing import assert_close\n\n\nclass TestRANSACHomography:\n def test_smoke(self, device, dtype):\n points1 = torch.rand(4...
[ [ "torch.rand_like", "torch.eye", "torch.tensor", "torch.rand", "torch.autograd.gradcheck" ] ]
amwufiv/spark
[ "b50d4507f52315d5f6d75c617e845248a1c828a9" ]
[ "python/pyspark/tests/test_serializers.py" ]
[ "#\n# 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\"); yo...
[ [ "numpy.array" ] ]
huhji/License_plate_recognition_CRNN_korean
[ "1f8447f085a0571fead7abdc120db167de048741" ]
[ "Image_Generator.py" ]
[ "import cv2\nimport os, random\nimport numpy as np\nfrom parameter import letters\n\n# # Input data generator\ndef labels_to_text(labels): # letters의 index -> text (string)\n return ''.join(list(map(lambda x: letters[int(x)], labels)))\n\ndef text_to_labels(text): # text를 letters 배열에서의 인덱스 값으로 변환\n r...
[ [ "numpy.expand_dims", "numpy.zeros", "numpy.ones" ] ]
omnicomdatahousecl/omnicom_libraries
[ "d97447b01d845a12462d5313be31f1debd180770" ]
[ "pycomscore/pycomscore.py" ]
[ "\"\"\"\r\nThis is a module that allows you to connect to the Comscore library \r\ndeveloped by Annalect and obtain synthesized information.\r\n\"\"\"\r\n\r\n__author__ = \"Carlos Trujillo, Data analytics Manager\"\r\n__email__ = \"carlos.trujillo@omnicommediagroup.com\"\r\n__status__ = \"planning\"\r\n\r\n\r\nfrom...
[ [ "pandas.concat", "pandas.DataFrame", "pandas.DataFrame.from_dict", "pandas.read_sql", "pandas.pivot_table" ] ]
LIIR-KULeuven/CLDR_CLNER_models
[ "5fe47a988b88a36d0ccf4484aff5ab70c59f39d6" ]
[ "tSNE_analysis/tSNE_RE_space_named_entities.py" ]
[ "import seaborn as sns\nimport random\nimport os\nimport h5py\nimport matplotlib.pyplot as plt\nfrom sklearn.manifold import TSNE\nimport configparser\n\nparser = configparser.ConfigParser()\nparser.read(\"./../configs/tSNE_analysis.conf\")\n\nSPLIT_NUM = int(parser.get(\"config\", \"split_num\"))\n\nclass tSNE_ana...
[ [ "sklearn.manifold.TSNE", "matplotlib.pyplot.close" ] ]
yueri/Cook
[ "12162ef040c28662e4f3fb259d3d81bda3b59860" ]
[ "integration/tests/cook/util.py" ]
[ "import functools\nimport importlib\nimport itertools\nimport json\nimport logging\nimport os\nimport os.path\nimport subprocess\nimport time\nimport unittest\nimport uuid\nfrom datetime import datetime\nfrom urllib.parse import urlencode, urlparse\n\nimport numpy\nimport requests\nfrom retrying import retry\n\nfro...
[ [ "numpy.percentile" ] ]