repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
WeixiongLin/Quanser-robots
[ "733d4aeed1a8d91a42e51abb7c7884a6933d8fb6" ]
[ "Quanser Robot/MPC/MPC-Qube/dynamics.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.autograd as autograd\nimport pickle\nfrom utils import *\n\nclass MLP(nn.Module):\n '''A simple implementation of the multi-layer neural network'''\n def __init__(self, n_input=7, n_output=6, n_h=2, size_h=128):\n '''\n Specify the neural networ...
[ [ "torch.nn.init.uniform_", "torch.load", "torch.nn.ModuleList", "torch.utils.data.DataLoader", "torch.nn.Tanh", "torch.nn.Linear", "torch.save", "torch.FloatTensor", "torch.nn.ReLU", "torch.nn.MSELoss", "torch.autograd.Variable" ] ]
50417/SLGPT
[ "df29217d20d6bd35d7841b90cc92f784da95b0af" ]
[ "code-process/calculatemetrics.py" ]
[ "import networkx as nx\nfrom Graph_Info import Graph_Info\nfrom math import isinf\nimport numpy as np\nimport os\nimport json\ndef calculate_graph_metric( using_json=False,simulink_name=None, adjList=None, source=None, sinks=None, blocks=None):\n import json\n DG = nx.DiGraph()\n gi = Graph_Info(simulink_n...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.plot", "matplotlib.ticker.MaxNLocator", "matplotlib.pyplot.close", "matplotlib.pyplot.rcParams.update" ] ]
JediLuke/rufus
[ "177c6012ecdaeaab42f45f76e478b14b5610c6b3" ]
[ "donkeycar/parts/lidar.py" ]
[ "\"\"\"\nLidar\n\"\"\"\n\nimport time\nimport numpy as np\n\n\nclass Ultrasonic():\n def __init__(self):\n # self.sensor = someThing()\n self.dist = 1000\n\n def run_threaded(self):\n return self.dist\n\n def update(self):\n #self.dist = self.sensor.getReading()\n print(\...
[ [ "numpy.zeros" ] ]
jurafish/Paddle
[ "15724e745409cf6af3df99ae3eec90511e482cbc" ]
[ "python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_sum.py" ]
[ "# Copyright (c) 2021 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.random.random" ] ]
tt8000/Paddle
[ "17b660c0827bb7c2a24d1a17fe18349ad6702513" ]
[ "python/paddle/tests/test_pretrained_model.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.random", "numpy.testing.assert_allclose" ] ]
explorer2326/Stance-Detection-Fake-News-Challenge
[ "3eb473aa5d7973cb9901abc1f91f50d58a235200" ]
[ "language_model.py" ]
[ "#%%\r\nimport os\r\nimport sys\r\nsys.path.append(os.getcwd())\r\nimport warnings\r\nwarnings.filterwarnings(action='ignore', category=UserWarning, module='gensim')\r\nimport gensim \r\nimport nltk\r\nfrom nltk.corpus import stopwords\r\nfrom nltk.tokenize import word_tokenize\r\nimport numpy as np\r\nimport calcu...
[ [ "numpy.save" ] ]
yexijoe/tinyms
[ "16ca574886cb0a8f22280fe400928d4f40e3e285" ]
[ "tinyms/vision/transforms.py" ]
[ "# Copyright 2021 Huawei Technologies Co., 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 l...
[ [ "numpy.hstack", "numpy.expand_dims", "numpy.maximum", "numpy.minimum", "numpy.random.choice", "numpy.sort", "numpy.concatenate", "numpy.zeros_like", "numpy.random.rand", "numpy.argsort", "numpy.array" ] ]
NicolasDurrande/GPflow
[ "ba8b7a58bb5f695dc48242a31c949ee23148e555" ]
[ "gpflow/mean_functions.py" ]
[ "# Copyright 2016 James Hensman, alexggmatthews, PabloLeon, Valentine Svensson\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#...
[ [ "tensorflow.matmul", "tensorflow.transpose", "tensorflow.zeros", "numpy.reshape", "tensorflow.shape", "tensorflow.cast", "tensorflow.size", "tensorflow.eye", "numpy.ones", "tensorflow.dynamic_stitch", "numpy.atleast_2d", "numpy.zeros", "tensorflow.tile" ] ]
tunisij/mask-rcnn
[ "2e80edf45613dfccd5ae47110c16dc006c6fac67" ]
[ "mrcnn/visualize.py" ]
[ "\"\"\"\nMask R-CNN\nDisplay and Visualization Functions.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport sys\nimport random\nimport itertools\nimport colorsys\n\nimport numpy as np\nfrom skimage.measure import ...
[ [ "matplotlib.pyplot.imshow", "numpy.concatenate", "numpy.any", "numpy.where", "matplotlib.patches.Polygon", "matplotlib.pyplot.tight_layout", "numpy.unique", "numpy.fliplr", "numpy.arange", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "numpy.zeros", "ma...
Blackdevil132/machineLearning
[ "de048bb1473994052f8ed1afb11a15b7833b506d" ]
[ "src/old/QtableEnemy.py" ]
[ "import numpy as np\nfrom src.qrl.Qtable import Qtable\n\n\n# Qtable for 2-dim storing\nclass QtableEnemy(Qtable):\n def __init__(self, action_space, observation_space_1, observation_space_2):\n Qtable.__init__(self)\n self.action_space = action_space\n self.observation_space = (observation_...
[ [ "numpy.zeros" ] ]
stu314159/HPC_Introduction_with_LBM
[ "cbba81460513166b4814f3028807020be9b5c234" ]
[ "python/tlbm/prolate_spheroid/tLBM_partition.py" ]
[ "#!/usr/bin/env python3\n##!/home/users/sblair/anaconda2/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 26 14:23:52 2017\n\n@author: stu\n\"\"\"\n\nimport sys\nsys.path.insert(1,'.')\n\nimport pyPartition as pp\n#from pymetis import part_graph #<-- requires that the PrgEnv-intel module be selected\...
[ [ "numpy.meshgrid", "numpy.linspace" ] ]
zacksoliman/conditional-image-generation
[ "9f6b25d1e9dc2a3134e41ae57dc42bbe2196ed63" ]
[ "imagegen/data.py" ]
[ "import os, sys\nimport glob\nimport pickle as pkl\nimport numpy as np\nimport PIL.Image as Image\nfrom skimage.transform import resize\n\ndef resize_mscoco():\n '''\n function used to create the dataset,\n Resize original MS_COCO Image into 64x64 images\n '''\n\n ### PATH need to be fixed\n data_...
[ [ "numpy.copy", "numpy.array", "numpy.floor", "numpy.min" ] ]
wblumberg/atm-py
[ "253fc427fb366667da2d46a9af4a5d6550a13a6d" ]
[ "atmPy/aerosols/physics/aerosol.py" ]
[ "# -*- coding: utf-8 -*-\nfrom math import pi,exp,log10,sqrt,log\n\nfrom scipy.optimize import fsolve\n\nfrom atmPy.general import constants\n\n\ndef z(d, gas, n):\n \"\"\"\n Calculate electric mobility of particle with diameter D. \n \n Parameters\n -----------\n d: float\n diamet...
[ [ "scipy.optimize.fsolve" ] ]
0liu/Hyperactive
[ "cb1df3b6dcfbd6bc238439a63b490eaa50e37fce" ]
[ "tests/test_memory/test_shared_memory.py" ]
[ "import time\nimport numpy as np\nimport pandas as pd\nfrom sklearn.datasets import load_boston\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.tree import DecisionTreeRegressor\n\n\nfrom hyperactive import Hyperactive\n\n\ndata = load_boston()\nX, y = data.data, data.target\n\n\ncv = 10\n\n\ndef...
[ [ "sklearn.tree.DecisionTreeRegressor", "sklearn.model_selection.cross_val_score", "sklearn.datasets.load_boston" ] ]
yt605155624/Parakeet
[ "8ce8254adad55df07288df86cecdbf0f608b73fb" ]
[ "examples/ge2e/inference.py" ]
[ "# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.save" ] ]
cecivieira/concatenador-tabelas
[ "7f904eac4944b4184770b009b1b1ec1be092afff" ]
[ "concatenar-tabelas.py" ]
[ "import streamlit as st\nimport pandas as pd\nimport base64\n\ndef get_table_download_link(df):\n '''Essa função foi uma solução encontrada no fórum do StreamLit. Você pode encontrar a discussão aqui: https://discuss.streamlit.io/t/file-download-workaround-added-to-awesome-streamlit-org/1244\n '''\n csv = ...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
outstandingcandy/pytorchvideo
[ "c71b3c21fd670a813948b6ddf12a1ca1d01b3bc7" ]
[ "pytorchvideo/data/youcook2.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nfrom __future__ import annotations\n\nimport os\nimport json\nfrom collections import defaultdict\nfrom typing import Any, Callable, Dict, Optional, Set, Tuple, Type\nimport gensim\n\nimport torch\nfrom iopath.common.file_io import g_pathmg...
[ [ "numpy.concatenate", "torch.from_numpy", "torch.zeros" ] ]
pferreirafabricio/graphic-computation
[ "28f64673eda8796e233e8bb8de49225e6f6c5c35" ]
[ "draws/drawing-sky.py" ]
[ "import cv2\r\nimport numpy as np\r\n\r\nwidth = 400\r\nheight = 400\r\n\r\n# Colors\r\nblue = (255, 0, 0)\r\ngreen = (20, 180, 0)\r\nblack = (0, 0, 0)\r\nred = (0, 0, 255)\r\n\r\nscreen = np.ones((400, 400, 3))\r\n\r\n# cv2.line(screen, (0, 0), (width, height), blue)\r\n# cv2.line(screen, (int(width / 2), 0), (int...
[ [ "numpy.array", "numpy.ones" ] ]
MiRudnik/quantum_optimization
[ "9c63c9164d9a8620d7610cc0576a1e3ee7319d98" ]
[ "histograms.py" ]
[ "# import pandas as pd\nimport random\n\nimport matplotlib.pyplot as plt\nimport plotly.graph_objects as go\nimport numpy as np\nimport plotly.express as px\nfrom pandas import DataFrame\nfrom matplotlib.backends.backend_pdf import PdfPages\n\nres_8 = [45, 27, 15, 28, 20, 8, 19, 21, 9, 24, 3, 16, 7, 12, 6, 9, 1, 3,...
[ [ "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.subplots" ] ]
wittawatj/cadgan
[ "92f2c99f4e6c58d3b49caad8f25330f22135dfa8", "92f2c99f4e6c58d3b49caad8f25330f22135dfa8" ]
[ "cadgan/gan/fashion_mnist/dcgan.py", "cadgan/kernel_tf.py" ]
[ "import math\nimport os\n\nimport cadgan.glo as glo\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nimport torchvision.transforms as transforms\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom torchvision import datase...
[ [ "torch.nn.Dropout2d", "torch.load", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.BCELoss", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.Sigmoid", "numpy.random.normal", "torch.nn.init.normal_", "torch.nn.Upsample", "torch.nn.LeakyReLU", "torch.nn.Bat...
jackaranda/climatedash
[ "4fc279b2308d33ac64691629d063357d39cbe628" ]
[ "data/covid-19/update.py" ]
[ "import urllib.request\nimport datetime\n\ndt = datetime.datetime\n\nimport numpy as np\nimport pandas as pd\n\nBASE_URL = \"https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/\"\n\nurls = {\n\t'cases': BASE_URL + \"time_series_covid19_confirmed_global.csv\...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
nancy-nayak/rethinking-bnn
[ "f7595c13bc56c69a9f1ed6d689a0bc569f4072bf" ]
[ "latentweights/mnistLENET5.py" ]
[ "import tensorflow as tf\nimport binary_layer \nfrom tensorflow.examples.tutorials.mnist import input_data\nimport numpy as np\nfrom mnist import download_mnist\nimport pickle\nimport xlsxwriter \n\n\n\ndef conv_pool_bn(pre_layer, kernel_num, kernel_size, padding, pool_size, activation, training, epsilon=1e-4, alph...
[ [ "tensorflow.control_dependencies", "tensorflow.global_variables", "tensorflow.train.AdamOptimizer", "tensorflow.Variable", "tensorflow.get_collection", "numpy.arange", "numpy.copy", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.trainable_variables", ...
Pythonista-Haruka/awesomebook-master
[ "2060d9a16d3854ac11d43d48df32ba3bd98d8367" ]
[ "awesome_S3.py" ]
[ "import os\nimport pandas as pd\n\n# csvファイルからのダウンロード\n# 絶対パスを通すといい。ダメなら実行構成を見直すこと\nX = os.path.abspath(\"reserve.csv\")\nreserve_tb = pd.read_csv(X, encoding=\"utf-8\")\n\n# 3-1 データ数、種類数の算出\n# agg関数を用い、引数にdictionaryオブジェクトを取ることで集約処理をまとめて指定\n# result = reserve_tb\\\n# .groupby(\"hotel_id\")\\\n# .agg({\"rese...
[ [ "pandas.read_csv" ] ]
chansigit/fbm
[ "431d984f4d775de1fafa2752db9a54c39d7ed8d0" ]
[ "fbm/fbm.py" ]
[ "\"\"\"Generate realizations of fractional Brownian motion.\"\"\"\nimport warnings\n\nimport numpy as np\n\n\nclass FBM(object):\n \"\"\"The FBM class.\n\n After instantiating with n = number of increments, hurst parameter, length\n of realization (default = 1) and method of generation\n (default davies...
[ [ "numpy.matrix", "numpy.sqrt", "numpy.linspace", "numpy.fft.fft", "numpy.asarray", "numpy.random.normal", "numpy.any", "numpy.linalg.cholesky", "numpy.zeros" ] ]
Varat7v2/Person-Detection
[ "b8b33f1206839d94119f1aa7a6b7b62ec9c5048e" ]
[ "myFROZEN_GRAPH_v1.py" ]
[ "import sys\nimport time\nimport numpy as np\nimport tensorflow as tf\nimport cv2\n\nclass FROZEN_GRAPH_INFERENCE:\n \n def __init__(self, frozen_model):\n \"\"\"Tensorflow detector\n \"\"\"\n self.inference_list = list()\n self.PATH_TO_CKPT = frozen_model\n self.count = 0\n...
[ [ "tensorflow.Graph", "numpy.expand_dims", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "numpy.squeeze", "tensorflow.ConfigProto", "tensorflow.Session", "tensorflow.GraphDef" ] ]
snudm-starlab/cnn-compression
[ "8f41ea2f14d640972aabbf074fa181078edc2d53" ]
[ "src/train_test/train.py" ]
[ "\"\"\"\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements. See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership. The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you m...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.MSELoss", "torch.nn.functional.softmax" ] ]
lraszkiewicz/trax
[ "a4aff810ed8f744ce8a59ef5623a21b8f268ec66" ]
[ "trax/supervised/callbacks.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Trax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app...
[ [ "numpy.abs", "numpy.min", "numpy.nan_to_num", "numpy.max", "numpy.var", "numpy.array", "numpy.sum" ] ]
neuroelf/isic-archive
[ "3250009693bbfa1457a3df2d647a17a977af52dd" ]
[ "isicarchive/annotation.py" ]
[ "\"\"\"\nisicarchive.annotation (Annotation)\n\nThis module provides the Annotation object for the IsicApi to utilize.\n\nAnnotation objects are either returned from calls to\n\n >>> from isicarchive.api import IsicApi\n >>> api = IsicApi()\n >>> study = api.study(study_name)\n >>> annotation = study.load_a...
[ [ "numpy.asarray", "numpy.logical_and", "numpy.zeros", "numpy.random.randint" ] ]
AntonKorneev/classy_code
[ "fdc673938b3ee201d5d2fa924692a64a9bcaf466" ]
[ "Solution.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport json as js\nimport requests as req\nfrom tkinter import filedialog\nfrom tkinter import *\nimport sys\nimport pandas as pd\nimport numpy as np\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport httpagentparser as pars\nprint(\"Пожалуйста з...
[ [ "pandas.read_csv", "pandas.Series", "matplotlib.pyplot.show", "numpy.random.randint" ] ]
goodatlas/fairseq
[ "7dafb05754fe268bb5f76a1c97cf3a14062f44e5" ]
[ "fairseq_cli/train.py" ]
[ "#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nTrain a new model on one or across multiple GPUs.\n\"\"\"\n\nimport argparse\nimport logging\nimpor...
[ [ "torch.autograd.profiler.record_function", "torch.autograd.profiler.emit_nvtx", "torch.cuda.profiler.profile", "numpy.random.seed" ] ]
jwb37/LSeSim_adv
[ "97d8b10aab758a9cde713854f62314b144c5b913" ]
[ "models/cyclegan_networks.py" ]
[ "\"\"\"\nThe network architectures is based on the implementation of CycleGAN and CUT\nOriginal PyTorch repo of CycleGAN: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix\nOriginal PyTorch repo of CUT: https://github.com/taesungp/contrastive-unpaired-translation\nOriginal CycleGAN paper: https://arxiv.org/pd...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.ReflectionPad2d", "torch.Tensor", "torch.nn.Conv2d", "torch.sum", "torch.nn.Tanh", "numpy.ceil", "torch.nn.AvgPool2d", "torch.nn.LeakyReLU", "torch.nn.functional.interpolate", "numpy.mod", "torch.nn.ReLU", ...
shishirpy/highdicom
[ "bdec0b4123b1eedc3ff275f07edadca6cfe21725" ]
[ "src/highdicom/spatial.py" ]
[ "from typing import Sequence, Tuple\n\nimport numpy as np\n\n\ndef create_rotation_matrix(\n image_orientation: Sequence[float],\n) -> np.ndarray:\n \"\"\"Builds a rotation matrix.\n\n Parameters\n ----------\n image_orientation: Sequence[float]\n Cosines of the row direction (first triplet: h...
[ [ "numpy.cross", "numpy.dot", "numpy.linalg.inv", "numpy.ones", "numpy.column_stack", "numpy.array", "numpy.zeros" ] ]
neerbek/taboo-selective
[ "56b126e4aa6d08c53b33ebffe0c7d5063bc1719e" ]
[ "functionality/kmeans_cluster_ijcai18_1_201_9_exp199_search_best_k_200K.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n\nCreated on March 9, 2018\n\n@author: neerbek\n\nSearch for k values\n\"\"\"\nimport os\nos.chdir(\"../../taboo-core\")\nfrom numpy.random import RandomState # type: ignore\nfrom sklearn.cluster import KMeans # type: ignore\n\nimport ai_util\nimport confusion_matrix\nimport kme...
[ [ "numpy.random.RandomState", "sklearn.cluster.KMeans" ] ]
yingyichen-cyy/Nested-Co-teaching
[ "8b7e3ed02d8994d93dcb2011340fe28ba6012283" ]
[ "data/preprocess_sym_noise_cifar.py" ]
[ "import os \nimport PIL.Image as Image\nimport numpy as np \nfrom shutil import copyfile, copytree\nimport argparse\n\n\n## decide the size of the data subset\nparser = argparse.ArgumentParser(description='Create Symmetric Noisy Labels Dataset')\n\nparser.add_argument('--dataset', type = str, choices=['CIFAR10', 'C...
[ [ "numpy.arange", "numpy.delete", "numpy.random.seed", "numpy.random.choice" ] ]
okpoti2/cvxpy
[ "0087df795fc9472181fef1d09cd7656387bff481" ]
[ "cvxpy/tests/test_dqcp.py" ]
[ "\"\"\"\nCopyright, the CVXPY authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in...
[ [ "numpy.random.seed", "numpy.arange", "numpy.ones", "numpy.testing.assert_almost_equal", "numpy.random.randn", "numpy.array", "numpy.zeros", "numpy.isclose" ] ]
voitsik/pypima
[ "594a6f8b800950377e182b9886d1c0288d3514d0" ]
[ "pypima/raexperiment.py" ]
[ "\"\"\"\nCreated on Sun Dec 29 04:02:35 2013\n\n@author: Petr Voytsik\n\"\"\"\n\nimport logging\nimport os.path\nimport shutil\nimport subprocess\nimport threading\nfrom datetime import datetime\nfrom io import BytesIO\n\nimport numpy as np\nimport pandas as pd\nimport pycurl\n\nimport pypima.pima\n\nfrom .fri impo...
[ [ "numpy.median" ] ]
shunzgim/PyQC
[ "8bcbb5b6c5990cac578b2645c558a1fdac29bc1f" ]
[ "examples/HHL.py" ]
[ "from pyqc import *\nimport numpy as np\n\n\nif __name__ == '__main__':\n A = np.array([[1.5, 0.5],\n [0.5, 1.5]])\n t = 2*np.pi\n r = 2**4\n ########## step1 ########### 申请后端模拟器\n qubit_nums = 4\n env = Environment(simType._FULL_AMPLITUDE) \n q = env.allocateQubits(qubit_nums)...
[ [ "numpy.array" ] ]
we0091234/myYoloxTrain
[ "aa0aba21056b67be1392a60d69ea3245d4c06838" ]
[ "export_onnx.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport argparse\nimport os\nfrom loguru import logger\n\nimport torch\nfrom torch import nn\n\nfrom yolox.exp import get_exp\nfrom yolox.models.network_blocks import SiLU\nfrom yolox.utils import replace_module\n\n\...
[ [ "torch.randn", "torch.onnx._export", "torch.load" ] ]
jayholman/vmaf
[ "0bba4faf68ab89e38314cc596e6908b4fb83984d" ]
[ "python/src/vmaf/tools/reader.py" ]
[ "__copyright__ = \"Copyright 2016-2018, Netflix, Inc.\"\n__license__ = \"Apache, Version 2.0\"\n\nimport os\n\nimport numpy as np\n\nclass YuvReader(object):\n\n SUPPORTED_YUV_8BIT_TYPES = ['yuv420p',\n 'yuv422p',\n 'yuv444p',\n ...
[ [ "numpy.fromfile" ] ]
cclauss/MORAN_v2
[ "ae6b7b54d38c4eb8c0da34c923bca1e569f12a08" ]
[ "models/morn.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport numpy as np\n\nclass MORN(nn.Module):\n def __init__(self, nc, targetH, targetW, inputDataType='torch.cuda.FloatTensor', maxBatch=256):\n super(MORN, self).__init__()\n self.targetH = targetH\n self.targetW = t...
[ [ "torch.nn.functional.upsample", "numpy.expand_dims", "torch.cat", "matplotlib.pyplot.get_cmap", "torch.autograd.Variable", "numpy.arange", "torch.from_numpy", "numpy.stack", "torch.nn.functional.relu", "torch.nn.Conv2d", "torch.nn.BatchNorm2d", "numpy.transpose", ...
ashhadulislam/smote_variants
[ "7c0bc1b5d93e28bda053f2c0ac8648186de865a4" ]
[ "smote_variants/smote_v_ashhad.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Sep 15 11:15:24 2018\n\n@author: gykovacs\n\"\"\"\n\nprint(\"Imported the sv again\")\n\n# import system packages\nimport os\nimport pickle\nimport itertools\nimport logging\nimport re\nimport time\nimport glob\nimport inspect\n\n# used to par...
[ [ "scipy.spatial.Voronoi", "numpy.linalg.matrix_rank", "numpy.sqrt", "sklearn.model_selection.KFold", "numpy.all", "sklearn.cluster.AgglomerativeClustering", "numpy.exp", "numpy.where", "sklearn.preprocessing.MinMaxScaler", "tensorflow.random.set_seed", "numpy.unique", ...
Ingvarstep/spodernet
[ "b03d60e91588f234fc34fe59fe8a74a153f56b97" ]
[ "spodernet/preprocessing/processors.py" ]
[ "from __future__ import unicode_literals\nfrom os.path import join\nfrom spodernet.utils.util import Timer\nfrom spodernet.utils.util import get_data_path, save_data, make_dirs_if_not_exists, load_data, Timer\nfrom spodernet.interfaces import IAtBatchPreparedObservable\nfrom spodernet.utils.global_config import Con...
[ [ "numpy.arange", "numpy.max", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.random.RandomState" ] ]
dgketchum/etrm
[ "f74f5771fbc6ba5750a790e384eac422b598325a" ]
[ "zobs/orecharge/ETRM_distributed/ETRM_savAnMo_22APR16s.py" ]
[ "# ETRM - Evapotranspiration and Recharge Model, Point version, DISTRIBUTED\n# ETRM - Evapotranspiration and Recharge Model, Point version, DISTRIBUTED\n# David Ketchum, April 2016\nimport datetime\nimport calendar\nimport os\nfrom dateutil import rrule\nfrom osgeo import gdal\nimport numpy as np\n\nnp.set_printopt...
[ [ "numpy.maximum", "numpy.minimum", "numpy.isnan", "numpy.set_printoptions", "numpy.ones", "numpy.exp", "numpy.zeros", "numpy.where" ] ]
annis/cosmosis
[ "55efc1bc2260ca39298c584ae809fa2a8e72a38e" ]
[ "cosmosis/samplers/emcee/emcee_sampler.py" ]
[ "from .. import ParallelSampler, sample_ellipsoid\nimport numpy as np\nimport sys\n\n\ndef log_probability_function(p):\n r = emcee_pipeline.run_results(p)\n return r.post, (r.prior, r.extra)\n\n\nclass EmceeSampler(ParallelSampler):\n parallel_output = False\n supports_resume = True\n sampler_output...
[ [ "numpy.diag", "numpy.genfromtxt", "numpy.copy", "numpy.repeat", "numpy.array", "numpy.loadtxt" ] ]
kventinel/Practical_DL
[ "a2e427ce207e9869260daadfe758e2926a007f3f" ]
[ "_under_construction/week7/pretrained_lenet.py" ]
[ "from lasagne.layers import InputLayer\nfrom lasagne.layers import DenseLayer\nfrom lasagne.layers import ConcatLayer\nfrom lasagne.layers import NonlinearityLayer\nfrom lasagne.layers import GlobalPoolLayer\nfrom lasagne.layers import Conv2DLayer as ConvLayer\nfrom lasagne.layers import MaxPool2DLayer as PoolLayer...
[ [ "numpy.copy", "numpy.repeat", "numpy.array", "numpy.swapaxes" ] ]
Freyr-Wings/cse252c_hw3-release
[ "8299b52ffa39195edacddb682a03f8a4b548fbac" ]
[ "Segmentation/dataLoader.py" ]
[ "import torch\nimport numpy as np\nimport os.path as osp\nimport random\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nimport cv2\n\n\nclass BatchLoader(Dataset):\n def __init__(self, imageRoot, labelRoot, fileList, imWidth=None, imHeight=None, numClasses=21):\n super(BatchLoader, self).__i...
[ [ "numpy.random.random", "numpy.asarray", "numpy.arange", "numpy.concatenate", "numpy.ceil", "numpy.array", "numpy.zeros" ] ]
maksimt/distr-nmf
[ "e7e3bb3cb619cf1b75a01d0948921bd7d1102901" ]
[ "tests/test_tasks.py" ]
[ "import pytest\nimport numpy as np\nimport os\nfrom distr_nmf.src import tasks_nmf\nfrom distr_nmf.src.exec_config import log_mpc_filename\nimport luigi\nfrom matrixops.transform import normalize, tfidf\nfrom rri_nmf import nmf\n\n\ndef _gen_random_mat(n, d, density, random_seed=0, nnz_per_row=1):\n np.random.se...
[ [ "numpy.allclose", "numpy.random.seed", "numpy.random.choice", "numpy.save", "numpy.random.rand", "numpy.load", "numpy.zeros" ] ]
veugene/data_tools
[ "6b590bee65e69ea1e88b92cb67b360f3ec3c3c85" ]
[ "data_tools/wrap.py" ]
[ "import warnings\nimport numpy as np\n\n\nclass delayed_view(object):\n \"\"\"\n Given an array, create a view into that array without preloading the viewed\n data into memory. Data is loaded as needed when indexing into the\n delayed_view.\n \n Indexing is numpy-style, using any combination of in...
[ [ "numpy.size", "numpy.random.RandomState", "numpy.shape" ] ]
damiclem/freeda_network
[ "5f4067da5cd5e6129417e586414b7a20af8cc129" ]
[ "modules/dataset.py" ]
[ "# Dependencies\nimport numpy as np\nimport pandas as pd\n\n# Load words dataset table\ndef load_words(path):\n return pd.read_csv(path, dtype={\n 'tweet': np.unicode_,\n 'index': np.int,\n 'text': np.unicode_,\n 'pos': np.unicode_,\n 'conf': np.float \n })\n ...
[ [ "pandas.read_csv" ] ]
cjhaitman/bert_seq2seq
[ "110d5afd76944cd0ec74d72c7a16a68e90032793" ]
[ "bert_seq2seq/model/roberta_model.py" ]
[ "import logging\nimport math\nimport os\n\nimport torch\nfrom torch import nn\nfrom torch.nn import CrossEntropyLoss, MSELoss\n\ndef swish(x):\n return x * torch.sigmoid(x)\n\ndef gelu(x):\n \"\"\" \n \"\"\"\n return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))\n\ndef mish(x):\n return x * torch.t...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.sigmoid", "torch.ones", "torch.zeros", "torch.sqrt", "torch.zeros_like", "torch.nn.Embedding", "torch.nn.Tanh", "torch.nn.Linear", "torch.matmul", "torch.arange", "torch.nn.functional.softplus" ] ]
pankajdarak-xlnx/pyxir
[ "a93b785a04b6602418c4f07a0f29c809202d35bd" ]
[ "python/pyxir/quantization/quant_ops.py" ]
[ "# Copyright 2020 Xilinx 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 law or agreed ...
[ [ "numpy.min", "numpy.max", "numpy.std", "numpy.prod", "numpy.transpose", "numpy.array" ] ]
flabowski/POD-UQNN
[ "1c81be432e69d24ae894828f42918fbc1fe54bc1" ]
[ "poduqnn/pod.py" ]
[ "\"\"\"Module to handle Proper Orthogonal Decomposition tasks.\"\"\"\nimport numpy as np\nfrom numba import njit\n\n\n@njit(parallel=False)\ndef perform_pod(U, eps=0., n_L=0, verbose=True):\n \"\"\"POD algorithmm.\"\"\"\n # Number of DOFs\n n_h = U.shape[0]\n\n # Number of snapshots n_s x Number of time...
[ [ "numpy.linalg.svd", "numpy.sqrt", "numpy.ascontiguousarray", "numpy.concatenate", "numpy.zeros", "numpy.sum" ] ]
alexcwsmith/imageProcessing
[ "266afd661a299d236e5b7d34a1b867bf29277bf9" ]
[ "clearMapSubregionParser_old.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Dec 15 17:30:50 2019\n\n@author: smith\n\"\"\"\n\nimport ClearMap.IO.IO as io\nimport numpy as np\nimport pandas as pd\nimport os\n\n\nsamples = ['IA1_RT', 'IA1_RB', 'IA1_LT', 'IA1_LB', \n 'IA2_NP', 'IA2_RT', 'IA2_RB', 'IA2_LT', 'IA2...
[ [ "numpy.nonzero", "pandas.cut", "pandas.DataFrame" ] ]
TamasKormendi/tensorflow-music-generator
[ "c01b41fd7e498c06f746df731aab7f7eab74697c" ]
[ "dataloader_progressive.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport utils\nimport glob\nimport os\n\n# Positive and negative range of a 16-bit signed int\n# with this we can scale the data to [-1, 1] inclusive range\nBIT_RANGE = 32767\n\nclass Dataloader(object):\n\n def __init__(self, window_length, batch_size, filepath, num_...
[ [ "numpy.asarray", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.placeholder", "numpy.concatenate", "numpy.array" ] ]
53X/TextAttack
[ "e6a7969abc1e28a2a8a7e2ace709b78eb9dc94be" ]
[ "textattack/models/helpers/lstm_for_classification.py" ]
[ "import torch\nimport torch.nn as nn\n\nimport textattack\nfrom textattack.models.helpers import GloveEmbeddingLayer\nfrom textattack.models.helpers.utils import load_cached_state_dict\nfrom textattack.shared import utils\n\n\nclass LSTMForClassification(nn.Module):\n \"\"\" A long short-term memory neural netwo...
[ [ "torch.nn.Dropout", "torch.nn.functional.softmax", "torch.max", "torch.nn.LSTM", "torch.nn.Linear" ] ]
asmundkk/Robotics
[ "fd801b1ff35640fee99948762de720866e88e13f" ]
[ "Exersice6/problem3.py" ]
[ "from numpy import array, pi, sqrt\nfrom modern_robotics import IKinSpace\n\n\"\"\"IKinSpace:\nComputes inverse kinematics in the space frame for an open chain robot\n\n:param Slist: The joint screw axes in the space frame when the\n manipulator is at the home position, in the format of a\n ...
[ [ "numpy.array", "numpy.sqrt" ] ]
davidguzmanr/siamese-neural-networks
[ "f5ab87c92cddba760b8dbd2e8e33fc7a04cfb1de" ]
[ "siamese/train_lightning.py" ]
[ "import torch\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader, random_split\nfrom torchmetrics import Accuracy\n\nfrom torchvision import transforms\nfrom torchvision.datasets import Omniglot\n\nfrom pytorch_lightning import LightningModule\nfrom pytorch_lightning.utilities.cli import...
[ [ "torch.Generator", "torch.utils.data.DataLoader" ] ]
wmvanvliet/posthoc
[ "a011a4219cee1e80cf77895543597438f71cd299" ]
[ "posthoc/beamformer.py" ]
[ "# encoding: utf-8\nimport numpy as np\nfrom sklearn.base import TransformerMixin, RegressorMixin\nfrom sklearn.linear_model import LinearModel\n\nfrom .cov_estimators import Empirical\n\n\nclass Beamformer(LinearModel, TransformerMixin, RegressorMixin):\n '''A beamformer filter.\n\n A beamformer filter attem...
[ [ "numpy.asarray", "numpy.zeros" ] ]
Goosang-Yu/pe_library
[ "a63de7a81ce359e6c9125299a0338dea6247e645" ]
[ "source_code/miniseq_lib_barcode_sorting.py" ]
[ "import Bio.SeqIO, os\nimport pandas as pd\nimport sys, time, regex\nfrom tqdm import tqdm\n\nstart = time.time()\n\ndef main():\n sAnalysis_Tag = '63_GS_PE off-target_283T_2_1rxn_220118'\n BaseDIR = r'C:\\Users\\home\\Desktop\\220128_miniseq'\n FASTQ_file = r'%s\\%s\\%s.fastq' % (BaseDIR, sAnalysis_Tag,...
[ [ "pandas.read_csv", "pandas.Series" ] ]
WISDEM/DriveSE
[ "3edf703897ef55106b6f2574031322438b5ad326" ]
[ "src/drivese/hubse_components.py" ]
[ "\"\"\"\nhubse_components.py\nCopyright (c) NREL. All rights reserved.\n\nThis is a modified version of hubse_components.py that models the hub and spinner as spherical (rather than\ncylindrical) shapes. It is based on Excel spreadsheets by Scott Carron.\nGNS 2019 06 17\n\"\"\"\n\nimport numpy as np\nfrom math impo...
[ [ "numpy.array", "numpy.zeros", "numpy.abs" ] ]
aditya02acharya/William-s-Visual-Search
[ "b2ad7c637a0d61e5023d71463b690edfadbd99c3" ]
[ "ExperienceBuffer.py" ]
[ "import numpy as np\nimport random\nfrom GlobalConstants import TUPLE_SIZE\n\n\nclass ExperienceBuffer(object):\n\n def __init__(self, buffer_size=100000):\n self.buffer = []\n self.buffer_size = buffer_size\n\n def add(self, experience):\n\n if len(self.buffer) >= self.buffer_size:\n ...
[ [ "numpy.reshape", "numpy.array" ] ]
yhung119/show-and-tell-image-captioning
[ "6eace30dc30e3bc4bd384790b1eaf1f94d890288" ]
[ "datasets/flickr8k.py" ]
[ "import os\r\nimport torch\r\nimport numpy as np\r\nfrom torch.utils.data import Dataset\r\nimport torchvision\r\nfrom torchvision import transforms\r\nfrom PIL import Image\r\nfrom pycocotools.coco import COCO\r\nimport nltk\r\nfrom .build_vocab import Vocabulary\r\nimport pickle\r\nimport json\r\nimport argparse\...
[ [ "torch.stack", "torch.utils.data.DataLoader", "torch.Tensor" ] ]
xuzhiqi1997/pandapower
[ "d93d1af88a7a7ab7a7fc00561c07fd91bc8a029a" ]
[ "pandapower/test/control/test_const_control.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IEE), Kassel. All rights reserved.\n\nimport pytest\nimport numpy as np\nimport pandas as pd\n\nimport pandapower as pp\nimport pandapower.networks as nw\nimpo...
[ [ "numpy.array", "pandas.DataFrame" ] ]
yzjba/FATE
[ "bdda535c7d8a974fc2c43102837964b7da199730" ]
[ "federatedml/tree/hetero/hetero_secureboosting_tree_guest.py" ]
[ "#!/usr/bin/env python \n# -*- coding: utf-8 -*- \n\n#\n# Copyright 2019 The FATE 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# htt...
[ [ "numpy.max", "numpy.argmax" ] ]
mullachv/causal_notes
[ "509e1f5c9f793697949a3a6f6bfc53df85e7e9f6" ]
[ "framework/vae_snps_traits.py" ]
[ "from keras.layers import Lambda, Dense, MaxPooling2D, UpSampling2D, Input\nfrom keras.models import Model\nfrom keras.losses import mse, binary_crossentropy\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom keras import backend as K\nfrom keras.datasets import mnist\nfrom keras.utils import plot_model\nim...
[ [ "numpy.array", "matplotlib.pyplot.yticks", "matplotlib.pyplot.imshow", "matplotlib.pyplot.scatter", "numpy.linspace", "numpy.reshape", "numpy.arange", "matplotlib.pyplot.savefig", "numpy.round", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.ylabel", "matplotlib.p...
jstout211/enigma_MEG
[ "3db3e968c1d13a04ae27f1e7d77199ec0a589642" ]
[ "enigmeg/test/test_loop_process_file.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jan 28 15:55:48 2021\n\n@author: stoutjd\n\"\"\"\n\nimport pandas as pd\nimport enigmeg\nimport mne\nimport os, os.path as op\nimport shutil\n\nimport pytest\nfrom enigmeg.test_data import loop_test_data \nfrom enigmeg.test_data.get_test_data ...
[ [ "pandas.read_csv" ] ]
daemon/squawk
[ "df6443a200f8bfef7d5338d8577fc30eac4f49b9" ]
[ "squawk/data/dataset.py" ]
[ "from collections import OrderedDict\nfrom dataclasses import dataclass\nfrom pathlib import Path\nfrom typing import Mapping, Sequence\n\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.utils.data as tud\nimport torchaudio\n\nfrom squawk.ctqdm import ctqdm\n\n\n@dataclass\nclass DatasetInfo(obj...
[ [ "pandas.read_csv" ] ]
ZhecanJamesWang/MPIIGaze_Pytorch
[ "369f836d8317b57d9d0f67622d220bc1e80a8696" ]
[ "main.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\nimport os\nimport time\nimport json\nfrom collections import OrderedDict\nimport importlib\nimport logging\nimport argparse\nimport numpy as np\nimport random\nimport cv2\nimport datetime\n\nimport torch\nimport torch.nn as nn\nimport torch.optim\nimport torch.utils.data\nim...
[ [ "torch.abs", "numpy.savez", "numpy.random.seed", "torch.cuda.current_device", "torch.sqrt", "torch.manual_seed", "torch.sin", "numpy.asarray", "numpy.sin", "torch.no_grad", "torch.save", "torch.nn.MSELoss", "torch.cos", "torch.optim.lr_scheduler.StepLR" ] ...
kolk/Pea-QA
[ "bdfe90ba859833f2e86159d982bb4fa268c68af1" ]
[ "train.py" ]
[ "\n# -*- coding: utf-8 -*-\nimport json\nfrom multiprocessing import Pool\nfrom tqdm import tqdm\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialSampler, random_split\nfrom datasets import load_dataset, load_metric\nimport transformers\nfrom transformers...
[ [ "torch.device", "torch.Generator" ] ]
kelseybisson/icepyx
[ "6cf5d8faee29b5d8e04976b3a9a33c507adc7c31" ]
[ "icepyx/core/query.py" ]
[ "import datetime as dt\nimport os\nimport requests\nimport json\nimport warnings\nimport pprint\nimport time\nimport geopandas as gpd\nimport matplotlib.pyplot as plt\n\nfrom icepyx.core.Earthdata import Earthdata\nimport icepyx.core.APIformatting as apifmt\nimport icepyx.core.is2ref as is2ref\nimport icepyx.core.g...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
michalk8/anndata
[ "664e32b0aa6625fe593370d37174384c05abfd4e" ]
[ "anndata/tests/test_views.py" ]
[ "from operator import mul\n\nimport joblib\nimport numpy as np\nfrom scipy import sparse\nimport pandas as pd\nimport pytest\n\nimport anndata as ad\nfrom anndata._core.index import _normalize_index\nfrom anndata.utils import asarray\n\nfrom anndata.tests.helpers import (\n gen_adata,\n subset_func,\n slic...
[ [ "numpy.random.choice", "numpy.reshape", "numpy.arange", "scipy.sparse.csr_matrix", "numpy.ones", "numpy.all", "numpy.testing.assert_array_equal", "scipy.sparse.random", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
ternlef11/tcr-pmhc
[ "dc033ce749b38d6effa0a583440ae4889362745a" ]
[ "data/see_data.py" ]
[ "import pandas as pd\n\nthese_features = pd.read_csv(\"example.csv\")\n\nprint(these_features.head(20))\n" ]
[ [ "pandas.read_csv" ] ]
Munna-Manoj/Team7_TTS
[ "5e2d473a2afe429023876bcc51c2ac966a4938b8" ]
[ "synthesize.py" ]
[ "import torch as t\nfrom utils import spectrogram2wav\nfrom scipy.io.wavfile import write\nimport hyperparams as hp\nfrom text import text_to_sequence\nimport numpy as np\nfrom model.network import ModelPostNet, Model\nfrom collections import OrderedDict\nfrom tqdm import tqdm\nimport argparse\n\ndef load_checkpoin...
[ [ "torch.LongTensor", "scipy.io.wavfile.write", "torch.zeros", "torch.load", "torch.cat", "torch.no_grad" ] ]
IanAWatson/smu
[ "0cb07853f018b9e36cea85597b52bffde205e8d4" ]
[ "parser/smu_utils_lib.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Google Research 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 requ...
[ [ "tensorflow.io.gfile.GFile", "pandas.read_csv", "numpy.isclose", "numpy.triu_indices" ] ]
wanglifeng1022/DeepTreeAttention
[ "580e9dffbab1fb51faf1f29505897e0b5cf5693a" ]
[ "tests/test_trees.py" ]
[ "#Test main tree module, only run comet experiment locally to debug callbacks\nimport glob\nimport geopandas as gpd\nimport os\n\nis_travis = 'TRAVIS' in os.environ\nif not is_travis:\n from comet_ml import Experiment \n experiment = Experiment(project_name=\"neontrees\", workspace=\"bw4sz\")\n experiment....
[ [ "numpy.array_equal", "numpy.random.random", "pandas.DataFrame" ] ]
uditjuneja1/autokeras
[ "4770d60f343f3ed0cee689518c3ccefa263402d8" ]
[ "examples/code_reuse_example.py" ]
[ "from functools import reduce\n\nimport torch\n\nimport numpy as np\nfrom torch.utils.data import DataLoader\nfrom torchvision.transforms import Compose\n\nfrom autokeras.loss_function import classification_loss\nfrom autokeras.metric import Accuracy\nfrom autokeras.model_trainer import ModelTrainer\nfrom autokeras...
[ [ "numpy.random.random", "torch.Tensor", "numpy.concatenate", "torch.nn.Linear", "torch.no_grad", "torch.nn.ReLU", "numpy.random.randint" ] ]
joelostblom/dash-docs
[ "7be5aed7795f61ac32375ce33a18046b8f2f5254" ]
[ "dash_docs/chapters/dash_datatable/interactivity/examples/interactivity_connected_to_graph.py" ]
[ "import dash\nfrom dash.dependencies import Input, Output\nimport dash_table\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport pandas as pd\n\ndf = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder2007.csv')\n\napp = dash.Dash(__name__)\n\napp.layout = ht...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
tallamjr/shogun
[ "c964c9d1aab4bc1cf9133baf14d3bd5b96ba42de" ]
[ "examples/undocumented/python/kernel_top.py" ]
[ "#!/usr/bin/env python\nfrom tools.load import LoadMatrix\nimport shogun as sg\nimport numpy as np\nlm=LoadMatrix()\n\ntraindat = lm.load_dna('../data/fm_train_dna.dat')\ntestdat = lm.load_dna('../data/fm_test_dna.dat')\nlabel_traindat = lm.load_labels('../data/label_train_dna.dat')\n\nfm_hmm_pos=[traindat[i] for i...
[ [ "numpy.where" ] ]
ericjang/taichi
[ "641c4b83bcf98e7354b135964cd23759b0110c6b" ]
[ "tests/python/test_numpy.py" ]
[ "import taichi as ti\nimport numpy as np\n\n@ti.program_test\ndef test_numpy():\n val = ti.var(ti.i32)\n\n n = 4\n\n @ti.layout\n def values():\n ti.root.dense(ti.i, n).place(val)\n\n @ti.kernel\n def test_numpy(arr: np.ndarray):\n for i in range(n):\n arr[i] = arr[i] ** 2\n\n a = np.array([4, 8, ...
[ [ "numpy.array" ] ]
dataronio/pyGPGO
[ "c628eec39d57d25929e6961b986378a3a35ffbd7" ]
[ "examples/sineGP.py" ]
[ "#######################################\n# pyGPGO examples\n# sineGP: Fits a Gaussian Process on a sine-like function.\n#######################################\n\nimport numpy as np\nfrom pyGPGO.surrogates.GaussianProcess import GaussianProcess\nfrom pyGPGO.covfunc import squaredExponential\nimport matplotlib.pypl...
[ [ "matplotlib.pyplot.legend", "numpy.sqrt", "numpy.arange", "numpy.sin", "matplotlib.pyplot.plot", "numpy.atleast_2d", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.grid", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
shuxiaobo/Digit-image-Classify-with-one-channel
[ "ce937ac9c6b25b4aafbbdd5f6d981d96606d1e08" ]
[ "MyDateSet.py" ]
[ "from torch.utils.data.dataset import Dataset\nimport numpy as np\n\nclass MyDataSet(Dataset):\n \"\"\"Dataset wrapping images and target labels for Kaggle - Planet Amazon from Space competition.\n\n Arguments:\n A CSV file path\n Path to image folder\n Extension of images\n PIL tr...
[ [ "numpy.load" ] ]
cedadev/ipython_project
[ "fd9c85c20d3689435684cf4b681dfaab1c0a825b" ]
[ "seasonalmean.py" ]
[ "\"\"\"A module to compute the seasonal mean over a variable in a dataset.\n\nSee the run function. time_bounds may also be useful.\n\n\"\"\"\n\nfrom IPython.parallel import Client, interactive\nimport numpy\nfrom netCDF4 import MFDataset, num2date\n\n\ndef time_bounds (files, time_name = 'time'):\n \"\"\"Get f...
[ [ "numpy.array" ] ]
ypar/cimr
[ "c82dc769965969e1868808f05947d218ff74f9b7" ]
[ "cimr/processor/convertibles.py" ]
[ "#!/usr/bin/env python3\n\"\"\"Utility functions to convert between values and units\nfor downstream analyses.\ne.g. log(OR) -> effect_size\n\"\"\"\n\n__author__ = \"yoson park\"\n\n\nimport re\nimport sys\nimport numpy\nimport pandas\nimport logging\n\nfrom scipy import stats\n\nfrom .constants import (EFFECT_SIZE...
[ [ "scipy.stats.norm.ppf", "numpy.log", "numpy.absolute", "numpy.isfinite", "numpy.sign", "numpy.any", "numpy.where", "numpy.isinf" ] ]
tstirrat15/predictit_538_odds
[ "dc4ab8263ebbdd209fa03a6965c31c3a69c2cd1b" ]
[ "predictit_538_presidential.py" ]
[ "# TO DO\n# 1. Fair probability\n# 2. Hedge opportunities\n# 3. Datapane map\n# 4. Change since prior poll\n\n# Import modules\nimport json\nimport requests\nimport pandas as pd\nimport numpy as np\n\nPREDICTIT_URL = \"https://www.predictit.org/api/marketdata/all/\"\nFIVE_38_PRESIDENTIAL_POLL_URL = 'https://project...
[ [ "pandas.merge", "pandas.read_csv", "pandas.to_datetime", "pandas.concat", "pandas.DataFrame", "pandas.to_numeric" ] ]
cutz-j/CS231n
[ "f8616b19a9c6ad4a8c88610a6bf3576450a25054" ]
[ "assignment2/cs231n/data_utils.py" ]
[ "import pickle\nimport numpy as np\nimport os\nfrom imageio import imread\nDIR_CS231n = '/Users/thorey/Documents/MLearning/CS231/assignment2/'\n\n\ndef load_CIFAR_batch(filename):\n \"\"\" load single batch of cifar \"\"\"\n with open(filename, 'rb') as f:\n datadict = pickle.load(f, encoding='latin1')...
[ [ "numpy.ones", "numpy.concatenate", "numpy.mean", "numpy.array", "numpy.zeros" ] ]
Lonely-Troubadour/IoT-Data-Mining
[ "684c201fb6278dd4f443bfed32967505cf87963d" ]
[ "lab2/NaiveBayes.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Naive Bayes python implementation.\n\nHomework of IoT Information processing Lab 2. A simple implementation\nof Naive Bayes algorithm.\n\nExample:\n $ python NaiveBayes.py\n $ python NiaveBayes.py -k num_of_iterations\n $ python NaiveBayes.py -k 25\n\nAuthor: Yongjian Hu\nLi...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
kuy04195/MaskRCNN
[ "44998883fb1c73ed1a78ad9a5abd2f2c1c1a717b" ]
[ "detect.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nsys.path.append(\"Mask_RCNN\")\nimport random\nimport math\nimport re\nimport time\nimport numpy as np\nimport cv2\nimport skimage\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport PIL\n\nfrom mrcnn.config import Config\nfrom mrcnn ...
[ [ "numpy.random.choice" ] ]
fmeirinhos/pytorch-hessianfree
[ "7136c79381b1aca8d37ae8866fe185dc938f0c1e" ]
[ "hessianfree.py" ]
[ "import torch\nfrom torch.nn.utils.convert_parameters import vector_to_parameters, parameters_to_vector\nfrom functools import reduce\n\n\nclass HessianFree(torch.optim.Optimizer):\n \"\"\"\n Implements the Hessian-free algorithm presented in `Training Deep and\n Recurrent Networks with Hessian-Free Optimi...
[ [ "torch.finfo", "torch.nn.utils.convert_parameters.parameters_to_vector", "torch.isnan", "torch.cat", "torch.einsum", "torch.zeros_like", "torch.eye", "torch.dot", "torch.stack", "torch.autograd.grad", "torch.nn.utils.convert_parameters.vector_to_parameters" ] ]
mblnk/pyeventio
[ "072dbd698f3bcd8e60eff0eeddcf828615b28db8" ]
[ "eventio/scripts/plot_hists.py" ]
[ "from eventio import EventIOFile, Histograms\nimport matplotlib.pyplot as plt\nfrom eventio.search_utils import yield_toplevel_of_type\nimport numpy as np\nfrom argparse import ArgumentParser\n\n\nparser = ArgumentParser()\nparser.add_argument('inputfile')\nparser.add_argument(\n '-o', '--output-base',\n help...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "numpy.linspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.xlim", "matplotlib.pyplot.hist", "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.show", "numpy.where", "numpy.sum...
wmkouw/da-mrinv
[ "582ffc6fec59cf792e1086c1cd81a05433fd0184" ]
[ "mrainet/demos/demo_mraicnn.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom mrainet.mraicnn import MRAIConvolutionalNeuralNetwork\nfrom mrainet.util import extract_all_patches\nfrom mrainet.viz import viz_embedding\n\n'''Load data set'''\n\n# Load source MRI-scan and corresponding segmentation\nX = np.load('./data/subject01_GE2D_...
[ [ "numpy.isnan", "numpy.load", "matplotlib.pyplot.subplots" ] ]
sgg10/arsp_solver_api
[ "ad1d2f52eea58338d4f26128d5130eb326d529fb" ]
[ "app/linear_equations/factorization/partial_lu.py" ]
[ "from app.utils.methods import BaseMethod\nimport numpy as np\nfrom numpy import size, eye, zeros\n\n\nclass PartialLU(BaseMethod):\n def __init__(self, A, b):\n self.A = np.array(A)\n self.b = np.array(b)\n self.n = len(A)\n self.L = eye(self.n)\n self.U = zeros(self.n)\n ...
[ [ "numpy.dot", "numpy.eye", "numpy.ones", "numpy.concatenate", "numpy.transpose", "numpy.array", "numpy.zeros" ] ]
RuichunWang/ModelArts-Lab
[ "cfa9a853e3a76a21eac2818f055b36978ac2bb69" ]
[ "official_examples/Using_Hetero_Cluster_Framework_to_train_a_Pong_Player_with_Rllib/learner_algorithm_dir/customize_service.py" ]
[ "import os\r\nimport numpy as np\r\nimport time\r\nimport pickle\r\nimport traceback\r\nimport logging\r\nfrom http.server import SimpleHTTPRequestHandler, HTTPServer\r\nfrom socketserver import ThreadingMixIn\r\nfrom ray.rllib.agents.ppo import PPOTrainer\r\nfrom ray.rllib.env import ExternalEnv\r\nimport sys\r\ni...
[ [ "numpy.array" ] ]
vjf/LoopStructural-1
[ "de13fa3f734e21621d3ae93c6d5dab59be4f6a12" ]
[ "LoopStructural/modelling/fault/fault_segment.py" ]
[ "import logging\n\nfrom LoopStructural.modelling.fault.fault_function_feature import FaultDisplacementFeature\nfrom LoopStructural.modelling.fault.fault_function import BaseFault\nlogger = logging.getLogger(__name__)\nfrom concurrent.futures import ThreadPoolExecutor\nimport numpy as np\n\n\nclass FaultSegment:\n ...
[ [ "numpy.abs", "numpy.isnan", "numpy.linalg.norm", "numpy.copy", "numpy.zeros_like", "numpy.logical_and", "numpy.zeros" ] ]
goodenou/decisionengine_modules
[ "cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71", "cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71" ]
[ "src/decisionengine_modules/glideinwms/resource_dist_plugins.py", "src/decisionengine_modules/GCE/sources/GCEInstancePerformance.py" ]
[ "import pandas as pd\n\n_RESOURCE_FROM_COLUMN_MAP = {\n \"Grid_Figure_Of_Merit\": \"Grid_Figure_Of_Merit\",\n \"GCE_Figure_Of_Merit\": \"FigureOfMerit\",\n \"AWS_Figure_Of_Merit\": \"AWS_Figure_Of_Merit\",\n \"Nersc_Figure_Of_Merit\": \"FigureOfMerit\",\n}\n\n\ndef order_resources(resources, logger=None...
[ [ "pandas.DataFrame" ], [ "pandas.read_csv" ] ]
zhiiker/distribuuuu
[ "eaaa9229ab66a1c5f24c2a07aced21adf9af7895" ]
[ "tutorial/imagenet.py" ]
[ "\"\"\"\n(MNMC) Multiple Nodes Multi-GPU Cards Training\nMinimal ImageNet training code powered by DDP\n\"\"\"\n\nimport os\nimport subprocess\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nimport torchvision\nimport torchvision.transforms as transforms\nfrom torch.nn.parallel import Dist...
[ [ "torch.nn.CrossEntropyLoss", "torch.distributed.init_process_group", "torch.cuda.set_device", "torch.utils.data.distributed.DistributedSampler", "torch.load", "torch.utils.data.DataLoader", "torch.distributed.barrier", "torch.device", "torch.cuda.device_count", "torch.nn.pa...
ClementNguyen/slt
[ "20ee90349d1ed0655b99612ffcfae6d079116db6" ]
[ "signjoey/initialization.py" ]
[ "# coding: utf-8\n\n\"\"\"\nImplements custom initialization\n\"\"\"\n\nimport math\n\nimport torch\nimport torch.nn as nn\nfrom torch import Tensor\nfrom torch.nn.init import _calculate_fan_in_and_fan_out\n\n\ndef orthogonal_rnn_init_(cell: nn.RNNBase, gain: float = 1.0):\n \"\"\"\n Orthogonal initialization...
[ [ "torch.nn.init.uniform_", "torch.no_grad", "torch.nn.init.orthogonal_", "torch.nn.init.normal_", "torch.nn.init.xavier_uniform_", "torch.nn.init._calculate_fan_in_and_fan_out", "torch.nn.init.zeros_" ] ]
Phil1108/transformers
[ "a48f183f1f23568caed1cc4f9db71d25e17e91f1" ]
[ "src/transformers/modeling_reformer.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Trax 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 obtain a copy of t...
[ [ "torch.mean", "torch.nn.functional.dropout2d", "torch.cat", "torch.nn.functional.dropout", "torch.zeros", "torch.sum", "torch.nn.Embedding", "torch.tanh", "torch.rsqrt", "torch.no_grad", "torch.where", "torch.logsumexp", "torch.nn.Dropout", "torch.nn.CrossEn...
rmm286/backman_smooth_turning_path_generation
[ "ab4d55bc348f6dab2fc573762febc2e405af08f3" ]
[ "BackmanAlgorithm/testIterations.py" ]
[ "#!/usr/bin/env python3\nfrom SmoothPlannerClass import SmoothPathPlanner, planShortest\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport time\n\ndef testSingleSourceGoal():\n dT = 0.0005\n initialState = [0.0, 0, 0.5*np.pi, 1, 0]\n finalState = [1.0, 1.0, -0.5*np.pi, 1, 0]\n vConstraints = ...
[ [ "matplotlib.pyplot.title", "numpy.linspace", "matplotlib.pyplot.figure", "numpy.cos", "matplotlib.pyplot.savefig", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
kirakira666/ZENNKU
[ "a62905e21838967af9f16e55d954e130f596f9e3" ]
[ "examples/run_pre_train.py" ]
[ "# coding: utf-8\n# Copyright 2019 Sinovation Ventures AI Institute\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...
[ [ "torch.distributed.init_process_group", "numpy.random.seed", "torch.cuda.set_device", "torch.utils.data.distributed.DistributedSampler", "torch.manual_seed", "numpy.memmap", "torch.utils.data.DataLoader", "torch.utils.data.RandomSampler", "numpy.full", "torch.nn.DataParalle...
broadinstitute/str-analysis
[ "f9b5499200d1fbe7cf99ad1ffc84d62056f39948" ]
[ "str_analysis/generate_gnomad_json.py" ]
[ "import argparse\nimport collections\nfrom datetime import datetime\nimport gzip\nimport hashlib\nimport json\nimport math\nimport os\nimport pandas as pd\nimport pkgutil\nimport pwd\nimport requests\nimport tqdm\n\nfrom str_analysis.utils.canonical_repeat_unit import compute_canonical_motif\n\n# Map STR locus ids ...
[ [ "pandas.isna", "pandas.read_table", "pandas.concat", "pandas.merge" ] ]