repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
gnafit/gna
[ "c1a58dac11783342c97a2da1b19c97b85bce0394" ]
[ "pylib/gna/bundles/root_histograms_v03.py" ]
[ "\nfrom load import ROOT as R\nimport numpy as N\nfrom gna.env import env, namespace\nfrom collections import OrderedDict\nfrom mpl_tools.root2numpy import get_buffer_hist1, get_bin_edges_axis\nfrom gna.constructors import Histogram\nfrom gna.configurator import NestedDict\nfrom gna.grouping import Categories\n\nfr...
[ [ "numpy.ascontiguousarray" ] ]
nwlambert/matsubara
[ "859596d2112e8be540618164d067db79fc5f4e47" ]
[ "matsubara/tests/test_pure_dephasing.py" ]
[ "\"\"\"\nTests for the pure dephasing analytical computations.\n\"\"\"\n\nimport numpy as np\nfrom numpy.testing import (run_module_suite, assert_,\n assert_array_almost_equal, assert_raises)\nfrom matsubara.pure_dephasing import (pure_dephasing_integrand,\n ...
[ [ "numpy.testing.run_module_suite", "numpy.abs", "numpy.max", "numpy.concatenate", "numpy.linspace" ] ]
wl1447215262/hyper
[ "93cc5877e4a20f0bb6f5788510a590e658fc22b7" ]
[ "HyperLprGUI.py" ]
[ "\"\"\"\nAuthor: youngorsu\nEmail : zhiyongsu@qq.com\nLast edited: 2018.1.29\n\"\"\"\n# coding=utf-8\n\n\nimport sys\nimport os\nfrom PyQt5.QtWidgets import (\n QMainWindow,\n QLabel,\n QLineEdit,\n QPushButton,\n QHBoxLayout,\n QVBoxLayout,\n QGridLayout,\n QTableWidget,\n QWidget,\n ...
[ [ "numpy.fromfile" ] ]
monshri/adversarial-robustness-toolbox
[ "6465240cb6a71bc376dae52459a7133e403df8d2", "6465240cb6a71bc376dae52459a7133e403df8d2" ]
[ "art/attacks/evasion/auto_projected_gradient_descent.py", "tests/defences/test_feature_squeezing.py" ]
[ "# MIT License\n#\n# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limita...
[ [ "numpy.sum", "numpy.ones", "tensorflow.argsort", "torch.stack", "torch.argsort", "torch.diagonal", "numpy.abs", "torch.from_numpy", "tensorflow.stack", "torch.argmax", "numpy.argmax", "tensorflow.cast", "numpy.prod", "numpy.square", "numpy.sign", "te...
sugyan/image-dataset
[ "2d0190714048cbc3750e3bb3609294f42170bcb9" ]
[ "python/detect.py" ]
[ "import argparse\nimport logging\nimport math\nimport cv2\nimport dlib\nimport numpy as np\n\n\nclass Detector():\n def __init__(self, datafile='shape_predictor_68_face_landmarks.dat', verbose=False):\n logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s')\n self.logger = logging.getL...
[ [ "numpy.rint", "numpy.zeros", "numpy.array", "numpy.pad", "numpy.linalg.norm" ] ]
louispotok/great_expectations
[ "b91a3ce10f771742f49ccad9c403bda03f318515" ]
[ "tests/datasource/test_pandas_datasource.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pytest\n\nimport os\nfrom ruamel.yaml import YAML\n\nimport pandas as pd\nfrom six import PY3\nimport shutil\n\n\nfrom great_expectations.exceptions import BatchKwargsError\nfrom great_expectations.datasource import PandasDatasource\nfrom great_expectations.datasource.types.batch_...
[ [ "pandas.DataFrame" ] ]
raymondEhlers/pachyderm
[ "c9a554d8c4e904315171a5aafa4569259e280fa4" ]
[ "pachyderm/binned_data.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\" Functionality related to binned data.\n\n.. codeauthor:: Ramyond Ehlers <raymond.ehlers@cern.ch>, ORNL\n\"\"\"\n\nimport collections\nimport itertools\nimport logging\nimport operator\nimport uuid\nfrom functools import reduce\nfrom typing import TYPE_CHECKING, Any, Dict, List, Map...
[ [ "numpy.sqrt", "numpy.allclose", "numpy.zeros_like", "numpy.append", "numpy.searchsorted", "numpy.ones_like", "numpy.copy", "numpy.may_share_memory", "numpy.array", "numpy.isscalar" ] ]
vikrant-github/python-data-science
[ "8f1d7631e302e7e751008aa16caa4d044411de43" ]
[ "src/models/machine_learning_api.py" ]
[ "\r\nfrom flask import Flask, request\r\nimport pandas as pd\r\nimport numpy as np\r\nimport json\r\nimport pickle\r\nimport os\r\n\r\napp = Flask(__name__)\r\n\r\n# Load Model and Scaler Files\r\nmodel_path = os.path.join(os.path.pardir,os.path.pardir,'models')\r\nmodel_filepath = os.path.join(model_path, 'lr_mode...
[ [ "pandas.DataFrame", "pandas.read_json" ] ]
SamLubbers/rainforest_land_use_classification
[ "8eb27b8cf4cacfacd53f066b05d5ea13196d1ba3" ]
[ "helpers/evaluation.py" ]
[ "import os\nimport sys\nfrom collections import OrderedDict\n\nimport pandas as pd\n\nfrom .data import extract_label_values\n\nsys.path.append(\"../\")\nfrom config import DATASETS_PATH\n\nfrom sklearn.metrics import fbeta_score\n\n\ndef evaluate_performance_validation(predictions, beta=2):\n labels = pd.read_c...
[ [ "sklearn.metrics.fbeta_score" ] ]
TVM-for-armgpu/tvm
[ "4c4392306f5b4d21e85d633231bae71e935f39a2" ]
[ "python/tvm/autotvm/tuner/tuner.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.mean" ] ]
ManianVSS/Shani
[ "2c9e5c0f8a0f073d891a84c38131da02deff0330" ]
[ "ucm_drf/api/ipte_util.py" ]
[ "from scipy.stats.distributions import chi2\n\n\n#\n# def ipte_formula(iterations_or_ipte, number_of_incidents, confidence):\n# chi_square_inverse_right_tailed = chi2.ppf(confidence, df=2 * (number_of_incidents + 1))\n# return chi_square_inverse_right_tailed * (1000 / (iterations_or_ipte * 2))\n#\n\ndef cal...
[ [ "scipy.stats.distributions.chi2.ppf" ] ]
ethall/LED-Timeline
[ "f8d25c112c944db7d698eb7b9b31bc2d6b9c12e0" ]
[ "p03_gray.py" ]
[ "import cv2 as _cv\nimport numpy as _np\n\nfrom _util import get_frames as _get_frames, matrix_to_video as _matrix_to_video\n\n\ndef to_grayscale(source: str, destination: str) -> None:\n vid = _cv.VideoCapture(source)\n\n # (t,y,x,chan)\n denoised_color_movie = _get_frames(vid)\n print(\"Converting to ...
[ [ "numpy.zeros" ] ]
danilobr94/dynamic-aif-framework
[ "39710501c4d3383c595b058d963719a0e9858c0b" ]
[ "ltf/state_plot.py" ]
[ "\"\"\"2D Scatter plot for data points of one iteration.\"\"\"\nimport numpy as np\n\n\nclass StatePlot:\n \"\"\"Plot data of one time step.\"\"\"\n\n def __init__(self, x_lim=None, y_lim=None, pos_lbl=1, neg_lbl=0, pos_cls=1, neg_cls=0):\n \"\"\"\n\n Args:\n x_lim [int, int]: Min and...
[ [ "numpy.arange", "numpy.sum", "numpy.logical_and", "numpy.shape" ] ]
xiabo0816/ChemNer
[ "d89f1913a5510d21171bee6809a08bbce7d3d4cc" ]
[ "BiLSTM-CRF-baseline-model/run_lstm_crf.py" ]
[ "import json\r\nimport torch\r\nimport argparse\r\nimport torch.nn as nn\r\nfrom torch import optim\r\nimport config\r\nfrom model import NERModel\r\nfrom dataset_loader import DatasetLoader\r\nfrom progressbar import ProgressBar\r\nfrom ner_metrics import SeqEntityScore\r\nfrom data_processor import CluenerProcess...
[ [ "torch.cuda.empty_cache", "torch.load", "torch.no_grad", "torch.tensor", "torch.optim.Adam", "torch.device" ] ]
saurabhya/kornia
[ "f2b4fe9fb32d99795783f25b5a4c561001783ebf" ]
[ "test/feature/test_laf.py" ]
[ "import pytest\nimport torch\nfrom torch.autograd import gradcheck\n\nimport kornia\nimport kornia.geometry.transform.imgwarp\nimport kornia.testing as utils # test utils\nfrom kornia.testing import assert_close\n\n\nclass TestAngleToRotationMatrix:\n def test_shape(self, device):\n inp = torch.ones(1, 3...
[ [ "torch.jit.script", "torch.ones", "torch.inverse", "torch.rand", "torch.zeros_like", "torch.tensor", "torch.zeros", "torch.autograd.gradcheck" ] ]
Jwuthri/GtfsTools
[ "d0db0c89588f936f02d4e6cccb70034ec1e4b9b1" ]
[ "mixer/gtfs/generater/shapes.py" ]
[ "\"\"\"Generate the file shapes.txt.\"\"\"\r\nimport networkx as nx\r\nimport multiprocessing as mp\r\nfrom hashlib import sha1\r\nfrom tqdm import tqdm\r\n\r\nimport pandas as pd\r\n\r\nfrom mixer.gtfs.reader.controller import Controller\r\n\r\n\r\nclass EstimateShapes(object):\r\n \"\"\"Gen or fill shapes.\"\"...
[ [ "pandas.DataFrame", "pandas.merge", "pandas.concat", "pandas.DataFrame.from_dict" ] ]
huangwenwenlili/imgclsmob
[ "1505fd61acbed429773f5c7ce286c858fc2278b8" ]
[ "gluon/gluoncv2/models/densenet.py" ]
[ "\"\"\"\n DenseNet, implemented in Gluon.\n Original paper: 'Densely Connected Convolutional Networks,' https://arxiv.org/abs/1608.06993.\n\"\"\"\n\n__all__ = ['DenseNet', 'densenet121', 'densenet161', 'densenet169', 'densenet201']\n\nimport os\nfrom mxnet import cpu\nfrom mxnet.gluon import nn, HybridBlock\n...
[ [ "numpy.prod" ] ]
spencer-hong/QSARBO
[ "a9fa8cbf058abea715fe2c721564f662ed8b1135" ]
[ "tutorial/lstm.py" ]
[ "from keras.callbacks import ModelCheckpoint\nfrom keras import backend as K\nfrom keras import optimizers\nfrom keras.layers import Dense\nfrom keras.layers import Dense, Dropout\nfrom keras.models import Sequential\nfrom keras.wrappers.scikit_learn import KerasClassifier\nfrom pandas import ExcelFile\nfrom pandas...
[ [ "matplotlib.pyplot.legend", "numpy.append", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "pandas.DataFrame", "numpy.argmax", "matplotlib.pyplot.subplot", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "matplotlib.p...
svandenhoek/NeuralCR
[ "52d2fecc38760c7e7a975c5631241d4ffe457249" ]
[ "train.py" ]
[ "import argparse\nimport ncrmodel \nimport numpy as np\nimport os\nfrom onto import Ontology\nimport json\nimport fastText\nimport pickle \nimport tensorflow as tf\nimport accuracy\nimport annotate_text\nimport eval\nimport tempfile\nimport shutil\nimport random\ntf.enable_eager_execution()\n\ndef save_ont_and_args...
[ [ "tensorflow.enable_eager_execution", "tensorflow.train.AdamOptimizer", "tensorflow.GradientTape", "tensorflow.losses.sparse_softmax_cross_entropy", "numpy.array", "numpy.random.randint" ] ]
tmsincomb/pyontutils
[ "dad24e7178d8d8cd3bd60d53b9039952fa7a5a1e" ]
[ "ilxutils/ilxutils/ontopandas.py" ]
[ "\"\"\" Converts owl or ttl or raw rdflib graph into a pandas DataFrame. Saved in .pickle format.\n\n Usage:\n Graph2Pandas.py [-h | --help]\n Graph2Pandas.py [-v | --version]\n Graph2Pandas.py [-f=<path>] [-a | -t=<str>] [-o=<path>]\n\n Options:\n -h --help Display this ...
[ [ "pandas.Series", "pandas.notnull", "pandas.DataFrame" ] ]
gregvw/pyQAOA
[ "59b5abda36d90b45913878e7ffb588a1c146bc38" ]
[ "qaoa/operators/sum_sigma_x_propagator.py" ]
[ "import numpy as np\nfrom qaoa.operators import Kronecker, SumSigmaXOperator, Propagator\n\nclass SumSigmaXPropagator(Propagator):\n \n def __init__(self,D,theta=0):\n assert( isinstance(D,SumSigmaXOperator) )\n self.kronecker = Kronecker(np.eye(2),D.num_qubits(),dtype=complex)\n super()....
[ [ "numpy.array", "numpy.eye", "numpy.cos", "numpy.sin" ] ]
tkoyama010/pyvista-doc-translations
[ "23bb813387b7f8bfe17e86c2244d5dd2243990db" ]
[ "locale/pot/api/core/_autosummary/pyvista-PolyData-lines-1.py" ]
[ "# Return the lines from a spline.\n#\nimport pyvista\nimport numpy as np\npoints = np.random.random((3, 3))\nspline = pyvista.Spline(points, 10)\nspline.lines\n# Expected:\n## array([10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9])\n" ]
[ [ "numpy.random.random" ] ]
snu-mllab/PuzzleMix
[ "18986c3cd745a18b281e45082704cfd497ad6a9b" ]
[ "imagenet_fast/main_test.py" ]
[ "# This module is adapted from https://github.com/mahyarnajibi/FreeAdversarialTraining/blob/master/main_free.py\n# Which in turn was adapted from https://github.com/pytorch/examples/blob/master/imagenet/main.py\nimport init_paths\nimport argparse\nimport os\nimport time\nimport sys\nimport torch\nimport torch.nn as...
[ [ "torch.optim.SGD", "torch.load", "torch.mean", "torch.clamp", "torch.nn.functional.softmax", "numpy.concatenate", "torch.no_grad", "torch.zeros_like", "torch.autograd.Variable", "torch.nn.CrossEntropyLoss", "numpy.random.beta", "torch.nn.functional.kl_div", "tor...
anirudh-chakravarthy/PropTR
[ "29448a0c73da6c9918d161228d92409d3d1315db" ]
[ "datasets/transforms.py" ]
[ "\"\"\"\nTransforms and data augmentation for sequence level images, bboxes and masks.\n\nMostly copy-paste from https://github.com/Epiphqny/VisTR/blob/master/datasets/transforms.py\n\"\"\"\nimport random\n\nimport PIL\nimport torch\nimport torchvision.transforms as T\nimport torchvision.transforms.functional as F\...
[ [ "numpy.random.uniform", "numpy.zeros", "torch.as_tensor", "torch.nn.functional.pad", "torch.tensor", "numpy.asarray", "torch.all", "numpy.maximum", "numpy.random.randint", "numpy.minimum" ] ]
JannisBush/h2o-3
[ "30aa2a86e6bfa1febb5f95f3cb43811337895f7f" ]
[ "h2o-py/h2o/frame.py" ]
[ "# -*- encoding: utf-8 -*-\n\"\"\"\nH2O data frame.\n\n:copyright: (c) 2016 H2O.ai\n:license: Apache License Version 2.0 (see LICENSE for details)\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nfrom h2o.utils.compatibility import * # NOQA\n\nimport csv\nimport dateti...
[ [ "scipy.sparse.issparse", "scipy.sparse.find", "pandas.DataFrame", "scipy.sparse.csr_matrix", "pandas.concat", "pandas.get_dummies" ] ]
guptakhil12/show-tell
[ "5003898894425e902bed10d4cf57207842ee3bcb" ]
[ "rnn.py" ]
[ "\nfrom cnn import ResNet\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch\nimport torch.nn as nn\n\n\n\nclass RNN(torch.nn.Module):\n\n def __init__(self, embed_dim, num_hidden_units, vocab_size, num_layers):\n '''\n Args:\n embed_dim (int) : Embedding dime...
[ [ "torch.utils.data.DataLoader", "torch.stack", "torch.nn.Linear", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.Embedding", "torch.nn.GRU", "torch.cuda.is_available" ] ]
suneric/face_detection
[ "bf345a29690729eca912d830f3f5d690245de995" ]
[ "face_in_image.py" ]
[ "import face_recognition\nimport cv2\nimport argparse\nimport os\nimport numpy as np\nimport math\n\ndef get_args():\n parser = argparse.ArgumentParser()\n parser.add_argument('--input', type=str, default=\"img\")\n parser.add_argument('--output', type=str, default=None)\n parser.add_argument('--source'...
[ [ "numpy.array", "numpy.isclose" ] ]
ultrainren/robosuite
[ "4a32bde5f8f6247733a2ca439318bedc5a83a941" ]
[ "robosuite/environments/panda.py" ]
[ "from collections import OrderedDict\nimport numpy as np\n\nimport robosuite.utils.transform_utils as T\nfrom robosuite.environments import MujocoEnv\n\nfrom robosuite.models.grippers import gripper_factory\nfrom robosuite.models.robots import Panda\n\nfrom robosuite.controllers.arm_controller import *\nfrom collec...
[ [ "numpy.vstack", "numpy.ones", "numpy.zeros", "numpy.diff", "numpy.abs", "numpy.cos", "numpy.clip", "numpy.array", "numpy.sin", "numpy.concatenate", "numpy.linalg.norm" ] ]
msobrevillac/sockeye
[ "6ed5e2dbe003673d03272987b79f73bdee86283d" ]
[ "sockeye/build_input_embeddings.py" ]
[ "import numpy as np\nimport json\n\nsrc_embed_file = '/home/msobrevillac/Projects/phd/NLG/sockeye/pre-embeddings/embed-in-src.npy'\nsrc_vocab_file = '/home/msobrevillac/Projects/phd/NLG/sockeye/pre-embeddings/vocab-in-src.json'\n\nvocab = {}\nvectors = []\n\nwith open('/home/msobrevillac/Projects/phd/Resources/Embe...
[ [ "numpy.array", "numpy.save" ] ]
Zber5/OpenRadar
[ "701cf166203c3f3e1ba4873cd132a7ccba4f0863" ]
[ "FER/em_network/train_3dCNNfusion_baseline_full_size.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nimport random\nimport time\n\nfrom utils import device, AverageMeter, dir_path, write_log, accuracy, save_checkpoint\nfrom models.c3d import C3DFusionBaselineFull\nfrom dataset import HeatmapDataset\nfrom torch.utils.data import DataLoader\nimport os\nimport...
[ [ "torch.utils.data.DataLoader", "torch.optim.lr_scheduler.StepLR", "torch.cuda.manual_seed", "torch.manual_seed", "torch.no_grad", "numpy.random.seed", "torch.nn.CrossEntropyLoss", "torch.autograd.set_detect_anomaly", "pandas.DataFrame.from_dict" ] ]
nivosco/detection-tools
[ "bfe461b668cdcd9bcfcfccbdad92342d6fb12fd1" ]
[ "detection_tools/core/post_processing.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.image.combined_non_max_suppression", "tensorflow.compat.v1.logging.warning", "tensorflow.compat.v1.expand_dims", "tensorflow.compat.v1.unstack", "tensorflow.compat.v1.reduce_sum", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.compat.forward_compatible", ...
lukeandshuo/sensiac_fast_rcnn_quebec
[ "4b23dad3d0490b3e288bc538dd0f83512f595149" ]
[ "experiments/curves/Recall/6:2/DrawRecall.py" ]
[ "import cPickle\nimport matplotlib.pyplot as plt\nimport os\nimport os.path as op\nbase_path= os.path.split(os.path.abspath(__file__))[0]\nxlabel=[0.5,0.6,0.7,0.8,0.9]\nIR=[0.469,0.231,0.050,0.001,0.00]\nVisible =[0.919,0.692,0.371,0.108,0.005]\nplt.plot(xlabel,Visible,'r',label='Visible =0.3731')\nplt.plot(xlabel,...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel" ] ]
Mishne-Lab/SOAP-Self-supervised-Online-Adversarial-Purification
[ "09535124ef13e3f957d25b3a4e54af7f5f713a73" ]
[ "models.py" ]
[ "import torch\nimport torch.nn as nn\nimport torchvision.models as models\nimport torchvision.transforms as transforms\n\nfrom resnet import *\nfrom wide_resnet import *\n\nimport os\n\ndef load_model(name, dataset, n_class=10, in_channel=3, save_dir=None, substitute=False):\n if name == 'fcnet':\n model ...
[ [ "torch.nn.MaxPool2d", "torch.FloatTensor", "torch.nn.Linear", "torch.randn_like", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.nn.Dropout", "torch.nn.ConvTranspose2d" ] ]
SoliareofAstora/DeepFRI
[ "a7de5c4e3036109b5a5711ca97715d0ec340cd8d" ]
[ "deepfrier/DeepCNN.py" ]
[ "import glob\nimport tensorflow as tf\n\nfrom .utils import get_batched_dataset\nfrom .layers import FuncPredictor\n\nimport matplotlib.pyplot as plt\nplt.switch_backend('agg')\n\n\nclass DeepCNN(object):\n \"\"\" Class containig the CNN model for predicting protein function. \"\"\"\n def __init__(self, outpu...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Concatenate", "tensorflow.keras.callbacks.EarlyStopping", "matplotlib.pyplot.ylabel", "tensorflow.keras.layers.GlobalMaxPooling1D", "tensorflow.keras.layers.Add", "matplotlib.pyplot.plot...
arnabgho/infoGAN-pytorch
[ "60f31010768f3e07010ac60845411a4a41fa1bba" ]
[ "common_net.py" ]
[ "import torch\nimport torch.nn as nn\n\ndef gaussian_weights_init(m):\n classname = m.__class__.__name__\n if classname.find('Conv') != -1:\n m.weight.data.normal_(0.0, 0.02)\n elif classname.find('BatchNorm') != -1:\n m.weight.data.normal_(1.0, 0.02)\n m.bias.data.fill_(0)\n\n\nclass ...
[ [ "torch.nn.BatchNorm2d", "torch.nn.InstanceNorm1d", "torch.nn.Linear", "torch.nn.BatchNorm1d", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.max", "torch.nn.ReLU", "torch.nn.Dropout" ] ]
isl-mt/xnmt-isl
[ "0f25c8f7f90cd5fa39de03302219a66d640a44f0" ]
[ "xnmt/xnmt_run_experiments.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\"\nReads experiments descriptions in the passed configuration file\nand runs them sequentially, logging outputs\n\"\"\"\nimport argparse\nimport logging\nimport os\nimport random\nimport sys\nimport socket\nimport datetime\nimport faulthandler\nfaulthandler.enable()\nimport traceback...
[ [ "numpy.random.seed" ] ]
rhayes777/PyAutoFit
[ "ac0a424cf97103106b292e124911de43635fc15a" ]
[ "autofit/non_linear/samples/mcmc.py" ]
[ "import math\nfrom typing import List, Optional\n\nimport numpy as np\n\nfrom autofit.mapper.model_mapper import ModelMapper\nfrom autofit.non_linear.mcmc.auto_correlations import AutoCorrelationsSettings\nfrom autofit.non_linear.samples.pdf import PDFSamples\nfrom .samples import Samples\nfrom .sample import Sampl...
[ [ "numpy.percentile", "numpy.max", "numpy.min" ] ]
tgen/bisbee
[ "d12ded4e4ee497e18a8b8e4929dac0e08de9f7f6" ]
[ "prot/utils.py" ]
[ "\nimport pyensembl\nimport Bio.SeqIO\nimport Bio.Seq\nimport pandas as pd\nimport sys\nimport re\nfrom Bio import pairwise2\n\n\ndef get_transcript_adj_exons(ensembl,gene_id,exon_coord):\n try:\n transcript_ids=ensembl.transcript_ids_of_gene_id(gene_id)\n except:\n print('Warning: ' + gene_id + ' not found')\n ...
[ [ "pandas.DataFrame" ] ]
CEMES-CNRS/pymodaq_plugins_physical_measurements
[ "1259e239a0a80e0a6937060d47c7c30eb6cb6b4d" ]
[ "src/pymodaq_plugins_physical_measurements/daq_viewer_plugins/plugins_0D/daq_0Dviewer_Keithley_Pico.py" ]
[ "from PyQt5.QtCore import pyqtSignal\nfrom easydict import EasyDict as edict\nfrom pymodaq.daq_utils.daq_utils import ThreadCommand, getLineInfo, DataFromPlugins\nfrom pymodaq.daq_viewer.utility_classes import DAQ_Viewer_base\nfrom collections import OrderedDict\nimport numpy as np\nfrom enum import IntEnum\nfrom p...
[ [ "numpy.array" ] ]
mangye16/deep-person-reid
[ "42eaccea712c3ebcc5273085a3cfea400a4783b8" ]
[ "torchreid/models/pcb.py" ]
[ "from __future__ import division, absolute_import\nimport torch.utils.model_zoo as model_zoo\nfrom torch import nn\nfrom torch.nn import functional as F\n\n__all__ = ['pcb_p6', 'pcb_p4']\n\nmodel_urls = {\n 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',\n 'resnet34': 'https://downloa...
[ [ "torch.nn.BatchNorm2d", "torch.nn.MaxPool2d", "torch.nn.init.kaiming_normal_", "torch.nn.Linear", "torch.nn.init.constant_", "torch.nn.AdaptiveAvgPool2d", "torch.nn.functional.normalize", "torch.nn.init.normal_", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.utils.mo...
tianweiy/openseg.pytorch
[ "e4159e0b2db86d22149c44f220c5f2e3070a3042" ]
[ "lib/datasets/data_loader.py" ]
[ "##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: Donny You, RainbowSecret, JingyiXie\n## Microsoft Research\n## yuyua@microsoft.com\n## Copyright (c) 2019\n##\n## This source code is licensed under the MIT-style license found in the\n## LICENSE file in the root directory ...
[ [ "torch.utils.data.distributed.DistributedSampler" ] ]
JJHibbard/ares
[ "4b185747f2182524d732ef8316bff3a709bd85f2" ]
[ "ares/sources/Source.py" ]
[ "\"\"\"\n\nSource.py\n\nAuthor: Jordan Mirocha\nAffiliation: University of Colorado at Boulder\nCreated on: Sun Jul 22 16:28:08 2012\n\nDescription: Initialize a radiation source.\n\n\"\"\"\nfrom __future__ import print_function\nimport re, os\nimport numpy as np\nfrom scipy.integrate import quad\nfrom ..util impor...
[ [ "numpy.zeros_like", "numpy.sum", "scipy.integrate.quad", "numpy.zeros", "numpy.diff", "numpy.seterr", "numpy.arange", "numpy.max", "numpy.log10", "numpy.min" ] ]
xxxxHolic/scikit-beam
[ "d1b4e746ff3daba8d0e8d5163259462fc9298b9a" ]
[ "skbeam/core/accumulators/binned_statistic.py" ]
[ "\"\"\"\nCopyright 2001, 2002 Enthought, Inc.\nAll rights reserved.\n\nCopyright 2003-2013 SciPy Developers.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n- Redistributions of source code m...
[ [ "numpy.sqrt", "numpy.bincount", "numpy.empty", "numpy.zeros", "numpy.diff", "numpy.atleast_2d", "numpy.fabs", "numpy.asarray", "numpy.copy", "numpy.arange", "numpy.seterr", "numpy.sort", "numpy.around", "numpy.isscalar", "numpy.linspace", "numpy.digi...
Wliubei/Multiple-Resolutionse
[ "3d8a9a725a00e5f9a2ac3b2b9659bc22b3876f75" ]
[ "torch_stft/stft.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn.functional as F\nfrom scipy.signal import get_window\nfrom librosa.util import pad_center, tiny\nfrom .util import window_sumsquare\nimport librosa\nclass STFT(torch.nn.Module):\n def __init__(self, filter_length=1724, hop_length=130, win_length=None,\n ...
[ [ "numpy.eye", "torch.FloatTensor", "scipy.signal.get_window", "torch.nn.functional.conv1d", "torch.sqrt", "numpy.imag", "torch.from_numpy", "numpy.linalg.pinv", "numpy.real", "torch.atan2" ] ]
fzalkow/music_indexing
[ "b7a0405f229f81d759e3fbe5a870da3532874afc" ]
[ "common/__init__.py" ]
[ "'''\nFile name: common/__init__.py\nAuthor: Frank Zalkow\nDate: 2020\nLicense: MIT\nThis file is part of the following repository:\n https://github.com/fzalkow/music_indexing\n'''\n\nimport numpy as np\nimport librosa\n\nCHROMA_DIMS = 12\n\n\ndef compute_features(fn_audio):\n Fs = 22050\n H = 2205\n smoo...
[ [ "numpy.empty" ] ]
seinecke/aict-tools
[ "87601eba47d77385ac35145fd0b85d7aa7d66c71" ]
[ "aict_tools/scripts/plot_direction_performance.py" ]
[ "import click\nimport logging\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\nimport numpy as np\nfrom sklearn.externals import joblib\nfrom ..configuration import AICTConfig\nimport fact.io\n\nfrom ..plotting import (\n plot_roc,\n plot_probabilities,\n plot_regress...
[ [ "numpy.nanmax", "matplotlib.pyplot.figure", "matplotlib.backends.backend_pdf.PdfPages", "sklearn.externals.joblib.load", "numpy.nanmin", "matplotlib.pyplot.show", "numpy.log10" ] ]
MoonBlvd/TFSegmentation
[ "baa874237289227c99163fe119448579904a231f" ]
[ "models/encoders/resnet_18.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nfrom layers.utils import variable_summaries, variable_with_weight_decay\nfrom utils.misc import timeit\nfrom utils.misc import _debug\n# import torchfile\nimport pickle\nimport pdb\n\nclass RESNET18:\n \"\"\"\n RESNET 18 Encoder class\n \"\"\"\n\n def __in...
[ [ "tensorflow.variable_scope", "tensorflow.matmul", "tensorflow.name_scope", "tensorflow.identity", "tensorflow.nn.max_pool", "tensorflow.nn.atrous_conv2d", "tensorflow.ones_initializer", "tensorflow.cond", "tensorflow.constant", "tensorflow.add_to_collection", "numpy.loa...
daniel03c1/audio_augment
[ "ee73bb0844e22c57c9cbeb129560da4a3853f77d" ]
[ "transforms_test.py" ]
[ "import PIL.Image\r\nimport PIL.ImageEnhance\r\nimport PIL.ImageOps\r\nimport numpy as np\r\nimport os\r\nimport random\r\nimport torch\r\nimport unittest\r\nfrom transforms import *\r\n\r\n\r\nclass TransformsTest(unittest.TestCase):\r\n def setUp(self):\r\n self.pil_img = PIL.Image.open('test_img.jpeg')...
[ [ "numpy.array", "torch.Tensor" ] ]
MFadhilArkan/gym-pybullet-drones
[ "cc2e14da194682b2a5fb2f1a6ca7d047bf2dafae" ]
[ "gym_pybullet_drones/control/DSLPIDControl.py" ]
[ "import math\nimport numpy as np\nimport pybullet as p\nfrom scipy.spatial.transform import Rotation\n\nfrom gym_pybullet_drones.control.BaseControl import BaseControl\nfrom gym_pybullet_drones.envs.BaseAviary import DroneModel, BaseAviary\n\nclass DSLPIDControl(BaseControl):\n \"\"\"PID control class for Crazyf...
[ [ "numpy.vstack", "numpy.multiply", "numpy.zeros", "scipy.spatial.transform.Rotation.from_quat", "numpy.cross", "numpy.repeat", "numpy.abs", "scipy.spatial.transform.Rotation.from_euler", "numpy.clip", "scipy.spatial.transform.Rotation.from_matrix", "numpy.flip", "num...
mariana1412/FEUP-PRI
[ "9c72e8f41d073230cf91d27cfb3e55adb9718ed2" ]
[ "review_scrape/review_scrape.py" ]
[ "import pandas as pd\nimport requests\nimport re\nfrom bs4 import BeautifulSoup\nfrom timeit import default_timer\nimport asyncio\nfrom concurrent.futures import ThreadPoolExecutor\nfrom threading import Thread\nfrom queue import Empty, Queue\nimport signal\nimport sys\n\nSTART_TIME = default_timer()\nCLEANR = re.c...
[ [ "pandas.read_csv" ] ]
cindyxinyiwang/MoEM
[ "1d37f96cec1a97856224793f15a90170b8266a1b" ]
[ "model_v2.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nfrom embed_regularize import embedded_dropout\nfrom locked_dropout import LockedDropout\nfrom weight_drop import WeightDrop\n\nclass RNNModel_v2(nn.Module):\n \"\"\"Container module with an ...
[ [ "torch.nn.LSTM", "torch.nn.Linear", "torch.nn.functional.softmax", "torch.nn.Embedding", "torch.nn.ModuleList", "torch.LongTensor" ] ]
hilltailor/22037-Camera-1
[ "4a236bcb236071b3cc051dcce0756d3d9804ec0f" ]
[ "examples/capture_savehdf5_display.py" ]
[ "##########################################################################\n# Testing of display and capture & storage thread combined.\n# Scan for camera\n# Aquire 14 images\n# Convert to b/w\n# Save hdf5 files\n##########################################################################\n# Results\n#\n#\n#########...
[ [ "numpy.sum", "numpy.zeros", "numpy.subtract", "numpy.argmin", "numpy.random.random" ] ]
akirayou/cmdstanpy
[ "f6a526807ea4d248844ac2f1a44e4c53bfca197c" ]
[ "test/test_generate_quantities.py" ]
[ "\"\"\"CmdStan method generate_quantities tests\"\"\"\n\nimport os\nimport unittest\nfrom pandas.testing import assert_frame_equal\n\nfrom cmdstanpy.cmdstan_args import Method\nfrom cmdstanpy.model import CmdStanModel\n\nHERE = os.path.dirname(os.path.abspath(__file__))\nDATAFILES_PATH = os.path.join(HERE, 'data')\...
[ [ "pandas.testing.assert_frame_equal" ] ]
jmlazaro25/vissig
[ "370262b0546959bd2936cfd1ffa16de5b85a3dee" ]
[ "dev/mathematica/get_ldmx_acceptance_to_share/detector_hit_conditions.py" ]
[ "import numpy as np\nimport collections\n\ndef _xv_from_uni(xi,zmax,gct):\n \"\"\"\n Generate a z vertex displacement from a uniform random variable \n both zmax and gct should be in cm\n \"\"\"\n if xi > 0.:\n return gct*np.log(xi) + zmax\n else:\n return -100.*zmax\n \nxv_from_u...
[ [ "numpy.array", "numpy.log", "numpy.vectorize" ] ]
Jazys/docker-airflow
[ "347619d857f5d19a6955c51a23f381e2406f7d22" ]
[ "dags/treino04.py" ]
[ "from airflow import DAG\nfrom airflow.operators.bash_operator import BashOperator\nfrom airflow.operators.python_operator import PythonOperator, BranchPythonOperator\nfrom datetime import datetime, timedelta\nimport zipfile\nimport random\nimport pandas as pd\n\ndefault_args = {\n 'owner': 'Neylson Crepalde',\n...
[ [ "pandas.read_csv" ] ]
NAnnamalai/gramex
[ "6a0845aed2f7423da09eaa84678d3a0519fe1ff1" ]
[ "gramex/handlers/modelhandler.py" ]
[ "import os\nimport json\nimport gramex.ml\nimport pandas as pd\nimport gramex.cache\nimport gramex.data\nfrom gramex.handlers import BaseHandler\nimport tornado.escape\n\n\nclass ModelHandler(BaseHandler):\n '''\n Allows users to create API endpoints to train/test models exposed through Scikit-Learn.\n TOD...
[ [ "pandas.DataFrame" ] ]
infomon/meta_nas
[ "b81b7de86d26ae1ec0d6646b4277f3c918e5e35d" ]
[ "starter_kit/dev_meta_features/competition/data_io.py" ]
[ "# Functions performing various input/output operations for the ChaLearn AutoML challenge\n\n# Main contributors: Arthur Pesah and Isabelle Guyon, August-October 2014\n\n# ALL INFORMATION, SOFTWARE, DOCUMENTATION, AND DATA ARE PROVIDED \"AS-IS\".\n# ISABELLE GUYON, CHALEARN, AND/OR OTHER ORGANIZERS OR CODE AUTHORS ...
[ [ "pandas.read_csv", "numpy.ravel", "numpy.arange", "numpy.array", "numpy.random.randint" ] ]
dumpmemory/nlpatl
[ "59209242d1ac26714b11b86261070ac50cc90432" ]
[ "tests/sampling/certainty/test_most_confidence.py" ]
[ "import unittest\r\nimport numpy as np\r\n\r\nfrom nlpatl.sampling.certainty import MostConfidenceSampling\r\n\r\n\r\nclass TestSamplingConfidence(unittest.TestCase):\r\n @classmethod\r\n def setUpClass(cls):\r\n cls.data = np.array(\r\n [\r\n [0.01689184, 0.02989921, 0.923489...
[ [ "numpy.array", "numpy.where" ] ]
haider4445/MultipleAdvAttacks
[ "a5e420a39b6d0eaf38b300ae5d74d4732e5eb6ec" ]
[ "a2c_ppo_acktr/envs.py" ]
[ "import os\nimport sys\nimport gym\nimport numpy as np\nimport torch\nfrom gym.spaces.box import Box\n\nfrom baselines import bench\nfrom baselines.common.atari_wrappers import make_atari, wrap_deepmind\nfrom baselines.common.vec_env import VecEnvWrapper\nfrom baselines.common.vec_env.dummy_vec_env import DummyVecE...
[ [ "numpy.sqrt", "numpy.repeat", "torch.from_numpy", "torch.zeros", "torch.device" ] ]
AutumnSun1996/GameTools
[ "05ed69c09e69e284092cfaffd9eb6313f654c729" ]
[ "Autodroid/label_al.py" ]
[ "import sys\nimport copy\nfrom enum import IntEnum, auto\nimport tkinter as tk\nfrom tkinter import simpledialog, Label\nimport itertools\n\nimport cv2.cv2 as cv\nimport numpy as np\nfrom PIL import Image, ImageTk\nfrom shapely import geometry\n\nfrom simulator import image_tools, win32_tools\nfrom notebook.azurlan...
[ [ "numpy.bincount", "numpy.subtract", "numpy.any", "numpy.asarray", "numpy.array", "numpy.mat" ] ]
vks/mordecai
[ "87c1aee4864975cc672323d043e5fbf9d6f554f7" ]
[ "mordecai/utilities.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nimport os\nimport sys\nimport json\nimport numpy\nimport pandas as pd\nfrom elasticsearch_dsl import Search, Q\nfrom elasticsearch import Elasticsearch\n\nimport spacy\n\ntry:\n nlp\nexcept NameError:\n n...
[ [ "pandas.read_csv" ] ]
yz-mao/jbdl
[ "a5380233b3795c8aaa9acd9e5c07fa44f8a5dadb" ]
[ "src/jbdl/experimental/contact/solve_contact_simple_lcp.py" ]
[ "import numpy as np\nfrom jbdl.experimental.contact import calc_contact_jacobian_core\nfrom jbdl.experimental.contact.calc_contact_jacobian import calc_contact_jacobian_core_jit_flag\nfrom jbdl.experimental.contact.calc_contact_jdot_qdot import calc_contact_jdot_qdot_core\nfrom jbdl.experimental.contact.calc_contac...
[ [ "numpy.zeros" ] ]
allnes/open_model_zoo
[ "693ba31b3b7671f5fb8ecf8f9b8d670cfec21bc3" ]
[ "tools/accuracy_checker/accuracy_checker/adapters/attributes_recognition.py" ]
[ "\"\"\"\nCopyright (c) 2019 Intel Corporation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or ag...
[ [ "numpy.zeros" ] ]
SubhamSingh285/greyatom-python-for-data-science
[ "16a70eaa2732f1cd30bcc013847150b8caf33f02" ]
[ "Loan-Approval-Analysis/code.py" ]
[ "# --------------\n# Import packages\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import mode \n\n\n\n# code starts here\n#Load Dataset\n\nbank = pd.read_csv(path)\n \n# Display categorical variable\n\n\ncategorical_var=bank.select_dtypes(include='object')\n\n\n#print(\"Categorical variables : \",c...
[ [ "pandas.read_csv" ] ]
gxxu-ml/Natural-Disaster-Image-Generation-to-raise-Environmental-Awareness
[ "930e30fb2b3eca0fa3aeeeb05462538669405d54" ]
[ "dalle-mini-custom/tools/inference/inference.py" ]
[ "import jax\nimport jax.numpy as jnp\nimport os\n# Load models & tokenizer\nfrom dalle_mini.model import DalleBart, DalleBartTokenizer\nfrom vqgan_jax.modeling_flax_vqgan import VQModel\nfrom transformers import CLIPProcessor, FlaxCLIPModel\nimport wandb\nfrom transformers import CLIPProcessor, CLIPModel\nfrom dall...
[ [ "pandas.read_csv", "torch.no_grad", "numpy.asarray", "numpy.max", "numpy.mean" ] ]
nmasse/Meta-Networks
[ "1ac4c233e71221ee6ce9acd96220b313f3560160" ]
[ "motifs.py" ]
[ "import numpy as np\nfrom itertools import product\nfrom itertools import permutations\nimport matplotlib.pyplot as plt\nimport pickle\nimport os\nimport stimulus\nimport parameters\nimport analysis\n\n\nclass Motifs:\n\n def __init__(self, data_dir, file_prefix, N = None):\n\n self.motifs = {}\n s...
[ [ "numpy.vstack", "numpy.sum", "numpy.tile", "numpy.sort", "numpy.zeros", "numpy.squeeze", "numpy.setdiff1d", "numpy.reshape", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.colorbar", "numpy.where", "numpy.unique" ] ...
D-Sokol/lazy-pattern-classifier
[ "a0cc5e7a5db8177b6e12cc9a0f0e4acf61233603" ]
[ "datasets/__init__.py" ]
[ "from functools import wraps\nimport os\nimport pandas as pd\n\n\ndef _read_csv(name, **kw):\n path = os.path.join(os.path.dirname(__file__), 'data', name)\n return pd.read_csv(path, **kw)\n\n\ndef apply_one_hot(fun):\n @wraps(fun)\n def wrapper(*args, **kw):\n X, y = fun(*args, **kw)\n X ...
[ [ "pandas.read_csv", "pandas.get_dummies" ] ]
hienerd/molecool
[ "35817f23c0f2a64cbaffa7c8ed3b421bf4774130" ]
[ "molecool/measure.py" ]
[ "import numpy as np\n\ndef calculate_distance(rA, rB):\n \"\"\"\n This function calculates the distance between two points.\n\n Parameters\n ----------\n rA, rB : np.ndarray\n The coordinates of each point.\n\n Returns\n -------\n distance : float\n The distance between two poi...
[ [ "numpy.degrees", "numpy.dot", "numpy.linalg.norm" ] ]
agkphysics/emotion
[ "36bb9265f9439b10676fb539d5334cce645e49ef" ]
[ "src/ertk/sklearn/utils.py" ]
[ "import warnings\n\nimport numpy as np\nfrom joblib import Parallel, delayed\nfrom sklearn.base import MetaEstimatorMixin, clone\nfrom sklearn.multiclass import OneVsRestClassifier as _SKOvR\nfrom sklearn.multiclass import _ConstantPredictor\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.preprocessing import ...
[ [ "sklearn.multiclass._ConstantPredictor", "sklearn.preprocessing.LabelBinarizer", "sklearn.base.clone", "numpy.unique" ] ]
shizukanaskytree/tfx
[ "6490e102850e91489722a49b20efef9ef64ef2d2" ]
[ "tfx/orchestration/kubeflow/kubeflow_gcp_integration_test.py" ]
[ "# Lint as: python2, python3\n# Copyright 2019 Google LLC. 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\...
[ [ "tensorflow.test.main" ] ]
Trustworthy-Software/BATS
[ "eb122150dff61543bd8c88ac7e08987a0a3e47e0" ]
[ "experiment/evaluate.py" ]
[ "import pickle\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport Levenshtein\nimport math\nimport pandas as pd\nfrom sklearn.metrics import silhouette_score ,calinski_harabasz_score,davies_bouldin_score\nfrom scipy.spatial import distance\nfrom sklearn.preprocessing import StandardScaler, Normalizer, M...
[ [ "matplotlib.pyplot.cla", "matplotlib.pyplot.tight_layout", "sklearn.metrics.precision_score", "matplotlib.pyplot.ylabel", "sklearn.preprocessing.Normalizer", "matplotlib.pyplot.xticks", "sklearn.metrics.roc_curve", "matplotlib.pyplot.savefig", "sklearn.metrics.auc", "matplo...
monk1337/tensorflow
[ "885577afd802204096cde524ed2a3acd9e29a75c" ]
[ "tensorflow/python/tools/saved_model_cli.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.debug.wrappers.local_cli_wrapper.LocalCLIDebugWrapperSession", "tensorflow.python.saved_model.load.load", "tensorflow.python.compiler.tensorrt.trt_convert.DEFAULT_TRT_CONVERSION_PARAMS._replace", "numpy.save", "tensorflow.python.lib.io.file_io.FileIO", "tensorflow.python...
miraaitsaada/cclust_package
[ "4256693b424350ba3332861c7e937100f7a432c5" ]
[ "coclust/coclustering/coclust_mod.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\nThe :mod:`coclust.coclustering.coclust_mod` module provides an implementation\nof a co-clustering algorithm by direct maximization of graph modularity.\n\"\"\"\n\n# Author: Francois Role <francois.role@gmail.com>\n# Stanislas Morbieu <stanislas.morbieu@gmail.com>\n\n# Lic...
[ [ "sklearn.utils.check_random_state", "numpy.zeros", "numpy.matrix", "sklearn.utils.check_array", "numpy.abs", "numpy.argmax", "numpy.trace", "numpy.iinfo", "numpy.isnan" ] ]
FHsong/reinforcement-learning-an-introduction
[ "4eb5b36a5d59487ae1c3ea6cc90010c11bda5897" ]
[ "chapter08/maze.py" ]
[ "#######################################################################\n# Copyright (C) #\n# 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# 2016 Kenta Shimada(hyperkentakun@gmail.com) #\n# Permission given to m...
[ [ "numpy.random.binomial", "numpy.sqrt", "numpy.sum", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.pyplot.yscale", "numpy.random.choice", "numpy.argmax", "numpy.arange", "numpy.max", "matplotlib.pyplot.ylabel", "matplotlib.py...
BitJetKit/turicreate
[ "4fc93fb8873b90a1a57da499db4ca710e78f1478" ]
[ "src/unity/python/turicreate/test/test_sframe.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright © 2017 Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can\n# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\nfrom __future__ import print_function as _\nfrom __future__ import divisio...
[ [ "numpy.sum", "numpy.var", "pandas.DataFrame", "numpy.array", "numpy.std", "pandas.util.testing.assert_frame_equal", "numpy.unique", "numpy.mean" ] ]
Mofokeng-C/rgz_rcnn_py3
[ "00bb9a9179b74db5e3fe469f4249dc00c5c0edfc" ]
[ "lib/fast_rcnn/test.py" ]
[ "# Modified by Chen Wu (chen.wu@icrar.org)\n\nfrom fast_rcnn.config import cfg, get_output_dir\nimport argparse\nfrom utils.timer import Timer\nimport numpy as np\nimport cv2\nfrom utils.cython_nms import nms, nms_new\nfrom utils.boxes_grid import get_boxes_grid\nfrom utils.project_bbox import project_bbox_inv\nimp...
[ [ "matplotlib.pyplot.cla", "tensorflow.python.client.timeline.Timeline", "tensorflow.variable_scope", "matplotlib.pyplot.imshow", "matplotlib.pyplot.gca", "numpy.reshape", "numpy.abs", "numpy.where", "matplotlib.pyplot.Rectangle", "numpy.round", "numpy.unique", "numpy...
AlexWang000/AlacGAN
[ "3b9df7c25c3e95b7727b00fa789cab0cf7d46266" ]
[ "train.py" ]
[ "import argparse\nimport os\nimport random\nimport yaml\nimport time\nimport logging\nimport pprint\n\nimport scipy.stats as stats\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torchvision.utils as vutils\nimport numpy as np\nfrom torch.utils.tensorboard import SummaryWriter\nfrom torch...
[ [ "torch.utils.tensorboard.SummaryWriter", "numpy.var", "scipy.stats.truncnorm" ] ]
IanHawke/toy-evolve
[ "a1490327dd19492e2c0bb0d9c6909abe8b167135" ]
[ "toy-evolve/burgers_stiff_source_imex222.py" ]
[ "# Burgers test evolution: just one\n\nimport numpy\nfrom models import burgers\nfrom bcs import outflow\nfrom simulation import simulation\nfrom methods import weno3_upwind\nfrom rk import rk3, imex222\nfrom grid import grid\nfrom matplotlib import pyplot\n\nNgz = 3\nNpoints = 200\ntau = 0.05\nbeta = 0.8\nL = 1\ni...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.exp", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "numpy.linspace", "matplotlib.pyplot.xlabel" ] ]
Dongpaca/test
[ "b965a1e752436b250b2108d5df4651516b15698a" ]
[ "enhancer.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nimport torch.optim\nimport torch.utils.data as data\nimport torchvision\nimport numpy as np\nimport cv2\nimport random\nimport net\nimport numpy\nfrom torchvision import transforms\nfrom utils import *\nimport matplotlib.image as img\n\n\n\...
[ [ "numpy.sqrt", "torch.nn.init.xavier_uniform", "numpy.squeeze", "torch.nn.L1Loss", "numpy.fliplr", "numpy.median", "numpy.rot90", "torch.from_numpy", "numpy.array", "numpy.polyfit", "numpy.square", "matplotlib.image.imread" ] ]
Jakoviz/Infected-sweetpotato-classification
[ "003befcc5c430f41f8426d9ac94894e20fdfc247" ]
[ "models/F1_score.py" ]
[ "\"\"\"\nFrom https://stackoverflow.com/questions/62265351/measuring-f1-score-for-multiclass-classification-natively-in-pytorch\nwith this modification https://stackoverflow.com/questions/62265351/measuring-f1-score-for-multiclass-classification-natively-in-pytorch#comment122867942_63358412\n\"\"\"\n\nfrom typing i...
[ [ "torch.isnan", "torch.zeros_like", "torch.eq", "torch.div" ] ]
check-spelling/poppy
[ "2640d89d3a326fc6ecf03dcd24c878279b7807e5" ]
[ "poppy/instrument.py" ]
[ "import getpass\nimport os\nimport platform\nimport re\nimport time\nimport astropy.io.fits as fits\nimport astropy.units as units\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.interpolate\nimport scipy.ndimage\n\ntry:\n import synphot\n _HAS_SYNPHOT = True\nexcept ImportError:\n synph...
[ [ "numpy.arctan2", "numpy.zeros", "matplotlib.pyplot.gcf", "numpy.asarray", "numpy.remainder", "numpy.max", "matplotlib.pyplot.text", "matplotlib.pyplot.suptitle", "numpy.min", "numpy.sqrt", "numpy.linspace", "numpy.isscalar", "numpy.round" ] ]
arpith-kp/superset
[ "42ff4fc19a34144b31cef82b341871dff34f37d2" ]
[ "superset/examples/multiformat_time_series.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...
[ [ "pandas.to_datetime", "pandas.read_json" ] ]
Chengwei94/clinica
[ "0e9d837baf9064a626198422b2a70fe120f227f0" ]
[ "clinica/iotools/converters/adni_to_bids/adni_modalities/adni_pib_pet.py" ]
[ "# coding: utf-8\n\n\"\"\"Module for converting PIB PET of ADNI.\"\"\"\n\n\ndef convert_adni_pib_pet(\n source_dir, csv_dir, dest_dir, conversion_dir, subjs_list=None, mod_to_update=False\n):\n \"\"\"Convert PIB PET images of ADNI into BIDS format.\n\n Args:\n source_dir: path to the ADNI directory\...
[ [ "pandas.read_csv", "pandas.DataFrame", "pandas.concat" ] ]
dandavison/tensorflow-models
[ "64eea4f573094068bd99900016c603080a59e788" ]
[ "research/audioset/vggish/vggish_train_demo.py" ]
[ "# Copyright 2017 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi...
[ [ "numpy.random.uniform", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.summary.scalar", "tensorflow.compat.v1.Variable", "numpy.concatenate", "tensorflow.compat.v1.Graph", "tensorflow.compat.v1.reduce_mean", "tensorflow.compat.v1.train...
airmler/ctf
[ "88c101348b00a87def0393f962d3f87b1007110a" ]
[ "test/python/test_partition.py" ]
[ "#!/usr/bin/env python\n\nimport unittest\nimport numpy\nimport ctf\nimport os\nimport sys\n\n\ndef allclose(a, b):\n return abs(ctf.to_nparray(a) - ctf.to_nparray(b)).sum() < 1e-14\n\nclass KnowValues(unittest.TestCase):\n def test_partition(self):\n AA = ctf.tensor((4,4),sym=[ctf.SYM.SY,ctf.SYM.NS])\...
[ [ "numpy.random.seed" ] ]
HninPwint/nba-career-prediction
[ "ffce32507cad2c4dd020c62cee7f33cf97c886f7" ]
[ "src/features/build_features.py" ]
[ "import pandas as pd\nimport numpy as np\n\ndef replace_outliers(data, columns):\n '''\n Quantile-based Flooring and Capping\n '''\n df = data.copy()\n for column in columns:\n \n \n ten_percentile = (df[column].quantile(0.10))\n ninety_percentile = (df[column].quantil...
[ [ "numpy.where" ] ]
Fyy10/ML-DL_Practice
[ "7b7c8a63d52fbf2c9192d913255852bbbe3de276" ]
[ "Basics/Regression.py" ]
[ "import torch\nimport torch.nn.functional as F\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch.nn as nn\nimport torch.optim as optim\n\n\nx = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1)\ny = x.pow(2) + 0.2 * torch.rand(x.size())\n\n# plt.scatter(x.numpy(), y.numpy())\n# plt.show()\n\n\ncla...
[ [ "matplotlib.pyplot.pause", "torch.nn.Linear", "torch.nn.MSELoss", "matplotlib.pyplot.cla", "matplotlib.pyplot.ioff", "torch.linspace", "matplotlib.pyplot.show", "matplotlib.pyplot.text", "matplotlib.pyplot.ion" ] ]
vrautela/hail
[ "7db6189b5b1feafa88452b8470e497d9505d9a46" ]
[ "hail/python/test/hail/expr/test_ndarrays.py" ]
[ "import numpy as np\nfrom ..helpers import *\nimport pytest\n\nfrom hail.utils.java import FatalError, HailUserError\n\nsetUpModule = startTestHailContext\ntearDownModule = stopTestHailContext\n\ndef assert_ndarrays(asserter, exprs_and_expecteds):\n exprs, expecteds = zip(*exprs_and_expecteds)\n\n expr_tuple ...
[ [ "numpy.ones", "numpy.diag", "numpy.vstack", "numpy.allclose", "numpy.asfortranarray", "numpy.linalg.matrix_rank", "numpy.isnan", "numpy.identity", "numpy.minimum", "numpy.eye", "numpy.zeros", "numpy.arange", "numpy.hstack", "numpy.testing.assert_array_almost...
marianna13/heatpy
[ "a1010c87c592c81e61126f69842d010922c603fe" ]
[ "heatpy.py" ]
[ "import numpy as np\ndef plot(b,d,C,t,x1,y1,x2,y2,fn, show_solution=False):\n '''\n This function finds solutions.\n b,d : boundary conditions,\n C : thermal diffusivity\n t : time\n x2-x1 : size of a square in X direction,\n y2-y1 : size of the square in Y direction,\n fn : initial condition\...
[ [ "numpy.exp", "numpy.sqrt", "numpy.sin", "numpy.meshgrid", "numpy.linspace" ] ]
1kc2/Long-Short-Stress-Test
[ "1dd8cdb5f4949fd140c7c494f8315e0e24d001b9" ]
[ "src/attribution.py" ]
[ "from db_utils import read_select, get_temptable,\\\n insert_temp_ret_table, drop_temp_table\nfrom weights import get_portfolio_weights, get_single_ticker_weight\nfrom pandas import DataFrame\nimport pandas as pd\n\ndef load_constituent_prices(ticker, db):\n q = \"\"\"\n SELECT *\n ...
[ [ "pandas.DataFrame", "pandas.DatetimeIndex" ] ]
qeedquan/misc_utilities
[ "94c6363388662ac8ebbf075b9c853ce6defbb5b3" ]
[ "snippets/python/matplotlib/logistic.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef logistic(r=2.0, N=100):\n xs = 0.5*np.ones(N)\n for i in np.arange(N-1):\n xs[i+1] = r*xs[i]*(1.0-xs[i])\n return xs\n\nfig, axes = plt.subplots(2, 2)\naxes[0, 0].plot(logistic(2.7), 'bo')\naxes[1, 0].plot(logistic...
[ [ "numpy.arange", "numpy.ones", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
plin1112/ANI-Tools
[ "76280c918fc79fee8c266b8bc9ab57f86104ec99" ]
[ "activelearning/datareduction/diff_visualizer.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\ndfile = '/home/jujuman/Research/SingleNetworkTest/train_05/diffs.dat'\n\nf = open(dfile, 'r')\nfor l in f:\n diffs = np.array(l.split(','),dtype=np.float)\n plt.scatter(np.arange(diffs.size), diffs, color='black', label='DIFF', linewidth=1)\n plt.show...
[ [ "numpy.arange", "matplotlib.pyplot.show" ] ]
gvvynplaine/numpy
[ "0bd548e287b9e2fd0126f64d8be01a812e3c6a48" ]
[ "numpy/core/tests/test_regression.py" ]
[ "import copy\nimport sys\nimport gc\nimport tempfile\nimport pytest\nfrom os import path\nfrom io import BytesIO\nfrom itertools import chain\n\nimport numpy as np\nfrom numpy.testing import (\n assert_, assert_equal, IS_PYPY, assert_almost_equal,\n assert_array_equal, assert_array_almost_equal, asser...
[ [ "numpy.ones", "numpy.testing.assert_equal", "numpy.any", "numpy.asarray", "numpy.compat.pickle.loads", "numpy.testing.assert_warns", "numpy.datetime64", "numpy.transpose", "numpy.abs", "numpy.bool_", "numpy.bytes_", "numpy.unique", "numpy.typeDict.values", "...
Finfra/KerasStudy
[ "ccd9b0a9f78d70d63a500ba3c0bf9e6686bee11c" ]
[ "08.ReinforcemetLearning/tf_rl/models.py" ]
[ "import math\nimport tensorflow as tf\n\nfrom .utils import base_name\n\n\nclass Layer(object):\n def __init__(self, input_sizes, output_size, scope):\n \"\"\"Cretes a neural network layer.\"\"\"\n if type(input_sizes) != list:\n input_sizes = [input_sizes]\n\n self.input_sizes = ...
[ [ "tensorflow.get_variable", "tensorflow.variable_scope", "tensorflow.matmul", "tensorflow.constant_initializer" ] ]
farziengineer/numpy
[ "4ff3af387f93ff37f04f42458d4590c33f61fb9e" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n\"\"\" NumPy is the fundamental package for array computing with Python.\n\nIt provides:\n\n- a powerful N-dimensional array object\n- sophisticated (broadcasting) functions\n- tools for integrating C/C++ and Fortran code\n- useful linear algebra, Fourier transform, and random number capabil...
[ [ "numpy.distutils.core.setup", "numpy.distutils.misc_util.Configuration" ] ]
baxterai/AEANNtf
[ "416e282c4ee3e0e8622bafd558363bacb27d4c15" ]
[ "AEANNtf/ANNtf2_operations.py" ]
[ "\"\"\"ANNtf2_operations.py\n\n# Author:\nRichard Bruce Baxter - Copyright (c) 2020-2022 Baxter AI (baxterai.com)\n\n# License:\nMIT License\n\n# Installation:\nsee ANNtf2.py\n\n# Usage:\nsee ANNtf2.py\n\n# Description:\nANNtf operations\n\n\"\"\"\n\nimport tensorflow as tf\nimport numpy as np\nimport ANNtf2_global...
[ [ "tensorflow.size", "tensorflow.math.log", "tensorflow.dtypes.cast", "tensorflow.expand_dims", "tensorflow.reduce_mean", "tensorflow.math.squared_difference", "tensorflow.squeeze", "tensorflow.cast", "tensorflow.one_hot", "tensorflow.clip_by_value", "tensorflow.argmax", ...
AdamVPro/zenml
[ "6dfba8483b1549b888341aea726362a96e407a43" ]
[ "examples/airflow_local/run.py" ]
[ "# Copyright (c) ZenML GmbH 2021. 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.array", "sklearn.linear_model.LogisticRegression" ] ]
adrianogil/git-tools
[ "aa943515841a792aa1e7c4bf07e234fc20fa7811" ]
[ "analysis/prod_analysis.py" ]
[ "import sys, os\nimport subprocess\nfrom git_tools import git_tools\nimport matplotlib.pylab as pylab\n\ncurrent_dir = os.getcwd()\n\nauthors_data = {}\n\ndef commit_analysis(commit_hash, initial_date):\n # print(\"commit: \" + commit_hash)\n\n author_name_cmd = \"git log -1 --pretty=format:'%an' \" + commit_...
[ [ "matplotlib.pylab.legend", "matplotlib.pylab.show" ] ]
MeepoAII/faster-rcnn
[ "d8a0e760c1d5f320bc0eea072b575b3098bda0f1" ]
[ "model/utils/creator_tool.py" ]
[ "import numpy as np\r\nimport torch\r\nfrom torchvision.ops import nms\r\nfrom model.utils.bbox_tools import loc2bbox\r\n\r\ndef _get_inside_index(anchor, H, W):\r\n index_inside = np.where(\r\n (anchor[:, 0] >= 0) &\r\n (anchor[:, 1] >= 0) &\r\n (anchor[:, 2] <= H) &\r\n (anchor[:, 3...
[ [ "numpy.where", "torch.from_numpy" ] ]
shuaizzZ/mmsegmentation
[ "a6c6b348dbf8c4a0a39ffbdb832a1e82309c533c" ]
[ "mmseg/models/utils/dupsample_block.py" ]
[ "\nimport torch\nfrom torch import nn as nn\nfrom .custom_blocks import int_size\nfrom ..builder import build_loss\nfrom mmcv.runner import auto_fp16, force_fp32\n\n\nclass DUpsamplingBlock(nn.Module):\n def __init__(self, inplanes, scale, num_class=21, pad=0):\n super(DUpsamplingBlock, self).__init__()\n...
[ [ "torch.zeros", "torch.nn.Conv2d", "torch.Tensor" ] ]