repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
basiralab/MICNet | [
"38943ae25023f1cc0a23992ed0647f5d03cb0469",
"38943ae25023f1cc0a23992ed0647f5d03cb0469"
] | [
"DIFF/main_SNF_DIFF.py",
"DIFF/main_MGI_DIFF.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Apr 20 23:58:29 2020\r\n\r\n@author: Mohamed\r\n\"\"\"\r\n\r\nimport torch\r\nimport numpy as np\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport argparse\r\nimport pickle\r\nfrom torch.autograd import Variable\r\nimport sklearn.metrics as me... | [
[
"numpy.expand_dims",
"torch.max",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.mean",
"torch.cuda.is_available",
"sklearn.metrics.f1_score",
"sklearn.preprocessing.MinMaxScaler",
"numpy.hstack",
"torch.from_numpy",
"torch.squeeze",
"torch.optim.Adam",
"numpy.... |
siforrer/coreali | [
"261e321b546192e608edf87c47719d2173ab4645",
"261e321b546192e608edf87c47719d2173ab4645"
] | [
"tests/test_mem.py",
"src/coreali/registerio/Tester.py"
] | [
"import unittest\nimport numpy as np\nimport sys\nif not \"../src/\" in sys.path:\n sys.path.insert(0, \"../src/\")\nfrom coreali.regmodel import Memory, Selector\nfrom coreali.registerio import RegIoNoHW\n\n\nclass DummyNode():\n def __init__(self):\n self.property = {\"mementries\": 8,\n ... | [
[
"numpy.arange",
"numpy.array",
"numpy.zeros",
"numpy.array_equal"
],
[
"numpy.arange"
]
] |
TheSaintIndiano/SportsWear-Classification | [
"a98ea4a7a4a2ada60952525350d3e0aad1678638",
"a98ea4a7a4a2ada60952525350d3e0aad1678638"
] | [
"utils/data_utils.py",
"model/auto-tpot/sample.py"
] | [
"__author__ = 'indiano'\n\n# encoding=utf8\n\nimport fnmatch\nimport json\nimport os\nimport re\nfrom collections import Counter\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import Imputer\n\nfrom config import config\n\n\nclass DataUtils:\n\n def __init__(self, args):\n self.arg... | [
[
"sklearn.preprocessing.Imputer",
"pandas.read_hdf",
"pandas.concat",
"pandas.DataFrame"
],
[
"pandas.read_hdf",
"numpy.set_printoptions",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.classification_report",
"sklearn.fe... |
Harris-Lodi/Data_Visualization_Project | [
"6f08c8b8fb51fef99db1366fb711c64e5ea612f0"
] | [
"Basics/rw_visual.py"
] | [
"import matplotlib.pyplot as plt \nfrom random_walk import Randomwalk\n\n# this script will visually plot the randomwalks\n# generated from the random_walk.py script\n\n# keep making new walks, as long as the program is active\nwhile True:\n # make random walk\n rw = Randomwalk(50000) # changed the num_points... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use"
]
] |
alirezajahani60/FabFlee | [
"e2cfdb6efc758281e123f6acc1b06f93176dd756"
] | [
"config_files/validation/SWEEP/ssudan_ccamp/run.py"
] | [
"from flee import flee\nfrom datamanager import handle_refugee_data,read_period\nfrom datamanager import DataTable #DataTable.subtract_dates()\nfrom flee import InputGeography\nimport numpy as np\nimport outputanalysis.analysis as a\nimport sys\n\ndef AddInitialRefugees(e, d, loc):\n \"\"\" Add the initial refugee... | [
[
"numpy.sum"
]
] |
albanotmakolli/SMAC3 | [
"511bd41f8c8477a10c00bdc67d46026c398e4854"
] | [
"smac/optimizer/acquisition.py"
] | [
"# encoding=utf8\nimport abc\nimport copy\nfrom typing import List, Any, Tuple\n\nimport numpy as np\nfrom scipy.stats import norm\n\nfrom smac.configspace import Configuration\nfrom smac.configspace.util import convert_configurations_to_array\nfrom smac.epm.base_epm import AbstractEPM\nfrom smac.utils.logging impo... | [
[
"numpy.log",
"scipy.stats.norm.cdf",
"numpy.sqrt",
"scipy.stats.norm.pdf",
"numpy.isnan",
"numpy.finfo",
"numpy.copy",
"numpy.any",
"numpy.exp",
"numpy.random.RandomState"
]
] |
malyvsen/d-graph-plus | [
"445822778520b77ba14c0e53223ef74bc6059a97"
] | [
"d_graph_plus/visualize.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom d_graph_plus.data import batch\nimport d_graph_plus.manager as manager\nfrom d_graph_plus.tasks import current as task\n\n\ndef all():\n correlation(show=False)\n history(show=False)\n if hasattr(task, 'visualize'):\n task.visualize(show=Fal... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.colorbar",
"numpy.linalg.det",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
justin-napolitano/USSupremeCourtMetaDataGraph | [
"d2d53915cdba33848bdd81f661d3c496ca518966"
] | [
"active_code_base/neo4jAPI/csv_to_neo.py"
] | [
"#realtor_graph.py\n\n\n#from neo4j_connect_2 import NeoSandboxApp\n#import neo4j_connect_2 as neo\nimport GoogleServices as google\nfrom pyspark.sql import SparkSession\nfrom pyspark.sql.functions import struct\nfrom pprint import pprint\nfrom neomodel import (config, StructuredNode, StringProperty, IntegerPropert... | [
[
"pandas.read_csv"
]
] |
mpangrazzi/haystack | [
"eb514a6167b84a4b6923dfc397c7a40ab3da2e44"
] | [
"haystack/nodes/retriever/sparse.py"
] | [
"from typing import Dict, List, Optional\n\nimport logging\nimport pandas as pd\nfrom collections import OrderedDict, namedtuple\nfrom sklearn.feature_extraction.text import TfidfVectorizer\n\nfrom haystack.schema import Document\nfrom haystack.document_stores import BaseDocumentStore, KeywordDocumentStore\nfrom ha... | [
[
"sklearn.feature_extraction.text.TfidfVectorizer",
"pandas.DataFrame.from_dict"
]
] |
alishakodibagkar/brainlit | [
"2dc12eac3ea71412a36ecace3bab2deebd2ef29c"
] | [
"brainlit/registration/preprocessing/normalization.py"
] | [
"import numpy as np\n\nfrom ..lddmm._lddmm_utilities import _validate_ndarray\n\n\ndef _verify_data_is_ndarray(data):\n if not isinstance(data, np.ndarray):\n raise TypeError(f\"data must be of type np.ndarray.\\ntype(data): {type(data)}.\")\n\n\ndef cast_to_typed_array(data, dtype=float):\n \"\"\"\n ... | [
[
"numpy.median",
"numpy.mean",
"numpy.pad",
"numpy.quantile"
]
] |
agmt/sent_an | [
"20d7d151edd6c8d122c4cd264c4f7fcf5683b148"
] | [
"dmitrieva.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nRequirements:\npip3 install numpy nltk sklearn gensim pystemmer bs4 scipy pymorphy2 pymorphy2-dicts-ru\n\"\"\"\n\nimport numpy as np\nfrom gensim.models.doc2vec import LabeledSentence\nfrom sklearn.cross_validation import train_test_split\nfrom sklearn import preprocessing\nfrom s... | [
[
"sklearn.naive_bayes.MultinomialNB",
"sklearn.metrics.confusion_matrix",
"scipy.sparse.csr_matrix",
"numpy.copy",
"numpy.mean",
"sklearn.metrics.f1_score",
"sklearn.metrics.classification_report"
]
] |
uchidalab/dtw-features-ucr | [
"969a81bf0dae5e2682077d1bedfc4705a64402a4"
] | [
"cross_dtw_ucr.py"
] | [
"import utils.dtw as dtw\nimport time\nimport numpy as np\nimport os\nimport csv\nimport sys\n\n\nif __name__ == \"__main__\":\n version = sys.argv[1]\n length = int(sys.argv[2])\n\n print(\"Starting: {}\".format(version))\n\n # load settings\n full_train_file = os.path.join(\"data\", version + \"_TR... | [
[
"numpy.shape",
"numpy.zeros",
"numpy.genfromtxt"
]
] |
sfalkena/zoo | [
"14d329fe25c0bcd22751793f9dbf34cfc0ac9b78"
] | [
"larq_zoo/core/utils.py"
] | [
"import contextlib\nimport json\nimport os\nimport sys\nfrom typing import Optional, Union\n\nimport tensorflow as tf\nfrom tensorflow.python.eager.context import num_gpus\n\nif tf.__version__[0] > \"1\":\n is_keras_tensor = tf.keras.backend.is_keras_tensor\nelse:\n from tensorflow.python.keras.backend import... | [
[
"tensorflow.python.eager.context.num_gpus",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.backend.image_data_format",
"tensorflow.distribute.MirroredStrategy",
"tensorflow.python.keras.backend.is_keras_tensor",
"tensorfl... |
cbrochtrup/pizza-topping-suggestor | [
"1ec69b439790a6d4c29d26b34e331b2767006476"
] | [
"train-topping-predictor/link_predict.py"
] | [
"\"\"\"\nLink Prediction using Graph Neural Networks\n===========================================\n\nIn the :doc:`introduction <1_introduction>`, you have already learned\nthe basic workflow of using GNNs for node classification,\ni.e. predicting the category of a node in a graph. This tutorial will\nteach you how ... | [
[
"sklearn.metrics.roc_auc_score",
"torch.ones",
"torch.cat",
"torch.zeros",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nn.Linear",
"numpy.random.permutation",
"torch.no_grad",
"torch.nn.functional.relu",
"numpy.where"
]
] |
vibhavagarwal5/e-SNLI | [
"5b35d7f4e27dc0b9e3259610ceae54cade3abb63"
] | [
"attention/train_attention_bottom.py"
] | [
"import os\nimport sys\nimport time\nimport argparse\nimport glob\nimport math\nimport csv\nimport numpy as np\nimport random\nfrom shutil import copy2\n\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\n\nfrom data_attention_bottom import get_train, get_batch, build_vocab, get_word_dict, g... | [
[
"matplotlib.pyplot.semilogy",
"torch.nn.CrossEntropyLoss",
"matplotlib.pyplot.legend",
"torch.max",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.cuda.set_device",
"matplotlib.use",
"torch.manual_seed",
"torch.load",
"matplotlib.pyplot.savefig",
"matplotlib.... |
JeongChanwoo/lab_study_group | [
"46fc6c8d6e7000380132829ee58a7686d32d28ae"
] | [
"2017/CS_20SI/code/Seq2Seq with Attention/chatbot.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport os\nimport random\nimport sys\nimport time\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom model import ChatBotModel\nimport config\nimport data_handler\n\n\ndef _get_random_bucket(train_buckets_scale):\n \"... | [
[
"tensorflow.compat.as_str",
"tensorflow.global_variables_initializer",
"numpy.argmax",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.zeros"
]
] |
chrisseiler96/Mota-Analytica.io | [
"e1297984b03c5039f6dbbb09e523742a35a28459"
] | [
"FlaskApp/final_model/pybert/test/predicter.py"
] | [
"#encoding:utf-8\nimport torch\nimport numpy as np\nfrom ..utils.utils import model_device,load_bert\n\nclass Predicter(object):\n def __init__(self,\n model,\n logger,\n n_gpu,\n model_path\n ):\n self.model = model\n ... | [
[
"torch.no_grad"
]
] |
Skydipper/CNN-tests | [
"43c80bc1871b13c64035e07cda64a744575e61e7"
] | [
"dockerized/src/predict/scripts/predict.py"
] | [
"from keras.models import model_from_json\nfrom keras.optimizers import Adam \nfrom keras.callbacks import Callback, ModelCheckpoint\nimport h5py\nimport json\nimport time\nimport argparse\nimport numpy as np\nfrom models import SegNet, DeepVel, PSPNet, DeepLabv3plus\n \nclass predict(object):\n \n def ... | [
[
"numpy.load"
]
] |
m860/data-analysis-with-python | [
"e96a5ae79913d7805383ea3dfb8dcc731c60681d",
"e96a5ae79913d7805383ea3dfb8dcc731c60681d"
] | [
"filter/Stock.py",
"sync_data/sync.py"
] | [
"# -*- coding: UTF-8 -*-\nimport numpy as np\nimport pandas as pd\nimport os\nfrom dateutil.parser import parse\n\n\ndef _macd(closes):\n ema12 = _ema(closes, 12)\n ema26 = _ema(closes, 26)\n diff = ema12 - ema26\n dea = _ema(diff, 9)\n osc = diff - dea\n return (osc * 2, diff, dea)\n\n\ndef _ma(c... | [
[
"pandas.read_csv",
"numpy.arange",
"numpy.mean",
"numpy.float64",
"numpy.array",
"numpy.zeros"
],
[
"numpy.append",
"numpy.array"
]
] |
toytag/self-supervised-learning-for-semantic-segmentation | [
"b3326df6d1fa045fabb27fc30542313adee00d30"
] | [
"utils/worker_template.py"
] | [
"from abc import ABCMeta, abstractmethod\nimport builtins\nimport math\nimport os\nimport sys\nimport time\nfrom typing import Sequence, Union\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.distributed\nimport torch.optim as optim\nimport torch.utils.data as data\nimport torch.utils.... | [
[
"torch.distributed.init_process_group",
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.set_device",
"torch.load",
"torch.utils.data.DataLoader",
"torch.cuda.amp.GradScaler",
"torch.optim.SGD",
"torch.nn.parallel.DistributedDataParallel"
]
] |
ndb796/DARP | [
"069941c6cf414099658bce73bbdb427f39af0a1f"
] | [
"training_functions.py"
] | [
"from __future__ import print_function\n\nimport argparse\nimport os\nimport shutil\nimport time\nimport random\nimport math\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data as data\nimp... | [
[
"torch.softmax",
"numpy.random.beta",
"torch.max",
"torch.nn.functional.log_softmax",
"torch.cat",
"torch.zeros",
"torch.rot90",
"torch.no_grad",
"torch.split"
]
] |
sergivalverde/PARIIETAL | [
"24c630580067082f613082b22111a5d7fb56bbac"
] | [
"_utils/model_utils.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom termcolor import colored\n\nclass ResCoreElement(nn.Module):\n \"\"\"\n Residual Core element used inside the NN. Control the number of filters\n and batch normalization.\n \"\"\"\n def __init__(self,\n ... | [
[
"torch.nn.Conv3d",
"torch.nn.functional.relu",
"torch.nn.BatchNorm3d",
"torch.nn.functional.leaky_relu"
]
] |
Teemo341/BDNN | [
"d53d4634a7a43d038faa049d7dfd10b3578ae267"
] | [
"SVHN/abalation/whether_pseudo/cifar10/1/models/resnet_bayesian.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nfrom blitz.modules import BayesianLinear, BayesianConv2d\nfrom blitz.losses import kl_divergence_from_nn\nfrom blitz.utils import variational_estimator\n\n__all__ = ['Resnet_bayesian']\n\ndef init_params(net):\n '''Init layer parameters.'''\n ... | [
[
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.init.normal_",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal_"
]
] |
tailocbmt/mmaction2 | [
"51612047a53a13be7a855878ffe6f2e5dc4b7b0a",
"51612047a53a13be7a855878ffe6f2e5dc4b7b0a"
] | [
"POSEC3D-LSTM/long_demo.py",
"mmaction/apis/inference.py"
] | [
"from collections import deque\nimport os\nimport os.path as osp\nimport shutil\n\nimport cv2\nimport mmcv\nimport pandas as pd\nimport numpy as np\nimport torch\nfrom utils.mics import parse_args, PoseC3DTransform, createKNN\nfrom utils.models import modelFromConfig\n\nfrom mmaction.apis import init_recognizer\nfr... | [
[
"numpy.load",
"pandas.read_csv",
"torch.cuda.empty_cache"
],
[
"torch.no_grad"
]
] |
automl/paramsklearn | [
"0466802aad28bfc6df945f874b4b81a3f337009d",
"0466802aad28bfc6df945f874b4b81a3f337009d"
] | [
"ParamSklearn/implementations/MinMaxScaler.py",
"tests/implementations/test_OneHotEncoder.py"
] | [
"import numpy as np\nfrom scipy import sparse\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.utils.validation import check_is_fitted, check_array, warn_if_not_float\n\n\nclass MinMaxScaler(BaseEstimator, TransformerMixin):\n \"\"\"Transforms features by scaling each feature to a given ... | [
[
"sklearn.utils.validation.check_is_fitted",
"scipy.sparse.issparse",
"sklearn.utils.validation.check_array",
"numpy.min",
"numpy.max",
"sklearn.utils.validation.warn_if_not_float",
"numpy.array"
],
[
"sklearn.utils.testing.assert_array_almost_equal",
"numpy.array",
"num... |
fakufaku/sdr_medium_rare | [
"d747b43c7bf2feb593dfdd2fc4e4c05679389a27"
] | [
"torchiva/models/simple.py"
] | [
"# Copyright 2021 Robin Scheibler\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to\n# use, copy, modify, merge, pub... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.log10"
]
] |
qwerty29544/Py_Nonstationary_EM_integralEq | [
"c90514019fa3bf0db400f72df837f41bfcb946fb"
] | [
"test/test_charge.py"
] | [
"import src.charge as charge\nimport numpy as np\nimport os\n\n\ndef test_f_function():\n assert (charge.f_function(1 / 22, 1) == 0)\n assert (charge.f_function(1 / 21, 1) == 0)\n assert (charge.f_function(1 / 20, 1) != 0)\n assert (charge.f_function(0, 1) == 0)\n assert (charge.f_function(1, 1) == 0... | [
[
"numpy.arange"
]
] |
libgirlenterprise/dong_mnist_example | [
"fdcf2fcc457e717eeaddb631f071790eb1f39607"
] | [
"dong_mnist_example/data/default.py"
] | [
"\nfrom __future__ import division\n\nimport collections\nimport numpy\nimport tensorflow\nimport dong.framework\n\nDataPair = collections.namedtuple('DataPair', ['x', 'y'])\nDataParams = collections.namedtuple('Params', ['image_size', 'num_labels'])\n\nclass DefaultData(dong.framework.Data):\n\n \n def __ini... | [
[
"numpy.unique"
]
] |
zangruirui/causalml | [
"45fc68ef362822e2df1d9fd85497dbeaa30bfadb"
] | [
"causalml/inference/meta/slearner.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom future.builtins import super\nimport logging\nimport numpy as np\nfrom tqdm import tqdm\nfrom scipy.stats import norm\nfrom sklearn.dummy import DummyRegressor\nimport statsmodels.api as sm\nfrom co... | [
[
"scipy.stats.norm.ppf",
"numpy.unique",
"numpy.arange",
"sklearn.dummy.DummyRegressor",
"numpy.percentile",
"numpy.zeros_like",
"numpy.zeros"
]
] |
takekoputa/project-euler | [
"6f434be429bd26f5d0f84f5ab0f5fa2bd677c790"
] | [
"1st_100/problem082.py"
] | [
"# Question: https://projecteuler.net/problem=82\n\n# Let's transpose the matrix. So the problem becomes, from any cell from the top row, find the shortest path to any cell in the bottom row, and the allowed movements are going leftward, going rightward, and going downward.\n\n# The algorithm is the same as that of... | [
[
"numpy.zeros",
"numpy.transpose"
]
] |
IEM-Computer-Vision/kornia | [
"f98bd9a2158a6e59cda076d55d476acf13f4e0af",
"f98bd9a2158a6e59cda076d55d476acf13f4e0af"
] | [
"kornia/feature/scale_space_detector.py",
"kornia/contrib/max_blur_pool.py"
] | [
"from typing import Tuple, List, Optional\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom kornia.geometry import angle_to_rotation_matrix\nfrom kornia.feature.responses import BlobHessian\nfrom kornia.geometry import ConvSoftArgmax3d\nfrom kornia.feature.orientation import PassLAF\nf... | [
[
"torch.cat",
"torch.zeros_like",
"torch.eye",
"torch.nn.functional.interpolate",
"torch.topk",
"torch.pow"
],
[
"torch.nn.functional.max_pool2d",
"torch.is_tensor"
]
] |
orilinial/RSPP | [
"e9e4ac82d610bb00b2eaa3ef44e990d30f8b1278"
] | [
"varibad/models/encoder.py"
] | [
"import numpy as np\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\n\nfrom utils import helpers as utl\n\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\n\nclass RNNEncoder(nn.Module):\n def __init__(self,\n # network size\n ... | [
[
"torch.randn_like",
"torch.cat",
"torch.nn.init.constant_",
"torch.zeros",
"torch.nn.ModuleList",
"torch.nn.GRU",
"torch.exp",
"torch.nn.Linear",
"numpy.ceil",
"torch.nn.init.orthogonal_",
"torch.cuda.is_available"
]
] |
jessecusack/DIMES_eddy_wave_interactions | [
"eee1d2325eaeeda356ad65cfe4a153e69b9bb196"
] | [
"code/overview_analysis.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# formats: py:percent,ipynb\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.4.2\n# kernelspec:\n# display_name: dimes-eiw\n# language: python\n# name: dimes-eiw\n# ---\n... | [
[
"numpy.linspace",
"numpy.mean",
"numpy.fix",
"numpy.ma.masked_where",
"numpy.ones_like",
"numpy.arange",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.figure",
"numpy.min",
"numpy.isnan",
"numpy.median",
"matplotlib.path.Path",
"numpy.array",
"matplotli... |
vespa-engine/pyvespa | [
"86f5dbe346d922c21ad2f45ca86ba04f86e343bc"
] | [
"vespa/application.py"
] | [
"# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\n\nimport sys\nimport ssl\nimport aiohttp\nimport asyncio\nimport concurrent.futures\n\nfrom typing import Optional, Dict, Tuple, List, IO, Union\nfrom pandas import DataFrame\nfrom requests import Sessi... | [
[
"pandas.DataFrame.from_records"
]
] |
mikkowus/BESSPIN-Tool-Suite | [
"e87e9abb1156a8627aacc3272f1925b034129146",
"e87e9abb1156a8627aacc3272f1925b034129146"
] | [
"besspin/cyberPhys/cyberphyslib/cyberphyslib/demonstrator/joystick.py",
"besspin/cyberPhys/hardware/LED management/cyberphysical_demonstrator_led_manager.py"
] | [
"\"\"\"\nProject: SSITH CyberPhysical Demonstrator\njoystick.py\nAuthor: Ethan Lew <elew@galois.com>\nDate: 05/28/2021\nPython 3.8.3\nO/S: Windows 10\n\nUser Inputs Activity Monitoring Component\n\"\"\"\nimport collections\nimport enum\nimport pygame\nimport abc\nfrom collections import deque\nimport numpy as np\nf... | [
[
"numpy.max",
"numpy.array",
"numpy.min"
],
[
"numpy.concatenate",
"numpy.array"
]
] |
lzy1203/OpenKS | [
"6a22fac7550e248e43d5b55ef39b1fe67c4b4b68"
] | [
"openks/models/pytorch/mmd_modules/HOI/datasets/hico.py"
] | [
"# ------------------------------------------------------------------------\n# Copyright (c) Hitachi, Ltd. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 [see LICENSE for details]\n# ------------------------------------------------------------------------\n\"\"\"\nHICO detection dataset.\n\"... | [
[
"torch.zeros",
"torch.tensor",
"torch.stack",
"numpy.load",
"torch.as_tensor"
]
] |
tangy56/vv-per-adapt | [
"75a4cc94257cff8459f89a1e96cc6143f14e8bb6"
] | [
"src/eda_modules/eda.py"
] | [
"from .utility import v_print, check_path, list_flatten\n\nimport pandas as pd\nimport os\n\nimport matplotlib.pyplot as plt\nimport matplotlib\n\nfrom src.plot_modules.univariateplot import univariateplot\nfrom src.plot_modules.bivariateplot import bivariateplot\n\nfrom scipy import stats\nimport numpy as np\nfrom... | [
[
"scipy.stats.pearsonr",
"matplotlib.pyplot.subplots",
"numpy.round",
"numpy.std",
"numpy.mean",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
DanteCely/PUJ_ML | [
"7cb592bb51a9c7b5a5d330754d410377cc34911b"
] | [
"examples/pca/pca.py"
] | [
"## =========================================================================\n## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)\n## =========================================================================\n\nimport numpy, sys\nimport matplotlib.pyplot as plotter\nfrom matplotlib import cm\n\n# Check... | [
[
"matplotlib.pyplot.scatter",
"numpy.linalg.inv",
"numpy.linalg.eig",
"matplotlib.pyplot.subplots",
"numpy.linalg.norm",
"numpy.genfromtxt",
"matplotlib.pyplot.quiver",
"matplotlib.pyplot.show",
"numpy.zeros"
]
] |
popnetwork/hummingbot | [
"8695f83a2ffec392083be9ba5be7f0fa5c4dade6"
] | [
"hummingbot/client/command/order_book_command.py"
] | [
"from hummingbot.core.utils.async_utils import safe_ensure_future\nimport pandas as pd\nfrom typing import TYPE_CHECKING\nif TYPE_CHECKING:\n from hummingbot.client.hummingbot_application import HummingbotApplication\n\n\nclass OrderBookCommand:\n def order_book(self, # type: HummingbotApplication\n ... | [
[
"pandas.concat"
]
] |
juyingnan/DataViz | [
"262b57a47cdc7f2872769ee71db6ae3f2f6c8bc1"
] | [
"COCO/thumbnail_wall_coco.py"
] | [
"import os\nfrom scipy import io as sio\nimport numpy as np\nfrom bokeh.plotting import figure, show, output_file, reset_output\nfrom bokeh.layouts import column\n\nimport math\n\n\ndef find_sqrt_root_roof(number):\n sqrt_root = math.floor(math.sqrt(number))\n while sqrt_root ** 2 < number:\n sqrt_root... | [
[
"scipy.io.loadmat",
"numpy.zeros"
]
] |
pmulcaire/allennlp | [
"d03e87b7b7297821d384a0b129268e6ca4d8e679"
] | [
"tests/modules/seq2vec_encoders/pytorch_seq2vec_wrapper_test.py"
] | [
"# pylint: disable=no-self-use,invalid-name\nimport pytest\nfrom numpy.testing import assert_almost_equal\nimport torch\nfrom torch.autograd import Variable\nfrom torch.nn import LSTM\nfrom torch.nn.utils.rnn import pack_padded_sequence\n\nfrom allennlp.common.checks import ConfigurationError\nfrom allennlp.common.... | [
[
"torch.ones",
"torch.nn.LSTM",
"torch.FloatTensor",
"torch.rand",
"torch.autograd.Variable"
]
] |
xingshulicc/Regression-in-scikit-learn | [
"9a238465ed1b0147e09506252574e36d079eee20"
] | [
"LinearRegression_text.py"
] | [
"# -*- coding: utf-8 -*-\r\nfrom __future__ import print_function\r\n\"\"\"\r\nCreated on Mon Oct 02 14:24:30 2017\r\n\r\n@author: xingshuli\r\n\"\"\"\r\n\r\n'''\r\nmultiple linear regression with ordinary least squares fit: \r\nHere x is Multiple input ~(x1, x2,..., xn)\r\ny = a0 + a1*x1 + a2*x2 + ... + an*xn\r\n\... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.r2_score",
"matplotlib.pyplot.title",
"numpy.genfromtxt",
"matplotlib.pyplot.plot",
"sklearn.metrics.mean_squared_error",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.... |
soumik12345/Barbershop | [
"971be31afca55499287e97a7034a59a66b871ba8",
"971be31afca55499287e97a7034a59a66b871ba8",
"971be31afca55499287e97a7034a59a66b871ba8",
"971be31afca55499287e97a7034a59a66b871ba8"
] | [
"utils/data_utils.py",
"utils/shape_predictor.py",
"models/face_parsing/modules/bn.py",
"models/Blending.py"
] | [
"\"\"\"\nCode adopted from pix2pixHD:\nhttps://github.com/NVIDIA/pix2pixHD/blob/master/data/image_folder.py\n\"\"\"\nimport os\nimport numpy as np\nimport torch\n\nIMG_EXTENSIONS = [\n \".jpg\",\n \".JPG\",\n \".jpeg\",\n \".JPEG\",\n \".png\",\n \".PNG\",\n \".ppm\",\n \".PPM\",\n \".bmp... | [
[
"numpy.reshape",
"numpy.load",
"torch.from_numpy"
],
[
"scipy.ndimage.gaussian_filter",
"numpy.clip",
"numpy.median",
"numpy.flipud",
"numpy.rint",
"numpy.stack",
"numpy.mean",
"numpy.floor",
"numpy.float32",
"numpy.hypot"
],
[
"torch.nn.functional.b... |
joshuakim314/bridge-robo-advisor | [
"1fd1232dfc67f08180a7a5c76b6b242dc058b9c8"
] | [
"business_logic/main.py"
] | [
"import yfinance as yf\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nimport cvxpy as cp\n\nimport efficient_frontier\nimport param_estimator\nimport objective_functions\n\n\ntickers = [\"MSFT\", \"AMZN\", \"KO\", \"MA\", \"COST\",\n \"LUV\", \"XOM\", \"PFE\", \"JPM\", \"UNH\",... | [
[
"numpy.random.normal",
"numpy.random.seed"
]
] |
akileshbadrinaaraayanan/IITH | [
"955e07af01ba2002f8efe9a4644395fc4e7a46d1"
] | [
"Sem7/CS6370_Information_Retrieval/assignment_2/part2.py"
] | [
"\"\"\"\nThis module demonstrates finding the top K,median K and least K terms\nin the inverted index based on their document frequency\n\"\"\"\nimport numpy as np\nfrom part1 import createindexes\ndef get_topk(invertedindex):\n \"\"\"\n This function outputs the top k terms with highest document frequency.\n... | [
[
"numpy.array",
"numpy.mean"
]
] |
busunkim96/dbnd | [
"0191fdcd4c4fbd35006f1026d1a55b2abab9097b"
] | [
"plugins/dbnd-test-scenarios/src/dbnd_test_scenarios/test_common/task/factories.py"
] | [
"from __future__ import absolute_import\n\nimport pandas as pd\n\nimport dbnd\n\nfrom dbnd import Config, data, output, parameter, pipeline, task\nfrom dbnd._core.current import current_task_run\nfrom dbnd.tasks import PipelineTask, PythonTask\n\n\nclass TTask(PythonTask):\n t_param = parameter.value(\"1\")\n ... | [
[
"pandas.DataFrame"
]
] |
bentaculum/gnn_agglomeration | [
"e5b8a693ba78433b8a3721ac3102630c2a79a1e4"
] | [
"gnn_agglomeration/dataset/create_embeddings_siamese.py"
] | [
"import logging\nimport torch\ntorch.multiprocessing.set_sharing_strategy('file_descriptor') # noqa\nfrom torch.utils import tensorboard\nimport numpy as np\nfrom time import time as now\nimport datetime\nimport pytz\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\nlogger.setLevel(... | [
[
"torch.utils.data.DataLoader",
"numpy.linalg.norm",
"torch.cuda.max_memory_allocated",
"numpy.iinfo",
"torch.cuda.is_available",
"numpy.array",
"torch.multiprocessing.set_sharing_strategy"
]
] |
lixuran/Room_Layout_Estimation_new | [
"8e73b66e1418675e5bb82f3780091c406fe721d8"
] | [
"misc/panostretch.py"
] | [
"import functools\nimport numpy as np\nfrom scipy.ndimage import map_coordinates\n\n\ndef uv_meshgrid(w, h):\n uv = np.stack(np.meshgrid(range(w), range(h)), axis=-1)\n uv = uv.astype(np.float64)\n uv[..., 0] = ((uv[..., 0] + 0.5) / w - 0.5) * 2 * np.pi\n uv[..., 1] = ((uv[..., 1] + 0.5) / h - 0.5) * np... | [
[
"numpy.sqrt",
"numpy.arange",
"numpy.cos",
"numpy.stack",
"numpy.sin",
"numpy.tan",
"numpy.arctan2",
"scipy.ndimage.map_coordinates",
"numpy.array",
"numpy.where"
]
] |
isabella232/spatialpandas | [
"0a4e08ecf2c9e2f69c65c627cc353d88b6cd2807"
] | [
"spatialpandas/geometry/point.py"
] | [
"import numpy as np\nfrom pandas.core.dtypes.dtypes import register_extension_dtype\nfrom spatialpandas.geometry._algorithms.intersection import segment_intersects_point, \\\n point_intersects_polygon\n\nfrom spatialpandas.geometry.base import GeometryDtype\nfrom spatialpandas.geometry.basefixed import GeometryF... | [
[
"numpy.asarray",
"numpy.isnan",
"numpy.zeros",
"numpy.any"
]
] |
ilastik/ilastik-feature-selection | [
"ffb174890c92a2be80f4335898a628f9fb344a18"
] | [
"ilastik_feature_selection/examples/filter_feature_selection_example.py"
] | [
"__author__ = 'fabian'\n\nimport ilastik_feature_selection\nfrom sklearn import datasets\nimport numpy as np\n\ndef select_features_digits():\n # loads doigits dataset form sklearn and permutes instances (otherwise they are sorted in ascending order by their\n # target label\n X = datasets.load_digits()['d... | [
[
"numpy.random.permutation",
"sklearn.datasets.load_digits"
]
] |
PerdonLiu/Visual-Privacy-Protection-via-Mapping-Distortion | [
"d618cb51e95b972c95ac94276c3038b1ce4ecb65"
] | [
"utils/attack.py"
] | [
"import torch.nn as nn\nimport torch\nimport numpy as np\nfrom tqdm import tqdm\nimport copy\n\n\n__all__ = ['PGD']\n\n\nclass PGD(object):\n def __init__(self, model=None, step_size=0.1, iters=1000):\n \"\"\"\n Attack parameter initialization. The attack performs k steps of\n size a, while ... | [
[
"torch.from_numpy",
"torch.no_grad",
"torch.nn.MSELoss",
"numpy.clip"
]
] |
ap--/opentile | [
"1a84284c5bc2c3515e14d5345b6077842897b547"
] | [
"opentile/svs_tiler.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.squeeze",
"numpy.append"
]
] |
hecmay/heterocl | [
"e91eb4841f09385f676615cd246642744d08dd7c",
"e91eb4841f09385f676615cd246642744d08dd7c"
] | [
"tests/test_runtime_build.py",
"samples/conv/conv_impl.py"
] | [
"import heterocl as hcl\nimport numpy as np\n\ndef test_basic(sdsoc):\n if not sdsoc: return\n hcl.init()\n tool = hcl.tool.sdsoc\n target = hcl.platform.zc706(tool)\n\n A = hcl.placeholder((10,))\n def kernel(A):\n return hcl.compute(A.shape, lambda x: A[x] + 1)\n s = hcl.create_schedul... | [
[
"numpy.zeros",
"numpy.random.randint"
],
[
"numpy.array",
"numpy.flip",
"numpy.zeros"
]
] |
abbasmalekpour/InventoryOptim | [
"20e0a2311d270341e91ed8af3b90f416b8efb02b"
] | [
"InventoryOptimExample/inventory.py"
] | [
"class InventoryOptim(object):\n \"\"\"\n :param df: the `DataFrame` containing data point\n :param units_costs: a list of pairs :math:`(G_i, C_i)`.\n :param date_fld: `string` the name of the column keeping each row's date\n :param start_date: `None` or `datetime`the start date of the analysis;\n ... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.multiply",
"numpy.reshape",
"numpy.power",
"matplotlib.pyplot.subplots",
"scipy.stats.t.ppf",
"numpy.random.normal",
"numpy.append",
"sklearn.linear_model.LinearRegression",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
champon1020/TRACE | [
"8ed0aed87e153af66f02502887a4de0d39867209",
"8ed0aed87e153af66f02502887a4de0d39867209"
] | [
"lib/utils_rel/net_rel.py",
"lib/combine_tree/cluster_tree3d.py"
] | [
"# Adapted by Ji Zhang in 2019\n#\n# Based on Detectron.pytorch/lib/utils/net.py written by Roy Tseng\n\nimport logging\nimport os\nimport numpy as np\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nfrom core.config import cfg\nfrom utils.net import _get_lr_change_ratio\nfro... | [
[
"numpy.asarray",
"numpy.array",
"numpy.where"
],
[
"torch.nn.functional.softmax",
"torch.cat",
"numpy.stack",
"torch.nn.LayerNorm",
"numpy.ones",
"torch.nn.Linear",
"numpy.concatenate",
"torch.mul",
"numpy.mean",
"numpy.transpose",
"torch.nn.ReLU",
"... |
lukexyz/Streamlit-Examples | [
"7fe6a921080998458e88c4d072664f5b247edb08"
] | [
"app_maps.py"
] | [
"\"\"\"\nAn example of showing geographic data.\n\nUsage: > streamlit run app_maps.py\n\"\"\"\n\nimport streamlit as st\nimport pandas as pd\nimport numpy as np\nimport altair as alt\nimport pydeck as pdk\n\nDATE_TIME = \"date/time\"\nDATA_URL = (\n \"http://s3-us-west-2.amazonaws.com/streamlit-demo-data/uber-ra... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"numpy.histogram",
"numpy.average"
]
] |
cande1gut/urlExpander | [
"04da5668ece2bcd817c5ad6c646cffea1ed17c5b"
] | [
"urlexpander/core/api.py"
] | [
"\"\"\"\nThis is the main module of the urlExpander package.\nIt houses functions to standardize urls, and extract domain names from links.\nIt also has the expand and multithread expand functions, which are the crux of this package.\n\"\"\"\n\nimport os\nimport glob\nimport json\nimport itertools\nimport datetime\... | [
[
"numpy.random.shuffle",
"numpy.random.seed"
]
] |
ryankurte/efm32-base | [
"6349c2d8203355a7ca1523572d9e58e02f54eb05"
] | [
"radio/rail_lib/tools/pa_customer_curve_fits.py"
] | [
"# /*************************************************************************//**\n# * @brief Description: Script to generate customer PA curve fits that map from\n# * power levels to actual powers for the EFR32.\n# * @details\n# * To use this file:\n# * 1. Load railtest configured to the desired PA onto... | [
[
"numpy.polyfit",
"numpy.poly1d",
"numpy.loadtxt"
]
] |
flo-compbio/monet | [
"1cb561dfa9ea64973bd5325123b9e480bffd2cb3"
] | [
"monet/visualize/heatmap.py"
] | [
"# Copyright (c) 2020, 2021 Florian Wagner\n\n# This file is part of Monet.\n\nfrom pkg_resources import resource_filename\nfrom typing import List, Tuple\nimport copy\n\nimport plotly.graph_objs as go\nimport numpy as np\n\nfrom .util import DEFAULT_PLOTLY_COLORS, DEFAULT_GGPLOT_COLORS, load_colorscale\nfrom .plot... | [
[
"numpy.atleast_2d"
]
] |
handsomeWeiye/TaobaoSpider | [
"8f358c65a8a12c55133f758a4d6a2494654ba9da"
] | [
"goods_spider.py"
] | [
"import os\r\nimport re\r\nimport json\r\nimport time\r\nimport random\r\nimport requests\r\nimport pandas as pd\r\nfrom retrying import retry\r\n\r\nfrom taobao_login import TaoBaoLogin\r\n\r\ngoodsSearchName = '零食'\r\n# 关闭警告\r\nrequests.packages.urllib3.disable_warnings()\r\n# 登录与爬取需使用同一个Session对象\r\nreq_session ... | [
[
"pandas.read_excel",
"pandas.DataFrame",
"pandas.ExcelWriter"
]
] |
HunterJ-Lin/ActiveTeacher | [
"7e15c5fa118a0b5779f44811be2be41fe2f9d169"
] | [
"tools/inference_for_active_pick.py"
] | [
"import json\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\nfrom detectron2.config import get_cfg\nfrom detectron2.engine import default_argument_parser, default_setup\nfrom detectron2.checkpoint import DetectionCheckpointer\nfrom detectron2.data.build import get_detection_dataset_dicts\nfrom... | [
[
"torch.mean",
"torch.nn.functional.softmax",
"torch.sum",
"torch.cuda.empty_cache",
"torch.log2",
"torch.no_grad",
"torch.device"
]
] |
mnemlekar/tvm | [
"2e260938db8949a6b42064cc30bac60d2a4c1629",
"2e260938db8949a6b42064cc30bac60d2a4c1629"
] | [
"python/tvm/relay/frontend/tflite.py",
"tutorials/frontend/deploy_ssd_gluoncv.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.array"
],
[
"matplotlib.pyplot.show"
]
] |
CMU-IDS-2020/a3-data-diggers | [
"470b5c5ea2db44ba5ab7f189340f16ac829d1188"
] | [
"streamlit_app.py"
] | [
"import streamlit as st\nimport pandas as pd\nimport math\nimport altair as alt\nimport numpy as np\nimport pydeck as pdk\n\nst.beta_set_page_config(layout=\"wide\")\n\n\n# Function to remove dollar from price (TBD - move to cleaning later)\ndef remove_dollar(price):\n return price.replace('$', '').replace(',', ... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.to_numeric",
"pandas.DataFrame.from_dict"
]
] |
fatihcankurnaz/LSTM-CycleGAN | [
"5f81a37ecd5fd5cad0b7b03b0153d070bb6ac47c"
] | [
"utils/models/Discriminator.py"
] | [
"import torch\nimport torch.nn as nn\n\n\n\nclass Discriminator(nn.Module):\n ## As arguments, input_size(how many items in one timestamp), hidden_size, number of lstm layers and dropout value should be given.\n def __init__(self, input_size, hidden_size, number_of_layers,dropout_value):\n super(Discrimi... | [
[
"torch.zeros",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.Linear",
"torch.rand"
]
] |
jacobbieker/Leiden-Neural-Networks | [
"457f16fe4540e11efade05ee869311886bbfa235"
] | [
"A2/1b_RNN/train_2lang.py"
] | [
"import tensorflow as tf\nfrom keras.backend.tensorflow_backend import set_session\nconfig = tf.ConfigProto()\nconfig.gpu_options.allow_growth = True\nconfig.gpu_options.visible_device_list = \"0\"\nset_session(tf.Session(config=config))\nimport Twolang_s2s_v2 as my\nfrom keras import backend as K\nimport os\n\nact... | [
[
"tensorflow.ConfigProto",
"tensorflow.Session"
]
] |
guardian-network/webapp-poc | [
"e9b2079117a52dc94b5fc5a181d1a1632ab8986c"
] | [
"src/worker/task_init.py"
] | [
"# stdlib\nimport os\nimport pickle\nimport sys\nimport time\nimport subprocess\nimport logging\n\n# third party lib\nfrom celery import current_app\nimport h5py\nimport numpy as np\nfrom plinkio import plinkfile\n\n# internal lib\nfrom client.lib import shared\nfrom lib import networking\nfrom lib.utils import wri... | [
[
"numpy.zeros",
"numpy.loadtxt",
"numpy.unique"
]
] |
KingDeng005/pycpd | [
"a2d383d5aee96b2e0fc4d5efa238efb57f8536c8"
] | [
"examples/fish_jrmpc_2D.py"
] | [
"from functools import partial\nimport matplotlib.pyplot as plt\nfrom pycpd import jrmpc_rigid\nimport numpy as np\nimport time\n\ndef visualize(iteration, error, X, Y, ax):\n plt.cla()\n ax.scatter(X[:,0] , X[:,1], color='red', label='Target')\n ax.scatter(Y[:,0] , Y[:,1], color='blue', label='Source')\... | [
[
"matplotlib.pyplot.cla",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.pause",
"numpy.loadtxt",
"matplotlib.pyplot.figure"
]
] |
anonSub2/bem | [
"2791575213ce2d64381ee3f5dd2e5428be23b960"
] | [
"src/transformers/modeling_bert.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... | [
[
"torch.nn.Softmax",
"torch.cat",
"torch.zeros",
"torch.nn.Embedding",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.from_numpy",
"torch.tensor",
"torch.arange",
"tensorflow.train.list_variables",
"torch.nn.functional.softplus",
"torch.ful... |
WindQAQ/iree | [
"68fc75cbe6e4bdf175885c17d41f4d61a55c3537",
"68fc75cbe6e4bdf175885c17d41f4d61a55c3537"
] | [
"integrations/tensorflow/e2e/finite_test.py",
"integrations/tensorflow/e2e/dynamic_mlp_test.py"
] | [
"# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed... | [
[
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.enable_v2_behavior",
"tensorflow.compat.v2.math.is_finite",
"numpy.array",
"tensorflow.compat.v2.TensorSpec"
],
[
"tensorflow.compat.v2.random.normal",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.enable_v2_beha... |
faaizT/detectron2 | [
"f14450420b3e0ca5ad97670fb0140d2c9bd8af2e"
] | [
"detectron2/modeling/backbone/fpn.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\nimport math\nimport fvcore.nn.weight_init as weight_init\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom detectron2.layers import Conv2d, ShapeSpec, get_norm\n\nfrom .backbone import Backbone\nfrom .build import BACKBONE_REGISTRY\nfro... | [
[
"torch.nn.Conv2d",
"torch.nn.functional.relu",
"torch.rand",
"torch.nn.functional.interpolate",
"torch.nn.functional.max_pool2d"
]
] |
scantu/ugali-IMF | [
"f37876f76d0fae6281d51d0da25bcec42e1df2ae"
] | [
"ugali/analysis/loglike.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nImplementation of the (log) likelihood function.\n\"\"\"\nfrom collections import OrderedDict as odict\nimport copy\nimport time\n\nimport numpy\nimport numpy as np\nfrom scipy.stats import norm\n\nimport healpy as hp\nimport fitsio\n\nimport ugali.utils.binning\nimport ugali.utils.p... | [
[
"numpy.log",
"numpy.isnan",
"numpy.arange",
"numpy.max",
"numpy.append",
"numpy.argmax",
"numpy.any",
"numpy.insert",
"numpy.array",
"numpy.zeros"
]
] |
calebmcarr/vgantf | [
"953b98b85747ca1987c395587f47e825217fdedd"
] | [
"src/encoder.py"
] | [
"'''\r\nName : encoder.py\r\nAuthor : Caleb Carr\r\nDescription : TensorFlow implementation of the Encoder in\r\n Generating Videos with Scene Dynamics from Columbia.\r\n Some liberty was taken with activation layers\r\n\r\n Very similar to generator.py... | [
[
"tensorflow.keras.models.clone_model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.Conv3DTranspose",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Reshape"
]
] |
brendanhowell/cursor | [
"81ac2e1e80f0a3ca56208b9498026fca147e7e0b"
] | [
"cursor/path.py"
] | [
"from cursor import filter as cursor_filter\n\nimport numpy as np\nimport math\nimport datetime\nimport pytz\nimport random\nimport hashlib\nimport wasabi\nimport copy\nimport typing\nimport operator\nimport time\nfrom scipy import spatial\n\n\nlog = wasabi.Printer()\n\n\nclass TimedPosition:\n def __init__(self... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.unique",
"numpy.subtract",
"numpy.arccos",
"numpy.linalg.norm",
"scipy.spatial.distance.cosine",
"numpy.count_nonzero",
"numpy.array",
"numpy.sum"
]
] |
PrashantChowdharyTcs/fast_ml | [
"d6a96e1dd388a7d7b97cda185770f7b8d94167a4"
] | [
"fast_ml/missing_data_analysis.py"
] | [
"# Missing Value Treatment\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom IPython.display import Markdown, display\nfrom fast_ml.utilities import printmd , normality_diagnostic , plot_categories , display_all, \\\n plot_categories_with_target , calcula... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
Zekhire/pcaflow | [
"75f7b8b1df1f1b2b244eb6e0377abaf8b1a5d278"
] | [
"pcaflow/solver/EMSolver2.py"
] | [
"#! /usr/bin/env python2\n\nimport numpy as np\nimport cv2\nimport sys,os\nimport time\n\nimport parameters as dp\nimport homographytools as ht\nfrom utils import pcautils\nfrom utils.cprint import cprint\n\n# For debugging\nhave_plt=False\ntry:\n from matplotlib import pyplot as plt\n have_plt=True\nexcept:\... | [
[
"matplotlib.pyplot.imshow",
"numpy.logical_xor",
"numpy.sqrt",
"sklearn.cluster.KMeans",
"numpy.round",
"numpy.zeros_like",
"numpy.argmin",
"numpy.any",
"numpy.exp",
"numpy.hstack",
"matplotlib.pyplot.gca",
"numpy.ones_like",
"numpy.arange",
"numpy.eye",
... |
alvations/USAAR-SemEval-2015 | [
"9be9add28e53d382236aff749177a794dbb9d559"
] | [
"task17-USAAR-WLV/failed-attempt/scipy_clustering.py"
] | [
"#!/usr/bin/env python -*- coding: utf-8 -*-\n\nfrom itertools import product\n\nimport numpy as np\nfrom scipy.cluster.hierarchy import linkage, dendrogram, fcluster\nimport matplotlib.pylab as plt\n\nfrom texeval import TexEval2015\n\nnd = 2\ntexeval_corpus = TexEval2015()\nsbcs = texeval_corpus.test_subcorpora\n... | [
[
"scipy.cluster.hierarchy.dendrogram",
"numpy.loadtxt",
"scipy.cluster.hierarchy.linkage",
"matplotlib.pylab.savefig",
"scipy.cluster.hierarchy.fcluster"
]
] |
Codejune/aiopyupbit | [
"52e4d65cf02decf10627168c50eae23343562db3"
] | [
"aiopyupbit/quotation_api.py"
] | [
"# !/usr/bin/python\n# -*- coding: utf-8 -*-\nimport datetime\nimport pandas as pd\nfrom pandas._libs.tslibs import Timestamp\nfrom pandas.core.frame import DataFrame\nif __name__ == \"__main__\":\n from request_api import _call_public_api\nelse:\n from .request_api import _call_public_api\n\n\ndef convert_ti... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
johagg17/ArtificialFlyingObjects | [
"86ac81f1adaae03ea67a75bd4da1fb47068bcbd5"
] | [
"utils/plot.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport re\nimport random\nimport os.path\nimport scipy.misc\nfrom PIL import Image\nfrom glob import glob\nimport scipy.io as sio\nimport torchvision\nimport itertools\nfrom matplotlib import cm\nimport math\n\nfrom . import utils\n\ndef data_distr... | [
[
"matplotlib.pyplot.imshow",
"torch.cat",
"torch.sum",
"matplotlib.pyplot.get_cmap",
"torch.unique",
"torch.split",
"numpy.trace",
"matplotlib.pyplot.tight_layout",
"matplotlib.cm.max",
"numpy.arange",
"torch.from_numpy",
"torch.tensor",
"numpy.copy",
"numpy.... |
3778/ml-challenge | [
"3f40556db801eda279e47ccb54ae287c51e3b586"
] | [
"challenge/_internal/evaluate.py"
] | [
"from . import DATA_DIR\nimport pandas as pd\nimport numpy as np\nimport sklearn.metrics as sklearn_metrics\n\n\ndef evaluate_regression(y_pred):\n \"\"\"Evaluates predictions with multiple metrics\n\n For details on metrics see\n https://scikit-learn.org/stable/modules/model_evaluation.html\n\n Args:\n... | [
[
"pandas.read_csv"
]
] |
AtmaHou/PromptSlotTagging | [
"c120b18ca94a0c3f545d96f87af19b527189afc4"
] | [
"model.py"
] | [
"from __future__ import absolute_import, division, print_function, unicode_literals\nfrom typing import List, Tuple, Dict\nimport collections\nimport json\nimport logging\nimport math\nimport os\nimport sys\nfrom io import open\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import CrossEntropyLoss\nfrom torc... | [
[
"torch.nn.CrossEntropyLoss",
"torch.cuda.set_device",
"torch.cuda.empty_cache",
"torch.tensor",
"torch.nn.Linear",
"torch.cuda.device_count"
]
] |
aan1092j/ludwig | [
"98de513c1a6b18020cdcfc694bf238a34741bfa1"
] | [
"ludwig/features/binary_feature.py"
] | [
"#! /usr/bin/env python\n# coding=utf-8\n# Copyright (c) 2019 Uber Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENS... | [
[
"tensorflow.get_variable",
"tensorflow.cast",
"tensorflow.matmul"
]
] |
madsbk/cudf | [
"552f48468df9825b4430aac57dcd65e18110b2c0"
] | [
"python/cudf/groupby/groupby.py"
] | [
"# Copyright (c) 2018, NVIDIA CORPORATION.\n\nimport numpy as np\n\nfrom numbers import Number\n\nfrom cudf.dataframe.dataframe import DataFrame\nfrom cudf.dataframe.series import Series\nfrom cudf import MultiIndex\n\nfrom cudf.bindings.groupby import (\n agg as cpp_agg,\n _apply_basic_agg as _cpp_apply_basi... | [
[
"numpy.zeros"
]
] |
awesome-archive/MLAlgorithms | [
"829c74cf7d79307fc6ca1d849e65b959fb10e5de",
"823569da234bf4c64928049d0138b83d9fc5304f"
] | [
"mla/svm/kernerls.py",
"mla/neuralnet/parameters.py"
] | [
"import numpy as np\nimport scipy.spatial.distance as dist\n\n\nclass Linear(object):\n def __call__(self, x, y):\n return np.dot(x, y.T)\n\n def __repr__(self):\n return 'Linear kernel'\n\n\nclass Poly(object):\n def __init__(self, degree=2):\n self.degree = degree\n\n def __call__... | [
[
"numpy.dot",
"numpy.atleast_2d",
"scipy.spatial.distance.cdist"
],
[
"numpy.zeros_like",
"numpy.prod",
"numpy.full"
]
] |
ilias1111/messenger-history | [
"8e3632553827e2ff627f3e3924c752c2c62d7645"
] | [
"data_transform.py"
] | [
"import os\nimport glob\nimport json\nimport help_functions\nimport re\nimport pandas as pd\nimport data_manipulation\n\n\ndef name_exporter(folder_loc):\n \"\"\"Gives us the name of the chat participant\n\n Parameters\n ----------\n file_loc : str\n The file location of the json\n\n Returns\n... | [
[
"pandas.json_normalize",
"pandas.DataFrame"
]
] |
Kevin-Chen0/pommerman-playground | [
"af673e1b05dea970a4a763ab0512cc5051330dde"
] | [
"train.py"
] | [
"import pommerman\nfrom pommerman.agents import DullAgent, SimpleAgent\nfrom pommerman.agents.dqn import DQNAgent\nfrom pommerman.agents.ddpg import DDPGAgent\nfrom pommerman.agents.td3 import TD3Agent\nfrom collections import deque\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport t... | [
[
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"numpy.mean",
"torch.save",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
tgandor/pol_eval_2019_2 | [
"43300d91c1c2109cc21d1cfd4fa68cdb87065d7e"
] | [
"evaluate.py"
] | [
"from __future__ import print_function\nfrom __future__ import division\n\nimport argparse\nimport os.path as p\n\n# External\nimport attr\n\ndata_dir = p.join(p.dirname(__file__), '_data')\n\n\n@attr.s\nclass Phrase(object):\n phrase_id = attr.ib()\n document_id = attr.ib()\n original = attr.ib()\n lem... | [
[
"matplotlib.pyplot.pie",
"matplotlib.pyplot.show"
]
] |
Dinuda/ImageStore | [
"c95d9da4b5dd6336c531e73d50b6a924ac04cc0c"
] | [
"detectron2/src/classification/model.py"
] | [
"import numpy as np\nfrom PIL import Image\nimport sys\nimport os\nimport torch\n\nimport detectron2.utils.comm as comm\nfrom detectron2.checkpoint import DetectionCheckpointer\nfrom detectron2.data import build_detection_test_loader, build_detection_train_loader\nfrom detectron2.config import get_cfg\nfrom detectr... | [
[
"torch.zeros",
"torch.set_grad_enabled",
"torch.nonzero",
"torch.where",
"torch.argsort",
"numpy.array"
]
] |
lfzarazuaa/LiderSeguidor | [
"e6c7b4bc84f4933fc73df9e3e019cb55646d6a2c"
] | [
"esquema_lider_seguidor/src/Codigos_para_generacion_de_trayectorias/Generacion_de_puntos_de_trayectoria/Generar_puntos_por_ecuacion_cartesiana.py"
] | [
"#!/usr/bin/env python2\n# encoding: utf-8\nimport numpy as np\nimport path_parser\nimport matplotlib.pyplot as plt\nimport os\nnombre_de_archivo_de_salida='Trayectoria2'#Nombre del Archivo generado.\n\ndef GuardarArchivo(nombre):\n xr,yr=puntos#Puntos a guardar.\n npuntos=len(xr)#Número de puntos.\n ruta=... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.scatter",
"numpy.arange",
"numpy.sin",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ioff",
"numpy.concatenate",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
]
] |
TejaAmbati-02/Cotton-Disease-Prediction | [
"69fcf425616991fd92a56fdad45ac264bb803043"
] | [
"app.py"
] | [
"# -*- coding: utf-8 -*-\r\n\r\n\r\nfrom __future__ import division, print_function\r\n# coding=utf-8\r\nimport sys\r\nimport os\r\nimport glob\r\nimport re\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport tensorflow as tf\r\n\r\nfrom tensorflow.compat.v1 import ConfigProto\r\nfrom tensorflow.compat.v1 im... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.compat.v1.ConfigProto",
"numpy.expand_dims",
"tensorflow.keras.preprocessing.image.load_img",
"numpy.argmax",
"tensorflow.compat.v1.InteractiveSession",
"tensorflow.keras.preprocessing.image.img_to_array"
]
] |
CJWBW/knowbert | [
"fb93a735936bd93d12c1863d9bc4722adc0e8d08",
"fb93a735936bd93d12c1863d9bc4722adc0e8d08",
"fb93a735936bd93d12c1863d9bc4722adc0e8d08"
] | [
"tests/test_dict_field.py",
"tests/evaluation/test_semeval2010_task8.py",
"tests/test_bert_pretraining_reader.py"
] | [
"\r\nimport numpy as np\r\n\r\nfrom allennlp.data import Token, Vocabulary\r\nfrom allennlp.data.fields import TextField, ListField, ArrayField, SpanField\r\nfrom allennlp.data.token_indexers import SingleIdTokenIndexer\r\nfrom allennlp.data.tokenizers import WordTokenizer\r\nfrom allennlp.data.tokenizers.word_spli... | [
[
"numpy.array",
"torch.tensor"
],
[
"torch.tensor"
],
[
"numpy.random.seed",
"torch.tensor"
]
] |
gamasenninn/ichiren | [
"1701aee4f2ec953617dea1a6396454098e6a9848"
] | [
"make_html/MakeHTML_sqlite.py"
] | [
"#-------------------------------------------------------------------------------\n# Name: DBファイルからHTMLを作成\n# Purpose:\n#\n# Author: Satoshi Ono\n#\n# Created: 26/03/2020\n# Copyright: (c) FMVA1602FP 2020\n# Licence: MIT\n#-----------------------------------------------------------------------... | [
[
"pandas.read_sql"
]
] |
w4356y/House_price | [
"e2a0e35ece1342753691dfec184de345224e4e25"
] | [
"anjuke_test.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 6/21/2020 2:55 PM\n# @Author : Wei Jiang\n# @FileName: anjuke_test.py\n# @Software: PyCharm\n# @Github : https://github.com/w4356y/House_price.git\nimport time\nimport requests\nimport random\n#import pymysql\nfrom parsel import Selector\nfrom lxml import etree\nimport panda... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
lm2-poly/OpenFiberSeg | [
"0dbe27158a13b0ef9247e7353d3b2e651a545852"
] | [
"combineFunctions.py"
] | [
"# by Facundo Sosa-Rey, 2021. MIT license\n\nimport numpy as np\nimport os\nimport pickle\nimport time\n\nfrom joblib import Parallel, delayed \nimport multiprocessing\n\nfrom tifffile import TiffFile\nfrom matplotlib import pyplot as plt\n\nfrom fibers import fiberObj\nfrom extractCenterPoints import getTiffPr... | [
[
"numpy.unique",
"matplotlib.pyplot.get_cmap",
"numpy.ones",
"numpy.max",
"numpy.array",
"numpy.logical_and",
"numpy.where",
"numpy.zeros"
]
] |
cedricvincentcuaz/srGW | [
"c08a5aa3b1bea214105b145a10efb3783c9f8103"
] | [
"srGW_algorithms/srFGW_dictionary_learning.py"
] | [
"\"\"\"\n@author: cvincentcuaz\n\nTorch implementation of semi-relaxed Gromov-Wasserstein dictionary learning,\ndetailed in section 4 of the main paper. Also contains the srgw completion framework\ndetailed in this latter section.\n\nIt Supports all kinds of regularization for solving the unmixing problem\ndetailed... | [
[
"torch.all",
"torch.ones",
"numpy.random.seed",
"torch.zeros",
"torch.cat",
"torch.manual_seed",
"sklearn.cluster.KMeans",
"numpy.arange",
"torch.zeros_like",
"torch.sqrt",
"torch.tensor",
"numpy.random.normal",
"numpy.mean",
"torch.diag",
"numpy.random.... |
shilad/wmf-embeddings | [
"353556dfbb36e1f70eec7e618cfd989d7ae08de5"
] | [
"wmf_embed/train/hybrid_vectors.py"
] | [
"\nimport logging\nimport numpy as np\nimport os.path\nimport scipy.linalg\nimport scipy.spatial.distance\nimport sys\nfrom sklearn.decomposition import TruncatedSVD\n\nfrom wmf_embed.core.utils import nearest_neighbors\nfrom wmf_embed.train.neighbor_graph import NeighborGraph\nfrom wmf_embed.core.titler import Tit... | [
[
"numpy.concatenate",
"numpy.average",
"sklearn.decomposition.TruncatedSVD",
"numpy.sum"
]
] |
antoinecollas/transformer_neural_machine_translation | [
"2e27796388c16ac57424015842907ec8d607869b"
] | [
"transformer/decoder.py"
] | [
"import torch\nimport torch.nn as nn\nfrom transformer.layers import MultiHeadAttention, PositionWiseFeedForward, get_mask\n\n# torch.manual_seed(1)\n\nclass Decoder(nn.Module):\n def __init__(self, nb_layers=6, nb_heads=8, d_model=512, nb_neurons = 2048, dropout=0.1):\n super(Decoder, self).__init__()\n ... | [
[
"torch.Tensor"
]
] |
zouguojian/Traffic-flow-prediction | [
"df119921f4f58ca227ab6f7e571003b8cbd5199d"
] | [
"MT-STNet/baseline/astgat/data_next.py"
] | [
"# -- coding: utf-8 --\nimport tensorflow as tf\nimport numpy as np\nimport argparse\nfrom baseline.astgat.hyparameter import parameter\nimport pandas as pd\n\nclass DataClass(object):\n def __init__(self, hp=None):\n '''\n :param hp:\n '''\n self.hp = hp ... | [
[
"tensorflow.Session",
"pandas.read_csv",
"tensorflow.data.Dataset.from_generator"
]
] |
chrisfilippis/models | [
"df98ff0011a009694e72000b12c9ee4b21d7b659",
"df98ff0011a009694e72000b12c9ee4b21d7b659"
] | [
"research/deeplab/datasets/build_tooth_data.py",
"official/vision/image_classification/imagenet_preprocessing.py"
] | [
"# Lint as: python2, python3\n# 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/L... | [
[
"tensorflow.gfile.GFile",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.app.run"
],
[
"tensorflow.concat",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.minimum",
"tensorflow.image.decode_and_crop_jpeg",
"tensorflow.image.... |
marcusfrancis/cartpole-bot | [
"009dede4a7551501b2817eafc8765a9060e33161"
] | [
"venv/lib/python3.6/site-packages/imageio/plugins/pillowmulti.py"
] | [
"\"\"\"\nPIL formats for multiple images.\n\"\"\"\n\nimport sys\nimport numpy as np\n\nfrom .pillow import PillowFormat, ndarray_to_pil, image_as_uint\n\n\nNeuQuant = None # we can implement this when we need it\n\n\nclass TIFFFormat(PillowFormat):\n _modes = 'i' # arg, why bother; people should use the tiffil... | [
[
"numpy.log2",
"numpy.abs"
]
] |
pranavmodx/aiida-core | [
"0edbbf82dfb97ab130914d1674a6f2217eba5971"
] | [
"tests/cmdline/commands/test_data.py"
] | [
"# -*- coding: utf-8 -*-\n###########################################################################\n# Copyright (c), The AiiDA team. All rights reserved. #\n# This file is part of the AiiDA code. #\n# ... | [
[
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.