repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
i-shah/heprn-hci-nam | [
"2fffeb773e01153d1b91314db59c2411a2c34858"
] | [
"src/heprnhci/hci/raw.py"
] | [
"import pandas as pd\nimport numpy as np\nimport scipy as sp\nimport pylab as pl\nfrom collections import *\nfrom copy import copy\nimport os\nimport subprocess\nimport numpy.linalg as LA\n\nfrom statsmodels import robust \nimport seaborn as sns\nfrom matplotlib import cm\n\n\ndef smooth(x,w=7):\n \"\"\"smooth t... | [
[
"numpy.ones"
]
] |
b-fullam/Automating-VirusTotal-APIv3-for-IPs-and-URLs | [
"69e735feb89f80555aeff767191fb60530d9baf8"
] | [
"vt-ip-url-analysis.py"
] | [
"import argparse\nimport time\nfrom pathlib import Path\nimport requests\nimport re\nimport pandas as pd\nimport json\nimport base64\nimport os\nimport hashlib\nfrom dotenv import load_dotenv\n\n\n# //////////////////////////////////////////////\n#\n# Python Automated VT API v3 IP address and URL analysis 2.0\n# by... | [
[
"pandas.DataFrame.from_dict"
]
] |
lindsayad/python | [
"4b63a8b02de6a7c0caa7bb770f3f22366e066a7f"
] | [
"import_water_files.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nfrom matplotlib import rc\nrc('text', usetex=True)\n#\nmpl.rcParams.update({'font.size': 16})\n\nf = '/home/lindsayad/gdrive/MooseOutput/H_H3Op_OH_Om.csv'\n\ndata = np.loadtxt(f,delimiter=',')\nH = data[:,0]\nH3Op = data[:,1]\nOH = data... | [
[
"matplotlib.pyplot.figure",
"matplotlib.rc",
"numpy.loadtxt",
"matplotlib.rcParams.update",
"matplotlib.pyplot.show"
]
] |
ForrestPi/FaceProjects | [
"87ae30191c01eadc3cfa59b751db91f1aa76bc5d",
"87ae30191c01eadc3cfa59b751db91f1aa76bc5d"
] | [
"blog/centerface/datasets.py",
"faceRecognition/model/metric.py"
] | [
"import os\nimport os.path as osp\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom PIL import Image\n\nfrom utils import VisionKit\n\n\n\nclass WiderFace(Dataset, VisionKit):\n\n def __init__(self, dataroot, annfile, sigma, downscale, insize, transforms=None):\n \"\"\"\n ... | [
[
"numpy.log",
"numpy.zeros",
"numpy.exp",
"numpy.loadtxt",
"numpy.arange",
"numpy.maximum"
],
[
"torch.nn.functional.normalize",
"torch.FloatTensor",
"torch.nn.init.xavier_uniform_",
"torch.where"
]
] |
ravi-mosaicml/ravi-composer | [
"d100053198524672f628c3959a8c4e51a9302e2d",
"d100053198524672f628c3959a8c4e51a9302e2d"
] | [
"composer/trainer/ddp.py",
"composer/models/efficientnetb0/efficientnets.py"
] | [
"# Copyright 2021 MosaicML. All Rights Reserved.\n\n\"\"\"Helpers for running distributed data parallel training.\"\"\"\n\nfrom contextlib import contextmanager, nullcontext\nfrom typing import Callable, ContextManager, Union, cast\n\nimport torch.nn\nfrom torch.nn.parallel import DistributedDataParallel\n\nfrom co... | [
[
"torch.nn.parallel.DistributedDataParallel"
],
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
hemincong/MachineLearningExercise | [
"2c70f0df9f95bbebb9cf4e41178af5a06d3f3e16"
] | [
"ex7_K_means_Clustering_and_Principal_Component_Analysis/recoverData.py"
] | [
"import numpy as np\n\n\n# RECOVERDATA Recovers an approximation of the original data when using the\n# projected data\n# X_rec = RECOVERDATA(Z, U, K) recovers an approximation the\n# original data that has been reduced to K dimensions. It returns the\n# approximate reconstruction in X_rec.\n#\n\ndef recoverD... | [
[
"numpy.dot",
"numpy.shape"
]
] |
coletta1/gym-copter | [
"841a8ea2c5343e289bc06efd6ad49a75ba14cccd"
] | [
"gym_copter/envs/lander2d.py"
] | [
"#!/usr/bin/env python3\n'''\n2D Copter-Lander, based on\n https://github.com/openai/gym/blob/master/gym/envs/box2d/lunar_lander.py\n\nThis version controls each motor separately\n\nCopyright (C) 2019 Simon D. Levy\n\nMIT License\n'''\n\nimport numpy as np\nimport time\n\nimport gym\nfrom gym import spaces\nfrom g... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"numpy.sum",
"numpy.random.uniform",
"numpy.clip"
]
] |
Muzammal-Naseer/TTP | [
"d18a583bd83ff97bc2589e4563f1f121347b11ed"
] | [
"eval_all.py"
] | [
"'''\nEvaluation for 10/100-targets allsource setting as discussed in our paper.\nFor each target, we have 49500 samples of the other classes.\n'''\n\nimport argparse\nimport os\n\nimport torchvision\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\nimpo... | [
[
"torch.max",
"torch.clamp",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.DataParallel"
]
] |
rightlit/StackGAN-v2-rev | [
"bf5929db7f7e89a13067ae6332a5b6938210a0be"
] | [
"code/trainer.py"
] | [
"from __future__ import print_function\nfrom six.moves import range\n\nimport torch.backends.cudnn as cudnn\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport torchvision.utils as vutils\nimport numpy as np\nimport os\nimport time\nfrom PIL import Image, I... | [
[
"torch.cat",
"numpy.exp",
"numpy.mean",
"torch.bmm",
"torch.load",
"torch.nn.DataParallel",
"numpy.max",
"numpy.concatenate",
"numpy.log",
"torch.autograd.Variable",
"torch.FloatTensor",
"numpy.transpose",
"torch.nn.BCELoss",
"numpy.std",
"torch.cuda.set... |
vnavkal/FairMOT | [
"4651cf5aac20063995f525264cc2e3fa294a337a"
] | [
"src/lib/tracker/multitracker.py"
] | [
"from collections import deque\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom models import *\nfrom models.decode import mot_decode\nfrom models.model import create_model, load_model\nfrom models.utils import _tranpose_and_gather_feat\nfrom tracker import matching\nfrom tracking_utils.ka... | [
[
"numpy.concatenate",
"torch.device",
"numpy.array",
"numpy.linalg.norm",
"torch.nn.functional.normalize",
"numpy.asarray",
"torch.no_grad",
"numpy.where",
"numpy.partition"
]
] |
kompotiks/EYE | [
"6730db17460a0f3c29708b78c72c26a6225852ad"
] | [
"src/model_lib/train_model.py"
] | [
"from tensorflow.keras.preprocessing.image import ImageDataGenerator\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef plot_model_history(model_history):\n\n fig, axs = plt.subplots(1,2,figsize=(15,5))\n \n axs[0].plot(range(1,len(model_history.history['accuracy'])+1),model_history.history['acc... | [
[
"matplotlib.pyplot.show",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"matplotlib.pyplot.subplots"
]
] |
zuoym15/COTR | [
"a956ca58e501a7ebfe61969570767daacd574d7d"
] | [
"COTR/inference/inference_helper.py"
] | [
"import warnings\n\nimport cv2\nimport numpy as np\nimport torch\nfrom torchvision.transforms import functional as tvtf\nfrom tqdm import tqdm\nimport PIL\n\nfrom COTR.utils import utils, debug_utils\nfrom COTR.utils.constants import MAX_SIZE\nfrom COTR.cameras.capture import crop_center_max_np, pad_to_square_np\nf... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"torch.cat",
"numpy.ones_like",
"numpy.zeros",
"numpy.argmin",
"torch.norm",
"numpy.ones",
"torch.from_numpy",
"numpy.stack",
"numpy.prod",
"numpy.clip",
"scipy.spatial.Delaunay"
]
] |
ykkawana/neural_star_domain | [
"b6e19863a662b4338cfd742ad8f32505315f0f83"
] | [
"im2mesh/nsd/models/nsd_decoder.py"
] | [
"import torch\nfrom torch import nn\nfrom im2mesh.nsd.models import geometry_utils\nfrom im2mesh.nsd.models import radius_decoder\nfrom im2mesh.nsd.models import sphere_decoder\n\nEPS = 1e-7\n\n\nclass NeuralStarDomainDecoder(sphere_decoder.SphereDecoder):\n def __init__(self,\n num_points,\n ... | [
[
"torch.zeros",
"torch.stack",
"torch.isnan"
]
] |
Sudo-Biao/s-LWSR | [
"789ed425830873018c632fe56a8d6953a96edbc5"
] | [
"Train/code/model/lwsr.py"
] | [
"from model import common\n\nimport torch.nn as nn\n\nimport torch\n\ndef make_model(args, parent=False):\n return LWSR(args)\n\ndef default_conv(in_channels, out_channels, kernel_size, bias=True):\n return nn.Conv2d(\n in_channels, out_channels, kernel_size,\n padding=(kernel_size//2), bias=bia... | [
[
"torch.cat",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.add",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
jcfr/UncertainSCI-web-demos | [
"c550ef897b04ef5533422798511a4bd668913b8f"
] | [
"1D-python-demos/app.py"
] | [
"import os\n\nfrom itertools import chain, combinations\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom UncertainSCI.distributions import BetaDistribution, ExponentialDistribution\nfrom UncertainSCI.model_examples import laplace_ode_1d, sine_modulation\nfrom UncertainSCI.indexing import TotalDegreeSe... | [
[
"numpy.zeros",
"numpy.random.seed",
"numpy.ones",
"numpy.random.random",
"numpy.linspace"
]
] |
chloechsu/nanoparticle | [
"5e78fe33c2d562aa31d5e458be0dbf52813f20b1"
] | [
"src/resnet.py"
] | [
"import torch\nimport torch.nn as nn\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',\n 'wide_resnet50_2', 'wide_resnet101_2', 'RESNET_NAME_TO_MODEL_MAP']\n\n\ndef conv1d_3(in_planes, out_planes, stride=1, groups=1, di... | [
[
"torch.nn.Linear",
"torch.flatten",
"torch.nn.Conv1d",
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.AdaptiveAvgPool1d",
"torch.nn.MaxPool1d"
]
] |
Chainso/HLRL | [
"584f4ed2fa4d8b311a21dbd862ec9434833dd7cd"
] | [
"hlrl/torch/algos/sac/sac_recurrent.py"
] | [
"from typing import Dict, Tuple, Union\n\nimport torch\nimport torch.nn as nn\n\nfrom .sac import SAC\nfrom hlrl.torch.common import polyak_average\n\nclass SACRecurrent(SAC):\n \"\"\"\n Soft-Actor-Critic with a recurrent network.\n \"\"\"\n def forward(\n self,\n observation: torc... | [
[
"torch.no_grad",
"torch.min"
]
] |
Taimoor55/TrustPrime | [
"362320b7f31b94a9dac8055bd4d459c75bae16af"
] | [
"real.py"
] | [
"# import the necessary packages\nfrom imutils.video import VideoStream\nfrom imutils.video import FPS\nimport numpy as np\nimport argparse\nimport imutils\nimport time\nimport cv2\n\n# construct the argument parse and parse the arguments\nap = argparse.ArgumentParser()\nap.add_argument(\"-p\", \"--prototxt\", requ... | [
[
"numpy.array",
"numpy.arange"
]
] |
divideby0/dynamo-pandas | [
"3a28921bb2ecaecab20ee8cd919f4c686a81e2b5"
] | [
"tests/test_transactions.py"
] | [
"import base64\nimport os\nimport sys\n\nimport pandas as pd\nimport pytest\nfrom test_data import large_table_items\nfrom test_data import test_df\n\nfrom dynamo_pandas import keys\nfrom dynamo_pandas.transactions import get_all_items\nfrom dynamo_pandas.transactions import get_item\nfrom dynamo_pandas.transaction... | [
[
"pandas.DataFrame"
]
] |
vipulnaik/donations | [
"37f5aa7174d2fcf89946910012bd86419ae77653"
] | [
"python/graph.py"
] | [
"#!/usr/bin/python3\n\nimport argparse\nimport pandas as pd\nimport numpy as np\nimport matplotlib\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n# from dateutil.relativedelta import relativedelta\n\npd.set_option('display.width', 1000)\n\ndef main():\n... | [
[
"matplotlib.use",
"pandas.to_datetime",
"numpy.square",
"pandas.set_option",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"numpy.log10",
"matplotlib.pyplot.clf",
"pandas.read_csv"
]
] |
zhunzhong07/deep-person-reid | [
"c0af24220533881607e165d6c7019e1975fb2dda"
] | [
"train_imgreid_xent_htri.py"
] | [
"from __future__ import print_function\nfrom __future__ import division\n\nimport os\nimport sys\nimport time\nimport datetime\nimport os.path as osp\nimport numpy as np\nimport warnings\n\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\n\nfrom args import argument_parser, image_dataset_k... | [
[
"torch.cat",
"numpy.asarray",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.pow"
]
] |
knok/BuildingMachineLearningSystemsWithPython | [
"bb7510741b5a745237186a85c6b648e5b8b37f26"
] | [
"ch05/utils.py"
] | [
"# This code is supporting material for the book\n# Building Machine Learning Systems with Python\n# by Willi Richert and Luis Pedro Coelho\n# published by PACKT Publishing\n#\n# It is made available under the MIT License\n\nimport os\n\ntry:\n import ujson as json # UltraJSON if available\nexcept:\n import ... | [
[
"numpy.max",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.legend",
"matplotlib.pylab.fill_between",
"matplotlib.pylab.grid",
"matplotlib.pylab.bar",
"matplotlib.pylab.figure",
"matplotlib.pylab.hist",
"matplotlib.pylab.xlabel",
"matplotlib.pylab.subplot",
"matplotlib.py... |
adcoh/sdc_course | [
"f96150e0b78c14d138986f44325d87dca6272597"
] | [
"seminar02-graph-slam/code/optimization.py"
] | [
"import inspect\nimport itertools\nimport operator\nimport sys\n\nimport numpy as np\n\nimport graph_elements as ge\nimport constraint_builder_interface as cbi\n\nclass Optimization(object):\n '''\n Represents optimization system\n \n At the initialization it should create all vertices, edges and featur... | [
[
"numpy.concatenate",
"numpy.zeros_like",
"numpy.dot",
"numpy.clip",
"numpy.zeros",
"numpy.eye",
"numpy.power",
"numpy.linalg.solve",
"numpy.cumsum",
"numpy.isfinite",
"numpy.abs",
"numpy.linalg.inv"
]
] |
NGEscribano/timenorm-es | [
"509580e27a62db53d99da33f6cfde5722ffed92e"
] | [
"src/main/python/preprocess.py"
] | [
"# encoding: utf-8\nimport preprocess_functions as process\nimport read_files as read\nimport os\nfrom nltk.tokenize import sent_tokenize\nfrom nltk.tokenize.util import regexp_span_tokenize\nimport numpy as np\nfrom collections import defaultdict\nfrom random import randint\nimport argparse\nimport configparser\ni... | [
[
"numpy.count_nonzero",
"numpy.asarray",
"numpy.zeros",
"numpy.save",
"numpy.eye",
"numpy.repeat",
"numpy.linspace"
]
] |
yunhuiguo/tensorpack | [
"91ce2260e5dc41b802b1a39b8b65ae6bee7ac719"
] | [
"tensorpack/callbacks/steps.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: steps.py\n\n\"\"\" Some common step callbacks. \"\"\"\n\nimport tensorflow as tf\nfrom six.moves import zip\nimport tqdm\n\nfrom ..utils import logger\nfrom ..utils.utils import get_tqdm_kwargs\nfrom ..utils.naming import GLOBAL_STEP_INCR_OP_NAME\nfrom ..tfut... | [
[
"tensorflow.assign_add",
"tensorflow.name_scope",
"tensorflow.train.SessionRunArgs"
]
] |
fififei/cvat-on-aws-china | [
"9bdd5c8027566b214acad2f9589e8ca5020c02b7"
] | [
"cvat-serverless/functions/endpoints/openvino_reidentification.py"
] | [
"from django.http import HttpResponse, JsonResponse\nimport boto3\nimport json\nimport io\nimport base64\nfrom django.conf import settings\nfrom PIL import Image\nimport math\nimport numpy\nimport os\nfrom scipy.optimize import linear_sum_assignment\nfrom scipy.spatial.distance import euclidean, cosine\n\n\ndef inf... | [
[
"scipy.optimize.linear_sum_assignment",
"scipy.spatial.distance.cosine",
"scipy.spatial.distance.euclidean",
"numpy.clip"
]
] |
vallsv/silx | [
"834bfe9272af99096faa360e1ad96291bf46a2ac"
] | [
"silx/gui/plot/test/testScatterMaskToolsWidget.py"
] | [
"# coding: utf-8\n# /*##########################################################################\n#\n# Copyright (c) 2016-2017 European Synchrotron Radiation Facility\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Soft... | [
[
"numpy.equal",
"numpy.random.random",
"numpy.ones",
"numpy.arange"
]
] |
TorbenFricke/cmtoolkit | [
"f1bf1ec191fd9b20e6edcd3385c8b9fee1d638ca"
] | [
"tests/test_disk.py"
] | [
"import unittest\nimport numpy as np\nfrom numpy.testing import *\nfrom conformalmapping import *\n\nclass TestDisk(unittest.TestCase):\n\n def test_unitdisk(self):\n d = unitdisk()\n\n def test_disk_boundbox(self):\n d = unitdisk()\n box = d.boundbox()\n\n # by inspection three de... | [
[
"numpy.array"
]
] |
ojcastillo/disaster_response_pipeline | [
"43bd5c0bf34ebe09bd188e077c698ec1b518d4e8"
] | [
"data/process_data.py"
] | [
"import sys\n\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\n\ndef load_data(messages_filepath, categories_filepath):\n \"\"\"Loads a messages and categories CSV files and merges them into a single Pandas dataframe\"\"\"\n messages = pd.read_csv(messages_filepath)\n categories = pd.read_csv(... | [
[
"pandas.read_csv",
"pandas.merge",
"pandas.concat"
]
] |
liamlio/probability | [
"bbbd65ee29b5a7752b80118c1bd43836375b69aa"
] | [
"tensorflow_probability/python/math/minimize.py"
] | [
"# Copyright 2019 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.compat.v2.concat",
"tensorflow.compat.v2.control_dependencies",
"tensorflow.compat.v2.function",
"tensorflow.compat.v2.TensorSpec",
"numpy.arange",
"tensorflow.compat.v2.zeros",
"tensorflow.compat.v2.GradientTape",
"tensorflow.compat.v2.nest.flatten",
"tensorflow.co... |
AICryptoGroup/TorchSlim | [
"5e1a5eb994b7b22e226cce9ee3849a623ddaacb7"
] | [
"optimization/pruning/prune/lottery_ticket.py"
] | [
"import copy\nimport logging\nimport torch\nfrom schema import And, Optional\nfrom optimization.common.base import PrunerSchema\nfrom optimization.pruning.core import Pruner, WeightMasker\n\nlogger = logging.getLogger(__name__)\n\nclass LevelPrunerMasker(WeightMasker):\n\n def calc_mask(self, sparsity, wrapper, ... | [
[
"torch.gt",
"torch.ones"
]
] |
jyoonab/EasyVtuber | [
"6a1341b632f1cf56a570bbf2689cbd568360a46c"
] | [
"tha2/nn/face/face_morpher_08.py"
] | [
"import math\nfrom typing import List, Optional\n\nimport torch\nfrom torch import Tensor\nfrom torch.nn import ModuleList, Sequential, Sigmoid, Tanh\nfrom torch.nn.functional import affine_grid, grid_sample\n\nfrom tha2.nn.batch_module.batch_input_module import BatchInputModule, BatchInputModuleFactory\nfrom tha2.... | [
[
"torch.device",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Sigmoid",
"torch.nn.Tanh",
"torch.nn.functional.grid_sample",
"torch.tensor",
"torch.nn.functional.affine_grid",
"torch.randn"
]
] |
meghana-sesetti/adversarial-robustness-toolbox | [
"62ffe7c951d8a60d49a9ea6ac7b04aa4432a3fb7",
"62ffe7c951d8a60d49a9ea6ac7b04aa4432a3fb7"
] | [
"examples/inverse_gan_author_utils.py",
"tests/attacks/test_poisoning_attack_svm.py"
] | [
"# Copyright 2018 The Defense-GAN 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 req... | [
[
"tensorflow.contrib.layers.batch_norm",
"tensorflow.constant_initializer",
"tensorflow.nn.conv2d",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.is_variable_initialized",
"tensorflow.ones_initializer",
"tensorflow.matmul",
"tensorflow.ones_like",
"tensorflow.train... |
resource-watch/data-pre-processing | [
"951a6d61c848dfc2a26add331b4ad868eda9aaad"
] | [
"com_007_rw1_fdi_regulatory_restrictiveness_index/com_007_rw1_fdi_regulatory_restrictiveness_index_processing.py"
] | [
"import pandas as pd\nimport os\nimport sys\nutils_path = os.path.join(os.path.abspath(os.getenv('PROCESSING_DIR')),'utils')\nif utils_path not in sys.path:\n sys.path.append(utils_path)\nimport util_files\nimport util_cloud\nimport util_carto\nfrom zipfile import ZipFile\nimport shutil\nimport logging\nimport g... | [
[
"pandas.read_csv",
"pandas.pivot_table"
]
] |
ArifSohaib/AutonomousRobotChallenge | [
"10f7299022158425c6e7aa40f427105503d38468"
] | [
"videoClassification/preprocessing.py"
] | [
"import tensorflow as tf\nimport pathlib\n\ndef preprocess_image(image):\n image = tf.image.decode_jpeg(image, channels=3)\n image = tf.image.resize(image, [192, 192])\n image /= 255.0 # normalize to [0,1] range\n return image\n\ndef load_and_preprocess_image(path):\n image = tf.io.read_file(path)\n... | [
[
"tensorflow.io.read_file",
"tensorflow.reshape",
"tensorflow.io.parse_tensor",
"tensorflow.image.resize",
"tensorflow.image.decode_jpeg"
]
] |
icefoxx/rDnaTools | [
"d184ffece7902dacddc278636eb806ab3697208b"
] | [
"src/pbrdna/io/FastqIO.py"
] | [
"#################################################################################\n# Copyright (c) 2011-2013, Pacific Biosciences of California, Inc.\n#\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 condit... | [
[
"numpy.array_equiv",
"numpy.fromstring",
"numpy.clip"
]
] |
apaleyes/differential-privacy-bayesian-optimization | [
"252c389e2a36226383bfc5b931599a3bed2b6dda",
"252c389e2a36226383bfc5b931599a3bed2b6dda"
] | [
"experiments/output_perturbation/scikit-learn/examples/compose/plot_digits_pipe.py",
"experiments/output_perturbation/scikit-learn/examples/neural_networks/plot_rbm_logistic_classification.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n=========================================================\nPipelining: chaining a PCA and a logistic regression\n=========================================================\n\nThe PCA does an unsupervised dimensionality reduction, while the logistic\nregression d... | [
[
"sklearn.datasets.load_digits",
"pandas.DataFrame",
"numpy.logspace",
"matplotlib.pyplot.subplots",
"sklearn.linear_model.SGDClassifier",
"matplotlib.pyplot.tight_layout",
"sklearn.model_selection.GridSearchCV",
"matplotlib.pyplot.show",
"sklearn.pipeline.Pipeline",
"sklear... |
KayChou/2048-api | [
"a4cb3394fa1ee00ad52b7cc1534da7861cb00935"
] | [
"Dataset/iter_dump.py"
] | [
"import numpy as np\nimport sys\nsys.path.append(\"..\")\nfrom game2048.expectimax import board_to_move\nfrom game2048.game import Game\nfrom game2048.agents import ExpectiMaxAgent\nfrom game2048.displays import Display\nimport csv, os\n\nGAME_SIZE = 4\nSCORE_TO_WIN = 2048\niter_num = 300\n\ngame = Game(GAME_SIZE, ... | [
[
"numpy.int32",
"numpy.log2",
"numpy.append"
]
] |
adityavyasbme/GetSetHedge | [
"2586e0d28ee9e2db17bc0947ada0f4cb6a3eeac6"
] | [
"src/eda/child.py"
] | [
"import pandas as pd\nimport logging\nfrom src.helper import create_logger\n\nlogger = create_logger('child', 'logs/Child.log',\n logging.DEBUG, logging.WARNING)\n\n\nclass Teacher_Knowledge:\n \"\"\"Tracker Based Class\n \"\"\"\n def __init__(self):\n self.data = None\n\n d... | [
[
"pandas.concat"
]
] |
SimonKenoby/Master-Thesis-Fake-News-Dectection | [
"2c3a5e82d4c7d6294ca87c265a1b638d61f2cb08"
] | [
"Code/models/Self_Embedding/Attention/utils/dbUtils.py"
] | [
"from pymongo import MongoClient\n\nclass DBIterator(object):\n\n \"\"\"\n A class to iterate over a collection in mongodb and access it by index\n\n Attributes\n ----------\n collection: str\n the name of the collection to iterate over\n limit: int\n The maximum amount of element t... | [
[
"pandas.DataFrame"
]
] |
nhatsmrt/nn-toolbox | [
"689b9924d3c88a433f8f350b89c13a878ac7d7c3",
"689b9924d3c88a433f8f350b89c13a878ac7d7c3"
] | [
"tests/test_convlstm.py",
"nntoolbox/vision/components/dense.py"
] | [
"from nntoolbox.vision.components import ConvLSTM2dCell, ConvLSTM2d\nimport torch\nfrom torch import nn\nfrom torch.optim import Adam\nimport torchvision\n\n\nclass TestConvLSTM2dCell:\n def test_cell(self):\n input_seq = torch.randn(5, 16, 4, 32, 32)\n expected_output = torch.randn(5, 16, 16, 32, ... | [
[
"torch.nn.MSELoss",
"torch.stack",
"torch.randn"
],
[
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d"
]
] |
cmu-sei/augur-code | [
"d8c1e29ce3276037b26b65ea316d251752529449"
] | [
"harness/datasets/ref_dataset.py"
] | [
"# Augur: A Step Towards Realistic Drift Detection in Production MLSystems - Code\r\n# Copyright 2022 Carnegie Mellon University.\n# \r\n# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN \"AS-IS\" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF AN... | [
[
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.append",
"numpy.unique"
]
] |
jamesoneill12/LayerFusion | [
"99cba1030ed8c012a453bc7715830fc99fb980dc",
"99cba1030ed8c012a453bc7715830fc99fb980dc"
] | [
"prune/fischer.py",
"models/loss/sinkhorn.py"
] | [
"import numpy as np\nfrom functools import reduce\nfrom torch.autograd import Variable\nimport torch\nimport random\nimport operator\n\n\nclass Pruner:\n def __init__(self, module_name='MaskBlock'):\n # First get vector of masks\n self.module_name = module_name\n self.masks = []\n sel... | [
[
"numpy.concatenate",
"torch.zeros",
"torch.cat",
"torch.min",
"torch.save",
"numpy.where",
"torch.sum"
],
[
"torch.FloatTensor",
"torch.abs",
"torch.zeros_like",
"torch.log",
"torch.empty",
"torch.exp",
"torch.sum"
]
] |
0x00-pl/kendryte-model-compiler | [
"051e5560cb76d3e210fe76e32435c230590aff9d"
] | [
"dataset_loader/fbank2/__init__.py"
] | [
"import os\n\nimport numpy as np\n\n\ndef load_file(filename, file_format, frame_rate=16000):\n import pydub\n from pydub import effects\n sound = pydub.AudioSegment.from_file(filename, file_format)\n sound = sound.set_frame_rate(frame_rate)\n sound = sound.set_channels(1)\n sound = sound.set_samp... | [
[
"numpy.square",
"numpy.fft.rfft",
"numpy.dot",
"numpy.array",
"numpy.log",
"numpy.zeros",
"numpy.ones",
"numpy.std",
"numpy.finfo",
"numpy.transpose",
"numpy.clip",
"numpy.average"
]
] |
yufeimi/CVPlot | [
"f09ccd98fb66e8d731e5dcd744c6c8dc9e13b7b8"
] | [
"src/bernoulli.py"
] | [
"import sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport yaml\n\nfrom smooth import *\n\n# Global variables\nS = 1.397 # Cross section area (height in 2D)\nc = 34000 # Sound speed\nrho = 1.3e-3 # Air density\nmu = 1.8e-4 # Air viscosity\nto_newton = 1e-5 # Convert from dyne... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.locator_params",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
bricewang/rl-credit | [
"bd201b06617a060b9306acc9710c9dfa5002ead2"
] | [
"rl_credit/examples/distractor_variance_expt.py"
] | [
"import numpy as np\nimport gym\nimport wandb\n\nfrom rl_credit.examples.environment import (\n DISCOUNT_FACTOR,\n VaryGiftsGoalEnv,\n)\nfrom rl_credit.examples.train import train\n\n\nDISCOUNT_TIMESCALE = int(np.round(1/(1 - DISCOUNT_FACTOR)))\nDELAY_STEPS = 0.5 * DISCOUNT_TIMESCALE\n\n\n####################... | [
[
"numpy.round"
]
] |
abt8601/diffusion-maps | [
"d2bca8bf6f0921b085484f690a4475456b1887b5"
] | [
"diffusion_maps_ref.py"
] | [
"\"\"\"Reference implementation of the diffusion maps algorithm.\"\"\"\n\nfrom typing import Callable, List\n\nimport numpy as np\nfrom scipy import sparse\nfrom scipy.sparse import linalg as slinalg\n\n\ndef _compute_kernel_matrix(data: np.ndarray,\n kernel: Callable[[np.ndarray, np.ndarr... | [
[
"scipy.sparse.coo_matrix",
"numpy.linalg.norm",
"scipy.sparse.diags",
"scipy.sparse.linalg.eigsh",
"numpy.flip"
]
] |
alumae/Automatic_Speech_Recognition | [
"697c47125dd108311e23e2210728bfba207b396e"
] | [
"main/madarian_train.py"
] | [
"#-*- coding:utf-8 -*-\n#!/usr/bin/python\n''' Automatic Speech Recognition for LibriSpeech corpus\n\nauthor(s):\nzzw922cn\n \ndate:2017-4-15\n'''\n\nimport sys\nsys.path.append('../')\nsys.dont_write_bytecode = True\n\nimport time\nimport datetime\nimport os\nfrom six.moves import cPickle\nfrom functools impor... | [
[
"tensorflow.python.platform.flags.DEFINE_integer",
"tensorflow.python.platform.flags.DEFINE_boolean",
"tensorflow.Session",
"tensorflow.train.get_checkpoint_state",
"tensorflow.python.platform.flags.DEFINE_float",
"tensorflow.python.platform.flags.DEFINE_string"
]
] |
catnlp/catnlp | [
"df86a56b4446ac915dda977c71ddf46b34edae55"
] | [
"src/catnlp/ner/train_lstm.py"
] | [
"# -*- coding:utf-8 -*-\n\nimport os\nimport logging\nfrom pathlib import Path\nimport random\n\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom .util.progressbar import ProgressBar\nfrom... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.cuda.is_available",
"torch.device",
"torch.utils.tensorboard.SummaryWriter"
]
] |
maganrobotics/UR3e-manipulation | [
"ceaf650b1a811d0bfc3baf175d353fc7f4a33522"
] | [
"motionplanning/rrt/ddrrtconnect.py"
] | [
"#!/usr/bin/python\n\n\"\"\"\nThe script is written following\nhttp://myenigma.hatenablog.com/entry/2016/03/23/092002\nthe original file was 2d\n\n\n\"\"\"\n\nimport gc\nimport random\nimport copy\nimport math\nimport numpy as np\n\nclass DDRRTConnect(object):\n\n def __init__(self, start, goal, iscollidedfunc, ... | [
[
"numpy.linalg.norm",
"numpy.asarray",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.axis"
]
] |
haoxiangsnr/aps | [
"38f77139b54553b0cb04b26a833bebbbf3177c5e"
] | [
"cmd/compute_ss_metric.py"
] | [
"#!/usr/bin/env python\n\n# Copyright 2018 Jian Wu\n# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\nimport tqdm\nimport argparse\nimport numpy as np\n\nfrom aps.loader import AudioReader\nfrom aps.metric.reporter import AverageReporter\nfrom aps.metric.sse import permute_metric\n\n\ndef run(ar... | [
[
"numpy.stack"
]
] |
sajadn/Exemplar-VAE | [
"4dbd0913d315db6ef9e3b5a689fae4140add2323"
] | [
"analysis.py"
] | [
"import torch\nimport argparse\nfrom utils.load_data.data_loader_instances import load_dataset\nimport torchvision\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nfrom utils.plot_images import imshow\nfrom utils.utils import load_model\nfrom utils.classify_data import classify_data\nfrom utils.knn_... | [
[
"torch.rand",
"torch.cat",
"torch.cuda.manual_seed",
"numpy.array",
"numpy.random.seed",
"matplotlib.pyplot.savefig",
"torch.no_grad",
"sklearn.manifold.TSNE",
"numpy.mean",
"torch.manual_seed",
"numpy.std",
"torch.randint",
"torch.cuda.is_available",
"torch... |
zhoulw13/FCOS | [
"d6a690d5f24b806b54755de562e1aa858eff2c98",
"d6a690d5f24b806b54755de562e1aa858eff2c98"
] | [
"fcos_core/modeling/rpn/osis/osis.py",
"fcos_core/modeling/roi_heads/keypoint_head/roi_keypoint_predictors.py"
] | [
"import math\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\n#from .inference import make_osis_postprocessor\nfrom .loss import make_osis_loss_evaluator\n\n#from maskrcnn_benchmark.layers import Scale\n\nclass OSISHead(torch.nn.Module):\n def __init__(self, cfg, in_channels):\n \"\... | [
[
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.GroupNorm",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.normal_"
],
[
"torch.nn.init.kaiming_normal_",
"torch.nn.init.constant_"
]
] |
watson21/Knowledge_Distilling | [
"2e217208485c99b68c0cc2548f97d2cb0c82d1d0"
] | [
"inference.py"
] | [
"import torch, timm\nimport torch.nn as nn\nimport torchvision.models as models\nimport torchvision.transforms as T\nimport albumentations as A\nfrom albumentations.pytorch import ToTensorV2\nfrom colorama import Fore\nimport numpy as np\nimport cv2\n# from scipy.special import softmax\nfrom distiller.loss import s... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cuda.is_available",
"torch.load"
]
] |
Edwinem/pytorch_scripts | [
"7b619cb03ac817eb72b04ecded018d106cd59fc7"
] | [
"img_proc.py"
] | [
"import numpy as np\nimport math\nfrom skimage import transform, img_as_ubyte\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom torchvision import utils\nfrom PIL import Image\n# Ignore warnings\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\n\nimport json\nimport logging\nimpor... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.log",
"matplotlib.pyplot.subplots",
"torch.from_numpy",
"numpy.random.randint",
"matplotlib.pyplot.gcf",
"numpy.repeat",
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle"
]
] |
fbussv/PyDSlog | [
"7a2d1a0a615ac261eca6d9e9613e7edbe7869217"
] | [
"examples/example_signal_classificator_1.py"
] | [
"import PyDSlog.classificator as classificator\nimport PyDSlog.transform as transform\nimport pandas as pd\nimport numpy as np\n\n\nN = 800\nfs = 400\nT = 1 / fs\n\nPREFIX = \"1478193801060\"\n\nX_FILES = [PREFIX+\"_x_ACCX_.csv\",PREFIX+\"_x_ACCY_.csv\",PREFIX+\"_x_ACCZ_.csv\",\n PREFIX+\"_x_GYRX_.csv\",P... | [
[
"numpy.array",
"sklearn.metrics.classification_report",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"numpy.squeeze"
]
] |
suyash/stylizer | [
"50d4df89eb4299a228cc208fb140d7ea0cfc4295"
] | [
"stylizer/utils/utils.py"
] | [
"import tensorflow as tf\n\n\n@tf.function\ndef resize_min(img, min_dim=512):\n \"\"\"\n Scale the image preserving aspect ratio so that the minimum dimension is `min_dim`.\n Then, take a square crop in the middle to get a `min_dim` x `min_dim` image.\n \"\"\"\n scale = tf.constant(min_dim, dtype=tf.... | [
[
"tensorflow.shape",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.reshape",
"tensorflow.constant",
"tensorflow.image.resize_image_with_crop_or_pad",
"tensorflow.cast"
]
] |
Kitware/VAIME | [
"47b24b9d8a208cf8c621e5bb1088c61fcf507af6"
] | [
"tools/compute_disparity.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"ckwg +29\n * Copyright 2019 by Kitware, Inc.\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 are met:\n *\n * * Redistributions of source code must retain the a... | [
[
"numpy.max",
"numpy.percentile",
"numpy.logical_not",
"numpy.min"
]
] |
scolemann/mlfinlab | [
"2f15d12d273ad1705427c9a7297165bc719d9539"
] | [
"mlfinlab/cross_validation/combinatorial.py"
] | [
"\"\"\"\nImplements the Combinatorial Purged Cross-Validation class from Chapter 12\n\"\"\"\n\nfrom itertools import combinations\nfrom typing import List\n\nimport pandas as pd\nimport numpy as np\n\nfrom sklearn.model_selection import KFold\nfrom .cross_validation import ml_get_train_times\n\n\nclass Combinatoria... | [
[
"numpy.array",
"numpy.arange",
"pandas.Series"
]
] |
gesource/convert_emnist_data_to_imagefile | [
"c4ea979a8cb8c83b588d2c2a1ab42eb201619162"
] | [
"parse_emnist.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nfrom PIL import Image\nimport numpy as np\nimport struct\nfrom typing import Generator\nimport os\n\ndef read_4bytes(f) -> int:\n '''\n ファイルから4バイト読み込む\n '''\n return int.from_bytes(f.read(4), 'big')\n\ndef read_1bytes(f) -> int:\n ''... | [
[
"numpy.rot90",
"numpy.flip",
"numpy.frombuffer"
]
] |
liorshig/pivpy | [
"094fe77153fc00ea1f446bda5a83baa2e5171a35"
] | [
"tests/test_methods.py"
] | [
"# test_methods.py\nimport xarray as xr\nfrom pivpy import io, pivpy\nimport numpy as np\nimport pkg_resources as pkg \n\nimport os\nf1 = 'Run000001.T000.D000.P000.H001.L.vec'\nf2 = 'Run000002.T000.D000.P000.H001.L.vec'\npath = pkg.resource_filename('pivpy','data/Insight')\n\n_a = io.load_vec(os.path.join(path,f1))... | [
[
"numpy.allclose"
]
] |
horizon-blue/pplbench-1 | [
"07e176459b6e3c0b90b9bfe5e8b28550e6784937"
] | [
"pplbench/ppls/stan/inference.py"
] | [
"# Copyright(C) Facebook, Inc. and its affiliates. All Rights Reserved.\nfrom collections import OrderedDict\nfrom typing import Dict, Optional, Type, cast\n\nimport numpy as np\nimport xarray as xr\nfrom pystan import StanModel\n\nfrom ..base_ppl_impl import BasePPLImplementation\nfrom ..base_ppl_inference import ... | [
[
"numpy.expand_dims"
]
] |
jegork/transformers | [
"7c5d79912a21880ce13d77881940458e90d98917"
] | [
"examples/pytorch/translation/run_translation_no_trainer.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
[
"numpy.where",
"torch.no_grad",
"torch.utils.data.DataLoader"
]
] |
kaylode/shrec22-pothole | [
"700d1632de686214e42a2f56aeaceab30c8b9a3f"
] | [
"theseus/base/augmentations/custom.py"
] | [
"import numpy as np\n\nclass Denormalize(object):\n \"\"\"\n Denormalize image and boxes for visualization\n \"\"\"\n def __init__(self, mean = [0.485, 0.456, 0.406], std = [0.229, 0.224, 0.225], **kwargs):\n self.mean = mean\n self.std = std\n \n def __call__(self, img, box = No... | [
[
"numpy.array",
"numpy.clip"
]
] |
punk95/Hierarchical-constrained-RL | [
"848dc52a95208c4ce2908e3451c0067e38cea191"
] | [
"agents/past/lyp_sarsa_agent.py"
] | [
"import math\nimport numpy as np\nimport os\nimport time\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport random\nimport gym\nimport copy\n\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom common.past.utils import *\n\nfrom common.past.multiproce... | [
[
"torch.cat",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.no_grad",
"torch.FloatTensor",
"torch.le",
"numpy.mean",
"torch.manual_seed",
"torch.nn.functional.mse_loss",
"torch.cuda.is_available",
"numpy.random.randint",
"torch.LongTensor",
"torch.zeros_l... |
victorfica/utils | [
"b61935a860838a0e70afde7c9ecf2c68f51a2c4b"
] | [
"featherembed.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nUsage:\n\npython featherembed.py --listcolumns /fh/fast/gilbert_p/grp/compass_hvtn602_aw/tmpdata/flow-data-2of9-responses.feather\npython featherembed.py --columns CCR6,CCR7,CD154,CD45RA,CXCR3,GzA,HLA-DR,IFNg,IL13/4,IL17a,IL2,IL22,KLRG1,Perforin,TNFa /fh/fast/gilbert_p/grp/compass_... | [
[
"pandas.DataFrame"
]
] |
Ayush8120/MR-DFS | [
"f6e19f0593760061c561e627c6868ed9f352323e"
] | [
"Python Implementation/Python Implementation_General/mergematrices.py"
] | [
"import numpy as np\nimport pandas as pd\n#I1 , I2 are incidence matrices of R,V or Edge,V \n#out of this function they are initialised as pandas DataFrame\n# we'll need to convert them to nparray after calling this function\n'''\nMerge Matrices Algorithm : Helps merge 2 matrices by removing redundant entries. \n ... | [
[
"numpy.delete",
"numpy.count_nonzero",
"numpy.zeros",
"pandas.DataFrame",
"numpy.shape",
"numpy.sign"
]
] |
yu54ku/xml-cnn | [
"5910ae517b7780dca6b824bdbfe94df50eec0d96"
] | [
"xml_cnn.py"
] | [
"import torch\nfrom torch import nn as nn\nfrom torch.nn import functional as F\n\nfrom my_functions import out_size\n\n\nclass xml_cnn(nn.Module):\n def __init__(self, params, embedding_weights):\n super(xml_cnn, self).__init__()\n\n self.params = params\n\n stride = params[\"stride\"]\n ... | [
[
"torch.nn.Linear",
"torch.nn.Embedding.from_pretrained",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.init.kaiming_normal_",
"torch.nn.functional.relu",
"torch.nn.Conv2d",
"torch.nn.MaxPool1d"
]
] |
talonvoice/onnx | [
"9373cfc412b4d4ed54ea0e6d32aaf3722ee30493"
] | [
"onnx/backend/test/case/node/nonzero.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np # type: ignore\n\nimport onnx\nfrom ..base import Base\nfrom . import expect\n\n\nclass NonZero(Bas... | [
[
"numpy.array",
"numpy.nonzero"
]
] |
rahularepaka/ObjectDetectionWeb | [
"813fc699d8b3504d600f96a87b1d0b3d4232260a"
] | [
"main-local.py"
] | [
"import cv2\nimport streamlit as st\nimport numpy as np\nimport pandas as pd\nimport time\n\nfrom streamlit_webrtc import VideoTransformerBase, webrtc_streamer\n\n\nst.set_page_config(page_title=\"Object Detection\", page_icon=\"🤖\")\n\n\nst.title(\"Lite Object Detection WebApp\")\nst.subheader(\n \"Using COCO ... | [
[
"pandas.read_excel",
"numpy.argmax"
]
] |
btbonval/DieStatistician | [
"2e7591856d549cf66daea86b02d2371670e73ccb"
] | [
"tests/testbase.py"
] | [
"'''\nBryan Bonvallet\n2013\n\nThis file contains test functions for series.py and PMF.py.\n'''\n\nimport numpy\nimport unittest\n\nfrom PMF import PMF\nfrom series import FiniteSequence, InfiniteSequence\n\nclass FinitePMF(FiniteSequence, PMF): pass\n\nclass InfinitePMF(InfiniteSequence, PMF): pass\n\nclass TestSe... | [
[
"numpy.random.randint",
"numpy.ones",
"numpy.arange",
"numpy.zeros"
]
] |
DeivideSilva/Python | [
"9d6f14737b9cb515ac0bf8b52a8650559803e2cf"
] | [
"Analise_Bonus_Viagem/main.py"
] | [
"import pandas as pd\nimport os\nfrom twilio.rest import Client\n\n# Download the helper library from https://www.twilio.com/docs/python/install\n# Your Account Sid and Auth Token from twilio.com/console\n# and set the environment variables. See http://twil.io/secure\n\naccount_sid = \"AC62414231660af0f68b86ff8324c... | [
[
"pandas.read_excel"
]
] |
Sumit1673/Projects | [
"82e3d352617655bb27be460acfc443fe9c741e24"
] | [
"ImageProcessing/CannyEdgeDetection/hysteresis_thrshold.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nSTRONG = 255\nWEAK = 50\n\n\nclass HysterisisThreshold:\n def __init__(self, nms_img, low_thr=0.2, high_thr=0.9):\n self.h_thr = np.max(nms_img)*high_thr\n self.l_thr = self.h_thr*low_thr\n self.inp_img = np.array(nms_img)\n self.b... | [
[
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.where",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.imshow"
]
] |
frank-qcd-qk/tensorflow | [
"40fc414003a2f26dcc8cde0e18acc6f8ae9e6ede"
] | [
"tensorflow/lite/testing/model_coverage/model_coverage_quantization_test.py"
] | [
"# Copyright 2021 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.lite.python.lite.TFLiteConverter.from_frozen_graph",
"tensorflow.lite.python.lite.TFLiteConverterV2.from_saved_model",
"tensorflow.lite.python.lite.TFLiteConverterV2.from_keras_model",
"numpy.random.rand",
"numpy.random.seed",
"tensorflow.lite.testing.model_coverage.model_cover... |
htw-pv3/pvlib-python-pv3 | [
"8b8b40571c719213b1b303a3563009ed4cbc8aa8"
] | [
"pv3_pvlib_sonnja.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as mpl\nimport numpy as np\nimport os\nfrom collections import OrderedDict\n\nimport pvlib\n\nfrom pvlib.modelchain import ModelChain\nfrom pvlib import irradiance\n\nimport read_htw_data\nimport get_weather_data\nimport analysis_tools\nimport tools\n\n\ndef reindl(ghi... | [
[
"pandas.Timedelta",
"numpy.fmax",
"pandas.date_range",
"pandas.DataFrame",
"matplotlib.pyplot.legend",
"numpy.where",
"numpy.radians",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf",
"numpy.maximum"
]
] |
AndreIglesias/42_bootcamp_ml | [
"b0690bd954b14d19d8efd28cd85530a747718388"
] | [
"old_bootcamp/day00/ex00/sum.py"
] | [
"# **************************************************************************** #\n# #\n# ::: :::::::: #\n# sum.py :+: :+: ... | [
[
"numpy.array"
]
] |
nlbutts/ImageProcessing | [
"e946bbcd757991564b542ccd89555516dbc4575f"
] | [
"pipeline/bayer2rgb.py"
] | [
"import numpy as np\nimport cv2\n\nx=np.fromfile('/media/ztemp/snap_1_32_600.raw', dtype='uint16')\ny=np.reshape(x, (1944,2592))\nz=cv2.cvtColor(y, cv2.COLOR_BayerRG2BGR)\n\n#White balance\nmt=np.mean(z)\nmb=np.mean(z[:,:,0])\nmg=np.mean(z[:,:,1])\nmr=np.mean(z[:,:,2])\nz[:,:,0] = z[:,:,0] * mt/mb\nz[:,:,1] = z[:,:... | [
[
"numpy.linspace",
"numpy.mean",
"numpy.reshape",
"numpy.fromfile"
]
] |
lsiemens/lsiemens.github.io | [
"d93bf32c8e849b6514aea0f8eb582c42543a53d6"
] | [
"theory/fractional_calculus/code/irrational_pi_e.py"
] | [
"from matplotlib import pyplot\nimport numpy\n\nx_max = 20\nx = numpy.linspace(-x_max, x_max, 1024)\n\ndef f(z, theta=0.0):\n return numpy.exp(numpy.e*z) + numpy.exp(numpy.pi*z) + numpy.exp(theta*1.0j)\n\ndef f_prime(z, theta=0.0):\n return numpy.e*numpy.exp(numpy.e*z) + numpy.pi*numpy.exp(numpy.pi*z)\n\ndef ... | [
[
"numpy.array",
"numpy.angle",
"numpy.ones",
"numpy.real",
"numpy.exp",
"numpy.abs",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.meshgrid",
"numpy.imag"
]
] |
hcfman/sbts-install | [
"0bd2fbfc27d5898776117c4087daf4c8dcd7202e"
] | [
"resources/secure/sbts-draw.py"
] | [
"#!/usr/bin/python3\n\nimport sys\nimport requests\nimport json\n\nimport argparse\n\nimport cv2\nimport numpy as np\n\nfrom multi_secureparse.model import CameraReader\n\nfrom shapely.geometry import Point\nfrom shapely.geometry.polygon import Polygon\n\ndrawn = False\narea = []\n\ndef dumpJson(area):\n jsonAre... | [
[
"numpy.array",
"numpy.fromstring"
]
] |
pan3rock/yam | [
"e8fae519c10b1c213018b826cb0629ce06d7134a"
] | [
"yam/tests/test_stretch.py"
] | [
"# Copyright 2018-2019 Tom Eulenfeld, MIT license\n\nimport os.path\nimport tempfile\nimport unittest\n\nimport numpy as np\nfrom obspy import Stream, Trace, UTCDateTime as UTC\n\nfrom yam.stretch import stretch\nfrom yam.commands import write_dict, read_dicts\n\n\nclass TestCase(unittest.TestCase):\n\n def test... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.testing.assert_equal",
"numpy.cos",
"numpy.linspace"
]
] |
ma-ji/proxy_pool | [
"31841883a0496daa682d9c9c605060b90e478413"
] | [
"fetcher/proxyFetcher.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n-------------------------------------------------\n File Name: proxyFetcher\n Description :\n Author : JHao\n date: 2016/11/25\n-------------------------------------------------\n Change Activity:\n 2016/11/25: proxyFetcher\n---------... | [
[
"pandas.read_html"
]
] |
AshishBhatti/real-time-embedded-object-detection | [
"c8a119bf8651534932b80da3f89ab91c3f478532"
] | [
"ScaledYOLOv4/utils/datasets.py"
] | [
"import glob\nimport math\nimport os\nimport random\nimport shutil\nimport time\nfrom pathlib import Path\nfrom threading import Thread\n\nimport cv2\nimport numpy as np\nimport torch\nfrom PIL import Image, ExifTags\nfrom torch.utils.data import Dataset\nfrom tqdm import tqdm\n\nfrom utils.general import xyxy2xywh... | [
[
"torch.cat",
"torch.stack",
"numpy.minimum",
"torch.load",
"numpy.concatenate",
"numpy.full",
"numpy.eye",
"numpy.flipud",
"numpy.arange",
"torch.utils.data.DataLoader",
"numpy.append",
"numpy.mod",
"torch.zeros",
"numpy.array",
"numpy.zeros",
"torch... |
bijitdeb/numpy | [
"145ed90f638c1a12ce5b06e9100421f99783f431"
] | [
"numpy/distutils/ccompiler_opt.py"
] | [
"\"\"\"Provides the `CCompilerOpt` class, used for handling the CPU/hardware\noptimization, starting from parsing the command arguments, to managing the\nrelation between the CPU baseline and dispatch-able features,\nalso generating the required C headers and ending with compiling\nthe sources with proper compiler'... | [
[
"numpy.distutils.log.warn",
"numpy.distutils.log.info"
]
] |
leifdenby/uclales-extractor | [
"6147533e25b3b417c744bd814d2407a6588cf995"
] | [
"tests/test_synthetic_objects_3d.py"
] | [
"# coding: utf-8\n\"\"\"\nRoutines for creating masks of parameterised synthetic 3D shapes\n\"\"\"\n\nimport numpy as np\nimport xarray as xr\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport tempfile\n\nfrom genesis.utils.xarray import apply_all\nfrom genesis.objects.synthetic import discrete, ellips... | [
[
"matplotlib.pyplot.gca",
"numpy.arange",
"matplotlib.pyplot.tight_layout"
]
] |
vishalbelsare/iterreg | [
"95f4b0f0c5c9d1fc3f79e10db15b05665ef0678c"
] | [
"iterreg/sparse/solvers.py"
] | [
"import numpy as np\n\nfrom numba import njit\nfrom numpy.linalg import norm\nfrom scipy import sparse\nfrom scipy.sparse.linalg import svds\n\nfrom iterreg.utils import shrink, ell1, deriv_ell1\n\n\ndef primal_dual(X, y, max_iter=1000, f_store=10, prox=shrink, alpha_prec=None,\n step_ratio=1, verbos... | [
[
"scipy.sparse.issparse",
"scipy.sparse.linalg.svds",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.ones",
"numpy.asfortranarray",
"numpy.sqrt",
"numpy.abs"
]
] |
cajfisher/pymatgen | [
"286c304e38102d567723a71f733e0c304b72035d"
] | [
"pymatgen/io/tests/test_lobster.py"
] | [
"# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\nimport json\nimport os\nimport tempfile\nimport unittest\nimport warnings\n\nimport numpy as np\nfrom pymatgen import Structure\nfrom pymatgen.electronic_structure.core import Spin, Orbital\nfrom pymat... | [
[
"numpy.sum",
"numpy.isclose"
]
] |
alexiscoutinho/gammapy | [
"f72717eeb056f8a7f841ae6cf47149442f9c2135"
] | [
"gammapy/estimators/flux_point.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport logging\nimport numpy as np\nfrom scipy import stats\nfrom astropy import units as u\nfrom astropy.io.registry import IORegistryError\nfrom astropy.table import Table, vstack\nfrom astropy.visualization import quantity_support\nfrom gammapy.da... | [
[
"matplotlib.pyplot.gca",
"scipy.stats.norm.isf",
"scipy.stats.norm.sf"
]
] |
faresbs/slrt | [
"779f8e307950305b74b6e812393b2c702ac38fc6"
] | [
"source/dataset_stats.py"
] | [
"#OPTIONAL\n\n#Get std and mean of the dataset\n\n\"\"\"\nWe can use ImageNet statistics (std and mean) to normalize the dataset images.\nHowever since we are dealing with a different domain image, then it is better to calculate the statistics of our target dataset.\nYou can use these stats to normalize data or use... | [
[
"torch.save",
"torch.tensor",
"torch.utils.data.DataLoader"
]
] |
ArkaprabhaChakraborty/tardis | [
"f52b6de55701c6880ad835ad714e911dcbe9ee96"
] | [
"tardis/montecarlo/montecarlo_numba/base.py"
] | [
"from numba import prange, njit, jit\nimport logging\nimport numpy as np\n\nfrom tardis.montecarlo.montecarlo_numba.r_packet import (\n RPacket,\n PacketStatus,\n)\nfrom tardis.montecarlo.montecarlo_numba.utils import MonteCarloException\n\nfrom tardis.montecarlo.montecarlo_numba.numba_interface import (\n ... | [
[
"numpy.zeros_like",
"numpy.ones_like",
"numpy.array",
"numpy.random.seed",
"numpy.empty_like",
"numpy.floor"
]
] |
ailingzengzzz/Split-and-Recombine-Net | [
"1b6285c9f5b46140832e7e4d24e8e5a7dbb24234"
] | [
"common/common_pytorch/experiment/eval_metrics.py"
] | [
"import torch\nimport numpy as np\n\nfrom common.common_pytorch.loss.loss_family import p_mpjpe\nfrom common.visualization.plot_pose3d import plot17j\n\ndef gather_3d_metrics(expected, actual):\n \"\"\"\n\n :param expected: Predicted pose\n :param actual: Ground Truth\n :return: evaluation results\n ... | [
[
"torch.zeros",
"torch.cat",
"numpy.dot",
"numpy.linalg.norm",
"torch.norm",
"torch.linspace",
"torch.abs",
"torch.tensor",
"torch.Tensor",
"torch.mean"
]
] |
yakovkeselman/trax | [
"615432bbc58ffb5bdf83a771e8f8b470995456db",
"a0a3dd8d49e53fc48bb24cc08c10a8a53517e7bc"
] | [
"trax/models/reformer/reformer_test.py",
"trax/rl/online_tune.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.ones"
],
[
"numpy.array",
"numpy.stack",
"numpy.isnan",
"numpy.clip"
]
] |
blaisewang/seq2seq-topic-labelling | [
"d78e1362d9c85396dc65385de3dc7d0958abf044"
] | [
"models/embed_bi_gru_attn.py"
] | [
"\"\"\"\nBidirectional GRU with attention and word embedding\n\"\"\"\n\nimport tensorflow as tf\n\nfrom layers.gru import rnn_layer\nfrom .attention import BahdanauAttention\n\n\nclass Encoder(tf.keras.Model):\n pre_trained_word2vec = False\n\n def __init__(self, vocab_size, embedding_size, enc_units):\n ... | [
[
"tensorflow.expand_dims",
"tensorflow.reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Concatenate",
"tensorflow.cast"
]
] |
rkini-pnnl/volttron-GS | [
"60055438446a060176381468757ad0ec339f2371"
] | [
"pnnl/transactive_base/transactive/transactive.py"
] | [
"import logging\nimport sys\nfrom datetime import timedelta as td\nimport numpy as np\n\nfrom dateutil.parser import parse\nimport dateutil.tz\nimport gevent\n\nfrom volttron.platform.agent.math_utils import mean, stdev\nfrom volttron.platform.agent.base_market_agent import MarketAgent\nfrom volttron.platform.agent... | [
[
"numpy.std",
"numpy.linspace",
"numpy.interp",
"numpy.mean"
]
] |
danieldeutsch/summarize | [
"b38e3e8c7755903477fd92a4cff27125cbf5553d"
] | [
"summarize/training/metrics/cross_entropy_metric.py"
] | [
"import numpy as np\nfrom allennlp.training.metrics import Metric\nfrom overrides import overrides\nfrom typing import Dict\n\n\n@Metric.register('cross-entropy')\nclass CrossEntropyMetric(Metric):\n def __init__(self) -> None:\n self.total_loss = 0\n self.total_num_tokens = 0\n\n @overrides\n ... | [
[
"numpy.exp"
]
] |
ivalab/mmf | [
"acabd362e4390c850450a39ec9ca74a4431dfa97"
] | [
"mmf/models/resnet_lstm_mul.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nfrom copy import deepcopy\n\nimport torch\nfrom mmf.common.registry import registry\nfrom mmf.models.base_model import BaseModel\nfrom mmf.modules.layers import Flatten\nfrom torch import nn\n\nfrom mmf.utils.build import (\n build_classifier_layer,\n bui... | [
[
"torch.cat",
"torch.mul",
"torch.nn.LSTM",
"torch.flatten",
"torch.nn.Embedding"
]
] |
vitas-ai/speechbrain | [
"8e43dd2c3471586aa508d772b0f24632fa02d8da"
] | [
"recipes/TIMIT/ASR/seq2seq/train_with_dynamic_batching.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Recipe for training a phoneme recognizer on TIMIT.\nThe system relies on an encoder, a decoder, and attention mechanisms between them.\nTraining is done with NLL. CTC loss is also added on the top of the encoder.\nGreedy search is using for validation, while beamsearch is used at test... | [
[
"torch.cat",
"torch.LongTensor"
]
] |
Foristkirito/ranking | [
"4971decddc81ccc720df73d420d90d611e857097"
] | [
"tensorflow_ranking/python/losses_test.py"
] | [
"# Copyright 2020 The TensorFlow Ranking 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 appli... | [
[
"tensorflow.compat.v1.enable_v2_behavior",
"tensorflow.Graph",
"tensorflow.compat.v1.local_variables_initializer",
"tensorflow.math.log1p",
"tensorflow.compat.v1.reset_default_graph",
"tensorflow.squeeze",
"tensorflow.test.main",
"tensorflow.compat.v1.set_random_seed",
"tensorf... |
BrettJSettle/MotilityTracking | [
"e9f10365737f3020c60cfa71b344db8a5404ce50"
] | [
"histogram.py"
] | [
"import pyqtgraph as pg\nimport numpy as np\nfrom PyQt4 import QtCore, QtGui\nfrom process.BaseProcess import BaseDialog, SliderLabel\nimport global_vars as g\n\nclass Histogram(pg.PlotWidget):\n\tdef __init__(self, *args, **kwargs):\n\t\tsuper(Histogram, self).__init__(*args, **kwargs)\n\t\tself.plotitem = pg.Plot... | [
[
"numpy.max",
"numpy.histogram",
"numpy.savetxt",
"numpy.zeros",
"numpy.min",
"numpy.linspace"
]
] |
randlet/Orbis-Old | [
"1dcd6c907dfd572cc7ab6218891807a47d73fd16"
] | [
"sketchpad.py"
] | [
"import time\nfrom orbis import check_num_atoms_exceeded \nfrom guiparts import PlotPanel\nfrom molecule import Molecule,Atom,Bond\nimport matplotlib\nimport math \nimport numpy\nimport settings \nimport time \nimport wx\nimport sys\nfrom validators import NumberValidator\nfrom editatombond import... | [
[
"numpy.array",
"numpy.arange",
"matplotlib.transforms.blended_transform_factory"
]
] |
TheLocust3/FRC-Field-Vision-System | [
"356243de64279d76ed18a43393d124493f82d7a1"
] | [
"detectors/fuel_detector.py"
] | [
"import cv2\nimport numpy as np\n\nfrom detectors.detector import *\nfrom detectors.game_objects.fuel import *\nimport image_operations\n\nclass FuelDetector(Detector):\n\n def run(self, image):\n otsu_thresh = image_operations.ostu_threshold(image)\n new_image = cv2.bitwise_and(image, image, mask ... | [
[
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.