repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
richter43/project_vg | [
"faf97ab4efc5bb74069cb3a683db8539725707f8"
] | [
"commons.py"
] | [
"\n\"\"\"\nThis file contains some functions and classes which can be useful in very diverse projects.\n\"\"\"\n\nimport os\nimport sys\nimport torch\nimport random\nimport logging\nimport traceback\nimport numpy as np\nfrom os.path import join\n\n\ndef make_deterministic(seed=0):\n \"\"\"Make results determinis... | [
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"numpy.random.seed"
]
] |
yz-cnsdqz/MOJO-release | [
"476b40c8111861c6ab6b193a68e634d9aeb4e407"
] | [
"experiments/vis_kps_amass.py"
] | [
"import os\nimport sys\nimport numpy as np\nimport open3d as o3d\nimport torch\nimport smplx\nimport cv2\nimport pickle\nimport pdb\n\nsys.path.append(os.getcwd())\nfrom experiments.utils.batch_gen_amass import BatchGeneratorAMASSCanonicalized\nfrom experiments.utils.vislib import *\n\n\n\n\ndef visualize(data, out... | [
[
"numpy.random.seed",
"numpy.uint8",
"numpy.eye",
"numpy.linalg.norm",
"numpy.stack",
"numpy.ones",
"numpy.array"
]
] |
individuodk/KaggleAux | [
"556c88f01e1c322f2371891b381964ca44ec9867"
] | [
"kaggleaux/utils.py"
] | [
"import sys\nfrom datetime import timedelta\nfrom pandas.io.data import DataReader\n\n\nclass ProgressBar(object):\n '''\n Return A simple textual progress bar.\n\n Parameters\n ----------\n tasks_completed : int\n should be an incremented value to measure the progress of your tasks.\n tota... | [
[
"pandas.io.data.DataReader"
]
] |
valdrinkoshi/tensorboard | [
"190cea32bfc8383141b4524464bf42f1ca234478"
] | [
"tensorboard/plugins/debugger/interactive_debugger_server_lib.py"
] | [
"# Copyright 2017 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.debug.lib.grpc_debug_server.EventListenerBaseServicer.__init__",
"tensorflow.python.debug.reconstruct_non_debug_graph_def",
"tensorflow.core.debug.debug_service_pb2.EventReply",
"tensorflow.logging.info",
"tensorflow.make_ndarray",
"tensorflow.compat.as_str"
]
] |
takumiw/Deep-Learning-for-Human-Activity-Recognition | [
"e5ae66c3824b0ded4c1e3db6c9671a3cc0eb7d49"
] | [
"models/cnn.py"
] | [
"\"\"\"Functions for training Convolutional Neural Network (CNN)\"\"\"\nimport os\nfrom typing import Any, Dict, List, Tuple\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras.models import Sequential, Model\nfrom tensorflow.keras.layers import Dense, Activation, Dro... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.backend.clear_session",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.D... |
sumitsidana/neural_collaborative_filtering | [
"1e13d282134ef309dcf14f51b3f1610f520852c4"
] | [
"evaluate_test_pandor.py"
] | [
"'''\nCreated on Apr 15, 2016\nEvaluate the performance of Top-K recommendation:\n Protocol: leave-1-out evaluation\n Measures: Hit Ratio and NDCG\n (more details are in: Xiangnan He, et al. Fast Matrix Factorization for Online Recommendation with Implicit Feedback. SIGIR'16)\n\n@author: hexiangnan\n'''\ni... | [
[
"numpy.array"
]
] |
FelippeRoza/object-detection-suite | [
"fbb9a914fe51f7bb97361cef79c3746930783422"
] | [
"models/yolov3.py"
] | [
"#######\n# most of the code taken/adapted from zzh8829:\n# https://github.com/zzh8829/yolov3-tf2\n#######\n\nimport numpy as np\nimport tensorflow as tf\nimport models.models_utils as models_utils\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.layers import (\n Add, Concatenate, Conv2D, Input, L... | [
[
"tensorflow.concat",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.minimum",
"tensorflow.keras.layers.ZeroPadding2D",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.regularizers.l2",
"tensorflow.ke... |
abahnasy/torchsparse | [
"59aea7e32c1f7a71f6326584cd9d9b020eff1db9"
] | [
"torchsparse/__init__.py"
] | [
"import torch\nfrom .sparse_tensor import *\nfrom .point_tensor import *\n\n__version__ = '1.1.0'\n\ndef cat(input_list, dim=1):\n assert len(input_list) > 0\n inputs = input_list[0]\n features = inputs.F\n coords = inputs.C\n cur_stride = inputs.s\n output_tensor = SparseTensor(torch.cat([inputs.... | [
[
"torch.cat"
]
] |
BenVuti/Booting-ML | [
"ea86dbfb8b3ab7450425fc06978fe7e246190546"
] | [
"Machine Learning A-Z/Part 1 - Data Preprocessing/Section 2 -------------------- Part 1 - Data Preprocessing --------------------/tuto.py"
] | [
"# Data Preprocessing\n\n# Import Libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Import dataset\ndataset = pd.read_csv('Data.csv')\nX = dataset.iloc[:, :-1].values\ny = dataset.iloc[:, 3].values\n\n# Taking care of missing data\nfrom sklearn.preprocessing import Imputer\nim... | [
[
"pandas.read_csv",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.Imputer",
"sklearn.preprocessing.StandardScaler",
"sklearn.preprocessing.LabelEncoder"
]
] |
optas/geo_tool | [
"286722e759e7b75c52a77827574aa66bbef858c6"
] | [
"utils/graph_generators.py"
] | [
"'''\nCreated on December 26, 2017\n\n@author: optas\nTODO: Merge/ re-factor (fundamentals/graph + graph_roles)\nPRELIMINARY CODE - not used/debugged yet. \n\n'''\n\nimport numpy as np\nimport random\n\nfrom scipy.sparse import coo_matrix\n\n\ndef adjacency_from_edges(edges, n_nodes, sparse=True, dtype=np.int32):\n... | [
[
"scipy.sparse.coo_matrix",
"numpy.ones_like",
"numpy.arange",
"numpy.array",
"numpy.zeros"
]
] |
ChenGeng-ZJU/PCC-RL | [
"6627a186643175ea68269d78e206e6bc45ac634f",
"6627a186643175ea68269d78e206e6bc45ac634f"
] | [
"src/plot_scripts/plot_training_curves.py",
"src/simulator/compare_syn_real_traces.py"
] | [
"import glob\nimport os\n\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom plot_scripts.plot_packet_log import PacketLog\nfrom simulator.trace import Trace\n\nRESULT_ROOT = \"../../results\"\nTRACE_ROOT = \"../../data/2019-09-17T22-29-AWS-California-1-to-Stanford-cellular-3-runs\"... | [
[
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.std",
"numpy.mean",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.ylabel"
],
[
"matplotlib.pyplot.title",
... |
Thiago-SMerces/synthetic-mine-maker | [
"e723d69429bd5656ec7740b74fc49709e66649f7"
] | [
"src/map.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Floor creator. Orchestrates the creation of drillholes, blockmodels\n# and geological shapes.\n\nfrom collections import defaultdict\nfrom src.geometry import *\nfrom src.objects import *\nimport concurrent.futures\nimport numpy as np\nimport random\nimport math... | [
[
"numpy.empty"
]
] |
TAMUparametric/PPOPT | [
"2d20f60e7e7c312f761d5563ba808bd0bb9361e5"
] | [
"src/ppopt/upop/linear_code_gen.py"
] | [
"import copy\nfrom typing import List\n\nimport numpy\nimport scipy.io as sio\nfrom datetime import datetime\n\nfrom ..solution import Solution\nfrom ..upop.language_generation import gen_array, gen_variable\nfrom ..upop.lib_upop.upop_cpp_template import cpp_upop\nfrom ..upop.lib_upop.upop_js_template import js_upo... | [
[
"numpy.block",
"numpy.array",
"scipy.io.savemat"
]
] |
LaurentBerger/libseek | [
"84e726c1e7955ae5bd7a5fa69988db417824b047"
] | [
"seek_bpc.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 vi:ts=4:noet\n# Bad pixel correction calibration for seek thermal camera\n\nimport sys, os, re, math\nimport pickle\nimport numpy as np\nimport cv2\n\nclass BPC_Static(object):\n\t\"\"\"\n\tPerform bad-pixels calibration and correction,\n\tassuming images have pixels in 0... | [
[
"numpy.array",
"numpy.zeros_like"
]
] |
FrancescoSaverioZuppichini/huggingface_hub | [
"b1cf2d8f47088d3fce2244058d222a4d8234b3ab"
] | [
"src/huggingface_hub/hub_mixin.py"
] | [
"import json\nimport os\nfrom pathlib import Path\nfrom typing import Dict, Optional, Union\n\nimport requests\n\nfrom .constants import CONFIG_NAME, PYTORCH_WEIGHTS_NAME\nfrom .file_download import hf_hub_download, is_torch_available\nfrom .hf_api import HfApi, HfFolder\nfrom .repository import Repository\nfrom .u... | [
[
"torch.device",
"torch.load"
]
] |
y0-causal-inference/ProPPA | [
"b3e737b99e863daea4f1e0414d5b17b82b74d774"
] | [
"enhanced_abc_sampler.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 17 21:17:48 2017\n\n@author: Anastasis\n\"\"\"\n\nimport numpy as np\n\nfrom abc_sampler import ABCSampler\nfrom utilities import gillespie,parameterise_rates,split_path,combine_times_states\n#from model_utilities import load_observations,get_updates\n\nclass Enh... | [
[
"scipy.stats.norm",
"scipy.stats.uniform",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.figure"
]
] |
ptocca/CP_Combination_Demo | [
"fcf58db802b840456c7be83ceb73a3f549946886"
] | [
"CP_Combination_Demo.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,py:percent\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.5.2\n# kernelspec:\n# display_name: Python(comb_demo)\n# language: python\n# name: comb_demo\... | [
[
"numpy.dot",
"numpy.linspace",
"numpy.cumsum",
"numpy.concatenate",
"numpy.max",
"numpy.mean",
"numpy.searchsorted",
"numpy.histogram",
"numpy.where",
"scipy.interpolate.UnivariateSpline",
"numpy.unique",
"numpy.clip",
"numpy.arange",
"numpy.eye",
"numpy... |
vkm41101/BioSPPy | [
"b47ac24d9cbc1164b491a9feedd532262c778eb3"
] | [
"biosppy/signals/bvp.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nbiosppy.signals.bvp\n-------------------\n\nThis module provides methods to process Blood Volume Pulse (BVP) signals.\n\n:copyright: (c) 2015-2018 by Instituto de Telecomunicacoes\n:license: BSD 3-clause, see LICENSE for more details.\n\"\"\"\n\n# Imports\n# compat\nfrom __future__... | [
[
"numpy.linspace",
"numpy.nonzero",
"numpy.copy",
"numpy.argmax",
"numpy.diff",
"numpy.mean",
"numpy.array"
]
] |
facebookresearch/UNOC | [
"9d40ea3114326fc0932e50b1faf23a27a2d86270"
] | [
"src/plots.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport numpy as np\nfrom vispy import visuals, scene\nimport time\n\n\nclass Vispy3DScatter:\n def __init__(self):\n self.Scat... | [
[
"numpy.random.random",
"numpy.repeat",
"numpy.array",
"numpy.zeros",
"numpy.empty"
]
] |
TAMU-VITA/SS-GCNs | [
"644f8a5f3b507be6d59be02747be406fabd8b8f9"
] | [
"SS-GMNN-GraphMix/GraphMix-comp/layer.py"
] | [
"import math\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.nn import init\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nfrom torch.nn.parameter import Parameter\n\nclass SparseMM(torch.autograd.Function):\n\n def __init__(self, sparse):\n super(SparseMM, self... | [
[
"torch.mm",
"torch.Tensor"
]
] |
wijnandhoitinga/nutils | [
"7ad6793ca5e3a43f45dcc0a4a795b381d2a0b9d4",
"7ad6793ca5e3a43f45dcc0a4a795b381d2a0b9d4"
] | [
"nutils/numeric.py",
"nutils/elementseq.py"
] | [
"\"\"\"\nThe numeric module provides methods that are lacking from the numpy module.\n\"\"\"\n\nfrom . import types, warnings\nimport numpy\nimport numbers\nimport builtins\nimport collections.abc\n\n_abc = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' # indices for einsum\n\n\ndef round(arr):\n return... | [
[
"numpy.sqrt",
"numpy.einsum",
"numpy.asarray",
"numpy.issubdtype",
"numpy.ndarray",
"numpy.cumsum",
"numpy.concatenate",
"numpy.broadcast",
"numpy.round",
"numpy.iinfo",
"numpy.searchsorted",
"numpy.divide",
"numpy.pad",
"numpy.greater",
"numpy.arange",
... |
atulyakumar97/fire-and-gun-detection | [
"081ef7838de6fa46098238c5da5878ea2024efda"
] | [
"yolo.py"
] | [
"import cv2\nimport numpy as np \nimport argparse\nimport time\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--webcam', help=\"True/False\", default=False)\nparser.add_argument('--play_video', help=\"Tue/False\", default=False)\nparser.add_argument('--image', help=\"Tue/False\", default=False)\nparser... | [
[
"numpy.argmax"
]
] |
nku-shengzheliu/Pytorch-TransVG | [
"dbe7b94873c04c3f2a85680780416f9a124bd993"
] | [
"utils/checkpoint.py"
] | [
"import os\nimport shutil\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\ndef save_checkpoint(state, is_best, args, filename='default'):\n if filename=='default':\n filename = 'TransVG_%s_batch%d'%(args.dataset,args.batch_size)\n\n checkpoint_name = './saved_models/%s_checkpoint.p... | [
[
"torch.load",
"torch.cuda.empty_cache",
"torch.save"
]
] |
StDario/ctx_zero_domain | [
"8b4276afaa749bede748720a2101931b4400e5f4"
] | [
"baseline_sockeye/training.py"
] | [
"# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You may not\n# use this file except in compliance with the License. A copy of the License\n# is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"l... | [
[
"numpy.random.get_state",
"numpy.isfinite"
]
] |
LuisCardosoDLD/polars | [
"04f3dfa2dec54e72bd1b006e9a0c9a112322b036"
] | [
"py-polars/tests/test_df.py"
] | [
"# flake8: noqa: W191,E101\nimport io\nimport sys\nfrom builtins import range\nfrom datetime import datetime\nfrom io import BytesIO\nfrom typing import Any, Iterator, Type\nfrom unittest.mock import patch\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nimport pytest\n\nimport polars as pl\nfrom p... | [
[
"numpy.random.seed",
"numpy.arange",
"pandas.DataFrame",
"numpy.random.randn",
"numpy.random.rand",
"pandas.date_range",
"numpy.array",
"numpy.random.randint"
]
] |
redbubble/pyrec | [
"8f1a7ed73b69352f960f33e643eb20be7e74830a"
] | [
"pyrec/implicit/annoy.py"
] | [
"import itertools\nimport logging\n\nimport annoy\nimport numpy as np\nfrom implicit.als import AlternatingLeastSquares\nfrom implicit.utils import augment_inner_product_matrix\n\nfrom pyrec import ImplicitRecommender\n\nlog = logging.getLogger(\"rb.recommendation\")\n\n\nclass ImplicitAnnoyRecommender(ImplicitReco... | [
[
"numpy.append",
"numpy.array",
"numpy.linalg.norm"
]
] |
jmpf2018/ShipAI | [
"cf2c26a6f7813eeedca85eca64d8e9984dada182"
] | [
"evaluate_learning.py"
] | [
"import numpy as np\nimport pickle\nimport matplotlib.pyplot as plt\nfrom ship_data import ShipExperiment\n\nfilename = 'ddpg_600kit_rn4_maior2_mem20k_target01_theta3_batch32_adam2'\nwith open('_experiments/history_' + filename+'.pickle', 'rb') as f:\n hist = pickle.load(f)\nf.close()\n\ndef _moving_average(a, n... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.cumsum",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
fkiaee/sparsecnn | [
"4df3b2fa175ce914efbb99a2f4d801dd293c1d73",
"4df3b2fa175ce914efbb99a2f4d801dd293c1d73"
] | [
"cifar10/ADMM_cifar.py",
"imagenet/imagenet_models.py"
] | [
"#!/usr/bin/env python\r\nfrom __future__ import print_function\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport os\r\nimport sys\r\nimport argparse\r\n# Add the ADMMutils module to the import path\r\nsys.path.append(os.path.realpath(os.path.join(os.path.dirname(__file__), '../')))\r\nimport ADMMutils\r\n... | [
[
"numpy.sqrt",
"tensorflow.cast",
"tensorflow.equal",
"tensorflow.Variable",
"tensorflow.get_collection",
"numpy.reshape",
"tensorflow.initialize_all_variables",
"tensorflow.Session",
"tensorflow.trainable_variables",
"tensorflow.argmax",
"tensorflow.train.shuffle_batch"... |
miquelramirez/tulip-control | [
"ce54897c242689f45ad33650f157bf1805b35ed6"
] | [
"tulip/graphics.py"
] | [
"# Copyright (c) 2013-2014 by California Institute of Technology\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# 1. Redistributions of source code must retain the above copyright\... | [
[
"matplotlib.pyplot.gca",
"numpy.linspace",
"numpy.prod",
"numpy.meshgrid",
"matplotlib.pyplot.figure"
]
] |
tvuong123/espnet | [
"24aa0296bc480d7b32250d71b988bb9c8fdc4466"
] | [
"test/test_e2e_st_transformer.py"
] | [
"# coding: utf-8\n\n# Copyright 2019 Hirofumi Inaguma\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\nimport argparse\nimport importlib\nimport logging\nimport numpy\nimport pytest\nimport torch\n\nfrom test.test_e2e_asr_transformer import run_transformer_copy\nfrom test.test_e2e_asr_transformer imp... | [
[
"torch.randn",
"torch.tensor",
"torch.no_grad",
"torch.rand",
"numpy.random.randn",
"numpy.random.rand"
]
] |
mansoorcheema/bark-ml | [
"349c0039a5f54778d6b7aea7fd18e3e979efc3a3"
] | [
"bark_ml/tests/capability_gnn_actor/actor_nets.py"
] | [
"# Copyright (c) 2020 fortiss GmbH\n#\n# Authors: Silvan Wimmer\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\nimport numpy as np\nimport time\nimport tensorflow as tf\n\nclass RandomActorNet:\n \"\"\"RandomActor which returns uniformely... | [
[
"numpy.random.uniform",
"numpy.resize",
"tensorflow.constant",
"tensorflow.math.reduce_mean"
]
] |
NicoleDeer/optimized-super-resolution | [
"deba8a5cff06ab3bd8bf99e207b582f4ddc1ffd1"
] | [
"codes/conv_loss/models.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\nimport torchvision\n\nimport pretrainedmodels.models.pnasnet as pnasnet\n\n\n# Assume input range is [0, 1]\nclass VGGFeatureExtractor(nn.Module):\n def __init__(self,\n feature_layer=34,\n use_bn=Fal... | [
[
"torch.device",
"torch.nn.AvgPool2d",
"torch.utils.model_zoo.load_url",
"torch.Tensor"
]
] |
gomtings/for_NEXO | [
"8274e4569d96d67d18d458fba48a3254772ea8e0"
] | [
"selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py"
] | [
"#!/usr/bin/env python3\nimport os\nimport numpy as np\n\nfrom common.realtime import sec_since_boot\nfrom common.numpy_fast import clip, interp\nfrom selfdrive.swaglog import cloudlog\nfrom selfdrive.modeld.constants import index_function\nfrom selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU\nfrom self... | [
[
"numpy.diag",
"numpy.min",
"numpy.arange",
"numpy.cumsum",
"numpy.ones",
"numpy.copy",
"numpy.diff",
"numpy.interp",
"numpy.any",
"numpy.column_stack",
"numpy.exp",
"numpy.argmin",
"numpy.array",
"numpy.zeros"
]
] |
gautierdag/cultural-evolution-engine | [
"54ea8d374ff4345c05f03eccfb2e93161e16a050"
] | [
"main.py"
] | [
"# Cultural Evolution using Shapes\n\nimport argparse\nimport sys\nimport pickle\nimport torch\nimport warnings\n\nfrom tensorboardX import SummaryWriter\nfrom utils import *\nfrom baseline_helper import get_training_data, save_example_images\n\nfrom EvolutionCEE import EvolutionCEE\n\n\ndef parse_arguments(args):\... | [
[
"torch.device",
"torch.cuda.device_count",
"torch.cuda.is_available"
]
] |
dlrudco/tensorflow_object_detection_v1 | [
"adc01cd76ae0d9d3b2e8dde3ec6bf4086f7da046"
] | [
"official/nlp/transformer/transformer_main.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.convert_to_tensor",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.train.latest_checkpoint",
"tensorflow.range",
"tensorflow.io.gfile.exists",
"tensorflow.train.Checkpoint",
"tensorflow.compat.v2.summary.create_file_writer",
"tensorflow.io.gfile.makedirs",
... |
mohsinkhn/seti-kaggle-tezdhar | [
"dd3b1dcb8729ed73c5bb6ce0041cd385c412156e"
] | [
"src/augmentations/spectogram_augmentations.py"
] | [
"\"\"\"Augmentations for spectograms\"\"\"\nfrom abc import abstractmethod\n\nimport cv2\nimport numpy as np\nfrom pathlib import Path\nimport PIL\nfrom PIL import Image\nfrom scipy.ndimage.filters import laplace\n\n\n\nclass RandomTransform:\n def __init__(self, p=0.5):\n self.p = p\n\n def __call__(s... | [
[
"numpy.asarray",
"numpy.concatenate",
"numpy.max",
"numpy.zeros_like",
"numpy.mean",
"numpy.exp",
"numpy.roll",
"numpy.clip",
"numpy.stack",
"numpy.std",
"numpy.diff",
"numpy.log1p",
"scipy.ndimage.filters.laplace",
"numpy.min",
"numpy.random.choice",
... |
waynecz/fedlearner | [
"06c682258d0d1f45f309b44c5009e92c46e1674b"
] | [
"fedlearner/data_join/raw_data_partitioner.py"
] | [
"# Copyright 2020 The FedLearner 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.compat.v1.gfile.Remove",
"tensorflow.compat.v1.gfile.ListDirectory",
"tensorflow.compat.v1.gfile.Exists",
"tensorflow.compat.v1.gfile.IsDirectory",
"tensorflow.compat.v1.gfile.GFile",
"tensorflow.compat.v1.gfile.MakeDirs"
]
] |
e-sha/admm-pruning | [
"ca3dd21c70192b62e584eb6432ee5dfe3e3b507c"
] | [
"tensorflow-mnist-code/solver.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\n\nclass AdmmSolver():\n def __init__(self,model): \n A=self.A = tf.placeholder(tf.float32, shape = [5, 5, 1, 20])\n B=self.B = tf.placeholder(tf.float32, shape = [5, 5, 1, 20])\n C=self.C = tf.placeholder(tf.float32, shape = [5, 5, 20, 50])\n D=self.D ... | [
[
"tensorflow.nn.l2_loss",
"tensorflow.placeholder",
"tensorflow.train.AdamOptimizer",
"tensorflow.name_scope"
]
] |
JavonneM/BlenderToRGBD | [
"59b26826d833f63f14dd14b2307370be8d9c6de8"
] | [
"generateRGBD.py"
] | [
"\"\"\"\nMIT License\n\nCopyright (c) 2017 Javonne Jason Martin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy... | [
[
"numpy.radians",
"numpy.linalg.inv",
"numpy.linalg.norm",
"numpy.uint16",
"numpy.array",
"numpy.zeros"
]
] |
felialois/iml_kmeans | [
"18bf7e81fd0815b77520a9e12bb7a00a275d681e"
] | [
"utils.py"
] | [
"import math\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\n# This function returns the euclidean distance between the two given points\ndef distance(p1, p2):\n summation = 0.0\n for i in range(len(p1)):\n summation += (p1[i] - p2[i]) ** 2\n return math.sqrt(summation)\n\n\n# Calculate th... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
jvpoulos/Attention-OCR | [
"e40a348183dd10eacac056ff72dcc70081e6d658"
] | [
"src/model/seq2seq.py"
] | [
"# Copyright 2015 Google Inc. All Rights Reserved. #\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.contrib.rnn.python.ops.rnn.rnn",
"tensorflow.python.ops.array_ops.shape",
"tensorflow.python.ops.math_ops.tanh",
"tensorflow.python.ops.array_ops.zeros",
"tensorflow.python.framework.ops.device",
"tensorflow.python.ops.nn_ops.softmax",
"tensorflow.python.ops.array_ops.stop_... |
magnus-haw/PlasmaPy | [
"ef86757f94f98edc00dcbe01a40431992091be9a"
] | [
"plasmapy/formulary/tests/test_parameters.py"
] | [
"\"\"\"Tests for functions that calculate plasma parameters.\"\"\"\n\nimport numpy as np\nimport pytest\nfrom astropy import units as u\nfrom astropy.tests.helper import assert_quantity_allclose\n\nfrom plasmapy.utils.exceptions import RelativityWarning, RelativityError\nfrom plasmapy.utils.exceptions import Physic... | [
[
"numpy.abs",
"numpy.array",
"numpy.sqrt",
"numpy.isclose"
]
] |
Focke-Wulf/mars | [
"7fbe1c7ef2f7e55455811ec511b68294546d04dc",
"7fbe1c7ef2f7e55455811ec511b68294546d04dc",
"7fbe1c7ef2f7e55455811ec511b68294546d04dc"
] | [
"mars/learn/proxima/simple_index/tests/test_simple_index.py",
"mars/dataframe/base/apply.py",
"mars/dataframe/indexing/tests/test_indexing.py"
] | [
"# Copyright 1999-2020 Alibaba Group Holding Ltd.\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 appl... | [
[
"numpy.asarray",
"pandas.DataFrame",
"numpy.testing.assert_array_equal",
"numpy.array",
"numpy.random.RandomState",
"numpy.testing.assert_array_almost_equal"
],
[
"numpy.errstate",
"pandas.RangeIndex",
"numpy.dtype"
],
[
"pandas.testing.assert_series_equal",
"pa... |
ares201005/qiskit-terra | [
"2ace54c00276a136b76407851bace247bd7e2c16",
"2ace54c00276a136b76407851bace247bd7e2c16"
] | [
"qiskit/circuit/library/standard_gates/ry.py",
"qiskit/extensions/unitary.py"
] | [
"# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\... | [
[
"numpy.array"
],
[
"numpy.log2",
"numpy.array"
]
] |
antonior92/plot-phase-plane | [
"fedf073dd28a8ca1a2d7035f8baf06b678fdb2da"
] | [
"dynplt/cobweb.py"
] | [
"\"\"\"\nCobweb plot function\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n__all__ = [\n 'cobweb'\n]\n\n\ndef cobweb(func, initial_conditon, nsteps, limits, args=(), ax=None):\n \"\"\"\n Plot cobweb diagram for onedimensional iterated functions\n ``x[n+1] = func(x[n])``.\n\n Para... | [
[
"matplotlib.pyplot.subplots",
"numpy.linspace"
]
] |
strickolas/achilles | [
"c1cd44443535856ae01f564c00bb819a9a9e61f2"
] | [
"javalect.py"
] | [
"import javalang\nimport re\nimport random\nimport string\nimport numpy as np\nimport csv\nfrom sklearn.utils.extmath import softmax\nfrom datetime import datetime\nfrom model import *\n\n\n# JavaClass: receives a `path` of a Java file, extracts the code,\n# converts the code from Allman to K&R, extracts the method... | [
[
"numpy.asarray"
]
] |
VOIX97/Bio-big-data_Homework_week2 | [
"d5e4e0b096efaa200574cb0da169c458de74896f"
] | [
"biobigdata/clustering/k_means.py"
] | [
"from sklearn.metrics import adjusted_rand_score\nfrom sklearn.cluster import KMeans\n\ndef k_means(train_feature,std_label):\n kmeans = KMeans(n_clusters=3).fit(train_feature)\n pre_label = kmeans.labels_\n print(\"Real label:\\n\",std_label)\n print(\"Predict label:\\n\",pre_label)\n return adjuste... | [
[
"sklearn.metrics.adjusted_rand_score",
"sklearn.cluster.KMeans"
]
] |
pietrobarbiero/deep-topological-learning | [
"21d5832b248b0c2e47e136b8ac7ca770aa96a391"
] | [
"experiments/dimensionality_samples.py"
] | [
"import logging\nimport os\nimport sys\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport tensorflow as tf\nfrom sklearn.cluster import KMeans\nfrom sklearn.datasets import make_classification\nfrom sklearn.preprocessing import StandardScaler\nfrom tensorflow.... | [
[
"matplotlib.pyplot.legend",
"sklearn.datasets.make_classification",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.rc",
"pandas.DataFrame",
"tensorflow.keras.backend.clear_session",
"matplotlib.pyplot.tight_layout",
"tensorflow.keras.Input",
"numpy.arange",
"matplotlib.pyplot... |
girisakar365/Project-Rent | [
"5c81975f41de630845cb5075ece54b1db4499fa7"
] | [
"Rent 6.5/Plot.py"
] | [
"from matplotlib import pyplot as p\r\nimport csv\r\nfrom source import Msg\r\n\r\ndef chart(location):\r\n Month=[]\r\n Total=[]\r\n\r\n with open(location,'r') as csv_file:\r\n\r\n csvfile = csv.DictReader(csv_file)\r\n \r\n try:\r\n for i in csvfile:\r\n Mo... | [
[
"matplotlib.pyplot.bar",
"matplotlib.pyplot.show",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure"
]
] |
KindaReeNgl/pymclevel | [
"8bf7b3d76479e007a51f3055198a8bcddb626c84"
] | [
"indev.py"
] | [
"\"\"\"\nCreated on Jul 22, 2011\n\n@author: Rio\n\nIndev levels:\n\nTAG_Compound \"MinecraftLevel\"\n{\n TAG_Compound \"Environment\"\n {\n TAG_Short \"SurroundingGroundHeight\"// Height of surrounding ground (in blocks)\n TAG_Byte \"SurroundingGroundType\" // Block ID of surrounding ground\n ... | [
[
"numpy.swapaxes",
"numpy.array"
]
] |
Originofamonia/vqa-project | [
"cf67b62ddf5732881dfb4278478accfd15c4df6d"
] | [
"nih/preprocess_nih.py"
] | [
"\"\"\"\nread saved box and feature pt file, parse to VQA dataset format\n\"\"\"\nimport os\nimport csv\nimport json\nimport numpy as np\nimport pandas as pd\nimport zarr\nimport collections\nfrom tqdm import tqdm\nimport torch\nfrom PIL import Image\nfrom spacy.tokenizer import Tokenizer\nimport spacy\nimport stri... | [
[
"pandas.read_csv",
"numpy.unique",
"torch.load",
"torch.cat",
"pandas.DataFrame",
"numpy.vstack",
"torch.save"
]
] |
WangXin93/mmpose | [
"28b6e9ac2f6ed195ab27fb04da2213fc885a5994"
] | [
"tests/test_pipelines/test_pose3d_transform.py"
] | [
"import copy\nimport os.path as osp\nimport tempfile\n\nimport mmcv\nimport numpy as np\nimport pytest\n\nfrom mmpose.datasets.pipelines import Compose\n\nH36M_JOINT_IDX = [14, 2, 1, 0, 3, 4, 5, 16, 12, 17, 18, 9, 10, 11, 8, 7, 6]\n\n\ndef get_data_sample():\n\n def _parse_h36m_imgname(imgname):\n \"\"\"P... | [
[
"numpy.diagflat",
"numpy.full",
"numpy.random.rand",
"numpy.testing.assert_allclose",
"numpy.load",
"numpy.testing.assert_array_almost_equal"
]
] |
thlaegler/cryptopy | [
"171158753fa5155dae69f02bd4820422c44adf9f"
] | [
"test.py"
] | [
"import numpy as np\n\nimport matplotlib.pyplot as plt\n\nfrom stock_prediction import create_model, load_data\nfrom parameters import *\n\n\ndef plot_graph(test_df):\n \"\"\"\n This function plots true close price along with predicted close price\n with blue and red colors respectively\n \"\"\"\n pl... | [
[
"matplotlib.pyplot.legend",
"numpy.expand_dims",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
tobinsouth/ProcessEntropy | [
"dae82797085d4aa0cf81c2a4bc8c1cc08a191b25"
] | [
"example_usage.py"
] | [
"# Example usage\n\nfrom ProcessEntropy.SelfEntropy import *\nfrom ProcessEntropy.CrossEntropy import *\nfrom ProcessEntropy.Predictability import *\n\n\n# Basic Usage\nimport nltk\n\nemma = nltk.corpus.gutenberg.words('austen-emma.txt')\nsense = nltk.corpus.gutenberg.words('austen-sense.txt')\nshakespear = nltk.co... | [
[
"pandas.read_csv"
]
] |
slabbaki/discriminative-subtyping | [
"fc9ce91da79aa35360ad916db19cd73449344335"
] | [
"cen/data/support2.py"
] | [
"\"\"\"Loaders and preprocessors for SUPPORT2 data.\"\"\"\n\nimport logging\nimport os\n\nimport numpy as np\nimport pandas as pd\n\nlogger = logging.getLogger(__name__)\n\n# Data parameters\nTRAIN_SIZE, VALID_SIZE, TEST_SIZE = 7105, 1000, 1000\nEXCLUDE_FEATURES = [\n \"aps\", \"sps\", \"surv2m\", \"surv6m\", \"... | [
[
"pandas.read_csv",
"numpy.pad",
"numpy.random.rand",
"numpy.random.RandomState",
"pandas.get_dummies"
]
] |
jattenberg/sktime | [
"30b06140eb6e94b2845e6239efd679414dc13188"
] | [
"sktime/classification/dictionary_based/_muse.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\" WEASEL+MUSE classifier\nmultivariate dictionary based classifier based on SFA transform, dictionaries\nand linear regression.\n\"\"\"\n\n__author__ = \"Patrick Schäfer\"\n__all__ = [\"MUSE\"]\n\nimport math\nimport numpy as np\nfrom numba import njit\nfrom sklearn.feature_extraction... | [
[
"sklearn.feature_selection.chi2",
"sklearn.linear_model.LogisticRegression",
"numpy.asarray",
"numpy.int32",
"numpy.where",
"sklearn.feature_extraction.DictVectorizer",
"numpy.array",
"numpy.zeros",
"sklearn.utils.check_random_state"
]
] |
huent189/onnx2keras | [
"edd7758453e2d066b281f64b60f543a80b9193cd"
] | [
"onnx2keras/operation_layers.py"
] | [
"from tensorflow import keras\nfrom tensorflow.keras import backend as K\nimport logging\nfrom .utils import is_numpy, ensure_tf_type, ensure_numpy_type\nimport numpy as np\n\n# Handle python 2.7 import error\ntry:\n from collections.abc import Iterable\nexcept ImportError:\n from collections import Iterable\... | [
[
"tensorflow.clip_by_value",
"tensorflow.norm",
"tensorflow.keras.backend.int_size",
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.backend.int_shape",
"tensorflow.keras.backend.sum",
"tensorflow.keras.backend.max",
"tensorflow.keras.backend.... |
despargy/Shade | [
"8ed54c80154448c2cdc29623c2798a01d594995e"
] | [
"Analysis/plot_altitude.py"
] | [
"import plot_line\nimport numpy as np\nimport reader\nimport render_figure\n\nclass PlotAltitude(plot_line.LinePlot):\n\n def __init__(self, fig_cluster, fig_name, fig):\n self.fig = fig\n self.fig_name = fig_name\n self.fig_cluster = fig_cluster\n self.config = self.get_config()\n ... | [
[
"numpy.nanmax",
"numpy.isnan",
"numpy.nanmin",
"numpy.append",
"numpy.delete",
"numpy.array"
]
] |
MatthewBeaudouinLafon/cardistry_rhythm | [
"e228db9aa502412360d7e18dfeb2352d3e4f493c"
] | [
"src/main.py"
] | [
"import os\nimport math\nimport time\nfrom enum import Enum\nimport numpy as np\nimport cv2 as cv\nimport matplotlib.pyplot as plt\nfrom matplotlib.transforms import Bbox\n\nfrom MetricManager import MetricManager\n\n# IDEAS: \n# - Analyze motion by subtracting average flow to each flow vector.\n# Removes overall m... | [
[
"numpy.zeros_like",
"numpy.random.randint"
]
] |
sdrave/pymor | [
"3fa4adf0fcc8e34eacc6c2dc9d5439046cf8fc0a",
"3fa4adf0fcc8e34eacc6c2dc9d5439046cf8fc0a"
] | [
"src/pymor/gui/qt.py",
"src/pymordemos/thermalblock.py"
] | [
"# This file is part of the pyMOR project (http://www.pymor.org).\n# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler\n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n#\n# Contributors: Andreas Buhr <andreas@andreasbuhr.de>\n# Michael Schaefer <michael.schaefe... | [
[
"numpy.max",
"numpy.min"
],
[
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.legend",
"numpy.linspace",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
freyrsae/pydatalab | [
"9aba1ac6bbe8e1384e7a4b07c5042af84348797d"
] | [
"tests/_util/generic_feature_statistics_generator_test.py"
] | [
"# Copyright 2017 Google Inc. 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 required by appl... | [
[
"numpy.datetime64",
"numpy.dtype",
"tensorflow.python.platform.googletest.main",
"pandas.DataFrame"
]
] |
ElJdP/mplsoccer | [
"8a4558c4950bd9e88785ec59e5148af40ab90acf"
] | [
"examples/pitch_plots/plot_heatmap_gaussian.py"
] | [
"\"\"\"\n================\nHeatmap smoothed\n================\n\nTom Decroos, author of matplotsoccer (https://github.com/TomDecroos/matplotsoccer),\nasked whether it was possible to plot a Gaussian smoothed heatmaps,\nwhich are available in matplotsoccer.\nHere is an example demonstrating this.\n\"\"\"\n\nimport m... | [
[
"scipy.ndimage.gaussian_filter",
"matplotlib.pyplot.style.use"
]
] |
czbiohub/ercc_exploration | [
"f158d0012d0620a25b6e77c3ec1ed902c79fd71b"
] | [
"get_ercc_substitution_rate.py"
] | [
"\"\"\" get the ERCC substitution rate for a set of scRNA-seq alignment (.bam) files \"\"\"\n\nimport pandas as pd\nimport os\nimport csv\nimport re\nimport sys\nimport numpy as np\n\n\ndef split_at_upper_case(text):\n \"\"\" splits a given string AFTER each upper case letter \"\"\"\n result = \"\"\n for c... | [
[
"numpy.amax",
"pandas.Series",
"numpy.amin",
"numpy.median",
"numpy.quantile",
"numpy.mean"
]
] |
KIT-IBT/AugmentA | [
"b44ea02a4c6e33fd6c14ce3cf180d5603ff660b1"
] | [
"Atrial_LDRBM/LDRBM/Fiber_LA/la_generate_fiber.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Apr 19 14:55:02 2021\n\n@author: Luca Azzolin\n\nCopyright 2021 Luca Azzolin\n\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements. See the NOTICE file\ndistributed with this work for additional... | [
[
"pandas.read_csv",
"numpy.linalg.norm",
"numpy.setdiff1d",
"numpy.max",
"numpy.append",
"numpy.copy",
"numpy.intersect1d",
"numpy.cross",
"numpy.where",
"numpy.sum"
]
] |
manueltonneau/academic-budget-bert | [
"19e8d2d758e7315bd5f841fe215c5f6f05cd6812"
] | [
"run_pretraining.py"
] | [
"# coding=utf-8\n# Copyright 2021 Intel Corporation. All rights reserved.\n# code taken from commit: 35b4582486fe096a5c669b6ca35a3d5c6a1ec56b\n# https://github.com/microsoft/DeepSpeedExamples/tree/master/bing_bert\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file e... | [
[
"torch.cuda.synchronize",
"torch.utils.data.distributed.DistributedSampler",
"numpy.isnan",
"torch.utils.data.DataLoader",
"torch.distributed.barrier",
"torch.cuda.is_available",
"torch.distributed.get_rank",
"torch.distributed.get_world_size",
"torch.utils.data.sampler.RandomS... |
neurospin/pylearn-mulm | [
"cfbcda8312a495a8e82657e04b67dc95db2a3306"
] | [
"mulm/utils.py"
] | [
"# -*- coding: utf-8 -*-\n##########################################################################\n# Created on Created on Thu Feb 6 15:15:14 2020\n# Copyright (c) 2013-2021, CEA/DRF/Joliot/NeuroSpin. All rights reserved.\n# @author: Edouard Duchesnay\n# @email: edouard.duchesnay@cea.fr\n# @license: BSD 3-cl... | [
[
"numpy.abs",
"numpy.sum"
]
] |
SimeoW/Bitcoin-Simulator | [
"e4afac04c3ac4a9086d82c1825dbccb429fe647c"
] | [
"data/bitcoin_latencies/3_remove_one_half_percentile_outliers.py"
] | [
"# Given the bitcoin_latencies.csv file, this file will strip off the top 1 percentile and bottom 1 percentile of the data\n# The data will be outputted to bitcoin_latencies_removed_1_percentile.csv\n\nimport csv\nimport numpy\n\n# Return the threshold separating the top 99% of the data\ndef getQuantiles():\n\tread... | [
[
"numpy.percentile"
]
] |
sluedtke/borg_hydro | [
"ef856784191e21e98e7fe8dd906c0dd9f82fd4ff"
] | [
"borg_hydro/swimpy/gof_python.py"
] | [
"#!/usr/bin/python\n######################################################################\n\n# Filename: gof_python.py\n\n# Author: Stefan Luedtke\n\n######################################################################\n\nimport pandas as pd\nimport numpy as np\n\n\n##################################... | [
[
"numpy.square",
"numpy.log",
"pandas.merge",
"numpy.sqrt",
"pandas.melt"
]
] |
JovanWang/AdaptiveStreamSpTTMFramework | [
"3ba43efe0d78a3f93c14c03cb959db0b00927ab4"
] | [
"pygExp/graphclassexpgpu.py"
] | [
"import os.path as osp\n\nimport torch\nimport torch.nn.functional as F\n# from torch.nn import Linear\nfrom torch_geometric.data import DataLoader\nfrom torch_geometric.datasets import Matformatgpu,Matformattestgpu\n# from torch_geometric.data import Matformatgpu \nfrom torch_geometric import transforms as T\nimpo... | [
[
"torch.nn.functional.nll_loss",
"torch.cat",
"torch.nn.functional.dropout",
"numpy.concatenate",
"torch.nn.Linear",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.array",
"numpy.where",
"numpy.loadtxt",
"torch.save"
]
] |
lijiancheng0614/Paddle | [
"f980b29e6259b8e51f4ee04260e3a84233f337df"
] | [
"python/paddle/fluid/tests/book/high-level-api/image_classification/test_image_classification_vgg.py"
] | [
"# Copyright (c) 2018 PaddlePaddle 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 ... | [
[
"numpy.random.rand"
]
] |
jlanillos/clinAcc_PGx_WES | [
"cc9a5dc89520b05793b5e7fda1aa7cb953d22ff9"
] | [
"Figures_tables/0_Fig1B_QC_coverage.py"
] | [
"####################\n## SSV6 and CCP17 ##\n####################\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n# x is a vector of coverage values to plot\nx = list(np.arange(0,110,10))\n# Load reference alleles and extract hg19 \"actionable\" positions we aim to calculate coverage stat... | [
[
"pandas.read_csv",
"numpy.arange",
"matplotlib.pyplot.savefig",
"numpy.ceil",
"matplotlib.pyplot.subplots_adjust",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
hoechenberger/mne-bids | [
"f9eed4c34c06a3a71cbf092bc07d7593ffca0042"
] | [
"examples/convert_ieeg_to_bids.py"
] | [
"\"\"\"\n.. currentmodule:: mne_bids\n\n====================================\n08. Convert iEEG data to BIDS format\n====================================\n\nIn this example, we use MNE-BIDS to create a BIDS-compatible directory of iEEG\ndata. Specifically, we will follow these steps:\n\n1. Download some iEEG data fr... | [
[
"numpy.array",
"numpy.loadtxt"
]
] |
SiAce/Attention-Agent | [
"1f321883de055562d1cc6ecf5121849cde15d257"
] | [
"tasks/gym_task.py"
] | [
"import cv2\nimport gin\nimport gym\nfrom gym import spaces\nimport numpy as np\nimport os\nimport tasks.abc_task\nimport time\nimport car_racing_variants\nimport takecover_variants\n\n\nclass GymTask(tasks.abc_task.BaseTask):\n \"\"\"OpenAI gym tasks.\"\"\"\n\n def __init__(self):\n self._env = None\n... | [
[
"numpy.ones",
"numpy.argmax",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
ganeshkulkarni455/ssd | [
"7129331630c5a33a3dc184a8db5352151eaf6168"
] | [
"datasets.py"
] | [
"import torch\nfrom torch.utils.data import Dataset\nimport json\nimport os\nfrom PIL import Image\nfrom utils import transform\nimport glob\n\nimg_formats = ['.bmp', '.jpg', '.jpeg', '.png', '.tif']\n\nclass PascalVOCDataset(Dataset):\n \"\"\"\n A PyTorch Dataset class to be used in a PyTorch DataLoader to c... | [
[
"torch.stack",
"torch.ByteTensor",
"torch.LongTensor",
"torch.FloatTensor"
]
] |
xuritian317/pytorch-image-models | [
"034139e4871cddd0f6c24931b6ac380ba9f28711",
"034139e4871cddd0f6c24931b6ac380ba9f28711",
"034139e4871cddd0f6c24931b6ac380ba9f28711"
] | [
"timm/models/mlp_mixer.py",
"timm/models/mobilevit.py",
"main/old/transfg_ctfg/utils/autoaugment.py"
] | [
"\"\"\" MLP-Mixer, ResMLP, and gMLP in PyTorch\n\nThis impl originally based on MLP-Mixer paper.\n\nOfficial JAX impl: https://github.com/google-research/vision_transformer/blob/linen/vit_jax/models_mixer.py\n\nPaper: 'MLP-Mixer: An all-MLP Architecture for Vision' - https://arxiv.org/abs/2105.01601\n\n@article{tol... | [
[
"torch.addcmul",
"torch.ones",
"torch.zeros",
"torch.nn.init.constant_",
"torch.nn.Linear",
"torch.nn.Identity",
"torch.nn.init.ones_",
"torch.nn.init.normal_",
"torch.jit.is_scripting",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.zeros_"
],
[
"torch.nn.Conv... |
ycc252/pySRM | [
"0183f9af381f5f7d0b9d1ffe6ba9c1a0b3ba12c7"
] | [
"src/modules/SR.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # 1. Read and Order Data Frame\n\n# ## 1.1 Import packages\n\n# In[63]:\n\n\nimport numpy as np\nfrom matplotlib import pylab as plt\nimport pandas as pd\nfrom scipy.optimize import leastsq as lsq\nfrom scipy.optimize import curve_fit \nimport scipy.stats as spst\nfrom s... | [
[
"numpy.log",
"pandas.read_csv",
"numpy.abs",
"scipy.integrate.quad",
"numpy.exp",
"scipy.optimize.curve_fit",
"numpy.sum"
]
] |
6paklata/tensorflow | [
"d6464431256192d2cf1c9b20271792309af7a354"
] | [
"tensorflow/python/autograph/pyct/inspect_utils_test.py"
] | [
"# Copyright 2017 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.autograph.pyct.inspect_utils.islambda",
"tensorflow.python.autograph.pyct.inspect_utils.getmethodclass",
"tensorflow.python.autograph.pyct.inspect_utils.SuperWrapperForDynamicAttrs",
"tensorflow.python.autograph.pyct.inspect_utils.getfutureimports",
"tensorflow.python.autogr... |
BDAII/SubgroupModeling | [
"6ecc3182d0178929cb8c72c5714bb43b15f07b1b"
] | [
"pub_function.py"
] | [
"import os\r\nimport pickle\r\nimport shap\r\nimport logging\r\nimport warnings\r\n\r\nwarnings.filterwarnings('ignore')\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport lightgbm as lgb\r\n\r\n# from pub_class import *\r\n\r\nfrom scipy import stats\r\nfrom scipy.stats import levene\r\nfrom scipy.stats im... | [
[
"sklearn.metrics.roc_auc_score",
"pandas.concat",
"numpy.log2",
"numpy.abs",
"sklearn.model_selection.StratifiedKFold",
"pandas.DataFrame",
"sklearn.feature_selection.SelectKBest",
"numpy.std",
"numpy.mean",
"scipy.stats.levene",
"numpy.argsort",
"numpy.array",
... |
cmranieri/FullySpikingVAE | [
"c59e7e704f55246dd2e9891964259d2e611917fa"
] | [
"metrics/inception_score.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nimport torch.utils.data\n\nfrom torchvision.models.inception import inception_v3\n\nimport numpy as np\nfrom scipy.stats import entropy\nfrom tqdm import tqdm\n\ndef get_inception_score(model, device=torch.device(\"cuda:0\"), batch_size=256,... | [
[
"torch.nn.functional.softmax",
"numpy.std",
"scipy.stats.entropy",
"numpy.mean",
"torch.nn.Upsample",
"torch.device",
"numpy.zeros"
]
] |
aryabhata-archive/uniformaugment | [
"20633d21a26d4561cd85768912891ea6025cd76c"
] | [
"UniformAugment/train.py"
] | [
"import pathlib\nimport sys\n\nsys.path.append(str(pathlib.Path(__file__).parent.parent.absolute()))\n\nimport itertools\nimport json\nimport logging\nimport math\nimport os\nfrom collections import OrderedDict\n\nimport torch\nfrom torch import nn, optim\nfrom torch.nn.parallel.data_parallel import DataParallel\nf... | [
[
"torch.cuda.synchronize",
"torch.distributed.broadcast",
"torch.cuda.set_device",
"torch.load",
"torch.sum",
"torch.no_grad",
"torch.device",
"torch.distributed.get_rank",
"torch.distributed.get_world_size"
]
] |
spencerbraun/editable_nlp | [
"b22fb7a5c52f1002949ab60adf7d952e102c7e9d"
] | [
"src/masked_lm/train.py"
] | [
"import argparse\nimport sys\nfrom datetime import datetime\n\nimport numpy as np\nimport torch\n\nimport transformers\nimport higher\nimport wandb\n\nimport data\nfrom config import TrainConfig\n\nsys.path.append('../')\nimport utils\n\n\n\nclass T5Trainer:\n def __init__(self, config, train, validation, model_... | [
[
"torch.manual_seed",
"torch.no_grad",
"torch.cuda.is_available",
"torch.save"
]
] |
Ali-Elganzory/Algorithms-Project | [
"95604fdb24da4d8fdf0e36b0c3b4a33e30e80e7f"
] | [
"console/task_6.py"
] | [
"import numpy as np\n\n\nclass Grid():\n def __init__(self):\n self.n = None\n self.m = None\n self.triomino_list = [\n [(0, 0), (1, 0), (1, -1)],\n [(0, 0), (0, 1), (1, 1)],\n [(0, 0), (1, 0), (0, 1)],\n [(0, 0), (1, 0), (1, 1)]]\n\n def get... | [
[
"numpy.flipud",
"numpy.rot90",
"numpy.array"
]
] |
kmader/MMdnn | [
"f62a33a7d6834680537693c7fdc7e90e1b2382ef"
] | [
"mmdnn/conversion/tensorflow/saver.py"
] | [
"import tensorflow as tf\n\n\ndef save_model(MainModel, network_filepath, weight_filepath, dump_filepath, dump_tag = 'SERVING'):\n if dump_tag == 'SERVING':\n tag_list = [tf.saved_model.tag_constants.SERVING]\n else:\n tag_list = [tf.saved_model.tag_constants.TRAINING]\n input, model = MainMo... | [
[
"tensorflow.saved_model.signature_def_utils.build_signature_def",
"tensorflow.saved_model.builder.SavedModelBuilder",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.saved_model.utils.build_tensor_info"
]
] |
rlizzo/hangar-py | [
"a6deb22854a6c9e9709011b91c1c0eeda7f47bb0"
] | [
"tests/test_cli.py"
] | [
"from os import getcwd\nimport os\nfrom pathlib import Path\n\nimport numpy as np\nimport pytest\nfrom click.testing import CliRunner\n\nfrom hangar import Repository\nfrom hangar.cli import cli\nfrom hangar.external import PluginManager\nfrom conftest import fixed_shape_backend_params\n\n\n# ----------------------... | [
[
"numpy.arange",
"numpy.random.random",
"numpy.allclose"
]
] |
ctherien/pysptools | [
"fbcd3ecaa7ab27f0158b28b4327537c3e75db160",
"fbcd3ecaa7ab27f0158b28b4327537c3e75db160"
] | [
"pysptools/skl/km.py",
"pysptools/ml/cv.py"
] | [
"#\r\n#------------------------------------------------------------------------------\r\n# Copyright (c) 2013-2014, Christian Therien\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the Li... | [
[
"numpy.reshape",
"sklearn.cluster.KMeans"
],
[
"numpy.reshape",
"sklearn.model_selection.KFold",
"numpy.unique"
]
] |
jzi040941/ScheduleRecognition | [
"8a7d83d8a5b7c38d3c02b556d4adbac3dc58c6a2"
] | [
"model/keras_retinanet/keras_retinanet/preprocessing/pascal_voc_daytimetbseg.py"
] | [
"\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable la... | [
[
"numpy.append",
"numpy.zeros"
]
] |
SoyBison/BandcampVAE | [
"7ac2fac075675d2fc373e05e9a0b8a43e7090e54"
] | [
"data.py"
] | [
"from torch.utils.data import DataLoader, Dataset\nfrom abc import abstractmethod\nfrom torch import Tensor\nimport json\nimport numpy as np\nfrom sqlalchemy import create_engine\nfrom torchvision.io import read_image\nimport pandas as pd\nimport configparser\nimport os\nfrom gensim.models import Word2Vec\n\n\nconf... | [
[
"numpy.mean",
"pandas.read_sql"
]
] |
mwortsma/elements_of_style | [
"afd78f50b5e6fe358e3443a7dc16983d75847b97",
"afd78f50b5e6fe358e3443a7dc16983d75847b97"
] | [
"modules/mnist_xcoders.py",
"deprecated/mnist_binary_vae/mnist_tompkin_net.py"
] | [
"import torch\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n# Simple Encoder\nclass FCEncoder(nn.Module):\n def __init__(self,z_sz=10,h_sz=400,im_sz=784):\n super(FCEncoder, self).__init__(... | [
[
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.functional.sigmoid"
],
[
"matplotlib.pyplot.legend",
"torch.Tensor",
"torch.cat",
"torch.randn",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.plot",
"torch.nn.Linear",
... |
WWW2022PAGG/PAGG | [
"f3eddec9157d1b34c100883193221d64c26be7ee"
] | [
"baseline/Mixhop/dataset.py"
] | [
"from collections import defaultdict\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport scipy\nimport scipy.io\nfrom sklearn.preprocessing import label_binarize\nfrom ogb.nodeproppred import NodePropPredDataset\n\nfrom load_data import load_twitch, load_fb100, DATAPATH\nfrom data_utils impor... | [
[
"numpy.hstack",
"numpy.expand_dims",
"torch.zeros",
"numpy.unique",
"scipy.io.loadmat",
"torch.from_numpy",
"torch.tensor",
"numpy.argmax",
"torch.where",
"numpy.load",
"numpy.array",
"numpy.empty",
"torch.as_tensor"
]
] |
jonaletil/stackoverflow | [
"be76fd3b8bcc3a6acecc1568f78138c0a61a9cd2"
] | [
"Salary_ML.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import r2_score, mean_squared_error\nimport seaborn as sns\n\ndef clean_data(df):\n '''\n INPUT\n df - pan... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"sklearn.metrics.r2_score",
"matplotlib.pyplot.title",
"pandas.get_dummies",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.plot",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.xlabel",
"matplotlib... |
Fakhre-Alam-Hub/Attendance-System2 | [
"a8eadcc6d661ed522d18bd012c4558560a5a80d6"
] | [
"Home/camera.py"
] | [
"import cv2\nimport face_recognition\nfrom numpy import load\nimport numpy as np\nfrom Home.models import attendanceEntry, Present\nimport datetime\n# from datetime import datetime\nfrom django.db.utils import IntegrityError\nfrom django.contrib.auth.models import User\n\nfrom Home.utils import *\n\nclass VideoCame... | [
[
"numpy.load",
"numpy.argmin"
]
] |
zxkjack123/pypact | [
"a418ba218cdf4a25ae3e7d72e0919905d027d2ba"
] | [
"examples/outputplotting/animatenuclidechart.py"
] | [
"#!/usr/bin/env python3\n\nfrom __future__ import division\nimport os\nfrom operator import attrgetter\n\nimport numpy as np\n\nimport pypact as pp\nimport pypact.analysis as ppa\n\nfilename = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n '..', '..', 'reference', 'test127.out')\n... | [
[
"numpy.zeros"
]
] |
claudiovicar/remotepixel-tiler | [
"f4eb06b9375820229cd17c874b57ad1e2e69934e"
] | [
"tests/test_sentinel.py"
] | [
"\"\"\"tests remotepixel_tiler.sentinel.\"\"\"\n\nimport os\nimport json\nimport numpy\n\nimport pytest\nfrom mock import patch\n\nfrom remotepixel_tiler.sentinel import APP\n\nmetadata_results = os.path.join(\n os.path.dirname(__file__), \"fixtures\", \"metadata_sentinel2.json\"\n)\nwith open(metadata_results, ... | [
[
"numpy.random.rand",
"numpy.full"
]
] |
fatemehtd/Echo-SyncNet | [
"f7f81ead7a24d7574c0668df3765ef58fd71d54d",
"f7f81ead7a24d7574c0668df3765ef58fd71d54d"
] | [
"algos/tcn.py",
"tcc/alignment.py"
] | [
"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow.compat.v2 as tf\n\nfrom algos.algorithm import Algorithm\nfrom config import CONFIG\nfrom utils import get_cnn_feats\nfrom utils import set_learning_phase\n\n\ndef _npairs_loss(labe... | [
[
"tensorflow.compat.v2.transpose",
"tensorflow.compat.v2.split",
"tensorflow.compat.v2.square",
"tensorflow.compat.v2.reduce_mean",
"tensorflow.compat.v2.shape",
"tensorflow.compat.v2.reshape",
"tensorflow.compat.v2.nn.softmax_cross_entropy_with_logits",
"tensorflow.compat.v2.range"... |
yzhao520/ARC | [
"13add94311bfa22660e34200ec8a1dd97a66faa3"
] | [
"training/train_initial_depth_predictor_D.py"
] | [
"import os, time, sys\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler \nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nimport torchvision\nfrom torchvision import datasets, models, tran... | [
[
"torch.zeros",
"torch.cat",
"torch.nn.BCEWithLogitsLoss",
"torch.set_grad_enabled",
"torch.nn.L1Loss"
]
] |
drbenvincent/Veillard-Vincent | [
"05d0c287421b51f957f90281ea92f26b43bc9a1c"
] | [
"data/mcq_wcq_scoring/inference.py"
] | [
"import pymc3 as pm\nimport numpy as np\nimport math\n\n\ndef V(reward, delay, logk):\n '''Calculate the present subjective value of a given prospect'''\n k = pm.math.exp(logk)\n return reward * discount_function(delay, k)\n\n\ndef discount_function(delay, k):\n ''' Hyperbolic discount function '''\n ... | [
[
"numpy.max"
]
] |
16231108/comp3 | [
"ba30823f20c1f82f05ccfb2f239d2be98c6a951f"
] | [
"finrl/marketdata/yahoodownloader.py"
] | [
"\"\"\"Contains methods and classes to collect data from\nYahoo Finance API\n\"\"\"\n\nimport pandas as pd\nimport yfinance as yf\nfrom .lxcUrl import hsDownloadData\n\nclass YahooDownloader:\n \"\"\"Provides methods for retrieving daily stock data from\n Yahoo Finance API\n\n Attributes\n ----------\n ... | [
[
"pandas.DataFrame"
]
] |
adelejjeh/hypermapper | [
"02bd83b5b1d3feb9907cf1187864ded66ba2c539"
] | [
"hypermapper/utility_functions.py"
] | [
"import copy\nimport json\nimport multiprocessing as mp\nimport os\nimport sys\nimport warnings\nfrom collections import defaultdict, OrderedDict\n\nimport numpy as np\nfrom jsonschema import Draft4Validator, validators\nfrom pkg_resources import resource_stream\nfrom scipy import stats\n\n# ensure backward compati... | [
[
"scipy.stats.dirichlet.rvs",
"numpy.dtype",
"numpy.std",
"numpy.argmin",
"scipy.stats.uniform.rvs",
"numpy.array",
"numpy.zeros"
]
] |
dlakaplan/photutils | [
"a7d2562dde41a156c6e190ec1af53bd4605ceda6"
] | [
"photutils/datasets/make.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nMake example datasets.\n\"\"\"\n\nfrom collections import OrderedDict\nimport numpy as np\nfrom astropy.convolution import discretize_model\nfrom astropy.io import fits\nfrom astropy.modeling.models import Gaussian2D\nfrom astropy.table impor... | [
[
"numpy.indices",
"numpy.cos",
"numpy.sin",
"numpy.asanyarray",
"numpy.any",
"numpy.array",
"numpy.zeros"
]
] |
nadiaaaaachen/Bigscity-LibCity | [
"9670c6a2f26043bb8d9cc1715780bb599cce2cd5",
"9670c6a2f26043bb8d9cc1715780bb599cce2cd5"
] | [
"libcity/data/dataset/traffic_state_datatset.py",
"libcity/executor/geosan_executor.py"
] | [
"import os\nimport pandas as pd\nimport numpy as np\nimport datetime\nfrom logging import getLogger\n\nfrom libcity.data.dataset import AbstractDataset\nfrom libcity.data.utils import generate_dataloader\nfrom libcity.utils import StandardScaler, NormalScaler, NoneScaler, \\\n MinMax01Scaler, MinMax11Scaler, Log... | [
[
"numpy.square",
"pandas.read_csv",
"numpy.isnan",
"numpy.arange",
"numpy.tile",
"numpy.stack",
"numpy.concatenate",
"numpy.timedelta64",
"numpy.savez_compressed",
"numpy.load",
"numpy.array",
"numpy.zeros",
"numpy.isinf"
],
[
"torch.device",
"torch.m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.