repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
jmcnamara/pandas
[ "da59b112e73dc4139f09f85a4203c67795a72634" ]
[ "pandas/tests/test_strings.py" ]
[ "# pylint: disable-msg=E1101,W0612\n\nfrom datetime import datetime, timedelta, date\nimport os\nimport operator\nimport re\nimport warnings\n\nimport nose\n\nfrom numpy import nan as NA\nimport numpy as np\nfrom numpy.testing import assert_array_equal\nfrom numpy.random import randint\n\nfrom pandas.compat import ...
[ [ "numpy.array_equal", "pandas.compat.u", "pandas.compat.range", "pandas.core.strings.str_startswith", "pandas.DataFrame", "pandas.util.testing.assert_isinstance", "pandas.core.strings.str_count", "numpy.arange", "pandas.util.testing.assert_produces_warning", "numpy.random.ra...
nicoladimauro/SPFlow
[ "80fb4fab074dd541b32d79cf272af134316a581d" ]
[ "src/spn/structure/leaves/histogram/Histograms.py" ]
[ "'''\nCreated on March 20, 2018\n\n@author: Alejandro Molina\n'''\nimport numpy as np\n\nfrom spn.structure.Base import Leaf\nfrom spn.structure.StatisticalTypes import MetaType, Type\n\nrpy_initialized = False\n\n\ndef init_rpy():\n if rpy_initialized:\n return\n\n from rpy2 import robjects\n from ...
[ [ "numpy.max", "numpy.histogram", "numpy.array", "numpy.isnan", "numpy.asarray", "numpy.sum", "numpy.roll", "numpy.min", "numpy.linspace", "numpy.var" ] ]
lukaszplk/boosting
[ "93299e2f33cadf5e23a3d4a0ccd7b86915fc33c0" ]
[ "adaboost.py" ]
[ "# For this basic implementation, we only need these modules\nfrom sklearn.datasets import load_breast_cancer\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.ensemble import AdaBoostClassifier\n\n# Load the well-known Breast Cancer dataset\n# Spli...
[ [ "sklearn.model_selection.train_test_split", "sklearn.ensemble.AdaBoostClassifier", "sklearn.tree.DecisionTreeClassifier", "sklearn.datasets.load_breast_cancer" ] ]
IBM/vsrl-framework
[ "673001eabcd310699d980ad442f3856f60f6e1cf" ]
[ "vsrl/utils/visualization.py" ]
[ "#\n# Copyright (C) 2020 IBM. All Rights Reserved.\n#\n# See LICENSE.txt file in the root directory\n# of this source tree for licensing information.\n#\n\n\"\"\"\nClasses and functions to visualize results of trained agents.\n\nThis is only intended to be used within a Jupyter notebook.\n\"\"\"\n\nimport gzip\nimp...
[ [ "numpy.concatenate", "numpy.array", "numpy.load", "numpy.save", "numpy.mean", "numpy.std", "numpy.stack" ] ]
zhujiagang/co-cn
[ "4ea18441fa1842eb5d87a90ab8f28f3d803ef1a5" ]
[ "co_cn/net/conv1_4.py" ]
[ "# The based unit of graph convolutional networks.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom .net import conv_init\n\n\nclass conv1_4(nn.Module):\n def __init__(self,\n in_channels):\n super(conv1_4, self).__init__()\...
[ [ "torch.nn.Conv2d", "torch.nn.BatchNorm2d", "torch.nn.MaxPool2d" ] ]
Bierbunker/Lab-Tool
[ "cb65fa4b39135708045c0da161e9e5e0c908623c" ]
[ "tests/test_UArray.py" ]
[ "import numpy as np\nimport pandas as pd\nimport uncertainties.unumpy as unp\nimport random\nfrom labtool_ex2.uarray import UArray\n\n\nuarr = UArray(unp.uarray(random.sample(range(0, 100), 10), list(random.sample(range(0, 100), 9) + [np.nan]))) # type: ignore\nuarr = UArray(list(uarr) + [1, 2, 3])\nprint(uarr)\np...
[ [ "pandas.DataFrame" ] ]
pholtz/cyclo-analyzer
[ "8cf2a485bd160332f0b361969b5fbf459be28444" ]
[ "multi_plot.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport datetime\nimport calendar\nimport pathlib\nimport statistics\nimport pandas as pd\nimport numpy as np\nimport seaborn\nimport matplotlib.pyplot as plt\nfrom activity import Activity, create_activity, parse_activities_csv, build_activity_dataframe,...
[ [ "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.show", "matplotlib.pyplot.clf", "pandas.pivot_table" ] ]
vincentiusmartin/teacup
[ "8a6c829a3d9121596b07e11949a996b1607d5590" ]
[ "src/teacup/training/trainingparser.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport itertools\nimport scipy\nimport subprocess\n\nfrom sklearn import tree\nfrom sklearn import metrics\nfrom sklearn import ensemble\nfrom sklearn import svm\nfrom sklearn import linear_model\nfrom sklearn import naiv...
[ [ "pandas.read_csv", "pandas.DataFrame", "matplotlib.pyplot.savefig", "sklearn.tree.export_graphviz", "scipy.interp", "numpy.array", "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.title", "sklearn.model_selection.KFold", "matplotlib.pyplot.clf", "sklearn.me...
Skopos-team/Prostagma
[ "a6d0a0df421cd3740d3761486dc15d56e81dbc02" ]
[ "main.py" ]
[ "import argparse\nimport shutil\nimport numpy as np\n\nfrom project.data_preprocessing.preprocessing import Preprocessor\nfrom project.data_preprocessing.data_loader import Loader\nfrom project.models.model import Model\n\nfrom prostagma.techniques.grid_search import GridSearch\nfrom prostagma.performances.cross_va...
[ [ "numpy.random.seed" ] ]
justinhyou/project-z
[ "6fd3f5bf1a30a69d92c0f6a488bc862cc014aa7e" ]
[ "DataSupplier.py" ]
[ "import json\nimport pandas as pd\n\nfrom DataTypeSource import DataTypeSource\n\nclass DataSupplier:\n\n COUNTY_DATA = DataTypeSource.COUNTY.name + \".csv\"\n STATE_DATA = DataTypeSource.STATE.name + \".csv\"\n\n def __init__(self):\n return\n\n def __getDataFrame(self, fileName):\n retur...
[ [ "pandas.read_csv" ] ]
int-chaos/FLAML
[ "99667dad5f4931120551b56aa9a955b4ff0e6f15" ]
[ "test/automl/test_forecast.py" ]
[ "import numpy as np\nfrom flaml import AutoML\n\n\ndef test_forecast_automl(budget=5):\n # using dataframe\n import statsmodels.api as sm\n\n data = sm.datasets.co2.load_pandas().data[\"co2\"].resample(\"MS\").mean()\n data = (\n data.fillna(data.bfill())\n .to_frame()\n .reset_inde...
[ [ "pandas.to_datetime", "pandas.read_csv", "numpy.arange" ] ]
JanekEbb/paderbox
[ "7cd3bf92380e05ec856936d21a64d0a8a3ff0fca", "7cd3bf92380e05ec856936d21a64d0a8a3ff0fca", "7cd3bf92380e05ec856936d21a64d0a8a3ff0fca" ]
[ "paderbox/visualization/matplotlib_fix.py", "tests/utils_test/test_tbf_to_tbchw.py", "paderbox/io/audiowrite.py" ]
[ "import os\nimport matplotlib\n\n# Fix matplotlib when no display is available\n# https://github.com/ipython/ipython/pull/10974\nif os.environ.get('DISPLAY', '') == '':\n if matplotlib.get_backend() in [\n 'module://ipykernel.pylab.backend_inline', # %matplotlib inline\n 'NbAgg', # %matplotlib no...
[ [ "matplotlib.use", "matplotlib.get_backend" ], [ "numpy.random.uniform" ], [ "numpy.asarray", "numpy.sum", "scipy.io.wavfile.write", "numpy.abs", "numpy.clip", "numpy.iinfo", "numpy.dtype" ] ]
Neronjust2017/keras-project
[ "919e67e10b0bf518eb9cc63df68c79fe2bb71b36", "919e67e10b0bf518eb9cc63df68c79fe2bb71b36", "919e67e10b0bf518eb9cc63df68c79fe2bb71b36" ]
[ "NAS/files/kerastuner/applications/metric.py", "models/classification/resnet_attention.py", "NAS/auto-keras/inceptiontime.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras import backend as K\n\ndef recall(y_true,y_pred):\n \"\"\"Recall metric.\n\n Only computes a batch-wise average of recall.\n\n Computes the recall, a metric for multi-label classification of\n how many relevant items are selected.\n...
[ [ "tensorflow.keras.backend.clip", "tensorflow.keras.backend.epsilon" ], [ "numpy.concatenate", "tensorflow.keras.layers.Add", "tensorflow.keras.layers.GlobalAveragePooling1D", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Activation", "tensorflow.keras.models.Model",...
alekseiliachko/w-ml
[ "e31603346bb32e6aa5c5127b3afa01f827ec520c" ]
[ "m-learn/l5/task8.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nfrom matplotlib import pyplot as plt\r\nfrom sklearn import preprocessing, svm\r\nfrom sklearn.linear_model import LinearRegression\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.svm import SVR\r\nfrom sklearn.metrics import mean_squared_error\r...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.linspace", "matplotlib.pyplot.figure", "sklearn.svm.SVR", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
TheoMathurin/holoviews
[ "e1234a60ae0809ac561c204b1998dff0452b2bf0" ]
[ "holoviews/operation/stats.py" ]
[ "import param\nimport numpy as np\n\nfrom ..core import Dimension, Dataset, NdOverlay\nfrom ..core.operation import Operation\nfrom ..core.util import cartesian_product, isfinite\nfrom ..element import (Curve, Area, Image, Distribution, Bivariate,\n Contours, Polygons)\n\nfrom .element import ...
[ [ "numpy.empty", "numpy.zeros", "scipy.stats.gaussian_kde", "numpy.linspace", "numpy.full_like" ] ]
varun1423/NeuralSolvers
[ "0036319ec3e7cd570a029aa5e154d0bc995ae9ce" ]
[ "PINNFramework/models/Finger_Net.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass FingerNet(nn.Module):\n def __init__(self, lb, ub, numFeatures = 500, numLayers = 8, activation = torch.relu, normalize=True, scaling=1.):\n torch.manual_seed(1234)\n super(FingerNet, self).__init__()\n\n self.numFeatures = numFeatures\n s...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.init.xavier_uniform_", "torch.manual_seed", "torch.tensor" ] ]
SebastianBruijns/pgmult
[ "60631edda247486532b3269d0954b91bad7b8159" ]
[ "test/geweke_test.py" ]
[ "\"\"\"\nSimple Geweke test for the PG-augmented Multinomial distribution\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import norm, probplot\n\nfrom pgmult.distributions import PGMultinomial\n\ndef geweke_test(K, N_iter=10000):\n \"\"\"\n \"\"\"\n # Create a multinomial ...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure", "scipy.stats.probplot", "numpy.eye", "matplotlib.pyplot.hist", "numpy.sqrt", "matplotlib.pyplot.show" ] ]
yuagnun/HauntedTweet
[ "04b31ac23cb52e68aa60f7d22e5ae0da96c35646" ]
[ "data/word2vec.py" ]
[ "#!/usr/bin/env python\n'''Referred to TensorFlow word2vec tutorial\n(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/word2vec/word2vec_basic.py), \nwhich follows Apache License, Ver. 2.0.'''\nimport tensorflow as tf\nimport numpy as np\nimport math\nimport os.path\nfrom six.moves...
[ [ "numpy.random.choice", "numpy.random.rand", "tensorflow.matmul", "tensorflow.nn.embedding_lookup", "tensorflow.global_variables_initializer", "tensorflow.nn.nce_loss", "tensorflow.set_random_seed", "tensorflow.argmax", "tensorflow.random_uniform", "tensorflow.Variable", ...
zhz44/mindspore
[ "6044d34074c8505dd4b02c0a05419cbc32a43f86" ]
[ "mindspore/python/mindspore/dataset/engine/datasets_user_defined.py" ]
[ "# Copyright 2019-2022 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 applica...
[ [ "numpy.array", "numpy.frombuffer" ] ]
supercatnguyen/rank_convai2
[ "53f4880c152d9ba7e93883ef6941ba25024fd4ec" ]
[ "parlai/core/torch_agent.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\nfrom parlai.cor...
[ [ "torch.no_grad", "torch.save", "torch.cuda.device", "torch.topk", "torch.cuda.is_available", "torch.LongTensor", "torch.load", "torch.Tensor", "torch.set_num_threads" ] ]
igoumiri/MuyGPyS
[ "f60e67108a94d556ab330645bc792acbb84a8a3a" ]
[ "MuyGPyS/gp/muygps.py" ]
[ "# Copyright 2021 Lawrence Livermore National Security, LLC and other MuyGPyS\n# Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: MIT\n\n\"\"\"MuyGPs implementation\n\"\"\"\n\nimport numpy as np\n\nfrom typing import Dict, Generator, Optional, Tuple, Union\n\nfrom Muy...
[ [ "numpy.array", "numpy.zeros", "numpy.eye" ] ]
dwadden/longchecker
[ "9efdc2f13130146dfea187c76037e69008ad62d5" ]
[ "longchecker/allennlp_feedforward.py" ]
[ "from typing import List, Union\n\nimport torch\n\n\nclass ConfigurationError(Exception):\n pass\n\n\nclass FeedForward(torch.nn.Module):\n \"\"\"\n This `Module` is a feed-forward neural network, just a sequence of `Linear` layers with\n activation functions in between.\n # Parameters\n input_dim...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.ModuleList" ] ]
Storvild/python_examples
[ "52b0b486fee442bf4b49a13cf8e609cdf4e02e0b" ]
[ "qt/qt_sample_qtchart.py" ]
[ "#!e:\\virtualenvs\\qt\\qt_env36\\Scripts\\python.exe\n# -*- coding: utf-8 -*-\n#\n# Licensed under the terms of the MIT License\n# Copyright (c) 2015 Pierre Raybaut\n\n\"\"\"\nSimple example illustrating Qt Charts capabilities to plot curves with \na high number of points, using OpenGL accelerated series\n\"\"\"\n...
[ [ "numpy.linspace", "numpy.sin", "numpy.cos", "numpy.frombuffer" ] ]
goswamig/training_results_v0.7
[ "f5bb59aa0f8b18b602763abe47d1d24d0d54b197", "f5bb59aa0f8b18b602763abe47d1d24d0d54b197", "f5bb59aa0f8b18b602763abe47d1d24d0d54b197", "f5bb59aa0f8b18b602763abe47d1d24d0d54b197", "f5bb59aa0f8b18b602763abe47d1d24d0d54b197" ]
[ "Google/benchmarks/minigo/implementations/minigo-research-TF-tpu-v4-128/selfplay_timing.py", "Google/benchmarks/minigo/implementations/minigo-research-TF-tpu-v4-128/oneoffs/cbt_eval_sgfs.py", "Google/benchmarks/bert/implementations/bert-research-TF-tpu-v4-512/dataset_input.py", "Google/benchmarks/minigo/imple...
[ "# Lint as: python3\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.io.gfile.glob", "tensorflow.io.gfile.GFile" ], [ "tensorflow.compat.v1.gfile.Glob" ], [ "tensorflow.compat.v1.parse_single_example", "tensorflow.compat.v1.to_int32", "tensorflow.compat.v1.logging.info", "tensorflow.compat.v1.data.TFRecordDataset", "tensorflow.co...
mrriteshranjan/ColossalAI
[ "0d057a1bae67b915a385be7edab7da83413cb645" ]
[ "colossalai/nn/layer/moe/experts.py" ]
[ "import math\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nfrom colossalai.global_variables import moe_env\r\nfrom colossalai.context import ParallelMode, seed\r\nfrom colossalai.utils import get_current_device\r\n\r\n\r\nclass MoeExperts(nn.Module):\r\n\r\n def __init__(self, comm: str):\r\n super().__...
[ [ "torch.nn.Dropout", "torch.cat", "torch.nn.init.trunc_normal_", "torch.baddbmm", "torch.nn.GELU", "torch.chunk" ] ]
anhquannguyen21/Cholesky-Factorization
[ "3a6e589ff8211a4f85163431d062821dec357ce2" ]
[ "CholeskyNumpy.py" ]
[ "import numpy as np\n\nA=np.array([[1,-2j],[2j,5]])\nprint(A)\n\n#A=L.dot(L^H) with A is positive definite matrix and L is lower triangular matrix.\n\nL=np.linalg.cholesky(A)\nprint(L)\nprint(L.dot(L.T.conj()))\n\na=np.array([[4,12,-16],[12,37,-43],[-16,-43,98]])\n\nL=np.linalg.cholesky(a)\nprint(L)\nL_T=L.transpos...
[ [ "numpy.array", "numpy.linalg.cholesky" ] ]
lukaselmer/ethz-data-mining
[ "cb4215c202efc37f3626a25c8301a4ac36813493" ]
[ "2-svm/code/gen_test_data.py" ]
[ "#!/usr/bin/env python2.7\n\nimport sys\nimport math\nimport numpy as np\nimport scipy\nfrom sklearn import linear_model\nfrom sklearn.svm import LinearSVC\n\n#from sklearn.multiclass import OneVsRestClassifier\n#from sklearn.svm import LinearSVC\n#from sklearn.metrics import accuracy_score\n#from sklearn import cr...
[ [ "numpy.random.random" ] ]
ArneBinder/Pytorch-LRP
[ "c17902138f1d560f1f5d38f401ac856e071a5800", "c17902138f1d560f1f5d38f401ac856e071a5800" ]
[ "nitorch/data.py", "nitorch/transforms.py" ]
[ "import numpy as np\nimport nibabel as nib\nfrom scipy.ndimage.interpolation import zoom\nimport matplotlib.pyplot as plt\nimport nibabel\nimport os\n\ndef load_nifti(file_path, dtype=np.float32, incl_header=False, z_factor=None, mask=None):\n \"\"\"\n Loads a volumetric image in nifti format (extensions .nii...
[ [ "numpy.rot90", "numpy.isnan", "matplotlib.pyplot.subplots", "scipy.ndimage.interpolation.zoom", "matplotlib.pyplot.tight_layout" ], [ "numpy.max", "numpy.zeros_like", "numpy.asarray", "torch.min", "torch.max", "numpy.min", "numpy.mean", "torch.from_numpy", ...
phasorhand/PyTorchText
[ "dcadcba44af0c3731b82d9db1c77f2968d4feac0" ]
[ "scripts/data_process/embedding2matrix.py" ]
[ "#coding:utf8\n\n'''\n将embedding.txt 转成numpy矩阵\n'''\n\n\nimport word2vec\nimport numpy as np\n\ndef main(em_file, em_result):\n '''\n embedding ->numpy\n '''\n em = word2vec.load(em_file)\n vec = (em.vectors)\n word2id = em.vocab_hash\n # d = dict(vector = vec, word2id = word2id)\n # t.save(...
[ [ "numpy.savez_compressed" ] ]
shufay/pyscf
[ "c7ea840b012a59fce5fa4114ef3274a7cf00165e" ]
[ "pyscf/pbc/tools/pywannier90.py" ]
[ "# Copyright 2014-2020 The PySCF Developers. 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 r...
[ [ "scipy.io.FortranFile", "numpy.arccos", "numpy.dot", "numpy.exp", "numpy.sign", "numpy.cos", "numpy.sin", "numpy.linalg.norm", "numpy.empty", "numpy.eye", "numpy.prod", "numpy.arange", "numpy.sqrt", "numpy.int32", "numpy.cross", "numpy.mod", "num...
MaxKinny/kaggle_SMILE-Kinship-Recognizing
[ "a8f1878931cb472a6c6caa8b2fb7a3e0a03d805c" ]
[ "code/vgg_face_senet.py" ]
[ "from collections import defaultdict\nfrom glob import glob\nfrom random import choice, sample\n\nimport cv2\nimport numpy as np\nimport pandas as pd\nfrom keras.callbacks import ModelCheckpoint, ReduceLROnPlateau\nfrom keras.layers import Input, Dense, GlobalMaxPool2D, GlobalAvgPool2D, Concatenate, Multiply, Dropo...
[ [ "numpy.array", "pandas.read_csv" ] ]
vineeths96/FashionMNIST
[ "ec8684e21296b84c78e08ee074a0aada62e10641" ]
[ "CNN/model_test.py" ]
[ "import os\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\nimport tensorflow as tf\nfrom CNN.model_parameters import *\n\n# Uncomment for generating plots. Requires some libraries (see below)\n\"\"\"\nimport seaborn as sns\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nfrom sklearn.metrics import confusion_m...
[ [ "tensorflow.keras.models.load_model" ] ]
seasonZhu/AnimationSpider
[ "10c1e84eb2fb198560b554390fe415c538d42c5a" ]
[ "Other Spider/beike_new_house.py" ]
[ "import requests\nimport json\nimport pandas as pd\nfrom bs4 import BeautifulSoup\n\ncolumns = ['title', 'place', 'msg', 'perMeter', 'price']\n\n# 通过select获取信息\ndef getInfo(soup, selector):\n infoString = '未知'\n info = soup.select(selector)\n if len(info) > 0:\n infoString = info[0].get_text().repla...
[ [ "pandas.DataFrame" ] ]
uibcdf/MolSysMT
[ "9866a6fb090df9fff36af113a45164da4b674c09" ]
[ "molsysmt/forms/classes/attic/bck_api_openmm_Topology.py" ]
[ "from os.path import basename as _basename\nfrom simtk.openmm.app import Topology as _simtk_openmm_app_Topology\nfrom numpy import array as _array, unique as _unique, ndenumerate as _ndenumerate, concatenate as _concatenate\nfrom numpy import arange as _arange, hstack as _hstack, empty as _empty\n\nform_name=_basen...
[ [ "numpy.array", "numpy.arange", "numpy.unique" ] ]
lordqyxz/lifelines
[ "5c8a7b136e2fd341836772745af009504947ea9e" ]
[ "lifelines/tests/test_estimation.py" ]
[ "# -*- coding: utf-8 -*-\nimport warnings\n\n# pylint: disable=wrong-import-position\nwarnings.simplefilter(action=\"ignore\", category=DeprecationWarning)\n\nfrom collections import Counter, Iterable\nimport os\nimport pickle\nfrom itertools import combinations\n\nfrom io import StringIO, BytesIO as stringio\n\nim...
[ [ "numpy.testing.assert_allclose", "numpy.ones_like", "numpy.random.rand", "scipy.stats.invweibull", "numpy.minimum", "numpy.random.exponential", "numpy.not_equal", "numpy.median", "numpy.exp", "numpy.mean", "numpy.min", "numpy.where", "numpy.linalg.norm.rvs", ...
YounessDataV/batch9_dyslexia
[ "ec40ac0b79e7269ddc543e55ddc7a241ca313524" ]
[ "dyslexia/io/load_image.py" ]
[ "from typing import Union, IO\nfrom pathlib import Path\nfrom PIL import Image, ExifTags\nimport cv2\nimport numpy as np\n\n\ndef crop_black_border(img):\n tmp = img.copy()\n \n if len(img.shape) == 3:\n tmp = cv2.cvtColor(tmp, cv2.COLOR_BGR2GRAY)\n\n _, thresh = cv2.threshold(tmp, 1, 255, cv2.TH...
[ [ "numpy.array" ] ]
russelldj/BiSeNet
[ "d29fa741ad5275fab9e1bfc237b02811acf73b98" ]
[ "lib/coco.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\nimport os\nimport os.path as osp\nimport json\n\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport torch.distributed as dist\nimport cv2\nimport numpy as np\n\nimport lib.transform_cv2 as T\nfrom lib.sampler import RepeatedDistSampler\nfrom lib.b...
[ [ "numpy.arange" ] ]
Edinburgh-Genome-Foundry/zymp
[ "a0a90be8c09a230f01015971323cab88abf0aa6d" ]
[ "zymp/stacked_sites_array.py" ]
[ "import numpy as np\nfrom dnachisel.biotools import reverse_complement\nfrom Bio import Restriction\nimport proglog\n\nfrom .tools import (\n enzymes_to_dna_pattern,\n get_enzymes_ATGC_sequences,\n find_patterns_matches,\n reverse_complement,\n)\n\n\ndef sites_difference(site1, site2):\n \"\"\"Return...
[ [ "numpy.random.rand", "numpy.random.shuffle" ] ]
GOMTAE/Hummingbird_PPO
[ "e25646587b050d507febd20d9b11ef86c321d7e0" ]
[ "scripts/plotting/plot_example.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport random\n\ndf_motor = pd.read_csv('/home/ubuntu/bagfiles/3r_mon/4r/motor.csv', header=0)\ndf_odom = pd.read_csv('/home/ubuntu/bagfiles/realistic/real_gt_odom.csv', header=0)\nprint(df_motor)\nprint(df_motor.colum...
[ [ "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.hlines" ] ]
nilsmechtel/stereopy
[ "cd8f34b45ae6667043611e5d02ea46f8ca3f0c7b" ]
[ "stereo/preprocess/normalize.py" ]
[ "#!/usr/bin/env python3\n# coding: utf-8\n\"\"\"\n@author: Ping Qiu qiuping1@genomics.cn\n@last modified by: Ping Qiu\n@file:normalize.py\n@time:2021/03/05\n\nchange log:\n add basic functions of normalization. by Ping Qiu. 2021/03/05\n Refactor the code and add the quantile_norm function. by Ping Qiu. 2021/...
[ [ "pandas.DataFrame" ] ]
obodroid/Hierarchical-Localization
[ "932ff78ee19c44a817011ac1f9de9616a64c3064" ]
[ "hloc/get_intrinsics_db.py" ]
[ "import cv2\nimport logging\nimport numpy as np\nfrom pathlib import Path\n\nfrom .utils.read_write_model import (\n read_cameras_binary, read_images_binary, read_model, write_model,\n qvec2rotmat, read_images_text, read_cameras_text)\n\ndef create_list_with_intrinsics(model, out, list_file=None, ext=...
[ [ "numpy.array" ] ]
emrysj/msi-explore
[ "92637607054229a51cbd64451aeafc297e2e6241" ]
[ "UMAPvis6.py" ]
[ "#import tkinter as tk\n#from tkinter import filedialog\nfrom bokeh.layouts import gridplot, column\nfrom bokeh.models import ColumnDataSource,CustomJS, LassoSelectTool, BoxSelectTool, Slider, Select, RadioButtonGroup, Button, TextInput, HoverTool, TapTool\nfrom bokeh.models.annotations import Title\nfrom bokeh.plo...
[ [ "numpy.max", "numpy.reshape", "numpy.round", "pandas.DataFrame", "numpy.min", "numpy.mean", "numpy.flipud", "numpy.arange", "pandas.read_csv", "sklearn.decomposition.PCA", "numpy.log2" ] ]
lizhaoliu-Lec/CrowdDet
[ "89ad2ad722d06b0d97cf1d2dbc66c823ca582f96" ]
[ "lib/evaluate/compute_JI.py" ]
[ "import os\nimport sys\nimport math\nimport argparse\nfrom multiprocessing import Queue, Process\n\nfrom tqdm import tqdm\nimport numpy as np\n\nfrom .JIToolkits.JI_tools import compute_matching, get_ignores\n\nsys.path.insert(0, '../')\nimport utils.misc_utils as misc_utils\n\ngtfile = '/data/annotation_val.odgt'\...
[ [ "numpy.sum", "numpy.array", "numpy.arange", "numpy.min" ] ]
ctw/nilearn
[ "932eee9c69cd8fbf40ee6af5cee77f8f93b25da3", "932eee9c69cd8fbf40ee6af5cee77f8f93b25da3" ]
[ "nilearn/reporting/_visual_testing/_glm_reporter_visual_inspection_suite_.py", "nilearn/regions/tests/test_rena_clustering.py" ]
[ "\"\"\"\nThis file contains a bunch of functions run via __main__().\nThe functions represent feature comprehensive examples\nto visualize, inspect, and test the functionality\nof nistats.reporting.make_glm_reports().\n\nDisable any of the function calls in the __main__()\nto run a specific script and save time.\n\...
[ [ "numpy.array", "pandas.DataFrame", "numpy.ones", "numpy.load", "numpy.eye", "numpy.linspace", "numpy.vstack" ], [ "numpy.copy" ] ]
arifmudi/Advanced-Deep-Learning-with-Python
[ "083f63dfc0c5f404143552ea20d560b06ec303f5" ]
[ "Chapter02/transfer_learning_tf_keras.py" ]
[ "\"\"\"\nThis example is partially based on https://github.com/tensorflow/docs/blob/master/site/en/tutorials/images/transfer_learning.ipynb\n\nCopyright 2018 The TensorFlow Authors. All rights reserved.\nCopyright 2019 Ivan Vasilev.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not ...
[ [ "tensorflow.image.random_flip_left_right", "tensorflow.image.random_flip_up_down", "tensorflow.keras.applications.ResNet50V2", "tensorflow.one_hot", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure", "tensorflow.keras.layers.Dense", "tensorflow.ke...
lhr-solar/Array-Sim-Training
[ "e7372ee4ed094f1527e5cdbc1817108d93acace8" ]
[ "ArraySimulation/PVSource/PVCell/PVCellIdeal.py" ]
[ "\"\"\"\nPVCellIdeal.py\n\nAuthor: Matthew Yu, Array Lead (2020).\nContact: matthewjkyu@gmail.com\nCreated: 11/14/20\nLast Modified: 11/26/20\n\nDescription: Derived class of PVCell that implements an ideal model tuned to\nthe Sunpower Maxeon III Bin Le1 solar cells.\n\"\"\"\n# Library Imports.\nfrom math import ex...
[ [ "numpy.log" ] ]
tyo-yo/ImageMorphing
[ "7740287d6ad55d8eaecd81ab958007d118833699" ]
[ "tests/test_render.py" ]
[ "import unittest\nimport cv2\nimport numpy as np\nfrom image_morphing.render import render_animation\n\nclass TestRender(unittest.TestCase):\n def test_render(self):\n img0 = cv2.imread('tests/data/nbb/original_A.png')\n img1 = cv2.imread('tests/data/nbb/original_B.png')\n v = np.load('tests...
[ [ "numpy.load" ] ]
Abigail-Wood/CRAFT
[ "e262f1e557e543482139a8c4eb38d8b2dc10767f" ]
[ "craft/finemap.py" ]
[ "import sys\nimport os\nimport tempfile\n\nimport pandas as pd\n\nimport craft.config as config\n\ndef finemap(data_dfs, index_df, file_dir, n_causal_snps):\n \"\"\" Runs Finemap and LDStore on each SNP locus.\n\n Finemap(v1.3.1) was created by Christian Brenner (http://www.christianbenner.com/) and uses summ...
[ [ "pandas.DataFrame" ] ]
vwozhaoxin/cs224n_homework
[ "202c571e1e0ed378d0353bb263c1e3e59c118aef" ]
[ "assignment3/q3_gru.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nQ3: Grooving with GRUs\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\n\nimport argparse\nimport logging\nimport sys\nimport time\nfrom datetime import datetime\n\nimport tensorflow as tf\nimport numpy as np\n\nimport matp...
[ [ "tensorflow.gradients", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.set_random_seed", "tensorflow.trainable_variables", "matplotlib.pyplot.savefig", "tensorflow.variable_scope", "numpy.arange", "tensorflow.get_variable_sco...
youqad/oxford-hack-2020
[ "7c4bf02f0dc52ce99cee721a3b7b3344060018f2" ]
[ "smaa_noob.py" ]
[ "import torch\nimport numpy as np\nimport pyro\nimport matplotlib.pyplot as plt\nfrom pyro.infer import MCMC, NUTS\nfrom pyro.distributions import Normal, Dirichlet, Uniform\n\ndef utility(critVal, weight_val): \n return critVal.dot(weight_val).item()\n\ndef crit_alt_matrix(number_alternatives, number_criterion)...
[ [ "torch.zeros", "torch.FloatTensor", "torch.zeros_like", "torch.ones" ] ]
GDaglio/adversarial-attacks-pytorch
[ "7634571539351a12cd90b32d69e4f53678273f46" ]
[ "torchattacks/attacks/eotpgd.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom ..attack import Attack\n\n\nclass EOTPGD(Attack):\n r\"\"\"\n Comment on \"Adv-BNN: Improved Adversarial Defense through Robust Bayesian Neural Network\"\n [https://arxiv.org/abs/1907.00895]\n\n Distance Measure : Linf\n\n Arguments:\n model (nn.Mod...
[ [ "torch.clamp", "torch.autograd.grad", "torch.zeros_like", "torch.nn.CrossEntropyLoss", "torch.empty_like" ] ]
pcmagic/stokes_flow
[ "464d512d3739eee77b33d1ebf2f27dae6cfa0423" ]
[ "try_code/try_cython/try_solveu.py" ]
[ "import solveu\nimport numpy as np\n\n\ndef myfun():\n a = 1.1\n out = np.ones((1))\n solveu.try1(a, out)\n PETSc.Sys.Print(out)\n\n\nif __name__ == '__main__':\n myfun()\n" ]
[ [ "numpy.ones" ] ]
justaboutlola/improved-wgan-pytorch
[ "5bb0b729809152d9129ef72a9dd28b3ff83021a2" ]
[ "libs/plot.py" ]
[ "import numpy as np\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nimport collections\nimport pickle\n\n_since_beginning = collections.defaultdict(lambda: {})\n_since_last_flush = collections.defaultdict(lambda: {})\n\n_iter = [0]\ndef tick():\n\t_iter[0] += 1\n\ndef plot(name, valu...
[ [ "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf" ] ]
Billmvp73/attention-sampling
[ "6ac4ef44a438a1ab25ce97f18a185c87defbcdff" ]
[ "scripts/trafficSign_utils.py" ]
[ "import argparse\nfrom collections import namedtuple\nfrom functools import partial\nimport hashlib\nimport urllib.request\nimport os\nfrom os import path\nimport string\nimport sys\nimport zipfile\nimport json\nimport subprocess\nfrom cv2 import imread, imwrite, VideoCapture, resize\nimport cv2\nimport keras.backe...
[ [ "numpy.float32", "numpy.random.shuffle" ] ]
martinwellman/odm-qpcr-analyzer
[ "05c2af3b76bbb15ff0df5b4a146f91508fc91e1a" ]
[ "qpcr_analyzer/qpcr_utils.py" ]
[ "#%%\n\"\"\"\nqpcr_utils.py\n=============\n\nSome miscellaneous helper utilities and variables used by the QPCR code.\n\"\"\"\n\nimport yaml\nfrom easydict import EasyDict\nimport numpy as np\nfrom openpyxl.utils import get_column_letter\nfrom openpyxl.utils import units\nimport re\nimport pandas as pd\n\nOUTLIER_...
[ [ "pandas.DataFrame", "pandas.isna" ] ]
pserel/stock_price_forecasting
[ "6b20608378e26b9ad6d0c98f18695bb24cbfd17c" ]
[ "lstm_data_structure.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 3 22:19:27 2019\n\n@author: SERELPA1\n\"\"\"\n\n# Creating a data structure with n_past timesteps and n_future outputs\nimport numpy as np\n\ndef lstm_data_structure(ds, n_past = 25, n_future = 25, n_features = 1):\n \n X_train = []\n y_train = []\n \n ...
[ [ "numpy.array" ] ]
mdjoh/FIFA-data-app
[ "bb836aaa2807dc1cca365debf081010e6fab25aa" ]
[ "app.py" ]
[ "from flask import Flask, render_template, request\nfrom sklearn.externals import joblib\nimport os\nimport pandas as pd\nimport numpy as np\n\napp = Flask(__name__, static_url_path='/static/')\n\n\n@app.route('/')\ndef form():\n return render_template('index.html')\n\n@app.route('/future_rate_prediction')\ndef ...
[ [ "sklearn.externals.joblib.load", "pandas.read_csv" ] ]
abhishek-kumar41/K-means-Clustering
[ "c8f41c204e4b41c54afbefcf3fb34120eff95c4a" ]
[ "k_means_clustering.py" ]
[ "import glob\nimport librosa\nimport numpy as np\nfrom sklearn.cluster import KMeans\n\np_data_wav_train=[]\nt_data_wav_train=[]\nk_data_wav_train=[]\nb_data_wav_train=[]\nd_data_wav_train=[]\ng_data_wav_train=[]\n\nfor i in range(1,4):\n p_data_path_wav_train = 'PTKBDG/*/*p*' + str(i) + '.wav'\n p_data_wav_t...
[ [ "numpy.array", "sklearn.cluster.KMeans", "numpy.zeros" ] ]
tintinrevient/detectron2
[ "59069d9a20104ca2eb87773ba39280d522f2e345" ]
[ "projects/DensePose/visualize_rect_segm.py" ]
[ "from detectron2.utils.logger import setup_logger\nsetup_logger()\n\nimport cv2, os, re\nimport numpy as np\nfrom detectron2.engine import DefaultPredictor\nfrom detectron2.config import get_cfg\nfrom densepose.config import add_densepose_config\nfrom densepose.vis.extractor import DensePoseResultExtractor\nimport ...
[ [ "numpy.dot", "numpy.argmin", "numpy.tile", "numpy.min", "numpy.mean", "numpy.load", "numpy.where", "scipy.spatial.ConvexHull", "numpy.cos", "numpy.max", "numpy.sin", "numpy.empty", "pandas.DataFrame", "numpy.nanmin", "numpy.sqrt", "numpy.nanmax", ...
Yongjin-colin-choi/TorchSemiSeg
[ "8e2bacfd76ee8ab7c7e5c8e37ce4a4fcb0ef6371" ]
[ "exp.city/city8.res50v3+.CPS+CutMix/network.py" ]
[ "# encoding: utf-8\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nfrom functools import partial\r\nfrom collections import OrderedDict\r\nfrom config import config\r\nfrom base_model import resnet50\r\n\r\nclass Network(nn.Module):\r\n def __init__(self, num_classes, crite...
[ [ "torch.cat", "torch.nn.functional.avg_pool2d", "torch.nn.LeakyReLU", "torch.nn.functional.interpolate", "torch.nn.CrossEntropyLoss", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.pad", "torch.randn" ] ]
guowenhao787938711/EFPN-detectron2
[ "1a381027cc19845afb88461bd5c96fa0fd75f449" ]
[ "detectron/modeling/backbone/bp_resnet.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport logging\nimport numpy as np\nimport fvcore.nn.weight_init as weight_init\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom detectron2.layers import (\n CNNBlockBase,\n Conv2d,\n DeformConv,\n ModulatedDeformConv,\n ...
[ [ "torch.nn.Linear", "torch.nn.functional.relu_", "torch.flatten", "torch.nn.Sequential", "torch.nn.init.normal_", "numpy.prod", "torch.nn.AdaptiveAvgPool2d" ] ]
vjaltare/er_and_plasticity_in_ca1_spine
[ "318a467ae1a7b09d868746709a55da953cf2330e" ]
[ "generate_mellor_like_bursts.py" ]
[ "import numpy as np\nfrom numpy.random import *\n\ndef get_tBurst(beta):\n \"\"\"returns a Poison spike train with parameter beta = 1/lambda\"\"\"\n seed(100)\n t_max = 20 #s\n tBurst = exponential(beta, 1000)\n tBurst = np.cumsum(tBurst)\n tBurst2 = []\n for i in range(tBurst.shape[0]):\n ...
[ [ "numpy.array", "numpy.insert", "numpy.cumsum" ] ]
jrzaurin/autogluon
[ "b7dbed302c4181f9160b2f8f88f73c1fa37941cd" ]
[ "tabular/src/autogluon/tabular/trainer/model_presets/presets.py" ]
[ "import copy\nimport inspect\nimport logging\nimport warnings\nfrom collections import defaultdict\n\nfrom sklearn.linear_model import LogisticRegression, LinearRegression\n\nfrom autogluon.core.metrics import soft_log_loss, mean_squared_error\nfrom autogluon.core.constants import AG_ARGS, AG_ARGS_FIT, AG_ARGS_ENSE...
[ [ "sklearn.linear_model.LogisticRegression", "sklearn.linear_model.LinearRegression" ] ]
cis-ncbj/ideep
[ "b57539e4608e75f80dbc5c2784643d5f2f242003", "b57539e4608e75f80dbc5c2784643d5f2f242003" ]
[ "python/ideep4py/tests/mm/test_mdarray_set_mm.py", "python/ideep4py/tests/mm/testing/random.py" ]
[ "import ideep4py # NOQA\nimport numpy\nimport testing\nfrom ideep4py import mdarray\nimport unittest\n\n\nclass TestMdarraySet(unittest.TestCase):\n def setUp(self):\n self.check_options = {'atol': 1e-5, 'rtol': 1e-4}\n\n def test_set1(self):\n x = numpy.array([1, 1, 1], dtype=numpy.float32)\n ...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.arange", "numpy.random.rand" ], [ "numpy.random.seed", "numpy.random.get_state", "numpy.random.randint", "numpy.random.set_state" ] ]
seismicshaker/2018_agu_workshop
[ "c4b5ff0d21e5cc3b86fabf8b4e331ce2b5c264a1" ]
[ "data_analysis/data_analysis.py" ]
[ "\"\"\"\nThese are data anaysis functions to download and process temperature series from Berkeley Earth.\n\"\"\"\n\n#Import Libraries\nimport numpy as np\nimport requests\n\n#Define loading functions\ndef generate_URL(place):\n \"\"\"\n This function will generate the string of the URL to access the temperat...
[ [ "numpy.full", "numpy.mean" ] ]
Christopher-Bradshaw/legacyhalos
[ "8a7644425dedc85849dc532d8252f280fa6d1f56" ]
[ "py/legacyhalos/io.py" ]
[ "\"\"\"\nlegacyhalos.io\n==============\n\nCode to read and write the various legacyhalos files.\n\n\"\"\"\nimport os, pdb\nimport numpy as np\nimport numpy.ma as ma\n\nimport fitsio\nimport astropy.units as u\nfrom astropy.table import Table, Column\nfrom astrometry.util.fits import fits_table\n\ndef legacyhalos_d...
[ [ "scipy.ndimage.morphology.binary_dilation", "numpy.median", "scipy.ndimage.filters.gaussian_filter", "numpy.min", "numpy.max", "numpy.zeros_like", "numpy.log", "numpy.atleast_2d", "numpy.logical_or", "numpy.array", "numpy.int", "numpy.savetxt", "numpy.float32", ...
davidcortesortuno/finmag
[ "9ac0268d2c0e45faf1284cee52a73525aa589e2b" ]
[ "src/finmag/tests/comparison/demag/run_nmag.py" ]
[ "import os\nimport numpy as np\nimport nmag\nfrom nmag import SI\n\nMODULE_DIR = os.path.dirname(os.path.abspath(__file__))\n\n# create simulation object\nsim = nmag.Simulation()\n\n# define magnetic material\nPy = nmag.MagMaterial(name='Py', Ms=SI(1.0, 'A/m'))\n\n# load mesh\nsim.load_mesh(\"sphere.nmesh.h5\", [('...
[ [ "numpy.savetxt" ] ]
hirorin-demon/hirorin-streamlit
[ "03fbb6f03ec94f909d451e708a3b30b177607695" ]
[ "Lib/site-packages/streamlit/delta_generator.py" ]
[ "# Copyright 2018-2021 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 required by applicable law or ...
[ [ "pandas.RangeIndex" ] ]
HeliWang/onnx-fixed
[ "266ec0a6a302d99710921f9bc8047d5fe3558328" ]
[ "onnx/backend/test/case/node/slice.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\n\nimport onnx\nfrom ..base import Base\nfrom . import expect\n\n\nclass Slice(Base):\n\n @staticmethod\n def export_slice():\n ...
[ [ "numpy.random.randn" ] ]
kourouklides/artificial_neural_networks
[ "c22f80c092481dda4bb219d981e27295d06222b0" ]
[ "artificial_neural_networks/architectures/feedforward_neural_networks/convolutional_neural_networks/cnn_dense_mnist.py" ]
[ "\"\"\"\r\n\r\nModel: Convolutional Neural Network (CNN) with dense (i.e. fully connected) layers\r\nMethod: Backpropagation\r\nArchitecture: Feedforward Neural Network\r\n\r\nDataset: MNIST\r\nTask: Handwritten Digit Recognition (Multi-class Classification)\r\n\r\n Author: Ioannis Kourouklides, www.kourouklides...
[ [ "tensorflow.set_random_seed", "sklearn.metrics.confusion_matrix", "tensorflow.get_default_graph", "numpy.random.seed", "numpy.load", "numpy.unique" ] ]
mostafaelhoushi/tvm
[ "ae21eddf5f13ffa82d514e8311c87f38bcac559a" ]
[ "tests/python/frontend/mxnet/test_forward.py" ]
[ "import numpy as np\nimport operator\n\nimport tvm\nfrom tvm.contrib import graph_runtime\nfrom tvm.relay.testing.config import ctx_list\nfrom tvm import relay\nimport mxnet as mx\n\nfrom mxnet import gluon\nfrom mxnet.gluon.model_zoo import vision\nimport model_zoo\n\n\ndef verify_mxnet_frontend_impl(mx_symbol,\n ...
[ [ "numpy.array", "numpy.random.uniform", "numpy.random.randint" ] ]
mudkipmaster/gwlf-e
[ "9e058445537dd32d1916f76c4b73ca64261771cd", "9e058445537dd32d1916f76c4b73ca64261771cd" ]
[ "gwlfe/MultiUse_Fxns/Runoff/AvCNRur.py", "gwlfe/Output/Loading/SurfaceLoad_1.py" ]
[ "from numpy import sum\n\nfrom gwlfe.Input.LandUse.RurAreaTotal import RurAreaTotal\nfrom gwlfe.Input.LandUse.RurAreaTotal import RurAreaTotal_f\nfrom gwlfe.Memoization import memoize\n\n\n@memoize\ndef AvCNRur(NRur, Area, CN):\n result = 0\n rurareatotal = RurAreaTotal(NRur, Area)\n # Get the area weighte...
[ [ "numpy.sum" ], [ "numpy.repeat", "numpy.where", "numpy.zeros" ] ]
takuma-yoneda/gym-fetch
[ "d7de5007b832a09dd09b7b38bafea375008f2ac6" ]
[ "fetch/box.py" ]
[ "from gym import utils\nimport numpy as np\nfrom . import fetch_env\n\n\nclass BoxEnv(fetch_env.FetchEnv, utils.EzPickle):\n def __init__(self, action, reward_type='sparse'):\n self.action = action\n self.initial_qpos = {\n 'robot0:slide0': 0.405,\n 'robot0:slide1': 0.48,\n ...
[ [ "numpy.linalg.norm" ] ]
yihengwuKP/openmmtools
[ "8bf446742f75acb4008e51c0a102bb7f314d1da3" ]
[ "openmmtools/tests/test_integrators.py" ]
[ "#!/usr/local/bin/env python\n\n#=============================================================================================\n# MODULE DOCSTRING\n#=============================================================================================\n\n\"\"\"\nTest custom integrators.\n\n\"\"\"\n\n#=======================...
[ [ "numpy.array", "numpy.isnan", "numpy.zeros", "numpy.mean", "numpy.abs" ] ]
vuthithuhuyen/milk-pasteurization-prediction
[ "44e0e228f53d61c0a2fa1ed12c4803fd20ac3aad" ]
[ "Model/DeeplearningModel.py" ]
[ "import pickle\n\nimport numpy\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers import LSTM\nfrom keras.layers import RepeatVector\nfrom keras.layers import TimeDistributed\n\nfrom Model import GlobalVariables\n\n\ndef SaveDictToFile(_dict, _fileName):\n pickle_out = open(_...
[ [ "numpy.argmax", "numpy.asarray" ] ]
memayukh/ImbalancedRegressioninDataStreams
[ "0e2935e20c545793d21277e4ccf9b5dec60ea80a" ]
[ "TestUtilityModule.py" ]
[ "\"\"\"\r\nTestUtilityModule.py script tests all cases for PhiRelevance module\r\nimports PhiRelevance module --> Calls functions of PhiUtils script of PhiRelevance module and plots graphs between target continous variable and relevance.\r\n\"\"\"\r\n\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\nfro...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
bdzimmer/symbols
[ "d9530d0a6be30bf3ce7c991de6933616c2748136" ]
[ "symbols/blimp_util.py" ]
[ "\"\"\"\n\nUtilities for using blimp programatically\n\n\"\"\"\n\nfrom symbols import blimp\n\nfrom PIL import Image\nimport numpy as np\n\n\ndef render_and_composite(layers, resources_dirname, im_bg):\n \"\"\"render a layer, apply effects, and composite against a background image\"\"\"\n\n blimp.DEBUG = Fals...
[ [ "numpy.array" ] ]
loopinf/vertex-ai-samples
[ "5ced566373203eb7301609b763cf6b1de1df4560" ]
[ "gb_dots_stock_pipelines/comps_calc_cos_similarity/comp_calc_df_snapshot.py" ]
[ "\nfrom logging import log\n\n\ndef calc_df_snapshot(\n date_ref: str,\n)-> str:\n ############## top30 신호등\n import logging\n logging.basicConfig(level=logging.DEBUG)\n import pandas_gbq # type: ignore\n import pandas as pd\n import numpy as np\n from google.cloud import bigquery \n\n from trading_calenda...
[ [ "pandas.tseries.offsets.CustomBusinessDay", "pandas.Timestamp" ] ]
ywaby/blender-layers-image
[ "f921f81698318704413e154976cbf0e06d8e2f76" ]
[ "src/psd_tools/user_api/bl_support.py" ]
[ "\"\"\"\n\"\"\"\nimport array\nimport warnings\nimport collections\nimport numpy\nfrom psd_tools.utils import fix_byteorder\nfrom psd_tools.constants import Compression, ChannelID, ColorMode\ntry:\n import packbits\n import bpy\nexcept ImportError:\n pass\n\nclass BBox(collections.namedtuple('BBox', 'x1, y...
[ [ "numpy.array", "numpy.reshape", "numpy.ones", "numpy.flipud", "numpy.ravel", "numpy.full_like" ] ]
sovan-biswas/MITL
[ "7ea4a305aae45a58c857ea05102bd491019950f2" ]
[ "slowfast/utils/misc.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport json\nimport logging\nimport math\nimport numpy as np\nimport os\nfrom datetime import datetime\nimport psutil\nimport torch\nfrom fvcore.nn.activation_count import activation_count\nfrom fvcore.nn.flop_count ...
[ [ "torch.rand", "torch.cat", "torch.cuda.max_memory_allocated", "torch.multiprocessing.spawn", "matplotlib.pyplot.subplots", "torch.cuda.is_available", "torch.tensor" ] ]
gu997/mixture
[ "551ac3cdc61d0d6f5ca7eb7d912abf2da64a9e3f", "551ac3cdc61d0d6f5ca7eb7d912abf2da64a9e3f" ]
[ "low_level_interface/mixture_impianto_senza_eiettore_sep_x_ottimo.py", "low_level_interface/mixture_impianto_con_eiettore_sep_function.py" ]
[ "import numpy as np\nimport CoolProp.CoolProp as CP\n#import grafici_termodinamici as gt\nimport grafici_termodinamici_mixture as gt\nfrom scipy.optimize import fsolve\nimport compressore as c\n#from mixture_impianto_senza_eiettore_sep_function_T7fix import Funz as Funz7\nfrom mixture_impianto_senza_eiettore_sep_fu...
[ [ "numpy.array", "numpy.zeros", "scipy.optimize.fsolve", "matplotlib.pyplot.subplots", "numpy.where", "numpy.linspace", "matplotlib.pyplot.subplots_adjust" ], [ "numpy.ones", "scipy.optimize.fsolve", "numpy.zeros" ] ]
mcaceresb/pyblp
[ "b8c14125402f2fa87c2cd8654118eae438b3c22b" ]
[ "pyblp/results/simulation_results.py" ]
[ "\"\"\"Economy-level structuring of BLP simulation results.\"\"\"\n\nimport time\nfrom typing import Dict, Hashable, List, Optional, Sequence, Tuple, TYPE_CHECKING, Union\n\nimport numpy as np\n\nfrom .. import exceptions, options\nfrom ..configurations.formulation import Formulation\nfrom ..configurations.integrat...
[ [ "numpy.array", "numpy.zeros" ] ]
borisgarbuzov/Deep-Learning-with-Keras
[ "21f37bc92b85be5546066893337977f94c7da0b9" ]
[ "Chapter02/keras_VGG16_prebuilt.py" ]
[ "from keras.applications.vgg16 import VGG16\nfrom keras.models import Model\nfrom keras.preprocessing import image\nfrom keras.applications.vgg16 import preprocess_input\nimport numpy as np\n\n\n# pre-built and pre-trained deep learning VGG16 model\nbase_model = VGG16(weights='imagenet', include_top=True)\nfor i, l...
[ [ "numpy.expand_dims" ] ]
bazige/ascendfly
[ "cb176fd35b7f71e2e529f00583edc110f9afd364" ]
[ "ascend/video/video_capture.py" ]
[ "#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCopyright 2020 Huawei Technologies Co., Ltd\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\nhttp://www.apache.org/lic...
[ [ "numpy.frombuffer" ] ]
BQZic/glow-pytorch
[ "4b43042326bbe644ccfda3c81a138375321808ed" ]
[ "glow/modules.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport scipy.linalg\nfrom . import thops\n\n\nclass _ActNorm(nn.Module):\n \"\"\"\n Activation Normalization\n Initialize the bias and scale with a given minibatch,\n so that the output per-channel have zero mean ...
[ [ "numpy.sign", "torch.exp", "torch.sqrt", "numpy.log", "numpy.triu", "numpy.eye", "torch.slogdet", "numpy.arange", "torch.zeros_like", "torch.Tensor", "torch.nn.functional.conv2d", "torch.zeros", "numpy.zeros", "numpy.random.randn", "numpy.random.shuffle"...
neurodata/graspologic
[ "13577bf3009a6367a385408c252728fab66320fb", "13577bf3009a6367a385408c252728fab66320fb", "13577bf3009a6367a385408c252728fab66320fb" ]
[ "graspologic/cluster/autogmm.py", "tests/pipeline/test_mug2vec.py", "graspologic/inference/latent_position_test.py" ]
[ "# Copyright (c) Microsoft Corporation and contributors.\n# Licensed under the MIT License.\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.cluster import AgglomerativeClustering\nfrom sklearn.metrics import adjusted_rand_score\nfrom sklearn.mixture import GaussianMixture\nfrom sklearn.mixture._gaussian_mi...
[ [ "numpy.array", "numpy.dot", "sklearn.cluster.AgglomerativeClustering", "numpy.zeros", "pandas.DataFrame", "numpy.copy", "sklearn.model_selection.ParameterGrid", "sklearn.mixture.GaussianMixture", "sklearn.mixture._gaussian_mixture._estimate_gaussian_parameters", "sklearn.me...
NCAR/cesm-collections
[ "6e9f4cdaf0e64ea5fadb33c34167dc70c097e5d4" ]
[ "esm_collections/calc.py" ]
[ "import pop_tools\nimport xarray as xr\nimport numpy as np\nfrom xhistogram.xarray import histogram\nimport geocat.comp\n\n\ndef _get_tb_name_and_tb_dim(ds):\n \"\"\"return the name of the time 'bounds' variable and its second dimension\"\"\"\n assert \"bounds\" in ds.time.attrs, 'missing \"bounds\" attr on t...
[ [ "numpy.isnan" ] ]
AlexYaoRuihao/tvm
[ "e3bb56e65ed3285708581a965a269fc70a81a353" ]
[ "python/tvm/relay/frontend/tensorflow_ops.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.prod", "numpy.cumsum", "numpy.squeeze", "numpy.expand_dims" ] ]
krooonal/col_gen_estimator
[ "afb928eee97a5f1e2a7359a32b31fc6311688527" ]
[ "col_gen_estimator/tests/test_common.py" ]
[ "import pytest\n\nfrom sklearn.utils.estimator_checks import check_estimator\n\nfrom col_gen_estimator import BooleanDecisionRuleClassifier\nfrom col_gen_estimator import BooleanDecisionRuleClassifierWithHeuristic\n\n\n@pytest.mark.parametrize(\n \"estimator\",\n [BooleanDecisionRuleClassifier(),\n Boolea...
[ [ "sklearn.utils.estimator_checks.check_estimator" ] ]
jcsharp/DriveIt
[ "656fdff219d743794b56d468709456bdaa263ec9", "656fdff219d743794b56d468709456bdaa263ec9" ]
[ "car.py", "DQN/DeepQNetwork.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCar class for the DriveIt Gym environment.\r\n@author: Jean-Claude Manoli\r\n\"\"\"\r\n\r\nimport math\r\nimport numpy as np\r\nfrom numpy import cos, sin, pi, sqrt, clip, sign #pylint: disable=E0611\r\nfrom utils import *\r\nfrom part import *\r\nfrom sensors import *\r\nfrom ...
[ [ "numpy.sign", "numpy.sin", "numpy.cos", "numpy.clip" ], [ "numpy.std", "numpy.mean" ] ]
dacoex/pvlib-python
[ "38c0082f264a468015464aff1026a9ac864b4ed5" ]
[ "pvlib/clearsky.py" ]
[ "\"\"\"\nThe ``clearsky`` module contains several methods \nto calculate clear sky GHI, DNI, and DHI.\n\"\"\"\n\nfrom __future__ import division\n\nimport logging\nlogger = logging.getLogger('pvlib')\n\nimport os\n\nimport numpy as np\nimport pandas as pd\n\nfrom pvlib import tools\nfrom pvlib import irradiance\nfr...
[ [ "numpy.concatenate", "numpy.minimum", "pandas.DataFrame", "numpy.exp", "numpy.interp", "numpy.linspace" ] ]
cclauss/pba
[ "e368e848298829371dfb9a12ca1e71e319ef082a" ]
[ "pba/helper_utils.py" ]
[ "# Copyright 2018 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi...
[ [ "tensorflow.logging.log_first_n", "numpy.argmax" ] ]
dirmeier/numpyro
[ "d155669c36247bf0055105d036869eff09a9651f" ]
[ "numpyro/infer/autoguide.py" ]
[ "# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\n# Adapted from pyro.infer.autoguide\nfrom abc import ABC, abstractmethod\nfrom contextlib import ExitStack\nfrom functools import partial\nimport warnings\n\nimport numpy as np\n\nimport jax\nfrom jax import grad, hessian, lax,...
[ [ "numpy.prod", "numpy.isnan" ] ]
yvr1037/hello-dian.ai
[ "de932cc1546d14d8e3415d664aa7d0b0ce27a113", "de932cc1546d14d8e3415d664aa7d0b0ce27a113" ]
[ "lab1/mnist.py", "lab1/nn/functional.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\nfrom tqdm import tqdm\n\nfrom nn.modules import Linear,BatchNorm1d,Conv2d,MaxPool\nfrom nn.functional import ReLU,Sigmoid\n# from typing import OrderedDict\n\nimport nn\nimport nn.functional as F\n\nn_features = 28 * 28\nn_classes = 10\nn_epochs = 10\nbs = ...
[ [ "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.subplots", "numpy.argmax", "matplotlib.pyplot.tight_layout", "numpy.sqrt", "matplotlib.pyplot.show" ], [ "numpy.max", "numpy.log", "numpy.exp", "numpy.arange", "numpy.outer", "numpy.diag" ] ]
Mehbangg/MRI_CT
[ "6a2cae5510017c5f0ba4684799cab31490d16837" ]
[ "train.py" ]
[ "import dataset\nimport tensorflow as tf\nimport time\nfrom datetime import timedelta\nimport math\nimport random\nimport numpy as np\nimport os\n\n#Adding Seed so that random initialization is consistent\nfrom numpy.random import seed\nseed(1)\nfrom tensorflow import set_random_seed\nset_random_seed(2)\n\n\nbatch_...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.nn.conv2d", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.nn.softmax", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.set_random_seed", "tensorflow.argmax", "tensorflow.train....
Xibanya/VQGAN-CLIP
[ "24510ef372df3131dedf289397818217e1fd3df0" ]
[ "XibGAN/Augments.py" ]
[ "import kornia.augmentation as K\r\nimport yaml\r\nimport torch\r\nfrom .Utils import resample, clamp_with_grad\r\nfrom torch import nn\r\n\r\nCONFIG_DIRECTORY = 'Config'\r\nAUGMENT_CONFIG = 'augment_config.yaml'\r\nDEFAULT_AUGMENTS = [['Af', 'Pe', 'Ji', 'Er']]\r\n\r\nwith open(f\"{CONFIG_DIRECTORY}/{AUGMENT_CONFIG...
[ [ "torch.nn.AdaptiveMaxPool2d", "torch.cat", "torch.rand", "torch.nn.Sequential", "torch.randint", "torch.randn_like", "torch.nn.AdaptiveAvgPool2d" ] ]
sshleifer/pytorch-lightning
[ "575e01be82c4adbc69970f801bd925e545bb1ccb", "575e01be82c4adbc69970f801bd925e545bb1ccb" ]
[ "tests/trainer/logging/test_eval_loop_logging_1_0.py", "tests/base/model_train_steps.py" ]
[ "\"\"\"\nTests to ensure that the training loop works with a dict (1.0)\n\"\"\"\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning import callbacks\nfrom tests.base.deterministic_model import DeterministicModel\nfrom tests.base import SimpleModule, BoringModel\nimport os\nimport torch\nimport pytest\n\n...
[ [ "torch.tensor" ], [ "torch.tensor" ] ]
Zador-Pataki/Probabilistic-Artificial-Intelligence-Projects
[ "914612effc92a9ee2b8ef74dbdbacddc9222fbac" ]
[ "task0_bayesian_inference/solution.py" ]
[ "# log_posterior_probs function was implemented in October 2021 by\n# Pascal Lieberherr, Zador Pataki, Timo Schönegg\n\nimport numpy\nfrom scipy.stats import laplace, norm, t\nimport scipy\nimport math\nimport numpy as np\nfrom scipy.special import logsumexp\n\nVARIANCE = 2.0\n\nnormal_scale = math.sqrt(VARIANCE)\n...
[ [ "numpy.array", "numpy.random.choice", "numpy.nditer", "numpy.log", "numpy.random.RandomState", "scipy.stats.t.pdf", "scipy.stats.t", "scipy.stats.laplace", "scipy.stats.laplace.pdf" ] ]
zacheberhart-kd/Squirrel-Optimizer-BBO-NeurIPS20-automlorg
[ "1ae6afdeb6c2f3313a374c4a0ea9bc8421b55dde" ]
[ "squirrel/GaussianProcess/trend.py" ]
[ "\"\"\"\nCreated on Wed Aug 23 16:48:47 2017\n\n@author: Hao Wang\n@email: wangronin@gmail.com\n\"\"\"\n\nfrom pdb import set_trace\nimport numpy as np\n\nfrom abc import abstractmethod, ABC\nfrom numpy import newaxis, zeros, tile, eye, r_, c_, ones, array, atleast_2d\nfrom sklearn.ensemble import RandomForestRegre...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.random.randn", "numpy.eye", "sklearn.ensemble.RandomForestRegressor", "numpy.hstack", "numpy.atleast_2d" ] ]
tmorgan4/ray
[ "bc9f040aa002a5223cd86d647a13bd9135a892a8", "bc9f040aa002a5223cd86d647a13bd9135a892a8" ]
[ "rllib/tf2_examples/custom_keras_model_fc_vs_rnn.py", "python/ray/tests/test_stress.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport sys\nimport ray\nfrom ray import tune\nfrom ray.rllib.models.lstm import add_time_dimension\nfrom ray.rllib.models import ModelCatalog\nfrom ray.rllib.models.misc import normc_initializer\nfrom ...
[ [ "tensorflow.trainable_variables", "tensorflow.sequence_mask", "tensorflow.keras.layers.Input", "numpy.zeros", "tensorflow.reshape", "tensorflow.keras.layers.Reshape", "tensorflow.disable_v2_behavior", "tensorflow.keras.Model", "tensorflow.keras.layers.Masking", "tensorflow....