repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
lizhaokun/Table-Extraction-and-Chinese-OCR
[ "5636e7140c07e41d8bdbc0a0f8c27a6eb33df706" ]
[ "dnn/ocr.py" ]
[ "import cv2\nimport os\nimport time\nimport json\nimport numpy as np\nfrom PIL import Image\nfrom config import ocrPath,GPU\ndef read_characters():\n p= ocrPath.replace('.weights','.json')\n if os.path.exists(p):\n with open(p, encoding='utf-8') as f:\n characters = json.loads(f.read())\n ...
[ [ "numpy.ceil", "numpy.array", "numpy.zeros" ] ]
msamribeiro/ultrasound-speech-error-detection
[ "c9661676c8f993e383f07d08fd8091811bf9286a" ]
[ "model.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nModel architecture for PyTorch\n\nDate: 2020\nAuthor: M. Sam Ribeiro\n\"\"\"\n\nimport numpy as np\nnp.random.seed(42)\n\nimport random\nrandom.seed(42)\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n\nclass Model(nn.Module):\n\n...
[ [ "torch.nn.BatchNorm1d", "torch.nn.LogSoftmax", "numpy.random.seed", "torch.cat", "torch.nn.Conv2d", "torch.nn.Linear" ] ]
ziniBRC/RNASSR-Net
[ "7e43f62bb00c75c913b7f53fd085151517eeca98" ]
[ "nets/RNA_graph_classification/graphsage_net.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport dgl\n\n\"\"\"\n GraphSAGE: \n William L. Hamilton, Rex Ying, Jure Leskovec, Inductive Representation Learning on Large Graphs (NeurIPS 2017)\n https://cs.stanford.edu/people/jure/pubs/graphsage-nips17.pdf\n\"\"\"\n\nfrom layers...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.Linear", "torch.nn.Dropout" ] ]
korintje/pygjf
[ "fb30ad84fe7da1f08c4a7a76f4a02d796d88081f" ]
[ "pygjf.py" ]
[ "import math\r\nimport numpy as np\r\n\r\ndef cart2sph(cart):\r\n XsqPlusYsq = cart[0]**2 + cart[1]**2\r\n r = math.sqrt(XsqPlusYsq + cart[2]**2)\r\n elev = math.atan2(cart[2], math.sqrt(XsqPlusYsq))\r\n az = math.atan2(cart[1], cart[2])\r\n return np.array([r, elev, az])\r\n\r\ndef sph2cart(sph):\r\...
[ [ "numpy.array", "numpy.cos", "numpy.sin" ] ]
menajosep/recipe-summarization
[ "3eb595582962b38daadca04b93f3e6dcf2dd0146" ]
[ "src/utils.py" ]
[ "\"\"\"Utility methods.\"\"\"\nimport os\nfrom sklearn.model_selection import train_test_split\nimport _pickle as pickle\n\nimport config\nfrom constants import empty, eos, FN0\n\n\ndef join_ingredients(ingredients_listlist):\n \"\"\"Join multiple lists of ingredients with ' , '.\"\"\"\n return [' , '.join(i)...
[ [ "sklearn.model_selection.train_test_split" ] ]
JiekaiJia/pettingzoo_comunication
[ "1e85d5edb87ac867385649616e030284c0b6910f" ]
[ "learning.py" ]
[ "from gym import spaces\nimport numpy as np\nfrom scipy.special import softmax\nfrom pettingzoo.mpe import simple_spread_v2, simple_speaker_listener_v3, simple_tag_v2, simple_reference_v2, simple_world_comm_v2,simple_crypto_v2\nfrom pettingzoo.sisl import multiwalker_v7, pursuit_v3, waterworld_v3\nfrom pettingzoo.m...
[ [ "numpy.random.randint" ] ]
jchanxtarov/vbpr
[ "972d682b41ff715deb1fe56f98e96299a0afb670" ]
[ "src/models/base.py" ]
[ "# Copyright (c) latataro (jchanxtarov). All rights reserved.\n# Licensed under the MIT License.\n\nfrom abc import ABCMeta, abstractmethod\nfrom typing import Any, Generic, TypeVar\n\nimport torch as th\nimport torch.nn as nn\nfrom utils.loaders.base import BaseDataset\nfrom utils.types import UserItems\n\nDataset...
[ [ "torch.device" ] ]
gyan42/mozhi
[ "ee54692b1913141e5fdfda486b7dcd2a37e9f39f" ]
[ "mozhi/serve/torch/handler/ner_handler.py" ]
[ "import importlib\nimport inspect\nimport os\nimport logging\nimport torch\nimport pickle\nfrom abc import ABC\n\nimport ts\nfrom ts.torch_handler.base_handler import BaseHandler\nfrom ts.torch_handler.text_handler import TextHandler\n\nfrom mozhi.preprocessor.ipreprocessor import IPreprocessor\nfrom mozhi.bin.urn....
[ [ "torch.jit.load", "torch.load", "torch.tensor", "torch.cuda.is_available", "torch.argmax" ] ]
dasepli/fastNLP
[ "97883fcabfb88e3878cb9b73d878a26746615e8b" ]
[ "fastNLP/io/pipe/coreference.py" ]
[ "r\"\"\"undocumented\"\"\"\n\n__all__ = [\n \"CoReferencePipe\"\n]\n\nimport collections\n\nimport numpy as np\n\nfrom fastNLP.core.vocabulary import Vocabulary\nfrom .pipe import Pipe\nfrom ..data_bundle import DataBundle\nfrom ..loader.coreference import CoReferenceLoader\nfrom ...core.const import Const\n\n\n...
[ [ "numpy.array", "numpy.zeros" ] ]
hossein-haeri/MADDPG
[ "4d3abf907b890000374303769bf22db02a2b56d8" ]
[ "experiments/train.py" ]
[ "import argparse\nimport numpy as np\nimport tensorflow as tf\nimport time\nimport pickle\nimport matplotlib.pyplot as plt\nimport maddpg.common.tf_util as U\nfrom maddpg.trainer.maddpg import MADDPGAgentTrainer\nimport tensorflow.contrib.layers as layers\nimport csv\n\n# np.random.seed(101)\n\ndef parse_args():\n ...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.legend", "numpy.asarray", "matplotlib.pyplot.cla", "tensorflow.contrib.layers.fully_connected", "matplotlib.pyplot.plot", "numpy.std", "numpy.mean", "matplotlib.pyplot.grid", "tensorflow.variable_scope", "tensorflow.train.Save...
meijun/cs231n-assignment
[ "6180f3081530db9afca17d15ed6169057d063669" ]
[ "assignment2/cs231n/layers.py" ]
[ "import numpy as np\n\n\ndef affine_forward(x, w, b):\n \"\"\"\n Computes the forward pass for an affine (fully-connected) layer.\n\n The input x has shape (N, d_1, ..., d_k) and contains a minibatch of N\n examples, where each example x[i] has shape (d_1, ..., d_k). We will\n reshape each input into a vector ...
[ [ "numpy.maximum", "numpy.pad", "numpy.random.seed", "numpy.sqrt", "numpy.arange", "numpy.max", "numpy.zeros_like", "numpy.random.rand", "numpy.mean", "numpy.transpose", "numpy.zeros", "numpy.sum" ] ]
markvrma/PlagiarismChecker
[ "e656829de05186baf3fd413643f98033ce4cd4d7" ]
[ "backend/OCR/word.py" ]
[ "import cv2\nimport numpy as np\nfrom OCR.utils import resize, ratio\n\n\ndef bb_to_img(img, lines):\n result = []\n for line in lines:\n for word in line:\n result.append(img[word[1] : word[3], word[0] : word[2]])\n return result\n\n\ndef wordDetection(image, join=False):\n \"\"\"Dete...
[ [ "numpy.uint8", "numpy.ones", "numpy.copy", "numpy.array", "numpy.zeros", "numpy.hypot" ] ]
Lozovskii-Aleksandr/modin
[ "ed2a7a4adf973660eb15b9ea674cd5fb802f2424" ]
[ "modin/pandas/test/dataframe/test_indexing.py" ]
[ "# Licensed to Modin Development Team under one or more contributor license agreements.\n# See the NOTICE file distributed with this work for additional information regarding\n# copyright ownership. The Modin Development Team licenses this file to you under the\n# Apache License, Version 2.0 (the \"License\"); you...
[ [ "pandas.to_datetime", "pandas.Series", "pandas.RangeIndex", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.random.randint", "numpy.testing.assert_equal", "pandas.read_csv", "pandas.MultiIndex.from_frame", "numpy.arange", "pandas.Index", "pandas.Datetime...
JoannaWangBK/Attention-Based-Aspect-Extraction
[ "2c4b64f5dafef0a645b35c06b1d1ed53d186e63d" ]
[ "code/preprocess.py" ]
[ "from sklearn.feature_extraction.text import CountVectorizer\nfrom nltk.corpus import stopwords\nfrom nltk.stem.wordnet import WordNetLemmatizer\nimport codecs\nimport json\nfrom tqdm import tqdm\nimport argparse\n\n\ndef parseSentence(line):\n lmtzr = WordNetLemmatizer()\n stop = stopwords.words('english')\n...
[ [ "sklearn.feature_extraction.text.CountVectorizer" ] ]
lelilia/advent_of_code_2021
[ "cee570be9865e089216c3fdad11418b5eee8a07b" ]
[ "day20.py" ]
[ "\"\"\" Advent of Codee 2021 day 20 \"\"\"\n\nimport numpy as np\n\nINPUT_FILE = \"input20.txt\"\n\nMASK = np.array([[256, 128, 64], [32, 16, 8], [4, 2, 1]])\n\n\ndef get_input(input_file):\n with open(input_file) as f:\n algo, data = f.read().strip().split(\"\\n\\n\")\n\n algo = get_algo(algo)\n ma...
[ [ "numpy.pad", "numpy.array", "numpy.where", "numpy.sum", "numpy.zeros" ] ]
damirazo/pandas-profiling
[ "e436694befc25463073652b4abddc9b9537a555d" ]
[ "tests/unit/test_example.py" ]
[ "import sys\n\nimport pandas as pd\nimport numpy as np\n\nfrom pandas_profiling import ProfileReport\n\n\ndef test_example(get_data_file, test_output_dir):\n file_name = get_data_file(\n \"meteorites.csv\",\n \"https://data.nasa.gov/api/views/gh4g-9sfh/rows.csv?accessType=DOWNLOAD\",\n )\n\n ...
[ [ "pandas.read_csv", "pandas.to_datetime", "pandas.DataFrame", "numpy.random.choice" ] ]
squio/Photo_Mosaic
[ "3340324d33c9e94ca780ca1164c843c645a175d7" ]
[ "scripts/Mosaic_Creator.py" ]
[ "#!/usr/bin/env python\nimport os, random, argparse\nfrom PIL import Image\nimport numpy as np\n\nparser = argparse.ArgumentParser(description='Creates a photomosaic from input images')\nparser.add_argument('--target', dest='target', required=True, help=\"Image to create mosaic from\")\nparser.add_argument('--image...
[ [ "numpy.array" ] ]
Caro-app/cvat
[ "604be638419221a35c55fa9f0d565c6adaf0ad71" ]
[ "datumaro/tests/test_cvat_format.py" ]
[ "import numpy as np\nimport os\nimport os.path as osp\nfrom xml.etree import ElementTree as ET\n\nfrom unittest import TestCase\n\nfrom datumaro.components.extractor import (Extractor, DatasetItem,\n AnnotationType, PointsObject, PolygonObject, PolyLineObject, BboxObject,\n LabelCategories,\n)\nfrom datumaro....
[ [ "numpy.zeros", "numpy.ones" ] ]
GXYM/DRRG
[ "ce63248ce44aac59821ccc1b405a64953aa91b51" ]
[ "eval.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport subprocess\nfrom util.config import config as cfg\nfrom util.misc import mkdirs\n\n\ndef osmkdir(out_dir):\n import shutil\n if os.path.exists(out_dir):\n shutil.rmtree(out_dir)\n os.makedirs(out_dir)\n\n\ndef analysize_result(source_dir, fid_path, ...
[ [ "numpy.int0", "numpy.reshape" ] ]
befelix/GPyOpt
[ "333023becdffbc35591a8a4a2d0c770659c6cbb7" ]
[ "GPyOpt/util/general.py" ]
[ "# Copyright (c) 2016, the GPyOpt Authors\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\nimport numpy as np\nfrom scipy.special import erfc\nimport time\nfrom ..core.errors import InvalidConfigError\n\ndef compute_integrated_acquisition(acquisition,x):\n '''\n Used to compute the acquisition ...
[ [ "numpy.hstack", "numpy.sqrt", "numpy.clip", "numpy.asarray", "numpy.ptp", "numpy.ones", "numpy.atleast_2d", "numpy.max", "numpy.argmin", "numpy.exp", "numpy.random.uniform", "numpy.array", "numpy.zeros" ] ]
WiIIiamTang/SummaRuNNer
[ "ea0c38c960f85a405848dd43355776e4b99d4d12" ]
[ "utils/Dataset.py" ]
[ "import csv\r\nimport torch\r\nimport torch.utils.data as data\r\nfrom torch.autograd import Variable\r\nfrom .Vocab import Vocab\r\nimport numpy as np\r\n\r\nclass Dataset(data.Dataset):\r\n def __init__(self, examples):\r\n super(Dataset,self).__init__()\r\n # data: {'sents':xxxx,'labels':'xxxx',...
[ [ "numpy.random.shuffle" ] ]
srijankr/hawkeye
[ "674c729b1aa2825b84c7703063e1addbb9950c7a" ]
[ "src/code/birdwatch-metric-process-tweets.py" ]
[ "'''This script is used to collect the results for the Birdwatch system.'''\n\nimport pandas as pd\nfrom tqdm import tqdm\nimport random\nimport math\nimport pickle\n\nnotes = pd.read_csv(\"..//data//notes-00000-13-04-21.tsv\", sep='\\t')\nratings = pd.read_csv(\"..//data//ratings-00000-13-04-21.tsv\", sep='\\t')\n...
[ [ "pandas.read_csv" ] ]
IL2HorusTeam/il2-heightmap-creator
[ "a7964106de125456e10dd91bd28b1ba4d109ed42" ]
[ "il2fb/maps/heightmaps/rendering.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport argparse\nimport logging\n\nfrom array import array\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom matplotlib.colors import LinearSegmentedColormap\nfrom pylab import contour, contourf\n\n\nfrom il2fb.maps.heightmaps.constants import HEIGH...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.axis", "matplotlib.colors.LinearSegmentedColormap.from_list", "numpy.array", "matplotlib.pyplot.figure" ] ]
tacticsiege/TacticToolkit
[ "74f86180776c77507f096adb0aacf5d23840b341" ]
[ "ttk/sandbox/udemy/SimpleRNNClassifier.py" ]
[ "import theano\nimport theano.tensor as T\n\nimport numpy as np\n\nfrom ttk.sandbox.udemy import init_weight\n\nimport matplotlib.pyplot as plt\n\nfrom sklearn.utils import shuffle\n\nimport time\n\nclass SimpleRNNClassifier(object):\n def __init__(self, M):\n self.M = M\n \n def fit(self, X, Y,...
[ [ "matplotlib.pyplot.plot", "sklearn.utils.shuffle", "matplotlib.pyplot.show", "numpy.zeros" ] ]
hiroharu-kato/nmr
[ "b27780f7f574b70d338d2e947063504379ad1920" ]
[ "nmr/rasterization.py" ]
[ "import functools\nimport string\n\nimport cupy as cp\nimport torch\n\nfrom . import utils\n\n\ndef distribute(data, indices, foreground_maps, is_batch_data=False, is_batch_indices=False, default_value=-1):\n if not is_batch_data:\n data = data[indices]\n else:\n if not is_batch_indices:\n ...
[ [ "torch.ceil", "torch.floor", "torch.sum", "torch.stack", "torch.as_tensor", "torch.arange", "torch.broadcast_tensors", "torch.logical_not", "torch.cross" ] ]
emirhansilsupur/K132_data_science_bootcamp_homework
[ "7a39c76672cbe7dd6bf45f5e06b03305f94b9f53" ]
[ "week2/web_scraping_kdnuggets/KDnuggets_scraping.py" ]
[ "from requests_html import HTMLSession\nimport pandas as pd\n\n\n# Creating a session object that will allow us to send requests to the website.\nsession = HTMLSession()\n# Extracting the title, description and date of the news article.\ndef scraping(topic):\n \"\"\"\n The function is scraping the website and...
[ [ "pandas.DataFrame" ] ]
pspeter/pythovolve
[ "7d5b1f7c7ab44438979ea5bd93dc872eb2b44960" ]
[ "pythovolve/plotting.py" ]
[ "from multiprocessing import Queue\nfrom typing import Sequence\n\nfrom matplotlib.axes import Axes\nfrom matplotlib.figure import Figure\n\n\nclass ProgressPlot:\n def __init__(self, max_generations: int, data_queue: Queue, fig: Figure = None,\n axes: Sequence[Axes] = None):\n\n # these i...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.animation.FuncAnimation" ] ]
MOJTABAFA/toxoplasma-isbi2018
[ "cd5a86e49fd560d27963dc2898104280996ad396" ]
[ "ar/ar.py" ]
[ "import numpy as np\nimport numpy.linalg as linalg\n\ndef state_space(raw_data, q):\n \"\"\"\n Performs the state-space projection of the original data using principal\n component analysis (eigen-decomposition).\n\n Parameters\n ----------\n raw_data : array, shape (N, M)\n Row-vector data ...
[ [ "numpy.diag", "numpy.dot", "numpy.linalg.svd", "numpy.linalg.pinv", "numpy.size", "numpy.mean", "numpy.zeros" ] ]
trummelbummel/MSfingerprinter
[ "8a7c275d4368754327ff30e38c3fd9df01ccad75", "8a7c275d4368754327ff30e38c3fd9df01ccad75" ]
[ "MSfingerprinter/MSfingerprinter/detect_peaks.py", "MSfingerprinter/MSfingerprinter/maxsubpatternhitset.py" ]
[ "\"\"\"Detect peaks in data based on their amplitude and other features.\"\"\"\n\nfrom __future__ import division, print_function\nimport numpy as np\n\n__author__ = \"Marcos Duarte, https://github.com/demotu/BMC\"\n__version__ = \"1.0.4\"\n__license__ = \"MIT\"\n\n\ndef detect_peaks(x, mph=None, mpd=1, threshold=0...
[ [ "numpy.hstack", "numpy.isfinite", "numpy.isnan", "numpy.vstack", "matplotlib.pyplot.subplots", "numpy.sort", "numpy.atleast_1d", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.where", "matplotlib.pyplot.show" ], [ "numpy.ma.allequal", "numpy.take"...
yx14/ising
[ "675349021696857ed70c8231adadf33d4aa3f2c8" ]
[ "python_with_c/main-multiprocessing_c3.py" ]
[ "import sys\r\nimport os\r\nimport time\r\nimport csv\r\nimport click\r\nimport numpy as np\r\nimport logging\r\nimport matplotlib.pyplot as plt\r\nfrom ising_c import run_ising #import run_ising function from ising.py\r\nimport multiprocessing as mp\r\nfrom IsingLattice import IsingLattice\r\nimport scipy as scipy...
[ [ "scipy.stats.moment", "numpy.abs", "numpy.multiply", "numpy.arange", "numpy.std", "numpy.average" ] ]
yselivonchyk/DCIGN_tensorflow
[ "ff8d85f3a7b7ca1e5c3f50ff003a1c09a70067cd" ]
[ "autoencoder.py" ]
[ "\"\"\"MNIST Autoencoder. \"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\n# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport numpy as np\nimport tensorflow as tf\nimport utils as ut\nimport input as inp\nimport visualization as v...
[ [ "numpy.expand_dims", "tensorflow.concat", "numpy.asarray", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.variables_initializer", "numpy.nan_to_num", "tensorflow.app.flags.DEFINE_string", "numpy.random.randn", "tensorflow.app.flags.DEFINE_boolean", "tensorflow....
skurscheid/snakemake
[ "8d17cef39905cab4fb8a6ef068dacb015c449316" ]
[ "snakemake/utils.py" ]
[ "__author__ = \"Johannes Köster\"\n__contributors__ = [\"Per Unneberg\"]\n__copyright__ = \"Copyright 2015, Johannes Köster\"\n__email__ = \"koester@jimmy.harvard.edu\"\n__license__ = \"MIT\"\n\nimport os\nimport json\nimport re\nimport inspect\nimport textwrap\nimport platform\nfrom itertools import chain\nimport ...
[ [ "pandas.isnull", "pandas.DataFrame" ] ]
kifumi/aqua
[ "30bb8dc865d1f3e1a670369b1f72f04ff14196a1" ]
[ "qiskit_aqua/algorithms/many_sample/qsvm/svm_qkernel_binary.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright 2018 IBM.\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 appli...
[ [ "numpy.sign", "numpy.int", "numpy.array", "numpy.zeros", "numpy.vstack" ] ]
anokun7/AlexNet
[ "9fd64fc6d52e6e75231a8b069506da261dee071e" ]
[ "examples/imagenet/main.py" ]
[ "# Copyright 2020 Lorna Authors. All Rights Reserved.\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 b...
[ [ "torch.nn.CrossEntropyLoss", "torch.distributed.init_process_group", "torch.multiprocessing.spawn", "torch.utils.data.distributed.DistributedSampler", "torch.cuda.set_device", "torch.manual_seed", "torch.load", "torch.utils.data.DataLoader", "torch.nn.DataParallel", "torch....
JamesDarcy616/wsidicomizer
[ "c38c062a2b1c31ce30be00ef71c69e34826c8f96" ]
[ "wsidicomizer/openslide.py" ]
[ "# Copyright 2021 SECTRA AB\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 applicabl...
[ [ "numpy.all", "numpy.array", "numpy.asarray", "numpy.dtype" ] ]
disruptive-technologies/simple-forecast-an
[ "785c4b08857af1b501531bdd1997f3582327b238" ]
[ "forecast/sensor.py" ]
[ "# packages\nimport numpy as np\n\n# project\nimport forecast.helpers as hlp\nimport config.parameters as prm\n\n\nclass Sensor():\n \"\"\"\n One Sensor object for each sensor in project.\n It keeps track of the algorithm state between events.\n When new event_data json is received, iterate...
[ [ "numpy.sqrt", "numpy.arange", "numpy.mean", "numpy.array", "numpy.zeros" ] ]
KlemenBr/darkgreybox
[ "83848ead4488f15cbf456b967be503e8bd3ae25b" ]
[ "docs/tutorials/util/plot.py" ]
[ "import matplotlib.pyplot as plt\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom statsmodels.graphics.tsaplots import plot_pacf\n\n\ndef plot(y, model_result, suptitle=''):\n\n rmse = mean_squared_error(y, model_result.Z) ** 0.5\n r2 = r2_score(y, model_result.Z)\n\n fig, ax = plt.subplots(...
[ [ "sklearn.metrics.r2_score", "matplotlib.pyplot.subplots", "sklearn.metrics.mean_squared_error" ] ]
hebrewsnabla/pyscf_addon
[ "7988d2b3964d75282a817062c1679d792000b5c6" ]
[ "guess.py" ]
[ "from pyscf import gto, scf, dft\nimport numpy as np\ntry:\n from fch2py import fch2py\n import gaussian\nexcept:\n print('fch2py not found. Interface with fch is disabled. Install MOKIT if you need that.')\nimport stability\nimport time\nimport copy\n\ndef gen(xyz, bas, charge, spin, conv='tight', level_s...
[ [ "numpy.cos", "numpy.sin", "numpy.ones", "numpy.array", "numpy.zeros" ] ]
eric-erki/biopython
[ "2b4f7474766427c4ff4bf01e66b436f23456208e" ]
[ "Tests/test_pairwise_aligner.py" ]
[ "# This code is part of the Biopython distribution and governed by its\n# license. Please see the LICENSE file that should have been included\n# as part of this package.\n\n\n\"\"\"Tests for pairwise aligner module.\"\"\"\n\nimport array\nimport os\nimport unittest\n\nfrom Bio import Align, SeqIO\n\n\nclass TestAl...
[ [ "numpy.eye", "numpy.array", "numpy.zeros" ] ]
guanjue/imputed_cistrome_2022
[ "223efd1e76ce547b480c13f36d0df913ee1f0e5f" ]
[ "merge_train_test.qta.py" ]
[ "#!/usr/bin/env python3\nimport gc\nimport os\nimport pickle\n\nimport fire\nimport h5py\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom hyperopt.fmin import generate_trials_to_calculate\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import precision_recall_curve\nfrom numpy i...
[ [ "pandas.read_csv", "sklearn.preprocessing.QuantileTransformer", "numpy.concatenate", "numpy.intersect1d", "numpy.mean", "numpy.array" ] ]
MeisQuietude/Simple-Neural-Network
[ "66ca182837f38af9acf636a44809517e99fdc57b" ]
[ "app/data/__init__.py" ]
[ "from numpy import array\n\nfrom ._parse import raw_data_in, raw_data_out, raw_data_test\n\n# Append 1 as additional parameter to avoid extra multiplication by 0\nraw_data_in = [set_ + [1] for set_ in raw_data_in]\nraw_data_test = [set_ + [1] for set_ in raw_data_test]\n\n# Create ndarray of each data set for expor...
[ [ "numpy.array" ] ]
ElsevierSoftwareX/SOFTX-D-21-00117
[ "8ce9f9b5c1f1bb07733f248763759b05454690c8" ]
[ "Examples/12_tacticities/polycarboxybetaine/scripts/polymerization.py" ]
[ "from pysimm import lmps, system, forcefield\nfrom pysimm.apps.random_walk import random_walk, random_walk_tacticity, check_tacticity\n\nimport matplotlib.pyplot as mplp\nimport numpy \nimport os\n\n# ----------> Here starts the main body of polymerisation code <------------\ndef cap_with_methyls(input_sst, ff):\n ...
[ [ "numpy.array", "numpy.zeros", "numpy.linalg.norm" ] ]
AutuanLiu/PyCon
[ "ba0e2005d1e0301d77bb8111ff67b663dc234784" ]
[ "src/plot4.py" ]
[ "import numpy as np\n\nfrom bokeh.plotting import figure, output_file, show\n\n# prepare some data\nN = 4000\nx = np.random.random(size=N) * 100\ny = np.random.random(size=N) * 100\nradii = np.random.random(size=N) * 1.5\ncolors = [\n \"#%02x%02x%02x\" % (int(r), int(g), 150) for r, g in zip(50+2*x, 30+2*y)\n]\n...
[ [ "numpy.random.random" ] ]
mahmoudyusof/trax
[ "20ee40ff9c7c55ba8507a71967806a4438f587e7" ]
[ "trax/math/tf.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Trax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app...
[ [ "tensorflow.compat.v2.nest.map_structure", "tensorflow.compat.v2.TensorSpec", "numpy.dtype" ] ]
sadin911/projectTM
[ "e434022157b30dbbbd7e052404f1e24c0f27712b" ]
[ "src/train.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Tensorflow 2.0\n\"\"\"\nCreated on Wed Jan 8 11:08:18 2020\n\n@author: chonlatid\n\"\"\"\n\nimport os\nimport shutil\nimport tensorflow as tf\n\nimport datetime\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'\nif tf.test.gpu_device_name():\n print('GPU found')\nelse...
[ [ "numpy.expand_dims", "tensorflow.python.keras.layers.Flatten", "tensorflow.python.keras.layers.MaxPooling2D", "tensorflow.test.gpu_device_name", "tensorflow.python.keras.layers.Dense", "tensorflow.keras.callbacks.TensorBoard", "tensorflow.summary.scalar", "tensorflow.python.keras.l...
charliewhyman/santander-cycles
[ "63d410775ea4921dd143e38f5ec8ad3e0ef39343" ]
[ "get_bikepoints.py" ]
[ "import urllib.request\nimport json\nimport pandas as pd\n\n# Define bikepoint URL (from TfL Unified API)\nbikepoint_url = \"https://api.tfl.gov.uk/BikePoint\"\n\n# Request and open bikepoint url\nresponse = urllib.request.urlopen(bikepoint_url)\nbikepoints = json.loads(response.read())\n\n# Load json file into a d...
[ [ "pandas.read_json" ] ]
asherif844/diarization
[ "ee9c9a7d88def5110bed2a3696cc484d29def646" ]
[ "pyAudioAnalysis/audioSegmentation.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport sklearn.cluster\nimport scipy\nimport os\nfrom pyAudioAnalysis import ShortTermFeatures as sF\nfrom pyAudioAnalysis import MidTermFeatures as aF\nfrom pyAudioAnalysis import audioTrainTest as aT\nfrom pyAudioAnalysis import audioBasicIO\nfrom scipy....
[ [ "sklearn.cluster.KMeans", "matplotlib.pyplot.rc", "matplotlib.pyplot.plot", "numpy.max", "numpy.concatenate", "numpy.mean", "sklearn.discriminant_analysis.LinearDiscriminantAnalysis", "numpy.where", "numpy.unique", "scipy.signal.medfilt", "numpy.arange", "numpy.eye"...
brisvag/pygfx
[ "02e1f5ff92f50899ca990b712016e10d2914fcaf" ]
[ "examples/line_thin.py" ]
[ "\"\"\"\nSome thin line drawing.\n\"\"\"\n\nimport numpy as np\n\nimport pygfx as gfx\n\nfrom PySide6 import QtWidgets\nfrom wgpu.gui.qt import WgpuCanvas\n\napp = QtWidgets.QApplication([])\n\ncanvas = WgpuCanvas()\nrenderer = gfx.WgpuRenderer(canvas)\n\nscene = gfx.Scene()\n\npositions = [[200 + np.sin(i) * i * 6...
[ [ "numpy.cos", "numpy.sin", "numpy.ones" ] ]
Lnna/OpenNRE-PyTorch
[ "907026a8bece7a867558087131cd1e97d41eb3f2" ]
[ "config/Config.py" ]
[ "#coding:utf-8\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport numpy as np\nimport os\nimport time\nimport datetime\nimport json\nimport sys\nimport sklearn.metrics\nfrom tqdm import tqdm\nimport pickle as pc\n# sys.path.append('/home/nana/Documents/pyc...
[ [ "numpy.take", "torch.load", "torch.from_numpy", "numpy.random.shuffle", "torch.cuda.is_available", "numpy.array" ] ]
kazemiakk/wss_mri_calculator
[ "8e4808d66a739bf7d7ab75be628d7d74a32d1905" ]
[ "src/wss_utils_test.py" ]
[ "import logging\nimport wss_utils\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef test_vector_magnitude():\n v1 = np.asarray([[0.370491361,\t-0.167037462,\t-0.225748788],\n [0.585235848,\t-0.099175084,\t-0.116312987]])\n v1_mag = wss_utils.get_vector_magnitude(v1)\n \n tru...
[ [ "numpy.gradient", "numpy.asarray", "numpy.stack", "numpy.testing.assert_almost_equal", "matplotlib.pyplot.clf", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
sevmardi/ml-projects
[ "0eb218c77cda61285cfcf599599ff28a8a8deba7" ]
[ "predicting-airline-delay/tools.py" ]
[ "import numpy as np\nimport sys\n\nfrom pprint import pprint\n\n\ndef get_vpo2(values, goback=1):\n \"\"\"\n Supporting rolling windows with goback.\n\n Just make sure that goback parameter here\n will match the one in network configuration\n in input parameter.\n\n if goback=2 inputs=2 in train.p...
[ [ "numpy.array" ] ]
m3hdi-i/graph-total-spanning-trees
[ "2fa7b0ae300c05e6eb27604a03b8b047f4db7940" ]
[ "main.py" ]
[ "# -----------------------------\r\n# Author : Mehdi I.\r\n# -----------------------------\r\n\r\nimport numpy as np\r\n\r\ndef get_total_number_of_spanning_trees(matrix,nodes_count):\r\n # STEP 1: Replace all the diagonal elements with the degree of nodes.\r\n for i in range(nodes_count):\r\n sum_of_c...
[ [ "numpy.linalg.det", "numpy.delete" ] ]
clarkalvarez/Yuro-Tennis-Project
[ "32f106293200ba84ea6641f8fce70e217fd9a812" ]
[ "gitclark/distance_to_camera.py" ]
[ "# import the necessary packages\nfrom imutils import paths\nimport numpy as np\nimport imutils\nimport cv2\n \ndef find_marker(image):\n\t# convert the image to grayscale, blur it, and detect edges\n\tgray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\n\tgray = cv2.GaussianBlur(gray, (5, 5), 0)\n\tedged = cv2.Canny(gr...
[ [ "numpy.int0" ] ]
ttthomaschan/KylinModelLib
[ "9c812aadbf5d9155a6c77e37950e2a7919e45475", "9c812aadbf5d9155a6c77e37950e2a7919e45475" ]
[ "models/detection/FCOS/dataset/TableBank_dataset.py", "models/OCR/DBNet/networks/necks/det_fpn.py" ]
[ "from torchvision.datasets import CocoDetection\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport numpy as np\nfrom torchvision import transforms\nimport os\nimport cv2\nimport random\nimport json\nfrom sklearn.model_selection import train_test_split\n\n\nclass TablebankDataset(Dataset):\n ...
[ [ "torch.LongTensor", "torch.from_numpy", "sklearn.model_selection.train_test_split", "torch.stack", "numpy.array", "numpy.zeros", "torch.nn.functional.pad" ], [ "torch.nn.Conv2d", "torch.nn.functional.interpolate", "torch.cat" ] ]
hmc-cs-rkretsch/Secondary-Protein-Structure
[ "f1436976d453fbf6f5dbc4716bef3c5ad35b8455" ]
[ "Program/log_regression.py" ]
[ "'''\nAuthor: Rachael Kretsch\nBig Data Final Project\nSecondary Protein Structure\n\nfinally perform logistic regression on our data!\n'''\n\n\nimport numpy as np\nimport pickle\nimport matplotlib.pyplot as plt\nfrom sklearn import linear_model\n\ndef log_reg(filename, penalty='l2', reg=1.0):\n '''grabs the dat...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.gca", "sklearn.linear_model.LogisticRegression", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "numpy.random.shuffle", "matplotlib.pyplot.gcf", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplo...
nuka137/DeepLearningFramework
[ "613881e46b48c2206b9424a49106455cb2336d2e" ]
[ "dl/layers/normalization.py" ]
[ "import numpy as np\nfrom collections import OrderedDict\n\nfrom .layer_base import LayerBase\n\n\nclass BatchNormalizationLayer(LayerBase):\n def __init__(self, gamma=1.0, beta=0.0):\n super().__init__()\n\n self.cache = {}\n\n self.params = OrderedDict()\n self.params[\"gamma\"] = g...
[ [ "numpy.sum", "numpy.mean", "numpy.sqrt", "numpy.ones" ] ]
akashsunilgaikwad/Pytorch-Squeeznet
[ "e7b9f4d44d9e91c8d23ad623d956c2f2410deb1c" ]
[ "main.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jun 13 19:32:33 2018\n\n@author: akash\n\"\"\"\n\n\nfrom __future__ import print_function\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, tr...
[ [ "torch.max", "numpy.random.seed", "torch.nn.functional.nll_loss", "torch.manual_seed", "numpy.arange", "torch.utils.data.DataLoader", "torch.autograd.Variable", "torch.no_grad", "torch.cuda.is_available", "numpy.transpose", "torch.device", "torch.save" ] ]
afeldman/TorchMoon
[ "04c6ad75b0202542a2a885cb2a900085e43c5884" ]
[ "torchmoon/model/cratervnet.py" ]
[ "from typing import (Any, List)\n\nfrom torch.nn import (Module, Conv2d, Dropout2d, ConvTranspose2d)\nfrom torch import (cat, add)\nfrom torch.nn import BCEWithLogitsLoss\nfrom torch.optim import Adam\nimport pytorch_lightning as pl\n\nfrom torchmetrics import (MaxMetric, StructuralSimilarityIndexMeasure)\n\nfrom t...
[ [ "torch.nn.Dropout2d", "torch.add", "torch.nn.ConvTranspose2d", "torch.cat", "torch.nn.Conv2d", "torch.nn.BCEWithLogitsLoss" ] ]
tanwj14/examples
[ "08e59e6ccf45e8fb0e15951c752921d70e0b548c" ]
[ "word_language_model/model.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass FNNModel(nn.Module):\n\n def __init__(self, vocab_size, embedding_dim, context_size, nhid, tie_weights=False):\n super(FNNModel, self).__init__()\n self.context_size = context_size\n self.embedding_di...
[ [ "torch.nn.Dropout", "torch.transpose", "torch.nn.init.uniform_", "torch.ones", "torch.nn.functional.log_softmax", "torch.zeros", "torch.sin", "torch.cat", "torch.nn.RNN", "torch.arange", "torch.nn.Embedding", "torch.nn.Linear", "torch.nn.TransformerEncoderLayer"...
dviewai/Face-Liveness-Detection
[ "eab9a90e38b1fbea4dc921fb1a68cbe9fd29f7c4" ]
[ "training.py" ]
[ "\nimport matplotlib\nfrom imutils import paths\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport argparse\nimport random\nimport cv2\nimport os\nmatplotlib.use(\"Agg\")\nfrom architecture import MiniVGG\nimport tensorflow as tf\nfrom keras.preprocessing.image import ImageDataGenerator,img_to_array\nfrom...
[ [ "matplotlib.use", "sklearn.model_selection.train_test_split", "numpy.save", "numpy.load", "numpy.array" ] ]
nan-dre/FFTNR
[ "a66569fa11b0ee81345f5bffe8167cc5ae41a7fa" ]
[ "main.py" ]
[ "import scipy\nimport numpy as np\nimport librosa\nfrom librosa import display\nfrom matplotlib import pyplot as plt\nimport pprint\n\nfile_path = \"sounds/a_tired_ghost.wav\"\nsamples, sampling_rate = librosa.load(file_path, sr = None, mono = True,\n offset = 0.0, duration = ...
[ [ "numpy.abs", "scipy.fft", "numpy.linspace", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplots", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
mosco/graphknn
[ "0bbee471eae7ca909a8b4870c011d658a36f8088" ]
[ "test_graphknn.py" ]
[ "'''Use py.test to run the testing functions here, or just run them manually.'''\n\nimport numpy as np\nimport scipy.sparse\nimport heapdict\n\nimport graphknn\n\n\ndef graphknn_using_dijkstra(W, mask, k):\n n = graphknn._check_sparse_edge_weights_matrix(W)\n\n assert mask.dtype == np.bool\n assert mask.sh...
[ [ "numpy.random.random", "numpy.argpartition" ] ]
Phusun/kaggle-and-public-datasets
[ "4deeb8406deec7eddb3a3217f0dce55df09dfe0d" ]
[ "A Machine Learning Based Approach for Forecasting Housing Prices/Data_Code/databin/metro_names.py" ]
[ "import pandas as pd\n\nmetros = pd.read_excel('Metro names.xlsx', header=0)\nmetros_list = list(metros.iloc[:,0])\nstates_list = list(metros.iloc[:,1])\n\npersonal_income = pd.read_excel('Per Capita Personal Income 2015-2017.xlsx', header=None, skiprows=8, usecols=[0,1,2,3], names=['Metropolitan Areas','2015','201...
[ [ "pandas.read_excel" ] ]
filipeamorais/cs463cloudsecurityuitwitterbotdetection
[ "1edc4c8040a8666a4f4e0377561ae3477f74cf93" ]
[ "deployment/getcsv.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 16 12:32:01 2019\n\n@author: Dhiral\n\"\"\"\n\n#%%\nimport warnings\nimport requests\nimport numpy as np\nfrom requests_oauthlib import OAuth1\nimport tweepy as tw\nimport pandas as pd\nimport os\nfrom sklearn import tree\n\n#%% Your Account info\nconsumer_key ...
[ [ "sklearn.tree.DecisionTreeClassifier", "numpy.array", "pandas.DataFrame" ] ]
handal95/Timeband
[ "301ebec628dd6543670f57d1ed74ad40a857f99b" ]
[ "source/cleaner.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\n\nfrom tqdm import tqdm\nfrom torch.utils.data import DataLoader\n\nfrom .loss import TIMEBANDLoss\nfrom .model import TIMEBANDModel\nfrom .metric import TIMEBANDMetric\nfrom .dataset import TIMEBANDDataset\nfrom .dashboard import TIMEBANDDashboard\n\n\n# Anomaly...
[ [ "numpy.nanmedian", "pandas.DataFrame", "numpy.concatenate", "numpy.nanstd", "numpy.empty" ] ]
generall/hnswlib
[ "e54e865b246fb97a9a1b865308124e0b547a102c" ]
[ "python_bindings/tests/conditional_search.py" ]
[ "import unittest\nfrom typing import List\nimport tqdm\nimport numpy as np\nfrom statsmodels.stats.proportion import proportion_confint\nfrom collections import defaultdict\n\n\ndef calc_precision_at(found_pos: List[int], limit):\n hits = np.array(found_pos) < limit\n return np.mean(hits), proportion_confint(...
[ [ "numpy.putmask", "numpy.random.random", "numpy.arange", "numpy.mean", "numpy.random.rand", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
njuaplusplus/mirror
[ "133969741b87daafd367cb4fd3612076e7e4ff05", "133969741b87daafd367cb4fd3612076e7e4ff05" ]
[ "genforce/my_get_GD.py", "my_test_confidence.py" ]
[ "# python3.7\n\"\"\"This file is modifed from synthesize.py. The goal is to return a generator which output an image in range [0., 1.]\"\"\"\n\nimport os\nimport argparse\nimport subprocess\nfrom tqdm import tqdm\nimport numpy as np\n\nimport torch\nfrom torchvision.utils import save_image\n\nfrom .models import MO...
[ [ "torch.manual_seed", "torch.clamp", "numpy.random.seed", "torch.load" ], [ "torch.nn.functional.softmax", "torch.load", "torch.no_grad", "torch.topk", "torch.dist", "torch.argmax" ] ]
ndangtt/DACBench
[ "ddb94bfd30f885901562b3cad3320857da2c768d" ]
[ "tests/envs/test_onell.py" ]
[ "import unittest\nfrom unittest import mock\n\nimport numpy as np\nfrom dacbench import AbstractEnv\nfrom dacbench.envs import OneLLEnv\nfrom dacbench.envs.onell_env import OneMax, LeadingOne\nfrom dacbench.additional_configs.onell.configs import onell_lbd_theory, onell_lbd_onefifth, onell_lbd_p_c, onell_lbd1_lbd2_...
[ [ "numpy.arange" ] ]
akshay-jaggi/basic_neural_processing_modules
[ "96dd6b0a507b730aa1883109a87e7e22636dd50d" ]
[ "indexing.py" ]
[ "import numpy as np\nfrom numba import jit, njit, prange\nimport copy\nimport scipy.signal\nimport matplotlib.pyplot as plt\n\n\ndef widen_boolean(arr, n_before, n_after, axis=None):\n '''\n Widens boolean events by n_before and n_after. \n RH 2021 \n\n Args:\n arr (np.ndarray):\n ...
[ [ "numpy.expand_dims", "numpy.abs", "numpy.nonzero", "numpy.asarray", "numpy.isnan", "numpy.double", "numpy.cumsum", "matplotlib.pyplot.plot", "numpy.max", "numpy.ceil", "numpy.mean", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.where", "ma...
faizanahemad/Hybrid-Weighted-Embedding-Recommender
[ "457c4f13521aefa70476947c5849e85482abc3d4" ]
[ "hwer/ncf.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .gcn import *\n\n\nclass NCF(nn.Module):\n def __init__(self, feature_size, depth, gaussian_noise):\n super(NCF, self).__init__()\n noise = GaussianNoise(gaussian_noise)\n layers = [noise]\n for layer_idx in r...
[ [ "torch.nn.Sequential", "torch.cat", "torch.nn.Sigmoid", "torch.nn.Linear", "torch.nn.LeakyReLU" ] ]
TheCleric/surgeo
[ "018ff69a817ea115d6d42dc0d7d5b7b09db331e4" ]
[ "surgeo/app/surgeo_gui.py" ]
[ "\"\"\"Script containing a basic GUI program.\"\"\"\n\nimport pathlib\nimport sys\nimport traceback\n\nimport tkinter as tk\nimport tkinter.ttk as ttk\nimport tkinter.filedialog as filedialog\nimport tkinter.messagebox as messagebox\n\nimport pandas as pd\n\nimport surgeo\n\nfrom surgeo.utility.surgeo_exception imp...
[ [ "pandas.read_excel", "pandas.read_csv" ] ]
vitaldb/pyvital
[ "b7b045d92e8db3a9d7f45ea6593e57c73ae8ec11" ]
[ "pyvital/filters/pleth_ptt.py" ]
[ "from .. import arr\nimport numpy as np\n\ncfg = {\n 'name': 'Pleth - Pulse Transit Time',\n 'group': 'Medical algorithms',\n 'desc': 'Calculate pulse transit time.',\n 'reference': '',\n 'overlap': 5,\n 'interval': 30,\n 'inputs': [{'name': 'ecg', 'type': 'wav'}, {'name': 'pleth', 'type': 'wav...
[ [ "numpy.diff" ] ]
terrencetec/sigflow
[ "e46e3b1e732b6b95250bc21e49ce3a5d180593a2" ]
[ "sigflow/system/system.py" ]
[ "import numpy as np\n\nfrom sigflow.blocks import Block\nfrom sigflow.core.utils import to_array\n\nclass System(Block):\n \"\"\"A generic system class that connect blocks.\n\n Attributes\n ----------\n blocks : list of Block objects\n System's blocks which connect to each other.\n \"\"\"\n ...
[ [ "numpy.broadcast" ] ]
esteng/miso_uds
[ "66cc382e0dd11247c445e1ccbdb057a3a9b3dcc2" ]
[ "miso/losses/mixing.py" ]
[ "from overrides import overrides\nimport logging \n\nimport torch\nimport torch.nn.functional as F\nfrom allennlp.common.registrable import Registrable\n\nlogger = logging.getLogger(__name__) # pylint: disable=invalid-name\n\nclass LossMixer(torch.nn.Module, Registrable):\n def __init__(self):\n super()....
[ [ "torch.nn.functional.sigmoid", "torch.zeros" ] ]
IsakFalk/IKML
[ "9b9c7ee2eccd8021295c47190f55f0c0616ea826" ]
[ "scripts/gas_sensor/linear.py" ]
[ "import argparse\nimport pickle as pkl\nimport warnings\nfrom collections import OrderedDict\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom implicit_kernel_meta_learning.data_utils import GasSensorDataLoader\nfrom implicit_kernel_meta_l...
[ [ "numpy.log", "matplotlib.pyplot.tight_layout", "torch.eye", "matplotlib.pyplot.subplots", "torch.tensor", "torch.exp", "torch.nn.Linear", "torch.cuda.is_available", "torch.nn.MSELoss" ] ]
numberonewastefellow/projects
[ "b33f826930ef3e98165c267f34c7ea550853f2df" ]
[ "small_ds/counts_merger_pickle_files.py" ]
[ "import argparse\nfrom concurrent.futures.process import ProcessPoolExecutor\nimport shutil\n\nfrom pickle_reading_writing import PickleReadWrite\nimport os\nimport pandas as pd\n\n\ndef read_pickles_from_dir(input_folder):\n files = os.listdir(input_folder)\n pkl = PickleReadWrite()\n output = pkl.read_fr...
[ [ "pandas.DataFrame" ] ]
huylb314/mmpose
[ "c5cb46fbea58340cb89bc92a0884343a825d03a0" ]
[ "mmpose/models/detectors/top_down.py" ]
[ "import math\n\nimport cv2\nimport mmcv\nimport numpy as np\nimport torch.nn as nn\nfrom mmcv.image import imwrite\nfrom mmcv.visualization.image import imshow\n\nfrom mmpose.core.evaluation import pose_pck_accuracy\nfrom mmpose.core.evaluation.top_down_eval import keypoints_from_heatmaps\nfrom mmpose.core.post_pro...
[ [ "numpy.mean", "numpy.prod", "numpy.array", "numpy.zeros", "numpy.vstack" ] ]
Blank-Wang/dcase2017_task4_cvssp
[ "97ab1e29709bc87c9c1f9459929fb3853e7fa664" ]
[ "prepare_data.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport sys\nimport soundfile\nimport os\nimport librosa\nfrom scipy import signal\nimport pickle\nimport cPickle\nimport scipy\nimport time\nimport csv\nimport gzip\nimport h5py\nimport matplotlib.ticker as ticker\nimport matplotlib.pyplot as plt\nfrom skl...
[ [ "numpy.dot", "numpy.log", "scipy.signal.spectral.spectrogram", "numpy.concatenate", "numpy.mean", "numpy.hamming", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.zeros" ] ]
btrr/covid19-epicenters
[ "4134967f6dbbdeb5ad91a435dc72d905e9886fd6" ]
[ "deprecated/italy/it-nc.py" ]
[ "import datetime as dt\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport matplotlib.ticker as ticker\nfrom matplotlib.dates import MO, TU, WE, TH, FR, SA, SU\n\ndates = ['1/31/2020', '2/1/2020', '2/2/2020', '2/3/2020', '2/4/2020', '2/5/2020', '2/6/2020', '2/7/2020', '2/8/2020', '2/9/2020',...
[ [ "matplotlib.pyplot.gca", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.legend", "matplotlib.dates.WeekdayLocator", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
bycycle-tools/bycycle
[ "51425920236cbcab6eaff80cfb84b464dd2848fe" ]
[ "bycycle/group/utils.py" ]
[ "\"\"\"Functions to compute features across epoched data.\"\"\"\n\nfrom importlib import import_module\nimport numpy as np\n\n###################################################################################################\n#########################################################################################...
[ [ "numpy.shape" ] ]
lcchu/closed-form-matting
[ "622a6b74f333cb6cf9d5458a16302ab8b605c69a" ]
[ "closed_form_matting.py" ]
[ "#!/usr/bin/env python \n\"\"\"Implementation of Closed-Form Matting.\n\nThis module implements natural image matting method described in:\n Levin, Anat, Dani Lischinski, and Yair Weiss. \"A closed-form solution to natural image matting.\"\n IEEE Transactions on Pattern Analysis and Machine Intelligence 30.2 ...
[ [ "numpy.einsum", "numpy.arange", "numpy.eye", "numpy.tile", "numpy.ones", "numpy.lib.stride_tricks.as_strided", "numpy.concatenate", "numpy.mean", "numpy.repeat", "numpy.sum" ] ]
dirkroorda/fusus
[ "ee83067e1fb4fb4e4a7389554df4ab200c6f2092" ]
[ "fusus/lines.py" ]
[ "\"\"\"Line detection\n\nWe detect lines in page blocks based on ink distribution.\n\nOur proxy to ink distribution are histograms, but there is no easy correspondence\nbetween the peaks in the histograms and the lines on the page.\n\nWe will need some signal processing tools from\n[SciPy](https://docs.scipy.org/do...
[ [ "scipy.signal.find_peaks", "scipy.signal.medfilt", "numpy.rint", "numpy.transpose", "numpy.array", "numpy.flip", "numpy.sum" ] ]
perfectbullet/albumy
[ "6e0fa1bef31f470c19fd6bcf6751d0be6510d864" ]
[ "opencv_demos/svm_train/train_number_svm.py" ]
[ "#!/usr/bin/python\n# coding=utf-8\n\nimport cv2, os\nimport numpy as np\n\n\n# 获取数据集\n# 参数: datadirs:数据目录, labels:数据目录对应的标签, descriptor:特征描述器, size:图片归一化尺寸(通常是2的n次方, 比如(64,64)), kwargs:描述器计算特征的附加参数\n# 返回值, descs:特征数据, labels:标签数据\ndef getDataset(datadirs, labels, descriptor, size, **kwargs):\n # 获取训练数据\n # ...
[ [ "numpy.hstack", "numpy.vstack", "numpy.array", "numpy.count_nonzero" ] ]
Flunzmas/vp-suite
[ "479bd48185b9a93a6bc6bff2dfe226e9c65800d8" ]
[ "vp_suite/datasets/mmnist_on_the_fly.py" ]
[ "import numpy as np\nimport torch\nfrom torchvision.datasets import MNIST\n\nfrom vp_suite.base import VPDataset, VPData\nfrom vp_suite.defaults import SETTINGS\n\n\nclass MovingMNISTOnTheFly(VPDataset):\n r\"\"\"\n Dataset class for the dataset \"Moving MNIST\", as firstly encountered in\n \"Unsupervised ...
[ [ "numpy.abs", "numpy.clip", "torch.zeros", "numpy.repeat", "numpy.array", "numpy.zeros", "numpy.random.default_rng" ] ]
ahodges9/Systematic-LEDs
[ "b3b997aba6cf9d08f0935e3b858fac3904d0261b" ]
[ "python/main.py" ]
[ "from __future__ import print_function\nfrom __future__ import division\nfrom scipy.ndimage.filters import gaussian_filter1d\nfrom collections import deque\nimport time\nimport sys\nimport numpy as np\nimport lib.config as config\nimport lib.microphone as microphone\nimport lib.dsp as dsp\n#import lib.led as led\n...
[ [ "numpy.linspace", "numpy.asarray", "numpy.concatenate", "numpy.round", "numpy.roll", "numpy.pad", "numpy.clip", "numpy.fliplr", "numpy.copy", "numpy.interp", "numpy.zeros", "numpy.multiply", "numpy.atleast_2d", "numpy.random.rand", "scipy.ndimage.filters...
davidstone/tensorflow
[ "6044759779a564b3ecffe4cb60f28f20b8034add" ]
[ "tensorflow/python/compat/compat.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.util.tf_export.tf_export" ] ]
intflow/YOLOX_AUDIO
[ "c962bad922bdc7ae0ab6b6ed0ed4d13d18511fad" ]
[ "tools/demo_audio.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport argparse\nimport os\nimport time\nfrom loguru import logger\n\nimport cv2\nimport numpy as np\nfrom scipy.io import wavfile\nimport scipy.io\nimport librosa\nfrom PIL import Image\n\nimport torch\n\nfrom yolo...
[ [ "torch.ones", "numpy.abs", "torch.load", "numpy.asarray", "torch.from_numpy", "numpy.concatenate", "numpy.mean", "torch.no_grad", "numpy.flip", "scipy.io.wavfile.read", "numpy.zeros" ] ]
Abhishek2304/Cerebro-System-Ray
[ "1e2f2ae291cd449573f87bb83fb2bda12e606b3a" ]
[ "cerebro/tune/grid.py" ]
[ "# Copyright 2020 Supun Nakandala, Yuhao Zhang, and Arun Kumar. 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...
[ [ "numpy.argmax", "numpy.argmin" ] ]
grezesf/Research
[ "10b7de860f9caf9275ac23c4b4fce51150af5f7f" ]
[ "Reservoirs/Task1_Toy_Examples/lib_task1.py" ]
[ "#!/usr/bin/python\nimport random\nimport math\nimport numpy\n\n\n\ndef gen_toy_data(data_dim=500, set_size=100, freq_range=[20,40], phase_range=[20,40], amplitude_range=[10,50], delay=5, input_noise=0.0, target_noise=0.0):\n # generates toy wavy data\n # data_dim is the number of points per wave \n # set_...
[ [ "numpy.array" ] ]
IT-BillDeng/Garbage-Classification
[ "f68f4821e63dac67992ba5ea9cd7b77fae1cf4e5" ]
[ "data/util.py" ]
[ "import numpy as np\nfrom PIL import Image\nimport random\n# from skimage import io, color\n\n\ndef read_image(path, dtype=np.float32, color=True):\n \"\"\"Read an image from a file.\n\n This function reads an image from given file. The image is CHW format and\n the range of its value is :math:`[0, 255]`. ...
[ [ "numpy.maximum", "numpy.minimum", "numpy.logical_and", "numpy.asarray", "numpy.ones", "numpy.flatnonzero", "numpy.array" ] ]
szymonmaszke/UniFirstKaggle
[ "c1718e5ad9006251e8280c65fd8651b4d4efa31e" ]
[ "src/utilities/analysis.py" ]
[ "import pathlib\n\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import skew, skewtest\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.feature_selection import f_classif, mutual_info_classif\nfrom statsmodels.stats.outliers_influence import variance_inflation_factor\nfrom statsmodels....
[ [ "sklearn.ensemble.RandomForestClassifier", "sklearn.feature_selection.f_classif", "scipy.stats.skewtest", "pandas.DataFrame", "sklearn.feature_selection.mutual_info_classif", "scipy.stats.skew" ] ]
Junction4Nako/mvp_pytorch
[ "66db043d7beb1481c7a4c62908a4a46c7bfbc57a" ]
[ "oscar/run_retrieval.py" ]
[ "# Copyright (c) 2020 Microsoft Corporation. Licensed under the MIT license. \nfrom __future__ import absolute_import, division, print_function\nimport argparse\nimport os\nimport glob\n# os.environ[\"CUDA_VISIBLE_DEVICES\"] = '0'\nimport base64\nimport os.path as op\nimport random, json\nimport numpy as np\nimport...
[ [ "torch.nn.Softmax", "torch.max", "torch.load", "torch.cat", "torch.zeros", "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.is_available", "torch.device", "torch.save", "numpy.swapaxes", "numpy.reshape", "torch.from_numpy", "torch.tensor", "nu...
Danish-VSL/deep-person-reid
[ "2e3a4b6706b84c77203f9905683b917ab0871b93" ]
[ "torchreid/losses/sa_loss.py" ]
[ "import torch\nimport os\n\n\ndef sa_loss(features_dict):\n\n if os.environ.get('sa'):\n layer3, layer4_1, layer4_2 = features_dict['layers']\n\n layer3 = torch.norm(layer3, dim=1, p=2) ** 2 / 1024\n layer3 = layer3.view(layer3.size(0), -1)\n layer4_1 = torch.norm(layer4_1, dim=1, p=2...
[ [ "torch.norm" ] ]
tsyploff/tsyplov_stats
[ "29126d494bd846a9d40357c59c5c1751d006bc65" ]
[ "tsyplov_stats/validation.py" ]
[ "\r\nimport numpy as np\r\nfrom tsyplov_stats.wolfram_functions import *\r\n\r\n\r\ndef mean_square_error(x, y):\r\n\treturn np.mean((x - y)**2)\r\n\r\ndef root_mean_square_error(x, y):\r\n\treturn np.sqrt(np.mean((x - y)**2))\r\n\r\ndef mean_absolute_error(x, y):\r\n\treturn np.mean(np.abs(x - y))\r\n\r\ndef time_...
[ [ "numpy.array", "numpy.mean", "numpy.abs" ] ]
juliaprocess/ml_libs
[ "52cac5d64b55a12dfbdad1c768cdd8d79d5789f5" ]
[ "kernel_herding_subsampling/lib/sort_samples_into_classes.py" ]
[ "#!/usr/bin/env python\n#\tWritten by Chieh Wu\n\nimport numpy as np\nimport sklearn.metrics\nfrom sklearn.utils import shuffle\nfrom sklearn.preprocessing import OneHotEncoder\n\n\nnp.set_printoptions(precision=4)\nnp.set_printoptions(linewidth=300)\nnp.set_printoptions(suppress=True)\n\nclass sort_samples_into_cl...
[ [ "numpy.unique", "numpy.set_printoptions", "sklearn.preprocessing.OneHotEncoder", "numpy.array", "numpy.where" ] ]
arijit-s/CarND-Semantic-Segmentation
[ "dbcb2a3b9aae03dd74eb567e834a5c9eef3456d4" ]
[ "main.py" ]
[ "import os.path\nimport tensorflow as tf\nimport helper\nimport warnings\nfrom distutils.version import LooseVersion\nimport project_tests as tests\n\n\n# Check TensorFlow Version\nassert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf._...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.test.gpu_device_name", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.add", "tensorflow.Session", "tensorflow.contrib.layers.l2_regularizer", "tensorflow.train...
XanTiuM-Dev/kiwi-dev
[ "1daf51aaf289d37392a0e1da0d86c020f7f3676a" ]
[ "AI/Python/AI-Object-Recognition/test.py" ]
[ "from imutils.video import VideoStream\nfrom imutils.video import FPS\nimport numpy as np\nimport argparse\nimport imutils\nimport time\nimport cv2\n\nap = argparse.ArgumentParser()\nap.add_argument(\"-p\", \"--prototxt\", required=True,\n\thelp=\"path to Caffe 'deploy' prototxt file\")\nap.add_argument(\"-m\", \"-...
[ [ "numpy.arange", "numpy.array" ] ]
spectre-team/DiviK-standalone-client
[ "bda3de8e1781216d6e249dfb34a63f3fbea99cd7" ]
[ "src/Python/divik2spectre.py" ]
[ "\"\"\"Convert MATLAB data file into Spectre txt format\n\ndivik2spectre.py\nConverts MATLAB data file into Spectre txt format\n\nCopyright 2017 Spectre Team\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy ...
[ [ "numpy.arange", "scipy.io.loadmat", "numpy.transpose" ] ]
AleksUDKM/udkm1Dsim-1
[ "ea6806a005f14cc34cea813cbfb3e3beaf01719e" ]
[ "udkm1Dsim/structure.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# This file is part of the udkm1Dsimpy module.\n#\n# udkm1Dsimpy is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# ...
[ [ "numpy.hstack", "numpy.nonzero", "numpy.cumsum", "numpy.ones", "numpy.max", "numpy.append", "numpy.where" ] ]
AmanDaVinci/lifelong-learning
[ "cd131860120748775b5be5a1ccdddd65cd53ba1a" ]
[ "datastreams/datastream.py" ]
[ "import random\nimport pandas as pd\nfrom functools import partial\nfrom torch.utils.data import DataLoader\nfrom datasets import load_dataset, concatenate_datasets\nfrom datasets import Features, Value, ClassLabel\nfrom datastreams.datasets import dataset_configs\n\n\nclass DataStream:\n features = Features({\n...
[ [ "pandas.concat", "torch.utils.data.DataLoader" ] ]