repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
DwangoMediaVillage/marltas_core
[ "91a5caf75c2350a31d47d1b0408c817644a0d41e" ]
[ "bin/async_rnn_train.py" ]
[ "\"\"\"Asynchronized (distributed) rnn tranining.\"\"\"\nimport os # noqa isort:skip\nos.environ['OMP_NUM_THREADS'] = '1' # noqa isort:skip\n\nimport argparse\nimport logging\nimport pprint\nimport time\nfrom dataclasses import asdict, dataclass\nfrom functools import partial\nfrom pathlib import Path\n\nimport n...
[ [ "numpy.ones" ] ]
elucherini/t-recs
[ "ab50f81d5413700775783c5b3eafd9ef4289d9d5" ]
[ "trecs/components/users.py" ]
[ "\"\"\"\nSuite of classes related to users of the system, including predicted user-item\nscores, predicted user profiles, actual user profiles, and a Users class (which\nencapsulates some of these concepts).\n\"\"\"\nimport numpy as np\nimport scipy.sparse as sp\n\nimport trecs.matrix_ops as mo\nfrom trecs.random i...
[ [ "numpy.divide", "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.copy", "numpy.ones", "numpy.multiply", "numpy.arange", "numpy.power", "numpy.hstack" ] ]
talonchandler/polharmonic
[ "2aa3ca984e11050f901579b8eaa45a3a61d07957" ]
[ "notes/2018-05-30-polarized-dispim-svd/calculations/test-multi.py" ]
[ "from polharmonic import det, ill, micro, multi\nimport numpy as np\n\n#n_px=2**4 + 1\nn_px=2**4 + 1\nfolder='multi-out/'\n\nmm = multi.MultiMicroscope(sigma_ax=0.33)\n# mm.micros[0].plot(mm.micros[0].H, filename=folder+'H0.pdf', n_px=n_px, plot_m=[-2, -1, 0, 1, 2])\nmm.calc_SVD(n_px=n_px)\nmm.plot_SVS_3D(filename=...
[ [ "numpy.array" ] ]
mikeireland/pymfe
[ "ce78392215bb40467a0d4efd453c2a6d062c12f5" ]
[ "rhea_subaru_superK.py" ]
[ "\"\"\"A script to fit tramlines etc for RHEA@Subaru data.\n\nLong wavelengths are down and right. 15 lines visible.\n\nlines = np.loadtxt('argon.txt')\norder = 1e7/31.6*2*np.sin(np.radians(64.0))/argon\nplt.plot(1375 - (order - np.round(order))/order*1.8e5)\nplt.plot(1375 - (order - np.round(order)+1)/order*1.8e5)...
[ [ "matplotlib.pyplot.ion", "numpy.empty", "numpy.median", "numpy.sum", "matplotlib.pyplot.clf", "matplotlib.pyplot.imshow" ] ]
XiangyuYang-Opt/scipy
[ "465da5496a8dda099646e9d5947f24dfc0ec44e9" ]
[ "scipy/stats/_axis_nan_policy.py" ]
[ "# Many scipy.stats functions support `axis` and `nan_policy` parameters.\n# When the two are combined, it can be tricky to get all the behavior just\n# right. This file contains utility functions useful for scipy.stats functions\n# that support `axis` and `nan_policy`, including a decorator that\n# automatically a...
[ [ "numpy.array_equal", "numpy.finfo", "numpy.apply_along_axis", "numpy.sort", "numpy.cumsum", "numpy.broadcast_to", "numpy.max", "numpy.concatenate", "numpy.full", "numpy.prod", "scipy._lib._docscrape.Parameter", "numpy.delete", "numpy.array", "scipy._lib._doc...
tdinesh/occamsam
[ "a0b27ca8d8f8b32d5d46f9b7861ec34f3d060b49" ]
[ "occamsam/optim.py" ]
[ "import cvxpy as cp\nimport cvxpy.atoms\nfrom cvxpy.atoms import norm, mixed_norm, sum_squares\nfrom cvxpy.atoms.affine.vec import vec\n\nimport numpy as np\nimport scipy as sp\nimport scipy.sparse\n\nimport equivalence\nimport utilities\nfrom factorgraph import GaussianFactorGraph\n\nimport itertools\n\n\ndef _san...
[ [ "numpy.concatenate", "numpy.array", "scipy.sparse.bsr_matrix", "numpy.isclose", "scipy.sparse.diags", "numpy.linalg.norm", "numpy.zeros", "numpy.dot", "numpy.sum", "numpy.tile", "numpy.any", "numpy.diag" ] ]
MrD1360/random_projects
[ "7f18dd9a0c720c46837eeb59cf6fdd8afb137aa5" ]
[ "NLP/chatbot_with_attention/chatbot_models_class.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport tensorflow as tf\n\nimport tensorflow_addons as tfa\n\n#vocab_len=23\n#batch_size=16\n#buck_t1=8 #max len input (threshold of the first bucket)\n\n\n# In[2]:\n\n\nclass encoder_model(tf.keras.Model):\n def __init__(self,lat_dim=256,vocab_len=14):#,*...
[ [ "tensorflow.keras.layers.LSTMCell", "tensorflow.keras.layers.LSTM", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Embedding" ] ]
hitfee01/rtm3d
[ "9e872c1bf857234d17c8863be6006722d4aab283" ]
[ "models/nets/resnet.py" ]
[ "\"\"\"\n# ---------------------------------------------------------------------------------\n# -*- coding: utf-8 -*-\n-----------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\n# ...
[ [ "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.utils.model_zoo.load_url", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
ymzayek/asteroidsCNN
[ "b10d1a7b713ef878a0459340d4060cfdad9575a7" ]
[ "utils/CNN_utils.py" ]
[ "import csv\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\n\nfrom matplotlib.ticker import FormatStrFormatter\nfrom tensorflow.keras import backend as K\n\n\ndef load_data_from_images(image_path, datasplit):\n \"\"\"Load images from directory\n\n Parameters:\...
[ [ "numpy.array", "numpy.asarray", "pandas.DataFrame", "matplotlib.ticker.FormatStrFormatter", "matplotlib.pyplot.subplots", "tensorflow.keras.backend.epsilon", "tensorflow.keras.backend.clip" ] ]
avdul-q101/numba
[ "199798e2c849b5e63eeef36972566fda7b84625c" ]
[ "numba/cuda/tests/cudadrv/test_managed_alloc.py" ]
[ "import numpy as np\nfrom ctypes import byref, c_size_t\nfrom numba.cuda.cudadrv.driver import device_memset, driver\nfrom numba import cuda\nfrom numba.cuda.testing import unittest, ContextResettingTestCase\nfrom numba.cuda.testing import skip_on_cudasim\nfrom numba.tests.support import linux_only\n\n\n@skip_on_cu...
[ [ "numpy.all", "numpy.ndarray", "numpy.dtype" ] ]
wx-b/ravens
[ "249c316301d84fda10e0ce4ca99519d9a37a5059" ]
[ "ravens/tasks/manipulating_rope.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Ravens Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "numpy.float32", "numpy.linalg.norm", "numpy.sqrt", "numpy.eye" ] ]
timvink/flee
[ "c7901e2a0de70f18c3267236e127ab1c26c8f5e5" ]
[ "flee/postprocessing/analysis.py" ]
[ "import numpy as np\n\n\n# Primitive error function for single values.\n\ndef rel_error(val, correct_val):\n if correct_val < 0.00001:\n return 0.0\n return np.abs(float(val) / float(correct_val) - 1)\n\n\ndef abs_error(val, correct_val):\n return np.abs(float(val) - float(correct_val))\n\n\n# Primi...
[ [ "numpy.log", "numpy.abs" ] ]
swing-research/trumpets
[ "df8dc2b1e902393453e552c3a9b8f0cd3e10d741" ]
[ "logdetJ.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\ndef wrapper_logdet(x, f):\n\n # @tf.function\n def power_iteration(f, n):\n v = tf.random.normal(x.shape, dtype=tf.float32)\n v /= tf.linalg.norm(v, axis=-1, keepdims=True)\n\n for _ in range(n):\n with tf.autodiff.ForwardAccumula...
[ [ "tensorflow.shape", "tensorflow.concat", "tensorflow.GradientTape", "numpy.log", "tensorflow.random.normal", "tensorflow.ones", "tensorflow.math.minimum", "tensorflow.linalg.norm", "tensorflow.reduce_max", "tensorflow.autodiff.ForwardAccumulator", "numpy.float32", "...
zhaoyueyi/TaichiRenderer
[ "56f3bf5a59cd5cce3a8939e689620d84ccf7b0e4" ]
[ "hacker.py" ]
[ "# from taichi-three(tina) source code\n\nimport taichi as ti\n\n# hasattr(ti, '_tinahacked') or setattr(ti, '_tinahacked', 1) or setattr(ti,\n# 'static', lambda x, *xs: [x] + list(xs) if xs else x) or setattr(\n# ti.Matrix, 'element_wise_writeback_binary', (lambda f: lambda x, y, z:\n# (y._...
[ [ "numpy.stack" ] ]
ikramulkayes/Python_season2
[ "d057460d07c5d2d218ecd52e08c1d355add44df2" ]
[ "practice64.py" ]
[ "import numpy as np\nx = np.array([6,8,12,14,18])\ny = np.array([7,9,13,15,19])\n\ndef gradiant_descent(x,y):\n m = c = 0\n loop = 10\n alpha = 0.3\n n = len(x)\n for i in range(loop):\n yp = m*x + c\n costfunc = (1/n)*sum(val*val for val in (y-yp))\n dm = -(2/n)*sum(x*(y-yp))\n ...
[ [ "numpy.array" ] ]
bingqingchen/oatomobile
[ "5576458a1036b7c969a45753443b00b5fbc347cf" ]
[ "oatomobile/baselines/rulebased/autopilot/agent.py" ]
[ "# Copyright 2020 The OATomobile Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.save" ] ]
benman1/ep-stan
[ "c1bc6edf0ed2775266fba7d4fa65e8f0009f9b17" ]
[ "experiment/models/m3b.py" ]
[ "\"\"\"A simulated experiment model used by the sckript fit.py\n\nModel name: m3b\nDefinition:\n group index j = 1 ... J\n input index d = 1 ... D\n explanatory variable x = [x_1 ... x_D]\n response variable y\n local parameter alpha = [alpha_1 ... alpha_J]\n local parameter beta = [[beta_11 ... b...
[ [ "numpy.empty", "numpy.log", "numpy.random.RandomState", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.abs", "scipy.linalg.cholesky", "numpy.cumsum" ] ]
Sangameshkodge/IMAC-TCASI
[ "3b3a4cf2fd79822d4258658b7b4289eb6f7d7113" ]
[ "Application levels/MNIST/train.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Feb 24 16:30:25 2019\n@author: skodge\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.autograd import Variable\nfrom torchvision import datasets, transforms\nfrom LeNet import lenet\nimport numpy\n#impor...
[ [ "torch.autograd.Variable", "torch.save", "torch.optim.lr_scheduler.MultiStepLR", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ] ]
OpenGVLab/gv-benchmark
[ "ffe1f7460b857c88276d52a1537cbc673002f1e4" ]
[ "gvbenchmark/cls/datasets/retinopathy.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport os\n\nimport numpy as np\nfrom mmcls.core.evaluation.eval_metrics import calculate_confusion_matrix\nfrom mmcls.datasets.base_dataset import BaseDataset\nfrom mmcls.datasets.builder import DATASETS\nfrom mmcls.models.losses import accuracy\n\n\ndef has_file_a...
[ [ "numpy.array", "numpy.vstack" ] ]
secimTools/GalaxyTools
[ "a79d9f6d733c9a8c1e52b5aa8f4b7d0da79cbf6d" ]
[ "src/scripts/mahalanobis_distance.py" ]
[ "#!/usr/bin/env python\n####################################################################\n# AUTHOR: Miguel Ibarra (miguelib@ufl.edu)\n#\n# DESCRIPTION: Pairwise and to mean standarized euclidean comparison\n####################################################################\n\nimport os\nimport logging\nimport...
[ [ "matplotlib.use", "numpy.dot", "numpy.percentile", "pandas.DataFrame", "matplotlib.backends.backend_pdf.PdfPages", "pandas.DataFrame.merge", "scipy.stats.beta.rvs", "numpy.diag", "numpy.linalg.svd", "numpy.sqrt", "scipy.stats.chi2.ppf", "sklearn.neighbors.DistanceMe...
zky362550824/MAUIL
[ "cd791a6872d4c797f519a762f530007c41ad3eb2" ]
[ "code/main_dblp.py" ]
[ "# -*- coding: utf-8 -*-\r\nimport numpy as np\r\nimport json,pickle,time,os\r\nfrom align import align_cca\r\nfrom utils import dataset,get_sim,hit_precision\r\nfrom multiprocessing import Pool\r\nfrom functools import partial\r\n\r\ndef psearch(n_train,emb,K,reg,seed):\r\n test = datasets.get('test',n=500,seed...
[ [ "numpy.concatenate", "numpy.array", "numpy.mean" ] ]
aachenmax/vmaf
[ "e65143f36ac9324a1242614bdd6256861d4f46f6" ]
[ "python/test/local_explainer_test.py" ]
[ "import os\nimport unittest\n\nimport numpy as np\n\nfrom vmaf.config import VmafConfig\nfrom vmaf.core.asset import Asset\nfrom vmaf.core.local_explainer import LocalExplainer\nfrom vmaf.core.quality_runner_extra import VmafQualityRunnerWithLocalExplainer\nfrom vmaf.core.noref_feature_extractor import MomentNorefF...
[ [ "numpy.random.seed", "numpy.mean" ] ]
KanHatakeyama/anneal_project2
[ "e9b5e776f4ac1d202b952c9b6fb4ffaee833441d" ]
[ "lib/MoleculeRegressor.py" ]
[ "import numpy as np\nfrom sklearn.base import BaseEstimator, RegressorMixin\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.linear_model import SGDRegressor\nfrom Fingerprint import Fingerprint\nfrom rdkit.Avalon.pyAvalonTools import GetAvalonFP\n\nFP = Fingerprint()\n\n\nclass MoleculeRegressor(Bas...
[ [ "numpy.array", "sklearn.linear_model.SGDRegressor", "sklearn.preprocessing.StandardScaler" ] ]
esceptico/toxic
[ "b337df1790d4fd3a253522a38b91888705770822" ]
[ "src/toxic/modelling/encoder.py" ]
[ "from typing import Sequence, Tuple\n\nimport torch\nfrom torch import nn\n\nfrom src.toxic.modelling.modules import Conv1dMaxPooling\n\n\nclass WideCNNEncoder(nn.Module):\n \"\"\"Convolutional sentence encoder\n\n References:\n Convolutional Neural Networks for Sentence Classification\n https:/...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.Embedding" ] ]
timudk/uwEnergyHacks
[ "ddb2966fe98b8b51f9bc584ef497a1b24264de67" ]
[ "make_datasets/data_visualization.py" ]
[ "import numpy as np \nimport matplotlib.pyplot as plt\nimport pickle\nimport math\nimport matplotlib.animation as animation\n\ndef compute_nx_ny(k):\n\tn_x = k%4\n\tn_y = int((k-n_x)/4)\n\n\treturn n_x, n_y\n\ndef read_outside_temp(filename):\n\toutside_temp = np.loadtxt(filename)\n\n\treturn outside_temp\n\ndef re...
[ [ "matplotlib.pyplot.colorbar", "numpy.isnan", "matplotlib.pyplot.clim", "matplotlib.pyplot.plot", "numpy.ones", "matplotlib.pyplot.figure", "numpy.loadtxt", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
seblars/AdventOfCode2020
[ "dc41181caa50fe03645aa36d70fe0ebd76cd6e25" ]
[ "day17.py" ]
[ "import numpy as np\r\nimport fileinput\r\n\r\nd = np.array([[1 if j == '#' else 0 for j in list(i)]\r\n for i in \"\".join(fileinput.input()).split('\\n')])\r\n\r\ndef sumNN(d, idx):\r\n return np.sum(d[tuple([slice(i-1,i+2) for i in idx])])\r\n \r\ndef cubeConv(d, n_cycles=6):\r\n\r\n for _ ...
[ [ "numpy.meshgrid", "numpy.pad", "numpy.arange" ] ]
ghaggart/nPYc-Toolbox
[ "d0160b476581fbd695f3f5f0303048466ed95864" ]
[ "nPYc/batchAndROCorrection/_batchAndROCorrection.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport types\nimport numpy\nimport scipy\nimport warnings\nfrom scipy.signal import savgol_filter\nimport statsmodels.api as sm\nlowess = sm.nonparametric.lowess\nimport logging\nfrom scipy.signal import savgol_filter\nimport time\nimport sys\nimport copy\nfrom dat...
[ [ "numpy.divide", "numpy.zeros_like", "numpy.isnan", "scipy.signal.savgol_filter", "numpy.asarray", "numpy.zeros", "numpy.median", "numpy.interp", "numpy.mean", "numpy.multiply", "numpy.argsort", "numpy.nan_like", "numpy.squeeze", "numpy.empty_like" ] ]
Konrad337/MINST_nn_and_misc
[ "9db2295991eed5d91214ddd4912349c31d50286b" ]
[ "src/classic_nn.py" ]
[ "import numpy as np\nfrom mnist_file_tools import get_bytes, get_input_layer, get_label\nimport print_network\nfrom graphics import GraphWin\nimport matplotlib.pyplot as plt\nimport math\n\n\ndraw_iter = 1000\n\n\ndef softmax(x):\n exps = np.exp(x - x.max())\n return exps / np.sum(exps)\n# Copy paste softmax\...
[ [ "numpy.dot", "numpy.exp", "numpy.resize", "matplotlib.pyplot.draw", "numpy.random.random", "numpy.argmax", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplot", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.amax", "numpy.amin", "numpy.clip", "numpy.rand...
avisherwood/DovPandaDev
[ "fd8f30b6dd243bdc1b3a4f3dbeab2b9f52c4f553" ]
[ "dovpanda/core.py" ]
[ "import os\r\n\r\nimport numpy as np\r\nfrom dateutil import parser\r\n\r\nfrom dovpanda import base, config\r\nfrom dovpanda.base import Ledger\r\n\r\nledger = Ledger()\r\n\r\n\r\n@ledger.add_hint('DataFrame.iterrows')\r\ndef iterrows_is_bad(arguments):\r\n ledger.tell(\"iterrows is not recommended, and in the ...
[ [ "numpy.issubdtype", "numpy.asarray" ] ]
nkorojoseph/Project-Trust
[ "3064c7672a2e82da6879909048c8f639eab23ae4" ]
[ "Dataset/paper-20210313T183737Z-001/paper/projectTrust.py" ]
[ "\n# coding: utf-8\n\n# In[11]:\n\nimport nltk, string\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nimport glob\nimport csv\nimport os\nimport ntpath\nimport networkx as nx\nimport pandas as pd\nfrom collections import Counter\nimport matplotlib.pyplot as plt\nfrom wordcloud import WordCloud, STOPW...
[ [ "matplotlib.pyplot.savefig", "pandas.read_csv", "matplotlib.pyplot.show", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
g-pichler/flower
[ "e455cdc3678921ece960287a0e1ae5123500c948" ]
[ "src/py/flwr/server/strategy/fast_and_slow.py" ]
[ "# Copyright 2020 Adap GmbH. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.max", "numpy.array", "numpy.random.choice" ] ]
EigenPro/EigenPro-tensorflow
[ "324d26451f1bd1f0331d6ad80e0e00e6b975a5ab" ]
[ "layers.py" ]
[ "from keras import backend as K\nfrom keras.engine.topology import Layer\nimport numpy as np\n\nclass KernelEmbedding(Layer):\n \"\"\" Generate kernel features.\n\n Arguments:\n kernel_f: kernel function k(x, y).\n centers: matrix of shape (n_center, n_feature).\n \"\"\"\n\n def __ini...
[ [ "numpy.sqrt" ] ]
KALVS/RandomStuff
[ "a347d73ee3621597c6efa731b36194d1743ef36c" ]
[ "OpenCV/MEAN and CAM shift/MeanShift.py" ]
[ "\nimport numpy as np\nimport cv2\n\n# Start the webcam\ncap = cv2.VideoCapture('slow.flv')\n\n\n# Take the first frame\nret, frame = cap.read()\nrows, cols = frame.shape[:2]\n\n# Define the initial window location at the frame center\nwindowWidth = 150\nwindowHeight = 200\nwindowCol = int((cols - windowWidth) / 2)...
[ [ "numpy.array" ] ]
rohankumardubey/ibis
[ "e416dcfdb32792ffeb6f5214b361872582aa8795" ]
[ "ibis/backends/sqlite/tests/test_client.py" ]
[ "import os\nimport uuid\n\nimport numpy as np\nimport pandas.testing as tm\nimport pytest\n\nimport ibis\nimport ibis.config as config\nimport ibis.expr.types as ir\nfrom ibis.backends.sqlite import Backend\nfrom ibis.util import guid\n\n\ndef test_file_not_exist_and_create():\n path = f'__ibis_tmp_{guid()}.db'\...
[ [ "numpy.testing.assert_allclose", "pandas.testing.assert_series_equal" ] ]
fairgelle/disaster-response-pipeline
[ "b275a7d50fec1e5fcb5151720a275e374265e911" ]
[ "data/process_data.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom sqlalchemy.engine import create_engine\nimport sys\n\n\ndef load_data(messages_filepath, categories_filepath):\n '''\n Returns a df that is a result of the merged 'messages' &\n 'categories' data. The data are concatenated by the id.\n \n Args:\n ...
[ [ "pandas.read_csv", "pandas.to_numeric", "pandas.merge", "pandas.concat" ] ]
FlorisHoogenboom/yolo-v2-tf-2
[ "00de6dbfdc3b2d96e45a51dd848461d91ce01919" ]
[ "test/test_layers.py" ]
[ "import numpy as np\n\nfrom yolo import layers\n\n\ndef test_anchor_layer_base_anchor_boxes():\n anchors = [\n [1, 1],\n [1, 1.5],\n [1.5, 1]\n ]\n grid_height = 2\n grid_width = 3\n layer = layers.AnchorLayer(\n grid_height=grid_height,\n grid_width=grid_width,\n ...
[ [ "numpy.all", "numpy.random.randn", "numpy.zeros", "numpy.unique" ] ]
StochLab/autompc
[ "657cf9c6ae6771b65b20fdcbaaadde31150afdff" ]
[ "autompc/control/nmpc.py" ]
[ "from collections import Iterable\nfrom .controller import Controller, ControllerFactory\nfrom pdb import set_trace\nimport ConfigSpace as CS\nimport ConfigSpace.hyperparameters as CSH\n\nimport numpy as np\n\nclass TrajOptProblem(object):\n \"\"\"Just a general interface for nonlinear optimization problems.\n ...
[ [ "numpy.concatenate", "numpy.ceil", "numpy.zeros", "numpy.ones", "numpy.arange", "numpy.random.random" ] ]
samhsia/dlrm
[ "a50709a24b690782293a44941264c83f09e15a3c" ]
[ "dlrm_data_pytorch.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n#\n# Description: generate inputs and targets for the dlrm benchmark\n# The inpts and outputs are generated according to the following...
[ [ "numpy.random.rand", "torch.stack", "torch.utils.data.RandomSampler", "numpy.set_printoptions", "numpy.load", "numpy.min", "numpy.random.random", "numpy.max", "numpy.concatenate", "numpy.random.normal", "torch.tensor", "torch.utils.data.DataLoader", "numpy.int32...
J535D165/asreview
[ "eda3c52a595d739093c3cd6cd37d41eeed6dd15c" ]
[ "asreview/query_strategies/max.py" ]
[ "# Copyright 2019 The ASReview 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 requir...
[ [ "numpy.argsort" ] ]
imageslr/NLP
[ "f56796a86620accd487480e5c3bd992cf3dc7578" ]
[ "3.Tasks/Dialog-RL-GAN/gen/seq2seq.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n# We disable pylint because we need python3 compatibility.\nfrom six.moves import xrange # pylint: disable=redefined-builtin\nfrom six.moves import zip # pylint: disable=redefined-builtin\nimport ...
[ [ "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.variable_scope.get_variable", "tensorflow.multinomial", "tensorflow.matmul", "tensorflow.python.ops.math_ops.tanh", "tensorflow.reshape", "tensorflow.clip_by_value", "tensorflow.python.util.nest.flatten",...
jgphilpott/sensors
[ "a43c9f70ed1c37d4cb1cf6e619d1b0e822b1048c" ]
[ "Radio/433MHz/ReceiveRF.py" ]
[ "import RPi.GPIO as GPIO\nfrom datetime import datetime\nimport matplotlib.pyplot as pyplot\n\nRECEIVE_PIN = 23\nMAX_DURATION = 5\nRECEIVED_SIGNAL = [[], []]\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setup(RECEIVE_PIN, GPIO.IN)\n\ncumulative_time = 0\nbeginning_time = datetime.now()\nprint('Started recording...')\n\nwhile cu...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.axis" ] ]
diqiuzhuanzhuan/poros
[ "b4f0ff4c5094aa9df12a9195e5b3edd85c3460f4" ]
[ "poros/bert/modeling.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at/dense\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\...
[ [ "tensorflow.io.gfile.GFile", "tensorflow.initializers.TruncatedNormal", "tensorflow.ones", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.executing_eagerly", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.cast", "te...
unanan/Transformer_MultiModality
[ "fd07288908a8b9774d5adac498cf415874b36585" ]
[ "model/srcembed/crnn.py" ]
[ "import torch.nn as nn\n\n\nclass BidirectionalLSTM(nn.Module):\n \n def __init__(self, nIn, nHidden, nOut):\n super(BidirectionalLSTM, self).__init__()\n \n self.rnn = nn.LSTM(nIn, nHidden, bidirectional=True)\n self.embedding = nn.Linear(nHidden * 2, nOut)\n \n def forward(...
[ [ "torch.nn.Linear", "torch.nn.LSTM", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
chanvee/My_Neural_Transfer
[ "3fad9dbfa2f029e8583085871f4bb4e370e187cf" ]
[ "neural_style_transfer.py" ]
[ "'''Neural style transfer with Keras.\n\nRun the script with:\n```\npython neural_style_transfer.py path_to_your_base_image.jpg path_to_your_reference.jpg prefix_for_results\n```\ne.g.:\n```\npython neural_style_transfer.py img/tuebingen.jpg img/starry_night.jpg results/my_result\n```\nOptional parameters:\n```\n--...
[ [ "numpy.array", "scipy.misc.imsave", "numpy.copy", "numpy.clip", "numpy.expand_dims" ] ]
BillMills/argo-database
[ "a22d87fdeacf1a12280201b995509a671f9d90e4" ]
[ "test/netCDFToDocTest.py" ]
[ "# -*- coding: utf-8 -*-\n\n\nimport os\nimport sys\nimport pdb\nimport re\nimport numpy as np\nsys.path.append('..')\nsys.path.append('../add-profiles/')\nfrom argoDatabase import argoDatabase\nimport addFunctions as af\nimport unittest\nfrom datetime import datetime\nimport random\nimport warnings\nfrom numpy imp...
[ [ "numpy.warnings.filterwarnings" ] ]
SousaPedro11/algoritmos
[ "86a3601912778d120b9ec8094267c26a7eb6d153" ]
[ "python_implementation/prova_03/matriz_esparsa.py" ]
[ "import os.path\nimport random\nfrom typing import List\n\nimport numpy as np\n\n\ndef __imprime_matriz(matriz: List[List]) -> None:\n try:\n print(f'Matriz de tamanho: {len(matriz)}')\n for linha in matriz:\n print(' '.join(str(x) for x in linha))\n print('\\n')\n except Valu...
[ [ "numpy.random.randint" ] ]
bettertony/Better
[ "edb58ac1a44692f4227d1c0f6cdde550eca13f4f" ]
[ "better/tools/indicator.py" ]
[ "from __future__ import division, print_function, absolute_import\nimport numpy as np\n\n\ndef max_drawdown(pc_array):\n \"\"\"calculate the max drawdown with the portfolio changes\n @:param pc_array: all the portfolio changes during a trading process\n @:return: max drawdown\n \"\"\"\n portfolio_val...
[ [ "numpy.std", "numpy.sum", "numpy.cumprod", "numpy.mean" ] ]
l2xBrain/chineseocr
[ "96b0fd9615ea4d3294e4d6e1972f5df70514ec60" ]
[ "neural/index.py" ]
[ "# coding: utf-8\nimport sys\nimport os\nimport tensorflow as tf\nfrom PIL import Image\nfrom six.moves import cPickle as Pickle\n\nroot_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), \"..\")\nsys.path.append(root_dir)\nimport dataset\nimport inference\n\nIMAGE_HEIGHT = 45\nIMAGE_WIDTH = 45\nIMAGE_C...
[ [ "tensorflow.trainable_variables", "tensorflow.train.start_queue_runners", "tensorflow.group", "tensorflow.Session", "tensorflow.Variable", "tensorflow.train.Saver", "tensorflow.placeholder", "tensorflow.train.ExponentialMovingAverage", "tensorflow.train.exponential_decay", ...
djalmabright/statsmodels
[ "eb2432e1e4bd10b96ecde47552c9a9589441e7a2" ]
[ "statsmodels/tsa/base/tsa_model.py" ]
[ "from statsmodels.compat.python import long\nfrom statsmodels.compat.pandas import is_numeric_dtype\n\nimport numbers\n\nimport warnings\nimport numpy as np\nfrom pandas import (to_datetime, Int64Index, DatetimeIndex, Period,\n PeriodIndex, RangeIndex, Timestamp, Series, Index,\n ...
[ [ "pandas.to_datetime", "pandas.Index", "pandas.tseries.frequencies.to_offset", "numpy.asarray", "pandas.DataFrame", "pandas.RangeIndex", "pandas.Timestamp", "numpy.argmax", "pandas.Period" ] ]
jhover/cshl-work
[ "ff1e1a3f6c4da7795f89dcc49204c8bb1f9c5f0f" ]
[ "cshlwork/phylotool.py" ]
[ "#!/usr/bin/env python\n#\n# https://www.biostars.org/p/224572/\n# preferred breakdown: animals, fungi, plants, protists, bacteria, archaea\n# ncbi taxon category codes: chordata 7711 vertebrata 7742 Insecta 50557 \n# # in DB\n# 1 => 'Eukaryota',\n# 2...
[ [ "pandas.read_csv" ] ]
aspanghe/actionable-recourse
[ "e851de05ad32c077daf037a231addd271fcb1aac" ]
[ "examples/paper/demo_script_givemecredit.py" ]
[ "from examples.paper.initialize import *\nimport itertools\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport seaborn.apionly as sns\nfrom sklearn.linear_model import LogisticRegressionCV\nfrom sklearn.model_selection import train_test_split, KFold\nfrom sklearn.metrics import roc_auc_score\nfrom sk...
[ [ "matplotlib.pyplot.text", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "sklearn.model_selection.KFold", "matplotlib.pyplot.rc", "sklearn.linear_model.Lo...
dmitrySorokin/raph
[ "57c6c95fe879f929b730255cc724f23f09fecb31" ]
[ "nethack_raph/Actions/FollowGuard.py" ]
[ "import numpy as np\n\nfrom nethack_raph.Actions.base import BaseAction\nfrom nethack_raph.myconstants import COLOR_BG_RED\n\n\nclass FollowGuard(BaseAction):\n def can(self, level):\n targets = np.zeros(level.shape, dtype=bool)\n for xy, m in level.monsters.items():\n if m.guard:\n ...
[ [ "numpy.zeros" ] ]
JunhoPark0314/herbarium
[ "a475908dddb042c8beb60aea5f3f4fafa87f527c" ]
[ "herbarium/engine/defaults.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates.\n\n\"\"\"\nThis file contains components with some default boilerplate logic user may need\nin training / testing. They will not work for everyone, but many users may find them useful.\n\nThe behavior of functions/classes in this file is s...
[ [ "torch.no_grad", "torch.nn.parallel.DistributedDataParallel" ] ]
justinrgarrard/USEduData
[ "cafbc9a416264a7aa6a37876d058525a07ea5903" ]
[ "tests/tests.py" ]
[ "\"\"\"\nA testing script that evaluates each pipeline.\n\nShould only be run AFTER the main script has executed and\noutput files have been generated.\n\"\"\"\n\nimport os\nimport time\nimport shutil\nimport numpy as np\nimport pandas as pd\nimport unittest\nimport zipfile\nfrom pathlib import Path\n\n# Set shared...
[ [ "numpy.isnan" ] ]
tntek/PSAT-GDA
[ "89647ee66692da02359be7ca240b96b5cdbab19f" ]
[ "network.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torchvision\nfrom torchvision import models\nfrom torch.autograd import Variable\nimport math\nimport torch.nn.utils.weight_norm as weightNorm\nfrom collections import OrderedDict\nfrom models.modeling import VisionTransformer_shot as ViT_seg\nfrom mo...
[ [ "torch.nn.Linear", "torch.nn.init.kaiming_uniform_", "torch.nn.Dropout", "torch.nn.Sigmoid", "torch.nn.Sequential", "numpy.load", "numpy.exp", "torch.nn.ReLU", "torch.nn.init.normal_", "torch.nn.BatchNorm1d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.init.zeros_", ...
lmmx/DALL-E
[ "76b36ddc5372444448dd93d1e29f434831d5e17c" ]
[ "dall_e/__init__.py" ]
[ "import io, requests\nimport torch\nimport torch.nn as nn\n\nfrom dall_e.encoder import Encoder\nfrom dall_e.decoder import Decoder\nfrom dall_e.utils import map_pixels, unmap_pixels\nfrom dall_e._model_dl import models_path # Set up models directory\nfrom dall_e import models # Load implicit namespace module\n\n...
[ [ "torch.load" ] ]
xf4j/aapm_thoraric_challenge
[ "eb242ab5fb573152dd7490d06066e73182289406" ]
[ "main.py" ]
[ "from __future__ import division\nimport os\nimport numpy as np\nimport pickle\nimport pprint\nimport tensorflow as tf\n\nfrom utils import *\nfrom constants import *\nfrom model import UNet3D\n\nflags = tf.app.flags\nflags.DEFINE_integer(\"epoch\", 200, \"Epoch to train [200]\")\nflags.DEFINE_string(\"train_data_d...
[ [ "tensorflow.ConfigProto", "tensorflow.app.run", "tensorflow.reset_default_graph", "tensorflow.Session" ] ]
riven314/ENetDepth_TimeAnlysis_Tmp
[ "29bd864adf91700799d87b449d0c4e389f7028bc" ]
[ "models/enet.py" ]
[ "import torch.nn as nn\nimport torch\n\n\nclass InitialBlock(nn.Module):\n\t\"\"\"The initial block is composed of two branches:\n\t1. a main branch which performs a regular convolution with stride 2;\n\t2. an extension branch which performs max-pooling.\n\n\tDoing both operations in parallel and concatenating thei...
[ [ "torch.zeros", "torch.cat", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.PReLU", "torch.nn.MaxUnpool2d", "torch.nn.Dropout2d" ] ]
sanket-pixel/deep-video
[ "bc1465fe94149f84356fdf78caaa5b46e98738ae" ]
[ "TSN/demo.py" ]
[ "import cv2\nimport numpy as np\nfrom model import TSN\nimport os\nimport torch\nfrom dataset import RGBFrames\nfrom torchvision.transforms import Compose, Normalize, Resize, RandomHorizontalFlip, RandomApply, RandomCrop, RandomResizedCrop\nfrom torchvision import transforms\n\ndef get_file_names(path):\n with o...
[ [ "torch.cuda.is_available", "torch.load" ] ]
SMAPPNYU/smapp_text_classifier
[ "d4b75dbc3a5a8a9f7a01e69404efd4c5c51d062b" ]
[ "smapp_text_classifier/plot.py" ]
[ "'''\nOriginal code snippet found at:\nhttps://scikit-learn.org/stable/auto_examples/model_selection/plot_learning_curve.html#sphx-glr-auto-examples-model-selection-plot-learning-curve-py\n\n© 2007 - 2018, scikit-learn developers (BSD License)\n'''\nfrom textwrap import wrap\nimport numpy as np\nimport matplotlib.p...
[ [ "sklearn.datasets.load_digits", "numpy.mean", "sklearn.model_selection.learning_curve", "matplotlib.pyplot.savefig", "sklearn.svm.SVC", "matplotlib.pyplot.fill_between", "sklearn.naive_bayes.GaussianNB", "matplotlib.pyplot.figure", "numpy.std", "matplotlib.pyplot.show", ...
warnerwarner/tensortools
[ "1b6b5c89e915a0b9e98459e0b9e9520893141457" ]
[ "tests/test_ktensor.py" ]
[ "\"\"\"Test KTensor functions.\"\"\"\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_almost_equal\n\nfrom tensortools import KTensor\n\n\ndef test_norm():\n\n rs = np.random.RandomState(123)\n U = KTensor([rs.randn(55, 3) for _ in range(3)])\n\n assert_almost_equal(U.norm(), np.linalg....
[ [ "numpy.random.RandomState" ] ]
alon/emolog
[ "ed6e9e30a46ffc04282527ee73aa3bb8605e2dc9" ]
[ "emolog_pc/misc/gtk_queue_samples_plotter.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nExample of embedding matplotlib in an application and interacting with\na treeview to store data. Double click on an entry to update plot\ndata\n\n\"\"\"\nimport pygtk\npygtk.require('2.0')\nimport gtk\nfrom gtk import gdk\n\nimport matplotlib\nmatplotlib.use('GTKAgg') # or 'GTK'\n...
[ [ "matplotlib.use", "numpy.random.random", "matplotlib.backends.backend_gtk.FigureCanvasGTK", "matplotlib.figure.Figure" ] ]
manhhomienbienthuy/break_captcha_ver2
[ "1fe323c5ed112ce3f071480863a87612459b7e7a" ]
[ "prepare_data.py" ]
[ "from __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport requests\r\nimport os\r\nfrom os import listdir\r\nfrom os.path import join, isfile\r\nfrom PIL import Image, ImageChops\r\nimport math\r\nimport numpy as np\r\nimport cv2\r\nimport random\r\nimport string\r\nfrom scipy.misc imp...
[ [ "scipy.misc.imread", "numpy.array" ] ]
lemonwaffle/nflows
[ "70a2417dc5bb41858bf12467789e4187f4ae212c" ]
[ "tests/transforms/splines/cubic_test.py" ]
[ "import torch\nimport torchtestcase\n\nfrom nflows.transforms import splines\n\n\nclass CubicSplineTest(torchtestcase.TorchTestCase):\n def test_forward_inverse_are_consistent(self):\n num_bins = 10\n shape = [2, 3, 4]\n\n unnormalized_widths = torch.randn(*shape, num_bins)\n unnormal...
[ [ "torch.zeros_like", "torch.rand", "torch.randn" ] ]
rkimball/incubator-tvm
[ "85e42b6af38ea3bd0c99c8208d7baed5086a8959" ]
[ "tests/python/contrib/test_hexagon/test_usmp.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.random.rand" ] ]
Nayananga/gpt-2
[ "edf42c3190188891fba043d1f6edf397bc3d197d" ]
[ "src/load_dataset.py" ]
[ "import glob\nimport os\n\nimport numpy as np\nimport tqdm\n\n\ndef load_dataset(enc, path, combine, encoding=None):\n paths = []\n if os.path.isfile(path):\n # Simple file\n paths.append(path)\n elif os.path.isdir(path):\n # Directory\n for (dirpath, _, fnames) in os.walk(path)...
[ [ "numpy.load", "numpy.random.RandomState" ] ]
ferdinandb/pyHEC
[ "d1f0cb5001b98176098b16abccc03d2396f54685" ]
[ "pyhec/core/util/parallel_processing_util.py" ]
[ "\"\"\"\nHelper functions for the parallel processing module\n\"\"\"\n\nimport pandas as pd\nimport sys\nimport csv\n\ndef read_csv(files, **kwargs):\n \"\"\"\n Reads a list of CSV files. This function is used for the overarching wrapper to read\n CSV files in parallel.\n\n :param files: A list of files...
[ [ "pandas.read_csv" ] ]
kaaiian/CrabNet
[ "32791345522da1029e690512a04006695ff0eff7" ]
[ "data/get_dataset_size.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\n\nfrom tqdm import tqdm\nfrom utils.composition import _element_composition\n\n\n# %%\nbenchmark_data = os.listdir('data/benchmark_data')\nmatbench_data = os.listdir('data/matbench_cv')\n\n\n# %%\ncols = ['mat_prop', 'samples_total',\n 'samples_train', 'sa...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
spilchen/yahoo-baseball-assistant
[ "a2bed8059cd9201b145d83f5dca20e1b9f4c67e8" ]
[ "yahoo_fantasy_bot/tests/conftest.py" ]
[ "#!/usr/bin/python\n\nimport pytest\nimport pandas as pd\nimport numpy as np\nfrom yahoo_fantasy_bot import roster\n\nRBLDR_COLS = [\"player_id\", \"name\", \"eligible_positions\", \"selected_position\"]\nRSEL_COLS = [\"player_id\", \"name\", \"HR\", \"OBP\", \"W\", \"ERA\"]\n\n\n@pytest.fixture\ndef empty_roster()...
[ [ "pandas.DataFrame" ] ]
gesellkammer/lambdasim
[ "7cab12d69b412005665b527657905d4c6a5a0db4" ]
[ "lambdasim/sim.py" ]
[ "from __future__ import absolute_import, print_function, division\n\nimport os\nimport math\nimport numpy\nimport warnings\nfrom collections import namedtuple\n\n# 3rd party\nimport shapelib\nimport sndfileio\n\n# local\nfrom .conversions import *\nfrom .io import *\nfrom .filtering import *\nfrom .source import *\...
[ [ "numpy.array", "numpy.ones_like", "numpy.zeros", "numpy.ones", "numpy.nonzero", "numpy.fromfile" ] ]
leilayasmeen/MSc_Thesis
[ "ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d" ]
[ "final_code/nn_training_scripts/mixup_generator.py" ]
[ "# This file is used when training neural networks with mixup\n# It should be called from the neural network training file.\n# It implements mixup, as descripted in the 2017 paper by Zhang et al.,\n# by creating training batches of mixed images\n# The code was adapted from the implementation at: \n# https://raw.git...
[ [ "numpy.random.beta", "numpy.arange", "numpy.random.shuffle" ] ]
ivallesp/keras
[ "1a35ff2788b5e6880ceb8af82e1a8d5f72d0f76f" ]
[ "keras/metrics_test.py" ]
[ "# Copyright 2016 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.compat.v1.get_default_graph", "numpy.exp", "numpy.mean", "numpy.multiply", "tensorflow.cast", "tensorflow.compat.v1.placeholder", "numpy.full", "tensorflow.compat.v1.variables_initializer", "numpy.log", "tensorflow.constant", "tensorflow.compat.v1.zeros_like...
taneroksuz/riscv-sfpu
[ "dbbb87d44e4fc790fb169b88b9845b7ea90e3be8" ]
[ "scripts/fma.py" ]
[ "#!/usr/bin/env python\n\nimport binascii\nimport sys\nimport subprocess\nimport os\nimport struct\nimport numpy as np\n\ndef fdiv_single(float_a,float_b,float_c,f):\n a = struct.unpack('!f', float_a.decode('hex'))[0]\n b = struct.unpack('!f', float_b.decode('hex'))[0]\n sig_a = int((int(float_a,16) & int(...
[ [ "numpy.float32" ] ]
superdan-t/Not-A-Tank
[ "35784b955818b4b0db0a9dca1c5fd4cff9509cdd" ]
[ "TenacityRover/controller/imagezmq.py" ]
[ "\"\"\" imagezmq: Transport OpenCV images via ZMQ.\nClasses that transport OpenCV images from one computer to another. For example,\nOpenCV images gathered by a Raspberry Pi camera could be sent to another\ncomputer for displaying the images using cv2.imshow() or for further image\nprocessing. See API and Usage Exa...
[ [ "numpy.ascontiguousarray", "numpy.frombuffer" ] ]
OumaimaHourrane/SmallDataLongDocuments
[ "57e883423dd4b9fcc5de191928ab4fadc404bcb2" ]
[ "oumaima/make_dataset.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Sep 15 12:06:19 2020\n\n@author: jonas\n\n@tile: make_dataset\n\n@description: script to transform taxonomy from excel sheet to machine readable format in python.\n\"\"\"\n#%%\n'''import packages'''\nimport os\nimport sys\n\nimport pandas as p...
[ [ "pandas.DataFrame", "pandas.get_dummies" ] ]
gregoryng/SpaceXtract
[ "e011b43b442e6f50095ec1e1289904cad83379a5" ]
[ "src/Analysis/analyse_raw_telemetry.py" ]
[ "import numpy as np\nimport json\n\nfrom pandas.util.testing import all_timeseries_index_generator\nfrom scipy.signal import savgol_filter\nfrom scipy.optimize import curve_fit\nimport scipy\nimport matplotlib.pyplot as plt\nfrom math import fabs, pi, asin, sin, log, degrees, acos\nimport trendline\nfrom scipy.inte...
[ [ "scipy.interpolate.interp1d", "numpy.array", "scipy.signal.savgol_filter", "numpy.isnan", "numpy.sin", "numpy.minimum", "numpy.log", "numpy.interp", "numpy.multiply", "numpy.sign", "scipy.signal.medfilt", "numpy.subtract", "numpy.arange", "numpy.argmax", ...
JaniAnttonenp/ml-fairness
[ "d76786f5bfb00239a8a68d6de69b9889cf7cf61e" ]
[ "environments/recommenders/recsim_samplers.py" ]
[ "# coding=utf-8\n# Copyright 2020 The ML Fairness Gym Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.random.RandomState", "numpy.sum", "numpy.split", "numpy.cumsum", "numpy.iinfo" ] ]
csajedi/mergelife
[ "1a7ab53f0705a4bdef851e132dbd6f25ac4673dc" ]
[ "python/mergelife.py" ]
[ "import numpy as np\nfrom scipy.ndimage import convolve\nimport scipy\nimport scipy.stats\nimport ctypes\nfrom PIL import Image\nimport dp\nimport logging\n\nPATH = \"C:\\\\Users\\\\jeffh\\\\temp\\mlife\\\\\"\nlogger = logging.getLogger(\"mergelife\")\n\n# The color table.\nCOLOR_TABLE = [\n [0, 0, 0], # Black ...
[ [ "scipy.stats.mode", "scipy.ndimage.convolve", "numpy.logical_or", "numpy.dot", "numpy.logical_not", "numpy.max", "numpy.zeros", "numpy.sum", "numpy.copy", "numpy.logical_and", "numpy.random.randint", "numpy.floor" ] ]
millicentli/clin-bias-summarization
[ "bab94e8480b98109fe8b390a99317f635fce66b4" ]
[ "scripts/make_targets.py" ]
[ "# code is a mess since it's mostly exported from a jupyter notebook\nimport os\nimport pandas as pd\nimport Constants\nfrom sklearn.model_selection import KFold\nfrom readers import PhenotypingReader, InHospitalMortalityReader\nimport yaml\nfrom argparse import ArgumentParser\nfrom pathlib import Path\n\nparser = ...
[ [ "pandas.isnull", "pandas.Timedelta", "pandas.merge", "pandas.DataFrame", "sklearn.model_selection.KFold" ] ]
bitnot/ud120
[ "344469e5e0e875473f2070e333f706d7987b4993" ]
[ "naive_bayes/basic_classifier/ClassifyNB.py" ]
[ "from sklearn.naive_bayes import GaussianNB\n\ndef classify(features_train, labels_train):\n classifier = GaussianNB()\n classifier.fit(features_train, labels_train)\n return classifier\n" ]
[ [ "sklearn.naive_bayes.GaussianNB" ] ]
cognirob/crow_vision_yolact
[ "9c547be146ddd73f33e36e0683b2179468cd4250" ]
[ "run_test_on_multi_dataset.py" ]
[ "import os\nimport numpy as np\n\ntrained_model = './data/yolact/weights/weights_yolact_kuka_14/crow_plus_base_56_330000.pth'\nscore_threshold = '0.15'\ntop_k = '15'\nmax_images='1000'\nimage_source_cams=[1,1,1,1,1,1,1,1]\n\ncommand = 'python eval.py --trained_model='+trained_model+' --score_threshold='+score_thres...
[ [ "numpy.nonzero" ] ]
EnricoReg/asynch-rl
[ "acd01a49a7a4b8ff4ff0694d1e24274ba87691ee" ]
[ "asynch_rl/rl/resources/sim_agent.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Sep 8 14:23:05 2020\n\n@author: Enrico Regolin\n\"\"\"\n\n# Importing the libraries\n# required if current directory is not found\nimport sys \nimport os\nos.environ[\"KMP_DUPLICATE_LIB_OK\"]=\"TRUE\"\n\n \nfrom pathlib import Path as createPath\n#%%\nimport rand...
[ [ "torch.isnan", "torch.multinomial", "torch.is_tensor", "torch.tensor", "numpy.append", "torch.zeros", "numpy.array", "numpy.zeros", "numpy.round", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "torch.log", "numpy.average", ...
Torato-Taraka/Fingerprint
[ "badea84d89db696a5b090130498343df032ed6f8" ]
[ "minutiae_former.py" ]
[ "import argparse\nfrom myPackage import tools as tl\nfrom myPackage import preprocess\nfrom myPackage import minutiaeExtraction as minExtract\nfrom enhancementFP import image_enhance as img_e\nfrom os.path import basename, splitext\nimport os\nimport time\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy a...
[ [ "numpy.std", "numpy.mean" ] ]
shiv-io/pandas
[ "a1d9c96389b27e55d1d9910f97ae42fdf3e2b393" ]
[ "pandas/core/internals/managers.py" ]
[ "from __future__ import annotations\n\nfrom collections import defaultdict\nimport itertools\nfrom typing import (\n Any,\n Callable,\n DefaultDict,\n Hashable,\n Sequence,\n TypeVar,\n cast,\n)\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import (\n internals as libinternals,...
[ [ "pandas._libs.internals.get_blkno_placements", "pandas.core.indexes.api.ensure_index", "pandas.core.construction.extract_array", "pandas._libs.lib.is_integer", "pandas.core.internals.blocks.ensure_block_shape", "numpy.dtype", "pandas._libs.internals.BlockPlacement", "pandas.core.in...
SkyLord2/ResNetByTFKeras
[ "70d00ef1c559d7d5ab895d3dfce6074fd316793b" ]
[ "resnet.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 2020/10/22 20:14\n# @Author : cds\n# @Site : https://github.com/SkyLord2?tab=repositories\n# @Email: chengdongsheng@outlook.com\n# @File : resnet.py\n# @Software: PyCharm\n\nfrom tensorflow.keras import layers,Model,Sequential\n\nclass BasicBlock(layers.Layer):\n expansion=1\n...
[ [ "tensorflow.keras.layers.Add", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.layers.GlobalAvgPool2D", "tensorflow.keras.Sequential", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflo...
AlbertoBarbado/unsupervised-outlier-transparency
[ "d80637cd0a9f70a3ff5f327952b4bd6377826707" ]
[ "lib/common.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Oct 6 10:13:42 2019\n\n@author: alber\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn import svm\nfrom sklearn.preprocessing import StandardScaler\nfrom joblib import Parallel, delayed\nfrom sklearn.tree import _tree\n\ndef train_one_class_svm(datas...
[ [ "pandas.merge", "sklearn.preprocessing.StandardScaler", "numpy.shape", "numpy.arange", "sklearn.svm.OneClassSVM", "numpy.abs" ] ]
NoelShin/PixelPick
[ "f0ae7d35f62c1dda70f5bff1689177a513ab6259" ]
[ "datasets/voc.py" ]
[ "import os\nfrom glob import glob\nfrom random import random, randint, uniform\nimport pickle as pkl\n\nimport numpy as np\nimport cv2\nfrom PIL import Image, ImageFile\nimport torch\nfrom torchvision.datasets import VOCSegmentation\nfrom torchvision.transforms import ColorJitter, RandomApply, RandomGrayscale, Cent...
[ [ "numpy.logical_or", "numpy.array", "numpy.random.choice", "numpy.asarray", "numpy.zeros", "numpy.random.random_sample", "numpy.where" ] ]
ddavid/kafvio
[ "33f36140e392ef5b421d3a323d785749d2aa9a17" ]
[ "scripts/gen_anchors.py" ]
[ "'''\nCreated on Feb 20, 2017\n\n@author: jumabek\n'''\nfrom os import listdir\nfrom os.path import isfile, join\nimport argparse\n#import cv2\nimport numpy as np\nimport sys\nimport os\nimport shutil\nimport random \nimport math\n\nwidth_in_cfg_file = 416.\nheight_in_cfg_file = 416.\n\ndef IOU(x,centroids):\n s...
[ [ "numpy.array", "numpy.zeros", "numpy.argmin", "numpy.sum", "numpy.ones", "numpy.argsort", "numpy.abs" ] ]
zhiyiYo/Alpha-Gobang-Zero
[ "b0e90ae456b02754956be83a0d6495391390e666" ]
[ "utils/draw_model.py" ]
[ "# coding:utf-8\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom alphazero import PolicyValueNet\n\n\nnet = PolicyValueNet(is_use_gpu=False)\nwith SummaryWriter('log', comment='策略-价值模型') as w:\n w.add_graph(net, torch.zeros(1, 6, 9, 9))\n" ]
[ [ "torch.zeros", "torch.utils.tensorboard.SummaryWriter" ] ]
newsettle/ns4_chatbot
[ "526b97aa31292c28d10518bbfaa7466b8ba109ee" ]
[ "business/classify/data_process.py" ]
[ "#-*- coding:utf-8 -*-\nimport time\nfrom bs4 import BeautifulSoup\nfrom scipy.sparse import csc_matrix\nimport pandas as pd\nimport jieba,re,sys\nfrom gensim import corpora, models\nimport gensim\nimport logging as logger\nfrom time import time\nfrom sqlalchemy import create_engine\nimport sys,numpy as np\nfrom co...
[ [ "numpy.array", "pandas.read_sql", "scipy.sparse.csc_matrix" ] ]
dfuttu1/AGNN
[ "579a28388ba3e28d3382ef71c4ab089bedb4705a" ]
[ "code/datasets.py" ]
[ "import os.path as osp\nimport numpy as np\nimport scipy.sparse as sp\nimport networkx as nx\nimport os\nimport torch\nimport sys\nimport argparse\nimport numpy as np\nfrom torch_geometric.utils import to_undirected\nfrom tqdm import tqdm\nfrom torch_geometric.data import InMemoryDataset, Data, DataLoader\nfrom get...
[ [ "torch.Size", "numpy.concatenate", "torch.zeros", "torch.cat", "numpy.setdiff1d", "numpy.zeros", "numpy.random.RandomState", "numpy.sum", "numpy.load", "torch.sparse.FloatTensor", "torch.from_numpy", "torch.ones", "torch.LongTensor", "torch.load", "numpy...
jeremiedecock/botsim
[ "73262092a8769c331edb96e083e32156f33bf948" ]
[ "utils/plot_part_dat.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015 Jérémie DECOCK (jd.jdhp@gmail.com)\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\n\nimport argparse\n\ndef parse_part_log_file(filename):\n log_data = np.loadtxt(filename)\n\n data_dict = {}\n data_dict[\"time_se...
[ [ "matplotlib.pyplot.savefig", "numpy.loadtxt", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
eteq/python-skyfield
[ "e524e069a52711c707e85a42ce86cc8e06f71862" ]
[ "skyfield/searchlib.py" ]
[ "\"\"\"Routines to search for maxima and zero crossings.\"\"\"\n\nfrom __future__ import print_function, division\n\nfrom numpy import (\n concatenate, diff, flatnonzero, linspace, multiply, sign, sort\n)\nfrom .constants import DAY_S\nEPSILON = 0.001 / DAY_S\n\ndef find_discrete(start_time, end_time, f, epsilon...
[ [ "numpy.concatenate", "numpy.diff", "numpy.sort", "numpy.linspace", "numpy.flatnonzero" ] ]
Arpita-25/invincible
[ "124beceec3c45458fe19b95a59eb7c01dd74e85b" ]
[ "WebD_File/try_on/cp_dataset.py" ]
[ "# coding=utf-8\nimport torch\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\n\nfrom PIL import Image\nfrom PIL import ImageDraw\n\nimport os.path as osp\nimport numpy as np\nimport json\n\n\nclass CPDataset(data.Dataset):\n \"\"\"Dataset for CP-VTON+.\n \"\"\"\n\n def __init...
[ [ "torch.zeros", "numpy.array", "torch.cat", "torch.utils.data.sampler.RandomSampler", "torch.from_numpy", "torch.utils.data.DataLoader" ] ]
ggoom/necstlab-damage-segmentation
[ "9adf087ea41f1cdd6d2b0eb5a546606c32a73590" ]
[ "train_segmentation_model.py" ]
[ "import shutil\nimport os\nimport random\nimport numpy as np\nimport yaml\nfrom pathlib import Path\nfrom datetime import datetime\nimport pytz\nimport matplotlib.pyplot as plt\nfrom keras.callbacks import ModelCheckpoint, TensorBoard, CSVLogger\nfrom image_utils import TensorBoardImage, ImagesAndMasksGenerator, tr...
[ [ "numpy.asarray", "matplotlib.pyplot.subplots" ] ]
lzha106/FDDB-tools-for-windows
[ "6a5d3f4381c87d8e22f66f83268549e040054ce5" ]
[ "mtcnn_fddb/mtcnn_face_det.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport sys\nimport argparse\nimport tensorflow as tf\nimport numpy as np\nimport src.align.detect_face\nimport src.align as align\nimport cv2\n\ndef detect_face(img, pnet, rnet, onet):\n minsize = 2...
[ [ "numpy.asarray", "numpy.zeros", "numpy.minimum", "tensorflow.Graph", "tensorflow.Session", "numpy.squeeze", "numpy.maximum" ] ]
LiCHOTHU/ocean-kp
[ "2102bda2e51233baad0da12a6b1f168a7882564b" ]
[ "rlkit/envs/humanoid_multi_dir.py" ]
[ "import numpy as np\r\n\r\nfrom gym.envs.mujoco import HumanoidEnv as HumanoidEnv\r\nfrom . import register_env\r\n\r\ndef mass_center(model, sim):\r\n mass = np.expand_dims(model.body_mass, 1)\r\n xpos = sim.data.xipos\r\n return (np.sum(mass * xpos, 0) / np.sum(mass))\r\n\r\n\r\n@register_env('humanoid-m...
[ [ "numpy.concatenate", "numpy.square", "numpy.sin", "numpy.sum", "numpy.random.uniform", "numpy.cos", "numpy.searchsorted", "numpy.expand_dims" ] ]
wbhu/SphericalViewSynthesis
[ "e2af7edf1cc3c98835382c0016fb0a4e868faeb3" ]
[ "dataset/transform.py" ]
[ "#!/usr/bin/env python\n\"\"\"\n File Name : SparseVec-transform\n date : 4/11/2019\n Author : wenbo\n Email : huwenbodut@gmail.com\n Description :\n _ _\n ( |---/ )\n ) . . (\n______...
[ [ "numpy.expand_dims" ] ]
hdevillepoix/astroquery
[ "ce8c500c28424fe841e04741d4230b8f695ee194" ]
[ "astroquery/nist/tests/test_nist.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport os\n\nimport numpy.testing as npt\nimport pytest\nfrom astropy.table import Table\nimport astropy.units as u\n\nfrom ...utils.testing_tools import MockResponse\nfrom ... import nist\n\nDATA_FILES = {'lines': 'nist_out.html'}\n\n\ndef data_path...
[ [ "numpy.testing.assert_approx_equal" ] ]
JonDamFlindt/DM562-Rabbits-and-Foxes
[ "a80d3d936b0c7d377db649f83495c24e700446d6" ]
[ "reporting.py" ]
[ "import matplotlib as matplot\nimport matplotlib.pyplot as plt\nfrom results import *\n\n\ndef print_summary(results: SimulationStats):\n \"\"\"Prints a short summary regarding the populations of the simulation.\"\"\"\n\n for item in [['FOXES', results.foxes],['RABBITS', results.rabbits]]:\n animal = item[...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.colors.LinearSegmentedColormap.from_list" ] ]