repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
kparasch/xfields
[ "fd288588ee269bf0d18da24ef83f5f925e6c5e4f" ]
[ "xfields/beam_elements/electronlens_interpolated.py" ]
[ "import numpy as np\n\nimport xobjects as xo\nimport xtrack as xt\n\nfrom ..fieldmaps import TriLinearInterpolatedFieldMap\nfrom ..fieldmaps import TriCubicInterpolatedFieldMap\n\nfrom ..fieldmaps import TriCubicInterpolatedFieldMapData\nfrom ..fieldmaps import TriLinearInterpolatedFieldMapData\nfrom ..general impo...
[ [ "numpy.zeros" ] ]
r09491/poorscrum
[ "cdbbc0db03fde842f546093f46e70d03a105bbbd" ]
[ "scripts/poorscrum_burndown.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n__author__ = \"sepp.heid@t-online.de\"\n__doc__ = \"\"\" \"\"\"\n\nimport argparse\nimport os\nimport sys\n\nfrom pptx import Presentation\nfrom pptx.exc import PackageNotFoundError\nfrom pptx.util import Inches\n\nfrom poorscrum import SPRINT_FILE, BURNDOWN_SAVE_N...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.grid", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.bar" ] ]
ingako/AOTrAdaBoost
[ "6e71e9ff7d0309c01a153ea928f9a46d3a67b093", "6e71e9ff7d0309c01a153ea928f9a46d3a67b093" ]
[ "eval-bike-perf.py", "plot-acc.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nimport sys\nimport math\nimport pandas as pd\nimport numpy as np\nfrom dataclasses import dataclass\nfrom pprint import PrettyPrinter\n\nfrom scipy.stats import friedmanchisquare\n\ngenerator = \"bike-bk/bike-weekday-weekend\"\nbenchmark_list = [\"disable_transfer\",\n ...
[ [ "pandas.read_csv" ], [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.ticklabel_format" ] ]
wavestate/wavestate-iirrational
[ "01d6dba8b2131fa2a099a74f17e6540f30cee606" ]
[ "src/wavestate/iirrational/v1/nyquist_move.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# SPDX-License-Identifier: Apache-2.0\n# SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology.\n# SPDX-FileCopyrightText: © 2021 Lee McCuller <mcculler@mit.edu>\n# NOTICE: authors should document their contributions in concisely in NOTICE\n# with deta...
[ [ "numpy.angle", "numpy.exp" ] ]
microsoft/archai
[ "50f70ccccf536466cc0370c8a63401e05dec33fd" ]
[ "scripts/plain_models/cifar_resnet/train_cifar100.py" ]
[ "# Copyright (c) Microsoft Corporation.\r\n# Licensed under the MIT license.\r\n\r\nimport torch\r\nfrom archai import cifar10_models\r\nfrom archai.common.trainer import Trainer\r\nfrom archai.common.config import Config\r\nfrom archai.common.common import common_init\r\nfrom archai.datasets import data\r\n\r\ndef...
[ [ "torch.device" ] ]
Napuu/matalapaine
[ "84931e7b629be09b295c2c3def1cd15ae811f0c2" ]
[ "weather-data/lambda/dataset_processor.py" ]
[ "import boto3\nimport rasterio\nimport os\nimport numpy as np\nfrom osgeo import gdal\nfrom botocore.handlers import disable_signing\nfrom typing import List\nfrom datetime import datetime\n\nDATASET_TMP_PATH = \"/tmp/tmp.grib2\"\nGDAL_TMP_FILE = \"/tmp/temp.tiff\"\nFINAL_IMG = \"/tmp/final.jpeg\"\nNOAA_BUCKET = 'n...
[ [ "numpy.interp" ] ]
margitantal68/sapimouse
[ "40b5ea6cf10c6f1d64b9dd0427d21138cc4f75e2" ]
[ "util/fcn.py" ]
[ "import os\r\nimport time\r\nimport numpy as np\r\nimport pandas as pd\r\nimport tensorflow.keras as keras\r\nfrom pathlib import Path\r\nfrom sklearn.ensemble import RandomForestClassifier\r\nfrom sklearn.preprocessing import LabelEncoder, OneHotEncoder \r\nfrom sklearn.model_selection import train_test_split\r\nf...
[ [ "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.GlobalAveragePooling1D", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Activation", "tensorflow.keras.models.Model", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Dense", "tensorflow.ker...
yenlow/coursera_dl
[ "b092a290d5120b2dfeecce65fd9ae63df470adee" ]
[ "Sequence Models/utils.py" ]
[ "import numpy as np\n\ndef softmax(x):\n e_x = np.exp(x - np.max(x))\n return e_x / e_x.sum(axis=0)\n\ndef smooth(loss, cur_loss):\n return loss * 0.999 + cur_loss * 0.001\n\ndef print_sample(sample_ix, ix_to_char):\n txt = ''.join(ix_to_char[ix] for ix in sample_ix)\n txt = txt[0].upper() + txt[1:] ...
[ [ "numpy.max", "numpy.zeros_like", "numpy.dot", "numpy.zeros", "numpy.log", "numpy.random.seed", "numpy.copy", "numpy.random.randn" ] ]
slibby/PyAEZ
[ "fffba1028586c9d14a8c3a1377a12a05868b8403" ]
[ "code/EconomicSuitability.py" ]
[ "\r\n\"\"\"\r\nPyAEZ\r\nWritten by Thaileng Thol\r\n\r\nBETA version - under development and in testing phase\r\n\"\"\"\r\n\r\nimport numpy as np\r\nfrom scipy import stats\r\n\r\nclass EconomicSuitability(object):\r\n\r\n def __init__(self):\r\n self.crop_name_list = []\r\n self.net_revenue_list =...
[ [ "numpy.divide", "numpy.array", "numpy.zeros", "scipy.stats.linregress", "numpy.mean", "numpy.amax", "numpy.amin", "numpy.all" ] ]
check-spelling/webbpsf
[ "88d2915e623750dff8be4b9ddbdf15ed15285f4f" ]
[ "webbpsf/optics.py" ]
[ "import os\nimport poppy\nimport poppy.utils\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\n\nfrom astropy.table import Table\nimport astropy.io.fits as fits\nimport astropy.units as units\n\nfrom scipy.interpolate import griddata, RegularGridInterpolator\nfrom scipy.ndimage import rotate\...
[ [ "matplotlib.pyplot.text", "numpy.ones_like", "numpy.argmin", "numpy.where", "numpy.sign", "numpy.finfo", "numpy.cos", "numpy.deg2rad", "scipy.interpolate.griddata", "numpy.concatenate", "numpy.full", "numpy.sin", "numpy.indices", "scipy.poly1d", "scipy.n...
jeanne-ber/vicreg
[ "5e7b38f4586384bbb0d9a035352fab1d8f03b3b4" ]
[ "main_vicreg.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\n\nfrom pathlib import Path\nimport argparse\nimport json\nimport math\nimport os\nimport sys\nimport time\n\nim...
[ [ "torch.nn.Linear", "torch.distributed.get_world_size", "torch.cat", "torch.stack", "torch.cuda.amp.autocast", "torch.load", "torch.where", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.norm", "torch.utils.data.DataLoader", "torch.zeros_like", "torch.nn.fun...
ichimei/dlcot
[ "6ba405a5fc75be7b5c93c5615d99e1311dc85187" ]
[ "modeling/backbone/drn.py" ]
[ "import torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nfrom dlcot.modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d\n\nwebroot = 'http://dl.yf.io/drn/'\n\nmodel_urls = {\n 'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth',\n 'drn-c-26': webroot + '...
[ [ "torch.rand", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.utils.model_zoo.load_url", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
sht47/mmtracking
[ "5a25e418e9c598d1b576bce8702f5e156cbbefe7" ]
[ "mmtrack/core/utils/visualization.py" ]
[ "import random\n\nimport cv2\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport mmcv\nimport numpy as np\nimport seaborn as sns\nfrom matplotlib.patches import Rectangle\n\n\ndef random_color(seed):\n \"\"\"Random a color according to the input seed.\"\"\"\n random.seed(seed)\n colors = sns.color_...
[ [ "matplotlib.use", "matplotlib.pyplot.text", "matplotlib.pyplot.autoscale", "matplotlib.patches.Rectangle", "matplotlib.pyplot.savefig", "matplotlib.pyplot.margins", "matplotlib.pyplot.draw", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "numpy.clip", "matplotlib....
iammcy/Fed-Learning
[ "5de2930061cdf7803456b7e73b7934d5e334e2c9", "5de2930061cdf7803456b7e73b7934d5e334e2c9" ]
[ "src/model.py", "src/client.py" ]
[ "from torch import nn\nimport torch.nn.functional as F\n\nclass LinearModel(nn.Module):\n def __init__(self) -> None:\n super(LinearModel, self).__init__()\n self.flatten = nn.Flatten()\n self.linear_relu_stack = nn.Sequential(\n nn.Linear(28*28, 512),\n nn.ReLU(),\n ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.Flatten" ], [ "torch.no_grad", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ] ]
flatten-official/flatten-scripts
[ "b19a2275ebd4607b8534d82b7d8035bde6a9b8a9" ]
[ "archive/confirmed_cases/covidOntario.py" ]
[ "'''\ncovidOntario.py\nA script to get up to date Covid-19 Data from the public health units of Ontario.\nAuthor: Ivan Nesterovic\nBorn: 2020-03-25\n'''\n\n## NOTE: Some Public Health units have put their data in text so text parsing is necessary, this may break and require checking over.\n\nimport bs4\nimport requ...
[ [ "pandas.read_csv" ] ]
peixinhou/mindspore
[ "fcb2ec2779b753e95c762cf292b23bd81d1f561b" ]
[ "mindspore/nn/metrics/bleu_score.py" ]
[ "# Copyright 2021 Huawei Technologies Co., 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 l...
[ [ "numpy.array", "numpy.log", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.exp" ] ]
SaiMahimaIyer/Data-Analytics
[ "2516e7f2de332808dfc9f483db2a0c0dc6f728da" ]
[ "Exploratory Data Analysis on Titanic Dataset.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport numpy as np\nimport pandas as pd\nimport pandas_profiling\n\n\n# In[2]:\n\n\ndf = pd.read_csv(\n \"https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv\"\n )\n\n\n# In[3]:\n\n\ndf.profile_report()\n\n\n# In[5]:\n\n\npro...
[ [ "pandas.read_csv" ] ]
charliealpha094/Project_Data_Visualization
[ "ccd55db58927dbbcfd57ab750fe7b21754c2b2dc" ]
[ "Chapter_15_Generating_Data/try_15.1/five_cubic.py" ]
[ "#Done by Carlos Amaral (19/07/2020)\n\n\n#Try 15.1- Cubes\n\nimport matplotlib.pyplot as plt \n\nx_values = [1, 2, 3, 4, 5]\ny_values = [1, 8, 27, 64, 125]\n\nplt.style.use('seaborn')\nfig, ax = plt.subplots()\nax.plot(x_values, y_values, linewidth = 3)\n\n#Set chart title and label axes\nax.set_title(\"Cubic Numb...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "matplotlib.pyplot.style.use" ] ]
aleaf/SFRmaker
[ "4b87d29f5486f283fecc024be36cf81d429bdcca" ]
[ "sfrmaker/test/test_preprocessing.py" ]
[ "\"\"\"\nTest the preprocessing module\n\"\"\"\nimport os\nfrom pathlib import Path\nimport yaml\nimport numpy as np\nimport pandas as pd\nimport geopandas as gpd\nfrom shapely.geometry import box\nimport pytest\nfrom gisutils import df2shp, shp2df\nfrom sfrmaker.checks import check_monotonicity\nfrom sfrmaker.prep...
[ [ "pandas.to_datetime", "pandas.testing.assert_frame_equal", "numpy.array_equal", "pandas.DataFrame", "numpy.allclose", "numpy.all", "pandas.read_csv" ] ]
frankiert/layout-parser
[ "f89a18f3d0a51a07f9a70598d06ca586dc4dd1c3" ]
[ "src/layoutparser/io/basic.py" ]
[ "# Copyright 2021 The Layout Parser team. 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...
[ [ "pandas.read_csv", "pandas.isna" ] ]
HapeMask/Theano
[ "89aac420cb6cc64328e23ee5dbe33c280b1eb980" ]
[ "theano/tensor/nnet/tests/test_neighbours.py" ]
[ "from __future__ import absolute_import, print_function, division\nimport numpy as np\nimport unittest\n\nimport theano\nfrom theano import shared, function\nimport theano.tensor as T\nfrom theano.tensor.nnet.neighbours import images2neibs, neibs2images, Images2Neibs\n\nfrom theano.tests import unittest_tools\n\nmo...
[ [ "numpy.random.rand", "numpy.asarray", "numpy.ones", "numpy.allclose", "numpy.prod" ] ]
oxquantum/CVAE_for_QE
[ "01f3070b9ddc4b6d54ad5d6573749b7270d95bee" ]
[ "util_conv.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.framework import tensor_shape\n\n# Convert an input_shape to n, which is the integer satisfying 2^n = height\n# Input_shape: (height, width), list or tuple, length 2\n# Assume height == width\ndef convert_shape_to_depth(input_shape):\n height, ...
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.variance_scaling_initializer", "tensorflow.shape", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.python.framework.tensor_shape.as_dimension", "tensorflow.reshape", "tensorflow.nn.conv2d_transpose", "te...
nightlessbaron/pytorch-lightning
[ "239bea5c29cef0d1a0cfb319de5dbc9227aa2a53", "239bea5c29cef0d1a0cfb319de5dbc9227aa2a53" ]
[ "tests/core/test_results.py", "tests/base/models.py" ]
[ "# Copyright The PyTorch Lightning team.\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...
[ [ "torch.zeros", "torch.distributed.get_world_size", "torch.eq", "torch.distributed.init_process_group", "torch.multiprocessing.spawn", "torch.cuda.device_count", "torch.tensor", "torch.load" ], [ "torch.nn.Linear", "torch.rand", "torch.nn.Dropout", "torch.nn.LSTM...
annomator/annomator_package_beta_0.1
[ "134d5c3b2818cf196021ed1ce61424259e80d7f6" ]
[ "annotate/annotate_json_boxes.py" ]
[ "# Copyright 2019 Annomator Written by Arend Smits\n# Copyright 2019 The TensorFlow 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. You may obtain a copy of the License at\n# http://www.apache.org/l...
[ [ "matplotlib.use", "tensorflow.Session", "matplotlib.pyplot.close" ] ]
joaoalvarenga/TensorFlowASR
[ "72cd5d2b932d66ddd61e79ab41bb0d64cb8c4919" ]
[ "tensorflow_asr/optimizers/schedules.py" ]
[ "# Copyright 2020 Huy Le Nguyen (@usimarit)\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless require...
[ [ "tensorflow.python.ops.math_ops.maximum", "tensorflow.python.framework.ops.name_scope_v2", "tensorflow.python.ops.math_ops.cast", "tensorflow.python.ops.math_ops.floor", "tensorflow.python.ops.math_ops.pow", "tensorflow.python.framework.ops.convert_to_tensor", "tensorflow.math.minimum"...
mattianeroni/IndustryAlgorithms
[ "ff76c55a4fa655b8566e63a8a7e6ffeba76d6acd" ]
[ "picking/algorithms/zhong.py" ]
[ "from __future__ import annotations\nfrom typing import Dict, List, Tuple, Union, Optional, cast, NewType\n\nimport random\nimport numpy as np # type: ignore\nimport time\n\n\n\n\n# The type Velocity is defined\nVelocity = NewType (\"Velocity\", List[Tuple[Tuple[int, int], float]])\n\n\n\n\n\n\n\n\n\n\ndef _compute...
[ [ "numpy.exp", "numpy.log" ] ]
Gaoyifei1011/AmapProgram
[ "d45a27abf9f508d922f37abc34f00da6d0aab4a0" ]
[ "FundamentalFunctions/MiddleShanxiAreaDataVisualization.py" ]
[ "import matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\n\"\"\"\r\nCopy from Jupyter Notebook\r\n\"\"\"\r\n# TODO: In the future version will insert into the 山西省道路信息分析系统 page.\r\n\r\n# 设置字体,否则中文会显示异常\r\nplt.rcParams['font.sans-serif'] = ['Microsoft YaHei']\r\nplt.rcParams['axes.unicode_m...
[ [ "matplotlib.pyplot.xlabel", "pandas.read_excel", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplot" ] ]
ziotom78/polycomp
[ "03415c4f04bdc6b98d2b12e1a6957509c15a6e24" ]
[ "setup.py" ]
[ "#!/usr/bin/env python3\n# -*- mode: python -*-\n\nfrom setuptools import setup, find_packages\nfrom setuptools.extension import Extension\nimport os.path as path\nfrom distutils.version import LooseVersion as Version\nimport numpy as np\n\nhere = path.abspath(path.dirname(__file__))\n\nwith open(path.join(here, 'p...
[ [ "numpy.get_include" ] ]
matthiaszimmermann/blm
[ "ae70e5845578da9c3b7ff2cdd47829a88004cb5d" ]
[ "app/app.py" ]
[ "from flask import Flask, render_template, request\nfrom model import LSCCNN\nfrom PIL import Image\nfrom io import BytesIO\n\nimport logging\nimport numpy as np\nimport base64\nimport cv2\n\nMODEL_FILENAME = './model/scale_4_epoch_46.pth'\nMODEL = None\n\nEMOJI_FILENAME = './blm_fist.png'\nEMOJI = None\n\napp = Fl...
[ [ "numpy.array" ] ]
ashishfarmer/pyro
[ "11a96cde05756def826c232d76f9cff66f6e6d4f", "54d48627a7c5c0575c2fe69d5b6c80f3c47b287b" ]
[ "pyro/ops/integrator.py", "pyro/distributions/transforms/affine_coupling.py" ]
[ "# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nfrom torch.autograd import grad\n\n\ndef velocity_verlet(z, r, potential_fn, kinetic_grad, step_size, num_steps=1, z_grads=None):\n r\"\"\"\n Second order symplectic integrator that uses the velocity verlet algorithm....
[ [ "torch.autograd.grad" ], [ "torch.distributions.utils._sum_rightmost", "torch.cat", "torch.exp" ] ]
ratschlab/immunopepper
[ "1c10c10c721273535ac57cd466a18b685641f83b" ]
[ "tests/parquet_test/columnar_write.py" ]
[ "import pandas as pd\nimport pyarrow as pa\nfrom pyarrow import parquet as pq\nimport numpy as np\nimport os\n\noutdir = '/Users/laurieprelot/Documents/Projects/tmp_kmer/parquet_test'\n\ndf = pd.DataFrame({\"Day\":{\"0\":1,\"1\":2,\"2\":3,\"3\":4,\"4\":5,\"5\":6,\"6\":7,\"7\":8},\"Year\":{\"0\":2018,\"1\":2018,\"2\...
[ [ "pandas.DataFrame" ] ]
torkjellsdatter/pisa
[ "7b26b0ac40c873a87786286acfd1c96abf724a99", "7b26b0ac40c873a87786286acfd1c96abf724a99", "7b26b0ac40c873a87786286acfd1c96abf724a99" ]
[ "pisa/utils/random_numbers.py", "pisa/scripts/make_toy_events.py", "pisa/stages/osc/pi_prob3.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nUtilities to handle random numbers needed by PISA in a consistent and\nreproducible manner.\n\n\"\"\"\n\n\nfrom __future__ import division\n\nfrom collections import Sequence\n\nimport numpy as np\n\nfrom pisa.utils.log import set_verbosity\n\n\n__all__ = ['get_random_state',\n ...
[ [ "numpy.random.RandomState" ], [ "numpy.max", "numpy.full", "numpy.isclose", "scipy.stats.norm.ppf", "numpy.asarray", "numpy.log", "scipy.stats.norm", "numpy.sum", "numpy.min", "numpy.diff", "numpy.where", "numpy.isscalar", "numpy.power", "numpy.log10...
miwoow/ppt
[ "28b115445d63c15a04a13d9f80beec573e00af40" ]
[ "children_math/gen.py" ]
[ "#!/bin/env/python\n#encoding:utf-8\n\nfrom numpy import random\n\nMAX_INT = 50 \n\nPATERN=\"%-13s\"\n\ndef two_arg_problem():\n sel = '+'\n a = random.randint(1, MAX_INT-1)\n if random.randint(0, 1) == 0:\n sel = '+'\n if a < 10:\n b = random.randint(11-a, MAX_INT - a)\n el...
[ [ "numpy.random.randint" ] ]
SimScaleGmbH/external-building-aerodynamics
[ "8ab6ce7bf7e0835d9b200c55461cd6966479f94a" ]
[ "examples/AIJ Case D/TKE_API.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 2 19:34:28 2021\n\n@author: MohamadKhairiDeiri\n\"\"\"\n\nimport pathlib\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom scipy import stats\n\nimport simscale_eba.ResultProcessing as res\n\nresult = res...
[ [ "numpy.square", "numpy.isnan", "pandas.read_excel", "scipy.stats.linregress", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.invert", "numpy.sqrt", "scipy.stats.sem" ] ]
zhyever/Monocular-Depth-Estimation-Toolbox
[ "c591b9711321450387ffa7322ec1db9a340347c2" ]
[ "depth/apis/inference.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport matplotlib.pyplot as plt\nimport mmcv\nimport torch\nfrom mmcv.parallel import collate, scatter\nfrom mmcv.runner import load_checkpoint\n\nfrom depth.datasets.pipelines import Compose\nfrom depth.models import build_depther\n\n\ndef init_depther(config, chec...
[ [ "torch.no_grad" ] ]
ADALabUCSD/vista
[ "3cf4486c3b06c93b7841da180ab46ad6e433cac8" ]
[ "spark/code/python/cnn/alexnet.py" ]
[ "'''\nCopyright 2018 Supun Nakandala and Arun Kumar\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 applicable law or agre...
[ [ "tensorflow.reshape", "tensorflow.constant", "tensorflow.variable_scope", "tensorflow.get_variable", "tensorflow.nn.softmax", "tensorflow.get_collection", "tensorflow.cast" ] ]
SamarthH/qiskit-metal
[ "4a5a002b898429500913174c088564a787869b65" ]
[ "qiskit_metal/tests/test_analyses_2_functionality.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE...
[ [ "pandas.DataFrame", "numpy.linspace", "numpy.array_equal" ] ]
ai-cv/rq
[ "032c41ed7c263456c1f1beccd2a4d5515400366e" ]
[ "CodesInBooks/ContourDetection/BoundingBox.py" ]
[ "import cv2\nimport numpy as np\nimport imutils\n\n\nimg = cv2.pyrDown(cv2.imread(\"../data/imgs/hg.png\", cv2.IMREAD_UNCHANGED))\nret, thresh = cv2.threshold(cv2.cvtColor(img.copy(), cv2.COLOR_BGR2GRAY), 127, 255, cv2.THRESH_BINARY)\n# contours = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)...
[ [ "numpy.int0" ] ]
JuAbels/CAVE
[ "344cf9bf6d205cfe892780cd13c94e67a5e8549c" ]
[ "cave/analyzer/compare_default_incumbent.py" ]
[ "import os\nimport logging\nfrom collections import OrderedDict\n\nfrom pandas import DataFrame\nimport numpy as np\n\nfrom cave.analyzer.base_analyzer import BaseAnalyzer\nfrom cave.html.html_helpers import figure_to_html\n\nclass CompareDefaultIncumbent(BaseAnalyzer):\n def __init__(self, default, incumbent):\...
[ [ "pandas.DataFrame" ] ]
VIROBO-15/ML-algo-from-scratch
[ "58d08dce1499b2d2084102be0be7e2403611b1e6" ]
[ "Gaussian_NAive_bayes2.py" ]
[ "import numpy as np\nfrom sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\nfrom math import pi\n\n\niris = load_iris()\nx_train,x_test,y_train,y_test=train_test_split(iris.data,iris.target,train_size=120,random_state=1000)\n#print(x_train)\n\nclc= np.zeros((3,1))\nlst1,lst2,l...
[ [ "numpy.array", "numpy.zeros", "numpy.mean", "numpy.var", "sklearn.model_selection.train_test_split", "sklearn.datasets.load_iris" ] ]
sourcery-ai-bot/cxplain
[ "ff3310c3042d70d4f857f824d9c2a096d1a03898", "ff3310c3042d70d4f857f824d9c2a096d1a03898" ]
[ "cxplain/backend/model_builders/base_model_builder.py", "cxplain/util/count_vectoriser.py" ]
[ "\"\"\"\nCopyright (C) 2019 Patrick Schwab, ETH Zurich\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify,...
[ [ "tensorflow.keras.backend.int_shape", "tensorflow.python.keras.layers.Input", "tensorflow.compat.v1.train.RMSPropOptimizer", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.python.keras.callbacks.ModelCheckpoint", "tensorflow.compat.v1.train.MomentumOptimizer", "tensorflow.pyth...
hogansung/deep-reinforcement-learning
[ "5170ca42bdfdb16cc5c2b86c61bee304015a6254" ]
[ "maddpg/OUNoise.py" ]
[ "import numpy as np\nimport torch\n\n\n# from https://github.com/songrotek/DDPG/blob/master/ou_noise.py\nclass OUNoise:\n def __init__(self, action_dimension, scale=0.1, mu=0, theta=0.15, sigma=0.2):\n self.action_dimension = action_dimension\n self.scale = scale\n self.mu = mu\n self...
[ [ "numpy.ones", "torch.tensor" ] ]
ekalosak/GPy
[ "ff82f12c3d321bfc3ce6615447fad25aea9de6bd", "ff82f12c3d321bfc3ce6615447fad25aea9de6bd", "ff82f12c3d321bfc3ce6615447fad25aea9de6bd" ]
[ "GPy/inference/latent_function_inference/pep.py", "GPy/likelihoods/gamma.py", "GPy/util/netpbmfile.py" ]
[ "from .posterior import Posterior\nfrom ...util.linalg import jitchol, tdot, dtrtrs, dtrtri, pdinv\nfrom ...util import diag\nimport numpy as np\nfrom . import LatentFunctionInference\nlog_2_pi = np.log(2*np.pi)\n\nclass PEP(LatentFunctionInference):\n '''\n Sparse Gaussian processes using Power-Expectation P...
[ [ "numpy.square", "numpy.dot", "numpy.log", "numpy.sum", "numpy.eye", "numpy.sqrt", "numpy.diag" ], [ "scipy.special.psi", "scipy.special.gamma", "scipy.special.polygamma", "numpy.log", "numpy.exp", "numpy.atleast_1d" ], [ "numpy.max", "numpy.ndind...
gronlund/kmeans1d
[ "585386d4678000691706acdb954911be8fea1c5c" ]
[ "plot.py" ]
[ "import argparse\nimport csv\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nCLOCKS_PER_SEC = 1000000\n\n\ndef main(k_plot, constant=False, csvfilename='timing.csv'):\n with open(csvfilename) as time_file:\n csv_reader = csv.reader(time_file)\n fasts = []\n medis = []\n ns =...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ticklabel_format" ] ]
ZurMaD/DAIN
[ "22570e51e84f7dfd48ba4f88e6ee7c9ff1b0b123" ]
[ "my_package/Interpolation/setup.py" ]
[ "#!/usr/bin/env python3\nimport os\nimport torch\n\nfrom setuptools import setup, find_packages\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\ncxx_args = ['-std=c++11']\n\nnvcc_args = [\n '-gencode', 'arch=compute_50,code=sm_50',\n '-gencode', 'arch=compute_52,code=sm_52',\n '-genc...
[ [ "torch.utils.cpp_extension.CUDAExtension" ] ]
sfermigier/quantipy3
[ "6b1a5404a70b1a419493f612c39127d7baed4124" ]
[ "tests/test_complex_logic.py" ]
[ "import unittest\nimport os.path\nimport numpy as np\nimport pandas as pd\nfrom pandas.util.testing import assert_frame_equal\nfrom . import test_helper\nimport copy\n\nfrom operator import lt, le, eq, ne, ge, gt\n\nfrom pandas.core.index import Index\n__index_symbol__ = {\n Index.union: ',',\n Index.intersec...
[ [ "pandas.DataFrame.from_csv" ] ]
lukadvisor/BCNet
[ "d55263c0543ecf27f1f72e03a1a1eafb7b18ae88" ]
[ "detectron2/data/samplers/distributed_sampler.py" ]
[ "import itertools\nimport math\nfrom collections import defaultdict\nfrom typing import Optional\nimport torch\nfrom torch.utils.data.sampler import Sampler\n\nfrom detectron2.utils import comm\n\n\nclass TrainingSampler(Sampler):\n \"\"\"\n In training, we only care about the \"infinite stream\" of training ...
[ [ "torch.trunc", "torch.arange", "torch.Generator", "torch.randperm", "torch.tensor" ] ]
benjydel/ssd_keras
[ "3cbbfa631dc1f5c66ce299f0c433cacb52c6cab1" ]
[ "inference_ssd300.py" ]
[ "# Needed libraries\nimport argparse\n\nfrom ssd_encoder_decoder.ssd_output_decoder import decode_detections\nfrom data_generator.object_detection_2d_misc_utils import apply_inverse_transforms\n\nimport numpy as np\nimport random\nimport cv2\n\nfrom threading import Thread\nfrom datetime import datetime\nimport tim...
[ [ "numpy.array", "tensorflow.python.platform.gfile.GFile", "numpy.set_printoptions", "tensorflow.GraphDef", "tensorflow.Session", "tensorflow.import_graph_def" ] ]
akaashsidhu/statsmodels
[ "fadf25911739a3611980278aabf751e2df6e6680" ]
[ "statsmodels/tsa/holtwinters.py" ]
[ "\"\"\"\nNotes\n-----\nCode written using below textbook as a reference.\nResults are checked against the expected outcomes in the text book.\n\nProperties:\nHyndman, Rob J., and George Athanasopoulos. Forecasting: principles and\npractice. OTexts, 2014.\n\nAuthor: Terence L van Zyl\nModified: Kevin Sheppard\n\"\"\...
[ [ "numpy.finfo", "numpy.zeros_like", "numpy.log", "numpy.arange", "numpy.ndim", "numpy.log10", "scipy.optimize.minimize", "scipy.optimize.brute", "numpy.array", "scipy.spatial.distance.sqeuclidean", "scipy.stats.boxcox", "scipy.optimize.basinhopping", "numpy.zeros...
deepakdalakoti/Bayesian_neural_net
[ "1ee554d64550377dfa4295bb05e61bab98e43ee4" ]
[ "meshes/naca-2412-airfoil/airfoil-mesh.py" ]
[ "'''\n// NACA 2412 Airfoil\n// Created using Gmsh (http://gmsh.info/)\n// Mesh Distributed by: Notre Dame CICS (MIT Liscense)\n// - Associated publication:\n// doi: https://doi.org/10.1016/j.jcp.2019.01.021\n// github: https://github.com/cics-nd/rans-uncertainty\n'''\n\nimport pygmsh #See: https://pypi.org/project/...
[ [ "numpy.array", "numpy.genfromtxt", "numpy.zeros" ] ]
jwohlwend/flop
[ "c5bbd4c5fae6291e2a056e68b44bcf97e4d757bf" ]
[ "examples/enwik8_tf/eval.py" ]
[ "# coding: utf-8\nimport argparse\nimport time\nimport math\nimport os, sys\n\nimport torch\n\nfrom data_utils import get_lm_corpus\nfrom mem_transformer import MemTransformerLM\nfrom utils.exp_utils import get_logger\n\nparser = argparse.ArgumentParser(description='PyTorch Transformer Language Model')\nparser.add_...
[ [ "torch.device", "torch.no_grad", "torch.load" ] ]
torchgan/torchgan
[ "cfd5da4b7ffcec544c6cc4a22257edf40fd31f9d" ]
[ "torchgan/losses/auxclassifier.py" ]
[ "import torch\n\nfrom .functional import auxiliary_classification_loss\nfrom .loss import DiscriminatorLoss, GeneratorLoss\n\n__all__ = [\n \"AuxiliaryClassifierGeneratorLoss\",\n \"AuxiliaryClassifierDiscriminatorLoss\",\n]\n\n\nclass AuxiliaryClassifierGeneratorLoss(GeneratorLoss):\n r\"\"\"Auxiliary Cla...
[ [ "torch.randint", "torch.randn" ] ]
HJReachability/learning_feedback_linearization
[ "cb655ade4cfbf53f5dd19f79c943f7665666f2cb" ]
[ "sandbox/train_stuff.py" ]
[ "import gym\nimport tensorflow as tf\nimport spinup\nimport numpy as np\n\n#defining arguments for environment\nenvargs = {\"uscaling\": 0.1}\n\n#making environment lambda function\n#env = lambda : gym.make(\"quadrotor_14d_env:Quadrotor14dEnv-v0\", uscaling=0.1, dynamicsScaling = 0)\nenv = lambda : gym.make(\"custo...
[ [ "numpy.random.randint" ] ]
JenkoB/resolwe-bio
[ "a958cf3fc82ebc37f527e1b156753f2324a33803" ]
[ "resolwe_bio/tools/genehcluster.py" ]
[ "#!/usr/bin/env python2\n# pylint: disable=missing-docstring,invalid-name,import-error\n# XXX: Refactor to a comand line tool and remove pylint disable\n\"\"\"Hierarchical clustering of expression time courses.\"\"\"\nfrom __future__ import absolute_import, division, print_function\n\nimport argparse\nimport json\n...
[ [ "numpy.array", "scipy.spatial.distance.pdist", "numpy.array_equal", "numpy.isnan", "scipy.stats.spearmanr", "numpy.interp", "numpy.corrcoef", "numpy.nanmax" ] ]
MahmudulAlam/Recurrently-Semantic-Segmentation
[ "64f988e3e278ef7807cdb2dd48c79eb1bbc66519" ]
[ "visualize.py" ]
[ "import colorsys\nimport numpy as np\n\n\ndef random_colors(N, bright=True):\n brightness = 1.0 if bright else 0.7\n hsv = [(i / N, 1, brightness) for i in range(N)]\n colors = list(map(lambda c: colorsys.hsv_to_rgb(*c), hsv))\n return colors\n\n\ndef apply_mask(image, mask, color, alpha=0.5):\n for ...
[ [ "numpy.where" ] ]
RangK/models
[ "a1ce90442e3205b82ffca3badd3c65408f4450cb" ]
[ "research/object_detection/inputs.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.shape", "tensorflow.minimum", "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.random_uniform", "tensorflow.ones_like", "tensorflow.equal", "tensorflow.reshape", "tensorflow.constant", "tensorflow.estimator.export.ServingInputReceiver", "tensorflow...
okteto/demos
[ "15f2af3aae4802b03f43ddbead51e493e54ee2af" ]
[ "cpu/Detection/SSD/examples/SSD320_inference.py" ]
[ "#\n# Copyright (c) 2019, NVIDIA CORPORATION. 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 ...
[ [ "tensorflow.logging.set_verbosity", "tensorflow.train.latest_checkpoint", "tensorflow.ConfigProto", "tensorflow.estimator.RunConfig", "tensorflow.app.run" ] ]
Bobeye/rllab
[ "53c0afb73f93c4a78ff21507914d7f7735c21ea9", "53c0afb73f93c4a78ff21507914d7f7735c21ea9" ]
[ "rllab/misc/ext.py", "dam_files/GPOMDP_SVRG_WV_ada_verA_reacher_fr_nver_2.py" ]
[ "from path import Path\nimport sys\nimport pickle as pickle\nimport random\nfrom rllab.misc.console import colorize, Message\nfrom collections import OrderedDict\nimport numpy as np\nimport operator\nfrom functools import reduce\n\nsys.setrecursionlimit(50000)\n\n\ndef extract(x, *keys):\n if isinstance(x, (dict...
[ [ "tensorflow.set_random_seed", "numpy.concatenate", "numpy.asarray", "numpy.random.RandomState", "numpy.random.seed", "numpy.mean", "numpy.random.shuffle", "numpy.std" ], [ "numpy.concatenate", "numpy.array", "numpy.cov", "numpy.trace", "numpy.zeros", "nu...
leo603222/fix-displace-between-selection-area-and-mouse-pos
[ "1f9031884a980432795b69487bd659f5e4ef91aa" ]
[ "tests/imageview/test_imageview.py" ]
[ "import pyqtgraph as pg\nimport numpy as np\n\napp = pg.mkQApp()\n\ndef test_nan_image():\n img = np.ones((10,10))\n img[0,0] = np.nan\n v = pg.image(img)\n v.imageItem.getHistogram()\n app.processEvents()\n v.window().close()\n\ndef test_init_with_mode_and_imageitem():\n data = np.random.randi...
[ [ "numpy.ones", "numpy.random.randint" ] ]
bowang-lab/CONCERTO
[ "a6b59778eb4d2a964ca1795fa6368eeb579c1bf7" ]
[ "src/models.py" ]
[ "import torch as th\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport pandas as pd\nimport numpy as np\nfrom dgl.nn import MaxPooling, AvgPooling, GlobalAttentionPooling\nfrom dgl import function as fn\nfrom dgl.nn.pytorch.softmax import edge_softmax\nfrom dgllife.model import GATPredictor, GIN, load_...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "numpy.ceil", "torch.nn.AvgPool1d", "torch.nn.Conv1d", "torch.nn.Sequential", "torch.nn.ELU", "torch.no_grad", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "pandas.Series", "torch.nn.MaxPool1d", "torch.mean", ...
RonMeiburg/orqviz
[ "fd3e345ac76325cc1f8bd0d523af33689af31fda" ]
[ "tests/orqviz/hessians/hessians_test.py" ]
[ "import os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom orqviz.hessians import (\n get_Hessian,\n get_Hessian_SPSA_approx,\n perform_1D_hessian_eigenvector_scan,\n plot_1D_hessian_eigenvector_scan_result,\n)\nfrom orqviz.utils import load_viz_object, save_viz_object\n\n\ndef COST_FUNCT...
[ [ "numpy.testing.assert_array_almost_equal", "numpy.sum", "numpy.sin", "numpy.random.rand" ] ]
ksu-hmi/mouth-check
[ "f659a8c76707eb7f974dc3fbdd93b1324315f91b" ]
[ "masksMaker.py" ]
[ "import numpy as np\nfrom utils import pairwise\nfrom tqdm import tqdm\nimport os\nimport json\nfrom PIL import Image, ImageDraw\nfrom skimage.draw import polygon2mask\nimport cv2\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport sys\n\n\n\npathImgSrc = \"data\\\\img\\\\ori\"\npathImgDst = \"data\\\\img...
[ [ "pandas.DataFrame", "numpy.zeros", "numpy.maximum" ] ]
leichen2018/dgl
[ "820caa02d022618fc4c2a835e44695f744b0fdca" ]
[ "examples/pytorch/line_graph/test.py" ]
[ "\"\"\"\nSupervised Community Detection with Hierarchical Graph Neural Networks\nhttps://arxiv.org/abs/1705.08415\n\nAuthor's implementation: https://github.com/joanbruna/GNN_community\n\"\"\"\n\nfrom __future__ import division\nimport time\nfrom datetime import datetime as dt\n\nimport argparse\nfrom itertools imp...
[ [ "torch.device", "torch.cat", "torch.max", "torch.no_grad", "numpy.mean", "torch.ones", "torch.from_numpy", "numpy.std", "torch.load", "torch.chunk", "torch.sum" ] ]
trhongbinwang/data_science_journey
[ "3f1437942109250cc41207d39e6bcb6e4ff17730" ]
[ "python/pandas/pandas_command.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Aug 29 11:07:14 2016\r\n\r\npandas command collection\r\n\r\n\r\n\"\"\"\r\n\r\nimport pandas as pd\r\n\r\nimport numpy as np\r\n\r\n# create df from dict\r\ndata = {'name': ['Jason', 'Molly', 'Tina', 'Jake', 'Amy'], \r\n 'year': [2012, 2012, 2013, 2014, 20...
[ [ "pandas.DataFrame" ] ]
korobool/codefinder
[ "02ffe34066547fb1a9d996ddabf0ede753b26ef6" ]
[ "train.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom sklearn.metrics import accuracy_score\n\ntf.reset_default_graph()\n\nfrom model import *\n\nf1_ = open('loss_test_track.json', 'w')\nf2_ = open('loss_train_track.json', 'w')\nbatch_size = 100\nmax_batches = 11801\nbatches_for_test = 100\nbatches_for_print = 10\nepo...
[ [ "tensorflow.Session", "tensorflow.reset_default_graph", "tensorflow.train.Saver", "sklearn.metrics.accuracy_score", "numpy.float32", "tensorflow.global_variables_initializer" ] ]
mamalmaleki/hands_on_ml
[ "086fa254847bda2c3b3b7e27997ee0ecd7152171" ]
[ "ch02/ex0202_randomized_search_cv.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nnp.random.seed(42)\n\nimport os\nimport tarfile\nimport urllib.request\n\nDOWNLOAD_ROOT = \"https://raw.githubusercontent.com/ageron/handson-ml2/master/\"\nHOUSING_PATH = os.path.join(\"datasets\", \"housing\")\nHOUSING_URL = DOWNLOAD_ROOT + \"datasets/housing...
[ [ "sklearn.impute.SimpleImputer", "scipy.stats.expon", "pandas.cut", "numpy.log", "sklearn.preprocessing.StandardScaler", "numpy.random.seed", "scipy.stats.reciprocal", "matplotlib.pyplot.title", "sklearn.model_selection.RandomizedSearchCV", "matplotlib.pyplot.figure", "m...
cr1m5onk1ng/text_similarity
[ "2123621bf153683b35e9433835237812605bd42f" ]
[ "src/compression/prune.py" ]
[ "import transformers\nfrom transformers.models.auto.configuration_auto import AutoConfig\nfrom transformers import AutoModel, AutoModelForSequenceClassification\nfrom transformers import AutoTokenizer\nfrom src.dataset.wic_dataset import *\nfrom transformers import AutoTokenizer\nfrom src.models.modeling import Bas...
[ [ "torch.device", "torch.cuda.amp.autocast" ] ]
nils-werner/keras
[ "78f26df8fb2b8aa5c6262aef44a494a8335a9c6e" ]
[ "tests/keras/utils/data_utils_test.py" ]
[ "\"\"\"Tests for functions in data_utils.py.\n\"\"\"\nimport os\nimport sys\nimport tarfile\nimport threading\nimport zipfile\nfrom itertools import cycle\n\nimport numpy as np\nimport pytest\nfrom six.moves.urllib.parse import urljoin\nfrom six.moves.urllib.request import pathname2url\n\nfrom keras.utils import Se...
[ [ "numpy.ones" ] ]
k15z/kevz-nnet
[ "e870b02e032903510b3cbac6e604fa58b4b84b44" ]
[ "nnet/layers/softmax.py" ]
[ "import numpy as np\n\nclass Softmax:\n\tdef __init__(self, input_dims, output_dims):\n\t\tself.input_dims = input_dims\n\t\tself.output_dims = output_dims\n\t\tself.weight = np.random.normal(0.0, 1.0 / np.sqrt(output_dims), (output_dims, input_dims))\n\n\tdef _softmax(self, y):\n\t\tresult = []\n\t\tfor i, y_i in ...
[ [ "numpy.max", "numpy.array", "numpy.dot", "numpy.vectorize", "numpy.sum", "numpy.sqrt", "numpy.outer" ] ]
JPchico/parsevasp
[ "9e43076657007145e2dbab17b5a57fff7b778442" ]
[ "tests/test_xml_regular.py" ]
[ "import os\nimport pytest\nimport numpy as np\nfrom parsevasp.vasprun import Xml\nimport utils\n\"\"\"Test parsew, the regular extraction for both terminated\nand truncated XML files.\n\n\"\"\"\n@pytest.fixture(scope='module', autouse=True)\ndef set_precision(request):\n np.set_printoptions(precision=8)\n\n\n@py...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.set_printoptions", "numpy.allclose", "numpy.all" ] ]
SuiMingYang/ProductTypeClassify
[ "ad5c76e71f21dccd2c1190eff96848146c0790c8" ]
[ "api.py" ]
[ "from sklearn.externals import joblib\nimport pickle\nfrom sklearn.feature_extraction.text import CountVectorizer\nimport jieba\nfrom collections import Counter\n\n\"\"\"\n调用代码\n\"\"\"\n\nif __name__ == \"__main__\":\n def put_category(l):\n l=loaded_model.predict(vec.transform(jieba.lcut(l)))\n l=...
[ [ "sklearn.externals.joblib.load" ] ]
jswalens/labyrinth
[ "d6a9359cafcc0ed02c5cd6c152551386e1e160f8" ]
[ "results/process-results.py" ]
[ "import sys\nimport re\nfrom collections import defaultdict\nimport numpy\n\nif len(sys.argv) >= 2:\n FILE = sys.argv[1]\nelse:\n FILE = \"20190817T1454-1cc19b18.csv\"\n\nif len(sys.argv) >= 3:\n OUTPUT = sys.argv[2]\nelse:\n # E.g. 20190817T1454-1cc19b18.csv to\n # 20190817T1454-1cc19b18-medians.csv...
[ [ "numpy.median", "numpy.percentile" ] ]
mattroos/dino
[ "5e5a599a5f315bad9bf85112f29d5671822af484" ]
[ "eval_linear.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\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 ...
[ [ "torch.nn.Linear", "torch.nn.Identity", "torch.cat", "torch.cuda.synchronize", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.no_grad", "torch.nn.parallel.DistributedDataParallel", "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSampler", "torc...
KLeeDE/Python
[ "0a12ffdabb25586ab47d10d5a320033918155eac" ]
[ "Ch5_Cartopy/5_Python_Week5_cartopy.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Dec 3 12:03:49 2020\r\n\r\n@author: Kyungmin Lee\r\n\"\"\"\r\n\r\n# R / Week3 Assignment\r\n\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\n\r\nimport cartopy\r\nimport cartopy.crs as ccrs\r\nimport matplotlib.pyplot as plt\r\n\r\nhelp(ccrs.PlateCa...
[ [ "matplotlib.pyplot.contourf", "matplotlib.cm.get_cmap", "numpy.linspace", "numpy.mean", "matplotlib.pyplot.figure", "matplotlib.pyplot.axes", "numpy.deg2rad", "matplotlib.patches.Rectangle", "numpy.meshgrid" ] ]
hanseungwook/SimSiam
[ "ff363f2cfdee07ecfee6c25ae3e920fdb9302e57" ]
[ "models/backbones/wrn.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\"\"\"\nOriginal Author: Wei Yang\n\"\"\"\n\n__all__ = ['wrn']\n\n\nclass BasicBlock(nn.Module):\n def __init__(self, in_planes, out_planes, stride, dropRate=0.0):\n super(BasicBlock, self).__init__()\n self.bn1 =...
[ [ "torch.nn.Linear", "torch.nn.functional.avg_pool2d", "torch.nn.ModuleList", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.functional.dropout", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.randn" ] ]
i14kawanaka/AtCoder
[ "1dd24b42ef672a64c592dc6479a80c4fe8383abc" ]
[ "ABC/205/C.py" ]
[ "import numpy as np\ns1 = input().split()\nA = int(s1[0])\nB = int(s1[1])\nC = int(s1[2])\n\nif(C%2 == 0): #偶数\n if(np.abs(A)==np.abs(B)):\n print(\"=\")\n elif(np.abs(A)>np.abs(B)):\n print(\">\")\n else:\n print(\"<\")\nelse:\n if(A==B):\n print(\"=\")\n elif(A>B):\n ...
[ [ "numpy.abs" ] ]
Peiiii/detro
[ "26d74468d7554dc20b2a2daf7ec5009302c820f2" ]
[ "detro/packages/circledet/network.py" ]
[ "from .resnet_backbone import resnet18\nfrom torch import nn\nimport torch\nimport torch.nn.functional as F\nfrom detro.networks.components import BiFPN, Center_layer, Offset_layer, Reg_layer, Heatmap_layer\nfrom detro.networks.losslib import center_loss, distance_loss\n\n\nclass FeatureFusionNetwork(nn.Module):\n ...
[ [ "torch.cat", "torch.nn.functional.upsample", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
idea-iitd/graphgen
[ "0c74511faeed593dcfa7a6c59fc177812232f7d2" ]
[ "metrics/stats.py" ]
[ "import concurrent.futures\nimport os\nimport pickle\nimport subprocess as sp\nimport tempfile\nfrom datetime import datetime\nfrom functools import partial\nimport numpy as np\nimport networkx as nx\n\nimport metrics.mmd as mmd\n\nPRINT_TIME = True\nMAX_WORKERS = 48\n\n\ndef degree_worker(G):\n return np.array(...
[ [ "numpy.histogram", "numpy.array", "numpy.sum" ] ]
ogzgbkn/rover_20
[ "ca35debe3decb67fd1a3270ce478984ae7af8f60", "4582036b06bc60774efaf79fdb6806d0ce20efd7" ]
[ "arm_20/geometric_approach/geometrical_ik_v3.py", "rover_20_image/src/rover_send_color.py" ]
[ "import rospy\nimport math\nfrom std_msgs.msg import Float64 as F64\nimport numpy as np\nfrom random import randint\nfrom calculations import *\nfrom sensor_msgs.msg import Joy\nfrom Arm import *\n\n\nglobal x,xi,y,yi,z,zi,w,flag,button\nflag=False\nx=54.0\ny=50.0\nz=0.0\nxi=0.0\nyi=0.0\nzi=0.0\nbutton=0.0\npitch=0...
[ [ "numpy.degrees" ], [ "numpy.array", "numpy.ones" ] ]
always-newbie161/pyprobml
[ "eb70c84f9618d68235ef9ba7da147c009b2e4a80", "eb70c84f9618d68235ef9ba7da147c009b2e4a80", "eb70c84f9618d68235ef9ba7da147c009b2e4a80" ]
[ "scripts/Old/8mer.py", "scripts/pca_digits.py", "scripts/coiled_pytorch_finetune.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nDEFAULT_SITES = ['HOXC4_REF_R2', 'CRX_REF_R1']\n\ndef load_data(file_name, normalize=False):\n #Function to load the data source file \n data = pd.read_csv(file_name, sep=',')\n data = data.iloc[:, 1:] # Remove index column\n assert d...
[ [ "numpy.max", "numpy.array", "numpy.vectorize", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "pandas.qcut", "numpy.mean", "matplotlib.pyplot.figure", "numpy.where", "numpy.size", "matplotlib.pyplot.show", "pandas.read_csv" ], [ "numpy.array", "num...
sagarchotalia/Pick-and-Place-Robot-Eklavya
[ "79005767e457018a2cbf397b7bd4887c009fb6c9" ]
[ "Script/Scene_Script.py" ]
[ "# -*- coding: utf-8 -*-\n# importing modules\nimport time\nimport numpy as np\nimport cv2\nfrom zmqRemoteApi import RemoteAPIClient\nfrom bp3d import Bin, Item, bp3D\n# connecting via ZMQ Api at port 23000 \nclient = RemoteAPIClient('localhost',23000)\n# getting simulation handles\nsim = client.getObject('sim')\ns...
[ [ "numpy.frombuffer" ] ]
vladsterz/GraphCMR
[ "710527332583e81926e677dd596e4a3a5f2a9811" ]
[ "opendr/helpers.py" ]
[ "__author__ = 'pol'\n\nfrom utils import *\nimport opendr\nimport geometry\nimport numpy as np\nfrom math import radians\nfrom opendr.camera import ProjectPoints\nfrom opendr.renderer import TexturedRenderer\nfrom opendr.lighting import SphericalHarmonics\nfrom opendr.lighting import LambertianPointLight\nimport ch...
[ [ "numpy.array", "numpy.empty", "numpy.zeros", "numpy.tile", "numpy.repeat", "numpy.vstack" ] ]
holyseven/WassersteinGAN.tensorflow
[ "29b51b5aefc97537eb148d4ea353ca12d268c166" ]
[ "utils.py" ]
[ "__author__ = 'shekkizh'\n# Utils used with tensorflow implemetation\nimport tensorflow as tf\nimport numpy as np\nimport scipy.misc as misc\nimport os, sys\nfrom six.moves import urllib\nimport tarfile\nimport zipfile\nfrom tqdm import trange\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import Im...
[ [ "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.nn.lrn", "tensorflow.ones", "tensorflow.control_dependencies", "tensorflow.nn.avg_pool", "tensorflow.python.training.moving_averages.assign_moving_average", "tensorflow.identity", "tensorflow.summary.histogr...
marc-h-lambert/L-RVGA
[ "e7cd0c9745c87fb68828f28b1856a9616da933b1" ]
[ "XP_LRVGA_LinearRegression.py" ]
[ "###################################################################################\n# THE KALMAN MACHINE LIBRARY #\n# Code supported by Marc Lambert #\n############################################################...
[ [ "numpy.array", "matplotlib.ticker.MultipleLocator", "numpy.zeros", "numpy.random.seed", "matplotlib.pyplot.savefig", "numpy.ones", "matplotlib.ticker.LogLocator", "numpy.identity", "matplotlib.pyplot.tight_layout" ] ]
Koushul/FindAllRNA
[ "a2c41831f67be2cd52629ebc2ef24cfca3e172f5" ]
[ "FindAllRNA/Archieved/models.py" ]
[ "import os\n\nimport warnings\n\nfrom encoders import AbstractSequenceEncoder\nwarnings.simplefilter(action='ignore', category=FutureWarning)\n\nimport tensorflow as tf\nfrom tensorflow import keras\nimport numpy as np\n# from tensorflow.python.keras.backend import GraphExecutionFunction\n\nfrom tensorflow.keras.la...
[ [ "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.MaxPooling1D", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.Sequential", "tensorflow.keras.layers.GaussianNois...
Unprocessable/pandas
[ "2c8e53efa2f5c6470a9d65da55461f3d3ea9b961" ]
[ "pandas/core/reshape/pivot.py" ]
[ "import numpy as np\n\nfrom pandas.util._decorators import Appender, Substitution\n\nfrom pandas.core.dtypes.cast import maybe_downcast_to_dtype\nfrom pandas.core.dtypes.common import is_integer_dtype, is_list_like, is_scalar\nfrom pandas.core.dtypes.generic import ABCDataFrame, ABCSeries\n\nimport pandas.core.comm...
[ [ "pandas.util._decorators.Substitution", "pandas.core.common.maybe_make_list", "pandas.core.dtypes.common.is_scalar", "pandas.DataFrame", "pandas.core.dtypes.cast.maybe_downcast_to_dtype", "pandas.core.series.Series", "pandas.core.index._get_objs_combined_axis", "pandas.core.index.M...
BoChenGroup/Pydpm
[ "7498f195665f60e56700f57bc6c6c24896dc7485" ]
[ "pydpm/_model/_cpgbn.py" ]
[ "\"\"\"\n===========================================\nConvolutional Poisson Gamma Belief Network\nChaojie Wang Sucheng Xiao Bo Chen and Mingyuan Zhou\nPublished in International Conference on Machine Learning 2019\n\n===========================================\n\n\"\"\"\n\n# Author: Chaojie Wang <xd_silly@163.c...
[ [ "numpy.dot", "numpy.random.rand", "numpy.sum", "numpy.ones", "numpy.load", "numpy.save", "numpy.where" ] ]
ch135/pyCFTrack
[ "18cf5b36b9b4796b44640357f32eadca963ccc07" ]
[ "cftracker/kcf.py" ]
[ "\nimport numpy as np\nimport cv2\nfrom lib.utils import cos_window,gaussian2d_rolled_labels\nfrom lib.fft_tools import fft2,ifft2\nfrom .base import BaseCF\nfrom .feature import extract_hog_feature,extract_cn_feature\n\nclass KCF(BaseCF):\n def __init__(self, padding=1.5, features='gray', kernel='gaussian'):\n ...
[ [ "numpy.array", "numpy.clip", "numpy.mean", "numpy.argmax", "numpy.conj", "numpy.sqrt", "numpy.size", "numpy.floor" ] ]
duyniem/tsai
[ "5eb1c375883986a3ebba5a2f8eddf2e4b9f86f85" ]
[ "tsai/data/validation.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/000b_data.validation.ipynb (unless otherwise specified).\n\n__all__ = ['check_overlap', 'check_splits_overlap', 'leakage_finder', 'balance_idx', 'TrainValidTestSplitter',\n 'plot_splits', 'get_splits', 'TSSplitter', 'TimeSplitter', 'get_predefined_splits', ...
[ [ "sklearn.model_selection.KFold", "matplotlib.patches.Patch", "sklearn.model_selection.StratifiedKFold" ] ]
josborne-noaa/PyFerret
[ "8496508e9902c0184898522e9f89f6caea6d4539" ]
[ "pyfermod/stats/stats_stats.py" ]
[ "\"\"\"\nReturns the (unweighted) mean, variance, skew, and kurtoses\nof an array of values\n\"\"\"\n\nfrom __future__ import print_function\n\nimport math\nimport numpy\nimport pyferret\nimport scipy.stats\n\n\ndef ferret_init(id):\n \"\"\"\n Initialization for the stats_stats.py Ferret PyEF\n \"\"\"\n ...
[ [ "numpy.logical_not", "numpy.array", "numpy.isnan", "numpy.empty", "numpy.ones", "numpy.mean", "numpy.allclose", "numpy.fabs", "numpy.power", "numpy.var" ] ]
movingpictures83/Transform
[ "229e5ebc9015ee34f62bf68a2cc15b2b1756784f" ]
[ "TransformPlugin.py" ]
[ "import sys\nimport numpy\nimport math\nclass TransformPlugin:\n def input(self, filename):\n self.myfile = filename\n\n def run(self):\n filestuff = open(self.myfile, 'r')\n self.firstline = filestuff.readline()\n lines = []\n for line in filestuff:\n lines.append(line)\n\n ...
[ [ "numpy.zeros" ] ]
taokz/FuzzyFL
[ "337a4a52e006db2dfb10b53d2c141a812c9adb21" ]
[ "gaussian_mf.py" ]
[ "\"\"\"\nImplementation of gaussian membership function\n\nAuthor: Kai Zhang (www.kaizhang.us)\nhttps://github.com/taokz\n\"\"\"\n\nimport numpy as np \n\ndef gaussmf(elements, mean, sigma):\n\t\"\"\"\n\tinput:\n\t\telements: (array) elements of the set\n\t\tmean: (real) mean of the set\n\t\tsigma (real) standart d...
[ [ "numpy.square", "numpy.dot", "numpy.linalg.inv", "numpy.exp" ] ]
beyucel/gpytorch
[ "a5394937495756945b831d83035349579d8fac31", "a5394937495756945b831d83035349579d8fac31" ]
[ "gpytorch/utils/transforms.py", "test/lazy/test_block_diag_lazy_tensor.py" ]
[ "#!/usr/bin/env python3\n\nimport torch\n\n\ndef inv_softplus(x):\n return torch.log(torch.exp(x) - 1)\n\n\ndef inv_sigmoid(x):\n return torch.log(x / (1 - x))\n\n\ndef _get_inv_param_transform(param_transform, inv_param_transform=None):\n reg_inv_tf = TRANSFORM_REGISTRY.get(param_transform, None)\n if ...
[ [ "torch.log", "torch.exp" ], [ "torch.zeros", "torch.eye", "torch.randn" ] ]
bchao1/stereo-magnification
[ "031376675430a459f4bde768eb5c652f1d22a0a4" ]
[ "geometry/projector.py" ]
[ "#!/usr/bin/python\n#\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app...
[ [ "tensorflow.zeros", "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.matmul", "tensorflow.contrib.resampler.resampler", "tensorflow.meshgrid", "tensorflow.reshape", "tensorflow.transpose", "tensorflow.ones_like", "tensorflow.constant", "tensorflow.ones", "...
Karthik-Git-Sudo786/cisco-kubeflow-starter-pack
[ "49013953c0cf0de508bb05f1837809d84e6ea2d2" ]
[ "apps/networking/network-traffic/onprem/pipelines/custom_visualization.py" ]
[ "\nfrom sklearn.metrics import precision_recall_curve\nimport matplotlib.pyplot as plt\nrd = pd.read_excel('network_source.xlsx',index=None,sheet_name='Sheet1')\nprecision, recall, _ = precision_recall_curve(np.array(rd['actual']),np.array(rd['pred']))\nplt.step(recall, precision, color='g', alpha=0.2, where='post'...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.step", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.ylabel...
TensorVision/MediSeg
[ "222fcab98d82f48f09304eda3cfbfe4d6ac825b7" ]
[ "AP3/basic_local_classifier.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"A basic classifier which uses only local features.\"\"\"\n\nimport os.path\nfrom PIL import Image\nimport scipy.misc\nimport scipy.ndimage\n\nimport logging\nimport sys\nimport time\nimport numpy as np\nimport json\n\nlogging.basicConfig(format='%(asctime)s %...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "sklearn.utils.shuffle" ] ]
harisankarh/IndianNLP-Transliteration
[ "0e0dd8139c75477346c985201b51315b3a4e4f48" ]
[ "tasks/rnn_xlit_runner.py" ]
[ "''' RNN Seq2Seq (Encoder-Decoder) training setup\n'''\n\nimport torch\nfrom torch.utils.data import DataLoader\nimport numpy as np\nimport os\nimport sys\nimport json\nfrom tqdm import tqdm\nimport utilities.running_utils as rutl\nfrom utilities.lang_data_utils import XlitData, GlyphStrawboss, merge_xlit_jsons\nfr...
[ [ "torch.nn.CrossEntropyLoss", "torch.no_grad", "torch.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.mean" ] ]
am-3/TimeZoned
[ "e8ae2e90c2d6addf13b145aa2a4c7a9a66c1346e" ]
[ "progs/timezonefinder-master/timezonefinder-master/timezonefinder/helpers.py" ]
[ "# -*- coding:utf-8 -*-\nfrom math import asin, atan2, ceil, cos, degrees, floor, radians, sin, sqrt\n\nfrom numpy import int64\n\nfrom timezonefinder.global_settings import COORD2INT_FACTOR, INT2COORD_FACTOR, MAX_HAVERSINE_DISTANCE\n\n\ndef inside_polygon(x, y, coordinates):\n \"\"\"\n Implementing the ray c...
[ [ "numpy.int64" ] ]
jialinwu17/seg_every_thing
[ "46f1c371136372f81efe986a34f6154ffec48063" ]
[ "lib/core/test.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\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 applicabl...
[ [ "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.round", "numpy.tile", "numpy.exp", "numpy.mean", "numpy.where", "numpy.savez", "numpy.amax", "numpy.vstack", "numpy.sort", "numpy.expand_dims", "numpy.hstack", "numpy.unique", "numpy.maximum" ...
open-mmlab/mmflow
[ "203ea55ad8a4f99fcb394371aa0ba4423d3debcc" ]
[ "mmflow/utils/collect_env.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport os.path as osp\nimport subprocess\nimport sys\nfrom collections import defaultdict\n\nimport cv2\nimport mmcv\nimport torch\nimport torchvision\nfrom mmcv.utils import get_build_config, get_git_hash\n\nimport mmflow\n\n\ndef collect_env() -> dict:\n \"\"\"...
[ [ "torch.cuda.is_available", "torch.cuda.get_device_name", "torch.cuda.device_count" ] ]