repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
huangwenwenlili/vedadet
[ "1d66e07538792799c2f12c6b1d381e2c1374d623" ]
[ "vedadet/datasets/pipelines/transforms.py" ]
[ "# adapted from https://github.com/open-mmlab/mmcv or\n# https://github.com/open-mmlab/mmdetection\nimport inspect\nimport numpy as np\nfrom numpy import random\n\nimport vedacore.image as image\nfrom vedacore.misc import is_list_of, is_str, registry\nfrom vedadet.misc.bbox import bbox_overlaps\n\ntry:\n from im...
[ [ "numpy.concatenate", "numpy.array", "numpy.ceil", "numpy.random.choice", "numpy.random.rand", "numpy.zeros", "numpy.random.permutation", "numpy.tile", "numpy.random.random_sample", "numpy.random.uniform", "numpy.random.randint", "numpy.clip" ] ]
yyyjoe/deep-person-reid
[ "82380612ca87928c772ea8059da5cb8c6bb06e0c" ]
[ "torchreid/datasets/mars.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport glob\nimport re\nimport sys\nimport urllib\nimport tarfile\nimport zipfile\nimport os.path as osp\nfrom scipy.io import loadmat\nimport numpy as np\nimport h5py\nfrom scipy.misc impor...
[ [ "scipy.io.loadmat" ] ]
LukichevaPolina/dpnp
[ "5f5a679905d237ac7be1cc9ad1075877a9f77e39" ]
[ "tests/test_statistics.py" ]
[ "import pytest\n\nimport dpnp\n\nimport numpy\n\n\n@pytest.mark.parametrize(\"type\",\n [numpy.float64, numpy.float32, numpy.int64, numpy.int32],\n ids=['float64', 'float32', 'int64', 'int32'])\n@pytest.mark.parametrize(\"size\",\n [2, 4, 8, 16...
[ [ "numpy.max", "numpy.testing.assert_allclose", "numpy.array", "numpy.bincount", "numpy.median", "numpy.testing.assert_array_equal", "numpy.arange", "numpy.nanvar" ] ]
mapehe/pandas
[ "832d81fa55c0413fac441a05cef25a508ff0c308" ]
[ "pandas/tests/test_panel.py" ]
[ "# -*- coding: utf-8 -*-\n# pylint: disable=W0612,E1101\n\nfrom warnings import catch_warnings\nfrom datetime import datetime\nimport operator\nimport pytest\n\nimport numpy as np\n\nfrom pandas.core.dtypes.common import is_float_dtype\nfrom pandas import (Series, DataFrame, Index, date_range, isna, notna,\n ...
[ [ "pandas.util.testing.add_nans", "pandas.compat.StringIO", "pandas.core.nanops.nanall", "numpy.random.rand", "pandas.util.testing.makeCustomDataframe", "pandas.io.excel.ExcelFile", "pandas.core.panel.panel_index", "numpy.median", "pandas.notna", "pandas.core.reshape.reshape....
cyber-meow/Noisy_active_query
[ "309c41f45c53311c32e2eeec9b179807237abce1" ]
[ "mnist/mnist_relabel_active.py" ]
[ "import torch\nimport torch.utils.data as data\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport argparse\n# import matplotlib.pyplot as plt\nimport numpy as np\nfrom copy import deepcopy\nfrom collections import OrderedDict\n\nimport dataset\nimport settings\nfrom active_query import Rando...
[ [ "numpy.logical_or", "torch.cat", "torch.cuda.is_available", "torch.from_numpy" ] ]
NCRAR/psiaudio
[ "fdb7629238ef7de62a511b5ab17458d46767db69" ]
[ "tests/test_pipeline.py" ]
[ "import pytest\n\nfrom collections import deque\nfrom functools import partial\n\nimport numpy as np\nfrom scipy import signal\n\nfrom psiaudio import pipeline\nfrom psiaudio.pipeline import normalize_index\nfrom psiaudio import util\n\n\n@pytest.fixture\ndef data1d(fs):\n md = {'foo': 'bar'}\n data = np.rand...
[ [ "numpy.concatenate", "scipy.signal.iirfilter", "numpy.testing.assert_array_equal", "scipy.signal.detrend", "numpy.mean", "numpy.testing.assert_array_almost_equal", "numpy.random.uniform", "scipy.signal.lfilter", "numpy.random.randint", "scipy.signal.lfilter_zi" ] ]
seyuboglu/terra
[ "7d5f8d8cdfbf819b52fb997b5b9746746d86b295" ]
[ "terra/pytorch.py" ]
[ "import torch\n\nfrom terra.io import reader, writer\n\n\n@writer(torch.Tensor)\ndef write_tensor(out, path):\n torch.save(out, path)\n return path\n\n\n@reader(torch.Tensor)\ndef read_tensor(path):\n return torch.load(path)\n\n\nclass TerraModule:\n def __terra_write__(self, path):\n torch.save(...
[ [ "torch.save", "torch.load" ] ]
Globe-Eater/Cali_Housing
[ "c4340ce86f13c8c4f50423c574d5ab857869400d" ]
[ "PCA.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Apr 16 13:32:05 2020\n\n@author: kellenbullock\n\"\"\"\nimport pandas as pd\nfrom statsmodels.multivariate.pca import PCA\n\ndf = pd.read_excel('Final.xlsx')\ndf = df.drop(columns=['Unnamed: 0'])\n\nc = PCA(df, standardize=False)" ]
[ [ "pandas.read_excel" ] ]
Pseudomanifold/POT
[ "5861209f27fe8e022eca2ed2c8d0bb1da4a1146b" ]
[ "benchmarks/benchmark.py" ]
[ "# /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom ot.backend import get_backend_list, jax, tf\nimport gc\n\n\ndef setup_backends():\n if jax:\n from jax.config import config\n config.update(\"jax_enable_x64\", True)\n\n if tf:\n from tensorflow.python.ops.numpy_ops import np_config...
[ [ "tensorflow.python.ops.numpy_ops.np_config.enable_numpy_behavior" ] ]
warlock8hz/pointnet2
[ "7e456909379c6d19946bf49b3f54346ec96e0fe5" ]
[ "part_seg/evaluate.py" ]
[ "import argparse\nimport math\nfrom datetime import datetime\nimport h5py\nimport numpy as np\n#import tensorflow as tf\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nimport socket\nimport importlib\nimport os\nimport sys\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = os.path.dirn...
[ [ "tensorflow.compat.v1.placeholder", "numpy.array", "numpy.zeros", "tensorflow.compat.v1.Graph", "tensorflow.compat.v1.disable_v2_behavior", "numpy.sum", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.train.Saver", "numpy.mean", "tensorflow.compat.v1.Session", ...
tstaffas/Lidar
[ "cd381826b6b45dd2a36aecb35617196b78ab32e8" ]
[ "Lidar code/intensity_lidar_0.2.py" ]
[ "#------IMPORTS-----\r\n#Packages for ETA backend\r\nimport json\r\nimport etabackend.eta #Available at: https://github.com/timetag/ETA, https://eta.readthedocs.io/en/latest/\r\nimport etabackend.tk as etatk\r\n\r\n#Packages used for analysis\r\nimport numpy as np\r\nfrom pathlib import Path\r\nimport os\r\nimport ...
[ [ "numpy.arange", "numpy.abs", "numpy.amax" ] ]
LinqCod/model_search
[ "d90bc39994bc2a5f5028035ac954f796eda03310" ]
[ "model_search/data/csv_data_for_binary.py" ]
[ "# 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.array", "tensorflow.compat.v2.compat.v1.disable_eager_execution", "tensorflow.compat.v2.feature_column.numeric_column", "tensorflow.compat.v2.data.experimental.CsvDataset", "tensorflow.compat.v2.compat.v1.placeholder", "pandas.read_csv", "tensorflow.compat.v2.estimator.export.bu...
penghouwen/CDARTS
[ "7dddc8d5db4ed343979ed3687c6adfc39dfce284", "7dddc8d5db4ed343979ed3687c6adfc39dfce284", "3f2c153df1551e775c3d7a93c7f4a7b9931bd44c", "3f2c153df1551e775c3d7a93c7f4a7b9931bd44c" ]
[ "CDARTS_segmentation/tools/utils/darts_utils.py", "CDARTS_segmentation/train/seg_metrics.py", "CDARTS_segmentation/train/cal_model.py", "CDARTS_detection/mmdet/models/backbones/efficientnet_builder.py" ]
[ "import os\nimport math\nimport numpy as np\nimport torch\nimport shutil\nfrom torch.autograd import Variable\nimport time\nfrom tqdm import tqdm\nfrom genotypes import PRIMITIVES\nimport matplotlib\n# Force matplotlib to not use any Xwindows backend.\nmatplotlib.use('Agg')\nfrom matplotlib import pyplot as plt\nfr...
[ [ "matplotlib.pyplot.annotate", "torch.load", "matplotlib.pyplot.subplots", "numpy.random.randint", "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.use", "numpy.array", "numpy.copyto", "torch.save", "numpy.random.randn", "matplotlib.pyplot.figure", "...
WAPAY/EPM
[ "4c4426f3b6a86d74f2d4c2c8d0c82f9475103eb7" ]
[ "model.py" ]
[ "# -*- coding: utf-8 -*-\nimport os\nos.environ['TF_KERAS'] = \"1\"\nimport tensorflow as tf\nimport config\nfrom bert4keras.models import build_transformer_model\nfrom module import label_smoothing, noam_scheme\nimport logging\nimport constant\nimport numpy as np\nimport law_accu_term_constraint\nlogging.basicConf...
[ [ "tensorflow.contrib.layers.xavier_initializer", "tensorflow.matmul", "tensorflow.ones_like", "numpy.load", "tensorflow.nn.embedding_lookup", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.cast", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.s...
mlbench/mlbench-core
[ "4fd3c7e6f1a5be69e52383ab2eb64cad257218c2", "4fd3c7e6f1a5be69e52383ab2eb64cad257218c2" ]
[ "mlbench_core/controlflow/pytorch/checkpoints_evaluation.py", "mlbench_core/utils/pytorch/utils.py" ]
[ "\"\"\"Evaluate training/validation set using models in checkpoints\"\"\"\nimport logging\n\nimport torch\n\nfrom mlbench_core.aggregation.pytorch.centralized import AllReduceAggregation\nfrom mlbench_core.controlflow.pytorch.helpers import iterate_dataloader\nfrom mlbench_core.utils.pytorch.distributed import glob...
[ [ "torch.no_grad" ], [ "torch.FloatTensor", "torch.empty", "torch.sum" ] ]
PariksheetPinjari909/tvmdbg
[ "4ddd24485c554a1422289bffd6da8587f2a806bc" ]
[ "python/tvm/tools/debug/cli/tensor_format.py" ]
[ "# coding: utf-8\n# pylint: disable=fixme, too-many-arguments, too-many-locals, too-many-statements, too-many-branches, no-member,consider-using-enumerate\n# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this fi...
[ [ "numpy.max", "numpy.isinf", "numpy.isnan", "numpy.isposinf", "numpy.set_printoptions", "numpy.sum", "numpy.isneginf", "numpy.shape", "numpy.min", "numpy.mean", "numpy.std", "numpy.size", "numpy.issubdtype" ] ]
jdmcbr/geopandas
[ "1cabaaa860c6d407cae710b878e98f6ea83d1ae0" ]
[ "geopandas/tools/overlay.py" ]
[ "import warnings\nfrom functools import reduce\n\nimport numpy as np\nimport pandas as pd\n\nfrom geopandas import GeoDataFrame, GeoSeries\nfrom geopandas.array import _check_crs, _crs_mismatch_warn\n\n\ndef _ensure_geometry_column(df):\n \"\"\"\n Helper function to ensure the geometry column is called 'geome...
[ [ "numpy.split", "pandas.DataFrame", "numpy.unique", "pandas.concat" ] ]
jpauwels/scikit-learn
[ "46969c2d1e8abf5cc5308b9a20fc89c747bce6b2" ]
[ "sklearn/model_selection/_validation.py" ]
[ "\"\"\"\nThe :mod:`sklearn.model_selection._validation` module includes classes and\nfunctions to validate the model.\n\"\"\"\n\n# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Gael Varoquaux <gael.varoquaux@normalesup.org>\n# Olivier Grisel <olivier.grisel@ensta.org>\n# Raghav...
[ [ "numpy.min", "numpy.mean", "numpy.finfo", "numpy.issubdtype", "numpy.full_like", "numpy.concatenate", "numpy.max", "numpy.zeros_like", "scipy.sparse.issparse", "numpy.array", "numpy.zeros", "numpy.stack", "numpy.clip", "numpy.asarray", "numpy.sum", "...
AljazBozic/TransformerFusion
[ "fe64be2e57a064403d6e0bf170ce42afcab1ab9f" ]
[ "src/evaluation/eval.py" ]
[ "import sys, os\nsys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))\n\nimport time\nimport argparse\nimport torch\nimport numpy as np\nfrom tqdm import tqdm\nimport open3d as o3d\n\nfrom nnutils.chamfer_distance import ChamferDistance \n\n\ndef visualize_occlusion_mask(occlusion_mask...
[ [ "torch.sqrt", "numpy.asarray", "torch.arange", "numpy.load", "torch.inverse", "torch.isfinite", "torch.from_numpy", "numpy.loadtxt", "torch.ones_like", "torch.meshgrid", "torch.mean" ] ]
genomicsITER/NanoRTax
[ "c466dbc1371f597a976d004bc0fb8d4251fe4b8f" ]
[ "templates/kraken_push.py" ]
[ "#!/usr/bin/env python3\n\nimport datetime\nimport re\nimport pandas as pd\nimport skbio\n\n\ndf = pd.read_csv(\"$report\", delimiter=\"\\t\", names=['seq_id', 'tax_id', 'kingdom', 'phylum', 'class', 'order', 'family', 'genus', 'species'])\ntax_table = df['class'].value_counts()\ntax_table_class = pd.DataFrame(list...
[ [ "pandas.read_csv" ] ]
MugiPham/MEDIUM_NoteBook
[ "799b146469c99d8a94ab8684beb78271eec73cfb" ]
[ "Graph_TimeSeries_Forecasting/spektral_gcn.py" ]
[ "from tensorflow.keras import activations, initializers, regularizers, constraints\nfrom tensorflow.keras import backend as K\nfrom tensorflow.keras.layers import Layer\n\nfrom spektral_utilities import filter_dot, dot, localpooling_filter\n\n\nclass GraphConv(Layer):\n r\"\"\"\n A graph convolutional layer (...
[ [ "tensorflow.keras.initializers.get", "tensorflow.keras.activations.get", "tensorflow.keras.regularizers.get", "tensorflow.keras.regularizers.serialize", "tensorflow.keras.constraints.get", "tensorflow.keras.activations.serialize", "tensorflow.keras.initializers.serialize", "tensorf...
nmonath/awd-lstm-lm
[ "060650f5f8f7f9cff61faa8713ed5aca9679870b" ]
[ "generate.py" ]
[ "###############################################################################\n# Language Modeling on Penn Tree Bank\n#\n# This file generates new sentences sampled from the language model\n#\n###############################################################################\n\nimport argparse\n\nimport torch\nfrom...
[ [ "torch.rand", "torch.cuda.manual_seed", "torch.manual_seed", "torch.multinomial", "torch.cuda.is_available", "torch.load" ] ]
leotmc/simcse
[ "e0b62fcef5dadeeef55aef3b640ab219860c201b" ]
[ "SentEval/senteval/sick.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\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\n'''\nSICK Relatedness and Entailment\n'''\nfrom __future__ import absolute_import, division, unicode_literals\n\nim...
[ [ "numpy.array", "sklearn.metrics.mean_squared_error", "scipy.stats.spearmanr", "scipy.stats.pearsonr", "numpy.abs", "numpy.vstack", "numpy.floor" ] ]
gmum/toolk
[ "936684590b06dedbc561cdbfe8927de9d19c37d6" ]
[ "pytorch_lightning_project_template/src/utils.py" ]
[ "\"\"\"\nMinor utilities\n\"\"\"\n\nimport sys\nfrom functools import reduce\n\nimport traceback\nimport logging\nimport argparse\nimport optparse\nimport datetime\nimport sys\nimport pprint\nimport types\nimport time\nimport copy\nimport subprocess\nimport glob\nfrom collections import OrderedDict\nimport os\nimpo...
[ [ "torch.save", "torch.nn.modules.module._addindent", "pandas.concat" ] ]
wangye707/continuous_integration
[ "6e38924a67e17a57f3e64d9e846f0ede6e47c93f" ]
[ "inference/inference_benchmark/cc/Paddle/bin/py_parse_log.py" ]
[ "import os\nimport re\nimport argparse\n\nimport pandas as pd\n\ndef parse_args():\n \"\"\"\n parse input args\n \"\"\"\n parser = argparse.ArgumentParser()\n parser.add_argument(\"--log_path\", type=str, default=\"./log\",\n help=\"benchmark log path\")\n parser.add_argumen...
[ [ "pandas.isnull", "pandas.DataFrame" ] ]
vathes/DJ-NWB-Yu-Gutnisky-2016
[ "85414f6b35da48fbb78a9a37108fb59a609079c6" ]
[ "scripts/ingest_wholecell.py" ]
[ "import os\nimport re\nimport pathlib\nimport h5py as h5\nimport numpy as np\nfrom decimal import Decimal\nfrom tqdm import tqdm\nimport glob\n\nimport datajoint as dj\nfrom pipeline import (reference, subject, acquisition, intracellular, behavior, stimulation, virus, utilities)\n\npath = pathlib.Path(dj.config['cu...
[ [ "numpy.where", "numpy.array", "numpy.logical_and", "numpy.diff" ] ]
pvkraju80/leo
[ "f6ed6f4ee6eb34c47581d40d4d3fea69f42140f3" ]
[ "code/scripts/variance_swaps.py" ]
[ "#\n# Module with functions for\n# Variance Swaps Examples\n#\n# (c) Dr. Yves J. Hilpisch\n# Listed Volatility and Variance Derivatives\n#\nimport math\nimport numpy as np\nimport pandas as pd\n\ndef generate_path(S0, r, sigma, T, M, seed=100000):\n ''' Function to simulate a geometric Brownian motion.\n\n Pa...
[ [ "numpy.random.seed", "pandas.DataFrame", "numpy.random.standard_normal" ] ]
rcr-usfs/lamda
[ "dac61cca68d70f049d43a8162b7f2d80f3487d9c" ]
[ "Production/raster_processing_lib.py" ]
[ "\"\"\"\n\t Copyright 2021 Ian Housman, RedCastle Resources Inc.\n\n\t Licensed under the Apache License, Version 2.0 (the \"License\");\n\t you may not use this file except in compliance with the License.\n\t You may obtain a copy of the License at\n\n\t\t\t http://www.apache.org/licenses/LICENSE-2.0\n\n\t Unless ...
[ [ "numpy.max", "numpy.sum", "numpy.array" ] ]
RiyaGupta99/preprocessy
[ "1cccf56e96f95394e939ea9aa2751857c071af75" ]
[ "preprocessy/feature_selection/_selectKBest.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.feature_selection import f_classif\nfrom sklearn.feature_selection import f_regression\n\n\nclass SelectKBest:\n \"\"\"Class for finding K highest scoring features among the set of all features. Takes a feature and finds its correlation with the\n target ...
[ [ "numpy.asarray", "numpy.zeros", "numpy.argsort" ] ]
hammadzz/great_expectations
[ "020c605000d9472e88a9da7b6baa2fae28fd02c7" ]
[ "great_expectations/dataset/sparkdf_dataset.py" ]
[ "import copy\nimport inspect\nimport json\nimport logging\nfrom collections import OrderedDict\nfrom datetime import datetime\nfrom functools import reduce, wraps\nfrom typing import List\n\nimport jsonschema\nimport numpy as np\nimport pandas as pd\nfrom dateutil.parser import parse\n\nfrom great_expectations.data...
[ [ "pandas.Index", "numpy.mean" ] ]
okehkim/End-to-End-Speech-Recognition-Models
[ "7b4695bbc778e4d2c92470b56e2479c8d81d0079" ]
[ "deepspeech2/model.py" ]
[ "# -*- coding: utf-8 -*-\n# Soohwan Kim @ https://github.com/sooftware/\n# This source code is licensed under the Apache 2.0 License license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import...
[ [ "torch.nn.ReLU", "torch.no_grad", "torch.stack", "torch.nn.functional.log_softmax" ] ]
boourns/eurorack
[ "1914e3c4c0a1b43b79fa18abdf28f16f0158d5c5" ]
[ "warps/tools/generate_src_filters.py" ]
[ "#!/usr/bin/python2.5\n#\n# Copyright 2014 Olivier Gillet.\n#\n# Author: Olivier Gillet (pichenettes@mutable-instruments.net)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software witho...
[ [ "numpy.fft.rfft", "numpy.arange" ] ]
OMARI1988/bug_tracking
[ "4501805557359e476f54624956371e42e85f6a39" ]
[ "transform.py" ]
[ "# -*- coding: utf-8 -*-\n# transformations.py\n\n# Copyright (c) 2006-2015, Christoph Gohlke\n# Copyright (c) 2006-2015, The Regents of the University of California\n# Produced at the Laboratory for Fluorescence Dynamics\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or witho...
[ [ "numpy.dot", "numpy.random.rand", "numpy.set_printoptions", "numpy.negative", "numpy.mean", "numpy.radians", "numpy.finfo", "numpy.cos", "numpy.outer", "numpy.random.random", "numpy.concatenate", "numpy.sin", "numpy.empty", "numpy.linalg.eigh", "numpy.fa...
DSCI-310/DSCI-310-Group-7
[ "f244e9005be3a4b73e77fed82c97d22ae2b0a971", "f244e9005be3a4b73e77fed82c97d22ae2b0a971" ]
[ "src/knn_script.py", "src/svm_lr_script.py" ]
[ "\"\"\"\nTakes the clean data location get the data from their do the model evaluation and train\nit using the best k for KNN and export the reports and results of KNN model to the export\nlocation\n\nUsage: src/knn_script.py data_loc export_loc\n\nOptions:\ndata_loc The location of the cleaned data that the mo...
[ [ "numpy.zeros", "matplotlib.pyplot.savefig", "pandas.DataFrame", "sklearn.model_selection.train_test_split", "pandas.read_csv" ], [ "sklearn.model_selection.train_test_split", "pandas.DataFrame", "pandas.read_csv" ] ]
niltonlk/nrn
[ "464541abbf72fe58de77b16bf0e1df425a280b89" ]
[ "share/lib/python/neuron/rxdtests/run_all.py" ]
[ "def test(files, correct_data):\n import os\n import sys\n import filecmp\n import subprocess\n import re, array, numpy\n\n tol = 1e-10\n dt_eps = 1e-20\n for dr in [\"wave1d\", \"ecs\", \"3d\", \"hybrid\"]:\n try:\n os.makedirs(os.path.join(\"test_data\", dr))\n exc...
[ [ "numpy.interp", "numpy.fromfile" ] ]
marthaboyer/beast
[ "1ca71fb64ab60827e4e4e1937b64f319a98166c3", "1ca71fb64ab60827e4e4e1937b64f319a98166c3", "1ca71fb64ab60827e4e4e1937b64f319a98166c3" ]
[ "beast/tools/setup_batch_beast_trim.py", "beast/physicsmodel/helpers/hdfstore.py", "beast/observationmodel/noisemodel/toothpick.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nCode to setup the batch files for BEAST trim grid runs\n\"\"\"\n\nfrom __future__ import print_function\nimport os\nimport glob\n\nimport argparse\n\nimport numpy as np\n\n\ndef setup_batch_beast_trim(project,\n datafile,\n astfil...
[ [ "numpy.unique" ], [ "numpy.random.normal", "numpy.arange", "numpy.asarray" ], [ "numpy.empty", "numpy.zeros", "numpy.percentile", "numpy.interp", "numpy.mean", "numpy.where", "numpy.std", "numpy.amax", "numpy.arange", "numpy.argsort", "numpy.amin...
brandontrabucco/rlkit
[ "ac0bb660d6baa9c36fceb688cb147066f5ddc722", "ac0bb660d6baa9c36fceb688cb147066f5ddc722" ]
[ "rlkit/torch/conv_networks.py", "rlkit/core/rl_algorithm.py" ]
[ "import torch\nfrom torch import nn as nn\n\nfrom rlkit.pythonplusplus import identity\nfrom rlkit.torch.core import PyTorchModule\n\nimport numpy as np\n\n\nclass CNN(PyTorchModule):\n def __init__(\n self,\n input_width,\n input_height,\n input_channels,\n ...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d", "numpy.prod", "torch.nn.BatchNorm1d" ], [ "numpy.array" ] ]
Mrqianduoduo/RSDet-8P-4R
[ "56e1c1ccb619975b515ecf7d1537f15282edcdd8" ]
[ "libs/configs/DOTA1.0/cfgs_res50_dota_v8.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import\nimport os\nimport tensorflow as tf\nimport math\n\n\"\"\"\nv3 + 2x multi-gpu + REG_WEIGHT=1.0\nThis is your evaluation result for task 1:\n\n mAP: 0.627914092842082\n ap of each class:\n plane:0.8858093578644306,\n ...
[ [ "tensorflow.constant_initializer", "tensorflow.random_normal_initializer" ] ]
ForrestHeiYing/Detectron
[ "787f5a9bf80b4149adb4913e86b2edd8a441bf09" ]
[ "detectron/utils/train.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.isnan" ] ]
icaros-usc/pyribs
[ "ef289a930e7a8a51286cf657f7e4b29551277350" ]
[ "tests/archives/grid_archive_test.py" ]
[ "\"\"\"Tests for the GridArchive.\"\"\"\nimport numpy as np\nimport pytest\n\nfrom ribs.archives import AddStatus, GridArchive\n\nfrom .conftest import get_archive_data\n\n# pylint: disable = redefined-outer-name\n\n\n@pytest.fixture\ndef data():\n \"\"\"Data for grid archive tests.\"\"\"\n return get_archive...
[ [ "numpy.all", "numpy.array", "numpy.isclose", "numpy.linspace" ] ]
Digitaltransform/tensorboard
[ "931fdb84ed125efe5ef6cb0bad869c52da73e18f" ]
[ "tensorboard/plugins/audio/audio_plugin_test.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.compat.v1.placeholder", "tensorflow.compat.v1.summary.merge_all", "numpy.random.rand", "tensorflow.compat.v1.summary.audio", "tensorflow.compat.v1.Graph", "numpy.random.seed", "tensorflow.compat.as_bytes", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.reset_...
SalishSeaCast/tools
[ "4be9170bbe7ab700ab1b3afc3138e669053d43f8" ]
[ "SalishSeaTools/salishsea_tools/bio_tools.py" ]
[ "# Copyright 2013-2021 The Salish Sea NEMO Project and\n# The University of British Columbia\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/LI...
[ [ "numpy.minimum", "numpy.ones", "numpy.exp", "numpy.logical_and", "numpy.any", "numpy.where", "numpy.power" ] ]
youansheng/PyTorchCV
[ "c7e717fe301ba338b3e9dbea70b51f3e2cd5dabe", "3a51b2f209639e58620676bf19b3564ef8c92a75", "c7e717fe301ba338b3e9dbea70b51f3e2cd5dabe", "c7e717fe301ba338b3e9dbea70b51f3e2cd5dabe" ]
[ "models/seg/nets/pspnet.py", "models/det/nets/faster_rcnn.py", "demo/pseg/model/dmnetU.py", "methods/seg/fcn_segmentor.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Author: Donny You(youansheng@gmail.com)\n# Pytorch implementation of PSP net Synchronized Batch Normalization\n# this is pytorch implementation of PSP resnet101 (syn-bn) version\n\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom models...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d", "torch.Tensor", "torch.nn.Dropout2d" ], [ "torch.nn.Sequential", "torch.nn.Conv2d" ], [ "torch.cat", "torch.nn.BatchNorm2d", "torch.nn.functional.max_unpool2d", "torch.clamp...
heyudao/ISS
[ "d076fca9b8783825ffe688fbbddb7ef45eae7cd1" ]
[ "Day 2/workshop/selected-downloads (26)/ML_Classifiers.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Aug 23 17:03:52 2019\r\n\r\n@author: isswan\r\n\"\"\"\r\n\r\n\r\nimport sklearn\r\nimport nltk\r\nimport re \r\nimport pandas as pd\r\nimport numpy as np\r\nfrom sklearn.feature_extraction.text import TfidfVectorizer\r\nfrom sklearn.model_selection import train_t...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.neighbors.KNeighborsClassifier", "numpy.mean", "sklearn.metrics.classification_report", "sklearn.naive_bayes.MultinomialNB", "sklearn.linear_model.LogisticRegression", "sklearn.feature_extraction.text.TfidfVectorizer", "sklearn.feature_s...
thisisi3/OpenMMLab-IoUNet
[ "23a9931627aa2bc15298d0379a81c2efde5e0297" ]
[ "mmdet/iounet/roi_generator.py" ]
[ "from mmdet.core import bbox_overlaps, bbox_xyxy_to_cxcywh, bbox_cxcywh_to_xyxy\nfrom .utils import clip_bboxes_to_image\nimport math, torch\n \nclass RoIGenerator(torch.nn.Module):\n \"\"\"It generates IoU balanced rois from a given set of GT bboxes.\n We use delta since it is scale-invariant. A large...
[ [ "torch.cat", "torch.stack", "torch.randperm", "torch.linspace", "torch.tensor", "torch.meshgrid" ] ]
jacobic/redmapper
[ "bda5bd6f486fd5f18d35aa9ae4b875628e905604" ]
[ "redmapper/calibration/selectspecseeds.py" ]
[ "\"\"\"Select seed galaxies\n\"\"\"\nimport os\nimport numpy as np\nimport fitsio\nimport esutil\n\nfrom ..configuration import Configuration\nfrom ..galaxy import GalaxyCatalog\nfrom ..catalog import Catalog\n\nclass SelectSpecSeeds(object):\n \"\"\"\n Class to match a galaxy catalog to a spectroscopic catal...
[ [ "numpy.where", "numpy.zeros" ] ]
tanmay7270/Playing-with-PyTorch
[ "9ace9c93823010a91cdf9206c2d57d3dc10d821f" ]
[ "fashion_MNIST.py" ]
[ "import torch\nfrom torchvision import datasets, transforms\nfrom torch import nn, optim\nimport torch.nn.functional as F\n\n# Define a transform to normalize the data\ntransform = transforms.Compose([transforms.ToTensor(),\n transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])\n#...
[ [ "torch.nn.NLLLoss", "torch.nn.Linear", "torch.no_grad", "torch.utils.data.DataLoader", "torch.exp" ] ]
KTH-dESA/UNECE-Capacity-building
[ "5163cf6c7c86aa2774c7f6072ada0e4b90cc8e9a" ]
[ "drina/packages.py" ]
[ "# This file imports all the packages\nimport pandas as pd\npd.set_option('mode.chained_assignment', None)\nimport numpy as np\nfrom IPython.display import HTML\nimport IPython.core.display as di\nimport plotly as py\nimport cufflinks\nimport plotly.offline as pyo\nfrom plotly.offline import plot, iplot, init_noteb...
[ [ "pandas.set_option" ] ]
Anpopaicoconat/Poly-Encoder
[ "779a6ec19bd6477947fcf44199fa06fc6353e18a" ]
[ "encoder.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom transformers import BertPreTrainedModel, BertModel\n\n\nclass BiEncoder(BertPreTrainedModel):\n def __init__(self, config, *inputs, **kwargs):\n super().__init__(config, *inputs, **kwargs)\n self.bert = ...
[ [ "torch.nn.Linear", "torch.cdist", "torch.arange", "torch.nn.functional.log_softmax", "torch.abs", "torch.nn.init.normal_", "torch.eye", "torch.nn.functional.softmax", "torch.matmul", "torch.nn.Embedding" ] ]
cburns/pynifti
[ "12c0314994a1061b573990dbd46ea8e35cec8e60", "12c0314994a1061b573990dbd46ea8e35cec8e60" ]
[ "nifti/tests/test_analyze.py", "nifti/spm2analyze.py" ]
[ "''' Test analyze headers\n\nSee test_binary.py for general binary header tests\n\nThis - basic - analyze header cannot encode full affines (only\ndiagonal affines), and cannot do integer scaling.\n\nThe inability to do affines raises the problem of whether the image is\nneurological (left is left), or radiological...
[ [ "numpy.array", "numpy.ones", "numpy.allclose", "numpy.all", "numpy.diag" ], [ "numpy.dtype", "numpy.isfinite" ] ]
dmelis/POT
[ "7471b7a16577d66e907e10e08bf3bbcded19551c" ]
[ "ot/gromov.py" ]
[ "\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nGromov-Wasserstein transport method\r\n\r\n\r\n\"\"\"\r\n\r\n# Author: Erwan Vautier <erwan.vautier@gmail.com>\r\n# Nicolas Courty <ncourty@irisa.fr>\r\n# Rémi Flamary <remi.flamary@unice.fr>\r\n#\r\n# License: MIT License\r\n\r\nimport numpy as np\r\n\r\nfr...
[ [ "numpy.divide", "numpy.linalg.norm", "numpy.dot", "numpy.asarray", "numpy.log", "numpy.sum", "numpy.random.randn", "numpy.outer" ] ]
Ji-Ping-Dai/CosmoCl
[ "5c6ca73c1a37d3b0de8751c772ad38eb60f89840" ]
[ "python/getdist/densities.py" ]
[ "import numpy as np\nfrom scipy.interpolate import splrep, splev, RectBivariateSpline, LinearNDInterpolator\n\n\nclass DensitiesError(Exception):\n pass\n\n\ndefaultContours = [0.68, 0.95]\n\n\ndef getContourLevels(inbins, contours=defaultContours, missing_norm=0, half_edge=True):\n \"\"\"\n Get contour l...
[ [ "numpy.max", "numpy.ndindex", "numpy.array", "numpy.asarray", "numpy.zeros", "scipy.interpolate.splrep", "numpy.sum", "scipy.interpolate.LinearNDInterpolator.__init__", "numpy.roll", "scipy.interpolate.splev", "numpy.atleast_1d", "numpy.sort", "numpy.argmax", ...
OpenHEC/SNN-simulator-on-PYNQcluster
[ "14f86a76edf4e8763b58f84960876e95d4efc43a" ]
[ "NEST-14.0-FPGA/pynest/nest/tests/test_stdp_multiplicity.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# test_stdp_multiplicity.py\n#\n# This file is part of NEST.\n#\n# Copyright (C) 2004 The NEST Initiative\n#\n# NEST is free software: 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 ve...
[ [ "numpy.round", "numpy.array" ] ]
KailinLi/nflows
[ "7c07a1d5e510beb681d1b11d6ffda95a086a8153" ]
[ "nflows/transforms/UMNN/MonotonicNormalizer.py" ]
[ "import torch\n\n# from UMNN import NeuralIntegral, ParallelNeuralIntegral\nimport torch.nn as nn\n\n\ndef _flatten(sequence):\n flat = [p.contiguous().view(-1) for p in sequence]\n return torch.cat(flat) if len(flat) > 0 else torch.tensor([])\n\n\nclass ELUPlus(nn.Module):\n def __init__(self):\n s...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.Sequential", "torch.nn.ReLU", "torch.tensor", "torch.ones_like", "torch.nn.ELU" ] ]
mkoeppe/scipy
[ "70a76cbcea11d959bcfdf7ee9df983bfac30e170", "70a76cbcea11d959bcfdf7ee9df983bfac30e170" ]
[ "scipy/optimize/__init__.py", "scipy/stats/_mstats_extras.py" ]
[ "\"\"\"\n=====================================================\nOptimization and root finding (:mod:`scipy.optimize`)\n=====================================================\n\n.. currentmodule:: scipy.optimize\n\nSciPy ``optimize`` provides functions for minimizing (or maximizing)\nobjective functions, possibly sub...
[ [ "scipy._lib._testutils.PytestTester" ], [ "numpy.array", "numpy.ma.sqrt", "numpy.dot", "scipy.stats.distributions.binom._ppf", "numpy.ma.fix_invalid", "numpy.ma.median", "scipy.stats.distributions.norm.cdf", "scipy.stats.distributions.t.ppf", "scipy.stats.distributions....
beckdaniel/GPy
[ "37e835aa36b18c32bc500684cc10dd2b74240e1f", "37e835aa36b18c32bc500684cc10dd2b74240e1f" ]
[ "GPy/likelihoods/student_t.py", "GPy/models/bayesian_gplvm_minibatch.py" ]
[ "# Copyright (c) 2012-2014 Ricardo Andrade, Alan Saul\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\nimport numpy as np\nfrom scipy import stats, special\nimport scipy as sp\nfrom . import link_functions\nfrom scipy import stats, integrate\nfrom scipy.special import gammaln, gamma\nfrom .likelihood...
[ [ "numpy.square", "numpy.array", "numpy.ones_like", "numpy.empty", "scipy.special.gammaln", "numpy.log", "scipy.special.psi", "numpy.float", "numpy.log1p", "numpy.prod", "numpy.atleast_1d", "numpy.sqrt" ], [ "numpy.square", "numpy.zeros_like", "numpy.d...
w3ichen/models
[ "b378433a1bb2dc55ae9266796f63b787fe3206fd" ]
[ "official/modeling/performance.py" ]
[ "# Copyright 2020 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.keras.mixed_precision.set_global_policy", "tensorflow.keras.mixed_precision.experimental.set_policy", "tensorflow.keras.mixed_precision.LossScaleOptimizer", "tensorflow.train.experimental.enable_mixed_precision_graph_rewrite", "tensorflow.keras.mixed_precision.experimental.Policy",...
kazemakase/mne-python
[ "9dbb10156a8faf6610f3a8d979ffe9b853dd20dd" ]
[ "mne/preprocessing/ica.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Authors: Denis A. Engemann <denis.engemann@gmail.com>\n# Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Juergen Dammers <j.dammers@fz-juelich.de>\n#\n# License: BSD (3-clause)\n\nfrom inspect import isfunction\nfrom collections import namedtuple\nfrom copy impor...
[ [ "numpy.dot", "numpy.median", "numpy.exp", "scipy.linalg.pinv", "numpy.sign", "numpy.where", "numpy.concatenate", "numpy.linalg.norm", "numpy.log", "numpy.nonzero", "numpy.eye", "numpy.prod", "numpy.arange", "numpy.argmax", "numpy.sqrt", "sklearn.deco...
welpaolo/ML2SQL
[ "a716c466dedfe0400d701de40beacd1fee16a778" ]
[ "python2sql/ml/ml_pipeline.py" ]
[ "import os\nimport pickle\nimport time\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sqlalchemy import create_engine\n\n\nclass MLPipeline(object):\n \"\"\"\n TODO\n \"\"\"\n\n def __init__(self, output_dir):\n self.output_dir = output_dir\...
[ [ "pandas.DataFrame", "pandas.concat", "sklearn.model_selection.train_test_split", "pandas.read_csv", "numpy.unique" ] ]
codeboy5/cvpr20-scatter-text-recognizer
[ "4bd6cfbd4d7f64ce11864514f6b6b0646267c285" ]
[ "modules/prediction.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\nfrom torch.nn.init import xavier_uniform_\nfrom torch.nn.init import constant_\nfrom torch.nn.init import xavier_normal_\nimport copy\nimport numpy as np\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\n\ncl...
[ [ "torch.nn.Linear", "torch.cat", "torch.ones", "torch.cuda.is_available", "torch.nn.functional.multi_head_attention_forward", "torch.LongTensor", "torch.nn.LayerNorm", "torch.nn.init.constant_", "torch.FloatTensor", "torch.empty", "torch.nn.init.xavier_normal_", "tor...
callysto/curriculum-notebooks
[ "871241c8f318cff74f46f42705a03020cd48cd17" ]
[ "Mathematics/GraphingTwoVariables/helper.py" ]
[ "import matplotlib.pyplot as plt\nimport plotly as py\nimport plotly.graph_objs as go\nimport numpy as np\nimport math\nimport ipywidgets as widgets\nfrom astropy.table import Table, Column\nfrom ipywidgets import interact, interactive, Layout\nfrom IPython.display import display, Math, Latex, HTML\n\npy.offline.in...
[ [ "matplotlib.pyplot.rc" ] ]
zlgenuine/pybamm
[ "5c43d17225710c5bea8e61b3863688eb7080e678" ]
[ "examples/scripts/thermal_lithium_ion.py" ]
[ "#\n# Compares the full and lumped thermal models for a single layer Li-ion cell\n#\n\nimport pybamm\nimport numpy as np\n\n# load model\npybamm.set_logging_level(\"INFO\")\n\noptions = {\"thermal\": \"x-full\"}\nfull_thermal_model = pybamm.lithium_ion.SPMe(options)\n\noptions = {\"thermal\": \"x-lumped\"}\nlumped_...
[ [ "numpy.linspace" ] ]
fitancinpet/WMemPy
[ "ed9b3bece2aca465635e09526060165b2704cfcc" ]
[ "WMemPy/wmem_scannable.py" ]
[ "# pylint: disable=c-extension-no-member\n\"\"\"Scannable classes are used to represent live memory of a process that can be scanned\"\"\"\nimport os\nimport ctypes\nimport win32process\nimport numpy as np\nfrom wmempy.wmem_structs import MODULEINFO\n\nclass ProcScannable:\n \"\"\"\n Scannable interface has t...
[ [ "numpy.empty" ] ]
jlevy44/airlab
[ "7d8439339bea11e680716f1c70bf8a21559df0c6" ]
[ "airlab/regulariser/displacement.py" ]
[ "# Copyright 2018 University of Basel, Center for medical Image Analysis and Navigation\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/LICE...
[ [ "torch.abs", "torch.nn.functional.pad", "torch.sqrt" ] ]
mathco-wf/river
[ "2e0b25a2ef2d2ba9ec080cf86a491f7465433b18", "2e0b25a2ef2d2ba9ec080cf86a491f7465433b18" ]
[ "river/compat/test_sklearn.py", "river/reco/funk_mf.py" ]
[ "import pytest\nfrom sklearn import linear_model as sk_linear_model\nfrom sklearn.utils import estimator_checks\n\nfrom river import base, cluster, compat, linear_model, preprocessing\n\n\n@pytest.mark.parametrize(\n \"estimator\",\n [\n pytest.param(estimator, id=str(estimator))\n for estimator...
[ [ "sklearn.linear_model.SGDRegressor", "sklearn.utils.estimator_checks.check_estimator" ], [ "numpy.dot" ] ]
nschloe/pyamg
[ "005a71754015f050ac3d39241365cbfa4998c374" ]
[ "pyamg/krylov/tests/test_simple_iterations.py" ]
[ "from pyamg.krylov import minimal_residual, steepest_descent\nimport numpy as np\nfrom pyamg.util.linalg import norm\nimport pyamg\n\nfrom numpy.testing import TestCase\n\n\nclass TestSimpleIterations(TestCase):\n def setUp(self):\n self.definite_cases = []\n self.spd_cases = []\n\n # 1x1\n ...
[ [ "numpy.array", "numpy.zeros_like", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "numpy.ones", "numpy.ravel" ] ]
phiandre/ToricCodeRL
[ "c62a33124e427307cc462caed02382cea0f74c47" ]
[ "QNet.py" ]
[ "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nNeural network for approximation of Q-function.\n\nWill take in concatenated state- and action data\nand ouput the associated approximation Q(s,a).\n\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"...
[ [ "numpy.expand_dims" ] ]
LetteraUnica/neural_cellular_automata
[ "360aed252d31529b02460cdf50d752acbd6edaf8" ]
[ "pytorch_ca/src/utils/utils.py" ]
[ "import torch\n\nfrom random import randint\n\n\ndef make_seed(n_images: int,\n n_channels: int,\n image_size: int,\n n_CAs: int = 1,\n alpha_channel: int = -1,\n device: torch.device = \"cpu\") -> torch.Tensor:\n \"\"\"Makes n_images seeds to star...
[ [ "torch.zeros" ] ]
wingarlo/Aerolyzer
[ "16c91740ba561b988e67fdcd6ef802ed8a826da2" ]
[ "aerolyzer/image_restriction_functions.py" ]
[ "'''\nImage Restriction Function File\nDescription: This file contains all functions for the verifying image restrictions.\n'''\nimport os\nimport re\nimport cv2\nimport yaml\nfrom datetime import datetime\nimport exifread\nimport numpy as np\n\nclass imgRestFuncs(object):\n 'Class containing all image restricti...
[ [ "numpy.argmin" ] ]
Photon26/wrs-main-210414
[ "71efab6f8680af48ba269244136acf69c36cb730" ]
[ "modeling/_gimpact_cdhelper.py" ]
[ "import numpy as np\nimport gimpact as gi\n\n# util functions\ndef gen_cdmesh_vvnf(vertices, vertex_normals, faces):\n \"\"\"\n generate cdmesh given vertices, _, and faces\n :return: gimpact.TriMesh (require gimpact to be installed)\n author: weiwei\n date: 20210118\n \"\"\"\n return gi.TriMes...
[ [ "numpy.array" ] ]
chrism0dwk/probability
[ "ab260f15cae94c6802c2f2769fb448ad213b79cd" ]
[ "tensorflow_probability/python/distributions/probit_bernoulli.py" ]
[ "# Copyright 2018 The TensorFlow Probability 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 required by a...
[ [ "tensorflow.compat.v2.exp", "tensorflow.compat.v2.TensorShape", "tensorflow.compat.v2.cast", "tensorflow.compat.v2.ones", "tensorflow.compat.v2.less", "tensorflow.compat.v2.math.log1p", "tensorflow.compat.v2.math.log", "tensorflow.compat.v2.convert_to_tensor", "tensorflow.compa...
anidhi/ParlAI
[ "aa684894300eececd6d000900e1821e9a7393da4" ]
[ "parlai_hred/seq2seq.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\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\nfrom parlai_internal.agents.seq2seq.torch_generator_agent2 import TorchGeneratorAgent2\nfrom parlai.utils.mis...
[ [ "torch.nn.NLLLoss", "torch.nn.CrossEntropyLoss", "torch.load" ] ]
npezolano/zipline
[ "e7a5e097c419bed7816d3cd6c370b5171db37b33" ]
[ "zipline/utils/data.py" ]
[ "#\n# Copyright 2013 Quantopian, 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 applicable law or...
[ [ "pandas.isnull", "numpy.empty", "numpy.roll", "pandas.Panel", "numpy.arange", "numpy.all" ] ]
ocefpaf/xroms
[ "763d6e678e28fe074e0aaab26fecd2b74e51a8b0" ]
[ "xroms/interp.py" ]
[ "from scipy.spatial import Delaunay\nimport matplotlib.tri as mtri\nimport numpy as np\nimport xroms\nimport xarray as xr\n\n\ndef setup(ds, whichgrids=None):\n '''Set up for using ll2xe().\n \n Set up Delaunay triangulation by calculating triangulation and functions for \n calculating grid coords from ...
[ [ "numpy.array", "numpy.asarray", "numpy.arange", "numpy.column_stack", "matplotlib.tri.TriAnalyzer", "scipy.spatial.Delaunay" ] ]
esheldon/galsim_extra
[ "1e93a35db16943f6ce0251cddcd253defe0d5c61" ]
[ "tests/test_focalplane.py" ]
[ "from __future__ import print_function\nimport galsim\nimport logging\nimport numpy as np\nimport os, sys\n\ndef test_truth():\n \"\"\"This test addressed Issue 10, where Niall found that the truth catalog wasn't being\n built correctly with the FocalPlane builder.\n \"\"\"\n config = galsim.config.Read...
[ [ "numpy.not_equal", "numpy.any", "numpy.all", "numpy.testing.assert_equal" ] ]
frankxu2004/knnlm
[ "7a668a916b08a0e82072c8f49eef4a10ad4a8505" ]
[ "fairseq/tasks/language_modeling.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 logging\nimport os\n\nimport numpy as np\nimport torch\n\nfrom fairseq import utils\nfrom fairseq.data import (\n data_uti...
[ [ "numpy.array", "torch.no_grad" ] ]
Chahalprincy/deepchem
[ "9d1a6a879cc74b065694b3ddb763d52151d57b7a" ]
[ "deepchem/utils/fake_data_generator.py" ]
[ "\"\"\"\nA fake data generator\n\"\"\"\nimport random\nimport numpy as np\nfrom deepchem.data import NumpyDataset\nfrom deepchem.feat import GraphData\n\n\nclass FakeGraphGenerator:\n \"\"\"Generates a random graphs which can be used for testing or other purposes.\n\n The generated graph supports both node-level ...
[ [ "numpy.array", "numpy.random.randint", "numpy.random.rand" ] ]
kkinist/karlib
[ "16c2daa11623b41297ddb9c6c2b1e663a8638cef" ]
[ "chem_subs.py" ]
[ "# Routines for general quantum chemistry (no particular software package)\n# Python3 and pandas\n# Karl Irikura \n#\nimport re, sys\n#import string, copy\nimport copy\nimport numpy as np\nimport pandas as pd\nimport quaternion\nfrom scipy.spatial.distance import cdist\nfrom scipy import interpolate\nfrom scipy imp...
[ [ "numpy.dot", "numpy.arccos", "numpy.isclose", "numpy.array_equal", "numpy.argmin", "numpy.ones_like", "scipy.interpolate.UnivariateSpline", "scipy.interpolate.Akima1DInterpolator", "numpy.rint", "numpy.subtract.outer", "numpy.exp", "numpy.min", "scipy.optimize.m...
JoJoJun/NLPCC2018_Multi_Turn_Response_Selection
[ "ba13e629e5094dca5d87e8aeea3d3371df6a9679" ]
[ "LCMN_and_SMN.py" ]
[ "import tensorflow as tf\r\nimport pickle\r\nimport utils\r\nfrom tensorflow.contrib.layers import xavier_initializer\r\nfrom tensorflow.contrib import rnn\r\nfrom tensorflow.python.keras.preprocessing.sequence import pad_sequences\r\nimport numpy as np\r\nimport Evaluate\r\nimport time\r\nfrom datetime import time...
[ [ "tensorflow.tensordot", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.matmul", "tensorflow.nn.embedding_lookup", "tensorflow.stack", "tensorflow.nn.softmax", "tensorflow.global_variables_initializer", "tensorflow.contrib.layers.flatten", "tensorflow.einsum", "...
AutuanLiu/Machine-Learning-on-docker
[ "00eb7211a3a40a9da02114923647dfd6ac24f138", "00eb7211a3a40a9da02114923647dfd6ac24f138", "00eb7211a3a40a9da02114923647dfd6ac24f138" ]
[ "boost/XGBoost/xgboostree.py", "TensorFlow/LinearRegression/LogisticRegression.py", "boost/LightGBM/regression.py" ]
[ "\"\"\"\nCreated on 1 Apr 2015\n@author: Jamie Hall\n\"\"\"\n# https://github.com/dmlc/xgboost/blob/master/demo/guide-python/sklearn_examples.py\n\nimport pickle\n\nimport numpy as np\nimport xgboost as xgb\nfrom sklearn.datasets import load_iris, load_digits, load_boston\nfrom sklearn.metrics import confusion_matr...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.metrics.mean_squared_error", "sklearn.datasets.load_digits", "numpy.random.RandomState", "sklearn.model_selection.GridSearchCV", "sklearn.model_selection.train_test_split", "sklearn.datasets.load_iris", "sklearn.model_selection.KFold", ...
leoninekev/DeepCTR
[ "9bc93ae729f1d4d03fdf5fe8b9c111fbc59a2870" ]
[ "deepctr/layers/sequence.py" ]
[ "# -*- coding:utf-8 -*-\n\"\"\"\n\nAuthor:\n Weichen Shen,wcshen1994@163.com\n\n\"\"\"\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.keras import backend as K\nfrom tensorflow.python.keras.initializers import TruncatedNormal\nfrom tensorflow.python.keras.layers import LSTM, Lambda, Layer...
[ [ "tensorflow.tensordot", "tensorflow.matmul", "tensorflow.ones_like", "tensorflow.zeros_like", "numpy.cos", "tensorflow.tile", "tensorflow.nn.embedding_lookup", "tensorflow.keras.initializers.glorot_uniform", "tensorflow.cast", "numpy.sin", "tensorflow.shape", "tenso...
Micheal-Nguyen/reddit-stock-scraper
[ "779e2e463fab38567c3bb3c29b21665f7b0a0edd" ]
[ "reddit-stock-scraper.py" ]
[ "#! python3\nimport praw\nimport pandas as pd\nimport configparser\n\ndef scrape(name):\n config = configparser.ConfigParser()\n config.read(\"config.ini\")\n client_id = config.get(\"reddit\", \"client_id\")\n client_secret = config.get(\"reddit\", \"client_secret\")\n user_agent = config.get(\"redd...
[ [ "pandas.DataFrame" ] ]
llucid-97/FastDeepQLearning
[ "023d617ad86477763e424fd09fb496571083c50c" ]
[ "franQ/Env/classic_control_goal/classic_goal.py" ]
[ "from collections import OrderedDict\nimport typing as T\n\nimport numpy as np\nimport gym\n\nspaces = gym.spaces\nfrom franQ.Env import wrappers\nfrom franQ.Env.conf import EnvConf\n\n\nclass ClassicGoalEnv(wrappers.Wrapper):\n def __init__(self, conf: EnvConf):\n tasks = {\n \"CartPole-v1\": ...
[ [ "numpy.zeros_like", "numpy.array", "numpy.asarray", "numpy.allclose", "numpy.cos", "numpy.clip", "numpy.all" ] ]
YorkUCVIL/Wavelet-Flow
[ "8d6d63fa116ec44299c32f37e66817594510f644", "8d6d63fa116ec44299c32f37e66817594510f644" ]
[ "src/models/lsun_bedroom_64_haar/Validation_data.py", "src/models/lsun_bedroom_64_haar/Training_data.py" ]
[ "import tensorflow as tf\nimport os\nfrom util import *\n\nclass Validation_data:\n\tdef __init__(self,batch_override=None,shuffle_repeat=True,partial_level=0):\n\t\twith tf.variable_scope(None,default_name='validation_data'):\n\t\t\tself.crop_factor = config.validation.partial_training_crops[partial_level]\n\t\t\t...
[ [ "tensorflow.floor", "tensorflow.shape", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.read_file", "tensorflow.random_uniform", "tensorflow.image.random_crop", "tensorflow.variable_scope", "tensorflow.cast" ], [ "tensorflow.floor", "tensorflow.shape", "te...
SebastianoF/pyro2
[ "9d1787c2ee25d735a414db3da8c00287743a6fde" ]
[ "swe/tests/test_swe.py" ]
[ "import numpy as np\nfrom numpy.testing import assert_array_equal\n\nfrom util import runparams\nimport swe.simulation as sn\n\n\nclass TestSimulation(object):\n @classmethod\n def setup_class(cls):\n \"\"\" this is run once for each class before any tests \"\"\"\n pass\n\n @classmethod\n ...
[ [ "numpy.testing.assert_array_equal", "numpy.sqrt" ] ]
youbaji/outlier
[ "a18daa6bd56015541ba77bb2650f8c4f135a041f" ]
[ "lof/lof.py" ]
[ "import numpy as np\nimport scipy.stats as stats\nfrom scipy.spatial.distance import pdist, squareform\nimport pdb\n\nclass Lof():\n def __init__(self, k):\n self.k = k\n\n def fit(self, data):\n #tree = sp.spatial.KDTree(data)\n distance = squareform(pdist(data))\n indices = stats...
[ [ "numpy.maximum", "numpy.random.random", "scipy.spatial.distance.pdist", "scipy.stats.mstats.rankdata" ] ]
WybeKoper/PASAF
[ "b7052eecb686f50a1988bdb7b1a88a26fc2240b5" ]
[ "data_processing/i_tables.py" ]
[ "import matplotlib.pyplot as plt\nfrom matplotlib.transforms import Bbox\nimport pandas as pd\nfrom adjustText import adjust_text\nimport os\nfrom mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes\nfrom mpl_toolkits.axes_grid1.inset_locator import mark_inset\n\ndef number_of_rescales(taskmanager):\n ...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.set_option" ] ]
GeekLogan/dcimg
[ "066f653a72a52db8cbca804832380d3d61c408f9" ]
[ "tests/test_dcimg.py" ]
[ "import unittest\nfrom ddt import ddt, data\n\nimport numpy as np\n\nfrom dcimg import DCIMGFile\n\n\ntest_vectors = [\n np.index_exp[...],\n np.index_exp[..., -1],\n np.index_exp[:, :, :],\n np.index_exp[..., ::-1],\n np.index_exp[..., ::-1, :],\n np.index_exp[::-1, ...],\n np.index_exp[::-1, ...
[ [ "numpy.array_equal", "numpy.zeros", "numpy.copy", "numpy.prod", "numpy.arange" ] ]
lsst/TS_wep
[ "c2e2b973d5da7e9e522d5490e9b6f94664ec8610", "c2e2b973d5da7e9e522d5490e9b6f94664ec8610" ]
[ "ts_wep/CWFS/makeCornerMasklist.py", "ts_wep/CWFS/interpMaskParam.py" ]
[ "import numpy as np\nfrom rotateMaskParam import rotateMaskParam\ndef makeCornerMasklist(obsR, ca, ra, cb, rb, fldx,fldy):\n\n cax, cay, cbx, cby = rotateMaskParam(ca,cb,fldx,fldy)\n masklist=np.array([[0, 0, 1, 1],[0, 0, obsR, 0],[cax, cay, ra, 1],[cbx, cby, rb, 0]])\n \n return masklist\n", "import ...
[ [ "numpy.array" ], [ "numpy.count_nonzero", "numpy.loadtxt", "numpy.dot", "numpy.sqrt" ] ]
robmarkcole/BERT_as_serverless_service
[ "fbc4004677ae3811b08f89d577b5a45ce0bfbbd0" ]
[ "config.py" ]
[ "import transformers\nimport torch\n\nMAX_LEN = 512\nTRAIN_BATCH_SIZE = 4\nVALID_BATCH_SIZE = 8\nNUM_CLASSES = 5\nDEVICE = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')\n\nEPOCHS = 2\nBERT_PATH = './input/prunebert-base-uncased-6-finepruned-w-distil-squad'\nMODEL_PATH = './model/pytorch...
[ [ "torch.device", "torch.cuda.is_available" ] ]
jheek/flax
[ "f4986e5154aa46b28fb75281ef67318f4f7cc569" ]
[ "examples/seq2seq/train.py" ]
[ "# Lint as: python3\n#\n# Copyright 2020 The Flax 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 require...
[ [ "numpy.array", "numpy.arange" ] ]
EmreOzkose/k2
[ "818b138b33eabe440601df8910a2b97ac088594b" ]
[ "k2/python/tests/ctc_loss_test.py" ]
[ "#!/usr/bin/env python3\n#\n# Copyright 2020 Xiaomi Corporation (authors: Fangjun Kuang)\n#\n# See ../../../LICENSE for clarification regarding multiple 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 ma...
[ [ "torch.device", "torch.rand", "torch.rand_like", "torch.arange", "torch.nn.utils.rnn.pad_sequence", "torch.nn.functional.log_softmax", "torch.manual_seed", "torch.cuda.device_count", "torch.cuda.set_device", "torch.cuda.is_available", "torch.tensor", "torch.randint"...
chris48s/arcade
[ "930ecd8be2d47db1f65173c6f1afc00c0df545c8" ]
[ "arcade/sprite_list.py" ]
[ "\"\"\"\nThis module provides functionality to manage Sprites in a list.\n\n\"\"\"\n\nfrom typing import Iterable\nfrom typing import TypeVar\nfrom typing import Generic\nfrom typing import List\nfrom typing import Optional\n\nimport pyglet.gl as gl\n\nimport math\nimport numpy as np\n\nfrom PIL import Image\n\nfro...
[ [ "numpy.array", "numpy.asarray", "numpy.dtype" ] ]
leichtrhino/nsf-torch
[ "1ad4495b476908a50c18ead391a8cd57bc2f4094" ]
[ "test_generate_fake_data.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport librosa\nimport random\nimport torch\nimport numpy as np\n\nfrom math import ceil\nfrom model import NSFModel\n\nsampling_rate = 16000\nframe_length = sampling_rate * 25 // 1000\nframe_shift = sampling_rate * 10 // 1000\n\nbatch_size = 2\nwaveform_length = 16000\ncontext_...
[ [ "numpy.array", "numpy.zeros", "numpy.random.shuffle", "numpy.arange", "torch.tensor", "torch.load", "numpy.expand_dims", "numpy.vstack" ] ]
jpbottaro/anna
[ "e9a8be720cf0f95eb8b02fee469e9ed0c9c3ae6f" ]
[ "anna/model/metrics.py" ]
[ "\"\"\"Tensorflow implementation of metrics for Multi-label Classification.\n\nMetrics: Subset Accuracy, Hamming accuracy, example-based f1, and label-based\n micro/macro f1.\n\nDefinitions from: https://papers.nips.cc/paper/7125-maximizing-subset-accuracy-with-recurrent-neural-networks-in-multi-label-class...
[ [ "tensorflow.python.ops.math_ops.equal", "tensorflow.python.ops.math_ops.divide", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.state_ops.assign_add", "tensorflow.python.ops.math_ops.reduce_sum", "tensorflow.python.ops.array_ops.ones_like", "tensorflow.py...
rainbowbismuth/bird-vision
[ "ea4a54a694be7c46906fcd703cb26d84048319a6" ]
[ "birdvision/quiet.py" ]
[ "\"\"\"\nUtility module to contain any code for any external libraries that get too noisy for my tastes.\n\"\"\"\n\n\ndef silence_tensorflow():\n \"\"\"Silence every warning of notice from tensorflow.\"\"\"\n import tensorflow as tf\n import logging\n import os\n logging.getLogger('tensorflow').setLe...
[ [ "tensorflow.autograph.set_verbosity", "tensorflow.get_logger" ] ]
dabrze/similarity_forest
[ "3d0f0f304b0106a6b2d86e6e84562ef2cb5ee81d" ]
[ "simforest/distance.py" ]
[ "import numpy as np\nfrom scipy.linalg.blas import sgemm\nimport numexpr as ne\nfrom numba import jit\n\n\ndef rbf(X, p, q, gamma=None):\n \"\"\"A function calculating rbf kernel based projection of data-points in matrix X\n X : array of shape=(n_examples, n_features),\n should be 2-dim...
[ [ "numpy.dot" ] ]
ayan-b/xena-GDC-ETL
[ "107fabadd061ea1cbf2f3ec330c4277fed58284c" ]
[ "xena_gdc_etl/main.py" ]
[ "from __future__ import print_function\nimport argparse\nfrom datetime import date\nimport os\nimport pkg_resources\n\nimport pandas as pd\nfrom pandas.util.testing import assert_frame_equal\n\nfrom .utils import handle_merge_xena\nfrom .gdc import gdc_check_new, get_project_info\nfrom .constants import valid_dtype...
[ [ "pandas.read_csv", "pandas.util.testing.assert_frame_equal" ] ]
gawelk/aqua
[ "98ce06289cc6e12d087982cba95a45353ce0cb3b" ]
[ "test/test_initial_state_zero.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2019.\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...
[ [ "numpy.testing.assert_array_equal" ] ]
EricCousineau-TRI/onnxruntime
[ "796948c6aee80df5562c3e1538bb675913946754" ]
[ "onnxruntime/test/python/onnxruntime_test_python_nuphar.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n# -*- coding: UTF-8 -*-\nimport numpy as np\nimport onnx\nfrom onnx import numpy_helper\nimport onnxruntime as onnxrt\nimport os\nfrom onnxruntime.nuphar.rnn_benchmark import perf_test, generate_model\nfrom pathlib im...
[ [ "numpy.concatenate", "numpy.allclose", "numpy.random.randint", "numpy.random.rand" ] ]