repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
weiya711/scadi_graph | [
"5ce78fe09286e9722c2627f7f959c4ad3f2288eb"
] | [
"sam/sim/test/test.py"
] | [
"import copy\nimport random\n\nimport numpy as np\n\nfrom sam.sim.src.wr_scanner import WrScan, CompressWrScan\nfrom sam.sim.src.array import Array\n\nTIMEOUT = 10000000\n\n\ndef check_arr(arr_obj, gold):\n assert (isinstance(arr_obj, WrScan) or isinstance(arr_obj, Array))\n # Assert the array stores values w... | [
[
"numpy.ndenumerate",
"numpy.zeros"
]
] |
LuoZijun/arrow | [
"8219a8b878d9344fe73e07def34a18a71a8f85a8"
] | [
"python/pyarrow/tests/test_json.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.random.RandomState"
]
] |
noelnamai/machine-learning | [
"02743dfd99429846cff4bf0c8fca544d45a1db27"
] | [
"sebaba/ml/collaborative_filtering.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nfrom scipy.optimize import minimize\n\n\nclass CollaborativeFiltering(object):\n \"\"\"\n Implementation of the Collaborative Filtering algorithm using \n Low-Rank Matrix Factorization and Conjugate Gradient Descent.\n\n Parameters\n --------------------... | [
[
"numpy.dot",
"numpy.reshape",
"numpy.sum",
"numpy.random.random",
"scipy.optimize.minimize"
]
] |
bieniekmateusz/forcebalance | [
"593791866e622ab4eae23ce29a0bed27499a118d"
] | [
"tools/vibrations/anifrq-tc.py"
] | [
"#!/usr/bin/env python\n\nfrom __future__ import division\nfrom __future__ import print_function\nfrom builtins import range\nimport os, sys, re\nimport numpy as np\nfrom forcebalance.molecule import Molecule\nfrom forcebalance.readfrq import read_frq_tc\n\n# TeraChem frequency output file.\ntcout = sys.argv[1]\n\n... | [
[
"numpy.max",
"numpy.sin",
"numpy.linalg.norm",
"numpy.argmax",
"numpy.sqrt",
"numpy.linspace"
]
] |
TechLabs-Aachen-e-V/WiSe20_Team_10_Main | [
"1bf1fe4cf5065144a5f6f196004cf5ec16585c83"
] | [
"notebooks/05-__-Editing_1.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,py:light\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.11.1\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\nimpo... | [
[
"pandas.read_csv"
]
] |
joy13975/covidprof_submission | [
"b3c7bb0ebf6fa1557edb8d1ca5d3d41377508e7d"
] | [
"src/adapter/c3aidatalake.py"
] | [
"import requests\nimport pandas as pd\n\n\ndef read_data_json(typename, api, body):\n \"\"\"\n read_data_json directly accesses the C3.ai COVID-19 Data Lake APIs using the requests library, \n and returns the response as a JSON, raising an error if the call fails for any reason.\n ------\n typename: ... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.concat",
"pandas.json_normalize"
]
] |
liaimi/pytext-1 | [
"40113ed01fb07714776fdc9e1f187f88c1f9f443"
] | [
"pytext/models/model.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport os\nfrom typing import Dict, List\n\nimport torch\nimport torch.nn as nn\nfrom pytext.common.constants import Stage\nfrom pytext.config import ConfigBase\nfrom pytext.config.component import Component, Componen... | [
[
"torch.nn.Module.__init__"
]
] |
garmenz/detectron2_local | [
"cf293e033dc5cf548042fc6416227a5c84cc77fc"
] | [
"projects/GAN_Panoptic_FPN/train_net_cityscapes_with_aug.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\nA main training script.\n\nThis scripts reads a given config file and runs the training or evaluation.\nIt is an entry point that is made to train standard models in detectron2.\n\nIn order to let one script support training of many... | [
[
"torch.cuda.device_count"
]
] |
snu-mllab/EDAC | [
"c21d8aa354d13dbe884fd2fb809fe9a85c65e6c9"
] | [
"lifelong_rl/trainers/q_learning/sac.py"
] | [
"import numpy as np\nimport torch\nimport torch.optim as optim\nfrom torch import nn as nn\n\nfrom collections import OrderedDict\n\nimport lifelong_rl.torch.pytorch_util as ptu\nfrom lifelong_rl.torch.distributions import TanhNormal\nfrom lifelong_rl.util.eval_util import create_stats_ordered_dict\nfrom lifelong_r... | [
[
"torch.nn.MSELoss",
"torch.einsum",
"torch.norm",
"numpy.mean",
"numpy.prod",
"torch.eye",
"torch.exp",
"torch.sum"
]
] |
bpteague/fcsparser | [
"228e8a936da2ca0b4dc22f8ac3e1ae074a106118"
] | [
"fcsparser/api.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nParser for FCS 2.0, 3.0, 3.1 files. Python 2/3 compatible.\n`\nDistributed under the MIT License.\n\nUseful documentation for dtypes in numpy\nhttp://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.byteswap.html?highlight=byteswap#numpy.ndarray.byteswap # noqa\nhttp://doc... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.arange",
"numpy.zeros"
]
] |
FEE-Fair-Embedding-Engine/FEE | [
"013a540069ef433d579e4ea2e5f21aa2a3f86815"
] | [
"fee/metrics/proximity_bias.py"
] | [
"import numpy as np\nfrom ..utils import get_g, get_pair_idb\nfrom tqdm import tqdm\nfrom collections import defaultdict\n\ndef _bias_ratio(vals, l, thresh):\n return len(vals[vals>thresh]) / l\n\ndef _get_nbs_i(E, word, n):\n return np.argsort(E.vecs.dot(E.v(word)))[-n:][::-1]\n\ndef _prox_bias(word, E, g=No... | [
[
"numpy.array"
]
] |
Xtuden-com/proteinfer | [
"e2bc5c88eaae2ef3caca06c23592b1f85c82ca2e",
"e2bc5c88eaae2ef3caca06c23592b1f85c82ca2e"
] | [
"utils_test.py",
"protein_model.py"
] | [
"# coding=utf-8\n# Copyright 2020 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... | [
[
"numpy.allclose",
"numpy.array",
"tensorflow.compat.v1.test.main"
],
[
"tensorflow.compat.v1.metrics.recall",
"tensorflow.compat.v1.metrics.false_positives",
"tensorflow.compat.v1.tile",
"tensorflow.compat.v1.identity",
"tensorflow.compat.v1.math.top_k",
"tensorflow.compat.... |
CNES/cars | [
"484dd1aab8a1c921d29cbea4baacc2db948c4e9d"
] | [
"cars/core/geometry/otb_geometry.py"
] | [
"#!/usr/bin/env python\n# coding: utf8\n#\n# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).\n#\n# This file is part of CARS\n# (see https://github.com/CNES/cars).\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... | [
[
"numpy.array",
"numpy.floor"
]
] |
ENPH-2113-Silicon-Photonics/legume | [
"45c64b78f09b7d8779f7a4e12f204f5778b08b0b"
] | [
"chickpea/sbl.py"
] | [
"import legume\nfrom legume import backend as bd\nimport numpy as np\n\nclass ShapeBuilder():\n def __init__(self, **defaults):\n\n\n self._defaults = dict()\n\n self._defaults.update(defaults)\n\n raise NotImplementedError(\"Must be implemented by subclass\")\n\n def place_shape(self, ph... | [
[
"numpy.radians",
"numpy.sqrt"
]
] |
UpCoder/YNe | [
"2f932456eda29b1e04f4c7e212e2ab0dacfe831b"
] | [
"datasets/ISBI2017_build_dataset_zn.py"
] | [
"# -*- coding=utf-8 -*-\nimport cv2\nimport os\nfrom glob import glob\nimport numpy as np\nfrom tqdm import tqdm\nimport nipy\nMIN_AREA = 10\n\n\ndef image_expand(img, kernel_size=5):\n kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (kernel_size, kernel_size))\n image = cv2.dilate(img, kernel)\n ret... | [
[
"numpy.max",
"numpy.asarray",
"numpy.sum",
"numpy.min",
"numpy.mean",
"numpy.shape",
"numpy.expand_dims"
]
] |
dctelus/transformers | [
"b18dfd95e1f60ae65a959a7b255fc06522170d1b",
"b18dfd95e1f60ae65a959a7b255fc06522170d1b",
"b18dfd95e1f60ae65a959a7b255fc06522170d1b",
"6786cbc4b14ebff0ac59c768cadd109391db9a08",
"6786cbc4b14ebff0ac59c768cadd109391db9a08"
] | [
"tests/sew_d/test_modeling_sew_d.py",
"src/transformers/image_utils.py",
"tests/generation/test_generation_utils.py",
"examples/pytorch/image-pretraining/run_mim.py",
"examples/tensorflow/text-classification/run_glue.py"
] | [
"# coding=utf-8\n# Copyright 2021 The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.... | [
[
"torch.no_grad",
"torch.ones",
"torch.from_numpy",
"torch.tensor",
"torch.isinf",
"torch.ones_like",
"torch.allclose",
"torch.argmax"
],
[
"numpy.zeros_like",
"numpy.array",
"torch.tensor"
],
[
"torch.zeros",
"torch.min",
"torch.eq",
"torch.max",... |
malfarasplux/pnet2019 | [
"ae34d5c84fb4d3985634b237a14dfb69e98b8339",
"ae34d5c84fb4d3985634b237a14dfb69e98b8339"
] | [
"Rui/ESN_new_interp.py",
"grid_search_mem_scale_exp1/source/ESNtrainCV.py"
] | [
"from sklearn.metrics import accuracy_score, f1_score, roc_auc_score, precision_score, recall_score, roc_curve\nfrom ESNtools import *\nfrom iterative_interpolation import nan_bounds, nan_interpolate\nfrom GroupStratifiedKFold import GroupStratifiedKFold\n\n\nprint(\"Loading datasets...\", flush=True)\n\ndataset_in... | [
[
"sklearn.metrics.f1_score",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.roc_curve"
],
[
"numpy.random.rand",
"numpy.load",
"numpy.min",
"numpy.where",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.metrics.f1_score",
"numpy.co... |
jgard1/continual-learning | [
"54ffbfe8cd548c7edeaae10feb721030a2e7de3a"
] | [
"encoder.py"
] | [
"import torch\nfrom torch.nn import functional as F\nfrom linear_nets import MLP,fc_layer\nfrom boosted_exemplars import ExemplarHandler\nfrom continual_learner import ContinualLearner\nfrom replayer import Replayer\nimport utils\n\n\nclass Classifier(ContinualLearner, Replayer, ExemplarHandler):\n '''Model for ... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.sigmoid",
"torch.cat",
"torch.nn.functional.cross_entropy"
]
] |
srom/nbias | [
"be8cf8dd623038dcf08d38ed3d19f635ee2dbeae"
] | [
"preprocessing/assembly_summary.py"
] | [
"\"\"\"\nGather metadata for all assemblies in the dataset \nand output to assemblies.csv\n\"\"\"\nimport argparse\nimport os\nimport logging\nimport re\n\nimport numpy as np\nimport pandas as pd\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef main():\n logging.basicConfig(level=logging.INFO, format=\"%(ascti... | [
[
"pandas.read_csv",
"pandas.to_numeric",
"pandas.merge",
"pandas.concat"
]
] |
Frightera/probability | [
"deac4562cbc1056e6abebc7450218d38444fe65d",
"deac4562cbc1056e6abebc7450218d38444fe65d",
"deac4562cbc1056e6abebc7450218d38444fe65d"
] | [
"tensorflow_probability/python/distributions/distribution.py",
"tensorflow_probability/python/sts/components/local_level.py",
"tensorflow_probability/python/sts/components/local_linear_trend.py"
] | [
"# Copyright 2018 The TensorFlow Probability 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 a... | [
[
"tensorflow.python.util.nest.map_structure_up_to",
"tensorflow.compat.v2.shape",
"tensorflow.compat.v2.cast",
"tensorflow.python.util.nest.flatten",
"tensorflow.compat.v2.is_tensor",
"tensorflow.compat.v2.get_static_value",
"tensorflow.compat.v2.group",
"tensorflow.python.util.nest... |
jimmy9065/mxnet-ssd | [
"ff15817dbf6d3c6d3fc69fbf6bef4c4d61490159"
] | [
"evaluate/eval_metric.py"
] | [
"import mxnet as mx\nimport numpy as np\nimport os\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\n\nclass MApMetric(mx.metric.EvalMetric):\n \"\"\"\n Calculate mean AP for object detection task\n\n Parameters:\n ---------\n ovp_thresh : float\n overlap threshold ... | [
[
"matplotlib.pyplot.xlim",
"numpy.minimum",
"numpy.mean",
"numpy.where",
"numpy.concatenate",
"numpy.max",
"matplotlib.pyplot.savefig",
"numpy.arange",
"numpy.argmax",
"numpy.vstack",
"matplotlib.use",
"numpy.delete",
"numpy.array",
"numpy.zeros",
"matplo... |
sujitmandal/python | [
"9fbb1e5f58f9ff173874941dd2adb868088bf67a"
] | [
"GrayFrameImageCapture.py"
] | [
"import cv2\r\nimport time\r\nimport pandas\r\nimport os\r\nfrom datetime import datetime\r\n\r\n#This programe is create by Sujit Mandal\r\n\r\n'''\r\nnote: in order to capture image yoy need to press \"space\" key from keybord\r\n\r\n'''\r\n\r\nfirst_frame = None\r\nstatus_list = [None ,None]\r\ntime = []\r\ndf =... | [
[
"pandas.DataFrame"
]
] |
csiro-hydrology/iRONS | [
"022182d85ed2e7799e5d65bb5b9ed04f91da7526"
] | [
"iRONS/Software/res_sys_sim.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nThis function implements the reservoir simulation model (res_sys_sim). First,\nit extracts and process the regulated flows contained in the Qreg variable. \nThis makes the regulated flow data readable by the mass balance function \n(mass_bal_func). Then, mass_bal_func links all the... | [
[
"numpy.array",
"numpy.arange",
"numpy.interp",
"numpy.zeros"
]
] |
hasukmin12/nnUNet_MDD_UNet_with_Semi_Supervised | [
"58c5665a5d89d1ad77038e5d6420be76fadab136",
"58c5665a5d89d1ad77038e5d6420be76fadab136"
] | [
"nnunet/training/network_training/HasTrainer_DP_DDense_3_branch.py",
"nnunet/training/network_training/nnUNet_variants/data_augmentation/nnUNetTrainerV2_DA3_for_DTC.py"
] | [
"# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ... | [
[
"numpy.vstack",
"torch.cuda.is_available",
"torch.cuda.amp.autocast",
"torch.tensor"
],
[
"numpy.vstack"
]
] |
shenyunhang/WS-JDS | [
"4827791640c5affef1af4b548333694973f5c0d5"
] | [
"detectron/core/config.py"
] | [
"# Copyright (c) 2017-present, Facebook, 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 required by applicabl... | [
[
"numpy.array",
"numpy.log"
]
] |
yaramohajerani/GL_learning | [
"aa8d644024e48ba3e68398050f259b61d0660a2e"
] | [
"obsolete_scripts.dir/convert_shapefile_single_tiles.py"
] | [
"#!/usr/bin/env python\nu\"\"\"\nconvert_shapefile_single_tiles.py\nYara Mohajerani\n\nRead output predictions before they're stitched together\n and the corresponding labels and convert to shapefile lines\n\"\"\"\nimport os\nimport sys\nimport rasterio\nimport numpy as np\nimport fiona\nimport imageio\nimport skim... | [
[
"numpy.count_nonzero",
"numpy.zeros",
"numpy.round",
"numpy.nonzero",
"scipy.ndimage.binary_fill_holes"
]
] |
ndrewwang/liiondb | [
"c9a30e818843dadbdc00f2334a38e49126a64d12"
] | [
"streamlit_gui/elements/query_box.py"
] | [
"import streamlit as st\nimport psycopg2\nimport inspect\nimport sys\nimport os\nimport importlib\nimport functions.fn_db as fn_db\nimport functions.fn_plot as fn_plot\nimport pandas as pd\nimport numpy as np\nimport webbrowser\nimport markdown\nimport base64\n\n# DASHBOARD PAGE ====================\n# @st.cache(su... | [
[
"pandas.read_sql"
]
] |
hoel-bagard/MNIST-TensorFlow | [
"cc3ac86d80dc7bdd726a9c7d14a006fb22b8f967"
] | [
"src/dataset/dataset_creator.py"
] | [
"import os\n\nimport tensorflow as tf\nimport numpy as np\n\nfrom src.dataset.mnist import load_mnist\nfrom src.dataset.cat_vs_dog import load_cat_vs_dog\nfrom src.dataset.fashion_mnist import load_fashion_mnist\nfrom src.dataset.data_augmentation import color_augment\n\n\nclass DatasetCreator:\n def __init__(se... | [
[
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.image.random_flip_left_right",
"tensorflow.image.convert_image_dtype",
"numpy.load",
"numpy.save"
]
] |
Hermine2015/deep_gcns_torch | [
"cb0bfaded1e75aecd0e9d7061317c7a28eebcf47"
] | [
"examples/sem_seg_dense/config.py"
] | [
"import os\nimport datetime\nimport argparse\nimport shutil\nimport random\nimport numpy as np\nimport torch\nfrom utils.tf_logger import TfLogger\nimport logging\nimport logging.config\nimport pathlib\nimport glob\nimport time\nimport uuid\nimport sys\n\n\nclass OptInit:\n def __init__(self):\n parser = ... | [
[
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.is_available"
]
] |
ghazalehnt/RecBole | [
"f1219847005e2c8d72b8c3cd5c49a138fe83276d",
"f1219847005e2c8d72b8c3cd5c49a138fe83276d"
] | [
"recbole/config/configurator.py",
"recbole/model/general_recommender/bm25vec.py"
] | [
"# @Time : 2020/6/28\n# @Author : Zihan Lin\n# @Email : linzihan.super@foxmail.com\n\n# UPDATE\n# @Time : 2020/10/04, 2021/3/2, 2021/2/17\n# @Author : Shanlei Mu, Yupeng Hou, Jiawei Guan\n# @Email : slmu@ruc.edu.cn, houyupeng@ruc.edu.cn, Guanjw@ruc.edu.cn\n\n\"\"\"\nrecbole.config.configurator\n##############... | [
[
"torch.cuda.is_available"
],
[
"torch.zeros",
"numpy.log10",
"torch.tensor"
]
] |
XavierXinweiWang/UnrealCV_Ubuntu | [
"4fdbb32f2096a4c95c0912d018ff4adb4801fb8b"
] | [
"client/python/createImageData.py"
] | [
"from __future__ import division, absolute_import, print_function\nimport os, sys, time, re, json\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom unrealcv import client\nimport PIL.Image\n\nimread = plt.imread\n\n\n# TODO: replace this with a better implementation\nclass Color(object):\n ''' A utility... | [
[
"numpy.asarray",
"numpy.ones",
"numpy.load",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
deltaautonomy/delta_perception | [
"7b40f005b9753464016207d142969890ff6ec031"
] | [
"erfnet/lane_detection.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n'''\nAuthor : Heethesh Vhavle\nEmail : heethesh@cmu.edu\nVersion : 1.0.0\nDate : Sep 18, 2019\n'''\n\n# Python 2/3 compatibility\nfrom __future__ import print_function, absolute_import, division\n\n# Standalone\nif __name__ == '__main__':\n import sys\n ... | [
[
"torch.no_grad",
"torch.softmax",
"torch.from_numpy",
"scipy.optimize.linear_sum_assignment",
"torch.load"
]
] |
rgbkrk/pandas | [
"67229f084751fdfeb440878609c92f601bc72df3"
] | [
"pandas/core/generic.py"
] | [
"# pylint: disable=W0231,E1101\nimport warnings\nimport operator\nimport weakref\nimport numpy as np\nimport pandas.lib as lib\n\nfrom pandas.core.base import PandasObject\nfrom pandas.core.index import Index, MultiIndex, _ensure_index\nimport pandas.core.indexing as indexing\nfrom pandas.core.indexing import _mayb... | [
[
"pandas.core.common.is_re_compilable",
"pandas.core.common._values_from_object",
"pandas.io.pickle.to_pickle",
"pandas.core.common._ensure_int64",
"pandas.io.pytables.to_hdf",
"pandas.core.common._clean_fill_method",
"pandas.core.indexing.get_indexers_list",
"pandas.core.common._ma... |
kylmcgr/RL-RNN-SURF | [
"5d6db3e6ff4534003f2a7e832f221b5e529775d5",
"5d6db3e6ff4534003f2a7e832f221b5e529775d5"
] | [
"src/GL/fit/qlp_ml_rand_opt.py",
"src/actionflow/util/helper.py"
] | [
"# This file optimises QLP, but fits a separate model to each subject (instead of fitting a single model to\n# the whole group).\n\nimport sys\nfrom multiprocessing.pool import Pool\nfrom actionflow.data.data_process import DataProcess\nfrom actionflow.qrl.opt_ml import OptML\nfrom actionflow.qrl.ql import QL\nfrom... | [
[
"pandas.DataFrame",
"tensorflow.reset_default_graph",
"pandas.concat"
],
[
"numpy.dot",
"tensorflow.train.import_meta_graph",
"tensorflow.train.get_checkpoint_state",
"pandas.concat",
"tensorflow.trainable_variables",
"tensorflow.shape",
"pandas.DataFrame",
"tensorf... |
kdorst/hsqc-hemi | [
"799409eaaca622cd18100441e9bbc17dfa694d88"
] | [
"images.py"
] | [
"from PIL import Image\nimport numpy as np\nimport pathlib\n\nvalue_names = ['glc', 'man', 'gal', 'ara', 'xyl']\npred_names = ['glc_pred', 'man_pred', 'gal_pred', 'ara_pred', 'xyl_pred']\n\ntarget_width = 224\ntarget_height = 224\nchannels = 3\n\ndef get_data_files():\n files = []\n for subdir in pathlib.Pat... | [
[
"numpy.asarray"
]
] |
SilverSulfide/glow-tts | [
"f517d003c703da26341bb4468f6ba432bff1749f"
] | [
"train.py"
] | [
"import os\nimport json\nimport argparse\nimport math\nimport torch\nfrom torch import nn, optim\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\nimport torch.multiprocessing as mp\nimport torch.distributed as dist\nfrom apex.parallel... | [
[
"torch.distributed.init_process_group",
"torch.no_grad",
"torch.multiprocessing.spawn",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.utils.data.distributed.DistributedSampler",
"tor... |
AUFinalProject/Phase5-withRandom | [
"6b97da2b9d362efb6669715234a9833b6dfa1c47"
] | [
"allWHITE_random_2.py"
] | [
"# -------------------------------------------------------------------------------------------------------------------------------------------------------------\n# Main, three machines (image - KMC, text - Logistic Regression, features - RF) and all white pdfs files\n# @Authors: Alexey Titov and Shir Bentabou\n# @... | [
[
"sklearn.ensemble.AdaBoostRegressor",
"numpy.array",
"sklearn.metrics.confusion_matrix",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.cluster.KMeans",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.classification_report",
"sklea... |
CoderSLZhang/-LTSM- | [
"c163d53d5177d59e18b88ae5f05b0cf3a8aecf6a"
] | [
"tensorflow_imp_char/couplets_utils.py"
] | [
"# Author: zhangshulin \n# Email: zhangslwork@yeah.net \n# Date: 2018-04-30 \n# Last Modified by: zhangshulin\n\nFILF_PATH = './datasets/all_couplets.txt'\n\n\nfrom datasets_creator import Datasets_creator\nfrom batch_generator import Batch_generator\nimport numpy as np\n\n\ndef load_datasets(max_vocabs_size=5000,... | [
[
"tensorflow.Session",
"numpy.squeeze"
]
] |
chaosink/AdvMCDenoise | [
"a99bf312baf2430d750d70a79270aca0720532aa"
] | [
"codes/models/arch/generator_resnet.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torchvision\nfrom . import block as B\nimport functools\nimport torch.nn.functional as F\n\n\nclass ResNet(nn.Module):\n def __init__(self, in_nc, out_nc, nf, nb, norm_type='batch', act_type='relu', \\\n mode='NAC', res_scale=1):\n super... | [
[
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.ReLU"
]
] |
rasmushaugaard/surfemb | [
"53e1852433a3b2b84fedc7a3a01674fe1b6189cc",
"53e1852433a3b2b84fedc7a3a01674fe1b6189cc"
] | [
"surfemb/scripts/misc/compact_model.py",
"surfemb/pose_refine.py"
] | [
"\"\"\"\nBy default, the optimizer parameters are also saved with the model.\n\"\"\"\nimport argparse\n\nimport torch\n\nparser = argparse.ArgumentParser()\nparser.add_argument('model_path')\nargs = parser.parse_args()\n\nckpt = torch.load(args.model_path)\ntorch.save(dict(\n state_dict=ckpt['state_dict'],\n ... | [
[
"torch.load"
],
[
"numpy.array",
"torch.from_numpy",
"torch.logsumexp"
]
] |
rcmckee/patents-public-data | [
"b9b20d6ad6b18d5547be26b267a2c48ee6b5fa34"
] | [
"models/claim_breadth/trainer/task.py"
] | [
"# Copyright 2018 Google Inc. All Rights Reserved. Licensed under the Apache\n# License, Version 2.0 (the \"License\"); you may not use this file except in\n# compliance with the License. You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or ... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.estimator.TrainSpec",
"tensorflow.estimator.EvalSpec",
"tensorflow.estimator.RunConfig",
"tensorflow.contrib.training.python.training.hparam.HParams",
"tensorflow.estimator.train_and_evaluate"
]
] |
lpenuelac/ImageAnalysis | [
"a01b1278cca92e45fef6f5e41d1310cfbb041308"
] | [
"scripts/process.py"
] | [
"#!/usr/bin/env python3\n\n# This is the master ImageAnalysis processing script. For DJI and\n# Sentera cameras it should typically be able to run through with\n# default settings and produce a good result with no further input.\n#\n# If something goes wrong, there are usually specific sub-scripts that\n# can be r... | [
[
"numpy.linalg.inv"
]
] |
miradel51/pandas | [
"57c7daa3251e8fed3f3f709ab5bc8e707db99e98"
] | [
"pandas/tests/test_algos.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pytest\n\nfrom numpy.random import RandomState\nfrom numpy import nan\nfrom datetime import datetime\nfrom itertools import permutations\nimport struct\nfrom pandas import (Series, Categorical, CategoricalIndex,\n Timestamp, DatetimeIndex, In... | [
[
"pandas.DatetimeIndex",
"pandas.core.algorithms.value_counts",
"pandas.core.algorithms.factorize",
"pandas.CategoricalIndex",
"pandas._libs.algos.groupsort_indexer",
"pandas.core.common.asarray_tuplesafe",
"pandas.core.dtypes.dtypes.CategoricalDtype",
"pandas.Timestamp",
"panda... |
amishacorns/dnn-quant-ocs | [
"a43b9f101dbf95e034c404f89162ce0082e12ecf"
] | [
"distiller/data_loggers/logger.py"
] | [
"#\n# Copyright (c) 2018 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"torch.numel"
]
] |
timtyree/bgmc | [
"891e003a9594be9e40c53822879421c2b8c44eed"
] | [
"python/lib/lib_care/measure/bootstrap.py"
] | [
"import numpy as np, pandas as pd, dask.bag as db\nfrom scipy.stats import normaltest\nimport time\n\ndef test_normality(x,alpha = 0.05):\n '''performs D'Agostino and Pearson's omnibus test for normality.\n Returns p, True if significantly different from normal distribution'''\n _, p = normaltest(x)\n i... | [
[
"scipy.stats.normaltest",
"numpy.histogram",
"numpy.array",
"numpy.zeros",
"pandas.DataFrame",
"numpy.mean",
"numpy.std",
"numpy.ndarray",
"numpy.stack",
"numpy.random.randint"
]
] |
fzheng/backtester | [
"add76a410ed5215abea07486bd4b0ee57f11cdb5"
] | [
"algorithm.py"
] | [
"import numpy as np\n\n\nclass Algorithm:\n \"\"\"\n Example algorithm for trading. Must implement a \"generate_orders\" function which returns a list of orders.\n Each order is a tuple of the form\n ( Stock Ticker str, Current Price float, Order Amount in shares float)\n\n Algorithm trades for s... | [
[
"numpy.sign",
"numpy.mean",
"numpy.zeros",
"numpy.random.uniform"
]
] |
RobFirth/pycoco | [
"1c9be662b6dd67f8be5423568bb3ecbff2979492"
] | [
"pycocosn/defaults.py"
] | [
"\"\"\"\n\n\"\"\"\n\nimport os\n\nimport astropy.units as u\nimport matplotlib.pyplot as plt\n\n__all__ = [\"_default_data_dir_path\",\n \"_default_filter_dir_path\",\n \"_default_coco_dir_path\",\n \"_default_recon_dir_path\",\n \"_default_specphase_dir_path\",\n \... | [
[
"matplotlib.pyplot.get_cmap"
]
] |
Tawkat/Autonomous-Code-Review-Usefulness-Measurement | [
"e709eb4813123b713764ef6be8534dd29724c217"
] | [
"GerritAPI2/DbQuery.py"
] | [
"import sys\n\nreload(sys)\nsys.setdefaultencoding('utf8')\n\nimport sqlite3\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport operator\n\nconnection=sqlite3.connect('Gerrit.db')\nconnection.text_factory=str\ncursor=connection.cursor()\n'''\nreviewer=\"George Nash\"\ncursor.execute(\"Select COUNT(review_... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
lightwisemax/diabetic-retinopathy-pytorch | [
"a0710a00e5e4d5f220de66cb10dc34fd691be4a1"
] | [
"contrast/grad_cam.py"
] | [
"import torch\nimport cv2\nimport os\nimport sys\nimport numpy as np\nfrom torch.autograd import Variable\n\nsys.path.append('../')\nfrom contrast.models import vgg19\nfrom utils.util import add_prefix, remove_prefix, mkdir\n\n\nclass FeatureExtractor():\n \"\"\" Class for extracting activations and \n regist... | [
[
"numpy.max",
"numpy.uint8",
"numpy.zeros",
"torch.autograd.Variable",
"numpy.min",
"numpy.mean",
"torch.from_numpy",
"numpy.float32",
"numpy.transpose",
"numpy.maximum",
"torch.sum"
]
] |
fbenke-pik/aneris | [
"6d81bb17a37b019341056ccd1fdc49ffb0e90962"
] | [
"tests/test_default_decision_tree.py"
] | [
"import pandas as pd\nimport pytest\n\nfrom aneris import harmonize\n\nimport pandas.testing as pdt\n\n\ndef make_index(length, gas='CH4', sector='Energy'):\n return pd.MultiIndex.from_product(\n [[\"region_{i}\" for i in range(length)], [gas], [sector]],\n names=[\"region\", \"gas\", \"sector\"]\n... | [
[
"pandas.DataFrame",
"pandas.testing.assert_series_equal",
"pandas.Series"
]
] |
SiLab-Bonn/E3BeamMonitor | [
"3a06baf484b567db036b44b80f9d1ed519f0b6fd"
] | [
"analyse.py"
] | [
"''' Replay program to analyze data and test analysing setups. '''\nimport zmq\nfrom pybar.daq.readout_utils import is_data_record, get_col_row_array_from_data_record_array, is_fe_word\nfrom pybar.daq import readout_utils as ru\nfrom matplotlib import pyplot as plt\nimport numpy as np\nfrom pybar_fei4_interpreter i... | [
[
"numpy.median",
"matplotlib.pyplot.xlabel",
"numpy.sum",
"matplotlib.pyplot.plot",
"numpy.mean",
"numpy.any",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.var"
]
] |
AllenInstitute/project7 | [
"901350cdf5c57a56b7efece2a309c72bdf5f2608"
] | [
"src/pysonata/sonata/circuit/population.py"
] | [
"# Copyright 2017. Allen Institute. All rights reserved\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the\n# following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and ... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.isscalar",
"pandas.Series"
]
] |
rkneusel9/MathForDeepLearning | [
"8db1a85ce3cef4b48aab01ebe156e3fab2dfa271"
] | [
"chapter_02/birthday.py"
] | [
"#\n# file: birthday.py\n#\n# Simulate the birthday paradox\n#\n# RTK, 04-Jun-2020\n# Last update: 04-Jun-2020\n#\n################################################################\n\nimport numpy as np\n\n# Simulate picking two people at random, probability of sharing a birthday\nN = 100000\nmatch = 0\nfor i ... | [
[
"numpy.random.randint"
]
] |
lthUniBonn/AWERA | [
"fa7f210516318bcfcbe1c99abbb5954b0cbaf682"
] | [
"AWERA/power_production/kitepower_generator.py"
] | [
"import numpy as np\nfrom scipy import interpolate\n# Generator 100kW GS (?)\n\nload_steps = [0, 10, 25, 50, 75, 100, 125] # %\nfreq_steps = [0, 10, 20, 30, 40, 50, 80, 100] # Hz\nefficiency_by_frequency_load = [\n # Load / Frequency\n # 0% 10% 25% 50% 75% 100% 125%\n [0, 0, 0, 0, 0, 0, 0], # 0Hz\n [... | [
[
"numpy.abs",
"scipy.interpolate.interp2d"
]
] |
wasiur/VaccinationInIsrael | [
"fdcdc21b0bd5ba4a194ba75d18f4f19b8389b19c"
] | [
"ABC_2dose_MPI.py"
] | [
"\nfrom mpi4py import MPI\nimport pickle\nimport math\nimport time\nfrom scipy.spatial import distance\nfrom tabulate import tabulate\nfrom optparse import OptionParser\nfrom DSA_Vaccination_library import *\nfrom mycolours import *\nmy_plot_configs()\n\nassert MPI.COMM_WORLD.Get_size() > 1\ncomm = MPI.COMM_WORLD\n... | [
[
"scipy.spatial.distance.euclidean"
]
] |
shengwubin/SpectralNet | [
"19229f113b1a5b47d34080823c764b86f79e4804"
] | [
"src/utils/helperFunctions.py"
] | [
"\"\"\"\nSpectral Clustering Demo - Helper Functions\n\nECE 510\n\npython version: Python 3.7.2\n\nSpring 2019\n\"\"\"\n\nimport numpy as np\nimport scipy as sp\nimport math\nfrom numpy import linalg as lin\nfrom sklearn.cluster import KMeans\nfrom scipy.spatial.distance import squareform, pdist\nfrom scipy.optimiz... | [
[
"scipy.spatial.distance.pdist",
"numpy.fill_diagonal",
"numpy.zeros",
"numpy.sum",
"numpy.exp",
"scipy.optimize.linear_sum_assignment",
"numpy.where",
"numpy.sort",
"numpy.size",
"numpy.argsort",
"numpy.abs",
"numpy.diag",
"numpy.unique"
]
] |
vreis/CrypTen-2 | [
"839a751277a901e4edd9166a720fb3a29deac641",
"839a751277a901e4edd9166a720fb3a29deac641"
] | [
"crypten/nn/__init__.py",
"crypten/mpc/primitives/binary.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport io\n\nimport onnx\nimport torch\nimport torch.onnx.utils\nfrom onnx import numpy_helper\n\nfrom .lo... | [
[
"torch.onnx.export"
],
[
"torch.is_tensor",
"torch.stack",
"torch.broadcast_tensors"
]
] |
BrianPugh/grid-strategy | [
"1364397a80e5d6635c27629c139e73b003f05cd7"
] | [
"src/grid_strategy/_abc.py"
] | [
"\"\"\"Proof of concept code for MEP 30: Automatic subplot management.\"\"\"\nimport itertools as it\n\nfrom abc import ABCMeta, abstractmethod\n\nfrom matplotlib import gridspec\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nclass GridStrategy(metaclass=ABCMeta):\n \"\"\"\n Static class used to co... | [
[
"numpy.lcm.reduce",
"matplotlib.pyplot.figure"
]
] |
dasayan05/vanilla-GAN | [
"c48b7defa498d7c73276365d1fa946d2f4b88ffb"
] | [
"mlp.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\n\nclass MLP(nn.Module):\n # generalized MLP class for both\n # generator and discriminator nets\n\n def __init__(self, ip_size, units, activations=[], bn=True):\n # constructor\n super().__init__()\n\n # track the parameters\n ... | [
[
"torch.nn.Linear",
"torch.nn.BatchNorm1d"
]
] |
stjordanis/symbolic_deep_learning | [
"b7518a07d9de894af86db1a3a30b7b8b4f2daeb4"
] | [
"simulate.py"
] | [
"import jax\nfrom jax import ops\nfrom jax.ops import index_update\nfrom jax import numpy as np\nfrom matplotlib import pyplot as plt\nfrom jax import jit, vmap, grad, pmap\nfrom jax.experimental.ode import odeint\nfrom jax import random\nimport numpy as onp\nimport matplotlib as mpl\nimport multiprocessing\nfrom f... | [
[
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"matplotlib.cm.gist_ncar"
]
] |
kamil1338/User-Activity-Classification-Model | [
"1dc3d7f1dc6d266f8147e5cfa7975226c1acdc1f"
] | [
"training/train/train_and save_model_X.py"
] | [
"import tensorflow as tf\n\nfrom data.npy_file_util import load_npy_file, create_dir_if_necessary\nfrom plot_util import show_loss, show_accuracy, print_loss_acc\nfrom training.path_util import npy_files_dir_path, model_saving_dir_path\n\n\ndef execute():\n train_data = load_npy_file(npy_files_dir_path + 'train_... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.layers.Dense"
]
] |
sisl/CEEM | [
"6154587fe3cdb92e8b7f70eedb1262caa1553cc8",
"6154587fe3cdb92e8b7f70eedb1262caa1553cc8"
] | [
"ceem/odesolver.py",
"ceem/smoother.py"
] | [
"#\n# File: odesolver.py\n#\n\nimport abc\nimport torch\n\n\nclass Euler:\n\n @staticmethod\n def step_func(func, t, dt, y, u, transforms=None):\n return tuple(dt * f_ for f_ in func(t, y, u=u))\n\n @property\n def order(self):\n return 1\n\n\nclass Midpoint:\n\n @staticmethod\n def ... | [
[
"torch.is_tensor",
"torch.is_floating_point"
],
[
"torch.zeros",
"torch.no_grad",
"torch.inverse",
"torch.eye",
"torch.tensor",
"torch.randn"
]
] |
britneyting/resnet_chestxray | [
"7dcbb76883578d79ae31554c003c7dcfe93323de"
] | [
"split_data.py"
] | [
"import os\nimport pandas as pd\nimport numpy as np\n\nfrom resnet_chestxray import model_utils\n\n\ncurrent_dir = os.path.dirname(__file__)\n\nmimiccxr_metadata = os.path.join(current_dir,\n\t\t\t\t\t\t\t\t 'mimic_cxr_edema/auxiliary_metadata/mimic_cxr_metadata_available_CHF_view.csv')\n\nregex_labels = os.path.jo... | [
[
"pandas.read_csv"
]
] |
sagarnair16/Machine-Learning-Models | [
"a2b5bbce5887e2e81d594ed2d2344b99219acc39"
] | [
"Machine Learning/Part 2 - Regression/Section 5 - Multiple Linear Regression/Multiple_Linear_Regression/multiple_linear_regression_allin.py"
] | [
"# Import Libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n#import dataset from working directory\ndataset= pd.read_csv('50_Startups.csv')\nx= dataset.iloc[:,:-1].values\ny= dataset.iloc[:,4].values\n\n#Encode categorical data\nfrom sklearn.preprocessing import LabelEncoder, On... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"pandas.read_csv",
"sklearn.cross_validation.train_test_split",
"sklearn.preprocessing.One... |
safiza-web/ru-gpts | [
"08416ee32141432f834cd6b2f8aeba83008a69f8"
] | [
"src/model/gpt3_modeling.py"
] | [
"# coding=utf-8\n# Copyright (c) 2020, Sber. 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 ... | [
[
"torch.nn.functional.linear",
"torch.nn.init.normal_",
"torch.nn.Embedding",
"torch.nn.Dropout"
]
] |
trickyMan/paraview_view | [
"3b38670e8259b688093e0d7ba2fe2edd7c5d57a7"
] | [
"Wrapping/Python/paraview/extract_selection.py"
] | [
"r\"\"\"This module is used by vtkPythonExtractSelection to extract query-based\nselections. It relies on the python-calculator (vtkPythonCalculator),\nspecifically, the Python code used by that class, to compute a mask array from\nthe query expression. Once the mask array is obtained, this filter will either\nextr... | [
[
"numpy.int8"
]
] |
language-brainscore/lang-brainscore-fuzzy-potato | [
"d436f525856ea445d207d49e65000e25a4bbeabf"
] | [
"langbrainscore/interface/metric.py"
] | [
"import typing\nfrom abc import ABC, abstractmethod\n\nimport numpy as np\nfrom langbrainscore.interface.cacheable import _Cacheable\n\n\nclass _Metric(_Cacheable, ABC):\n # class _Metric(ABC):\n \"\"\"\n checks that two arrays are comparable for a given similarity metric,\n then applies that metric to ... | [
[
"numpy.array",
"numpy.isnan",
"numpy.zeros"
]
] |
PacktPublishing/Hands-On-Deep-Learning-with-Caffe2 | [
"0c9fd6beee481c95fea127c3190f8018d62669e0"
] | [
"Section_6_BlueWhale/ml/rl/training/conv/cnn.py"
] | [
"#!/usr/bin/env python3\n\n\nimport math\nfrom typing import List, Optional\n\nimport numpy as np\nfrom caffe2.python import brew, core, workspace\nfrom caffe2.python.model_helper import ModelHelper\nfrom ml.rl.custom_brew_helpers.conv import conv_explicit_param_names\nfrom ml.rl.thrift.core.ttypes import CNNParame... | [
[
"numpy.zeros"
]
] |
molamolabbb/aws-mwaa-local-runner | [
"557a29d10d07d0f267cb54b26bb2aacc5c4a8cf5"
] | [
"dags/s3/create_juso_db.py"
] | [
"import boto3\nimport pandas as pd\nfrom io import StringIO\n\ndef _process_en_row(row_str):\n \"\"\"Processes a single row of a en address data file.\"\"\"\n comps = row_str.split('|')\n assert len(comps) == 18\n return {\n 'city_name': comps[1], 'gu_name': comps[2], 'dong_name': comps[3],\n 'ri_... | [
[
"pandas.DataFrame",
"pandas.merge"
]
] |
Thijsvanede/AppScanner | [
"849117326d28cca2a3c40c6ac0e812d854ace8d4"
] | [
"appscanner/reader.py"
] | [
"from scapy.all import *\nimport numpy as np\nimport ipaddress\n\nclass Reader(object):\n\n def __init__(self, verbose=False):\n \"\"\"Reader object for reading packets from .pcap files.\n\n Parameters\n ----------\n verbose : boolean, default=false\n If Tru... | [
[
"numpy.array"
]
] |
LiyuanLucasLiu/allennlp | [
"da81516cbe78b58c2f2a3a9e56ef2526bd72fb9f"
] | [
"allennlp/modules/elmo_lstm.py"
] | [
"\"\"\"\nA stacked bidirectional LSTM with skip connections between layers.\n\"\"\"\nfrom typing import Optional, Tuple, List\nimport warnings\n\nimport torch\nfrom torch.nn.utils.rnn import PackedSequence, pad_packed_sequence\nwith warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", category=Future... | [
[
"torch.cat",
"torch.stack",
"torch.FloatTensor",
"torch.nn.utils.rnn.pad_packed_sequence",
"numpy.transpose"
]
] |
tai271828/Cirq | [
"d75467def0430c8400fb90618d717744f1f1665d"
] | [
"cirq/sim/sparse_simulator.py"
] | [
"# Copyright 2018 The Cirq Developers\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 o... | [
[
"numpy.array",
"numpy.copyto",
"numpy.empty",
"numpy.reshape",
"numpy.dtype"
]
] |
LiuVII/Self-driving-RC-car | [
"2b156df7bd03385dfd893937bda858de9313c894"
] | [
"drive_9_acts.py"
] | [
"#!/bin/usr/env python3\nimport getch\nimport os\nimport sys\nimport time\nimport argparse\nimport urllib2\nimport subprocess\nimport cv2\nimport numpy as np\nimport pandas as pd\nfrom math import pi\nimport shutil\nfrom datetime import datetime\nimport select\nimport math\nfrom PIL import ImageOps\nfrom PIL import... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.argmax",
"numpy.mean"
]
] |
hnp0411/mmcaptioning | [
"47bcdee3734cdaaa96a34e927cdec5cc43cab538"
] | [
"mmcap/models/builder.py"
] | [
"\"\"\"\nLuke\n\"\"\"\nfrom mmcv.utils import Registry, build_from_cfg\nfrom torch import nn\n\n\nENCODERS = Registry('encoder')\nBACKBONES = Registry('backbone')\nNECKS = Registry('neck')\n\nDECODERS = Registry('decoder')\n\nLOSSES = Registry('loss')\n\nCAPTIONS = Registry('captions')\n\n\ndef build(cfg, registry,... | [
[
"torch.nn.Sequential"
]
] |
inamdarmusab/audio-filter | [
"c30b3b9560c99b5466ce319b93ff26bf109c8dd1"
] | [
"signal processing assignment 1.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun May 30 09:37:04 2021\r\n\r\n@author: Musab Inamdar\r\n\"\"\"\r\n\r\n# make a random image \r\n\r\n\r\n\r\nfrom matplotlib import pyplot as plt\r\nimport numpy as np\r\nimport scipy.signal as signal\r\n\r\n# 1)plot 3 sine wave \r\n\r\n# f1 = 2100\r\n# f2 = 2400\r... | [
[
"numpy.sin",
"scipy.signal.firwin",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.arange",
"scipy.signal.lfilter",
"matplotlib.pyplot.ylabel",
"numpy.cos",
"matplotlib.pyplot.show"
]
] |
rothnic/bokeh | [
"2c580d93419033b962d36e3c46d7606cc2f24606"
] | [
"examples/plotting/server/stocks.py"
] | [
"# The plot server must be running\n# Go to http://localhost:5006/bokeh to view this plot\n\nimport numpy as np\n\nfrom bokeh.sampledata.stocks import AAPL, FB, GOOG, IBM, MSFT\nfrom bokeh.plotting import figure, show, output_server, vplot\n\noutput_server(\"stocks\")\n\np1 = figure(x_axis_type = \"datetime\")\n\np... | [
[
"numpy.array",
"numpy.ones",
"numpy.convolve"
]
] |
BiomedicalMachineLearning/stLearn | [
"3cf0bc6e76aef44a81f2163064791ba0150a7429"
] | [
"stlearn/plotting/cci_plot.py"
] | [
"from matplotlib import pyplot as plt\nimport matplotlib\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport sys\nfrom anndata import AnnData\nfrom typing import Optional, Union\n\nfrom typing import Optional, Union, Mapping # Special\nfrom typing import Sequence, Iterable # ABCs\nfrom typing ... | [
[
"numpy.array",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
JuanLuisGozaloFdez/DevOpsLab4-Jupyter | [
"96a98c60593125607dee68f876d03ecb4952f36b"
] | [
"runbooks/show_something.py"
] | [
"import matplotlib.pyplot as plt\nx = range(1000)\ny = [i ** 2 for i in x]\nplt.plot(x,y)\nplt.show()"
] | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
teresafds/bokeh | [
"95b2a74ff463cfabdf9e3390951fa380166e6691"
] | [
"examples/models/file/basic_plot.py"
] | [
"''' A scatter plot of a smooth periodic oscillation. This example demonstrates red\ncircle scatter markers with black outlines, using the low-level ``bokeh.models``\nAPI.\n\n.. bokeh-example-metadata::\n :apis: bokeh.models.Circle, bokeh.models.Plot, bokeh.models.ColumnDataSource, bokeh.models.LinearAxis, bokeh... | [
[
"numpy.sin",
"numpy.arange"
]
] |
columbia-ai-robotics/adagrasp | [
"9b1bfbd0b639930949d44334bd2554c3c3f7f31f"
] | [
"gripper_module/gripper_wsg_50.py"
] | [
"import numpy as np\nfrom gripper_module.gripper_base import GripperBase\nimport time\n\n\nclass GripperWSG50(GripperBase):\n def __init__(self, bullet_client, gripper_size):\n r\"\"\" Initialization of WSG_50\n specific args for WSG_50:\n - gripper_size: global scaling of the gripper wh... | [
[
"numpy.array"
]
] |
joeization/cv_finalproject | [
"66c3917e8dce83eac0d46af086d8146d535bd8f7"
] | [
"demo.py"
] | [
"# USAGE\n# python video_facial_landmarks.py --shape-predictor shape_predictor_68_face_landmarks.dat\n# python video_facial_landmarks.py --shape-predictor shape_predictor_68_face_landmarks.dat --picamera 1\n\n# import the necessary packages\nfrom imutils.video import VideoStream\nfrom imutils import face_utils\nimp... | [
[
"numpy.concatenate",
"numpy.int32",
"numpy.linalg.norm"
]
] |
lihr04/PCA-OGD | [
"196d03701f22110479af9c1feb619fef6fe1562b"
] | [
"models/lenet.py"
] | [
"\n\nimport torch.nn as nn\n\n\nclass LeNet(nn.Module):\n\n def __init__(self, out_dim=10, in_channel=1, img_sz=32, hidden_dim=500):\n super(LeNet, self).__init__()\n feat_map_sz = img_sz//4\n self.n_feat = 50 * feat_map_sz * feat_map_sz\n self.hidden_dim = hidden_dim\n\n self.... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.Flatten"
]
] |
rickyHong/Cirq-repl | [
"5b31440d5b5bf5a66ee85ef5e44373ac89aa0eaf"
] | [
"cirq/sim/density_matrix_simulator_test.py"
] | [
"# Copyright 2019 The Cirq Developers\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 o... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.array_equal",
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.testing.assert_almost_equal",
"numpy.ones",
"numpy.eye",
"numpy.diag"
]
] |
libAtoms/extxyz | [
"f48a3c68a50eebaef035b8c615120dbccaaa38c6"
] | [
"tests/test_ase_cases.py"
] | [
"\n# additional tests of the extended XYZ file I/O\n# (which is also included in oi.py test case)\n# maintained by James Kermode <james.kermode@gmail.com>\n\nimport os\nfrom pathlib import Path\nimport numpy as np\nimport pytest\n\nfrom extxyz.extxyz import read, write\n\n# from ase.io.extxyz import key_val_str_to_... | [
[
"numpy.array",
"numpy.arange",
"numpy.testing.assert_equal"
]
] |
Danhyal-Masood/models | [
"5ceb3acfc48843f260bac9a8afae5f90c5409eed"
] | [
"official/staging/shakespeare/shakespeare_main.py"
] | [
"# Copyright 2019 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.random.categorical",
"numpy.array",
"tensorflow.io.gfile.GFile",
"tensorflow.train.latest_checkpoint",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.math.tanh",
"tensorflow.expand_dims",
"tensorflow.TensorShape",
"tensorflow.math.log",
"tensorflow.ke... |
ever-qxl/- | [
"e5b6bb67a9d6aaa0aaaa99c678073951b980c47f"
] | [
"Nb_ok_test.py"
] | [
"# coding: utf-8\r\n\r\n# NB\r\n\r\n# get_ipython().magic(u'matplotlib inline')\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib as mpl\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.colors as colors\r\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\r\nfrom sklearn import preproce... | [
[
"pandas.set_option",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"sklearn.naive_bayes.GaussianNB",
"numpy.mean",
"numpy.std",
"numpy.arange",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show"... |
Krittisak/ShapeDeepLearning | [
"e64fb1e35e075e166465da45bd89876bb0996ea8",
"e64fb1e35e075e166465da45bd89876bb0996ea8"
] | [
"bin/main.py",
"submit/poly.py"
] | [
"from shapes import Sphere, Torus, Pyramid, Cube, SquareTorus, Gridspace\nfrom datasets import Dataset\nfrom models import ConvModel\nfrom docopt import docopt\nfrom graph import Graph\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.stats import ortho_group\nimport json\nimport random\nimport gc\n\... | [
[
"numpy.random.seed"
],
[
"numpy.dot",
"numpy.polynomial.polynomial.polyval2d",
"numpy.random.randn",
"scipy.linalg.qr",
"numpy.polynomial.Polynomial",
"numpy.power"
]
] |
konradkorczynski/nonograms-solver | [
"2a17a93647b491676125a8af3dab9f80803df644"
] | [
"nonograms_solver/line.py"
] | [
"import numpy as np\n\n\nclass Line:\n def __init__(self, input_values: list, length: int, position: int):\n self.solved = False\n self.length = length\n self.position = position\n self.possible_solutions = self.get_possible_solutions(input_values)\n\n def get_possible_solutions(se... | [
[
"numpy.array",
"numpy.where",
"numpy.ma.masked_equal",
"numpy.apply_along_axis",
"numpy.ma.array"
]
] |
weihao996/Quarantine-Boys | [
"b74de4c989d58e0496901be7bf09c8acd9557527"
] | [
"src/wider/test_img.py"
] | [
"import sys\nimport argparse\nimport time\n\nimport tensorflow as tf\nimport cv2\nimport numpy as np\n\nfrom src.mtcnn import PNet, RNet, ONet\nfrom tools import detect_face, get_model_filenames\n\n\ndef main(args):\n\n img = cv2.imread(args.image_path)\n file_paths = get_model_filenames(args.model_dir)\n ... | [
[
"numpy.int_",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.train.import_meta_graph",
"tensorflow.global_variables",
"tensorflow.ConfigProto",
"numpy.transpose",
"tensorflow.placeholder",
"tensorflow.device"
]
] |
UKPLab/naacl2019-does-my-rebuttal-matter | [
"69b5311e5f5c51755091c0db8cffa8f17f01615a"
] | [
"RebuttalAnalysis/RevRespSimilarity/embed.py"
] | [
"import numpy as np\nfrom gensim.models import KeyedVectors\nfrom resources import EMBEDDING_PATH\nfrom sklearn.metrics.pairwise import cosine_similarity\n\ndef averageEmbedding(model,sentence,lowercase=True):\n if lowercase: sentence = sentence.lower()\n vecs = []\n for w in sentence.split(): # assume it'... | [
[
"numpy.zeros",
"numpy.mean",
"sklearn.metrics.pairwise.cosine_similarity"
]
] |
tomoki/deep-learning-from-scratch | [
"0b6144806b6b79462d6d65616a64b1774f876973"
] | [
"src/my_first_nn.py"
] | [
"import os\nimport sys\nimport numpy as np\nimport pickle\nimport matplotlib.pylab as plt\nsys.path.append(os.pardir)\n\nfrom dataset.mnist import load_mnist\n\n(x_train, t_train), (x_test, t_test) = load_mnist(flatten=True, normalize=True, one_hot_label=False)\n\nnetwork = pickle.load(open(\"../ch03/sample_weight.... | [
[
"numpy.max",
"numpy.dot",
"numpy.sum",
"numpy.exp",
"numpy.argmax"
]
] |
wineslab/deepbeam | [
"00bcebb043f2d9da8dd83300b12b9c253fde85b7"
] | [
"keras_code/DataGeneratorTestingCross.py"
] | [
"from DataGeneratorCross import DataGeneratorCross\nimport numpy as np\n\n\ndef main():\n gains = [40, 50, 60]\n tx_beams = np.arange(0, 24)\n num_frames_for_gain_tx_beam_pair = 100 # 10000\n\n # Order is gain *\n\n indexes = np.arange(\n 0,\n num_frames_for_gain_tx_beam_pair * len(tx_... | [
[
"numpy.arange"
]
] |
FILALIHicham/Numerical_Analysis_Optimization_Package | [
"b12b12bf529d0f42ab268fd29188e887fa6fbbdb"
] | [
"Plotting_Scripts/Elimination_Methods_Comparison.py"
] | [
"#=================================================\\\\Documentation//==================================================\r\n\r\n\"\"\"\r\nThis program generates and saves a gif file containing a comparison plot of the optimisation elimination methods\r\nthat we have imported in the package. In this program, I have ... | [
[
"numpy.array",
"numpy.vectorize",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.axes"
]
] |
wps712/MicroNetChallenge | [
"5edc5aaaf918826eb1669897024ad4e6f5220d3e"
] | [
"models/mixnet.py"
] | [
"import torch\nimport torch.nn as nn\n\nimport numpy as np\nfrom collections import OrderedDict\n\n__all__ = ['mixnet_m', 'mixnet_l', 'mixnet_s']\n\n\nclass Swish(nn.Module):\n def __init__(self, inplace=True):\n super(Swish, self).__init__()\n self.inplace = inplace\n\n def forward(self, x):\n ... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"numpy.ceil",
"torch.nn.Dropout",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.split",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.load",
"torch.nn.AdaptiveAvgPool2d"
]
] |
jackweiwang/mmdetection-to-tensorrt | [
"c31c32ee4720ff56010bcda77bacf3a110d0526c"
] | [
"mmdet2trt/models/roi_heads/bbox_heads/sabl_head.py"
] | [
"from mmdet2trt.models.builder import register_wraper, build_wraper\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom .bbox_head import BBoxHeadWraper\n\n\n@register_wraper(\"mmdet.models.roi_heads.bbox_heads.sabl_head.SABLHead\")\nclass SABLHeadWraper(BBoxHeadWraper):\n def __init__(sel... | [
[
"torch.cat",
"torch.nn.functional.softmax"
]
] |
anmoliiitd823/debaised-analysis | [
"1dddfa87de0a889156afa25fcd1626de11b715e3"
] | [
"intents/oversights/benchmark_set_too_different.py"
] | [
" \n\"\"\"\nCopyright 2020 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttps://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing,... | [
[
"pandas.concat"
]
] |
teleported/ds-fromscratch | [
"cbc598f1ba8d89412f4617cf19fc00e53bc55b28"
] | [
"chapter03/bar2.py"
] | [
"#!/usr/bin/python\n\nimport matplotlib\nmatplotlib.use('Qt4Agg')\n\nfrom collections import Counter\nfrom matplotlib import pyplot as plt\nimport random\n\ngrades = random.sample(range(100), 10)\ndeciles = [i // 10 * 10 for i in grades]\nhistogram = Counter(deciles)\n\nplt.bar([k - 4 for k in histogram.keys()], hi... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
malashinroman/recurrent-visual-attention | [
"7a0ba286e35565bf52eea7995e277d2c7c03d1ad"
] | [
"trainer.py"
] | [
"import torch\nimport torch.nn.functional as F\n\nfrom torch.autograd import Variable\nimport torch.optim as optim\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\n\nimport os\nimport time\nimport shutil\nimport pickle\n\nfrom tqdm import tqdm\nfrom utils import AverageMeter\nfrom model import RecurrentAtte... | [
[
"torch.zeros",
"torch.stack",
"torch.max",
"torch.autograd.Variable",
"torch.save",
"torch.nn.functional.mse_loss",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.load",
"torch.nn.functional.nll_loss",
"torch.Tensor",
"torch.mean",
"torch.sum"
]
] |
aaaqhbd/psa | [
"e000545acb7949f8efab451a6cfdbc80bbc33ca8"
] | [
"tool/torchutils.py"
] | [
"\nimport torch\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nimport os.path\nimport random\nimport numpy as np\nfrom tool import imutils\n\nclass PolyOptimizer(torch.optim.SGD):\n\n def __init__(self, params, lr, weight_decay, max_step, momentum=0.9):\n super().__init__(params, lr, weight... | [
[
"torch.zeros",
"numpy.equal",
"numpy.logical_not",
"numpy.less",
"numpy.reshape",
"numpy.not_equal",
"torch.ones",
"numpy.stack",
"numpy.transpose",
"numpy.flip",
"torch.Tensor",
"numpy.expand_dims"
]
] |
Vinc0110/scikit-rf | [
"c8501ad6d7a09e7bc79eb6df87b9e2d28868fca5"
] | [
"skrf/media/cpw.py"
] | [
"\n\n\"\"\"\ncpw (:mod:`skrf.media.cpw`)\n========================================\n\n.. autosummary::\n :toctree: generated/\n\n CPW\n\n\"\"\"\nfrom scipy.constants import epsilon_0, mu_0\nfrom scipy.special import ellipk\nfrom numpy import pi, sqrt, log, zeros, ones\nfrom .media import Media\nfrom ..tlineFun... | [
[
"numpy.log",
"numpy.sqrt"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.