repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
futscdav/Chunkmogrify | [
"efdfdf3df0bb15e5e64de8575ab89baaaa9f5340"
] | [
"setup_cpp_ext.py"
] | [
"#\n# Author: David Futschik\n# Provided as part of the Chunkmogrify project, 2021.\n#\n\nimport platform\nimport setuptools\nimport numpy as np\nfrom setuptools import sandbox\n\nplatform_specific_flags = []\nif platform.system() == \"Windows\":\n platform_specific_flags += [\"/permissive-\", \"/Ox\", \"/... | [
[
"numpy.get_include"
]
] |
gitter-badger/GeoMetrics | [
"8f33a7da1db88ea49f10772c4bf63b357e9f066c"
] | [
"src/GUI/compile_space/fermat_sprial.py"
] | [
"import matplotlib.pyplot as plt\nfrom matplotlib import *\nfrom numpy import *\nfrom matplotlib.animation import *\n\nname = \"Fermat Spiral\"\n\ndef r_(u):\n\tr = (a**m * u)\n\treturn r\n\ndef r2_(u):\n\tr2 = 1/((a**-m) * u)\n\treturn r2\n\nm = 2\na = 6\nu = linspace(0.001, 2 * pi,1000)\nr = r_(u)\nr2 = r2_(u)\n\... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplot"
]
] |
compsciencelab/ppo_D | [
"1870c908f498ceb29295e5625ff5598bed82cbb3"
] | [
"main/wrappers.py"
] | [
"import os\nimport sys\nimport gym\nimport torch\nimport glob\nfrom os.path import join\nimport random\nimport numpy as np\nfrom gym import error, spaces\nfrom baselines.bench import load_results\nfrom baselines import bench\nfrom gym.spaces.box import Box\nfrom baselines.common.vec_env import VecEnvWrapper\nimport... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.array",
"torch.cat",
"numpy.zeros",
"torch.no_grad"
]
] |
sghill/sureal | [
"df4bc7a9cfd380569ecf2252be014977c68c792b"
] | [
"sureal/tools/stats.py"
] | [
"import numpy as np\nimport scipy\nimport scipy.signal\nfrom .inverse import inversefunc\nimport warnings\n\n# import multiprocessing\n# pool = multiprocessing.Pool()\n\nfrom .misc import parallel_map\n\n__copyright__ = \"Copyright 2016-2018, Netflix, Inc.\"\n__license__ = \"Apache, Version 2.0\"\n\n\ndef vectorize... | [
[
"numpy.histogram",
"numpy.array",
"numpy.vectorize",
"numpy.errstate",
"scipy.signal.fftconvolve",
"numpy.cosh",
"numpy.exp",
"numpy.interp",
"numpy.arange",
"numpy.sqrt",
"numpy.cumsum",
"numpy.hstack"
]
] |
applelms/guofei9987.github.io | [
"30bbebbda077de08bcb306420fe4e1129cd03e3e"
] | [
"reading/tools/auto_generat_sidebar_tree.py"
] | [
"# 用二叉树自动print sidebar\n\n# %%\nimport os\nimport re\nimport string\n\n# 字数统计\nregex_chinese = re.compile('[\\u4e00-\\u9fa5]') # 汉字\nregex_English = re.compile('[0-9a-zA_Z]+') # 数字和英语单词\n# 去掉中文标点和英文标点\nregex_punctuation = re.compile('[!\"()*+,./:;<=>?{|}~。;,:“”()、?《》]')\n\n\ndef word_count(file_name_md):\n '''... | [
[
"pandas.DataFrame"
]
] |
americanas-data-platform/data-discovery-cidamo | [
"9fe42dcc13b3e6f3fc12a06b181d1207b0be0e74"
] | [
"data_quality/src/transformer/general_transformer.py"
] | [
"import pandas as pd\nfrom data_quality.src.transformer.base_transformer import BaseTransformer\nfrom data_quality.src.transformer.aggregation_functions.categorical import describe_categorical\nfrom data_quality.src.transformer.aggregation_functions.continuous import describe_continuous, describe_datetime\nfrom dat... | [
[
"pandas.to_datetime"
]
] |
Yanan-Clarifai/automl | [
"be9d9677145220f2c622ae57e78827902373afcd"
] | [
"efficientdet/keras/train.py"
] | [
"# Lint as: python3\n# Copyright 2020 Google Research. 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... | [
[
"tensorflow.keras.mixed_precision.experimental.set_policy",
"tensorflow.distribute.MirroredStrategy",
"tensorflow.train.latest_checkpoint",
"tensorflow.random.set_seed",
"tensorflow.config.optimizer.set_jit",
"tensorflow.config.experimental_run_functions_eagerly",
"tensorflow.config.ex... |
stanfordmlgroup/CheXseg | [
"fb5c411ce08e394cd4a2a87d963843942bdc2021"
] | [
"chexpert-model/segmentation_test_save_output.py"
] | [
"import wandb\nfrom args import SegTestArgParser\nimport segmentation_models_pytorch as smp\nfrom data import get_seg_loader\nimport torch\nimport pandas as pd\nimport util\nimport json\nfrom argparse import Namespace\nfrom tqdm import tqdm\nfrom pycocotools import mask\nimport os\n\nimport numpy as np\n\ndevice = ... | [
[
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.load",
"torch.nn.Sigmoid"
]
] |
adrien-berchet/GpsDataAnalyzer | [
"88a0dab83b186430c05d3e0976c5beac796ebc0d"
] | [
"tests/fixtures/poi_points.py"
] | [
"import pytest\n\nimport pandas as pd\n\nimport gps_data_analyzer as gda\n\n\n@pytest.fixture\ndef simple_poi_raw_data():\n x = [0.15]\n y = [1.15]\n r = [0.1]\n return x, y, r\n\n\n@pytest.fixture\ndef simple_poi_df(simple_poi_raw_data):\n x, y, r = simple_poi_raw_data\n df = pd.DataFrame({\"x\":... | [
[
"pandas.DataFrame"
]
] |
ephsmith/darts | [
"0e5b5ad184ed8e83e703e5c955156400930d8afa"
] | [
"darts/tests/models/forecasting/test_NBEATS.py"
] | [
"import numpy as np\n\nfrom darts.tests.base_test_class import DartsBaseTestClass\nfrom darts.utils import timeseries_generation as tg\nfrom darts.logging import get_logger\n\nlogger = get_logger(__name__)\n\ntry:\n from darts.models.forecasting.nbeats import NBEATSModel\n\n TORCH_AVAILABLE = True\nexcept Imp... | [
[
"numpy.average",
"numpy.array"
]
] |
zzzace2000/robust_cls_model | [
"c2b9a79dd5ccbb8aa8beaa08baaded6ed45d0410"
] | [
"arch/inpainting/InpaintingBase.py"
] | [
"import torch.nn as nn\nimport torch\n\nfrom .Baseline import InpaintTemplate\n\n\nclass InpaintingBase(InpaintTemplate):\n def __init__(self):\n super(InpaintingBase, self).__init__()\n\n pth_mean = torch.FloatTensor([0.485, 0.456, 0.406]).unsqueeze(0).unsqueeze(-1).unsqueeze(-1)\n pth_std ... | [
[
"torch.FloatTensor",
"torch.nn.Parameter"
]
] |
AmirAliEbrahimi/PyTorch-ENet | [
"22860676e9f05c06c6babf89001c0226ac146b16"
] | [
"models/bden.py"
] | [
"import torch.nn as nn\nimport torchvision.transforms as transforms\nfrom .binarized_modules import BinarizeConv2d,InputScale,SignumActivation,BinarizeTransposedConv2d\n\nclass BDEN(nn.Module):\n\n def __init__(self, num_classes):\n super().__init__()\n self.ratioInfl=16\n self.numOfClasses... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.Softmax"
]
] |
Darth-Ozak/pvlib-python | [
"510f08ef8b2d0ee543c197a1433c6294ce410cde"
] | [
"pvlib/temperature.py"
] | [
"\"\"\"\nThe ``temperature`` module contains functions for modeling temperature of\nPV modules and cells.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom pvlib.tools import sind\n\nTEMPERATURE_MODEL_PARAMETERS = {\n 'sapm': {\n 'open_rack_glass_glass': {'a': -3.47, 'b': -.0594, 'deltaT': 3},\n ... | [
[
"numpy.zeros_like",
"numpy.clip",
"numpy.exp",
"pandas.Series",
"numpy.asanyarray"
]
] |
vadam5/NeMo | [
"3c5db09539293c3c19a6bb7437011f91261119af"
] | [
"nemo/collections/asr/parts/numba/rnnt_loss/rnnt.py"
] | [
"# Copyright (c) 2021, 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 re... | [
[
"torch.zeros",
"torch.cuda.current_stream"
]
] |
gecko17/project-sailor | [
"7a35eeec2a6a8ec9bc998e39e8ffad4703cec5d7"
] | [
"sailor/sap_iot/fetch.py"
] | [
"\"\"\"\nTimeseries module can be used to retrieve timeseries data from the SAP iot abstract timeseries api.\n\nInterfaces for retrieval are aligned with AssetCentral objects such as equipment_set and indicator_set.\nTimeseries data is generally stored in a pandas dataframe, wrapped in a convenience class to make i... | [
[
"pandas.DatetimeTZDtype",
"pandas.merge",
"pandas.concat"
]
] |
m-mostafavi/Arshad | [
"ca9bff4f66562be8cd50b3703f51061f48ee1612"
] | [
"Practice2/LogesticRegression.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom matplotlib import gridspec\nfrom sklearn.model_selection import cross_val_predict\nfrom sklearn import linear_model\nimport sklearn.metrics as met\nimport matplotlib.pyplot as plt\n\n\n#Insert data set\ndata=pd.read_csv('tae.csv',sep=',',header=None)\ntrain=data.ix[:,... | [
[
"numpy.array",
"sklearn.metrics.precision_score",
"matplotlib.pyplot.figure",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"numpy.arange",
"sklearn.metrics.recall_score",
"matplotlib.pyplot.show",
"pandas.read_csv",
"sklearn.metrics.f1_score"... |
DarthThomas/PyRep | [
"5430f57e57af036e02753a7db8f816a0409571ff"
] | [
"pyrep/robots/configuration_paths/arm_configuration_path.py"
] | [
"from pyrep.backend import sim\nfrom pyrep.robots.configuration_paths.configuration_path import (\n ConfigurationPath)\nimport numpy as np\nfrom typing import List\n\n\nclass ArmConfigurationPath(ConfigurationPath):\n \"\"\"A path expressed in joint configuration space.\n\n Paths are retrieved from an :py:... | [
[
"numpy.square",
"numpy.array",
"numpy.max",
"numpy.abs"
]
] |
caglar/GroundHogP | [
"03182d3041eee0d18ee50845efc842f60e346d48"
] | [
"groundhog/layers/rec_layers.py"
] | [
"\"\"\"\nRecurrent layers.\n\n\nTODO: write more documentation\n\"\"\"\n__docformat__ = 'restructedtext en'\n__authors__ = (\"Razvan Pascanu \"\n \"KyungHyun Cho \"\n \"Caglar Gulcehre \")\n__contact__ = \"Razvan Pascanu <r.pascanu@gmail>\"\n\nimport numpy\nimport copy\nimport theano\nim... | [
[
"numpy.sum",
"numpy.zeros"
]
] |
ThorstenGroh/Qcodes_contrib_drivers | [
"97e05f8f5d8762953ee9db9bc461d0814eef657d"
] | [
"qcodes_contrib_drivers/drivers/Spectrum/M4i.py"
] | [
"# **************************************************************************\n#\n# Driver file for M4i.44x-x8\n#\n# **************************************************************************\n#\n# QuTech\n#\n# Written by: Luka Bavdaz, Marco Tagliaferri, Pieter Eendebak\n# Also see: http://spectrum-instrumentation.... | [
[
"numpy.round",
"numpy.mean",
"numpy.frombuffer"
]
] |
wimpykid26/Evolutionary-Classification | [
"0a78cbebc252c0a13703aee20dac9fa234f07b08"
] | [
"PCA/dermatology-pca.py"
] | [
"import pandas as pd\nimport plotly.plotly as py\nfrom plotly.graph_objs import *\nimport plotly\nimport numpy as np\nplotly.tools.set_credentials_file(username='iwayankit', api_key='9syhwIKBYVUPY7uX20I9')\nimport plotly.tools as tls\n\ndf = pd.read_csv(\n filepath_or_buffer='https://archive.ics.uci.edu/ml/machi... | [
[
"numpy.linalg.norm",
"numpy.cov",
"sklearn.preprocessing.StandardScaler",
"numpy.mean",
"numpy.linalg.eig",
"numpy.linalg.svd",
"numpy.cumsum",
"numpy.abs",
"numpy.corrcoef",
"pandas.read_csv"
]
] |
harupy/nyaggle | [
"132a93079e364d60b5598de77ab636a603ec06a4"
] | [
"nyaggle/feature/nlp/bert.py"
] | [
"from typing import Any, Callable, List, Optional, Union\nimport transformers\n\nimport numpy as np\nimport pandas as pd\nfrom category_encoders.utils import convert_input\nfrom sklearn.decomposition import TruncatedSVD\nfrom tqdm import tqdm\n\nfrom nyaggle.environment import requires_torch\nfrom nyaggle.feature.b... | [
[
"numpy.max",
"torch.no_grad",
"numpy.hstack",
"numpy.mean",
"pandas.concat",
"sklearn.decomposition.TruncatedSVD"
]
] |
ktlichkid/diy-gym | [
"8783f15e2cb203829f0f1e1eac06c3310065e7f9",
"8783f15e2cb203829f0f1e1eac06c3310065e7f9"
] | [
"diy_gym/tests/test_environment.py",
"examples/r2d2_maze/generate_maze.py"
] | [
"import unittest\nimport os\nimport numpy as np\nfrom diy_gym import DIYGym\n\n\nclass TestEnvironment(unittest.TestCase):\n def setUp(self):\n config_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'basic_env.yaml')\n self.env = DIYGym(config_file)\n\n def test_load_environment(... | [
[
"numpy.linalg.norm"
],
[
"numpy.array",
"numpy.add",
"numpy.zeros"
]
] |
philipperemy/tensorflow-grid-lstm | [
"9983c474ae696e3f4808c0927e3b6c7d17882e42"
] | [
"utils.py"
] | [
"import codecs\nimport collections\nimport os\nimport pickle\n\nimport numpy as np\n\n\nclass TextLoader(object):\n def __init__(self, data_dir, batch_size, seq_length):\n self.data_dir = data_dir\n self.batch_size = batch_size\n self.seq_length = seq_length\n\n input_file = os.path.j... | [
[
"matplotlib.pyplot.xlabel",
"numpy.copy",
"matplotlib.pyplot.legend",
"numpy.load",
"numpy.save",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
HubertBalcerzak/Kratos | [
"0bac5e132d02061680fc90f1e52d4930b5ed7fa3"
] | [
"applications/CoSimulationApplication/tests/test_convergence_accelerators.py"
] | [
"from __future__ import print_function, absolute_import, division # makes these scripts backward compatible with python 2.6 and 2.7\n\nimport KratosMultiphysics as KM\nimport KratosMultiphysics.KratosUnittest as KratosUnittest\n\nfrom KratosMultiphysics.CoSimulationApplication.coupling_interface_data import Coupli... | [
[
"numpy.testing.assert_array_equal"
]
] |
radhe2205/summar | [
"2e2e63efd06c14acf275faf49a1eb69648a761e4"
] | [
"src/preprocess.py"
] | [
"import re\n\nimport numpy as np\nimport pandas as pd\nfrom nltk import WordNetLemmatizer\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\n\nfrom src.embeddings import load_vocab, load_embeddings\n\ndef find_all_num(data):\n all_ch_c = len(data)\n i = 0\n all_nums = s... | [
[
"pandas.isnull",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.scatter",
"pandas.read_csv"
]
] |
xinjie0831/OpenRAM | [
"76e2ab88fe4097ffa51e0387ba72165bcda49e68"
] | [
"compiler/gdsMill/gdsMill/vlsiLayout.py"
] | [
"from .gdsPrimitives import *\nfrom datetime import *\n#from mpmath import matrix\n#from numpy import matrix\nimport numpy as np\n#import gdsPrimitives\nimport debug\n\nclass VlsiLayout:\n \"\"\"Class represent a hierarchical layout\"\"\"\n\n def __init__(self, name=None, units=(0.001,1e-9), libraryName = \"D... | [
[
"numpy.array",
"numpy.dot"
]
] |
shinsteve/udacity-carnd-vehicledetection-p5 | [
"fa76f7302dfc5a79082c3312eb228ea91762ce5e"
] | [
"find_cars.py"
] | [
"import sys\nimport glob\nimport os\nimport pprint\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pickle\nimport cv2\n\nfrom feature_tools import *\nimport bbox_filter\n\n\"\"\"\nUsage: python find_cars.py project_video.mp4\n\"\"\"\n\n\ndef main(video_clip_path):\n # load a pe-trained svc model fro... | [
[
"numpy.hstack",
"numpy.int"
]
] |
RafaelAdao/cursomachinelearningalura | [
"b4c4ac3f675adb07df1b16dd9fd515001a16727a"
] | [
"classifica_acesso.py"
] | [
"from dados import carregar_acessos\r\n\r\nX, Y = carregar_acessos()\r\n\r\ntreino_dados = X[:90]\r\ntreino_marcacoes = Y[:90]\r\n\r\nteste_dados = X[-9:]\r\nteste_marcacoes = Y[-9:]\r\n\r\nfrom sklearn.naive_bayes import MultinomialNB\r\nmodelo = MultinomialNB()\r\nmodelo.fit(treino_dados, treino_marcacoes)\r\nres... | [
[
"sklearn.naive_bayes.MultinomialNB"
]
] |
dustymugs/PerceptualSimilarity | [
"f83089bd744ec132860b00d6163e36ab71da47f8"
] | [
"PerceptualSimilarity/data/dataset/twoafc_dataset.py"
] | [
"from __future__ import absolute_import\n\nimport os.path\nimport torchvision.transforms as transforms\nfrom data.dataset.base_dataset import BaseDataset\nfrom data.image_folder import make_dataset\nfrom PIL import Image\nimport numpy as np\nimport torch\n\nclass TwoAFCDataset(BaseDataset):\n def initialize(self... | [
[
"torch.FloatTensor",
"numpy.load"
]
] |
ZNLP/ATSum | [
"02e92489ebfa4652a4f3354c578f3a64c34ff64b"
] | [
"ATS-A/beaver/model/transformer.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport math\r\n\r\nimport torch\r\nimport torch.nn as nn\r\n\r\n\r\nclass FeedForward(nn.Module):\r\n def __init__(self, hidden_size, inner_size, dropout):\r\n super(FeedForward, self).__init__()\r\n self.linear_in = nn.Linear(hidden_size, inner_size, bias=False)\r\n ... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.stack",
"torch.gt",
"torch.nn.Softmax",
"torch.nn.Sigmoid",
"torch.cat",
"torch.nn.init.xavier_uniform_",
"torch.ones",
"torch.nn.ReLU",
"torch.matmul",
"torch.sum"
]
] |
athmargaritis/PyDMD | [
"82a54a3b3619995682e0be518ce4d596412a42b9"
] | [
"pydmd/mrdmd.py"
] | [
"\"\"\"\nDerived module from dmdbase.py for multi-resolution dmd.\n\nReference:\n- Kutz, J. Nathan, Xing Fu, and Steven L. Brunton. Multiresolution Dynamic Mode\nDecomposition. SIAM Journal on Applied Dynamical Systems 15.2 (2016): 713-735.\n\"\"\"\nfrom __future__ import division\nfrom builtins import range\nfrom ... | [
[
"numpy.min",
"numpy.linalg.lstsq",
"numpy.sort",
"matplotlib.pyplot.gcf",
"numpy.concatenate",
"numpy.max",
"numpy.log",
"matplotlib.pyplot.get_cmap",
"numpy.arange",
"matplotlib.pyplot.gca",
"numpy.linalg.multi_dot",
"matplotlib.pyplot.title",
"matplotlib.pyplo... |
clintg6/imageio | [
"ef70fcfbc2ed160881188a029e2ac08174a35611"
] | [
"imageio/plugins/pillow.py"
] | [
"# -*- coding: utf-8 -*-\n# imageio is distributed under the terms of the (new) BSD License.\n\n\"\"\" Plugin that wraps the the Pillow library.\n\"\"\"\n\nfrom __future__ import absolute_import, print_function, division\n\nimport logging\nimport threading\n\nimport numpy as np\n\nfrom .. import formats\nfrom ..cor... | [
[
"numpy.rot90",
"numpy.array",
"numpy.ones",
"numpy.diff",
"numpy.fliplr"
]
] |
Appy1310/image_GAN_painting | [
"cbb7845add4a7501e61f64cab5bb07afe8314de0"
] | [
"models/CycleGAN.py"
] | [
"'''\nClass defining a CycleGAN model for image to image translation\n'''\n\n# import random\n# import os\n# #from os import listdir\n# from random import random\n# import numpy as np\n# from numpy import load, zeros, ones, asarray\n# from numpy.random import randint\nfrom tensorflow import keras\nimport tensorflow... | [
[
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.initializers.RandomNormal",
"tensorflow.keras.Model",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.keras.Input",
"tensorflow.keras.optimizers.Ada... |
jokieleung/Maria | [
"51ac07d1de564c26fbf038b07031a55660bbcb27"
] | [
"retrieval_model/xmatching/metric.py"
] | [
"import torch\n\n\ndef batchwise_accuracy(lang_output, visn_output, lang_mask):\n \"\"\"\n Calculate the accuracy of contextual word retrieval, average by batch.\n :param lang_output: [batch_size, max_len, hid_dim]\n :param visn_output: [batch_size, hid_dim]\n :param lang_mask: Int Tensor [batch_size... | [
[
"torch.kthvalue",
"torch.arange"
]
] |
Open-Source-Spatial-Clean-Cooking-Tool/OnSSTOVE | [
"0d723720a816dd528d24e813d392f1a566b402ed"
] | [
"onsstove/raster.py"
] | [
"import os\nimport glob\nimport numpy as np\nfrom math import sqrt\nfrom heapq import heapify, heappush, heappop\nimport rasterio\nimport rasterio.mask\nfrom rasterio.merge import merge\nfrom rasterio.warp import calculate_default_transform, reproject, Resampling\nfrom rasterio.fill import fillnodata\nfrom rasterio... | [
[
"numpy.full",
"numpy.nanmax",
"numpy.nanmin",
"numpy.isnan"
]
] |
montefiore-ai/alan-boilerplate | [
"abc1215551912a901d0793f9be76eb58d61ec98b"
] | [
"experiments/experiment-example/train.py"
] | [
"import argparse\nimport numpy as np\nimport torch\nimport torch.multiprocessing as mp\nimport time\n\nfrom torch.utils.data import TensorDataset\n\ncriterion = None\ndataset_training = None\ndataset_validation = None\ndevice = None\nmodel = None\nlearning_rate_scheduler = None\noptimizer = None\ntraining_losses = ... | [
[
"torch.nn.Linear",
"torch.zeros",
"numpy.array",
"torch.nn.SELU",
"torch.optim.lr_scheduler.StepLR",
"torch.nn.Sigmoid",
"torch.save",
"torch.FloatTensor",
"torch.cuda.device_count",
"torch.ones",
"torch.multiprocessing.Manager",
"torch.cuda.is_available",
"torc... |
sconlyshootery/DeepV2D | [
"a669dce1eef74648aec71f4282145b7cd0788d82"
] | [
"deepv2d/geometry/projective_ops.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom deepv2d.utils.einsum import einsum\n\n\nMIN_DEPTH = 0.1\n\ndef coords_grid(shape, homogeneous=True):\n \"\"\" grid of pixel coordinates \"\"\"\n xx, yy = tf.meshgrid(tf.range(shape[-1]), tf.range(shape[-2]))\n\n xx = tf.cast(xx, tf.float32)\n yy = tf.ca... | [
[
"tensorflow.shape",
"tensorflow.range",
"tensorflow.concat",
"tensorflow.ones_like",
"tensorflow.reshape",
"tensorflow.zeros_like",
"tensorflow.identity",
"tensorflow.tile",
"tensorflow.stack",
"tensorflow.maximum",
"tensorflow.unstack",
"tensorflow.cast"
]
] |
cnc-ood/cnc_ood | [
"a149fa22ea32e14e977c893f2ce524ad8e770cf4"
] | [
"utils/test_utils.py"
] | [
"import logging\nimport torch\nimport numpy as np\nfrom tqdm import tqdm\n\nimport sklearn.metrics as sk\n\ndata_path_dict = {\n \"imagenet\" : \"/nvme/scratch/ankita/Imagenet/ILSVRC/Data/CLS-LOC/val\",\n \"inaturalist\" : \"/nvme/scratch/jatin/Data/iNaturalist\",\n \"isun\" : \"/nvme/scratch/jatin/Data/SU... | [
[
"numpy.logical_not",
"numpy.array",
"numpy.zeros",
"torch.nn.Softmax",
"numpy.sum",
"torch.no_grad",
"torch.softmax",
"numpy.diff",
"numpy.allclose",
"sklearn.metrics.average_precision_score",
"numpy.argsort",
"numpy.cumsum",
"numpy.abs",
"sklearn.metrics.ro... |
JoonHong-Kim/KoDALLE | [
"0011ac21bfe8aa840828feb2d30e9e8948344c9a"
] | [
"dalle/models.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom einops import repeat\nfrom axial_positional_embedding import AxialPositionalEmbedding\nfrom einops import rearrange\n\nfrom dalle_pytorch import DiscreteVAE\nfrom dalle_pytorch.vae import OpenAIDiscreteVAE, VQGanVAE\n\nfr... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LayerNorm",
"torch.arange",
"torch.finfo",
"torch.no_grad",
"torch.multinomial",
"torch.nn.functional.cross_entropy",
"torch.load",
"torch.nn.functional.softmax",
"torch.nn.functional.pad",
"torch.nn.Embedding"
]
] |
FACEGOOD/Audio2BlendshapeWeights | [
"9ec7df27bdc09f8b84151335af94d3666971ddda"
] | [
"code/train/step1_LPC.py"
] | [
"# Copyright 2021 The FACEGOOD 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 required b... | [
[
"numpy.concatenate",
"numpy.array",
"scipy.io.wavfile.read",
"numpy.zeros",
"numpy.hanning",
"numpy.save",
"numpy.ndarray",
"numpy.hstack",
"numpy.expand_dims"
]
] |
MarShaikh/ivy | [
"e6bf8c1ea2af409fe61d16bc5874b5e21dc5a333",
"e6bf8c1ea2af409fe61d16bc5874b5e21dc5a333"
] | [
"ivy/functional/backends/tensorflow/manipulation.py",
"ivy_tests/test_ivy/test_functional/test_core/test_sorting.py"
] | [
"# global\nimport math\nimport tensorflow as tf\nfrom numbers import Number\nfrom typing import Union, Tuple, Optional, List\nfrom tensorflow.python.types.core import Tensor\n\n# local\nimport ivy\n\n\ndef roll(\n x: Tensor,\n shift: Union[int, Tuple[int, ...]],\n axis: Optional[Union[int, Tuple[int, ...]]... | [
[
"tensorflow.experimental.numpy.promote_types",
"tensorflow.size",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.roll",
"tensorflow.expand_dims",
"tensorflow.transpose",
"tensorflow.reshape",
"tensorflow.repeat",
"tensorflow.reverse",
"tensorflow.squeeze",
"te... |
lectorvin/slam_algorithm | [
"9dd5e97dcdb1903bfe5fde2fe2764f8beb292f4b"
] | [
"smth/cov_matrix.py"
] | [
"import numpy as np\n\n\ndef mean(arr):\n return sum(arr)/(len(arr))\n\n\ndef mul(arr1, arr2):\n a = [arr1[i]*arr2[i] for i in range(len(arr1))]\n return a\n\n\ndef cov(arr1, arr2):\n m = len(mul(arr1, arr2))\n return (sum(mul(arr1, arr2)) - sum(arr1)*sum(arr2)/m)/(m-1)\n\n\ndef covMatrix(x, y):\n ... | [
[
"numpy.matrix",
"numpy.cov"
]
] |
upamanyus/primerunning | [
"dbd0b588e5952b6cd917d41c877bc190183c86d7"
] | [
"src/primegraph.py"
] | [
"#!/bin/env python\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nclass PrimeGraph:\n\n def __init__(self):\n plt.figure()\n\n def loadFromFile(self, infilename):\n data = np.genfromtxt(infilename, delimiter=',', names=True)\n self.xs = data[data.dtype.names[0]]\n self... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.genfromtxt",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
xiaobao520123/EnterpriseNavigator | [
"eb380d3e7ae3074c82a2b4b46eb9ecf834a991d9"
] | [
"srvbase_qcc/east/nms.py"
] | [
"# coding=utf-8\nimport numpy as np\n\nimport cfg\n\ndef should_merge(region, i, j):\n neighbor = {(i, j - 1)}\n return not region.isdisjoint(neighbor)\n\ndef region_neighbor(region_set):\n j_min = 100000000\n j_max = -1\n i_m = 0\n for node in region_set:\n i_m = node[0] + 1\n if node... | [
[
"numpy.around",
"numpy.reshape",
"numpy.zeros"
]
] |
singagan/nn-Meter | [
"38654df84064aaa0f56043a99a7317667aca53ca"
] | [
"nn_meter/builder/backend_meta/fusion_rule_tester/generate_testcase.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\nimport os\nimport sys\nimport yaml\nimport importlib\nfrom tensorflow import keras\nfrom .utils import get_operator_by_name, generate_model_for_testcase\nfrom .build_models import SingleOpModel\nfrom nn_meter.builder.backend_meta.utils impo... | [
[
"tensorflow.keras.layers.DepthwiseConv2D",
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.models.Model",
"tensorflow.keras.Input",
"tensorflow.keras.models.save_model"
]
] |
solmn/parallel_wavenet | [
"45e9eceb7a2d1982b3d45823332575eb26f333c0"
] | [
"wavenet/ops.py"
] | [
"from __future__ import division\n\nimport tensorflow as tf\n\n\ndef create_adam_optimizer(learning_rate, momentum):\n return tf.train.AdamOptimizer(learning_rate=learning_rate,\n epsilon=1e-8)\n\n\ndef create_sgd_optimizer(learning_rate, momentum):\n return tf.train.MomentumO... | [
[
"tensorflow.abs",
"tensorflow.log1p",
"tensorflow.shape",
"tensorflow.train.AdamOptimizer",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.train.MomentumOptimizer",
"tensorflow.reshape",
"tensorflow.transpose",
"tensorflow.nn.conv1d",
"tensorflow.sign",
"tensorflow.na... |
RaimisJ/dc-app-performance-toolkit | [
"492a4dd163fddecf1a277ce3f6460060018eedc8"
] | [
"app/util/jtl_convertor/jtls-to-csv.py"
] | [
"import os\nimport sys\nimport tempfile\nimport time\nfrom pathlib import Path\nfrom typing import IO, List, Set\nimport csv\nimport pandas\nimport json\n\nfrom util.jtl_convertor import jtl_validator\nfrom util.project_paths import ENV_TAURUS_ARTIFACT_DIR, DEFAULT_TEST_ACTIONS\n\nLABEL = 'Label'\nSAMPLES = '# Samp... | [
[
"pandas.Series"
]
] |
NCAR/lrose-projects-front | [
"333a1607550fe94ea9cf5689160187baa82fc6cf"
] | [
"projDir/qc/scripts/PlotFieldDiffs.spol.qc.pecan.py"
] | [
"#!/usr/bin/env python\n\n#===========================================================================\n#\n# Produce plots for field diffs from original to QC\n#\n#===========================================================================\n\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport su... | [
[
"numpy.array",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.figure",
"numpy.isfinite",
"numpy.repeat",
"matplotlib.pyplot.show",
"matplotlib.dates.DayLocator",
"numpy.convolve"
]
] |
DeFacto/WebCredibility | [
"dfbb990966fc6b33f60378acffa0f12e25183431"
] | [
"trustworthiness/util.py"
] | [
"import collections\nimport datetime\nimport logging\nimport os\nimport sys\nfrom pathlib import Path\n\nimport numpy as np\nimport pdfkit as pdfkit\nfrom bs4 import BeautifulSoup\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error, confusion_matrix, classification_report, \\\n accuracy_score\nf... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.mean_squared_error",
"sklearn.externals.joblib.dump",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.classification_report",
"sklearn.metrics.mean_absolute_error",
"pandas.read_csv"
]
] |
crpurcell/MQ_DPI_Release | [
"97444513e8b8d48ec91ff8a43b9dfaed0da029f9"
] | [
"Shark_Tagging/Imports/boxtracker.py"
] | [
"#!/usr/bin/env python\nfrom scipy.spatial import distance as dist\nfrom collections import OrderedDict\nimport numpy as np\nimport os\nimport json\nimport itertools\nimport operator\nclass BoxTracker():\n def __init__(self, maxGone=20, iouThreshSelf=0.3):\n self.nextObjectID = 0 \n se... | [
[
"numpy.delete",
"numpy.array",
"numpy.ones_like",
"numpy.median",
"numpy.nonzero",
"numpy.split",
"numpy.transpose",
"numpy.maximum"
]
] |
vaibhav-s/self-driving-car | [
"eb5865d50499f90b3eeace869c1f8a65cf9e2c46"
] | [
"steering-models/community-models/cg23/data_explore.py"
] | [
"# -------------------------------------------------------------------\r\n# Challenge #2 - Data Exploration\r\n# -------------------------------------------------------------------\r\n\r\n# Creates plots of steering angles by consecutive timestamps\r\n# By: cgundling \r\n# Rev Date: 11/19/16\r\n\r\nfrom __future__ ... | [
[
"numpy.zeros",
"numpy.set_printoptions",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.ylabel",
"numpy.append",
"pandas.read_csv",
"matplotlib.pyplot.subplots_adj... |
celinede/nilearn | [
"901a627c4c5ae491fef19d58307805b3657b3b7e"
] | [
"nilearn/image/image.py"
] | [
"\"\"\"\nPreprocessing functions for images.\n\nSee also nilearn.signal.\n\"\"\"\n# Authors: Philippe Gervais, Alexandre Abraham\n# License: simplified BSD\n\nimport collections\nimport warnings\n\nimport numpy as np\nfrom scipy import ndimage\nfrom scipy.stats import scoreatpercentile\nimport copy\nimport nibabel\... | [
[
"numpy.minimum",
"numpy.min",
"numpy.where",
"sklearn.externals.joblib.Parallel",
"numpy.max",
"numpy.log",
"numpy.eye",
"numpy.isfinite",
"numpy.logical_or",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.isnan",
"numpy.sum",
"numpy.any",
"sc... |
Cgadal/PyDune | [
"9f4ca2b154734d88d4eaeb2b41d86dd37b43cabf"
] | [
"PyDune/data_processing/meteorological/downloadCDS.py"
] | [
"\"\"\"\nThis module allows to dowload data from the ERA5 and ERA5Land datasets hosted at\nthe `Climate Data Store <https://cds.climate.copernicus.eu/#!/home>`_ . Before\nusing this module, please read the corresponding documentation\n`here <https://confluence.ecmwf.int/display/CKB/How+to+download+ERA5`_,\nand espe... | [
[
"numpy.concatenate",
"scipy.io.netcdf.NetCDFFile",
"numpy.array_split"
]
] |
stalei/TagMix | [
"36b7b6619c835b981c6f769cffbc34677d561346"
] | [
"TagMix.py"
] | [
"# © Shahram Talei @ 2021 The University of Alabama - All rights reserved.\n#you can redistribute it and/or modify\n#it under the terms of the GNU General Public License as published by\n#the Free Software Foundation; either version 3 of the License, or\n#(at your option) any later version.\n#You should have recei... | [
[
"numpy.array",
"numpy.sum",
"numpy.genfromtxt",
"numpy.sqrt",
"numpy.get_include"
]
] |
bridget-haus/Energy_Disaggregation | [
"5cf5a9277bda471c3c4e3b897a7d2fc32a782da3"
] | [
"Dashboard/data-manipulation/clean-save-result.py"
] | [
"import os\nimport json\nimport pandas as pd\nimport pickle5 as pkl\nfrom pathlib import Path\nfrom collections import defaultdict\n\ncurr_dir = Path(os.getcwd())\nparent_dir = curr_dir.parent\nsource_dir = parent_dir.parent\nresult_dir = os.path.join(source_dir, 'pkl_results')\noutput_dir = os.path.join(parent_dir... | [
[
"pandas.Grouper"
]
] |
yang182/MolGAN | [
"31a4aeceed1fd413877dd446a7daddae58f44e48"
] | [
"utils/sparse_molecular_dataset.py"
] | [
"import pickle\nimport numpy as np\n\nfrom rdkit import Chem\n\nif __name__ == '__main__':\n from progress_bar import ProgressBar\nelse:\n from utils.progress_bar import ProgressBar\n\nfrom datetime import datetime\n\n\nclass SparseMolecularDataset():\n\n def load(self, filename, subset=1):\n\n with... | [
[
"numpy.array",
"numpy.count_nonzero",
"numpy.zeros",
"numpy.linalg.eigh",
"numpy.nonzero",
"numpy.random.shuffle",
"numpy.stack",
"numpy.diag"
]
] |
WittmannF/fastai_docs | [
"03ecae01557a5e4a196dd858b10a57b224df52cd"
] | [
"dev_course/dl2/exp/nb_03.py"
] | [
"\n#################################################\n### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###\n#################################################\n# file to edit: dev_nb/03_minibatch_training.ipynb\n\nfrom exp.nb_02 import *\nimport torch.nn.functional as F\n\ndef accuracy(out, yb):\n preds = torch.argm... | [
[
"torch.utils.data.DataLoader"
]
] |
Zephyr-29/RecBole | [
"e8300611765c947ce904f29c610b188033ec8da8"
] | [
"tests/metrics/test_topk_metrics.py"
] | [
"# -*- encoding: utf-8 -*-\n# @Time : 2020/11/1\n# @Author : Kaiyuan Li\n# @email : tsotfsk@outlook.com\n\n\nimport os\nimport sys\nimport unittest\n\nsys.path.append(os.getcwd())\nimport numpy as np\nfrom recbole.evaluator.metrics import metrics_dict\n\npos_idx = np.array([\n [0, 0, 0],\n [1, 1, ... | [
[
"numpy.array",
"numpy.log2"
]
] |
xsthunder/TUH_EEG_Seizure_Detection | [
"e19b9b788eda26db83269e5a076afa115b2d1db4"
] | [
"src/tools/tuh_sz_extract_metadata.py"
] | [
"\"\"\"Extract the metadata of the dataset.\n\nAuthors: Vincent Stragier\n\nDescription:\n - List all the files of the dataset to find the EEG recording.\n - Extract all the metadata of the dataset and store them\n in a pickle and a JSON file.\n - Provides functions to load the extracted metadata\n i... | [
[
"numpy.argmax"
]
] |
404akhan/pytorch-a3c | [
"a223b1b4bb9589a35cf14aa9aff94525eec873d4"
] | [
"test.py"
] | [
"import math\nimport os\nimport sys\nimport itertools\n\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom envs import create_atari_env\nfrom model import ActorCritic\nfrom torch.autograd import Variable\nfrom torchvision import datasets, transforms\nimport time\nfrom collections impo... | [
[
"numpy.concatenate",
"torch.nn.functional.softmax",
"torch.from_numpy",
"torch.manual_seed",
"numpy.append"
]
] |
chemmatcars/XModFit | [
"7d1298448d1908d78797fd67ce0a00ecfaf17629"
] | [
"Functions/ASAXS/Biphasic_Sphere_Uniform.py"
] | [
"####Please do not remove lines below####\nfrom lmfit import Parameters\nimport numpy as np\nimport sys\nimport os\nsys.path.append(os.path.abspath('.'))\nsys.path.append(os.path.abspath('./Functions'))\nsys.path.append(os.path.abspath('./Fortran_routines'))\n####Please do not remove lines above####\n\n####Import y... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.zeros_like",
"numpy.ones_like",
"numpy.sin",
"numpy.log",
"numpy.sum",
"numpy.min",
"numpy.exp",
"numpy.abs",
"numpy.cos",
"numpy.sqrt",
"numpy.linspace",
"numpy.logspace"
]
] |
yih301/pdenv | [
"ee51a3e39e7e353b30bc3d10e37d72877cfe5921"
] | [
"train_stable.py"
] | [
"import os\n\nimport gym\nimport gym\nfrom gym import wrappers, logger\nimport gym_panda\nfrom gym_panda.wrapper_env.wrapper import *\n# import gym_circle_move\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nfrom stable_baselines import DDPG,PPO2,TRPO\nfrom stable_baselines.common.policies import MlpPolic... | [
[
"numpy.mean",
"numpy.zeros",
"numpy.ones"
]
] |
mou3adb/RodiCS | [
"caafe8f6427943cb6d82cf3245a3d774ba7664f1"
] | [
"scripts/axes_world.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as pp\n\nfrom matplotlib import rc\n#==============================================================================\nrc('text', usetex=True)\n\nmarkersize = 8\nfontsize = 12\n\ndef one_by_one(inch_x=3.5, inch_y=3.5):\n fig = pp.figure(figsize=(inch_x,inch_y))\n ... | [
[
"numpy.sqrt",
"numpy.exp",
"matplotlib.pyplot.figure",
"matplotlib.rc"
]
] |
gpengzhi/fairseq | [
"4775610f48b770f271e05245991dc7b44d45667b",
"4775610f48b770f271e05245991dc7b44d45667b"
] | [
"fairseq/options.py",
"fairseq/models/speech_to_text/xm_transformer.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nfrom pathlib import Path\nfrom typing import Callable, List, Optional, Union\n\nimport torch\nfrom fairseq import u... | [
[
"torch.cuda.device_count"
],
[
"torch.nn.Conv1d"
]
] |
JELAshford/OxHack-2020 | [
"ab981c145bad7554b451dac227f40e80c82f2a21"
] | [
"James_IdeaTesting/CollatzVisualiser/collatz_process.py"
] | [
"import numpy as np\nimport time\n\n# Code for the basic finding of collatz paths to 1\nmem = {}\n\ndef collatz(val, max_step=10000):\n \n collatz_list = [val]\n step = 0\n current_val, new_val = val, 0\n\n while current_val > 1 and step < max_step:\n\n # Pull from memory if possible \n ... | [
[
"numpy.random.randint"
]
] |
a3sha2/3DUnetCNN | [
"71c440a98b306355b1c3fddaf8b852cd51b50440"
] | [
"unet3d/model/unet.py"
] | [
"import numpy as np\nfrom tensorflow.keras import backend as K\nfrom keras.engine import Input, Model\nfrom keras.layers import Conv3D, MaxPooling3D, UpSampling3D, Activation, BatchNormalization, PReLU, Deconvolution3D\nfrom keras.optimizers import Adam\nfrom keras_contrib.layers.normalization.instancenormalization... | [
[
"numpy.power",
"tensorflow.keras.backend.set_image_data_format"
]
] |
Quanscendence/braynai | [
"ab828ca95571c6dffef2b2392522e6a4160a2304"
] | [
"dataintegration/views.py"
] | [
"from __future__ import print_function\nfrom django.shortcuts import render,redirect\nfrom django.views.generic import TemplateView,CreateView,View,UpdateView,ListView\nfrom dataintegration.forms import DriveDetailsForm,SheetDetailsForm,DropboxDetailsForm,OneDriveDetailsForm,ApiDataForm,SheetUrlForm\nfrom datainteg... | [
[
"pandas.to_datetime",
"pandas.merge",
"pandas.json_normalize",
"pandas.DataFrame",
"pandas.read_excel",
"numpy.issubdtype",
"pandas.read_csv",
"pandas.to_numeric",
"pandas.read_html"
]
] |
HimariO/VideoSum | [
"3a81276df3b429c24ebf9a1841b5a9168c0c3ccf"
] | [
"tensorflow_toolbox/moreLSTM.py"
] | [
"'''\nsupercell\nhttps://github.com/hardmaru/supercell/\ninspired by http://supercell.jp/\n'''\n\nimport tensorflow as tf\nimport numpy as np\n\n# Orthogonal Initializer from\n# https://github.com/OlavHN/bnlstm\ndef orthogonal(shape):\n flat_shape = (shape[0], np.prod(shape[1:]))\n a = np.random.normal(0.0, 1.0, ... | [
[
"tensorflow.constant_initializer",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.mul",
"tensorflow.tanh",
"tensorflow.random_normal_initializer",
"numpy.random.normal",
"tensorflow.concat",
"tensorflow.sigmoid",
"tensorflow.contrib.rnn.LSTMStateTuple",
"tensorf... |
douch/Paddle | [
"dbd6e2df9d074973b7ee177e2d6b96ed2318008e"
] | [
"python/paddle/fluid/tests/unittests/process_group_gloo.py"
] | [
"# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.random.seed",
"numpy.random.random",
"numpy.array_equal"
]
] |
juan-carlos-calvo/navigate | [
"b804638aa3a51f9c9db2ffea75ad6f0519365105"
] | [
"navigate/dqn_agent.py"
] | [
"import random\nfrom collections import deque, namedtuple\nfrom typing import Any\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom config import settings\nfrom navigate.utils import load_obj\n\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() els... | [
[
"torch.no_grad",
"numpy.mean",
"torch.from_numpy",
"torch.nn.functional.mse_loss",
"torch.cuda.is_available",
"numpy.arange",
"numpy.vstack"
]
] |
cthorey/CraterInspector | [
"f71de6dfddd3d538d76da229b4b9605c40f3fbac"
] | [
"pdsimage/PDS_Extractor.py"
] | [
"# Import library\nfrom __future__ import print_function\nimport numpy as np\nimport pandas as pd\nimport os\nimport sys\nfrom distutils.util import strtobool\n# Library to help read header in binary WAC FILE\nimport pvl\nfrom pvl import load as load_label\n\n# Helper to catch images from URLs\nimport urllib\nimpor... | [
[
"numpy.sin",
"numpy.isnan",
"numpy.arcsin",
"numpy.rint",
"numpy.tan",
"numpy.sqrt",
"numpy.cos",
"numpy.abs",
"numpy.hstack",
"numpy.fromstring",
"numpy.meshgrid",
"numpy.vstack"
]
] |
alm818/epipy | [
"4d861c27f70f9fc62c561c56950017046de7e164"
] | [
"epipy/sparse/csr.py"
] | [
"import numpy as np\nfrom scipy.sparse import csr_matrix\nfrom numba import jit, prange\n\n# Deprecated\n# @jit(nopython=True, parallel=True)\n# def coo_tocsr(M, N, data_, row_ind, col_ind):\n# \"\"\"\n# Numba parallel version of https://github.com/scipy/scipy/blob/3b36a57/scipy/sparse/sparsetools/coo.h#L34... | [
[
"scipy.sparse.csr_matrix",
"numpy.zeros"
]
] |
meganhfowler/optimal-ph | [
"faa9cfcc3b7262cb5757b2f72a17209b3baea577"
] | [
"src/predict.py"
] | [
"#!/usr/bin/env python3\nimport argparse\nimport pandas as pd\nfrom model import NeuralNet, BaselineModel\nimport torch\nimport config\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--input_csv', default='submission/input.csv')\nargs = parser.parse_args()\n\n# Config\noutput_file_path = 'test/predictio... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
binder-oilgains/py-pde | [
"d76977095f1e915c63230e6895391f063d0778d8"
] | [
"pde/grids/boundaries/axis.py"
] | [
"r\"\"\"\n.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>\n\nThis module handles the boundaries of a single axis of a grid. There are\ngenerally only two options, depending on whether the axis of the underlying\ngrid is defined as periodic or not. If it is periodic, the class \n:class:`~pde.grids.boundaries... | [
[
"numpy.all"
]
] |
hieu1999210/image_compression | [
"3faf90d704782e1d6a186b0c8ea7fb1e2ec97a2c"
] | [
"test/test_gdn.py"
] | [
"# Copyright 2020 Hieu Nguyen\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"torch.abs",
"torch.rand",
"torch.sqrt",
"torch.tensor"
]
] |
Omerside/dfcx-scrapi | [
"33845a26ffc59684478869503b290cf26baeb666"
] | [
"src/dfcx_scrapi/tools/dataframe_functions.py"
] | [
"\"\"\"Utility file for dataframe functions in support of Dialogflow CX.\"\"\"\n\n# Copyright 2021 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.a... | [
[
"pandas.DataFrame"
]
] |
Tina-Rezaei/A-learning-model-to-detect-maliciousness-of-portable-executable-using-integrated-feature-set | [
"14e984d78d5ededd8f85d55600f1a90addab8561"
] | [
"main.py"
] | [
"import random\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn import tree\nfrom sklearn import svm\nfrom sklearn.model_selection import cross_validate\nimport numpy as np\nimport time\nimport click\nimport feature_extraction\n\nstart_time = tim... | [
[
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.cross_validate",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.mean",
"sklearn.svm.SVC",
"sklearn.tree.DecisionTreeClassifier"
]
] |
ragibson/ModularityPruning | [
"683e85d8612bb7b6d3aa6aa5c26d161d78e41be9",
"683e85d8612bb7b6d3aa6aa5c26d161d78e41be9"
] | [
"utilities/parameter_estimation_utilities.py",
"experiments/miscellaneous_tests/runtime_comparison_with_louvain.py"
] | [
"from .louvain_utilities import louvain_part_with_membership, sorted_tuple, check_multilayer_louvain_capabilities\nfrom .champ_utilities import CHAMP_2D, CHAMP_3D\nfrom .partition_utilities import num_communities\nimport igraph as ig\nimport louvain\nfrom math import log\nimport numpy as np\nfrom scipy.optimize imp... | [
[
"numpy.log",
"numpy.array",
"numpy.mean"
],
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.y... |
NaiboWang/Federated-Learning-PyTorch | [
"6f811ebbb783b9d279e5462789ff242968e17bc0"
] | [
"src/Federated_distributed_order.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Python version: 3.6\n\n\"\"\"\n有序的从1到num_users训练model,第i个model初始化为第i-1个model训练后的模型\n\n与所有用户把数据交给center分批训练的唯一区别就在于互相看不到对方的数据\n\n\"\"\"\n\nimport os\nimport copy\nimport time\nimport pickle\nimport numpy as np\nimport torch.nn as nn\nfrom tqdm import tqdm\n\nimport ... | [
[
"torch.nn.DataParallel"
]
] |
asprasan/unified_framework | [
"45f9c20e4c66b0f0b9199c4a0bdaf8ecd1e82ad8"
] | [
"train_unet.py"
] | [
"'''\r\n-----------------------------------\r\nTRAINING CODE - SHIFTVARCONV + UNET\r\n-----------------------------------\r\n'''\r\nimport os \r\nimport numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nimport logging\r\nimport glob\r\nimport argparse\r\nimport time\r\nfrom torch.utils import data\r\n\r\n\r\n... | [
[
"torch.cat",
"numpy.random.seed",
"torch.no_grad",
"torch.manual_seed",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.utils.data.DataLoader",
"torch.mean"
]
] |
binary-signal/some-what-homomorphic-encryption | [
"861c752416e2669a4b9e1824f93b5593a8b4abd6"
] | [
"demos/public_key_demo.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom keys.public_key import PublicKey\nimport matplotlib.pyplot as plt\nfrom timeit import default_timer as timer\n\n\ndef test_key_size(L_low, L_max=20, units='mb', showFigure=False, file='sec_pam_vs_key_size.png'):\n \"\"\"\n test function for key size\n \"\"\"\n print(\"\\... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
AmorosTech/RP-R-CNN | [
"45557a69ae9789e2662e3b937feb7624319a3e73"
] | [
"rcnn/modeling/mask_rcnn/maskiou/loss.py"
] | [
"import torch\n\nfrom models.ops import l2_loss\nfrom rcnn.core.config import cfg\n\n\nclass MaskIoULossComputation(object):\n def __init__(self, loss_weight):\n self.loss_weight = loss_weight\n\n def __call__(self, labels, pred_maskiou, gt_maskiou):\n positive_inds = torch.nonzero(labels > 0).s... | [
[
"torch.nonzero"
]
] |
Joukahainen/finmarketpy | [
"59e340e1411edceba121a0943fb500d8bda2c6f2"
] | [
"finmarketpy/economics/marketliquidity.py"
] | [
"__author__ = 'saeedamen' # Saeed Amen\n\n#\n# Copyright 2016-2020 Cuemacro - https://www.cuemacro.com / @cuemacro\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the\n# License. You may obtain a copy of the License at http://www.apache.or... | [
[
"pandas.DataFrame"
]
] |
ojschumann/pyeospac | [
"db94a31866abd4bf311d82d4fea318ed5b9ee357"
] | [
"setup_eospac.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import Extension\nimport os.path\nimport re\nfrom datetime import datetime\nimport numpy\n\ndef setup_eospac(cfg):\n\n EOSPAC_INCLUDE = os.path.join(cfg['path'], \"include\", cfg['arch'], cfg['compiler'])\n EOSPAC_INCLUDE2 = os.path.join(cfg['path... | [
[
"numpy.get_include"
]
] |
cherise215/Cooperative_Training_and_Latent_Space_Data_Augmentation | [
"f5a987fb4babb891a41116e934a9ce6432e0d803"
] | [
"medseg/dataset_loader/acdc_preprocess.py"
] | [
"import os\n\nimport numpy as np\nimport glob\nimport SimpleITK as sitk\nfrom os.path import join\nimport matplotlib.pyplot as plt\nimport SimpleITK as sitk\n\nimport time\n\n\nfrom medseg.dataset_loader.dataset_utils import resample_by_spacing\n\n\ndef normalize_minmax_data(image_data):\n \"\"\"\n # 3D MRI s... | [
[
"numpy.round",
"numpy.percentile",
"numpy.uint8",
"numpy.zeros"
]
] |
f1recracker/tensorflow-datasets | [
"d4e0e83a2c7b5ee8b807d036493ef0329e8f446e"
] | [
"tensorflow_datasets/image/imagenet.py"
] | [
"# coding=utf-8\n# Copyright 2019 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"tensorflow.io.gfile.exists",
"tensorflow.io.gfile.GFile"
]
] |
cpmpercussion/imps | [
"5707ca01d4004d11603a9969276591c8ab5c28a4"
] | [
"utils/test_prediction_speed.py"
] | [
"import logging\nimport time\nimport datetime\nimport numpy as np\nimport pandas as pd\n\n# Hack to get openMP working annoyingly.\nimport os\nos.environ['KMP_DUPLICATE_LIB_OK']='True'\n\nprint(\"Importing Keras and MDRNN.\")\nstart_import = time.time()\nimport empi_mdrnn\nimport tensorflow as tf\nfrom keras import... | [
[
"pandas.DataFrame",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.contrib.training.python.training.hparam.HParams",
"pandas.concat"
]
] |
dpcomp-org/ektelo | [
"7629fbf106f9b9568c66a0b97f6005280022c3d8"
] | [
"test/unit/test_transformation.py"
] | [
"from collections import OrderedDict\nfrom ektelo.data import Relation\nfrom ektelo.data import RelationHelper\nimport numpy as np\nimport os\nfrom ektelo.client.mapper import Grid\nfrom ektelo.private.transformation import Group\nfrom ektelo.private.transformation import Null\nfrom ektelo.private.transformation im... | [
[
"numpy.testing.assert_array_equal",
"numpy.prod",
"numpy.random.rand",
"numpy.ones"
]
] |
K-A-R-T/DCL-Release | [
"44c6e1234af63daa1ae32302eef5981651a5a0aa"
] | [
"scripts/trainval_tube_v2.py"
] | [
"#! /usr/bin/env python3\n## -*- coding: utf-8 -*-\n\n\"\"\"\nTraining and evaulating the Neuro-Symbolic Concept Learner.\n\"\"\"\nimport torch\ntorch.manual_seed(0)\ntorch.backends.cudnn.deterministic = True\ntorch.backends.cudnn.benchmark = False\nimport numpy as np\nnp.random.seed(0)\n\nimport pdb\n\nimport time... | [
[
"torch.isnan",
"numpy.random.seed",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.load"
]
] |
c0redumb/bert | [
"8ccd1863cc9bc73f149224ad149673b9c9bb5196"
] | [
"run_squad.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.io.gfile.GFile",
"tensorflow.compat.v1.logging.info",
"tensorflow.data.TFRecordDataset",
"tensorflow.train.Features",
"tensorflow.compat.v1.estimator.tpu.TPUEstimator",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.compat.v1.trainable_variables",
"tensorflo... |
rnwatanabe/silx | [
"b0395f4a06c048b7778dc04ada828edd195ef02d"
] | [
"src/silx/gui/plot3d/items/core.py"
] | [
"# coding: utf-8\n# /*##########################################################################\n#\n# Copyright (c) 2017-2021 European Synchrotron Radiation Facility\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Soft... | [
[
"numpy.identity",
"numpy.equal",
"numpy.array"
]
] |
jRicciL/ml_and_ensemble_docking | [
"d2bf7010d6df34710e860b0c01f2746b4dc8e09a"
] | [
"fxa/5_Machine_Learning/nested_cv_results/lr_nested_cv_lr.py"
] | [
"# Nested vs non-nested cross-validation\n# Based on: https://scikit-learn.org/stable/auto_examples/model_selection/plot_nested_cross_validation_iris.html\n\n# Filename with the results\nfile_name = '../4_Ensemble_docking_results/df_DkSc_results_COCRYS_DEKOIS_DUD.pkl'\n\nimport pickle\nimport numpy as np\nimport pa... | [
[
"pandas.read_pickle",
"sklearn.model_selection.StratifiedKFold",
"numpy.zeros",
"pandas.DataFrame",
"numpy.geomspace",
"numpy.repeat",
"sklearn.model_selection.cross_val_score"
]
] |
SilvinWillemsen/lorenz | [
"d76d3a7a8560622545644c6ed241781600d611f2"
] | [
"lorenz/plotting.py"
] | [
"\"\"\"\n\nThe main function plotLorenz plots the output of the result provided by \nsolver.solve. The output includes 3 2D plots and 1 3D plot. An internal \nfunction _plot2D handles the 2D plots.\n\n\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport time\n\n\ndef _plot2D (vecs, vel_vecs, num_hor,... | [
[
"matplotlib.pyplot.colorbar",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.sqrt",
"matplotlib.pyplot.scatter",
"matplotlib.pypl... |
neutrinoceros/astropy | [
"40ba5e4c609d2760152898b8d92a146e3e38c744"
] | [
"astropy/io/ascii/tests/test_ecsv.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\"\"\"\nThis module tests some of the methods related to the ``ECSV``\nreader/writer.\n\"\"\"\nfrom astropy.table.column import MaskedColumn\nimport os\nimport copy\nimport sys\nfrom io import StringIO\nfrom contextlib import nullcontext\n\nimport ... | [
[
"numpy.array",
"numpy.empty",
"numpy.allclose",
"numpy.ma.array",
"numpy.arange",
"numpy.all",
"numpy.dtype"
]
] |
dan-armstrong/amrrt | [
"84d063a45adafc317c141bbad7306aa1dbca9b69"
] | [
"amrrt/planners.py"
] | [
"#Copyright (c) 2020 Ocado. All Rights Reserved.\n\nimport time, math, random\nimport numpy as np\n\nfrom amrrt.tree import Tree\nfrom amrrt.metrics import EuclideanMetric\nfrom amrrt.cost import Cost\n\n\nclass RTSamplingPlanner:\n \"\"\"\n Real time sampling planner, parent class for RTRRT and AMRRT\n \"... | [
[
"numpy.sin",
"numpy.random.rand",
"numpy.arctan2",
"numpy.cos"
]
] |
NileGraddis/pynwb | [
"85ef17dc5d820deeaf1c40e5ed22e22336b691ec"
] | [
"docs/gallery/general/iterative_write.py"
] | [
"\"\"\"\nIterative Data Write\n====================\n\nThis example demonstrate how to iteratively write data arrays with applications to\nwriting large arrays without loading all data into memory and streaming data write.\n\n\"\"\"\n\n####################\n# Introduction\n# ----------------------------------------... | [
[
"numpy.memmap",
"numpy.prod",
"numpy.arange",
"numpy.all",
"numpy.dtype"
]
] |
Northengard/graphx-conv | [
"051c1bb3e9d0f7086acf54234c8169da1da49530"
] | [
"src/train.py"
] | [
"import argparse\n\nparser = argparse.ArgumentParser('GraphX-convolution')\nparser.add_argument('config_file', type=str, help='config file to dictate training/testing')\nparser.add_argument('-g', '--gpu', type=int, default=0, help='gpu number')\nargs = parser.parse_args()\n\nimport os\nos.environ['CUDA_VISIBLE_DEVI... | [
[
"torch.utils.data.DataLoader"
]
] |
stencila/libdh | [
"41b0dc826e6a6af3390877736185ed90b52459a2"
] | [
"funcs/word_cloud_plot.py"
] | [
"import matplotlib.pyplot as plt\r\nimport random\r\n\r\nfrom word_cloud import word_cloud\r\n\r\ndef word_cloud_plot(values):\r\n \"\"\"\r\n Plot a word cloud\r\n\r\n :param values: Is either a string or an array containing strings\r\n :return A matplotlib of the actual n gram\r\n\r\n e.g.\r\n\r\n ... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
]
] |
exoristos21/exostriker | [
"85cee34744bcd6e960dcdffc9140bb1d9107982e"
] | [
"exostriker/lib/detrend_window.py"
] | [
"# -*- coding: utf-8 -*-\nimport pyqtgraph as pg\nfrom PyQt5 import QtCore, QtGui, QtWidgets, uic\n\nimport numpy as np\nimport os, sys\nfrom print_info_window import print_info\nfrom worker import Worker\nfrom multiprocessing import cpu_count\nimport gls as gls\nimport dill\nimport RV_mod as rv\nimport pg_hack\n\n... | [
[
"numpy.max",
"numpy.square",
"numpy.array",
"numpy.median",
"numpy.min",
"numpy.mean"
]
] |
Aoxig/CenterNet-Fixed-For-Colab | [
"5edf76c2b569b499d21a5bb7f2608bb9ee0e260a"
] | [
"src/lib/models/networks/resnet_spp_short_cbam.py"
] | [
"# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\n# Modified by Dequan Wang and Xingyi Zhou\n# ------------------------------------------------------------------------------... | [
[
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.normal_"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.