repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Ahren09/RecBole
[ "f04084b8d2cffcb79eb9e4b21325f8f6c75c638e" ]
[ "recbole/model/general_recommender/recvae.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 2021/2/28\n# @Author : Lanling Xu\n# @Email : xulanling_sherry@163.com\n\nr\"\"\"\nRecVAE\n################################################\nReference:\n Shenbin, Ilya, et al. \"RecVAE: A new variational autoencoder for Top-N recommendations with implicit feedback.\" In WSD...
[ [ "torch.nn.functional.normalize", "torch.sigmoid", "numpy.log", "torch.Tensor", "torch.nn.functional.dropout", "torch.zeros", "torch.nn.functional.log_softmax", "torch.zeros_like", "torch.nn.LayerNorm", "torch.exp", "torch.nn.Linear", "torch.arange", "torch.stack...
davemc84/Cirq
[ "447b2c762cc2820dd28abb3bd2bc785d36bae39a" ]
[ "cirq/sim/simulator.py" ]
[ "# Copyright 2018 The Cirq Developers\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.array" ] ]
ntellakula/fixed_matched_markets
[ "187827e614f398d414019a68ec093a39ca8fadfd" ]
[ "matched_markets_fixed/utils.py" ]
[ "# Copyright 2020 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "numpy.abs", "pandas.Timestamp", "numpy.arange", "pandas.api.types.is_numeric_dtype", "pandas.DataFrame", "numpy.copy", "numpy.log10", "numpy.floor", "pandas.date_range", "numpy.array", "pandas.to_numeric" ] ]
wavelets/bird
[ "ae0fe470a6517e34bfe8713fe389f0a2dd223afe" ]
[ "bird/_bird.py" ]
[ "# -*- coding: utf-8 -*-\n# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Manuel Moussallam <manuel.moussallam@gmail.com>\n#\n# Algorithm presented here are described in:\n# Blind Denoising with Random Greedy Pursuits.\n# Moussallam, M., Gramfort, A., Daudet, L., & Richard, G. (2...
[ [ "numpy.log2", "numpy.sqrt", "numpy.abs", "numpy.sort", "numpy.array_split", "numpy.mean", "numpy.zeros_like", "scipy.linalg.norm", "numpy.array", "numpy.random.RandomState", "numpy.zeros" ] ]
hzclarksm/hublib
[ "e8f2168d80464b6343b980e30fdd552d1b0c2479" ]
[ "hublib/rappture/test/test_number.py" ]
[ "from __future__ import print_function\nimport pytest\nimport os, sys\nimport numpy as np\n\nsys.path.insert(0, os.path.abspath('../../..'))\nimport hublib.rappture as rappture\nfrom hublib import ureg, Q_\n\n\nclass TestNumber:\n\n @classmethod\n def setup_class(cls):\n print(\"cls\", cls)\n cl...
[ [ "numpy.allclose", "numpy.isclose" ] ]
Shubham-0212/ga-learner-dsmp-repo
[ "ed2ebf13fb959746be3b97a6ece0a1784ebb0166" ]
[ "Banking-Inference/code.py" ]
[ "# --------------\nimport pandas as pd\r\nimport scipy.stats as stats\r\nimport math\r\nimport numpy as np\r\nimport warnings\r\n\r\nwarnings.filterwarnings('ignore')\r\n#Sample_Size\r\nsample_size=2000\r\n\r\n#Z_Critical Score\r\nz_critical = stats.norm.ppf(q = 0.95) \r\n\r\n\r\n# path [File location varia...
[ [ "scipy.stats.chi2.ppf", "scipy.stats.norm.ppf", "pandas.read_csv", "numpy.sqrt", "scipy.stats.chi2_contingency", "pandas.Series", "matplotlib.pyplot.subplots", "numpy.array" ] ]
HuchieWuchie/Mask_RCNN
[ "93f74c5fae72852563b1d3e0e22428d6abf86dc2" ]
[ "mrcnn/utils.py" ]
[ "\"\"\"\nMask R-CNN\nCommon utility functions and classes.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport sys\nimport os\nimport logging\nimport math\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport sci...
[ [ "numpy.dot", "numpy.minimum", "numpy.sqrt", "tensorflow.stack", "numpy.around", "tensorflow.cast", "numpy.cumsum", "numpy.concatenate", "numpy.max", "numpy.all", "numpy.any", "numpy.exp", "numpy.where", "numpy.divide", "numpy.pad", "numpy.reshape", ...
hduliufan/work
[ "951a69aad5de3387c26fabe417a939349def3df6" ]
[ "one_one.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom getlen_bit import getlen\nfrom begain import getbegain\nfrom x1x2 import x1_x2\nfrom exchange_normal import variation\nfrom fitvalue import fitvalue\n#计算精度(人为设定)0.001\ns=0.0001\na1=-3\na2=4.1\nb1=12.1\nb2=5.8\n#种群规模\nN=20\n#-3<=x1<=12.1 4.1<=x2<=5.8\n#二进制...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.max", "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.where", "matplotlib.pyplot.ylabel" ] ]
buf1024/OpenData
[ "6268a5f7bee88cc943b3a05858b8ab6f371e8e3b" ]
[ "opendatatools/stock/stock_interface.py" ]
[ "# encoding: utf-8\n\nimport datetime\n\nfrom .stock_agent import SHExAgent, SZExAgent, CSIAgent, XueqiuAgent, SinaAgent, CNInfoAgent, EastMoneyAgent\nfrom opendatatools.common import get_current_day\n\nshex_agent = SHExAgent()\nszex_agent = SZExAgent()\ncsi_agent = CSIAgent()\nxq_agent = XueqiuAgent()\n...
[ [ "pandas.DatetimeIndex", "pandas.concat", "pandas.DataFrame" ] ]
AWehrhahn/PyPSG
[ "adaa1e50998b3366541e16143034d6acdc379bb3" ]
[ "pypsg/psg.py" ]
[ "# ---------------------------------------------------\n# Planet Spectrum Generator Interface\n# PSG multiple-scattering model: https://psg.gsfc.nasa.gov/helpmodel.php\n# PSG databases: https://psg.gsfc.nasa.gov/helpatm.php\n# PSG API driver: https://psg.gsfc.nasa.gov/helpapi.php\n# --------------------------------...
[ [ "numpy.array2string", "numpy.array", "numpy.genfromtxt" ] ]
nybupt/athena
[ "2808f5060831382e603e5dc5ec6a9e9d8901a3b2", "2808f5060831382e603e5dc5ec6a9e9d8901a3b2" ]
[ "src/models/test.py", "src/models/detection_as_defense.py" ]
[ "import os\nimport sys\nimport time\n\nimport numpy as np\n\nfrom utils.config import *\nfrom utils.util import *\n\n\ndef usage():\n print(\n \"====================================================================================================================\")\n print(\n \"python <this scrip...
[ [ "numpy.max", "numpy.argmax", "numpy.zeros", "numpy.mean" ], [ "numpy.max", "numpy.argmax", "numpy.zeros", "scipy.spatial.distance_matrix" ] ]
And0k/vaex
[ "298d0d5c6ace0ea4c335339fef10ba7ee54cc077" ]
[ "packages/vaex-core/vaex/dataframe.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function\nimport io\nimport difflib\nimport base64\nfrom typing import Iterable\nimport os\nimport math\nimport time\nimport itertools\nimport functools\nimport collections\nimport sys\nimport platform\nimport warnings\nimport re\nfrom functools impor...
[ [ "numpy.can_cast", "numpy.sqrt", "numpy.linspace", "numpy.asarray", "numpy.cumsum", "pandas.DataFrame", "numpy.all", "numpy.ma.array", "numpy.ma.getmaskarray", "numpy.unique", "numpy.sin", "numpy.ceil", "numpy.argmax", "numpy.asanyarray", "numpy.interp", ...
zhigenzhao/stable-baselines3
[ "a69a4f0497849d9c20f6b77870ca77ae92f5c7bb" ]
[ "Kuka_examples/plot_monitor.py" ]
[ "from matplotlib import pyplot as plt\nimport numpy as np\nimport csv\n\n\ndef main():\n filename = \"/home/zhigen/code/stable-baselines3/Kuka_examples/saved_models/monitor (copy).csv\"\n with open(filename) as csvfile:\n training_monitor = csv.reader(csvfile)\n \n reward = []\n fo...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "numpy.ones_like", "matplotlib.pyplot.yscale", "matplotlib.pyplot.xlim", "numpy.std", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "numpy.array", "matplotlib.pyplot.show", "matplotlib.p...
craigmayhew/aws_transcribe_to_docx
[ "1aded9a7c0f14b8242991e564aec3275fc9f83f9" ]
[ "tscribe/__init__.py" ]
[ "\"\"\" Produce Word Document transcriptions using the automatic speech recognition from AWS Transcribe. \"\"\"\n\nfrom docx import Document\nfrom docx.shared import Cm, Mm, Inches, RGBColor\nfrom docx.enum.text import WD_ALIGN_PARAGRAPH\nimport json, datetime\nimport matplotlib.pyplot as plt\nimport statistics\n\n...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
FloWuenne/semi-auto-image-annotation-tool
[ "f48f521c480a436bafb148b4ecaf9f2c4a898211" ]
[ "main.py" ]
[ "\"\"\"\nCopyright {2018} {Viraj Mavani}\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\nfrom tkinter import *\nfro...
[ [ "tensorflow.compat.v1.Session", "numpy.array", "tensorflow.compat.v1.ConfigProto", "numpy.expand_dims" ] ]
czy779509408/text-detection-ctpn
[ "b94c3af3d5105b5a9ff4d4a00edf92b2d55ee4cf" ]
[ "lib/utils/blob.py" ]
[ "\"\"\"Blob helper functions.\"\"\"\nimport numpy as np\nimport cv2\nfrom ..fast_rcnn.config import cfg\n\ndef im_list_to_blob(ims):\n \"\"\"Convert a list of images into a network input.\n\n Assumes images are already prepared (means subtracted, BGR order, ...).\n \"\"\"\n max_shape = np.array([im.shap...
[ [ "numpy.min", "numpy.round", "numpy.max", "numpy.random.rand", "numpy.array", "numpy.zeros" ] ]
qhjqhj00/ConV2020
[ "680c4b8eb9e9568471e414f6e763e838bca0025e" ]
[ "to_images.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport pandas as pd\nfrom matplotlib import pyplot as plt \nimport os\nfrom pypinyin import lazy_pinyin\nfrom matplotlib.ticker import MaxNLocator\nimport re\n\ntarget_dir = './res/'\npicture = './images/'\n\nfunc = lambda z:dict([(x, y) for y, x in z.items()])\n \ndef plo...
[ [ "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.use", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.ticker.MaxNLocator", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
cbrnr/mne-qt-browser
[ "8ed661d2317d0bfc4c25fdbcabcdf2ea581d2f1c" ]
[ "mne_qt_browser/_pg_figure.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Base classes and functions for 2D browser backends.\"\"\"\n\n# Author: Martin Schulz <dev@earthman-music.de>\n#\n# License: BSD-3-Clause\n\nimport datetime\nimport functools\nimport gc\nimport math\nimport platform\nimport sys\nfrom ast import literal_eval\nfrom collections import Or...
[ [ "numpy.asarray", "numpy.in1d", "scipy.stats.zscore", "numpy.concatenate", "numpy.max", "numpy.mean", "numpy.argmin", "numpy.searchsorted", "numpy.where", "numpy.ones_like", "numpy.clip", "numpy.unique", "numpy.arange", "numpy.intersect1d", "numpy.copy", ...
k-fillmore/pandas
[ "67d4cae17bec45e84b9cf51bcf4fb5bbe293b26f" ]
[ "pandas/tests/frame/test_reductions.py" ]
[ "from datetime import timedelta\nfrom decimal import Decimal\n\nfrom dateutil.tz import tzlocal\nimport numpy as np\nimport pytest\n\nfrom pandas.compat import is_platform_windows\nimport pandas.util._test_decorators as td\n\nimport pandas as pd\nfrom pandas import (\n Categorical,\n DataFrame,\n Index,\n ...
[ [ "pandas._testing.assert_almost_equal", "pandas.to_datetime", "pandas.Series", "pandas.DataFrame", "numpy.random.randn", "numpy.iinfo", "numpy.var", "pandas.isna", "pandas._testing.assert_frame_equal", "pandas._testing._make_skipna_wrapper", "numpy.random.randint", "...
mathemakitten/tensorflow
[ "e62a6a8be2f9cfb79913bdb64f99efb5e88df0df" ]
[ "tensorflow/python/ops/array_ops.py" ]
[ "# Copyright 2015 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.ops.gen_math_ops.select_v2", "tensorflow.python.util.tf_decorator.make_decorator", "tensorflow.python.ops.gen_array_ops.list_diff", "tensorflow.python.framework.ops.RegisterGradient", "tensorflow.python.ops.gen_array_ops.strided_slice", "tensorflow.python.ops.gen_array_o...
frantisekvasa/epimix_rapid_processing
[ "b4bc3cc8b2f473fd8f9538376b4ffbd6a5e9374f" ]
[ "EPImix_analysis/epimix_functions.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 13 10:38:35 2020\n\n@author: Frantisek Vasa (fdv247@gmail.com)\n\nAdditional functions for manuscript \"Rapid processing and quantitative evaluation of multicontrast EPImix scans for adaptive multimodal imaging\"\n\n\"\"\"\n\n# Additional ...
[ [ "numpy.nanmedian", "numpy.absolute", "matplotlib.colors.to_rgb", "numpy.reshape", "scipy.stats.pearsonr", "matplotlib.pyplot.subplots", "matplotlib.colors.Normalize", "numpy.ones", "matplotlib.pyplot.axes", "matplotlib.colorbar.ColorbarBase", "matplotlib.pyplot.savefig"...
jessicapetrochuk/Detectron_2_Image_Segmentation
[ "67ab6fb03b90a298367c86eab0d89a2d8438169a" ]
[ "model.py" ]
[ "import torch\nimport natsort\nimport numpy as np\nimport pycocotools\nfrom PIL import Image\nimport os, cv2, random\nimport torchvision.ops as ops\nfrom detectron2 import model_zoo\nfrom detectron2.config import get_cfg\nfrom detectron2.structures import BoxMode\nfrom detectron2.engine import DefaultTrainer\nfrom ...
[ [ "numpy.asarray", "torch.__version__.split", "numpy.where", "torch.tensor" ] ]
eldrin/aarms
[ "bdd5455ac8dcfc1fe91a12fdd132b74e6c37609d" ]
[ "tests/test_rsvd.py" ]
[ "import unittest\n\nimport os\nos.environ['NUMBA_NUM_THREADS'] = '1'\n\nimport numpy as np\nfrom scipy import sparse as sp\n\nfrom aarms.models.rsvd import RSVD, RSVDSPPMI\nfrom aarms.models.transform import sppmi\n\nfrom base_test import TestAARMS\n\n\nclass TestRSVD(TestAARMS):\n \"\"\"\n \"\"\"\n def te...
[ [ "scipy.sparse.csr_matrix" ] ]
luispedro/SemiBin
[ "7a5c9c68bb29ec27b64d7b34ed88a2eab921314b" ]
[ "integration-tests/generate_data_coassembly_command.py" ]
[ "import os\nimport pandas as pd\nimport subprocess\n\n\n### Input fa\nsubprocess.check_call('SemiBin generate_data_single -i test/coassembly_sample_data/input.fasta -o output_coassembly_fa -m 2500 --ratio 0.05 --ml-threshold 4000 -p 1 -b test/coassembly_sample_data/input.sorted*.bam', shell=True)\n\ndata = pd.read_...
[ [ "pandas.read_csv" ] ]
rajivmanivannan/facenet
[ "4a896201dba3f8caf64ba4d5004d60eaf9aefd78" ]
[ "src/generative/modify_attribute.py" ]
[ "# MIT License\n# \n# Copyright (c) 2017 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, co...
[ [ "tensorflow.Graph", "tensorflow.local_variables_initializer", "tensorflow.shape", "scipy.misc.imsave", "tensorflow.image.resize_images", "tensorflow.train.start_queue_runners", "tensorflow.train.Coordinator", "tensorflow.exp", "tensorflow.placeholder", "tensorflow.trainable...
dswigh/summit
[ "a1cecdd41df8119005173b46ac45fb22472628d6" ]
[ "summit/strategies/entmoot.py" ]
[ "from summit.strategies.base import Strategy\nfrom summit.domain import *\nfrom summit.utils.dataset import DataSet\n\nimport string\nimport numpy as np\nimport pandas as pd\n\n\nclass ENTMOOT(Strategy):\n \"\"\"\n Single-objective Bayesian optimization, using gradient-boosted trees\n instead of Gaussian p...
[ [ "numpy.min", "numpy.asarray", "pandas.DataFrame", "numpy.argmin", "numpy.array", "numpy.vstack" ] ]
AlejandroCN7/sinergym
[ "4e89e478b5c939323e7ddf6a6ecf25a9a13251c6" ]
[ "sinergym/utils/callbacks.py" ]
[ "\"\"\"Custom Callbacks for stable baselines 3 algorithms.\"\"\"\n\nimport os\nfrom typing import Optional, Union\n\nimport gym\nimport numpy as np\nfrom stable_baselines3.common.callbacks import BaseCallback, EvalCallback\nfrom stable_baselines3.common.env_util import is_wrapped\nfrom stable_baselines3.common.vec_...
[ [ "numpy.std", "numpy.savez", "numpy.mean", "numpy.sum" ] ]
ka10ryu1/keytouch_cam
[ "042b0caacb5af31cfa9c71ae012d58e798777c8d" ]
[ "Tools/concat.py" ]
[ "#!/usr/bin/env python3\n# -*-coding: utf-8 -*-\n#\nhelp = '複数の画像を任意の行列で結合する'\n#\n\nimport os\nimport sys\nimport cv2\nimport argparse\nimport numpy as np\n\n[sys.path.append(d) for d in ['./Tools/', '../Tools/'] if os.path.isdir(d)]\nimport func as F\nimport imgfunc as IMG\n\n\ndef command():\n parser = argpars...
[ [ "numpy.hstack", "numpy.max", "numpy.array", "numpy.zeros", "numpy.vstack" ] ]
cclai999/pyxl-stock
[ "3c0bb2f3e17f88770d16e9cb7171d56757a451b4" ]
[ "p1-stock-code/stock-code.py" ]
[ "import pandas as pd\nfrom openpyxl import load_workbook\n\nfrom tools import get_html_to_file\n\nurl1 = \"https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=1&issuetype=1&industry_code=&Page=1&chklike=Y\"\nurl2 = \"https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isin...
[ [ "pandas.read_html" ] ]
amazing89/mathtoolbox
[ "8904bb06ced2ac501594f9574ef1ba3454b8e38e" ]
[ "python-examples/classical-mds-image.py" ]
[ "import pymathtoolbox\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport seaborn as sns\nfrom PIL import Image\nfrom scipy.spatial.distance import pdist, squareform\n\n# Load an image\nasset_dir_path = os.path.dirname(os.path.abspath(__file__)) + \"/assets\"\nimage = Image.open(asset_dir_path +...
[ [ "numpy.asarray", "scipy.spatial.distance.pdist", "matplotlib.pyplot.figure" ] ]
claytonkanderson/SimplyRL
[ "3e808f519f174d081c80c04a8adba88cf93c9c9d" ]
[ "Source/GridWorldDrivingDQNMain.py" ]
[ "import numpy as np\nimport gym\nfrom time import time\n\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation, Flatten\nfrom keras.optimizers import Adam\nfrom keras.callbacks import TensorBoard\n\nfrom rl.agents.dqn import DQNAgent\nfrom rl.policy import BoltzmannQPolicy\nfrom rl.memory...
[ [ "numpy.random.seed" ] ]
website-fingerprinting/minipatch
[ "682d86c0eca5331a8c001e83003cf79b5d4b1a78" ]
[ "dual_annealing.py" ]
[ "# Dual Annealing implementation.\n# Copyright (c) 2018 Sylvain Gubian <sylvain.gubian@pmi.com>,\n# Yang Xiang <yang.xiang@pmi.com>\n# Author: Sylvain Gubian, Yang Xiang, PMP S.A.\n\n\"\"\"\nA slight modification to Scipy's implementation of simulated annealing.\nFix bug in implementation of formula in p. 398 of re...
[ [ "numpy.fmod", "scipy.optimize.OptimizeResult", "numpy.log", "numpy.sqrt", "numpy.isfinite", "numpy.isnan", "numpy.sin", "numpy.all", "numpy.copy", "scipy._lib._util.check_random_state", "scipy.special.gammaln", "numpy.exp", "numpy.array", "numpy.isinf", ...
atemysemicolon/scikit-image
[ "a48cf5822f9539c6602b9327c18253aed14fa692" ]
[ "skimage/feature/tests/test_corner.py" ]
[ "import numpy as np\nfrom numpy.testing import (assert_array_equal, assert_raises,\n assert_almost_equal)\n\nfrom skimage import data\nfrom skimage import img_as_float\nfrom skimage.color import rgb2gray\nfrom skimage.morphology import octagon\n\nfrom skimage.feature import (corner_moravec...
[ [ "numpy.testing.run_module_suite", "numpy.random.seed", "numpy.isfinite", "numpy.asarray", "numpy.rad2deg", "numpy.ones", "numpy.testing.assert_array_equal", "numpy.testing.assert_almost_equal", "numpy.sort", "numpy.testing.assert_raises", "numpy.random.random_integers",...
dawn-ico/grid-experiments
[ "882d73d2dc2f3dadeeb71dde6731c21397f37092" ]
[ "reordering.py" ]
[ "from grid_types import Grid, DEVICE_MISSING_VALUE, GridSet\nfrom location_type import LocationType\nfrom schemas import *\n\nimport numpy as np\nimport netCDF4\nfrom functools import cmp_to_key\n\nNaN = float(\"nan\")\n\n\ndef apply_permutation(\n ncf, perm: np.ndarray, schema: GridScheme, location_type: Locati...
[ [ "numpy.fmod", "numpy.take", "numpy.unique", "numpy.min", "numpy.arange", "numpy.isnan", "numpy.around", "numpy.cos", "numpy.full", "numpy.arctan2", "numpy.max", "numpy.deg2rad", "numpy.copy", "numpy.all", "numpy.sin", "numpy.average", "numpy.arra...
GuillaumeBalezo/SOD-python
[ "c54566d25e01b252815fbc613a8d0af1c77818b6" ]
[ "functions/get_Proposals.py" ]
[ "# Functions for generating the proposal set for optimization\n#\n# Jianming Zhang, Stan Sclaroff, Zhe Lin, Xiaohui Shen,\n# Brian Price and Radomír Mech. \"Unconstrained Salient\n# Object Detection via Proposal Subset Optimization.\"\n# CVPR, 2016.\n# Code written by Guillaume Balezo, 2020\n\nimport numpy as np\nf...
[ [ "numpy.take_along_axis", "numpy.hstack", "numpy.maximum", "numpy.minimum", "numpy.take", "tensorflow.keras.applications.vgg16.preprocess_input", "numpy.copy", "scipy.cluster.hierarchy.linkage", "numpy.argsort", "numpy.array", "numpy.roll", "scipy.cluster.hierarchy.f...
dkkim93/gumbel-rl-gridworld
[ "2ec86bc6cf7c16d5ef0368c9dc4a83062d3d86e3" ]
[ "policy/td3.py" ]
[ "\"\"\"Modified Twin Delayed Deep Deterministic Policy Gradients (TD3)\nTD3 Ref: https://github.com/sfujim/TD3\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom misc.utils import onehot_from_logits, gumbel_softmax\n\ndevice = torch.device(\"cuda\" if torch.cuda....
[ [ "torch.load", "torch.cat", "numpy.squeeze", "torch.min", "torch.nn.Linear", "torch.nn.functional.mse_loss", "torch.FloatTensor", "torch.cuda.is_available" ] ]
Hengstenberg11/RedesNeuronales
[ "62bda5c8a6fc7f0e4207f7b6eb47617800bb3ebf" ]
[ "librerias/redNeuronal.py" ]
[ "#Neural network utils\n#This code was not implemented by me\n\nimport numpy as np\nfrom functools import reduce\n\nflatten_list_of_arrays = lambda list_of_arrays: reduce(\n lambda acc, v: np.array([*acc.flatten(), *v.flatten()]),\n list_of_arrays\n)\n\ndef inflate_matrixes(flat_thetas, shapes):\n layers =...
[ [ "numpy.log", "numpy.asarray", "numpy.delete", "numpy.exp", "numpy.zeros" ] ]
vinodsr/frigate
[ "3b04169c8b53b5653ad9b26d5bbe6313cbeff08d" ]
[ "frigate/object_processing.py" ]
[ "import json\nimport hashlib\nimport datetime\nimport time\nimport copy\nimport cv2\nimport threading\nimport queue\nimport copy\nimport numpy as np\nfrom collections import Counter, defaultdict\nimport itertools\nimport pyarrow.plasma as plasma\nimport matplotlib.pyplot as plt\nfrom frigate.util import draw_box_wi...
[ [ "numpy.copy", "numpy.zeros" ] ]
qiaozhijian/PLReg3D
[ "35e7df28eb64abf6f6dc9f31c77e8042123242f3" ]
[ "models/model_factory.py" ]
[ "# Author: Jacek Komorowski\n# Warsaw University of Technology\nimport torch\nimport models.minkloc as minkloc\n\n\ndef model_factory(params):\n in_channels = 32 if params.use_unet else 1\n\n if 'MinkFPN' in params.model_params.model:\n model = minkloc.MinkLoc(params.model_params.model, in_channels=in_...
[ [ "torch.cuda.is_available", "torch.load" ] ]
TuringApproved/Turing_Neural_Networks
[ "50101d20c8dc7cfa37db46e0f29bd6d79f66eaad" ]
[ "examples/context_free_grammar_simple_parser.py" ]
[ "__author__ = \"Giovanni Sirio Carmantini\"\n\n\"\"\"In this file we reproduce the simple parser from beim Graben, P.,\n & Potthast, R. (2014). Universal neural field computation. In Neural\n Fields (pp. 299-318).\n\nFirst, the Context Free Grammar is used to create a Generalized Shift,\nan NDA simulating the GS is...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.pause", "numpy.array_equal", "matplotlib.patches.Rectangle", "matplotlib.pyplot.draw", "matplotlib.pyplot.axes", "matplotlib.pyplot.show", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure" ] ]
ahv15/Mininet
[ "b5cdc5282a0b4324b6ece5f4a1756fc0232af8dd" ]
[ "botnet_detection.py" ]
[ "import numpy as np\r\nfrom netml.ndm.iforest import IF\r\nfrom netml.pparser.parser import PCAP\r\nfrom sklearn.model_selection import train_test_split\r\nfrom netml.ndm.model import MODEL\r\nfrom netml.utils.tool import dump_data, load_data\r\n\r\npcap = PCAP(\r\n \"D:\\\\BotnetDetection\\\\isot_app_and_botnet...
[ [ "sklearn.model_selection.train_test_split", "numpy.vstack" ] ]
ErikGartner/love-letter
[ "36995788292ea6fdfc72a8b09adad01ba6683c26" ]
[ "loveletter/card.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nLove Letter Card tools\nFunctions and constants to facilitate working with cards, which are represented as integers.\n\"\"\"\n\nimport numpy as np\n\n\nclass Card():\n \"\"\"Static Card class\"\"\"\n noCard = 0\n guard = 1\n priest = 2\n baron = 3\n handmaid = 4\n...
[ [ "numpy.random.shuffle", "numpy.array", "numpy.random.seed" ] ]
smearle/pytorch-a2c-ppo-acktr-micropolis
[ "699a6f6e65e8bab5533074945cc9aa7827919a59" ]
[ "envs.py" ]
[ "import os\nimport sys\n\nimport gym\nimport numpy as np\nimport torch\nfrom gym.spaces.box import Box\n\nfrom baselines import bench\n#from baselines.common.atari_wrappers import make_atari, wrap_deepmind\nfrom baselines.common.vec_env import VecEnvWrapper\nfrom baselines.common.vec_env.subproc_vec_env import Subp...
[ [ "numpy.sqrt", "torch.zeros", "torch.from_numpy", "numpy.concatenate", "torch.device", "numpy.repeat", "numpy.array" ] ]
ling-cai/Time2Box
[ "7c6f7467a0341f7c979103121d54e2f911806a6d" ]
[ "codes/run.py" ]
[ "#!/usr/bin/python3\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport json\nimport logging\nimport os\nimport random\n\nimport numpy as np\nimport torch\n\nfrom torch.utils.data import DataLoader\n\nfrom model import Query2bo...
[ [ "torch.optim.lr_scheduler.ReduceLROnPlateau", "numpy.random.seed", "torch.cuda.manual_seed", "torch.manual_seed", "numpy.mean", "numpy.sum", "torch.multiprocessing.set_sharing_strategy" ] ]
AmirAlavi/scipr
[ "5807b8648526e41c2db413783c76fa33331cc710" ]
[ "api_tests/test_rigid.py" ]
[ "import numpy as np\n\nimport scipr\nfrom scipr.matching import Closest, Hungarian, Greedy, MNN\nfrom scipr.transform import Affine, Rigid, StackedAutoEncoder\n\nnp.random.seed(1817)\nA = np.random.random((10, 100))\nB = np.random.random((20, 100))\n\nmatchers = [Closest(), Greedy(), Hungarian(), MNN()]\nfor match ...
[ [ "numpy.not_equal", "numpy.random.random", "numpy.random.seed" ] ]
Rathore25/Sapiens-QA
[ "0bf794784c3a3b26b541dbc2fa894756c979e5c4" ]
[ "Main App/app/main.py" ]
[ "from flask import Flask, request, jsonify\nfrom flask_cors import CORS\n\nimport os\nimport pandas as pd\nimport requests\nimport wget\nimport json\nimport wget\n\nfrom cdqa.pipeline import QAPipeline\n\napp = Flask(__name__)\nCORS(app)\n\nprint(\"Started main.py !!!\")\n\nresponse = requests.get('https://docs.goo...
[ [ "pandas.DataFrame" ] ]
iGEMDarmstadt/HoloPyGuy
[ "160bcf551efcc152d9b74cc38726647c0a7c1d2e" ]
[ "picprocessing.py" ]
[ "import os\nfrom PIL import Image\nimport numpy as np\n\n#Takes all pics in \"raw pics\" directory, convert to grey scale,\n#cutting into square images, and same to \"ready pics\" directory\n\n\ndef create_temp_pictures(filenames):\n filelist = []\n cnt = 0\n for filename in filenames:\n im = Image....
[ [ "numpy.minimum" ] ]
KanwarKelide/football
[ "149c03dfd90aaf652a61c656e40cefa5dc9e0454" ]
[ "gfootball/env/football_env_test.py" ]
[ "# coding=utf-8\n# Copyright 2019 Google LLC\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 la...
[ [ "numpy.ascontiguousarray", "numpy.array", "numpy.shape" ] ]
aswart/PSDA
[ "2bdd071e6a3dee89827900553185a98a38292843" ]
[ "psda/demo.py" ]
[ "import numpy as np\nfrom numpy.random import randn, randint\nimport matplotlib.pyplot as plt\n\nfrom psda import VMF, PSDA, decompose, atleast2\nfrom pyllr import quick_eval\n\n\"\"\"\nThis demo uses a quick-and-dirty data simulator, using Gaussians, not VMF.\nIt does not work for high dimensions. But you can play...
[ [ "matplotlib.pyplot.legend", "numpy.hstack", "matplotlib.pyplot.title", "numpy.unique", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylim", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlim", "numpy.random.randint", "num...
Raudcu/pyrodash
[ "3671086ef57c097fa055a908a65401eb6648c69a" ]
[ "pyrodash/geometrics/parallelepiped.py" ]
[ "import numpy as np\nfrom itertools import product\nimport plotly.graph_objects as go\n\n\nclass Parallelepiped:\n \"\"\"\n Class to build and draw a Parallelepiped.\n\n ...\n\n Attributes\n ----------\n L : float or numpy array\n x, y, z lengths of the parallelepiped sides. If float, a cub...
[ [ "numpy.array" ] ]
dongwang218/spark
[ "257236c3e17906098f801cbc2059e7a9054e8cab" ]
[ "examples/src/main/python/als.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "numpy.linalg.solve", "numpy.random.seed", "numpy.power", "numpy.random.rand", "numpy.array" ] ]
LiuxyEric/dscc202-402-spring2022
[ "f3877c2dde64656f9d84e3f913340f3fcefdc11b" ]
[ "project3-mlops/06-Model-Registry.py" ]
[ "# Databricks notebook source\n# MAGIC %md\n# MAGIC # Model Registry\n# MAGIC \n# MAGIC MLflow Model Registry is a collaborative hub where teams can share ML models, work together from experimentation to online testing and production, integrate with approval and governance workflows, and monitor ML deployments and ...
[ [ "sklearn.ensemble.RandomForestRegressor", "pandas.read_csv" ] ]
Remorax/COMET
[ "e0a9c4116edb58fd2ddd2078329e06978e15b3b2" ]
[ "tests/integration/models/test_ranking_metric.py" ]
[ "# -*- coding: utf-8 -*-\nimport multiprocessing\nimport os\nimport shutil\nimport unittest\n\nimport torch\nfrom comet.models import RankingMetric\nfrom pytorch_lightning import seed_everything\nfrom pytorch_lightning.trainer.trainer import Trainer\nfrom scipy.stats import pearsonr\nfrom tests.data import DATA_PAT...
[ [ "scipy.stats.pearsonr" ] ]
rahatsantosh/ipf_severity_detection
[ "e08f72db344a6dd54868c83a2484c78f7ec7a6fe" ]
[ "models/xray_train.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\nfrom torch.backends import cudnn\nfrom torch.utils.data import DataLoader\nimport torchvision\nimport matplotlib.pyplot as plt\nfrom shallow_autoenc import Autoencoder\nfrom autoencoder_dataset import Dataset\n\n# CUDA for PyTorch\nuse_cuda = torch.cuda.is_av...
[ [ "torch.reshape", "torch.utils.data.DataLoader", "matplotlib.pyplot.savefig", "torch.nn.CosineSimilarity", "torch.cuda.is_available", "torch.cuda.get_device_name", "torch.device", "torch.save" ] ]
nielsota/GANs
[ "7c4043022ba0fdd2d1f163abf70b7bd3f06be908" ]
[ "utils.py" ]
[ "from torchvision.utils import make_grid\nimport matplotlib.pyplot as plt\nimport argparse\nimport os\nimport torch\nfrom Data import *\n\n\n################################################################################\n############################## UTILITY FUNCTIONS ###############################\n###########...
[ [ "matplotlib.pyplot.subplots" ] ]
geek-guild/async-rl
[ "b208b023541cae468ca4c9eceec590b9bfd71abd" ]
[ "atari_environment.py" ]
[ "import tensorflow as tf\nfrom skimage.transform import resize\nfrom skimage.color import rgb2gray\nimport numpy as np\nfrom collections import deque\n\nclass AtariEnvironment(object):\n \"\"\"\n Small wrapper for gym atari environments.\n Responsible for preprocessing screens and holding on to a screen bu...
[ [ "numpy.empty", "numpy.array", "numpy.stack" ] ]
jbrowarczyk/jb-masters-thesis
[ "c345f43b32126d16f10c3706f5f798fde0665ee0" ]
[ "src/experiment3.py" ]
[ "from sklearn.svm import SVC\nfrom sklearn.metrics import accuracy_score, confusion_matrix, classification_report\nfrom global_settings import TRAIN_VERBOSE\nfrom utils import make_train_data, make_test_data, save_txt\nimport numpy as np\nimport joblib\nimport os\n\n\nEXPERIMENT_NAME = \"experiment3\"\n\nFEATURES =...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.svm.SVC", "numpy.load", "sklearn.metrics.classification_report", "sklearn.metrics.accuracy_score" ] ]
JOHNKYON/Kaggle_Learn
[ "6a45931e4ec1e189b95c61e27e90499347840180" ]
[ "hot_encoding/hot_encoding.py" ]
[ "\"\"\"Python script for kaggle house price predict practice\"\"\"\n\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.preprocessing import Imputer\nimport pandas as pd\n\n\ndef main():\n \"\"\"Main script\"\"\"\n # Load data\n train_data = pd.read_csv('data/train.csv')\n test_data = pd....
[ [ "sklearn.ensemble.RandomForestRegressor", "pandas.read_csv", "pandas.DataFrame", "sklearn.preprocessing.Imputer", "pandas.get_dummies" ] ]
nivethakesavan2203/haiku-generation
[ "ef66c0aa5a5ffcfcfa26b8e993d3efdfcc1be804" ]
[ "haiku_generation/src/models/embedding.py" ]
[ "import torch\n\n'''\none method:\nload RoBERTa from torch.hub\nimport torch\n\nroberta_torch = torch.hub.load('pytorch/fairseq', 'roberta.large')\nroberta_torch.eval()\n\nsentence = \"I Love RoBERTa!!! I Love Pytorch!!!\"\nApply Byte-Pair Encoding to input text, tokens should be a tensor\ntokens_torch = roberta_to...
[ [ "torch.hub.load" ] ]
ghbtest/deep-learning-coursera
[ "95d343f2136e20f285963a2605739dc966d82b09" ]
[ "Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/Initialization.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Initialization\n# \n# Welcome to the first assignment of \"Improving Deep Neural Networks\". \n# \n# Training your neural network requires specifying an initial value of the weights. A well chosen initialization method will help learning. \n# \n# If you completed the ...
[ [ "matplotlib.pyplot.gca", "numpy.sqrt", "matplotlib.pyplot.title", "numpy.random.seed", "scipy.stats.describe", "matplotlib.pyplot.plot", "numpy.random.randn", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.ylabel" ] ]
Unity-Technologies/lightning-hydra-template
[ "4bdf4e62c6f93021d7fae86a51c5d706990a933d" ]
[ "src/callbacks/wandb_callbacks.py" ]
[ "import glob\nimport os\nfrom typing import List\n\nimport matplotlib.pyplot as plt\nimport seaborn as sn\nimport torch\nimport wandb\nfrom pytorch_lightning import Callback, Trainer\nfrom pytorch_lightning.loggers import LoggerCollection, WandbLogger\nfrom sklearn import metrics\nfrom sklearn.metrics import f1_sco...
[ [ "torch.cat", "sklearn.metrics.precision_score", "torch.argmax", "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.clf", "sklearn.metrics.f1_score", "sklearn.metrics.recall_score", "matplotlib.pyplot.figure" ] ]
zheang01/FACT
[ "a877cc86acc4d29fb7589c8ac571c8aef09e5fd8" ]
[ "data/data_utils.py" ]
[ "from torchvision import transforms\r\nimport random\r\nimport torch\r\nimport numpy as np\r\nfrom math import sqrt\r\n\r\ndef dataset_info(filepath):\r\n with open(filepath, 'r') as f:\r\n images_list = f.readlines()\r\n\r\n file_names = []\r\n labels = []\r\n for row in images_list:\r\n ...
[ [ "numpy.fft.fft2", "numpy.fft.ifft2", "numpy.abs", "numpy.clip", "numpy.asarray", "numpy.fft.fftshift", "numpy.copy", "numpy.fft.ifftshift", "numpy.random.uniform", "numpy.angle" ] ]
kazarinov/cfdr
[ "bf93428614af15440b60fb894097e94fa4efd168" ]
[ "hccf/utils/mathematics.py" ]
[ "# -*- coding: utf-8 -*-\nimport math\nimport scipy as sp\n\n\ndef sigmoid(z):\n s = 1.0 / (1.0 + math.exp(-z))\n return s\n\n\ndef log_loss(act, pred):\n epsilon = 1e-15\n pred = sp.maximum(epsilon, pred)\n pred = sp.minimum(1 - epsilon, pred)\n ll = sum(act * sp.log(pred.astype(float)) + sp.subt...
[ [ "scipy.minimum", "scipy.maximum" ] ]
alexliniger/AdversarialRoadModel
[ "14157760687c22acc8b91c39128875005ada7563" ]
[ "LearningSafeSets/Validation/Validation.py" ]
[ "## Copyright 2020 Alexander Liniger\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 o...
[ [ "numpy.mean", "torch.nn.MSELoss", "torch.nn.BCELoss" ] ]
XDZhelheim/TrafficDataAnalysis
[ "a73dde10f91fb88af3a7b2edd7a04adaa5ea57f5" ]
[ "Supersegment/temp.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport geopandas as gp\nfrom shapely.geometry import Polygon, MultiLineString, Point\nimport shapely.wkt as wkt\nimport supersegment\n\n# def randrange(n, vmin, vmax):\n# '''\n# Helper function to make an array of random numbers havi...
[ [ "pandas.read_table" ] ]
Priyashbhugra/yolact
[ "ef871057f2768dcb13e6d9636d49402c9862fcd4" ]
[ "layers/output_utils.py" ]
[ "\"\"\" Contains functions used to sanitize and prepare the output of Yolact. \"\"\"\n\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport cv2\n\nfrom data import cfg, mask_type, MEANS, STD, activation_func\nfrom utils.augmentations import Resize\nfrom utils import ti...
[ [ "matplotlib.pyplot.imshow", "numpy.abs", "torch.Tensor", "numpy.clip", "torch.max", "torch.sum", "torch.no_grad", "torch.nn.functional.interpolate", "numpy.exp", "numpy.array", "matplotlib.pyplot.show", "numpy.zeros" ] ]
bipinupd/beam
[ "fffb85a35df6ae3bdb2934c077856f6b27559aa7" ]
[ "sdks/python/apache_beam/dataframe/expressions.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "pandas.concat" ] ]
teguhkhg/3dv_tutorial_py
[ "5e7bc614c5a71cd9d125b1bd8767b0b502ef9241" ]
[ "python/sfm_global.py" ]
[ "import numpy as np\nimport g2o\nimport cv2\nimport glob\n\nfrom bundle_adjustment import MonoBA\n\n# def makeNoisyPoints(Xs, xs, )\n\nclass Frame(object):\n def __init__(self):\n pass\n\nclass Mappoint(object):\n def __init__(self):\n pass\n\nclass Measurement(object):\n def __init__(self):\...
[ [ "numpy.asarray", "numpy.array" ] ]
diabloxenon/dautils
[ "064307b0fd9bbca2adcc7df5c6a0289954c74d58" ]
[ "dautils/nb.py" ]
[ "\"\"\" IPython/Jupyter notebook widgets and utilities. \"\"\"\nfrom IPython.display import display\nfrom IPython.display import Math\n# from IPython.html import widgets : DEPRECATED OPTION\nimport ipywidgets as widgets\nfrom dautils import collect\nfrom dautils import conf\nfrom dautils import ts\nfrom dautils imp...
[ [ "matplotlib.rcParams.copy", "matplotlib.rcParams.update", "matplotlib.colors.ColorConverter", "matplotlib.colors.rgb2hex" ] ]
luckyzflQ/py4fix
[ "bbf7b41d375e4f7b0344bc9b1e97d7910ad1e6ec" ]
[ "python36/dxa/sn_random_numbers.py" ]
[ "import numpy as np\n\ndef sn_random_numbers(shape, antithetic=True, moment_matching=True,\n fixed_seed=False):\n ''' Returns an array of shape shape with (pseudo)random numbers\n that are standard normally distributed.\n \n Parameters\n ==========\n shape : tuple (o, n, m)\n ...
[ [ "numpy.random.seed", "numpy.random.standard_normal", "numpy.concatenate", "numpy.std", "numpy.mean" ] ]
avantikasharma/HackerRank-Solutions
[ "a980859ac352688853fcbcf3c7ec6d95685f99ea" ]
[ "Practice/Python/EyeAndIdentity.py" ]
[ "import numpy\nN,M=map(int,input().split())\nprint(numpy.eye(N,M,k=0))\n" ]
[ [ "numpy.eye" ] ]
dblenkus/resolwe-bio
[ "5077a162f454576dbe1bc41e97923bde49420261" ]
[ "resolwe_bio/tools/samplehcluster.py" ]
[ "#!/usr/bin/env python3\n\"\"\"Hierarchical clustering of samples.\"\"\"\n\nimport argparse\nimport json\n\nimport numpy as np\nimport pandas as pd\nimport resdk\nfrom resolwe_runtime_utils import error, warning\nfrom scipy.cluster.hierarchy import dendrogram, linkage\nfrom scipy.stats import spearmanr, zscore\n\n\...
[ [ "pandas.concat", "pandas.read_csv", "numpy.log2", "numpy.min", "scipy.stats.zscore", "numpy.max", "scipy.cluster.hierarchy.linkage.tolist", "scipy.cluster.hierarchy.dendrogram", "scipy.stats.spearmanr" ] ]
starcroce/tf_dl_cookbook
[ "65c0cb9c9df230e551df5f04c5e2345dcbe53552" ]
[ "house_price_mlp.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\nimport tensorflow as tf\nimport tensorflow.contrib.layers as layers\n\nfrom sklearn import datasets\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\n\nboston = datasets.load_boston()\ndf = pd.DataFrame(bosto...
[ [ "tensorflow.summary.FileWriter", "matplotlib.pyplot.scatter", "tensorflow.cast", "tensorflow.placeholder", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "tensorflow.contrib.layers.fully_connected", "tensorflow.global_variables_initializer", "tensorflow.square"...
ncassereau-idris/stylebank
[ "2884d5eb8175622a03684ee621fd44736a431e82" ]
[ "stylebank/datasets.py" ]
[ "# /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport logging\nfrom hydra.utils import to_absolute_path\nimport torch\nimport torch.distributed as dist\nfrom torch.utils.data import Dataset, DataLoader\nfrom torch.utils.data.distributed import DistributedSampler\nimport torchvision.transforms.functional as TF\...
[ [ "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSampler", "torch.distributed.barrier" ] ]
caj380/lifx-lan-gui
[ "610f1cea7c915dd6d9c2d5108a1c5a19309527f2" ]
[ "lights.py" ]
[ "#!/usr/bin/env python3\n\nimport sys\nif sys.version_info < (3, 3):\n sys.stdout.write(\"Sorry, This module requires Python 3.3 (or higher), not Python 2.x. You are using Python {0}.{1}\\n\".format(sys.version_info[0],sys.version_info[1]))\n sys.exit(1)\n \nfrom appJar import gui\nimport os\nimport time\n...
[ [ "numpy.array", "numpy.mean", "numpy.transpose" ] ]
hustcxl/tensorflow_cookbook
[ "4f57ea4ad79c8111fb29bad3da5d151858c6a050" ]
[ "04_Support_Vector_Machines/02_Working_with_Linear_SVMs/02_linear_svm.py" ]
[ "# Linear Support Vector Machine: Soft Margin\n# ----------------------------------\n#\n# This function shows how to use TensorFlow to\n# create a soft margin SVM\n#\n# We will use the iris data, specifically:\n# x1 = Sepal Length\n# x2 = Petal Width\n# Class 1 : I. setosa\n# Class -1: not I. setosa\n#\n# We know...
[ [ "matplotlib.pyplot.legend", "tensorflow.sign", "tensorflow.equal", "matplotlib.pyplot.plot", "tensorflow.Session", "tensorflow.square", "tensorflow.python.framework.ops.reset_default_graph", "tensorflow.matmul", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "skle...
ruppysuppy/numpy
[ "a89f3ebaec7441f4ba5e30eb07206c2a7269778e" ]
[ "numpy/__init__.py" ]
[ "\"\"\"\nNumPy\n=====\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3. Linear Algebra, Fourier Transforms, Random Number Generation\n\nHow to use the documentation\n----------------------------\nDocumentation is available in two forms: docstrings ...
[ [ "numpy._pytesttester.PytestTester" ] ]
Sukriti1312/DSCI-522_City_of_A-Stars_310
[ "3cbfd1c238a86bcc4c3ddeb4d4cf83b90310e4ad" ]
[ "scripts/eda_script.py" ]
[ "# author: A. Muhammad\n# date: 2020-02-01\n\n'''This script performs EDA on the students performance datasets\nfor portuguese and math students and outputs necessary tables and\nfigures to path provided.\n\nUsage: eda_script.py --file_path=<file_path> --results_path=<results_path>\n\nExample: \n python scripts/...
[ [ "pandas.read_csv" ] ]
indigoLovee/DQN
[ "21a30484014331b21047ecddac4fa584828ee80a" ]
[ "DQN.py" ]
[ "import torch as T\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport numpy as np\nfrom buffer import ReplayBuffer\n\ndevice = T.device(\"cuda:0\" if T.cuda.is_available() else \"cpu\")\n\n\nclass DeepQNetwork(nn.Module):\n def __init__(self, alpha, state_dim, action_dim...
[ [ "numpy.random.random", "torch.max", "numpy.random.choice", "torch.load", "numpy.arange", "torch.tensor", "torch.nn.Linear", "torch.no_grad", "torch.cuda.is_available", "torch.argmax" ] ]
lapaniku/GAS
[ "e49ce302689af683da744cd172e0359c0ba0af86" ]
[ "examples/6a586378-063a-427c-92b2-87d6236615c6.py" ]
[ "# This program was generated by \"Generative Art Synthesizer\" \n# Generation date: 2021-11-28 02:06:28 UTC \n# GAS change date: 2021-11-28 01:31:12 UTC \n# GAS md5 hash: c291ffb9de6ad6dea37797c00163f591 \n# Python version: 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] \n# For m...
[ [ "numpy.amax", "numpy.abs", "numpy.isnan", "numpy.uint8", "numpy.amin", "numpy.arange", "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.sign", "numpy.zeros", "numpy.sum" ] ]
PankajPatil1/SageMaker-Deployment
[ "be608dd09e82098fc87f2522a380472773dd9a37" ]
[ "Project/serve/predict.py" ]
[ "import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\nfrom utils import review_to_words, convert_and_p...
[ [ "numpy.hstack", "torch.load", "torch.from_numpy", "torch.no_grad", "torch.cuda.is_available" ] ]
NightmareNyx/pygcn
[ "3972f167ce7fcc41cb21284d75816dfd9a15f7ef" ]
[ "pygcn/layers.py" ]
[ "import math\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.modules.module import Module\nfrom torch.nn.parameter import Parameter\n\n\nclass GraphConvolution(Module):\n \"\"\"\n Simple GCN layer, similar to https://arxiv.org/abs/1609.02907\n \"\"...
[ [ "torch.nn.functional.softmax", "numpy.sqrt", "torch.nn.functional.dropout", "torch.zeros", "torch.cat", "torch.sparse_coo_tensor", "torch.FloatTensor", "torch.cuda.is_available", "torch.where", "torch.nn.Dropout", "torch.mm", "torch.Size", "torch.ones", "tor...
jtrunnels91/ModularEstimator
[ "1088f91440abd5a82d094311f51d0250ecca52e1" ]
[ "modest/substates/correlationvector.py" ]
[ "## @file CorrelationVector\n# This package contains the #CorrelationVector class\n\nimport numpy as np\n#from numpy import sin, cos, arcsin, arccos, arctan2, square, sqrt, abs, power\nimport matplotlib.pyplot as plt\nfrom . import substate\nfrom .. modularfilter import ModularFilter\nfrom . oneDimensionalPositionV...
[ [ "numpy.dot", "numpy.sqrt", "numpy.linspace", "numpy.zeros_like", "numpy.var", "numpy.roll", "numpy.square", "numpy.sinc", "numpy.eye", "numpy.sin", "numpy.ceil", "numpy.argmax", "scipy.special.factorial", "numpy.outer", "numpy.zeros", "numpy.power", ...
rsaurabh799/ga-learner-dsmp-repo
[ "024f054e0385fd5faa24804004e25d9f849363aa" ]
[ "the-lego-collector-s-dilemma-(linear-regression)/code.py" ]
[ "# --------------\nimport pandas as pd\nimport numpy as np\nfrom sklearn.cross_validation import train_test_split\n# code starts here\ndf = pd.read_csv(path)\nprint(df.head(5))\nX = df.drop('list_price',axis=1)\ny = df['list_price']\nX_train,X_test,y_train,y_test = train_test_split(X,y,test_size = 0.3,random_state ...
[ [ "sklearn.cross_validation.train_test_split", "pandas.read_csv", "sklearn.metrics.r2_score", "matplotlib.pyplot.subplots", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.LinearRegression", "numpy.array", "matplotlib.pyplot.hist" ] ]
atul04/Grammar-Correction
[ "89ee3338f901735cbad2144e5e41a54ee11213f9" ]
[ "utils.py" ]
[ "import torch\nimport spacy\nfrom torchtext.data.metrics import bleu_score\nimport sys\n\n\ndef translate_sentence(model, sentence, german, english, device, max_length=50):\n # Load german tokenizer\n spacy_ger = spacy.load(\"en\")\n\n # Create tokens using spacy and everything in lower case (which is what...
[ [ "torch.LongTensor", "torch.no_grad", "torch.save" ] ]
LukasBeiske/ctapipe
[ "8325700ca01cbae62733c2f41de4113013f18939" ]
[ "ctapipe/visualization/mpl_array.py" ]
[ "from itertools import cycle\n\nimport numpy as np\nfrom astropy import units as u\nfrom astropy.coordinates import Angle\nfrom matplotlib import pyplot as plt\nfrom matplotlib.collections import PatchCollection\nfrom matplotlib.lines import Line2D\nfrom matplotlib.patches import Circle\n\nfrom ctapipe.coordinates ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.gca", "matplotlib.collections.PatchCollection", "numpy.sqrt", "numpy.arange", "matplotlib.lines.Line2D", "matplotlib.patches.Circle", "numpy.cos", "numpy.full", "matplotlib.pyplot.draw", "numpy.sin", "numpy.ma.masked_in...
VladLujerdeanu/Image-to-Coe-File
[ "faab54003982ce5b53f89298a9057680a5b63e1c" ]
[ "img2coe.py" ]
[ "import numpy as np\nimport sys\nimport os\nfrom PIL import Image\n\ndef img2coe(path, index):\n img = Image.open(path)\n arr = np.array(img)\n\n output_file = \"img\" + str(index) + \".coe\"\n\n f = open(output_file, \"w\")\n\n f.write(\"memory_initialization_radix=2;\\nmemory_initialization_vector=...
[ [ "numpy.array" ] ]
taoddiao/dr.b
[ "87f9ae4a5001e1a9248b0e19ad90aa252e426fe9" ]
[ "DSB3Tutorial/LUNA_train_unet.py" ]
[ "from __future__ import print_function\n\nimport numpy as np\nfrom keras.models import Model\nfrom keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D\nfrom keras.optimizers import Adam\nfrom keras.optimizers import SGD\nfrom keras.callbacks import ModelCheckpoint, LearningRateScheduler\nfro...
[ [ "numpy.ndarray", "numpy.save", "numpy.std", "numpy.mean", "numpy.load", "numpy.sum" ] ]
Yuta1004/procon30-battle-simulator-py
[ "dcd0bb34efab3201705ff2188c2fc62f6ac7bc09" ]
[ "simulator/game.py" ]
[ "# Copylight(c) 2019 NakagamiYuta\n# LICENCE : MIT\n\nimport numpy as np\nimport json\nfrom simulator.common import flatten_2d, gen_2d_list\n\nclass Game:\n \"\"\"\n Gameクラス\n\n Brief:\n  シミュレーター\n \"\"\"\n\n def __init__(self, board, agents):\n \"\"\"\n コンストラクタ\n\n Params...
[ [ "numpy.ceil", "numpy.array", "numpy.abs" ] ]
acse-jl8920/IRP-Johnson
[ "2a70ab9b286726847cc5d5bb65232b2b241f4d5a" ]
[ ".ipynb_checkpoints/Model-checkpoint.py" ]
[ "#coding=utf-8\nimport tensorflow as tf\nimport keras \nfrom keras.models import *\nfrom keras.layers import *\nimport numpy as np\nfrom metrics import metrics\nfrom losses import LOSS_FACTORY\nfrom keras.callbacks import History\nfrom keras.callbacks import ModelCheckpoint\ndef conv_block(input, filters):\n out...
[ [ "numpy.asarray", "numpy.zeros" ] ]
shvetsiya/carvana
[ "acc594cba53c44d577c9e3e326e0163eea8b4862" ]
[ "model/unet.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n\nclass Conv3BN(nn.Module):\n \"\"\"A module which applies the following actions:\n - convolution with 3x3 kernel;\n - batch normalization (if enabled);\n - ELU.\n Attributes:\n in_ch: Number of input chan...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Upsample", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
gerkamspiano/QuantMacro
[ "f7e6e4ff7ae075d556f73cb1434c45652b4180cb" ]
[ "ps5_II.2_II.3.py" ]
[ "# Problem Set 5 - Germán Sánchez Arce\r\n\r\n# In collaboration with María González\r\n\r\n# Import packages\r\n\r\nimport numpy as np\r\nfrom numpy import vectorize\r\nfrom itertools import product\r\nimport matplotlib.pyplot as plt\r\nimport scipy as sp\r\nfrom scipy.interpolate import BSpline\r\nfrom scipy.int...
[ [ "matplotlib.pyplot.legend", "numpy.amax", "numpy.linspace", "matplotlib.pyplot.title", "numpy.reshape", "numpy.tile", "numpy.ones", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "numpy.argmax", "numpy.transpose", "matplotlib.pyplot.xlabel", "numpy.array"...
yangapku/OFA
[ "6bf21b0f2483d53b2750db1ea3fd103ec7d331d1" ]
[ "evaluate.py" ]
[ "#!/usr/bin/env python3 -u\n# Copyright 2022 The OFA-Sys Team. \n# All rights reserved.\n# This source code is licensed under the Apache 2.0 license \n# found in the LICENSE file in the root directory.\n\nimport logging\nimport os\nimport sys\n\nimport numpy as np\nimport torch\nfrom fairseq import distributed_util...
[ [ "torch.cuda.set_device", "numpy.random.seed", "torch.no_grad", "torch.FloatTensor", "torch.cuda.is_available" ] ]
tiwalayo/flexible-bnn
[ "424572de879d64ee0b2f004d9649e823d2004430" ]
[ "src/models/stochastic/bbb/utils.py" ]
[ "import torch \r\nimport numpy as np\r\nimport torch.nn.functional as F\r\n\r\ndef kl_divergence(mu, sigma, mu_prior, sigma_prior):\r\n kl = 0.5 * (2 * torch.log(sigma_prior / sigma) - 1 + (sigma / sigma_prior).pow(2) + ((mu_prior - mu) / sigma_prior).pow(2)).sum() \r\n return kl\r\n\r\ndef normpdf(x, mu=0.0,...
[ [ "torch.FloatTensor", "torch.log", "torch.pow", "torch.tensor" ] ]
ChristophRaab/DATL
[ "e1d44992e41060bb842525591181bfbbf7fd3c23" ]
[ "parameter_init_adjustments.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\n\n\ndef init_weights(m):\n classname = m.__class__.__name__\n if classname.find('Conv2d') != -1 or classname.find('ConvTranspose2d') != -1:\n nn.init.kaiming_uniform_(m.weight)\n nn.init.zeros_(m.bias)\n elif classname.find('BatchNorm')...
[ [ "torch.nn.init.xavier_normal_", "torch.nn.init.kaiming_uniform_", "torch.nn.init.normal_", "torch.nn.init.zeros_", "numpy.exp" ] ]
mzweilin/armory
[ "da3fedc02f6f4841a813c4af8aafcc3ff7501665" ]
[ "armory/utils/metrics.py" ]
[ "\"\"\"\nMetrics for scenarios\n\nOutputs are lists of python variables amenable to JSON serialization:\n e.g., bool, int, float\n numpy data types and tensors generally fail to serialize\n\"\"\"\n\nimport logging\nimport numpy as np\n\nlogger = logging.getLogger(__name__)\n\n\ndef categorical_accuracy(y, y_p...
[ [ "numpy.abs", "numpy.asarray", "numpy.linalg.norm", "numpy.argmax", "numpy.argsort", "numpy.array" ] ]
feihoo87/waveforms
[ "d986852019206f18269a702f4dfbd17a78dc135a" ]
[ "waveforms/quantum/circuit/qlisp/utils.py" ]
[ "from itertools import repeat\n\nimport numpy as np\n\n\ndef DD(qubit, t, gates, pos, f=0):\n seq = [('X/2', qubit)]\n i = 0\n for gate in gates:\n gap = t * (pos[i] - pos[i - 1]) if i > 0 else t * pos[0]\n seq.append((('Delay', gap), qubit))\n seq.append((gate, qubit))\n i += 1...
[ [ "numpy.arange", "numpy.sin" ] ]
gitter-lab/active-learning-drug-discovery
[ "b24004a359037b3a1175a61c181ec231b711c797" ]
[ "active_learning_dd/utils/generate_dissimilarity_matrix.py" ]
[ "\"\"\"\n Script for generating the dissimilarity matrix.\n csv_file_or_dir: specifies a single file or path with format of csv files to be loaded. e.g: /path/iter_{}.csv or /path/iter_*.csv.\n output_dir: where to save the memmap file of the dissimilarity matrix.\n feature_name: specifies the column na...
[ [ "pandas.concat", "pandas.read_csv", "numpy.random.seed", "numpy.memmap", "numpy.save", "numpy.fromstring", "numpy.load", "numpy.array", "numpy.sum" ] ]
hwk42/pipelines
[ "c89ed71cf6339cdcdd957d4dca4b1f32c10db9c9" ]
[ "samples/contrib/pytorch-samples/bert/wrapper.py" ]
[ "# !/usr/bin/env/python3\n# Copyright (c) Facebook, Inc. and its affiliates.\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# U...
[ [ "torch.ones" ] ]
11wi/11wi.github.io
[ "c89f6999ece59cba3ba5bdfd378028adcbad5ee3" ]
[ "attachments/matrix_util.py" ]
[ "import numpy as _np\nfrom multiprocessing import RawArray as _RawArray\nfrom multiprocessing import Pool as _Pool\nfrom functools import partial as _partial\nfrom numba import njit\n\n\ndef nonzero(array):\n index_array = _np.nonzero(array)[0]\n return index_array\n\n\ndef inverse(mat):\n return _np.ascon...
[ [ "numpy.random.chisquare", "numpy.nonzero", "numpy.linalg.inv", "numpy.arange", "numpy.frombuffer", "numpy.random.normal", "numpy.cov", "numpy.linalg.cholesky", "numpy.zeros", "numpy.sum" ] ]