repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
SABS-R3-Epidemiology/branching-process
[ "d7dd5f612c45b280b0b369e8e0391ee6dcd84459" ]
[ "branchpro/data_library/covid_hainan/parse_data.py" ]
[ "#\n# This file is part of BRANCHPRO\n# (https://github.com/SABS-R3-Epidemiology/branchpro.git) which is released\n# under the BSD 3-clause license. See accompanying LICENSE.md for copyright\n# notice and full license details.\n#\n\n\"\"\"Processing script for Hainan, China data from [1]_.\nIt rewrites the data fil...
[ [ "pandas.DataFrame" ] ]
louislva/minihex
[ "c8d0fea1e341d1e061f06f2ec39f99857d20c00e" ]
[ "minihex/HexGame.py" ]
[ "import gym\nfrom gym import spaces\nimport numpy as np\nfrom enum import IntEnum\n\n\nclass player(IntEnum):\n BLACK = 0\n WHITE = 1\n EMPTY = 2\n\n\nclass HexGame(object):\n \"\"\"\n Hex Game Environment.\n \"\"\"\n\n def __init__(self, active_player, board,\n focus_player, co...
[ [ "numpy.arange", "numpy.ones", "numpy.max", "numpy.zeros_like", "numpy.count_nonzero", "numpy.ravel_multi_index", "numpy.zeros" ] ]
ZikangXiong/ToyRLAlgorithms
[ "6b54a3a845fdc227b1fb619f4a682859a36060fc" ]
[ "algorithms/refactor/learning/rewards.py" ]
[ "from typing import Tuple\n\nimport numpy as np\nimport torch as th\n\n\nclass GAE:\n\n def __init__(self, n_workers: int, worker_steps: int, gamma: float, lambda_: float, device: str):\n \"\"\"\n https://nn.labml.ai/rl/ppo/gae.html\n :param n_workers:\n :param worker_steps:\n ...
[ [ "torch.tensor", "numpy.array", "torch.zeros", "torch.logical_not" ] ]
nikhil-garg/Reservoir-Computing-framework-for-multivariate-time-series-classification
[ "99d59a8defb5581604a2662c368751f92879309b" ]
[ "code/modules.py" ]
[ "# General imports\nimport numpy as np\nimport time\nfrom sklearn.linear_model import Ridge\nfrom sklearn.metrics import accuracy_score, f1_score\nfrom sklearn.decomposition import PCA\nfrom sklearn.svm import SVC\nfrom sklearn.neural_network import MLPClassifier\nfrom scipy.spatial.distance import pdist, cdist, sq...
[ [ "sklearn.neural_network.MLPClassifier", "scipy.spatial.distance.cdist", "numpy.concatenate", "sklearn.linear_model.Ridge", "numpy.argmax", "numpy.mean", "scipy.spatial.distance.pdist", "sklearn.svm.SVC", "sklearn.metrics.f1_score", "numpy.exp", "sklearn.decomposition.PC...
jklarson/volttron-applications
[ "159e7ca12e3a7935c7882a29b4d9c720e1c8b689" ]
[ "pnnl/TCM2Agent/tcm2/agent.py" ]
[ "# -*- coding: utf-8 -*- {{{\n# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:\n#\n# Copyright (c) 2015, Battelle Memorial Institute\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n...
[ [ "pandas.merge", "pandas.read_csv", "pandas.to_datetime", "pandas.TimeGrouper", "pandas.DataFrame" ] ]
VictorJiangXin/Linear-CRF
[ "37c6737b573ecc7cfc48075baa23035b4c7a96d0" ]
[ "src/crf.py" ]
[ "# MIT License\n# \n# Copyright (c) 2019 Jiang Xin, jiangxin.hust@foxmail.com\n# \n\n\nimport os\nimport sys\nimport time\n\nimport pickle\nimport codecs\nimport numpy as np\nfrom scipy import optimize\n\n\nclass LinearCRF(object):\n \"\"\"Simple implementation of linear-chain CRF for Chinese word segmentation t...
[ [ "numpy.dot", "scipy.optimize.fmin_l_bfgs_b", "numpy.ones", "numpy.max", "numpy.argmax", "numpy.random.randn", "numpy.exp", "numpy.zeros" ] ]
abhishek2024/Chatbot-Mem2Seq-Knowledge-Base
[ "7ad9fb8c2e70b39ebfcbea659d755d0ee9c2bbf5" ]
[ "models/Mem2Seq.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch.optim import lr_scheduler\nfrom torch import optim\nimport torch.nn.functional as F\nfrom utils.masked_cross_entropy import *\nfrom utils.config import *\nimport random\nimport numpy as np\nimport datetime\nfrom utils.measures imp...
[ [ "torch.nn.Softmax", "torch.LongTensor", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.Tensor", "torch.zeros", "torch.cat", "torch.nn.GRU", "torch.sum", "torch.nn.Embedding", "numpy.ones", "torch.nn.Linear", "numpy.transpose", "numpy.array", "torch.nn....
Wentzell/libdlr
[ "69906bed4f4619e9e685af9f2c15943fa8b5f398" ]
[ "pydlr/kernel_fortran.py" ]
[ "\"\"\"Python wrapper module for dlrcode \n\nCopyright 2021 Hugo U.R. Strand\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\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless require...
[ [ "numpy.eye", "numpy.argwhere", "numpy.zeros_like", "numpy.triu", "numpy.tril" ] ]
MichalisLazarou/pytorch-meta
[ "96ad5703414ef983b56d3c396a944829707ff076" ]
[ "torchmeta/transforms/categorical.py" ]
[ "import torch\nfrom torchmeta.transforms.utils import apply_wrapper\nfrom collections import defaultdict\n\n\nclass Categorical(object):\n \"\"\"Target transform to return labels in `[0, num_classes)`.\n\n Parameters\n ----------\n num_classes : int, optional\n Number of classes. If `None`, then ...
[ [ "torch.randperm" ] ]
tinabd14/TrackR-CNN
[ "68fbd2aaf4feaf078651b7229c9bec9bc20bb0df" ]
[ "datasets/KITTI/segtrack/KITTI_segtrack.py" ]
[ "import glob\nimport tensorflow as tf\n\nfrom datasets.DetectionDataset import MapillaryLikeDetectionFileListDataset\nfrom datasets.KITTI.segtrack.KITTI_MOTS_info import SEQ_IDS_TRAIN, SEQ_IDS_VAL\nfrom datasets.Loader import register_dataset\nfrom datasets.util.Util import username\nfrom datasets import DataKeys\n...
[ [ "tensorflow.reduce_any", "tensorflow.stack", "tensorflow.py_func" ] ]
dbogatov/embedding-tests
[ "1d4d32c9c3aa5fe9f3d35ff456c030591fb8e855" ]
[ "data/mimic.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.asarray", "numpy.random.shuffle", "numpy.random.seed" ] ]
dykestra/menpo
[ "3a4690f991003a8706028ddb898493ac5b53418e", "3a4690f991003a8706028ddb898493ac5b53418e" ]
[ "menpo/math/test/decomposition_base_test.py", "menpo/transform/piecewiseaffine/base.py" ]
[ "import numpy as np\nfrom numpy.testing import assert_almost_equal\nfrom menpo.math import eigenvalue_decomposition, pca, ipca\n\n# Positive semi-definite matrix\ncov_matrix = np.array([[3, 1], [1, 3]])\n# Data values taken from:\n# http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf\n# Tes...
[ [ "numpy.sqrt", "numpy.abs", "numpy.testing.assert_almost_equal", "numpy.array", "numpy.zeros", "numpy.vstack" ], [ "numpy.hstack", "numpy.einsum", "numpy.nonzero", "numpy.arange", "numpy.all", "numpy.any", "numpy.require", "numpy.transpose", "numpy.lo...
matinaghaei/Stock-Trading-ActorCriticRL
[ "8876eacb6d2ba09f3f80792c82fe6fb6e4ffda29" ]
[ "algorithms/ddpg/ddpg.py" ]
[ "from env.environment import PortfolioEnv\nfrom algorithms.ddpg.agent import Agent\nimport numpy as np\nfrom plot import add_curve, add_hline, save_plot\nimport os\nimport pandas as pd\nfrom pyfolio import timeseries\n\n\nclass DDPG:\n\n def __init__(self, load=False, alpha=0.000025, beta=0.00025, tau=0.001,\n ...
[ [ "pandas.Series", "numpy.random.seed" ] ]
Asif54321/pynwb
[ "e484bfd0208a9777bc6c45e44a4cfa3a900cffe3" ]
[ "docs/gallery/general/object_id.py" ]
[ "\"\"\"\n.. _object_ids:\n\nObject IDs in NWB\n=================\n\nThis example focuses on how to access object IDs from NWB container objects and NWB container objects by\nobject ID. Every NWB container object has an object ID that is a UUID_ string, such as\n\"123e4567-e89b-12d3-a456-426655440000\". These IDs ha...
[ [ "numpy.cos", "numpy.linspace", "numpy.sin" ] ]
vzinche/inferno
[ "91b22dfcd1b6a9ec415f0bbb6ae66caea42f4034" ]
[ "inferno/io/transform/generic.py" ]
[ "import numpy as np\nimport torch\nfrom scipy.stats import median_absolute_deviation\nfrom .base import Transform, DTypeMapping\nfrom ...utils.exceptions import assert_, DTypeError\n\n\nclass Normalize(Transform):\n \"\"\"Normalizes input to zero mean unit variance.\"\"\"\n def __init__(self, eps=1e-4, mean=N...
[ [ "numpy.clip", "numpy.asarray", "numpy.arange", "numpy.median", "torch.from_numpy", "scipy.stats.median_absolute_deviation", "numpy.zeros_like", "numpy.equal" ] ]
laureho/arboretum
[ "b011dc5b5cf54340a06925d0420985444358df86" ]
[ "arboretum/io.py" ]
[ "import numpy as np\nimport btrack\n\n\n\nclass TrackerFrozenState:\n \"\"\" Capture the Tracker state at the end of tracking \"\"\"\n def __init__(self):\n self.objects = None\n self.tracks = None\n self.lbep = None\n self.refs = None\n self.dummies = None\n\n def set(se...
[ [ "numpy.max", "numpy.zeros" ] ]
Patabu2/extended-semi-siamese-unet
[ "e20d36abeaffe0c2d856fbe757a142f75380c446" ]
[ "models/u_net_ext_semi_siam_3_channels.py" ]
[ "import tensorflow as tf\n\nfrom tensorflow.keras import Model\n\nfrom tensorflow.keras.layers import Conv2D, MaxPooling2D, UpSampling2D, Concatenate, Dropout, BatchNormalization, ReLU, Add\n\n\n#--------------------------------------------------------------------------------\n# Encoding block\n#-------------------...
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.UpSampling2D", "tensorflow.where", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.MaxPooling2D" ] ]
SpiritedAwayCN/AIintro-GiveMeSomeCredit
[ "c73288c8eebd6ea7122bf5ab70be23766bc7647b" ]
[ "utils/draw.py" ]
[ "# 画图\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.transforms as trs\nimport math\nimport seaborn\n\ndata = pd.read_csv('cs-training.csv', index_col=0)\ndata.drop_duplicates(inplace=True)\n\ndata.boxplot(column=['NumberOfTime30-59DaysPastDueNotWorse',\n ...
[ [ "matplotlib.transforms.Bbox", "numpy.log", "pandas.read_csv", "matplotlib.pyplot.title", "numpy.isfinite", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplot", "matplotlib.pyplot.close", "matplotlib.pyplot.yticks", "matplotlib.pyplot.s...
lebr0nli/ncu-schedule2ics
[ "fdf8e8adf6965b29494486f5688b658d5007f83c" ]
[ "main.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Sep 13 22:00:49 2020\n\n@author: AlanLi\n\"\"\"\n\nimport pandas as pd\nfrom datetime import datetime, timedelta\nimport re\nfrom icalendar import Calendar, Event, Alarm\nimport requests\nimport configparser\n\nlogin_url = \"https://cis.ncu.ed...
[ [ "pandas.read_html" ] ]
toxidol/MLSP-FA2021
[ "3109e62f00d6f16e410f4eae341df2e027ee9cc3" ]
[ "calc_snr.py" ]
[ "\"\"\"\nInstall pysepm as follows:\n pip3 install https://github.com/schmiph2/pysepm/archive/master.zip\n\"\"\"\n\nimport soundfile as sf\nimport pysepm\nimport numpy as np\n\n\nif __name__ == '__main__':\n clean_speech, fs = sf.read('eval/SA1_clean.wav')\n noisy_speech, fs = sf.read('eval/SA1_noisy.wav')...
[ [ "numpy.abs" ] ]
mskinner5278/lsdc
[ "7f8aec813c7f2b3a49f152aac66a06fcb688b453" ]
[ "lsdcGui.py" ]
[ "\"\"\"\nThe GUI for the LSDC system\n\"\"\"\nimport sys\nimport os\nimport string\nimport math\nimport urllib\nimport urllib.request\nfrom io import BytesIO\nfrom epics import PV\nfrom qtpy import QtWidgets\nfrom qtpy import QtCore\nfrom qtpy import QtGui\nfrom qtpy.QtCore import * \nfrom qtpy.QtGui import * \nQSt...
[ [ "numpy.amin", "numpy.amax", "numpy.zeros" ] ]
andrasormos/A3C_Keras_FlappyBird
[ "9b3fb805653e628a37c730eb707dbf4af392654a" ]
[ "test.py" ]
[ "import numpy as np\nimport sys\n\nsys.path.append(\"game/\")\n\nimport pygame\nimport wrapped_flappy_bird as game\n\nimport skimage\nfrom skimage import transform, color, exposure\n\nimport keras\nfrom keras.models import Sequential, Model, load_model\nfrom keras.layers.core import Dense, Flatten, Activation\nfrom...
[ [ "numpy.random.random", "pandas.DataFrame", "numpy.concatenate", "numpy.append", "numpy.random.rand" ] ]
starimeL/PytorchConverter
[ "75fbdb3d52da9ee64db509ecdf221dd102402579" ]
[ "code/ReplaceDenormals.py" ]
[ "import numpy as np\nimport torch\n\n\ndef ReplaceDenormals(net):\n for name, param in net.named_parameters():\n np_arr = param.data.numpy()\n for x in np.nditer(np_arr, op_flags=['readwrite']):\n if abs(x) < 1e-30:\n x[...] = 1e-30\n param.data = torch.from_numpy(n...
[ [ "torch.from_numpy", "numpy.nditer" ] ]
peterhan91/Throax_GAN
[ "739dd4d7885d73b651ef13f9336f6a46a4b9f56f" ]
[ "ProGAN/train.py" ]
[ "# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# This work is licensed under the Creative Commons Attribution-NonCommercial\n# 4.0 International License. To view a copy of this license, visit\n# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to\n# Creative Commons, PO Box 1866,...
[ [ "tensorflow.device", "tensorflow.control_dependencies", "tensorflow.cast", "tensorflow.get_default_graph", "numpy.clip", "tensorflow.floor", "numpy.ceil", "tensorflow.name_scope", "numpy.zeros", "tensorflow.tile", "tensorflow.reverse", "tensorflow.shape", "tenso...
TRex22/vector-AI-ML-term_project
[ "70d1cab20966c9c71e38a2f471d60628396c8e5a" ]
[ "src/ann.py" ]
[ "# Jason Chalom 711985 May 2017\n# Artificial Neural Network helper functions for vector AI\n\nimport numpy as np\nimport utils as u\nimport tic_tac_toe as game\n\ndef determine_xy(output_layer, b_s):\n\tsize = output_layer.shape[0]\n\t# print(output_layer)\n\tmax = -1;\n\tidex = -1;\n\tfor i in range(size):\n\t\ti...
[ [ "numpy.dot", "numpy.hstack", "numpy.load", "numpy.exp", "numpy.vstack" ] ]
augustoolucas/iCaRL
[ "90ac1be39c9e055d9dd2fa1b679c0cfb8cf7335a" ]
[ "iCaRL-Tensorflow/utils_resnet.py" ]
[ "import tensorflow as tf\nimport numpy as np\ntry:\n import cPickle\nexcept:\n import _pickle as cPickle\n\n\ndef relu(x, name, alpha):\n if alpha > 0:\n return tf.maximum(alpha * x, x, name=name)\n else:\n return tf.nn.relu(x, name=name)\n\n\ndef get_variable(name, shape, dtype, initializ...
[ [ "tensorflow.device", "tensorflow.get_variable", "tensorflow.control_dependencies", "tensorflow.nn.max_pool", "tensorflow.reduce_sum", "tensorflow.nn.atrous_conv2d", "tensorflow.nn.conv2d", "tensorflow.get_collection", "tensorflow.nn.moments", "tensorflow.nn.batch_normalizat...
naveednilawfar/DroidCC
[ "68cd9cf369a223767513278b9780b35c2b92aeb9" ]
[ "code/droidcc/model_train/train_dbn.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 2018/3/30 13:52\n\n@file: train_dbn.py\n@author: Qingyu Mao\n\"\"\"\nimport numpy as np\nfrom sklearn.metrics import confusion_matrix, classification_report, roc_auc_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics.classification import a...
[ [ "sklearn.metrics.roc_auc_score", "pandas.read_csv", "numpy.random.seed", "sklearn.metrics.confusion_matrix", "sklearn.model_selection.train_test_split", "sklearn.metrics.classification.accuracy_score", "sklearn.metrics.classification_report" ] ]
maxpark/PaddleSlim
[ "f6b827fca5f3d9cc467426b8ef30e3a6d2b012b9" ]
[ "demo/dygraph/pruning/imagenet.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.array" ] ]
Jelly6489/Stock-Proj
[ "3e7b1ad5cddc5b142f0069e024199fe969c7c7e8" ]
[ "com_blacktensor/cop/emo/model/emotion_dfo.py" ]
[ "import requests\nimport pandas as pd\nimport codecs\nimport numpy as np\nimport re\nfrom bs4 import BeautifulSoup\nfrom konlpy.tag import Twitter\nfrom collections import Counter\n\n# from sqlalchemy import Column, Integer, String, Date\n# # from sqlalchemy import create_engine\n\nfrom com_blacktensor.util.file_ha...
[ [ "pandas.concat" ] ]
martinsbruveris/pytorch-image-models
[ "65419f60cc389f197ed555e1fc3b7f986708a683" ]
[ "timm/models/resnet.py" ]
[ "\"\"\"PyTorch ResNet\n\nThis started as a copy of https://github.com/pytorch/vision 'resnet.py' (BSD-3-Clause) with\nadditional dropout and dynamic global avg/max pool.\n\nResNeXt, SE-ResNeXt, SENet, and MXNet Gluon stem/downsample variants, tiered stems added by Ross Wightman\nCopyright 2020 Ross Wightman\n\"\"\"...
[ [ "torch.nn.Sequential", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Identity", "torch.nn.init.ones_", "torch.nn.init.zeros_", "torch.nn.init.kaiming_normal_" ] ]
ngailapdi/LWF
[ "7b7a87db3d80e25cfe8590b4135a5ee25c1f2707" ]
[ "data_loader.py" ]
[ "from torchvision.datasets import CIFAR10\nimport torchvision.transforms as transforms\nimport numpy as np\nimport torch\nfrom PIL import Image\nimport cv2\nimport time\n\nclass cifar10(CIFAR10):\n\tdef __init__(self, root,\n\t\t\t\t classes=range(10),\n\t\t\t\t train=True,\n\t\t\t\t transform=None,\n\t\t\t\t targe...
[ [ "numpy.pad", "torch.FloatTensor", "numpy.random.random_integers", "numpy.mean", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
rishabh-jha101/Character-level-rnn-trained-on-Tolstoy-s-Anna-Karenina
[ "9cee2b8d7c89a8b9b65831a9e354405add97bc18" ]
[ "get_batches.py" ]
[ "import numpy as np\n\ndef get_batches(arr, batch_size, seq_length):\n '''Create a generator that returns batches of size\n batch_size x seq_length from arr.\n\n Arguments\n ---------\n arr: Array you want to make batches from\n batch_size: Batch size, the number of sequences per ba...
[ [ "numpy.zeros_like" ] ]
Open-Catalyst-Project/baselines
[ "5a664501d2eff24d362b6f1ea504300705c481ac" ]
[ "ocpmodels/common/utils.py" ]
[ "\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n\"\"\"\n\nimport ast\nimport collections\nimport copy\nimport glob\nimport importlib\nimport itertools\nimport json\nimport logging\n...
[ [ "torch.all", "torch.transpose", "torch.zeros", "torch.cat", "torch.sum", "torch.le", "torch.repeat_interleave", "torch.nn.PairwiseDistance", "torch.logical_and", "torch.save", "torch.norm", "torch.cumsum", "matplotlib.backends.backend_agg.FigureCanvasAgg", "...
yenchenlin/pix2pix-flow
[ "c3536b4f9d676c1780fb59dbc77aec3c6435a65d" ]
[ "data_loaders/get_edges_shoes_joint.py" ]
[ "import numpy as np\nimport os\n\n\ndef downsample(x, resolution):\n assert x.dtype == np.float32\n assert x.shape[1] % resolution == 0\n assert x.shape[2] % resolution == 0\n if x.shape[1] == x.shape[2] == resolution:\n return x\n s = x.shape\n x = np.reshape(x, [s[0], resolution, s[1] // ...
[ [ "numpy.reshape", "numpy.squeeze", "numpy.concatenate", "numpy.ceil", "numpy.mean", "numpy.floor", "numpy.zeros" ] ]
kent1325/Python_Crash_Course_Book_Projects
[ "1fd108139b79660f5f089bf2aba807cd54168fb2" ]
[ "data_visualization/death_valley_weather.py" ]
[ "import csv\nimport matplotlib.pyplot as plt\nfrom datetime import datetime\n\nfilename = 'data/death_valley_2018_simple.csv'\nwith open(filename) as f:\n reader = csv.reader(f)\n header_row = next(reader)\n\n # Get high temperatures from this file.\n dates, highs, lows = [], [], []\n for row in read...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.style.use", "matplotlib.pyplot.ylabel" ] ]
rhullcsa/RunestoneServer
[ "db1ad6078f855a058e735bdbc6c1f130f1a34ee7" ]
[ "controllers/admin.py" ]
[ "# *******************************\n# |docname| - route to a textbook\n# *******************************\n# This controller provides routes to admin functions\n#\n# Imports\n# =======\n# These are listed in the order prescribed by `PEP 8\n# <http://www.python.org/dev/peps/pep-0008/#imports>`_.\n#\n# Standard librar...
[ [ "pandas.concat" ] ]
makr3la/regression
[ "7c402d7c044d6ed1d2b0c04e60134bb668acb0e7" ]
[ "tests/test_regression.py" ]
[ "from io import BytesIO\nimport os\nimport subprocess\n\nimport numpy as np\nimport pandas as pd\n\nfrom regression import app\nfrom regression import processing as lib\n\n\ndef test_lib():\n alfa, beta, n = np.random.normal(), np.random.normal(), 50\n noise = np.random.normal(0, 3, n)\n X = np.linspace(-1...
[ [ "numpy.linspace", "numpy.random.choice", "numpy.isclose", "pandas.DataFrame", "numpy.random.normal", "numpy.random.randint" ] ]
sharique1006/Gaussian-Discriminant-Analysis
[ "4cbc707b5d9f9372f35d713980428113d6ec8d2c" ]
[ "Q4b.py" ]
[ "import numpy as np\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nfrom mpl_toolkits.mplot3d import Axes3D\nimport math\nimport sys\nimport os\n\ndata_dir = sys.argv[1]\nout_dir = sys.argv[2]\ndataX = os.path.join(sys.argv[1], 'q4x.dat')\ndataY = os.path.join(...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.std", "numpy.mean", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "numpy.array", "numpy.where", "numpy.loadtxt", "matp...
gronki/slezanbear
[ "f3d6203036fa664c0f1bec4b0fdca59605ee416e" ]
[ "data/plotmodel.py" ]
[ "# coding: utf-8\nimport gdal\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sys import argv\nfrom re import match, sub\n\ni2m = lambda i: 5.5 - 2.5 * np.log10(i)\nm2i = lambda m: 10 ** ((5.5 - m) / 2.5)\n\ncolors = [\n (18.000, '#FFFFFF'),\n (19.400, '#D2613D'),\n (20.200, '#FFDE00'),\n (20...
[ [ "numpy.linspace", "numpy.arange", "matplotlib.colors.LinearSegmentedColormap", "matplotlib.pyplot.subplots", "numpy.cos", "matplotlib.pyplot.colorbar", "numpy.log10", "numpy.array" ] ]
JonathanDHarris/skypy
[ "08b4406a54fbc8ac89b6316544a57e8952e3b2bd" ]
[ "skypy/galaxy/_spectrum_loaders.py" ]
[ "'''Implementations for spectrum loaders.'''\n\nimport numpy as np\nimport specutils\nimport astropy.utils.data\nimport astropy.table\nfrom astropy import __version__ as astropy_version\nfrom astropy import units\n\nimport os\nimport urllib\nfrom pkg_resources import resource_filename\n\n\ndef download_file(url, ca...
[ [ "numpy.concatenate", "numpy.atleast_2d", "numpy.squeeze", "numpy.allclose" ] ]
Neil0406/Flask-echart
[ "54ffb3797b995889dd52e56bc4488f9a00318598" ]
[ "test.py" ]
[ "import pymysql\nimport pandas as pd\n\nMYSQL_HOST = 'localhost'\nMYSQL_DB = 'neildb'\nMYSQL_USER = 'root'\nMYSQL_PASS = 'root'\n\ndef connect_mysql(): #連線資料庫\n global connect, cursor\n connect = pymysql.connect(host = MYSQL_HOST, db = MYSQL_DB, user = MYSQL_USER, password = MYSQL_PASS,\n charset ...
[ [ "pandas.read_sql" ] ]
bkalita-git/nn_seq2seq_transformer
[ "b394bb2b5d6f167c2d4d5c582d1cf5d260841688" ]
[ "attention1.py" ]
[ "import torch\nimport loader1\nimport pickle\nembedding_size = 10\nencoder_file = \"encoder\"\ndecoder_file = \"decoder\"\nencoder_max_len = 6\ndecoder_max_len = 7\nnum_lines = 6\nbatch_size = 3\nnum_layers = 4\nld = loader1.load(encoder_file,encoder_max_len,decoder_file,decoder_max_len,num_lines,batch_size)\nclass...
[ [ "torch.nn.Softmax", "torch.nn.CrossEntropyLoss", "torch.nn.LSTM", "torch.cat", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.Linear", "torch.nn.utils.rnn.PackedSequence", "torch.nn.utils.rnn.pad_packed_sequence" ] ]
Virginiaxu/DeepMosaic
[ "fe5bf9b98e36f0b9ef6bb88345d4afaa55054e96" ]
[ "deepmosaic/canvasPainter.py" ]
[ "import numpy as np\n\nMAX_DP = 500\nWIDTH = 300\n\ndef strand_to_index(reverse=False):\n if reverse:\n return 100\n else:\n return 200\n\ndef base_to_index(base):\n if base == \"A\":\n return 50\n elif base == \"C\":\n return 100\n elif base == \"G\":\n return 150\...
[ [ "numpy.zeros" ] ]
Anonymous502/siamfda-for-eccv
[ "72dff5c174b7ebe30c59a6e21bb6f06fdb06c3fb" ]
[ "SiamFDA/utils/lr_scheduler.py" ]
[ "# Copyright (c) SenseTime. All Rights Reserved.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport math\n\nimport numpy as np\nfrom torch.optim.lr_scheduler import _LRScheduler\n\nfrom SiamFDA.core.con...
[ [ "numpy.linspace", "numpy.arange", "torch.nn.Conv2d", "numpy.cos", "numpy.concatenate", "torch.optim.SGD", "numpy.array" ] ]
ayasyrev/model_constructor
[ "3759a02dd9f7aa1ca3e6a4a5aefe72380886207e" ]
[ "model_constructor/yaresnet.py" ]
[ "# YaResBlock - former NewResBlock.\n# Yet another ResNet.\n\nimport torch.nn as nn\nfrom functools import partial\nfrom collections import OrderedDict\nfrom .layers import SEModule, ConvLayer, act_fn, noop, SimpleSelfAttention\nfrom .net import Net\nfrom torch.nn import Mish\n\n\n__all__ = ['YaResBlock', 'yaresnet...
[ [ "torch.nn.Mish", "torch.nn.AvgPool2d" ] ]
ersince76/derinogrenme_giris
[ "69790997622c957e40c2baf9faccfd3b658d5a40" ]
[ "ikili_metin_siniflandirma/binary_classification_birgun_karar_u1.py" ]
[ "\"\"\"\nGuncelleme 1, \nStandardScaler ve Pipeline\n\"\"\"\n\nimport preprocess_util\nimport numpy as np\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.wrappers.scikit_learn import KerasClassifier\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.preprocessing imp...
[ [ "sklearn.model_selection.cross_val_score", "numpy.random.seed", "sklearn.pipeline.Pipeline", "sklearn.model_selection.StratifiedKFold", "sklearn.preprocessing.StandardScaler", "sklearn.preprocessing.LabelEncoder" ] ]
packetChor/Intracity-Fare-Estimation
[ "2ca3e477dac6af48015bc568ff20988bd51498e4" ]
[ "notebooks_&_scripts/Driver.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn import neural_network\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import r2_score\nfrom sklearn.model_selection import train_test_split\n# from sklearn.model_selection import GridSearchCV\n\n\ndef testRUN_crCsv(X, y, ann):\n scale...
[ [ "pandas.read_csv", "sklearn.metrics.r2_score", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "numpy.concatenate", "sklearn.preprocessing.StandardScaler", "numpy.array", "sklearn.neural_network.MLPRegressor" ] ]
numagic/lumos
[ "f729354613fec84957384323da6d0b69e00ed7cc" ]
[ "lumos/models/tree_utils.py" ]
[ "from __future__ import annotations # Cyclic referencing of types\n\nfrom copy import deepcopy\nfrom typing import Any, Dict\nfrom jax.tree_util import register_pytree_node_class\n\nimport numpy as np\nimport casadi as cas\n\n\"\"\"\nNOTE:\n- we chose not to use existing 3rd party tree library yet, because it does...
[ [ "numpy.hstack", "numpy.split", "numpy.cumsum", "numpy.size", "numpy.shape", "numpy.ravel", "numpy.array" ] ]
Rested/mutualism-visualisation
[ "b1223afebd688a7b1b8226dc5e56abb348a6dc16" ]
[ "core/maths.py" ]
[ "import numpy as np\n\n\ndef dX_dt(X, t=0, **params):\n animal, plant = X\n return np.array(\n [\n (params[\"r1\"] + (params[\"b12\"] * animal)) * plant\n - (\n (params[\"alpha1\"] + (params[\"c1\"] * params[\"b12\"] * animal))\n * (plant ** 2)\n ...
[ [ "numpy.roots", "numpy.array" ] ]
ethereum-ninja/statistical_analysis_toolkit
[ "6ebf6dc0093b85e555a6ca8de4eb73e57d4bc70b" ]
[ "statistical_analysis_toolkit.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\nget_ipython().run_line_magic('matplotlib', 'inline')\n\n\n# In[ ]:\n\n\ndef strength_of_evidence(p_value, alpha=0.05):\n assert(p_value == abs(p_value)) ...
[ [ "scipy.stats.chi2.ppf", "scipy.stats.norm.ppf", "pandas.concat", "numpy.log", "pandas.Series", "numpy.linspace", "scipy.stats.norm.pdf", "scipy.stats.norm.cdf", "numpy.isnan", "matplotlib.pyplot.subplots", "scipy.stats.t.ppf", "scipy.stats.norm", "scipy.stats.pr...
ArjunNarayanan/DeepEdgeFlip
[ "d849c06a37ca861ee2cfc0b68fb02745643e2c88" ]
[ "ValueFunction/test_gcnconv.py" ]
[ "import torch\nfrom torch.nn import ReLU\nfrom torch_geometric.nn import GCNConv, Sequential, global_add_pool\nimport torch.optim as optim\nimport load_graphs\nimport numpy as np\n\n\nclass GCN(torch.nn.Module):\n def __init__(self, arch):\n super().__init__()\n self.gcn = make_network(arch)\n\n ...
[ [ "torch.no_grad", "numpy.count_nonzero", "torch.nn.ReLU", "numpy.zeros", "torch.nn.MSELoss" ] ]
neumannd/compliance-checker
[ "58262b23b6b138c656ef3e10b75306b700b9a71f" ]
[ "compliance_checker/cf/cf.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport logging\nimport os\nimport sqlite3\nimport sys\n\nfrom collections import OrderedDict, defaultdict\nfrom functools import wraps\nfrom warnings import warn\n\nimport numpy as np\nimport pyproj\nimport regex\n\nfrom cf_units import Unit\n\nfrom compliance_checke...
[ [ "numpy.isnan", "numpy.ma.isMA", "numpy.issubdtype", "numpy.dtype" ] ]
stuart-knock/bokeh
[ "b609e8a458701c246e8f3102c3dce45692b54fe4" ]
[ "bokeh/server/blaze/views.py" ]
[ "from __future__ import absolute_import\n\nimport datetime as dt\n\nimport pandas as pd\nimport numpy as np\nfrom blaze import into\nfrom flask import request\nfrom six import iteritems\n\nfrom ..app import bokeh_app\nfrom ... import protocol\nfrom ...transforms import line_downsample\nfrom ...transforms import ima...
[ [ "numpy.array", "numpy.linspace" ] ]
victorlifan/msds689
[ "d1c45bec1c5e00a6892316eaac9421d514afb96d" ]
[ "projects/iforest/savecancer.py" ]
[ "from sklearn.datasets import load_breast_cancer\nimport pandas as pd\n\ncancer = load_breast_cancer()\ndf = pd.DataFrame(data=cancer.data, columns=cancer.feature_names)\ndf['diagnosis'] = cancer.target\ndf.loc[df.diagnosis==0,'diagnosis'] = -1\ndf.loc[df.diagnosis==1,'diagnosis'] = 0\ndf.loc[df.diagnosis==-1,'diag...
[ [ "sklearn.datasets.load_breast_cancer", "pandas.DataFrame" ] ]
LoremasterLH/MatlabToPython
[ "bdfd827d7fc143332e3945fc980e915c6324eb6c" ]
[ "1-Vzorcenje/ukazi.py" ]
[ "# Author: Martin Konečnik\n# Contact: martin.konecnik@gmail.com\n# Licenced under MIT\n\n# 1-Vzorčenje\n# Predlagan IDE PyCharm Community Edition (na voljo za Windows, macOS in Linux)\n# https://www.jetbrains.com/pycharm/download\n# Navodila za pridobitev potrebnih knjižnic:\n# https://www.jetbrains.com/help/pycha...
[ [ "numpy.dot", "matplotlib.pyplot.imshow", "numpy.ndarray", "matplotlib.pyplot.plot", "numpy.concatenate", "numpy.round", "numpy.double", "numpy.roll", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.uint8", "matplotlib.pyplot.subplot", "matplotlib.pyplot...
brianWeng0223/toad
[ "9aa755273c8fc055c8a244f244e5437c189aa884" ]
[ "toad/nn/zoo/autoencoder_test.py" ]
[ "import sys\nimport torch\nimport pytest\nimport numpy as np\nfrom torch.utils.data import TensorDataset, DataLoader\n\nfrom .autoencoder import BaseAutoEncoder, VAE\n\n# skip testing with python 3.9 on linux\nif sys.version_info >= (3, 9) and sys.platform.startswith('linux'):\n pytest.skip(\"failed with python ...
[ [ "torch.utils.data.DataLoader", "numpy.random.rand" ] ]
fujikosu/tf-object-dection-DSVM
[ "a5fd231944e410ce16ad98d20b74fb02166051cd" ]
[ "object_detection/workaround/tfexample_decoder.py" ]
[ "import tensorflow as tf\n\nfrom tensorflow.python.framework import sparse_tensor\nfrom tensorflow.python.ops import array_ops\nfrom tensorflow.python.ops import control_flow_ops\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.ops import sparse_ops\n\nItemHandler = tf.contrib.slim.tfexample_deco...
[ [ "tensorflow.python.ops.array_ops.shape", "tensorflow.python.ops.array_ops.stack", "tensorflow.python.ops.array_ops.reshape", "tensorflow.python.ops.sparse_ops.sparse_tensor_to_dense", "tensorflow.python.ops.sparse_ops.sparse_reshape" ] ]
iz4vve-talks/misc-training
[ "4f676080e54539cbaf283e611278fdd5d7ef93c4" ]
[ "python-structures-presentation/code/bad_code.py" ]
[ "#!/usr/bin/env python\nimport time\nstart = time.time()\n# START OMIT\nimport numpy as np\n\ncounter = [['yes', 0], ['no', 0]]\nbig_list = np.random.randint(0, 10000, 10000000)\ncheck_list = np.random.randint(0, 99999, 1000)\n\nfor number in check_list:\n if number in big_list:\n counter[0][1] = counter[...
[ [ "numpy.random.randint" ] ]
karthikchary/ga-learner-dst-repo
[ "99b52f4b00cdc9012850b18a096c6a9217c56eb0" ]
[ "Make-sense-of-census/code.py" ]
[ "# --------------\n# Importing header files\r\nimport numpy as np\r\nimport warnings\r\n\r\nwarnings.filterwarnings('ignore')\r\n#path='subset_1000.csv'\r\n#New record\r\nnew_record=[[50, 9, 4, 1, 0, 0, 40, 0]]\r\n\r\n#Reading file\r\ndata = np.genfromtxt(path, delimiter=\",\", skip_header=1)\r\n\r\n#Code sta...
[ [ "numpy.concatenate", "numpy.std", "numpy.mean", "numpy.genfromtxt" ] ]
pchandrasekaran1595/Anime-Cartoon-Image-Classification
[ "541effbe8eb64e454262ffd7e33862bf38d81e39" ]
[ "CLI/utils.py" ]
[ "import os\nimport re\nimport cv2\nimport json\nimport torch\nimport imgaug\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom time import time\nfrom imgaug import augmenters\nfrom torchvision import transforms\nfrom torch.utils.data import Dataset\nfrom torch.utils.data import DataLoader as DL\nfrom skle...
[ [ "matplotlib.pyplot.legend", "torch.load", "torch.utils.data.DataLoader", "sklearn.model_selection.KFold", "matplotlib.pyplot.plot", "torch.nn.BCEWithLogitsLoss", "torch.set_grad_enabled", "torch.no_grad", "torch.FloatTensor", "torch.cuda.is_available", "matplotlib.pyplo...
ispmor/trabajo-fin-de-grado
[ "65f761b343b02ec3e4b4f3f5eee7494958b0b396" ]
[ "nbeats_additional_functions.py" ]
[ "import os\nimport wfdb\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\n\nimport torch\nfrom torch.nn import functional as F\n\n\ndef plot_scatter(*args, **kwargs):\n plt.plot(*args, **kwargs)\n plt.scatter(*args, **kwargs)\n\n\ndef data_generator(x,...
[ [ "matplotlib.pyplot.scatter", "sklearn.model_selection.train_test_split", "torch.tensor", "matplotlib.pyplot.plot", "numpy.max", "torch.no_grad", "torch.device", "numpy.array" ] ]
MehnaazAsad/RESOLVE_Statistics
[ "a7bdcc896ca2c51ab3417c46f07efe8c16825597" ]
[ "src/data/smf_bmf_data.py" ]
[ "\"\"\"\n{This script plots SMF and BMF from all 3 surveys}\n\"\"\"\n\n# Libs\nfrom cosmo_utils.utils.stats_funcs import Stats_one_arr\nfrom cosmo_utils.utils import work_paths as cwpaths\nfrom collections import OrderedDict\nimport matplotlib.pyplot as plt\nfrom matplotlib import rc\nimport pandas as pd\nimport nu...
[ [ "matplotlib.pyplot.gca", "pandas.read_csv", "numpy.sqrt", "numpy.linspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.yscale", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "numpy.log10", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.xlabel", "matp...
kiranrraj/100Days_Of_Coding
[ "ab75d83be9be87fb7bc83a3f3b72a4638dab22a1" ]
[ "Day_63/pie_chart.py" ]
[ "# Title : Pie chart\n# Author : Kiran Raj R.\n# Date : 19/11/2020\n\nimport matplotlib.pyplot as pp\n\nweek = [1, 2, 3, 4, 5, 6]\nexpence = [9, 8, 6, 4, 10, 7]\ncols = ['r','y','g','b','m','c']\n\nsection = [\"Food \", \"Recharge\", \"Electricity\", \"Water\", \"Loan\", \"Petrol\"]\n\npp.pie(week, \n lab...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.pie", "matplotlib.pyplot.show" ] ]
hotmailbox/Structural-Engineering
[ "f34dcaec728fbb3e3a05c6f29ed5dabc621550cb" ]
[ "Code/snow_drift_by_polygons.py" ]
[ "'''\r\nBSD 3-Clause License\r\nCopyright (c) 2019, Donald N. Bockoven III\r\nAll rights reserved.\r\nRedistribution and use in source and binary forms, with or without\r\nmodification, are permitted provided that the following conditions are met:\r\n* Redistributions of source code must retain the above copyright ...
[ [ "numpy.array" ] ]
Dodo33/alchemist-lib
[ "40c2d3b48d5f46315eb09e7f572d578b7e5324b4" ]
[ "alchemist_lib/datafeed/__init__.py" ]
[ "import datetime as dt\n\nimport pandas as pd\n\nfrom .poloniexdatafeed import PoloniexDataFeed\nfrom .bittrexdatafeed import BittrexDataFeed\n\nfrom ..database.ohlcv import Ohlcv\n\nfrom .. import utils\n\n\n\ndef get_data_sources_dict(session):\n\n \"\"\"\n Remember to change this method every time you add ...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
FredeJ/CSIKit
[ "5ce1b114be3d8b24a05576e5345ef43c9e5cd136" ]
[ "CSIKit/legacy/realtime_graph.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nfrom filters import hampel, running_mean, running_stdev, bandpass\nfrom matlab import db, variance\nfrom read_bfee import BeamformReader\nfrom scipy import fftpack, signal\n\n\nclass RealtimeGraph:\n\n def __init__(self, graphType=\"default\"):\n plt.i...
[ [ "matplotlib.pyplot.legend", "numpy.abs", "numpy.cumsum", "matplotlib.pyplot.subplots", "matplotlib.pyplot.plot", "numpy.argmax", "numpy.mean", "numpy.diff", "matplotlib.pyplot.xlabel", "numpy.angle", "matplotlib.pyplot.ion", "numpy.zeros", "scipy.signal.welch", ...
dianuchitop/DianaMartinez_Ejercicio30
[ "68dcfcab1b24ba371e3e1bbd8f3918bf5583dc7e" ]
[ "graficash.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\nfrom matplotlib.animation import FuncAnimation\nfrom matplotlib.animation import PillowWriter\n\nm=100\nbeta=0.05\nc=1\ndx=1./m\ndt=beta*dx/c\nT_final=0.1\nn=int(T_final/dt)+1\n\ndata = np.loadtxt(\"Data.dat\")\ngrid = np.reshape(data, (n, m))\n\nfig = plt....
[ [ "matplotlib.animation.PillowWriter", "numpy.linspace", "numpy.reshape", "matplotlib.pyplot.axes", "matplotlib.pyplot.ylabel", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.xlabel", "numpy.loadtxt", "matplotlib.pyplot.figure" ] ]
jejjohnson/kernellib
[ "eb9f80c1b605c8a6b5e8a324efd4ef07d8f59050" ]
[ "kernellib/kernels/derivative_functions/cythonize_rbf_derivative.py" ]
[ "from distutils.core import setup\nfrom Cython.Build import cythonize\nimport numpy\n\nsetup(\n name = 'RBF Derivative Cython',\n ext_modules = cythonize(\"rbf_derivative_cy.pyx\"),\n include_dirs = [numpy.get_include()]\n \n)" ]
[ [ "numpy.get_include" ] ]
Python3pkg/500lines
[ "e9c05e45d6eedf36ceef67ec5f817a39a07980fb" ]
[ "sampler/code/rpg.py" ]
[ "import numpy as np\nfrom multinomial import MultinomialDistribution\n\n\nclass MagicItemDistribution(object):\n\n # these are the names (and order) of the stats that all magical\n # items will have\n stats_names = (\"dexterity\", \"constitution\", \"strength\",\n \"intelligence\", \"wisd...
[ [ "numpy.arange", "numpy.ones", "numpy.argmax", "numpy.array", "numpy.sum" ] ]
ddervs/GreenGraph
[ "bb65e5d9f2a34686add644e4fa1851aabf82c3c1" ]
[ "greengraph/classes/Map.py" ]
[ "import numpy as np\nimport requests\nfrom StringIO import StringIO\nfrom matplotlib import image as img\n\nclass Map(object):\n\n def __init__(self, latitude, longitude, satellite=True,\n zoom=10, size=(400, 400), sensor=False):\n\n base = \"http://maps.googleapis.com/maps/api/staticmap?\...
[ [ "numpy.array", "numpy.logical_and", "matplotlib.image.imsave" ] ]
luizhss/Gesture_Hand_Controller
[ "705c401f2b922b5b6036cb3eebd8155594878208" ]
[ "delay.py" ]
[ "import numpy as np\nfrom collections import Counter\n\n\nclass Delay():\n \"\"\"\n Delay Frames Class.\n\n This class is responsible to provoke delays on the execution frames.\n Required Arguments:\n classes {list[string], required}: List of class names from the trained classifier.\n\n Keywor...
[ [ "numpy.append", "numpy.vstack", "numpy.delete", "numpy.empty" ] ]
sugi-san/BlendGAN
[ "7aff2aad8ee06c13d2ef421f02fa9a56d747ba58" ]
[ "style_transfer_folder.py" ]
[ "import argparse\nimport os\n\nimport cv2\nimport numpy as np\nimport torch\n\nfrom model import Generator\nfrom psp_encoder.psp_encoders import PSPEncoder\nfrom utils import ten2cv, cv2ten\nimport glob\nimport random\n\nseed = 0\n\nrandom.seed(seed)\nnp.random.seed(seed)\ntorch.manual_seed(seed)\ntorch.cuda.manual...
[ [ "numpy.random.seed", "torch.load", "torch.manual_seed", "numpy.concatenate", "torch.no_grad", "torch.cuda.manual_seed_all" ] ]
sjdv1982/seamless
[ "1b814341e74a56333c163f10e6f6ceab508b7df9" ]
[ "examples/BC/load_pdb.py" ]
[ "import Bio.PDB\nfrom io import StringIO\nimport numpy as np\npdb_data = StringIO(pdb)\np = Bio.PDB.PDBParser()\nstruc = p.get_structure(\"pdb\", pdb_data)\ncoors = []\nfor residue in struc.get_residues():\n for atom in residue.get_atoms():\n if atom.name == \"CA\":\n coors.append(atom.coord)\n...
[ [ "numpy.stack" ] ]
YerbaPage/scikit-fem
[ "e5140e0648e4a0f1ea0b60de90851ab49d369453" ]
[ "docs/examples/ex35.py" ]
[ "\"\"\"Computation of the characteristic impedance and velocity factor of RG316\ncoaxial cable.\n\nThis example solves the series inductance (per meter) and parallel capacitance\n(per meter)\nof RG316 coaxial cable. These values are then used to compute the\ncharacteristic impedance and velocity factor of the cable...
[ [ "numpy.dot", "numpy.sqrt", "matplotlib.pyplot.subplot", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
salosyatov/football_stat
[ "a8cb68cd648f65f8dbb383b8795cbd8b0dbac5d3" ]
[ "src/models/train_net_model.py" ]
[ "import logging\nimport sys\nfrom typing import Tuple\n\nimport numpy as np\nimport torch\nfrom torch import nn, optim\nfrom torch.optim import Optimizer\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\n\nfrom .net import Network, TripletLoss, CachedDataset\nfrom ..params import TrainingParams, Test...
[ [ "torch.jit.script", "numpy.random.seed", "torch.manual_seed", "torch.utils.data.DataLoader", "numpy.concatenate", "torch.no_grad", "torch.cuda.is_available", "numpy.sum", "torch.nn.init.kaiming_normal_" ] ]
kyle-rgb/NBA_Sportsbook_Project
[ "0287e2f8482c33eccecfe8e418314ccaad584594" ]
[ "src/data/shark.py" ]
[ "import time, sys, requests, re, bs4, os, json, time\nimport pandas as pd, numpy as np, sqlalchemy as sql, datetime as dt\nfrom concurrent.futures import ThreadPoolExecutor\nfrom selenium import webdriver\nfrom db_info import connection_str\n\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
dngoldberg/oggm
[ "b6e8106abab15940c7968c6b634aa9bc2f9ca419" ]
[ "oggm/core/climate.py" ]
[ "\"\"\"Climate data and mass-balance computations\"\"\"\n# Built ins\nimport logging\nimport os\nimport datetime\nimport warnings\nimport sys\n\n# External libs\nimport numpy as np\nimport xarray as xr\nimport netCDF4\nimport pandas as pd\nfrom scipy import stats\nfrom scipy import optimize as optimization\n\n# Opt...
[ [ "pandas.Series", "pandas.DataFrame", "numpy.all", "numpy.max", "numpy.mean", "numpy.any", "numpy.searchsorted", "numpy.nanmean", "numpy.where", "pandas.read_csv", "numpy.allclose", "numpy.arange", "scipy.optimize.brentq", "numpy.zeros", "numpy.min", ...
sambit-giri/emulator
[ "daa8bc9df5ec804052423b11d0a1c7252a75f850" ]
[ "src/gaussian_process.py" ]
[ "import numpy as np\nfrom sklearn.metrics import r2_score\nimport pickle\nfrom . import helper_functions as hf\nfrom time import time\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import mean_squared_error\n\ntry: import GPy\nexcept: print('Install GPy to use GPR_GPy and SparseGPR_GPy....
[ [ "numpy.diag", "sklearn.metrics.r2_score", "numpy.sqrt", "sklearn.model_selection.train_test_split", "torch.from_numpy", "numpy.append", "torch.no_grad", "numpy.array" ] ]
Thrada/depthai-experiments
[ "f06312596b47427f9699a300ae8bc143dbbac000" ]
[ "gen2-triangulation/main.py" ]
[ "# import math\r\nfrom pathlib import Path\r\n\r\nimport blobconverter\r\nimport numpy as np\r\nimport math\r\nfrom visualizer import initialize_OpenGL, get_vector_direction, get_vector_intersection, start_OpenGL\r\nimport cv2\r\nimport depthai as dai\r\n\r\np = dai.Pipeline()\r\n\r\nleft_camera_position = (0.107, ...
[ [ "numpy.array" ] ]
sabbbin/age-rep
[ "9f42db8c662b8c4a78e8aeab39c1a6989e09f46a" ]
[ "model-code/morph-ce.py" ]
[ "# coding: utf-8\n\n#############################################\n# Cross Entropy with ResNet-34\n#############################################\n\n# Imports\n\nimport os\nimport time\nimport pandas as pd\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport argparse\nimport sys\n\nfrom torc...
[ [ "torch.abs", "torch.nn.functional.softmax", "torch.max", "torch.utils.data.DataLoader", "torch.sum", "torch.set_grad_enabled", "torch.cuda.is_available", "torch.device", "pandas.read_csv", "torch.sqrt", "torch.nn.Sequential", "torch.nn.Conv2d", "torch.nn.Linear"...
Jee-King/ICCV2021_Event_Frame_Tracking
[ "ea86cdd331748864ffaba35f5efbb3f2a02cdb03" ]
[ "pytracking/utils/plotting.py" ]
[ "import matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport torch\r\nimport cv2\r\n\r\n\r\ndef draw_figure(fig):\r\n fig.canvas.draw()\r\n fig.canvas.flush_events()\r\n plt.pause(0.001)\r\n\r\n\r\ndef show_tensor(a: torch.Tensor, fig_num = None, title = None, range=(None, None), ax=None):\r\n \"\"\...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "numpy.unique", "numpy.asarray", "matplotlib.pyplot.cla", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.axis", "numpy.transpose", "numpy.array", "numpy.z...
AlbertiPot/CTNAS
[ "ecb22ea66b7ba075c48ca4c4db28f68b777f45db" ]
[ "ctnas/core/controller/common_nas.py" ]
[ "import functools\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.distributions as distributions\nfrom torch.distributions.utils import probs_to_logits\n\nfrom core.genotypes import Genotype\nfrom core.utils import logger\n\n\nclass Controller(nn.Module):\n '''\n Controll...
[ [ "torch.nn.functional.softmax", "torch.zeros", "torch.cat", "torch.nn.Embedding", "torch.nn.LSTMCell", "torch.nn.Linear", "torch.tanh", "torch.distributions.Categorical" ] ]
Kabongosalomon/axcell
[ "b41c1623377d89c3c45a61907f0a47ea029269de" ]
[ "axcell/helpers/cache.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport pandas as pd\nimport json\nfrom collections import defaultdict\nfrom pathlib import Path\n\n\n# these functions are used to cache various results\n# of corresponding pipeline steps, to make it faster to\n# rerun the pipeline or run i...
[ [ "pandas.read_csv" ] ]
Jwy-Leo/pytorch_yolov3
[ "7deb87529e80cf715ec4fd90e1381293401998ea" ]
[ "darknet.py" ]
[ "import os\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom cfg import *\nimport numpy as np\nfrom region_layer import RegionLayer\nfrom yolo_layer import YoloLayer\n#from layers.batchnorm.bn import BN2d\n\nclass MaxPoolStride1(nn.Module):\n def __init__(self):\n super(MaxPoolSt...
[ [ "torch.nn.Softmax", "torch.cat", "numpy.concatenate", "torch.nn.L1Loss", "torch.nn.functional.relu", "torch.nn.functional.pad", "torch.nn.SmoothL1Loss", "torch.nn.Sequential", "torch.nn.functional.avg_pool2d", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.Line...
bamos/hypertorch
[ "24826349f73d84f0820da429023f6f6aeada7c74" ]
[ "hypergrad/diff_optimizers.py" ]
[ "import torch\nfrom itertools import repeat\n\n\nclass DifferentiableOptimizer:\n def __init__(self, loss_f, dim_mult, data_or_iter=None):\n \"\"\"\n Args:\n loss_f: callable with signature (params, hparams, [data optional]) -> loss tensor\n data_or_iter: (x, y) or iterator ov...
[ [ "torch.zeros_like", "torch.autograd.grad", "torch.enable_grad" ] ]
ericdaat/self-label
[ "7c12f834c7b6bd5bee2f7f165aab33d4c4e50b51" ]
[ "models/resnetv1.py" ]
[ "import torch.nn as nn\nimport math\n\n__all__ = ['resnetv1','resnetv1_18']\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,\n padding=1, bias=False)\n\n\nclass Normalize(nn.M...
[ [ "torch.nn.Sequential", "torch.randn", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
cb-stimmer/estim2bapi
[ "adeb6d4ef681c4e4be65d7ad1758edb9bf11ac58" ]
[ "examples/udp_motion_example/motion.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom collections import deque\n\nclass EMA:\n def __init__(self, alpha):\n self.alpha = alpha\n self.ema = None\n self.emv = 0.0\n\n def __call__(self, value):\n delta = value\n if self.ema is not None: delta -= self.ema\n\n s...
[ [ "numpy.abs", "numpy.sqrt", "numpy.reshape", "numpy.std", "numpy.mean", "numpy.diff", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
obi-ml-public/echoAI-PET-measurements
[ "54d81edfdc465b8db0b1bb71ea01855e42a623bc" ]
[ "src/echoai_pet_measurements/processing.py" ]
[ "\"\"\"\nThis file is part of the echoAI-PET-measurements project.\n\"\"\"\nimport os\nimport numpy as np\nimport cv2\nimport lz4.frame\n\nclass Videoconverter:\n \"\"\" Preprocessing functions for echo videos\n min_rate: minimum frame rate\n min_frames: minimum required number of frames\n meta_df: data...
[ [ "numpy.amax", "numpy.abs", "numpy.amin", "numpy.arange", "numpy.squeeze", "numpy.round", "numpy.moveaxis", "numpy.load", "numpy.array", "numpy.zeros" ] ]
Alicegaz/pytorch-lightning
[ "96b45f15aa04e0ad7e0ed20b8717ab1599148966" ]
[ "tests/trainer/test_dataloaders.py" ]
[ "import os\nimport platform\nfrom unittest.mock import patch\n\nimport pytest\nimport torch\nfrom packaging.version import parse\nfrom torch.utils.data.dataloader import DataLoader\nfrom torch.utils.data.dataset import IterableDataset, Subset\nfrom torch.utils.data.distributed import DistributedSampler\n\nimport te...
[ [ "torch.cuda.device_count", "torch.utils.data.dataloader.DataLoader", "torch.nn.ReLU" ] ]
gilbertslade/hmmlearn
[ "e525a8819acc05f02ea486dfdb944b8cd525835c" ]
[ "hmmlearn/hmm.py" ]
[ "# Hidden Markov Models\n#\n# Author: Ron Weiss <ronweiss@gmail.com>\n# Shiqiao Du <lucidfrontier.45@gmail.com>\n# API changes: Jaques Grobler <jaquesgrobler@gmail.com>\n# Modifications to create of the HMMLearn module: Gael Varoquaux\n# More API changes: Sergei Lebedev <superbobry@gmail.com>\n\n\"\"\"\nThe...
[ [ "numpy.diag", "numpy.dot", "sklearn.cluster.KMeans", "numpy.einsum", "numpy.asarray", "numpy.cumsum", "numpy.concatenate", "numpy.any", "numpy.exp", "numpy.where", "numpy.allclose", "numpy.eye", "numpy.finfo", "numpy.diff", "numpy.outer", "numpy.zero...
danmlr/graph_transformer
[ "4f173315c16bac213a7a8ec8171bbdbc236e42d2" ]
[ "train/train_SBMs_node_classification.py" ]
[ "\"\"\"\r\n Utility functions for training one epoch \r\n and evaluating one epoch\r\n\"\"\"\r\nimport torch\r\nimport torch.nn as nn\r\nimport math\r\nimport dgl\r\n\r\nfrom train.metrics import accuracy_SBM as accuracy\r\n\r\ndef train_epoch(model, optimizer, device, data_loader, epoch):\r\n\r\n model.tr...
[ [ "torch.no_grad" ] ]
sngweicong/DeepCTR-Torch
[ "67d4e9d0c8a13aa4d614b2d04397a7f6e7a0e9af" ]
[ "avazu.py" ]
[ "import pandas as pd\nimport torch\nfrom sklearn.metrics import log_loss, roc_auc_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import LabelEncoder\n\nfrom deepctr_torch.inputs import SparseFeat, get_feature_names\nfrom deepctr_torch.models import FiBiNET\n\nif __name__ == ...
[ [ "sklearn.metrics.roc_auc_score", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.log_loss", "torch.cuda.is_available", "sklearn.preprocessing.LabelEncoder" ] ]
jmmshn/emmet
[ "b67fb4160d2350c611c8b2f534717a04eb6ce035" ]
[ "emmet-builders/emmet/builders/feff/xas.py" ]
[ "from typing import List, Dict\nfrom itertools import groupby, chain\nfrom datetime import datetime\nimport traceback\n\nimport numpy as np\nfrom monty.json import jsanitize\n\nfrom maggma.core import Store\nfrom maggma.builders import GroupBuilder\n\nfrom pymatgen.core import Structure\nfrom pymatgen.analysis.xas....
[ [ "numpy.argwhere" ] ]
FengJunJian/Teacher-Assistant-Knowledge-Distillation
[ "cdb61d853df260f638a6490998aaee6c4d787fed" ]
[ "resnet_cifar.py" ]
[ "\"\"\"\nresnet for cifar in pytorch\n\nReference:\n[1] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016.\n[2] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In ECCV, 2016.\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport math\n\...
[ [ "torch.nn.Sequential", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
simonemastella/SureBetFinder
[ "8dd1fb9ea2f8c42ee54c48af1ccdff878edfc7c0" ]
[ "scrapper/marathonbet.py" ]
[ "from bs4 import BeautifulSoup as bs4 #per scrap\nimport pandas as pd #per analizzare e creare dataframe\nfrom requests_html import HTMLSession\nimport webbrowser\nfrom datetime import datetime, timedelta\n\ndef scrap(link):\n if True: \n session = HTMLSession()\n with session.get(link) as res:\...
[ [ "pandas.DataFrame" ] ]
INTERA-Inc/mf6cts
[ "13967af777e88b112b1a9026b35841c322d34bf4", "13967af777e88b112b1a9026b35841c322d34bf4" ]
[ "verification/flopy/mf6/data/mfdataarray.py", "verification/flopy/utils/sfroutputfile.py" ]
[ "import sys, inspect, copy, os\nimport numpy as np\nfrom ..data.mfstructure import DatumType\nfrom .mfdatastorage import DataStorage, DataStructureType, DataStorageType\nfrom ...utils.datautil import MultiList, DatumUtil\nfrom ..mfbase import ExtFileAction, MFDataException, VerbosityLevel\nfrom ..utils.mfenums impo...
[ [ "numpy.concatenate", "numpy.expand_dims", "numpy.full_like" ], [ "numpy.where" ] ]
orfranco/IML.HUJI
[ "29a8a98ed20f9790eceebe620b3f2b738a808ad5" ]
[ "IMLearn/learners/regressors/polynomial_fitting.py" ]
[ "from __future__ import annotations\nfrom typing import NoReturn\nfrom . import LinearRegression\nfrom ...base import BaseEstimator\nimport numpy as np\n\n\nclass PolynomialFitting(BaseEstimator):\n \"\"\"\n Polynomial Fitting using Least Squares estimation\n \"\"\"\n\n def __init__(self, k: int) -> Pol...
[ [ "numpy.vander" ] ]
NIRVANALAN/Centroid_GCN
[ "e93ec415d769cc3b1bbf737056097e8cbe65ded5" ]
[ "train.py" ]
[ "from cluster import * # import cluster\nimport argparse\nimport pathlib\nfrom pathlib import Path\nimport time\nimport pdb\nimport numpy as np\nimport networkx as nx\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl import DGLGraph\nfrom dgl.data import register_data_args, load_data\...
[ [ "torch.BoolTensor", "torch.ByteTensor", "torch.LongTensor", "torch.nn.CrossEntropyLoss", "torch.isinf", "torch.max", "torch.cuda.set_device", "torch.sum", "numpy.save", "torch.FloatTensor", "torch.no_grad", "numpy.mean", "numpy.array", "torch.pow" ] ]
SimuJenni/SemDefNet
[ "de64e661f7103df6550b47c1429896dab61d001c" ]
[ "models/SDNet_avgDisc_concat_new_2.py" ]
[ "import tensorflow as tf\nimport tensorflow.contrib.slim as slim\nfrom AlexNet_avgDisc_concat_noBN_2 import AlexNet\nfrom layers_new import up_conv2d, pixel_dropout, res_block_bottleneck\nfrom utils import montage_tf\n\n\nDEFAULT_FILTER_DIMS = [64, 128, 256, 512, 1024]\n\n\ndef toon_net_argscope(activation=tf.nn.el...
[ [ "tensorflow.concat", "tensorflow.contrib.slim.metrics.accuracy", "tensorflow.zeros", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.contrib.slim.flatten", "tensorflow.add_n", "tensorflow.summary.scalar", "tensorflow.contrib.layers.variance_scaling_initializer", "tensorfl...
ndb796/vision
[ "8a820172393b1a1c06411f359dba7a305fd9a9b7" ]
[ "test/test_datasets.py" ]
[ "import contextlib\nimport sys\nimport os\nimport unittest\nfrom unittest import mock\nimport numpy as np\nimport PIL\nfrom PIL import Image\nfrom torch._utils_internal import get_file_path_2\nimport torchvision\nfrom torchvision.datasets import utils\nfrom common_utils import get_tmp_dir\nfrom fakedata_generation ...
[ [ "numpy.array", "torch.randint", "torch.rand", "numpy.random.randint" ] ]