repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ms440/bnlearn | [
"229b2bf05b6b6f2aa7dc96e6d55bf972cdbbfe52"
] | [
"bnlearn/helpers/network.py"
] | [
"\"\"\" This function has functionalities for network creation, clustering and plotting.\n\n\tG = network.to_graph(adjmat)\n\tlabx = network.cluster(G)\n\tfig = network.plot(G, labx)\n\n INPUT:\n adjmat: pd.DataFrame(): Edges are any values >0 between intersecting nodes.\n rows = ... | [
[
"numpy.isin",
"matplotlib.pyplot.gca",
"pandas.concat",
"numpy.abs",
"matplotlib.pyplot.title",
"numpy.unique",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"numpy.all",
"numpy.any",
"matplotlib.pyplot.grid",
"sklearn.preprocessing.MinMaxScaler",
"numpy.arra... |
Vpatrik/mech_ros | [
"3119908b25b2c86756c1d88e9da2d60cb426e1cc"
] | [
"src/Compare_Aruco_board_marker_detection.py"
] | [
"#!/usr/bin/env python\n\n# Patrik Vavra 2019\n\n\"\"\"\nCompares estimated pose of ArUco marker and ChArUco board, computes statistical data\nand write them to csv file.\n\"\"\"\n\n\nimport numpy as np\n# import cv2\nimport yaml\n# import time\nimport rospy\nimport cv2\nimport math\nimport csv\n\n\nfrom geometry_m... | [
[
"numpy.dot",
"numpy.int32",
"numpy.finfo",
"numpy.cov",
"numpy.mean",
"numpy.float32",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
farizrahman4u/AdelaiDet | [
"156e60bb0a5dde4aa6e29ebd3623834c5d32b3c1"
] | [
"adet/evaluation/text_evaluation.py"
] | [
"import contextlib\nimport copy\nimport io\nimport itertools\nimport json\nimport logging\nimport numpy as np\nimport os\nimport re\nimport torch\nfrom collections import OrderedDict\n# from fvcore.common.file_io import PathManager\n# from detectron2.utils.file_io import PathManager\nfrom adet.utils.file_io import ... | [
[
"numpy.concatenate",
"torch.device",
"numpy.linspace",
"numpy.outer"
]
] |
BEAR-algorithm/BEAR | [
"3793ac9a736f99f880ccd3693a9ccd54f5c45f04"
] | [
"SOFTMAX-MISSION-Topk-minibatch.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport random\nimport time\nimport warnings\nimport murmurhash\nimport pickle\nimport heapq\nfrom countminsketch_mmh3_parallel import CountMinSketch\nfrom topkheap import mytopkheap\nwarnings.filterwarnings(\"ignore\")\n\ndef loss_softmax(W, X, y_ind, reg):\n ... | [
[
"numpy.log",
"numpy.abs",
"numpy.random.seed",
"numpy.asarray",
"numpy.max",
"numpy.append",
"numpy.argmax",
"numpy.zeros_like",
"numpy.shape",
"numpy.exp",
"numpy.sum"
]
] |
neeradp/incubator-mxnet | [
"b34addeb1ffa4786158636e10724083d8462ed07"
] | [
"python/mxnet/contrib/onnx/onnx2mx/_op_translations.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"
]
] |
Aadi0902/AirSim | [
"50411c2e7b5ff85916485f8ed08e07dff12153db"
] | [
"PythonClient/multirotor/AK testing/PWM model/PWMtest.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jul 19 13:02:17 2020\n\n@author: amk170930\nG\"\"\"\n\n\nimport numpy as np\nimport airsim\nfrom airsim import Vector3r\nimport time\nimport xlrd\nimport control\nimport matrixmath\nimport gain_matrix_calculator as calK\nfrom scipy import signal\nfrom squaternion imp... | [
[
"numpy.dot",
"numpy.array",
"numpy.sqrt",
"scipy.spatial.transform.Rotation.from_quat"
]
] |
anhdhbn/face | [
"e29b6396cd9d2bce4bff5889daef9735a8129db0"
] | [
"Learner.py"
] | [
"import bcolz\nimport math\nfrom torchvision import transforms as trans\nfrom torchvision.utils import make_grid\nfrom PIL import Image\nfrom utils import get_time, gen_plot, hflip_batch, separate_bn_paras\nfrom matplotlib import pyplot as plt\nfrom tensorboardX import SummaryWriter\nfrom tqdm import tqdm\nimport n... | [
[
"torch.cat",
"matplotlib.pyplot.switch_backend",
"torch.min",
"torch.tensor",
"matplotlib.pyplot.plot",
"torch.no_grad",
"torch.optim.SGD",
"torch.pow"
]
] |
ijnek/ipm | [
"dee4f2ac99f5d24bd0d2a8c9ff7c748b74727a2f"
] | [
"ipm_library/ipm_library/utils.py"
] | [
"# Copyright (c) 2022 Hamburg Bit-Bots\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 o... | [
[
"numpy.square",
"numpy.multiply",
"numpy.einsum",
"numpy.eye",
"numpy.linalg.norm",
"numpy.finfo",
"numpy.tensordot",
"numpy.array"
]
] |
akosik-anyvision/incubator-tvm | [
"e1b11712ac09c32614483d24a4c7e0245ee4cb4b"
] | [
"python/tvm/relay/frontend/tflite.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.asscalar",
"numpy.cumsum",
"numpy.dtype",
"numpy.prod",
"numpy.transpose",
"numpy.array"
]
] |
illdopejake/data_driven_pathology | [
"489e2d7dc8b6b7e459a56b70a95317b1619e31b7"
] | [
"CrossDecomp.py"
] | [
"import pandas\nimport numpy as np\nimport scipy.stats as stats\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\ndef evaluate_components(clf, x, y, n_iterations=500, check = 100,\n evaluate = True, plot = True, thr = 0.95,\n metric=None, random_state=123):\n ... | [
[
"scipy.stats.pearsonr",
"pandas.DataFrame",
"numpy.argmax",
"matplotlib.pyplot.close",
"numpy.random.RandomState",
"matplotlib.pyplot.show"
]
] |
trumanw/ESP_DNN | [
"26b08787dc2836fac3c50559447ebaa56c2c8277"
] | [
"esp_dnn/graph_conv.py"
] | [
"# Copyright 2019 Astex Therapeutics Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"tensorflow.Print"
]
] |
remz1337/DataFrame | [
"e5aa82854a56201d75ed87cdc1f5b4059409ef8d"
] | [
"test/pandas_performance.py"
] | [
"import numpy as np\nimport pandas as pd\n\n# ------------------------------------------------------------------------------\n\ntimestamps = pd.date_range(\"1970-01-01\", \"2019-08-15\", freq='S')\ndf = pd.DataFrame({\"timestamp\": timestamps,\n \"normal\": np.random.normal(size=len(timestamps)),\... | [
[
"pandas.date_range"
]
] |
Shall-Chee/Vision-based-Vehicle-Detection-and-Tracking | [
"dff14e34779f142daa3254934f1e001e0777733f"
] | [
"iou.py"
] | [
"'''\nCombining detector and tracker\ntracker can track multiple object in the video\n'''\nimport numpy as np\nimport json\nfrom utils import *\nfrom constant import *\n\nfrom constant import t_min\n\nfrom ast import literal_eval\n\ndef overlap(box1, box2):\n '''\n check the overlap of two boxes\n @param\n... | [
[
"numpy.array",
"numpy.argmax"
]
] |
vodev/vocloud-RDF | [
"a98468cfe7e805e12ba14218b2508936143ba6d3"
] | [
"data_set_handler.py"
] | [
"import io\nimport os\n\nimport pandas as pd\nimport pyfits\nfrom astropy.io.votable import parse\nfrom astropy.io.votable.tree import VOTableFile, Resource, Table, Field\nfrom sklearn.cross_validation import StratifiedKFold, KFold\nfrom sklearn.cross_validation import train_test_split\n\n\ndef load_header(uri):\n ... | [
[
"sklearn.cross_validation.train_test_split",
"pandas.read_csv",
"sklearn.cross_validation.StratifiedKFold"
]
] |
matthewlchambers/flowsa | [
"97fdab9250d205bfd8d9341e3b62cc464bc854c7"
] | [
"flowsa/data_source_scripts/StatCan_LFS.py"
] | [
"# Stat_Canada.py (flowsa)\n# !/usr/bin/env python3\n# coding=utf-8\n\n\"\"\"\nLabour force characteristics by industry, annual (x 1,000)\nHow to cite: Statistics Canada. Table 14-10-0023-01 Labour\nforce characteristics by industry, annual (x 1,000)\nDOI: https://doi.org/10.25318/1410002301-eng\n\"\"\"\n\nimport i... | [
[
"pandas.concat",
"pandas.read_csv"
]
] |
mlindauer/SMAC3 | [
"9e871f61d72c789c0c0a25f1ddbcbb39621cfe74"
] | [
"test/test_smbo/test_acquisition.py"
] | [
"import unittest\n\nimport numpy as np\n\nfrom smac.smbo.acquisition import EI\n\n\nclass MockModel(object):\n def __init__(self, num_targets=1):\n self.num_targets = num_targets\n\n def predict_marginalized_over_instances(self, X):\n return np.array([np.mean(X, axis=1).reshape((1, -1))] *\n ... | [
[
"numpy.array",
"numpy.mean"
]
] |
AdamMiltonBarker/AI-Classification | [
"67a0a9d4ec1636014d51e404b23c5b2ecc8ea149"
] | [
"Projects/2/Classes/Model.py"
] | [
"############################################################################################\n#\n# Project: Peter Moss COVID-19 AI Research Project\n# Repository: AI-Classification\n# Repo Project: COVID-19 Tensorflow DenseNet Classifier\n#\n# Author: Adam Milton-Barker (AdamMiltonBarker.com)\n# C... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.imshow",
"numpy.expand_dims",
"tensorflow.keras.metrics.BinaryAccuracy",
"tensorflow.keras.preprocessing.image.load_img",
"tensorflow.keras.models.save_model",
"matplotlib.pyplot.plot",
"tensorflow.keras.applications.DenseNet121",
... |
hnmspirit/malaria_centernet | [
"e855e99016e60c6ec7a66f05591ead5993a41a18"
] | [
"lib/models/networks/mobi3.py"
] | [
"from torch.utils import model_zoo\r\nfrom ..backbones import mobilenetv3\r\n\r\n\r\nclass Mobi3Enc(mobilenetv3.MobileNetV3):\r\n def __init__(self, cfgs, mode='large', width_mult=1., outputs=[16], url=None):\r\n self.url = url\r\n super().__init__(cfgs, mode, width_mult=width_mult)\r\n self... | [
[
"torch.utils.model_zoo.load_url"
]
] |
kaixindelele/DRL | [
"74bb73caafd30547be0de7cdf0f6b945e51ecf6f",
"74bb73caafd30547be0de7cdf0f6b945e51ecf6f",
"74bb73caafd30547be0de7cdf0f6b945e51ecf6f"
] | [
"spinup/algos/sac1_rnn/test.py",
"spinup/algos/maxsqn/maxsqn_football.py",
"spinup/algos/sac1/sac1_BipedalWalkerHardcore-v2_old.py"
] | [
"\nimport tensorflow as tf\nimport gym\nimport joblib\nimport os\nimport os.path as osp\nfrom spinup.utils.logx import restore_tf_graph\n\n\ndef load_policy(fpath, itr='last', deterministic=False):\n\n # handle which epoch to load from\n if itr=='last':\n saves = [int(x[11:]) for x in os.listdir(fpath)... | [
[
"tensorflow.Session"
],
[
"numpy.dot",
"tensorflow.get_variable",
"numpy.expand_dims",
"tensorflow.control_dependencies",
"tensorflow.minimum",
"tensorflow.train.AdamOptimizer",
"numpy.random.randint",
"tensorflow.stop_gradient",
"tensorflow.Session",
"tensorflow.tr... |
TuomasJalonen/visual-product-tracking-system | [
"bc6c5499c4f146d4e2f77c79394018328615c19b"
] | [
"Preprocess_data.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 12 22:02:20 2020\n\n@author: Tuomas Jalonen\n\nThis file is used for preprocessing the data.\n\n\"\"\"\nimport os\nimport pandas as pd\nimport cv2\nimport numpy as np\n\ndef process_img(path, size):\n \"\"\"\n\n Parameters\n -----... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
rob-luke/mnelab | [
"4f2aa82fbc7d95ead253c463a7f8afee35e94163"
] | [
"mnelab/viz.py"
] | [
"# Authors: Clemens Brunner <clemens.brunner@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport math\nimport matplotlib.pyplot as plt\nfrom mne.time_frequency import tfr_multitaper\nfrom mne.viz.utils import center_cmap\n\n\ndef _get_rows_cols(n):\n if n <= 3:\n rows, cols = 1, n\n else:\n rows ... | [
[
"matplotlib.pyplot.subplots"
]
] |
richardwu/holoclean | [
"90668091f1c3baa5a8d19a5874194e8fcec13f6d"
] | [
"detect/detect.py"
] | [
"import pandas as pd\nimport time\nfrom dataset import AuxTables\n\n\nclass DetectEngine:\n def __init__(self, env, dataset):\n self.env = env\n self.ds = dataset\n\n def detect_errors(self, detectors):\n errors = []\n tic_total = time.clock()\n for detector in detectors:\n ... | [
[
"pandas.concat"
]
] |
stevennic/pandas | [
"27aae225e82d602e1092a10adf018a3e05682bc5"
] | [
"pandas/tests/io/parser/test_common.py"
] | [
"\"\"\"\nTests that work on both the Python and C engines but do not have a\nspecific classification into the other test modules.\n\"\"\"\nimport codecs\nimport csv\nfrom datetime import datetime\nfrom inspect import signature\nfrom io import StringIO\nimport os\nimport platform\nfrom urllib.error import URLError\n... | [
[
"pandas.Series",
"pandas.MultiIndex.from_tuples",
"pandas.DataFrame",
"pandas.io.parsers.TextParser",
"numpy.iinfo",
"pandas._testing.assert_frame_equal",
"pandas.util._test_decorators.check_file_leaks",
"pandas.Index",
"pandas._libs.tslib.Timestamp",
"pandas._testing.makeD... |
ThomasFavrel/Simple_Deep_NN_Numpy | [
"fe2080bfb5fec6e986294939cf253e6864abdd56"
] | [
"utils.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\n\n\ndef sigmoid(Z):\n \"\"\"\n Implements the sigmoid activation in numpy\n \n Arguments:\n Z -- numpy array of any shape\n \n Returns:\n A -- output of sigmoid(z), same shape as Z\n cache -- returns Z as well, useful duri... | [
[
"numpy.maximum",
"numpy.random.seed",
"numpy.random.randn",
"numpy.exp",
"numpy.array",
"numpy.zeros"
]
] |
kake777/python_sample | [
"3e69c0e89a67f81ced56193524c2f69913262dda"
] | [
"algorithm/deep_learning/gradient3.py"
] | [
"#勾配のグラフ\nimport numpy as np\nimport matplotlib.pylab as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom common_function import numerical_gradient, function_2\n\ndef tangent_line(f, x):\n d = numerical_gradient(f, x)\n print(d)\n y = f(x) - d*x\n return lambda t: d*t + y\n\nif __name__ == '__main__':... | [
[
"matplotlib.pylab.show",
"matplotlib.pylab.grid",
"matplotlib.pylab.xlim",
"numpy.arange",
"matplotlib.pylab.draw",
"matplotlib.pylab.xlabel",
"matplotlib.pylab.figure",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.ylim",
"matplotlib.pylab.quiver",
"numpy.array",
"n... |
craigbig/allennlp | [
"3f15a8bdcae366f3ef732eec1e9df26d91521582"
] | [
"allennlp/modules/token_embedders/pretrained_transformer_embedder.py"
] | [
"import math\nfrom typing import Optional, Tuple\n\nfrom overrides import overrides\n\nimport torch\nimport torch.nn.functional as F\nfrom transformers.modeling_auto import AutoModel\n\nfrom allennlp.data.tokenizers import PretrainedTransformerTokenizer\nfrom allennlp.modules.token_embedders.token_embedder import T... | [
[
"torch.zeros_like",
"torch.arange",
"torch.nn.functional.pad",
"torch.cat"
]
] |
Maarten7/neural-network-arca | [
"1ed80519bcfbfa871c30d28f7bc2cc3f35dfbd17"
] | [
"models/toy_model.py"
] | [
"import numpy as np\n\ndef get_random_xyz():\n x = np.random.randint(13)\n y = np.random.randint(13)\n z = np.random.randint(18)\n return x, y, z\n\n\ndef get_event_klass_label(num_mini_timeslices):\n event = np.zeros((num_mini_timeslices, 13, 13, 18, 3))\n klass = np.random.randint(3) \n label... | [
[
"numpy.zeros",
"numpy.random.randint"
]
] |
startnew/auto_work_tools | [
"169832fd9fa2f2f397f1605be4823eeee2e4a83a"
] | [
"auto_test/gen_data_csv.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 2020/11/9 14:19\n# @Author : zhuzhaowen\n# @email : shaowen5011@gmail.com\n# @File : gen_data_csv.py\n# @Software: PyCharm\n# @desc : \"获取导入的信息并筛选\"\n\nimport pandas as pd\nimport urllib\nimport pypinyin\nimport time\nfrom util.util import base6... | [
[
"pandas.concat",
"pandas.read_excel",
"pandas.read_pickle"
]
] |
s-gupta/fast-rcnn | [
"da935a12be8078c4d8684100016f82b5a4b02afc"
] | [
"lib/fast_rcnn/config.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\"\"\"Fast R-CNN config system.\n\nThis file specifies defa... | [
[
"numpy.array"
]
] |
Griffin98/fsgan | [
"c4e54cf0579ef95b3ef14174441d66f7b119e06f"
] | [
"preprocess/preprocess_video.py"
] | [
"\"\"\" Video preprocessing.\n\nThis script implements all preprocessing required for both training and inference.\nThe preprocessing information will be cached in a directory by the file's name without the extension,\nresiding in the same directory as the file. The information contains: face detections, face seque... | [
[
"numpy.convolve",
"numpy.pad",
"torch.cat",
"torch.utils.data.DataLoader",
"numpy.linalg.norm",
"numpy.ones",
"numpy.concatenate",
"numpy.savez_compressed",
"torch.set_grad_enabled",
"numpy.load",
"torch.nn.DataParallel",
"numpy.array",
"torch.as_tensor"
]
] |
RobbeElsermans/GestureControl | [
"c66f4d19fbf9ad785f4a8c721e7c6f8ba8425f4f"
] | [
"Code PlatformIO/Gesture Control PCBV0.3_F302RET6/python/showDataCSV.py"
] | [
"#!/usr/bin/python\nfrom csv import reader\nimport matplotlib.pyplot as plt\n\nfileName = \"links_zonder_duim\"\n\nfile = open(\"Software_Opstelling/\" + fileName + \".csv\", 'r', newline='')\n\ndata = reader(file, delimiter=',')\n\nleft=[]\ncenter=[]\nright=[]\n\nfor items in data:\n if not(\"LEFT\" in items[0]... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
]
] |
Yard1/pycaret | [
"b6a0168d9479c7778aea8f07cf1e14b3da169045"
] | [
"pycaret/arules.py"
] | [
"# Module: Association Rules Mining\n# Author: Moez Ali <moez.ali@queensu.ca>\n# License: MIT\n# Release: PyCaret 2.0x\n# Last modified : 30/07/2020\n\ndef setup(data, \n transaction_id, \n item_id,\n ignore_items = None,\n session_id = None):\n \n \"\"\"\n \n Descr... | [
[
"pandas.DataFrame"
]
] |
ruarai/epifx.covid | [
"be7aecbf9e86c3402f6851ea65f6705cdb59f3cf"
] | [
"local_epifx/tests/test_select.py"
] | [
"import logging\nimport os\nimport warnings\nimport numpy as np\nimport pypfilt\nimport pypfilt.sweep\nimport epifx\nimport epifx.select\n\n\ndef test_select():\n logging.basicConfig(level=logging.INFO)\n logger = logging.getLogger(\"epifx.select\")\n logger.setLevel(logging.DEBUG)\n out_file = 'test_se... | [
[
"numpy.array"
]
] |
huillll/deepface | [
"f17e63b8c8edc989d2d5d0d0861fe976c359d922"
] | [
"deepface/basemodels/OpenFace.py"
] | [
"import os\nfrom pathlib import Path\nimport gdown\n\nimport tensorflow as tf\nimport keras\nfrom keras.models import Model, Sequential\nfrom keras.layers import Conv2D, ZeroPadding2D, Activation, Input, concatenate\nfrom keras.layers.core import Dense, Activation, Lambda, Flatten\nfrom keras.layers.pooling import ... | [
[
"tensorflow.nn.lrn"
]
] |
gvisco/ossom | [
"77a455f467eb21e9a0cefdc5447d05f86cd090ec"
] | [
"ossom/som.py"
] | [
"import math\n\nimport scipy\nfrom scipy.spatial.distance import euclidean\n\n\ndef similarity(x, y):\n return euclidean(x, y)\n\n\ndef neighborhood_kernel(radius, i, j, ii, jj):\n \"\"\"Grid distance explained:\n http://keekerdc.com/2011/03/hexagon-grids-coordinate-systems-and-distance-calculations/\n\n ... | [
[
"scipy.random.uniform",
"scipy.spatial.distance.euclidean"
]
] |
leroidauphin/agents | [
"858ee36aaaea6fbcf0e5ab1c12929c77bd17abae"
] | [
"tf_agents/environments/parallel_py_environment.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"tensorflow.nest.flatten",
"tensorflow.nest.pack_sequence_as",
"numpy.stack"
]
] |
rainzhop/ConvNetQuake | [
"a3e6de3f7992eac72f1b9883fec36b8c7fdefd48"
] | [
"openquake.hazardlib/openquake/hazardlib/gsim/fukushima_tanaka_1990.py"
] | [
"# -*- coding: utf-8 -*-\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# Copyright (C) 2014-2016 GEM Foundation\n#\n# OpenQuake is free software: you can redistribute it and/or modify it\n# under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 ... | [
[
"numpy.log",
"numpy.log10",
"numpy.array",
"numpy.exp",
"numpy.zeros"
]
] |
kirkjens/sarpy_apps | [
"e38402b1591512081a83d0f31e6ded325ae196e8"
] | [
"sarpy_apps/supporting_classes/image_reader.py"
] | [
"\"\"\"\nHelper classes mapping the sarpy readers into the CanvasImageReader pattern.\n\"\"\"\n\n__classification__ = \"UNCLASSIFIED\"\n__author__ = \"Thomas McCullough\"\n\n\nimport logging\nimport numpy\nfrom typing import List, Tuple\nimport gc\n\nfrom tk_builder.image_reader import CanvasImageReader\n\nfrom sar... | [
[
"numpy.zeros",
"numpy.abs"
]
] |
al093/pytorch_connectomics | [
"52821951233b061102380fc0d2521843652c580a"
] | [
"torch_connectomics/utils/net/serialSampler.py"
] | [
"from collections import deque\nimport numpy as np\n\nimport torch\n\nfrom torch_connectomics.data.dataset.misc import crop_volume\nfrom torch_connectomics.data.utils.functional_collate import collate_fn_test_2, collate_fn_test\n\nclass SerialSampler():\n\n def __init__(self, dataset, batch_size, pad_size, init_... | [
[
"numpy.all",
"numpy.array",
"numpy.abs",
"numpy.ones"
]
] |
democheng/PythonRobotics | [
"0734c14ab7cd6daf9be307693b674e20a676bebb",
"0734c14ab7cd6daf9be307693b674e20a676bebb"
] | [
"Localization/legacy/KalmanFilterAnimation.py",
"Localization/histogramfilter_robot.py"
] | [
"import sys\nimport math\nimport numpy as np\nfrom scipy.stats import norm\nimport matplotlib.pyplot as plt\nimport mpl_toolkits.mplot3d.axes3d as p3\nfrom matplotlib.animation import FuncAnimation\n\ndef gaussian(x, mu, sig):\n return norm.pdf(x, mu, sig)\n\ndef gaussian_histogram(bin_num, mu, sig):\n sig3 =... | [
[
"numpy.sqrt",
"scipy.stats.norm.pdf",
"numpy.abs",
"numpy.arange",
"matplotlib.pyplot.axes",
"numpy.concatenate",
"numpy.argmax",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
],
[
"numpy.log",
"numpy.sqrt",
"scipy.stats.norm.pdf",
... |
JDE65/StockAnalysis | [
"6423e05f46fa4630d1c8a03e1630ea6e630b5a8f"
] | [
"util_model.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Aug 2 23:16:50 2020\r\n\r\nUtility functions for financial analysis to prepare X and Y matrices\r\n 1. LSTM_cleanXset(X_raw, trigger) => return X_clean\r\n 2. create_dataset(dataX, dataY, seq_length, step) => return Xs, ys as np.array\r\n 3. LSTM_train_... | [
[
"numpy.multiply",
"numpy.squeeze",
"numpy.trace",
"tensorflow.math.scalar_mul",
"sklearn.metrics.confusion_matrix",
"tensorflow.keras.backend.square",
"tensorflow.keras.backend.mean",
"tensorflow.keras.backend.switch",
"numpy.sum"
]
] |
JohnlNguyen/FLSim | [
"a5ed7c0b84499cd9dbc5fe95f8bcb4ba8ab5a5cb"
] | [
"flsim/privacy/tests/test_user_update_clipper.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport pytest\nimport torch\nfrom flsim.common.pytest_helper import (\n a... | [
[
"torch.allclose",
"torch.zeros_like",
"torch.tensor"
]
] |
KhronosGroup/NNEF-Tools | [
"0295fdedddcb316afd9c8092934c62ca84b39439"
] | [
"nnef_tools/conversion/tflite_to_nnef.py"
] | [
"# Copyright (c) 2020 The Khronos Group Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable... | [
[
"numpy.prod"
]
] |
Barkhausen-Institut/GFDM-PHY-Reference | [
"18296058ce4b3ef2fcbad977dea4bbb758322476"
] | [
"simulation/unittest/test_modulator.py"
] | [
"import unittest\r\nimport sys, os\r\n\r\nimport unittest\r\nimport numpy as np\r\n\r\nimport sys, os\r\nsys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))\r\nimport simulation.modem.util as util\r\nimport sdr_utils\r\n\r\n\r\nclass TestModulator(unittest.TestCase):\r\n \r\n def test_ofdm_mo... | [
[
"numpy.abs",
"numpy.fft.fft",
"numpy.fft.ifft",
"numpy.array",
"numpy.testing.assert_array_almost_equal"
]
] |
ZhongxiaYan/ray | [
"b97b8c2be1c7d01e2c93ca97a0b87120bfa2bd1a"
] | [
"python/ray/util/sgd/tests/test_pytorch.py"
] | [
"import os\nimport tempfile\nfrom unittest.mock import patch\n\nimport pytest\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\n\nimport ray\nfrom ray import tune\nfrom ray.tests.conftest import ray_start_2_cpus # noqa: F401\nfrom ray.util.sgd.pytorch import PyTorchTrainer, PyTor... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.equal",
"torch.nn.Linear",
"torch.distributed.is_available",
"torch.nn.MSELoss",
"torch.optim.lr_scheduler.StepLR"
]
] |
joep-source/minecraft_game | [
"1d2e01f18e029f547cd84913b93eca80254a5c31"
] | [
"play.py"
] | [
"import logging\nimport random\nimport sys\nfrom enum import Enum\nfrom functools import lru_cache\nfrom os import path\nfrom typing import List, Tuple, Union\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom ursina.camera import instance as camera\nfrom ursina.color import color, gray, light_gray\n... | [
[
"matplotlib.pyplot.imsave"
]
] |
cltl/SDG-tracker | [
"f8730adbf35b01864033cc82333972019d76077a"
] | [
"classify_only/utils.py"
] | [
"import os\r\nimport random\r\nimport glob\r\nimport json\r\nimport nltk\r\nimport re\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nfrom sentence_transformers import SentenceTransformer\r\n\r\nfrom sklearn import svm\r\nfrom sklearn.svm import LinearSVC\r\nfrom sklearn.model_selection import train_test_split\... | [
[
"numpy.concatenate",
"numpy.mean"
]
] |
TNO/techruption-poc-odessey-hackathon-2019 | [
"a7915244f4826fc9954c6b7e87ae10a8c7dbf2a3"
] | [
"data_generation/records.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Apr 12 19:11:47 2019\r\n\r\n@author: bosmanjw\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\n# BN id 201.5 pp 52 https://zoek.officielebekendmakingen.nl/blg-784527.pdf\r\n#https://www.prorail.nl/sites/default/files/phs-folder_gevaarlijke_stoffen_we... | [
[
"numpy.reshape",
"numpy.atleast_1d",
"numpy.atleast_2d",
"numpy.random.permutation",
"numpy.array",
"numpy.random.randint"
]
] |
SamsungLabs/ASAM | [
"f156a680171db16d551c0d85cba2514fa3bff6a2"
] | [
"example_cifar.py"
] | [
"import argparse\nimport torch\nimport torchvision\nfrom torch.utils.data import DataLoader\nfrom torchvision import transforms\nfrom torchvision.datasets import CIFAR10, CIFAR100\nfrom timm.loss import LabelSmoothingCrossEntropy\nfrom homura.vision.models.cifar_resnet import wrn28_2, wrn28_10, resnet20, resnet56, ... | [
[
"torch.nn.CrossEntropyLoss",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.argmax"
]
] |
gibsramen/umap | [
"fbd2f95f6deec70a4105091a4eaeab0e6ccbaf01"
] | [
"umap/tests/test_umap_trustworthiness.py"
] | [
"from umap import UMAP\nfrom sklearn.datasets import make_blobs\nfrom nose.tools import assert_greater_equal\nimport numpy as np\ntry:\n # works for sklearn>=0.22\n from sklearn.manifold import trustworthiness\nexcept ImportError:\n # this is to comply with requirements (scikit-learn>=0.20)\n # More rec... | [
[
"numpy.array",
"sklearn.manifold.t_sne.trustworthiness",
"sklearn.datasets.make_blobs"
]
] |
Islamsed/ai-assisted-annotation-client | [
"313da5177eba7ca94f8d76811c23e462726c978f"
] | [
"py-client/client_api.py"
] | [
"# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list of c... | [
[
"numpy.array",
"numpy.asanyarray",
"numpy.zeros"
]
] |
JeongsooHa/handRNN | [
"e289371f030858823cf4f002781fcf3fe5d7decf"
] | [
"online.py"
] | [
"\"\"\"\nRun the online classification system.\n\nCapture an image, classify, do it again.\n\"\"\"\nimport time\nfrom picamera import PiCamera\nfrom picamera.array import PiRGBArray\nimport tensorflow as tf\n\ndef get_labels():\n \"\"\"Get a list of labels so we can see if it's an ad or not.\"\"\"\n with open... | [
[
"tensorflow.Session",
"tensorflow.GraphDef",
"tensorflow.import_graph_def",
"tensorflow.gfile.FastGFile"
]
] |
omri374/fossa | [
"0ca81ba9cceecdc942832bc46e72075278a08ffe"
] | [
"tests/test_common.py"
] | [
"\"\"\"Test common fossa functionalities.\"\"\"\n\nimport pytest\nimport pandas as pd\n\nfrom fossa import LatestWindowAnomalyDetector\n\n\ndef test_bad_data():\n clf = LatestWindowAnomalyDetector(p_threshold=0.00001)\n # bad df: one-level index\n with pytest.raises(ValueError):\n df = pd.DataFrame(... | [
[
"pandas.MultiIndex.from_tuples",
"pandas.DataFrame"
]
] |
IQSS/workshops | [
"f060ee3b883c93cb4eb1410b13c3d9f8509233d8"
] | [
"Other/RCEintro/Python_examples/power1/power.py"
] | [
"import numpy as np\nfrom scipy import stats\n\n## function to simulate data and perform a t.test\ndef sim_ttest(mu1, mu2, sd, n1, n2):\n x = stats.norm.rvs(loc = mu1, scale = sd, size = n1)\n y = stats.norm.rvs(loc = mu2, scale = sd, size = n2)\n return(stats.ttest_ind(x, y)[1])\n\n## run the function 10... | [
[
"scipy.stats.ttest_ind",
"scipy.stats.norm.rvs"
]
] |
maruel/ml | [
"39e1883d7ee0c4393ba0b35bd7cc9ac2066e4e72"
] | [
"notebooks/deepdream.py"
] | [
"# Copyright 2021 Marc-Antoine Ruel. All rights reserved.\n# Use of this source code is governed under the Apache License, Version 2.0\n# that can be found in the LICENSE file.\n\n\"\"\"Includes tools to deep dream an image.\n\nInspired by https://www.tensorflow.org/tutorials/generative/deepdream\n\"\"\"\n\nimport ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.clip_by_value",
"tensorflow.constant",
"tensorflow.range",
"tensorflow.cast",
"tensorflow.keras.applications.InceptionV3",
"tensorflow.expand_dims",
"tensorflow.keras.Model",
"tensorflow.math.reduce_std",
"tensorflow.math.reduce_s... |
colorfullywonderfully/RS-Inspection | [
"799e1c12a19ee13cd4a1e23760b4d4e43e5f5794"
] | [
"rail_location.py"
] | [
"\r\nimport numpy as np\r\nimport cv2\r\nfrom pylab import *\r\n\r\ndef convolution(Img):\r\n\r\n p = 50\r\n # 计数\r\n count = 0\r\n\r\n #Img = np.array(cv2.imread('1.jpeg',0),dtype= int64)#直接读为灰度图像\r\n #plt.imshow(Img,'gray')\r\n #plt.show()\r\n #print(Img)\r\n rows,cols=Img.shape ## 行 列\r\... | [
[
"numpy.argmax"
]
] |
snemistry/spotlight | [
"830a65c462119d8cd47ece104246ff16f67dcea9"
] | [
"experimental/50-3-bpr-MLP-adaptive-lr-001-mom-92-l2-04.py"
] | [
"from spotlight.cross_validation import random_train_test_split\nfrom spotlight.datasets.movielens import get_movielens_dataset\nfrom spotlight.evaluation import mrr_score\nfrom spotlight.factorization.implicit import ImplicitFactorizationModel\nfrom spotlight.interactions import Interactions\nimport pandas as pd\n... | [
[
"pandas.read_parquet"
]
] |
DominickZhang/Distillation-Swin-Transformer | [
"6fc7b25bd558edb14e6f15715f53612c37e5166f"
] | [
"models/swin_transformer_distill_jinnian.py"
] | [
"import torch\nimport torch.nn as nn\nfrom timm.models.layers import trunc_normal_, to_2tuple, DropPath\nfrom .swin_transformer import Mlp, window_partition, window_reverse, PatchEmbed, PatchMerging\nimport torch.utils.checkpoint as checkpoint\n\n\nclass WindowAttentionDistill(nn.Module):\n r\"\"\" Window based ... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.zeros",
"torch.nn.init.constant_",
"torch.nn.ModuleList",
"torch.arange",
"torch.nn.Linear",
"torch.nn.Identity",
"torch.utils.checkpoint.checkpoint",
"torch.no_grad",
"torch.flatten",
"torch.roll",
"torch.nn.Adapti... |
cguevaramorel/ogs6py | [
"f6ed1d3aa694048175f59f4a467097f32332a0c0"
] | [
"ogs6py/log_parser/log_parser.py"
] | [
"#!/usr/bin/env python\n\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\nimport re\nimport sys\nfrom dataclasses impo... | [
[
"pandas.DataFrame"
]
] |
jchibane/if-net_texture | [
"989ffdc9afc0296d92a55a7a1f155c1cc3e6e5e4"
] | [
"models/training.py"
] | [
"from __future__ import division\nimport torch\nimport torch.optim as optim\nfrom torch.nn import functional as F\nimport os\nfrom glob import glob\nimport numpy as np\n\n\n\n\nclass Trainer(object):\n\n def __init__(self, model, device, train_dataset, val_dataset, exp_name, optimizer='Adam'):\n self.mode... | [
[
"torch.load",
"numpy.save",
"numpy.sort",
"numpy.array",
"torch.nn.L1Loss"
]
] |
DiegoCorrea/masters-dissertation | [
"61d6e9c46da6cf1e7d904f98eb1d46d907a74576"
] | [
"src/processing/traditional_recommenders.py"
] | [
"import datetime\nimport gc\nimport logging\nimport multiprocessing\nimport os\nimport time\nfrom copy import deepcopy\n\nimport numpy as np\nimport pandas as pd\n\nfrom src.analises.popularity import count_popularity_item\nfrom src.config.labels import TRANSACTION_VALUE_LABEL, POPULARITY_LABEL, USER_LABEL, ITEM_LA... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
bthorne93/freckles | [
"cacb0c3846602f13b371252876f1f8e05dca54ba"
] | [
"src/freckles/separation/components.py"
] | [
"from __future__ import print_function\nfrom numba import jit, float64\nimport numpy as np\nimport inspect\n\nclass Component(object):\n def __init__(self, comp_name):\n \"\"\" SED must be in uK_RJ units.\n \"\"\"\n self.comp_name = comp_name\n self.sed = globals()[comp_name]\n ... | [
[
"numpy.log",
"numpy.exp"
]
] |
davanstrien/flyswot | [
"630aa4f51c4381a7832846a7ef5be7af06a4b47b"
] | [
"src/flyswot/inference.py"
] | [
"\"\"\"Inference functionality\"\"\"\nimport csv\nimport mimetypes\nimport re\nimport string\nimport time\nfrom abc import ABC\nfrom abc import abstractmethod\nfrom collections import defaultdict\nfrom collections import OrderedDict\nfrom dataclasses import asdict\nfrom dataclasses import dataclass\nfrom datetime i... | [
[
"numpy.max",
"numpy.array",
"numpy.zeros"
]
] |
vicjung/meme-glossary | [
"b502587825f3892f411a66421a7ba789c18d59cb"
] | [
"prepare_memes/xml2vec.py"
] | [
"#!/usr/bin/env python3\n'''\nGenerate .vec voca file from image xml folder. (voca format is KeyedVectors.load_word2vec_format.) [filename : vector]\nUsage : ./xml2vec --model_path=./model.bin --xml_dir=./xml_dir/ --vec_path=./voca.vec\n'''\nimport sys\nimport os\nsys.path.append(os.path.dirname(os.path.dirname(os.... | [
[
"numpy.any"
]
] |
jacopofar/sleep-anki-correlation | [
"ac7d152590839b3ff1ae7360d7dfc75b0ade6b41"
] | [
"activities_weekly_heatmap.py"
] | [
"from datetime import datetime\nimport json\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nHOURS = [str(x) for x in range(49)]\nWEEKDAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']\n\n\ndef main():\n counts = np.zeros((len(WEEKDAYS), len(HOURS)))\n with open('activities.jsonl') as f:\n ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
bottydim/dginn | [
"c6b638b2df1e1fe57a76961b18c68dceee55ac38"
] | [
"dg_relevance.py"
] | [
"import numpy as np\nimport pandas as pd\nimport tensorflow as tf\nif __name__ == '__main__':\n tf.compat.v1.enable_eager_execution()\nfrom matplotlib import pyplot as plt\nfrom dginn.utils import vprint, Timer\nimport math\n\n# this should be only in the call module, all other modules should not have it!!!\n# b... | [
[
"tensorflow.reduce_sum",
"tensorflow.compat.v1.enable_eager_execution",
"numpy.all",
"numpy.mean",
"numpy.where",
"matplotlib.pyplot.tight_layout",
"numpy.unique",
"numpy.arange",
"numpy.argmax",
"numpy.apply_along_axis",
"numpy.ravel",
"numpy.zeros",
"numpy.ran... |
kazuhitogo/amazon-redshift-police | [
"287e62725f7ef039ee074aaa157952a8448138a2"
] | [
"src/generate_image.py"
] | [
"from random import randint,seed\nfrom PIL import Image,ImageDraw,ImageFont\nfrom os import makedirs, path, listdir\nfrom glob import glob\nimport argparse\nimport numpy as np\nimport matplotlib.font_manager as fm\nseed(1234) # 結果を再現できるようにするために乱数のシードを固定\ndef main(output_dir,check_name_list):\n system_font_list =... | [
[
"numpy.save",
"numpy.ones",
"numpy.all",
"numpy.array",
"matplotlib.font_manager.findSystemFonts"
]
] |
yasudakn/CIHP_PGN | [
"71a1aae3b507cdbf47cab6a12e2e8bdef68273bb"
] | [
"utils/image_reader.py"
] | [
"import os\n\nimport numpy as np\nimport tensorflow as tf\nimport random\n\nIGNORE_LABEL = 255\nIMG_MEAN = np.array((125.0, 114.4, 107.9), dtype=np.float32)\n\ndef image_scaling(img, label, edge):\n \"\"\"\n Randomly scales the images between 0.5 to 1.5 times the original size.\n Args:\n img: Training... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.stack",
"tensorflow.image.decode_png",
"tensorflow.cast",
"tensorflow.train.batch",
"tensorflow.to_int32",
"tensorflow.boolean_mask",
"tensorflow.read_file",
"tensorflow.squeeze",
"tensorflow.to_float",
... |
blueenvelope31/pandas | [
"6e1f41b45a0d08f662b794ed98695b8595f39023"
] | [
"pandas/tests/arrays/categorical/test_subclass.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport pandas.util.testing as tm\nfrom pandas import Categorical\n\n\nclass TestCategoricalSubclassing(object):\n\n def test_constructor(self):\n sc = tm.SubclassedCategorical(['a', 'b', 'c'])\n assert isinstance(sc, tm.SubclassedCategorical)\n tm.assert_categoric... | [
[
"pandas.Categorical.from_codes",
"pandas.util.testing.assert_categorical_equal",
"pandas.Categorical",
"pandas.util.testing.SubclassedCategorical.from_codes",
"pandas.util.testing.SubclassedCategorical"
]
] |
thunfischtoast/tf_netbuilder | [
"728826ac5e4e58a39ea862cecc86ad249a19e278"
] | [
"tf_netbuilder/activations.py"
] | [
"from typing import Callable\nimport tensorflow as tf\nimport numpy as np\n\n\ndef hard_swish(x: tf.Tensor):\n with tf.name_scope('hard_swish'):\n return x * tf.nn.relu6(x + np.float32(3)) * np.float32(1. / 6.)\n\n\nclass FuncAsLayer:\n \"\"\"\n This wrapper is a common denominator for function activation... | [
[
"tensorflow.keras.layers.Activation",
"tensorflow.name_scope",
"numpy.float32"
]
] |
ChristopherBrix/Debona | [
"f000f3d483b2cc592233d0ba2a1a0327210562c8"
] | [
"src/vnnlib.py"
] | [
"'''\nvnnlib simple utilities\n\nStanley Bak\nJune 2021\n'''\n\nfrom copy import deepcopy\n\nimport numpy as np\nimport re\n\n\ndef read_statements(vnnlib_filename):\n '''process vnnlib and return a list of strings (statements)\n\n useful to get rid of comments and blank lines and combine multi-line statement... | [
[
"numpy.array"
]
] |
dewloosh/dewloosh-geom | [
"5c97fbab4b68f4748bf4309184b9e0e877f94cd6"
] | [
"src/dewloosh/geom/tri/triplot.py"
] | [
"# -*- coding: utf-8 -*-\nfrom typing import Callable, Iterable\nimport numpy as np\nfrom functools import partial\n\nfrom dewloosh.core.tools import issequence\n\nfrom .triang import triobj_to_mpl, get_triobj_data, triangulate\nfrom .triutils import offset_tri\nfrom ..utils import cells_coords, explode_mesh_data_b... | [
[
"numpy.abs",
"matplotlib.patches.Polygon",
"matplotlib.pyplot.subplots"
]
] |
dlinde/disaster_response_pipeline | [
"e1f5f8e3f666830d29351396bb343001d5fe330d"
] | [
"models/title_transformer.py"
] | [
"from sklearn.base import BaseEstimator, TransformerMixin\nimport pandas as pd\n\nclass TitleCount(BaseEstimator, TransformerMixin):\n\n\n def fit(self, x, y=None):\n return self\n\n def transform(self, X):\n X_tagged = pd.Series(X).apply(lambda x: len([\n wrd for wrd in x.split() if wr... | [
[
"pandas.Series",
"pandas.DataFrame"
]
] |
JIC-Image-Analysis/point-picker | [
"b2d94520c2b6ee0a323c4a7021f03709ac9db82a"
] | [
"scripts/point_picker.py"
] | [
"import sys\nimport logging\n\nfrom vispy import scene\nfrom vispy.scene.visuals import Text\nfrom vispy import app\nimport numpy as np\n\nimport pandas as pd\n\nfrom imageio import imread\n\nimport click\n\nfrom skimage.draw import circle\n\ncanvas = scene.SceneCanvas(keys='interactive')\ncanvas.size = 800, 600\nc... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.argmin",
"numpy.array",
"numpy.sum"
]
] |
TeaPoly/Conformer-Athena | [
"9919de269ca3074c20f55d72ca8fc975aca8cf7d"
] | [
"athena/layers/commons.py"
] | [
"# coding=utf-8\n# Copyright (C) 2019 ATHENA AUTHORS; Xiangang Li\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 r... | [
[
"tensorflow.keras.constraints.serialize",
"tensorflow.stack",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.cast",
"tensorflow.keras.regularizers.serialize",
"tensorflow.keras.backend.int_shape",
"tensorflow.nn.moments",
"tensorflow.keras.layers.Conv2D",
"tensorflow.ke... |
chenyanghungry/person-reid-lib | [
"783e66c9bfedf582e2cf935b9f5be960b543ac3c",
"783e66c9bfedf582e2cf935b9f5be960b543ac3c"
] | [
"lib/datamanager/transforms.py",
"lib/dataset/dukemtmcreid.py"
] | [
"from torchvision.transforms import ToPILImage, Resize, RandomHorizontalFlip, ToTensor, Normalize, RandomCrop\nimport torchvision.transforms.functional as F\nfrom PIL import Image, ImageOps\nimport numpy as np\nimport random\nimport numbers\nimport torch\nimport math\n\n\n__all__ = ['GroupToTensor',\n 'Gr... | [
[
"torch.stack",
"torch.cat"
],
[
"numpy.asarray",
"numpy.intersect1d",
"numpy.unique"
]
] |
myepes2/MiSiCgui | [
"a2e76568cf32d00813760e5793d606faf7049701"
] | [
"models/MiSiDC04082020.py"
] | [
"\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.utils import get_file\n\nimport numpy as np\n\nfrom skimage.transform import resize,rescale\nfrom skimage.feature import shape_index\nfrom skimage.util import random_noise\nfrom skimage.io import imread,imsave\n\nimport matplotlib.pyplot as pl... | [
[
"tensorflow.keras.models.load_model",
"numpy.pad",
"numpy.max",
"tensorflow.keras.utils.get_file",
"numpy.zeros"
]
] |
jan-pavlovsky/Deep-Learning-Tasks | [
"220764d350ae1bbe8e50250b44a5f9e0b3abefe4"
] | [
"09/morpho_dataset.py"
] | [
"import os\nimport sys\nimport urllib.request\nimport zipfile\n\nimport numpy as np\n\n# Loads a morphological dataset in a vertical format.\n# - The data consists of three Datasets\n# - train\n# - dev\n# - test\n# - Each dataset is composed of factors (FORMS, LEMMAS, TAGS), each an\n# object containing the... | [
[
"numpy.arange",
"numpy.array",
"numpy.random.RandomState",
"numpy.zeros"
]
] |
Henriksen-Lab/Simple_DAQ | [
"3bd313df4c80340eb367081400cb6d75ba132623"
] | [
"pico_vna_adapt/PicoVNA108.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# author: Shilling Du, revised from https://github.com/picotech/picosdk-picovna-python-examples\n# Feb 22, 2022\n\nimport win32com.client\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass Smith():\n def __init__(self,real,imag,logmag,phase,freq):\n ... | [
[
"numpy.ceil",
"numpy.array"
]
] |
bene1337/OpenFermion | [
"6187085f2a7707012b68370b625acaeed547e62b"
] | [
"src/openfermion/transforms/repconversions/conversions.py"
] | [
"# 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 or agreed to in writing, software... | [
[
"numpy.ix_",
"numpy.imag",
"numpy.abs",
"numpy.eye",
"numpy.real",
"numpy.zeros"
]
] |
thangth1102/Wikidata2Text | [
"722b528451e92b3072bf57260fdb8f0962a89929"
] | [
"autoencoders.py"
] | [
"from cluster_losses import *\r\nfrom cluster_metrics import *\r\nfrom corpus_estimation import *\r\nfrom cluster_methods import *\r\n\r\nfrom sklearn.model_selection import train_test_split\r\n\r\nimport keras\r\nfrom keras.layers import Input, Dense\r\nfrom keras.models import Model\r\nfrom keras.callbacks import... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
yarenty/ludwig | [
"d77aaf8da39f04a353a3a08fb699ae8a96ffea3a"
] | [
"ludwig/data/preprocessing.py"
] | [
"#! /usr/bin/env python\n# Copyright (c) 2019 Uber Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle... | [
[
"pandas.DataFrame",
"numpy.random.choice"
]
] |
utiasSTARS/pyslam | [
"5c0de9eaed4ebc7687b6d43079481c9a9336145b"
] | [
"examples/stereo_ba.py"
] | [
"import numpy as np\n\nfrom liegroups import SE3\n\nfrom pyslam.sensors import StereoCamera\nfrom pyslam.residuals import ReprojectionResidual\nfrom pyslam.problem import Options, Problem\nfrom pyslam.utils import invsqrt\n\n# Reproducibility\nnp.random.seed(42)\n\n# Landmarks (world frame is first camera frame)\np... | [
[
"numpy.random.seed",
"numpy.diagflat",
"numpy.ones",
"numpy.random.rand",
"numpy.array"
]
] |
wangvei/pydefect | [
"e909796c429e16982cefe549d16881039bce89e7"
] | [
"pydefect/cli/main_functions.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\nfrom copy import deepcopy\nfrom glob import glob\nfrom pathlib import Path\nfrom typing import Optional\n\nimport numpy as np\n\nfrom pydefect.analysis.defect import Defect\nfrom pydefect.analysis.defect_carrier_concentration import DefectConcentration\nfrom pydefect.analysis.... | [
[
"numpy.count_nonzero"
]
] |
priikone/colour | [
"e9c8834178c14dd6d8d0d874191aada18929c211"
] | [
"colour/algebra/common.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCommon Utilities\n================\n\nDefines common algebra utilities objects that don't fall in any specific\ncategory.\n\"\"\"\n\nimport functools\nimport numpy as np\n\nfrom colour.utilities import as_float_array, as_float, tsplit\n\n__author__ = 'Colour Developers'\n__copyrigh... | [
[
"numpy.abs",
"numpy.einsum",
"numpy.power",
"numpy.clip",
"numpy.isnan",
"numpy.atleast_1d",
"numpy.max",
"numpy.sign",
"numpy.identity"
]
] |
ztanml/ptpqp | [
"1438a919174b041fb5f36c30bc6825c3748d9a11"
] | [
"MELD/script.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Apr 14 20:24:06 2016\n\n@author: zhaoshiwen\n\"\"\"\n\nimport numpy as np\n\nimport MELD as MELD\nreload(MELD)\n\n\nn = 1000\nY = np.loadtxt('../data/CTp20Yn' + str(n) + '.txt')\n(p,n) = Y.shape\n\nYt = np.array([0]*p) \n# the type of the variables\n# 0: categorical\... | [
[
"numpy.array"
]
] |
CosimoRulli/VMRProject_K_D | [
"3dc3f7276b7c9ad67404b2b10de4fc42dbffcaf8"
] | [
"lib/model/faster_rcnn/alexnet_caffe.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass AlexNet_caffe(nn.Module):\n\n def __init__(self, num_classes=1000):\n super(AlexNet_caffe, self).__init__()\n self.features = nn.Sequential(\n nn.Conv2d(3, 96, kernel_size=11, stride=4),\n nn.ReLU(),\n nn.LocalResponse... | [
[
"torch.nn.Dropout",
"torch.nn.LocalResponseNorm",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.ReLU"
]
] |
felipeescallon/lux | [
"1dbbcb9967f0e7413675626ce080c1059e214e74"
] | [
"lux/executor/PandasExecutor.py"
] | [
"# Copyright 2019-2020 The Lux Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"pandas.reset_option",
"pandas.to_numeric",
"pandas.api.types.is_object_dtype",
"pandas.to_datetime",
"pandas.api.types.is_float_dtype",
"pandas.Series",
"pandas.api.types.is_datetime64_any_dtype",
"pandas.option_context",
"pandas.DataFrame",
"pandas.Series.mode",
"pand... |
Anomaly-Detection-Research/arma-arima | [
"c5e025641aca41f6b47f9df01573ef956fb8d5df"
] | [
"python_scripts/ARIMA.py"
] | [
"import warnings\nimport itertools\nimport pandas\nimport math\nimport sys\nimport numpy as np\nfrom plotly.offline import download_plotlyjs, init_notebook_mode, plot\n# init_notebook_mode(connected=True)\n\n# dataframe = pandas.read_csv('./data/realTraffic/speed_6005.csv')\n# dataframe = pandas.read_csv('./data/re... | [
[
"numpy.dot",
"numpy.polyfit",
"pandas.read_csv",
"numpy.arange",
"numpy.max",
"numpy.random.normal",
"numpy.std",
"numpy.mean",
"numpy.corrcoef",
"numpy.array",
"numpy.zeros"
]
] |
LilYuuu/transformers | [
"795c9d2de2ec9e3844dc4c2cdf2e0bc9251597f7"
] | [
"src/transformers/data/processors/glue.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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... | [
[
"tensorflow.TensorShape",
"tensorflow.data.experimental.cardinality"
]
] |
vdorobantu/lyapy | [
"485e8490ef77f2286a804b2bd506cc3f46b74c6d"
] | [
"lyapy/systems/system.py"
] | [
"\"\"\"Base class for dynamical systems of the form x_dot = f(t, x).\"\"\"\n\nfrom scipy.integrate import solve_ivp\n\nclass System:\n \"\"\"Base class for dynamical systems of the form x_dot = f(t, x).\n\n Override dx.\n\n Let n be number of states.\n \"\"\"\n\n def dx(self, t, x):\n \"\"\"Ev... | [
[
"scipy.integrate.solve_ivp"
]
] |
gorogoroyasu/captum | [
"e4e27c537e86deca6ed841432be2f11459d6795a"
] | [
"tests/attr/neuron/test_neuron_gradient.py"
] | [
"#!/usr/bin/env python3\n\nimport unittest\n\nimport torch\nfrom captum.attr._core.saliency import Saliency\nfrom captum.attr._core.neuron.neuron_gradient import NeuronGradient\nfrom captum.attr._utils.gradient import _forward_layer_eval\n\nfrom ..helpers.basic_models import (\n BasicModel_ConvNet,\n BasicMod... | [
[
"torch.randn",
"torch.tensor"
]
] |
GregTheRick/Deep-Learning-for-Fast-Low-Light-Imaging | [
"c2a3f869f9e9a4691900962a0541b41fc17f2f0c"
] | [
"experiment_trainer_flip.py"
] | [
"from __future__ import division\nimport numpy as np\nimport tensorflow as tf\nfrom SIDLoader import SIDLoader\nfrom ModelBuilder import ModelBuilder\nfrom Experiment import Experiment\nimport time,datetime,os,glob\n\npath_prefix = '.'\ncheckpoint_dir = path_prefix+'/chk'\ndataset_dir = path_prefix+'/dataset'\nvali... | [
[
"numpy.random.seed"
]
] |
gwdgithubnom/monkey-clever | [
"05290c33f7f2cf1de752e68f99464b92c02a9faf"
] | [
"arithmetic4py/src/kmeans/ref/wire3d.py"
] | [
"#http://matplotlib.org/examples/mplot3d/wire3d_demo.html\nfrom mpl_toolkits.mplot3d import axes3d\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfig = plt.figure()\nax = fig.add_subplot(111, projection='3d')\nX, Y, Z = axes3d.get_test_data(0.05)\nax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)\n\nplt.s... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
vvanirudh/deluca | [
"673e66038547db90a7b23335cfe7508728076a4d"
] | [
"tests/utils/test_experiment.py"
] | [
"# Copyright 2020 Google LLC\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.sum"
]
] |
sachsanjoy/ezmist | [
"68afd231bd1323b33cd70ceff8a724b87e81cefa"
] | [
"ezmist/simpletable.py"
] | [
"\"\"\" This file implements a Table class\n that is designed to be the basis of any format\n\nRequirements\n------------\n\n* FIT format:\n * astropy:\n provides a replacement to pyfits\n pyfits can still be used instead but astropy is now the default\n\n* HDF5 format:\n * pytables\n\nRuntim... | [
[
"numpy.nanmax",
"numpy.nanmedian",
"numpy.asarray",
"numpy.squeeze",
"numpy.nanmin",
"numpy.nanmean",
"numpy.var",
"numpy.nanstd",
"numpy.where",
"numpy.equal.outer",
"pandas.read_csv",
"numpy.arcsin",
"numpy.sin",
"numpy.lib.recfunctions.drop_fields",
"... |
cypherix/ssd.pytorch | [
"0529c61bb945973d29a416487046d4aae63360fc"
] | [
"data/__init__.py"
] | [
"from .voc0712 import VOCDetection, VOCAnnotationTransform, VOC_CLASSES, VOC_ROOT\n\nfrom .coco import COCOAnnotationTransform\nfrom .config import *\nimport torch\nimport cv2\nimport numpy as np\n\ndef detection_collate(batch):\n \"\"\"Custom collate fn for dealing with batches of images that have a different\n... | [
[
"torch.stack",
"numpy.array",
"torch.FloatTensor"
]
] |
blzheng/pytorch-YOLOv4 | [
"8956c4801c4e1ae4b0c2fadf807a0356f0bfe058"
] | [
"test_inference.py"
] | [
"import torch\nimport argparse\nimport os\nimport random\nimport shutil\nimport time\nimport warnings\nfrom torch import nn\nimport torch.nn.functional as F\nfrom tool.torch_utils import *\nfrom tool.yolo_layer import YoloLayer\nfrom yolo_loss import Yolo_loss\nfrom torch.utils import mkldnn as mkldnn_utils\nfrom m... | [
[
"torch.jit.freeze",
"torch.randn",
"torch.no_grad",
"torch.rand",
"torch.device",
"torch.cpu.amp.autocast",
"torch.autograd.Variable"
]
] |
ChristosT/meshio | [
"de0ced0cc19fa40389764514328874dce8afdbec"
] | [
"meshio/medit/_medit.py"
] | [
"\"\"\"\nI/O for Medit's format/Gamma Mesh Format,\nLatest official up-to-date documentation and a reference C implementation at\n<https://github.com/LoicMarechal/libMeshb>\n\"\"\"\nimport logging\nimport struct\nfrom ctypes import c_double, c_float\n\nimport numpy as np\n\nfrom .._common import _pick_first_int_dat... | [
[
"numpy.dtype",
"numpy.fromfile",
"numpy.empty",
"numpy.ones"
]
] |
mleshen/pytorch | [
"314a578154d9f0981bc08397aaaeaf50d8233730"
] | [
"torch/fx/graph_module.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.overrides\nfrom torch.nn.modules.module import _addindent\nfrom torch.package import PackageImporter, PackageExporter\nimport linecache\nfrom typing import Type, Dict, List, Any, Union, Optional, Set\nfrom .graph import Graph, _is_from_torch, _custom_builtins, Pyth... | [
[
"torch.nn.Module",
"torch.nn.modules.module._addindent",
"torch.save"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.