repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Darkbladecr/MND-patient-dashboard | [
"747019de417db1c106dd188a7df6d29239b616bb"
] | [
"server/apis/appointmentsExport.py"
] | [
"\"\"\"\nAppointment Excel Exporter.\n\nExports the current patient's appoitnments from the mongoDB database\n\"\"\"\n\nimport sys\nfrom os import chdir\nfrom os.path import exists\nfrom time import sleep\n\nimport numpy as np\nfrom bson.objectid import ObjectId\nfrom openpyxl import Workbook\nfrom pymongo import M... | [
[
"numpy.array",
"numpy.argmin"
]
] |
A-Lawrence-Reynolds/python-intro | [
"99c20adc78eb53ac4d3c87543ef8da1ef4d10adc"
] | [
".venv/lib/python3.7/site-packages/matplotlib/pyplot.py"
] | [
"# Note: The first part of this file can be modified in place, but the latter\n# part is autogenerated by the boilerplate.py script.\n\n\"\"\"\n`matplotlib.pyplot` is a state-based interface to matplotlib. It provides\na MATLAB-like way of plotting.\n\npyplot is mainly intended for interactive plots and simple case... | [
[
"matplotlib.cbook._suppress_matplotlib_deprecation_warning",
"matplotlib.figure.Figure.legend.__doc__.replace",
"matplotlib._pylab_helpers.Gcf.destroy_all",
"matplotlib.docstring.copy",
"matplotlib._pylab_helpers.Gcf.get_all_fig_managers",
"matplotlib.interactive",
"matplotlib._pylab_h... |
Rakshitha-Yalamanchili/Coursera-Ng-Convolutional-Neural-Networks | [
"6256ca8b98473fe7bfe171b6795898ddd1627b7f"
] | [
"Week 2 PA 1 Keras - Tutorial - Happy House v2/Keras+-+Tutorial+-+Happy+House+v2.py"
] | [
"\n# coding: utf-8\n\n# # Keras tutorial - the Happy House\n# \n# Welcome to the first assignment of week 2. In this assignment, you will:\n# 1. Learn to use Keras, a high-level neural networks API (programming framework), written in Python and capable of running on top of several lower-level frameworks including T... | [
[
"numpy.expand_dims",
"matplotlib.pyplot.imshow"
]
] |
EKami/EzeeML | [
"2eb3e2a20b7619bd58b0b0fca120e2aefca0e79a"
] | [
"torchlite/pandas/time_series.py"
] | [
"# TODO include https://github.com/blue-yonder/tsfresh\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import TimeSeriesSplit\nfrom sklearn.metrics import mean_absolute_error, mean_squared_log_error\nfrom scipy.optimize import minimize\nfrom tqdm import tqdm\nimport statsmodels.tsa.api as smt\nimport... | [
[
"matplotlib.pyplot.style.context",
"pandas.DataFrame",
"matplotlib.pyplot.tight_layout",
"scipy.optimize.minimize",
"matplotlib.pyplot.axis",
"numpy.array",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.std",
"matplotlib.pyplot.show",
"matplotlib.pyplot.... |
XxOinvizioNxX/EP_Split_and_Merge | [
"b480e189182b3a7e139f56d56eb942c7960c56d9"
] | [
"Text_OCR/Network_TF.py"
] | [
"\"\"\"\r\n Licensed under the Unlicense 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 https://unlicense.org\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distr... | [
[
"numpy.array",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"numpy.argmax"
]
] |
lorycontixd/PNS | [
"23f61833ae75a2425d05ca9757ef471aec930654"
] | [
"es6/run.py"
] | [
"import sys, os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport utils\nimport subprocess\n\nmetro = [True, False]\npoints= 20\ntemps = np.linspace(0.2,3.0,num=points)\nnspins = 50\nj = 1.0\nhs = [0.0, 0.02]\nnblk = 100\nnsteps = 10000\niter = 0\ndbiter = 0\nnrestarts = 5\ntotal = len(metro)*len(temps)*... | [
[
"numpy.linspace"
]
] |
Zigars/Yolov4-Pytorch | [
"4f4291df2d43f97884345a154eb20191cef6f49f"
] | [
"model/common.py"
] | [
"'''\n@Description:common 公用组件\n@Author:Zigar\n@Date:2021/03/05 15:37:00\n'''\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom model.attention import SEModule, CBAM\nfrom config.config import cfg\n\n#---------------------------------------------------------------#\n# Mish激活函数\n#--------... | [
[
"torch.nn.Identity",
"torch.nn.functional.softplus",
"torch.nn.Conv2d"
]
] |
dawnclaude/Keyword-MLP | [
"ca743098eaa8c4aeaa5901cfb40983339de320a6"
] | [
"utils/dataset.py"
] | [
"import torch\nfrom torch.utils import data\nfrom torch.utils.data import Dataset, DataLoader\nimport numpy as np\nimport functools\nimport librosa\nimport glob\nimport os\nfrom tqdm import tqdm\nimport multiprocessing as mp\nimport json\n\nfrom utils.augment import time_shift, resample, spec_augment\nfrom audiomen... | [
[
"numpy.clip",
"torch.from_numpy",
"numpy.amax",
"torch.utils.data.DataLoader",
"numpy.amin"
]
] |
deep-cube/deep-cube | [
"de4623e94e569a2f09f3f0b1c332618bca753a77"
] | [
"src/test_seq_cnn.py"
] | [
"from model_seq_cnn import *\nfrom tqdm import trange\nimport torch\nimport numpy as np\nimport unittest\n\n\nclass TestSeqCNN(unittest.TestCase):\n\n def test_shape_2d(self):\n for i in trange(20, desc='test_shape_2d'):\n in_C = np.random.randint(2, 4)\n in_H = np.random.randint(30,... | [
[
"torch.zeros",
"numpy.random.randint"
]
] |
coookie89/Intern-Training | [
"6e3b26edfee5bdcc98dd5ac05d35cef125778ad5",
"6e3b26edfee5bdcc98dd5ac05d35cef125778ad5"
] | [
"txya900619/Week1/ch2/2.1/exercise2.py",
"u08410006/Week1/ch2/ch2-6.py"
] | [
"import torch\n\n\nif __name__ == \"__main__\":\n a = torch.arange(15).reshape((3, 1, 5))\n b = torch.arange(30).reshape((3, 2, 5))\n\n print(\"a:\\n\", a)\n print()\n\n print(\"b:\\n\", b)\n print()\n\n # to trigger broadcasting mechanism, one of a or b is 1, and other axes size are equal\n ... | [
[
"torch.arange"
],
[
"torch.distributions.multinomial.Multinomial",
"torch.ones"
]
] |
cremebrule/rl_games | [
"fc996a0d00438f6747fef86959c8d31ecd7880f9"
] | [
"rl_games/algos_torch/torch_ext.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.optim.optimizer import Optimizer\n\ndef policy_kl(p0_mu, p0_sigma, p1_mu, p1_sigma, reduce=True):\n c1 = torch.log(p1_sigma/p0_sigma + 1e-5)\n c2 = (p0_sigma**2 + (p1_mu - p0_mu)*... | [
[
"torch.nn.Linear",
"torch.stack",
"torch.randperm",
"numpy.mean",
"torch.ones",
"numpy.finfo",
"torch.load",
"torch.sqrt",
"torch.distributions.normal.Normal",
"torch.tensor",
"numpy.sqrt",
"torch.index_select",
"torch.Tensor",
"torch.nn.Embedding",
"tor... |
dlaredo/stochastic_dynamics | [
"a851d8fe1e88f5bafa187c4d43c21c7904716670"
] | [
"code/loss_functions.py"
] | [
"import tensorflow as tf\nimport analytic_functions\nimport residuals\n\ndef get_tensors_from_batch(X, y_pred, y_real, num_inputs, num_outputs, num_conditions, num_feval):\n \"\"\"Given the minibatches, retrieve the tensors containing the original point, the points+-deltas and boundary conditions\"\"\"\n\n X_... | [
[
"tensorflow.multiply",
"tensorflow.shape",
"tensorflow.assign",
"tensorflow.summary.scalar",
"tensorflow.subtract",
"tensorflow.constant",
"tensorflow.get_variable",
"tensorflow.stack",
"tensorflow.slice",
"tensorflow.add",
"tensorflow.cast"
]
] |
SuX97/mmaction2 | [
"d19cc95eb205c16fd8a1cf126e0268fbc82dcd29"
] | [
"mmaction/models/recognizers/base.py"
] | [
"from abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.runner import auto_fp16\n\nfrom .. import builder\n\n\nclass BaseRecognizer(nn.Module, metaclass=ABCMeta):\n \"\"\"Bas... | [
[
"torch.distributed.is_available",
"torch.distributed.is_initialized",
"torch.distributed.get_world_size",
"torch.nn.functional.softmax"
]
] |
danielcrz95/hager_py | [
"e2d789e8251d8c795e714055974b75889906752f"
] | [
"hager_py/hagerstrand.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: 00_hagerstrand.ipynb (unless otherwise specified).\n\n__all__ = ['Diffusion', 'SimpleDiffusion', 'AdvancedDiffusion']\n\n# Cell\nimport sys\nfrom random import randint\nfrom random import uniform\nimport numpy as np\nfrom scipy.spatial.distance import cdist\nfrom skimage... | [
[
"numpy.array",
"numpy.meshgrid",
"numpy.ravel_multi_index",
"numpy.zeros",
"numpy.sum",
"numpy.nonzero",
"numpy.unravel_index",
"numpy.ravel",
"numpy.cumsum",
"numpy.random.random",
"numpy.linspace",
"scipy.spatial.distance.cdist"
]
] |
PacktPublishing/Computer-Vision-Python-OCR-Object-Detection-Quick-Starter | [
"4c34febd2e4fcef5452889468611dbc25e38489a"
] | [
"pretrained_mobilenetssd_video.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\n\r\n@author: abhilash\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport cv2\r\n\r\n#get the saved video file as stream\r\nfile_video_stream = cv2.VideoCapture('images/testing/video_sample.mp4')\r\n\r\n#create a while loop \r\nwhile (file_video_stream.isOpened):\r\n #get the cur... | [
[
"numpy.array",
"numpy.arange"
]
] |
mljarman/twitoff | [
"bbd2d0eaeb8813466f44039dfad3e5894a0ce7f6"
] | [
"TWITOFF/predict.py"
] | [
"\"\"\"\nPrediction of Users based on Tweet embeddings.\n\"\"\"\nimport pickle\nimport numpy as np\nfrom sklearn.linear_model import LogisticRegression\nfrom .models import User\nfrom .twitter import BASILICA\n\ndef predict_user(user1_name, user2_name, tweet_text, cache=None):\n \"\"\"Determine and return which ... | [
[
"sklearn.linear_model.LogisticRegression",
"numpy.array",
"numpy.vstack"
]
] |
xunhen/oneflow_vision_model | [
"1774b04546034794af24f7b393717e19f11eb019"
] | [
"SRGAN/of_data_utils.py"
] | [
"\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\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 http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicab... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.random.seed",
"numpy.ascontiguousarray",
"numpy.random.shuffle",
"numpy.save",
"numpy.random.randint"
]
] |
csmithchicago/openrec | [
"5a9cf03abe0db0636107985f9f19d6351e4afe68"
] | [
"legacy/legacy/modules/interactions/ns_log.py"
] | [
"import tensorflow as tf\r\nfrom openrec.legacy.modules.interactions import Interaction\r\n\r\n\r\nclass NsLog(Interaction):\r\n def __init__(\r\n self,\r\n user,\r\n max_item,\r\n item=None,\r\n item_bias=None,\r\n p_item=None,\r\n p_item_bias=None,\r\n ne... | [
[
"tensorflow.multiply",
"tensorflow.reduce_min",
"tensorflow.less",
"tensorflow.expand_dims",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.reduce_sum",
"tensorflow.to_float",
"tensorflow.tile"
]
] |
KosmX/captcha-tensorflow | [
"21262eac8725d9db7dd8d5cf4fe00c1a02f66a9c"
] | [
"model.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.layers import Input, Dense, BatchNormalization, Conv2D, MaxPool2D, GlobalMaxPool2D, Dropout\nfrom tensorflow.keras.optimizers import SGD\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras import layers, models\n\nfrom ai_config import *\n\ndef new_model... | [
[
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.models.load_model",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.Input"
]
] |
maciekwoo/TensorFlowRegressor | [
"2a049f163256affabb6aa445f0a9a9c142501883"
] | [
"scikit_regressor.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nfrom get_data import MasterData\nfrom get_data import my_grid_search\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.neural_network import MLPRegressor\nfrom sklearn.metrics import mean_squared_error\n\nmd = MasterData('Bosto... | [
[
"sklearn.metrics.mean_squared_error",
"pandas.DataFrame",
"sklearn.neural_network.MLPRegressor",
"sklearn.preprocessing.MinMaxScaler",
"pandas.concat"
]
] |
linewalks/daqm | [
"66db54af15611b85db95339672ff7da49657f9d4"
] | [
"daqm/data/data_frame.py"
] | [
"\"\"\"\nDataFrame 모듈\n\npandas DataFrame을 이용한 Data Wrapper, Query\n\"\"\"\n\n\nimport functools\nimport pandas as pd\nimport numpy as np\nimport warnings\nimport sqlalchemy\n\nfrom collections import defaultdict\nfrom datetime import datetime\nfrom typing import List, Callable, Generator\n\nfrom daqm.data.data imp... | [
[
"pandas.isnull",
"pandas.notnull",
"numpy.ceil",
"pandas.merge",
"pandas.DataFrame",
"pandas.to_timedelta",
"numpy.trunc",
"numpy.timedelta64",
"pandas.Series",
"pandas.read_sql",
"numpy.floor"
]
] |
moondaiy/SSD_Series_TF | [
"824404aab3678856d08b964d1bd77349b9cfed69"
] | [
"net/box_utils/nms_tf_op.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\n\ndef nms_calculate(boxes, scores, iou_threshold, max_output_size, name='non_maximal_suppression'):\n\n with tf.variable_scope(name):\n\n ... | [
[
"tensorflow.variable_scope",
"tensorflow.image.non_max_suppression"
]
] |
enp1s0/tsqr-gpu | [
"b3a8f131d9deb9cf88dc642503edc85efdd143a9"
] | [
"scripts/standard_test/mk_performance_graph.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nimport pandas as pd\nimport os\n\ndata_list = [\n 'fp16_notc',\n 'fp16_tc_nocor',\n 'fp32_notc',\n 'fp32_tc_nocor',\n 'fp32_tc_cor',\n 'mixed_tc_cor_emu',\n 'tf32_tc_nocor_emu... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"matplotlib.patches.Rectangle",
"pandas.read_csv"
]
] |
RevathiJambunathan/yt | [
"324d3bbcbce39717405459168d9f25542b31ee22"
] | [
"yt/frontends/boxlib/data_structures.py"
] | [
"import glob\nimport inspect\nimport os\nimport re\nimport warnings\nfrom collections import namedtuple\nfrom stat import ST_CTIME\n\nimport numpy as np\n\nfrom yt.data_objects.index_subobjects.grid_patch import AMRGridPatch\nfrom yt.data_objects.static_output import Dataset\nfrom yt.funcs import ensure_tuple, mylo... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.minimum",
"numpy.ones",
"numpy.where",
"numpy.greater",
"numpy.log2",
"numpy.dtype",
"numpy.unique",
"numpy.maximum"
]
] |
pyarnold/ipython | [
"c4797f7f069d0a974ddfa1e4251c7550c809dba0"
] | [
"IPython/sphinxext/custom_doctests.py"
] | [
"\"\"\"\nHandlers for IPythonDirective's @doctest pseudo-decorator.\n\nThe Sphinx extension that provides support for embedded IPython code provides\na pseudo-decorator @doctest, which treats the input/output block as a\ndoctest, raising a RuntimeError during doc generation if the actual output\n(after running the ... | [
[
"numpy.allclose",
"numpy.isnan"
]
] |
mc-nya/FedNest | [
"35405f4f9943488331eaada87bc9caf109ee6124"
] | [
"main_mm_fmnist.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Python version: 3.6\n\nimport yaml\nimport time\nfrom core.test import test_img\nfrom utils.Fed import FedAvg, FedAvgGradient\nfrom models.SvrgUpdate import LocalUpdate\nfrom utils.options import args_parser\nfrom utils.dataset_normal import load_data\nfrom models.... | [
[
"torch.manual_seed",
"torch.optim.SGD"
]
] |
MarcoGorelli/bornly | [
"086c6a414ad21e153efaeaa83e0bcde8a9fc0d75"
] | [
"bornly/_seaborn/seaborn/categorical.py"
] | [
"from textwrap import dedent\nfrom numbers import Number\nimport warnings\nfrom colorsys import rgb_to_hls\nfrom functools import partial\n\nimport numpy as np\nimport pandas as pd\ntry:\n from scipy.stats import gaussian_kde\n _no_scipy = False\nexcept ImportError:\n from .external.kde import gaussian_kde... | [
[
"numpy.repeat",
"numpy.median",
"numpy.min",
"numpy.where",
"matplotlib.colors.rgb2hex",
"matplotlib.colors.LinearSegmentedColormap.from_list",
"numpy.max",
"numpy.concatenate",
"pandas.notnull",
"matplotlib.colors.to_hex",
"matplotlib.collections.PatchCollection",
... |
Johnson-yue/pytorch-DFGAN | [
"dae569f57b2d249d59d091e60f1c984c55092f8e"
] | [
"CGAN_dfgan.py"
] | [
"import utils, torch, time, os, pickle\nimport numpy as np\nimport torch.nn as nn\nimport torch.optim as optim\nfrom dataloader import dataloader\nimport copy\n\n\nclass generator(nn.Module):\n # Network Architecture is exactly same as in infoGAN (https://arxiv.org/abs/1606.03657)\n # Architecture : FC1024_BR... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"numpy.mean",
"torch.ones",
"torch.nn.ConvTranspose2d",
"torch.randint",
"torch.nn.BCELoss",
"numpy.sqrt",
"torch.zeros_like",
"torch.zeros",
"torch.nn.Tanh",
"torch.nn.ReLU",
... |
jeffdaily/tensorflow-upstream | [
"2ac94cf58dafd29ddeb086a913a130711ae6712e"
] | [
"tensorflow/python/compat/compat.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 requ... | [
[
"tensorflow.python.util.tf_export.tf_export"
]
] |
aosokin/biogans | [
"cb72bb0457be335fad6c27a16bb1761b937a6d06"
] | [
"code/dcgan.py"
] | [
"import numbers\n\nimport torch\nimport torch.nn as nn\n\n\nclass DCGAN_D(nn.Module):\n def __init__(self, isize, nz, nc, ndf, n_extra_layers=0, use_batch_norm=True):\n super(DCGAN_D, self).__init__()\n\n if isinstance(isize, numbers.Number):\n isize = (int(isize), int(isize))\n\n ... | [
[
"torch.cat",
"torch.nn.Sequential",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
zhaoyone/RecBole | [
"a620a96cc58535462b468d2ca799ac52d31fcf0a"
] | [
"recbole/sampler/sampler.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author : Yupeng Hou\n# @Email : houyupeng@ruc.edu.cn\n# @File : sampler.py\n\n# UPDATE\n# @Time : 2020/8/17, 2020/8/31, 2020/10/6, 2020/9/18\n# @Author : Xingyu Pan, Kaiyuan Li, Yupeng Hou, Yushuo Chen\n# @email : panxy@ruc.edu.cn, tsotfsk@outlook.com, houyupeng@ruc.edu.cn, chenyu... | [
[
"numpy.tile",
"numpy.zeros"
]
] |
AngelBrisco/SubPixelConvolution-in-Keras | [
"ba883ba22c05213cdc45e1b7727f09dcf9416247"
] | [
"TF 1 legacy model/Custom upsample layers.py"
] | [
"import numpy as np\nfrom tensorflow.keras.layers import *\nfrom tensorflow.keras import backend as K\nimport tensorflow as tf\n\n__all__ =[\"SubpixelLayer2D\",\"conv_up\",\"SubpixelLayer2D_log\"]\n\nclass SubpixelLayer2D(Layer):\n\n def __init__(self,filters=None,ksz=1, scale=2, **kwargs):\n self.scale=s... | [
[
"tensorflow.keras.backend.pool2d",
"tensorflow.initializers.variance_scaling",
"tensorflow.keras.backend.relu",
"tensorflow.Variable",
"tensorflow.keras.backend.resize_images",
"tensorflow.keras.backend.conv2d",
"tensorflow.depth_to_space",
"tensorflow.tile",
"numpy.log2"
]
] |
cbottrell/RealSim-CFIS | [
"f0a48054c1d26daf19445e2c873a0af169f3495f"
] | [
"CFIS_utils.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nfrom astropy.wcs import WCS\nfrom astropy.utils.exceptions import AstropyWarning\nimport os,time,vos,warnings\nfrom astropy.io import fits\nwarnings.filterwarnings('ignore')\n\ndef CFIS_tile_radec(ra,dec):\n # find tile (see Stacking in docs)\n # https://www.cadc... | [
[
"numpy.around",
"numpy.rint",
"numpy.empty",
"numpy.cos"
]
] |
fossabot/Indian-Stock-Markets | [
"851e60e41b6f99bea10629435e7e73407c5b2a6e"
] | [
"indian_stock_markets/nse/bhavcopy.py"
] | [
"import requests\nimport zipfile\nimport shutil\nimport csv\nimport pandas as pd\nfrom datetime import date\nfrom datetime import datetime\nfrom pathlib import Path\nfrom urllib.parse import urlparse\n\nclass BhavCopy(object):\n \"\"\"description of class\"\"\"\n def __init__(self, date: date):\n self.... | [
[
"pandas.read_csv"
]
] |
chrox/RealTimeElectrophy | [
"e1a331b23d0a034894a0185324de235091e54bf0"
] | [
"StimControl/Experiments/demo/rand-orth-timing3.py"
] | [
"#!/usr/bin/python\n# Generate arbitrary onset and offset timing gratings.\n#\n# Copyright (C) 2010-2011 Huang Xin\n#\n# See LICENSE.TXT that came with this file.\n\nfrom __future__ import division\nimport sys\nimport random\nimport numpy as np\nfrom StimControl.LightStim.SweepSeque import TimingSeque\nfrom StimCon... | [
[
"numpy.linspace"
]
] |
ndronen/ignite | [
"5d7298017ceb0e5457551263d3f4090c34dbf636"
] | [
"ignite/contrib/metrics/average_precision.py"
] | [
"from functools import partial\nfrom ignite.metrics import EpochMetric\n\n\ndef average_precision_compute_fn(y_preds, y_targets, activation=None):\n try:\n from sklearn.metrics import average_precision_score\n except ImportError:\n raise RuntimeError(\"This contrib module requires sklearn to be ... | [
[
"sklearn.metrics.average_precision_score"
]
] |
chouhanaryan/nilearn | [
"e26312be96fe5c0211da28889ddd3ab1bd0ddc49"
] | [
"nilearn/plotting/html_connectome.py"
] | [
"import json\n\nimport numpy as np\nfrom scipy import sparse\n\nfrom nilearn._utils import rename_parameters\nfrom .. import datasets\nfrom . import cm\n\nfrom .js_plotting_utils import (add_js_lib, mesh_to_plotly,\n encode, colorscale, get_html_template,\n ... | [
[
"scipy.sparse.coo_matrix",
"numpy.nan_to_num",
"numpy.asarray",
"numpy.abs",
"numpy.ndim"
]
] |
leouieda/deeplook | [
"6b568fa7302fee36e807d7ad002658be3ee470d7"
] | [
"deeplook/backend/array_backend.py"
] | [
"\"\"\"\nnumpy and scipy based backend.\n\nTransparently handles scipy.sparse matrices as input.\n\"\"\"\nfrom __future__ import division, absolute_import\nimport numpy as np\nimport scipy.sparse\nimport scipy.sparse.linalg\nimport scipy.linalg\n\n\ndef inv(matrix):\n \"\"\"\n Calculate the inverse of a matri... | [
[
"numpy.diagonal"
]
] |
chickenfingerwu/research-GANwriting | [
"530595927dca2fc9c35c96634c659c5849fbf3a8"
] | [
"recognizer/models/encoder_vgg.py"
] | [
"from torch import nn\n#from torch.autograd import Variable\nimport torch\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\nimport numpy as np\n#from models.vgg_tro_channel1 import vgg16_bn\nfrom recognizer.models.vgg_tro_channel3 import vgg16_bn, vgg19_bn\n\n#torch.cuda.set_device(1)\ncuda... | [
[
"torch.nn.Linear",
"torch.device",
"numpy.array",
"torch.cat",
"torch.zeros",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.Dropout2d"
]
] |
dtsbourg/codegraph-fmt | [
"598feb368503e66f093865b402e8e8d5f05a4c42"
] | [
"src/feature_utils.py"
] | [
"\"\"\"\n`feature_utils.py`\n-------------------\n\nExtract different types of features based on the properties of nodes within the AST or within the graph.\n\n@author: Thao Nguyen (@thaonguyen19)\n\nLicense: CC-BY 4.0\n\"\"\"\n\nimport numpy as np\nimport ast_utils\nimport gensim\nimport re\n\nclass FeatureExtract... | [
[
"numpy.mean"
]
] |
intisarnaheen/Bayesian-Reinforcement-Learning-with-Maximum-Entropy | [
"b9cef141d6c55d346c74ba03dba269edead245ec"
] | [
"thesis rough codes/debugging.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nQ= 8\nN=5\nA=2\nstep_size=0.5\niterations =400\ngamma =.92\nal = 0.05\n\nphi = np.ones(Q)\nchi= np.ones((Q,A))\nshi= np.ones((N,Q,N,Q,A)) # Dimension(i,q0,j,q_next,a)\ndef softmax_intialmemory(phi):\n alpha = np.exp(phi)\n alpha /= np.sum(alpha)\n q_0 =... | [
[
"numpy.random.standard_gamma",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"matplotlib.pyplot.legend",
"numpy.exp",
"matplotlib.pyplot.plot",
"numpy.tile",
"numpy.eye",
"numpy.einsum",
"numpy.dstack"
]
] |
michaeljohnbennett/zipline | [
"29321af1b472d72b759a71c9f5ba341109fc0e6d",
"29321af1b472d72b759a71c9f5ba341109fc0e6d"
] | [
"zipline/finance/performance/position_tracker.py",
"tests/modelling/base.py"
] | [
"from __future__ import division\n\nimport logbook\nimport numpy as np\nimport pandas as pd\nfrom pandas.lib import checknull\ntry:\n # optional cython based OrderedDict\n from cyordereddict import OrderedDict\nexcept ImportError:\n from collections import OrderedDict\nfrom six import iteritems, itervalues... | [
[
"numpy.float64",
"pandas.DataFrame",
"pandas.lib.checknull",
"pandas.concat"
],
[
"numpy.random.seed",
"pandas.DataFrame",
"pandas.date_range",
"numpy.random.randn",
"numpy.prod",
"numpy.arange"
]
] |
TheLaurens/Team-Brains | [
"78b2417c90116336ac02036d4c148eb221f73830",
"78b2417c90116336ac02036d4c148eb221f73830"
] | [
"Project1/Scripts/RandomForest/RandomForest.py",
"Project1/Scripts/SVMAverageFeature/LoadData.py"
] | [
"'''\n@author: DiedeKemper\nTrains a random forest to the data with features per business.\nGives a classification for the test data.\n'''\n\nfrom sklearn import cross_validation\nfrom sklearn.ensemble import RandomForestClassifier\nfrom CreateClassification import create\nfrom CreateClassification import createPro... | [
[
"matplotlib.pyplot.xlim",
"pandas.merge",
"sklearn.ensemble.RandomForestClassifier",
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.figure",
"sklearn.cross_validation.cross_val_score",
"numpy.std",
"numpy.argsort",
"matplotlib.pyplot.show"
],
[
"pandas.... |
Sokigo-GLS/gdal | [
"595f74bf60dff89fc5df53f9f4c3e40fc835e909"
] | [
"gdal/swig/python/setup.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Setup script for GDAL Python bindings.\n# Inspired by psycopg2 setup.py file\n# http://www.initd.org/tracker/psycopg/browser/psycopg2/trunk/setup.py\n# Howard Butler hobu.inc@gmail.com\n\n\ngdal_version = '3.1.0'\n\nimport sys\nimport os\n\nfrom glob import glob\... | [
[
"numpy.__version__.split",
"numpy.get_include"
]
] |
xiaonanQua/experiment | [
"19925c9af5cffc73451dc7674bc3afce25abf772"
] | [
"data/mask_dataset.py"
] | [
"import xml.etree.ElementTree as ET\nimport numpy as np\nfrom PIL import Image\nimport glob\n\n\nclass MaskDataset:\n def __init__(self):\n # 根目录;数据路径;\n self.root = '/home/team/xiaonan/dataset/mask/'\n self.data_path = {\n 'sample': self.root,\n 'train': self.root,\n ... | [
[
"numpy.array",
"numpy.stack",
"numpy.asarray"
]
] |
WeifengOu/sphereface_pytorch | [
"c6b57bfcc56a206b5fc6432425dee5833561cbef"
] | [
"lfw_eval.py"
] | [
"from __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\ntorch.backends.cudnn.bencmark = True\n\nimport os,sys,cv2,random,datetime\nimport argparse\nimport numpy as np\nimport zipfile\n\nfrom dat... | [
[
"numpy.array",
"numpy.count_nonzero",
"numpy.mean",
"torch.from_numpy",
"numpy.std",
"numpy.arange",
"torch.load",
"numpy.vstack"
]
] |
microsoft/SCoRE | [
"f0058e6db5e51e660c30cc4db7087344532877a6"
] | [
"score/modeling_bert_context_long.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn import CrossEntropyLoss, MSELoss\n\nfrom transformers.configuration_bert import BertConfig\nfrom transformers.modeling_bert import BertLayerNorm, BertPreTrainedModel, gelu, BertModel\n\nCOLUMN_SQL_LABEL_COUNT = 502\nSQL_DIFF_LABEL_COUNT = 120\n\nclass BertForConte... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.gather",
"torch.tensor",
"torch.nn.CrossEntropyLoss"
]
] |
KaonToPion/pandas | [
"58f7468626f27b0140834bf09cf743f2fb90d467"
] | [
"pandas/core/frame.py"
] | [
"\"\"\"\nDataFrame\n---------\nAn efficient 2D container for potentially mixed-type time series or other\nlabeled data series.\n\nSimilar to its R counterpart, data.frame, except providing automatic data\nalignment and a host of useful data manipulation methods having to do with the\nlabeling information\n\"\"\"\nf... | [
[
"pandas.core.ops.add_flex_arithmetic_methods",
"pandas.core.common.asarray_tuplesafe",
"pandas.core.construction.extract_array",
"pandas.core.dtypes.common.is_float_dtype",
"pandas.core.aggregation.aggregate",
"pandas.core.dtypes.cast.maybe_convert_platform",
"numpy.empty",
"pandas... |
iraquitan/formal-languages-ufpa | [
"669a238e0116f2b428efe587ee772a26658b0b28"
] | [
"gen_dataset.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport numpy as np\nimport rstr\n\nfrom dfa import DFA\n\n\ndef gen_dataset(fname):\n with open(os.path.expanduser(fname), 'r') as f:\n str_dataset = f.read()\n\n dict_dataset = {}\n cur_id = '0'\n fl = []\n for r in str_dataset.split('\\n'):\n if r ... | [
[
"numpy.in1d",
"numpy.arange",
"numpy.random.choice"
]
] |
TimothyStiles/nrpcalc | [
"42ab25e929d472c2e808dd3bec6430bc80b42a06"
] | [
"nrpcalc/base/maker.py"
] | [
"from collections import namedtuple\r\nfrom itertools import count\r\nfrom glob import glob\r\nfrom time import time, sleep\r\n\r\nfrom .synthesis import Synthesis\r\nfrom .utils import Fold\r\nfrom .kmerSetDB import kmerSetDB\r\nfrom .kmerSetArray import kmerSetArray\r\n\r\nimport ... | [
[
"numpy.random.default_rng"
]
] |
xbuffat/xfields | [
"2b51a544d0b15d98789fe4b14cf0104998607377"
] | [
"examples/exploratory_scripts/009_test_qgaussian/001_with_def_kernels.py"
] | [
"import time\n\nimport numpy as np\n\nimport xobjects as xo\nfrom xfields.contexts import add_default_kernels\n\nfrom pysixtrack.be_beamfields.gaussian_fields import get_Ex_Ey_Gx_Gy_gauss\nfrom pysixtrack.mathlibs import MathlibDefault\n\nctx = xo.ContextCpu()\nctx = xo.ContextCpu(omp_num_threads=4)\n#ctx = xo.Cont... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
ptrcktylr/glasses-detection | [
"c3781942330293f4ee777e9093a647722528d74a"
] | [
"app.py"
] | [
"from tensorflow.keras.applications.mobilenet_v2 import preprocess_input\nfrom tensorflow.keras.preprocessing.image import img_to_array\nfrom tensorflow.keras.models import load_model\nfrom imutils.video import VideoStream\nimport cv2\nimport numpy as np\nimport imutils\nimport time\nimport os\n\n\ndef detect_glass... | [
[
"tensorflow.keras.models.load_model",
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input"
]
] |
sbaechler/thumbor-universalimages | [
"485d56b178534a7a08c238fe0176f67fc2a70a44"
] | [
"tests/test_regions2.py"
] | [
"# coding: utf-8\nfrom __future__ import unicode_literals, absolute_import\n\nimport numpy as np\nfrom .base import FilterTestCase\nfrom os.path import abspath, join, dirname\n\nSTORAGE_PATH = abspath(join(dirname(__file__), 'fixtures'))\n\nfilter_data = {\n 'async': False,\n 'params': ({'regex': '[-]?(?:(?:[... | [
[
"numpy.array"
]
] |
louity/pyscatharm | [
"7d623c3032202f7dd2cc270e7dd0a683bcfd87a3"
] | [
"test/test_scattering.py"
] | [
"\"\"\" This script will test the submodules used by the scattering module\"\"\"\n\nimport torch\nimport unittest\nimport numpy as np\nfrom scatharm.filters_bank import gaussian_3d, solid_harmonic_filters_bank\nfrom scatharm.scattering import SolidHarmonicScattering\nfrom scatharm import utils as sl\n\ngpu_flags = ... | [
[
"torch.norm",
"torch.FloatTensor",
"torch.from_numpy",
"torch.abs",
"torch.cuda.is_available",
"numpy.sqrt"
]
] |
ottofabian/rl_stochastic_search | [
"0e96cdcb5d7a09e789c94f989192ae437d440861"
] | [
"objective_functions/rosenbrock.py"
] | [
"import numpy as np\n\n\nclass Rosenbrock:\n def __init__(self, n):\n self.n = n\n\n def function_eval(self, x):\n assert x.shape[0] == self.n\n\n a = x[1:, :] - x[:-1, :]**2\n b = 1 - x[:-1, :]\n out = np.sum(100 * a**2 + b**2, axis=0)\n\n return out\n"
] | [
[
"numpy.sum"
]
] |
stanmart/project-for-pp4rs | [
"e442a8db9a9cdec8293bc79ce751de79fd38fdb3"
] | [
"src/figures/plot_colored.py"
] | [
"import argparse\nimport pandas as pd\nimport datashader as ds\nimport datashader.transfer_functions as tf\nfrom datashader.utils import export_image\n\n\ndef create_plot(data, out, width):\n \"\"\"Creates a figure of the ZVV transit network using ZVV's color scheme.\n\n Args:\n data: a csv file contai... | [
[
"pandas.read_csv"
]
] |
HaFred/pytorch-cifar | [
"9a032298590b31a7a0ad194311edbf332c8d4318"
] | [
"main_withLog.py"
] | [
"\"\"\"Fred: Train CIFAR10 with PyTorch.\n\nEpoch: 0\n [================================================================>] Step: 1s633ms | Tot: 1m49s | Loss: 1.797 | Acc: 33.956% (16978/50000) 391/391\n [================================================================>] Step: 71ms | Tot: 9s672ms | Loss: 1.445 | A... | [
[
"torch.optim.lr_scheduler.StepLR",
"numpy.sum",
"torch.no_grad",
"torch.save",
"numpy.where",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"numpy.around",
"torch.nn.CrossEntropyLoss"
]
] |
ColCarroll/sampled | [
"7f0a50b7be1ee0e98a01744db40b33fbef749caa"
] | [
"test/test_sampled.py"
] | [
"import numpy as np\nimport pymc3 as pm\nimport theano.tensor as tt\n\nfrom sampled import sampled\nSEED = 1\n\n\ndef test_sampled_one_model():\n @sampled\n def just_a_normal():\n pm.Normal('x', mu=0, sd=1)\n\n kwargs = {\n 'draws': 50,\n 'tune': 50,\n 'init': None\n }\n\n ... | [
[
"numpy.random.normal",
"numpy.testing.assert_allclose",
"numpy.random.seed",
"numpy.mean",
"numpy.std"
]
] |
isjoung/scipy | [
"876a966a2b2016df9f7343f562ec70efa04a37f1"
] | [
"scipy/spatial/tests/test_distance.py"
] | [
"#! /usr/bin/env python\n#\n# Author: Damian Eads\n# Date: April 17, 2008\n#\n# Copyright (C) 2008 Damian Eads\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# 1. Redistributions of source code must retai... | [
[
"numpy.testing.assert_allclose",
"numpy.dot",
"numpy.random.rand",
"scipy.spatial.distance.cosine",
"scipy._lib.six.xrange",
"scipy.spatial.distance.wminkowski",
"numpy.issubdtype",
"scipy._lib.six.u",
"numpy.linalg.norm",
"scipy.spatial.distance.is_valid_y",
"scipy.spa... |
fby1997/Trading-Strategy-Based-on-Sector-Rotation | [
"75146fd598584067cb310a46d6c4f1c4e3c0a322"
] | [
"Correlation scoring model.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\nimport math\r\nfrom functools import reduce\r\nfrom scipy.stats.stats import pearsonr\r\nfrom matplotlib import pyplot as plt\r\n\r\ndata_path=r'./SWI closing price.xlsx'\r\n#columns_list=['801040.SWI','801180.SWI','801710.SWI']\r\ndata=pd.read_excel(data_path)\r\ncolum... | [
[
"numpy.array",
"numpy.log",
"pandas.DataFrame",
"pandas.read_excel",
"matplotlib.pyplot.plot",
"scipy.stats.linregress",
"scipy.stats.stats.pearsonr"
]
] |
adits31/modin | [
"90d277f56027c3825bdd440a07216e97c6b106b9"
] | [
"modin/pandas/test/test_groupby.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pytest\nimport sys\nimport pandas\nimport numpy as np\nimport modin.pandas as pd\nfrom modin.pandas.utils import from_pandas, to_pandas\n\nPY2 = False\nif sys.version_info.major < 3:\n PY2 = ... | [
[
"pandas.DataFrame",
"numpy.random.randint"
]
] |
rossant/galry | [
"6201fa32fb5c9ef3cea700cc22caf52fb69ebe31"
] | [
"experimental/highlevel.py"
] | [
"# import galry.plot as plt\nfrom galry import *\nfrom galry.plot import PlotWidget\n\nimport numpy as np\nimport numpy.random as rdn\n\ninfo_level()\n\nwidget = PlotWidget()\n\nn = 1000\nk = 3\nX = np.linspace(-1., 1., n).reshape((1, -1))\nX = np.tile(X, (k, 1))\nY = .1 * np.sin(20. * X)\nY += np.arange(k).reshape... | [
[
"numpy.sin",
"numpy.tile",
"numpy.linspace",
"numpy.arange"
]
] |
Data-Science-in-Mechanical-Engineering/vision-based-furuta-pendulum | [
"84bfc5a089a2a8ace250f030f0298d45a3f9772f"
] | [
"gym_brt/envs/qube_base_env.py"
] | [
"\"\"\"Base code for all OpenAI Gym environments of the Qube.\n\nThis base class defines the general behavior and variables of all Qube environments.\n\nFurthermore, this class defines if a simulation or the hardware version of the Qube should be used by initialising the\nspecific corresponding Qube class at the va... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros"
]
] |
TaeseongMoon/bf_reimplement | [
"ffcf2700e89fa2691cc78c92b76ef837c982168a"
] | [
"keras_layers/keras_layer_DecodeDetections.py"
] | [
"'''\nA custom Keras layer to decode the raw SSD prediction output. Corresponds to the\n`DetectionOutput` layer type in the original Caffe implementation of SSD.\n\nCopyright (C) 2018 Pierluigi Ferrari\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in complian... | [
[
"tensorflow.exp",
"tensorflow.size",
"tensorflow.range",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.image.non_max_suppression",
"tensorflow.expand_dims",
"tensorflow.cond",
"tensorflow.nn.top_k",
"tensorflow.reshape",
"tensorflow.constant",
"tensorflow.gat... |
pdlan/pytorch | [
"b3124c990886f4b90502329011bf1c7ea013af87"
] | [
"test/run_test.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport copy\nfrom datetime import datetime\nimport json\nimport modulefinder\nimport os\nimport shutil\nimport signal\nimport subprocess\nimport sys\nimport tempfile\n\nimport torch\nfrom torch.utils import cpp_extension\nfrom torch.testing._internal.common_utils import T... | [
[
"torch.distributed.is_available",
"torch.distributed.is_nccl_available",
"torch.distributed.is_mpi_available",
"torch.distributed.is_gloo_available",
"torch.utils.cpp_extension.verify_ninja_availability",
"torch.cuda.device_count",
"torch.testing._internal.common_utils.set_cwd",
"t... |
elsander/civis-python | [
"03b5ec6c2f1bdb3c0555dd5af6741901cd894943"
] | [
"civis/response.py"
] | [
"from __future__ import absolute_import\nimport requests\n\nfrom civis._utils import camel_to_snake\n\n\nclass CivisClientError(Exception):\n def __init__(self, message, response):\n self.status_code = response.status_code\n self.error_message = message\n\n def __str__(self):\n return sel... | [
[
"pandas.DataFrame.from_records",
"pandas.Series"
]
] |
kstoneriv3/autonomous-learning-library-with-rrpg | [
"aaa5403ead52f1175b460fc3984864355c575061"
] | [
"all/experiments/parallel_env_experiment.py"
] | [
"\nimport torch\nimport time\nimport numpy as np\nfrom all.core import State\nfrom .writer import ExperimentWriter, CometWriter\nfrom .experiment import Experiment\nfrom all.environments import VectorEnvironment\nfrom all.agents import ParallelAgent\nimport gym\n\n\nclass ParallelEnvExperiment(Experiment):\n '''... | [
[
"numpy.zeros"
]
] |
salem-devloper/test_mamo1 | [
"936a8b186497b7fd07d8c1a1227d9bbc97788f30"
] | [
"src/data_operations/data_generator.py"
] | [
"import numpy as np\nimport pydicom\nfrom pydicom.data import get_testdata_files\nfrom tensorflow.keras.utils import Sequence\nfrom tensorflow.keras.utils import to_categorical\nfrom skimage.transform import resize\n\nimport config\n\n# Will need to encode categories before calling the Data Generator\n# Also before... | [
[
"numpy.array",
"numpy.empty",
"numpy.random.shuffle"
]
] |
xhochy/onnxmltools | [
"cb2782b155ff67dc1e586f36a27c5d032070c801",
"cb2782b155ff67dc1e586f36a27c5d032070c801"
] | [
"onnxmltools/convert/lightgbm/operator_converters/LightGbm.py",
"onnxmltools/convert/coreml/operator_converters/neural_network/BidirectionalLSTM.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n\nimport copy\nimport numbers\nfrom collections import deque, Counter\nimport ctypes\nimport json\nimport numpy as np\nfrom ...common._apply_operation import (\n apply_div, apply_reshape, apply_sub, apply_cast, apply_identity, apply_clip)\nfrom ...common._registration impo... | [
[
"numpy.array"
],
[
"numpy.concatenate",
"numpy.zeros"
]
] |
fhopfmueller/invertible-resnet-no-visdom | [
"630e886bcd50cc21dee0769d1a5b35100d3ff569"
] | [
"models/utils.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.nn.utils.weight_norm as wn\nfrom torch.nn.modules.batchnorm import _BatchNorm\n\nimport numpy as np\nimport pdb\nimport os\n\n# ------------------------------------------------------------------------------\n# Utility Methods\n# ---... | [
[
"torch.rand",
"numpy.log",
"torch.nn.Softmax",
"torch.max",
"torch.sign",
"torch.abs",
"torch.ones_like",
"torch.cuda.FloatTensor",
"torch.log",
"torch.exp",
"torch.masked_select"
]
] |
workingyifei/DAND | [
"1985d4c73fabd5f08f54b922e73a9306e09c77a5"
] | [
"Intro_to_Machine_Learning/ENV/lib/python2.7/site-packages/sklearn/linear_model/tests/test_logistic.py"
] | [
"import numpy as np\nimport scipy.sparse as sp\nfrom scipy import linalg, optimize, sparse\nfrom sklearn.datasets import load_iris, make_classification\nfrom sklearn.metrics import log_loss\nfrom sklearn.model_selection import StratifiedKFold\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.utils impor... | [
[
"sklearn.linear_model.logistic.LogisticRegressionCV",
"sklearn.utils.testing.raises",
"numpy.dot",
"sklearn.linear_model.logistic._logistic_loss",
"sklearn.datasets.load_iris",
"numpy.mean",
"numpy.logspace",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.count_nonzero",
... |
vrishk/epidemic-simulator | [
"c6b7843136392cea0079d5a0636a1383d0ecb691"
] | [
"simulator/python_scripts_CPP/calibrate.py"
] | [
"#Copyright [2020] [Indian Institute of Science, Bangalore & Tata Institute of Fundamental Research, Mumbai]\n#SPDX-License-Identifier: Apache-2.0\n\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom scipy.optimize import least_squares\n\ndef find_slope(data):\n... | [
[
"numpy.array",
"numpy.log",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"numpy.logical_and",
"numpy.exp",
"numpy.where",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"pandas.read_csv",
"scipy.optim... |
armaandhull/great_expectations | [
"257d0a06cdae09a6b20aa1f6554649de10409fa7"
] | [
"tests/conftest.py"
] | [
"import datetime\nimport json\nimport locale\nimport os\nimport shutil\nfrom types import ModuleType\nfrom typing import Union\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom freezegun import freeze_time\n\nimport great_expectations as ge\nfrom great_expectations.core import (\n ExpectationConfig... | [
[
"pandas.DataFrame"
]
] |
ryosukeminami/hamming-code-app | [
"33f87f2cb58a13ec4ee7406546bf67353a8b71a9"
] | [
"src/hammingclasses.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nimport re\nimport random\n\n# ---- Hamming code classes --- #\n\n# This code assumes that words and codewords are encoded as row vectors.\n# Thus, word w is encoded into codeword c with w.G and c is decoded with c.H.\n\n# ---- Hamming encoder class --- #\n\nclass Hammi... | [
[
"numpy.all",
"numpy.dot",
"numpy.array_str",
"numpy.zeros"
]
] |
Fanxingye/AutoTimm | [
"68230fce773e6010bbbf705cdab9ff931e1f9934"
] | [
"autotimm/models/common.py"
] | [
"import copy\nfrom collections import OrderedDict\nfrom dataclasses import dataclass\nfrom typing import Optional\nimport torch\nimport warnings\nfrom torch import nn\nimport torch.nn.functional as F\n\ntry:\n from pytorch_quantization import nn as quant_nn\nexcept ImportError as e:\n warnings.warn(\n ... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.Identity",
"torch.nn.Sigmoid",
"torch.no_grad",
"torch.nn.functional.dropout",
"torch.add",
"torch.ones",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.mean",
"torch.addcmul"
]
] |
robfalck/aoc2019 | [
"1f8ed9432d4d52d02843b38480b86d191a006e1c"
] | [
"aoc2019/day13/analyze_scoring.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\n\ndata = np.loadtxt('scoring.txt')\n\nprint(data)\n\nblocks_remaining = data[:, 0]\nscore = data[:, 1]\n\nplt.plot(score, blocks_remaining)\n\npoly = np.poly1d(np.polyfit(blocks_remaining, score, 1))\n\nprint(poly(0))\n\nprint(np.diff(score))\n\nplt.show()\n\n... | [
[
"matplotlib.pyplot.plot",
"numpy.diff",
"numpy.loadtxt",
"numpy.polyfit",
"matplotlib.pyplot.show"
]
] |
MarletteFunding/aws-kube-codesuite | [
"ab4e5ce45416b83bffb947ab8d234df5437f4fca"
] | [
"src/networkx/algorithms/centrality/katz.py"
] | [
"# coding=utf8\n# Copyright (C) 2004-2017 by\n# Aric Hagberg <hagberg@lanl.gov>\n# Dan Schult <dschult@colgate.edu>\n# Pieter Swart <swart@lanl.gov>\n# All rights reserved.\n# BSD license.\n#\n# Authors: Aric Hagberg (aric.hagberg@gmail.com)\n# Pieter Swart (swart@lanl.gov)\n# Sa... | [
[
"numpy.linalg.norm",
"numpy.eye"
]
] |
quantum-tinkerer/qsymm | [
"56be9ec97ff1046f7138316e05dcf6cd43477224"
] | [
"qsymm/hamiltonian_generator.py"
] | [
"from collections import OrderedDict\nimport numpy as np\nimport sympy\nimport itertools as it\nimport scipy.linalg as la\nfrom copy import deepcopy\nimport tinyarray as ta\n\nfrom .linalg import matrix_basis, nullspace, sparse_basis, family_to_vectors, rref, allclose\nfrom .model import Model, BlochModel, BlochCoe... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros_like",
"numpy.zeros",
"numpy.eye",
"numpy.any",
"numpy.log10",
"numpy.vstack"
]
] |
zoni/obsidiantools | [
"5c86662c7cab099cef987211ba6f92ad40827c72"
] | [
"tests/test_api_vault_stub.py"
] | [
"import pytest\nimport numpy as np\nimport pandas as pd\nimport os\nfrom pathlib import Path\nfrom pandas.testing import assert_series_equal\n\n\nfrom obsidiantools.api import Vault\n\n# NOTE: run the tests from the project dir.\nWKD = Path(os.getcwd())\n\n\n@pytest.fixture\ndef expected_metadata_dict():\n retur... | [
[
"pandas.testing.assert_series_equal"
]
] |
kandeldeepak46/Fine-Tuning-BERT-For-Sentiment-Analysis-Served-With-fastAPI | [
"2bcd18649b57a8d0a8c6207344d43b5e26f6fda8"
] | [
"sentiment_analyzer/classifier/model.py"
] | [
"import json\n\nimport torch\nimport torch.nn.functional as F\nfrom transformers import BertTokenizer\n\nfrom .sentiment_classifier import SentimentClassifier\n\nwith open(\"config.json\") as json_file:\n config = json.load(json_file)\n\n\nclass Model:\n def __init__(self):\n\n self.device = torch.devi... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.load",
"torch.max"
]
] |
mit-quest/nuclear-core-optimization | [
"400f2cb09606cb132a06583e4825e7f58e50a968"
] | [
"util.py"
] | [
"import os\nimport math\nimport json\nimport datetime\nimport copy\nimport pandas as pd\nimport numpy as np\nfrom collections import defaultdict\nfrom ray import tune\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import cm\n\ndef create_dict(filename):\n loaded = json.load(open(filename))\n result ... | [
[
"numpy.zeros",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.mean",
"numpy.std",
"pandas.read_json",
"matplotlib.pyplot.ylabel"
]
] |
ErikKratzCth/Deep-SVDD | [
"f77209b85f654aa68d29ab636ecb422207f437e1"
] | [
"src/opt/sgd/train.py"
] | [
"import time\nimport numpy as np\n\nfrom config import Configuration as Cfg\nfrom utils.monitoring import performance, ae_performance\nfrom utils.visualization.diagnostics_plot import plot_diagnostics\n\n\ndef train_network(nnet):\n\n if Cfg.reconstruction_loss:\n nnet.ae_n_epochs = nnet.n_epochs\n ... | [
[
"numpy.concatenate",
"numpy.empty",
"numpy.random.choice",
"numpy.sum",
"numpy.mean"
]
] |
apurl1/Deep-SVDD-PyTorch | [
"9cbda00a90ae5ee85d516b96a4cc479adc0e368d"
] | [
"src/networks/wheel_LeNet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom base.base_net import BaseNet\n\n\nclass Wheel_LeNet(BaseNet):\n\n def __init__(self):\n super().__init__()\n\n self.rep_dim = 32\n self.pool = nn.MaxPool2d(2, 2)\n\n self.conv1 = nn.Conv2d(1, 16, 5, bias=Fal... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.nn.Conv2d",
"torch.nn.functional.leaky_relu"
]
] |
FSMLP/PyOCR | [
"c61c9f90507b09686c13efe235fe5de644d23b63"
] | [
"predict/predict_utility.py"
] | [
"# Copyright (c) 2020 FSMLP Authors. All Rights Reserved.\n\nimport argparse\nimport os, sys\n\nimport logging\nimport cv2\nimport numpy as np\nimport json\nfrom PIL import Image, ImageDraw, ImageFont\nimport math\nimport unidecode\n\nimport onnxruntime\nfrom paddle.fluid.core import PaddleTensor\nfrom paddle.fluid... | [
[
"numpy.array"
]
] |
cdeepakroy/SMQTK | [
"ef5cec7399e9766f95ff06fe122471a51fc4b2d8"
] | [
"python/smqtk/utils/file_utils.py"
] | [
"import csv\nimport errno\nimport os\nimport numpy\nimport re\nimport tempfile\nimport threading\nimport time\n\nfrom smqtk.utils import SmqtkObject\n\n\ndef safe_create_dir(d):\n \"\"\"\n Recursively create the given directory, ignoring the already-exists\n error if thrown.\n\n :param d: Directory file... | [
[
"numpy.array",
"numpy.zeros"
]
] |
nipunbatra/pyro | [
"d5b0545c4f992d435692080db6969314a2c32f05",
"d5b0545c4f992d435692080db6969314a2c32f05",
"d5b0545c4f992d435692080db6969314a2c32f05"
] | [
"examples/eight_schools/mcmc.py",
"pyro/contrib/timeseries/lgssm.py",
"pyro/contrib/minipyro.py"
] | [
"# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport argparse\nimport logging\n\nimport data\nimport torch\n\nimport pyro\nimport pyro.distributions as dist\nimport pyro.poutine as poutine\nfrom pyro.infer import MCMC, NUTS\n\nlogging.basicConfig(format=\"%(message)s\"... | [
[
"torch.zeros",
"torch.ones"
],
[
"torch.zeros",
"torch.no_grad",
"torch.ones",
"torch.eye",
"torch.distributions.MultivariateNormal",
"torch.matmul",
"torch.randn",
"torch.cumsum"
],
[
"torch.Size",
"torch.get_rng_state",
"numpy.random.seed",
"torch.... |
YipengHu/DeepReg | [
"6c610a29c813448be25d384555f5b9bbb6a3bd2a"
] | [
"test/unit/test_interface.py"
] | [
"# coding=utf-8\n\n\"\"\"\nTests for deepreg/dataset/loader/interface.py\n\"\"\"\nfrom test.unit.util import is_equal_np\n\nimport numpy as np\nimport pytest\n\nfrom deepreg.dataset.loader.interface import (\n AbstractPairedDataLoader,\n AbstractUnpairedDataLoader,\n DataLoader,\n FileLoader,\n Gener... | [
[
"numpy.random.random",
"numpy.asarray"
]
] |
SvenSommer/LegoBrickRecognizer | [
"5498f968a709736998e1d7f4e0d96e030696ae68"
] | [
"third_party/callbacks.py"
] | [
"import os\nimport torch\nimport random\nimport numpy as np\nfrom functools import reduce\nfrom visdom import Visdom\nfrom torchvision.transforms import ToPILImage, ToTensor\nfrom shutil import copyfile\nimport torch.nn.functional as F\n\n\ndef add_prefix(path, pref):\n \"\"\"\n Add prefix to file in path\n ... | [
[
"numpy.array"
]
] |
illidanlab/tensorpack | [
"99764b11afc9a7223f9f5fe0a361761a8c5b61fb"
] | [
"examples/A3C-Gym/train-atari-qfunc-supervised.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: train-atari.py\n# Author: Yuxin Wu\n\nimport argparse\nimport cv2\nimport gym\nimport multiprocessing as mp\nimport numpy as np\nimport pickle\nimport os\nimport six\nimport sys\nimport uuid\nimport tensorflow as tf\nfrom six.moves import queue\n\nfrom tensor... | [
[
"tensorflow.constant_initializer",
"numpy.load",
"tensorflow.reshape",
"tensorflow.nn.softmax",
"tensorflow.one_hot",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.compat.v1.summary.FileWriter",
"tensorflow.train.latest_checkpoint",
"tensorflow.t... |
hemapriyadharshini/Chatbot_Nltk_Tensorflow_Keras_Numpy_Tkinter | [
"e9b2b577986490208b42cc24fe0303b9564d198d"
] | [
"train_chatbot.py"
] | [
"import nltk #Import Natural Language tool Kit library\nfrom nltk.stem import WordNetLemmatizer #Converts words to their root words Ex: Believing to Belief\nlemmatizer = WordNetLemmatizer()\nimport json\nimport pickle\n\nimport numpy as np\nfrom keras import *\nfrom keras.models import Sequential # plain stack of l... | [
[
"numpy.array"
]
] |
Barigamb738/PrisonersDilemmaTournament | [
"22834192a30cbefdef4f06f41eea5ef7ec3a0652"
] | [
"code/strats/betterDetective.py"
] | [
"import random\n\nimport numpy as np\n\n# A modification of Detective. Instead of using Tit for Tat when the opponent betrays you it uses the much more agressive Forgiving Tit for Tat which will only forgive you when you are nice for two consecutive turns\n#\n# Better DETECTIVE: First: I analyze you. I start:\n# Co... | [
[
"numpy.count_nonzero"
]
] |
jiweiqi/covid19-energy | [
"61bc090773d4f841a1082593805fc574a672009d"
] | [
"PODA_Model_Code/Check_6_Google EIA_Correlation.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Jun 11 21:31:58 2020\r\n\r\n@author: hexx\r\n\"\"\"\r\n\r\n\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat May 9 18:19:50 2020\r\n\r\n@author: hexx\r\n\"\"\"\r\n\r\nimport pandas as pd\r\nimport numpy as np\r\nimport os\r\nfrom scipy.optimize import mini... | [
[
"pandas.to_datetime",
"pandas.read_excel",
"numpy.load",
"matplotlib.pyplot.figure",
"pandas.DateOffset"
]
] |
armandmgt/IA-pool | [
"3252924783846dd1266c8477682f8bb5d984f298"
] | [
"d04/e07.py"
] | [
"import matplotlib.pyplot as plt\n\n\nif __name__ == '__main__':\n\tdata_x = [-2, -1, 0, 1, 2.5, 3.5, 4, 5, 6, 7]\n\tdata_y = [202.5, 122.5, 62.5, 22.5, 0, 10.0, 22.5, 62.5, 122.5, 202.5]\n\tdata_der = [-45, -35, -25, -15, 0, 10, 15, 25, 35, 45]\n\n\tfor x, y, d in zip(data_x, data_y, data_der):\n\t\tplt.plot(x, y,... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
jayelm/m2vae | [
"e5512dcf6180d849ec830cbae0c1398e8c957145"
] | [
"m2vae/train.py"
] | [
"\"\"\"\nTrain an m2vae model.\n\"\"\"\n\nimport os\nimport sys\nfrom collections import defaultdict\nimport contextlib\nfrom itertools import combinations\n\nimport torch\n\nimport numpy as np\nfrom tqdm import tqdm\n\nimport pretty_midi\n\nimport data\nimport mvae\nimport models\nimport util\nimport io_util\nimpo... | [
[
"numpy.bincount",
"numpy.concatenate",
"torch.zeros",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.sum",
"numpy.where"
]
] |
JustHarsh/Autoneu | [
"953d22ff07384d546555e8b9f232215a2b3b2fac"
] | [
"Code/train.py"
] | [
"# Using Tensorflow 2.x\n# Make sure to use the latest version of Tensorflow\n\n# Using Tensorflow 2.x\n\nimport tensorflow as tf\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\n\nmodel = tf.keras.Sequential([\n tf.keras.layers.Conv2D(64, (2, 2), input_shape=(64, 64, 3)),\n tf.keras.laye... | [
[
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Dropout"
]
] |
rahulpalli2806/datasets | [
"1465d97b2e8b2a030f5df7872e8390b90dba8926",
"1465d97b2e8b2a030f5df7872e8390b90dba8926"
] | [
"tensorflow_datasets/testing/fake_data_generation/kitti.py",
"tensorflow_datasets/testing/fake_data_generation/dsprites.py"
] | [
"# coding=utf-8\n# Copyright 2020 The TensorFlow Datasets 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 ... | [
[
"numpy.random.rand",
"numpy.random.uniform",
"tensorflow.compat.v2.image.encode_png",
"numpy.random.choice"
],
[
"numpy.ascontiguousarray",
"numpy.random.RandomState"
]
] |
fancyicookie/HDRUNet | [
"95c018408752caceeed37b756fd51c9f465a53ff"
] | [
"codes/data/LQ_condition_dataset.py"
] | [
"import numpy as np\nimport torch\nimport torch.utils.data as data\nimport data.util as util\n\n\nclass LQ_Dataset(data.Dataset):\n '''Read LQ images only in the test phase.'''\n\n def __init__(self, opt):\n super(LQ_Dataset, self).__init__()\n self.opt = opt\n self.paths_LQ = None\n ... | [
[
"numpy.transpose"
]
] |
A-Malone/genetic-neural-nets | [
"e8284cc820e6f67a52b4064d7e7320eb29629791"
] | [
"colearning/game/coopgame.py"
] | [
"import numpy as np\nfrom pybrain.tools.shortcuts import buildNetwork\nimport pygame\n\nclass CoopGame(object):\n \"\"\" Class that runs and renders the game \"\"\"\n\n window = None\n\n DIM = (600, 600)\n\n FPS = 24\n DT = 1.0/FPS\n\n players = []\n bullets = []\n\n def __init__(self, rende... | [
[
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
ikingye/sqlflow | [
"d3a2064ceb6092208785b5dd787c824cc1b49782"
] | [
"python/runtime/db_test.py"
] | [
"# Copyright 2020 The SQLFlow Authors. All rights reserved.\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 ap... | [
[
"numpy.array",
"numpy.array_equal"
]
] |
zhoutunhe/Savu | [
"fa214673a65d48f79d83f060938ca13bb6b954d2"
] | [
"savu/data/data_structures/plugin_data.py"
] | [
"# Copyright 2014 Diamond Light Source Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"numpy.ceil",
"numpy.prod",
"numpy.arange",
"numpy.sort",
"numpy.dtype"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.