repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
biamuniz/fiscalizando-o-ibama
[ "2bdc6f9986b862fe236e770e68952f1a12b331b9" ]
[ "get_multas.py" ]
[ "import base64\nimport json\nimport os\nimport pandas as pd\nimport ssl\nimport gspread\nimport requests\n\nssl._create_default_https_context = ssl._create_unverified_context\nspreadsheet_id = os.environ[\"SPREADSHEET_ID\"]\nconteudo_codificado = os.environ[\"GOOGLE_SHEETS_CREDENTIALS\"]\nconteudo = base64.b64decod...
[ [ "pandas.read_csv" ] ]
sectra-medical/pydicomutils
[ "aa2bdfa43c7aac11907e72a1cd172996901b9096" ]
[ "pydicomutils/IODs/WSMImage.py" ]
[ "import os\nimport numpy as np\nimport random\nfrom datetime import datetime\n\nfrom pydicom import Dataset, Sequence\nfrom pydicom.uid import generate_uid\n\nfrom .IOD import IOD, IODTypes\nfrom .modules.general_modules import CommonInstanceReferenceModule, FrameOfReferenceModule, AcquisitionContextModule\nfrom .m...
[ [ "numpy.ceil", "numpy.expand_dims", "numpy.pad", "numpy.random.randint" ] ]
DannyFGitHub/avalanche
[ "d94f9bf507eb92cbe3690e503ff9529b273530fc" ]
[ "avalanche/training/plugins/lwf.py" ]
[ "import copy\n\nimport torch\n\nfrom avalanche.models import avalanche_forward, DynamicModule, MultiTaskModule\nfrom avalanche.training.plugins.strategy_plugin import StrategyPlugin\n\n\nclass LwFPlugin(StrategyPlugin):\n \"\"\"\n A Learning without Forgetting plugin.\n LwF uses distillation to regularize ...
[ [ "torch.nn.functional.kl_div", "torch.softmax", "torch.no_grad", "torch.log_softmax" ] ]
Innixma/neural_password_cracking
[ "4ec6847fb7875da176a44d89a2b367c3afd764ab" ]
[ "passwordGuessCountGenerator.py" ]
[ "'''Example script to generate text from Nietzsche's writings.\n\nAt least 20 epochs are required before the generated text\nstarts sounding coherent.\n\nIt is recommended to run this script on GPU, as recurrent\nnetworks are quite computationally intensive.\n\nIf you try this script on new data, make sure your cor...
[ [ "numpy.random.choice", "numpy.delete", "numpy.append", "numpy.array", "numpy.zeros" ] ]
Holim0711/DeficientCIFAR-Lightning
[ "ffcb0008ef18974c7cbe83c74c79647daa5842e3" ]
[ "src/deficient_cifar/utils.py" ]
[ "import numpy as np\n\n__all__ = [\n 'random_select',\n 'random_noisify',\n 'transition_matrix',\n]\n\n\ndef random_select(y, N, random_state):\n \"\"\" Select a total of 'N' indices equally for each class \"\"\"\n y = np.array(y)\n C = np.unique(y)\n n = N // len(C)\n\n random_I = []\n f...
[ [ "numpy.eye", "numpy.array", "numpy.where", "numpy.unique" ] ]
balaji-kss/RSL
[ "e173bfc94effdfd78845214dbbbcc67da8c3d5fb" ]
[ "binarization/gates.py" ]
[ "# Copyright (c) 2021 Qualcomm Technologies, Inc.\n\n# All Rights Reserved.\n\nfrom enum import Enum\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom sigmoid_module import Sigmoid\n\nclass Binarization(nn.Module):\n def __init__(\n self,\n in_channels: int,\n ):\...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.pow", "torch.nn.init.xavier_uniform_" ] ]
comzyh/SRGAN_impl
[ "80007c51ea7f3bcee10bae4ee633145923740cff" ]
[ "train.py" ]
[ "import os.path\nimport argparse\nimport tensorflow as tf\nimport numpy as np\nfrom tensorflow.python.ops import math_ops\n\nfrom model import SRResNet\nfrom model import SRGAN_discriminator\nfrom model import srresnet_preprocess\nfrom model import srresnet_postprocess\n\n\ndef parse_record(record):\n keys_to_fe...
[ [ "tensorflow.python.ops.math_ops.log", "tensorflow.FixedLenFeature", "tensorflow.train.AdamOptimizer", "tensorflow.group", "tensorflow.summary.scalar", "tensorflow.data.Iterator.from_string_handle", "tensorflow.get_collection", "tensorflow.data.TFRecordDataset", "tensorflow.trai...
m-antonio22069/Aceleradev_ds
[ "cedd643eada8a4d538e1911afe1632b15bfff9ed" ]
[ "Semana 3/Streamlit/semana3.py" ]
[ "import streamlit as st\nimport pandas as pd\nimport altair as alt\n\n\ndef criar_histograma(coluna, df):\n chart = alt.Chart(df, width=600).mark_bar().encode(\n alt.X(coluna, bin=True),\n y='count()', tooltip=[coluna, 'count()']\n ).interactive()\n return chart\n\n\ndef criar_barras(coluna_n...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
miykael/scikit-learn-mooc
[ "06840c79db1c891e36715175c9053535bf886094" ]
[ "python_scripts/03_categorical_pipeline_ex_02.py" ]
[ "# -*- coding: utf-8 -*-\n# ---\n# jupyter:\n# kernelspec:\n# display_name: Python 3\n# name: python3\n# ---\n\n# %% [markdown]\n# # 📝 Exercise M1.05\n#\n# The goal of this exercise is to evaluate the impact of feature preprocessing\n# on a pipeline that uses a decision-tree-based classifier instead of a...
[ [ "pandas.read_csv", "sklearn.ensemble.HistGradientBoostingClassifier", "sklearn.compose.make_column_selector", "sklearn.preprocessing.OrdinalEncoder", "sklearn.model_selection.cross_validate", "sklearn.compose.ColumnTransformer" ] ]
sdpython/mlprodict
[ "165c61dcfbfda5914ec151cc480f7d22d57d90b1" ]
[ "_unittests/ut_onnxrt/test_onnxrt_python_runtime_ml_text.py" ]
[ "# coding: utf-8\n\"\"\"\n@brief test log(time=2s)\n\"\"\"\nimport unittest\nfrom logging import getLogger\nimport numpy\nimport pandas\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.preprocessing import OneHotEncoder\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.compose impo...
[ [ "sklearn.ensemble.RandomForestClassifier", "sklearn.preprocessing.OneHotEncoder", "pandas.DataFrame", "sklearn.multioutput.MultiOutputClassifier", "sklearn.feature_extraction.text.CountVectorizer", "numpy.array", "sklearn.compose.ColumnTransformer" ] ]
FengMingquan-sjtu/NLIL
[ "77fc7bcb48464fee08ccbdea384e5ffff4082440" ]
[ "model/Modules.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\n\n\nclass ScaledDotProductAttention(nn.Module):\n ''' Scaled Dot-Product Attention '''\n\n def __init__(self, temperature, attn_dropout=0.1):\n super().__init__()\n self.temperature = temperature\n self.dropout = nn.Dropout(attn_dr...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.bmm" ] ]
TiNezlobinsky/Finitewave
[ "b29621f56cada26256be120b2fbbe84970758683", "b29621f56cada26256be120b2fbbe84970758683" ]
[ "finitewave/cpuwave3D/tracker/action_potential_3d_tracker.py", "examples/trackers/3D/act_time_3d_tracker.py" ]
[ "import os\nimport numpy as np\n\nfrom finitewave.core.tracker.tracker import Tracker\n\n\nclass ActionPotential3DTracker(Tracker):\n def __init__(self):\n Tracker.__init__(self)\n self.act_pot = np.array([])\n self.cell_ind = [1, 1, 1]\n self.file_name = \"act_pot\"\n\n def initi...
[ [ "numpy.array" ], [ "numpy.arange", "matplotlib.pyplot.subplots", "numpy.ones", "numpy.transpose", "matplotlib.pyplot.show", "numpy.zeros" ] ]
bob800530/Find_lane_line
[ "cbfd4b60e3434f06d80ae4b1e040f505d379eafe" ]
[ "hw1.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Dec 10 22:57:55 2018\n\n@author: Bob\n\"\"\"\n\n# Do relevant imports\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nimport numpy as np\nimport cv2\n\n# Read in an image\nimage = mpimg.imread('test_images/whiteCarLaneSwitch.jpg')\n\ngray = cv2.cv...
[ [ "matplotlib.pyplot.imshow", "numpy.dstack", "matplotlib.image.imread", "numpy.copy", "numpy.zeros_like", "numpy.array" ] ]
yhavinga/transformers
[ "9932ee4b4bca9045d941af6687ef69eedcf68483" ]
[ "tests/gpt_neo/test_modeling_gpt_neo.py" ]
[ "# coding=utf-8\n# Copyright 2021 The HuggingFace Inc. team. 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....
[ [ "torch.all", "torch.ones", "torch.cat", "torch.manual_seed", "torch.tensor", "torch.allclose" ] ]
zlatko-minev/qiskit-aer
[ "339397ae2b392b31072113cfd940eee4624b016c" ]
[ "test/terra/utils/common.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright 2018, IBM.\n#\n# This source code is licensed under the Apache License, Version 2.0 found in\n# the LICENSE.txt file in the root directory of this source tree.\n\n\"\"\"\nShared functionality and helpers for the unit tests.\n\"\"\"\n\nfrom enum import Enum\n\nimport inspect\n...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.random.rand", "numpy.transpose" ] ]
ljbelenky/stats-shortcourse
[ "875e6a20183833ca186af51a0649c308ce531fbc" ]
[ "docs/linear-regression.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nlinear regression example\n\n\"\"\"\n\nfrom __future__ import division\nimport os,sys\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.stats as stats\n\nfrom mylib import *\n\nimport logging\n_logger = logging.getLogger(\"theano.gof.compilelock\")\n_logger.setLevel(...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
MBadriNarayanan/FakeNewsDetection
[ "5ccf2be7263b1fe6062c7a29ff288dbb4c8fb5fd", "5ccf2be7263b1fe6062c7a29ff288dbb4c8fb5fd" ]
[ "Scripts/model.py", "Scripts/bert_train.py" ]
[ "import math\nimport torch\nfrom torch.nn import (\n BatchNorm1d,\n Conv1d,\n Dropout,\n Embedding,\n Flatten,\n GELU,\n Linear,\n Module,\n Sequential,\n TransformerEncoder,\n TransformerEncoderLayer,\n)\n\n\nclass PositionalEncoding(Module):\n def __init__(self, d_model, dropou...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.nn.GELU", "torch.sin", "torch.cat", "torch.zeros", "torch.nn.Flatten", "torch.arange", "torch.nn.Embedding", "torch.nn.Linear", "torch.nn.TransformerEncoderLayer", "torch.FloatTensor", "torch.nn.Conv1d", "to...
Gorlph/pythainlp
[ "6135ba5f490e00640de902a0d5c65a4537739d98" ]
[ "pythainlp/transliterate/thai2rom.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nRomanization of Thai words based on machine-learnt engine (\"thai2rom\")\n\"\"\"\n\nimport random\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pythainlp.corpus import get_corpus_path\n\ndevice = torch.device(\"cuda:0\" if torch.c...
[ [ "torch.nn.Dropout", "torch.nn.functional.softmax", "torch.nn.LSTM", "torch.load", "torch.cat", "torch.zeros", "torch.sum", "torch.from_numpy", "torch.nn.Embedding", "torch.tensor", "numpy.sort", "torch.nn.Linear", "torch.nn.utils.rnn.pad_packed_sequence", "t...
crisz/hate-speech-hiexp
[ "891c6321e8c24f9cacc399b77f700844e195bf68" ]
[ "loader/gab.py" ]
[ "from .common import *\nfrom torch.utils.data import DataLoader, Dataset\nimport torch\nimport random\n\nclass GabProcessor(DataProcessor):\n \"\"\"\n Data processor using DataProcessor class provided by BERT\n \"\"\"\n def __init__(self, configs, tokenizer=None):\n super().__init__()\n se...
[ [ "torch.LongTensor", "torch.utils.data.DataLoader" ] ]
practicallypredictable/pracnbstats
[ "55cd6e285394686a62f3d1535a5b3468cd5410ea" ]
[ "pracnbastats/utils.py" ]
[ "import collections\nimport numpy as np\n\n\ndef order_columns(df, *, first_cols, last_cols=None):\n \"\"\"Reorder DataFrame columns by first/middle/last grouping.\"\"\"\n if last_cols:\n middle_cols = [\n col for col in df\n if col not in set().union(first_cols, last_cols)\n ...
[ [ "numpy.split" ] ]
qijimrc/tensor2tensor
[ "f41d448178261920c27eaf243ea3636ddd945113" ]
[ "tensor2tensor/rl/rl_trainer_lib.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir...
[ [ "tensorflow.global_variables", "tensorflow.global_variables_initializer", "tensorflow.logging.info", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.variable_scope", "tensorflow.get_default_graph", "tensorflow.get_variable_scope", "tensorflow.summary.merge" ] ]
bigprince97/lit
[ "a40ef90b514383fb78b3f8742aea31135445693e" ]
[ "lit_nlp/examples/datasets/classification.py" ]
[ "# Lint as: python3\n\"\"\"Text classification datasets, including single- and two-sentence tasks.\"\"\"\nfrom typing import List\n\nfrom absl import logging\nfrom lit_nlp.api import dataset as lit_dataset\nfrom lit_nlp.api import types as lit_types\nimport pandas as pd\nimport tensorflow_datasets as tfds\n\n\n\n\n...
[ [ "pandas.read_csv" ] ]
johanattia/textflow
[ "d1dbe1b22ff44d0391cc10fff33270c472c72c4e" ]
[ "tests/test_attention.py" ]
[ "\"\"\"Test for Attention layer.\"\"\"\n\nimport tensorflow as tf\nfrom textflow.classification.attention import AttentionLayer\nfrom textflow.classification.han import HierarchicalAttentionNetwork\n\n\ndef test_attention():\n batch1 = tf.random.normal((16, 10, 50, 128))\n batch2 = tf.random.normal((16, 10, 1...
[ [ "tensorflow.random.normal", "tensorflow.zeros" ] ]
PMetcalf/electric-motor-thermal-modelling
[ "fedc56a6101836ebd9157668c5a33dde9e20f0cc" ]
[ "src/models/sklearn_helpers.py" ]
[ "'''\nsklearn_helpers\n\nHelper routines for working with sklearn models\n\n'''\n\n# Module Importations\nfrom sklearn.externals import joblib\nimport time\n\nproject_code = 'YC'\n\ndef name_model(model_type):\n \"\"\"\n Returns a time-stamped model name.\n ======================================\n\n Inp...
[ [ "sklearn.externals.joblib.dump" ] ]
RhnSharma/sunpy
[ "03700193d287156ca1922eb27c4c2ad50040e53f", "03700193d287156ca1922eb27c4c2ad50040e53f", "03700193d287156ca1922eb27c4c2ad50040e53f" ]
[ "sunpy/net/helio/chaincode.py", "sunpy/physics/tests/test_solar_rotation.py", "sunpy/coordinates/tests/test_sun.py" ]
[ "\"\"\"\nThis module implements a function to understand chaincodes from HELIO.\n\"\"\"\nimport numpy as np\n\n__all__ = [\"Chaincode\"]\n\n\nclass Chaincode(np.ndarray):\n \"\"\"\n A tool to infer some information from chaincodes produced by HELIO Feature\n Catalogue or Heliophysics Events Knowledgebase.\...
[ [ "numpy.asarray", "numpy.zeros", "numpy.ma.masked_array" ], [ "numpy.asarray" ], [ "numpy.array" ] ]
Goodpaster/QSoME
[ "8b24d58dfab5ac0d90fd84b8519b25864eee6f74" ]
[ "qsome/inp_reader.py" ]
[ "#!/usr/bin/env python\n\"\"\"A module to define the input reader object\nDaniel S. Graham\nDhabih V. Chulhai\n\"\"\"\n\nfrom __future__ import print_function, division\n\nfrom copy import copy\nimport input_reader\nimport numpy as np\nfrom pyscf import gto, pbc\nfrom qsome import helpers\n\nclass InputError(Except...
[ [ "numpy.argwhere" ] ]
gis-ops/spopt
[ "3f895f184bb63c1e31459606a4477eb2af9105af" ]
[ "spopt/region/maxp.py" ]
[ "\"\"\"\r\nMax-p regions algorithm\r\n\r\nSource: Wei, Ran, Sergio J. Rey, and Elijah Knaap (2020) \"Efficient\r\nregionalization for spatially explicit neighborhood delineation.\" International\r\nJournal of Geographical Information Science. Accepted 2020-04-12.\r\n\"\"\"\r\n\r\n__author__ = [\"Ran Wei\", \"Serge ...
[ [ "numpy.random.random", "numpy.arange", "numpy.random.shuffle", "numpy.atleast_2d", "numpy.delete", "scipy.spatial.distance.pdist", "numpy.exp", "numpy.array", "numpy.where", "scipy.sparse.csgraph.connected_components", "numpy.random.randint" ] ]
1271756664/study
[ "8013dd6c597618949c5fcbf86e38502525a8136d" ]
[ "setup.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nsuggested by bugsuse(https://github.com/bugsuse)\n\"\"\"\n\nfrom setuptools import find_packages, setup\nimport sys, os\nfrom Cython.Build import cythonize\nimport numpy\n\nparent_dir = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(parent_dir)\n\nDISTNAME = \"pycwr\"\...
[ [ "numpy.get_include" ] ]
copasi/basico
[ "d4f5799dfe73c20decb8179c2492ccc9da26e354" ]
[ "basico/task_parameterestimation.py" ]
[ "\"\"\"Submodule with utility methods for carrying out and plotting of parameter estimations.\n\nThe main function provided by this submodule is :func:`run_parameter_estimation`. Without any parameters, the\npreviously set up parameter estimation as stored in the file will be carried out. And the parameters found w...
[ [ "numpy.isnan", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotlib.pyplot.cycler" ] ]
vvvijaya/pycaret
[ "724cb30600e491ccf1e79fdaa96efde5961a9919" ]
[ "pycaret/nlp.py" ]
[ "# Module: Natural Language Processing\n# Author: Moez Ali <moez.ali@queensu.ca>\n# License: MIT\n# Release: PyCaret 2.2.0\n# Last modified : 25/10/2020\n\nfrom typing import Optional, Dict, Any, Dict\nfrom pycaret.loggers import DashboardLogger\nfrom pycaret.loggers.base_logger import BaseLogger\nfrom pycaret.logg...
[ [ "sklearn.neural_network.MLPClassifier", "sklearn.ensemble.RandomForestRegressor", "matplotlib.pyplot.imshow", "numpy.sqrt", "sklearn.cluster.KMeans", "sklearn.linear_model.ElasticNet", "pandas.DataFrame", "numpy.round", "sklearn.manifold.TSNE", "sklearn.tree.DecisionTreeCla...
teucer/formulae
[ "a94684a53f58be05ae468226305ef056f177af8e" ]
[ "formulae/matrices.py" ]
[ "# pylint: disable=relative-beyond-top-level\nimport logging\nimport textwrap\n\nimport numpy as np\nimport pandas as pd\n\nfrom .environment import Environment\nfrom .model_description import model_description\nfrom .utils import flatten_list\n\n_log = logging.getLogger(\"formulae\")\n\n\nclass DesignMatrices:\n ...
[ [ "numpy.zeros", "pandas.DataFrame", "numpy.unique" ] ]
kn1ghtf1re/ShredFPSOpponents
[ "bedad185a938e671e1aea7e13f9a19e827690d2a" ]
[ "ingame_detector.py" ]
[ "import cv2\nimport time\nimport numpy as np\nfrom mss import mss\nfrom PIL import Image\nfrom core import utils\nfrom utils import normalize\nimport requests\nimport ast\nfrom videocaptureasync import VideoCaptureAsync\nimport random\nfrom args import imgsize, mon\n\nclass Detection:\n ''' Class to hold all det...
[ [ "numpy.array" ] ]
utkucanaytac/Kats
[ "9781615750a2f3b49f16cccf335b5c29fdfd181a", "9781615750a2f3b49f16cccf335b5c29fdfd181a" ]
[ "kats/models/sarima.py", "kats/tests/utils/test_feature_engineering.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and 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 logging\nfrom typing import Any, Callable, Dict, List, Optional, Tuple\n\nimport numpy as np\nimport pandas as pd\nfrom kat...
[ [ "pandas.to_datetime", "pandas.DataFrame", "numpy.concatenate", "pandas.date_range", "numpy.array" ], [ "numpy.sqrt", "pandas.Series", "numpy.isnan", "pandas.DataFrame", "pandas.date_range", "pandas.Timestamp" ] ]
hmatalonga/restaurant-recommender-system
[ "cf7b72782b512665e8a129a4f3e42ca1f67f8877" ]
[ "backend/prepare.py" ]
[ "#!/usr/bin/env python3\n\nimport sys\nimport pandas as pd\nimport numpy as np\nfrom re import sub\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.metrics.pairwise import cosine_similarity\n\n\ndef gen_sim_matrix(df, col_name='keyword', lang='english'):\n # Import CountVectorizer and c...
[ [ "sklearn.feature_extraction.text.CountVectorizer", "pandas.read_csv", "sklearn.metrics.pairwise.cosine_similarity" ] ]
mlech26l/bayesian_nn_safety
[ "335cb3d32092a854499d98a2832fed14667a0f95" ]
[ "run_car_mip.py" ]
[ "import argparse\nimport json\nimport os\nimport time\n\nfrom car_env import CarEnv\nfrom mixed_integer_encoding import (\n ReluNetwork,\n MixedIntegerEncoding,\n clip_at_pm1,\n clip_at_pm_k,\n)\nimport tensorflow as tf\nimport numpy as np\nimport mip\nimport datetime\n\nimport matplotlib.pyplot as plt\...
[ [ "tensorflow.keras.metrics.BinaryAccuracy", "numpy.expand_dims", "numpy.linspace", "tensorflow.zeros", "numpy.concatenate", "tensorflow.random.set_seed", "numpy.random.default_rng", "tensorflow.keras.losses.BinaryCrossentropy", "numpy.stack", "tensorflow.data.Dataset.zip", ...
davindicode/universal_count_model
[ "f91294b66f16a5701dc8e0b5a825ac55bff83da2" ]
[ "neuroprob/GP/means.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.parameter import Parameter\n\n\n\n# GP means\nclass decaying_exponential(nn.Module):\n def __init__(self, dims, a, b, learnable=[True, True]):\n \"\"\"\n :param int neurons: the number of output dimensios\n :param float a: initial value for...
[ [ "torch.exp", "torch.ones" ] ]
maxe23/web-scraping-challenge
[ "42f0764f3fb181cb81ac3f48d434742d49cd4896" ]
[ "scrape_mars.py" ]
[ "from bs4 import BeautifulSoup \nfrom splinter import Browser\nimport pandas as pd\nimport requests\nimport pymongo\nfrom flask import Flask, render_template\nfrom webdriver_manager.chrome import ChromeDriverManager\n\ndef init_browser():\n executable_path = {\"executable_path\": ChromeDriverManager().install()}...
[ [ "pandas.read_html" ] ]
cifkao/favor
[ "f8aa50ab17e24217812832506172ccb4189be68a" ]
[ "favor/favor.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom warnings import warn\nimport itertools\nimport math\nimport numpy as np\n\n\nclass FAVOR(nn.Module):\n \"\"\"Fast Attention Via positive Orthogonal Random features\"\"\"\n def __init__(\n self,\n key_dim,\n orthono...
[ [ "torch.matmul" ] ]
kakasu/FATE
[ "23ad848bcc7ae7f304a376d3f46f4af26872c8a2" ]
[ "examples/scripts/download_mnist_data.py" ]
[ "import os\nimport struct\nimport urllib.request\nimport gzip\n\nimport numpy as np\n\ndata = dict(\n train_images=\"http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz\",\n train_labels=\"http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz\",\n test_images=\"http://yann.lecun.com/exdb/mnis...
[ [ "numpy.savetxt", "numpy.hstack", "numpy.dtype" ] ]
Honestree2/GNN
[ "8ebd42495deaf0c8a68309b3e1d27b1f63a3d24b" ]
[ "gnn/GNN.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport datetime as time\n\n# class for the core of the architecture\nclass GNN:\n def __init__(self, net, input_dim, output_dim, state_dim, max_it=50, optimizer=tf.train.AdamOptimizer, learning_rate=0.01, threshold=0.01, graph_based=False,\n param=st...
[ [ "tensorflow.sparse_placeholder", "tensorflow.concat", "tensorflow.cast", "tensorflow.sparse_tensor_dense_matmul", "tensorflow.SparseTensorValue", "tensorflow.summary.scalar", "tensorflow.while_loop", "tensorflow.greater", "tensorflow.subtract", "tensorflow.Session", "nu...
vishalbelsare/kabuki
[ "eb23092027986ca2cb759d3dc7f92ead3b05c2f5" ]
[ "kabuki/analyze.py" ]
[ "\nimport sys, os\nimport warnings\nfrom types import FunctionType\n\nimport numpy as np\nfrom matplotlib.pylab import figure\nimport matplotlib.pyplot as plt\n\nimport pandas as pd\nimport pymc as pm\nimport pymc.progressbar as pbar\nfrom . import utils\n\nfrom .utils import interpolate_trace\n\nfrom collections i...
[ [ "matplotlib.pyplot.legend", "numpy.sqrt", "numpy.linspace", "matplotlib.pyplot.plot", "numpy.max", "numpy.mean", "numpy.zeros_like", "matplotlib.pyplot.gcf", "numpy.ceil", "numpy.std", "matplotlib.pylab.figure", "numpy.zeros", "matplotlib.pyplot.figure", "pa...
tckwgd/DANN-MNIST-tf2
[ "7f89fa14a735910d853fe80721f2fde86ff3ea8d" ]
[ "DANN-MNIST-tf2/model/dann.py" ]
[ "# -*- coding: utf-8 -*-\r\n# @Time : 2020/7/10 12:36\r\n# @Author : DaiPuwei\r\n# @Email : 771830171@qq.com\r\n# @File : dann.py\r\n# @Software: PyCharm\r\n\r\nimport tensorflow as tf\r\n\r\ndef build_feature_extractor():\r\n \"\"\"\r\n 这是特征提取子网络的构建函数\r\n :param image_input: 图像输入张量\r\n :param ...
[ [ "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.layers.Flatten" ] ]
gatsby-sahani/svGPFA
[ "9bf026c216cae83ba44ae6b4399c92c37d39a56c" ]
[ "ci/test_svEmbedding.py" ]
[ "\nimport sys\nimport pdb\nimport os\nimport math\nfrom scipy.io import loadmat\nimport numpy as np\nimport torch\nsys.path.append(\"../src\")\nfrom stats.kernels import PeriodicKernel, ExponentialQuadraticKernel\nfrom stats.svGPFA.kernelMatricesStore import IndPointsLocsKMS, \\\n IndPointsLocsAndAllTimesKMS...
[ [ "torch.sum", "numpy.char.equal", "scipy.io.loadmat", "torch.from_numpy" ] ]
hekaisheng/ray
[ "05fe6dc278126352e830a21b408027bd7a8cfd78" ]
[ "python/ray/tests/test_advanced_3.py" ]
[ "# coding: utf-8\nimport glob\nimport logging\nimport os\nimport sys\nimport socket\nimport time\n\nimport numpy as np\nimport pickle\nimport pytest\n\nimport ray\nimport ray.ray_constants as ray_constants\nimport ray.cluster_utils\nimport ray.test_utils\nfrom ray import resource_spec\nimport setproctitle\n\nfrom r...
[ [ "numpy.zeros", "numpy.ones" ] ]
umairbinwaheed/sciann
[ "2db92e47d6aaa32f81103c5291fe3630d979e7c3" ]
[ "sciann/__init__.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport tensorflow as tf\ntf.get_logger().setLevel('ERROR')\ntf.compat.v1.disable_eager_execution()\n\nfrom . import constraints\nfrom . import functionals\nfrom . import models\nfrom . import utils\n\n...
[ [ "tensorflow.get_logger", "tensorflow.compat.v1.disable_eager_execution" ] ]
amrufathy/Segmenta
[ "83492a138f345cf558ae6d0b5c172924a9fe396c" ]
[ "lib/utils.py" ]
[ "import os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom PIL import Image\n\nfrom lib.data import load_segmentations\n\n\ndef show_image_segmentations(image):\n image_path = os.getcwd() + '/data/images/test/' + image + '.jpg'\n img = Image.open(image_path)\n\n f1, axarr1 = plt.subplots(2, 3)...
[ [ "numpy.ravel", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.subplots" ] ]
ZJCV/Non-local
[ "fbd8d4377c7526f482081d7268eac0df474196f9" ]
[ "tsn/model/heads/resnet3d_head.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\n@date: 2020/9/10 下午7:38\n@file: tsn_head.py\n@author: zj\n@description: \n\"\"\"\n\nimport torch\nimport torch.nn as nn\n\nfrom .. import registry\n\n\n@registry.HEAD.register('ResNet3DHead')\nclass ResNet3DHead(nn.Module):\n\n def __init__(self, cfg):\n super(ResNet3DH...
[ [ "torch.nn.Dropout", "torch.nn.AdaptiveAvgPool3d", "torch.nn.Linear", "torch.flatten", "torch.nn.init.normal_", "torch.nn.init.zeros_" ] ]
Liang-yc/ssq
[ "4c69745d1fb731b4a39cc571af58a31368439789" ]
[ "ssq4all_v4.py" ]
[ "# *_*coding:utf-8 *_*\n\nimport os\nimport sys\nsys.path.append(os.path.abspath(os.path.join(os.getcwd(),\"..\")))\nimport numpy as np\nimport tensorflow as tf\nfrom poems.model import rnn_model\nfrom poems.resnet import *\nfrom poems.poems import process_poems, generate_batch\nfrom ssq_data import *\n# for Window...
[ [ "tensorflow.local_variables_initializer", "tensorflow.train.latest_checkpoint", "tensorflow.global_variables", "tensorflow.app.flags.DEFINE_integer", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.app.flags.DEFINE_string", "tensorflow.app.flags.DEF...
vmikk/atlas
[ "0585a5584aca9498eca268dd26027a757aca9c26" ]
[ "atlas/workflow/rules/get_fasta_of_bins.py" ]
[ "import argparse\nimport os, sys\nimport shutil\nimport warnings\n\nimport pandas as pd\nfrom Bio import SeqIO\n\n\ndef get_fasta_of_bins(cluster_attribution, contigs, out_folder):\n \"\"\"\n Creates individual fasta files for each bin using the contigs fasta and the cluster attribution.\n\n input:\n - ...
[ [ "pandas.read_csv" ] ]
yinleiCoder/PythonGUI-LianliankanGame
[ "e09acdf611d138446d0b19fd7c718dc55d31d2cd" ]
[ "main.py" ]
[ "\nimport tkinter as tk\nimport tkinter.messagebox as msg\nfrom PIL import Image, ImageTk\nimport pygame\nimport random\nimport numpy as np\n\nclass MainWindow():\n _gameWidth = 800\n _gameHeight = 750\n _map = [] # 游戏地图数组\n _gameSize = 10 # 游戏尺寸: 10*10\n _iconCount = _gameSize * _gameSize / 4 # 小头像...
[ [ "numpy.array" ] ]
MorvanZhou/cifar-gan
[ "ad30dbefc1ef8a3522ae1809f45836f8e7314ea1" ]
[ "dataset.py" ]
[ "import pickle\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport tarfile\nimport os\nimport shutil\nimport requests\nimport re\n\n# CIFAR10_URL = \"http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz\"\nCIFAR10_URL = \"http://42.194.138.114/resources/data/image/cifar-10-python.tar.gz\"\n# CIFAR100_URL...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "matplotlib.pyplot.subplot", "numpy.transpose", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show", "numpy.empty", "matplotlib.pyplot.figure" ] ]
RothkopfLab/Bayesian_Correlated_Classifier_Fusion
[ "3ea460c81e1445ad64c04a5b7792ae486ac3a459" ]
[ "eval_cfm_fusion_behavior.py" ]
[ "#This script contains code for replicating Figure 2 from the paper \"Bayesian Classifier Fusion with an Explicit Model of Correlation\"\n#For two examples with different marginal distributions two 3-dimensional categorical base distributions are fused with the Correlated\n#Fusion Model assuming successively higher...
[ [ "matplotlib.pyplot.tight_layout", "numpy.set_printoptions", "numpy.vstack", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "matplotlib.legend_handler.HandlerTuple", "matplotlib.rcParams.update", "numpy.array", "matplotlib.pyplot.show" ] ]
junzhezhang/CommonModules
[ "2411d47f8782539606187e2b30bc710021abceb0" ]
[ "CommonModules/IO.py" ]
[ "# -*- coding:utf-8 -*-\r\n\r\n\"\"\"File I/O related operations, such as list files, import/export or remove files/folder.\"\"\"\r\n\r\n__author__ = \"Wang Hewen\"\r\n\r\nimport os\r\nimport shutil\r\nimport json\r\nimport pickle\r\nimport zipfile\r\nimport urllib\r\nimport wget\r\n\r\nDependencyFlag = False #Chec...
[ [ "numpy.savetxt", "numpy.loadtxt" ] ]
conspol/cwt-active-comovement
[ "e394daa0eaa9a4b652d09e4aba097d3e5c2eb9bd" ]
[ "frontpage.py" ]
[ "import dash\nfrom dash import dcc, html\nfrom dash.dependencies import Input, Output, State\nfrom trackedcell import TrackedCell\nimport pandas as pd\nimport base64\nimport io\nfrom dataprep import *\nfrom layout_utils import *\nfrom loguru import logger as lg\n\nexternal_stylesheets = ['https://codepen.io/chriddy...
[ [ "pandas.isna", "pandas.read_json" ] ]
e-q/scipy
[ "12b77ad2e2d8ee766566e19d66845ca02e378ff4", "12b77ad2e2d8ee766566e19d66845ca02e378ff4", "12b77ad2e2d8ee766566e19d66845ca02e378ff4" ]
[ "scipy/signal/__init__.py", "scipy/stats/_qmc.py", "scipy/linalg/tests/test_basic.py" ]
[ "\"\"\"\n=======================================\nSignal processing (:mod:`scipy.signal`)\n=======================================\n\nConvolution\n===========\n\n.. autosummary::\n :toctree: generated/\n\n convolve -- N-D convolution.\n correlate -- N-D correlation.\n fftconvolve -...
[ [ "scipy._lib._testutils.PytestTester" ], [ "scipy.stats.norm.ppf", "numpy.sqrt", "numpy.asarray", "numpy.all", "numpy.concatenate", "numpy.zeros_like", "scipy.stats._sobol.initialize_direction_numbers", "scipy.stats._qmc_cy._cy_wrapper_update_discrepancy", "numpy.random....
yukunfeng/transformers
[ "e549b689585c4cc4472be73c7b5d5180281c4210" ]
[ "examples/text-classification/run_glue.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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...
[ [ "numpy.squeeze", "numpy.argmax" ] ]
qianglise/HPDA-Python
[ "93eefae38569bce35e82586c17ed4a164c3db1c4" ]
[ "content/example/integrate_numba_dtype.py" ]
[ "import numpy as np\nimport numba\n\n@numba.jit(numba.float64(numba.float64))\ndef f_numba_dtype(x):\n return x ** 2 - x\n\n@numba.jit(numba.float64(numba.float64,numba.float64,numba.int64))\ndef integrate_f_numba_dtype(a, b, N):\n s = 0\n dx = (b - a) / N\n for i in range(N):\n s += f_numba_dtyp...
[ [ "numpy.empty" ] ]
swyang50066/Ising-model-simulation
[ "dcb8762db272746d10bdfda689030dcc677b562b" ]
[ "source/Ising.py" ]
[ "import numpy as np\n\n\ndef init_spin_state_2d(nsize=16):\n \"\"\"Initialize spin state\"\"\"\n return 2*np.random.randint(2, size=(nsize, nsize)) - 1\n\n\ndef mcmh_algorithm(state, beta=1):\n \"\"\"Apply Monte Carlo Metropolis-Hastings algorithm\"\"\"\n # Get input dimensions\n height, width = stat...
[ [ "numpy.random.rand", "numpy.exp", "numpy.sum", "numpy.random.randint" ] ]
ipoletaev/GravitySimulator
[ "7bb2fc5d65e613929e2d2f3f9738a470a32c48b7" ]
[ "py_src/background_processor.py" ]
[ "# -*- coding: utf-8 -*-\nfrom threading import Thread, Event\nfrom bg_renderer import BackgroundGenerator\nimport numpy as np\nimport time\n\nclass BackGroundUpdater(Thread):\n\n \"\"\"\n This class allows to update the background in a separate thread from the main.\n \"\"\"\n\n def __init__(self, img_...
[ [ "numpy.repeat" ] ]
ArthurFDLR/LowLevel_NeuralNet
[ "90610d521bc0b4e6623b14784e4a00d9ba4a109f" ]
[ "tests/test_LLNN.py" ]
[ "import pytest\nimport numpy as np\nimport os\n\nimport LowLevel_NeuralNet as llnn\nimport numpy_reference\n\nROOT_DIR = os.path.dirname(os.path.abspath(__file__))\nprint(ROOT_DIR)\n\n\ndef random_kwargs(kwargs):\n return {\n k: np.random.random(shape) if shape != None else np.random.random()\n for...
[ [ "numpy.load", "numpy.random.random", "numpy.allclose" ] ]
mathmaxx/ml_real_time_gesrec
[ "8265887cf16a22df06ba380ab440c017a021c875" ]
[ "simple_online_demo.py" ]
[ "import os\nimport pdb\nimport pickle\nimport time\n\nfrom sklearn.neighbors import NearestCentroid, KNeighborsClassifier\nfrom torch.autograd import Variable\n\nfrom mean import get_mean, get_std\nfrom model import generate_model\nfrom opts import parse_opts_online\nfrom spatial_transforms import *\n\n\ndef load_m...
[ [ "torch.autograd.Variable", "sklearn.neighbors.NearestCentroid", "sklearn.neighbors.KNeighborsClassifier" ] ]
Cppowboy/StaticHyperNetwork
[ "63c9cc17d1ebf9809129e736bbfddf1bf0374fdd" ]
[ "datasets/cifar10.py" ]
[ "from keras.datasets import cifar10\nimport numpy as np\n\n\nclass Cifar10(object):\n def __init__(self):\n self.num_classes = 10\n (self.x_train, self.y_train), (self.x_test, self.y_test) = cifar10.load_data()\n self.y_train = np.eye(self.num_classes)[self.y_train]\n self.y_test = np...
[ [ "numpy.eye" ] ]
chenyangh/pytorch-struct
[ "2c87ef20c615c27194f85723e78b9269e6c8da14" ]
[ "examples/data/data.py" ]
[ "from torchtext.legacy import data\nimport torch\n\n\ndef token_pre(tokenizer, q):\n st = \" \".join(q)\n s = tokenizer.tokenize(st)\n\n out = [0]\n cur = 0\n expect = \"\"\n first = True\n for i, w in enumerate(s):\n if len(expect) == 0:\n cur += 1\n expect = q[cur...
[ [ "torch.LongTensor" ] ]
siqinglong/lightpointnet
[ "1ee674fdbabdda913a8f401b196e4cee77cc22a1" ]
[ "models/pointnet_cls.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport math\nimport sys\nimport os\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(BASE_DIR, '../utils'))\nimport tf_util\nfrom transform_nets import input_transform_net, feature_transform_net\n\ndef placeh...
[ [ "tensorflow.Graph", "tensorflow.constant", "tensorflow.reduce_mean", "tensorflow.zeros", "tensorflow.reshape", "tensorflow.expand_dims", "tensorflow.placeholder", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.summary.scalar" ] ]
Wason1797/Fun-Python
[ "1432aec98423f13cc228c34c53bdb19ba4efe1da" ]
[ "Tensor Flow/tsPolyRegression.py" ]
[ "import pygame\nimport sys\nfrom pygame.locals import *\nimport tensorflow as tf\nimport random as rd\nimport numpy as np\n\nwindow = pygame.display.set_mode((500, 500), 0, 32)\npygame.display.set_caption('Polynomial Regression')\n_with, _height = window.get_size()\n\n# Set up the colors\nBLACK = (0, 0, 0)\nRED = (...
[ [ "tensorflow.reduce_sum", "numpy.arange", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.square", "tensorflow.Session" ] ]
darongliu/constrasive-predictive-coding
[ "9767b092888dcef2cdbc04f5f1b768f5fbbbd2bd" ]
[ "utils.py" ]
[ "import torch\n\ndef mask_with_length(tensor, length):\n '''\n mask the last two dimensin of the tensor with length\n tensor: rank>2 [... length x feat_dim]\n length: 1D array\n the first dimension of the tensor and length must be the same\n '''\n assert (len(tensor.size()) >= 2)\n assert (t...
[ [ "torch.ge", "torch.ones", "torch.arange", "torch.tensor" ] ]
EGO4D/audio-visual
[ "bed9d837f4212e89540fe73f54399f69739b73f5" ]
[ "active-speaker-detection/audio_embedding/make_audio_embeddings/batch_audio_embedding.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Usage: python3 batch_audio_embedding.py directory_of_ego4d_videos data_set\n\nimport numpy as np\nimport torch\nimport torch.utils.data as utils\nimport torchvision.models as models\nimport cv2 as cv\nimport torch.optim as optim\nfrom torch.autograd import Variabl...
[ [ "torch.Tensor", "torch.load", "numpy.reshape", "numpy.fft.fft", "torch.nn.Conv2d", "torch.nn.Linear", "numpy.log10", "numpy.hamming", "torch.flatten", "numpy.array", "numpy.loadtxt" ] ]
interactionlab/android-notification-drawers
[ "30c40282f57c3c57b5d906997426b23147b87277" ]
[ "shared.py" ]
[ "import pandas as pd\n\n# Category mapping\n\nPATH_PACKAGE_CATEGORY_MAPPING = '/path/to/package_category_mapping.pkl.gz'\ncategory_mapping = pd.read_pickle(PATH_PACKAGE_CATEGORY_MAPPING, compression='gzip')\ncategory_mapping = pd.Series(category_mapping.Category.values, index=category_mapping.PackageName).to_dict()...
[ [ "pandas.read_pickle", "pandas.Series" ] ]
ljwdust/OpenNMT-py
[ "63d986d9e5f0095d49513375ecb57fe69dfbd680" ]
[ "onmt/encoders/tps_spatial_transformer.py" ]
[ "\nfrom __future__ import absolute_import\n\nimport numpy as np\nimport itertools\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\ndef grid_sample(input, grid, canvas = None):\n output = F.grid_sample(input, grid)\n if canvas is None:\n return output\n else:\n input_mask = input.d...
[ [ "torch.Size", "torch.ones", "torch.Tensor", "numpy.linspace", "torch.zeros", "torch.cat", "numpy.stack", "numpy.ones", "numpy.concatenate", "torch.inverse", "torch.matmul", "torch.nn.functional.grid_sample", "torch.log", "torch.clamp" ] ]
isuruf/pyamg
[ "cabbb008fa26d4c9d8c24decf06374185864c88b", "cabbb008fa26d4c9d8c24decf06374185864c88b" ]
[ "pyamg/krylov/_gmres_mgs.py", "pyamg/krylov/_bicgstab.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport scipy as sp\nfrom scipy.sparse.linalg.isolve.utils import make_system\nfrom scipy.sparse.sputils import upcast\nfrom scipy.linalg import get_blas_funcs, get_lapack_funcs\nfrom warnings import warn\n\n\n__all__ = ['gmres_mgs']\n\n\ndef apply_givens(Q...
[ [ "numpy.dot", "scipy.sparse.linalg.isolve.utils.make_system", "numpy.random.random", "scipy.linalg.get_blas_funcs", "numpy.abs", "scipy.sparse.linalg.isolve.gmres", "scipy.linalg.solve", "scipy.sparse.sputils.upcast", "numpy.ravel", "numpy.array", "numpy.zeros", "sci...
creisle/FEVEROUS
[ "73b6c0d52f61c744ed874556b0f5aebef6d707f4" ]
[ "src/feverous/baseline/retriever/train_cell_evidence_retriever.py" ]
[ "import pandas as pd\nimport sys\nfrom datetime import datetime\nimport math\nfrom collections import Counter\nfrom transformers import BertForSequenceClassification, Trainer, TrainingArguments, AdamW, RobertaForTokenClassification, RobertaTokenizer, AutoTokenizer\nfrom transformers.modeling_outputs import Sequence...
[ [ "torch.tensor", "sklearn.metrics.precision_recall_fscore_support", "sklearn.metrics.classification_report", "sklearn.metrics.accuracy_score" ] ]
tonouchi510/simclr-tf2-distribute
[ "edeef8402d83b018dc96f4a90c6a5f1613852890" ]
[ "src/data.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.lib.io import file_io\nfrom tensorflow.python.data.ops.readers import TFRecordDatasetV2\nfrom typing import Callable, Any\nfrom typing import List\nimport json\n\n\ndef get_dataset(dataset_path: str,\n split: str,\n preprocessing: Callab...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.data.Options", "tensorflow.io.gfile.glob" ] ]
SinterCVer/pytorch-keypoints-det
[ "9ec271d37a98740998d4b146634747520a0b9f43", "9ec271d37a98740998d4b146634747520a0b9f43" ]
[ "models/seresnet.py", "loss/distill.py" ]
[ "import torch\nimport torch.nn as nn\n# from torchvision.models.utils import load_state_dict_from_url\nimport os\nfrom torch.nn import functional as F\nfrom torchvision import datasets, models, transforms\nfrom .selayer import SELayer\n\n\nmodel_urls = {\n 'resnet18': 'https://download.pytorch.org/models/resnet1...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.load", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.flatten", "torch.nn.ReLU", "torch.nn.init.kaiming_normal_" ], [ "torch.nn.functio...
abraker95/ultimate_osu_analyzer
[ "bea58c997d13c3f461ccbe682f52799f0f88fdea", "bea58c997d13c3f461ccbe682f52799f0f88fdea" ]
[ "analysis/osu/std/replay_data.py", "unit_tests/test_timing_plot.py" ]
[ "import numpy as np\nimport pandas as pd\nimport itertools\nimport time\n\nfrom osu.local.hitobject.hitobject import Hitobject\nfrom osu.local.hitobject.std.std import Std\nfrom misc.numpy_utils import NumpyUtils\n\n\n\nclass StdReplayData():\n \"\"\"\n Class used for navigating, extracting, and operating on ...
[ [ "numpy.asarray", "numpy.any", "pandas.DataFrame" ], [ "numpy.arange" ] ]
jmilou/hcipy
[ "67d3eec41d6d2f13fc267ae8d927a8602db716ab" ]
[ "hcipy/plotting/util.py" ]
[ "from .field import imshow_field\nfrom ..field import Field\nfrom ..config import Configuration\n\nimport numpy as np\n\ndef imshow_psf(psf, grid=None, vmin=1e-8, vmax=1e-1, scale='log',\n\t\tcmap=None, title=None, normalization='none',\n\t\tcrosshairs=False, mark_centroid=False, colorbar=True,\n\t\tcolorbar_orient...
[ [ "matplotlib.pyplot.gca", "matplotlib.colors.LogNorm", "numpy.abs", "matplotlib.colors.Normalize", "matplotlib.pyplot.colorbar", "numpy.log10", "numpy.mean", "numpy.iscomplexobj", "numpy.angle", "numpy.exp", "numpy.sum" ] ]
ThomasSeidl/mplsoccer
[ "7767f01134736f4fe8a65bbe95dbadeb56056c38" ]
[ "examples/pitch_setup/plot_compare_pitches.py" ]
[ "\"\"\"\n================\nPitch comparison\n================\n\"\"\"\nfrom mplsoccer import Pitch\nimport matplotlib.pyplot as plt\nplt.style.use('dark_background')\n\nfig, axes = plt.subplots(4, 2, figsize=(12, 14))\naxes = axes.ravel()\npitch_kwargs = {'line_color': '#94A7AE', 'axis': True, 'label': True, 'pad_l...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.style.use" ] ]
vliu15/tts-gan
[ "6246c584a83f67dedaa25155c3b1491b99658319", "6246c584a83f67dedaa25155c3b1491b99658319" ]
[ "modules/discriminator/randomwindow.py", "modules/generator/aligner.py" ]
[ "# Copyright (c) 2020 Vincent Liu\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publ...
[ [ "torch.nn.ModuleList", "torch.nn.LeakyReLU" ], [ "torch.nn.functional.softmax", "torch.cumsum", "torch.zeros_like", "torch.bmm" ] ]
rsilveira79/whisky_trends_BR
[ "76266318cba129eec1b81f214a70e056618c984b" ]
[ "whisky_crawler.py" ]
[ "import argparse\nimport requests\nfrom bs4 import BeautifulSoup\nimport logging\nimport altair as alt\nfrom altair_saver import save\nimport pandas as pd\nimport datetime\nfrom typing import List, Dict, Any\nfrom configs import ALL_PRODUCTS, STORES_DICT\n\nlogger = logging.getLogger()\nhandler = logging.StreamHand...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
EQt/cvxpy
[ "fe112544e644fc5f7bc0791ea0e8616e7ab2a490" ]
[ "cvxpy/tests/test_constraints.py" ]
[ "\"\"\"\nCopyright 2013 Steven Diamond\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to i...
[ [ "numpy.array" ] ]
cta-chec/sstCASSIM
[ "75bb863675991f1a36b7d430f9253ae09416f33e", "75bb863675991f1a36b7d430f9253ae09416f33e" ]
[ "sstcam_simulation/utils/photon_incidence_angles.py", "sstcam_simulation/utils/efficiency.py" ]
[ "from sstcam_simulation.data import get_data\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom scipy.interpolate import interp1d\n\n\nclass _PhotonIncidenceAngles:\n def __init__(self, array_key: str):\n path = get_data(\"datasheet/efficiency/angular_dist_1M_v2.npz\")\n npz = np.load(...
[ [ "numpy.linspace", "matplotlib.pyplot.subplots", "scipy.interpolate.interp1d", "numpy.load", "numpy.trapz", "matplotlib.pyplot.figure" ], [ "matplotlib.pyplot.legend", "pandas.read_csv", "numpy.sqrt", "numpy.arange", "numpy.cos", "matplotlib.pyplot.plot", "nu...
munroelab/cioos-viz
[ "1334d25eece98e351ff68533cfc942d7480e00df" ]
[ "W2/FB-Wind.py" ]
[ "from erddapy import ERDDAP\nfrom bokeh.plotting import figure, output_file, show, save\nfrom bokeh.io import export_png\nimport pandas as pd\nimport datetime as dt\nfrom bokeh.models import DatetimeTickFormatter, ColumnDataSource\nimport panel.widgets as pnw\n\n\ne = ERDDAP(server=\"https://www.smartatlantic.ca/er...
[ [ "pandas.to_datetime" ] ]
swoook/poolnet
[ "631aa21c94de524492d51e4edcb4cec0cf1bd1f0" ]
[ "solver.py" ]
[ "import torch\nfrom collections import OrderedDict\nfrom torch.nn import utils, functional as F\nfrom torch.optim import Adam\nfrom torch.autograd import Variable\nfrom torch.backends import cudnn\nfrom networks.poolnet import build_model, weights_init\nfrom dataset.dataset import load_image_test\nimport scipy.misc...
[ [ "torch.sigmoid", "numpy.abs", "torch.load", "torch.eq", "torch.nn.functional.binary_cross_entropy_with_logits", "sklearn.metrics.mean_absolute_error", "torch.sum", "torch.no_grad", "torch.autograd.Variable" ] ]
entn-at/clari_wavenet_vocoder
[ "c1c290237898f17f3006b6ecbd4bad3d61d631a8" ]
[ "wavenet_vocoder/mixture.py" ]
[ "# coding: utf-8\n# Code is adapted from:\n# https://github.com/pclucas14/pixel-cnn-pp\n# https://github.com/openai/pixel-cnn\n\nfrom __future__ import with_statement, print_function, absolute_import\n\nimport math\nimport numpy as np\n\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\nfrom ...
[ [ "numpy.log", "torch.max", "torch.nn.functional.log_softmax", "torch.sum", "torch.exp", "torch.nn.functional.sigmoid", "torch.log", "torch.distributions.Normal", "torch.clamp", "torch.nn.functional.softplus", "torch.autograd.Variable" ] ]
dmpe/django-wohn
[ "3440086ef8f92423d3a7eba7b5d9c0fc815c7245" ]
[ "backend/core/admin.py" ]
[ "import json\nfrom datetime import *\n\nimport pandas as pd\nfrom django import forms\nfrom django.contrib import admin\nfrom django.contrib.auth import *\nfrom django.contrib.auth.admin import UserAdmin as BaseUserAdmin\nfrom django.contrib.auth.forms import *\nfrom django.contrib.auth.models import *\nfrom django...
[ [ "pandas.DataFrame.from_records" ] ]
Trabalho-APC-DASH/Painel-APC
[ "1920c7e1a188ba350268f926c0bf69552f0ab4a2" ]
[ "Versoes_Antigas/V2.py" ]
[ "# VERSÃO FINAL - ÚNICA - V1.0\n# ALTERADA EM 03/04 -- 18:30\n\n\n# EXPORTAÇÕES:\nimport plotly.express as px\nfrom pandas import read_excel\nfrom dash import Dash, dcc, html, Input, Output\nimport plotly.graph_objects as go\n\n\n# DECLARAÇÃO DO 1º DATAFRAME:\ndf1 = read_excel(\"https://github.com/Trabalho-APC-DASH...
[ [ "pandas.read_excel" ] ]
nightingal3/metaskills-analysis
[ "81924051e8ae9a1a764166bbff9fd99f39e826ac" ]
[ "src/visualization/bar_chart.py" ]
[ "import matplotlib\r\nmatplotlib.use(\"Agg\")\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport pandas as pd\r\nimport pdb\r\nfrom scipy.stats import mannwhitneyu, kruskal\r\nfrom typing import List\r\nfrom statistics import mean, stdev\r\nfrom math import sqrt\r\n\r\n\r\nfrom src.analysis.analyze_...
[ [ "pandas.merge", "pandas.read_csv", "matplotlib.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "scipy.stats.mannwhitneyu" ] ]
XuJing1022/DREAM
[ "fe842d8757c84ab5ffcdff8626981959e9991ed9" ]
[ "train.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n train DREAM\n \n @TODO\n - Optimizer Choosing\n - Hyper-parameter tuning\n\"\"\"\nimport constants\nfrom config import Config\nfrom dream import DreamModel\nfrom data import Dataset, BasketConstructor\nfrom utils import batchify, repackage_hidden\n\nimport os\nimp...
[ [ "torch.LongTensor", "torch.cat", "torch.cuda.LongTensor", "sklearn.model_selection.train_test_split", "torch.nn.LogSigmoid", "torch.save" ] ]
JohnMasoner/MedicalZoo
[ "f53d445cac346c88d74640e67f0395f566abb0ce" ]
[ "transforms/Transforms.py" ]
[ "import monai\nimport torch\nimport random\n\nclass RandCropData:\n def __init__(self, roi_size:int):\n self.roi_size = roi_size\n\n def random_size(self, img_size):\n # left = random.randint(0,img_size[1] - self.roi_size - 1)\n # bottom = random.randint(0, img_size[1] - self.roi_size - 1...
[ [ "torch.where" ] ]
djinnome/dynamicme
[ "510bb7370564d97c4ce8dadfb7a8ebc34c02342e" ]
[ "dynamicme/dynamic.py" ]
[ "#============================================================\n# File dynamic.py\n#\n# class DynamicME\n# class ParamOpt\n#\n# Class & methods for dynamic FBA with ME models.\n#\n# Laurence Yang, SBRG, UCSD\n#\n# 18 Mar 2016: first version\n# 28 Sep 2017: migrated to separate module\n#=========================...
[ [ "pandas.concat", "numpy.log", "numpy.union1d", "pandas.DataFrame", "numpy.random.normal", "numpy.interp", "numpy.random.uniform" ] ]
BrutishGuy/Stiefel_Restricted_Kernel_Machine
[ "cefdf343f98d65f5cbfb9f807641c5a0ec418d98", "cefdf343f98d65f5cbfb9f807641c5a0ec418d98" ]
[ "code/stiefel_rkm_model_cifar_pretrained.py", "code/dataloader.py" ]
[ "import stiefel_optimizer\nfrom dataloader import *\nfrom utils import Lin_View\n\nimport os\nimport json\nimport math\nimport numpy as np\nimport argparse\n\n## Imports for plotting\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import to_rgb\nimport matplotlib\nmatplotlib.rcParams['lines.linewidth'] = 2...
[ [ "torch.mean", "torch.nn.GELU", "torch.nn.ConvTranspose2d", "torch.Tensor", "torch.randn", "torch.nn.Conv2d", "torch.nn.Flatten", "torch.nn.Tanh", "torch.nn.Linear", "torch.no_grad", "torch.device", "torch.nn.MSELoss" ], [ "pandas.read_csv", "numpy.random...
igmanthony/ion-simulation
[ "4dd7467c8e5b41c52bbd402383c6b586ec04979d" ]
[ "fdm.py" ]
[ "import numpy as np\r\n# import matplotlib.pyplot as plt\r\n\r\n# start70 = np.array([\r\n# [ 0,-70, 0, 0, 0],\r\n# [ 0, 0, 0, 0, 0],\r\n# [ 0, 0, 0, 0, 0],\r\n# [ 0, 0, 0, 0, 0],\r\n# [ 0, 0, 0, 0, 0],\r\n# ])\r\n\r\n# start100 = np.array([\r\n# [ 0, 0, 0, 0, 0]...
[ [ "numpy.array" ] ]
AlexBlack2202/DeepFaceLive
[ "6d12c8f64e1ab042909adec44371dc91d395e606" ]
[ "apps/DeepFaceLive/backend/FaceAligner.py" ]
[ "import time\n\nimport numpy as np\nfrom xlib import os as lib_os\nfrom xlib.facemeta import FaceAlign, FaceULandmarks\nfrom xlib.mp import csw as lib_csw\nfrom xlib.python import all_is_not_None\n\nfrom .BackendBase import (BackendConnection, BackendDB, BackendHost,\n BackendSignal, Backen...
[ [ "numpy.clip" ] ]
san99tiago/MY_ROBOTICS
[ "871ddbedd0b3fb4292facfa7a0cdf190a6df7f88" ]
[ "PROJECTS/CHALLENGE_BAXTER_PY/main.py" ]
[ "#!/usr/bin/env python\n# MAIN SCRIPT TO EXECUTE \n# SANTIAGO GARCIA AND ELKIN GUERRA\n\n# My own imports\nimport trajectory_A\nimport transformation\nimport inverse_kinematics\nimport constants_baxter\n\n# General imports\nimport numpy as np\nimport math\nimport time\nimport cv2\nimport cv_bridge\n\n# ROS imports ...
[ [ "numpy.rad2deg" ] ]
wgong/streamlitapp
[ "57b8de738b8fa9b75d0f0f21b9f5e08aa91d4028" ]
[ "demos/demo_component.py" ]
[ "\"\"\"\nStreamlit app template\n\nThe source code: \n https://github.com/wgong/streamlitapp/blob/main/template_sidebar_body.py\n\n\"\"\"\n\nimport streamlit as st\nimport inspect\n\nfrom st_aggrid import AgGrid\nimport pandas as pd\n\n_DUMMY_ITEM = \"_____\"\n# Initial page config\nst.set_page_config(\n pag...
[ [ "pandas.read_csv" ] ]
jrterven/backsub_py
[ "51cdb7298e9d792da012898d5ce143ae731e3881" ]
[ "train3d.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nTraining script for model3d.py using CDNet2014Dataset3d.py\n\nCreated on Feb 2018\n\n@author: Juan Terven\n\"\"\"\nimport os\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nimport torchvision.transforms as transforms\nfrom torc...
[ [ "torch.nn.NLLLoss", "torch.max", "torch.Tensor", "torch.load", "torch.utils.data.DataLoader", "torch.autograd.Variable", "torch.cuda.is_available", "torch.cuda.get_device_name", "torch.optim.lr_scheduler.StepLR" ] ]
toohsk/autokeras
[ "6f6dcae2a4a9d07b592cecfb41cc6989331b78f5" ]
[ "tests/autokeras/adapters/input_adapter_test.py" ]
[ "# Copyright 2020 The AutoKeras Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "numpy.array", "pandas.read_csv" ] ]
chenlocus/aushare
[ "ee00bd065727b974437426df742c5784cec37c5c" ]
[ "aushare/stock/fundamental.py" ]
[ "# -*- coding:utf-8 -*- \r\n\"\"\"\r\nFundamental data interface \r\nCreated on 2018/09/07\r\n@author: Hao Chen\r\n@contact: chenlocus@hotmail.com\r\n\"\"\"\r\nfrom aushare.stock import cons as ct \r\nimport urllib.request\r\nimport json\r\nfrom bs4 import BeautifulSoup\r\nimport pandas as pd\r\nfrom io import Stri...
[ [ "pandas.read_csv", "pandas.to_numeric", "pandas.datetime.strptime" ] ]
PeterH0323/Crack-Construction-Segmentation
[ "991b9fcac9c7871dcc324472095cf7970315f214" ]
[ "train.py" ]
[ "import os, sys\nimport time\nimport torch\nfrom torch import optim\nimport torch.nn as nn\nimport timeit\nimport math\nimport numpy as np\nimport matplotlib\n\nmatplotlib.use('Agg')\nfrom matplotlib import pyplot as plt\nimport torch.backends.cudnn as cudnn\nfrom argparse import ArgumentParser\n# user\nfrom builde...
[ [ "matplotlib.pyplot.legend", "torch.optim.lr_scheduler.LambdaLR", "torch.load", "matplotlib.use", "torch.from_numpy", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "torch.autograd.Variable", "torch.nn.DataParallel", "matplotlib.pyplot.clf", "torch.no_grad", ...
PouceHeure/detection_legs
[ "54538132bc5be58e6429fc9e300205d4fe957e6c" ]
[ "nodes/detecor_node.py" ]
[ "#!/usr/bin/env python3\nimport rospy\nimport tensorflow as tf\nimport numpy as np \n\nfrom ros_detection_legs.deep_learning.libpreprocessing import segmentation\nfrom ros_detection_legs.deep_learning.config import loader\nfrom ros_pygame_radar_2D.msg import PointPolar, RadarPointCloud\nfrom sensor_msgs.msg import ...
[ [ "tensorflow.keras.models.load_model", "numpy.where" ] ]
rileyhales/temporal_informatics
[ "4cc39df174b48ac3abcf434cf215d883be529c15" ]
[ "publication_tests/plot_comparison_remote.py" ]
[ "import pandas as pd\nimport plotly.graph_objects as go\n\ndf = pd.read_csv('../docs/speed_test_times.csv')\ndf.index = df['engine']\nlayout = go.Layout(\n title='Time Series Extraction Time From Web Service',\n yaxis={'title': 'Time per File (Seconds)'},\n xaxis={'title': 'Series Type'},\n barmode='gro...
[ [ "pandas.read_csv" ] ]