repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
jftsang/pypew
[ "238b227493d41d10b7d4da9849f46d40c87039dc" ]
[ "views/__init__.py" ]
[ "import os\nfrom tempfile import TemporaryDirectory\nfrom traceback import format_exc\n\nimport pandas as pd\nfrom flask import (flash, make_response, render_template, send_file)\n\nfrom forms import UpdateTextsForm\nfrom models import FEASTS_CSV\nfrom utils import logger\nfrom .feast_views import *\nfrom .pew_shee...
[ [ "pandas.read_csv" ] ]
IndicoDataSolutions/Indico-Solutions-Toolkit
[ "c9a38681c84e86a48bcde0867359ddd2f52ce236" ]
[ "tests/snapshots/test_snapshot.py" ]
[ "import pytest\nimport os\nimport tempfile\nfrom copy import deepcopy\nimport pandas as pd\nfrom pandas.util.testing import assert_frame_equal\nfrom indico_toolkit import ToolkitInputError\nfrom indico_toolkit.snapshots import Snapshot\n\n# TODO: tests for exception handling\n\n\ndef test_instantiation_wo_params(sn...
[ [ "pandas.concat", "pandas.read_csv" ] ]
ChangLee0903/SERIL-Noise-Adaptive-Speech-Enhancement-using-Regularization-based-Incremental-Learning
[ "73c5dbd8a272a534cc0af455a9f61567dc67fb66" ]
[ "dataset.py" ]
[ "import torch\nimport os\nimport numpy as np\nimport random\nfrom librosa import load\n\n\ndef read(data, normalize=False, sr=16000):\n data, sr = load(data, sr=sr)\n if normalize:\n data /= np.abs(data).max()\n return data, sr\n\nclass SpeechDataset(torch.utils.data.Dataset):\n def __init__(self...
[ [ "numpy.abs", "torch.from_numpy" ] ]
sdsc-bw/pre_processing
[ "df4eea6d9191ecfe0697e00cf5c5990c9a348e58" ]
[ "datafactory/util/metrics.py" ]
[ "from sklearn.metrics import f1_score\n\nfrom .constants import logger\n\ndef relative_absolute_error(pred, y):\n dis = abs((pred-y)).sum()\n dis2 = abs((y.mean() - y)).sum()\n if dis2 == 0 :\n return 1\n return dis/dis2\n \ndef get_score(y_pred, y_test, mtype='C'):\n if mtype == 'C':\n ...
[ [ "sklearn.metrics.f1_score" ] ]
andrewasheridan/kaleidoscope
[ "a84ffbec9dda98f438b0e94f1350d6c810031c94" ]
[ "kaleidoscope/transformations.py" ]
[ "# _ __ _ _\n# | | / _| | | (_)\n# | |_ _ __ __ _ _ __ ___| |_ ___ _ __ _ __ ___ __ _| |_ _ ___ _ __ ___\n# | __| '__/ _` | '_ \\/ __| _/ _ \\| '__| '_ ` _ \\ / _` | __| |/ _ \\| '_ \\/ __|\n# | |_| | | (_|...
[ [ "numpy.clip", "numpy.fliplr", "numpy.random.normal", "numpy.deg2rad", "numpy.random.randn", "numpy.random.rand" ] ]
aakanksha023/EVAN
[ "981327e4e8c408144b409f1e39f207ad96376c2d" ]
[ "src/04_visualization/licence_vis_synthesis.py" ]
[ "# author: Jasmine Qin\n# date: 2020-06-09\n\n\"\"\"\nThis script performs data wrangling and synthesizing needed for\nvisualization of the business licence file.\n\nUsage: src/04_visualization/licence_vis_synthesis.py\n\"\"\"\n\n# load packages\nimport pandas as pd\nimport json\nimport re\nfrom joblib import load\...
[ [ "pandas.concat", "pandas.read_csv", "pandas.to_datetime" ] ]
lotts/Syntney
[ "926f87937b6bcde679f27a89973cbd6c974c7c9f" ]
[ "Syntney.py" ]
[ "import os\r\nfrom Bio import SeqIO\r\nimport numpy as np\r\n#from colour import Color\r\nimport argparse\r\nimport subprocess\r\nfrom subprocess import run, PIPE\r\nfrom ete3 import *\r\nimport shutil\r\nimport sys\r\nimport tempfile\r\nimport re\r\n\r\n\r\ndef check_NCBI_format(fasta_header):\r\n tmp_header = ...
[ [ "numpy.copy", "numpy.array", "numpy.absolute" ] ]
rmclanton/ds4se
[ "d9e1cf771a66478ac99c5341dbfeddbbf0abe5b2" ]
[ "ds4se/ds/prediction/eval/traceability.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/9.0_ds.prediction.eval.traceability.ipynb (unless otherwise specified).\n\n__all__ = ['SupervisedVectorEvaluation', 'ManifoldEntropy']\n\n# Cell\nfrom prg import prg\n\n# Cell\nimport ds4se as ds\nfrom ....mining.ir import VectorizationType\nfrom ....mining.ir import...
[ [ "sklearn.metrics.roc_auc_score", "numpy.isnan", "sklearn.metrics.confusion_matrix", "sklearn.metrics.precision_recall_curve", "sklearn.metrics.roc_curve", "numpy.logical_or", "numpy.argmax", "sklearn.metrics.average_precision_score", "sklearn.metrics.auc", "numpy.logical_an...
manibhushan05/transiq
[ "763fafb271ce07d13ac8ce575f2fee653cf39343" ]
[ "web/transiq/supplier/services.py" ]
[ "from datetime import datetime\n\nimport pandas as pd\nfrom django.contrib.auth.models import User\nfrom django.db.models import Count\n\nfrom api.utils import get_or_none\nfrom authentication.models import Profile\nfrom broker.models import Broker\nfrom driver.models import Driver as d_Driver\nfrom fileupload.mode...
[ [ "pandas.read_excel", "pandas.DataFrame" ] ]
cattidea/PaTTA
[ "0a50eb9b6459c91e3a488f8772e124c164cb0d75" ]
[ "tests/test_transforms.py" ]
[ "import cv2\nimport numpy as np\nimport paddle\nimport patta as tta\nimport pytest\n\n\n@pytest.mark.parametrize(\n \"transform\",\n [\n tta.HorizontalFlip(),\n tta.VerticalFlip(),\n tta.HorizontalShift(shifts=[0.1, 0.2, 0.4]),\n tta.VerticalShift(shifts=[0.1, 0.2, 0.4]),\n ...
[ [ "numpy.abs", "numpy.allclose", "numpy.clip", "numpy.linspace", "numpy.random.randint" ] ]
chenjian158978/chenjian.github.io
[ "1742e518d43470aa88690f2f40094859e7d7f261" ]
[ "download/Cost-Function-Of-ML/costFunctionExam1.py" ]
[ "# -*- coding:utf8 -*-\n\n\"\"\"\n@author: chenjian158978@gmail.com\n\n@date: Tue, May 23 2017\n\n@time: 19:05:20 GMT+8\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef calcu_cost(theta, X, Y):\n \"\"\" 计算代价函数的值\n\n :param theta: 斜率\n :param X: x值\n :param Y: y值\n :return: J值\n...
[ [ "numpy.dot", "matplotlib.pyplot.title", "numpy.linspace", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
SWMaestro8th/tensorflow
[ "084d29e67a72e369958c18ae6abfe2752fcddcbf" ]
[ "tensorflow/python/eager/tensor.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.zeros" ] ]
jrplatin/NBA-RankSVM
[ "74bec6cf79bc4554e8a456450d45d892e034a425" ]
[ "ranksvm.py" ]
[ "from sklearn import svm\nfrom itertools import permutations\nimport numpy as np\nfrom operator import itemgetter\nfrom itertools import combinations \nimport numpy as np\n\n# Get all permutation pairs out of an array\ndef get_pairs(arr):\n return permutations(arr, 2)\n\n# Transform data to pairs, where label...
[ [ "numpy.arange", "numpy.mean" ] ]
Chianugoogidi/deit
[ "a286bfc817e9e285291ab8b2e9dff277d6447bda" ]
[ "models.py" ]
[ "# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\nimport torch\nimport torch.nn as nn\nfrom functools import partial\n\nfrom timm.models.vision_transformer import VisionTransformer, _cfg\nfrom timm.models.registry import register_model\nfrom timm.models.layers import trunc_normal_\n\n\n__all__ ...
[ [ "torch.zeros", "torch.cat", "torch.nn.Linear", "torch.nn.Identity", "torch.hub.load_state_dict_from_url" ] ]
china-zyy/NLP-Tutorials
[ "670160b5a9344b240c90dbaf0e62de3120c6d9e5" ]
[ "BERT.py" ]
[ "# [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/pdf/1810.04805.pdf)\nimport numpy as np\nimport tensorflow as tf\nimport utils\nimport time\nfrom GPT import GPT\nimport os\nimport pickle\n\n\nclass BERT(GPT):\n def __init__(self, model_dim, max_len, n_layer...
[ [ "numpy.random.random", "tensorflow.reduce_mean", "numpy.arange", "numpy.full_like", "tensorflow.math.equal", "tensorflow.GradientTape" ] ]
mzur/unknot
[ "07cc75d1fc94b1767e12bd9d55c1eac13be1fbfe" ]
[ "src/ObjectDetection.py" ]
[ "import numpy as np\nimport os.path\nimport imgaug.augmenters as iaa\nimport json\nfrom pyvips import Image as VipsImage\n\nfrom . import PatchesCollection\nfrom . import Dataset as ImageDataset\nfrom . import utils\n\nfrom .mrcnn import config as mrcnn_config\nfrom .mrcnn import utils as mrcnn_utils\nfrom .mrcnn i...
[ [ "numpy.load", "numpy.array", "numpy.zeros", "numpy.stack" ] ]
ducongju/HigherHRNet-Human-Pose-Estimation
[ "6986494e992fd58bced00543645fe8c49ec94c35" ]
[ "lib/dataset/COCOKeypoints.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (leoxiaobin@gmail.com)\n# Modified by Bowen Cheng (bcheng9@illinois.edu)\n# -------------------------------------------------------------------------...
[ [ "numpy.nonzero", "numpy.array", "numpy.exp", "numpy.zeros", "numpy.sum" ] ]
Ninarehm/attack
[ "773024c7b86be112521a2243f2f809a54891c81f" ]
[ "Fairness_attack/defenses.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport copy\nimport sys\n\nimport numpy as np\nfrom sklearn import metrics, model_selection, neighbors\n\nimport scipy.linalg as slin\nimport scipy.sparse as sp...
[ [ "sklearn.model_selection.KFold", "numpy.concatenate", "numpy.max", "numpy.all", "numpy.mean", "numpy.where", "numpy.square", "scipy.sparse.issparse", "numpy.reshape", "sklearn.neighbors.NearestNeighbors", "numpy.zeros", "numpy.power", "numpy.min", "scipy.spa...
Deion14/mlp3
[ "cab1a18b36114f49622e3a5fc8650efda5205e01" ]
[ "gym_trading/envs/Testing_Env.py" ]
[ "\nimport gym\nfrom gym import error, spaces, utils\nfrom gym.utils import seeding\nfrom collections import Counter\n\nimport quandl\nimport numpy as np\nfrom numpy import random\nimport pandas as pd\nimport logging\nimport pdb\nfrom sklearn import preprocessing\nimport tempfile\n\nlog = logging.getLogger(__name__)...
[ [ "pandas.concat", "pandas.Series", "numpy.isnan", "numpy.empty_like", "numpy.arange", "pandas.DataFrame", "numpy.ones", "numpy.append", "numpy.std", "numpy.zeros" ] ]
eegml/cvat
[ "e7808cfb0322c1adcf61e7955b8b4a8c2badd0d2" ]
[ "cvat/apps/engine/tests/test_rest_api.py" ]
[ "# Copyright (C) 2018 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport os\nimport shutil\nfrom PIL import Image\nfrom io import BytesIO\nfrom enum import Enum\nimport random\nfrom rest_framework.test import APITestCase, APIClient\nfrom rest_framework import status\nfrom django.conf import settings\nfr...
[ [ "numpy.array_equal", "numpy.clip", "numpy.sin", "numpy.round", "numpy.array", "numpy.empty" ] ]
Mooonside/SEGS
[ "93bb66d9979d9beefab9cfd1a146d6e7369f5d86" ]
[ "segs/deeplabv3_detection_common.py" ]
[ "\"\"\"\nIN YOLOV3, uses 3 layers, respectively downsample 32, downsample 16 and downsample 8\nIN DEEOLABV3+, the nwetwork output layers if stride 16, so need to add more layer to generate downsample 32!\n\"\"\"\nimport numpy as np\n\ndetection_feature_layers = [\n # downsample 8\n 'xception_65/entry_flow/blo...
[ [ "numpy.asarray" ] ]
BrightID/BrightID-Anti-Sybil
[ "8f31a73bae05a61b66ef0fd8a68bfb255127a943" ]
[ "anti_sybil/utils.py" ]
[ "from arango import ArangoClient\nfrom bisect import bisect\nimport networkx as nx\nimport numpy as np\nimport zipfile\nimport tarfile\nimport requests\nimport json\nimport csv\nimport os\n\nGRAPH_TEMPLATE = GRAPH_3D_TEMPLATE = COMPARE_GRAPH_TEMPLATE = None\nBACKUP_URL = 'https://storage.googleapis.com/brightid-bac...
[ [ "numpy.std", "numpy.mean" ] ]
pengfei2017/lstm_and_ctc_ocr
[ "23c746ce806d44795b7f1557afad03f6dc88084e" ]
[ "gen.py" ]
[ "#!/usr/bin/env python\n#\n# Copyright (c) 2016 Matthew Earl\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 the rights\n# to us...
[ [ "numpy.matrix", "numpy.hstack", "numpy.random.random", "numpy.clip", "numpy.min", "numpy.ones", "numpy.max", "numpy.random.normal", "numpy.any", "numpy.array", "numpy.zeros" ] ]
lalitmcb/python
[ "057b5750f7e2e46b5057d15badec756373d8ed79" ]
[ "src/pandas/read_files.py" ]
[ "import pandas as pd\n\n#install xlrd module to support excel.\n#In python 3 use: pip3 install xlrd\n#read the excel file by giving name and sheet\nexcel_df = pd.read_excel('titanic.xls',sheetname=0)\nprint(excel_df.head())\n\n#Writing the csv file out\n#By default index also goes in csv. It can be ignored\n#sep is...
[ [ "pandas.read_excel", "pandas.read_csv" ] ]
borisdayma/NeMo
[ "d2120a40bf23d3e38ff5677c2685c712f297e6b1" ]
[ "nemo/collections/asr/parts/features.py" ]
[ "# Taken straight from Patter https://github.com/ryanleary/patter\n# TODO: review, and copyright and fix/add comments\nimport math\n\nimport librosa\nimport torch\nimport torch.nn as nn\nfrom torch_stft import STFT\n\nfrom nemo import logging\nfrom nemo.collections.asr.parts.perturb import AudioAugmentor\nfrom nemo...
[ [ "torch.randn_like", "torch.ceil", "torch.zeros", "torch.cat", "torch.tensor", "torch.no_grad", "torch.arange", "torch.finfo", "torch.nn.functional.pad" ] ]
SzymonZos/Fuzzy-Data-Analysis
[ "20b27ac183e8d65c41b7f3e3e491c8fb08b9696f" ]
[ "main.py" ]
[ "import re\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom functools import partial\nfrom contextlib import ExitStack\nfrom sklearn.cluster import KMeans\nfrom sklearn.decomposition import PCA\nfrom skfuzzy.cluster import cmeans, cmeans_predict\n\n\nraw_datasets = [\"models/\" + name...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "sklearn.cluster.KMeans", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "sklearn.decomposition.PCA" ] ]
mlares/CMB_polarization
[ "936d17d0be81564dbae96d8aae0cb9f824f8a94d" ]
[ "pol/pol_stack_II_load_POL03.py" ]
[ "import pickle\nimport numpy as np\n\nimport cmfg\nfrom Parser import Parser\nfrom math import pi\nfrom astropy import units as u\nimport itertools\nfrom sklearn.neighbors import NearestNeighbors \nfrom matplotlib import pyplot as plt\nfrom random import random\nfrom matplotlib import colors, ticker, rc\n\n\nclass ...
[ [ "numpy.dot", "numpy.sqrt", "numpy.linspace", "numpy.arctan2", "numpy.mean", "numpy.exp", "matplotlib.pyplot.tight_layout", "matplotlib.ticker.StrMethodFormatter", "numpy.sin", "matplotlib.pyplot.Circle", "numpy.interp", "matplotlib.pyplot.close", "sklearn.neighb...
aaronbuhendwa/twophasePINN
[ "77bdcb2a07ab31dc9ab43623cf6b776a97c0b5c8" ]
[ "src/train_model.py" ]
[ "import sys\nsys.path.append(\"../utilities\")\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' \nos.environ[\"CUDA_DEVICE_ORDER\"]=\"PCI_BUS_ID\"\nGPU_ID = \"0\" \nos.environ[\"CUDA_VISIBLE_DEVICES\"]= GPU_ID \nimport tensorflow...
[ [ "tensorflow.losses.mean_squared_error", "tensorflow.concat", "tensorflow.keras.backend.set_session", "numpy.random.seed", "numpy.random.choice", "tensorflow.stack", "tensorflow.Variable", "tensorflow.pow", "tensorflow.gradients", "tensorflow.placeholder", "tensorflow.co...
tsis-mobile-technology/deep-text-recognition-benchmark
[ "d742dee8b13958437ec8565e70121732669fd704" ]
[ "train.py" ]
[ "#-*-coding:utf-8-*-\nimport os\nimport sys\nimport time\nimport random\nimport string\nimport argparse\n\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn.init as init\nimport torch.optim as optim\nimport torch.utils.data\nimport numpy as np\n\nfrom utils import CTCLabelConverter, CTCLabelConver...
[ [ "torch.optim.Adam", "torch.nn.CrossEntropyLoss", "torch.cuda.manual_seed", "numpy.random.seed", "torch.nn.init.constant_", "torch.manual_seed", "torch.load", "torch.nn.DataParallel", "torch.no_grad", "torch.nn.CTCLoss", "torch.cuda.is_available", "torch.device", ...
So-AI-love/nlpaug
[ "3aff5754609cb6bf092709d9af2089ccd55ffc93" ]
[ "nlpaug/model/lang_models/language_models.py" ]
[ "try:\n import torch\n import torch.nn.functional as F\nexcept ImportError:\n # No installation required if not using this function\n pass\nimport numpy as np\nimport string\n\nimport nlpaug.util.selection.filtering as filtering\n\n\nclass LanguageModels:\n OPTIMIZE_ATTRIBUTES = ['external_memory', '...
[ [ "torch.nn.functional.softmax", "torch.nonzero", "torch.multinomial" ] ]
dahyun-kang/renet
[ "b58ebc092fcdb40e7f534f6407512df4f109cacd" ]
[ "models/others/lsa.py" ]
[ "\"\"\" code references: https://github.com/leaderj1001/Stand-Alone-Self-Attention \"\"\"\n\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.nn.init as init\n\n\nclass LocalSelfAttention(nn.Module):\n def __init__(self, in_channels, out_channels, kernel_size, stride=1, paddin...
[ [ "torch.nn.functional.softmax", "torch.cat", "torch.randn", "torch.einsum", "torch.nn.Conv2d", "torch.nn.init.normal_", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.functional.pad", "torch.nn.init.kaiming_normal_" ] ]
MachineWei/ChineseNer
[ "fae4dfb0498c2f1f7dfafee70fa47c935266bfaf" ]
[ "models/layers/linears.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n# from torch.modeling_utils import PoolerStartLogits, PoolerEndLogits\n\nclass FeedForwardNetwork(nn.Module):\n def __init__(self, input_size, hidden_size, output_size, dropout_rate=0):\n super(FeedForwardNetwork, self).__init__()\n ...
[ [ "torch.nn.Linear", "torch.nn.LayerNorm", "torch.cat", "torch.nn.Tanh" ] ]
StanLei52/GEBD
[ "5f7e722e0384f9877c75d116e1db72400d2bc58f" ]
[ "PC/utils/scheduler.py" ]
[ "from typing import Dict, Any\n\nimport torch\nimport math\nimport logging\n\nimport numpy as np\n\n_logger = logging.getLogger(__name__)\n\n\nclass Scheduler:\n \"\"\" Parameter Scheduler Base Class\n A scheduler base class that can be used to schedule any optimizer parameter groups.\n Unlike the builtin ...
[ [ "torch.Generator", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.rand", "torch.randn" ] ]
PaulZhutovsky/probatus
[ "d8f85dc0eac65a7fec64b76f265693c845afcbe2" ]
[ "probatus/utils/shap_helpers.py" ]
[ "# Copyright (c) 2020 ING Bank N.V.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to\n# use, copy, modify, merge, pu...
[ [ "numpy.ceil", "numpy.mean", "numpy.abs", "pandas.DataFrame" ] ]
neurodata/ndex
[ "c4d84e3be16de1ff53028d3bb1efd770790759af" ]
[ "tests/create_images.py" ]
[ "import math\nimport os\n\nimport numpy as np\nimport png\nimport tifffile as tiff\n\n\ndef create_img_file(x_size, y_size, dtype, file_format, img_fname, intensity_range=None):\n if intensity_range is None:\n bit_width = int(''.join(filter(str.isdigit, dtype)))\n else:\n bit_width = round(math....
[ [ "numpy.random.randint" ] ]
azure93/openpilot_079_neokii
[ "7ac7c327527e8ab7a1b9dc42463ce02be81c444d" ]
[ "selfdrive/controls/lib/lane_planner.py" ]
[ "from common.numpy_fast import interp\nimport numpy as np\nfrom cereal import log\nfrom selfdrive.ntune import ntune_get\n\nCAMERA_OFFSET = 0.06 # m from center car to camera\n\n\ndef compute_path_pinv(l=50):\n deg = 3\n x = np.arange(l*1.0)\n X = np.vstack(tuple(x**n for n in range(deg, -1, -1))).T\n pinv = n...
[ [ "numpy.arange", "numpy.array", "numpy.linalg.pinv" ] ]
blowekamp/polus-plugins
[ "87f9c36647b4cf95cf107cfede3a5a1d749415a5" ]
[ "polus-image-assembler-plugin/src/main.py" ]
[ "import argparse, logging, multiprocessing, re\nfrom bfio import BioReader,BioWriter\nimport numpy as np\nfrom concurrent.futures import ThreadPoolExecutor\nfrom pathlib import Path\n\nSTITCH_VARS = ['file','correlation','posX','posY','gridX','gridY'] # image stitching values\nSTITCH_LINE = \"file: {}; corr: {}; po...
[ [ "numpy.ceil", "numpy.zeros" ] ]
FenixFly/UNN_HPC_SCHOOL_2019_OPENVINO
[ "5e5ce1fa14d56549c7809d1a24bc03353ffadcbb" ]
[ "src/openvino_dnn_detector.py" ]
[ "import cv2\nimport numpy\nfrom openvino.inference_engine import IENetwork, IECore\n\nclass OpenvinoDnnDetector:\n def __init__(self, weightsPath=None, configPath=None,\n task_type=None, cpu_extension = None):\n self.weights = weightsPath\n self.config = configPath\n self.tas...
[ [ "numpy.array" ] ]
yukimasano/nw_SEIR
[ "af9d1298861eba8aadd1517a92e176f76a7218a2" ]
[ "CreateNetworks.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreateNetworks.py\n\nThis algorithm aggregates the temporally resolved network data\ndefault= 20min aggregation, by setting mins=1/3 we get 20sec resolution.\n\nOutput: Tensor A20 for day 1, tensor B20 for day 2 along with the the times as vectors.\n\n@author: \nYuki M. Asano\n\"\"...
[ [ "numpy.ceil", "numpy.save", "numpy.zeros", "numpy.loadtxt" ] ]
tamasfe/polars
[ "5d342a6474754e47baa4f10d64201a4ae015e6c7" ]
[ "py-polars/tests/test_datelike.py" ]
[ "import io\nfrom datetime import date, datetime, timedelta\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nimport pytest\nfrom test_series import verify_series_and_expr_api\n\nimport polars as pl\n\n\ndef test_fill_null() -> None:\n dt = datetime.strptime(\"2021-01-01\", \"%Y-%m-%d\")\n s = ...
[ [ "numpy.arange", "numpy.array", "pandas.date_range" ] ]
ElectronicNose/Electronic-Nose
[ "3e79711a7701d352ef5c1c2151c535c5b576b71e" ]
[ "analysis.py" ]
[ "#analysis files\r\n\r\nfrom PyQt5 import QtCore, QtGui, QtWidgets\r\nfrom PyQt5.QtWidgets import QFileDialog\r\nfrom analysis_gui import Ui_Analysis\r\nimport numpy as np\r\nimport matplotlib,math,csv\r\nmatplotlib.use('Qt5Agg')\r\nfrom matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas\r\...
[ [ "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__", "matplotlib.figure.Figure", "matplotlib.use", "numpy.arange", "numpy.deg2rad", "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.updateGeometry", "matplot...
DavidAce/2Component_GL
[ "b0821956ebe1d65355b2afd954b099ed18b9ad54" ]
[ "batch_script/Bootstrap_Energy.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as mcolors\nimport sys\nimport os\nimport math\nfrom statsmodels.graphics.tsaplots import plot_acf\nimport statsmodels.api as sm\nfrom statsmodels.tsa.stattools import acf\nimport scipy.integrate as integrate\nimport random\nimport h5py\...
[ [ "matplotlib.pyplot.tight_layout", "numpy.random.choice", "numpy.asarray", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.var", "matplotlib.pyplot.show", "numpy.zeros" ] ]
GuillaumeAI/gia-style-transfer-tf2
[ "543e4e3434b87612bff6bb901c6ce4026069fa15" ]
[ "src/model.py" ]
[ "from absl import logging, flags\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.python.keras.utils import tf_utils\n\n# Define model flags\nFLAGS = flags.FLAGS\n\nflags.DEFINE_enum(\"increase_size_layer_type\", \"default\", [\"default\", \"unpool\", \"deconv\"],\n \"Type of...
[ [ "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.Sequential", "tensorflow.pad", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.Input", "tensorflow.nn.moments", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.regularizers.l2", "tensorflow.keras.activation...
wiatrak2/BScThesis
[ "e5dd012fd9052e7088d8464b409dc055dbfcf840" ]
[ "domain_trainer.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom collections import defaultdict, namedtuple\n\nclass DomainTrainer:\n\n\tdef __init__(self, models, optims, criterions, device, **kwargs):\n\t\tself.models = models\n\t\tself.optims = optims\n...
[ [ "torch.nn.Sequential", "torch.no_grad" ] ]
bellwethers-in-se/issueCloseTime
[ "e5e00c9625da0793dc8e7985fd88b0ca0b35f7d3" ]
[ "tests/src/metrics/recall_vs_loc.py" ]
[ "from __future__ import print_function, division\n\nimport numpy as np\nfrom pdb import set_trace\n\ndef get_curve(loc, actual, predicted):\n sorted_loc = np.array(loc)[np.argsort(loc)]\n sorted_act = np.array(actual)[np.argsort(loc)]\n\n sorted_prd = np.array(predicted)[np.argsort(loc)]\n recall, loc =...
[ [ "numpy.argsort", "numpy.array", "numpy.trapz" ] ]
goldgeisser/inference
[ "42c68883f6f60bf6e0d0253c1bb797a285e2d5f2" ]
[ "v0.5/classification_and_detection/python/main.py" ]
[ "\"\"\"\nmlperf inference benchmarking tool\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport argparse\nimport array\nimport collections\nimport json\nimport logging\nimport os\nimport threading\nimport time\nfrom queue import Queue\...
[ [ "numpy.array", "numpy.mean", "numpy.percentile" ] ]
Delay-Xili/F-Clip
[ "ea5a7b2ddba8f4baf57e62962b479d8f0447bd65" ]
[ "FClip/postprocess.py" ]
[ "import numpy as np\nimport torch\n\n\ndef pline(x1, y1, x2, y2, x, y):\n \"\"\"the L2 distance from n(x,y) to line n1 n2\"\"\"\n px = x2 - x1\n py = y2 - y1\n dd = px * px + py * py\n u = ((x - x1) * px + (y - y1) * py) / max(1e-9, float(dd))\n dx = x1 + u * px - x\n dy = y1 + u * py - y\n ...
[ [ "numpy.amax", "torch.max", "torch.cat", "numpy.amin", "numpy.clip", "torch.min", "torch.sum", "torch.zeros_like", "numpy.concatenate", "numpy.zeros_like", "numpy.transpose", "numpy.array", "numpy.sum" ] ]
Kraysent/OMTool
[ "abb293ee359720d622ed0c4ecdf90967171007c8" ]
[ "omtool/visualizer/draw_parameters.py" ]
[ "from dataclasses import dataclass\nfrom typing import Any, Tuple\n\nimport matplotlib as mpl\n\n\n@dataclass\nclass DrawParameters: \n id: str\n markersize: float = 0.1\n linestyle: str = 'None'\n color: str = 'b'\n marker: str = 'o'\n is_density_plot: bool = False\n resolution: int = 100\n ...
[ [ "matplotlib.colors.LogNorm" ] ]
PatriceC/MLProjectISDP2020
[ "e8eefdf2e630a53e09f88550357b67732f2bccd0" ]
[ "data_analysis.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Nov 27 19:19:45 2020\n\n@author: Patrice CHANOL & Corentin MORVAN--CHAUMEIL\n\"\"\"\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# %% Load Data\n\ndata_load = pd.read_csv('./Radar_Traffic_Counts.csv')\ndata_load = data_load.drop(columns=['Time Bin', 'lo...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "pandas.to_datetime", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
appliedopt/gpfit
[ "3c8025f12ba5360fdeb71c270e55d4c93e1676fd" ]
[ "gpfit/xfoil/constraint_set.py" ]
[ "\"\"\"xfoil constraint set\"\"\"\nimport numpy as np\nfrom gpfit.constraint_set import FitConstraintSet\nfrom .wrapper import xfoil_comparison\n\n\n# pylint: disable=too-many-arguments\nclass XfoilFit(FitConstraintSet):\n \"\"\"Special FitConstraintSet that can post-solve compare result to XFOIL\n\n Argument...
[ [ "numpy.where" ] ]
ordinaryname/CosmiQ_SN7_Baseline
[ "db486f834b5f4a0a917098c63c1bbfe432350789" ]
[ "src/sn7_baseline_prep_funcs.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Aug 25 14:11:02 2020\n\n@author: avanetten\n\"\"\"\n\nimport multiprocessing\nimport pandas as pd\nimport numpy as np\nimport skimage\nimport gdal\nimport os\n\nimport solaris as sol\nfrom solaris.raster.image import create_multiband_geotiff\n...
[ [ "numpy.zeros" ] ]
Math-568-project/interneuron_circuits_plasticity
[ "ded04f8da5d315d2ec18950179efa41ed4813960" ]
[ "retrain.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pickle\n\nfrom brian2 import *\nfrom brian2tools import *\n\nfrom analyse_experiment import *\nfrom plot_Spikingmodel import *\nfrom utils import *\n\nRESULTS_DIR = './results'\n\nTUNED_ORI = 1\n\n\ndef run_network(params):\n\n # get parameters\n p = Stru...
[ [ "numpy.copy" ] ]
daico007/molbox
[ "0cd18b1400ef1b0e1b5331b92aeb36af3465d425" ]
[ "molbox/box.py" ]
[ "\"\"\"generic box module.\"\"\"\nfrom warnings import warn\n\nimport numpy as np\n\n__all__ = [\"Box\", \"BoxError\"]\n\n\nclass BoxError(Exception):\n \"\"\"Exception to be raised when there's an error in Box methods\"\"\"\n\n\nclass Box(object):\n \"\"\"A box representing the bounds of the system.\n\n P...
[ [ "numpy.square", "numpy.dot", "numpy.clip", "numpy.asarray", "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.linalg.det", "numpy.ones", "numpy.deg2rad", "numpy.cross", "numpy.linalg.qr", "numpy.zeros", "numpy.isclose" ] ]
vasuneralla/theanolm
[ "9eda655ed63e8906234e62ab7da016e64e931afe" ]
[ "tests/theanolm/recurrentstate_test.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport math\n\nimport numpy\nfrom numpy.testing import assert_equal\n\nfrom theanolm.network import RecurrentState\n\nclass TestRecurrentState(unittest.TestCase):\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n\n ...
[ [ "numpy.arange", "numpy.zeros" ] ]
Honghe/TensorFlowASR
[ "72cd5d2b932d66ddd61e79ab41bb0d64cb8c4919" ]
[ "examples/streaming_transducer/test_subword_streaming_transducer.py" ]
[ "# Copyright 2020 Huy Le Nguyen (@usimarit)\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 ...
[ [ "tensorflow.keras.backend.clear_session", "tensorflow.config.optimizer.set_experimental_options", "tensorflow.random.set_seed" ] ]
zbouslama/open_maps
[ "26f0c8e64cf9fe28e24a05fae5c10cb3de38cf54" ]
[ "flaskapp/app.py" ]
[ "from flask import Flask, render_template,request, jsonify\nfrom data import Articles\nimport pandas as pd\n\napp = Flask (__name__)\n\nArticles= Articles()\n\n\n\n@app.route('/')\n\ndef index():\n\t\treturn render_template ('home.html')\n\n@app.route('/about')\ndef about ():\n\treturn render_template ('about.html'...
[ [ "pandas.read_csv" ] ]
TownShaw/Hierarchical-Multi-Label-Text-Classification
[ "e7d0f8d29b8c7b37b951c547b62b9655011fb0be" ]
[ "HARNN/test_harnn.py" ]
[ "# -*- coding:utf-8 -*-\n__author__ = 'Randolph'\n\nimport os\nimport sys\nimport time\nimport logging\nimport numpy as np\n\nsys.path.append('../')\nlogging.getLogger('tensorflow').disabled = True\n\nimport tensorflow as tf\nfrom utils import checkmate as cm\nfrom utils import data_helpers as dh\nfrom utils import...
[ [ "tensorflow.Graph", "tensorflow.train.latest_checkpoint", "tensorflow.ConfigProto", "tensorflow.Session", "numpy.array" ] ]
rentes/Euler
[ "e28b536a15f2e795f886a5df261d38bb0181be07" ]
[ "problem11.py" ]
[ "\"\"\"Project Euler - Problem 11 - http://projecteuler.net/problem=11\"\"\"\nimport sys\nimport time\n# please install numpy module (python-numpy on Arch Linux)\nimport numpy as np\nimport tools.timeutils as timeutils\n\n\ndef fill_matrix():\n \"\"\"\n Return a numpy matrix from the data in problem11-data.tx...
[ [ "numpy.bmat", "numpy.rot90", "numpy.loadtxt" ] ]
vs74/ivadomed
[ "c3b5a21bbe4907853a330bd18d0dbb048439111d" ]
[ "ivadomed/training.py" ]
[ "import copy\nimport datetime\nimport logging\nimport os\nimport random\nimport time\n\nimport numpy as np\nimport torch\nimport torch.backends.cudnn as cudnn\nfrom torch import optim\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\nfrom tqdm import tqdm\n\nfrom ivadomed ...
[ [ "torch.optim.Adam", "torch.optim.lr_scheduler.CosineAnnealingWarmRestarts", "torch.optim.lr_scheduler.CyclicLR", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.load", "torch.utils.data.DataLoader", "torch.is_tensor", "numpy.save", "torch.no_grad", "torch.utils.tensorb...
sadjadasghari/SpatialSense
[ "4cb5ecb4b99dbea76ecb92878cce411e1c5edfcd" ]
[ "baselines/unrel/spatial_features.py" ]
[ "import pdb\nimport json\nimport pickle\nimport numpy as np\nimport math\nimport random\nfrom sklearn.mixture import GaussianMixture\n\n\ndef raw_spatial_feature(bbox_s, bbox_o):\n w_s = bbox_s[3] - bbox_s[2]\n h_s = bbox_s[1] - bbox_s[0]\n w_o = bbox_o[3] - bbox_o[2]\n h_o = bbox_o[1] - bbox_o[0]\n\n ...
[ [ "sklearn.mixture.GaussianMixture", "numpy.vstack" ] ]
jakubzadrozny/kmml-data-challenge
[ "5127fb1df14808fb9b5cda2599b503beba6ccb23" ]
[ "train.py" ]
[ "import numpy as np\n\nfrom data import load_data\nfrom ridge import KRRClassifier\nfrom logistic import KernelLogisticClassifier\nfrom svm import KSVM\nfrom utils import KernelCrossValidation\nfrom kernels import SpectrumKernel, SumKernel, SubstringKernel\n\nSEED = 47\nFOLDS = 10\n\nmodel_path = None # set this t...
[ [ "numpy.random.seed" ] ]
sciris/sciris
[ "a52a7a0d4bf2c3de7dde1dbca07c40341f9a18b0" ]
[ "tests/test_plotting.py" ]
[ "\"\"\"\nTest color and plotting functions -- warning, opens up many windows!\n\"\"\"\n\nimport os\nimport numpy as np\nimport pylab as pl\nimport sciris as sc\n\n\nif 'doplot' not in locals():\n doplot = True\n\n\ndef test_colors(doplot=doplot):\n sc.heading('Testing colors')\n o = sc.objdict()\n\n pri...
[ [ "numpy.arange", "numpy.array", "numpy.random.rand", "numpy.isclose" ] ]
DataForces/CV_LUNA
[ "adc76fdc580807742fee4c6453c728a2d6d76ed3" ]
[ "src/data_processing/OLD/create_lung_segmented_same_spacing_data.py" ]
[ "import glob\nimport numpy as np\nimport os\nimport SimpleITK as sitk\nimport skimage.transform\nimport scipy.ndimage\n\nfrom joblib import Parallel, delayed\n\nRESIZE_SPACING = [1, 1, 1]\nSAVE_FOLDER = '1_1_1mm'\n\ndef load_itk(filename):\n itkimage = sitk.ReadImage(filename)\n numpyImage = sitk.GetArrayFrom...
[ [ "numpy.round" ] ]
tierriminator/GraphQSat
[ "9a356438d1dc68f28a14e71e3f5bd306bd8ce877" ]
[ "dqn2.py" ]
[ "# Copyright 2019-2020 Nvidia 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 law...
[ [ "numpy.nanmax", "torch.softmax", "numpy.nanmedian", "torch.load", "torch.no_grad", "numpy.mean", "torch.cuda.is_available", "numpy.nanmean", "torch.device" ] ]
olegklimov/DeepSpeed
[ "80e263c571599a93f412c850f0ff7a44a9051a90" ]
[ "deepspeed/runtime/pipe/module.py" ]
[ "import os\nimport glob\nimport enum\n\nimport re as regex\n\nfrom collections import defaultdict\nfrom functools import partial\n\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\n\nfrom deepspeed.utils import logger\nfrom .. import utils as ds_utils\nfrom ..activation_checkpointing import ch...
[ [ "torch.nn.ModuleDict", "torch.distributed.is_initialized", "torch.distributed.new_group", "torch.distributed.get_rank", "torch.distributed.get_world_size", "torch.distributed.all_reduce", "torch.save" ] ]
zementalist/Face-Landmarks-Detection-Highly-Improved
[ "2dea823e2b496153fc3431007a1d4c3e3ea74c42" ]
[ "script/main.py" ]
[ "import cv2\nimport dlib\nfrom imutils import face_utils\nimport numpy as np\nfrom scipy.spatial import Delaunay\nimport matplotlib.pyplot as plt\nfrom matplotlib import transforms\nimport os\nimport math\nfrom geometry import slope\n\ndef load_images_from_folder(folder):\n images = []\n filenames = []\n f...
[ [ "numpy.concatenate", "numpy.copy", "numpy.argmax", "numpy.diff", "numpy.count_nonzero", "numpy.average", "numpy.array", "numpy.logical_and", "numpy.sum" ] ]
jainrachit1008/Titans-of-Wall-Street-Program-Projects
[ "2d71499a0942ed506330c412eae3b0822c837aa7" ]
[ "Project_2.py" ]
[ "import datetime as dt\nimport pandas as pd\nimport numpy as np\nfrom pandas.plotting import table\nimport matplotlib.pyplot as plt\n\ndef ann_return(DF):\n \"function to calculate the Annualized return from monthly prices of a fund/sript\"\n df = DF.copy()\n df[\"mon_ret\"] = df[\"NAV\"].pct_change()\n ...
[ [ "pandas.read_csv", "pandas.to_datetime", "numpy.sqrt", "pandas.DataFrame" ] ]
vincentpun/ConformanceConstraintsReproducibility
[ "fc5df4ec9a3702a1837ffe6f3c05216523e8a1c5" ]
[ "Figure_8.py" ]
[ "import prose.datainsights as di\nimport os\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport subprocess\nfrom sklearn.decomposition import PCA\nimport numpy as np\nimport numpy.random as rnd\nimport matplotlib.pyplot as plt\nimport os\nimport sys\nimport warnings\nfrom matplotlib im...
[ [ "pandas.read_csv", "numpy.min", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.max", "numpy.size", "numpy.array", "numpy.where", "sklearn.decomposition.PCA", "matplotlib.rc" ] ]
yuanmingqi/YuanRL
[ "b0e6cdb0207d23ec9c883191f9ca13a6a08f9769" ]
[ "yuanrl/nn/QMIXBackbone.py" ]
[ "from torch import nn\nfrom torch.nn import functional as F\nimport torch\n\nclass SingleAgent(nn.Module):\n def __init__(self, kwargs):\n super(SingleAgent, self).__init__()\n\n self.fc1 = nn.Linear(kwargs['input_dim'], 64)\n self.fc2 = nn.Linear(64, 128)\n self.rnn = nn.GRUCell(128,...
[ [ "torch.nn.ELU", "torch.nn.Linear", "torch.FloatTensor", "torch.nn.LeakyReLU", "torch.bmm", "torch.stack", "torch.nn.GRUCell", "torch.nn.ReLU" ] ]
xwuShirley/mmdetection
[ "f9b9eaad9f58e90862997b90a034aad1518baf2f" ]
[ "mmdet/models/detectors/two_stage.py" ]
[ "import torch\nimport torch.nn as nn\n\n# from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler\nfrom ..builder import DETECTORS, build_backbone, build_head, build_neck\nfrom .base import BaseDetector\n\n\n@DETECTORS.register_module()\nclass TwoStageDetector(BaseDetector):\n \"\"\"Base clas...
[ [ "torch.randn" ] ]
goodteamname/spino
[ "aa8c6cfa9f94a639c306d85ca6df2483108fda37", "aa8c6cfa9f94a639c306d85ca6df2483108fda37" ]
[ "bokeh_app/scripts/functions/timeseries_stats.py", "bokeh_app/data/synthetic_data_generator.py" ]
[ "import pandas as pd\nimport numpy as np\n\n\ndef remove_trend(ts, N):\n \"\"\"Remove a best fitting polynomial of degree N from time series data.\n\n Uses numpy methods polyfit to find the coefficients of a degree N\n polynomial of best fit (least squares resiuduals) and polyeval to\n construct the pol...
[ [ "numpy.polyfit", "pandas.concat", "numpy.sqrt", "pandas.Series", "numpy.delete" ], [ "matplotlib.pyplot.scatter", "numpy.linspace", "numpy.cos", "numpy.sin", "matplotlib.pyplot.plot", "numpy.random.randn", "matplotlib.pyplot.show" ] ]
santisy/pytorch-CycleGAN-and-pix2pix
[ "0d78a3c34bea14316dba852724919fb3e75d1575" ]
[ "models/base_model.py" ]
[ "import os\nimport torch\nfrom collections import OrderedDict\nfrom abc import ABCMeta, abstractmethod\nfrom . import networks\n\n\nclass BaseModel(object):\n \"\"\"This class is an abstract base class (ABC) for models.\n To create a subclass, you need to implement the following five functions:\n -- <_...
[ [ "torch.device", "torch.no_grad", "torch.cuda.is_available" ] ]
sandeepdas05/lsm-crack-width
[ "38460e514d48f3424bb8d3bd58cb3eb330153e64", "38460e514d48f3424bb8d3bd58cb3eb330153e64" ]
[ "lsml/initializer/provided/ball.py", "lsml/util/test/test_distance_transform.py" ]
[ "import numpy\n\nfrom lsml.initializer.initializer_base import InitializerBase\n\n\nclass BallInitializer(InitializerBase):\n \"\"\" Initialize the zero level set to a ball of fixed radius \"\"\"\n\n def __init__(self, radius=10, location=None):\n self.radius = radius\n self.location = location\...
[ [ "scipy.ndimage.gaussian_filter", "numpy.nonzero", "numpy.arange", "numpy.indices", "numpy.linalg.norm", "numpy.ones", "scipy.ndimage.label", "numpy.array", "numpy.random.RandomState" ], [ "numpy.zeros", "numpy.ones" ] ]
shawntan/CategoricalNF
[ "2f92c60f840bf78616c89dc498288e85b00a1587" ]
[ "layers/categorical_encoding/linear_encoding.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport sys\nimport numpy as np\n\nsys.path.append(\"../../\")\n\nfrom general.mutils import get_param_val, one_hot\nfrom layers.flows.flow_layer import FlowLayer\nfrom layers.flows.permutation_layers import InvertibleConv\nfrom layers.flows.acti...
[ [ "torch.randint", "numpy.random.seed", "torch.zeros", "torch.nn.functional.log_softmax", "torch.manual_seed", "torch.nn.ModuleList", "torch.from_numpy", "torch.no_grad", "torch.arange", "numpy.exp", "torch.logsumexp" ] ]
sayandip18/sparse
[ "08daaad8edc59e7a7c432a97ae4f9321622e1bd3" ]
[ "sparse/_utils.py" ]
[ "import functools\nfrom collections.abc import Iterable\nfrom numbers import Integral\nfrom functools import reduce\n\nimport operator\nimport numpy as np\n\n\ndef assert_eq(x, y, check_nnz=True, compare_dtype=True, **kwargs):\n from ._coo import COO\n\n assert x.shape == y.shape\n\n if compare_dtype:\n ...
[ [ "numpy.array_equal", "numpy.asarray", "numpy.random.RandomState", "numpy.issubdtype", "numpy.float_", "numpy.random.rand", "numpy.isscalar", "numpy.prod", "numpy.min_scalar_type", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
Aniket1998Agrawal/robotic-palm
[ "b9a30fbb5a2f1d15faf8f553201203a431cb34cb" ]
[ "models/nets/cpm_hand.py" ]
[ "import tensorflow as tf\nimport pickle\nfrom models.nets.CPM import CPM\n\n\nclass CPM_Model(CPM):\n def __init__(self, input_size, heatmap_size, stages, joints, img_type='RGB', is_training=True):\n self.stages = stages\n self.stage_heatmap = []\n self.stage_loss = [0 for _ in range(stages)...
[ [ "tensorflow.get_variable", "tensorflow.concat", "tensorflow.shape", "tensorflow.assign", "tensorflow.layers.max_pooling2d", "tensorflow.placeholder", "tensorflow.train.exponential_decay", "tensorflow.nn.l2_loss", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.l...
havefun28/scenario_runner
[ "d24e9563179b7a345705c53e7da877b42736acf2" ]
[ "coil_model_warmstart.py" ]
[ "import os, sys\nsys.path.append('/home/ruihan/coiltraine/')\nimport yaml\n\nimport torch\n\nfrom network.models.coil_icra import CoILICRA\nfrom coilutils import AttributeDict\n\n# from attribute_dict import AttributeDict\n\n# # Sample from PyTorch docs: https://pytorch.org/tutorials/beginner/saving_loading_models....
[ [ "torch.set_default_dtype", "torch.set_default_tensor_type", "torch.load" ] ]
goeckslab/MarkerIntensityPredictor
[ "704e4ea782c6653cabb4b37a7b34fea4cd9fe595" ]
[ "src/AE/ae.py" ]
[ "import pickle\nimport sys\nfrom pathlib import Path\nfrom Shared.data import Data\nfrom Shared.data_loader import DataLoader\nimport numpy as np\nimport keras\nfrom keras import layers, regularizers\nfrom sklearn.preprocessing import StandardScaler, MinMaxScaler\nimport anndata as ad\nimport pandas as pd\nimport u...
[ [ "numpy.array", "tensorflow.keras.layers.LeakyReLU", "sklearn.metrics.r2_score", "pandas.DataFrame", "numpy.log10", "sklearn.preprocessing.StandardScaler", "tensorflow.keras.callbacks.EarlyStopping", "sklearn.preprocessing.MinMaxScaler" ] ]
derillina/trainerpi
[ "15268c5765ee5e12f217e9585af7b29e57ba59d8" ]
[ "trainerpi.py" ]
[ "import asyncio\nimport bleCSC\nimport collections\nimport numpy\nimport os\nimport pygame\nimport time\n\n\n# --------------------------------------------------------------------------- #\n# SETTINGS #\n# -------------------------------------------...
[ [ "numpy.interp", "numpy.loadtxt" ] ]
Reaiot/kiswahili_tts
[ "1bbbff49f7c6cf899e5e3fd4c8cb7d6a7d1b6e79" ]
[ "test/test_melgan_layers.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2020 Minh Nguyen (@dathudeptrai)\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# Unl...
[ [ "tensorflow.keras.backend.int_shape", "tensorflow.random.normal" ] ]
endaaman/prostate
[ "e08beb862fc61ab0bcef672ab77d2ff528259094" ]
[ "train.py" ]
[ "import os\nimport math\nimport re\nimport gc\nimport argparse\nfrom enum import Enum, auto\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim.lr_scheduler import LambdaLR\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\nfrom torchvision...
[ [ "torch.optim.lr_scheduler.LambdaLR", "numpy.multiply", "torch.cuda.device_count", "torch.utils.data.DataLoader", "numpy.identity", "torch.cuda.is_available", "torch.nn.DataParallel" ] ]
Antaego/gpt-companion
[ "071d1218661cb8dddfd31d50da91c1af7a9be21b" ]
[ "gpt-example/deps/gpt/src/sample.py" ]
[ "import tensorflow as tf\n\nfrom deps.gpt.src import model\n\ndef top_k_logits(logits, k):\n if k == 0:\n # no truncation\n return logits\n\n def _top_k():\n values, _ = tf.nn.top_k(logits, k=k)\n min_values = values[:, -1, tf.newaxis]\n return tf.where(\n logits ...
[ [ "tensorflow.TensorShape", "tensorflow.nn.softmax", "tensorflow.fill", "tensorflow.gather_nd", "tensorflow.range", "tensorflow.concat", "tensorflow.sort", "tensorflow.equal", "tensorflow.ones_like", "tensorflow.cast", "tensorflow.nn.top_k", "tensorflow.name_scope", ...
openmsr/openmc
[ "831c8d1c50cb4441faf8a0268ec59f6f803bb258" ]
[ "openmc/lattice.py" ]
[ "from abc import ABC\nfrom collections import OrderedDict\nfrom collections.abc import Iterable\nfrom copy import deepcopy\nfrom math import sqrt, floor\nfrom numbers import Real\nimport types\nfrom xml.etree import ElementTree as ET\n\nimport numpy as np\n\nimport openmc\nimport openmc.checkvalue as cv\nfrom ._xml...
[ [ "numpy.rot90", "numpy.asarray", "numpy.squeeze", "numpy.atleast_2d", "numpy.broadcast", "numpy.transpose", "numpy.ravel", "numpy.array", "numpy.empty" ] ]
HackRoboy/dialogic
[ "f67bbb378d327d9e29de21795770fd5e51141608" ]
[ "ros2/src/roboy_vision/convertions/convertions.py" ]
[ "import sys\n\nfrom sensor_msgs.msg import Image\n\nimport numpy as np\n\nfrom convertions.registry import converts_to_numpy, converts_from_numpy\n\nname_to_dtypes = {\n \"rgb8\": (np.uint8, 3),\n \"rgba8\": (np.uint8, 4),\n \"rgb16\": (np.uint16, 3),\n \"rgba16\": (np.uint16, 4),\n \"bgr8\": (np.uin...
[ [ "numpy.ascontiguousarray", "numpy.array", "numpy.dtype" ] ]
Thomas-01/lenstronomy_extensions
[ "fbbfe24dcfd71eae9e7c2dd60865a9b94db67fe8" ]
[ "lenstronomy_extensions/Itterative/iterative_source.py" ]
[ "__author__ = 'sibirrer'\n\nimport numpy as np\nimport lenstronomy.Util.util as util\nfrom lenstronomy.LightModel.Profiles.shapelets import Shapelets\nfrom lenstronomy.ImSim.image_model import ImageModel\n\n\nclass MakeImageIter(ImageModel):\n \"\"\"\n class to perform an iterative source reconstruction\n ...
[ [ "numpy.sqrt", "numpy.min", "numpy.append", "numpy.mean", "numpy.zeros_like", "numpy.array", "numpy.zeros" ] ]
yifeim/sagemaker-python-sdk
[ "d60f8d3889b4bbada745ff67ce4d0aae2013285a" ]
[ "src/sagemaker/predictor.py" ]
[ "# Copyright 2017-2018 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.array", "numpy.ndarray.flatten", "numpy.save" ] ]
jacky10001/tf2-mycnn
[ "6a631ee71b2a91fc4e6e7a43f8f9179260a1d7fa" ]
[ "mycnn/alexnet.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\nfrom tensorflow.keras import layers\nfrom .core.base_model import KerasModel\n\n\nclass LRN(layers.Layer):\n \"\"\" Implement Local Response Normalization \"\"\"\n def __init__(self,\n alpha=0.0001,\n k=2,\n b...
[ [ "tensorflow.keras.layers.ReLU", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.nn.lrn", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Flatten", "t...
nealplatt/sch_man_nwinvasion
[ "73f7ce5fa4843cc2352fdb709b134f22af28ad19" ]
[ "code/remove_invariant_sites_from_phylip.py" ]
[ "### RNPlatt\n### 05 Sept 2019\n### USAGE: remove_invariant_sites_from_phylip.py <list of invariants> <phylip> <outfile>\n### \n### This will take a list of invariant sites predetermined by raxml in a single\n### site per line file and the original phylip file used in raxml and return\n### a phylip file wit...
[ [ "numpy.delete", "numpy.array" ] ]
HypoX64/bilibili
[ "992029667ad37d7d03131aa2c4c9923da6cca6f2" ]
[ "OneImage2Video/school_badge.py" ]
[ "import os\nimport cv2\nimport numpy as np\n\nimport sys\nsys.path.append(\"..\")\nfrom Util import util,ffmpeg\n\n\n# 用校徽看badapple\nimgs_dir = './pixel_imgs/university/base'\nhighlight_dir = './pixel_imgs/university/highlight'\nbackground_dir = './pixel_imgs/university/background'\ncut_size = 79\npixel_resize = 0 ...
[ [ "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
intruder1912/adanet
[ "69354c4e961defca790a1ce0e042251dfbe4f410" ]
[ "adanet/core/report_accessor_test.py" ]
[ "\"\"\"Tests for run_report_accessor.py.\n\nCopyright 2018 The AdaNet Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n https://www.apache.org/licenses/L...
[ [ "tensorflow.test.main" ] ]
jgillis/optimization-engine
[ "2952af47891204d3cd080a8e7f71e616ac022e52" ]
[ "open-codegen/opengen/functions/norm2.py" ]
[ "import casadi.casadi as cs\nimport numpy as np\nfrom .is_numeric import *\nfrom .is_symbolic import *\n\n\ndef norm2(u):\n if (isinstance(u, list) and all(is_numeric(x) for x in u))\\\n or isinstance(u, np.ndarray):\n # if `u` is a numeric vector\n return np.linalg.norm(u)\n elif...
[ [ "numpy.linalg.norm" ] ]
bethz/interpret-community
[ "3932bfe93aedbc2a6409de1e169e0576cedc8b0d" ]
[ "python/interpret_community/mimic/mimic_explainer.py" ]
[ "# ---------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# ---------------------------------------------------------\n\n\"\"\"Defines the Mimic Explainer for computing explanations on black box models or functions.\n\nThe mimic explainer trains an ex...
[ [ "numpy.array", "numpy.stack" ] ]
khushhallchandra/CN-project
[ "405ce86e4e65e116531aa19287b8d05c959b1441" ]
[ "analyze_tls.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\ndef main(filename):\n data = pd.read_csv(filename, header=None)\n means = data.mean(axis = 0)\n stds = data.std(axis = 0)\n return means[0], means[1], stds[0], stds[1]\n\nif __name__ == '__main__':\n files_http1 = ['./resu...
[ [ "numpy.array", "pandas.read_csv", "matplotlib.pyplot.subplots" ] ]
bearsroom/mxnet-augmented
[ "af4843b249e312014d54ce38545fcb4fa546d7db" ]
[ "python/tools/metrics.py" ]
[ "\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nclass Metrics:\n def __init__(self, num_classes):\n self.num_classes = num_classes\n self.reset()\n\n def reset(self):\n self.tp = np.zeros((self.num_classes, ), dtype=np.float32)\n ...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "matplotlib.pyplot.tight_layout", "matplotlib.use", "numpy.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf", "numpy.where", "matplotlib.pyplot....
CLEANit/schnetpack
[ "4760ff452e10e5f8b75d19c3f2db595145bcae0b" ]
[ "src/schnetpack/representation/schnet.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom schnetpack.nn.base import Dense, ScaleShift\nfrom schnetpack import Properties\nfrom schnetpack.nn.cfconv import CFConv, VoxelCFConv\nfrom schnetpack.nn.cutoff import CosineCutoff\nfrom schnetpack.nn.acsf import GaussianSmearing\nfrom schnetpack.nn.neighbors import AtomD...
[ [ "torch.Tensor", "torch.sum", "torch.nn.Embedding" ] ]
yoqi/yolov4-pytorch-jinshuquexian
[ "cea88e5cf51bfa15590a6bb0a68c63701985d7bf" ]
[ "get_map.py" ]
[ "import argparse\nimport glob\nimport json\nimport math\nimport operator\nimport os\nimport shutil\nimport sys\n\nimport numpy as np\n\n#----------------------------------------------------#\n# 用于计算 mAP\n# 代码克隆自 https://github.com/Cartucho/mAP\n#----------------------------------------------------#\nMINOVERLAP...
[ [ "numpy.array", "matplotlib.pyplot.legend", "matplotlib.pyplot.gca", "numpy.maximum", "matplotlib.pyplot.title", "numpy.logspace", "matplotlib.pyplot.cla", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "numpy.insert", "matplotlib.pyplot.close", "matplotlib.pyplo...
wxshan/py-R-FCN
[ "de5f4c7abbeca5e55930f863ccb78da4fe130e5a" ]
[ "lib/utils/blob.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"Blob helper functions.\"\"\"\n\nimport numpy as np\ni...
[ [ "numpy.min", "numpy.round", "numpy.max", "numpy.array", "numpy.zeros" ] ]
linZHank/two_loggers
[ "34b02e443681ddabe796d73863b24b5499168895" ]
[ "loggers_control/scripts/envs/se.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nSolo escape environment with discrete action space\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport sys\nimport os\nimport numpy as np\nfrom numpy import pi\nfrom numpy import random\n\nimport rospy\nimport tf\nfrom std_srvs.srv import Empty\nfrom...
[ [ "numpy.absolute", "numpy.random.uniform", "numpy.array", "numpy.zeros" ] ]
poldni/tvm
[ "3653e0294c962d400e4fcde536a350fda07ea78c" ]
[ "tests/python/unittest/test_graph_tuner_core.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.prod" ] ]
rickvanveen/LVQLib
[ "4fba52a14ed37b0444becb96ef09c40d38d263ff" ]
[ "sklvq/activations/_sigmoid.py" ]
[ "import numpy as np\nfrom typing import Union\n\nfrom . import ActivationBaseClass\n\n\nclass Sigmoid(ActivationBaseClass):\n \"\"\"Sigmoid function\n\n Class that holds the sigmoid function and gradient as discussed in `[1]`_\n\n Parameters\n ----------\n beta : int or float, optional, default=1\n ...
[ [ "numpy.asarray", "numpy.exp" ] ]