repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
sourav-30/Manager
[ "21adc814ab2c6e1cd5b375ea3ce3e01da743e357" ]
[ "emanager/hr/Worker.py" ]
[ "import os\nfrom emanager.constants import*\nimport pandas as pd\n\nhr_path = os.path.dirname(os.path.realpath(__file__))\n\n\nclass Worker:\n def __init__(self, name):\n self.name = name\n\n self.check_database()\n self.check_attendance()\n self.check_balance()\n\n def check_datab...
[ [ "pandas.read_csv" ] ]
neuromorphs/grill-dvs-calibration
[ "9aa7c533d0203915f8ebd27665b590de4cecec01" ]
[ "edvs.py" ]
[ "import numpy as np\nimport threading\nimport atexit\nimport time\n\nclass Serial(object):\n def __init__(self, port, baud):\n import serial\n self.conn = serial.Serial(port, baudrate=baud, rtscts=True, timeout=0)\n def send(self, message):\n self.conn.write(message.encode('utf-8'))\n ...
[ [ "numpy.zeros", "numpy.frombuffer", "numpy.hstack", "matplotlib.pyplot.subplots", "numpy.where", "numpy.add.at", "matplotlib.pyplot.show" ] ]
Ter-hash/holography_test
[ "372e5192cd1355cb565159f2a96fd2f7370095ce" ]
[ "propagation_partial.py" ]
[ "import torch\nimport torch.nn as nn\nimport utils.utils as utils\nimport numpy as np\nimport time\nfrom propagation_ASM import propagation_ASM\nfrom spectrum import wvl2transmission_measured\nfrom utils.pytorch_prototyping.pytorch_prototyping import Conv2dSame\nimport random\n\n\nclass PartialProp(nn.Module):\n ...
[ [ "torch.stack", "numpy.exp", "torch.nn.Parameter", "torch.ones", "torch.fft.ifftn", "numpy.cos", "numpy.random.random", "torch.sum", "numpy.sin", "numpy.log", "torch.view_as_complex", "torch.normal", "torch.manual_seed", "numpy.prod", "torch.tensor", ...
rrtaylor/tensorflow
[ "8b639d335ec0ad6b69dddb791636adb3cd1dab68" ]
[ "tensorflow/python/eager/context.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.core.protobuf.config_pb2.ConfigProto", "tensorflow.python.pywrap_tensorflow.TFE_ContextExportRunMetadata", "tensorflow.python.eager.executor.new_executor", "tensorflow.python.eager.monitoring.Counter", "tensorflow.python.pywrap_tensorflow.TFE_NewContext", "tensorflow.python.tf2...
saverymax/mvts_transformer
[ "22796d6977b78d5636f6aad3f7efeb49f2991808" ]
[ "src/optimizers.py" ]
[ "import math\nimport torch\nfrom torch.optim.optimizer import Optimizer\n\n\ndef get_optimizer(name):\n\n if name == \"Adam\":\n return torch.optim.Adam\n elif name == \"RAdam\":\n return RAdam\n\n\n# from https://github.com/LiyuanLucasLiu/RAdam/blob/master/radam/radam.py\nclass RAdam(Optimizer)...
[ [ "torch.zeros_like" ] ]
hpphappy/XRF_tomography_Theta
[ "5db1f9e8fc477449561927816106d5e55a5917af" ]
[ "data_generation_fns_updating.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 7 23:34:50 2020\n\n@author: panpanhuang\n\"\"\"\n\nimport numpy as np\nfrom numpy.random import default_rng\nimport xraylib as xlib\nimport xraylib_np as xlib_np\nimport torch as tc\nimport torch.nn.functional as F\nimport os\nfrom tqdm i...
[ [ "torch.cat", "torch.stack", "numpy.argmin", "numpy.load", "torch.ones", "numpy.where", "torch.nn.functional.affine_grid", "torch.exp", "torch.sum", "numpy.concatenate", "numpy.full", "numpy.save", "torch.unsqueeze", "torch.tensor", "numpy.argmax", "n...
konami86/DeepLab-v3-plus-cityscapes-Res50
[ "3b4d6b4b5d373e8f1206485d4867866eb4ffac7b" ]
[ "models/deeplabv3plus.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.model_zoo as modelzoo\nimport torch.nn.functional as F\nimport torchvision\n\nfrom .resnet import Resnet50\nfrom modules import InPlaceABNSync as BatchNorm2d\n\n\n\nclass ConvBNReLU(nn.Module):\n def __init...
[ [ "torch.cat", "torch.nn.init.constant_", "torch.nn.functional.interpolate", "torch.nn.init.kaiming_normal_", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d", "torch.randn", "torch.nn.DataParallel" ] ]
j-c-cook/RadiationHeatTransfer
[ "23f65c15b7118aab02b272905700fe1c12a16e35" ]
[ "RadiationHeatTransfer/examples/blackbody_radiation.py" ]
[ "# Jack C. Cook\n# Sunday, January 31, 2021\n\n\"\"\"\nPlancks Law:\nImplement Plancks law using Eb,lambda function\n\"\"\"\n\nimport RadiationHeatTransfer as RHT\nfrom scipy.optimize import fminbound\nfrom itertools import count\nfrom itertools import takewhile\nimport matplotlib.pyplot as plt\nfrom scipy.integrat...
[ [ "scipy.interpolate.interp1d", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots" ] ]
k0kod/pylas
[ "e1637f3de4e13c4037f0177da661cb67d3c3dfe9" ]
[ "pylastests/test_chunk_read_write.py" ]
[ "\"\"\"\nTests related to the 'chunked' reading and writing\n\"\"\"\nimport io\nimport math\n\nimport numpy as np\nimport pytest\n\nimport pylas\n\n\ndef test_chunked_las_reading_gives_expected_points(las_file_path):\n \"\"\"\n Test chunked LAS reading\n \"\"\"\n with pylas.open(las_file_path) as las_re...
[ [ "numpy.allclose" ] ]
lagrassa/ray
[ "02bdaf221d04ed0bcadbf649674d936cfdd46761" ]
[ "test/failure_test.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport json\nimport os\nimport ray\nimport sys\nimport tempfile\nimport threading\nimport time\n\nimport ray.ray_constants as ray_constants\nfrom ray.utils import _random_string\nim...
[ [ "numpy.copy", "numpy.zeros" ] ]
nbip/IWAE
[ "3a5e38b4d6eafceb5ec47dbe59aee3b42ad576f6" ]
[ "tasks/task01.py" ]
[ "import tensorflow as tf\nfrom tensorflow_probability import distributions as tfd\nfrom tensorflow import keras\nimport numpy as np\nimport os\nimport argparse\nimport datetime\nimport time\nimport sys\nsys.path.insert(0, './src')\nsys.path.insert(0, './tasks')\nimport utils\nimport iwae1\nimport iwae2\nimport plot...
[ [ "tensorflow.keras.datasets.mnist.load_data", "tensorflow.data.Dataset.from_tensor_slices", "numpy.random.seed", "tensorflow.random.set_seed", "tensorflow.summary.create_file_writer", "tensorflow.config.experimental.set_memory_growth", "numpy.arange", "tensorflow.config.list_physica...
josephhardinee/pyart
[ "909cd4a36bb4cae34349294d2013bc7ad71d0969" ]
[ "pyart/setup.py" ]
[ "\n\ndef configuration(parent_package='', top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('pyart', parent_package, top_path)\n config.add_subpackage('io') # io first to detect if RSL is missing.\n config.add_subpackage('__check_build')\n config.add_s...
[ [ "numpy.distutils.misc_util.Configuration" ] ]
Midnighter/component-contribution
[ "e580480a1979fa7b57b378c9a02a99f2f0b5bde6" ]
[ "examples/mdf.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 14 18:32:46 2014\n\n@author: noore\n\"\"\"\nfrom scripts.max_min_driving_force import KeggFile2ModelList, MaxMinDrivingForce\nfrom python.component_contribution import ComponentContribution\nfrom scripts.html_writer import HtmlWriter\nimport logging\nimport numpy...
[ [ "matplotlib.pyplot.show" ] ]
gjbang/graduation-design
[ "deaaa11ed652ac0b8843a039f04665da67181566" ]
[ "singlenet-function/estimation/renderers.py" ]
[ "import cv2\nimport math\nimport numpy as np\n\n\ndef draw(config, input_image, coords, subset, resize_fac = 1):\n\n stickwidth = 1\n\n canvas = input_image.copy()\n\n for body_part_type, body_part_meta in config.body_parts.items():\n color = body_part_meta.color\n body_part_peaks = coords[bo...
[ [ "numpy.array", "numpy.mean", "numpy.zeros" ] ]
aod321/new_train
[ "23bf0a64ac274433cbc372898d97ae9d1aa5f6cd" ]
[ "preprocess.py" ]
[ "import torch\nimport torch.nn\nfrom torchvision import transforms\nfrom torchvision.transforms import functional as TF\nimport cv2\nimport numpy as np\nfrom skimage.util import random_noise\nfrom PIL import Image\nimport torch.nn.functional as F\nimport imgaug.augmenters as iaa\nimport imgaug as ia\nsometimes = la...
[ [ "torch.zeros", "numpy.array", "numpy.uint8", "torch.cat", "torch.tensor", "torch.sum" ] ]
SabrinaKall/credential-digger
[ "372b25aa19c7c04a2c2a8f385f4875f66de73af1" ]
[ "credentialdigger/generator/generator.py" ]
[ "import json\nimport random\nimport re\nimport pkg_resources\nimport shutil\nimport tempfile\nfrom collections import Counter\nfrom pathlib import Path\n\nimport pandas as pd\nimport string_utils\nfrom git import Repo as GitRepo\nfrom tqdm import tqdm\n\nfrom .qlearning import compute_dataset\nfrom .training import...
[ [ "pandas.DataFrame" ] ]
yingxinac/DSGRN
[ "b5bc64e5a99e6d266f6ac5ba7ac9d04954f12d32" ]
[ "software/HillSimulations/hillmodel.py" ]
[ "# The MIT License (MIT)\n\n# Copyright (c) 2016 Breschine Cummins\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# t...
[ [ "numpy.array", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "scipy.integrate.ode", "matplotlib.pyplot.axis" ] ]
jacobtomlinson/ucx-py
[ "7ac246f521d936b8f1fe9026c593d01ac50efbf7" ]
[ "benchmarks/old_tests/send-recv-py-obj.py" ]
[ "# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n# See file LICENSE for terms.\n#\n# Description: 2-process test that tests the functionality of sending\n# and receiving contiguous python objects\n#\n# Server Steps:\n# 1. activate listener\n# 2. Obtains the coroutine that accepts incoming connection...
[ [ "numpy.testing.assert_array_equal", "numpy.frombuffer" ] ]
adshidtadka/server-allocation
[ "ce533ce31cc2ce12f0c6a01bff97be3875e35b30" ]
[ "graph/Plot.py" ]
[ "\n# %%\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# %%\n\n\nclass Graph:\n def initialize_rcparams():\n plt.clf()\n plt.style.use('default')\n plt.rcParams['xtick.direction'] = 'in'\n plt.rcParams['ytick.direction'] = 'in'\n plt.gca().yaxis.se...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.rc", "matplotlib.pyplot.gca", "matplotlib.pyplot.ylabel", "pan...
jhamman/ndpyramid
[ "34e6bfbc7d217917f90816e520450269eae3934b" ]
[ "ndpyramid/regrid.py" ]
[ "import pathlib\n\nimport datatree as dt\nimport numpy as np\nimport xarray as xr\n\nfrom .utils import get_version, multiscales_template\n\n\ndef make_grid_ds(level: int, pixels_per_tile: int = 128) -> xr.Dataset:\n \"\"\"Make a dataset representing a target grid\n\n Parameters\n ----------\n level : i...
[ [ "numpy.arange", "numpy.empty", "numpy.zeros" ] ]
jdapoorv/lung-cancer-detector
[ "bd98e99ef4b6c7c1f4dec8458c6c655ea6c8b1ba" ]
[ "dataloader/stage1.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nimport pickle as p\r\nimport os\r\nimport math\r\nfrom dataloader.base_dataloader import BaseDataLoader\r\n\r\nimport utils.dicom_processor as dp\r\n\r\nclass Stage1Kaggle(BaseDataLoader):\r\n\tdef __init__(self, config):\r\n\t\tsuper(Stage1Kaggle, self).__init__(config...
[ [ "numpy.array" ] ]
mspkvp/MiningOpinionTweets
[ "23f05b4cea22254748675e03a51844da1dff70ac" ]
[ "src/lda_topics.py" ]
[ "from __future__ import print_function\r\nfrom time import time\r\nimport csv\r\nimport sys\r\n\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\n\r\nimport numpy as np\r\nimport lda\r\n\r\nimport logging\r\n\r\n#start_time = str(time())\r\nlogging.basicConfig(filename='lda_analyser.log', level=logg...
[ [ "numpy.array", "sklearn.feature_extraction.text.CountVectorizer", "numpy.argsort" ] ]
skmkedar/FewShotLearn
[ "3f27581ef93bda0fb1d6661027f5d19e7418c4f4" ]
[ "model/baselines/fce-embedding.py" ]
[ "##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: Albert Berenguel\n## Computer Vision Center (CVC). Universitat Autonoma de Barcelona\n## Email: aberenguel@cvc.uab.es\n## Copyright (c) 2017\n##\n## This source code is licensed under the MIT-style license found in the\n## ...
[ [ "torch.cat", "torch.nn.LSTM", "torch.nn.Softmax", "numpy.arange", "torch.load" ] ]
xemio/ANTsPy
[ "ef610318e217bb04d3850d480c2e51df695d56c0" ]
[ "ants/utils/label_image_centroids.py" ]
[ "\n\n__all__ = ['label_image_centroids']\n\nimport numpy as np\n\nfrom ..core import ants_transform as tio\n\n\ndef label_image_centroids(image, physical=False, convex=True, verbose=False):\n \"\"\"\n Converts a label image to coordinates summarizing their positions\n\n ANTsR function: `labelImageCentroids...
[ [ "numpy.zeros", "numpy.min", "numpy.mean", "numpy.arange", "numpy.unique", "numpy.sqrt", "numpy.vstack" ] ]
Oscarlight/PiNN_Caffe2
[ "fd5127c88960a863049f4bda658a4c26a8b5d376" ]
[ "ac_qv_api.py" ]
[ "import caffe2_paths\r\nimport os\r\nimport pickle\r\nfrom caffe2.python import (\r\n\tworkspace, layer_model_helper, schema, optimizer, net_drawer\r\n)\r\nimport caffe2.python.layer_model_instantiator as instantiator\r\nimport numpy as np\r\nfrom pinn.adjoint_mlp_lib import build_adjoint_mlp, init_model_with_schem...
[ [ "numpy.zeros", "numpy.ones", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "numpy.expand_dims" ] ]
jfyao90/SDN_DDoS_Simulation
[ "f148bf6b11e039a77ccb7a9dc015083941e428ce" ]
[ "networks/critic.py" ]
[ "from keras.layers import Dense, Input, merge\nfrom keras.models import Model\nfrom keras.optimizers import Adam\nimport keras.backend as keras_backend\nimport tensorflow\n\n\nclass CriticNetwork(object):\n def __init__(self, tensorflow_session, state_size, action_size,\n hidden_units=(300, 600),...
[ [ "tensorflow.initialize_all_variables", "tensorflow.gradients" ] ]
lfchener/Parakeet
[ "a84b6d3383b2a8a5fb45d0c233bee1ed80d0b389" ]
[ "parakeet/modules/audio.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.concatenate", "numpy.pad", "numpy.sin", "numpy.arange", "scipy.signal.get_window", "numpy.cos", "numpy.expand_dims" ] ]
franpena-kth/learning-deep-learning
[ "9cd287b602dee1358672c4189445721a9c24f107" ]
[ "unif/unif_playground.py" ]
[ "import random\nimport time\n\nimport torch\n\nimport utils\nfrom unif.unif_data import CodeDescDataset\nfrom unif.unif_model import UNIFAttention\nfrom unif.unif_tokenizer import tokenize_data\n\n\ndef load_unif_model():\n load_path = './unif_model.ckpt'\n code_snippets_file = './data/parallel_bodies'\n d...
[ [ "torch.load" ] ]
matt-peters/text-to-text-transfer-transformer
[ "614af25d4379c74ea829f4bbfcfcaa13f0a463cf" ]
[ "t5/data/test_utils_test.py" ]
[ "# Copyright 2020 The T5 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 applicable law or agr...
[ [ "tensorflow.compat.v2.compat.v1.enable_eager_execution", "tensorflow.compat.v2.data.Dataset.from_tensor_slices" ] ]
dl4184/alpha-zero-general
[ "7236f62f334cb0609971e3b9a48cb23da39447f3" ]
[ "connect4/Connect4Heuristics.py" ]
[ "import numpy as np\nfrom numba import njit\n\n\ndef heuristic1lookahead(board):\n board = np.copy(board)\n player = 1\n # if np.sum(board) == 0:\n # player = 1\n\n valid_moves = board[0] == 0\n l_len = 4\n for j in range(valid_moves.size):\n if valid_moves[j]:\n\n availabl...
[ [ "numpy.max", "numpy.pad", "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.copy", "numpy.ones", "numpy.where", "numpy.argmax", "numpy.all" ] ]
anna-guinet/dpa-chi-function
[ "70990b8c7ac715f3bb34540fdf7ce639493e30cf" ]
[ "num_sim_1x5bits_pr_success_to_csv_sq.py" ]
[ "#!/usr/bin/env python\n\n\"\"\" DPA ON KECCAK 5-BIT CHI ROW & 1-BIT K\n\nSave the figures for a simulation which display the outcome of a test\naccording to the SNR, in order to recover kappa bits. \n\nWithin one simulation, we guess 2 bits of kappa, with the scalar product,\nand a fixed noise power consumption ve...
[ [ "numpy.dot", "matplotlib.pylab.ylabel", "pandas.DataFrame", "matplotlib.pylab.legend", "matplotlib.pylab.figure", "matplotlib.pylab.xlabel", "matplotlib.pylab.title", "matplotlib.pylab.plot" ] ]
derhaudraufmann/kddm-eeg-eyestate
[ "7751751cf456132fec7f2e24ad7f56111c19facf" ]
[ "src/gradient_boost.py" ]
[ "# classification with Gradient boost, this approach in the end resulted in 74% accuracy and was used as final result\n\nimport numpy as np\nfrom sklearn.model_selection import KFold\n\nfrom sklearn.ensemble import GradientBoostingClassifier\n\nfrom src.util import extract_column, load_data\n\ndef gradient_boot():\...
[ [ "numpy.max", "numpy.array", "numpy.reshape", "numpy.median", "numpy.min", "numpy.mean", "numpy.append", "sklearn.model_selection.KFold", "numpy.column_stack", "sklearn.ensemble.GradientBoostingClassifier" ] ]
simonedeldeo/DAIN
[ "273d1a26de22a4c22bac173fc5b8f97c9ed25b1e" ]
[ "train.py" ]
[ "import sys\nimport os\n\nimport threading\nimport torch\nfrom torch.autograd import Variable\nimport torch.utils.data\nfrom lr_scheduler import *\n\nimport numpy\nfrom AverageMeter import *\nfrom loss_function import *\nimport datasets\nimport balancedsampler\nimport networks\nfrom my_args import args\n\n\n\ndef ...
[ [ "torch.utils.data.ConcatDataset", "numpy.array", "torch.sqrt", "torch.stack", "torch.autograd.Variable", "torch.no_grad", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.load", "torch.Tensor", "torch.mean" ] ]
jcasse/mlflow
[ "7bba35ceed7ac3219622583a2041cc4af4801159" ]
[ "tests/pytorch/test_pytorch_autolog.py" ]
[ "from distutils.version import LooseVersion\nimport pytest\nimport pytorch_lightning as pl\nimport torch\nfrom iris import IrisClassification\nimport mlflow\nimport mlflow.pytorch\nfrom pytorch_lightning.callbacks.early_stopping import EarlyStopping\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom mlf...
[ [ "torch.nn.Linear", "torch.Tensor" ] ]
MinxZ/multi_label
[ "aed67d4bb4102962eb73b996288aa56983589858" ]
[ "multi_loss/train.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport argparse\nimport multiprocessing as mp\nimport random\n\nimport numpy as np\nimport tensorflow as tf\nfrom keras import backend\nfrom keras.applications import *\nfrom keras.backend.common import (epsilon, floatx, image_data_format,\n ...
[ [ "numpy.sqrt" ] ]
quanpands/wflow
[ "b454a55e4a63556eaac3fbabd97f8a0b80901e5a" ]
[ "wflow/wflow/wflow_funcs.py" ]
[ "# Copyright (c) J. Schellekens 2005-2011\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program ...
[ [ "numpy.array", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.any", "numpy.where", "numpy.power" ] ]
renqianluo/DAG2N_PTB
[ "fb7061e48de8f3e787159743d7a7d6e2f9f5dbd1" ]
[ "data/process.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pickle\nimport numpy as np\n\n\ndef main():\n with open(\"train\") as finp:\n lines = finp.read().strip().replace(\"\\n\", \"<eos>\")\n words = lines.split(\" \")\n\n vocab, index = {}, ...
[ [ "numpy.array", "numpy.size" ] ]
jaymwong/CppNumericalSolvers
[ "2a0f98e7c54c35325641e05c035e43cafd570808" ]
[ "tensorflow/configure.py" ]
[ "import tensorflow as tf\nimport sys\n\nif '__cxx11_abi_flag__' not in dir(tf):\n print(\"Cannot find the ABI version of TensorFlow.\")\n print(\"Your TensorFlow version is too old. Please upgrade to at least TF v1.4.\")\n sys.exit(1)\n\nwith open(\"tensorflow_config.txt\", \"w\") as f:\n print(\"Tensor...
[ [ "tensorflow.sysconfig.get_include" ] ]
dimitri-yatsenko/photix
[ "906e5637c8e8172e1f57c3a6f04b55db355effb2" ]
[ "photix/demix.py" ]
[ "import numpy as np\nimport tqdm\nimport datajoint as dj\nimport scipy\nfrom .sim import Fluorescence, Detection, Tissue\n\nschema = dj.schema('photixxx')\n\n\n@schema\nclass Sample(dj.Lookup):\n definition = \"\"\"\n sample : tinyint unsigned \n ---\n density : int # cells per cubic mm\n \"\"\"\n ...
[ [ "numpy.ceil", "numpy.delete", "numpy.triu_indices", "numpy.linalg.norm", "numpy.argmin", "scipy.linalg.eigh", "numpy.random.seed", "numpy.round", "numpy.exp", "numpy.random.shuffle", "numpy.identity", "numpy.ndarray", "numpy.linalg.inv" ] ]
Filco306/TopologyLayer
[ "3da7af35a58bd1438d28d6cca49b40f90cb7ee14" ]
[ "examples/paper/regression/rips.py" ]
[ "import numpy as np\n\nfrom problems import generate_rips_problem\nimport torch\nimport torch.nn as nn\nfrom topologylayer.nn import *\nfrom util import penalized_ls, run_trials, run_trials_ols, get_stats, gen_snr_stats, gen_dim_stats\nfrom penalties import NormLoss\n\n\nclass TopLoss(nn.Module):\n def __init__(...
[ [ "numpy.arange", "numpy.logspace", "numpy.savetxt" ] ]
Krissmedt/runko
[ "073306de9284f1502d0538d33545bc14c80e8b93" ]
[ "projects/kms_penning/col_pypic.py" ]
[ "# -*- coding: utf-8 -*-\n\n# system libraries\nfrom __future__ import print_function\nfrom mpi4py import MPI\nimport numpy as np\nimport sys, os\nimport matplotlib.pyplot as plt\nimport time\n\n# runko + auxiliary modules\nimport pytools # runko python tools\n\n# Runko-Python functionality by Krissmedt\nfrom pyha...
[ [ "numpy.random.seed", "numpy.array", "numpy.linalg.norm", "numpy.zeros" ] ]
WojciechKusa/datasets
[ "1406a04c3e911cec2680d8bc513653e0cafcaaa4" ]
[ "src/datasets/fingerprint.py" ]
[ "import inspect\nimport json\nimport os\nimport random\nimport shutil\nimport tempfile\nimport weakref\nfrom dataclasses import asdict\nfrom functools import wraps\nfrom pathlib import Path\nfrom typing import TYPE_CHECKING, Any, Dict, List, Optional, Union\n\nimport numpy as np\nimport pyarrow as pa\nimport xxhash...
[ [ "numpy.random.get_state" ] ]
evopy/evopy
[ "1ca150c0a4bd76cde3e989aafa114dc476928201" ]
[ "test/test_random.py" ]
[ "\"\"\"Tests for (non-)deterministic behavior in evopy.\"\"\"\nimport numpy as np\nfrom nose.tools import raises\n\nfrom evopy.utils import random_with_seed\n\n\ndef random_integer_seed_test():\n \"\"\"Test if integers are correctly used.\"\"\"\n random = random_with_seed(42)\n assert random.randint(100) =...
[ [ "numpy.random.seed", "numpy.random.RandomState" ] ]
rbtsbg/pgig
[ "d45199b88d5dfbfee27faf8df0e07a2a7afc1765" ]
[ "viz.py" ]
[ "import matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom PIL import Image\nfrom matplotlib.colors import LinearSegmentedColormap, BoundaryNorm\nimport numpy as np\n\n\ndef pil_loader(path):\n with open(path, 'rb') as f:\n with Image.open(f) as img:\n return img.convert('RGB'...
[ [ "numpy.concatenate", "matplotlib.patches.Rectangle", "matplotlib.pyplot.gca", "matplotlib.pyplot.get_cmap", "matplotlib.colors.BoundaryNorm", "numpy.linspace", "matplotlib.pyplot.imshow" ] ]
woodygzp/test1
[ "1d0f8d63b6a857eab7c2252531703acaae4979f9" ]
[ "bnn/src/training/characters.py" ]
[ "\n'''\nModified version of the mnist.py training script\nDesigned to be used with the NIST SD 19 Handprinted Forms and Characters dataset: https://www.nist.gov/srd/nist-special-database-19\nBest results have been achieved by cropping all images by bounding box of the character, and scaling to 28x28 to emulate the ...
[ [ "numpy.asarray", "numpy.random.seed", "numpy.eye", "scipy.misc.imread", "numpy.float32" ] ]
isce3-testing/isce3-circleci-poc
[ "ec1dfb6019bcdc7afb7beee7be0fa0ce3f3b87b3" ]
[ "tests/python/extensions/pybind/cuda/core/device.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy.testing as npt\nimport isce3.ext.isce3 as isce3\n\ndef test_get_device_count():\n count = isce3.cuda.core.get_device_count()\n assert(count >= 0)\n\ndef test_init():\n count = isce3.cuda.core.get_device_count()\n for d in range(count):\n device = isce3.cuda...
[ [ "numpy.testing.assert_raises" ] ]
tmartins1996/6PM-clustering
[ "47147f88313a0e29d1a256120ef207add8ec8b88" ]
[ "6PM_n_clusters_Product.py" ]
[ "\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Dez 17 16:38:28 2017\r\n\r\n@group DM 2017 Semester 1, Group 2 \r\n\r\n@author: Martins T.\r\n@author: Mendes R.\r\n@author: Santos R.\r\n\r\n\r\ndataset - 2017/10/10\r\n\r\n\"\"\"\r\nprint(__doc__)\r\n\r\n\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom sc...
[ [ "scipy.cluster.hierarchy.dendrogram", "scipy.cluster.hierarchy.linkage", "matplotlib.pyplot.xlabel", "pandas.read_excel", "matplotlib.pyplot.title", "pandas.DataFrame", "matplotlib.pyplot.plot", "sklearn.cluster.KMeans", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel...
yyywxk/RGTNet
[ "cb53cb5979caac87b10eae4c396e3f7ca3f10e6c" ]
[ "utils/loss.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass DiceLoss(nn.Module):\n def __init__(self):\n super(DiceLoss, self).__init__()\n \n def forward(self, input, target):\n N = target.size(0)\n smooth = 1\n\n input_flat = input.view(N, -1)\n target...
[ [ "torch.zeros", "torch.rand", "torch.nn.functional.softmax", "torch.exp", "torch.nn.CrossEntropyLoss" ] ]
thegreatwall/NSLS2
[ "bff36128cce475a0e7563d05b93aa63b6f706c01" ]
[ "skxray/spectroscopy.py" ]
[ "# ######################################################################\n# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #\n# National Laboratory. All rights reserved. #\n# #\n# Redistribution an...
[ [ "numpy.max", "scipy.integrate.simps", "numpy.asarray", "numpy.log", "numpy.exp", "numpy.min", "numpy.diff", "numpy.any", "numpy.where", "numpy.argmax", "numpy.atleast_1d", "numpy.sqrt", "numpy.all" ] ]
chawins/princeton_thesis
[ "114b1f9bc36742827c2cb285249ca30dba0ae85c" ]
[ "lib/tf_utils.py" ]
[ "\"\"\"\nAn additional utility file used for adversarial training.\nAuthor: Arjun Bhagoji (abhagoji@princeton.edu)\n\"\"\"\n\nimport sys\nimport time\n\nimport keras.backend as K\nimport numpy as np\nimport tensorflow as tf\nfrom keras.models import save_model\nfrom keras.preprocessing.image import ImageDataGenerat...
[ [ "numpy.concatenate", "tensorflow.train.AdamOptimizer", "numpy.sum", "tensorflow.global_variables", "tensorflow.constant", "numpy.argmax" ] ]
student-work-agu-gis2021/lesson7-matplotlib-A5719050
[ "3914673641888338c7176f33afa276ee1fcea7fa" ]
[ "Exercise_7_problem_2.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# ## Problem 2 - Plotting temperatures \n# \n# In this problem we will plot monthly mean temperatures from the Helsinki-Vantaa airpot for the past 30 years.\n# \n# ## Input data\n# \n# File `data/helsinki-vantaa.csv` monthly average temperatures from Helsinki Vantaa airpo...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
goyeahia/SafeVid
[ "daeb2f15feac834fa3b5cea24e353f05f88dfcab" ]
[ "server.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jul 29 02:11:24 2018\n@author: Yeahia Sarker\n\"\"\"\n\nfrom imutils.video import FileVideoStream\nfrom imutils.video import FPS\nimport cv2\nimport imutils\nimport numpy as np\nimport pickle\nimport socket\nimport struct\nimport sys\nimport t...
[ [ "numpy.dstack" ] ]
PacktPublishing/Hands-On-Python-Deep-Learning-for-Web
[ "bb111a073a1cedda19469b311e7b441b11adc533" ]
[ "Chapter11/app/app.py" ]
[ "from flask import Flask, request, jsonify, render_template\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.neural_network import MLPClassifier\n\nnp.random.seed(5)\n\ndf = pd.read_csv(\"https://raw.gith...
[ [ "sklearn.preprocessing.StandardScaler", "numpy.random.seed", "sklearn.neural_network.MLPClassifier", "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
gaurav272333/RUA
[ "46892cbe38a24b2c4fb440a69ee0dde1674f6b8b" ]
[ "wrn2810_cifar100/rua/wrn2810_cifar100_rua.py" ]
[ "import math\nimport os\nimport random\nimport tempfile\n\nimport fastestimator as fe\nimport numpy as np\nimport tensorflow as tf\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom fastestimator.op.numpyop import NumpyOp\nfrom fastestimator.op.numpyop.meta import OneOf, Sometimes\nfrom fas...
[ [ "torch.nn.Linear", "torch.nn.functional.avg_pool2d", "numpy.asarray", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.functional.dropout", "torch.nn.init.kaiming_normal_", "torch.optim.SGD", "tensorflow.keras.datasets.cifar100.load_data", "torch.nn.ReLU", "nump...
CyprienGille/Atari-Freeway-Reinforcement-Learning-Project--RAM-only-
[ "fc3bd3590e764b3a185f11b94d6415a09a8a45c0" ]
[ "Freeway_ann/ann_training.py" ]
[ "\"\"\"\nScript to train the artificial neural network: run it to get a trained_agent saved to the working dir.\n\nMost interesting parameters are defined at the start of the script for easy changing.\nNote: This script assumes that you already created data with the data_creation.py script, or in a similar way.\n\"...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "matplotlib.pyplot.plot", "numpy.load", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.losses.SparseCategorica...
lierdakil/information-theory-2020
[ "e2792982bbd8f51869fc586e47275277a4058cdf" ]
[ "cyc.py" ]
[ "from sympy import mod_inverse\n\nclass ModArith:\n def __init__(self, val, mod):\n if isinstance(val, ModArith):\n assert(mod == val.m)\n self.val = val.val\n self.m = mod\n else:\n self.val = val % mod\n self.m = mod\n\n def __add__(self, ...
[ [ "numpy.count_nonzero", "numpy.reshape" ] ]
JobQiu/PrototypicalNetwork
[ "b46c34f8847946c4cd41774f4c8ee87c3486474c" ]
[ "data_loader/data_generator.py" ]
[ "import numpy as np\nfrom configs.config import MiniImageNetConfig\n\n\nclass DataGenerator:\n def __init__(self, config=MiniImageNetConfig()):\n self.config = config\n # load data here\n self.input = np.ones((500, 784))\n self.y = np.ones((500, 10))\n\n def next_batch(self, batch_...
[ [ "numpy.random.choice", "numpy.zeros", "numpy.random.permutation", "numpy.ones", "numpy.arange" ] ]
pomonam/Self-Tuning-Networks
[ "3fa949bb1da5beb2b4e7f1d07a26b819b42ad7f3" ]
[ "utils/cutout_utils.py" ]
[ "import numpy as np\n\nimport torch\n\n\nclass Cutout(object):\n # Contains a code from https://github.com/uoguelph-mlrg/Cutout\n \"\"\" Randomly mask out one or more patches from an image. \"\"\"\n def __init__(self, n_holes, length):\n \"\"\" Initialize a class CutOut.\n :param n_holes: int...
[ [ "numpy.clip", "numpy.ones", "numpy.random.randint", "torch.from_numpy" ] ]
jessie0306/MyCare
[ "fe8c3737835d08b9487227538a51a13e7c5717f8" ]
[ "mycare/chart_views.py" ]
[ "from django.shortcuts import render\nfrom mycare.models import Survey\nimport pandas as pd\nimport json\n\n# Create your views here.\ndef Chart(request):\n #DB안에 저장된 설문조사 결과 불러오기\n datas = Survey.objects.all() \n \n lst = []\n for d in datas:\n dic = {}\n dic['성별'] = d.gender\n ...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
omegafragger/models
[ "6518e3e78d898398aa7c19c8cfe7133a859e60e6" ]
[ "research/bayesian_deeplab/model_test.py" ]
[ "# Copyright 2018 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi...
[ [ "tensorflow.random_uniform", "tensorflow.Graph", "tensorflow.global_variables_initializer", "tensorflow.test.main" ] ]
damon-demon/Black-Box-Defense
[ "b4e1b9e6e1703a8d1ba7535d531647abb9705fe9" ]
[ "archs/resnet.py" ]
[ "import torch\nimport torch.nn as nn\n\n\n\ndef conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,\n padding=dilation, groups=groups, bias=False, dilation=dilatio...
[ [ "torch.nn.Linear", "torch.flatten", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
prasunanand/dask-ml
[ "69680f79d0dff57bec50818998edc20b71b6846f" ]
[ "tests/test_partial.py" ]
[ "import dask\nimport dask.array as da\nimport dask.bag as db\nimport dask.dataframe as dd\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom dask.delayed import Delayed\nfrom sklearn.base import clone\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.linear_model import SGDClassifier\n\n...
[ [ "numpy.array", "sklearn.ensemble.RandomForestClassifier", "numpy.ones", "numpy.allclose", "sklearn.linear_model.SGDClassifier", "numpy.arange", "sklearn.base.clone" ] ]
zzb610/factest
[ "1e628f6fc885cd1975c2e68181caf40e2874dc08" ]
[ "factest/alphalens/tears.py" ]
[ "#\r\n# Copyright 2017 Quantopian, Inc.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by...
[ [ "pandas.Timedelta", "pandas.tseries.offsets.BDay", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.subplot" ] ]
chen0040/mxnet-vqa
[ "9ad6d0b8019c647540cd19867a777e5da5928086" ]
[ "mxnet_vqa/library/vqa1.py" ]
[ "import mxnet as mx\nfrom mxnet import gluon, autograd, nd\nfrom mxnet.gluon import nn\nimport os\nimport numpy as np\nimport logging\n\nfrom mxnet_vqa.utils.glove_loader import GloveModel\nfrom mxnet_vqa.utils.image_utils import Vgg16FeatureExtractor\nfrom mxnet_vqa.utils.text_utils import word_tokenize\n\n\nclass...
[ [ "numpy.sum", "numpy.zeros" ] ]
cleverhans-lab/unrolling-sgd
[ "49e001f9cc77b61d65eac3bf26888b5183b73bef" ]
[ "BERT/regular_bert.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\nimport copy\nfrom torch.utils.data import Dataset, DataLoader\nimport torchvision\nimport torchvision.transforms as transforms\nimport numpy as np\nfrom PyHessian.pyhessian impor...
[ [ "torch.nn.Linear", "numpy.array", "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "torch.max", "numpy.random.seed", "torch.no_grad", "torch.std", "torch.nn.functional.log_softmax", "torch.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader"...
studioalight/char-rnn-tensorflow
[ "6c1134982590c42787fc8af1181720eb88e55d6b" ]
[ "sample.py" ]
[ "from __future__ import print_function\nimport tensorflow as tf\n\nimport argparse\nimport os\nfrom six.moves import cPickle\n\nfrom model import Model\n\nfrom six import text_type\n\n\ndef main():\n parser = argparse.ArgumentParser(\n formatter_class=argparse.ArgumentDefaultsHelpFormatter)...
[ [ "tensorflow.Session", "tensorflow.global_variables_initializer", "tensorflow.train.get_checkpoint_state", "tensorflow.global_variables" ] ]
marcusabate/Kimera-LCD-ROS
[ "a6a98c109f6be0cf6c32423c74c70cfcfc9eba90" ]
[ "scripts/ros_lcd_data_provider.py" ]
[ "#! /usr/bin/env python\n\nimport rospy\nimport numpy as np\n\nimport message_filters\nfrom sensor_msgs.msg import Image, CameraInfo\nfrom geometry_msgs.msg import Pose\nimport tf.transformations as transformations\nfrom kimera_lcd_ros.msg import LcdInputPayload, StereoFrame, StereoMatchingParams, CameraParams\n\nc...
[ [ "numpy.array", "numpy.reshape" ] ]
vmzhang/studyGroup
[ "d49ddc32bdd7ac91d73cb8890154e1965d1dcfd0" ]
[ "lessons/python/matplotlib/hwk2.2.py" ]
[ "#import necessary modules for poly1d and arange from numpy\nfrom numpy import poly1d,arange\nimport matplotlib.pyplot as plt\n\n#Generate an empty array for storing the roots\nroots=[]\n\n#Nested loops iterates through all the range of s and zeta passing the values\n#to the poly1d and solving the roots. The roots...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.arange", "numpy.poly1d" ] ]
peisabelle/EVAP_data_worflow
[ "9b1b2ea1fbc35173ce31ed21c53b9271804fc5cb" ]
[ "process_micromet/rename_trim_vars.py" ]
[ "# -*- coding: utf-8 -*-\nimport pandas as pd\n\ndef rename_trim_vars(stationName,varNameExcelTab,df,tab):\n \"\"\"Rename variables according to an Excel spreadsheet. Trim the DataFrame\n in order to keep only the variable specified in the spreadsheet\n\n Parameters\n ----------\n stationName: name o...
[ [ "pandas.ExcelFile", "pandas.read_excel" ] ]
maxfrei750/ignite
[ "0e97cb289f64de9679a04f18969c6e761aa146b0" ]
[ "ignite/contrib/metrics/regression/fractional_absolute_error.py" ]
[ "\n\nimport torch\n\nfrom ignite.exceptions import NotComputableError\nfrom ignite.contrib.metrics.regression._base import _BaseRegression\n\n\nclass FractionalAbsoluteError(_BaseRegression):\n r\"\"\"\n Calculates the Fractional Absolute Error.\n\n :math:`\\text{FAE} = \\frac{1}{n}\\sum_{j=1}^n\\frac{2 |A...
[ [ "torch.abs", "torch.sum" ] ]
aangelopoulos/ltt
[ "c03d13073146ca9fb2da327de6e279b0663de31c" ]
[ "experiments/coco/src/grid_fig.py" ]
[ "import torch\nimport torchvision as tv\nfrom ASL.src.helper_functions.helper_functions import parse_args\nfrom ASL.src.loss_functions.losses import AsymmetricLoss, AsymmetricLossOptimized\nfrom ASL.src.models import create_model\nimport argparse\nimport numpy as np\nfrom scipy.stats import binom\nfrom PIL import I...
[ [ "numpy.array", "matplotlib.pyplot.savefig", "torch.no_grad", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "torch.load", "matplotlib.pyplot.subplots_adjust", "torch.where" ] ]
j-c-cook/pygfunction
[ "73cb9292fc39a068bd3d4ebe66b07ec9c8903c8d" ]
[ "pygfunction/examples/load_aggregation.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\" Example of simulation of a geothermal system.\n\n The g-function of a single borehole is calculated for boundary condition of\n uniform borehole wall temperature along the borehole. Then, the borehole\n wall temperature variations resulting from a time-varying load profile\...
[ [ "numpy.ceil", "scipy.interpolate.interp1d", "numpy.sin", "scipy.signal.fftconvolve", "numpy.zeros", "numpy.arange", "matplotlib.pyplot.tight_layout", "numpy.cos", "numpy.floor" ] ]
imatge-upc/munegc
[ "92a820c1665e760bc7736595dd5dced19df448c1" ]
[ "Fusion2D3DMUNEGC/torch_geometric_extension/munegc.py" ]
[ "\"\"\"\n 2D–3D Geometric Fusion network using Multi-Neighbourhood Graph Convolution for RGB-D indoor scene classification\n 2021 Albert Mosella-Montoro <albert.mosella@upc.edu>\n\"\"\"\n\nimport torch\nimport torch_geometric\n\nfrom .agc import create_agc\nfrom .graph_reg import GraphReg\nfrom .graph_reg imp...
[ [ "torch.max" ] ]
correac/commah
[ "fc2531c1cea90f144a8c8dea4ed414d1044b83b7" ]
[ "examples.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport commah\n\n\ndef runcommand(cosmology='WMAP5'):\n \"\"\" Example interface commands \"\"\"\n\n # Return the WMAP5 cosmology concentration predicted for\n ...
[ [ "matplotlib.pyplot.ylim", "matplotlib.pyplot.figure", "numpy.arange", "numpy.sqrt", "matplotlib.pyplot.show", "numpy.log10" ] ]
ssinad/gcp
[ "50db0f72db5bc907cefd4f7b38e34dadb6ccc0b9" ]
[ "examples/Covid-19/LA-covid19-indicators/ca_reopening_tiers.py" ]
[ "\"\"\"\nFunctions to see how CA counties are meeting the\nCA Department of Public Health's reopening metrics\n\nhttps://www.cdph.ca.gov/Programs/CID/DCDC/Pages/COVID-19/COVID19CountyMonitoringOverview.aspx\n\n\"\"\"\nimport numpy as np\nimport pandas as pd\n\nimport default_parameters\nimport utils\n\nfulldate_for...
[ [ "pandas.read_parquet", "pandas.merge" ] ]
hojeong3709/ML
[ "2fdd8d22dc5584103397559cb23a6efa8bb59637" ]
[ "tensorflow-learning/tensorflow-lab/cost-function/min-squared-error/mini-exam/1.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# 문제1\n# simple3 파일을 읽어\n# hx = wx + b\n# w, b 값을 구하고 x가 5인 경우의 값을 예측하시오.\n\nf = np.loadtxt(\"simple3.txt\", dtype=np.int32, skiprows=1, delimiter=\",\")\nprint(f)\n\nx = f[:, 0]\ny = f[:, 1]\n\nprint(x)\nprint(y)\n\nX = tf.placeholder...
[ [ "tensorflow.Session", "tensorflow.Variable", "matplotlib.pyplot.plot", "tensorflow.constant", "numpy.loadtxt", "tensorflow.placeholder", "matplotlib.pyplot.show", "tensorflow.global_variables_initializer", "tensorflow.square", "tensorflow.train.GradientDescentOptimizer" ]...
WolfNiu/polite-dialogue-generation
[ "18f3b1376ea48e3c4aef6360777ac0224470fcb6" ]
[ "src/model/continuous-LFT.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\n\"\"\"\nDon't forget to append end token for Subtle dataset!!\n\"\"\"\n\n# Imports for compatibility between Python 2&3\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom six.moves import xran...
[ [ "tensorflow.Graph", "tensorflow.Session", "tensorflow.reset_default_graph", "tensorflow.train.Saver", "numpy.arange", "tensorflow.global_variables_initializer" ] ]
SU-CVR-21/DF-VO
[ "ac5f4656036e899ac4beac1afb5fbd7f7e1659f1" ]
[ "run.py" ]
[ "''''''\n'''\n@Author: Huangying Zhan (huangying.zhan.work@gmail.com)\n@Date: 2019-09-01\n@Copyright: Copyright (C) Huangying Zhan 2020. All rights reserved. Please refer to the license file.\n@LastEditTime: 2020-06-02\n@LastEditors: Huangying Zhan\n@Description: This API runs DF-VO.\n'''\n\nimport argparse\nimport...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.cuda.manual_seed" ] ]
Spacider/comp9444_assignment
[ "149db9a562c579d03b3ea06c9de2020c8f3ef310" ]
[ "asmt1/encoder_main.py" ]
[ "# encoder_main.py\n# COMP9444, CSE, UNSW\n\nfrom __future__ import print_function\nimport torch.utils.data\nimport torch.nn.functional as F\nimport matplotlib.pyplot as plt\nimport argparse\n\nfrom asmt1.encoder_model import EncModel, plot_hidden\nfrom asmt1.encoder import star16, heart18, target1, target2\n\n# co...
[ [ "matplotlib.pyplot.show", "torch.nn.functional.binary_cross_entropy" ] ]
AlexeyReshetnyak/ozon_prediction
[ "457824ee5ea575a44838b9b33ff83f633341bfb2" ]
[ "ozon_prediction.py" ]
[ "#!/usr/bin/env python3\n# coding: utf-8\n\nimport numpy as np\nimport pandas as pd\nfrom IPython.display import display # TODO: is it needed?\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn import preprocessing\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import r2...
[ [ "numpy.concatenate", "sklearn.metrics.mean_squared_error", "sklearn.ensemble.GradientBoostingRegressor", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.title", "numpy.linspace", "matplotlib.pyplot.figure", "sklearn.preprocessing.scale", "sklearn.model_selection.Ran...
mateusz-kosior/tensorflow-onnx
[ "b64622565223ce79596b60ace6d44ee06af72d52" ]
[ "tests/test_optimizers.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\n\"\"\"Unit Tests for optimizers such as TransposeOptimizer.\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\nfrom onnx imp...
[ [ "numpy.random.random", "numpy.array", "numpy.random.randn" ] ]
suzrz/nnvis
[ "a984449fb5c30b8ed2d2c451c36a53b16792cc67" ]
[ "nnvis/prelim.py" ]
[ "import logging\nimport copy\nimport torch\nimport numpy as np\nfrom torch.optim.lr_scheduler import StepLR\nfrom torch import optim\nfrom nnvis import paths, net, data_loader\n\nlogger = logging.getLogger(\"vis_net\")\n\n\ndef pre_train_subset(model, device, subset_list, epochs, test_loader):\n \"\"\"\n Func...
[ [ "torch.optim.lr_scheduler.StepLR", "numpy.savetxt", "torch.load" ] ]
PanagiotisP/demucs
[ "d115d0773ca08a081f5b6bfe274cf0e4ed9e2677" ]
[ "result_table.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nimport gzip\nimport json\nimport sys\nfrom collections import defaultdict\nfrom pathlib import ...
[ [ "numpy.std", "numpy.array", "numpy.mean", "numpy.nanmedian" ] ]
lharri73/ray
[ "3e42f54910ee8fecdd09a9a69e4852d6fb946e6d" ]
[ "python/ray/experimental/data/impl/shuffle.py" ]
[ "import math\nfrom typing import TypeVar, List, Optional\n\nimport numpy as np\n\nimport ray\nfrom ray.experimental.data.block import Block, BlockAccessor, BlockMetadata\nfrom ray.experimental.data.impl.progress_bar import ProgressBar\nfrom ray.experimental.data.impl.block_list import BlockList\nfrom ray.experiment...
[ [ "numpy.random.RandomState" ] ]
ryandesign/yap
[ "9a50d1a3d985ec559ebfbb8e9f4d4c6b88b30214" ]
[ "packages/python/yap_kernel/yap_ipython/core/tests/test_completer.py" ]
[ "# encoding: utf-8\n\"\"\"Tests for the yap_ipython tab-completion machinery.\"\"\"\n\n# Copyright (c) yap_ipython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nimport os\nimport sys\nimport textwrap\nimport unittest\n\nfrom contextlib import contextmanager\n\nimport nose.tools as...
[ [ "pandas.DataFrame", "numpy.array", "numpy.dtype", "numpy.zeros" ] ]
finncatling/lap-risk
[ "afda480bfa42bae0ce25c12129031971e517545f" ]
[ "tests/test_indications.py" ]
[ "from typing import Tuple, List, Set\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom utils import indications\n\n\n@pytest.fixture()\ndef columns_and_indication_subset() -> Tuple[List[str], Set[str]]:\n return (\n [\n 'S03PreOpArterialBloodLactate',\n 'S03PreOpLowes...
[ [ "pandas.DataFrame" ] ]
balbok0/SMPyBandits
[ "35e675bde29dafbec68288fcfcd14ef3b0f058b2" ]
[ "SMPyBandits/Policies/DoublingTrickWrapper.py" ]
[ "# -*- coding: utf-8 -*-\nr\"\"\" A policy that acts as a wrapper on another policy `P`, assumed to be *horizon dependent* (has to known :math:`T`), by implementing a \"doubling trick\":\n\n- starts to assume that :math:`T=T_0=1000`, and run the policy :math:`P(T_0)`, from :math:`t=1` to :math:`t=T_0`,\n- if :math:...
[ [ "numpy.isinf", "numpy.zeros_like", "matplotlib.pyplot.ion", "numpy.isnan", "numpy.log", "numpy.copy", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.diff", "numpy.arange", "matplotlib.pyplot.sh...
wuxinwang1997/wheatdetection
[ "93b928d12ab7f75883c85bf93c4738981fb6af79" ]
[ "evaluate/evaluate.py" ]
[ "# encoding: utf-8\n\"\"\"\n@author: wuxin.wang\n@contact: wuxin.wang@whu.edu.cn\n\"\"\"\nfrom tqdm import tqdm\nimport numpy as np\nfrom .calculate_score import calculate_final_score\n\ndef evaluate(all_predictions):\n best_final_score, best_score_threshold = 0, 0\n for score_threshold in tqdm(np.arange(0, ...
[ [ "numpy.where", "numpy.arange" ] ]
FFroehlich/pysb
[ "d1afd8bed83cc09476ea871ffcc106b18498dc7f" ]
[ "pysb/examples/run_earm_stochkit.py" ]
[ "\"\"\" Run the Extrinsic Apoptosis Reaction Model (EARM) using StochKit's\nstochastic simulation algorithm (SSA) implementation.\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom earm_1_0 import model\nfrom pysb.simulator import StochKitSimulator\n\n\ndef plot_mean_min_max(name, title=None):\n...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspace" ] ]
TymonXie/tymon
[ "1939d2f43e0c75b6fcc3805f37bdb2227bf3f594" ]
[ "tymon/model_hub/time_series/lstm.py" ]
[ "import torch.nn as nn\n\n\n# model\nclass LSTM(nn.Module):\n def __init__(self, in_dim=12, hidden_dim=10, output_dim=12, n_layer=1):\n super(LSTM, self).__init__()\n self.in_dim = in_dim\n self.hidden_dim = hidden_dim\n self.output_dim = output_dim\n self.n_layer = n_layer\n ...
[ [ "torch.nn.Linear", "torch.nn.LSTM" ] ]
Tanveer81/barlow_twins_video
[ "cb0b092971bdd56cc6c58168faf9eb01e0f8c832" ]
[ "yvos_dataset.py" ]
[ "import time\r\nfrom glob import glob\r\nimport os\r\nimport random\r\nimport json\r\nimport numpy as np\r\nimport sys\r\nimport matplotlib.pyplot as plt\r\nfrom torch.utils.data import Dataset\r\nfrom PIL import Image\r\nimport cv2\r\n\r\n\r\ndef generate_barlow_twin_annotations(img_path, meta_path, out_path, fram...
[ [ "numpy.ascontiguousarray", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
getian107/PRScs
[ "36827146c32e1b45972a290b965e621d990142c3" ]
[ "mcmc_gtb.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nMarkov Chain Monte Carlo (MCMC) sampler for polygenic prediction with continuous shrinkage (CS) priors.\n\n\"\"\"\n\n\nimport scipy as sp\nfrom scipy import linalg \nfrom scipy import random\nimport gigrnd\n\n\ndef mcmc(a, b, phi, sst_dict, n, ld_blk, blk_size, n_iter, n_burnin, th...
[ [ "scipy.array", "scipy.zeros", "scipy.random.seed", "scipy.ones", "scipy.linalg.cholesky", "scipy.dot", "scipy.random.gamma", "scipy.diag", "scipy.linalg.solve_triangular", "scipy.sqrt" ] ]
bjfar/JMCtools
[ "f134d2db3bb9c38a61e492a4e776e937519b0eeb" ]
[ "tests/docs_examples/quickstart.py" ]
[ "# make_joint\nimport JMCtools.distributions as jtd\nimport scipy.stats as sps\nimport numpy as np\n\njoint = jtd.JointModel([sps.norm,sps.norm])\n# sample_pdf\nnull_parameters = [{'loc': 3, 'scale': 1}, \n {'loc': 1, 'scale': 2}]\nsamples = joint.rvs((10000,),null_parameters)\n# check_pdf\n# Comp...
[ [ "numpy.histogram", "numpy.ones", "matplotlib.pyplot.figure", "numpy.arange", "numpy.argsort", "numpy.cumsum", "numpy.linspace", "scipy.stats.chi2.pdf", "numpy.meshgrid" ] ]
jzalger/serial-scope
[ "bf1859df8987356eae3aba0f2a352f86cd4ded47" ]
[ "serialscope.py" ]
[ "# This module defines functionality for the deepsix interface device\nimport getopt\nfrom numpy import ceil, mod\nimport serial\nimport pandas as pd\nimport pylab as plt\nfrom sys import argv, exit\nfrom numpy import float64\nfrom serial.serialutil import SerialException\n\n\nclass SerialScope:\n\n def __init__...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
pgmoka/checkout-simulator
[ "bce7e68ba47b9309f19514a9199d43bdbbbc4ffc" ]
[ "fullday_model.py" ]
[ "'''\n-----------------------------------------------------------------------\n Additional Documentation\n\nMade by Zachary A Brader, Kieran Coito, Pedro Goncalves Mokarzel\nwhile attending University of Washington Bothell\nMade in 03/09/2020\nBased on instruction in CSS 458, \ntaught by profes...
[ [ "numpy.sin", "numpy.sum", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.where", "numpy.arange", "numpy.cos", "matplotlib.pyplot.show" ] ]
clausia/qiskit-terra
[ "f4e3d086cf22c40adc14e9313af7b7714cb645d0" ]
[ "test/python/transpiler/test_preset_passmanagers.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.zeros" ] ]
EN1AC13/analytics-zoo
[ "169dac5400f341135b7bf38bb87e3fca89ac09d8", "169dac5400f341135b7bf38bb87e3fca89ac09d8" ]
[ "pyzoo/zoo/examples/orca/learn/horovod/simple_horovod_pytorch.py", "pyzoo/zoo/orca/learn/tf/utils.py" ]
[ "#\n# Copyright 2018 Analytics Zoo 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 applicable ...
[ [ "torch.nn.Linear", "torch.nn.functional.dropout", "torch.nn.functional.log_softmax", "torch.nn.Conv2d", "torch.nn.functional.nll_loss", "torch.nn.Dropout2d" ], [ "tensorflow.dtypes.as_dtype" ] ]
yuhonghong66/defensegan
[ "7e3feaebf7b9bbf08b1364e400119ef596cd78fd" ]
[ "utils/config.py" ]
[ "# Copyright 2018 The Defense-GAN 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 req...
[ [ "tensorflow.app.flags.DEFINE_string" ] ]
h-mayorquin/attractor_sequences
[ "885271f30d73a58a7aad83b55949e4e32ba0b45a" ]
[ "plots/bernstein_capacity_extension_overload_01.py" ]
[ "import sys\nsys.path.append('../')\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\n\nimport seaborn as sns\n\nfrom network import Protocol, BCPNNFast, NetworkManager\nfrom analysis_functions import calculate_recall_success_sequences\nfrom connectivity_...
[ [ "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.min", "matplotlib.pyplot.figure", "numpy.arange" ] ]
equinaut/statsmodels
[ "6fe8d4e351416727641db4c3d3552f4ec4f46d0e" ]
[ "statsmodels/stats/multitest.py" ]
[ "'''Multiple Testing and P-Value Correction\n\n\nAuthor: Josef Perktold\nLicense: BSD-3\n\n'''\n\nfrom statsmodels.compat.python import range\nfrom collections import OrderedDict\nfrom ._knockoff import RegressionFDR\nimport numpy as np\n\n\n#==============================================\n#\n# Part 1: Multiple Tes...
[ [ "numpy.vander", "numpy.minimum", "scipy.stats.distributions.norm.cdf", "numpy.exp", "numpy.min", "numpy.histogram", "numpy.log", "numpy.nonzero", "numpy.take", "numpy.arange", "numpy.sqrt", "scipy.optimize.minimize", "numpy.empty_like", "numpy.flatnonzero", ...