repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
irfanki/EDX
[ "272e774d00d05647423fa2f77c8526ceaa30109d" ]
[ "Module2/Module2-lab5.py" ]
[ "import pandas as pd\n\n\n# TODO: Load up the table, and extract the dataset\n# out of it. If you're having issues with this, look\n# carefully at the sample code provided in the reading\n#\n# .. your code here ..\n\ndf = pd.read_html('http://www.espn.com/nhl/statistics/player/_/stat/points/sort/points/year/2015/se...
[ [ "pandas.to_numeric", "pandas.read_html" ] ]
reshamas/modin
[ "b01f91fb3a628ce374aa830964d094480f73afca" ]
[ "modin/engines/base/io/text/csv_reader.py" ]
[ "# Licensed to Modin Development Team under one or more contributor license agreements.\n# See the NOTICE file distributed with this work for additional information regarding\n# copyright ownership. The Modin Development Team licenses this file to you under the\n# Apache License, Version 2.0 (the \"License\"); you...
[ [ "pandas.io.parsers._validate_usecols_arg", "pandas.read_csv", "pandas.Series" ] ]
bretthandrews/CapsNet-Keras
[ "d9bb39688a048b965bed92114e2836c38e2a960b" ]
[ "capsulenet.py" ]
[ "\"\"\"\nKeras implementation of CapsNet in Hinton's paper Dynamic Routing\nBetween Capsules. The current version maybe only works for TensorFlow\nbackend. Actually it will be straightforward to re-write to TF code.\nAdopting to other backends should be easy, but I have not tested this.\n\nUsage:\n python cap...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.copy", "numpy.prod", "numpy.argmax", "numpy.expand_dims", "matplotlib.pyplot.show", "matplotlib.pyplot.imread" ] ]
Yifei-Liu/uts
[ "64c137d59fcd0c7c016082018d67a56abac0b28e", "64c137d59fcd0c7c016082018d67a56abac0b28e" ]
[ "test/test_sma.py", "uts/zscore.py" ]
[ "import unittest\r\nimport numpy as np\r\nimport numpy.testing as npt\r\n\r\nfrom uts import sma\r\n\r\n\r\nclass TestEMA(unittest.TestCase):\r\n def test_sma_last(self):\r\n values = np.array([[0.0, 0.0], [1.0, 2.0],\r\n [1.2, 4.0], [2.3, 6], [2.9, 8], [5, 10]])\r\n result = sma.last(values...
[ [ "numpy.testing.assert_almost_equal", "numpy.array" ], [ "numpy.average" ] ]
pnlbwh/BRAINSTools
[ "f09f74bd28ad07cd2347c2528921b1a43b97fa1d" ]
[ "AutoWorkup/logismosb/utils/fs_thickness_measurements.py" ]
[ "\"\"\"\nfs_thickness_measurements.py\n==============================\nDescription:\n\nAuthor:\n\nUsage:\n\n\"\"\"\nimport vtk\nimport SimpleITK as sitk\nimport numpy as np\nfrom scipy.spatial import distance\nfrom nipype.interfaces.freesurfer import MRIsConvert\nimport os\nimport sys\n\n\ndef read_poly_data(filena...
[ [ "numpy.array", "scipy.spatial.distance.euclidean" ] ]
check-spelling/jdaviz
[ "e02c08d68ef71c5e40600785f46e65e5ae95e236" ]
[ "jdaviz/configs/cubeviz/plugins/tests/test_data_retrieval.py" ]
[ "import pytest\nimport numpy as np\n\nfrom astropy.utils.data import download_file\n\nfrom jdaviz.app import Application\n\n# This file is originally from\n# https://data.sdss.org/sas/dr14/manga/spectro/redux/v2_1_2/7495/stack/manga-7495-12704-LOGCUBE.fits.gz\nURL = 'https://stsci.box.com/shared/static/28a88k1qfipo...
[ [ "numpy.allclose" ] ]
HermitSun/ML_for_learner
[ "3014c641800c1408668ff243395bde752c45ec43" ]
[ "tree/ID3_Clf.py" ]
[ "import pandas as pd\nimport numpy as np\n\nclass ID3:\n def __init__(self):\n self.tree = None\n self.dataset = None\n\n def __entropy(self, feature):\n uni_val, cnt = np.unique(feature, return_counts=True) # 返回独特值与计数\n # 熵的计算\n H = np.sum([(-cnt[i] / np.sum(cnt)) * np.log...
[ [ "numpy.array", "numpy.sum", "numpy.argmax", "pandas.read_csv", "numpy.unique" ] ]
bearcatt/single-shot-detector
[ "649d55aa84f1c988afd920ed8abc601512405825" ]
[ "train.py" ]
[ "import os\nimport tensorflow as tf\nimport json\nfrom model import model_fn, RestoreMovingAverageHook\nfrom detector.input_pipeline import Pipeline\ntf.logging.set_verbosity('INFO')\n\n\n\"\"\"\nThis script does the training.\nAlso it runs the evaluation now and then during the training.\n\"\"\"\n\nGPU_TO_USE = '0...
[ [ "tensorflow.logging.set_verbosity", "tensorflow.estimator.TrainSpec", "tensorflow.estimator.WarmStartSettings", "tensorflow.ConfigProto", "tensorflow.estimator.RunConfig", "tensorflow.name_scope", "tensorflow.estimator.train_and_evaluate", "tensorflow.device", "tensorflow.estim...
addman2/KvantSim
[ "7bfc56f909c6a007aac9ba973227f392c50b33e2" ]
[ "Exercises/bin/dos.plot.py" ]
[ "#!/usr/bin/env python\n\nimport sys\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nE, N = np.loadtxt(sys.argv[1], usecols = (0,1), unpack = True)\n\nplt.plot(E, N)\n\ntry:\n plt.plot([float(sys.argv[2])] * 2, [max(N),0.0],\"r-\")\nexcept:\n pass\n\nplt.xlim([min(E),max(E)])\nplt.ylim([0.0,max(N...
[ [ "numpy.loadtxt", "matplotlib.pyplot.xlim", "matplotlib.pyplot.plot" ] ]
Andreas237/cvxportfolio
[ "46910e9ac62797ffc962bd090bea9bf8eb598053", "46910e9ac62797ffc962bd090bea9bf8eb598053" ]
[ "cvxportfolio/tests/test_what_if.py", "cvxportfolio/risks.py" ]
[ "\"\"\"\nCopyright 2016 Stephen Boyd, Enzo Busseti, Steven Diamond, BlackRock Inc.\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\nUnle...
[ [ "numpy.array", "pandas.read_csv", "pandas.Series" ], [ "pandas.isnull", "numpy.diag", "numpy.sqrt", "pandas.Series" ] ]
wotmd5731/J_LAB
[ "6951dbc898f063fbbe2853a36b7caeeca10ed173", "6951dbc898f063fbbe2853a36b7caeeca10ed173" ]
[ "pytorch-r2d2_mini/r2d2.py", "nearest_plot.py" ]
[ "import torch\nimport torch.utils.data\nimport torch.optim as optim\nimport torch.nn as nn\nimport numpy as np\nfrom collections import deque\nimport random\nimport gym\nimport os\nfrom copy import deepcopy\nfrom time import time, sleep\nimport torch.multiprocessing as mp\n#mp.set_start_method('spawn', force=True)\...
[ [ "torch.multiprocessing.Process", "torch.device", "torch.cuda.is_available", "torch.multiprocessing.Queue" ], [ "numpy.random.seed", "numpy.random.rand", "matplotlib.pyplot.pause", "matplotlib.pyplot.subplots" ] ]
Camilo-Mendoza/streamlit-ML
[ "be8aafdf9f334b92a6e056e6c4f994da82587f80" ]
[ "lib/streamlit/elements/data_frame_proto.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2018-2019 Streamlit 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 requi...
[ [ "pandas.DataFrame", "numpy.array", "pandas.isna" ] ]
osim-microgrid-tool/osim_islanded_microgrids_sizing
[ "407ce32683043dbc0356fa0b2edaf537b0098b71" ]
[ "actualizar_costos.py" ]
[ "import pandas as pd\nimport numpy as np\nimport math\nimport sqlite3\nimport os\n\ndef conexion_bd(sql=None, update=True):\n \n sqlite3.register_adapter(np.int64, lambda val: int(val))\n sqlite3.register_adapter(np.int32, lambda val: int(val))\n\n con = sqlite3.connect(os.getcwd() + os.sep + \"result_o...
[ [ "pandas.read_sql_query" ] ]
SKantar/SignalProcessing
[ "c8e5e9a45c92e1d337086b60bf7eed131756dcaf" ]
[ "02_task/02_subtask.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.fftpack import fft\n\nFs = 200 # Sample frequence\nN = 150 # Number of sample points\nT = 1.0 / Fs # Sample spacing\nt = np.linspace(T, N * T, N)\n\nA = 2.3\nf = 20\nx_clear = A * np.sin(f * 2.0 * np.pi * t)\n\npowers, colors = [0, ...
[ [ "numpy.random.normal", "numpy.sin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.figure", "scipy.fftpack.fft", "numpy.sqrt", "numpy.abs", "matplotlib.pyplot.show", "numpy.linspace" ] ]
gbbDonkiKong/UdemyAI_Template
[ "9d17edc43f0342675d194f29bf45fde77e4f5f0e" ]
[ "Chapter2_Python/ListSlicing.py" ]
[ "import matplotlib.pyplot as plt\n\n\nx = [[1, 4, 3, 9],\n [3, 1, 5, 2]]\n\ny = ['red', 'blue', 'blue', 'red']\n\n# P1 (x1 = 1, x2 = 3), Klasse = 'red'\n\nx1 = x[0]\nx2 = x[1]\n\nplt.scatter(x1, x2, color=y)\n# plt.show()\n\nw = [1, 3, 6, 9, 7, 4]\nw_squared = [val**2 for val in w[1:5]]\nprint(w_squared)" ]
[ [ "matplotlib.pyplot.scatter" ] ]
dalo2903/keras-video-classifier
[ "6dcf0a1e87342bdb057df0176af6489ff926f2d8" ]
[ "demo/crime_vgg16_bilstm_hi_dim_train.py" ]
[ "import numpy as np\nfrom keras import backend as K\nimport sys\nimport os\n\n\ndef main():\n K.set_image_dim_ordering('tf')\n sys.path.append(os.path.join(os.path.dirname(__file__), '..'))\n\n from keras_video_classifier.library.recurrent_networks import VGG16BidirectionalLSTMVideoClassifier\n from ker...
[ [ "numpy.random.seed" ] ]
wolfram2012/ros_track_ssd
[ "c98d54eb923e5bae5fde4abbedda2fe5ba716606" ]
[ "scripts/pyvision/util/fast_util.py" ]
[ "import numpy as np\nfrom scipy import weave\n\n\nclass LocalMaximumDetector:\n def __init__(self,max_length=1000000):\n self.max_length = max_length\n self.maxes = np.zeros((max_length,2),dtype=np.int)\n self.vals = np.zeros((max_length,),dtype=np.float)\n \n def __call__(self, mat, t...
[ [ "scipy.weave.inline", "numpy.argsort", "numpy.zeros" ] ]
suresh-guttikonda/sim-environment
[ "cc8faec17714d58c0e1f0227c8b7d4cf8817a136" ]
[ "src/tensorflow/igibson/utils/navigate_env.py" ]
[ "#!/usr/bin/env python3\n\nfrom gibson2.envs.igibson_env import iGibsonEnv\nfrom gibson2.utils.utils import l2_distance\nfrom utils import datautils\nimport numpy as np\nimport gym\n\nclass NavigateGibsonEnv(iGibsonEnv):\n\n def __init__(\n self,\n config_file,\n scene_id=None,\n mode...
[ [ "numpy.prod", "numpy.reshape" ] ]
cdanielmachado/framed
[ "36d56437685cbf5c7c3c8ee4f6d85b8f05f4d345" ]
[ "src/framed/bioreactor/base.py" ]
[ "\"\"\" This module defines the base classes used for modeling and analyzing bioreactors\n\nAuthor: Kai Zhuang\n\n\"\"\"\nfrom __future__ import print_function\nfrom builtins import object\n__author__ = 'kaizhuang'\n\nfrom copy import deepcopy\nfrom ..solvers import solver_instance\nfrom framed.solvers.solution imp...
[ [ "numpy.array", "scipy.integrate.ode", "numpy.dot", "numpy.zeros" ] ]
michelle4654/qiskit-terra
[ "1b18ea1debf2e9d3c0c3cf39e8c434352d2b2707" ]
[ "qiskit/circuit/instruction.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ...
[ [ "numpy.allclose", "numpy.shape" ] ]
MingSun-Tse/PytorchWCT
[ "9d11cc0995c0610c129b78ff5f72a26f4d60e10a" ]
[ "Loader.py" ]
[ "from PIL import Image\nimport torchvision.transforms as transforms\nimport torchvision.utils as vutils\nimport torch.utils.data as data\nfrom os import listdir\nfrom os.path import join\nimport numpy as np\nimport torch\nimport os\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport numpy as np\n\nd...
[ [ "numpy.array" ] ]
jram098/IRG
[ "5265d61c2e67cce43a3261563b3b0f3cea27d9e4" ]
[ "irmark1/templates/complete.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nScripts to drive an IR Mark One (2) car\n\nUsage:\n manage.py (drive) [--model=<model>] [--js] [--type=(linear|categorical|rnn|imu|behavior|3d|localizer|latent)] [--camera=(single|stereo)] [--meta=<key:value> ...]\n manage.py (train) [--tub=<tub1,tub2,..tubn>] [--file=<file> ....
[ [ "tensorflow.python.keras.models.model_from_json" ] ]
vietnguyen1991/Character-level-cnn-tensorflow
[ "f4067093ef54a92fd3cd6558823fe6a06bfc5614" ]
[ "train.py" ]
[ "\"\"\"\n@author: Thang Nguyen <nhthang1009@gmail.com>\n\"\"\"\nimport os\nimport shutil\nimport numpy as np\n\nimport tensorflow as tf\n\nfrom src.character_level_cnn import Char_level_cnn\nfrom src.utils import get_num_classes, create_dataset\n\ntf.flags.DEFINE_string(\"alphabet\", \"\"\"abcdefghijklmnopqrstuvwxy...
[ [ "tensorflow.flags.DEFINE_integer", "tensorflow.global_variables_initializer", "tensorflow.Summary", "tensorflow.shape", "tensorflow.flags.DEFINE_string", "tensorflow.Variable", "tensorflow.train.Saver", "tensorflow.flags.DEFINE_float", "tensorflow.ConfigProto", "tensorflow....
shaniwein/anyway
[ "dcd13bf7dc4a120f4d697ab0c08b906f43eea52e" ]
[ "anyway/accidents_around_schools.py" ]
[ "import os\n\nimport math\nimport pandas as pd\nimport sqlalchemy as sa\nfrom sqlalchemy import or_\n\nfrom anyway.backend_constants import BE_CONST\nfrom anyway.models import AccidentMarker, Involved, School\nfrom anyway.app_and_db import db\n\nSUBTYPE_ACCIDENT_WITH_PEDESTRIAN = 1\nLOCATION_ACCURACY_PRECISE = True...
[ [ "pandas.DataFrame", "pandas.read_sql_query" ] ]
khmariem/DenseFusion
[ "e39f685e6315fc9319d47be0f859585f7dfcf288" ]
[ "vanilla_segmentation/train.py" ]
[ "import os\nimport copy\nimport random\nimport argparse\nimport time\nimport numpy as np\nfrom PIL import Image\nimport scipy.io as scio\nimport scipy.misc\nimport torch\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport torch.nn as nn\n...
[ [ "torch.manual_seed", "torch.autograd.Variable" ] ]
KimMeen/STGCN
[ "5f67ccb68aae857b92a63bd9bfcbb79dd31f4c66" ]
[ "network.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jul 20 18:30:55 2020\n\n@author: Ming Jin\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport dgl\nimport dgl.function as fn\nfrom dgl import DGLGraph\nfrom layers import TemporalConvLayer, TemporalConvLayer_Residual, SpatialConvLa...
[ [ "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.nn.ModuleList" ] ]
bbstats/xicor
[ "69d61d5cff5a0e3bc7a2d95660ed3e8e48ef0341" ]
[ "tests/xi_test.py" ]
[ "import random\nimport numpy as np\nimport pytest\n\nfrom xicor.xicor import Xi\n\n\"\"\"\nFrom Wikipedia:\nAnscombe's quartet comprises four data sets that have nearly\nidentical simple descriptive statistics, yet have very different distributions\nand appear very different when graphed. Each dataset consists of e...
[ [ "numpy.random.seed" ] ]
ZouaghiHoussem/MTCNN_68_TensorFlow
[ "b41dbda229e24d6c79d28c22d910e17fca2618c3" ]
[ "testing/test_images.py" ]
[ "#coding:utf-8\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport sys\nrootPath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), \"../\"))\nsys.path.insert(0, rootPath)\nfrom training.mtcnn_model import P_Net, R_Net, O_Net\nfrom tools.loader import TestLoader\nfrom detection.M...
[ [ "numpy.round" ] ]
elifriedman/node2vec
[ "0fade3002f84e19cfe7564b5cb9d232dfd63d1ea" ]
[ "graph2vec/node2vec.py" ]
[ "import numpy as np\nimport networkx as nx\nimport random\n\n\nclass Graph():\n def __init__(self, nx_G, is_directed, p, q):\n self.G = nx_G.to_directed() if is_directed else nx_G.to_undirected()\n self.is_directed = is_directed\n self.p = p\n self.q = q\n\n def node2vec_walk(self,...
[ [ "numpy.random.rand", "numpy.zeros" ] ]
zhangdan0602/cogdl
[ "35a338f29066e4b1a5d7f46217f09ebceaf13106", "35a338f29066e4b1a5d7f46217f09ebceaf13106" ]
[ "cogdl/models/nn/pyg_supergat.py", "cogdl/layers/gcn_layer.py" ]
[ "import random\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import Parameter\nimport torch.nn.functional as F\nfrom torch_geometric.nn.conv import MessagePassing\nfrom torch_geometric.utils import (\n remove_self_loops,\n add_self_loops,\n softmax,\n dropout_adj,\n is_u...
[ [ "torch.zeros", "torch.sigmoid", "torch.cat", "torch.stack", "torch.einsum", "torch.is_tensor", "torch.nn.functional.dropout", "torch.nn.functional.elu", "numpy.exp", "torch.nn.BatchNorm1d", "torch.tensor", "numpy.sqrt", "torch.index_select", "torch.Tensor", ...
qaute/zeitgeist
[ "6d62294571e32acc12fbb67f98adf923d5a1533b" ]
[ "audio/receiver.py" ]
[ "#!/usr/bin/python3\n\"\"\"\nreceiver.py\n\nThis file tracks an acoustic FSK signal by the phase difference between two microphones.\n\"\"\"\n\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport sounddevice as sd\nimport scipy.signal as sp\n\n# define waveform parameters\nfs = 44100 # (Hz) sam...
[ [ "numpy.sin", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.plot", "scipy.signal.butter", "matplotlib.pyplot.legend", "numpy.roll", "scipy.signal.filtfilt", "numpy.abs", "matplotlib.pyplot.show", "numpy.linspace" ] ]
oxquantum-repo/drl_for_quantum_measurement
[ "a02a8f3a7c5b40458f440a63355932409c66921c" ]
[ "QDE/offline/offline_test_run.py" ]
[ "import sys\n\nimport math\n\nsys.path.append('../')\nimport mock_pygor\n\nsys.path.append('../')\nsys.path.append('../../')\nsys.path.append('../environments')\nsys.path.append('../utilities')\nsys.path.append('../testing_code')\nsys.path.append('../data')\n\nfrom offline_test_play_episode import offline_test_play...
[ [ "tensorflow.reset_default_graph", "tensorflow.global_variables_initializer", "tensorflow.train.Saver", "tensorflow.InteractiveSession" ] ]
Matthew-Boyd/HOPP
[ "de4e40efda5bfb28361dc3d9d68d13aa465dcc52" ]
[ "examples/optimization/layout_opt/hybrid_run.py" ]
[ "\"\"\"\nA prototype application of the distributed cross-entropy method to the wind optimization problem.\nIn this basic implementation, the number of turbines is fixed and the generative distribution is uncorrelated.\n\nTODO:\n + Add boundary constraints / penalties\n + Add proximity constraints\n + Better order ...
[ [ "matplotlib.use", "matplotlib.lines.Line2D", "numpy.array", "numpy.set_printoptions", "matplotlib.animation.PillowWriter" ] ]
jonasht/pythonEstudos
[ "5e7d28e7bd82b9d1b08e795867fdbaa743f4b747" ]
[ "paraVerComoFuncionaAlgumasCoisas/pythonParaAnaliseDeDados/capitulo4-basicosobreONumPy-arrayseprocessamentovetorizado/ipython_3_criando_ndarrays.py" ]
[ "# coding: utf-8\ndata1 = [6, 7.5, 8., 0., 1.]\nimport numpy as np\narr1 = np.array(data1)\narr1\ndata2 = [[1,2,3,4], [5,6,7,8]]\narr2 = np.array(data2)\narr2\narr2.ndim\narr2.shape\narr1.dtype\narr2.dtype\nnp.zeros(3,6)\nnp.zeros(10)\nnp.zeros((3, 6))\nnp.empty((2, 3, 2))\nnp.arange(15)\n" ]
[ [ "numpy.array", "numpy.empty", "numpy.zeros", "numpy.arange" ] ]
start2020/MSGC-Seq2Seq
[ "70f8db9293c8033a4b4f03f30a0164c360c4bcd0" ]
[ "pems/originals/analyze.py" ]
[ "import pandas as pd\r\nimport numpy as np\r\nimport datetime\r\n\r\n\r\n# traffic_file = \"PeMS.h5\"\r\n# df = pd.read_hdf(traffic_file)\r\n#\r\n# data = df.values\r\n# # tmp_df = df[0]\r\n# # tmf_file_name = \"tmp.xlsx\" #保存后删除第一列\r\n# # tmp_df.to_excel()\r\n# # print(tmp_df)\r\n#\r\n# new_pf = pd.read_excel('./t...
[ [ "numpy.concatenate", "numpy.reshape", "numpy.tile", "pandas.read_hdf", "numpy.savez_compressed", "numpy.expand_dims" ] ]
Xiao-dong-Wang/gpytorch
[ "92e07cf4dae26083fe0aed926e1dfd483443924e" ]
[ "gpytorch/variational/whitened_variational_strategy.py" ]
[ "#!/usr/bin/env python3\n\nimport math\nimport warnings\n\nimport torch\n\nfrom .. import settings\nfrom ..distributions import MultivariateNormal\nfrom ..lazy import (\n BatchRepeatLazyTensor,\n CachedCGLazyTensor,\n CholLazyTensor,\n DiagLazyTensor,\n MatmulLazyTensor,\n PsdSumLazyTensor,\n R...
[ [ "torch.cat", "torch.equal", "torch.no_grad" ] ]
jannsta1/pyx4
[ "b0e72c25b8bb0e3e12d4d9de1af78cee7b13b11f" ]
[ "src/pyx4_base/test_scripts/pyx4_test_logic.py" ]
[ "#!/usr/bin/env python3\n\n\n\"\"\" ROS node to perform most of the testing logic.\n- Manage subscriptions to relevant topics\n- Parse all the data needed for testing\n- Do the testing\n- All the results are published to the /pyx4_test topic\n\"\"\"\n\nPKG = 'pyx4'\nNAME = 'pyx4_test'\n\nimport sys, time, os, csv\n...
[ [ "numpy.allclose", "numpy.array", "numpy.empty" ] ]
iesl/box-mlc
[ "15439b7e46885458d0c45d530c17f1deac0398f8" ]
[ "box_mlc/modules/hierarchy_regularizer.py" ]
[ "\"\"\"Structural Regularization for \"\"\"\nfrom torch.nn.parameter import Parameter\nfrom allennlp.common import Registrable\nfrom allennlp.data.vocabulary import Vocabulary\nfrom pathlib import Path\nfrom networkx.exception import NetworkXException\nfrom typing import List, Tuple, Union, Dict, Any, Optional\nimp...
[ [ "torch.ger", "torch._C._nn._parse_to", "torch.nn.parameter.Parameter", "torch.sum" ] ]
Dive576/vispy
[ "06bedb0e9aa410505dbe283d2c52dc9b168f8ded" ]
[ "vispy/visuals/filters/clipping_planes.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\nfrom functools import lru_cache\n\nimport numpy as np\n\nfrom ..shaders import Function, Varying\nfrom .base_filter import Filter\n\n\nclass PlanesClip...
[ [ "numpy.empty" ] ]
cemac-ccs/Faze-In_App
[ "5a937360b34357785699e36587d6457c2dd88806" ]
[ "Applications/FlaskApp/flask_app.py" ]
[ "\"\"\"Routes for core Flask app.\"\"\"\nfrom flask import current_app as app\nfrom flask import render_template, flash, redirect, url_for, request\nfrom flask import session, abort, Blueprint\n#from wtforms import Form, validators, StringField, SelectField, TextAreaField\n#from wtforms import IntegerField, Passwor...
[ [ "pandas.merge", "pandas.read_sql_query" ] ]
kevslinger/stable-baselines
[ "4bf9f3c1db49f462f5fb35df967d836d92a3dbcd" ]
[ "stable_baselines/deepq_lstm/build_graph.py" ]
[ "\"\"\"Deep Q learning graph\n\nThe functions in this file can are used to create the following functions:\n\n======= act ========\n\n Function to chose an action given an observation\n\n :param observation: (Any) Observation that can be feed into the output of make_obs_ph\n :param stochastic: (bool) if se...
[ [ "tensorflow.constant_initializer", "tensorflow.group", "tensorflow.clip_by_norm", "tensorflow.stack", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.trainable_variables", "tensorflow.shape", "tensorflow.argmax", "tensorflow...
alex-kj-chin/prototransformer-public
[ "f6c82ea0e4a1fe57f19f161d4d659db2668f7313" ]
[ "scripts/eval/robustness_exp_text.py" ]
[ "\"\"\"Evaluate accuracy for 1000 episodes on test set.\"\"\"\n\nimport os\nimport numpy as np\n\nfrom src.agents.nlp import *\nfrom src.utils.setup import process_config, process_config_from_json\nfrom src.datasets.text import *\n\n\ndef evaluate(args, gpu_device=-1):\n config_path = os.path.join(args.exp_dir, ...
[ [ "numpy.savez" ] ]
kenextra/WhatsappMessenger
[ "bde7aa81c41384983d8cd1515db38be7be49d080" ]
[ "backend-for-whatsapp/app.py" ]
[ "\"\"\" Import Libraries \"\"\"\n\nfrom flask import Flask, render_template, request, jsonify\nimport requests\nimport os\nimport json\nimport math\nimport string\nimport pandas as pd\nimport numpy as np\nimport scipy as sp\nfrom sklearn.preprocessing import OneHotEncoder, StandardScaler\nfrom sklearn.pipeline impo...
[ [ "sklearn.compose.TransformedTargetRegressor", "pandas.to_datetime", "numpy.array", "sklearn.preprocessing.StandardScaler", "pandas.DataFrame", "sklearn.compose.ColumnTransformer", "sklearn.tree.DecisionTreeRegressor", "sklearn.model_selection.train_test_split", "pandas.read_csv...
sladesha/Frcwp
[ "421e8e831343bfeeeb31cb599598f059a563bbf8" ]
[ "Frcwp/Frcwp.py" ]
[ "import pandas as pd\nimport numpy as np\nimport sys\nfrom .reshapedata import natest as _natest\nfrom .reshapedata import valuenumber, coltest, standardizeddata, formatcheck\nfrom .distince import distince\nfrom .slicing import grouped, isolationforest, iswhole\n\n\nclass Frcwp():\n '''\n param : na_rate : i...
[ [ "pandas.DataFrame", "numpy.cov", "pandas.concat" ] ]
voidism/End-to-end-ASR-Pytorch
[ "509c389fa6ab98c30e227c6f4c8f7474adbc1bb2" ]
[ "bin/train_asr.py" ]
[ "import torch\nfrom src.solver import BaseSolver\n\nfrom src.asr import ASR\nfrom src.optim import Optimizer\nfrom src.data import load_dataset\nfrom src.util import human_format, cal_er, feat_to_fig\n\n\nclass Solver(BaseSolver):\n ''' Solver for training'''\n\n def __init__(self, config, paras, mode):\n ...
[ [ "torch.nn.NLLLoss", "torch.no_grad", "torch.nn.CTCLoss", "torch.cuda.empty_cache", "torch.nn.CrossEntropyLoss", "torch.sum" ] ]
hmeine/numpy
[ "ddd02d50e8cd06d84deecd3b2943813be20b91b8" ]
[ "numpy/core/tests/test_deprecations.py" ]
[ "\"\"\"\nTests related to deprecation warnings. Also a convenient place\nto document how deprecations should eventually be turned into errors.\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\nimport sys\nimport operator\nimport warnings\nfrom nose.plugins.skip import SkipTest\n\nimport...
[ [ "numpy.array", "numpy.testing.run_module_suite", "numpy.testing.assert_warns", "numpy.testing.assert_array_equal", "numpy.float_", "numpy.float64", "numpy.bool_", "numpy.arange", "numpy.int_", "numpy.testing.assert_raises" ] ]
MorrisHuang-skipper/Serial-MD
[ "48356dc88cdc47a832fa02bc61a03d8583bb4a79" ]
[ "analysis/video.py" ]
[ "import matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport numpy as np\nfrom pylab import cm\nimport math\nfrom mpl_toolkits.mplot3d import Axes3D\nimport os\nimport sys\nimport matplotlib.gridspec as gridspec\n\nmpl.rcParams['font.family'] = 'STIXGeneral'\nplt.rcParams['xtick.labelsize'] = 16\nplt.rcParams...
[ [ "matplotlib.pyplot.figure", "numpy.loadtxt", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.gridspec.GridSpec" ] ]
jskolnicki/100-Days-of-Python
[ "146af2b73914a525121f1c91737abd4857dc2f89" ]
[ "day-32-automated-email/main.py" ]
[ "##################### Extra Hard Starting Project ######################\n\nfrom email import message\nfrom re import template\nimport pandas as pd\nimport os\nimport datetime\nimport random\nimport smtplib\nfrom csv import reader\n\nos.chdir(os.path.dirname(__file__))\n\nmy_email = \"jareds.automated.email@gmail....
[ [ "pandas.read_csv" ] ]
zju-vipa/One-GORD
[ "a63ecaf2b9538789ca0e761d55608a28d7194c4d", "a63ecaf2b9538789ca0e761d55608a28d7194c4d", "a63ecaf2b9538789ca0e761d55608a28d7194c4d" ]
[ "One-GORD/Ours-o/model.py", "AE/model.py", "One-GORD/Ours/test_getRepreCodes_forMetrics.py" ]
[ "import os, sys\r\nimport time\r\nimport re\r\nimport numpy as np\r\nimport tensorflow as tf\r\n\r\nimport sys\r\nsys.path.append('../')\r\n\r\nimport lib.models as lib\r\nfrom lib.models import params_with_name\r\nfrom lib.models.save_images import save_images\r\nfrom lib.models.distributions import Bernoulli, Gau...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.reshape", "tensorflow.nn.softmax", "tensorflow.tanh", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.set_random_seed", "tensorflow.concat", "tensorflow.train.Saver", "tensorflow.constant", "...
shafzhr/SimpleConvNet
[ "89b669a59099743f0e115526cbc156aa22f453c3" ]
[ "CNN/utils/activations.py" ]
[ "import numpy as np\nimport abc\n\n\nclass Activation(metaclass=abc.ABCMeta):\n \"\"\"\n Activation abstract class\n \"\"\"\n\n @abc.abstractmethod\n def apply(self, x, is_training):\n \"\"\"\n Applying the activation function over `x`\n \"\"\"\n pass\n\n @abc.abstractm...
[ [ "numpy.max", "numpy.where", "numpy.sum", "numpy.exp" ] ]
Enigmatisms/NeRF
[ "870abd83c9679e0735284a1641ffc0d13f0cf1d4" ]
[ "test/image_sampler_test.py" ]
[ "#-*-coding:utf-8-*-\n\n\"\"\"\n @author Enigmatisms @date 2022.3.23\n Last testing module for image sampler\n\"\"\"\n\nimport torch\nimport numpy as np\nfrom time import time\nfrom nerf_helper import imageSampling\nfrom mpl_toolkits.mplot3d import axes3d\nimport matplotlib.pyplot as plt\nfrom instances impor...
[ [ "torch.zeros", "matplotlib.pyplot.show", "torch.set_default_tensor_type", "matplotlib.pyplot.axes" ] ]
mattiafrak/Processes-Predictions-with-MP-A-Priori-Knowledge
[ "7e1bb94bb2fc535972a351f543be4f0ad8475275" ]
[ "src/train_cf.py" ]
[ "\"\"\"\nthis script trains an LSTM model on one of the data files in the data folder of\nthis repository. the input file can be changed to another file from the data folder\nby changing its name in line 46.\n\nit is recommended to run this script on GPU, as recurrent networks are quite\ncomputationally intensive.\...
[ [ "numpy.max" ] ]
dlouk/DALI
[ "d2de8841123aaf7178b7e5f82908302345dfa586" ]
[ "dali/lagrange1d.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 12 21:09:10 2018\n\n@author: Dimitris Loukrezis\n\nUnivariate Lagrange and hierarchical polynomials.\n\"\"\"\n\nimport numpy as np\n\n\nclass Lagrange1d:\n \"\"\"Univariate Lagrange nodal basis polynomial\"\"\"\n def __init__(self, current_knot, knots):\n ...
[ [ "numpy.array", "numpy.prod", "numpy.setdiff1d" ] ]
MaxKelsen/qiskit-terra
[ "1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3", "1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3" ]
[ "qiskit/algorithms/minimum_eigen_solvers/vqe.py", "test/python/algorithms/test_adapt_qaoa.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.abs", "numpy.reshape", "numpy.sqrt" ], [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.abs", "numpy.log2" ] ]
fightZero/fightZero
[ "84c2f76c7dda31837d002e47cd74936044251079" ]
[ "src/Algorithms/PPO.py" ]
[ "# an implementation of PPO algorithm\n# reference to: https://github.com/nikhilbarhate99/PPO-PyTorch\nimport torch\nimport torch.nn as nn\nfrom torch.optim import Adam, RMSprop\nfrom torch.distributions import Categorical\nfrom torch.utils.tensorboard.writer import SummaryWriter\nfrom torch.utils.data import Batch...
[ [ "torch.nn.Linear", "torch.distributions.Categorical", "torch.stack", "torch.nn.MSELoss", "torch.nn.Softmax", "torch.min", "torch.FloatTensor", "torch.nn.LeakyReLU", "torch.no_grad", "torch.clamp", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.load"...
asaladino/tf-playground
[ "c188d29077334038b2ae3afefed950f1ebb94477" ]
[ "src/basic_classification/basic.py" ]
[ "from __future__ import absolute_import, division, print_function\n\n# TensorFlow and tf.keras\nimport tensorflow as tf\nfrom tensorflow import keras\n\nfrom basic_classification.helper import prediction_for_one_image\n\nfashion_mnist = keras.datasets.fashion_mnist\n# Load the data\n(train_images, train_labels), (t...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense" ] ]
free-city-of-ulm/Hashbrowns
[ "586e665b94a2d2221009f2602a10cc862a362895" ]
[ "train.py" ]
[ "#!/bin/env python\n\nfrom __future__ import print_function\nimport numpy as np\nimport tensorflow as tf\n\nimport argparse\nimport time\nimport os\nfrom six.moves import cPickle\n\nfrom rnn.utils import TextLoader\nfrom rnn.model import Model\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_a...
[ [ "tensorflow.assign", "tensorflow.initialize_all_variables", "tensorflow.Session", "tensorflow.train.get_checkpoint_state", "tensorflow.all_variables" ] ]
valosekj/spinalcordtoolbox
[ "266bfc88d6eb6e96a2c2f1ec88c2e185c6f88e09" ]
[ "scripts/sct_compute_hausdorff_distance.py" ]
[ "#!/usr/bin/env python\n#\n# Thinning with the Zhang-Suen algorithm (1984) --> code taken from https://github.com/linbojin/Skeletonization-by-Zhang-Suen-Thinning-Algorithm\n# Computation of the distances between two skeleton\n# ---------------------------------------------------------------------------------------...
[ [ "numpy.max", "numpy.isclose", "numpy.linalg.norm", "numpy.asarray", "numpy.zeros", "numpy.round", "pandas.DataFrame", "matplotlib.pyplot.savefig", "numpy.median", "numpy.nonzero", "matplotlib.pyplot.figure", "matplotlib.pyplot.hold" ] ]
jzuhone/yt_astro_analysis
[ "417751c41696e7e230d92a918fadda5263c99d56" ]
[ "yt_astro_analysis/halo_analysis/enzofof_merger_tree.py" ]
[ "\"\"\"\nA very simple, purely-serial, merger tree script that knows how to parse FOF\ncatalogs, either output by Enzo or output by yt's FOF halo finder, and then \ncompare parent/child relationships.\n\n\n\n\"\"\"\nfrom __future__ import print_function\n\n#----------------------------------------------------------...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.intersect1d", "matplotlib.pyplot.clf", "matplotlib.pyplot.axes" ] ]
nemodrive/car_data_collection
[ "8a8bf9381edb95ca3da2c0dea37ede70d778e1a3" ]
[ "visualize.py" ]
[ "# Andrei, 2018\n\"\"\"\n Collect data.\n\"\"\"\nimport matplotlib\nmatplotlib.use('TkAgg') # <-- THIS MAKES IT FAST!\n\nfrom argparse import ArgumentParser\nimport numpy as np\nimport cv2\nimport os\nimport time\n\nfrom utils import read_cfg\nfrom get_camera import async_camera_draw\nimport matplotlib.pyplot as...
[ [ "matplotlib.use", "matplotlib.pyplot.ion", "numpy.zeros", "matplotlib.pyplot.pause", "matplotlib.pyplot.show" ] ]
MustafaTheCoder/OpenCV-Cheat-Sheet
[ "437c00c84d6699052f025ac0470d719b0d298723" ]
[ "shapes/line.py" ]
[ "import cv2\nimport numpy as np\n\nimg = np.zeros((512,512,3), np.uint8)\n\n\"\"\"\nNow as you can see this concept is a little bit difficult to understand but lets break it \ninto pieces the first parameter here is the image that will be used to draw a line on, the\nsecond paramenter is the start point of the line...
[ [ "numpy.zeros" ] ]
dromosys/open-solution-home-credit
[ "3d4cc129727c2cef16629af372ad8a9c9f14f83c" ]
[ "src/utils.py" ]
[ "import logging\nimport os\nimport random\nimport sys\nimport multiprocessing as mp\nfrom functools import reduce\n\nimport glob\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nimport yaml\nfrom attrdict import AttrDict\n\n\ndef create_submission(meta, predictions):\n submission = pd.DataFrame({...
[ [ "numpy.ceil", "pandas.merge", "numpy.random.seed", "pandas.DataFrame", "pandas.read_csv" ] ]
ByzanTine/backdoor
[ "fe3384f1fd7ebfbde2da783823a68ae258ca2896" ]
[ "utils_backdoor.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Date : 2018-11-05 11:30:01\n# @Author : Bolun Wang (bolunwang@cs.ucsb.edu)\n# @Link : http://cs.ucsb.edu/~bolunwang\n\n\nimport tensorflow as tf\nimport numpy as np\nfrom keras.preprocessing import image\nimport h5py\n\n\ndef dump_image(x, filename, format)...
[ [ "tensorflow.ConfigProto", "tensorflow.Session", "tensorflow.global_variables_initializer", "tensorflow.GPUOptions" ] ]
jnice-81/dace
[ "5211794a2d17b7189037ac485ab0b292fb02aa0d", "5211794a2d17b7189037ac485ab0b292fb02aa0d", "5211794a2d17b7189037ac485ab0b292fb02aa0d", "5211794a2d17b7189037ac485ab0b292fb02aa0d" ]
[ "samples/distributed/explicit/poly_gemm_bc.py", "tests/fpga/multibank_reduce_fpga_test.py", "samples/fpga/gemm_systolic_vectorized.py", "tests/halfvec_cudatest.py" ]
[ "# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.\n\"\"\" Explicitly distributed Gemm sample with block-cyclic distribution.\"\"\"\nimport dace as dc\nimport numpy as np\nimport os\nimport timeit\nfrom dace.sdfg.utils import load_precompiled_sdfg\nfrom mpi4py import MPI\n\nlNI = dc.symbol...
[ [ "numpy.linalg.norm", "numpy.empty", "numpy.reshape", "numpy.zeros", "numpy.median", "numpy.copy", "numpy.random.default_rng", "numpy.allclose", "numpy.transpose", "numpy.arange" ], [ "numpy.allclose", "numpy.sum", "numpy.random.rand", "numpy.zeros" ], ...
martin-fabbri/ml-pipelines
[ "62d512752d68448168493c30b00baf9318db14e8" ]
[ "reproducible-dvc/studentpredictor/create_features.py" ]
[ "from datetime import date\n\nimport pandas as pd\nfrom config import Config\n\nConfig.FEATURES_PATH.mkdir(parents=True, exist_ok=True)\n\ntrain_df = pd.read_csv(str(Config.DATASET_PATH / \"train.csv\"))\ntest_df = pd.read_csv(str(Config.DATASET_PATH / \"test.csv\"))\n\n\ndef extract_features(df):\n df[\"publish...
[ [ "pandas.to_datetime" ] ]
NingxinSu/plato
[ "94c1c0d7d8b1a1b0ff7f6d9efcf1883f314d9668" ]
[ "plato/config.py" ]
[ "\"\"\"\nReading runtime parameters from a standard configuration file (which is easier\nto work on than JSON).\n\"\"\"\nimport argparse\nimport logging\nimport os\nimport random\nimport sqlite3\nfrom collections import OrderedDict, namedtuple\n\nimport yaml\nfrom yamlinclude import YamlIncludeConstructor\n\n\nclas...
[ [ "torch.distributed.is_available", "tensorflow.config.experimental.list_physical_devices", "torch.cuda.is_available", "torch.cuda.device_count" ] ]
ch-andrei/L-IQA
[ "e0e097aec2be468f5288594de89fbe489e4afff3" ]
[ "utils/image_processing/color_spaces.py" ]
[ "import cv2\nimport numpy as np\n\nfrom utils.image_processing.image_tools import img2array, imread\n\n\n# sources:\n# https://en.wikipedia.org/wiki/Relative_luminance\n# https://www.cl.cam.ac.uk/~rkm38/pdfs/mantiuk2016perceptual_display.pdf\n# converts to linear RGB then to luminance\ndef srgb2rgb(rgb, gamma=2.4):...
[ [ "numpy.logical_not", "numpy.array", "numpy.zeros_like", "numpy.zeros", "numpy.power" ] ]
Rothdyt/codes-for-courses
[ "a2dfea516ebc7cabef31a5169533b6da352e7ccb" ]
[ "Python_IE411/simplex_method/archived/simplex_method_new.py" ]
[ "import numpy as np\nfrom simplex_step import simplex_step\nfrom simplex_init import find_negative_index\n\n\ndef simplex_init_modified(A, b, c):\n \"\"\"\n Attempt to find a basic feasible vector for the linear program\n\n max: c*x\n ST: Ax=b\n x>=0,\n\n where A is...
[ [ "numpy.matrix", "numpy.matmul", "numpy.zeros", "numpy.sum", "numpy.copy", "numpy.ones", "numpy.eye", "numpy.where", "numpy.arange", "numpy.intersect1d", "numpy.hstack" ] ]
falkamelung/isce2
[ "d22bf1048ff0f7a077981ea4fbe8e0e6bc563961" ]
[ "components/isceobj/Alos2Proc/runDenseOffset.py" ]
[ "#\n# Author: Cunren Liang\n# Copyright 2015-present, NASA-JPL/Caltech\n#\n\nimport os\nimport logging\nimport numpy as np\n\nimport isceobj\nfrom isceobj.Util.decorators import use_api\n\nlogger = logging.getLogger('isce.alos2insar.runDenseOffset')\n\ndef runDenseOffset(self):\n '''estimate offset fied\n '''...
[ [ "numpy.logical_or", "numpy.zeros", "numpy.nonzero", "numpy.memmap", "numpy.fromfile" ] ]
dmpiergiacomo/tensorflow
[ "0ecdc6dc2dbc2381c9317f274bd39281294dfc97" ]
[ "tensorflow/python/ops/array_ops.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.gen_math_ops.select", "tensorflow.python.ops.gen_array_ops.list_diff", "tensorflow.python.ops.gen_array_ops.unique_with_counts", "tensorflow.python.framework.tensor_util.constant_value", "numpy.prod", "tensorflow.python.ops.gen_array_ops.diag_part", "tensorflow.p...
JanRocketMan/regression-prior-networks
[ "3c8ffa758ee6eaa15b8afe31ac1c03f87bbf6a14", "3c8ffa758ee6eaa15b8afe31ac1c03f87bbf6a14" ]
[ "get_samples.py", "distributions/nw_prior.py" ]
[ "from argparse import ArgumentParser\n\nimport numpy as np\nimport seaborn as sns\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n\nimport torch\nfrom torchvision.transforms import ToTensor, Resize, ToPILImage\n\nfrom evaluation.show_examples import show_model_examples\nfrom utils.data_loading import load_...
[ [ "matplotlib.pyplot.clf", "torch.cat" ], [ "torch.zeros", "torch.ones" ] ]
pmkenned/data-oriented
[ "e8c5b5bca4d4615ebfe8ded968cec11436ffae26" ]
[ "zipf/pickWords.py" ]
[ "#!/usr/bin/env python\n\nimport sys\nimport gzip\nimport random\n\nhas_numpy = False\ntry:\n import numpy\n has_numpy = True\nexcept ImportError:\n pass\n\nif has_numpy:\n\n x_cnt = dict()\n x = numpy.random.zipf(1.05, 100000)\n\n for i in x:\n i -= 1\n if i in x_cnt:\n x...
[ [ "numpy.random.zipf" ] ]
tokudaek/cs231n_spring18_assignments
[ "cf10f0768d95c4bcb7d34e116fd606a019dfb6ba" ]
[ "assignment2_v2/cs231n/optim.py" ]
[ "import numpy as np\n\n\"\"\"\nThis file implements various first-order update rules that are commonly used\nfor training neural networks. Each update rule accepts current weights and the\ngradient of the loss with respect to those weights and produces the next set of\nweights. Each update rule has the same interfa...
[ [ "numpy.zeros_like" ] ]
jackwilkinson255/mbmpo_master
[ "8b1351df94dfe530efaff1118022315c8d877774", "8b1351df94dfe530efaff1118022315c8d877774", "8b1351df94dfe530efaff1118022315c8d877774" ]
[ "sandbox/ours/policies/utils.py", "sandbox/ignasi/algos/MAML/maml_ppo.py", "sandbox_maml/rocky/tf/spaces/discrete.py" ]
[ "import numpy as np\nfrom collections import OrderedDict\nfrom rllab_maml.core.serializable import Serializable\nfrom rllab.misc import logger\nfrom rllab_maml.misc.tensor_utils import flatten_tensors, unflatten_tensors\nfrom sandbox.ours.core.utils import make_dense_layer_with_bias_transform, forward_dense_bias_tr...
[ [ "tensorflow.zeros_initializer", "tensorflow.variable_scope" ], [ "numpy.mean", "tensorflow.placeholder", "tensorflow.clip_by_value", "tensorflow.stack", "tensorflow.reduce_mean" ], [ "tensorflow.placeholder", "numpy.random.randint", "numpy.asarray" ] ]
xinhezhou/ticket2ride
[ "d0edb2fdbe309e06bd2a2606c1fed35aa37c4d5f" ]
[ "nonRLplayers/frugal_player.py" ]
[ "import numpy as np\nimport random\nfrom utils.game_utils import check_path, compute_availability_matrix, get_available_routes, compute_progress\n\nclass FrugalPlayer:\n def __init__(self, num_colors, destination_cards, trains, id):\n self.cards = num_colors * [0]\n self.routes = {}\n self.d...
[ [ "numpy.argmax" ] ]
marckassay/holoviews
[ "a2b37dc70228e34ffb6fe329f0854b1ad6502636" ]
[ "holoviews/element/chart.py" ]
[ "import numpy as np\nimport param\n\nfrom ..core import util\nfrom ..core import Dimension, Dataset, Element2D\nfrom ..core.data import GridInterface\nfrom .geom import Rectangles, Points, VectorField # noqa: backward compatible import\nfrom .selection import Selection1DExpr, Selection2DExpr\n\n\nclass Chart(Datase...
[ [ "numpy.nanmax", "numpy.nanmin" ] ]
edgells/dev_coms
[ "a7e50c32bcb45c6b6781e6d0514fda6ddf8aef02" ]
[ "python/xls/pandas_use.py" ]
[ "import pandas as pd\n\n\nxls = pd.read_excel(\"C:\\\\Users\\\\pc11\\\\Desktop\\\\data.xlsx\")\n\nfor n in xls[1:100]:\n print(n)" ]
[ [ "pandas.read_excel" ] ]
broncio123/mpmodeling
[ "4910d6fc8822fd7358edeca1ed2e57383ec5bc35" ]
[ "gridscan_insert.py" ]
[ "#!/usr/bin/env python\nimport concurrent.futures\nimport sys,itertools, subprocess, isambard_dev, time, os\nimport numpy as np\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\nfrom gridscan_setup import Pdb,Crick_Parameters,BUDE_Energies,Interhelix_Interactions,HOLE_Output,SASA_Estim...
[ [ "numpy.arange" ] ]
talonchandler/polaris2
[ "2ec215edf7f63967af109661d40bc55b10d836da" ]
[ "polaris2/geomvis/R2toR.py" ]
[ "import tifffile\nimport numpy as np\nfrom polaris2.geomvis import utilmpl\nimport logging\nlog = logging.getLogger('log')\n\nclass xy:\n def __init__(self, data, px_dims=[1,1], cmap='gray', title='',\n fov=[0,1], plotfov=[0,1], vmin=None, vmax=None):\n \n self.data = data\...
[ [ "numpy.max", "numpy.linspace", "numpy.meshgrid", "numpy.abs" ] ]
wang-yuhao/Practical-Big-Data-Science-ADL-AI
[ "0bf63bf210f506e287f8492e716bb3394137d74b", "0bf63bf210f506e287f8492e716bb3394137d74b" ]
[ "scripts/use_evaluation_model_distmult.py", "scripts/use_abstract_model_distmult.py" ]
[ "import argparse\nimport pickle\nimport torch\nimport os\nimport numpy as np\nfrom src.models.api import EvaluationModel, NegSampleGenerator\nfrom torch import nn\n\n\nclass Namespace:\n def __init__(self, **kwargs):\n self.__dict__.update(kwargs)\n\n\nclass DistMult:\n\n def get_score(self, head: torc...
[ [ "numpy.concatenate", "numpy.load", "torch.tensor", "torch.nn.Parameter" ], [ "torch.device", "numpy.stack", "numpy.random.randint", "torch.nn.Embedding", "torch.sum" ] ]
zhangzhongshuai/lanedet
[ "bff96fcbed122ac0f876d8e64ada7795ca34e4b6" ]
[ "lanedet/engine/runner.py" ]
[ "import time\nimport torch\nfrom tqdm import tqdm\nimport pytorch_warmup as warmup\nimport numpy as np\nimport random\nimport cv2\n\nfrom lanedet.models.registry import build_net\nfrom .registry import build_trainer, build_evaluator\nfrom .optimizer import build_optimizer\nfrom .scheduler import build_scheduler\nfr...
[ [ "torch.manual_seed", "torch.no_grad", "numpy.random.seed" ] ]
primitybio/cellengine-python-toolk
[ "1f9dd168f1f27e2beba69f02e340371190857b33" ]
[ "tests/unit/resources/scales/test_log_scale.py" ]
[ "import pytest\nfrom math import isclose\nfrom numpy import log10\nfrom pandas import Series\n\nfrom cellengine.utils.scale_utils import apply_scale\n\n\n@pytest.fixture(scope=\"module\")\ndef scale():\n return {\"minimum\": 5, \"maximum\": 10, \"type\": \"LogScale\"}\n\n\ndef test_should_apply_scale(scale):\n ...
[ [ "numpy.log10", "pandas.Series" ] ]
FelixKleineBoesing/FeatureSelector
[ "b33454be39d53881b1c1b5b7b6dca8d782cabd36" ]
[ "tests/Tester.py" ]
[ "import pandas as pd\nimport numpy as np\nimport logging\nimport time\n\nfrom pyFeatSel.Models.Model import XGBoostModel\nfrom pyFeatSel.FeatureSelectors.CompleteFeatureSpace import CompleteFeatureSpace\nfrom pyFeatSel.FeatureSelectors.GreedySearch import GreedySearch\nfrom pyFeatSel.Evaluator.Evaluator import Accu...
[ [ "numpy.array", "pandas.read_csv" ] ]
taghizad3h/Top2Vec
[ "0237989ecd6a28df184b6a2b245239c501676da2" ]
[ "top2vec/Top2Vec.py" ]
[ "# Author: Dimo Angelov\n#\n# License: BSD 3 clause\nimport logging\nimport numpy as np\nimport pandas as pd\nfrom gensim.models.doc2vec import Doc2Vec, TaggedDocument\nfrom gensim.utils import simple_preprocess\nfrom gensim.parsing.preprocessing import strip_tags\nimport umap\nimport hdbscan\nfrom wordcloud import...
[ [ "numpy.argmin", "numpy.where", "sklearn.preprocessing.normalize", "numpy.sort", "sklearn.feature_extraction.text.CountVectorizer", "numpy.inner", "sklearn.cluster.dbscan", "numpy.max", "scipy.special.softmax", "numpy.argmax", "numpy.append", "numpy.vstack", "mat...
AlessandroLaRocca96/vision
[ "d4195587166134c3806ae81458d08b06f5e00295" ]
[ "test/fakedata_generation.py" ]
[ "import os\nimport contextlib\nimport tarfile\nimport json\nimport numpy as np\nimport PIL\nimport torch\nfrom common_utils import get_tmp_dir\nimport pickle\nimport random\nfrom itertools import cycle\nfrom torchvision.io.video import write_video\nimport unittest.mock\nimport hashlib\nfrom distutils import dir_uti...
[ [ "torch.zeros", "torch.randint", "torch.tensor", "numpy.zeros" ] ]
MoisesHer/incubator-mxnet
[ "73d1b055d04a0f0f511a9cc2dd46ae2eb03a8628", "73d1b055d04a0f0f511a9cc2dd46ae2eb03a8628" ]
[ "tests/python/unittest/onnx/test_node.py", "tests/python/gpu/test_operator_gpu.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.array", "numpy.random.choice", "numpy.testing.assert_equal", "numpy.testing.assert_almost_equal", "numpy.shape", "numpy.prod" ], [ "numpy.random.normal", "numpy.array", "numpy.random.rand", "numpy.reshape", "numpy.zeros", "numpy.ones", "numpy.random.s...
Yoo-Youngjae/One-Shot-Object-Detection
[ "c560a3dfb042776854bb928682dbbf545e2cd1bf" ]
[ "lib/roi_data_layer/roibatchLoader.py" ]
[ "\n\"\"\"The data layer used during training to train a Fast R-CNN network.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch.utils.data as data\nfrom PIL import Image\nimport torch\nfrom collections import Counter\n\nfrom scipy...
[ [ "numpy.concatenate", "torch.nonzero", "numpy.array", "numpy.ceil", "numpy.random.choice", "torch.min", "torch.max", "torch.FloatTensor", "numpy.random.shuffle", "torch.from_numpy", "scipy.misc.imread", "numpy.where", "torch.Tensor", "numpy.unique", "nump...
DIAGNijmegen/adhesion_detection
[ "21a9c810a4dee3c640d31f30ee5fdff1bbce9146" ]
[ "src/vs_definitions.py" ]
[ "import numpy as np\nfrom pathlib import Path\nfrom enum import Enum, unique\nfrom cinemri.contour import Contour\nfrom config import *\n\n@unique\nclass VSExpectationNormType(Enum):\n # Division by mean\n mean_div = 0\n # Standardize with std\n standardize = 1\n\n\n# Transformation to apply to visceral...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.min", "numpy.random.shuffle", "numpy.atleast_1d", "numpy.arange", "numpy.column_stack", "numpy.array_split" ] ]
Munazza12/Python
[ "b550e3bf8a5468602bec4f23b4d4d1f2f696342f" ]
[ "01_matplotlib.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"01_Matplotlib.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1kcVik8w7TtrXYaCSklntRqq2av-7N7-6\n\n#Introduction to Matplotlib\n\n![alt text](https://matplotlib.org/_static/logo2.png)\n\nMatplotlib is the \...
[ [ "numpy.random.normal", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.boxplot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylab...
wangvei/PyDEF-2.0
[ "ee5bd0a01d241e5df45ccbf10f3c27e1b796418b" ]
[ "pydef_core/follow_convergence_OSZICAR.py" ]
[ "\"\"\"\n 12/12/17\n\tSimple script to follow convergence from OSZICAR file\n author: Adrien Stoliaroff\n email: adrien.stoliaroff@cnrs-imn.fr\n\"\"\"\nimport matplotlib.pyplot as plt\n\ndef isInt(s):\n try: \n int(s)\n return True\n except ValueError:\n return False\n\n#Read OSZ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.gcf", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot" ] ]
jim-fun/evidently
[ "eb3479b8ce39e43601fb2d1ffbf61e0624541865" ]
[ "evidently/tests/test_readme_examples.py" ]
[ "import json\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn import datasets\nfrom unittest import TestCase\n\nfrom evidently import ColumnMapping\nfrom evidently.dashboard import Dashboard\nfrom evidently.model_profile import Profile\nfrom evidently.profile_sections import DataDriftProfileSection, CatTarg...
[ [ "pandas.concat", "pandas.DataFrame", "sklearn.datasets.load_iris", "numpy.random.random" ] ]
hoopoe/face_liveness_detection
[ "834963001ee36b36264624b3c2fbec90f2343ce3" ]
[ "ML/train_keras.py" ]
[ "from __future__ import print_function\nimport os \nfrom tqdm import tqdm\nimport cv2\nimport numpy as np \nimport argparse\n\nimport keras\nfrom keras.datasets import mnist\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Flatten\nfrom keras.layers import Conv2D, MaxPooling2D\nfrom ke...
[ [ "numpy.array", "sklearn.preprocessing.OneHotEncoder" ] ]
Potgront/ABM
[ "76fef2c7ded7e362ecf72fffd82512b9d7926700" ]
[ "src/SA.py" ]
[ "\"\"\"\nScript to perform sobol analysis of the model.\nModified from the example sobol analysis notebook on canvas.\n\nThe variable parameters are specified in the problem dictionary.\n\"\"\"\nfrom SALib.sample import saltelli\nfrom SALib.analyze import sobol\nfrom mesa.batchrunner import BatchRunnerMP\nfrom mode...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.rcParams.update", "matplotlib.pyplot.gcf", "matplotlib.pyplot.axvline" ] ]
seung-lab/NeuroglancerAnnotationUI
[ "0429b93330b7aa83f4c591564978b3ceb9229374" ]
[ "src/nglui/easyviewer/base.py" ]
[ "from .. import nglite as neuroglancer\nfrom . import annotation, utils\nfrom numpy import issubdtype, integer, uint64, vstack\nfrom collections import OrderedDict\nimport copy\nimport re\n\nSEGMENTATION_LAYER_TYPES = [\"segmentation\", \"segmentation_with_graph\"]\n\n\nclass EasyViewer(neuroglancer.Viewer):\n \...
[ [ "numpy.uint64", "numpy.vstack" ] ]
jonbinney/trajectory_smoothing
[ "0e2b8d7d646c96c0c22eef1371bcd42d169121dc" ]
[ "traj/scripts/synchronized_traj_example.py" ]
[ "#!/usr/bin/env python3\n'''\nexample to check the joint motion synchronization algorithm [full trajectory] \n'''\nimport numpy as np\nimport math\nimport traj\nfrom matplotlib import pyplot as plt\nimport rospy\n\nrospy.init_node('traj_synchronization', log_level=rospy.DEBUG)\n# limits, option_1: same limits that ...
[ [ "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots" ] ]
1129ljc/video-inpainting-detection
[ "9a1aea6268f3ab2ba2f60c526ddf35ccc8350e04" ]
[ "Unet/test.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport torch\nfrom torchvision import transforms\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data import Dataset\n\nfrom postprocessing import post_deal\n\nclass IID_Dataset(Dataset):\n def __init__(self, dataset):\n self.input_size = (512, 512)\n...
[ [ "torch.no_grad", "torch.utils.data.DataLoader", "torch.load", "numpy.zeros" ] ]
alexquach/responsible-ai-widgets
[ "6208f72a5dc14b955f0e8b7b2203d0cd74f32497", "6208f72a5dc14b955f0e8b7b2203d0cd74f32497" ]
[ "erroranalysis/erroranalysis/_internal/surrogate_error_tree.py", "erroranalysis/erroranalysis/_internal/cohort_filter.py" ]
[ "# Copyright (c) Microsoft Corporation\n# Licensed under the MIT License.\n\nimport numpy as np\nimport pandas as pd\nfrom lightgbm import LGBMClassifier, LGBMRegressor\nfrom enum import Enum\nfrom erroranalysis._internal.cohort_filter import filter_from_cohort\nfrom erroranalysis._internal.constants import (PRED_Y...
[ [ "numpy.array", "sklearn.metrics.mean_squared_error", "pandas.DataFrame", "sklearn.metrics.median_absolute_error", "sklearn.metrics.mean_absolute_error", "sklearn.metrics.r2_score", "sklearn.metrics.precision_score", "sklearn.metrics.f1_score", "sklearn.metrics.recall_score" ]...
eipm/CIN
[ "1cde66166f40a1921eaec4d65bea5d2da201ca8b" ]
[ "Codes/MLP/MLP.py" ]
[ "# Train top MLP and evaluate model performance\n\n# %%\nimport numpy as np\nimport pandas as pd\nimport random as rand\nimport skimage\nfrom skimage import io,feature, filters,color\nfrom skimage.exposure import rescale_intensity\nimport re\nimport os\nimport shutil\nimport matplotlib.pyplot as plt \nimport tensor...
[ [ "tensorflow.keras.metrics.AUC", "numpy.save", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "tensorflow.keras.metrics.BinaryAccuracy", "sklearn.preprocessing.MinMaxScaler", "tensorflow.keras.models.Sequential", ...
svpcoder/tensorboard
[ "70753476c7aad3a5cb3eb4047994af1bcf3524b6" ]
[ "tensorboard/loader.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.errors.raise_exception_on_not_ok_status", "tensorflow.gfile.Walk", "tensorflow.compat.as_bytes", "tensorflow.compat.as_text", "tensorflow.Event", "tensorflow.logging.debug", "tensorflow.gfile.Stat" ] ]
Horki/CarND-Behavioral-Cloning-P3
[ "d6c7a3d35749f4e995fb14d38bf370755b60a466" ]
[ "gen_3/model.py" ]
[ "import csv\nimport numpy as np\nfrom scipy import ndimage\n\nfrom keras.models import Sequential\nfrom keras.layers import Flatten, Dense, Lambda\nfrom keras.layers.convolutional import Convolution2D\nfrom keras.layers.pooling import MaxPooling2D\n\nDATA_PATH='../data'\n# DATA_PATH='../behavioral_data/all'\nDRIVI...
[ [ "numpy.array" ] ]