repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
qf6101/preprocess_tabular_data | [
"8c2a2064d0be175b4d4ae68bd6c5b6874b009067"
] | [
"auto_inspect/funcs.py"
] | [
"import math\nfrom datetime import datetime\nimport numpy as np\nfrom typing import Tuple, Optional, List, Set, Dict\nfrom pandas import Series, DataFrame\nimport ruamel.yaml as yaml\n\n\ndef inspect_dtype(col: Series, predefined_dtype=None) -> Tuple[str, bool]:\n dtype = 'int'\n all_missing = False\n all_... | [
[
"numpy.array",
"numpy.isnan",
"numpy.mean",
"numpy.log1p",
"numpy.std"
]
] |
empyriumz/QAS_RL | [
"1f44f46acd9e61a8ed501cc7f0462c7217f46316"
] | [
"utils.py"
] | [
"import configparser\nimport numpy as np\nfrom chemical_hamiltonians import (\n qiskit_LiH_chem,\n qiskit_H2_chem,\n paulis2matrices,\n)\nimport json\nfrom itertools import product\n\n\ndef gen_hamiltonian(num_qubits, conf, taper=True, exact_en=False):\n if conf[\"ham_type\"] == \"LiH\":\n paulis... | [
[
"numpy.sum",
"numpy.savez",
"numpy.linalg.eig"
]
] |
artidoro/cnn-dailymail | [
"ab5b87e267e9a289cbcf2127753edeb8080a0380"
] | [
"chain_extractor_xsum/process_labels.py"
] | [
"import sys\nimport os\nimport hashlib\nimport struct\nimport subprocess\nimport collections\nimport tensorflow as tf\nfrom tensorflow.core.example import example_pb2\n\ndm_single_close_quote = '\\u2019' # unicode\ndm_double_close_quote = '\\u201d'\nEND_TOKENS = ['.', '!', '?', '...', \"'\", \"`\", '\"', dm_single... | [
[
"tensorflow.core.example.example_pb2.Example"
]
] |
matthew-viglione/py-wordle | [
"d786c8aa90bd11686bfa749e639253db25cba88c"
] | [
"solver_and_stats.py"
] | [
"\"\"\"Do some fun analytics on the wordle word sets\"\"\"\n\nimport string\nimport matplotlib.pyplot as plt\n\nfrom colorama import init\n\ninit()\n\n\nclass Colors:\n \"\"\"Colors class:reset all colors with colors.reset; two\n sub classes fg for foreground\n and bg for background; use as colors.subclass... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
skumailraza/FRSNet-GA | [
"a1fdf5c84fe0af16b6ec5867f7b5b20abd522656"
] | [
"models/GANet_ms.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nfrom libs.GANet.modules.GANet import DisparityRegression, GetCostVolume\nfrom libs.GANet.modules.GANet import MyNormalize\nfrom libs.GANet.modules.GANet import SGA\nfrom libs.GANet.modules.GANet import LGA, LGA2, LGA3\n# from libs.sync_bn.modules.s... | [
[
"torch.nn.functional.normalize",
"torch.nn.Dropout",
"torch.cat",
"torch.arange",
"torch.nn.init.constant_",
"torch.sub",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.squeeze",
"torch.nn.functional.grid_sample",
"torch.nn.Conv3d",
... |
SjoerdCor/micplot | [
"ff0ec25c8fc8840dfcecef919f7639ef0600d4e3"
] | [
"visualization.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nThis modules contains all necessary elements to make an effective plot, primarily\nthrough the `visualize` function, which is a wrapper around the Visualization class\n\nBy using `visualize(data)`, where data is a pandas Series or pandas DataFrame,\nthe user receives a Visualizatio... | [
[
"matplotlib.pyplot.subplots",
"pandas.api.types.is_integer_dtype"
]
] |
ddehueck/dynaml-lib | [
"64313349ecad0d93d67968a541cf54541ea1009b"
] | [
"dynaml_lib/experiment.py"
] | [
"import networkx as nx\nimport numpy as np\nimport json\n\n\"\"\" \nA class for an experiment within our simulated social network environment.\n\nArguments:\n N (int): the number of nodes in the graph\n agent_probs: list of probabilities for each agent type\n\n\"\"\"\n\n\nclass Experiment:\n def __init__... | [
[
"numpy.identity",
"numpy.random.rand",
"numpy.random.choice",
"numpy.zeros"
]
] |
JunHyun-DS/pandas_testcode | [
"6db3f538f670862f9d22648eb4956cc6194d9c2f"
] | [
"pandas_test3.py"
] | [
"import numpy as np\nimport pandas as pd\n\n## 경로\ndata_path = 'C:\\\\Users\\\\bbjjh\\\\OneDrive\\\\바탕 화면\\\\파이썬 스터디\\\\판다스과제\\\\남북한발전전력량.xlsx'\nnewData_path = 'C:\\\\Users\\\\bbjjh\\\\OneDrive\\\\바탕 화면\\\\파이썬 스터디\\\\판다스과제\\\\남북한발전전력량2.xlsx'\n\n## excel파일 읽어오기\ndf = pd.read_excel(data_path)# XlsxWriter 엔진으로 Pandas ... | [
[
"pandas.read_excel",
"pandas.ExcelWriter",
"pandas.concat"
]
] |
LishudaNoBug/learning_PyTorch | [
"1026035a9cb3d70e2fe97363b532e63db3ca136d"
] | [
"tutorial-contents/301_regression.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport matplotlib.pyplot as plt\n\n\"\"\"\n 训练回归模型(初级)\n 回归理解为: 对于任意输入有y对应,且y是连续的,形成一条连续的函数图像??\n\"\"\"\n\nx = torch.unsqueeze(torch.linspace(-1, 1, 100),1) # torch.linspace(-1, 1, 100)是-1~1之间取100个数。 unsqueeze是将一维的数处理成二维。因为torch只能处理二维的数,所以这里就变成了(100,1)的数。\... | [
[
"torch.nn.Linear",
"matplotlib.pyplot.ion",
"torch.nn.MSELoss",
"torch.linspace",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.show",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.ioff",
"torch.nn.functional.tanh"
]
] |
tynguyen/frankmocap | [
"c09e560aa7315e4f94b725cc41417e7de5f6ed4f"
] | [
"mocap_utils/demo_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport os, sys, shutil\nimport os.path as osp\nimport cv2\nfrom collections import OrderedDict\nimport mocap_utils.general_utils as gnu\nimport numpy as np\nimport json\nimport subprocess as sp\n\n\ndef setup_render_out(out_dir):\n if out_dir is not None:\n ... | [
[
"numpy.array"
]
] |
AlbertoRoper/GW_turbulence | [
"758be3b86f21c37ceb6f8405c98890069264da24"
] | [
"JCAP_2107_05356/generate_plots_interferometry.py"
] | [
"\"\"\"\ngenerate_plots_interferometry.py is a Python routine\nto generate the plots of Appendix B (LISA and Taiji interferometry)\nof A. Roper Pol, S. Mandal, A. Brandenburg, and T. Kahniashvili,\n\"Polarization of gravitational waves from helical MHD turbulent sources\",\nhttps://arxiv.org/abs/2107.05356.\n\"\"\"... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.xlim",
"numpy.sign",
"numpy.where",
"pandas.read_csv",
"numpy.logspace",
"matplotlib.pyplot.savefig",
"numpy.interp",
"matplotlib.pyplot.subplots",
"numpy.trapz",
"numpy.sqrt",
"matplotlib.pyplot.gca",
"numpy.log10",
... |
valeoai/QuEST | [
"02a23d2d8e0d059b4a30433f92eec5db146467f4"
] | [
"distillation/architectures/feature_extractors/wide_resnet.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport distillation.architectures.tools as tools\n\n\"\"\"\nOriginal Author: Wei Yang\n\"\"\"\n\n__all__ = ['wrn']\n\n\nclass BasicBlock(nn.Module):\n def __init__(self, in_planes, out_planes, stride, dropRate=0.0):\n supe... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.functional.dropout",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.randn"
]
] |
danicaxiao/LSTMVis | [
"80c8271fe2a6ac898dcf9a75f0d52a31fef47568"
] | [
"tools/txt_to_hdf5_dict.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nTakes a .txt file with the source data for the trained model and\ncreates the sparse word indices as well as a dictionary that maps\nthe word indices to the actual words. \nTo transform into validation and test with the same dictionary, \nuse model/preprocess.py\n\nUsage: python tx... | [
[
"numpy.array"
]
] |
peter0749/PointNetGPD | [
"5e2be543057657f1faaef87e80074d392823e5df"
] | [
"meshpy/tools/convert_image_to_obj.py"
] | [
"\"\"\"\nScript to convert a directory of 3D models to .OBJ wavefront format for use in meshpy using meshlabserver.\nAuthor: Jeff Mahler\n\"\"\"\nimport argparse\nimport logging\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport sys\n\nimport autolab_core.utils as utils\nfrom perception import ... | [
[
"numpy.savetxt"
]
] |
zl3311/COVID_prediction_US | [
"c41a40a259383305a5a04f019769252163fc09cf"
] | [
"covid_api/web/app.py"
] | [
"from flask import Flask, jsonify, request\nfrom flask_restful import Api, Resource\nimport pandas as pd\nimport numpy as np\nimport pickle\nimport datetime\nfrom statsmodels.tsa.api import STLForecast\nfrom statsmodels.tsa.ar_model import AutoReg\nimport tensorflow.compat.v1 as tf\ngraph = tf.get_default_graph()\n... | [
[
"pandas.DataFrame.from_dict",
"tensorflow.compat.v1.get_default_graph",
"numpy.mean"
]
] |
jvrana/pyro-graphnets | [
"a346324e77f20739e00a82f97530dda4906f59dd"
] | [
"caldera/blocks/select.py"
] | [
"import torch\n\n\nclass Select(torch.nn.Module):\n \"\"\"Differentiable select block.\"\"\"\n\n def __init__(self, input_size: int, output_size: int):\n super().__init__()\n self.blocks = torch.nn.Sequential(\n torch.nn.Linear(input_size, output_size), torch.nn.Sigmoid()\n )\n... | [
[
"torch.nn.Linear",
"torch.round",
"torch.nn.Sigmoid"
]
] |
text-machine-lab/dark-secrets-of-BERT | [
"c413ebea2f2f79d9cb8f0dd5f380c9993e4fae81"
] | [
"examples/run_classifier.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.distributed.get_world_size",
"torch.utils.data.RandomSampler",
"scipy.stats.pearsonr",
"torch.cuda.is_available",
"sklearn.metrics.f1_score",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel",
"torch.distributed.init_process_group",
"torch.manual_seed",
"torch.ten... |
ratnadeepb/LinearAlgebra | [
"0f4399c15ba12a3e7c0e2a796c77efa66520e462"
] | [
"InnerProductSpaces/Examples/matspace.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 25 16:13:40 2017\n\n@author: ratnadeepb\n@License: MIT\n\"\"\"\n\n'''\nSquare matrices (n x n) are also vector space where an inner product can \nbe defined.\n\nIn M2,2 space let:\n A = [[a11, a21], [a12, a22]]\n B = [[b11, b21], [b1... | [
[
"numpy.array"
]
] |
dailysergey/dlcourse_ai | [
"ee6a5cd19de4e02420573a959b7b8ade2672f3a5"
] | [
"assignments/assignment1/metrics.py"
] | [
"import numpy as np\n\ndef binary_classification_metrics(prediction, ground_truth):\n '''\n Computes metrics for binary classification\n\n Arguments:\n prediction, np array of bool (num_samples) - model predictions\n ground_truth, np array of bool (num_samples) - true labels\n\n Returns:\n prec... | [
[
"numpy.sum"
]
] |
davisan/PRNUPythonColab | [
"0cd2ff9ffa894034557d893e8f8a1617d4c2f566"
] | [
"src/Filter.py"
] | [
"\"\"\"\nPlease read the copyright notice located on the readme file (README.md). \n\"\"\"\nimport cv2 as cv\nimport numpy as np\nfrom scipy import signal\nimport PRNUPythonColab.src.Functions as Fu\n\n\ndef Threshold(y, t):\n \"\"\"\n Applies max(0,y-t).\n\n Parameters\n ----------\n y : numpy.ndar... | [
[
"numpy.divide",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.minimum",
"numpy.ones",
"numpy.convolve",
"numpy.power",
"numpy.ndim",
"numpy.flip",
"numpy.maximum"
]
] |
pdhung3012/Text-Classification-Pytorch | [
"e2f4e0de9469d9966305ab2ecf9ce1b4db3660f2"
] | [
"LSTM_3.py"
] | [
"\"\"\"\nText classification with the torchtext library\n==================================\nIn this tutorial, we will show how to use the torchtext library to build the dataset for the text classification analysis. Users will have the flexibility to\n - Access to the raw data as an iterator\n - Build data proc... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.EmbeddingBag",
"torch.optim.lr_scheduler.StepLR",
"torch.no_grad",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss"
]
] |
Mojusko/sensepy | [
"550a15859791799db5aba93580913317c1905b2e"
] | [
"sensepy/capture_ids.py"
] | [
"import torch\nimport matplotlib.pyplot as plt\nfrom stpy.borel_set import BorelSet,HierarchicalBorelSets\nfrom stpy.kernels import KernelFunction\nfrom typing import Callable, Type, Union, Tuple, List\nfrom stpy.point_processes.poisson_rate_estimator import PoissonRateEstimator\nfrom stpy.point_processes.poisson.p... | [
[
"torch.cat",
"numpy.array",
"numpy.argmin",
"scipy.optimize.minimize_scalar",
"numpy.random.uniform"
]
] |
Tajnymag/vsb-pai-game-of-life | [
"f0e19d96bd948a0507d5bf5cd0fd42bb1f22ea71"
] | [
"gol-py/src/gol.py"
] | [
"from numpy.typing import NDArray\n\nimport numpy as np\nfrom scipy.ndimage import convolve\n\n\ndef evolve_cells(board: NDArray[bool]) -> NDArray[bool]:\n kernel = [\n [1, 1, 1],\n [1, 0, 1],\n [1, 1, 1]\n ]\n\n neighbors = convolve(input=np.array(board).astype(int), weights=kernel, m... | [
[
"numpy.logical_not",
"numpy.array"
]
] |
sjfleming/pyro | [
"c8dc40a75cc4ff1f43c6ff9178d91c08155d7973",
"c8dc40a75cc4ff1f43c6ff9178d91c08155d7973",
"eadca9c9ed9654573037acdf4f48b34ea40037fe"
] | [
"pyro/infer/autoguide/guides.py",
"pyro/optim/optim.py",
"examples/contrib/epidemiology/regional.py"
] | [
"# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"\nThe :mod:`pyro.infer.autoguide` module provides algorithms to automatically\ngenerate guides from simple models, for use in :class:`~pyro.infer.svi.SVI`.\nFor example to generate a mean field Gaussian guide::\n\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.distributions.biject_to",
"torch.linalg.cholesky",
"torch.stack",
"torch.no_grad",
"torch.full_like",
"torch._C._get_tracing_state",
"torch.tensor",
"torch.broadcast_shapes",
"torch.zeros_like"
],
[
"torch.nn.utils.clip_gra... |
Royzon/JDE | [
"76258ffbfc51d20ebdd2a1fc152a91fe43a12f1c"
] | [
"towts.py"
] | [
"import os\nimport torch\nimport struct\nimport argparse\nimport collections\nimport numpy as np\nimport torch.onnx as onnx\nimport onnxruntime as ort\n\nimport darknet\nimport shufflenetv2\n\nif __name__ == '__main__':\n # parse arguments from command line\n parser = argparse.ArgumentParser(\n descrip... | [
[
"torch.rand",
"numpy.random.randint",
"torch.onnx.export",
"torch.load"
]
] |
bbadass/qmpy | [
"e2fd0015e4f2786e1cca185b616e679c3dcb2114"
] | [
"qmpy/web/views/data/references.py"
] | [
"import numpy as np\n\nimport matplotlib\n\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nfrom io import BytesIO\nimport urllib\nimport base64\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\n\nfrom ..tools import get_globals\nfrom qmpy.models import Author, ... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel"
]
] |
AliMuhammadOfficial/tf-quant-finance | [
"31863c907bf561cb86551b785c1aed947303590d"
] | [
"tf_quant_finance/experimental/svi/parameterizations.py"
] | [
"# Lint as: python3\n# Copyright 2021 Google LLC\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 applicab... | [
[
"tensorflow.compat.v2.name_scope",
"tensorflow.compat.v2.sqrt",
"tensorflow.compat.v2.convert_to_tensor"
]
] |
Ahnkyuwon504/Poly_AI | [
"a3e15c93056e3701967bb606b3f48b0fb306d4e2"
] | [
"testPythonProject1/singleiTest.py"
] | [
"#####################################\n# 학습 모듈 선언\n#####################################\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n#####################################\n# 환경설정\n#####################################\n# 훈련용 데이터 수 선언\ntrainDataNumber = 100\n# 모델 최적화를 위한 학습률 선언\... | [
[
"tensorflow.compat.v1.placeholder",
"numpy.random.normal",
"tensorflow.compat.v1.global_variables_initializer",
"numpy.random.seed",
"tensorflow.compat.v1.train.GradientDescentOptimizer",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotl... |
dli-invest/fin_news_nlp | [
"a7d18348f6cf6ebde3ff0f964d73d4ce5117ea4a"
] | [
"scrappers/get_tickers.py"
] | [
"\"\"\"\n Grab stocks from cad tickers \n\"\"\"\nimport pandas as pd\n\n\nclass TickerControllerV2:\n \"\"\"\n Grabs cad_tickers dataframes and normalized them\n \"\"\"\n\n def __init__(self, cfg: dict):\n \"\"\"\n Extract yahoo finance tickers from website\n Consider using hardcod... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
Sharmadisha1608/Machine-Learning | [
"b3d43b417d553c5a7f56b8c88dd5e01aa6fd9a13"
] | [
"face_answer.py"
] | [
"import cv2\r\nimport numpy as np\r\nimport os\r\ndef distance(v1,v2):\r\n return np.sqrt(((v1-v2)**2).sum())\r\ndef knn(train,test,k=5):\r\n dist=[]\r\n for i in range(train.shape[0]):\r\n ix=train[i,:-1]\r\n iy=train[i,-1]\r\n d=distance(test,ix)\r\n dist.append([d,iy])\r\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.ones",
"numpy.load",
"numpy.argmax",
"numpy.unique"
]
] |
ScienceStacks/MicrobEPy | [
"704435e66c58677bab24f27820458870092924e2"
] | [
"microbepy/tests/model/test_cv_model.py"
] | [
"from microbepy.common import constants as cn\nfrom microbepy.common import helpers\nfrom microbepy.common import util\nfrom microbepy.data import util_data as ud\nfrom microbepy.model.cv_regression import CVLinearRegression\nfrom microbepy.model.group_splitter import GroupSplitter\n\nimport numpy as np\nimport pan... | [
[
"pandas.DataFrame"
]
] |
MeriemSebai/MaskMitosis | [
"b61dea7dbadd3e0420464a626b4b55dc2dc83aff"
] | [
"Mitosis12_segmentation_unsup/labels_generation.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 22 20:42:31 2018\n\n@author: meriem\n\"\"\"\nimport os\nimport pickle\nimport numpy as np\nimport math\nfrom PIL import Image\nimport matplotlib\nfrom matplotlib import pyplot as plt\nimport matplotlib.cm as cm\nfrom shutil import copyfile... | [
[
"numpy.max",
"numpy.zeros",
"numpy.nonzero",
"scipy.ndimage.measurements.label",
"numpy.argmax",
"numpy.unique"
]
] |
jsubercaze/iot-tweet-search-engine | [
"731fe1aed1da40cab7cb183210ff3fe1e6491097"
] | [
"user.py"
] | [
"import os\n\nimport networkx as nx\nimport numpy as np\n\nfrom definitions import ROOT_DIR\nfrom parser import Parser\nfrom prediction_profile import PredictionProfile\nfrom topics_classifier import TopicsClassifier\n\n\nclass User:\n\tuser_fname = os.path.join(ROOT_DIR, 'saved_models/users_profile.tsv')\n\tauthor... | [
[
"numpy.asarray",
"numpy.zeros"
]
] |
lukasjarzembowski/Fura2-Calcium-Analysis | [
"f3c58ad0ab5151d5886b23a4a2d57c7f01ef5a3c"
] | [
"calciumfunctions.py"
] | [
"import os\nimport pandas as pd\nfrom scipy import stats\nimport dabest\nimport dask.dataframe as dd\n\ndef importrawdata(folderpath, runtime=None, dropcolumns=None, folder=True, name=None):\n #declare an empty dataframe and list for filenames\n targetdf = pd.DataFrame()\n files = []\n\n\n if folder is ... | [
[
"pandas.isna",
"pandas.merge",
"pandas.concat",
"pandas.DataFrame",
"pandas.read_excel",
"scipy.stats.linregress",
"numpy.arange",
"pandas.ExcelWriter",
"sklearn.metrics.auc",
"pandas.melt",
"numpy.unique"
]
] |
riadnassiffe/Simulator | [
"7d9ff09f26367d3714e3d10be3dd4a9817b8ed6b"
] | [
"src/tools/ecos/cvxpy/cvxpy/atoms/norm1.py"
] | [
"\"\"\"\nCopyright 2013 Steven Diamond\n\nThis file is part of CVXPY.\n\nCVXPY is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nCVXP... | [
[
"numpy.linalg.norm"
]
] |
FlopsKa/StreamDatasets-1 | [
"32a27c079dc70d5cf0009717851ebe207f05524c"
] | [
"changeds/datastreams.py"
] | [
"import os\r\n\r\nimport pandas as pd\r\nfrom sklearn.preprocessing import LabelEncoder\r\nfrom tensorflow import keras\r\nimport numpy as np\r\n\r\nfrom skmultiflow.data import led_generator, random_rbf_generator\r\n\r\nfrom changeds.abstract import ChangeStream, RegionalChangeStream, ClassificationStream, RandomO... | [
[
"numpy.concatenate",
"tensorflow.keras.datasets.cifar10.load_data",
"numpy.array",
"tensorflow.keras.datasets.mnist.load_data",
"sklearn.preprocessing.LabelEncoder",
"tensorflow.keras.datasets.fashion_mnist.load_data",
"tensorflow.keras.datasets.cifar100.load_data",
"numpy.diff",
... |
mawanda-jun/numba | [
"3d688932f919dbf5821f0cb8a210ce24abe39e9e",
"8c6658375c1f8fe50e1a5ccd11d4e7bf5a8053de"
] | [
"numba/tests/test_parfors_caching.py",
"numba/tests/test_dictobject.py"
] | [
"from __future__ import print_function, absolute_import, division\n\nimport os.path\n\nimport numpy as np\n\nfrom .support import skip_parfors_unsupported\nfrom .test_dispatcher import BaseCacheUsecasesTest\n\n\n@skip_parfors_unsupported\nclass TestParForsCache(BaseCacheUsecasesTest):\n here = os.path.dirname(__... | [
[
"numpy.ones"
],
[
"numpy.int8",
"numpy.random.seed",
"numpy.arange",
"numpy.intp",
"numpy.uint64",
"numpy.random.random",
"numpy.int32"
]
] |
jsilter/transformers | [
"d99ed7ad618037ae878f0758157ed0764bd7f935"
] | [
"src/transformers/file_utils.py"
] | [
"\"\"\"\nUtilities for working with the local dataset cache.\nThis file is adapted from the AllenNLP library at https://github.com/allenai/allennlp\nCopyright by the AllenNLP authors.\n\"\"\"\n\nimport fnmatch\nimport json\nimport os\nimport re\nimport shutil\nimport sys\nimport tarfile\nimport tempfile\nfrom colle... | [
[
"torch.hub._get_torch_home"
]
] |
neurospin/nipy | [
"cc54600a0dca1e003ad393bc05c46f91eef30a68"
] | [
"nipy/core/reference/spaces.py"
] | [
"\"\"\" Useful neuroimaging coordinate map makers and utilities \"\"\"\n\nimport numpy as np\n\nfrom .coordinate_system import CoordSysMaker\nfrom .coordinate_map import CoordMapMaker\nfrom ..transforms.affines import from_matrix_vector\n\nscanner_names = ['scanner-' + label for label in 'xyz'] + ['t']\nmni_names =... | [
[
"numpy.allclose",
"numpy.argsort",
"numpy.zeros"
]
] |
nanohop/keras_neural_network | [
"b0eed70c1c8d0f09eb03b72a3ed2acf8ba7465a1"
] | [
"train_sample_data.py"
] | [
"from keras.models import Sequential\nfrom keras.layers import Dense\n\nimport numpy as np\n\nmodel = Sequential()\n\n# 10.5, 5, 9.5, 12 => 18.5\n\nmodel.add(Dense(8, activation='relu', input_dim=4))\nmodel.add(Dense(16, activation='relu'))\nmodel.add(Dense(8, activation='relu'))\nmodel.add(Dense(1, activation='lin... | [
[
"numpy.array"
]
] |
tusharmishra288/ML-unsupervised-algorithms | [
"9b4a16ab7d84707eabdb95670c88725bec7b4708"
] | [
"mean shift.py"
] | [
"\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.datasets.samples_generator import make_blobs\r\nfrom sklearn.cluster import MeanShift\r\ncenters=([1,1],[5,7],[10,12])\r\nX,_=make_blobs(n_samples=10000,cluster_std=1,random_state=42,centers=centers) \r\nplt.scatter(X[:,0],X[:,1])\r\nplt.sho... | [
[
"sklearn.cluster.MeanShift",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"numpy.unique",
"sklearn.datasets.samples_generator.make_blobs"
]
] |
Faagerholm/tensorflow | [
"98e30b8748eb018f33836ac9269db67ab60483ab",
"98e30b8748eb018f33836ac9269db67ab60483ab"
] | [
"tensorflow/python/tpu/tpu_embedding.py",
"tensorflow/python/keras/saving/hdf5_format_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.tpu.ops.tpu_ops.load_tpu_embedding_adam_parameters",
"tensorflow.python.tpu.ops.tpu_ops.retrieve_tpu_embedding_stochastic_gradient_descent_parameters",
"tensorflow.python.ops.state_ops.assign",
"tensorflow.python.tpu.tpu_system_metadata._query_tpu_system_metadata",
"tensorfl... |
bnonni/Python | [
"9ebd18caa4e2d805028b557e8b77ea65a9ee1a3d"
] | [
"Machine_Learning/Project/Bryan/P1/MCROC.py"
] | [
"#!/usr/bin/env python3\nimport gc\nimport warnings\nimport gc, sys, re, os, math\nfrom time import strptime, mktime\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.preprocessing import *\nfrom sklearn.multiclass import OneVsRestClassifier\nfrom sklearn.svm import *\nfrom skl... | [
[
"sklearn.ensemble.AdaBoostClassifier",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"sklearn.metrics.auc",
"sklearn.metrics.roc_... |
astrockragh/IceCube | [
"eba09e9f9a3c351dbf05496821bcd7d29ac0261c"
] | [
"from_config/run_trainings.py"
] | [
"import os, sys, tqdm, json, shutil, glob, argparse\r\n\r\nimport os.path as osp\r\n\r\nfrom tensorflow.keras.backend import clear_session\r\nimport tensorflow as tf\r\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' \r\nparser = argparse.ArgumentParser()\r\nparser.add_argument(\"-f\", \"--f\", type=str, required=False)\r... | [
[
"tensorflow.config.list_physical_devices",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.keras.backend.clear_session"
]
] |
andrevks/Document-Forgery-Detection | [
"77dcde3867732a55cd0f4604627d7bf67a5e79a5"
] | [
"app/ImageObject.py"
] | [
"from PIL import Image\n# import scipy.misc\nimport imageio \nfrom math import pow\nimport numpy as np\nimport builtins\nfrom tqdm import tqdm, trange\nimport time\n\nimport Container\nimport Blocks\n\n\nclass ImageObject(object):\n \"\"\"\n Object to contains a single image, then detects a fraud in it\n \... | [
[
"numpy.zeros"
]
] |
ntoxeg/ignite | [
"11928a3b02eacaed1f312c225434195adf9e5082"
] | [
"examples/gan/dcgan.py"
] | [
"from __future__ import print_function\n\nimport argparse\nimport os\nimport random\nimport warnings\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data as data\n\nfrom ignite.contrib.handlers import ProgressBar\nfrom ignite.engine import Engine, Events\nfrom ignite.handlers... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.ones",
"torch.cuda.is_available",
"matplotlib.pyplot.gcf",
"torch.load",
"torch.nn.ConvTranspose2d",
"torch.manual_seed",
"numpy.arange",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.zeros",
"matp... |
evgenyneu/tarpan | [
"34a5dd8d98b09341e28946ef6aa03da03e62cf1c"
] | [
"tarpan/shared/histogram.py"
] | [
"\"\"\"Make histograms of posterior parameter distributions\"\"\"\n\nfrom dataclasses import dataclass\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\nimport seaborn as sns\nfrom tarpan.shared.info_path import InfoPath, get_info_path\nfrom tarpan.shared.summary import SummaryParams, sample_summar... | [
[
"numpy.percentile",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots"
]
] |
hplgit/fem-book | [
"c23099715dc3cb72e7f4d37625e6f9614ee5fc4e"
] | [
"doc/.src/book/exer/tanh_sines.py"
] | [
"import sys, os\nsys.path.insert(0, os.path.join(os.pardir, 'src'))\nimport sympy as sym\nfrom approx1D import least_squares_orth, comparison_plot\nimport matplotlib.pyplot as plt\n\nx = sym.Symbol('x')\n\n# Naive approach: (not utilizing the fact that i+1 computations can\n# make use of i computations)\ndef naive(... | [
[
"matplotlib.pyplot.show"
]
] |
SunshineJunFu/360Project | [
"93fe3517de5937466dde602741514fa6ca0898d7"
] | [
"fov_mask.py"
] | [
"\r\nimport numpy as np\r\nimport cv2\r\n\r\nimport torch\r\nfrom cupy.cuda import function\r\nfrom pynvrtc.compiler import Program\r\nfrom collections import namedtuple\r\n\r\nkernel = \"\"\"\r\n\r\nextern \"C\"\r\n\r\n__global__ void img_fov(float* fov_angle, float* vector_x, float* vector_y, float* pointCenter, ... | [
[
"torch.zeros",
"numpy.array",
"numpy.sin",
"torch.cuda.current_stream",
"torch.from_numpy",
"numpy.cos"
]
] |
marcelflygare/pyod | [
"89865d8fbf714c22c8237147e20bab38d825f390"
] | [
"pyod/test/test_data.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport sys\n\nimport unittest\nfrom sklearn.utils.testing import assert_equal\n# noinspection PyProtectedMember\nfrom sklearn.utils.testing import assert_allclose\nfrom sklearn.utils.testing import asser... | [
[
"numpy.sum",
"sklearn.utils.testing.assert_less_equal",
"sklearn.utils.testing.assert_allclose",
"sklearn.utils.testing.assert_equal",
"sklearn.utils.testing.assert_raises"
]
] |
harshmehta227/AMLP | [
"4a1d13bc5a2f04885a6854f552d67335a2ef228f"
] | [
"Categorical_Variables/US-Adult-Census/src/ohe_logres.py"
] | [
"import time\nimport pandas as pd\n\nfrom sklearn import linear_model\nfrom sklearn import metrics\nfrom sklearn import preprocessing\n\n\ndef run(fold):\n # load the full training data with folds\n df = pd.read_csv(\"../input/adult_folds.csv\")\n # list of numerical columns\n num_cols = [\n \"fn... | [
[
"sklearn.linear_model.LogisticRegression",
"pandas.concat",
"pandas.read_csv",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.metrics.roc_auc_score"
]
] |
philtsmith570/Linear-Regression-Lazy-Programmer | [
"03357ab98155bf73b8f1d2fd53255cc16bea2333"
] | [
"Linear Regression LP/linear_regression_class/generate_2d.py"
] | [
"# generates 2-dimensional data for linear regression analysis\n#\n# notes for this course can be found at:\n# https://deeplearningcourses.com/c/data-science-linear-regression-in-python\n# https://www.udemy.com/data-science-linear-regression-in-python\n\nfrom __future__ import print_function, division\nfrom builtin... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.random.uniform",
"numpy.dot"
]
] |
ekrembakay/COMP5327-FinalProject | [
"f6b03e10fddd8898caf9597237b0c8b222614566"
] | [
"FinalProject/main.py"
] | [
"import os\nimport numpy as np\nfrom keras.preprocessing.text import Tokenizer\nfrom numpy import array\nfrom numpy import argmax\nfrom numpy import array_equal\nfrom keras.utils import to_categorical\nfrom keras.models import Model\nfrom keras.layers import Input\nfrom keras.layers import LSTM\nfrom keras.layers i... | [
[
"numpy.array"
]
] |
ckohnke/discretize | [
"f414dd7ee7c5ba9a141cb2c37d4b71fdc531eae8"
] | [
"tests/base/test_tensor_boundary.py"
] | [
"import numpy as np\nimport unittest\nimport discretize\nfrom pymatsolver import Solver\n\nMESHTYPES = [\"uniformTensorMesh\"]\n\n\ndef getxBCyBC_CC(mesh, alpha, beta, gamma):\n \"\"\"\n This is a subfunction generating mixed-boundary condition:\n\n .. math::\n\n \\nabla \\cdot \\vec{j} = -\\nabla \... | [
[
"numpy.sin",
"numpy.ones_like",
"numpy.linalg.norm",
"numpy.ones",
"numpy.arange",
"numpy.cos"
]
] |
warlicks/Real_Estate_Data | [
"137dc53a24a878cb96ec5132be6e81196902aec1"
] | [
"python/neighborhood_stats.py"
] | [
"# Import Libriaries\n###############################################################################\nimport urllib\nimport xml.etree.ElementTree as et\nimport pandas as pd\n\n# Define Global Variable\n###############################################################################\ntrulia = 'http://api.trulia.com/... | [
[
"pandas.DataFrame"
]
] |
SparkJiao/LARCH | [
"93e2e103ff5e134f5a7d3501b46f510167fb99d5"
] | [
"models/gat_layer.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch import nn\n\n\nclass GraphAttentionLayer(nn.Module):\n \"\"\"\n Simple GAT layer, similar to https://arxiv.org/abs/1710.10903\n \"\"\"\n\n def __init__(self, in_features, out_features, dropout, alpha, concat=True, residual=False):\n super... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.einsum",
"torch.nn.Conv1d",
"torch.nn.functional.dropout",
"torch.nn.LeakyReLU",
"torch.nn.functional.elu",
"torch.mm",
"torch.transpose"
]
] |
cherepaha/PyDDM | [
"9ef36fd0cdf0c7926340f1bef3e18fe921bc8f21"
] | [
"ddm/sample.py"
] | [
"# Copyright 2018 Max Shinn <maxwell.shinn@yale.edu>\n# 2018 Norman Lam <norman.lam@yale.edu>\n# \n# This file is part of PyDDM, and is available under the MIT license.\n# Please see LICENSE.txt in the root directory for more information.\n\nimport numpy as np\nimport itertools\n\nfrom paranoid.types impo... | [
[
"numpy.concatenate",
"numpy.asarray",
"numpy.round",
"numpy.ones",
"numpy.mean",
"numpy.logical_and",
"numpy.allclose",
"numpy.all",
"numpy.issubdtype"
]
] |
jpnm561/HAR-UP | [
"04243d1e22d1aaac10aaa403604fc7965b6d4c47"
] | [
"CameraOF_files/resizeOF.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 11 14:27:56 2019\n\n@author: José Pablo\n\"\"\"\n\nfrom PIL import Image\nimport numpy as np\nfrom numpy import genfromtxt\nimport os\nfrom createFolder import createFolder\nfrom progressBar import progressBar\nimport sys\n\n#A function to replace dashes in the t... | [
[
"numpy.square",
"numpy.array",
"numpy.add",
"numpy.asarray",
"numpy.genfromtxt",
"numpy.min",
"numpy.amax",
"numpy.sqrt",
"numpy.abs"
]
] |
arpita221b/Hacktoberfest-2k19-1 | [
"6f682ea2226a8ce6f5a913da9ecdafff7a9fa5bd"
] | [
"machineLearning/KNN/knn.py"
] | [
"\"\"\"\r\nA knn classifier predicts which class a point p should belong to. To do this we loop through\r\nall the points and find the distance of p from each point. We then sort these\r\nindices ie., we get an array with the sorted indices(find_nearest_neighbours).\r\nWe then select the first k of these indices an... | [
[
"sklearn.neighbors.KNeighborsClassifier",
"numpy.mean",
"sklearn.datasets.load_iris"
]
] |
kekedan/PhotoWakeUpHMR | [
"d78b091ed320669efb0cd0a828891d655e7d1620"
] | [
"PhotoWakeUpDepthMaps.py"
] | [
"\"\"\"\nDemo of HMR.\n\nNote that HMR requires the bounding box of the person in the image. The best performance is obtained when max length of the person in the image is roughly 150px. \n\nWhen only the image path is supplied, it assumes that the image is centered on a person whose length is roughly 150px.\nAlter... | [
[
"numpy.max",
"numpy.array",
"tensorflow.Session",
"numpy.expand_dims"
]
] |
deephog/BASNet | [
"7770bc69f00b2bb7421c6ea7b26f38f6ca02082f"
] | [
"wandb/run-20210618_113342-dapqogt7/files/code/basnet_train.py"
] | [
"import torch\nimport torchvision\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils\nimport torch.optim as optim\nimport wandb\nimport torchvision.transforms as standard_transfor... | [
[
"torch.autograd.Variable",
"torch.cuda.empty_cache",
"torch.cuda.is_available",
"torch.nn.BCELoss",
"torch.load"
]
] |
sn6uv/sympy | [
"5b149c2f72847e4785c65358b09d99b29f101dd5"
] | [
"sympy/physics/quantum/qubit.py"
] | [
"\"\"\"Qubits for quantum computing.\n\nTodo:\n* Finish implementing measurement logic. This should include POVM.\n* Update docstrings.\n* Update tests.\n\"\"\"\n\nimport math\n\nfrom sympy import Integer, log, Mul, Add, Pow, conjugate\nfrom sympy.core.basic import sympify\nfrom sympy.matrices.matrices import Matri... | [
[
"numpy.matrix",
"scipy.sparse.csr_matrix"
]
] |
simonlindgren/GetOldTweets3 | [
"05744c7c2dfec11d5de65971a0add478cecab41f"
] | [
"sql2csv.py"
] | [
"#!/usr/bin/env python3\n\n'''\nREAD SQLITE3 DB INTO CSV\nSimon Lindgren\n200220\n'''\n\nimport sqlite3\nimport pandas as pd\nimport glob\n\ndef main():\n print(\"\\nEnter the name of a database file, located in this directory.\")\n dbs = glob.glob(\"*.db\")\n print(\"You have these to choose from:\")\n ... | [
[
"pandas.read_sql_query"
]
] |
jcoreyes/erl | [
"43f4e8407967749f5364106163f3c5335eb7dc83"
] | [
"rlkit/core/batch_rl_algorithm_modenv.py"
] | [
"from collections import OrderedDict\n\nfrom rlkit.core.timer import timer\n\nfrom rlkit.core import logger\nfrom rlkit.data_management.replay_buffer import ReplayBuffer\nfrom rlkit.misc import eval_util\nfrom rlkit.samplers.data_collector.path_collector import PathCollector\nfrom rlkit.core.rl_algorithm import Bas... | [
[
"numpy.random.uniform"
]
] |
modyharshit23/trax | [
"2e6783a4674209b57482ec41e1c533a420aa6fe6"
] | [
"trax/rl/space_serializer.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Trax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"numpy.max",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.minimum",
"numpy.allclose",
"numpy.stack",
"numpy.arange",
"numpy.maximum"
]
] |
spectralDNS/mpi4pt-fft | [
"ac510f8398f138bb860ed9f2580343e8b98cf799"
] | [
"tests/test_io.py"
] | [
"import functools\nimport os\nfrom mpi4py import MPI\nimport numpy as np\nfrom mpi4py_fft import PFFT, HDF5File, NCFile, newDistArray, generate_xdmf\n\nN = (12, 13, 14, 15)\ncomm = MPI.COMM_WORLD\n\nex = {True: 'c', False: 'r'}\n\nwriter = {'hdf5': functools.partial(HDF5File, mode='w'),\n 'netcdf4': functo... | [
[
"numpy.allclose",
"numpy.arange",
"numpy.random.random"
]
] |
alfred100p/PettingZoo | [
"2f5188608d5b4fc9c64297d7cddd4be57423dc6b"
] | [
"pettingzoo/butterfly/cooperative_pong/cooperative_pong.py"
] | [
"import os\nimport numpy as np\nimport gym\nfrom gym.utils import seeding\nfrom .cake_paddle import CakePaddle, RENDER_RATIO\nfrom .manual_control import manual_control\nfrom pettingzoo import AECEnv\nfrom pettingzoo.utils import wrappers\nfrom pettingzoo.utils.agent_selector import agent_selector\nfrom pettingzoo.... | [
[
"numpy.rot90",
"numpy.sin",
"numpy.sign",
"numpy.transpose",
"numpy.cos",
"numpy.fliplr"
]
] |
Corentin-M/Deployment_Notebook_Sagemaker | [
"fd2d8eebf4e837b50bd9243bc2e869dbb424cf75"
] | [
"Project/serve/predict.py"
] | [
"import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\nfrom utils import review_to_words, convert_and_p... | [
[
"numpy.hstack",
"torch.cuda.is_available",
"torch.load",
"torch.from_numpy"
]
] |
gbmxdwmssj/path_planner | [
"53e1d743dc8f780b677a69ea232ee0b9aeacaf5f"
] | [
"scripts/hori_compar.py"
] | [
"#!/usr/bin/env python\n\nimport rospy\nimport math\nimport csv\nimport numpy as np\nimport scipy\nfrom scipy import interpolate\nfrom scipy.interpolate import CubicHermiteSpline\nfrom nav_msgs.msg import *\nfrom hybrid_astar.srv import *\nfrom std_msgs.msg import *\nimport pylab as pl\nimport numpy as np\nimport m... | [
[
"matplotlib.pyplot.MultipleLocator"
]
] |
chie4hao/fgotest | [
"b489957fa90a297390d8ab620a4dc5850f4225d3"
] | [
"utils.py"
] | [
"# -*- coding: utf-8 -*- \nimport os\nimport numpy as np\nfrom PIL import Image, ImageGrab\nimport time\nimport matplotlib.pyplot as plt\nimport pytesseract\nimport win32api\nimport win32gui\nimport win32ui\nimport win32con\nfrom ctypes import windll\nimport cv2\n############################鼠标点击使用常数##############... | [
[
"numpy.max",
"numpy.array",
"numpy.sum",
"numpy.min",
"matplotlib.pyplot.figure",
"numpy.argmax",
"numpy.size",
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.expand_dims",
"matplotlib.pyplot.imshow"
]
] |
cogerk/walk-up-music-scrapper | [
"74df610985e6ff220a605a49933a0655e247caa3"
] | [
"walkupEnv/lib/python3.6/site-packages/holoviews/plotting/bokeh/annotation.py"
] | [
"from collections import defaultdict\n\nimport param\nimport numpy as np\nfrom bokeh.models import Span, Arrow, Div as BkDiv\ntry:\n from bokeh.models.arrow_heads import TeeHead, NormalHead\n arrow_start = {'<->': NormalHead, '<|-|>': NormalHead}\n arrow_end = {'->': NormalHead, '-[': TeeHead, '-|>': Norma... | [
[
"numpy.array",
"numpy.split"
]
] |
mitramir55/PassivePy | [
"6ffe8d082a40369f226909c84aa97286c6a1edd5"
] | [
"PassivePyCode/PassivePySrc/PassivePy.py"
] | [
"import pandas as pd\nimport numpy as np\nimport spacy\nfrom termcolor import colored\nimport regex as re\nfrom itertools import chain \nfrom tqdm import tqdm\nimport tqdm.notebook as tq\nimport os, sys, gc\n\n\ntry: \n from PassivePyCode.PassivePySrc.rules_for_all_passives import create_matcher\n from Passiv... | [
[
"numpy.array",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"pandas.concat",
"pandas.Series"
]
] |
ZJU-lishuang/C-3-Framework | [
"b3823bb5a54f7dd1885be65e8ada4aed102f1632"
] | [
"test.py"
] | [
"from matplotlib import pyplot as plt\n\nimport matplotlib\nimport os\nimport random\nimport torch\nfrom torch.autograd import Variable\nimport torchvision.transforms as standard_transforms\nimport misc.transforms as own_transforms\nimport pandas as pd\n\nfrom models.CC import CrowdCounter\nfrom config import cfg\n... | [
[
"matplotlib.pyplot.colorbar",
"torch.autograd.Variable",
"matplotlib.pyplot.savefig",
"torch.no_grad",
"matplotlib.pyplot.close",
"pandas.read_csv",
"scipy.io.savemat",
"matplotlib.pyplot.figure",
"torch.cuda.set_device",
"torch.load",
"matplotlib.pyplot.gca",
"matp... |
davidefiocco/ipyplot | [
"ff64f4a376e17bf86c6c6fb1d47ee99e50227708"
] | [
"tests/test_utils.py"
] | [
"import sys\n\nimport numpy as np\nimport pytest\nimport pandas as pd\n\nsys.path.append(\".\")\nsys.path.append(\"../.\")\nfrom ipyplot._utils import _get_class_representations\n\n\nTEST_OUT_IMAGES = ['a', 'b', 'c']\nTEST_DATA = [\n # images, labels,\n # ignore_list, labels_order,\n # out_images, out_labe... | [
[
"numpy.array",
"pandas.Series"
]
] |
j1a0m0e4sNTU/ML2019SPRING | [
"3d5f1ba8441660e61a0a7cbb0579f67d9b659c77"
] | [
"hw8_all/model_test.py"
] | [
"import sys\nimport torch\nimport torch.nn as nn\n\n# simple baseline : about 162435 parameters\n# strong baseline : about 56310 parameters\n\nconv_config = {\n 'base': [16, 64, 'D', 128, 'D', 256, 'D', 512, 'D'],\n 'A': [8, 16, 'D', 16, 16, 16, 'D', 32, 32, 'D', 32, 32, 'D', 64, 64],\n 'B': [16, 16, 16, ... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
t-aritake/ancestral_atom_learning | [
"1af3451058f31dfdd28289bb05e90bb2ec1d9e5d"
] | [
"utils/intrinsic_dimension_estimator.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy\nimport scipy.cluster.hierarchy\n\n\n# 二分木みたいにルートから追加できないのがちょっと面倒.\n# あとで見直す?\nclass Node(object):\n ''' class to construct clustering tree'''\n def __init__(self):\n self.data = None\n self.left = None\n self.right = None\n self.annotated_dis... | [
[
"numpy.max",
"numpy.random.normal",
"numpy.dot",
"numpy.triu_indices",
"numpy.log",
"numpy.zeros",
"numpy.percentile",
"numpy.sum",
"numpy.random.shuffle",
"numpy.mean",
"numpy.arange",
"numpy.sqrt",
"numpy.all",
"numpy.random.random",
"numpy.var"
]
] |
zjzh/pynndescent | [
"1e79a3742436bfe4822995de073b500ffedd485c"
] | [
"pynndescent/distances.py"
] | [
"# Author: Leland McInnes <leland.mcinnes@gmail.com>\n#\n# License: BSD 3 clause\nimport numpy as np\nimport numba\n\nfrom pynndescent.optimal_transport import (\n allocate_graph_structures,\n initialize_graph_structures,\n initialize_supply,\n initialize_cost,\n network_simplex_core,\n total_cost... | [
[
"numpy.arccos",
"numpy.median",
"numpy.finfo",
"numpy.radians",
"numpy.cos",
"numpy.sin",
"numpy.empty",
"numpy.log",
"numpy.arcsin",
"numpy.nonzero",
"numpy.eye",
"numpy.arange",
"numpy.sqrt",
"numpy.column_stack",
"numpy.zeros",
"numpy.corrcoef",
... |
dvdzhang/uncertainty-baselines | [
"8ce0d7494e5cae0719c1b750da4b61564e536636"
] | [
"baselines/clinc_intent/bert_utils.py"
] | [
"# coding=utf-8\n# Copyright 2022 The Uncertainty Baselines 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# Unles... | [
[
"tensorflow.sequence_mask",
"tensorflow.io.gfile.GFile",
"tensorflow.train.load_variable",
"tensorflow.train.load_checkpoint",
"tensorflow.train.list_variables",
"tensorflow.core.protobuf.trackable_object_graph_pb2.TrackableObjectGraph"
]
] |
openAGI/datum | [
"2dfc8c62ed1366fd8544b8b25d730d89dfb57d4e"
] | [
"datum/utils/common_utils.py"
] | [
"# Copyright 2020 The OpenAGI Datum 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... | [
[
"numpy.array",
"tensorflow.python.util.tf_inspect.isfunction",
"numpy.issubdtype"
]
] |
Iota87/texthero | [
"f3e3acec1ffab3436f38419f87058f2693e3da7e"
] | [
"tests/test_representation.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom texthero import representation\nfrom texthero import preprocessing\n\nfrom . import PandasTestCase\n\nimport doctest\nimport unittest\nimport string\nimport math\nimport warnings\nfrom parameterized import parameterized\n\n\n\"\"\"\nTest doctest\n\"\"\"\n\n\ndef load_t... | [
[
"pandas.testing.assert_series_equal",
"pandas.MultiIndex.from_tuples",
"pandas.SparseDtype",
"pandas.Series"
]
] |
osu-xai/abp | [
"cd83eaa2810a1c5350c849303d61639576c0bb0d"
] | [
"abp/adaptives/mb_ts/adaptive_archive_1l.py"
] | [
"import logging\nimport time\nimport random\nimport pickle\nimport os\nfrom sys import maxsize\nfrom collections import OrderedDict\n\nimport torch\nfrom tensorboardX import SummaryWriter\nfrom baselines.common.schedules import LinearSchedule\nimport numpy as np\nfrom copy import deepcopy\n\nfrom abp.utils import c... | [
[
"numpy.array",
"numpy.sum",
"numpy.split",
"torch.cuda.is_available",
"torch.load",
"numpy.vstack"
]
] |
Lingesh2311/Python-Projects | [
"9916cf580dff165a7348f52efd274c743961381d",
"9916cf580dff165a7348f52efd274c743961381d"
] | [
"Financial Projects/LeakyGANLongTextGeneration/encode.py",
"Employee Sentiment Analysis & Topic Modelling/initial.py"
] | [
"from functools import reduce\r\nimport numpy as np\r\nimport pickle\r\n\r\ndef text_to_tensor(filePath):\r\n \"\"\"\r\n Read text from file\r\n \"\"\"\r\n with open(filePath, 'r') as f:\r\n lines = f.readlines()\r\n f.close()\r\n corpus = []\r\n for l in lines:\r\n l = l.stri... | [
[
"numpy.array",
"numpy.save"
],
[
"pandas.read_csv"
]
] |
YHJYH/Machine_Learning | [
"0e86f0a5de0b8f280924c68e83ca1e817d7878e9",
"0e86f0a5de0b8f280924c68e83ca1e817d7878e9"
] | [
"projects/Multi Task Learning/code/mmoe/data_loader.py",
"projects/Multi Task Learning/code/single_task/data_loader.py"
] | [
"import torchvision.transforms as transforms\nfrom PIL import Image, ImageDraw, ImageFont\nfrom torch.utils.data import Dataset, DataLoader\n\nimport h5py\nimport math\nimport numpy as np\nfrom tqdm import tqdm\n\ndef load_data(root_path, batch_size=16, num_workers=2): \n transform = transforms.Compose(\n [... | [
[
"numpy.array",
"torch.utils.data.DataLoader"
],
[
"numpy.array",
"torch.utils.data.DataLoader"
]
] |
smearle/Griddly | [
"e621285b15fdc45689c08536ab8c3e0f7b52d5cb"
] | [
"python/examples/vectorized.py"
] | [
"from stable_baselines3.common.vec_env import SubprocVecEnv\nimport numpy as np\nimport gym\nimport griddly\n\ngame = \"GDY-Partially-Observable-Zelda-v0\"\n\ndef make_env():\n def _monad():\n env = gym.make(game)\n return env\n return _monad\n\nif __name__ == '__main__':\n raw_list = [make_e... | [
[
"numpy.zeros"
]
] |
neonkitchen/disent | [
"0f45fefea03473690dfdbf48ef83f6e17ca9b8b3"
] | [
"disent/schedule/_schedule.py"
] | [
"# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~\n# MIT License\n#\n# Copyright (c) 2021 Nathan Juraj Michlo\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# ... | [
[
"numpy.maximum",
"numpy.cos",
"numpy.minimum"
]
] |
domoritz/streamlit | [
"5e8e0ec1b46ac0b322dc48d27494be674ad238fa"
] | [
"lib/streamlit/__init__.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2018-2020 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi... | [
[
"tensorflow.python.keras.utils.vis_utils.model_to_dot",
"numpy.shape"
]
] |
NASA-LIS/neuralhydrology | [
"9626578d6013aa08864caf29d9520321cdcafc24"
] | [
"neuralhydrology/nh_run_scheduler.py"
] | [
"#!/usr/bin/env python\nimport argparse\nimport random\nimport subprocess\nimport sys\nimport time\nfrom pathlib import Path\nfrom typing import List\n\nimport numpy as np\n\n\ndef _get_args() -> dict:\n\n parser = argparse.ArgumentParser()\n parser.add_argument('mode', choices=[\"train\", \"evaluate\"])\n ... | [
[
"numpy.argmin"
]
] |
YuZiHanorz/stacked_capsule_autoencoders | [
"b85fb1b8b4d4f385f137b865469a20271a234162"
] | [
"capsules/models/scae.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google Research 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 requ... | [
[
"tensorflow.trainable_variables",
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.ones_like",
"tensorflow.reshape",
"tensorflow.nn.l2_loss",
"tensorflow.reduce_max",
"tensorflow.zeros_like",
"tensorflow.squeeze",
"tensorflow.reduce_sum",
"tensorflow.to_float"... |
SSG-DRD-IOT/commercial-iot-security-system | [
"0c3d89b35d0468d4d3cc5ce2653b3f0ac82652a9",
"0c3d89b35d0468d4d3cc5ce2653b3f0ac82652a9"
] | [
"opencv/experiments_raw/contour_Backproject/backProjection_masked.py",
"opencv/tutorials/videoAnalysis/meanshift_camshift/camshift.py"
] | [
"import numpy as np\nimport cv2\nfrom matplotlib import pyplot as plt\n\nxi, yi, xf, yf = 0, 0, 0, 0\nselecting = False\nfoo = False\n# bar = False\ndef regionSelect(event, x, y, flags, param):\n # print(selecting)\n global xi, yi, xf, yf, selecting, foo, roiHist #, bar\n if event == cv2.EVENT_LBUTTONDOWN:... | [
[
"numpy.copy",
"matplotlib.pyplot.close",
"numpy.zeros"
],
[
"numpy.array",
"numpy.int0"
]
] |
strawpants/cate | [
"eeef7da204b2f5c6dab1a90cb240aa5158c44513"
] | [
"cate/webapi/start.py"
] | [
"# The MIT License (MIT)\n# Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors\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, ... | [
[
"matplotlib.backends.backend_webagg_core.FigureManagerWebAgg.get_static_file_path"
]
] |
Ruil/fairseq | [
"5cd5c334631a2aca1d3cfaaaddeec1b56df9e0e4"
] | [
"fairseq/data/data_utils.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport contextlib\nimp... | [
[
"numpy.random.seed",
"numpy.random.get_state",
"numpy.random.set_state"
]
] |
wsmorgan/phonon-enumeration | [
"5d7a8d8e3403cc387bdd58cf98a23e4751ea34dd"
] | [
"phenum/grouptheory.py"
] | [
"\"\"\"Methods for taking an HNF and finding the site permutations and the\narrow permutations. All of these have been modified for python from\ntheir original fortran implementations which can be found at:\nhttps://github.com/msg-byu/enumlib/. Of these only get_rotation\nget_rotation_perms_lists() has been modifie... | [
[
"numpy.array",
"numpy.dot",
"numpy.count_nonzero",
"numpy.matmul",
"numpy.zeros",
"numpy.reshape",
"numpy.round",
"numpy.linalg.det",
"numpy.allclose",
"numpy.transpose",
"numpy.linalg.inv"
]
] |
LuanAGoncalves/pytorch-ssd | [
"37804052d04ff588c76818e862123d1d8cca1bde"
] | [
"vision/ssd/ssd.py"
] | [
"import torch.nn as nn\nimport torch\nimport numpy as np\nfrom typing import List, Tuple\nimport torch.nn.functional as F\n\nfrom ..utils import box_utils\nfrom collections import namedtuple\n\nGraphPath = namedtuple(\"GraphPath\", [\"s0\", \"name\", \"s1\"]) #\n\n\nclass SSD(nn.Module):\n def __init__(\n ... | [
[
"torch.cat",
"torch.nn.init.xavier_uniform_",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.load",
"torch.nn.functional.softmax"
]
] |
idc9/mvmm | [
"64fce755a7cd53be9b08278484c7a4c77daf38d1"
] | [
"mvmm/multi_view/LogPenMVMM.py"
] | [
"import numpy as np\nfrom warnings import warn\nfrom copy import deepcopy\nfrom textwrap import dedent\n\nfrom mvmm.base import _em_docs\nfrom mvmm.multi_view.MaskedMVMM import MaskedMVMM\n\n\nclass LogPenMVMM(MaskedMVMM):\n\n def __init__(self,\n pen=None,\n delta=1e-6,\n ... | [
[
"numpy.array",
"numpy.delete",
"numpy.log",
"numpy.exp",
"numpy.mean",
"numpy.where",
"numpy.finfo",
"numpy.argmax",
"numpy.clip"
]
] |
WalterZWang/AlphaBuilding-MedOffice | [
"744a68c4f3591f38b83fc08d81929d8ff6b1274d"
] | [
"gym_AlphaBuilding/fmuModel/test_fmu.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nTest the FMU using the rule based control.\n\nThe results are stored in pandas dataframe\n\n@author: walter\n\"\"\"\n\nfrom pyfmi import load_fmu\nimport numpy as np\nimport pylab as plt\nimport pandas as pd\n\n\ndef terminal_sat(T_room, T_set=22):\n '''\n A simple controller... | [
[
"pandas.DataFrame",
"pandas.date_range",
"numpy.arange"
]
] |
chongzhou96/maskrcnn-benchmark | [
"f88e33e930390c9b961ebadf510e5ca80620af6f"
] | [
"maskrcnn_benchmark/utils/visualize.py"
] | [
"from visdom import Visdom\nimport numpy as np\nimport logging\n\nclass Visualizer(object):\n\n def __init__(self, loss_keys, env, port, hostname, loss_log_dict=None):\n logger = logging.getLogger(\"maskrcnn_benchmark.visualize\")\n logger.info('Launching visdom server ...')\n\n self.viz = V... | [
[
"numpy.array",
"numpy.cumsum"
]
] |
Sam-Armstrong/PyTorch-Practice | [
"f5bca54579d3e023519ce505054b88fc118818ea"
] | [
"Circular/CifarFFCircular.py"
] | [
"\"\"\"\nUses the pre-training circular model to train a single-layer perceptron for classifying MNIST digits.\n\"\"\"\n\nimport torch.nn as nn\nimport torch\nimport torch.optim as optim\nfrom torchvision import datasets\nfrom torchvision.transforms import ToTensor\nfrom torch.utils.data import DataLoader, random_s... | [
[
"torch.Size",
"torch.device",
"torch.nn.Dropout",
"torch.nn.Linear",
"torch.nn.Softmax",
"torch.utils.data.random_split",
"torch.no_grad",
"torch.nn.BatchNorm1d",
"torch.cuda.is_available",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.utils.data.DataLoader",
... |
r4tn3sh/MIMO_detection | [
"3bfe80c4c3d7e6cfef4510b6e81683d987dc14ac"
] | [
"src/channels.py"
] | [
"import os\nimport math\nimport numpy as np\nfrom scipy import linalg\nfrom mimoclasses import Channel\n\n# ---------- CHANNEL ------------\ndef awgnChannel(x,N0):\n \"\"\"\n Generates the AWGN channel\n Input parameters\n - Signal x (should be avg unit power)\n - Noise variance N0\n Other paramet... | [
[
"numpy.identity",
"numpy.random.normal",
"numpy.zeros",
"numpy.asmatrix"
]
] |
jjjjamess/GFPGAN-1 | [
"2226e7297f2492270be59e2bc29bcecddad9633c"
] | [
"myapp.py"
] | [
"import io\nimport json\nimport argparse\nimport cv2\nimport glob\nimport numpy as np\nimport os\nfrom basicsr.utils import imwrite\n\nfrom gfpgan import GFPGANer\n\nimport torch\nimport torchvision.transforms as transforms\nfrom PIL import Image\nfrom flask import Flask, jsonify, request\n\nUPLOAD_FOLDER = 'upload... | [
[
"numpy.concatenate",
"torch.cuda.is_available",
"torch.load"
]
] |
pnijhara/h2o4gpu | [
"9885416deb3285f5d0f33023d6c07373ac4fc0b7"
] | [
"tests/python/open_data/daal/test_daal_regression.py"
] | [
"# -*- encoding: utf-8 -*-\n\"\"\"\n:copyright: 2017-2018 H2O.ai, Inc.\n:license: Apache License Version 2.0 (see LICENSE for details)\n\"\"\"\ntry:\n __import__('daal')\nexcept ImportError:\n import platform\n print(\"Daal is not supported. Architecture detected {}\".format(platform.architecture()))\nel... | [
[
"sklearn.linear_model.base.LinearRegression",
"numpy.array",
"numpy.random.rand",
"numpy.random.RandomState",
"numpy.linalg.tests.test_linalg.assert_almost_equal",
"numpy.ma.testutils.assert_array_almost_equal"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.