repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
HoSyTuyen/Federated_object_detection
[ "78cdb88b1b185db0545e9ed32efe73fe08042989" ]
[ "model/model_wrapper.py" ]
[ "import json\nimport numpy\nimport logging\nimport sys\nimport os\nimport torch\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\nfrom model.yolo import Darknet\nfrom utils.utils import *\nfrom utils.datasets import *\nfrom data.dataset import Dataset, TestDataset\nfrom utils import array_tool as at\...
[ [ "torch.cuda.manual_seed", "numpy.random.seed", "torch.no_grad", "torch.from_numpy", "torch.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.set_num_threads" ] ]
hellohawaii/BasicSR
[ "2ef0c0e8f6844aed07655c340f3f6adc333c18a2" ]
[ "codes/scripts/transfer_params.py" ]
[ "import torch\r\n\r\npretrained_net = torch.load('../../experiments/pretrained_models/SRResNet_bicx2_in3nf64nb16.pth')\r\n# should run train debug mode first to get an initial model\r\ncrt_net = torch.load('../../experiments/debug_SRResNet_bicx4_in3nf64nb16/models/8_G.pth')\r\n\r\nfor k, v in crt_net.items():\r\n ...
[ [ "torch.save", "torch.load" ] ]
ioni-garfunkel/great_expectations
[ "cf221fb6eb7c3242cbda1b6fb1c02150a9cec65b" ]
[ "great_expectations/validator/validator.py" ]
[ "import copy\nimport datetime\nimport inspect\nimport json\nimport logging\nimport traceback\nimport warnings\nfrom collections import defaultdict, namedtuple\nfrom collections.abc import Hashable\nfrom typing import Any, Dict, Iterable, List, Optional, Set\n\nimport pandas as pd\nfrom dateutil.parser import parse\...
[ [ "pandas.DataFrame" ] ]
lucassm/cigre-montecarlo
[ "fd354b9c3ade460b46687ba312f51212dad17151" ]
[ "pandapower/build_bus.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\n# Copyright (c) 2016 by University of Kassel and Fraunhofer Institute for Wind Energy and Energy\r\n# System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed by a\r\n# BSD-style license that can be found in the LICENSE file.\r\n\r\n\r\nimport numpy ...
[ [ "numpy.array", "numpy.zeros", "numpy.hstack", "numpy.float64", "numpy.arange", "numpy.in1d" ] ]
DevHyung/bert_score
[ "c3213b5a83471d3fde830e46f4761f021b759508" ]
[ "tests/test_scorer.py" ]
[ "import unittest\nimport torch\nfrom transformers import __version__ as ht_version\nimport bert_score\n\nEPS = 1e-5\n\ncands = [\n \"28-year-old chef found dead in San Francisco mall\",\n \"A 28-year-old chef who recently moved to San Francisco was found dead in the staircase of a local shopping center.\",\n ...
[ [ "torch.is_tensor", "torch.tensor" ] ]
Qi-max/amlearn
[ "88189519bc1079ab5085d5871169c223e0d03057" ]
[ "scripts/featurize_bp_symmfunc.py" ]
[ "import numpy as np\nfrom amlearn.utils.data import read_lammps_dump\nfrom amlearn.featurize.symmetry_function import \\\n BPRadialFunction, BPAngularFunction\n\n__author__ = \"Qi Wang\"\n__email__ = \"qiwang.mse@gmail.com\"\n\n\"\"\"\nThis is an example script of deriving B-P symmetry functinos for each atom, \...
[ [ "numpy.array" ] ]
hungntt/Rainbow
[ "f25723ce984fcbd5e23416db36b70c712bd7a68e" ]
[ "test.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import division\nimport os\nimport plotly\nfrom plotly.graph_objs import Scatter\nfrom plotly.graph_objs.scatter import Line\nimport torch\n\nfrom env import Env\n\n\n# Test DQN\ndef test(args, T, dqn, val_mem, metrics, results_dir, evaluate=False):\n env = Env(args)\n ...
[ [ "torch.tensor" ] ]
jqhoogland/randnn
[ "8cc428e22b8a8ee1eea28ab2b96bcd79854779d2" ]
[ "randnn/weights/exponential.py" ]
[ "import numpy as np\n\n\ndef get_exponential_weights(n_dofs: int, coupling_strength: float) -> np.ndarray:\n \"\"\"\n $J_{ij}$ is drawn from $f(x; 1/\\beta) = \\exp(-x / \\beta) / \\beta$\n\n :param n_dofs: the number of nodes in the network\n :param coupling_strength: the scale parameter (equiv. the in...
[ [ "numpy.random.exponential", "numpy.std", "numpy.random.choice", "numpy.sqrt" ] ]
GaelleChapuis/iblapps
[ "edfe7368b45480ce4a2307dd5d80ec2a38bb084d" ]
[ "atlaselectrophysiology/plot_data.py" ]
[ "from matplotlib import cm\r\nfrom pathlib import Path\r\nimport numpy as np\r\nimport alf.io\r\nfrom brainbox.processing import bincount2D\r\nfrom brainbox.population import xcorr\r\nfrom brainbox.task import passive\r\nimport scipy\r\nfrom PyQt5 import QtGui\r\n\r\nN_BNK = 4\r\nBNK_SIZE = 10\r\nAUTOCORR_BIN_SIZE ...
[ [ "numpy.quantile", "numpy.median", "numpy.copy", "numpy.min", "numpy.mean", "numpy.where", "numpy.apply_along_axis", "numpy.max", "numpy.divide", "numpy.empty", "numpy.seterr", "numpy.take", "numpy.arange", "numpy.log10", "numpy.vstack", "numpy.array"...
dezren39/manim
[ "80d7742446c588dc296bd3afb3465a63b63383db" ]
[ "utils/space_ops.py" ]
[ "import numpy as np\n\nfrom constants import OUT\nfrom constants import RIGHT\n\n# Matrix operations\n\n\ndef thick_diagonal(dim, thickness=2):\n row_indices = np.arange(dim).repeat(dim).reshape((dim, dim))\n col_indices = np.transpose(row_indices)\n return (np.abs(row_indices - col_indices) < thickness).a...
[ [ "numpy.array", "numpy.arccos", "numpy.dot", "numpy.linalg.norm", "numpy.sin", "numpy.identity", "numpy.transpose", "numpy.arange", "numpy.cos", "numpy.abs", "numpy.outer", "numpy.linalg.inv" ] ]
justachetan/scientific-computing
[ "e8493b5308c337ea8965a5f96cdd49def94801e0" ]
[ "a3/problem_4d.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom problem_4a import make_data\nfrom problem_4b import pca\n\ndef main():\n\tdata = make_data()\n\tpcs, u, s, vh, Y = pca(data.copy())\n\ts_d = s.copy()\n\ts_d[-1] = 0\n\tY_d = np.dot(np.dot(u, np.diag(s_d)), vh)\n\tdata_d = Y_d * np.sqrt(Y.shape[1] + 1) + np....
[ [ "matplotlib.pyplot.arrow", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "numpy.mean", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.sqrt", "matplotlib.pyplot.scatter", "matplotlib.pyplot.g...
asmyoo/MSAP
[ "0ed89f90d67260892a8c4d945504f3b0a2096d36" ]
[ "msap/modeling/model_selection/preprocessing/preprocessor.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Data preprocessing object.\n\nAuthors:\n Fangzhou Li - fzli@ucdavis.edu\n\nTodo:\n - docstring\n\n\"\"\"\nimport pandas as pd\n\nfrom .scale import standardize, minmax_normalize, robust_normalize\nfrom .impute import knn_impute, iterative_impute, missforest\nfrom .detect_outlie...
[ [ "pandas.concat" ] ]
VertNet/chrono
[ "681cf4626b84c1f29911e95fb8ee0f3e3ac3fdce" ]
[ "build/build-termlist.py" ]
[ "# Script to build Markdown pages that provide term metadata for complex vocabularies\n# Steve Baskauf 2020-06-28 CC0\n# This script merges static Markdown header and footer documents with term information tables (in Markdown) generated from data in the rs.tdwg.org repo from the TDWG Github site\n\nimport re\nimpor...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
JasonKessler/shifterator
[ "092879f88c2c919ada4a0a5fd3a0df7d8ffb2ac6" ]
[ "shifterator/shifterator.py" ]
[ "import sys\nimport warnings\n\nimport matplotlib.pyplot as plt\n\nfrom . import helper, plotting\n\n\nclass Shift:\n \"\"\"\n Shift object for calculating weighted scores of two systems of types,\n and the shift between them\n\n Parameters\n ----------\n type2freq_1, type2freq_2: dict\n Ke...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
LinkGeoML/Geocoding
[ "2b4c189fdd6e2bf7c90407f4537b465264d7d88a" ]
[ "geocoding/osm_utilities.py" ]
[ "import numpy as np\nimport pandas as pd\nimport json\nimport requests\nfrom shapely.geometry import LineString\nfrom sklearn.cluster import KMeans\nimport time\nimport os\n\nfrom geocoding.config import Config\n\n\ndef query_api(query, fpath):\n \"\"\"\n Queries Overpass API for *query*.\n\n Args:\n ...
[ [ "pandas.DataFrame", "sklearn.cluster.KMeans", "pandas.concat" ] ]
cetmann/robustness-interpretability
[ "6da6a28c101a0763f3ca59c51f2913eb0525f5c3" ]
[ "imagenet_data.py" ]
[ "\"\"\"\nThis file defines how to handle the ImageNet dataset from tfrecord files. The tfrecord files used in this work were\ncreated using the code from\nhttps://github.com/tensorflow/models/blob/master/research/inception/inception/data/build_imagenet_data.py\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom...
[ [ "numpy.zeros_like", "numpy.array", "tensorflow.data.TFRecordDataset" ] ]
arjunmajum/detectron2
[ "b9d77de2a9e16ac0b866fb0890ff0a618aa5f11b" ]
[ "detectron2/engine/hooks.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport datetime\nimport itertools\nimport logging\nimport os\nimport tempfile\nimport time\nfrom collections import Counter\nimport torch\nfrom fvcore.common.checkpoint import PeriodicCheckpointer as _PeriodicCheckpo...
[ [ "torch.autograd.profiler.profile" ] ]
joelkalonji/SplitMLModel
[ "5bf4afef50504f984bf90672f1b3b2e0917cf8fb" ]
[ "SplitModel.py" ]
[ "from sklearn.model_selection import StratifiedShuffleSplit\r\nfrom sklearn.model_selection import train_test_split\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\n\r\ndata = pd.read_csv('data/data.csv')\r\n\r\ndata.head()\r\n\r\n\r\ntrain_data, test_data = train_test_split(data, test_size=0.2)\r\n\r\ntrain_dat...
[ [ "sklearn.model_selection.train_test_split", "sklearn.model_selection.StratifiedShuffleSplit", "pandas.read_csv", "pandas.cut" ] ]
hhsecond/redisai-examples
[ "9eb167962a77a5ff307ee924c2e4ece3b98362ca" ]
[ "models/imagenet/tensorflow/model_checker.py" ]
[ "import tensorflow as tf\nimport tensorflow_hub as hub\nfrom skimage import io\nimport numpy as np\nimport json\n\n\nclass_idx = json.load(open(\"../data/imagenet_classes.json\"))\n\nfilepath = '../data/guitar.jpg'\nnumpy_img = io.imread(filepath).astype(dtype=np.float32)\nnumpy_img = np.expand_dims(numpy_img, axis...
[ [ "tensorflow.GraphDef", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.Graph", "tensorflow.gfile.GFile", "tensorflow.global_variables_initializer", "numpy.expand_dims" ] ]
anon-paper-submissions-1982/shrinkbench
[ "fd42c6701ab45473fad95b4dd99bb17356b8c82d" ]
[ "datasets/zeros224.py" ]
[ "import random\nimport torch\nfrom torch.utils.data import Dataset\n\n\nclass Zeros224(Dataset):\n\n def __init__(self, num_samples):\n self.len = num_samples\n\n def __len__(self):\n return self.len\n\n def __getitem__(self, index):\n x = torch.zeros(3, 224, 224)\n y = 0 # ran...
[ [ "torch.zeros" ] ]
CAOR-MINES-ParisTech/ukfm
[ "fa6c1358d73598fb57ad9930d7e89516830d27db" ]
[ "docsource/source/auto_examples/slam2d.py" ]
[ "\"\"\"\n********************************************************************************\n2D Robot SLAM - Example\n********************************************************************************\nGoals of this script:\n\n- apply the UKF for performing 2D SLAM (Simultaneous Localization And Mapping).\n\n- discover...
[ [ "numpy.array", "numpy.zeros", "numpy.squeeze", "numpy.eye", "numpy.where", "numpy.arange", "numpy.sqrt", "numpy.hstack", "numpy.diag", "numpy.vstack" ] ]
chatid/chatnet
[ "9d21a1b38da0a624daa4bb163fca854e14a456b3" ]
[ "chatnet/evaluation.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n evaluation\n ~~~~~~~~~~\n \n Evaluate model performance\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom matplotlib.pylab import plt\n\n\ndef calibration_plot(prob, ytest):\n # stolen from stackoverflow!\n outcome = ytest\n data = pd.DataFrame(dict(prob=p...
[ [ "matplotlib.pylab.plt.ylabel", "matplotlib.pylab.plt.subplot2grid", "pandas.cut", "matplotlib.pylab.plt.xlabel", "numpy.sqrt", "numpy.linspace", "matplotlib.pylab.plt.errorbar", "matplotlib.pylab.plt.plot" ] ]
brunoluanUFS/ProtoML
[ "cc467b7e41b45244b6f54725f08bbc89f806d708" ]
[ "app.py" ]
[ "import gunicorn\r\nfrom fastapi import FastAPI, File, Form, UploadFile, Query\r\nimport shutil\r\nimport pandas as pd\r\nfrom pandas_profiling import ProfileReport\r\nfrom fastapi.responses import FileResponse\r\nfrom datetime import datetime\r\nimport pickle\r\nimport numpy as np\r\n\r\napp = FastAPI()\r\n\r\n@ap...
[ [ "numpy.float_", "sklearn.linear_model.LogisticRegression", "pandas.read_csv", "sklearn.naive_bayes.GaussianNB" ] ]
AjithK14/PandemicSimulator
[ "654bc9c67b8799bf530bb296e270d85412a06a73" ]
[ "python/pandemic_simulator/script_helpers/person_routines.py" ]
[ "# Confidential, Copyright 2020, Sony Corporation of America, All rights reserved.\nfrom typing import Sequence, Type, Optional\n\nimport numpy as np\n\nfrom ..environment import LocationID, PersonRoutine, Registry, SimTimeInterval, GroceryStore, \\\n RetailStore, BarberShop, Retired, Restaurant, Bar\n\n__all__ ...
[ [ "numpy.random.RandomState" ] ]
sanazkeshvari/allrank
[ "527ed1e60320caaddfcef391eee37df9b875d8d0" ]
[ "allrank/models/losses/listMap2.py" ]
[ "import torch\n\nfrom allrank.data.dataset_loading import PADDED_Y_VALUE\nfrom allrank.models.losses import DEFAULT_EPS\n\n\ndef listMap2(y_pred, y_true, eps=DEFAULT_EPS, padded_value_indicator=PADDED_Y_VALUE):\n\n \"\"\"\n ListMLE loss introduced in \"Listwise Approach to Learning to Rank - Theory and Algori...
[ [ "torch.mul", "torch.gather", "torch.randperm", "torch.pow", "torch.load", "torch.multiply", "torch.log", "torch.exp", "torch.sum" ] ]
centercitypcs/centercitypcs_utils
[ "a81f527529884dcbfc869665ea1416f83304b488" ]
[ "centercitypcs_utils/__init__.py" ]
[ "\"\"\"\nUtility Functions\n\"\"\"\n\n__version__ = \"0.2.2\"\n\nimport sqlalchemy\nimport records\nimport pandas as pd\nimport gspread\nimport gspread_dataframe\n\n\ndef get_sql_as_df(database_url: str, query_file: str, **kwargs: dict) -> pd.DataFrame:\n with open(query_file, \"r\") as query_file:\n quer...
[ [ "pandas.read_sql" ] ]
FelixLorenz/distiller
[ "08b5cd95704d850cfb845ed7785f739cbb57de54" ]
[ "tests/common.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.randn" ] ]
rehno-lindeque/detr
[ "65c4f49b2795f68fba57b0f139d02e2dbe8b83ac" ]
[ "util/misc.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nMisc functions, including distributed helpers.\n\nMostly copy-paste from torchvision references.\n\"\"\"\nimport os\nimport subprocess\nimport time\nfrom collections import defaultdict, deque\nimport datetime\nimport pickle\nfrom typin...
[ [ "torch.distributed.get_world_size", "torch.cat", "torch.stack", "torch.ones", "torch.cuda.is_available", "torch.nn.functional.pad", "torch.distributed.init_process_group", "torch.ByteTensor", "torch.distributed.is_initialized", "torch.tensor", "torch.zeros_like", "t...
cgodine/ACT
[ "af9f0edb76e6f16e2764d5441a4bf4d7fb3a9f39" ]
[ "act/io/csvfiles.py" ]
[ "\"\"\"\n===============\nact.io.csvfiles\n===============\nThis module contains I/O operations for loading csv files.\n\n\"\"\"\n\n# import standard modules\nimport pandas as pd\n\nfrom .armfiles import check_arm_standards\n\n\ndef read_csv(filename, sep=',', engine='python', column_names=None,\n skipf...
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
792370706/Ivy
[ "d5d3d92443dfb590335554dd4ce834ea675189fe" ]
[ "ivy_tests/test_core/test_reductions.py" ]
[ "\"\"\"\nCollection of tests for templated reduction functions\n\"\"\"\n\n# global\nimport pytest\nimport numpy as np\n\n# local\nimport ivy\nimport ivy.numpy\nimport ivy_tests.helpers as helpers\n\n\n# reduce_sum\n@pytest.mark.parametrize(\n \"x\", [[1., 2., 3.], [[1., 2., 3.]]])\n@pytest.mark.parametrize(\n ...
[ [ "numpy.arange" ] ]
BinhuiXie/SPCL
[ "9e5bab7b5d38fde847f9e8f85ca64498baaf86be" ]
[ "semantic_prototype.py" ]
[ "import argparse\r\nimport os\r\nimport logging\r\nfrom collections import OrderedDict\r\nfrom tqdm import tqdm\r\n\r\nimport torch\r\nimport torch.nn.functional as F\r\nimport torch.utils.data\r\nimport torch.distributed\r\nimport torch.backends.cudnn\r\n\r\nfrom core.configs import cfg\r\nfrom core.datasets impor...
[ [ "torch.zeros", "torch.device", "torch.nn.functional.normalize", "torch.cat", "torch.max", "torch.no_grad", "torch.cuda.empty_cache", "torch.utils.data.DataLoader", "torch.nn.functional.softmax", "torch.mean" ] ]
speedcell4/OpenNRE
[ "4e4757eed77eb5fdcaefb4770e724b9a37090cb7" ]
[ "old/plot_pr.py" ]
[ "from sklearn.metrics import precision_recall_curve\nfrom sklearn.metrics import average_precision_score\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nplt.clf()\nfilename = ['CNN+ATT', 'Hoffmann', 'MIMLRE', 'Mintz', 'PCNN+ATT']\ncolor = ['red', 'turquoise', 'darkorange', 'cornflowerblue', 'teal']\nfor i i...
[ [ "matplotlib.pyplot.xlim", "sklearn.metrics.precision_recall_curve", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "numpy.load", "matplotlib.pyplot.legend", "matplotlib.pyplot.grid", "sklearn.metrics.average_precision_score", "matplotlib.pyp...
ajrichards/bayesian-examples
[ "fbd87c6f1613ea516408e9ebc3c9eff1248246e4", "fbd87c6f1613ea516408e9ebc3c9eff1248246e4" ]
[ "archive/visualization/simple_network.py", "archive/pymc3/linear-regression.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport networkx as nx\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\n\ndef draw_network(edge_dict,file_name=None,ax=None,node_size=500,k=10):\n \"\"\"draw a simple network\"\"\"\n if not ax:\n fig = plt.figure(fi...
[ [ "numpy.random.seed", "matplotlib.pyplot.show", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure" ], [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
Coderx7/InsightFace-v2
[ "d9e8519f4ea6de891b6b04a095c758b0d31d36b6" ]
[ "retinaface/layers/functions/prior_box.py" ]
[ "from itertools import product as product\nfrom math import ceil\n\nimport torch\n\n\nclass PriorBox(object):\n def __init__(self, cfg, image_size=None, phase='train'):\n super(PriorBox, self).__init__()\n self.min_sizes = cfg['min_sizes']\n self.steps = cfg['steps']\n self.clip = cfg...
[ [ "torch.Tensor" ] ]
JianJiao16/BANG
[ "95d5a8b95397f401f4b9c677899ef01126910cdb" ]
[ "bang/bang/bang_AR.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom fairseq import options, utils\nfrom fairseq.models import (\n FairseqEncoder,\n FairseqIncrementalDecoder,\n Fairseq...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.load", "torch.lt", "torch.nn.init.constant_", "torch.is_tensor", "torch.abs", "torch.nn.init.normal_", "torch.zeros_like", "torch.Tensor", "torch.nn.functional.dropout", "torch.nn.functional.log_softm...
HimanchalChandra/visual-relationship-detection
[ "74922fbb8a3dc1a15b539a7178acb48256f3ad0c" ]
[ "datasets/visual_genome.py" ]
[ "import numpy as np\nimport cv2\nfrom shapely.geometry import box\nfrom shapely.ops import cascaded_union\nfrom PIL import Image\nimport torch\nimport pandas as pd\nfrom skimage import io, transform\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transform...
[ [ "torch.Tensor", "torch.cat", "torch.stack" ] ]
DLPerf/PointASNL
[ "ec90b99e79fb9c7fbece319127404b60817edc63" ]
[ "SemanticKITTI/semantic_kitti_dataset.py" ]
[ "import os\nimport numpy as np\nimport yaml\nimport random\nfrom auxiliary import laserscan\n\nsplits = [\"train\", \"valid\", \"test\"]\nmapped_content = {0: 0.03150183342534689, 1: 0.042607828674502385, 2: 0.00016609538710764618, 3: 0.00039838616015114444,\n 4: 0.0021649398241338114, 5: 0.0018070...
[ [ "numpy.max", "numpy.concatenate", "numpy.array", "numpy.linalg.norm", "numpy.ceil", "numpy.zeros", "numpy.sum", "numpy.min", "numpy.random.shuffle", "numpy.where", "numpy.amax", "numpy.argsort", "numpy.expand_dims" ] ]
WhisperRen/Bag-of-Tricks-for-Multimodal-Classification
[ "e9b12d941391e1f42e5f265f730fea8e58f0a96b" ]
[ "single_modality_models/base_text_model.py" ]
[ "import tensorflow as tf\n\n\ndef make_text_model(tokenizer, output_dim=16, trainable=True):\n text_model = tf.keras.Sequential([\n tf.keras.layers.Embedding(len(tokenizer.index_word) + 1, 8),\n tf.keras.layers.Dropout(rate=0.5, trainable=trainable),\n tf.keras.layers.Bidirectional(tf.keras....
[ [ "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.LSTM", "tensorflow.keras.layers.Dense" ] ]
AtmaHou/UserSimulator
[ "4908e6a19f23b20064bb10c504eeadb0de5c235e" ]
[ "src/deep_dialog/dialog_system/state_tracker.py" ]
[ "\"\"\"\nCreated on May 20, 2016\n\nstate tracker\n\n@author: xiul, t-zalipt\n\"\"\"\n\nfrom . import KBHelper\nimport numpy as np\nimport copy\n\n\nclass StateTracker:\n \"\"\" The state tracker maintains a record of which request slots are filled and which inform slots are filled \"\"\"\n\n def __init__(sel...
[ [ "numpy.ones", "numpy.vstack", "numpy.zeros" ] ]
DELTA37/LDPC-code
[ "e055685d8dfebd50fa19a2638a8934b4a43b7ad3" ]
[ "estimate_dmin_upper_bound_qc_ldpc.py" ]
[ "import os\nimport sys\nimport argparse\nimport numpy as np\nfrom codes.qc_ldpc import QuasiCyclicLDPCCode\nfrom utils.poly_gf2 import poly1d_gf2\nimport importlib\n\n\ndef read_alist(alist):\n \"\"\"Create H matrix from a file in the .alist format\n\n See http://www.inference.org.uk/mackay/codes/alist.html f...
[ [ "numpy.empty" ] ]
awesome-archive/tensorpack
[ "e5e54e07bb47f85fc7efe9c78bde3e153ef0d49b", "d7a13cb74c9066bc791d7aafc3b744b60ee79a9f", "e5e54e07bb47f85fc7efe9c78bde3e153ef0d49b", "e5e54e07bb47f85fc7efe9c78bde3e153ef0d49b" ]
[ "tensorpack/dataflow/dataset/cifar.py", "tensorpack/dataflow/imgaug/noise.py", "tensorpack/tfutils/sessinit.py", "tensorpack/tfutils/varreplace.py" ]
[ "# -*- coding: utf-8 -*-\n# File: cifar.py\n\n# Yukun Chen <cykustc@gmail.com>\n\nimport numpy as np\nimport os\nimport pickle\nimport tarfile\nimport six\nfrom six.moves import range\n\nfrom ...utils import logger\nfrom ...utils.fs import download, get_dataset_path\nfrom ..base import RNGDataFlow\n\n__all_...
[ [ "numpy.array", "numpy.transpose", "numpy.mean" ], [ "numpy.clip" ], [ "tensorflow.gfile.Exists", "numpy.load", "tensorflow.global_variables", "tensorflow.train.NewCheckpointReader", "tensorflow.get_collection" ], [ "tensorflow.get_default_graph", "tensorflow...
nikwitt/FLEX_IR
[ "900221ea4078cc79fa101dff9fa9921194f18bc7" ]
[ "single_orbital/parameters.py" ]
[ "# -*- encoding: latin-1 -*-\r\n\r\nimport numpy as np\r\nimport h5py\r\nimport os\r\n\r\nclass parameters:\r\n \"\"\"\r\n Setting parameters for current calculation.\r\n As no extra file is generated, one should make thorough notes on what \r\n parameters are set in each calculation!\r\n \"\"\"\r\n ...
[ [ "numpy.arange", "numpy.cos" ] ]
zh217/infirunner
[ "ceb4b7b3a7ca9c080d537f2e601d1be197e27395" ]
[ "infirunner/hyperband.py" ]
[ "import abc\nimport importlib\nimport json\nimport math\nimport os\nimport random\nimport sys\nimport time\nimport datetime\n\nimport colorama\nimport click\nimport infirunner.capsule\nimport numpy as np\nimport scipy.stats as sps\n\nfrom colorama import Style, Fore\nfrom statsmodels.nonparametric.api import KDEMul...
[ [ "numpy.random.normal", "scipy.stats.truncnorm.rvs", "numpy.clip" ] ]
brmprnk/jointomicscomp
[ "2074025f6b9847698c21f4c45cdb76cb6c583f4e" ]
[ "src/MVIB/training/vae.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.distributions import Normal, Independent\n\nfrom src.MVIB.utils.modules import Decoder\nfrom src.MVIB.training.base import RepresentationTrainer\nfrom src.MVIB.utils.schedulers import ExponentialScheduler\n\n\n###############\n# VAE Trainer #\n###############\nclass ...
[ [ "torch.zeros", "torch.distributions.Normal", "torch.distributions.Independent", "torch.ones" ] ]
dogeplusplus/torch-actor-critic
[ "c12f5a6845fe27cf0f2b231a88e7b6d9f5985960" ]
[ "buffer/replay_buffer.py" ]
[ "import numpy as np\n\nfrom random import sample\nfrom torch import FloatTensor\nfrom dataclasses import dataclass\n\n\n@dataclass(frozen=True)\nclass Batch:\n states: FloatTensor\n actions: FloatTensor\n rewards: FloatTensor\n next_states: FloatTensor\n done: FloatTensor\n\n\nclass ReplayBuffer:\n ...
[ [ "torch.FloatTensor", "numpy.zeros" ] ]
moebg/retailbox
[ "95541b654201e3b8108ec1a0132a1543283a0c41" ]
[ "retailbox/recommender.py" ]
[ "# -*- coding: utf-8 -*-\nimport sys\nimport time\nimport pandas as pd\nimport pickle\nimport numpy as np\nimport os.path\nimport scipy.sparse as sparse\nfrom scipy.sparse.linalg import spsolve\nimport random\nimport warnings\nimport implicit\n\nfrom scipy.sparse.linalg import spsolve\nfrom output import printGreen...
[ [ "pandas.read_pickle", "numpy.array" ] ]
AliOsm/semantic-question-similarity
[ "35fa6e3da5178ed1942437233abf878c317eae36" ]
[ "5_infer.py" ]
[ "import csv\nimport argparse\n\nimport numpy as np\nimport pickle as pkl\n\nfrom os import remove\nfrom os.path import join\nfrom keras.models import load_model\nfrom keras_self_attention import SeqWeightedAttention\nfrom keras_ordered_neurons import ONLSTM\n\nfrom helpers import load_embeddings_dict\nfrom helpers ...
[ [ "numpy.array" ] ]
CASIA-IVA-Lab/DCFST
[ "ca881ba3aae1ce00e4a7a6db01d99e5f6efff68b", "ca881ba3aae1ce00e4a7a6db01d99e5f6efff68b" ]
[ "ltr/dataset/tracking_net.py", "pytracking/tracker/sbdt50/sbdt.py" ]
[ "import torch\nimport os\nimport os.path\nimport numpy as np\nimport pandas\nfrom collections import OrderedDict\n\nfrom ltr.data.image_loader import default_image_loader\nfrom .base_dataset import BaseDataset\nfrom ltr.admin.environment import env_settings\n\n\ndef list_sequences(root, set_ids):\n \"\"\" Lists ...
[ [ "pandas.read_csv", "torch.tensor" ], [ "torch.cat", "torch.prod", "torch.ones", "torch.set_printoptions", "torch.eye", "torch.topk", "torch.sqrt", "torch.tril", "torch.manual_seed", "torch.Tensor", "torch.zeros", "torch.potrf", "torch.cuda.manual_see...
tuantranf/doctr
[ "69f9ced542999ef5fa35f3153d7a06661d3c4d3f" ]
[ "doctr/models/detection/linknet/tensorflow.py" ]
[ "# Copyright (C) 2021-2022, Mindee.\n\n# This program is licensed under the Apache License version 2.\n# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.\n\n# Credits: post-processing adapted from https://github.com/xuannianz/DifferentiableBinarization\n\nfrom copy im...
[ [ "tensorflow.convert_to_tensor", "tensorflow.math.sigmoid", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.reduce_mean", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.losses.binary_crossentropy", "tensorflow.cast" ] ]
Nguyendat-bit/U-net
[ "0ee5f0beb2513fa6031947e42a7ad398ad3c8a28" ]
[ "GeneratorCustom.py" ]
[ "import numpy as np\nfrom tensorflow.keras.utils import Sequence\nimport cv2\nimport tensorflow as tf \nclass DataGenerator(Sequence):\n def __init__(self, all_filenames, input_size = (256, 256), batch_size = 32, shuffle = True, seed = 123, encode: dict = None, encode_with_kmean = None, color_mode = 'hsv', funct...
[ [ "numpy.array", "numpy.empty", "tensorflow.expand_dims", "numpy.random.seed", "numpy.random.shuffle", "tensorflow.image.resize", "tensorflow.cast" ] ]
bqhuyy/SlowFast-clean
[ "3dc000dc9fe1951ab70cb835bfb91b71a07d8f63" ]
[ "slowfast/utils/checkpoint.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Functions that handle saving and loading of checkpoints.\"\"\"\n\nimport copy\nimport numpy as np\nimport os\nimport pickle\nfrom collections import OrderedDict\nimport torch\nfrom fvcore.common.file_io import ...
[ [ "numpy.concatenate", "torch.cat", "torch.save", "torch.tensor", "torch.load" ] ]
alvaropp/AdventOfCode2017
[ "2827dcc18ecb9ad59a1a5fe11e469f31bafb74ad" ]
[ "2019/day9-1.py" ]
[ "from itertools import permutations\n\nimport numpy as np\n\n\nclass Processor:\n def __init__(self, data: np.array, inputs: list):\n self.data = np.append(data, np.zeros(200000, dtype=int))\n self.inputs = inputs\n self.outputs = []\n self.pos = 0\n self.base = 0\n self...
[ [ "numpy.genfromtxt", "numpy.zeros" ] ]
spmvg/evt
[ "bbba18007fce387bf877802d6512a66ff5dfd425", "bbba18007fce387bf877802d6512a66ff5dfd425" ]
[ "tests/test_dataset.py", "src/evt/estimators/gevmle.py" ]
[ "import hashlib\nimport io\nimport unittest\n\nimport numpy as np\nimport pandas as pd\nfrom matplotlib import pyplot as plt\n\nfrom evt.dataset import Dataset\n\n\nclass TestDataset(unittest.TestCase):\n def setUp(self) -> None:\n pass\n\n def test_series(self):\n series = pd.Series(data=[1, 2,...
[ [ "matplotlib.pyplot.gca", "numpy.isclose", "matplotlib.pyplot.figure", "pandas.Series" ], [ "scipy.stats.genextreme.fit", "scipy.stats.genextreme.sf" ] ]
UtahDave/great_expectations
[ "99a54370f7ebeea5d95bca726200db01c7326d68" ]
[ "tests/expectations/metrics/test_core.py" ]
[ "import copy\nimport logging\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport great_expectations.exceptions as ge_exceptions\nfrom great_expectations.core.batch import Batch\nfrom great_expectations.execution_engine import (\n PandasExecutionEngine,\n SparkDFExecutionEngine,\n)\nfrom great_...
[ [ "pandas.DataFrame", "pandas.Index", "numpy.isnan", "pandas.Series" ] ]
HenryKenlay/DeepRobust
[ "3f56dcc45f1fed788423d32cc179c26513416e2e", "3f56dcc45f1fed788423d32cc179c26513416e2e" ]
[ "deeprobust/graph/targeted_attack/nettack.py", "deeprobust/image/attack/lbfgs.py" ]
[ "'''\n Adversarial Attacks on Neural Networks for Graph Data. KDD 2018.\n https://arxiv.org/pdf/1805.07984.pdf\n Author's Implementation\n https://github.com/danielzuegner/nettack\n\n Since pytorch does not have good enough support to the operations on sparse tensor,\nthis part of code is hea...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.log", "numpy.sum", "numpy.tile", "numpy.eye", "numpy.multiply", "numpy.arange", "numpy.sqrt", "numpy.argsort", "scipy.sparse.lil_matrix", "scipy.sparse.csr_matrix", "numpy.unique", "numpy.maximum"...
SimonLBSoerensen/IntroductionToArtificialIntelligenceGroup9-NotRobot
[ "a26f2badc4f7625ccee14faf194d051071cff627" ]
[ "map_gen/.ipynb_checkpoints/map_gen-checkpoint.py" ]
[ "import numpy as np\nimport hashlib\n\ndef flatten(arr):\n return [el for sl in arr for el in sl]\n\ntemplets = [\n [\n [\n [\" \", \" \", \" \"],\n [\" \", \" \", \" \"],\n [\" \", \" \", \" \"],\n ],\n []\n ],\n [\n [\n [\"#\", \"...
[ [ "numpy.rot90", "numpy.full", "numpy.array", "numpy.random.choice", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.where", "numpy.argmax", "numpy.transpose" ] ]
StijnMatsHendriks/adversarial_attack_demo
[ "ff784e90f107a43afdbec826c7e5365b9db90750" ]
[ "applications/graphpipe/graphpipe_onnx_tool.py" ]
[ "#coding=utf-8\n\n# Copyright 2017 - 2018 Baidu 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 ap...
[ [ "numpy.max", "numpy.rollaxis", "numpy.argmax" ] ]
disktnk/chainer
[ "133798db470f6fd95973b882b9ccbd0c9726ac13", "133798db470f6fd95973b882b9ccbd0c9726ac13" ]
[ "tests/chainer_tests/functions_tests/pooling_tests/test_max_pooling_nd.py", "chainer/optimizers/ada_delta.py" ]
[ "import unittest\n\nimport functools\nimport math\nimport numpy\nfrom operator import mul\nimport six\n\nimport chainer\nfrom chainer.backends import cuda\nfrom chainer import functions\nfrom chainer import gradient_check\nfrom chainer import testing\nfrom chainer.testing import attr\nfrom chainer.testing import co...
[ [ "numpy.random.uniform", "numpy.random.rand" ], [ "numpy.sqrt" ] ]
tomguluson92/Regularized-AutoEncoder
[ "c79633dbe0b908cddec31324b786d8e236356a2b" ]
[ "opts/opts.py" ]
[ "# coding: UTF-8\n\"\"\"\n @author: samuel ko\n\"\"\"\nimport argparse\nimport torch\nimport os\n\n\ndef INFO(inputs):\n print(\"[ Regularized AE ] %s\" % (inputs))\n\n\ndef presentParameters(args_dict):\n \"\"\"\n Print the parameters setting line by line\n\n Arg: args_dict - The dict o...
[ [ "torch.cuda.is_available" ] ]
cospectrum/pylinal
[ "2e2d95c23ef2d9f87f89a6ddba972da260dae514" ]
[ "examples/torus.py" ]
[ "import itertools\nfrom numpy import linspace\nfrom pylinal import VectorFunc\nfrom math import cos, sin, pi\n\n \nR = 8 # distance from the center of the tube to the center of the torus\nr = 1 # radius of the tube\n\n# theta, phi in [0, 2*pi)\nx = lambda theta, phi: (R + r*cos(theta)) * cos(phi)\ny = lambda th...
[ [ "numpy.linspace" ] ]
Abas-Khan/thesis
[ "b733bd4382371203cc4992571890619a2e314047" ]
[ "gensim/gensim/sklearn_api/atmodel.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Author: Chinmaya Pancholi <chinmayapancholi13@gmail.com>\n# Copyright (C) 2017 Radim Rehurek <radimrehurek@seznam.cz>\n# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html\n\n\"\"\"\nScikit learn interface for gensim for easy use of gensim ...
[ [ "numpy.array", "sklearn.exceptions.NotFittedError" ] ]
Alberto199810/Master-s-thesis-Moneyball-II
[ "0bbfa1dba6c67d2ccee95eb92aa09533817b228c" ]
[ "01_Datasets/Leagues Comparison/Scrapers/SPI_Index_Scraper.py" ]
[ "import pandas as pd\nimport numpy as np\n\nsecond_ranking = pd.read_html('https://www.globalfootballrankings.com/')[0]\n\nsecond_ranking = second_ranking[['League','Average SPI']]\n\nsecond_ranking['League'] = ['Premier League', 'La Liga', 'Fußball-Bundesliga', 'Serie A', 'Ligue 1', \n '...
[ [ "numpy.max", "pandas.read_html", "numpy.min" ] ]
jinmyeonglee/LKVOLearner
[ "8d6a167d50942131dc9e379c280f442c37579d37" ]
[ "DEN/den.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torchvision.models import resnet152\n\n\nclass Flatten(nn.Module):\n def __init__(self):\n super(Flatten, self).__init__()\n\n def forward(self, input):\n return input.view(input.size()[0], -1)\n\n\nclass AuxConv(nn.Module):\n def __init__(self, in_c...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Dropout", "torch.nn.ModuleList", "torch.nn.Sequential", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.load" ] ]
yjchoi1/gns-1
[ "31c712dbb721be81b5fd193a23baaf56adf9c336" ]
[ "gns/noise_utils.py" ]
[ "import torch\nfrom gns import learned_simulator\n\n\ndef get_random_walk_noise_for_position_sequence(\n position_sequence: torch.tensor,\n noise_std_last_step):\n \"\"\"Returns random-walk noise in the velocity applied to the position.\n\n Args: \n position_sequence: A sequence of particle posit...
[ [ "torch.zeros_like", "torch.cumsum" ] ]
jiseokcube/PyTorch-GAN
[ "285c260934d37261d4c55fffbbeea32ce308cc53" ]
[ "implementations/esrgan/test_on_image.py" ]
[ "from models import GeneratorRRDB\nfrom datasets import denormalize, mean, std\nimport torch\nfrom torch.autograd import Variable\nimport argparse\nimport os\nfrom torchvision.utils import save_image\nfrom PIL import Image\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--image_path\", type=str, requir...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.load" ] ]
layer6ai-labs/CMLMC
[ "78fe1cb9c45a836dd0e1a2ee541e4a364ae24abe" ]
[ "fairseq/options.py" ]
[ "# 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 argparse\nimport sys\nfrom typing import Callable, List, Optional\n\nimport torch\n# this import is for backward compatibilit...
[ [ "torch.cuda.device_count" ] ]
realityengines/post_hoc_debiasing
[ "e0efc81e6e317b9c203e79106c3529e159bc3fa8" ]
[ "deco/src/deco/compute_shapley.py" ]
[ "import numpy as np\nimport pandas as pd\nimport pickle\nimport time\nimport argparse\nimport yaml\nimport keras\nfrom utils import accuracy_from_scores\nimport fairness\nimport gc\nfrom tqdm import tqdm\nimport os.path\n\n# References\n# [1] https://christophm.github.io/interpretable-ml-book/shapley.html#the-shap...
[ [ "numpy.random.choice", "pandas.DataFrame", "numpy.random.randn", "numpy.arange", "numpy.abs", "numpy.isfinite", "pandas.read_csv" ] ]
HuiliCui/ROMP
[ "8606d695e104f550a83bd74da3f3927c8e01faaf" ]
[ "simple_romp/setup.py" ]
[ "import setuptools\nfrom distutils.core import setup, Extension\nfrom Cython.Build import cythonize\nimport numpy\n\nwith open(\"README.md\", \"r\", encoding=\"utf-8\") as fh:\n long_description = fh.read()\n\nrequireds = [\"opencv-python\",\"torch\"]\n\nsetuptools.setup(\n name='simple_romp',\n version='0...
[ [ "numpy.get_include" ] ]
mfkiwl/kernel_tuner
[ "7f2bdc85a9c355d38b04dba1ce518fba1d65ffb7" ]
[ "examples/cuda/convolution_correct.py" ]
[ "#!/usr/bin/env python\n\"\"\" convolution with correctness checks\n\nThis example is mostly the same as the Convolution example. The only\ndifference is that a naive kernel is used to compute a reference\noutput. This reference output is used to check the correctness of\nevery kernel before it is benchmarked.\n\nT...
[ [ "numpy.prod", "numpy.random.randn", "numpy.zeros" ] ]
eugval/sim2real_dynamics_simulation
[ "2ed175803faa38792f6becc2dc91f44ae71ed9c2", "2ed175803faa38792f6becc2dc91f44ae71ed9c2" ]
[ "robosuite-extra/robosuite_extra/push_env/sawyer_push.py", "sim2real-policies/sim2real_policies/sys_id/env_probing_interaction/epi.py" ]
[ "from collections import OrderedDict\nimport numpy as np\nfrom robosuite_extra.env_base.sawyer import SawyerEnv\n\nfrom robosuite.models.arenas import TableArena\nfrom robosuite.models.objects import BoxObject, CylinderObject\nfrom robosuite_extra.models.generated_objects import FullyFrictionalBoxObject\nfrom robos...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.asarray", "numpy.zeros", "numpy.log", "numpy.ones", "numpy.arange", "numpy.cos" ], [ "torch.stack", "torch.isnan", "numpy.mean", "torch.eye", "torch.load", "torch.multip...
bebosudo/boppy
[ "2197f77e78ed64d23a90ef9158e867cd228b468a" ]
[ "boppy/simulators/gpu/ssa_gpu.py" ]
[ "\"\"\"Run Stochastic Simulation Algorithm on a Nvidia GPU device, using pycuda.\n\nEach thread is assigned one iteration of the algorithm, because each iteration is a distinct\nstochastic process, and therefore can only be horizontally parallelized.\n\nInside this kernel we use a \"binary selection\" to randomly p...
[ [ "numpy.float32" ] ]
sbird/FastPMRunner
[ "f38f6e69c603fb699436b645fe7b4eb418ee82c2" ]
[ "fastpm/python/comparehalos.py" ]
[ "from nbodykit.lab import FFTPower, BigFileCatalog\nfrom nbodykit import setup_logging\nimport numpy\nimport argparse\nimport warnings\nfrom mpi4py import MPI\nimport os\n\n# usage:\n#\n# python halobias.py output --nmin x --nmax x --nn x dmcatalog [...] -- halocatalog [...]\n#\n# measure the bias and growth rate f...
[ [ "numpy.log10", "numpy.savetxt" ] ]
tirkarthi/raiden
[ "dbd03ddda039332b54ec0c02d81cbe1100bc8028" ]
[ "tools/debugging/plot/line.py" ]
[ "#!/usr/bin/env python\nimport argparse\nimport csv\nimport datetime\nimport sys\nfrom typing import Any, List\n\nfrom matplotlib import dates, pyplot\nfrom matplotlib.axes import Axes\n\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--width\", default=1000, help=\"Configures width of the output in pi...
[ [ "matplotlib.dates.MinuteLocator", "matplotlib.pyplot.savefig", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.dates.HourLocator", "matplotlib.pyplot.gca" ] ]
giganticode/OpenVocabCodeNLM
[ "2d6cfd32c8399891b0fe2220946b4b4ddeac32ba" ]
[ "reader.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom itertools import chain\n\nimport collections\nimport getopt\nimport numpy as np\nimport sys\nimport tensorflow as tf\n\nfrom collections import deque\n\nUNKNOWN_WORD = \"-UNK-\"\nEMPTY_WORD = \"-EMP-\"\nEND_SENT = \"-eos-\"\nSTART_SENT =...
[ [ "numpy.concatenate", "numpy.full", "numpy.array", "numpy.ones", "tensorflow.gfile.GFile", "tensorflow.device", "numpy.array_split" ] ]
giannisdaras/tensor2tensor
[ "8d3d175d649680c8e5b98a1b1c1c5e782ff492ac" ]
[ "tensor2tensor/bin/t2t_trainer.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "tensorflow.logging.set_verbosity", "tensorflow.profiler.ProfileOptionBuilder.time_and_memory", "tensorflow.gfile.Open", "tensorflow.gfile.Exists", "tensorflow.logging.info", "tensorflow.gfile.MakeDirs", "tensorflow.app.run", "tensorflow.logging.warn" ] ]
alan-turing-institute/IceNetETL
[ "aaf4d0e211dcca58e8384e9574b59205b94a98a0" ]
[ "azfunctions/InputBlobTrigger/processor.py" ]
[ "# Standard library\nimport io\nimport logging\nimport math\nimport os\nimport time\n\n# Third party\nimport azure.functions as func\nimport pandas as pd\nimport psycopg2\nfrom shapely.geometry import Polygon\nimport xarray\n\n# Local\nfrom .utils import batches, human_readable, mean_step_size\n\n\nclass Processor:...
[ [ "pandas.io.sql.read_sql_query", "pandas.to_numeric", "pandas.merge" ] ]
varunarora/Paddle
[ "868bdc97713169f3525a014f71a4dd3e52e85008" ]
[ "python/paddle/fluid/tests/book/notest_understand_sentiment.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 re...
[ [ "numpy.array", "numpy.random.random_integers" ] ]
francesca-perillo/smartCarColorRecognizer
[ "efb8502b3872f9fda7b427f85bedda97ae8ea9d3" ]
[ "python/col_det_screen_view.py" ]
[ "from asyncio.windows_events import NULL\r\nfrom email import message\r\nimport cv2\r\nimport urllib.request\r\nimport numpy as np\r\n# to send color detection to arduino\r\nimport socket\r\nfrom threading import Thread\r\n# to delay the sending of messages\r\nimport timeit\r\n\r\n#function to open socket and conne...
[ [ "numpy.array" ] ]
amtagrwl/trax
[ "f7200793a0ce8922622d073a6ec90346efe8b679" ]
[ "trax/layers/metrics_test.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Trax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.ones_like", "numpy.ones" ] ]
karthikprasad/FLSim
[ "3c62fe83de2f06feffb9ed65ce9f71803bbd6027" ]
[ "flsim/utils/tests/test_model_param_utils.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport collections\nimport copy\nimport math\n\nimport torch\nimport torch.nn as nn\nfrom flsim.comm...
[ [ "torch.nn.init.constant_", "torch.norm", "torch.FloatTensor", "torch.manual_seed", "torch.randn_like", "torch.tensor", "torch.ones_like", "torch.zeros_like" ] ]
joseluis1061/neuralnilm
[ "06bd6abc4db41140b65dfc0677677ef2aecff349" ]
[ "neuralnilm/data/realaggregatesource.py" ]
[ "from __future__ import print_function, division\nfrom copy import copy\nfrom datetime import timedelta\nimport numpy as np\nimport pandas as pd\nimport nilmtk\nfrom nilmtk.timeframegroup import TimeFrameGroup\nfrom nilmtk.timeframe import TimeFrame\nfrom neuralnilm.data.source import Sequence\nfrom neuralnilm.util...
[ [ "pandas.DataFrame", "pandas.Series" ] ]
data2wealth/Interactive-Brokers-TWS-API-Python
[ "f7a8cbebe156cc7578704ac1b1f6eec0eec29910" ]
[ "samples/Python/Testbed/FileProcessor.py" ]
[ "import pandas as pd\r\nimport datetime as dt\r\nimport xml.etree.ElementTree as ETree\r\n\r\nimport DataStorage as DStrg\r\nimport DatabaseQuery as DBQry\r\nimport DatabaseWriter as DBWtr\r\n\r\nfrom ibapi.contract import Contract\r\n\r\ncsv_file_path = 'C:/Users/Rosie/Documents/Python Generated Files/'\r\n\r\n\r\...
[ [ "pandas.DataFrame", "pandas.read_excel", "pandas.ExcelWriter" ] ]
seatonullberg/cmstk
[ "f8dd4f698723053c06d181ecdd918d8e5fc98a92" ]
[ "cmstk/vasp/poscar.py" ]
[ "from cmstk.filetypes import TextFile\nfrom cmstk.structure.atom import Atom\nfrom cmstk.structure.simulation import SimulationCell\nfrom collections import OrderedDict\nimport numpy as np\nfrom typing import Dict, List, Optional, Tuple\n\n\nclass PoscarFile(TextFile):\n \"\"\"File wrapper for a VASP POSCAR file...
[ [ "numpy.array", "numpy.fromstring" ] ]
BinWang28/EvalRank-Embedding-Evaluation
[ "454dac5c7345f01993688f33375f637129c285e3" ]
[ "src/models/sent_emb/_bert.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n###\n# Created Date: 2022-03-20 16:44:31\n# Author: Bin Wang\n# -----\n# Copyright (c) 2022 National University of Singapore\n# \n# -----\n# HISTORY:\n# Date&Time \t\t\tBy\tComments\n# ----------\t\t\t---\t----------------------------------------------------------\n##...
[ [ "torch.no_grad", "numpy.stack", "torch.cuda.is_available" ] ]
Kzra/pykrev
[ "1a328fccded962f309e951c8509b87a82c3d3ae6" ]
[ "pykrev/plotting/kendrick_mass_defect_plot.py" ]
[ "from ..formula import kendrick_mass_defect\nfrom matplotlib import pyplot as plt\ndef kendrick_mass_defect_plot(mz_list, base = 'CH2', rounding = 'even', **kwargs):\n \"\"\" \n\tDocstring for function PyKrev.kendrick_mass_defect_plot.py\n\t====================\n\tThis function takes a list of molecular formula ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.gcf", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter", "matplotlib.pyplot.gca" ] ]
toandaominh1997/automlkiller
[ "c5f451cfb05d8287bec0d26a9b14e2c1b452861c" ]
[ "automlkiller/models/classification/adaboost_classifier.py" ]
[ "from sklearn.ensemble import AdaBoostClassifier\nfrom automlkiller.models.model_factory import ModelFactory\nfrom automlkiller.utils.distributions import np_list_arange, UniformDistribution, IntUniformDistribution\n@ModelFactory.register('classification-adaboostclassifier')\nclass AdaBoostClassifierContainer():\n ...
[ [ "sklearn.ensemble.AdaBoostClassifier" ] ]
scrlnas2019/nas4candle
[ "318959424cc66819c816054a87bd1cb5d426e2e7", "318959424cc66819c816054a87bd1cb5d426e2e7" ]
[ "nas4candle/candle/NT3/models/candle_conv_mlp_baseline.py", "nas4candle/nasapi/benchmark/nas/cifar10/load_data.py" ]
[ "import tensorflow as tf\n\nfrom nas4candle.nasapi.search.nas.model.baseline.util.struct import (create_seq_struct,\n create_struct_full_skipco)\nfrom nas4candle.nasapi.search.nas.model.space.block import Block\nfrom nas4candle.nasapi.search.nas.model.spac...
[ [ "tensorflow.keras.utils.plot_model" ], [ "numpy.true_divide", "numpy.empty", "numpy.shape" ] ]
SaiKrishna1207/Underwater-Image-Segmentation
[ "78def27e577b10e6722c02807bdcfeb7ba53d760" ]
[ "preprocessed_data/UCM/Code/global_histogram_stretching.py" ]
[ "import numpy as np\n\ndef histogram_r(r_array,height, width):\n length = height * width\n R_rray = []\n for i in range(height):\n for j in range(width):\n R_rray.append(r_array[i][j])\n R_rray.sort()\n I_min = int(R_rray[int(length / 500)])\n I_max = int(R_rray[-int(length / 500...
[ [ "numpy.zeros" ] ]
larsll/sagemaker-python-sdk
[ "4d0c2e67ea32376460a8d21abac4cc2c729d8c45" ]
[ "tests/integ/test_tf_script_mode.py" ]
[ "# Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in th...
[ [ "numpy.zeros" ] ]
starcraft2-ai/python-env
[ "4504696381b8721b9e9914f8ba8d17241348ecf8", "4504696381b8721b9e9914f8ba8d17241348ecf8" ]
[ "s2py3/lib/python3.6/site-packages/tensorflow/contrib/reduce_slice_ops/ops/gen_reduce_slice_ops.py", "s2py3/lib/python3.6/site-packages/tensorflow/contrib/text/python/ops/gen_skip_gram_ops.py" ]
[ "\"\"\"Python wrappers around TensorFlow ops.\n\nThis file is MACHINE GENERATED! Do not edit.\nOriginal C++ source file: reduce_slice_ops.cc\n\"\"\"\n\nimport collections as _collections\nimport six as _six\n\nfrom tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow\nfrom tensorflow.python.eager import...
[ [ "tensorflow.python.framework.ops.RegisterShape", "tensorflow.python.eager.context.context", "tensorflow.python.eager.execute.args_to_matching_eager", "tensorflow.python.eager.execute.execute", "tensorflow.python.framework.ops.convert_to_tensor", "tensorflow.python.eager.execute.record_grad...
ar90n/kkt
[ "e772860b20231e067973478350a4f0edb8bf5db1" ]
[ "examples/titanic_multi_files/script/random_forest.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nfrom sklearn.ensemble import RandomForestClassifier\n\nfrom titanic_multi_files import io, util\nfrom pathlib import Path\n\ntrain, test = io.load_dataset()\n\ndata = util.merge_dataset(train, test)\ndata[\"Sex\"].replace([\"male\", \"female\"], [0, 1], inplace=T...
[ [ "sklearn.ensemble.RandomForestClassifier", "numpy.mean" ] ]
samir-joshi/tmtoolkit
[ "42fdd388e606d6d1c45d80d2364dfa42b8408111" ]
[ "examples/bundestag18_tfidf.py" ]
[ "\"\"\"\nExample script that loads and processes the proceedings of the 18th German Bundestag and generates a tf-idf matrix.\nThe data is quite large, consisting of 15,733 documents with 14,355,341 tokens in total. This script shows how to\nhandle large data efficiently by using the parallel processing power of tmt...
[ [ "numpy.max", "numpy.array", "pandas.set_option", "numpy.median", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "numpy.min", "numpy.mean", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "matplotlib.pyplot.show" ] ]
acmlia/jobs
[ "ee13ac3363c8a4fab64e21c8787739f5de4ef385", "ee13ac3363c8a4fab64e21c8787739f5de4ef385", "ee13ac3363c8a4fab64e21c8787739f5de4ef385" ]
[ "tf_regression_sfcprcp_T17B6.py", "tf_regression_sfcprcp_T8.py", "tf_regression_sfcprcp_T10.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 20 21:31:04 2019\n\n@author: dvdgmf\n\"\"\"\n# https://www.tensorflow.org/tutorials/keras/basic_regression\n#------------------------------------------------------------------------------\n#-------------------------------------------------...
[ [ "matplotlib.pyplot.xlim", "numpy.where", "numpy.cumsum", "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gca", "sklearn.decomposition.PCA", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "matplotlib.pyplot.clf", "...
wangdecheng/QAStrategy
[ "d970242ea61cff2f1a6f69545dc7f65e8efd1672" ]
[ "GolemQ/portfolio/by_es_fof.py" ]
[ "#\n# The MIT License (MIT)\n#\n# Copyright (c) 2018-2020 azai/Rgveda/GolemQuant\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation ...
[ [ "numpy.round", "numpy.std", "numpy.array" ] ]
anuritabose/Advanced-Algorithm-FFT-RSA_Encryption
[ "748f571d85639db8ae090e0d10a3c3186bb11ba2" ]
[ "rsa.py" ]
[ "import numpy as np\r\nimport random\r\nimport cmath\r\nimport math\r\nimport copy\r\nimport time\r\n\r\n\r\n#generate two large odd numbers of a specific bit size\r\ndef generateLargeOdd(bitSize):\r\n a = random.getrandbits(128) | 1\r\n #print(a)\r\n return a\r\n\r\n\r\n#Primality check using Fermat Theor...
[ [ "numpy.allclose" ] ]
fossabot/ludwig
[ "d4ac229bbff89842fc3302cdafbd94c77c1cc069" ]
[ "ludwig/modules/loss_modules.py" ]
[ "# coding=utf-8\n# Copyright (c) 2019 Uber Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi...
[ [ "tensorflow.keras.losses.categorical_crossentropy", "tensorflow.reshape", "tensorflow.clip_by_value", "tensorflow.random.uniform_candidate_sampler", "tensorflow.cast", "tensorflow.shape", "tensorflow.concat", "numpy.log", "tensorflow.subtract", "tensorflow.transpose", "...
rmarshall10/Insight_App
[ "f0276e79d0ceaf2787762a1602d62a19db1c1800" ]
[ "app/routes.py" ]
[ "from flask import render_template\nfrom flask import request, Response, make_response\nfrom app import app\nfrom app import video_tracker\nfrom flask import send_from_directory\nimport os\nfrom werkzeug import secure_filename\nimport posenet\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\n\n#@app.rou...
[ [ "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.Session" ] ]
githubartema/efficientnet-lite-keras
[ "a8bda33caf9ecc69bde8f2ea2689ac24e7da7c02" ]
[ "test_efficientnet_lite/test_tfmot_qat_possibility.py" ]
[ "from typing import Callable, Tuple\n\nimport tensorflow as tf\nimport tensorflow_model_optimization as tfmot\nfrom absl.testing import absltest, parameterized\n\nfrom test_efficientnet_lite.test_model import TEST_PARAMS\n\n# Disable GPU\ntf.config.set_visible_devices([], \"GPU\")\n\n\nclass TestEfficientNetLiteQAT...
[ [ "tensorflow.keras.backend.clear_session", "tensorflow.config.set_visible_devices" ] ]
IuAyala/Self-Driving-Cars-Course
[ "3171a556726e1a67d43a8fae4512c66d3715cf1c" ]
[ "3_road_sign_classification/preprocessing.py" ]
[ "import os\nfrom pathlib import Path\nimport xml.dom.minidom\nimport cv2\nfrom skimage.transform import rescale, resize\nfrom sklearn.model_selection import train_test_split\nfrom PIL import Image\nimport numpy as np\nimport pickle\n\n# Dataset --> https://www.kaggle.com/andrewmvd/road-sign-detection\n# Classes (4)...
[ [ "sklearn.model_selection.train_test_split" ] ]
anchoranalysis/anchor-python-training
[ "f2089540b381cba8b2188a15797912f984d39f6c" ]
[ "src/anchor_python_training/visualize/reconstruction.py" ]
[ "\"\"\"Plots reconstruction of images against their original forms.\"\"\"\nimport torch\nimport torch.nn as nn\nfrom typing import Iterable\nimport numpy as np\n\n\nfrom .comparison import plot_images_two_rows\n\n\ndef plot_reconstruction_on_first_batch(\n loader: torch.utils.data.DataLoader, model_reconstructin...
[ [ "torch.no_grad" ] ]