repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
sparkingdark/scikit-learn
[ "73e8b7d0a984fac8420cb4f948d53470ef9b5abf" ]
[ "sklearn/utils/tests/test_fixes.py" ]
[ "# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>\n# Justin Vincent\n# Lars Buitinck\n# License: BSD 3 clause\n\nimport math\n\nimport numpy as np\nimport pytest\nimport scipy.stats\n\nfrom sklearn.utils._testing import assert_array_equal\n\nfrom sklearn.utils.fixes import _joblib_paralle...
[ [ "sklearn.utils.fixes.MaskedArray", "numpy.histogram", "numpy.array", "sklearn.utils.fixes.parse_version", "sklearn.utils._testing.assert_array_equal", "sklearn.utils.fixes._joblib_parallel_args", "sklearn.utils.fixes.linspace", "numpy.exp", "sklearn.utils.fixes._object_dtype_is...
matt-graham/differentiable-generator-networks
[ "5dcef70fe73461d56f0b79628aaba2722b09e10c" ]
[ "dgn/invertible_layers.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Invertible density network layer definitions.\"\"\"\n\n__authors__ = 'Matt Graham'\n__license__ = 'MIT'\n\nimport numpy as np\nimport theano as th\nimport theano.tensor as tt\nimport theano.tensor.slinalg as slinalg\nfrom theano_cpu_ops import (\n log_det, lower_triangular_solve, ...
[ [ "numpy.zeros_like", "numpy.ones_like", "numpy.triu", "numpy.eye", "numpy.identity", "numpy.tril" ] ]
aiudirog/pandas
[ "58059c152ccf8a714eb3233f13ed22987eb42b44" ]
[ "pandas/tests/series/methods/test_fillna.py" ]
[ "from datetime import (\n datetime,\n timedelta,\n timezone,\n)\n\nimport numpy as np\nimport pytest\nimport pytz\n\nfrom pandas import (\n Categorical,\n DataFrame,\n DatetimeIndex,\n NaT,\n Period,\n Series,\n Timedelta,\n Timestamp,\n date_range,\n isna,\n)\nimport pandas._...
[ [ "pandas.DatetimeIndex", "pandas.Timestamp", "pandas._testing.assert_series_equal", "pandas._testing.makeDateIndex", "pandas.Timedelta", "pandas.DataFrame", "numpy.arange", "numpy.random.randint", "pandas.Period", "numpy.random.randn", "pandas._testing.assert_frame_equal...
joycenerd/rsna-pneumonia-detection
[ "671c345533461ec497ee6b9cfd52ddcd5c59c942" ]
[ "yolov5/utils/datasets.py" ]
[ "# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\n\"\"\"\nDataloaders and dataset utils\n\"\"\"\n\nimport glob\nimport hashlib\nimport json\nimport os\nimport random\nimport shutil\nimport time\nfrom itertools import repeat\nfrom multiprocessing.pool import Pool, ThreadPool\nfrom pathlib import Path\nfrom threading imp...
[ [ "torch.cat", "torch.stack", "numpy.load", "numpy.concatenate", "numpy.full", "numpy.save", "numpy.flipud", "torch.tensor", "numpy.arange", "torch.zeros", "numpy.array", "numpy.zeros", "numpy.stack", "numpy.clip", "numpy.fliplr", "numpy.ascontiguousar...
EsdeathYZH/oneflow
[ "963cc01bd8dfcae2043a565d9ff1305aa70bb325" ]
[ "python/oneflow/test/modules/test_slice.py" ]
[ "\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap...
[ [ "numpy.array", "numpy.ones", "numpy.random.randn", "numpy.zeros" ] ]
lachieggg/PyDataScienceNotes
[ "551edcbdc326d2feb2a1f93d3f3ea335d87ca983" ]
[ "pca.py" ]
[ "# Code for PCA\n#\n\nfrom sklearn.datasets import load_iris\nfrom sklearn.decomposition import PCA\nimport pylab as pl\nfrom itertools import cycle\n\n# Load in the famed Iris dataset \niris = load_iris()\n\nnumSamples, numFeatures = iris.data.shape\n# Print the data so we have an intuition about\n# what we are lo...
[ [ "sklearn.decomposition.PCA", "sklearn.datasets.load_iris" ] ]
XYPB/myMaskRCNN-mxnet
[ "88a626b783cee9d8c1b4a6d54a53b95a9ed4a2eb" ]
[ "symnet/proposal_target.py" ]
[ "\"\"\"\nProposal Target Operator selects foreground and background roi and assigns label, bbox_transform to them.\n\"\"\"\n\nimport mxnet as mx\nimport numpy as np\n\nfrom symdata.bbox import bbox_overlaps, bbox_transform\n\n\ndef sample_rois(rois, gt_boxes, num_classes, rois_per_image, fg_rois_per_image, fg_overl...
[ [ "numpy.empty", "numpy.random.choice", "numpy.zeros", "numpy.ones", "numpy.where", "numpy.append", "numpy.hstack", "numpy.fromstring", "numpy.vstack" ] ]
eordanis/CIS-700
[ "4f5977ca2bc55c8995d034774b4340351f25c24d" ]
[ "models/gsgan/GsganDiscriminator.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.ops import control_flow_ops\n\n\nclass Discriminator():\n def __init__(self, embedding_size, vocab_size, non_static, hidden_unit, sequence_length, batch_size,\n num_classes, filter_sizes, num_filters, l2_reg_lambda=0.0, start_to...
[ [ "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.trainable_variables", "tensorflow.compat.v1.constant", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.name_scope", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.compat.v1.gradients", "tensorflow.compat.v1.uns...
fumiyo0607/ETM
[ "c9525d11491f9a4b86d2a0dc1231e6a0aef58c7c" ]
[ "main.py" ]
[ "#/usr/bin/python\n\nfrom __future__ import print_function\n\nimport argparse\nimport torch\nimport pickle \nimport numpy as np \nimport os \nimport math \nimport random \nimport sys\nimport matplotlib.pyplot as plt \nimport data\nimport scipy.io\nimport pandas as pd\n\nfrom torch import nn, optim\nfrom torch.nn im...
[ [ "torch.cuda.manual_seed", "numpy.random.choice", "torch.randperm", "torch.cuda.is_available", "torch.load", "torch.sum", "numpy.random.normal", "pandas.DataFrame", "torch.manual_seed", "torch.zeros", "torch.device", "numpy.array", "numpy.zeros", "torch.save"...
snailfrying/nlp_cv_recommendation_papers
[ "03d1c048ebb2ea1487aa8eaf344c4b1c1474bff9" ]
[ "cv_papers/ResNet/ResNetXt.py" ]
[ "# -*- coding: utf-8 -*-\n# @File : ResNetXt.py\n# @Author: snailfrying\n# @Time : 2021/9/22 10:30\n# @Software: PyCharm\n\nimport numpy as np\n\nfrom tensorflow import keras\nfrom tensorflow.keras import layers, utils, regularizers\nfrom tensorflow.python.keras import backend\nfrom tensorflow.keras.preprocessing i...
[ [ "tensorflow.python.keras.backend.image_data_format", "tensorflow.keras.utils.to_categorical", "numpy.array", "tensorflow.keras.layers.add", "tensorflow.python.keras.engine.training.Model", "tensorflow.keras.layers.Activation", "tensorflow.keras.preprocessing.image.smart_resize", "t...
hhuuggoo/pandas
[ "f87ab95c2ecd1be6a3e3acec8f5d81e7f3c8e4bd" ]
[ "pandas/core/generic.py" ]
[ "# pylint: disable=W0231,E1101\nimport warnings\nimport operator\nimport weakref\nimport gc\nimport numpy as np\nimport pandas.lib as lib\n\nimport pandas as pd\nfrom pandas.core.base import PandasObject\nfrom pandas.core.index import (Index, MultiIndex, _ensure_index,\n InvalidIndexEr...
[ [ "pandas.core.common.is_re_compilable", "pandas.core.datetools.to_offset", "pandas.core.common._values_from_object", "pandas.io.pickle.to_pickle", "pandas.core.common._ensure_int64", "pandas.io.pytables.to_hdf", "pandas.core.common._clean_fill_method", "pandas.core.indexing.get_inde...
bassio/omicexperiment
[ "323de49bb528e91658b38ed748a47c062e371048" ]
[ "omicexperiment/experiment/experiment.py" ]
[ "import types\nimport functools\nfrom collections import OrderedDict\nimport numpy as np\nfrom pandas import Series, DataFrame\nfrom omicexperiment.transforms import proxy\nfrom omicexperiment.plotting.plot_pygal import plot_table, return_plot, return_plot_tree, plot_to_file\nfrom omicexperiment.plotting.groups imp...
[ [ "pandas.DataFrame" ] ]
endremborza/parquetranger
[ "993845c78b6d8948f02bd259db08f63c3004a99e" ]
[ "parquetranger/tests/test_diff_cols.py" ]
[ "import pandas as pd\nimport pytest\n\nfrom parquetranger import TableRepo\n\n\n@pytest.mark.parametrize(\n [\"indices\"],\n [\n (None,),\n (pd.Series([1, 2], name=\"fing\"),),\n (pd.MultiIndex.from_product([[\"A\", \"C\"], [1]], names=[\"ix\", \"iy\"]),),\n ],\n)\ndef test_diff_cols(t...
[ [ "pandas.DataFrame", "pandas.MultiIndex.from_product", "pandas.Series" ] ]
dekura/OpenPCDet
[ "5ee5bebcba78615ad07db81dbd7968a625066213" ]
[ "pcdet/datasets/augmentor/database_sampler.py" ]
[ "import pickle\n\nimport numpy as np\n\nfrom ...ops.iou3d_nms import iou3d_nms_utils\nfrom ...utils import box_utils\n\n\nclass DataBaseSampler(object):\n def __init__(self, root_path, sampler_cfg, class_names, logger=None):\n self.root_path = root_path\n self.class_names = class_names\n sel...
[ [ "numpy.concatenate", "numpy.sum", "numpy.array", "numpy.stack" ] ]
vipulsinghal02/starfish
[ "c3d347954ad40a7a4be9a50d89974f5fbbc2919d" ]
[ "starfish/test/image/test_imagestack.py" ]
[ "import numpy as np\nimport pytest\n\nfrom starfish.imagestack.imagestack import ImageStack\nfrom starfish.intensity_table import IntensityTable\n# don't inspect pytest fixtures in pycharm\n# noinspection PyUnresolvedReferences\nfrom starfish.test.dataset_fixtures import ( # noqa: F401\n codebook_intensities_im...
[ [ "numpy.full", "numpy.array", "numpy.empty", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.diff", "numpy.where", "numpy.empty_like" ] ]
Phimos/PKU-Pattern-Recognition-2021-Fall
[ "be2c59710ec956437d237c306a5fe74b15f6618d" ]
[ "plot.py" ]
[ "# %%\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nx = np.arange(-1, 5, 0.01)\nfx = 1 * np.abs(x - 0) - 1 * np.abs(x-3) + 1 * np.abs(x - 4)\nplt.plot(x, fx)\nplt.title(\"$f(x)$\")\n\nplt.savefig(\"plot.png\", dpi=300)\n\n# %%\n\nx = np.arange(-1, 5, 0.01)\nb1x = -1/24 * np.abs(x - 0) + 1/6 * np.abs(x-3) ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.arange", "numpy.abs" ] ]
vinhtruongtrong/aspect-based-sentiment-analysis-for-vietnamese-text-using-bert
[ "f4908e6a47dd176671b38d58cb49f189b6f9bc45" ]
[ "run_classifier_TABSA.py" ]
[ "# coding=utf-8\n\n\"\"\"BERT finetuning runner.\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport argparse\nimport collections\nimport logging\nimport os\nimport random\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader, T...
[ [ "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel", "torch.utils.data.sampler.RandomSampler", "torch.distributed.init_process_group", "torch.manual_seed", "torch.tensor", "torch.utils.data.DataLoader", "numpy.argmax", "torch.device", "torch.cuda.manual_see...
francotheengineer/autokeras
[ "eac91bad8a90f78a68933992cc1ff4b7df4ee30f" ]
[ "autokeras/pretrained/voice_generator/voice_generator.py" ]
[ "import os\n\nimport numpy as np\nimport torch\nimport lws\nfrom scipy import signal\n\nfrom autokeras.pretrained.base import Pretrained\nfrom autokeras.constant import Constant\nfrom autokeras.utils import temp_path_generator, ensure_dir, get_device\nimport librosa\n\nfrom autokeras.pretrained.voice_generator.deep...
[ [ "numpy.array", "torch.no_grad", "torch.from_numpy", "scipy.signal.lfilter", "numpy.power", "torch.load", "numpy.clip", "torch.LongTensor" ] ]
konsan1101/py-etc
[ "687061ce09889ec91c1c3c11df62f4cfcb3d9613" ]
[ "flask6_all/_v5_proc_camera.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# COPYRIGHT (C) 2014-2020 Mitsuo KONDOU.\n# This software is released under the MIT License.\n# https://github.com/konsan1101\n# Thank you for keeping the rules.\n\n\n\nimport sys\nimport os\nimport time\nimport datetime\nimport codecs\nimport glob\n\nimport queue\...
[ [ "numpy.array", "numpy.zeros", "numpy.mean", "numpy.float32", "numpy.append" ] ]
vishalbelsare/FinMind
[ "bf57f8e68adc0583495b29135a91e47515cf4cf1" ]
[ "FinMind/strategies/short_sale_margin_purchase_ratio.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom FinMind.data import DataLoader\nfrom FinMind.schema.data import Dataset\nfrom FinMind.strategies.base import Strategy, Trader\n\n\nclass ShortSaleMarginPurchaseRatio(Strategy):\n \"\"\"\n url: \"https://blog.above.tw/2018/08/15/%E7%B1%8C%E7%A2%BC%E9%9D%A2%E7%9A...
[ [ "pandas.merge" ] ]
nicolas-harraudeau-sonarsource/tensorflow
[ "f42f57b814b82a217943f621967036a08bb95e88" ]
[ "tensorflow/python/compiler/tensorrt/trt_convert.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.core.protobuf.config_pb2.ConfigProto", "tensorflow.python.ops.gen_resource_variable_ops.destroy_resource_op", "tensorflow.python.framework.ops.get_collection_proto_type", "tensorflow.python.framework.ops.get_from_proto_function", "tensorflow.python.framework.ops.get_default_graph",...
amezqui3/vitaminC_morphology
[ "c2a59ce83248bbc6966dd63532cb466192ce0600" ]
[ "jupyter/mvee.py" ]
[ "from mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport sys\nimport numpy as np\n\nclass EllipsoidTool:\n \"\"\"Some stuff for playing with ellipsoids\n\n Taken from:\n https://github.com/minillinim/ellipsoid\n \"\"\"\n def __init__(self): pass\n\n def getMinVolEl...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.sin", "numpy.ones_like", "numpy.copy", "numpy.ones", "numpy.linalg.inv", "numpy.shape", "matplotlib.pyplot.figure", "numpy.argmax", "numpy.linalg.svd", "numpy.sqrt", "numpy.cos", "numpy.linspace", ...
ionuttamas/Theano-PyMC
[ "b666bdbb35aec21ac83936bfc91c573ef5ccf741" ]
[ "theano/scan/basic.py" ]
[ "__docformat__ = \"restructedtext en\"\n__authors__ = \"Razvan Pascanu \" \"Frederic Bastien \" \"James Bergstra \" \"Pascal Lamblin \"\n__copyright__ = \"(c) 2010, Universite de Montreal\"\n__contact__ = \"Razvan Pascanu <r.pascanu@gmail>\"\n\n\nimport logging\nfrom collections import OrderedDict\n\nimport numpy a...
[ [ "numpy.max", "numpy.min" ] ]
Bstuart77/OBG-Clone
[ "94faafbe6c0e8b7c094b3d71dc4c7b58ab2582dc" ]
[ "examples/lsc/mag240m/preprocess_sgc.py" ]
[ "# NOTE: 128-256GB CPU memory required to run this script.\n\nimport os\nimport time\nimport argparse\nimport os.path as osp\nfrom tqdm import tqdm\n\nimport torch\nimport numpy as np\nfrom torch_sparse import SparseTensor\nfrom torch_geometric.nn.conv.gcn_conv import gcn_norm\nfrom ogb.lsc import MAG240MDataset\nf...
[ [ "numpy.concatenate", "torch.save", "numpy.load", "numpy.save", "torch.from_numpy", "torch.load" ] ]
MeltingCake/acai
[ "9627e55ff63aa3086deea4205258f5a4335ecae0" ]
[ "create_datasets.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.concatenate", "tensorflow.train.BytesList", "tensorflow.train.Int64List", "tensorflow.train.Features", "tensorflow.Session", "tensorflow.python_io.TFRecordWriter", "tensorflow.placeholder", "numpy.transpose", "tensorflow.device", "tensorflow.image.encode_png", "n...
neilfrndes/predictive-maintenance
[ "81026ad8658a595766ea5f8ba09153773431570b" ]
[ "src/run.py" ]
[ "# To add a new cell, type ''\n# To add a new markdown cell, type ' [markdown]'\n\nimport logging\nfrom timeit import default_timer as timer\n\nimport keras\nimport numpy as np\nimport pandas as pd\nfrom keras.layers import LSTM, Dense, Dropout\nfrom keras.models import Sequential\nfrom sklearn import preprocessing...
[ [ "numpy.concatenate", "sklearn.metrics.confusion_matrix", "numpy.asarray", "numpy.random.seed", "sklearn.metrics.precision_score", "numpy.where", "sklearn.preprocessing.MinMaxScaler", "pandas.read_csv", "sklearn.metrics.recall_score" ] ]
arahman010/MLlearningUd
[ "4c665ed5476733d921500a23962fd2020b604a95" ]
[ "svm/svm_author_id.py" ]
[ "#!/usr/bin/python\n\n\"\"\" \n This is the code to accompany the Lesson 2 (SVM) mini-project.\n\n Use a SVM to identify emails from the Enron corpus by their authors: \n Sara has label 0\n Chris has label 1\n\"\"\"\n \nimport sys\nfrom time import time\nsys.path.append(\"../tools/\")\nfrom email_...
[ [ "numpy.count_nonzero", "sklearn.svm.SVC" ] ]
mthrok/audio
[ "e7ea820eecb12aa9cdb7f72322a0ec9d99fd6974" ]
[ "examples/tutorials/audio_feature_augmentation_tutorial.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nAudio Feature Augmentation\n==========================\n\"\"\"\n\n# When running this tutorial in Google Colab, install the required packages\n# with the following.\n# !pip install torchaudio librosa\n\nimport torch\nimport torchaudio\nimport torchaudio.transforms as T\n\nprint(tor...
[ [ "torch.random.manual_seed", "matplotlib.pyplot.show", "torch.abs", "matplotlib.pyplot.subplots" ] ]
Frank-Star-fn/transformers
[ "d1fcc90abf34cc498c8a65a717ad0d9354ceca97" ]
[ "tests/unispeech/test_modeling_unispeech.py" ]
[ "# coding=utf-8\n# Copyright 2021 The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2....
[ [ "torch.cosine_similarity", "torch.no_grad", "torch.ones", "torch.manual_seed", "torch.tensor", "torch.isinf", "torch.ones_like", "numpy.random.random", "torch.allclose" ] ]
Pankajd007/ML-Algortihm-for-Supervised-Learning
[ "d804e7eeace1e5187b156b2fa3e71125b2a3448a" ]
[ "Decision Tree Regressor/decision_tree_regression.py" ]
[ "# Decision Tree Regression\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('Position_Salaries.csv')\nX = dataset.iloc[:, 1:2].values\ny = dataset.iloc[:, 2].values\n\n# Splitting the dataset into the Training s...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "sklearn.tree.DecisionTreeRegressor", "matplotlib.pyplot.scatter", "pandas.read_csv" ] ]
Jabi7/QPD
[ "7afdb253963ff566705a239a3a4202282ac3b826" ]
[ "QGT.py" ]
[ "import numpy as np\nfrom math import *\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits import mplot3d\nfrom tabulate import tabulate\n\n\n\nC = np.array([1,0])\nD = np.array([0,1])\n\nCC = np.kron(C,C)\nDD = np.kron(D,D)\n\n\n# To find conjugate transpose\ndef H(j):\n return j.conjugate().T \n\n# Entanglem...
[ [ "numpy.array", "numpy.matmul", "numpy.zeros", "numpy.exp", "numpy.outer", "numpy.kron" ] ]
mkelley/comadyn
[ "7a75908bd58172fc95e076a8ce788a94cf26011e" ]
[ "comadyn/scalers.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\"\"\"scalers --- Parameter scale factors\n======================================\n\nScalers create parameter scale factors. They may depend on particle\nparameters, such as size, heliocentric distance, etc.\n\nScalers may be chained together usin...
[ [ "numpy.array", "numpy.ones_like", "numpy.iterable", "numpy.zeros_like", "numpy.dot", "numpy.median", "numpy.sum", "scipy.interpolate.splrep", "numpy.exp", "numpy.sqrt", "numpy.cos", "scipy.integrate.quad", "numpy.array2string" ] ]
boyentenbi/jax
[ "3a9ce3990eb0c7a271dc5a37e6f2c30306d7f3fa" ]
[ "jax/experimental/jax2tf/tests/shape_poly_test.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.TensorSpec", "numpy.array", "numpy.random.rand", "tensorflow.GradientTape", "numpy.ones", "tensorflow.Variable", "numpy.float_", "tensorflow.function", "numpy.stack", "numpy.arange", "numpy.prod" ] ]
jogvanb/sdg-faroese-translation
[ "d21278ae0b0c5845f40137bb75cdf01eb931f64f" ]
[ "scripts/export_translation_file.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nExport all translation keys to a CSV file for easy translation.\n\"\"\"\n\nimport os\nimport yaml\nimport pandas as pd\nimport csv\nimport sys\n\n# Decide if we actually want to export a particular key.\ndef should_we_omit_key(key, language):\n\n # Ignore keys that start with an...
[ [ "pandas.io.json.json_normalize" ] ]
gauravb12/Dos-Attack-Detection-using-Machine-Learning
[ "5ccaa2796c016c85a6f579ee6862078817e434f1" ]
[ "Dataset.py" ]
[ "import sklearn\nimport numpy as np\nfrom utils.LogHelper import Logs\nfrom utils.DateUtil import get_microseconds\nfrom utils.Anomaly import Anomaly\nfrom sklearn import preprocessing\n\n\nclass Dataset:\n\n def __init__(self):\n\n self.logs = Logs().read()\n self.client_ip_label_encoder = preproc...
[ [ "sklearn.preprocessing.LabelEncoder" ] ]
aouedions11/flower
[ "70bfbcfab2fedff1abf7a59a5539621cfc1adcc1" ]
[ "examples/pytorch_from_centralized_to_federated/cifar.py" ]
[ "\"\"\"PyTorch CIFAR-10 image classification.\n\nThe code is generally adapted from 'PyTorch: A 60 Minute Blitz'. Further\nexplanations are given in the official PyTorch tutorial:\n\nhttps://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html\n\"\"\"\n\n\n# mypy: ignore-errors\n# pylint: disable=W0223\n\n\nf...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.max", "torch.no_grad", "torch.nn.Conv2d", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.CrossEntropyLoss" ] ]
zampie/male-female-transfer
[ "6f72a2c2fb4df2c7669723dd27c192a594ffe4e6" ]
[ "inference_my_m.py" ]
[ "\"\"\"Translate an image to another image\nAn example of command-line usage is:\npython export_graph.py --model pretrained/apple2orange.pb \\\n --input input_sample.jpg \\\n --output output_sample.jpg \\\n --image_size 256\n\"\"\"\n\nimport tensorfl...
[ [ "tensorflow.Graph", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.GraphDef", "tensorflow.gfile.FastGFile", "tensorflow.app.run", "tensorflow.image.resize_images", "tensorflow.image.decode_jpeg" ] ]
isabelaconstantin/wikinet
[ "d12ac15d494c65502c8e2ec8165351fefa676282" ]
[ "milestone1/sparse.py" ]
[ "from scipy import sparse\nimport time\n\nstart = time.perf_counter()\nAs = sparse.csr_matrix(adjacency_undirected)\nAs = As*As*As\nAd = np.empty(adjacency_undirected.shape, dtype=adjacency_undirected.dtype)\nAs.todense(out=Ad)\nprint(time.perf_counter() - start)\n\nstart = time.perf_counter()\nadjacency_undirected...
[ [ "scipy.sparse.csr_matrix" ] ]
jiwidi/lightning-tutorials
[ "70ba437447f345d4d6ba089d5b30fd1da2cbc04b" ]
[ "lightning_examples/mnist-hello-world/hello-world.py" ]
[ "# %%\nimport os\n\nimport torch\nfrom pytorch_lightning import LightningModule, Trainer\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader, random_split\nfrom torchmetrics import Accuracy\nfrom torchvision import transforms\nfrom torchvision.datasets import MNIST\n...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.utils.data.random_split", "torch.nn.functional.log_softmax", "torch.cuda.device_count", "torch.nn.ReLU", "torch.utils.data.DataLoader", "torch.nn.functional.nll_loss", "torch.argmax", "torch.nn.Flatten" ] ]
hrc2da/armtui
[ "316c20fba975c2456e4a19162a66d431f97d20cb" ]
[ "SimpleHTR/wordnet/eval.py" ]
[ "import argparse\nfrom collections import namedtuple\n\nimport numpy as np\nimport torch\nfrom path import Path\n\nfrom wordnet.aabb import AABB\nfrom wordnet.aabb_clustering import cluster_aabbs\nfrom wordnet.coding import decode, fg_by_cc\nfrom wordnet.dataloader import DataLoaderIAM\nfrom wordnet.dataset import ...
[ [ "numpy.sum", "numpy.count_nonzero", "torch.no_grad", "torch.load" ] ]
yotam/numpy
[ "d61ee81e0220318ebe9404f0381c7fdfe189f647" ]
[ "numpy/lib/tests/test_io.py" ]
[ "from __future__ import division, absolute_import, print_function\n\nimport sys\nimport gzip\nimport os\nimport threading\nfrom tempfile import mkstemp, NamedTemporaryFile\nimport time\nimport warnings\nimport gc\nfrom io import BytesIO\nfrom datetime import datetime\n\nimport numpy as np\nimport numpy.ma as ma\nfr...
[ [ "numpy.ma.testutils.assert_array_equal", "numpy.genfromtxt", "numpy.load", "numpy.asfortranarray", "numpy.ma.testutils.assert_raises_regex", "numpy.random.random", "numpy.mafromtxt", "numpy.dtype", "numpy.empty", "numpy.testing.assert_warns", "numpy.testing.dec.skipif",...
tanujdhiman/ReAgent
[ "0a085ebdf088b75dcac1839344d2fa2b37fc638b" ]
[ "reagent/gym/tests/test_gym.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\nimport logging\nimport os\nimport pprint\nimport unittest\nimport uuid\nfrom typing import Optional\n\nimport numpy as np\nimport pytest\nimport pytorch_lightning as pl\nimport torch\nfrom parameterized import paramete...
[ [ "numpy.max", "torch.device", "numpy.array", "numpy.mean", "torch.cuda.is_available", "torch.utils.data.DataLoader" ] ]
tianjuchen/neml
[ "61ca3dcefcfb20c3f4405ca0ca2117a5414ca933" ]
[ "examples/rate_independent.py" ]
[ "#!/usr/bin/env python3\n\nimport sys\nsys.path.append('..')\n\nfrom neml import solvers, models, elasticity, drivers, surfaces, hardening, ri_flow\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nif __name__ == \"__main__\":\n E = 200000.0\n nu = 0.27\n\n mu = E / (2 * (1.0 + nu))\n K = E / (3 * (1 - ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.logspace" ] ]
packtprasadr/Machine-Learning-Algorithms
[ "06c1d79fd036f32d28261f9a792f6206767717a7" ]
[ "Chapter09/3spectral_clustering_2.py" ]
[ "from __future__ import print_function\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nfrom sklearn.datasets import make_moons\r\nfrom sklearn.cluster import SpectralClustering\r\n\r\n\r\n# For reproducibility\r\nnp.random.seed(1000)\r\n\r\nnb_samples = 1000\r\n\r\n\r\nif __name__ == '__main__':...
[ [ "sklearn.cluster.SpectralClustering", "numpy.random.seed", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.linspace", "sklearn.datasets.make_moons" ] ]
Darkhunter9/EBSD_CVAE_GAN_Public
[ "58d77a9cf419d450203b5af30301330ce6534694" ]
[ "utils/data_generator_av.py" ]
[ "\"\"\"\nCopyright (c) 2019-2022, Zihao Ding/Carnegie Mellon University\nAll rights reserved.\n********************************************************************\n\nProject: data_generator_av.py\n\nMODULE: util\n\nAuthor: Zihao Ding, Carnegie Mellon University\n\nBrief:\n-------------\nData generator including mu...
[ [ "numpy.concatenate", "numpy.array", "numpy.nan_to_num", "numpy.sort", "sklearn.utils.shuffle" ] ]
prasathlab/basenji
[ "d61389dc553aa610544503a3e937c1b53906fe35" ]
[ "bin/saluki_ism_tfr_folds.py" ]
[ "#!/usr/bin/env python\n# Copyright 2020 Calico LLC\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# https://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by appli...
[ [ "numpy.array" ] ]
SCGTall/CS6384ComputerVision
[ "f9b911d4230d65336555291a9d72f07f6aadcfe9" ]
[ "Codes/Project1/HandIn/lab_histeq.py" ]
[ "# -*- coding: utf-8 -*-\nimport cv2\nimport numpy as np\nimport sys\nfrom myModules import check_range\n\n# read arguments\nif(len(sys.argv) != 7) :\n print(sys.argv[0], \": takes 6 arguments. Not \", len(sys.argv)-1)\n print(\"Expecting arguments: w1 h1 w2 h2 ImageIn ImageOut.\")\n print(\"Example:\", sy...
[ [ "numpy.copy" ] ]
r0cketr1kky/einsteinpy
[ "d86f412736a42e2cf688a1e21d7b553868a14bc4" ]
[ "src/einsteinpy/plotting/senile/geodesics_scatter.py" ]
[ "import astropy.units as u\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.animation import FuncAnimation\n\nfrom einsteinpy.bodies import Body\nfrom einsteinpy.geodesic import Geodesic\nfrom einsteinpy.metric import Schwarzschild\n\n\nclass ScatterGeodesicPlotter:\n \"\"\"\n Class for p...
[ [ "numpy.sin", "matplotlib.pyplot.xlim", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.cos", "matplotlib.pyplot.scatter", "numpy.vstack" ] ]
bluemarlin2018/Kaggle_Challenges
[ "606a887754e8c50923aa3b117ae997bd74e99223" ]
[ "02_Cat_vs_Dog/test_utils.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport os\nimport numpy as np\nimport pandas as pd\n\nimport tensorflow as tf\nfrom tensorflow.keras.preprocessing import image\nfrom tensorflow.keras import layers,models\n\n\n#Load model from checkpoint in folder model/\ndef load_model(checkpoint):\n model = ...
[ [ "tensorflow.keras.preprocessing.image.load_img", "tensorflow.keras.models.load_model", "tensorflow.keras.preprocessing.image.img_to_array", "numpy.vstack", "numpy.expand_dims" ] ]
tim885/DeepDepthRefiner
[ "055380e99f94206b5a098debca6c93aa274f9d29" ]
[ "testing.py" ]
[ "import argparse\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader\nimport torch.optim as optim\nimport os\nfrom tqdm import tqdm\nfrom PIL import Image\n\nimport matplotlib\nmatplotlib.use('agg') # use matplotlib without GUI support\nimport matplotlib.pyplot as plt\n\nfrom lib.models.unet...
[ [ "matplotlib.use", "numpy.zeros", "matplotlib.pyplot.imsave", "torch.no_grad", "numpy.nanmean", "torch.utils.data.DataLoader" ] ]
sybitetechnologies/c-bot
[ "1f759e346170e031fa4307307f089e26fd7dd7a4" ]
[ "bot/hardware/complex_hardware/generic_blocks.py" ]
[ "import cv2\nimport numpy as np\nimport sys\nimport os\nfrom math import sin,cos,pi,copysign,tan,sqrt,hypot\n\nAREA_THRESHOLD=500\n\nFOV=59\n\nBLOCK=1.5 \n\n\n#Finds the blocks\ndef internal_find_blocks(img):\n hsv = cv2.cvtColor(img, cv2.cv.CV_BGR2HSV)\n\n hsv[:,:,1] = 255\n hsv[:,:,2] = 255\n\n \n ...
[ [ "numpy.int0", "numpy.reshape", "numpy.shape" ] ]
giulio93/NeuralNetwork-Viterbi
[ "45a20cc85ac600bac15c1e218c1b1bf474aaeb5f" ]
[ "utils/length_model.py" ]
[ "#!/usr/bin/python2.7\n\nimport numpy as np\n\n\nclass LengthModel(object):\n \n def n_classes(self):\n return 0\n\n def score(self, length, label):\n return 0.0\n\n def max_length(self):\n return np.inf\n\n\nclass PoissonModel(LengthModel):\n \n def __init__(self, model, max_...
[ [ "numpy.log", "numpy.loadtxt", "numpy.zeros", "numpy.round" ] ]
mcuntz/partialwrap
[ "e6536aef443f34e0bb62b1a4d73d00d0d8d73853" ]
[ "tests/rastrigin2.py" ]
[ "# Rastrigin function a=10, b=2*pi\nimport numpy as np\ndef rastrigin1(x):\n return 10.*len(x) + np.sum(x**2 - 10.*np.cos(2.*np.pi*x))\n\n# read parameters\nwith open('params.txt', 'r') as fi:\n pdict = {}\n for line in fi:\n ll = line.split()\n if (len(ll) == 0) or ll[0].startswith('#'):\n ...
[ [ "numpy.cos" ] ]
LWhite027/PaddleBox
[ "311b3b44fc7d51d4d66d90ab8a3fc0d42231afda" ]
[ "python/paddle/fluid/tests/unittests/test_fleet_base_single.py" ]
[ "# Copyright (c) 2020 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.random", "numpy.random.randint" ] ]
nasa/pretrained-microscopy-models
[ "c64ada1332a6eec842246c9a0250e9e0136f3818" ]
[ "pretrained_microscopy_models/losses.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\n\nclass DiceBCELoss(nn.Module):\n def __init__(self, weight=None, size_average=True):\n super(DiceBCELoss, self).__init__()\n self.weight = weight\n self.__name__ = 'DiceBCELoss'\n\n def forward(self, inputs, targets, smooth=1):\n ...
[ [ "torch.nn.functional.sigmoid", "torch.nn.functional.binary_cross_entropy" ] ]
lily-x/PAWS-public
[ "32f79d10a1187686f301be447de9f4d0e83cf127" ]
[ "planning/planning/src/Cluster.py" ]
[ "# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>, Brian Cheung\n# License: BSD 3 clause\n\nimport time\n\nimport numpy as np\nimport scipy as sp\nimport matplotlib.pyplot as plt\n\nfrom sklearn.feature_extraction import image\nfrom sklearn.cluster import spectral_clustering\n\n\ndef cluster(face):\n # C...
[ [ "sklearn.cluster.spectral_clustering", "matplotlib.pyplot.title", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "sklearn.feature_extraction.image.img_to_graph", "matplotlib.pyplot.contour", "matplotlib.pyplot.xticks", "matplotlib.pyplot.imsho...
giacomov/astromodels
[ "bfad6993465df66d9c071c00d6e0c747266bd3a7" ]
[ "astromodels/tests/test_point_source.py" ]
[ "from __future__ import division, print_function\n\nimport astropy.units as u\nimport numpy as np\nimport numpy.testing as npt\nimport pytest\n\nfrom astromodels.core.spectral_component import SpectralComponent\nfrom astromodels.functions import (Band, Blackbody, Exponential_cutoff,\n ...
[ [ "numpy.all", "numpy.array", "numpy.logspace" ] ]
soma2000-lang/tensorflow-image-models
[ "2e290cedb3ea944d0fa4ec0c77a3d7c72d8eaf6c" ]
[ "tests/test_architectures.py" ]
[ "import os\n\nimport numpy as np\nimport pytest\nimport tensorflow as tf\nimport timm\nimport torch\n\nfrom tfimm import create_model, list_models\nfrom tfimm.utils.timm import load_pytorch_weights_in_tf2_model\n\n# Exclude models that cause specific test failures\nif \"GITHUB_ACTIONS\" in os.environ: # and 'Linux...
[ [ "tensorflow.keras.mixed_precision.set_global_policy", "tensorflow.ones", "numpy.random.default_rng", "tensorflow.keras.backend.clear_session", "numpy.abs", "tensorflow.reduce_mean" ] ]
f-koehler/compsens
[ "1cdcc37ce63b3b242cfef4fd16e98f4464913dbc" ]
[ "compsens/common.py" ]
[ "import numpy\n\n\ndef check_sanity(t, w_min, w_max):\n dt = compute_dt(t)\n t_final = max(t)\n\n dt_required = 2 * numpy.pi / (3 * w_max)\n t_final_required = 2 * numpy.pi / w_min\n\n # check temporal resolution\n if dt >= dt_required:\n raise ValueError(\"temporal spacing too large: dt={}...
[ [ "numpy.sin", "numpy.copy", "numpy.diff", "numpy.arange", "numpy.cos", "numpy.unique" ] ]
moonson619/AI4Water-1
[ "285d46824502b6a787e42570b72432f4f6acf45e" ]
[ "tests/test_postprocessing/test_SeqMetrics/test_regression.py" ]
[ "import os\nimport unittest\nimport site # so that ai4water directory is in path\n\nai4_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nprint('ai4w_dir', ai4_dir)\nsite.addsitedir(ai4_dir)\n\nimport numpy as np\n\nfrom ai4water.postprocessing.SeqMetrics import plot_metrics\nfrom ai4water.postpr...
[ [ "numpy.random.random", "numpy.array" ] ]
Ir1d/kornia
[ "0ed0099a84261a6421f98c65924c746fe933ad74" ]
[ "kornia/color/xyz.py" ]
[ "from typing import Union\n\nimport torch\nimport torch.nn as nn\n\n\nclass RgbToXyz(nn.Module):\n r\"\"\"Converts an image from RGB to XYZ\n\n The image data is assumed to be in the range of (0, 1).\n\n args:\n image (torch.Tensor): RGB image to be converted to XYZ.\n returns:\n torch.Ten...
[ [ "torch.is_tensor", "torch.stack" ] ]
arthurwozniak/CaptchaBreaker
[ "697daa0bc592bf3ac7b4711d821c4387b129b334" ]
[ "captchabreaker/modifier.py" ]
[ "# coding=utf-8\nimport cv2\nimport numpy as np\nimport base64\n\n\ndef split_joined_boxes(image, boxes, count):\n number_of_splits = count - len(boxes)\n minimas = find_minimas(image)\n splits_values = sorted(calculate_boxes_splits(boxes, minimas), key=lambda box: box['cut_value'])\n return map(lambda ...
[ [ "numpy.sum", "numpy.fromstring" ] ]
draxtic/2048-api
[ "70f42a232fd8617b471cfce802d9135dc1ec2bb3" ]
[ "train.py" ]
[ "from game2048.agents import ExpectiMaxAgent as TestAgent\r\nfrom game2048.expectimax import board_to_move\r\nimport numpy as np\r\nimport math\r\nimport keras\r\nimport random\r\nfrom game2048.game import Game\r\nfrom keras.models import Sequential, Model\r\nfrom keras.layers import Dense, Dropout, Flatten,BatchNo...
[ [ "numpy.array", "numpy.reshape", "numpy.expand_dims" ] ]
m-zayan/notebooks
[ "999fdeb4a11a6b673cacb153238ed259608709d4" ]
[ "utils/test_utils/test_plots.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\nfrom ..random import random_indices\nfrom ..plot_utils import grid_plot\n\n__all__ = ['test_grid_plot_mnist']\n\n\ndef test_grid_plot_mnist():\n\n (_, _), (x_test, y_test) = tf.keras.datasets.mnist.load_data()\n\n x_test = x_test[..., None].astype('float32')\n ...
[ [ "numpy.where", "tensorflow.keras.datasets.mnist.load_data", "numpy.random.randint" ] ]
njucjc/machine-learning
[ "1adcbad8d1e9f9a187036bec01d1a5ce798e44e0" ]
[ "Assignment1/main.py" ]
[ "import numpy as np\nimport argparse, os\nfrom utils import load_data, make_path\nfrom pca import pca_train, pca_test\nfrom svd import svd_train, svd_test\nfrom isomap import isomap\nfrom knn import knn\n\nparser = argparse.ArgumentParser(description='Dimensionality Reduction')\n\nparser.add_argument('--mode', type...
[ [ "numpy.array" ] ]
npaj/SilentCities
[ "3526d1716d4d7fa970a692bb8370f7d134fbd09c", "e68735d7a04a101aae2fb8fccac8b5b96c686585" ]
[ "audioset_tagging_cnn/models.py", "analysis.py" ]
[ "### modified from https://github.com/qiuqiangkong/audioset_tagging_cnn\nimport os\nimport sys\nimport math\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.checkpoint as cp\nfrom torch.nn.parameter import P...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.BatchNorm2d", "torch.sum", "torch.sigmoid", "torch.nn.functional.avg_pool2d", "torch.nn.AvgPool1d", "torch.nn.Conv1d", "torch.nn.init.constant_", "torch.nn.AvgPool2d", "torch.max", "torch.nn.Sequential", "torch.nn.functi...
madsbk/veros
[ "00d2c33e28f0bd098a81bd6ac48436067e7eb8f5" ]
[ "veros/setup/wave_propagation/wave_propagation.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport logging\n\nimport numpy as np\nfrom netCDF4 import Dataset\nfrom PIL import Image\nimport scipy.ndimage\n\nimport veros\nimport veros.tools\nimport veros.core.cyclic\n\nBASE_PATH = os.path.dirname(os.path.realpath(__file__))\nDATA_FILES = veros.tools.get_assets(\"wave_pro...
[ [ "numpy.concatenate", "numpy.logical_or", "numpy.sin", "numpy.zeros", "numpy.exp", "numpy.logical_and", "numpy.where", "numpy.arange", "numpy.abs", "numpy.sqrt", "numpy.indices", "numpy.meshgrid", "numpy.maximum" ] ]
JPHaus/finding-donors
[ "acc13d3708b70f698d0f288d86a5c31026754f5a" ]
[ "visuals.py" ]
[ "###########################################\n# Suppress matplotlib user warnings\n# Necessary for newer version of matplotlib\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n#\n# Display inline matplotlib plots with IPython\nfrom IPython import get_ipython\nget_ipython().run_line_magic('matplotlib', 'inline...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.patches.Patch", "numpy.arange", "matplotlib.pyplot.tight_layout",...
facebookresearch/multimodal
[ "13e60d9b4e421d1d5304e861cf4e54c3e376c7f1" ]
[ "torchmultimodal/transforms/text_transforms.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom typing import List, Union\n\nimport torch\nimport torch.nn.functional as F\n\n\nclass PadTransf...
[ [ "torch.nn.functional.pad" ] ]
ishikei14k/atma11_1st_solution
[ "91d29eb83f3e5470f82470f0434ad0fc75a90c61" ]
[ "src/factory.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nimport numpy as np\nimport torch\nfrom torch import nn\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\nimport albumentations as A\nfrom albumentations.pytorch.transforms import ToTensorV2\nfrom dataset.custom_dataset import *\nfrom models.custom_mode...
[ [ "numpy.reshape", "torch.cuda.is_available", "numpy.load", "torch.utils.data.DataLoader" ] ]
ShintaroMinami/PDBBasic
[ "979a6d150d202a24113c60409b717f2417ae9291" ]
[ "pdbbasic/utils.py" ]
[ "import numpy as np\nimport torch\n\ndef unsqueeze(data, dim=0):\n return data.unsqueeze(dim) if torch.is_tensor(data) else np.expand_dims(np.array(data), dim)\n" ]
[ [ "torch.is_tensor", "numpy.array" ] ]
LukasNickel/cta_preprocessing
[ "0db9673a8a08739f70fb370d0f6ed8daa86b26fb" ]
[ "cta_preprocessing/file_processing.py" ]
[ "from .event_processing import event_information\nfrom .event_processing import process_event\nfrom .event_processing import number_of_valid_triggerd_cameras\nfrom ctapipe.io.eventsourcefactory import EventSourceFactory\nfrom ctapipe.io.lsteventsource import LSTEventSource\nfrom ctapipe.calib import CameraCalibrato...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
srio/propagation-free-space
[ "7d6a9c9a3ea50a907ac627a45088004b5a618a28" ]
[ "examples/fresnel_number.py" ]
[ "import numpy\nimport scipy.constants as codata\nfrom srxraylib.plot.gol import plot\nimport matplotlib.pylab as plt\n\n\nenergy = 10000.0\nwavelength = ( codata.h*codata.c/codata.e*1e9 /energy)*10**(-9)\nwindow_size = 5e-6\naperture_diameter = 1.25e-06\npropagation_distance = 75e-6\nN = 2048\n\ndelta = window_siz...
[ [ "numpy.linspace", "matplotlib.pylab.savefig", "matplotlib.pylab.show" ] ]
sangminwoo/evo_ai
[ "509b7113e54424773002067404548b536568cce0" ]
[ "4bit_deceptive/4bit_deceptive.py" ]
[ "import argparse\nimport logging\nimport os\nimport sys\nimport time\nfrom datetime import datetime, timedelta\n\nimport numpy as np\nimport random\nimport matplotlib.pyplot as plt\n\nclass Fourbit:\n\t# Order-4 deceptive problem\n\tdef __init__(self, crossover_algorithm, crossover_prob, crossover_points, mutation_...
[ [ "numpy.max", "numpy.array", "numpy.random.choice", "numpy.zeros", "numpy.log", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.legend", "numpy.mean", "numpy.logical_and", "matplotlib.pyplot.ylabel", "numpy.argsort" ] ]
abw-24/nets
[ "217030e0edd7f9891dfb8ca00d6a64439b7def95" ]
[ "nets/layers.py" ]
[ "\nfrom tensorflow.keras import layers as klayers\nimport tensorflow as tf\n\n\nclass SequentialBlock(klayers.Layer):\n \"\"\"\n Base block class. Creates a generic call method referencing\n self._block_layers, which is utilized by each child class to\n store computations. Layers that use the `training...
[ [ "tensorflow.exp", "tensorflow.keras.layers.Add", "tensorflow.shape", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.BatchNormalization" ] ]
gpiantoni/boavus
[ "855bc92cbb8a6062313d97d21813be87ba39bc81" ]
[ "boavus/ieeg/preprocessing.py" ]
[ "from logging import getLogger\nfrom pickle import load, dump\nfrom numpy import empty, arange\nfrom wonambi.trans import montage\nfrom wonambi.trans.select import _create_subepochs\n\nfrom bidso.utils import replace_extension\n\n\nlg = getLogger(__name__)\n\n\ndef preprocess_ecog(ieeg_file, reref, duration, offset...
[ [ "numpy.arange" ] ]
cyphyhouse/CyPyHous3
[ "9ba2e9681391d6b9773258bcc73b5e10f403dda7" ]
[ "tests/base/test_obstacle.py" ]
[ "# Copyright (c) 2019 CyPhyHouse. All Rights Reserved.\n\nimport unittest\n\nimport numpy as np\n\nimport src.datatypes.motion.abstract.obstacle as obs\nimport src.datatypes.motion.pos as pos\nimport src.datatypes.motion.seg as seg\n\n\nclass DummyObs(obs.Obstacle):\n\n def __init__(self, point: pos.Pos, size: n...
[ [ "numpy.array" ] ]
Indrajeetja/ga-learner-dsmp-repo
[ "ea5977dceb32af003fcdd4bc39195fbb4c1f5a20" ]
[ "GRADIENT-BOOSTING-MACHINES/code.py" ]
[ "# --------------\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n#path - Path of file \ndf=pd.read_csv(path)\n# Code starts here\nX = df.drop([\"customerID\",\"Churn\"],1)\ny = df[\"Churn\"].copy()\n\nX_train, X_test, y_train, y_test = train_test_split(X,y,test_size =0.3 , random_state ...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.preprocessing.LabelEncoder", "sklearn.ensemble.AdaBoostClassifier", "sklearn.model_selection.GridSearchCV", "sklearn.metrics.accuracy_score", "sklearn.metrics.classification_report", "sklearn.model_selection.train_test_split", "pandas.re...
mphancock/cctbx_project
[ "ec8a239c5bcee9c9b2d1c6c95dc3fff2580bbb85" ]
[ "simtbx/nanoBragg/nanoBragg_gui_frames.py" ]
[ "'''\nAuthor : Lyubimov, A.Y.\nCreated : 12/12/2017\nLast Changed: 06/20/2019\nDescription : SIMTBX (nanoBragg) GUI Windows / frames\n'''\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport wx\nimport numpy as np\n\nfrom wxtbx import bitmaps\n\nfrom matplotlib.backends.ba...
[ [ "numpy.percentile", "matplotlib.backends.backend_wxagg.FigureCanvasWxAgg", "numpy.mean", "numpy.random.randint", "matplotlib.figure.Figure" ] ]
mandubian/transformers
[ "0cb163865a4c761c226b151283309eedb2b1ca4d" ]
[ "transformers/tests/modeling_tf_transfo_xl_test.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.random.set_seed" ] ]
tanakatsu/jobcan_man_hour_auto_input
[ "e68cc438205162d604ea15b4bc7fdc8c66c0e0df" ]
[ "generate_projects_and_tasks.py" ]
[ "from lib.jobcan import JobcanInput\nimport pandas as pd\nfrom argparse import ArgumentParser\nimport os\n\nparser = ArgumentParser()\nparser.add_argument('--chrome_driver_path', help='chrome driver path')\nparser.add_argument('--client_id', help='client_id')\nparser.add_argument('--email', help='email')\nparser.ad...
[ [ "pandas.DataFrame", "pandas.Series" ] ]
markorland/markorland
[ "a14d75b0d75cdaaf49209c0cb9074e5d05992a0e" ]
[ "Scraping/aws_scraper.py" ]
[ "import pandas as pd\nimport requests\nfrom bs4 import BeautifulSoup\nfrom selenium import webdriver\nfrom time import sleep\nimport re\n\ndef get_new_driver():\n options = webdriver.ChromeOptions()\n options.binary_location = '/opt/google/chrome/google-chrome'\n options.add_argument('headless')\n drive...
[ [ "pandas.read_csv" ] ]
tsutterley/LSsurf
[ "6333e70f33b7d9fed25fbfe4c45b9d5a8e2ef488" ]
[ "LSsurf/read_ICESat2.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Aug 20 15:00:05 2019\n\n@author: ben\n\"\"\"\nimport numpy as np\nfrom ATL11.check_ATL06_hold_list import read_files as read_hold_files\n#from PointDatabase.geo_index import geo_index\n#from PointDatabase.point_data import point_data\n#from Po...
[ [ "numpy.array", "numpy.zeros_like", "matplotlib.pyplot.colorbar", "numpy.ones_like", "numpy.mod", "numpy.round", "numpy.mean", "numpy.any", "numpy.arange", "numpy.abs", "numpy.sqrt", "matplotlib.pyplot.axis", "matplotlib.pyplot.scatter", "numpy.isfinite", ...
Liang-ZX/EDSR-PyTorch
[ "a245d02fa1c3d799402aeadf7320f1c8a116e86a" ]
[ "src/model/latticenet.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nfrom model import common\r\nimport torch.nn.functional as F\r\nfrom model.splitsr import ResidualBlock, SplitSRBlock\r\n\r\n\r\ndef make_model(args, parent=False):\r\n return LatticeNet(args)\r\n\r\n\r\ndef mean_channels(x):\r\n assert(x.dim() == 4)\r\n spatial_sum...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.LeakyReLU", "torch.add", "torch.nn.ReLU", "torch.nn.PixelShuffle", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
saksham/CarND-Advanced-Lane-Lines
[ "0ac649696bc00cf7be03107733eba0e4dbd27d9f" ]
[ "scripts/plot.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport math\n\nfrom matplotlib import image as mpimg\nfrom matplotlib import pyplot as plt\n\n# measured coordinates from lane corners for perspective transform\n# img = mpimg.imread('examples/straight_lines1.jpg')\n\n# measured lane marking for calculating curvat...
[ [ "matplotlib.pyplot.show", "matplotlib.image.imread", "matplotlib.pyplot.imshow" ] ]
hadisna/Makov-Decision-Process-Neural-Network-For-Global-Optimization
[ "228d650d7ac45d0d5ddd020c6d01d26de7db91a7" ]
[ "MDPN.py" ]
[ "import numpy as np\r\nimport math\r\nimport argparse, random\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\ndef ChangeDomain(temp_e, umax, umin, Size, Codel, n, Po, temp_e3, temp_e2):\r\n v_max = math.floor((n * Codel - 1) / Codel)\r\n umax1 = np.array([[0.0] for i in range(v_max + 1)])\r\n umin1 = np.arra...
[ [ "numpy.concatenate", "matplotlib.pyplot.ion", "numpy.random.rand", "matplotlib.pyplot.plot", "numpy.diff", "numpy.flipud", "numpy.where", "matplotlib.pyplot.pause", "matplotlib.pyplot.ioff", "matplotlib.pyplot.clf" ] ]
U8NWXD/vivarium
[ "19c6a4096fe94e3342e40ce03e6708c24dd38fa3" ]
[ "vivarium/processes/membrane_potential.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport os\n\nimport numpy as np\nimport scipy.constants as constants\nimport matplotlib.pyplot as plt\n\nfrom vivarium.core.process import Process\nfrom vivarium.library.dict_utils import deep_merge\nfrom vivarium.core.composition import (\n si...
[ [ "numpy.log" ] ]
gp-wang/facenet_celeb
[ "6dba84d4d64951e6d27fe92d385bb5c290123088" ]
[ "src/classifier.py" ]
[ "\"\"\"An example of how to use your own dataset to train a classifier that recognizes people.\n\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\")...
[ [ "numpy.equal", "numpy.zeros", "tensorflow.get_default_graph", "numpy.random.seed", "tensorflow.Graph", "tensorflow.Session", "numpy.random.shuffle", "sklearn.svm.SVC", "numpy.argmax" ] ]
yangchongxuan/100-Days-Of-ML-Code
[ "a2197066c07e9830859e20e057393ca2270af374" ]
[ ".history/Code/ycx/day_13 svm_20210303174904.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\ndataset = pd.read_csv('./datasets/Social_Network_Ads.csv')\n# X = \ndataset.info()" ]
[ [ "pandas.read_csv" ] ]
ceilors/some-games
[ "91685acfccbc62533bb61755af90add182cc13a6" ]
[ "1010.py" ]
[ "#!/usr/bin/env python3\nfrom itertools import product\nfrom pathlib import Path\nimport numpy as np\nimport pygame\nimport os\n\n\n# основные используемые цвета\nbackground_color = (100, 100, 100)\nlayout_color = (120, 120, 120)\nlighter_color = (150, 150, 150)\ntext_color = (200, 200, 200)\ncolors = {\n # игро...
[ [ "numpy.array", "numpy.ceil", "numpy.empty", "numpy.random.choice", "numpy.zeros", "numpy.arange", "numpy.all" ] ]
supriya-gdptl/vnn-neural-implicits
[ "34118fac8ccc530c539693381120dbfedf2bc0f8" ]
[ "im2mesh/encoder/vnn2.py" ]
[ "import torch\nimport torch.nn as nn\nfrom im2mesh.layers_equi import *\n\n\ndef maxpool(x, dim=-1, keepdim=False):\n out, _ = x.max(dim=dim, keepdim=keepdim)\n return out\n\n\ndef meanpool(x, dim=-1, keepdim=False):\n out = x.mean(dim=dim, keepdim=keepdim)\n return out\n\n\nclass VNN_DGCNN(nn.Module):\...
[ [ "torch.cat" ] ]
mb-89/dfana
[ "b21efccdd34eb7fb175e4721a810e04f813e5826" ]
[ "src/dfana/pyqtgraphbackend/fftplt.py" ]
[ "from dfana.sharedfuns import getFixedLenString\nfrom scipy import fft\nimport numpy as np\n\nname = \"fft\"\niconName = \"fft\"\n\n\nclass PltHandler:\n def __init__(self, data, dst):\n self.data = data\n self.dst = dst\n\n def initialize(self):\n plt = self.dst\n src = self.data[...
[ [ "numpy.linspace", "scipy.fft.fft", "numpy.logical_and" ] ]
at-peter/epymarl
[ "e84ee56f435e6fe69e9bb3297256a326f65b3b1f" ]
[ "src/utils/logging.py" ]
[ "from collections import defaultdict\nimport logging\nimport numpy as np\nfrom torch import is_tensor\n\nclass Logger:\n def __init__(self, console_logger):\n self.console_logger = console_logger\n\n self.use_tb = False\n self.use_sacred = False\n self.use_hdf = False\n\n self....
[ [ "torch.is_tensor", "numpy.mean" ] ]
statphysandml/LatticeModelImplementations
[ "5cadb44679445d821cc3d88646215d82d71e920c" ]
[ "python_scripts/on_model_measures.py" ]
[ "import numpy as np\n\n\nfrom mcmctools.utils.lattice import get_neighbour_index\n\n\ndef compute_on_model_measures(data, measure_name, sim_params):\n if measure_name == \"TwoPointCorrelation\":\n return compute_two_point_correlation(data, sim_params)\n\n\ndef compute_two_point_correlation(data, sim_param...
[ [ "numpy.sum", "numpy.prod", "numpy.cumprod", "numpy.size" ] ]
SebastianWolf-SAP/data-synthesis-for-machine-learning
[ "b622739776cedf57a906d7304a96aa31f767340c" ]
[ "tests/test_attribute.py" ]
[ "\n\nfrom math import isclose\n\nfrom numpy import random, array_equal\nfrom pandas import Series\nfrom ds4ml.attribute import Attribute\nfrom ds4ml.utils import randomize_string\n\nsize = 30\n\n\ndef test_integer_attribute():\n ints = random.randint(1, 100, size)\n attr = Attribute(Series(ints), name='ID', c...
[ [ "numpy.array_equal", "pandas.DataFrame", "numpy.random.uniform", "numpy.random.randint", "pandas.Series", "sklearn.model_selection.train_test_split" ] ]
Xiaracto/PaddleRS
[ "b6f7033f3c0ca7bc6952456c0a0f53eef6c1c07f" ]
[ "paddlers/models/ppdet/utils/visualizer.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...
[ [ "matplotlib.pyplot.switch_backend", "numpy.array", "matplotlib.cm.get_cmap", "numpy.sum", "matplotlib.pyplot.close", "numpy.nonzero", "matplotlib.pyplot.figure", "numpy.mean", "numpy.where", "matplotlib.pyplot.gcf" ] ]
Mackiovello/full-stack-of-politics
[ "63d4f103190985a5accce8e0f9d1d7eb597731ab" ]
[ "viz.py" ]
[ "import pandas as pd\nfrom bokeh.io import output_file, save\nfrom bokeh.plotting import figure\nfrom bokeh.models import HoverTool, ColumnDataSource, Legend\nfrom bokeh.palettes import Category20_18\nimport re\n\n\ndef get_y_coordinate(x_frac, currenty, nexty, offset):\n return currenty + (nexty - currenty) * x...
[ [ "pandas.read_csv" ] ]
shoes22/openpilot
[ "a965de3c96a53b67d106cfa775e3407db82dd0e1" ]
[ "selfdrive/debug/check_timings.py" ]
[ "#!/usr/bin/env python3\n# type: ignore\nimport sys\nimport time\nimport numpy as np\nfrom collections import defaultdict, deque\n\nimport cereal.messaging as messaging\n\nsocks = {s: messaging.sub_sock(s, conflate=False) for s in sys.argv[1:]}\nts = defaultdict(lambda: deque(maxlen=100))\n\nif __name__ == \"__main...
[ [ "numpy.max", "numpy.min", "numpy.mean", "numpy.diff", "numpy.std" ] ]
SciTools-incubator/iris-ugrid
[ "ce035e6de456b5ab9df5daa9d164c59baddd7552" ]
[ "iris_ugrid/tests/synthetic_data_generator/__init__.py" ]
[ "# Copyright Iris contributors\n#\n# This file is part of Iris and is released under the LGPL license.\n# See COPYING and COPYING.LESSER in the root of the repository for full\n# licensing details.\n\"\"\"\nProvides synthetic data generation capability in order to test ugrid loading\nand regridding.\n\nConcept:\n ...
[ [ "numpy.arange", "numpy.zeros" ] ]
decisionforce/EGPO
[ "aba65504795e7d5bf652c8bb9ed1f1fb73d84b45" ]
[ "egpo_utils/sac_pid/sac_pid_model.py" ]
[ "import numpy as np\nfrom gym.spaces import Discrete\nfrom ray.rllib.models.tf.tf_modelv2 import TFModelV2\nfrom ray.rllib.utils.framework import try_import_tf\nfrom ray.rllib.models.tf.misc import normc_initializer\n\ntf, _, _ = try_import_tf()\n\nSCALE_DIAG_MIN_MAX = (-20, 2)\n\n\nclass ConstrainedSACModel(TFMode...
[ [ "numpy.product", "numpy.prod", "numpy.log" ] ]