repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
xykong1958/tensorflow | [
"f90532431c3785166cff35ff427b652fe460f60b"
] | [
"tensorflow/compiler/xla/python/xla_client_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.testing.assert_allclose",
"numpy.int8",
"numpy.dot",
"numpy.asfortranarray",
"numpy.exp",
"tensorflow.compiler.xla.python.xla_client.GatherDimensionNumbers",
"numpy.expm1",
"tensorflow.compiler.xla.python.xla_client.Shape.array_shape",
"numpy.dtype",
"tensorflow.comp... |
bbchond/user-activity-generator | [
"d8b75b10a194f9526b5553d750196188600d9816"
] | [
"src/classifier/knn.py"
] | [
"from sklearn.neighbors import KNeighborsClassifier\n\nknn = KNeighborsClassifier(n_neighbors=3)\n"
] | [
[
"sklearn.neighbors.KNeighborsClassifier"
]
] |
DNGros/R-U-A-Robot | [
"f2b9331f21dd0d2a237a9ed968c2b609c4ad979d"
] | [
"baselines/googleassistant/google_assistant_run.py"
] | [
"from pathlib import Path\nimport unicodedata, re, subprocess\nfrom tqdm import tqdm\nimport numpy as np\nimport random\nimport time\nimport pandas as pd\n\ncur_file = Path(__file__).parent.absolute()\n\n\n# Adapted from https://github.com/googlesamples/assistant-sdk-python/blob/ce76c508fdf076678/\n# google-assis... | [
[
"pandas.isnull",
"pandas.read_csv"
]
] |
tbrlpld/wagtail-ab-testing | [
"ab12cc164ebd8bc97a30a475252d014d9c79971a"
] | [
"wagtail_ab_testing/models.py"
] | [
"import random\n\nfrom datetime import datetime, timedelta, timezone as tz\n\nimport scipy.stats\nimport numpy as np\nfrom django.conf import settings\nfrom django.core.validators import MinValueValidator\nfrom django.db import connection, models, transaction\nfrom django.db.models import Q, Sum\nfrom django.dispat... | [
[
"numpy.array"
]
] |
shenyunhang/JTSM | [
"40cd5ce67d46852402c5bc752960c0e8922993f0"
] | [
"projects/WSL/tools/visualize_json_results.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport argparse\nimport json\nimport numpy as np\nimport os\nfrom collections import defaultdict\nimport cv2\nimport tqdm\n\nfrom detectron2.data import DatasetCatalog, MetadataCatalog\nfrom detectron2.structures import Boxes, BoxMode, In... | [
[
"numpy.concatenate",
"numpy.asarray"
]
] |
Jonas-Meier/FrustratinglySimpleFsDet | [
"c17af714b0a67e2ba0bfdb079659db48de836fd6"
] | [
"fsdet/modeling/roi_heads/roi_heads.py"
] | [
"\"\"\"Implement ROI_heads.\"\"\"\nimport copy\n\nimport numpy as np\nimport torch\nfrom torch import nn\n\nimport logging\nfrom detectron2.data import MetadataCatalog\nfrom detectron2.layers import ShapeSpec\nfrom detectron2.modeling.backbone.resnet import BottleneckBlock, make_stage\nfrom detectron2.modeling.box_... | [
[
"torch.device",
"torch.cat",
"torch.nn.Sequential",
"torch.no_grad",
"numpy.mean",
"torch.zeros_like"
]
] |
predictive-analytics-lab/pal-bolts | [
"5f1932f351f2e551276b47dfeda7888772d99895"
] | [
"conduit/data/datasets/utils.py"
] | [
"from collections.abc import Mapping\nfrom dataclasses import fields, is_dataclass\nfrom functools import lru_cache\nimport logging\nfrom multiprocessing.context import BaseContext\nfrom pathlib import Path\nimport platform\nimport subprocess\nfrom typing import (\n Any,\n Callable,\n List,\n NamedTuple... | [
[
"torch.cat",
"numpy.array",
"torch.stack",
"torch.utils.data.get_worker_info",
"torch.utils.data._utils.collate.default_collate_err_msg_format.format",
"torch.from_numpy",
"torch.tensor",
"torch.as_tensor",
"numpy.moveaxis",
"torch.utils.data._utils.collate.np_str_obj_array... |
jzf2101/boardlaw | [
"29126c2a6ab7f11154fb242c303d3b11f1566201"
] | [
"boardlaw/networks.py"
] | [
"import numpy as np\nimport torch\nfrom . import heads\nfrom torch import nn\nimport torch.jit\nfrom rebar import recurrence, arrdict, profiling\nfrom torch.nn import functional as F\nfrom collections import namedtuple\n\nclass ReZeroResidual(nn.Linear):\n\n def __init__(self, width):\n super().__init__(w... | [
[
"torch.nn.Sequential",
"torch.nn.init.orthogonal_",
"torch.nn.functional.relu",
"torch.zeros"
]
] |
MicrobialDarkMatter/GraphMB | [
"04d777953bb7e5e23ec445e3d956c11c120feaa1"
] | [
"src/graphmb/graph_functions.py"
] | [
"from pathlib import Path\nimport time\nimport os\nimport pdb\nimport itertools\nfrom collections import Counter\nimport networkx as nx\nimport numpy as np\nfrom tqdm import tqdm\nimport operator\nfrom vamb.cluster import cluster as vamb_cluster\nimport dgl\nimport random\n\nfrom graphmb.evaluate import read_contig... | [
[
"torch.device",
"numpy.array",
"sklearn.cluster.MiniBatchKMeans",
"sklearn.cluster.SpectralClustering",
"torch.is_tensor",
"numpy.random.seed",
"matplotlib.pyplot.savefig",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.legend",
"sklearn.cluster.Birch",
"matplotlib.pyplot... |
mou3adb/spread_the_particle | [
"6cc666fded62f07380ed1e3ed52969c436295906"
] | [
"scripts/text/text_particles.py"
] | [
"\"\"\"\nThe outfile structure is the following:\n\ndiameter density\nbirth lifetime\nis_captured stuck_to_geometry theta\n(blank line)\nRe Ur\n(blank line)\nn_trajectory\nx1 y1 up1 vp1 Uf1 Vf1 gradpx1 gradpy1 ap_x1 ap_y1 af_x1 af_y1\nx2 y2 up2 vp2 Uf2 Vf2 gradpx2 gradpy2 ap_x2 ap_y2 af_x2 af_y2\n...\nxNt yNt upNt ... | [
[
"numpy.array"
]
] |
XinhuiLi/PipelineHarmonization | [
"701f84841528d3e50c5538b2de244ee36eedd7d6"
] | [
"figure/s2/abcd.py"
] | [
"import os\nimport glob\nimport numpy as np\nimport nibabel as nb\nimport os\nimport scipy.io as sio\nfrom scipy.stats import pearsonr\n\nPH_SERVER_ROOT = os.environ.get('PH_SERVER_ROOT')\n\ndef zscore(data, axis):\n data -= data.mean(axis=axis, keepdims=True)\n data /= data.std(axis=axis, keepdims=True)\n ... | [
[
"numpy.dot",
"numpy.nan_to_num",
"numpy.genfromtxt",
"scipy.io.loadmat",
"numpy.loadtxt",
"numpy.sqrt",
"numpy.vstack"
]
] |
Adam1679/FET | [
"a7fc83ae22c7f15d84a80b9ebde9e67bf74ea988"
] | [
"models/fetentvecutils.py"
] | [
"import logging\nimport random\nfrom collections import defaultdict\n\nimport numpy as np\n\nfrom utils import datautils\n\n\nclass FETEntityVec:\n def get_entity_vecs(self, *input_args):\n raise NotImplementedError\n\n\nclass MentionFeat :\n @staticmethod\n def get_feat_set() :\n return {'al... | [
[
"numpy.random.uniform"
]
] |
nazcaspider/simple-3dviz | [
"3c40007259a1f754311623f74d24b06f7b98be14"
] | [
"simple_3dviz/behaviours/mouse.py"
] | [
"import numpy as np\nfrom pyrr import matrix33, vector\n\nfrom . import Behaviour\nfrom .trajectory import Circle\n\n\nclass MouseRotate(Behaviour):\n \"\"\"Rotate the camera based using the mouse when left button is pressed.\n\n We rotate the camera with the following convention. At any given point we\n c... | [
[
"numpy.cross"
]
] |
utegulovalmat/Mask_RCNN | [
"daa3b1d582e3ed95059b76071055c9e90ec513d0"
] | [
"mrcnn/model.py"
] | [
"\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict... | [
[
"tensorflow.exp",
"numpy.random.choice",
"tensorflow.image.non_max_suppression",
"numpy.copy",
"tensorflow.unique",
"tensorflow.reshape",
"numpy.where",
"tensorflow.sqrt",
"numpy.sort",
"tensorflow.stack",
"tensorflow.control_dependencies",
"numpy.broadcast_to",
... |
Acemyzoe/mnist-TensorRT | [
"df455542d1f889af755e08412b7fd81343cff2ff"
] | [
"mnist-tensorRT.py"
] | [
"#!/usr/bin/python\n# -*- coding:utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport tensorflow as tf\nimport time\nimport numpy\n\ndef mnist_model():\n mnist = tf.keras.datasets.mnist\n (x_train, y_train), (x_test, y_test) = mnist.load_data()\n x_train = x_tr... | [
[
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Dropout",
"tensorflow.experimental.tensorrt.Converter",
"tensorflow.keras.models.Sequential",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.saved_model.load"
]
] |
ZXLam/nnUNet | [
"0cf7c8a857c248d6be171e4945427b405f6ac258"
] | [
"nnunet/evaluation/evaluator.py"
] | [
"# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
[
"pandas.DataFrame",
"numpy.load",
"numpy.mean",
"numpy.nanmean",
"numpy.unique"
]
] |
PanJinquan/pytorch-base-trainer | [
"37799c948f72b2f9d3771ff469e06cdbff4a1d07"
] | [
"basetrainer/metric/eval_tools/acc.py"
] | [
"# -*-coding: utf-8 -*-\n\"\"\"\n @Project: python-learning-notes\n @File : acc.py\n @Author : panjq\n @E-mail : pan_jinquan@163.com\n @Date : 2019-07-12 18:22:29\n\"\"\"\n\nimport matplotlib\n\n# matplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nfrom sklearn import metrics\nimport numpy ... | [
[
"matplotlib.pyplot.xlim",
"numpy.asarray",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"sklearn.metrics.accuracy_score",
"numpy.where",
"matplotlib.pyplot.ylabel",
"matplotlib.p... |
Miki-lin/YOLOXR | [
"16eb48c76e97c36e4f53e40ee74115799238eea9"
] | [
"tools/demo_obb_kld.py"
] | [
"#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport argparse\nimport os\nimport time\nfrom loguru import logger\n\nimport cv2\n\nimport torch\n\nfrom yolox.data.data_augment import preproc\nfrom yolox.data.datasets import COCO_CLASSES\nfrom yolox.data.datasets... | [
[
"torch.no_grad",
"torch.load",
"torch.from_numpy"
]
] |
sumanth13131/COVID19-Pneumonia-Detection | [
"3bd4d0f8d4c115d14ed2237921e775bafae9642c"
] | [
"helper.py"
] | [
"# #Helper packages \nimport tensorflow as tf\nimport numpy as np\nimport cv2\n\n#decode the image\nimport base64\n\nclass Helper:\n def __init__(self) -> None:\n self.model = tf.keras.models.load_model('./models/Covid_Binary.h5')\n self.classes = ['COVID19 Pneumonia','Normal'] # covid== < 0.5 , n... | [
[
"tensorflow.keras.models.load_model",
"numpy.fromstring"
]
] |
huangxu96/Paddle | [
"5e59a8666ddde20867c6d976a3720f543b55bf83"
] | [
"python/paddle/fluid/framework.py"
] | [
"# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.array",
"numpy.dtype"
]
] |
tliu68/maggot_connectome | [
"ef4bbd2011fa9e03da187fcca8c8c1ca79209a36"
] | [
"pkg/pkg/graph/graph.py"
] | [
"from copy import deepcopy\n\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\n\nfrom ..utils import get_paired_inds, to_pandas_edgelist\n\n\nclass MaggotGraph:\n def __init__(self, g, nodes=None, edges=None):\n self.g = g\n # TODO add checks for when nodes/edges are passed, do they ... | [
[
"pandas.DataFrame",
"pandas.Series"
]
] |
kilianovski/bootcamp | [
"8f3a753592ecb931815fde068f6377485e3fbe79"
] | [
"solutions/video_similarity_search/object_detection/server/src/encode_resnet50.py"
] | [
"import numpy as np\nfrom tensorflow.keras.applications.resnet50 import ResNet50\nfrom tensorflow.keras.applications.resnet50 import preprocess_input as preprocess_input_resnet50\nfrom tensorflow.keras.preprocessing import image\nfrom numpy import linalg as LA\n\nclass CustomOperator:\n \"\"\"\n Say something... | [
[
"numpy.linalg.norm",
"tensorflow.keras.preprocessing.image.load_img",
"numpy.zeros",
"tensorflow.keras.applications.resnet50.preprocess_input",
"tensorflow.keras.applications.resnet50.ResNet50",
"tensorflow.keras.preprocessing.image.img_to_array",
"numpy.expand_dims"
]
] |
nishant34/RotSolver | [
"d50def173eed2ebc782d51942303ce5d91031f42"
] | [
"rotation_dataloader.py"
] | [
"import numpy as np\r\nimport os\r\n\r\n\r\nclass relative_camera_poses_data:\r\n \r\n \"\"\"\r\n Class to load relative rotations data for differentiable rotation averaging.\r\n THe data format should be as follows-->\r\n Root_dir\r\n | -rotations.npy --> relative rotations pairwise.\r\n | -tr... | [
[
"numpy.load",
"numpy.reshape"
]
] |
Engineero/tensorflow | [
"402d28705e426fea7aad6bbbe405a11daa6b6cd5"
] | [
"tensorflow/lite/python/util.py"
] | [
"# Lint as: python2, python3\n# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/... | [
[
"tensorflow.core.protobuf.config_pb2.ConfigProto",
"tensorflow.python.training.saver.export_meta_graph",
"tensorflow.lite.python.schema_util.get_builtin_code_from_operator_code",
"tensorflow.lite.python.schema_py_generated.QuantizationParametersT",
"tensorflow.lite.python.op_hint.convert_op_hi... |
xrick/Lcj-DSP-in-Python | [
"f27ee7036dc0df41b96e0b06ed13bb8fd874a714"
] | [
"dsp_python_imp/Ch04/sinusoid_wave.py"
] | [
"import numpy as np\nimport wave\nimport struct\n\nfile = \"sinusoid.wav\"\t\t# 檔案名稱\n\namplitude = 30000 # 振幅\nfrequency = 100\t\t\t\t# 頻率(Hz)\nduration = 3\t\t\t\t# 時間長度(秒)\nfs = 44100\t\t\t\t \t# 取樣頻率(Hz)\nnum_samples = duration * fs\t# 樣本數\n \nnum_channels = 1\t\t\t# 通道數\nsampwidth = 2\t\t\t\t# 樣本寬度... | [
[
"numpy.linspace",
"numpy.cos"
]
] |
ufz/ogs | [
"97d0249e0c578c3055730f4e9d994b9970885098"
] | [
"Tests/Data/Parabolic/T/3D_3BHEs_array_SimX/pre/3bhes.py"
] | [
"###\n# Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)\n# Distributed under a Modified BSD License.\n# See accompanying file LICENSE.txt or\n# http://www.opengeosys.org/project/license\n###\n\n# Execute this file to generate TESPy network csv files\nfrom tespy.networks import network\nfro... | [
[
"numpy.array"
]
] |
IzzatHalabi/newpix_prototype | [
"5d617ef20df59af57c26ca0f7fc8521afd4203f7"
] | [
"env/Lib/site-packages/mcdm/tests/test_load.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) 2020 Dimitrios-Georgios Akestoridis\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation... | [
[
"numpy.testing.assert_allclose",
"numpy.array"
]
] |
ml-in-programming/ml-on-source-code-models | [
"28f206afcda761320550cefdd53a3f89d206f82f",
"28f206afcda761320550cefdd53a3f89d206f82f"
] | [
"psob_authorship/reproduce_results/psobp_reproducibility/proof_of_work/iris_dataset_pytorch.py",
"psob_authorship/reproduce_results/psobp_reproducibility/proof_of_work/ackley.py"
] | [
"\"\"\"\nExample is taken from https://pyswarms.readthedocs.io/en/latest/examples/custom_objective_function.html\nComparison between my implementation of PSO and pyswarms is made on iris dataset.\nOptimizing PyTorch model.\nAssert is taken on absolute difference in final accuracy with 0.015 threshold.\nAlso for tra... | [
[
"torch.nn.Linear",
"torch.nn.Tanh",
"torch.FloatTensor",
"torch.LongTensor",
"torch.nn.CrossEntropyLoss",
"sklearn.datasets.load_iris"
],
[
"numpy.linalg.norm",
"numpy.zeros"
]
] |
pidan1231239/pytorch-template | [
"c68ae0019514e1ab59853ce552c8ec8603554d52"
] | [
"test.py"
] | [
"import argparse\nimport torch\nfrom tqdm import tqdm\nimport data_loader.data_loaders as module_data\nimport model.loss as module_loss\nimport model.metric as module_metric\nimport model.model as module_arch\nfrom parse_config import ConfigParser\n\n\ndef main(config):\n logger = config.get_logger('test')\n\n ... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.load",
"torch.nn.DataParallel"
]
] |
jabbar536/django_ML_model | [
"a85cfd68f906c799aa9085e740fed22063d37e2e"
] | [
"backend/server/apps/endpoints/views.py"
] | [
"# backend/server/apps/endpoints/views.py file\n\n# please add imports\nimport json\nfrom numpy.random import rand\nfrom rest_framework import views, status\nfrom rest_framework.response import Response\nfrom apps.ml.registry import MLRegistry\nfrom server.wsgi import registry\n\nfrom rest_framework import viewsets... | [
[
"numpy.random.rand"
]
] |
chelokot/ProjectedGAN-pytorch | [
"9b56e471d7abeaf9523655a31c77f7473b3830b0"
] | [
"dataset.py"
] | [
"import torch\r\nfrom torchvision import transforms, datasets\r\n\r\n\r\ndef load_data(data_path, batch_size):\r\n train_transforms = transforms.Compose([transforms.RandomRotation(30),\r\n transforms.Resize((256, 256)),\r\n trans... | [
[
"torch.utils.data.DataLoader"
]
] |
KailinTong/Algorithms-Design-and-Analysis | [
"786def6bdab0025ee037c0c5e16f0873e23c9134"
] | [
"Part_2/Homework_3/knapsack.py"
] | [
"import numpy as np\nimport sys\nsys.setrecursionlimit(10000)\n\nclass Knapsack:\n def __init__(self, txt_name):\n self.size = 0\n self.num_items = 0\n self.items = [(0, 0)] # (value, weight)\n self.array = np.array([])\n self.read_txt(txt_name)\n self.cache = {}\n ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
brandongk/segmenter | [
"dbc042d31dc74f1abdc87ae10a6be78ba38ddb91"
] | [
"segmenter/evaluators/PredictEvaluator.py"
] | [
"from tensorflow.keras import backend as K\nfrom segmenter.evaluators.ThresholdAwareEvaluator import ThresholdAwareEvaluator\nimport numpy as np\nimport os\n\n\nclass PredictEvaluator(ThresholdAwareEvaluator):\n def evaluate_threshold(self, model, threshold, outdir):\n for batch, (images, masks) in enumer... | [
[
"numpy.where",
"numpy.savez_compressed"
]
] |
matiaslindgren/ghht | [
"1e310a3573730dd546551fa3003e2403f6fd71ef"
] | [
"ghht/__main__.py"
] | [
"from argparse import ArgumentParser\nfrom collections import defaultdict\nfrom datetime import datetime\nfrom tempfile import mkstemp\nimport os.path\n\nimport fontTools.ttx\nimport numpy as np\n\nimport ghht\n\n\ndef parse_date(d):\n return datetime.datetime.strptime(d, \"%Y-%m-%d\")\n\n\ndef _main(sink, text,... | [
[
"numpy.zeros"
]
] |
joordamn/CellESignal | [
"ecf487d07d35f134d4537d7c99c7fa0582221e68"
] | [
"bin/matlab_label_convert.py"
] | [
"# -*- encoding: utf-8 -*-\n'''\n-------------------------\n@File : matlab_label_convert.py\n@Time : 2022/01/24 15:36:12\n@Author : Zhongning Jiang \n@Contact : zhonjiang8-c@my.cityu.edu.hk\n@Desc : 此脚本用于转换matlab导出的标签txt\n-------------------------\n'''\n\nimport os, sys, shutil\n# sys.path.appen... | [
[
"matplotlib.pyplot.clf",
"numpy.random.randint",
"matplotlib.pyplot.figure"
]
] |
tacaswell/pyFAI | [
"fd63c7d9ba35e687ef5c4ec717c01bf46564572a",
"fd63c7d9ba35e687ef5c4ec717c01bf46564572a",
"fd63c7d9ba35e687ef5c4ec717c01bf46564572a"
] | [
"pyFAI/io/ponifile.py",
"pyFAI/test/test_utils_header.py",
"pyFAI/utils/mathutil.py"
] | [
"# coding: utf-8\n#\n# Project: Azimuthal integration\n# https://github.com/silx-kit/pyFAI\n#\n# Copyright (C) 2015-2021 European Synchrotron Radiation Facility, Grenoble, France\n#\n# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)\n#\n# Permission is hereby granted, free of ch... | [
[
"numpy.isreal"
],
[
"numpy.array"
],
[
"numpy.fft.fft2",
"scipy.ndimage.filters.gaussian_filter",
"numpy.exp",
"numpy.finfo",
"numpy.where",
"numpy.sort",
"numpy.outer",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.empty",
"numpy.add.reduce",
"num... |
VieZhong/pointer-generator-keyphrase | [
"b529d416a0e679411c1a0fac5da46d5f1e63341f"
] | [
"run_summarization.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n# Modifications Copyright 2017 Abigail See\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.apach... | [
[
"tensorflow.global_variables_initializer",
"tensorflow.Summary",
"tensorflow.set_random_seed",
"tensorflow.train.Saver",
"tensorflow.logging.info",
"tensorflow.global_variables",
"tensorflow.python.debug.LocalCLIDebugWrapperSession",
"numpy.asscalar",
"numpy.isfinite",
"ten... |
voxl-ai/u2net | [
"612d6f07b16e3def38515a59cc47a6189f080ffd"
] | [
"u2net_test.py"
] | [
"import os\nfrom skimage import io, transform\nimport torch\nimport torchvision\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms # , utils\n\n# import torch.optim as optim\n\nimport num... | [
[
"numpy.array",
"torch.min",
"torch.max",
"torch.autograd.Variable",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
artjoms-formulevics/Hip-Hop-Analytics | [
"346a313871eb686435ee1d5c6ae9028f7725c5e4"
] | [
"helper_functions.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jan 3 22:36:21 2021\n\n@author: afo\n\"\"\"\n\nimport pandas as pd\nimport json\nfrom os.path import isfile, join\nfrom os import listdir\n\n# Function to get all the json file names in 3 subdirectories of given rapper - albums, eps, mixtapes... | [
[
"pandas.read_csv",
"pandas.to_numeric"
]
] |
yseokchoi/KMAwithBERTs | [
"72000c620c227f11d3c2cd041b67398c481ac1ae"
] | [
"optimizers.py"
] | [
"import torch\nimport torch.optim as optim\nfrom torch.nn.utils import clip_grad_norm_\n\nfrom math import sqrt\nimport functools\n\n\ndef build_torch_optimizer_for_bert(model, opt):\n \"\"\"\n no_decay = [\"bias\", \"LayerNorm.weight\"]\n encoder_params = [\n {\n \"params\": [p f... | [
[
"torch.optim.Adagrad",
"torch.nn.utils.clip_grad_norm_",
"torch.optim.optimizer.state_dict",
"torch.optim.SGD",
"torch.optim.Adam",
"torch.optim.Adadelta"
]
] |
breisfeld/pandas | [
"f1fd50bb8e7603042fe93e01e862766673e33450"
] | [
"pandas/tests/test_reshape.py"
] | [
"from pandas import DataFrame\n\nimport numpy as np\n\nfrom pandas.core.reshape import melt, convert_dummies\nimport pandas.util.testing as tm\n\ndef test_melt():\n df = tm.makeTimeDataFrame()[:10]\n df['id1'] = (df['A'] > 0).astype(int)\n df['id2'] = (df['B'] > 0).astype(int)\n\n molten1 = melt(df)\n ... | [
[
"pandas.core.reshape.melt",
"pandas.util.testing.assert_frame_equal",
"pandas.util.testing.makeTimeDataFrame",
"pandas.DataFrame",
"numpy.random.randn",
"pandas.core.reshape.convert_dummies"
]
] |
nlapier2/MiniScrub | [
"2fb70c85a3737ac13d3db8346a12f31e5cb07534"
] | [
"pileup.py"
] | [
"import argparse, gc, gzip, multiprocessing, random, sys, time, traceback\nimport numpy as np\nimport scipy.misc\n\n\nstart = time.time()\n\n\ndef echo(msg):\n\tglobal start\n\tseconds = time.time() - start\n\tm, s = divmod(seconds, 60)\n\th, m = divmod(m, 60)\n\thms = \"%02d:%02d:%02d\" % (h, m, s)\n\tprint('['+hm... | [
[
"numpy.array",
"numpy.mean"
]
] |
ian-katsuno/chainer-fast-neuralstyle | [
"9a05d7838a539d01dab396e7693b085d828e80ae"
] | [
"train.py"
] | [
"from __future__ import print_function, division\nimport numpy as np\nimport os, re\nimport argparse\nfrom PIL import Image\n\nfrom chainer import cuda, Variable, optimizers, serializers\nfrom net import *\n\ndef load_image(path, size):\n image = Image.open(path).convert('RGB')\n w,h = image.size\n if w < ... | [
[
"numpy.float32"
]
] |
TGarfield17/FIRESONG | [
"ad9e3688ed88563cfdb81b9f25aaa63850cc99f9"
] | [
"firesong/Legend.py"
] | [
"#!/usr/bin/python\n# Authors: Chris Tung\n# Ignacio Taboada\n#\n\n\"\"\"Example script that simulates a population of sources with a luminosity\n distribution that is dependent on redshift\"\"\"\n\n# General imports\n# from __future__ import division\nimport argparse\n# Numpy / Scipy\nimport numpy as n... | [
[
"numpy.array",
"numpy.random.RandomState",
"numpy.arcsin",
"numpy.sum",
"numpy.arange",
"numpy.ndim"
]
] |
pzzhang/ASL | [
"156d5986d74099e0941139e2699d44381d924e6c"
] | [
"infer.py"
] | [
"import torch\nfrom src.helper_functions.helper_functions import parse_args\nfrom src.loss_functions.losses import AsymmetricLoss, AsymmetricLossOptimized\nfrom src.models import create_model\nimport argparse\nimport matplotlib\n\n# matplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nim... | [
[
"numpy.array",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"torch.unsqueeze",
"torch.from_numpy",
"torch.load",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
JessevanKempen/nutils | [
"a10ae3ca9f71b81ac5d64179555ef2cddf6658da"
] | [
"examples/platewithhole-nurbs.py"
] | [
"#!/usr/bin/env python3\n#\n# In this script we solve the same infinite plane strain problem as in\n# :ref:`examples/platewithhole.py`, but instead of using FCM to create the hole\n# we use a NURBS-based mapping. A detailed description of the testcase can be\n# found in Hughes et al., `Isogeometric analysis: CAD, f... | [
[
"numpy.ones",
"numpy.nanmin",
"numpy.take",
"numpy.sqrt",
"numpy.nanmax"
]
] |
ebouteillon/advent-of-code-2021 | [
"dd433af29a6a377f2890d041f0d004e56704e3c0"
] | [
"day-05/part1.py"
] | [
"\"\"\"https://adventofcode.com/2021/day/5\"\"\"\n\nimport numpy as np\n\ndata = open(\"day-05/input.txt\").read().splitlines()\ndata = [x.replace(' -> ', ',').split(',') for x in data]\ndata = [list(map(int, x)) for x in data]\n\nsize = max(max(x) for x in data) + 1\ndiagram = np.zeros((size, size), dtype=int)\n\n... | [
[
"numpy.sum",
"numpy.zeros"
]
] |
HenryKenlay/graph_adversarial_attack | [
"5282d1269aa637ecafb0af239c53fa8396e5ef66"
] | [
"code/data_generator/gen_er_components.py"
] | [
"import sys\nimport cPickle as cp\nimport random\nimport numpy as np\nimport networkx as nx\nfrom tqdm import tqdm\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--save_dir', help='Save directory.')\nparser.add_argument('--max_n', type=int, help='Upper bound on graph size.')\nparser.ad... | [
[
"numpy.random.randint"
]
] |
johnlime/cleanrl | [
"66f6f8ba12a559a812dc77aaa8f41e09ccd6f800"
] | [
"cleanrl/experiments/vdqn_atari.py"
] | [
"# https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py\n\nimport numpy as np\nfrom collections import deque\nimport gym\nfrom gym import spaces\nimport cv2\ncv2.ocl.setUseOpenCL(False)\n\n\nclass NoopResetEnv(gym.Wrapper):\n def __init__(self, env, noop_max=30):\n \"\... | [
[
"torch.nn.Linear",
"numpy.sign",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.where",
"numpy.concatenate",
"torch.manual_seed",
"torch.randint",
"numpy.transpose",
"torch.Tensor",
"torch.utils.tensorboard.SummaryWriter",
"numpy.expand_dims",
"torch.nn.F... |
TOPO-EPFL/DDLoc | [
"120eaf0de08609d10b17ceb3a78523d062040924"
] | [
"training/train_initial_coord_regressor_C.py"
] | [
"import os, time, sys\nimport math\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler \nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nimport torchvision\nfrom torchvision import datasets,... | [
[
"torch.nonzero",
"torch.cat",
"torch.sqrt",
"torch.norm",
"torch.bmm",
"torch.nn.L1Loss",
"torch.logical_not",
"torch.eye",
"torch.set_grad_enabled",
"torch.sum"
]
] |
DongChengdongHangZhou/csv_read_write | [
"e83dc84cc3ee38e1da73367903fec01a0a632b01"
] | [
"csvWriter.py"
] | [
"import csv\r\nimport torch\r\nimport numpy as np\r\nimport tifffile as tiff\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\nfrom azimuth_integral import GetPSD1D\r\n\r\ndef write_csv():\r\n f = open('fake_fingerprint.csv','w',newline='')\r\n f_mean = open('mean_fake_fingerprint.csv','w',newline=... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.plot",
"numpy.exp",
"torch.log",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
albwrekt/housing_median_cost_prediction | [
"46e96fabf381978cd3074117a46696dfbddd621a"
] | [
"netflix_demo.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 23 21:26:42 2020\n\n@author: albwrekt\n\"\"\"\n\nimport os\nimport pandas as pd\nimport numpy as np\nfrom pandas.plotting import scatter_matrix\n\n\n# this dataset will be used to predict the rating of the movie\n\nDATA_PATH = \"../../arch... | [
[
"pandas.read_csv",
"pandas.plotting.scatter_matrix"
]
] |
pranaysy/neurodsp | [
"4236a32335af561f0e10b591b1aecfd7719aec59"
] | [
"neurodsp/burst/dualthresh.py"
] | [
"\"\"\"The dual threshold algorithm for detecting oscillatory bursts in a neural signal.\"\"\"\n\nimport numpy as np\n\nfrom neurodsp.utils.core import get_avg_func\nfrom neurodsp.utils.checks import check_param_options\nfrom neurodsp.utils.decorators import multidim\nfrom neurodsp.timefrequency.hilbert import amp_... | [
[
"numpy.ceil",
"numpy.sum",
"numpy.diff",
"numpy.where",
"numpy.insert"
]
] |
DancunManyinsa/netbot | [
"625349e785103eb318dd3302cb5672bf64a410f1"
] | [
"scripts/plot.py"
] | [
"#!/usr/bin/env python3.6\n\n\nimport os\nimport sys\nfrom datetime import datetime\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n\ndef csv_path():\n return os.path.join(os.path.dirname(__file__), os.path.pardir, \"data\", \"metrics.csv\")\n\ndef main():\n last = int(sys.argv[... | [
[
"matplotlib.pyplot.show",
"numpy.mean",
"matplotlib.pyplot.subplots"
]
] |
alex-simm/c3 | [
"9e36fb04ebdaca2ba59134d7d1775fd6a5b174f0"
] | [
"test/test_two_qubits.py"
] | [
"\"\"\"\nintegration testing module for C1 optimization through two-qubits example\n\"\"\"\n\nimport os\nimport tempfile\nimport copy\nimport pickle\nimport numpy as np\nimport pytest\nfrom numpy.testing import assert_array_almost_equal as almost_equal\n\n# Main C3 objects\nfrom c3.c3objs import Quantity as Qty\nfr... | [
[
"numpy.testing.assert_array_almost_equal",
"numpy.testing.assert_allclose",
"numpy.array"
]
] |
stanton119/data-analysis | [
"b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9"
] | [
"TimeSeries/not_finished/other/cnn.py"
] | [
"# %%\nimport numpy as np\nimport pandas as pd\nfrom time import process_time, time\nfrom sklearn.preprocessing import StandardScaler\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nimport utilities\nimport data\n\nplt.style.use(\"seaborn-whitegrid\")\n\n\n# %% Generate data\n# df = utilities.gen_ar_data... | [
[
"tensorflow.keras.layers.Conv1D",
"sklearn.preprocessing.StandardScaler",
"tensorflow.keras.layers.Flatten",
"pandas.DataFrame",
"tensorflow.optimizers.Adam",
"matplotlib.pyplot.plot",
"tensorflow.keras.layers.MaxPooling1D",
"tensorflow.keras.Sequential",
"tensorflow.keras.laye... |
akutta/hercules | [
"7fa89e8ac079ec8863675474009a1549d964dae6"
] | [
"swivel.py"
] | [
"#!/usr/bin/env python3\n#\n# Copyright 2016 Google Inc. All Rights Reserved.\n# Copyright 2017 Sourced Technologies S. L.\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# ... | [
[
"tensorflow.train.start_queue_runners",
"tensorflow.group",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.contrib.tensorboard.plugins.projector.ProjectorConfig",
"tensorflow.nn.embedding_lookup",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow... |
SumeetSinha/Signal_Analysis | [
"f8d3a6f81969b7512e2db1980f5cf8b782bc3eb3"
] | [
"Seismic_Motion.py"
] | [
"__author__ = \"Sumeet K. Sinha\"\r\n__credits__ = [\"\"]\r\n__license__ = \"GPL\"\r\n__version__ = \"2.0\"\r\n__maintainer__ = \"Sumeet K. Sinha\"\r\n__email__ = \"sumeet.kumar507@gmail.com\"\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport scipy.fftpack\r\nfrom scipy import integrate\r\nimpo... | [
[
"matplotlib.pyplot.xlim",
"numpy.absolute",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"scipy.integrate.cumtrapz",
"numpy.power",
"matplotlib.pyplot.ylabel",
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
lipovsek/avalanche | [
"1f06502b12140b39f48adf5a5f3b5de8ec2a930b"
] | [
"tests/test_avalanche_dataset.py"
] | [
"import unittest\n\nfrom os.path import expanduser\n\nimport avalanche\nfrom avalanche.benchmarks.datasets import default_dataset_location\nfrom avalanche.models import SimpleMLP\nfrom torch.optim import SGD\nfrom torch.nn import CrossEntropyLoss\nfrom avalanche.training.supervised import Naive\nfrom avalanche.benc... | [
[
"torch.utils.data.ConcatDataset",
"torch.cat",
"torch.stack",
"torch.ones",
"torch.nn.CrossEntropyLoss",
"torch.randint",
"torch.tensor",
"torch.as_tensor",
"torch.equal",
"torch.zeros",
"torch.min",
"torch.max",
"torch.full",
"torch.utils.data.TensorDataset... |
luiscameroo/soccer-matlab | [
"e6b0a0f722bda30b4b1c6298998508653be318e8"
] | [
"soccer-rl/pybullet/gym/pybullet_envs/ARS/shared_noise.py"
] | [
"\"\"\"\nCode in this file is copied and adapted from\nhttps://github.com/ray-project/ray/tree/master/python/ray/rllib/es\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport numpy as np\n\n\ndef create_shared_noise():\n \"\"\"\n Cre... | [
[
"numpy.random.RandomState"
]
] |
danielhanchen/hiperlearn | [
"7e2d7735bcb40854462decd5e5c8d70afd90aede"
] | [
"hyperlearn/decomposition/NMF.py"
] | [
"\nfrom ..numba import _min, _max, maximum, minimum, norm, njit, prange, squaresum\nfrom numpy import zeros, float32, float64\nfrom ..utils import _float, reflect, _XTX, _XXT\nfrom ..big_data.randomized import randomizedSVD\nfrom ..solvers import solveCholesky\n\n\ndef intialize_NMF(X, n_components = 2, eps = 1e-6,... | [
[
"numpy.zeros"
]
] |
ozercevikaslan/MyMLWorkSpace | [
"973d8fa04bed7503c3e3061ac02a4d6022a92e61"
] | [
"HouseSalePricesRegression.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndataset = pd.read_csv('kc_house_data.csv')\n\ndataset.drop('zipcode', axis=1, inplace=True)\ndataset.drop('lat', axis=1, inplace=True)\ndataset.drop('long', axis=1, inplace=True)\n\nX = dataset.iloc[:, 3:18].values\n\ny = dataset.iloc[:, 2... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"sklearn.ensemble.RandomForestRegressor",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.scatter",
"pandas.read_csv"
]
] |
OlavH96/Master | [
"f98476063e579b7b2a80b81a2c0ca4005f5fce80"
] | [
"src/sign_detection/image_generation/create_records.py"
] | [
"import configparser\nimport os\nfrom pathlib import Path\n\nimport pandas as pd\nimport tensorflow as tf\n\nfrom object_detection.utils import dataset_util\n\nroot_dir = Path.cwd()\n\nconfig = configparser.ConfigParser()\nconfig.read(root_dir / 'config.ini')\n\nsize_x = int(config['Model']['size_g... | [
[
"tensorflow.app.run",
"pandas.read_csv",
"tensorflow.python_io.TFRecordWriter"
]
] |
opti-mix/glow | [
"4ba074df5da9822986a23a6679ab592c22660f6d"
] | [
"torch_glow/tests/nodes/addmm_test.py"
] | [
"from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport torch\nfrom tests import utils\n\n\nclass SimpleAddMmModule(torch.nn.Module):\n def __init__(self, alpha=1, beta=1):\n super(SimpleAddMmModule, self).__init__()\n self.alpha = alpha\n self.beta = be... | [
[
"torch.randn"
]
] |
yuxuan1995liu/darkflowyolo_detection | [
"a7807e9b85833e3f877d46bb60e8fa7d0596a10b",
"f4eb40b5ca3f49dfc929ff3ad2b4bb877e9663e2"
] | [
"venv/lib/python3.6/site-packages/tensorflow/python/ops/gen_stateless_random_ops.py",
"venv/lib/python3.6/site-packages/tensorboard/plugins/projector/projector_plugin.py"
] | [
"\"\"\"Python wrappers around TensorFlow ops.\n\nThis file is MACHINE GENERATED! Do not edit.\nOriginal C++ source file: stateless_random_ops.cc\n\"\"\"\n\nimport collections as _collections\nimport six as _six\n\nfrom tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow\nfrom tensorflow.python.eager im... | [
[
"tensorflow.python.eager.execute.make_type",
"tensorflow.python.eager.context.context",
"tensorflow.python.eager.execute.args_to_matching_eager",
"tensorflow.python.eager.execute.execute",
"tensorflow.python.framework.ops.convert_to_tensor",
"tensorflow.python.eager.execute.record_gradient... |
Refinitiv-API-Samples/Examples.RDPLibrary.Python.July2020Webinar | [
"53fad3d2632d503cd5526a0118c9b4c4dcac09af"
] | [
"DashStreaming.py"
] | [
"import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport dash_table as dte\nimport pandas as pd\nimport plotly\nimport plotly.graph_objs as go\nfrom dash.dependencies import Output, Input\n\nimport refinitiv.dataplatform as rdp\nimport configparser as cp\n\nglobal esg_df, tick_l... | [
[
"pandas.to_numeric"
]
] |
liaorongfan/center_net | [
"4d2f8219332b5c22094b8e90dd8e2f51c9d9605b"
] | [
"FPS_test.py"
] | [
"import colorsys\nimport os\nimport pickle\n\nimport cv2\nimport numpy as np\nimport torch\nfrom PIL import Image, ImageDraw, ImageFont\nfrom torch import nn\nfrom torch.autograd import Variable\nfrom tqdm import tqdm\n\nfrom centernet import CenterNet\nfrom nets.centernet import CenterNet_HourglassNet, CenterNet_R... | [
[
"numpy.array",
"numpy.asarray",
"torch.no_grad",
"numpy.shape",
"numpy.float32",
"numpy.expand_dims"
]
] |
proux01/rupicola | [
"60180c1975f678443b02742e812dc183cf01631d"
] | [
"src/Rupicola/Examples/plot.py"
] | [
"#!/usr/bin/python3\n\nimport pandas, seaborn, matplotlib.pyplot\nimport latest_benchmark_results\n\nBENCHMARK_ALIASES = [\n ('crc32', 'crc32'),\n ('utf8_decode', 'utf8'),\n ('murmur3', 'm3s'),\n ('upstr', 'upstr'),\n ('ip_checksum', 'ip'),\n ('revcomp', 'fasta'),\n ('fnv1a64', 'fnv1a'),\n]\n\n... | [
[
"pandas.DataFrame"
]
] |
DEVESHTARASIA/pyro | [
"7fce5508fe4f15a1a65a267e8d6df3aeead1a3ec",
"7fce5508fe4f15a1a65a267e8d6df3aeead1a3ec"
] | [
"tests/distributions/test_categorical.py",
"pyro/contrib/gp/kernels/rbf.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nfrom unittest import TestCase\n\nimport numpy as np\nimport pytest\nimport scipy.stats as sp\nimport torch\nfrom torch.autograd import Variable\n\nimport pyro.distributions as dist\nfrom tests.common import assert_equal\n\n\nclass TestCategorical(... | [
[
"numpy.array",
"numpy.log",
"torch.ones",
"torch.Tensor",
"numpy.unique"
],
[
"torch.ones",
"torch.exp",
"torch.nn.Parameter"
]
] |
Learning-and-Intelligent-Systems/LISdf | [
"55faac02bfa462d5ae665b703305fc265feb8e0c"
] | [
"tests/test_planner_output/test_command.py"
] | [
"from dataclasses import dataclass\nfrom typing import Dict, List\n\nimport numpy as np\nimport pytest\n\nfrom lisdf.planner_output.command import (\n ActuateGripper,\n Command,\n GripperPosition,\n JointName,\n JointSpacePath,\n)\n\n\n@dataclass(frozen=True)\nclass _ConcreteCommand(Command, type=\"_... | [
[
"numpy.array",
"numpy.flip"
]
] |
qxde01/-gastric-cancer-detect | [
"9f2ffb1e0cee4b4c305609fc0a69e557571d197a"
] | [
"models/Unet.py"
] | [
"from tensorflow import keras\n#https://github.com/zhixuhao/unet\n\ndef conv_block(inputs, filters, kernel_size, strides, padding='same'):\n Z = keras.layers.Conv2D(filters, kernel_size, strides=strides, padding=padding, use_bias=False)(inputs)\n Z = keras.layers.BatchNormalization(axis=-1)(Z)\n A = keras.... | [
[
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.UpSampling2D",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.PReLU",
"tensorflow.keras.layers.BatchNorm... |
Rmloong/movie-revenue-predictor | [
"702e16aec92ac13f47f655950e63bdacf1783200"
] | [
"src/model.py"
] | [
"\n\"\"\"\nModule that fits the model and stores it (joblib)\nin a pickle file.\nWhen run as a module, this will load a csv dataset,\ntrain a RF regression model, and then pickle the\nresulting model object to disk.\n\nNote: The parameters for the RF model were selected\nbased upon GridSearchCV exploration in jupyt... | [
[
"pandas.read_csv",
"sklearn.ensemble.RandomForestRegressor",
"sklearn.externals.joblib.dump"
]
] |
lizhaoliu-Lec/QANet_dureader | [
"439ba57f98e330d98de393d3ad879b7fd0e3fc29"
] | [
"dataloader.py"
] | [
"# -*- coding:utf8 -*-\n\nimport json\nimport logging\nimport numpy as np\nfrom collections import Counter\nimport jieba\n\n\ndef word_tokenize(sent):\n if isinstance(sent, list):\n tokens = sent\n else:\n tokens = jieba.lcut(sent)\n return [token for token in tokens if len(token) >= 1]\n\n\n... | [
[
"numpy.arange",
"numpy.random.shuffle"
]
] |
dubey/tensorflow | [
"2783e5925d83b3a333e416d1601f9fbeaa645520"
] | [
"tensorflow/lite/python/lite_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.ops.variable_scope.get_variable",
"tensorflow.python.ops.math_ops.matmul",
"tensorflow.python.ops.array_ops.ones",
"tensorflow.python.keras.layers.Dense",
"tensorflow.python.eager.context.executing_eagerly",
"tensorflow.lit... |
mcwimm/pyMANGA | [
"6c7b53087e53b116bb02f91c33974f3dfd9a46de"
] | [
"TreeModelLib/GrowthAndDeathDynamics/Mortality/RandomGrowth/RandomGrowth.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@date: 2021-Today\n@author: marie-christin.wimmler@tu-dresden.de\n\"\"\"\n\nimport numpy as np\nfrom TreeModelLib.GrowthAndDeathDynamics.Mortality.Random import Random\n\n\nclass RandomGrowth(Random):\n def __init__(self, args, case):\n super(Rando... | [
[
"numpy.random.uniform"
]
] |
jmniederle/misgan | [
"8ac447bbc1fceaec15664eae00137d9804a45936"
] | [
"src/celeba_misgan_impute.py"
] | [
"import torch\nimport torch.nn as nn\nfrom datetime import datetime\nfrom pathlib import Path\nimport argparse\nfrom celeba_generator import ConvDataGenerator, ConvMaskGenerator\nfrom celeba_critic import ConvCritic\nfrom masked_celeba import BlockMaskedCelebA, IndepMaskedCelebA\nfrom imputer import UNetImputer\nfr... | [
[
"torch.device",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.cuda.device_count"
]
] |
uiuc-arc/gpytorch | [
"8a520be2a4c877e87a36bb5f1e6a8565f337c1c7"
] | [
"gpytorch/models/exact_gp.py"
] | [
"#!/usr/bin/env python3\n\nimport warnings\nfrom copy import deepcopy\n\nimport torch\n\nfrom .. import settings\nfrom ..distributions import MultivariateNormal\nfrom ..likelihoods import _GaussianLikelihoodBase\nfrom ..utils.broadcasting import _mul_broadcast_shape\nfrom ..utils.warnings import GPInputWarning\nfro... | [
[
"torch.is_tensor",
"torch.cat",
"torch.equal",
"torch.Size"
]
] |
dermida/openpilot | [
"7aec87896ec53a536af5cec97548b5d66c49fbda"
] | [
"selfdrive/car/volkswagen/carstate.py"
] | [
"import numpy as np\nfrom cereal import car\nfrom selfdrive.config import Conversions as CV\nfrom selfdrive.car.interfaces import CarStateBase\nfrom opendbc.can.parser import CANParser\nfrom opendbc.can.can_define import CANDefine\nfrom selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, NetworkLocation, Tran... | [
[
"numpy.mean"
]
] |
sanghoon/Higher-HRNet-Human-Pose-Estimation | [
"f6f24a3eec9ac82ca18edd1e22de62f6f201caea"
] | [
"tools/dist_train.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# -------------------------------------------------------------------------... | [
[
"torch.rand",
"torch.distributed.init_process_group",
"torch.multiprocessing.spawn",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.device_count",
"torch.optim.lr_scheduler.MultiStepLR",
"torch.cuda.set_device",
"torch.load",
"torch.nn.DataParallel"
]
] |
HannahElisa/RegRCNN | [
"1aa69d00c61bd36685213248bb30d4ba30ac5a06"
] | [
"exec.py"
] | [
"#!/usr/bin/env python\n# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ).\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://... | [
[
"torch.cuda.empty_cache",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.no_grad"
]
] |
superlich7/FasterRcnnTF_ICPR2018 | [
"7ab0bad4df1e772bb8cece55a1c83b0bb1804a3b"
] | [
"lib/model/test.py"
] | [
"# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __fu... | [
[
"numpy.max",
"numpy.array",
"numpy.reshape",
"numpy.minimum",
"numpy.random.seed",
"numpy.round",
"numpy.tile",
"numpy.min",
"numpy.where",
"numpy.sort",
"numpy.hstack",
"numpy.maximum"
]
] |
bala-office/fdic-data-warehouse | [
"b8d34ef9ffa0123d7c42f1b27e2f683211a6cd55"
] | [
"data_extraction.py"
] | [
"import pandas as pd\nimport numpy as np\n\npd.set_option(\"max_rows\", 25)\npd.set_option(\"max_columns\", 80)\n\n# reading in the 5 FDIC csv files and assigning them to dictionary keys. \ncolumns = [\n \"ADDRESBR\", \n \"ADDRESS\", \n \"ASSET\",\n \"BKCLASS\", \n \"BKMO\", \n \"BRCENM\",\n \... | [
[
"pandas.set_option"
]
] |
YANGZ001/OrganicChem-LabMate-AI | [
"fb826d85dd852aab987b9bef6856d8da6a4bd9be"
] | [
"continuous-variables/literature-code-in-python/Manuscript/LabMate-AI-balanced.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import KFold\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.externals.joblib import dump\n\n#load data\nfilename = 'train_data.txt'\ntrain = pd.read_csv(filename, sep= '\\t')\n... | [
[
"numpy.max",
"numpy.savetxt",
"sklearn.model_selection.GridSearchCV",
"pandas.DataFrame",
"sklearn.externals.joblib.dump",
"numpy.ndarray.tolist",
"numpy.arange",
"sklearn.ensemble.RandomForestRegressor",
"pandas.concat",
"sklearn.model_selection.KFold",
"pandas.read_cs... |
cornhundred/clustergrammer-glidget | [
"14b622ea91e236bee08c47b91caf12178f97aa8b"
] | [
"examples/himc_helper_functions_v0_17_1.py"
] | [
"# Version: 0.17.1\n# This is a set of scripts that are used in processing 10x single cell data\n# improved dehsahing pipeline\n\nimport gzip\nfrom scipy import io\nfrom scipy.sparse import csc_matrix\nfrom ast import literal_eval as make_tuple\nimport pandas as pd\nimport numpy as np\nfrom copy import deepcopy\nim... | [
[
"pandas.read_parquet",
"numpy.random.rand",
"numpy.asarray",
"sklearn.preprocessing.StandardScaler",
"numpy.random.seed",
"pandas.DataFrame",
"matplotlib.pyplot.ylim",
"scipy.io.mmread",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.hist",
"numpy.sinh",
"numpy.sq... |
edinburgh-university-OOSA/env_geog | [
"7e442a4ac26e67515ebd48160f99ae97bd61be61"
] | [
"prep_data/week1/makeGround.py"
] | [
"'''\nScript to generate ground data\nProduces field tree data for\nuse in week 1's exercise\n'''\n\n\n#########################################\n\nimport argparse\nimport numpy as np\nfrom math import exp\n\n#########################################\n\nif __name__==\"__main__\":\n def readCommands():\n '''\n ... | [
[
"numpy.array",
"numpy.empty",
"numpy.random.poisson",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.random.random"
]
] |
kayzhu/keras-tuner | [
"32240940cd5814a905aadf8e646497649cbbb046"
] | [
"keras_tuner/applications/augment.py"
] | [
"# Copyright 2020 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.shape",
"tensorflow.keras.layers.Input",
"tensorflow.equal",
"tensorflow.keras.layers.experimental.preprocessing.RandomTranslation",
"tensorflow.keras.Model",
"tensorflow.keras.utils.get_source_inputs"
]
] |
HarshCasper/FinMind | [
"7b7571e443525edcd52c7f53e7fb0daca42b1f60"
] | [
"tests/BackTestSystem/test_utils.py"
] | [
"import datetime\n\nimport pandas as pd\nimport pytest\n\nfrom FinMind.BackTestSystem.utils import (\n get_asset_underlying_type,\n get_underlying_trading_tax,\n calculate_Datenbr,\n calculate_sharp_ratio,\n convert_Return2Annual,\n convert_period_days2years,\n)\n\ntestdata_get_asset_underlying_ty... | [
[
"pandas.DataFrame"
]
] |
vladchimescu/bioimg-py3 | [
"f40b4747157fb4203ebb9ddebc29f742bc128689"
] | [
"bioimg/base/plot.py"
] | [
"#!/usr/env/bin python3\n\"\"\"\nFunctions and classes for static plots\n\"\"\"\nimport matplotlib.pyplot as plt\nfrom skimage import color\nimport numpy as np\nimport matplotlib.colors as mcolors\n\ncolor_dict = {'red': 0, 'orange': 0.1,\n 'yellow': 0.16, 'green': 0.3,\n 'cyan': 0.5, 'blu... | [
[
"matplotlib.colors.ColorConverter",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.Rectangle",
"matplotlib.colors.LinearSegmentedColormap",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplo... |
viadee/xair | [
"557534b022a6ff90b3fb5d50d0592bf73187644a"
] | [
"xai_xps/src/Utils.py"
] | [
"import json\nimport logging\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport skfuzzy as fuzz\nimport sys\nfrom cerberus import Validator\nfrom types import SimpleNamespace\n\nCONFIG_FILE = \"./resources/config/config.json\"\nANTE_CONFIG_FILE = \"./resources/config/antecedent_config... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.vlines",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
BrianPugh/pugh_torch | [
"d620a518d78ec03556c5089bfc76e4cf7bd0cd70"
] | [
"pugh_torch/tests/mappings/test_color.py"
] | [
"import pytest\nimport numpy as np\nimport pugh_torch as pt\n\n\ndef test_turbo_auto_range():\n x = np.arange(20).reshape(4, 5)\n\n actual = pt.mappings.turbo(x)\n\n assert actual.shape == (4, 5, 3)\n\n expected = np.array(\n [\n [\n [0.18995, 0.07176, 0.23217],\n ... | [
[
"numpy.allclose",
"numpy.array",
"numpy.random.rand",
"numpy.arange"
]
] |
adams314/health-equity-tracker | [
"2c6b63381a79227009376a255325d43300dda7cf"
] | [
"python/tests/test_gcs_to_bq.py"
] | [
"import json\nfrom datetime import datetime, timezone\nfrom textwrap import dedent\nfrom unittest import TestCase\nfrom unittest.mock import MagicMock, Mock, patch\n\nimport numpy as np\nfrom freezegun import freeze_time\nfrom pandas import DataFrame\nfrom pandas.testing import assert_frame_equal\n\nfrom ingestion ... | [
[
"pandas.DataFrame",
"pandas.testing.assert_frame_equal",
"numpy.dtype"
]
] |
akashsengupta1997/HierachicalProbalistic3DHuman | [
"9893133313afa0cc22323263b1df16871c36ae74"
] | [
"utils/label_conversions.py"
] | [
"import numpy as np\nimport torch\n\n\nCOCO_JOINTS = {\n 'Right Ankle': 16, 'Right Knee': 14, 'Right Hip': 12,\n 'Left Hip': 11, 'Left Knee': 13, 'Left Ankle': 15,\n 'Right Wrist': 10, 'Right Elbow': 8, 'Right Shoulder': 6,\n 'Left Shoulder': 5, 'Left Elbow': 7, 'Left Wrist': 9,\n 'Right Ear': 4, 'Le... | [
[
"torch.zeros",
"numpy.zeros_like",
"torch.arange",
"numpy.exp",
"torch.logical_not",
"numpy.arange",
"torch.zeros_like",
"torch.exp"
]
] |
sorami/transformers | [
"a1cecf55c1cd622acc929671c67dfc43ea943df4"
] | [
"src/transformers/trainer.py"
] | [
"# coding=utf-8\n# Copyright 2020-present the HuggingFace Inc. team.\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# Unles... | [
[
"torch.distributed.get_world_size",
"torch.cat",
"torch.utils.data.dataloader.DataLoader",
"torch.utils.data.sampler.RandomSampler",
"torch.cuda.amp.autocast",
"torch.no_grad",
"torch.utils.data.sampler.SequentialSampler",
"torch.tensor",
"torch.utils.data.distributed.Distribut... |
marcbadger/tweetynet | [
"048cc26ae3fe74c00a1d8f5a891eca21428c668c"
] | [
"src/tweetynet/curvefit.py"
] | [
"\"\"\"\"code to fit learning curves\r\nadapted from\r\nhttps://github.com/NickleDave/learning-curves/\"\"\"\r\n\r\nimport numpy as np\r\nfrom scipy import optimize\r\n\r\n\r\ndef residual_two_functions(params, x, y1, y1err, y2, y2err):\r\n \"\"\"\r\n returns residuals\r\n between two lines, specified by p... | [
[
"numpy.concatenate",
"numpy.mean",
"numpy.std",
"scipy.optimize.leastsq",
"numpy.average",
"numpy.log10"
]
] |
OhJaeKwang/gaze_estimation | [
"8fefa9ccb353ae5c164251a61221c369c1a825d2"
] | [
"dataset_tools/resize_data_lable.py"
] | [
"import matplotlib.pyplot as plt\nimport cv2\nimport json\nimport numpy as np\nimport math\nimport pandas as pd\nimport csv\n\norigin_x_shape = 192 # 이미지 가로 길이\norigin_y_shape = 192 # 이미지 세로 길이\n\nresize_width = 160\nresize_height = 96\n\nscale_factor_width = float(resize_width / origin_x_shape) \nscale_factor_... | [
[
"numpy.max",
"pandas.read_csv",
"numpy.min"
]
] |
akx/ml-hypersim | [
"2408fbafe580246108585f9c46780dc62f284cfc"
] | [
"code/python/analysis/dataset_generate_scene_labeling_statistics.py"
] | [
"#\n# For licensing see accompanying LICENSE.txt file.\n# Copyright (C) 2020 Apple Inc. All Rights Reserved.\n#\n\nfrom pylab import *\n\nimport argparse\nimport fnmatch\nimport inspect\nimport os\nimport pandas as pd\n\nimport path_utils\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--dataset_dir\",... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
liuyangzhuan/autotune | [
"bc24177a617025d2a47bc79563538cc6da45cfa9"
] | [
"Benchmarks/3mm/problem.py"
] | [
"import numpy as np\nfrom numpy import abs, cos, exp, mean, pi, prod, sin, sqrt, sum\nfrom autotune import TuningProblem\nfrom autotune.space import *\nimport os\nimport sys\nimport time\nimport json\nimport math\n\nimport ConfigSpace as CS\nimport ConfigSpace.hyperparameters as CSH\nfrom skopt.space import Real, I... | [
[
"numpy.asarray_chkfinite"
]
] |
pollen-robotics/pyrobus | [
"ff90e129159ae0569c0b82a49ee5c0de9914441f"
] | [
"pyluos/device.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport sys\nimport json\nimport time\nimport logging\nimport threading\nimport logging.config\nimport numpy as np\n\nfrom datetime import datetime\nfrom collections import defaultdict\n\nfrom .io import discover_hosts, io_from_host, Ws\nfrom .services import name2mod\n\nfrom any... | [
[
"numpy.array"
]
] |
amtagrwl/fvcore | [
"037302acd51b05c6c88f6c3495b5ea340cc4cb94"
] | [
"fvcore/nn/smooth_l1_loss.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport torch\n\n\ndef smooth_l1_loss(\n input: torch.Tensor, target: torch.Tensor, beta: float, reduction: str = \"none\"\n) -> torch.Tensor:\n \"\"\"\n Smooth L1 loss defined in the Fast R-CNN paper as:\n\n | 0.5 ... | [
[
"torch.abs",
"torch.where"
]
] |
shoguncao/autoMusic | [
"c7b648bc4320d21d89c8c4194dcaf2f835aa1234"
] | [
"magenta/models/music_vae/music_vae_train.py"
] | [
"# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"tensorflow.contrib.training.train",
"tensorflow.logging.set_verbosity",
"tensorflow.train.replica_device_setter",
"tensorflow.train.LoggingTensorHook",
"tensorflow.contrib.training.evaluate_repeatedly",
"tensorflow.Session",
"tensorflow.Graph",
"tensorflow.train.Saver",
"tenso... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.