repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
OneTheta/readability-transformers
[ "3c122c98a90c67add8eafad16563b269d5e3124a", "3c122c98a90c67add8eafad16563b269d5e3124a" ]
[ "readability_transformers/readers/FeaturesDataReader.py", "readability_transformers/dataset/Dataset.py" ]
[ "# Copyright 2021 One Theta. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "torch.tensor", "torch.utils.data.DataLoader" ], [ "pandas.cut", "pandas.concat" ] ]
dmquinones/qiskit-terra
[ "f8fdfc514b051b4a37f7ac738b9716aecba8fc37", "f8fdfc514b051b4a37f7ac738b9716aecba8fc37" ]
[ "test/python/qobj/test_pulse_converter.py", "test/python/circuit/test_parameters.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright 2019, IBM.\n#\n# This source code is licensed under the Apache License, Version 2.0 found in\n# the LICENSE.txt file in the root directory of this source tree.\n\n# pylint: disable=redefined-builtin\n\n\"\"\"Converter Test.\"\"\"\n\nimport numpy as np\n\nfrom qiskit.test impo...
[ [ "numpy.arange" ], [ "numpy.linspace" ] ]
codercody/dask
[ "901ac307b68486d8289105c159ca702318bea5b0" ]
[ "dask/array/ufunc.py" ]
[ "from operator import getitem\nfrom functools import partial\n\nimport numpy as np\nfrom toolz import curry\n\nfrom .core import Array, elemwise, blockwise, apply_infer_dtype, asarray\nfrom .utils import empty_like_safe, IS_NEP18_ACTIVE\nfrom ..base import is_dask_collection, normalize_function\nfrom .. import core...
[ [ "numpy.frompyfunc", "numpy.angle", "numpy.modf", "numpy.frexp" ] ]
i92run/my_Proxy_Anchor_Loss
[ "42b008b1878f33cc276cda13752f1a57b29466c8" ]
[ "code/utils.py" ]
[ "import numpy as np\nimport torch\nimport logging\nimport losses\nimport json\nfrom tqdm import tqdm\nimport torch.nn.functional as F\nimport math\n\ndef l2_norm(input):\n input_size = input.size()\n buffer = torch.pow(input, 2)\n normp = torch.sum(buffer, 1).add_(1e-12)\n norm = torch.sqrt(normp)\n ...
[ [ "torch.cat", "torch.sqrt", "torch.stack", "torch.max", "torch.no_grad", "torch.sum", "torch.nn.functional.linear", "torch.Tensor", "torch.cdist", "torch.pow" ] ]
alexeyev/visartm
[ "d19e193b3c084d7f355a45b966c8bb2ebb6fa366", "d19e193b3c084d7f355a45b966c8bb2ebb6fa366" ]
[ "algo/arranging/crossmin_test.py", "datasets/models.py" ]
[ "import numpy as np\nimport time\nfrom crossmin import CrossMinimizer\nimport matplotlib.pyplot as plt\n\n\ndef cm_test(N1, N2):\n A = np.zeros((N1, N2))\n for i in range((N1 * N2) // 100):\n i1 = np.random.randint(0, N1)\n i2 = np.random.randint(0, N2)\n A[i1][i2] = 1\n\n cm = CrossMi...
[ [ "numpy.random.randint", "numpy.zeros", "matplotlib.pyplot.figure" ], [ "numpy.save", "numpy.load", "numpy.zeros" ] ]
punk95/Continual-Learning-With-Curiosity
[ "af0c507040e1352beb8740b6b3a7849417fc879a" ]
[ "Results_Main/classic_control/buffer-size_based_stuff_non_propotional/plot_comparision_diff_buff_type.py" ]
[ "import numpy as np\nimport torch\nimport matplotlib.pyplot as plt\nfrom pathlib import Path\n\nlength_interval = 30000\nl_interval_rate = 0.4\nl_linear_rate = 65e-7\nupdate_on_interval = False\nno_steps = 120000\n\nl_i = length_interval//1000\nm_s = 1000\n\ndir_name_r_fifo = \"buff_size_\"+ str(m_s) + \"/linear_Fa...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.sum", "numpy.std", "matplotlib.pyplot.fill_between", "torch.load", "matplotl...
markregine/raw_data_df_module
[ "6ce1b628f6a94a4fd6d452b79ee4180ab2fbf01a" ]
[ "raw_data_df_module/clean_raw_date_column.py" ]
[ "import pandas as pd\nimport numpy as np\nimport datetime as datetime\nfrom dateutil.parser import parse\nimport re as re\n\n\ndef get_date_columns_from_df(df, strings_indicating_dates='date|dt', case=False):\n column_names = pd.Series(df.columns)\n m = column_names.str.contains(strings_indicating_dates, case...
[ [ "pandas.to_datetime", "pandas.Series" ] ]
duducheng/torch-points-kernels
[ "aed9cf56ca61fe34b4880159951760e5dcb3a1db" ]
[ "torch_points_kernels/torchpoints.py" ]
[ "import torch\nfrom torch.autograd import Function\nimport torch.nn as nn\nimport sys\nfrom typing import Optional, Any, Tuple\n\nimport torch_points_kernels.points_cpu as tpcpu\nfrom .knn import knn\n\nif torch.cuda.is_available():\n import torch_points_kernels.points_cuda as tpcuda\n\n\ndef furthest_point_samp...
[ [ "torch.cuda.is_available", "torch.sqrt" ] ]
wom-ai/inference_results_v1.0
[ "af4bfffd5b6c4815f305a272cb42ae6de09f44e1" ]
[ "open/Alibaba/code/resnet50/tensorrt/calibrator.py" ]
[ "# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.ascontiguousarray" ] ]
junhai0428/YOLOX-OBB
[ "9f0d745b89ba6559e692ff06ba09b433b2f4594c" ]
[ "yolox/data/datasets/voc.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Code are based on\n# https://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py\n# Copyright (c) Francisco Massa.\n# Copyright (c) Ellis Brown, Max deGroot.\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport os\nimport os.path\nimport pi...
[ [ "numpy.vstack", "numpy.empty", "numpy.mean", "numpy.round" ] ]
bwplotka/keanu
[ "3afc576380fd30f7539b34b220bd89e68529b10e" ]
[ "keanu-python/tests/test_tensor.py" ]
[ "from typing import Union, List\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom keanu.tensor import Tensor\nfrom keanu.vartypes import primitive_types, numpy_types\nfrom keanu.vertex.base import JavaObjectWrapper\n\n\n@pytest.fixture\ndef generic():\n pass\n\n\n@pytest.mark.parametrize(\"num, e...
[ [ "pandas.DataFrame", "numpy.array", "numpy.array_equal", "pandas.Series" ] ]
pokemonChampion5833/Steam-Scraper
[ "2db7f0167d9054c1ad7e7383c693bdae1ca33500" ]
[ "scraper/scrape.py" ]
[ "from bs4 import BeautifulSoup\nimport pandas as pd\nfrom selenium import webdriver\nimport os \nfrom pdfConverter import PDF\n\n\nclass Scrape:\n #constructor function\n def __init__(self):\n self.names=[]\n self.title=[]\n self.prices=[]\n self.platforms=[]\n self.images=[...
[ [ "pandas.DataFrame" ] ]
hadleyhzy34/point_cloud
[ "9327b1ad084daa61376311181498391693c1c01a" ]
[ "general_algorithm/pca_normal.py" ]
[ "import open3d as o3d \nimport os\nimport numpy as np\nfrom pyntcloud import PyntCloud\n\ndef PCA(data, correlation=False, sort=True):\n # import ipdb;ipdb.set_trace()\n # calculate mean value for each dimension/column\n M = np.mean(data,axis=0)\n # print(M.shape)\n\n # centered array\n pcd_center...
[ [ "numpy.array", "numpy.cov", "numpy.asarray", "numpy.mean", "numpy.loadtxt", "numpy.linalg.eig" ] ]
tomahawk123/pandas
[ "1f02bf240c3d0d3da338af868d056bfc169b28c2", "3fe697f3c9dcb0c0a7a9b91c0098d31b39f51fef" ]
[ "pandas/tests/series/test_dtypes.py", "pandas/io/excel.py" ]
[ "# coding=utf-8\n# pylint: disable-msg=E1101,W0612\n\nfrom datetime import datetime, timedelta\nimport string\nimport sys\n\nimport numpy as np\nimport pytest\n\nfrom pandas._libs.tslibs import iNaT\nimport pandas.compat as compat\nfrom pandas.compat import lrange, range, u\n\nimport pandas as pd\nfrom pandas impor...
[ [ "pandas.compat.u", "pandas.Timestamp", "pandas.compat.range", "numpy.dtype", "pandas.util.testing.assert_numpy_array_equal", "pandas.Timedelta", "pandas.DataFrame", "numpy.arange", "pandas.util.testing.assert_produces_warning", "numpy.random.randint", "numpy.array", ...
scottwedge/Dynamic-Programming
[ "11c913a44dff6b19d55ff95bbefa3889ccef9f90" ]
[ "Stochastic-Problem.py" ]
[ "'''\nThis program is for solving a stochastic dynamic programming problem similar\nto problem 19.31 in Schaum's Operations Research Second Edition\nApril 19, 2020\n'''\nimport numpy as np\nimport sys\n\n\nnumOfSites = int(input('How many sites can be developed? ' ))\nmoney = int(input('How many units of money are ...
[ [ "numpy.zeros" ] ]
natashanorsker/fagprojekt
[ "ef9a8cc2128c43d891c8a7a47e14916af2b9c602" ]
[ "deepRanking/deep_ranking_gridsearch.py" ]
[ "import sys\nsys.path.append('..')\n\nfrom utilities import labels_from_ids\nfrom dataset import BalancedBatchSampler, make_dataset\nfrom nets import EmbeddingNet\nfrom plots import extract_embeddings, plot_embeddings\nfrom losses import OnlineTripletLoss, AverageNonzeroTripletsMetric\nfrom deep_ranking_utils impor...
[ [ "sklearn.preprocessing.LabelEncoder", "torch.optim.lr_scheduler.StepLR", "sklearn.model_selection.ParameterGrid", "torch.cuda.is_available", "torch.utils.data.DataLoader" ] ]
aizawak/models
[ "47e783e62a41f1f19baffc316d6530315ea872ac" ]
[ "official/transformer/v2/transformer_main_test.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.keras.mixed_precision.experimental.set_policy", "tensorflow.test.is_built_with_cuda", "tensorflow.keras.mixed_precision.experimental.global_policy", "tensorflow.test.main", "tensorflow.python.eager.context.num_gpus" ] ]
gakkispy/DD-Net-Pytorch
[ "45032ce373dfa0fffec8e99671555071548445bc" ]
[ "dataloader/shrec_loader.py" ]
[ "#! /usr/bin/env python\n#! coding:utf-8:w\n\nimport numpy as np\nfrom sklearn import preprocessing\nimport pickle\nfrom pathlib import Path\nfrom tqdm import tqdm\nimport sys\nsys.path.insert(0, '..')\nfrom utils import * # noqa\ncurrent_file_dirpath = Path(__file__).parent.absolute()\n\n\ndef load_shrec_data(\n ...
[ [ "numpy.stack" ] ]
amrutha-p/pkwrap
[ "9f474122d9eb8c5d7b8b074b29235b5f837da30d" ]
[ "tests/test-chain-objf.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/\n# Written by Srikanth Madikeri <srikanth.madikeri@idiap.ch>\n\nimport torch\nimport pkwrap\n\npkwrap.InstantiateKaldiCuda()\ninput_mat = pkwrap.matrix.ReadKaldiMatrixFile(\"tests/data/lfmmi_input_0\")\nexpected_out = pkwr...
[ [ "torch.zeros", "torch.zeros_like" ] ]
20171130/Uni-Fold
[ "e0ad0bb8b015911b2577969585986f9b635f1571", "e0ad0bb8b015911b2577969585986f9b635f1571" ]
[ "unifold/model/quat_affine.py", "unifold/common/protein.py" ]
[ "# Copyright 2021 DeepMind Technologies Limited\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 applic...
[ [ "numpy.linalg.eigh", "numpy.transpose", "numpy.reshape", "numpy.zeros" ], [ "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.any" ] ]
NunoEdgarGFlowHub/thewalrus
[ "487957ec04a7d7da4a5007a0a9b9d209c4bee51f" ]
[ "thewalrus/tests/test_hermite_multidimensional.py" ]
[ "# Copyright 2019 Xanadu Quantum Technologies 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 applica...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "scipy.special.eval_hermitenorm", "numpy.ones", "numpy.allclose", "numpy.arange", "numpy.sqrt", "scipy.special.eval_hermite" ] ]
airman00/models
[ "7dcd3f6b3151ae968f71b7e53b32c25750245606" ]
[ "research/object_detection/core/post_processing.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.zeros", "tensorflow.compat.v1.transpose", "tensorflow.compat.v1.tile", "tensorflow.compat.v1.ones_like", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.image.combined_non_max_suppression", "tensorflow.compat.v1.less", "tensorflow.compat.v1.reduce_min", ...
ryan-kp-miller/Stock-Price-Prediction-App
[ "521140cbc7f6557bc593ee28e276c5f13a9a7dca" ]
[ "dash_app.py" ]
[ "import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output, State\nimport plotly.graph_objs as go\nimport plotly.express as px\n\nimport pandas as pd\nimport datetime as dt\nimport yfinance as yf\nfrom MLTrader import MLTrader\nfrom util import...
[ [ "pandas.read_csv" ] ]
ajchristie/char-rnn-tensorflow
[ "a20d88d2a8ea55a0b8b64728ba412ff5389064ec" ]
[ "GCloudVersion/trainer/utils.py" ]
[ "import codecs\nimport os\nimport collections\nfrom six.moves import cPickle\nimport numpy as np\nfrom tensorflow.python.lib.io import file_io\n\n\nclass TextLoader():\n def __init__(self, data_dir, batch_size, seq_length, encoding='utf-8'):\n self.data_dir = data_dir\n self.batch_size = batch_size...
[ [ "numpy.copy", "numpy.load", "numpy.save", "tensorflow.python.lib.io.file_io.file_exists", "tensorflow.python.lib.io.file_io.FileIO" ] ]
wmvanvliet/kirpputori
[ "1640c8ef978326b7981a961e21d0f3dae8a2894a" ]
[ "kirpputori/pythagoras.py" ]
[ "import numpy as np\n\n\ndef pythagoras(a, b):\n \"\"\"Compute pythagoras.\n\n Parameters\n ----------\n a : float\n length of one side of the triangle\n b : float\n length of second side\n\n Returns\n -------\n c : float\n length of the hypothenuse\n \"\"\"\n retu...
[ [ "numpy.sqrt" ] ]
ganeshmev/Fracktory3-3.0_b11_KLE
[ "16066e6993b96a880aa1a2f044a27930cbd0787d" ]
[ "Fracktory3-3.0_b11/plugins/CuraEngineBackend_TEMP/StartSliceJob.py" ]
[ "# Copyright (c) 2018 Ultimaker B.V.\n# Cura is released under the terms of the LGPLv3 or higher.\n\nimport numpy\nfrom string import Formatter\nfrom enum import IntEnum\nimport time\nfrom typing import Any, cast, Dict, List, Optional, Set\nimport re\nimport Arcus #For typing.\n\nfrom UM.Job import Job\nfrom UM.Log...
[ [ "numpy.array" ] ]
PARIKSHITJAIN2102/ROM-OpInf-Combustion-2D
[ "8b011795718484fb2abc721d5804a5ec76987752" ]
[ "DMDc_prediction.py" ]
[ "import os\nimport time\nimport numpy as np\nimport pandas as pd\n\nimport config\nimport data_processing as dproc\n\n\ntime.perf_counter()\n\n# Time domain.\nt = np.arange(0.015, 0.021, 10**-7)\n\n# Data location.\nBase_folder = \"C:\\\\Users\\\\Admin\\\\Desktop\\\\combustion\\\\\"\nos.chdir(Base_folder)\nSaved_sc...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.multi_dot", "pandas.DataFrame", "numpy.load", "numpy.save", "numpy.shape", "numpy.float32", "numpy.arange" ] ]
GwangsHong/EfficientNet-mGPUs
[ "b1074ff2f6b29f515e0bc2dfba59c58343030457" ]
[ "image_classification/utils.py" ]
[ "import os\nimport numpy as np\nimport torch\nimport shutil\nimport torch.distributed as dist\n\n\ndef should_backup_checkpoint(args):\n def _sbc(epoch):\n return args.gather_checkpoints and (epoch < 10 or epoch % 10 == 0)\n return _sbc\n\n\ndef save_checkpoint(state, is_best, filename='checkpoint.pth....
[ [ "torch.distributed.get_world_size", "torch.save", "torch.distributed.is_initialized", "torch.distributed.all_reduce", "torch.distributed.get_rank" ] ]
geppi/pandaSDMX
[ "33ec2704af0da5b9d1564046cd4d9707060c9bf9", "33ec2704af0da5b9d1564046cd4d9707060c9bf9" ]
[ "Dataflow.py", "pandasdmx/writer.py" ]
[ "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n# Copyright (c) 2020 digitX Gbr. All rights reserved.\n# Author: Thomas Geppert\n\n\n\nimport attr\nimport numpy as np\nimport pandas as pd\nimport pandasdmx as sdmx\nimport re\n\n\n# text pattern specifying weekly dates\nweekly_pattern = re.compile(r'^[0-9]{4}-W[0-9]{2...
[ [ "pandas.to_datetime" ], [ "pandas.to_datetime", "pandas.DataFrame.from_dict", "pandas.DataFrame", "pandas.concat", "pandas.Series" ] ]
gajdosech2/keras-centernet
[ "f9b87c84a1df181142978ffe7a27e0a2835600d7" ]
[ "inference.py" ]
[ "from generators.csv_ import CSVGenerator\nfrom models.resnet import centernet\nimport cv2\nimport os\nimport numpy as np\nimport time\nfrom generators.utils import affine_transform, get_affine_transform\nfrom utils.image import read_image_bgr, preprocess_image, resize_image\nimport os.path as osp\n\nDATA_SUFFIX = ...
[ [ "numpy.array", "numpy.where", "numpy.stack", "numpy.clip", "numpy.expand_dims" ] ]
Ulfgard/fCMApy
[ "67fa37e3188d4498e94dc35eb6c2a2c3219db0e0" ]
[ "fCSA.py" ]
[ "import numpy as np\nimport math \nclass fCSA:\n\tdef __init__(self, init_mean, init_variance = 1.0, noise_adaptation=False):\n\t\t#variables of the normal distribution\n\t\tself.mean = init_mean\n\t\tself.variance = init_variance\n\t\t\n\t\t#integer variables for population and dimensionality\n\t\tself.n = init_me...
[ [ "numpy.zeros", "numpy.sum", "numpy.exp", "numpy.mean", "numpy.abs" ] ]
tailonghe/Southern_Ocean_Carbon
[ "874ff36eb374ee08a9a640fc546215832a30a4cb" ]
[ "scripts/data_pair_generator/data_pair_GLODAP.py" ]
[ "import netCDF4 as nc\nimport glob\nimport numpy as np\nimport datetime\nimport pandas as pd\n\n\nz = np.array([-2.1, -6.7, -12.15, -18.55, -26.25, -35.25, -45, -55, -65, -75, -85,\n -95, -105, -115, -125, -135, -146.5, -161.5, -180, -200, -220, -240,\n -260, -280, -301, -327, -361, -402.5, -450, -500, -551.5...
[ [ "numpy.array", "numpy.isnan", "numpy.empty", "numpy.zeros", "numpy.genfromtxt", "numpy.load", "numpy.save", "numpy.nanmin", "numpy.mean", "numpy.where", "numpy.sqrt", "pandas.read_csv" ] ]
YueLiu-jina/jina
[ "f3e860313f26edc6d9f6e6ecc74cf6c2a3c65bff" ]
[ "jina/executors/crafters/image/flip.py" ]
[ "__copyright__ = \"Copyright (c) 2020 Jina AI Limited. All rights reserved.\"\n__license__ = \"Apache-2.0\"\n\nfrom typing import Dict\n\nimport numpy as np\n\nfrom .. import BaseCrafter\nfrom .helper import _load_image, _move_channel_axis\n\n\nclass ImageFlipper(BaseCrafter):\n \"\"\"\n :class:`ImageFlipper`...
[ [ "numpy.flipud", "numpy.array", "numpy.fliplr" ] ]
weninc/bitshuffle-1
[ "6899f5db159469e92e7b3c776d2087345e4d5b77" ]
[ "tests/test_regression.py" ]
[ "\"\"\"\nTest that data encoded with earlier versions can still be decoded correctly.\n\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport pathlib\nimport unittest\n\nimport numpy as np\nimport h5py\n\n\nTEST_DATA_DIR = pathlib.Path(__file__).parent / \"data\"\n\nOUT_FILE_TEMPLATE...
[ [ "numpy.all" ] ]
naidjeldias/GMM_Tracking
[ "990a2ac913b051815d12ea7305ae23f79bdad45c" ]
[ "main.py" ]
[ "import numpy as np\nimport cv2\nimport time\nimport xlsxwriter\n\n\nwarped = None,\nroiPts = []\nstartTime = 0\nendTime = 0\nfgbg = None\nlast =None\nwarpedAux = None\nrow = 0\ncol = 0\nworksheet = None\n\n\ncountFrames = 0\ncountFramesTrain = 0\ncountAux = 0\n\ncountFramesLeftArmAuX = 0\ncountFramesRightArmAux = ...
[ [ "numpy.array", "numpy.argmin", "numpy.zeros", "numpy.diff", "numpy.argmax" ] ]
xuyl0104/controlled-text-generation
[ "ebac4cc720065d815ba975dbc347591382e31015" ]
[ "train_clf.py" ]
[ "\nimport math\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.autograd as autograd\nimport torch.optim as optim\nimport numpy as np\nfrom torch.autograd import Variable\n\nfrom ctextgen.dataset import *\nfrom ctextgen.model import RNN_VAE\n\nimport argparse\n\n\nparse...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Dropout", "numpy.mean", "torch.nn.Conv2d", "torch.nn.functional.cross_entropy", "torch.nn.Embedding" ] ]
mkp170791/holoviews
[ "a17f5c66eac7c23817e31edd3b3768b3be35076f" ]
[ "holoviews/util/transform.py" ]
[ "from __future__ import division\n\nimport operator\nfrom types import BuiltinFunctionType, BuiltinMethodType, FunctionType, MethodType\n\nimport numpy as np\n\nfrom ..core.dimension import Dimension\nfrom ..core.util import basestring, unique_iterator\nfrom ..element import Graph\n\nfunction_types = (\n Builtin...
[ [ "numpy.max", "numpy.asarray", "numpy.log", "numpy.min", "numpy.diff", "numpy.where", "numpy.full_like" ] ]
muscasmarco/environment-recognition-fds
[ "686316609cf1c0b5a62529ad5c22aab35cccafb6" ]
[ "env_classifier.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom feature_extraction import FeatureExtractor\nfrom feature_mapping import FeatureMapper\nfrom prediction import Predictor\nfrom sklearn.metrics import accuracy_score\nfrom prediction import onehot_encode\nimport numpy as np\n\nclass EnvironmentClassifier:\n ...
[ [ "numpy.argmax", "sklearn.metrics.accuracy_score" ] ]
tholiao/opto
[ "370a016a1ccef462b185b0f9538fb33aab81d566" ]
[ "opto/data/dataset.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Feb 19 18:48:31 2015\n\n@author: Roberto Calandra\n\"\"\"\nfrom __future__ import division, print_function, absolute_import\nfrom past.builtins import basestring\nfrom builtins import range\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\n# import...
[ [ "numpy.concatenate", "numpy.delete", "numpy.matrix", "numpy.string_", "numpy.sum", "numpy.random.permutation", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "matplotlib.pyplot....
ednmolina/ABeautifulStayInTheNeighborhood
[ "7f46f676813e7bad5be14891ce7dccd32c0ade65" ]
[ "visualization/viz.py" ]
[ "import pandas as pd\nimport numpy as np\nimport dash #(version 1.0.0)\nimport dash_table\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nimport json\nimport plotly.offline as py #(version 4.4.1)\nimport plotly.graph_objs...
[ [ "numpy.float", "pandas.DatetimeIndex", "pandas.io.sql.read_sql" ] ]
HelloN00bman/baselines
[ "5e70a8bce38b04997fbb7bb10a345c65896dcdea" ]
[ "baselines/common/models.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom baselines.a2c import utils\nfrom baselines.a2c.utils import conv, fc, conv_to_fc, batch_to_seq, seq_to_batch\nfrom baselines.common.mpi_running_mean_std import RunningMeanStd\nimport tensorflow.contrib.layers as layers\n\nmapping = {}\n\ndef register(name):\n de...
[ [ "tensorflow.layers.flatten", "tensorflow.variable_scope", "tensorflow.placeholder", "numpy.sqrt", "tensorflow.contrib.layers.convolution2d", "tensorflow.contrib.layers.layer_norm", "tensorflow.cast" ] ]
evtHsa/sdcAdvLaneFinding
[ "4e20aad9e5d5fb3e0ed2c1da7574b6ff3210eb2b" ]
[ "unit_tests/lesson_7_8.py" ]
[ "#!/usr/bin/env python3\n#\n\nimport util as ut\nimport ImgViewer as iv\nimport cv2\nimport numpy as np\nimport ImgUtil as iu\nimport ImgViewer as iv\nimport LaneUtils as lu\n\nimport numpy as np\n\ncache_dict, parm_dict = ut.app_init(viewer=True, saver=True, title=\"whatever\")\nvwr = cache_dict['viewer']\n\ndef g...
[ [ "numpy.max", "numpy.random.seed", "numpy.random.randint", "numpy.polyfit", "numpy.absolute", "numpy.linspace" ] ]
SubmitCode/PooDetector
[ "54148783488c69c5f6429121686fd35bb00d0d1e" ]
[ "PooDetector/custom_recipe.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_custom_receipe.ipynb (unless otherwise specified).\n\n__all__ = ['fastai_recipe', 'create_folders', 'load_fastai_model', 'save_base64_image', 'score_stream',\n 'predict_folder', 'predict_all_subfolders', 'fastai_jsonl_recipe']\n\n# Cell\nimport numpy as ...
[ [ "numpy.round", "numpy.transpose", "numpy.asarray" ] ]
cactusAi/ImageCaption
[ "d96a71ccf29ca571c7d2050de662d25efe87dba3" ]
[ "icg/processing/text.py" ]
[ "import string\n\nfrom collections import OrderedDict\nfrom numpy import array\nfrom pickle import load\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.preprocessing.sequence import pad_sequences\nfrom keras.utils import to_categorical\nfrom keras.utils import plot_model\nfrom keras.models import Model\...
[ [ "numpy.array" ] ]
Pankajmalhan/simplified-ml
[ "635927b44aa31371566c0698296e4fed279d44f7" ]
[ "src/routes/routes_api.py" ]
[ "from flask import Blueprint, request, jsonify, session\nfrom src.constants.model_params import Ridge_Params, Lasso_Params, ElasticNet_Params, RandomForestRegressor_Params, \\\n SVR_params, AdabootRegressor_Params, GradientBoostRegressor_Params\nfrom src.constants.model_params import LogisticRegression_Params, S...
[ [ "pandas.DataFrame", "numpy.arange", "pandas.concat" ] ]
samroon2/app_rating_predictions
[ "4647f4c6c70443705c59d605baf53aa62cb4a993" ]
[ "pos_rev_service/pos_rev_service.py" ]
[ "import keras\r\nimport os, json, sys, pickle\r\nimport tensorflow as tf\r\nfrom quart import Quart, jsonify, request, make_response\r\nfrom keras.preprocessing.sequence import pad_sequences\r\nfrom sklearn.externals import joblib\r\nsys.path.insert(0, '../code/')\r\nfrom text_cleaning import TextClean\r\n\r\n\r\n#...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
ZhengPeng7/LeafVeinExtraction
[ "833967c2f00ac842440aaf81ee46f8b0e067003d" ]
[ "save_in_csv_and_xlsx.py" ]
[ "import os\r\nimport csv\r\nfrom xlsxwriter.workbook import Workbook\r\nimport numpy as np\r\n\r\n\r\ndef save_in_csv_curvature(csv_file, A4_name, curvatures):\r\n # in csv\r\n with open(csv_file, \"a\", newline=\"\") as fin_csv:\r\n csv_writer = csv.writer(fin_csv, dialect=\"excel\")\r\n row_he...
[ [ "numpy.median", "numpy.std", "numpy.hstack", "numpy.mean" ] ]
AriaPs/cleargrasp
[ "3c5fd901970cab2bb5da38ca0b3eff32d8f9dc12", "3c5fd901970cab2bb5da38ca0b3eff32d8f9dc12" ]
[ "live_demo/realsense/camera.py", "pytorch_networks/surface_normals/utils/depth_numpy_to_exr.py" ]
[ "#!/usr/bin/env python3\n\nimport socket\nimport numpy as np\nimport cv2\nimport os\nimport time\nimport struct\n\n\nclass Camera(object):\n\n def __init__(self):\n # Data options (change me)\n self.im_height = 720 # 848x480, 1280x720\n self.im_width = 1280\n # self.resize_height = 7...
[ [ "numpy.isinf", "numpy.fromstring", "numpy.isnan" ], [ "numpy.stack", "numpy.load" ] ]
gialmisi/desdeo-emo
[ "4835084824f6478c63513cb5b22380d9b27c3a9a" ]
[ "desdeo_emo/recombination/evodn2_xover_mutation.py" ]
[ "import numpy as np\nfrom copy import deepcopy\nfrom random import shuffle\n\n\ndef mate(\n mating_pop, individuals: list, params, crossover_type=None, mutation_type=None\n):\n \"\"\"Swap nodes between two partners and mutate based on standard deviation.\n\n Parameters\n ----------\n mating_pop : lis...
[ [ "numpy.random.normal", "numpy.copy", "numpy.random.binomial", "numpy.asarray" ] ]
angelolovatto/industrialbenchmark
[ "d89fdc4bbfa3e569beb5d5c4690c23d8ecad28ed" ]
[ "gym_industrial/envs/fatigue/dynamics.py" ]
[ "\"\"\"Python implementation of Fatigue state transition.\"\"\"\nfrom dataclasses import dataclass\n\nimport numpy as np\n\n\n@dataclass\nclass FatigueParams:\n \"\"\"Parameters for Fatigue dynamics.\"\"\"\n\n action_tolerance: float = 0.05\n amplification: float = 1.1\n amplification_max: float = 5.0\n...
[ [ "numpy.minimum", "numpy.clip", "numpy.exp", "numpy.maximum" ] ]
Okamille/mne-python
[ "25df6b63ea3cc2eca1855fcafd8bfbcfd7199263", "25df6b63ea3cc2eca1855fcafd8bfbcfd7199263", "25df6b63ea3cc2eca1855fcafd8bfbcfd7199263" ]
[ "mne/realtime/tests/test_fieldtrip_client.py", "mne/io/edf/edf.py", "mne/io/tests/test_constants.py" ]
[ "# Author: Mainak Jas <mainak@neuro.hut.fi>\n#\n# License: BSD (3-clause)\n\nimport contextlib\nimport os\nimport os.path as op\nimport queue\nimport threading\nimport socket\nimport subprocess\nimport time\n\nimport numpy as np\nfrom numpy.testing import assert_array_equal, assert_allclose\nimport pytest\n\nfrom m...
[ [ "numpy.concatenate", "numpy.testing.assert_array_equal", "numpy.unique", "numpy.diff" ], [ "numpy.min", "numpy.where", "numpy.size", "numpy.fromstring", "numpy.dtype", "numpy.concatenate", "numpy.max", "numpy.uint8", "numpy.take", "numpy.isfinite", "...
AdityaU3672/distraction-cv
[ "91251d00e321ad39cb8d59ba982b456abfc00cbf" ]
[ "test7.py" ]
[ "import cv2\nimport numpy as np\nimport dlib\nimport math\nvid = cv2.VideoCapture(0)\ndetector = dlib.get_frontal_face_detector()\npredictor = dlib.shape_predictor('shape_68.dat')\nfont = cv2.FONT_HERSHEY_SIMPLEX\n\n# FUNCTION TO MAKE 2D IMAGE\ndef make2d(shape):\n imagePoints = [[shape.part(30).x, shape.part(30...
[ [ "numpy.array", "numpy.zeros" ] ]
taoshibo/Paddle
[ "2497f4392fe60f4c72e9b7ff5de9b8b6117aacac" ]
[ "python/paddle/fluid/tests/unittests/test_set_value_op.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 ...
[ [ "numpy.array", "numpy.ones" ] ]
kkuette/AI_project
[ "1f46cb2536b24cb3716250f1e9705daa76af4f60" ]
[ "TradzQAI/core/environnement/base/dataloader.py" ]
[ "import pandas as pd\nimport os\nfrom collections import deque\nimport subprocess\nfrom datetime import datetime\n\nfrom TradzQAI.tools import Indicators\n\n# Indicators dict should be added in environnement configuration \nindicators = dict(\n RSI = 'default',\n MACD = 'default',\n Volatility ...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
scottliyq/QUANTAXIS
[ "5a71e142bc53602e49697a1263d9fc8459bfcb0f" ]
[ "QUANTAXIS/QASU/save_binance_future.py" ]
[ "# coding: utf-8\n# Author: Will\n# Contributor: scottliyq\n# Created date: 2021-06-02\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2018 yutiansut/QUANTAXIS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Softwa...
[ [ "pandas.DataFrame" ] ]
wang-chen/interestingness
[ "505ed5af22cf92fe3af095b3a56cdc78078c86c6" ]
[ "interestingness.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nimport copy\nimport torch\nimport os.path\nimport argparse\nimport numpy as np\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torchvision import models\nimport torch.utils.data as Data\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torchv...
[ [ "torch.rand" ] ]
uab-projects/bayesian-tweets
[ "e207e84fdc1e16b13c71a24bc754e39fa04b48cf" ]
[ "src/core/splitter/NpStratifiedCrossValidationSplitter.py" ]
[ "# libraries\nfrom .NpCrossValidationSplitter import NpCrossValidationSplitter\nfrom core.data.NpDataHandler import NpDataHandler\nimport logging\nimport numpy as np\n\n# constants\nLOGGER = logging.getLogger(__name__)\n\n\"\"\"\nGiven a matrix of data, splits the data in k groups, and then sets for each\niteration...
[ [ "numpy.bincount", "numpy.extract", "numpy.append" ] ]
FrancoMBM/machine-learning
[ "7115b83067f0af74b59de4e35f7c1a1da9cca9a4" ]
[ "code/svm_gui_py3.py" ]
[ "\"\"\"\n==========\nLibsvm GUI\n==========\n\nA simple graphical frontend for Libsvm mainly intended for didactic\npurposes. You can create data points by point and click and visualize\nthe decision region induced by different kernels and parameter settings.\n\nTo create positive examples click the left mouse butt...
[ [ "matplotlib.use", "numpy.array", "sklearn.datasets.dump_svmlight_file", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg", "numpy.arange", "matplotlib.figure.Figure", "numpy.meshgrid", "numpy.unique", "matplotlib.backends.backend_tkagg.NavigationToolbar2Tk" ] ]
mrmourao/classificando-osc-classe-outras
[ "3ec088a0feb739ecb24a385d5812bd1ed7429325" ]
[ "app/extracao_dados.py" ]
[ "# -*- coding: utf-8 -*-\n\n#------------------------------------------------------------------------------ \n# Importes das bibliotecas utilizadas\n\nimport logging\nimport time\nimport pandas as pd\nimport pickle\n\nfrom utils.log_factory import Log\nfrom os.path import dirname, abspath...
[ [ "pandas.merge" ] ]
napulen/AugmentedNet
[ "16aaeeccf15508478ac5987f9cf5d148ea44876e", "16aaeeccf15508478ac5987f9cf5d148ea44876e" ]
[ "test/test_joint_parser.py", "AugmentedNet/joint_parser.py" ]
[ "import io\nimport unittest\n\nimport pandas as pd\n\nimport AugmentedNet.joint_parser\n\n\nhaydnOp20no4iAnnotation = \"\"\"\nComposer: Haydn, Franz Joseph\nTitle: String Quartet in D Major - No.1: Allegro di molto\nAnalyst: Néstor Nápoles López, https://doi.org/10.5281/zenodo.1095617\nProofreader: Automated transl...
[ [ "pandas.read_csv" ], [ "pandas.concat" ] ]
tetherless-world/PaperRank
[ "a6b7c1294c7b9d5c3e0aebc59996eef044801daa" ]
[ "tests/compute_manager_test.py" ]
[ "from context import PaperRank\n\nfrom redis import StrictRedis, ConnectionPool\nimport numpy as np\n\nimport unittest\n\n\nclass TestComputeManager(unittest.TestCase):\n \"\"\"Test the compute engine `Manager` module with a dummy example.\n \"\"\"\n\n def __init__(self, *args, **kwargs):\n \"\"\"Ov...
[ [ "numpy.array" ] ]
yashchitre03/Bloom-Clock-Simulation
[ "5cdff4b75600084794852c9221498c0806780793" ]
[ "main.py" ]
[ "from math import factorial\nfrom multiprocessing import Process, Value, Queue, Pool, cpu_count\nimport random\nimport time\nimport numpy as np\nfrom queue import Empty\nimport matplotlib.pyplot as plt\nimport matplotlib.lines as mlines\nimport os\nfrom itertools import repeat\n\n\ndef positive_probability(b_y, b_z...
[ [ "matplotlib.lines.Line2D", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.sum", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib...
IanViotti/composipy
[ "87866ce908358d895d9a04a3a243a46ff7cda3a7" ]
[ "tests/test_Laminate.py" ]
[ "'''\nTest of Laminate class\n=================\n\nTest Laminate class using example from page 201 of reference 1\n\nReferences\n----------\n1 - Mendonça, Paulo de Tarso R. Materiais Compostos e Estruturas-sanduíche: Projeto e Análise. 2005 Editora Manole Ltda.\n'''\n\nimport pytest\nimport numpy as np\n\nfrom comp...
[ [ "numpy.testing.assert_almost_equal", "numpy.array" ] ]
pipegalera/BasketballReference-Webscraper
[ "6a61844ce2d39f8680457363505f3e8f895ef07c" ]
[ "functions_app.py" ]
[ "import pandas as pd\nimport base64\nfrom io import BytesIO\nimport streamlit as st\nfrom datetime import date, datetime\nimport requests\n\nfrom teams_names import TEAMS\n\nstats_dict = {'Players total stats': 'totals',\n 'Players stats per game': 'per_game',\n 'Players stats per 36 minut...
[ [ "pandas.DataFrame", "pandas.read_html", "pandas.ExcelWriter" ] ]
xinliy/SemLog_Vis2
[ "49fd16c768f612796ea0bea74fbccb34b8acdd4a" ]
[ "semlog_vis/semlog_vis/point_cloud.py" ]
[ "from PIL import Image\nimport numpy as np\nimport time\n\n\nclass PointCloudGenerator():\n \"\"\"Class for generate point cloud from RGB and depth image pair.\"\"\"\n\n def depthConversion(self, PointDepth):\n \"\"\"Adjust the relative depth in UE4.\"\"\"\n\n f = self.focal_length\n H = ...
[ [ "numpy.full", "numpy.array", "numpy.savetxt", "numpy.asarray", "numpy.zeros", "numpy.float", "numpy.save", "numpy.linspace" ] ]
saArbabi/PlanToMerge
[ "f831bc635a00e04a58a8221516f9fcd61d5b3f80" ]
[ "src/envs/env_initializor_test.py" ]
[ "import numpy as np\r\nfrom importlib import reload\r\nfrom vehicles import idmmobil_merge_vehicle\r\nreload(idmmobil_merge_vehicle)\r\nfrom vehicles.idmmobil_merge_vehicle import IDMMOBILVehicleMerge\r\n# import time\r\n\r\nclass EnvInitializor():\r\n def __init__(self, config):\r\n self.lanes_n = config...
[ [ "numpy.random.seed", "numpy.random.uniform" ] ]
julienschuermans/pyod
[ "d0e550c8e05fe31cda05701c53aee8d06ea3c320" ]
[ "pyod/test/test_copod.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport sys\n\nimport unittest\n# noinspection PyProtectedMember\nfrom numpy.testing import assert_allclose\nfrom numpy.testing import assert_array_less\nfrom numpy.testing import assert_equal\nfrom numpy.t...
[ [ "numpy.testing.assert_equal", "numpy.testing.assert_array_less", "scipy.stats.rankdata", "numpy.testing.assert_raises", "sklearn.metrics.roc_auc_score" ] ]
JMuff22/Scripts
[ "1cbc431031584c50e918e90be1b44715833e3f32", "1cbc431031584c50e918e90be1b44715833e3f32" ]
[ "casino/positron_utils/reconstruct_mp_grid.py", "casino/positron_utils/errorbar_on_expval.py" ]
[ "import numpy as np\nimport sys\nimport argparse\n\ndef get_args():\n\n args_parser = argparse.ArgumentParser()\n\n args_parser.add_argument(\n '--fsymmat',\n help='File containing sytmmetry matrices..',\n type=str,\n default='SYMMAT.txt'\n )\n\n args_parser.add_argument(\n '--fktot',\n help='...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.matmul", "numpy.zeros" ], [ "numpy.array", "numpy.linalg.norm", "numpy.matmul", "matplotlib.pyplot.errorbar", "numpy.zeros", "matplotlib.pyplot.grid", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.me...
DuXDaniel/autolamella
[ "932130999c0973db770bdf023db0d641218e50cd" ]
[ "tests/test_milling.py" ]
[ "import os\n\nimport numpy as np\nimport pytest\n\nimport autolamella\nfrom autolamella.milling import _upper_milling_coords, _lower_milling_coords\n\nautoscript = pytest.importorskip(\n \"autoscript_sdb_microscope_client\", reason=\"Autoscript is not available.\"\n)\n\n\n@pytest.fixture\ndef microscope():\n ...
[ [ "numpy.isclose" ] ]
tanaes/scikit-bio
[ "cd2725074ea55838fa357d341c4f214196ed017a" ]
[ "skbio/stats/ordination/tests/test_correspondence_analysis.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n# ---------------------------------...
[ [ "numpy.array", "scipy.spatial.distance.pdist", "numpy.asarray", "numpy.testing.assert_almost_equal", "pandas.DataFrame", "numpy.any", "numpy.sqrt", "numpy.testing.assert_raises" ] ]
bagmarnikhil/moviespectrum
[ "b37fd84be51e80b20d4bdd8ca8bfd24bbbaa42d8" ]
[ "handlers/DatasetHandler.py" ]
[ "import os\nimport pandas as pd\nimport numpy as np\n\ngenres = [\n \"Action\",\n \"Adventure\",\n \"Animation\",\n \"Children\",\n \"Comedy\",\n \"Crime\",\n \"Documentary\",\n \"Drama\",\n \"Fantasy\",\n \"Film-Noir\",\n \"Horror\",\n \"Musical\",\n \"Mystery\",\n \"Roman...
[ [ "numpy.array" ] ]
Bob-Chou/analytics-zoo
[ "e6b57887d06c4bcbb1f5e683b2a61bbc221c9cbf" ]
[ "pyzoo/test/zoo/models/anomalydetection/test_anomalydetector.py" ]
[ "#\n# Copyright 2018 Analytics Zoo 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 applicable ...
[ [ "numpy.random.seed", "numpy.allclose", "numpy.random.rand" ] ]
jimmyyhwu/spatial-action-maps
[ "07a29accafdd5a06094d37dc9bd2bdcc244f806d" ]
[ "models.py" ]
[ "from torch.nn import Module, Conv2d\nimport torch.nn.functional as F\nimport resnet\n\n\nclass SteeringCommandsDQN(Module):\n def __init__(self, num_input_channels=3, num_output_channels=4):\n super().__init__()\n self.resnet18 = resnet.resnet18(num_input_channels=num_input_channels, num_classes=n...
[ [ "torch.nn.Conv2d", "torch.nn.functional.interpolate" ] ]
mberr/torch_max_mem
[ "b65f995909f87df2e0b10dc4ef5fb262a4595e84" ]
[ "tests/test_decorator.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Tests.\"\"\"\n\nimport unittest\n\nimport numpy.testing\nimport torch\n\nfrom torch_max_mem import maximize_memory_utilization\nfrom torch_max_mem.api import maximize_memory_utilization_decorator\n\n\ndef knn(x, y, batch_size, k: int = 3):\n \"\"\"Compute k-nearst neigbors via b...
[ [ "torch.device", "torch.cuda.is_available", "torch.cdist", "torch.rand" ] ]
rurusasu/OrigNet
[ "3b3384cb3d09b52c7c98bb264901285f006e51c1" ]
[ "lib/datasets/ARCdataset/ARCutils.py" ]
[ "import os\nimport random\nimport sys\nfrom distutils.dir_util import copy_tree\nfrom glob import glob\nfrom typing import Dict, List, Literal, Union\n\nsys.path.append(\"../../\")\nsys.path.append(\"../../../\")\n\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as stats\nimport skimage.io ...
[ [ "numpy.logical_not", "scipy.stats.mode", "numpy.array", "numpy.max", "numpy.zeros", "numpy.logical_and", "pandas.read_json", "numpy.maximum" ] ]
rjalif199/Xtreme-Vision
[ "15ff71ccdcdbb76637524fe30559ce1671f3bbfb" ]
[ "xtreme_vision/Estimation/__init__.py" ]
[ "\"\"\"\nMIT License\n\nCopyright (c) 2020 Adeel <kingadeel2017@outlook.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\...
[ [ "numpy.array" ] ]
dvschultz/lag
[ "48b17003ddd9a5cd1ad39de5b79a69864f37fd5b" ]
[ "libml/layers.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.nn.conv2d", "tensorflow.matmul", "tensorflow.ones", "tensorflow.reshape", "tensorflow.tile", "numpy.outer", "tensorflow.random_normal", "tensorflow.add_to_collection", "tensorflow.reduce_mean", "numpy.concatenate", "tensorflow.nn.avg_pool", "tensorflow.s...
jramcast/ml_weather
[ "e684408558a8b9960e9772cd5fe9fd89fe869408" ]
[ "example8/test.py" ]
[ "from sklearn.externals import joblib\nfrom preprocessing import *\n\n\nclf = joblib.load('models/k1.pkl')\nresult = clf.predict([\n \"Another warm day inland with increasing sunshine after early morning clouds and a few widely scattered showers\"\n])\nprint(result)" ]
[ [ "sklearn.externals.joblib.load" ] ]
dch312/scipy
[ "8d8483dfc7dea469893dea946043fc5a85942ea4", "8d8483dfc7dea469893dea946043fc5a85942ea4" ]
[ "scipy/sparse/tests/test_base.py", "scipy/signal/__init__.py" ]
[ "#\n# Authors: Travis Oliphant, Ed Schofield, Robert Cimrman, Nathan Bell, and others\n\n\"\"\" Test functions for sparse matrices. Each class in the \"Matrix class\nbased tests\" section become subclasses of the classes in the \"Generic\ntests\" section. This is done by the functions in the \"Tailored base\nclass ...
[ [ "numpy.testing.assert_allclose", "numpy.int8", "numpy.dot", "numpy.random.rand", "scipy.sparse.bsr_matrix", "numpy.multiply", "scipy._lib.six.zip", "scipy.sparse.sputils.isscalarlike", "scipy.sparse.linalg.inv", "numpy.conjugate", "scipy._lib.six.xrange", "numpy.iss...
median-research-group/LibMTL
[ "b0937ff59429a7cfbca66fe6bc3385258c2d6461", "b0937ff59429a7cfbca66fe6bc3385258c2d6461" ]
[ "LibMTL/trainer.py", "examples/office/create_dataset.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\nfrom LibMTL._record import _PerformanceMeter\nfrom LibMTL.utils import count_parameters\n\nclass Trainer(nn.Module):\n r'''A Multi-Task Learning Trainer.\n\n This is a unified and extensible training framework for mul...
[ [ "torch.zeros", "torch.device", "torch.no_grad", "numpy.zeros" ], [ "torch.utils.data.DataLoader" ] ]
tsutterley/tsutterley.github.io
[ "5ea365aa34b46c8f0b471252e37e1a93bb126ff8" ]
[ "data/read_cpt.py" ]
[ "#!/usr/bin/env python\nu\"\"\"\nread_cpt.py\nWritten by Tyler Sutterley (09/2020)\nReads a GMT color palette table for use with matplotlib cmap functions\nCan import HSV (hue-saturation-value) or RGB values\n\nCALLING SEQUENCE:\n cpt = read_cpt(cpt_file)\n cmap = colors.LinearSegmentedColormap('cpt_import', ...
[ [ "numpy.array" ] ]
Mooonside/panopticapi
[ "024924d5147ca6e2085f51b2bd8682645afbbf3c" ]
[ "converters/2channels2panoptic_coco_format.py" ]
[ "#!/usr/bin/env python\n'''\nThis script converts panoptic segmentation predictions stored in 2 channels\npanoptic format to COCO panoptic format.\n\n2 channels format is described in the panoptic segmentation paper\n(https://arxiv.org/pdf/1801.00868.pdf). Two labels are assigned to each pixel of\na segment:\n- sem...
[ [ "numpy.unique", "numpy.zeros", "numpy.array_split" ] ]
jireh-father/tensorflow-triplet-loss
[ "c8a3b3efbf4c68f63d58ee3bedaa8e42451f6a80" ]
[ "dataset/script/warehouse2shop_statistics.py" ]
[ "import os, glob, shutil\n\ncategory_file = \"D:/data/fashion/image_retrieval/warehouse2shop_for_train/category.txt\"\nimage_dir = \"D:/data/fashion/image_retrieval/warehouse2shop_for_train/train\"\n\nf = open(category_file)\nlines = f.readlines()\ncategory_list = {}\nfor line in lines:\n line_split = line.rstri...
[ [ "numpy.array" ] ]
CVxTz/ReconstructionAuxLoss
[ "0d3b6651bd72aace2f10a698ae2d907a1b4f1bd5" ]
[ "audio/lstm_genre_classification.py" ]
[ "import json\nfrom glob import glob\n\nimport numpy as np\nimport pytorch_lightning as pl\nimport torch\nfrom audio_processing import random_crop\nfrom prepare_data import get_id_from_path\nfrom pytorch_lightning.loggers import TensorBoardLogger\nfrom sklearn.model_selection import train_test_split\nfrom torch.nn i...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.LSTM", "torch.max", "torch.nn.functional.l1_loss", "numpy.load", "torch.nn.functional.cross_entropy", "torch.tensor", "torch.utils.data.DataLoader", "sklearn.model_selection.train_test_split" ] ]
kanhua/pypvcell
[ "93c752e2067718f108fc9f6c6270abdac721c526" ]
[ "tests/test_high_precision_cell.py" ]
[ "import unittest\n\nimport scipy.constants as sc\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom pypvcell.solarcell import HighPSQCell, DiodeSeriesConnect\nfrom pypvcell.illumination import load_astm\n\nimport matplotlib.pyplot as plt\n\n\nclass TestHighPrecisionSQCellCase(unittest.TestCase):\n\n def ...
[ [ "numpy.isclose", "matplotlib.pyplot.plot", "numpy.allclose", "matplotlib.pyplot.show", "numpy.linspace" ] ]
dreamtimedapp/catalyst
[ "83e2e2b23c0266bde1c11e68a6acde7460c6eadf", "83e2e2b23c0266bde1c11e68a6acde7460c6eadf" ]
[ "tests/test_history.py", "tests/pipeline/test_filter.py" ]
[ "#\n# Copyright 2016 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...
[ [ "numpy.full", "numpy.array", "pandas.Index", "numpy.isnan", "numpy.zeros", "numpy.testing.assert_equal", "numpy.testing.assert_almost_equal", "pandas.DataFrame", "numpy.testing.assert_array_equal", "pandas.Timestamp", "numpy.arange", "pandas.Series" ], [ "nu...
ElcoK/WISC
[ "c3779b387664b37cdfc49399202c74ab30531066" ]
[ "scripts/analyze.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jun 4 20:48:37 2018\n\n@author: elcok\n\"\"\"\nimport os\nimport sys\nimport numpy as np\nimport geopandas as gpd\nimport pandas as pd\n\nsys.path.append(os.path.join( '..'))\nfrom scripts.functions import region_exposure,region_losses,poly_files,load_sample\nfrom s...
[ [ "pandas.set_option", "pandas.concat" ] ]
echapuis/Quant-StockPredictor
[ "63ac0cd61ff4dd030d79cd52004a5135da4ea831" ]
[ "util.py" ]
[ "\"\"\"MLT: Utility code.\"\"\"\n\nimport os\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndef symbol_to_path(symbol, base_dir=\"data\"):\n \"\"\"Return CSV file path given ticker symbol.\"\"\"\n return os.path.join(base_dir, \"{}.csv\".format(str(symbol)))\n\ndef get_data(symbols, dates, addSPY=Tr...
[ [ "pandas.DataFrame", "matplotlib.pyplot.show" ] ]
AmineKheldouni/DirectFuturePrediction
[ "01cca18deda5a5210618795002ccbc3370057250", "01cca18deda5a5210618795002ccbc3370057250" ]
[ "DDQN_REINFORCE_A2C/dqn.py", "DDQN_REINFORCE_A2C/a2c.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import print_function\n\nimport skimage as skimage\nfrom skimage import transform, color, exposure\nfrom skimage.viewer import ImageViewer\nimport random\nfrom random import choice\nimport numpy as np\nfrom collections import deque\nimport time\n\nimport json\nfrom keras.mode...
[ [ "numpy.max", "numpy.array", "numpy.random.rand", "numpy.reshape", "numpy.zeros", "numpy.rollaxis", "tensorflow.Session", "tensorflow.ConfigProto", "numpy.stack", "numpy.argmax", "numpy.append", "numpy.expand_dims" ], [ "numpy.zeros_like", "numpy.array", ...
fangde/tensorlayer
[ "ccff5ed3932f62ebfca7c2da5fa1d2438294ef23" ]
[ "tests/test_layers_normalization.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport unittest\n\nimport tensorflow as tf\nimport tensorlayer as tl\n\n\ndef model(x, is_train=True, reuse=False):\n with tf.variable_scope(\"model\", reuse=reuse):\n n = tl.layers.InputLayer(x, name='in')\n n = tl.layers.Conv2d(n, n_filter=80, name...
[ [ "tensorflow.reset_default_graph", "tensorflow.logging.set_verbosity", "tensorflow.placeholder", "tensorflow.variable_scope" ] ]
alvarosg/jax
[ "cd54dd977897f868c3f55723604054d43db801e8" ]
[ "tests/random_test.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.dot", "numpy.sort", "numpy.dtype", "numpy.full", "numpy.log", "numpy.eye", "numpy.prod", "numpy.arange", "numpy.transpose", "numpy.sqrt", "numpy.linalg.cholesky", "numpy.array", "numpy.delete", "numpy.zeros", "numpy.einsum", "numpy.result_type...
J-L-O/IIC
[ "9e25a728b3ad4c626882c45e25ee44b99153bfba" ]
[ "src/utils/cluster/k_means_assess.py" ]
[ "import numpy as np\nfrom sklearn.cluster import KMeans\n\nfrom .cluster_eval import _acc, _original_match, _hungarian_match\n\n\ndef multioutput_k_means_assess(config, x_outs_all, targets, verbose=0):\n assert (False) # outdated function\n num_sub_heads = len(x_outs_all)\n print((\"assessing multioutput ...
[ [ "sklearn.cluster.KMeans", "numpy.zeros" ] ]
alba83/tensorlow_example_1
[ "9c6a6ef737a1ac93615102fff599d28b65cc20bc" ]
[ "nmt/utils/misc_utils.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.shape", "tensorflow.gfile.Exists", "tensorflow.gfile.GFile", "tensorflow.ConfigProto", "tensorflow.Summary.Value", "tensorflow.contrib.training.HParams" ] ]
rilee0203/MachUpX
[ "b92054b2262cf8b7e318f32c7614f3d08243d7ae" ]
[ "dev/studies/linear_sweep_blending_distance_study.py" ]
[ "import os\n\nimport machupX as MX\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport multiprocessing as mp\n\nfrom helpers import get_grayscale_range, richardson_extrap\n\n\n# Study params\nN_sb = 10\nblending_distances = np.logspace(-3, 1, N_sb)\nN_grids = 10\ngrids = np.logspace(np.log10(5), np.log10(3...
[ [ "matplotlib.pyplot.xscale", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.log10", "numpy.logspace" ] ]
RamiSketcher/spinningupMPAC
[ "543a3587ef88cd098ec2f060f183d0f9969e92e3", "543a3587ef88cd098ec2f060f183d0f9969e92e3" ]
[ "spinup/algos/pytorch/memb_pl/core.py", "spinup/algos/pytorch/memb_pe/core.py" ]
[ "# (Rami) Modified\n# (Rami & Gaffar) Done 1st reading, Feb 22, 2020\n\n\n# import numpy as np\n# import tensorflow as tf\n\n\n# Imports\n# General\nimport os\nfrom typing import Tuple\n\n## ML & RL Impoorts\nimport numpy as np\n# import scipy.signal\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functiona...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.functional.softplus", "numpy.log", "torch.nn.Sequential", "torch.no_grad", "torch.distributions.normal.Normal", "torch.clamp", "torch.squeeze", "numpy.prod", "numpy.isscalar", "torch.utils.data.DataLoader", "torch.tanh",...
gfjiangly/RCNet
[ "ef6860f23943eb8e21fdec565019f2f8eda17673" ]
[ "src/lib/models/networks/DCNv2/build_double.py" ]
[ "import os\r\nimport torch\r\nfrom torch.utils.ffi import create_extension\r\n\r\n\r\nsources = ['src/dcn_v2_double.c']\r\nheaders = ['src/dcn_v2_double.h']\r\ndefines = []\r\nwith_cuda = False\r\n\r\nextra_objects = []\r\nif torch.cuda.is_available():\r\n print('Including CUDA code.')\r\n sources += ['src/dc...
[ [ "torch.cuda.is_available", "torch.utils.ffi.create_extension" ] ]
pitmonticone/probnum
[ "1fed705b2443a14d08419e16f98f6ef815ae9ffa" ]
[ "tests/test_filtsmooth/test_particle/test_particle_filter.py" ]
[ "import numpy as np\nimport pytest\n\nimport probnum.problems.zoo.filtsmooth as filtsmooth_zoo\nfrom probnum import filtsmooth, randvars\n\n\ndef test_effective_number_of_events():\n weights = np.random.rand(10)\n categ = randvars.Categorical(\n support=np.random.rand(10, 2), probabilities=weights / np...
[ [ "numpy.sum", "numpy.sin", "numpy.random.rand", "numpy.sqrt" ] ]
vizero1/incubator-tvm
[ "24c53a343b0ecb76ed766d3f29e968ee0f8b0816" ]
[ "tests/python/unittest/test_codegen_cuda.py" ]
[ "\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\");...
[ [ "numpy.full", "numpy.random.uniform", "numpy.random.randint", "numpy.zeros" ] ]
mwernli/digilog-crawling
[ "487553dd7e1b1c46caf12fba67e369e6f7bcf8c9" ]
[ "analysis/analysis_single/analysis_crawl.py" ]
[ "#single analyze\nimport re\nimport spacy\nfrom spacy.util import filter_spans\nfrom DataSourceSlim import DataSourceSlim\nfrom spaczz.matcher import FuzzyMatcher\nimport numpy as np\nimport pandas as pd\nimport logging\nimport os\nfrom progressbar import progressbar\nfrom bs4 import BeautifulSoup\nimport numpy as ...
[ [ "numpy.quantile" ] ]
ChanaRoss/Thesis
[ "39ab83d52055d401a3bb71da25b3458ad9196ecd" ]
[ "Simulation/Anticipitory/PlotResultsFromSimulationMIO_V1.py" ]
[ "import numpy as np\nimport pickle\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nimport seaborn as sns\nfrom ipywidgets import interact\nimport imageio\n# import my file in order to load state class from pickle\nfrom simAnticipatoryWithMIO_V1 import *\n\nsns.set()\n# load logs\npickleNames = []\n\n# ...
[ [ "numpy.max", "matplotlib.pyplot.text", "numpy.array", "matplotlib.pyplot.xlim", "numpy.zeros", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matpl...