repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
issamhammad/conv3d-video-action-recognition | [
"362087449c7df68b3c43d87149afff14bad792c2"
] | [
"python/pca_svm.py"
] | [
"from sklearn.decomposition import PCA\nfrom sklearn.svm import LinearSVC\nfrom sklearn.metrics import classification_report\nimport numpy as np\n\n\ndef run_pca(X_train, X_test, n_components):\n \"\"\"\n Apply PCA on features\n \n Parameters\n ----------\n X_train : array\n Array of train ... | [
[
"numpy.sum",
"sklearn.decomposition.PCA",
"sklearn.svm.LinearSVC"
]
] |
fabioc-ms/driverlessai-recipes | [
"5d9f9a7d44a666e735740ae986901742eec9c50a"
] | [
"data/databases/create_dataset_from_mongodb_collection.py"
] | [
"\"\"\"Create dataset from MonogDB\"\"\"\n\n# Author: Nicholas Png\n# Created: 31/01/2020\n# Last Updated: 20/02/2020\n\nimport datatable as dt\nimport pandas as pd\nfrom h2oaicore.data import CustomData\n\n\n_global_modules_needed_by_name = [\"pymongo\", \"dnspython\"]\n\n# Please fill before usage\n# Note that th... | [
[
"pandas.DataFrame.from_dict"
]
] |
chapman-phys220-2018f/cw08-forced-collaboration | [
"f21237668cc18bff47fbe506357848a47717fdb7"
] | [
"sinesum.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n########\n#Name: Conner Carnahan\n#ID: 1614309\n#Email: carna104@mail.chapman.edu\n#Class: PHYS220\n#Date: Oct 16, 2018\n########\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n@np.vectorize\ndef Sn(T,t,n):\n \"\"\"Sn(float T,flo... | [
[
"numpy.linspace",
"numpy.arange",
"numpy.sin",
"numpy.sign",
"numpy.divide"
]
] |
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | [
"bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11"
] | [
"start_visualisation.py"
] | [
"\"\"\"\nDescription: \n- File to create plots\n\"\"\"\n\n\"\"\" import packages \"\"\"\nimport os\nimport pandas as pd\nfrom pathlib import Path\n\n\n\"\"\" import project libraries \"\"\"\nimport modules.data.plot as plot\nimport modules.data.datamgm as dtm\n\n\"\"\" import configurations \"\"\"\nimport configura... | [
[
"pandas.concat"
]
] |
arnavdas88/QuTIpy | [
"0cd8263f7f6153b0de86e87479946e5479abc168"
] | [
"qutipy/Weyl/__init__.py"
] | [
"# This file is part of the QuTIpy package.\n# https://github.com/sumeetkhatri/QuTIpy\n#\n# Copyright (c) 2022 Sumeet Khatri.\n# --.- ..- - .. .--. -.--\n#\n#\n# SPDX-License-Identifier: AGPL-3.0\n#\n# This program is free software: you can redis... | [
[
"numpy.linalg.matrix_power",
"numpy.exp",
"numpy.zeros"
]
] |
undeadinu/datasets | [
"a6f1bce86404d534b7343fb90f0ebfd6d098c346"
] | [
"tensorflow_datasets/core/utils/py_utils.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"tensorflow.gfile.Rename",
"tensorflow.gfile.Open"
]
] |
edoarn/cv-models | [
"5fa7e50fd69f76b54611bb323b15610eeb1bb5cf"
] | [
"cvmodels/segmentation/deeplab.py"
] | [
"from enum import Enum\nfrom typing import Type, Tuple\nimport torch\nimport torch.nn as nn\n\nfrom cvmodels.segmentation.backbones import resnet as rn, xception as xc\n\n\nclass ASPPVariants(Enum):\n \"\"\"Enum describing the possible dilations in the Atrous spatial Pyramid Pooling block.\n There are essenti... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Upsample",
"torch.rand",
"torch.nn.ReLU"
]
] |
Camiloasc1/AstronomyUNAL | [
"0d533c1737e5328605c70f614024e1759e8d0962"
] | [
"CelestialMechanics/orbits/parable.py"
] | [
"from typing import Tuple\n\nimport numpy as np\nfrom astropy import units as u\n\n\ndef r(q: float, angle: float) -> float:\n \"\"\"\n r = 2 * q / (1 + np.cos(angle))\n\n :param q: pericentric distance\n :type q: float\n :param angle: theta angle\n :type angle: float\n :return: radius vector\n... | [
[
"numpy.sqrt",
"numpy.arctan",
"numpy.abs",
"numpy.arccos",
"numpy.cos",
"numpy.sin",
"numpy.tan",
"numpy.sign",
"numpy.deg2rad"
]
] |
a3sha2/aslprep | [
"b92ff4a6526351df91f37de3bf56d90d13d89286"
] | [
"aslprep/interfaces/cbf_computation.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport nibabel as nb\nfrom nibabel.processing import smooth_image\nfrom scipy.stats import gmean\nfrom nipype import logging\nfrom nipype.utils.filemanip import fname_presuffix\nfrom nipype.interfaces.base import (traits, TraitedSpec, BaseInterfaceInputSpec, Simp... | [
[
"numpy.minimum",
"numpy.sqrt",
"numpy.nan_to_num",
"pandas.DataFrame",
"numpy.mean",
"numpy.zeros_like",
"numpy.nanmean",
"numpy.var",
"numpy.exp",
"numpy.divide",
"pandas.read_csv",
"numpy.subtract",
"numpy.sin",
"numpy.finfo",
"numpy.std",
"numpy.a... |
GuptaVishu2002/IRNET | [
"a430d17df3ececfe6cfd8ab469fff070e1c262e7"
] | [
"IRNET17_NEW.py"
] | [
"# Larger CNN for the MNIST Dataset\nimport tensorflow as tf\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.layers import Dropout\nfrom tensorflow.keras.layers import Flatten\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.layers i... | [
[
"pandas.read_csv",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"numpy.asarray",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.concatenate",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras... |
rlnsanz/inspectional-rara-parakeet | [
"2c7919ed432616ec016a5afcd6718d16fa65e8af"
] | [
"examples/housing/housing_price_sliced.py"
] | [
"import gadget as ln\n\nwith ln.tracking(\"housing_price\"):\n\n import dbfread\n import pandas as pd\n\n from sklearn.ensemble import RandomForestClassifier\n\n ln.importing(\n dbfread, module=\"dbfread\", name=\"dbfread\", line_no=2\n ) ###############################\n ln.importing(\n ... | [
[
"sklearn.ensemble.RandomForestClassifier",
"pandas.DataFrame"
]
] |
jvfe/BioProv | [
"fe19342bec91931f226726a7c867210dc703040e"
] | [
"bioprov/workflows/workflows.py"
] | [
"__author__ = \"Vini Salazar\"\n__license__ = \"MIT\"\n__maintainer__ = \"Vini Salazar\"\n__url__ = \"https://github.com/vinisalazar/bioprov\"\n__version__ = \"0.1.22\"\n\n\"\"\"\nModule containing preset workflows created with the Workflow class.\n\"\"\"\n\nfrom bioprov.programs import blastn, prodigal\nfrom biopr... | [
[
"pandas.read_csv"
]
] |
TanjaBayer/craft-text-detector | [
"7daddaf5612d454e9fe570873ac21bc3f19472ac"
] | [
"craft_text_detector/predict.py"
] | [
"import os\nimport time\n\nimport cv2\nimport numpy as np\n\nimport craft_text_detector.craft_utils as craft_utils\nimport craft_text_detector.image_utils as image_utils\nimport craft_text_detector.torch_utils as torch_utils\n\n\ndef get_prediction(\n image,\n craft_net,\n refine_net=None,\n text_thresh... | [
[
"numpy.array"
]
] |
refaev/combat_gym | [
"f02fcf98e95a1dda29cdddd4ae271de3e18ea3bf"
] | [
"gym_combat/gym_combat/envs/DQN/deeprl_prj/core_one_screen_array.py"
] | [
"\"\"\"Core classes.\"\"\"\n\nimport numpy as np\nfrom gym_combat.envs.DQN.DQN_constants import *\nfrom PIL import Image\n\nclass Sample:\n \"\"\"Represents a reinforcement learning sample.\n\n Used to store observed experience from an MDP. Represents a\n standard `(s, a, r, s', terminal)` tuple.\n\n Pa... | [
[
"numpy.min",
"matplotlib.pyplot.subplots",
"numpy.transpose",
"numpy.zeros",
"numpy.random.randint"
]
] |
cuongtv312/int3405-examples | [
"c9e9f9944a12e210002868fe97c80b47f1e51d10"
] | [
"week03/naive_bayes.py"
] | [
"\"\"\"\nImplement Naive Bayes model, using smoothing constant L\n\nName:\nClass:\nMSSV:\n\nYou should understand your code\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport math\nfrom sklearn.metrics import accuracy_score, f1_score\n\n\nclass NaiveBayes:\n\n def __init__(self, L=0):\n self.L = L... | [
[
"pandas.read_csv",
"numpy.random.seed",
"sklearn.metrics.f1_score",
"numpy.where",
"sklearn.metrics.accuracy_score"
]
] |
alex-s-v/filterer | [
"c6ce02ae5a7cccceefcdb387c9be504e6cbcd6b6"
] | [
"cli.py"
] | [
"from configparser import ConfigParser\nfrom pathlib import Path\nfrom copy import deepcopy\n\nimport pandas as pd\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n\nfrom filterer import (\n process_data,\n compare_data\n)\n\n\ndef main(config):\n \"\"\"Main algorithm function\n\n Parameters\... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.scatter",
"matplotlib.style.use",
"matplotlib.pyplot.ylim",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylabel",
"mat... |
TillMacher/TaxonTableTools | [
"9b5c6356acd9890465d39f16b671eb346ceec25a"
] | [
"taxontabletools/check_taXon_table_format.py"
] | [
"# check the input format\ndef check_taXon_table_format(taXon_table):\n\n import PySimpleGUI as sg\n import pandas as pd\n import numpy as np\n from pathlib import Path\n\n try:\n taXon_table_df = pd.read_excel(Path(taXon_table), \"TaXon table\")\n taXon_table_df = taXon_table_df.replac... | [
[
"pandas.DataFrame"
]
] |
alkasm/pandas | [
"966757faa28cc536b1bca4856f1dc693ec0bd2ea"
] | [
"pandas/tests/io/test_html.py"
] | [
"from functools import partial\nfrom importlib import reload\nfrom io import BytesIO, StringIO\nimport os\nimport re\nimport threading\nfrom urllib.error import URLError\n\nimport numpy as np\nfrom numpy.random import rand\nimport pytest\n\nfrom pandas.compat import is_platform_windows\nfrom pandas.errors import Pa... | [
[
"pandas.io.html._remove_whitespace",
"pandas.MultiIndex",
"pandas.compat.is_platform_windows",
"numpy.arange",
"pandas.Index",
"pandas.DataFrame",
"pandas.io.html.read_html",
"pandas.util.testing.assert_frame_equal",
"numpy.dtype",
"pandas.util.testing.assert_index_equal",
... |
LFElodie/CarND-Behavioral-Cloning-P3 | [
"9d2db7d3ce7be8700fa359a3b11a21c44d199d50"
] | [
"utils.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nfrom sklearn.utils import shuffle\nimport matplotlib.image as mpimg\n\nCORRECTION = 0.2\n\n\ndef load_data(data_folders):\n '''\n Read driving_log.csv from data folders \n '''\n samples = []\n for data_folder in data_folders:\n # Raw sample ... | [
[
"pandas.concat",
"numpy.fliplr",
"sklearn.utils.shuffle",
"matplotlib.image.imread",
"numpy.array"
]
] |
rac2030/OnFire | [
"7fba89681ed20a37581d09d81d2099c9bc242423"
] | [
"bin/Vectorizer.py"
] | [
"import numpy as np\n\nfrom sklearn.feature_extraction.text import TfidfVectorizer\n\nlist = [\"India\"]\n\nwith open('new300.csv') as f:\n for line in f:\n list.append(line)\n\nvect = TfidfVectorizer(min_df=1)\n\ntfidf = vect.fit_transform(list)\nprint(tfidf.toarray())\nprint ((tfidf * tfidf.T).A)\n\npri... | [
[
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
JulienPeloton/gcr-catalogs | [
"1e8ba090ed42b32c2b7cfed2b3227611e093d76e"
] | [
"GCRCatalogs/alphaq.py"
] | [
"\"\"\"\nAlpha Q galaxy catalog class.\n\"\"\"\nfrom __future__ import division\nimport os\nimport re\nimport warnings\nfrom distutils.version import StrictVersion # pylint: disable=no-name-in-module,import-error\nimport numpy as np\nimport h5py\nfrom astropy.cosmology import FlatLambdaCDM\nfrom GCR import BaseGene... | [
[
"numpy.sqrt",
"numpy.arange",
"numpy.cos",
"numpy.rad2deg",
"numpy.sin",
"numpy.copy",
"numpy.log10",
"numpy.random.RandomState",
"numpy.where"
]
] |
pantheon5100/simsimpp | [
"147d5cdaa986d1da1608efb6cf663826bfd57053"
] | [
"solo/methods/new_predictor.py"
] | [
"import argparse\nfrom typing import Any, Dict, List, Sequence\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom solo.losses.simsiam import simsiam_loss_func\nfrom solo.methods.base import BaseModel\nfrom solo.losses.vicreg import covariance_loss\n\n\ndef value_constrain(x, type=None):\n... | [
[
"torch.nn.functional.normalize",
"torch.nn.BatchNorm1d",
"torch.sigmoid",
"torch.zeros",
"torch.randn",
"torch.linalg.norm",
"torch.tanh",
"torch.nn.Linear",
"torch.no_grad",
"torch.nn.functional.cosine_similarity",
"torch.nn.ReLU"
]
] |
jbreitbart/detectron2 | [
"53dfc401103993a64f6714b7bfc36bcebe36e55c"
] | [
"projects/DensePose/densepose/evaluator.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport contextlib\nimport copy\nimport io\nimport itertools\nimport logging\nimport numpy as np\nimport os\nfrom collections import OrderedDict\nimport pycocotools.mask as mask_utils\nimport torch\nfrom fvcore.common... | [
[
"torch.device",
"numpy.round",
"torch.save"
]
] |
ioir123ju/mmskeleton | [
"bab5f973f00d68c5e166e450dd2ed95169a6549a"
] | [
"mmskeleton/processor/recognition_granary.py"
] | [
"#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\"\"\"\n@File : recognition_granary.py.py \n@Contact : JZ\n@License : (C)Copyright 2018-2019, Liugroup-NLPR-CASIA\n\n@Modify Time @Author @Version @Desciption\n------------ ------- -------- -----------\n2019/10/23 15:07 juzheng ... | [
[
"torch.nn.Sequential",
"numpy.uint8",
"torch.from_numpy",
"torch.tensor",
"numpy.concatenate",
"torch.no_grad",
"numpy.array",
"numpy.zeros"
]
] |
juliadeneva/NICERsoft | [
"13681678ec57a81605601714896876cb870475ff"
] | [
"scripts/photon_toa.py"
] | [
"#!/usr/bin/env python\n# Program: photon_toa.py\n# Authors: Paul S. Ray <paul.ray@nrl.navy.mil>\n# Matthew Kerr <matthew.kerr@gmail.com>\n# Julia Deneva <julia.deneva@gmail.com>\n# Description:\n# Reads a FITS file of photon event times (from NICER or another X-ray mission)\n# and generates TOAs ... | [
[
"numpy.linspace",
"numpy.asarray",
"numpy.floor",
"numpy.searchsorted",
"numpy.where"
]
] |
Migelo/lopa-sorting | [
"5ed2732262940e0c24caee8ac734c54167932bcd"
] | [
"bins.py"
] | [
"import numpy as np\nimport argparse\n\nparser = argparse.ArgumentParser(description='Generate bins.')\nparser.add_argument('beginning', help='Beginning of the first bin.', type=str)\nparser.add_argument('end', help='End of the last bin.', type=str)\nparser.add_argument('-interval', help='Size of the bin.', type=in... | [
[
"numpy.savetxt",
"numpy.float"
]
] |
LeOntalEs/transform3d | [
"f3426c3cce98298c17d3820fa2d8e1bdf92a8571"
] | [
"transform3d/transform.py"
] | [
"import cv2\nimport numpy as np\n\ndef _get_M(w, h, f, rx=0, ry=0, rz=0, dx=0, dy=0, dz=0, sx=1, sy=1, sz=1):\n A1 = np.matrix([ [1, 0, -w/2],\n [0, 1, -h/2],\n [0, 0, 1],\n [0, 0, 1]])\n S = np.matrix([[sx, 0, 0, 0],\n [0, sy, 0, 0]... | [
[
"numpy.matrix",
"numpy.radians",
"numpy.sqrt",
"numpy.cos",
"numpy.sin"
]
] |
PM25/Facial_Expression_DL | [
"9c10886b27ed13a352e8ca355b1b512cf6e92db0"
] | [
"main.py"
] | [
"import torch\nfrom PIL import Image\nimport torch.nn.functional as F\nfrom torchvision import transforms\nfrom argparse import ArgumentParser\nimport matplotlib.pyplot as plt\n\n\n# Arguments\nparser = ArgumentParser(description='Predicting Facial Expression of an Image.')\nparser.add_argument('--model', type=str,... | [
[
"torch.nn.functional.softmax",
"torch.max",
"matplotlib.pyplot.title",
"torch.load",
"torch.no_grad",
"matplotlib.pyplot.show"
]
] |
ilyakrasnou/DiplomaProject | [
"a4cfd04fc00780c254e86e47039fecf27c3cbc9b"
] | [
"PythonNeuro/weights_viewer.py"
] | [
"import numpy as np\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\n\nmodel = keras.models.load_model(\"mnist_model.h5\")\n\nfor layer in model.layers:\n weights = layer.get_weights()\n print(layer.name)\n print(weights)\n"
] | [
[
"tensorflow.keras.models.load_model"
]
] |
je-c/CryptoClassifier | [
"abce5e81e9045581df29af2f77f89e851911e0bc"
] | [
"lib/functionality/processing.py"
] | [
"import pandas as pd\nimport numpy as np\nimport datetime as dt\nimport time, csv, os, itertools, shutil, json, random\nimport btalib\n\nfrom itertools import compress\nfrom PIL import Image\n\nfrom sklearn.preprocessing import MinMaxScaler\n\ndef bool_convert(s):\n \"\"\"\n Parse string booleans from paramet... | [
[
"pandas.read_csv",
"pandas.Series",
"numpy.diff",
"numpy.array",
"pandas.to_numeric",
"sklearn.preprocessing.MinMaxScaler"
]
] |
Mistariano/Deep-Image-Matting | [
"c7e5516ca4a0729b27410c10ab8a017d92b95bf0"
] | [
"demo.py"
] | [
"import math\nimport os\nimport random\n\nimport cv2 as cv\nimport keras.backend as K\nimport numpy as np\n\nfrom data_generator import generate_trimap, random_choice, get_alpha_test\nfrom model import build_encoder_decoder, build_refinement\nfrom utils import compute_mse_loss, compute_sad_loss\nfrom utils import g... | [
[
"numpy.reshape",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"numpy.random.randint"
]
] |
georglind/fermihubbard | [
"d76ad1df6b5ea57abf7b290576bbca4dd5275aeb"
] | [
"example.py"
] | [
"from __future__ import division, print_function\nimport numpy as np\nimport lintable as lin\nimport fermihubbard\n\nimport scipy.sparse as sparse\n\n# The model parameters:\n\n# The onsite energies (0)\nH1E = np.zeros((4, 4))\n\n# Hopping on a ring\nH1T = np.zeros((4, 4))\nfor i in xrange(4):\n H1T[i, (i+1) % 4... | [
[
"numpy.arange",
"numpy.eye",
"numpy.zeros"
]
] |
SkyfengBiuBiu/pytorch-detect-to-track_1 | [
"afdfdf505deca4506ebc594ec0c2eb032a2a5569"
] | [
"lib/model/correlation/build.py"
] | [
"import os\nimport torch\nimport torch.utils.ffi\n\nstrBasepath = os.path.split(os.path.abspath(__file__))[0] + '/'\nstrHeaders = []\nstrSources = []\nstrDefines = []\nstrObjects = []\n\nif torch.cuda.is_available() == True:\n strHeaders += ['src/correlation_cuda.h']\n strSources += ['src/correlation_cuda.c']... | [
[
"torch.cuda.is_available"
]
] |
MolecularAI/pysmilesutils | [
"9fadf5c34fb21d50cf79e56a3ed1033e4d5015e5"
] | [
"examples/examples_data.py"
] | [
"\n# %%\n# %load_ext autoreload\n# %autoreload 2\n\nimport torch\nimport h5py\nimport time\n\nfrom torch.utils.data import Dataset, TensorDataset, DataLoader\nfrom pysmilesutils.datautils import BlockDataLoader, BucketBatchSampler, MultiDataset\n\nfrom tqdm.notebook import tqdm\n\n\n# %% [markdown]\n# # `BlockDataL... | [
[
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.randint",
"torch.arange"
]
] |
boschresearch/blackboxopt | [
"85abea86f01a4a9d50f05d15e7d850e3288baafd"
] | [
"blackboxopt/optimizers/staged/iteration.py"
] | [
"# Copyright (c) 2020 - for information on the respective copyright owner\n# see the NOTICE file and/or the repository https://github.com/boschresearch/blackboxopt\n#\n# SPDX-License-Identifier: Apache-2.0\n\nimport copy\nimport logging\nfrom dataclasses import dataclass\nfrom typing import Callable, Dict, List, Op... | [
[
"numpy.isfinite"
]
] |
vijoin/ibis | [
"9d1086d7d29c2d3760c8150d8641ab51799720cd"
] | [
"ibis/expr/datatypes.py"
] | [
"import builtins\nimport collections\nimport datetime\nimport functools\nimport itertools\nimport numbers\nimport re\nimport typing\nfrom typing import Any as GenericAny\nfrom typing import (\n Callable,\n Iterator,\n List,\n Mapping,\n NamedTuple,\n Optional,\n Sequence,\n)\nfrom typing import... | [
[
"pandas.Timestamp"
]
] |
Jasonpoh/lenstronomy_sims | [
"dcdfc61ce5351ac94565228c822f1c94392c1ad6"
] | [
"lenstronomy/LensModel/Profiles/sis_truncate.py"
] | [
"__author__ = 'sibirrer'\n\nimport numpy as np\n\nclass SIS_truncate(object):\n \"\"\"\n this class contains the function and the derivatives of the Singular Isothermal Sphere\n \"\"\"\n param_names = ['theta_E', 'r_trunc', 'center_x', 'center_y']\n lower_limit_default = {'theta_E': 0, 'r_trunc': 0, ... | [
[
"numpy.zeros_like",
"numpy.sqrt"
]
] |
bing-jian/diffusion-mri | [
"3dad34ae002b4435dd6693a2e4b71b46c889e172"
] | [
"Python/test/test_condition_number.py"
] | [
"#!/usr/bin/env python\n#coding=utf-8\n\nimport os\nimport matplotlib\nimport pylab\n\nfrom dwmri.utils import *\n\ndef compute_wishart_A(p):\n g = pylab.load('81vectors.txt')\n B = prepareB(math.sqrt(1500.0)*g)\n ew = [0.0015,0.0004,0.0004]\n ev1 = pylab.load('81vectors.txt')\n ev2 = pylab.load('321... | [
[
"matplotlib.font_manager.FontProperties",
"matplotlib.rc"
]
] |
raunaqtri1/MINT-Transformation | [
"cdb95ff3ee05b109e5f2a1016d52702819691701"
] | [
"funcs/topoflow/topoflow/components/channels_base.py"
] | [
"\n# See \"d_bankfull\" in update_flow_depth() ######## (2/21/13)\n# NB! update_diversion() is currently COMMENTED OUT.\n# See \"(5/13/10)\" for a temporary fix.\n\n#------------------------------------------------------------------------\n# Copyright (c) 2001-2020, Scott D. Peckham\n#\n# Apr 2020. Added set_... | [
[
"numpy.minimum",
"numpy.sqrt",
"numpy.where",
"numpy.double",
"numpy.sin",
"numpy.size",
"numpy.float32",
"numpy.zeros",
"numpy.log",
"numpy.invert",
"numpy.isnan",
"numpy.tan",
"numpy.array",
"numpy.sum",
"numpy.maximum",
"numpy.isfinite",
"nump... |
eshanmherath/computer_vision_expert_nd | [
"46b4c4377af497fe6b6316ecf954d492148c0d01"
] | [
"06.classifying_day_and_night/01.pixel_based_run.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nimport helpers\n\nimage_dir_train = 'day_night_images/training'\nimage_dir_test = 'day_night_images/test'\n\nIMAGE_LIST = helpers.load_dataset(image_dir_train)\n\n# Visualize one image\n\nimage_index = 0\nselected_image = IMAGE_LIST[image_index][0]\nselected_l... | [
[
"matplotlib.pyplot.imshow",
"numpy.min",
"numpy.max",
"numpy.average",
"matplotlib.pyplot.show"
]
] |
Nozdi/masters | [
"eb4fe26ce14a731145f128b59884ba9d80000bf6"
] | [
"ladder/train.py"
] | [
"#!/usr/bin/env python\n\nimport logging\nimport os\nfrom collections import OrderedDict\nimport sys\n\nimport numpy\nimport theano\nfrom theano.tensor.type import TensorType\n\nfrom blocks.algorithms import GradientDescent, Adam\nfrom blocks.extensions import FinishAfter\nfrom blocks.extensions.monitoring import T... | [
[
"numpy.load",
"numpy.require",
"numpy.vstack"
]
] |
mrkwjc/cupy | [
"ae9705dcc8b59ed05a6c91fdfb401b71f7c2b224"
] | [
"tests/cupy_tests/test_cublas.py"
] | [
"import unittest\n\nimport numpy\n\nimport cupy\nfrom cupy import cublas\nfrom cupy import testing\nfrom cupy.testing import attr\n\n\n@testing.parameterize(*testing.product({\n 'dtype': ['float32', 'float64', 'complex64', 'complex128'],\n 'n': [10, 33, 100],\n 'bs': [None, 1, 10],\n 'nrhs': [None, 1, 1... | [
[
"numpy.linalg.svd",
"numpy.dtype",
"numpy.einsum"
]
] |
FizzBuzzCoder/dowhy | [
"4e93c0d04a74c9ea8f29265dcd0c9cc3fc7f8112"
] | [
"dowhy/causal_estimators/instrumental_variable_estimator.py"
] | [
"import numpy as np\nimport sympy as sp\nimport sympy.stats as spstats\n\nfrom dowhy.causal_estimator import CausalEstimate\nfrom dowhy.causal_estimator import CausalEstimator\nfrom dowhy.causal_estimator import RealizedEstimand\n\n\nclass InstrumentalVariableEstimator(CausalEstimator):\n \"\"\"Compute effect of... | [
[
"numpy.dot",
"numpy.mean",
"numpy.unique"
]
] |
RyanElliott10/slope | [
"3247b04181cb6696978ce544382d97fa570b862d"
] | [
"slope/utils/preco_parser.py"
] | [
"from enum import Enum\n\nimport pandas as pd\nfrom pandas import DataFrame, read_json\n\nfrom slope.utils.decorators import setter\n\n\nclass PreCoFileType(Enum):\n DEV = 'dev.json'\n TRAIN = 'train.json'\n\n\nclass PreCoParser(object):\n '''\n Parses data from PreCo formatted files. Allows filtration ... | [
[
"pandas.read_json"
]
] |
BASTAcode/BASTA | [
"6de8b8b866787d6745c4e77378bb94e0bab97090"
] | [
"basta/priors.py"
] | [
"\"\"\"\nDefinition of priors\n\nDefine any prior functions here that you want to use in BASTA!!\n\nThe prior function must be of the form:\nPRIOR = PRIORFUN(LIBITEM, INDEX)\n\nAny prior defined here can be used from an .xml input file.\n\"\"\"\nimport numpy as np\nfrom basta import utils_general as util\n\n\ndef s... | [
[
"numpy.log10"
]
] |
markovalexander/few_shot | [
"4b29ddf2efcb6c677d49bfc6eae27966343ab015"
] | [
"experiments/maml_ens_mgpu.py"
] | [
"from torch.utils.data import DataLoader\nfrom torch import nn\nimport torch.nn.functional as F\nimport argparse\nimport torch\nimport random\n\nimport sys\n\nsys.path.append('..')\n\nfrom few_shot.datasets import OmniglotDataset, MiniImageNet\nfrom few_shot.core import NShotTaskSampler, create_nshot_task_label, Ev... | [
[
"torch.device",
"torch.cuda.is_available"
]
] |
klecknerlab/muvi | [
"f7731af71d316678f9b52dd8771718d8d97bb02c"
] | [
"muvi/distortion.py"
] | [
"#!/usr/bin/python3\n#\n# Copyright 2020 Dustin Kleckner\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"numpy.asarray",
"numpy.ones",
"numpy.random.rand",
"numpy.zeros",
"numpy.empty"
]
] |
krishnatejakk/AUTOMATA | [
"fd0cf58058e39660f88d9d6b4101e30a497f6ce2"
] | [
"cords/test.py"
] | [
"import torch\n\nt = torch.rand(50, 100)\nchunked_t = torch.chunk(t, 5, dim=0)\nnew_t = []\nfor i in range(len(chunked_t)):\n new_t.append(torch.mean(chunked_t[i], dim=0).view(1, -1))\nnew_t = torch.cat(new_t, dim=0)\nprint()"
] | [
[
"torch.chunk",
"torch.mean",
"torch.rand",
"torch.cat"
]
] |
PinstripeWillie/CorePy | [
"d31a6021ce5a8cb3ad3643d630bbeabef47c07aa"
] | [
"CorePycodes/Corepy_plotting.py"
] | [
"import matplotlib.pyplot as plt\nimport seaborn as sns\nimport pickle\nimport os\nimport corepytools as corepy\nimport matplotlib.patheffects as PathEffects\nimport json\nimport pandas as pd\n\n\nCoreOfStudy = 'TiptonJonas'\n\n\nRoot_path = os.path.dirname(os.getcwd())\nCorebeta=json.load(open(os.path.join(Root_pa... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.fill",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel"
]
] |
gdhdang/pytorch-ssd | [
"c80b108cb212c517fc41cf78734612a997754450"
] | [
"vision/datasets/open_images.py"
] | [
"import numpy as np\nimport pathlib\nimport cv2\nimport pandas as pd\n\n\nclass OpenImagesDataset:\n\n def __init__(self, root,\n transform=None, target_transform=None,\n dataset_type=\"train\", balance_data=False):\n self.root = pathlib.Path(root)\n self.transform =... | [
[
"numpy.random.permutation",
"numpy.array",
"pandas.read_csv",
"numpy.zeros"
]
] |
ramonfmir/deblurring-public | [
"2fe98ef6c29913a369da83026a8e44c2e58514e9"
] | [
"cnn_denoiser/input_data.py"
] | [
"import sys\nsys.path.insert(0, \"../..\")\n\nimport cv2\nimport os\nimport glob\nimport numpy as np\nnp.set_printoptions(threshold=np.inf)\n\nimport scipy.misc as sc\nimport random\nfrom skimage import color\nfrom functools import partial\nfrom data_generator.blurring import corrupter\nfrom data_generator.blurring... | [
[
"numpy.set_printoptions"
]
] |
ZhaZhaFon/asteroid_config | [
"258f8b5ba40ed2bafa53f8adee54c921f4397288"
] | [
"egs/librimix/ConvTasNet/train.py"
] | [
"\n# original codebase: https://github.com/asteroid-team/asteroid\n# modified and re-distributed by Zifeng Zhao @ Peking University\n# 2022.03\n\nimport os\nimport argparse\nimport json\n\nimport torch\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.utils.data import DataLoader\nimport pytorch_l... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.load",
"torch.utils.data.DataLoader",
"torch.cuda.empty_cache",
"torch.cuda.is_available"
]
] |
thaolmk54/LOGNet-VQA | [
"360d43c65bc854606cd9d4c06fd8bf20eb7be46b"
] | [
"exp_gqa/train.py"
] | [
"import os, sys\n\nimport torch\nimport torch.optim as optim\nimport torch.nn as nn\nimport numpy as np\nimport argparse\nimport time\nimport logging\nfrom termcolor import colored\n\nimport torch.backends.cudnn as cudnn\n\nlogging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)-8s %(message)s')\nl... | [
[
"torch.nn.CrossEntropyLoss",
"numpy.random.seed",
"torch.load",
"torch.cuda.set_device",
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.device_count",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"numpy.argsort",
"torch.nn... |
Aravindh25/srm-event | [
"c5a4b0e765ee86a7a11f0c35b66acc6eeba3006d"
] | [
"captcha.py"
] | [
"from captcha.image import ImageCaptcha\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom PIL import Image\r\nimport random\r\nimport os\r\nnumber=['0','1','2','3','4','5','6','7','8','9']\r\nMAX_CAPTCHA=6\r\nWIDTH=100\r\nHEIGHT=30\r\nimage=ImageCaptcha(width=WIDTH,height=HEIGHT,font_sizes=[30])\r\nc... | [
[
"matplotlib.pyplot.imshow",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
Eyalcohenx/tonic | [
"afc15c6fa23fed4f696f68f0acf961964b0172dc"
] | [
"tonic/torch/agents/ddpg.py"
] | [
"import torch\n\nfrom tonic import explorations, logger, replays # noqa\nfrom tonic.torch import agents, models, normalizers, updaters\n\n\ndef default_model():\n return models.ActorCriticWithTargets(\n actor=models.Actor(\n encoder=models.ObservationEncoder(),\n torso=models.MLP((2... | [
[
"torch.no_grad",
"torch.as_tensor"
]
] |
biubiubiiu/derain-toolbox | [
"1669138d1aaa72c986d70d03f9cde7dbbbb70fa1"
] | [
"mmderain/models/losses/gradient_loss.py"
] | [
"# This code is taken from https://github.com/open-mmlab/mmediting\n# Modified by Raymond Wong\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..common import conv_gauss, pyr_downsample\nfrom ..registry import LOSSES\nfrom .pixelwise_loss import charbonnier_loss, l1_loss\n\n_reductio... | [
[
"torch.matmul",
"torch.nn.functional.conv2d",
"torch.zeros_like",
"torch.Tensor"
]
] |
kgullikson88/holoviews | [
"942c5ac7db46d1bc04b21a1fcf837285bbc9bde8",
"942c5ac7db46d1bc04b21a1fcf837285bbc9bde8"
] | [
"holoviews/tests/plotting/matplotlib/test_vectorfieldplot.py",
"holoviews/tests/core/data/test_spatialpandas.py"
] | [
"import numpy as np\n\nfrom holoviews.core.spaces import HoloMap\nfrom holoviews.element import VectorField\n\nfrom .test_plot import TestMPLPlot, mpl_renderer\nfrom ..utils import ParamLogStream\n\n\nclass TestVectorFieldPlot(TestMPLPlot):\n\n ###########################\n # Styling mapping #\n ##... | [
[
"numpy.array"
],
[
"numpy.array"
]
] |
akarazeev/REDE | [
"aa76367f91c9198e0d7427aa3898fe0fecd2c306"
] | [
"utils/dataset.py"
] | [
"# File name: dataset.py\n# Original file: https://github.com/pytorch/vision/blob/master/torchvision/datasets/mnist.py\n# Edited by: Anton Karazeev <anton.karazeev@gmail.com>\n#\n# This file is part of REDE project (https://github.com/akarazeev/REDE)\n\nfrom __future__ import print_function\nimport torch.utils.data... | [
[
"torch.FloatTensor",
"torch.from_numpy",
"torch.save"
]
] |
cuichenx/controllable-text-attribute-transfer | [
"237ed9575be387340fa71f696f80f0d41967b98f"
] | [
"method/mymodel-yelp/main.py"
] | [
"# coding: utf-8\n# requirements: pytorch: 0.4\n# Author: Ke Wang\n# Contact: wangke17[AT]pku.edu.cn\nimport time\nimport argparse\nimport math\nimport os\nimport torch\nimport torch.nn as nn\nfrom torch import optim\nimport numpy\nimport matplotlib\nmatplotlib.rcParams.update({'font.size': 22, 'lines.markersize': ... | [
[
"torch.load",
"torch.cat",
"torch.tensor",
"torch.nn.BCELoss",
"sklearn.manifold.TSNE",
"matplotlib.rcParams.update",
"numpy.where"
]
] |
gitAnto/multisensor_filters | [
"69f738c88193bd964b551b92bdca8817990d6e14"
] | [
"src/filter_node_kf.py"
] | [
"#!/usr/bin/env python\n#*********************************************************************\n#* MIT License\n#*\n#* Copyright (c) 2015 Antonio Petitti\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.matrix"
]
] |
jenshnielsen/nanotune | [
"0f2a252d1986f9a5ff155fad626658f85aec3f3e"
] | [
"nanotune/data/plotting.py"
] | [
"import copy\nimport os\nfrom typing import Dict, List, Optional, Tuple, Union\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom cycler import cycler\nfrom matplotlib.colors import LinearSegmentedColormap, ListedColormap\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\n\nimport nanotune as nt\nfr... | [
[
"matplotlib.pyplot.register_cmap",
"matplotlib.colors.LinearSegmentedColormap.from_list",
"matplotlib.rcParams.update",
"matplotlib.pyplot.savefig"
]
] |
NickYi1990/tabluar_buddy | [
"d60c25c72256ae6741fb4c3cfbdf3163b7cc0ca0"
] | [
"tabular_buddy/exploration/data_exploration.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom scipy.stats import skew\nfrom IPython.display import display\n\n\n####################################################################################\n# Display function\n####################################################################################\n\n\ndef sho... | [
[
"scipy.stats.skew",
"pandas.Series"
]
] |
BalajiAI/PyTorch-GAN | [
"7764c06e87d7fc36bf0a33cffe7eadeba9fa0f10"
] | [
"CycleGAN/train_class.py"
] | [
"import torch\nimport torch.nn as nn\nimport itertools\nfrom gan_model import Generator,Discriminator\n\n\nclass CycleGAN(nn.Module):\n \n def __init__(self,nb_features,lr,beta1,beta2,lambda_cycle,device):\n super().__init__()\n self.G_AB = Generator(nb_features).to(device)\n self.G_BA = ... | [
[
"torch.ones_like",
"torch.zeros_like",
"torch.nn.MSELoss",
"torch.nn.L1Loss"
]
] |
MohamedSebaie/DeepFake-Detection-Using-Pytorch | [
"b7c5a5965d058f72a660cc33248008d0d70193a5"
] | [
"DeepFake_Detection_Pip_Package/deepfake_detection/DeepFake_Utils.py"
] | [
"import subprocess\nimport sys\nimport os\nimport gdown\n\nBlazeFaceURL = 'https://drive.google.com/uc?id=1FhJrGLBnnRw_nq0p58NUzlN2rZI9BAQa'\nAnchorsURL = 'https://drive.google.com/uc?id=1oqK5yz5ZaWjLP9O_eXhvGL9RD6hOyS6d'\npytorchCVURL = 'https://drive.google.com/uc?id=18cBhKpkRflQmyXCVjy1DtVLIU... | [
[
"numpy.expand_dims",
"numpy.linspace",
"torch.cat",
"torch.load",
"numpy.concatenate",
"torch.no_grad",
"torch.cuda.is_available",
"torch.clamp",
"torch.nn.Dropout",
"numpy.clip",
"numpy.arange",
"torch.round",
"torch.from_numpy",
"numpy.stack",
"torch.t... |
Strikewolf/openpilot5 | [
"3ece1cd3e07d6a27ac32ce205f55092538108389"
] | [
"common/transformations/coordinates.py"
] | [
"import numpy as np\n\"\"\"\nCoordinate transformation module. All methods accept arrays as input\nwith each row as a position.\n\"\"\"\n\n\n\na = 6378137\nb = 6356752.3142\nesq = 6.69437999014 * 0.001\ne1sq = 6.73949674228 * 0.001\n\n\ndef geodetic2ecef(geodetic):\n geodetic = np.array(geodetic)\n input_shape = ... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.arctan",
"numpy.cos",
"numpy.sin",
"numpy.arctan2",
"numpy.atleast_2d",
"numpy.array"
]
] |
alexandrwang/6882project | [
"3723bda72baacded3f0b436e1cce171d084f43ab"
] | [
"strens/module.py"
] | [
"import numpy as np\nfrom random import choice\n\nfrom pybrain.rl.learners.valuebased.interface import ActionValueInterface\n\n\n'''\nUpdates to Q are given by\nQ(s, a) = E[R(s, a)] + gamma * sum_s'[T(s, a, s') * max_a' Q(s', a')]\n\nwhere we infer the transition probabilities\nT(s, a, s') = p(s' | s, a)\n\nand use... | [
[
"numpy.sqrt",
"numpy.ones",
"numpy.random.gamma",
"numpy.zeros",
"numpy.random.dirichlet"
]
] |
TingFree/NLPer-Arsenal | [
"17f34ec68c83babf8c3e5959fed14b9f251f869f"
] | [
"codes/nlper/models/text_clf.py"
] | [
"r\"\"\"\n各种文本分类模型的实现\n\"\"\"\n\nimport os\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\nfrom torch.optim import AdamW\nfrom torch.utils.data import DataLoader\nfrom transformers import AutoModel\nfrom transformers.models.bert.modeling_bert import BertModel\nfrom transformers import DataColl... | [
[
"torch.nn.Dropout",
"torch.optim.AdamW",
"torch.utils.data.DataLoader",
"torch.nn.functional.softmax"
]
] |
kakaba2009/MachineLearning | [
"26b389f8ffb5f3af939dfc9ebfdf2c6b2fc2ae33"
] | [
"python/src/market/LoadStockData.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport urllib\nimport matplotlib.dates as mdates\n\ndef graph_data(stock):\n\n stock_price_url = 'http://chartapi.finance.yahoo.com/instrument/1.0/'+stock+'/chartdata;type=quote;range=99y/csv'\n\n source_code = urllib.request.urlopen(stock_price_url).read(... | [
[
"numpy.loadtxt"
]
] |
ludydoo/ta | [
"20caf3e255ac39d1307dc099db24c6f36ba5ca05"
] | [
"test/integration/wrapper.py"
] | [
"import unittest\n\nimport pandas as pd\n\nimport ta\n\n\nclass TestWrapper(unittest.TestCase):\n\n _filename = \"test/data/datas.csv\"\n\n @classmethod\n def setUpClass(cls):\n cls._df = pd.read_csv(cls._filename, sep=\",\")\n\n @classmethod\n def tearDownClass(cls):\n del cls._df\n\n ... | [
[
"pandas.read_csv",
"pandas.to_numeric"
]
] |
rbpisupati/data-repo | [
"a86cbb0a3d66e139973787eb4fbea4692adfa7f2"
] | [
"dash-app/modules/data_viewer.py"
] | [
"import dash\nimport dash_core_components as dcc\nimport dash_bootstrap_components as dbc\nimport dash_html_components as html\nimport dash_table\nimport plotly.graph_objects as go\nfrom dash.dependencies import Input, Output, State\nimport sys\nimport os\nimport pandas as pd\nimport numpy as np\nimport json\nfrom ... | [
[
"pandas.DataFrame"
]
] |
Remnan13/pandas | [
"aaa69d1bb6ed2539f2dbdba842d83a2f90860aa0"
] | [
"pandas/tests/sparse/series/test_series.py"
] | [
"# pylint: disable-msg=E1101,W0612\n\nimport operator\nfrom datetime import datetime\n\nimport pytest\n\nfrom numpy import nan\nimport numpy as np\nimport pandas as pd\n\n\nfrom pandas import Series, DataFrame, bdate_range, isna, compat\nfrom pandas.errors import PerformanceWarning\nfrom pandas.tseries.offsets impo... | [
[
"pandas.util.testing.assert_sp_frame_equal",
"pandas.Series",
"numpy.take",
"numpy.asarray",
"pandas.util.testing.assert_produces_warning",
"pandas._libs.sparse.IntIndex",
"pandas.MultiIndex.from_tuples",
"pandas.DataFrame",
"pandas.SparseDataFrame",
"pandas.util.testing.as... |
wenhuchen/LogicNLG | [
"e986516e5b6d310219215510b3fe1603d03215cd"
] | [
"Model.py"
] | [
"import torch.optim as optim\nfrom torch import nn\nimport torch\nfrom torch import autograd\nimport torch.nn.functional as F\nimport math\nimport numpy as np\nfrom transformers import BertModel\n\n\nclass PositionalEmbedding(nn.Module):\n\n def __init__(self, d_model, max_len=512):\n super(PositionalEmbe... | [
[
"torch.nn.Softmax",
"numpy.sqrt",
"torch.sin",
"torch.cat",
"torch.zeros",
"torch.nn.Embedding",
"torch.FloatTensor",
"torch.nn.Dropout",
"torch.softmax",
"torch.ones",
"numpy.sin",
"torch.nn.Sigmoid",
"torch.bmm",
"torch.arange",
"torch.cos",
"numpy... |
scotthuang1989/opencv_study | [
"9b6354907609c9841915f6300ee5915a9d80906f"
] | [
"tutorial/gui_feature/track_bar.py"
] | [
"\"\"\"\nSimple application shows color you specify\n* one window which show the color\n* 3 trackbar\n\"\"\"\n\n\"\"\"\ncv2.getTrackbarPos(trackbarname, windname)\nreuturns: the current position of specified trackbar\n\"\"\"\n\n\"\"\"\ncv2.createTrackbar(trackbarName, windowName, value, count, onChange)\n\"\"\"\n\n... | [
[
"numpy.zeros"
]
] |
blefaudeux/fairscale | [
"aa5850107a37c7d5644b6079516e7ae1079ff5e8"
] | [
"fairscale/optim/oss.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport copy\nimport logging\nfrom typing import TYPE_CHECKING, Any, Callable, List, Optional, Type\n\nimport to... | [
[
"torch.distributed.broadcast",
"torch.empty",
"torch.device",
"torch.distributed.get_rank",
"torch.distributed.get_world_size"
]
] |
stephenyan1231/d2go | [
"cbd695ac4aab07f98e3157340213b6f568f16eb1"
] | [
"tools/lightning_train_net.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\n\nimport logging\nimport os\nfrom dataclasses import dataclass\nfrom typing import Any, Dict, List, Optional, Type\n\nimport pytorch_lightning as pl # type: ignore\nfrom d2go.config import CfgNode, temp_defrost, auto... | [
[
"torch.distributed.get_rank"
]
] |
bolero2/deeplab-v3-torch | [
"512c701d236ff2092be9aa8cc0219a333283bfb6"
] | [
"get_model.py"
] | [
"import sys\nimport torch\nimport os\nimport yaml\nfrom glob import glob\n\nfrom modeling.deeplab import *\n\n\ndef get_model(yaml_path : str = './setting.yaml'):\n file_path = os.path.split(sys.modules[__name__].__file__)[0]\n yaml_file = os.path.join(file_path, yaml_path)\n\n assert os.path.isfile(yaml_f... | [
[
"torch.cuda.is_available"
]
] |
julenmendieta/metaseq | [
"fa875d1f72317aa7ef95cb128b739956b16eef9f"
] | [
"metaseq/test/examples/atf3_peaks.py"
] | [
"\"\"\"\nPractical testing grounds to see what sorts of features are needed. Heavily\ncommented to serve as interim documentation.\n\nUse the download_data.py script in the test/data dir to get ENCODE CTCF\nChIP-seq data.\n\nDifferent modes -- TSS, intron, peaks.\n\nEach one generates features of interest, and the... | [
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
jren73/DeepSpeed | [
"e4bd86a84c98ebcaec462abc118576e127528501"
] | [
"tests/unit/test_checkpointing.py"
] | [
"import torch\n\nimport torch.distributed as dist\n\nimport deepspeed\nfrom deepspeed.runtime.zero.stage2 import FP16_DeepSpeedZeroOptimizer\nfrom deepspeed.runtime.zero.stage1 import FP16_DeepSpeedZeroOptimizer_Stage1\n\nfrom deepspeed.runtime.fp16.fused_optimizer import FP16_Optimizer\nfrom deepspeed.runtime.fp16... | [
[
"torch.equal",
"torch.allclose",
"torch.distributed.barrier"
]
] |
saritma/hw5_2019 | [
"6833385c9f608d7bf7f62f0f81975a9b5e9e3431"
] | [
"hw5.py"
] | [
"from pathlib import Path \nimport pandas as pd\nimport json\nfrom pandas.io.json import json_normalize\nimport numpy as np\nimport matplotlib.pyplot as plt\nclass QuestionnaireAnalysis:\n \"\"\"\n Reads and analyzes data generated by the questionnaire experiment.\n Should be able to accept strings and pat... | [
[
"pandas.io.json.json_normalize",
"matplotlib.pyplot.show",
"numpy.histogram"
]
] |
Junlin-Yin/Data-Mining-Homework | [
"043f836e3dd30f32b5b06f40af61ae55b9287fbc"
] | [
"hw3/hw3_code/knn/hack.py"
] | [
"import numpy as np\nimport extract_image\nimport knn\n\ndef hack(img_name):\n '''\n HACK Recognize a CAPTCHA image\n Inputs:\n img_name: filename of image\n Outputs:\n digits: 1x5 matrix, 5 digits in the input CAPTCHA image.\n '''\n data = np.load('hack_data.npz')\n\n # Y... | [
[
"numpy.load"
]
] |
carpeanon/turing | [
"0fa103ab0432efe9d21237d5690f42cf60d292be"
] | [
"tasks/copy.py"
] | [
"import os\nimport time\nimport numpy as np\nimport tensorflow as tf\nfrom random import randint\n\nfrom ntm import NTM\nfrom utils import pprint\nfrom ntm_cell import NTMCell\n\nprint_interval = 5\n\ndef copy(ntm, seq_length, sess, print_=True):\n start_symbol = np.zeros([ntm.cell.input_dim], dtype=np.float32)\... | [
[
"numpy.set_printoptions",
"numpy.round",
"tensorflow.initialize_all_variables",
"numpy.random.rand",
"numpy.zeros"
]
] |
lorenh516/financial_distress | [
"121b83ea74aadaaf6147de82a9132edba178866f"
] | [
"analysis/credit_util.py"
] | [
"import pandas as pd\nfrom ml_explore import eval_ratios\n\n\ndef payment_grid(df, focus_cols, group_col):\n df_list = []\n for col in focus_cols:\n new_df = eval_ratios(df, include_cols = [group_col, col], \n category_cols = [group_col], method = \"sum\", \n ... | [
[
"pandas.concat"
]
] |
LalicUfscar/WE-PE-tool | [
"e90ef8a098809a58d17347da6a88fd980e99416f"
] | [
"src/error_identification/tests/k_fold_correct_error.py"
] | [
"#!/usr/bin/env python3\nimport subprocess\nimport os\nimport progressbar\nimport sys\nfrom readers.read_blast import BlastReader\nfrom readers.read_giza import GIZAReader\nfrom utils import tag_sentences, extract_features, format_features\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.model_selectio... | [
[
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.KFold",
"sklearn.linear_model.Perceptron",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.naive_bayes.BernoulliNB",
"sklearn.svm.LinearSVC",
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.accuracy_score"
... |
asokraju/sb3-seir | [
"d3e07af143e7eeec5b812cd9607a01ed48a8aecc"
] | [
"gym_seir/envs/Tseir_env.py"
] | [
"import numpy as np\nimport gym\nfrom gym import spaces\nfrom gym.utils import seeding\n\nclass TSeirEnv(gym.Env):\n \"\"\"\n Description:\n Each city's population is broken down into four compartments --\n Susceptible, Exposed, Infectious, and Removed -- to model the spread of\n ... | [
[
"numpy.random.uniform",
"numpy.array",
"numpy.full"
]
] |
YangChuan80/BellfortSequenceParser | [
"87af8e42a70c772cc12e757be3cc18e55f247f0e"
] | [
"Source/BellfortSequenceParser.py"
] | [
"# Bellfort Sequence Parser\n\n## Modules\n\nimport numpy as np\nimport pandas as pd\nimport tkinter as tk\nfrom tkinter import ttk\nimport tkinter.font as tkf\nfrom tkinter import messagebox\nfrom tkinter import filedialog\nimport threading\nimport time\nimport os\nimport shutil\n\n## Helper Functions\n### Reverse... | [
[
"numpy.array",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
S3DEV/utils4 | [
"6c196c9928914412f0cadcb8b2ce1f0eeb285b25"
] | [
"utils4/cmaps.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n:Purpose: This module provides an easy-access, light-weight wrapper,\n around ``matplotlib``'s colour maps, and can be used for\n retrieving and previewing named colour maps.\n\n:Platform: Linux/Windows | Python 3.6+\n:Developer: J B... | [
[
"numpy.arange",
"matplotlib.pyplot.colormaps",
"matplotlib.pyplot.subplots",
"matplotlib.colors.Normalize",
"numpy.sin",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.show",
"matplotlib.colors.rgb2hex"
]
] |
yanglh14/InteractiveGrasping | [
"b5bc1866a1847e7b0c11616fd6cbe949c64a355b"
] | [
"FTSensor/pybind11-master/tests/test_buffers.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport io\r\nimport struct\r\nimport sys\r\n\r\nimport pytest\r\n\r\nfrom pybind11_tests import buffers as m\r\nfrom pybind11_tests import ConstructorStats\r\n\r\nPY3 = sys.version_info[0] >= 3\r\n\r\npytestmark = pytest.requires_numpy\r\n\r\nwith pytest.suppress(ImportError):\r\n imp... | [
[
"numpy.asarray",
"numpy.array"
]
] |
jie311/miemiedetection | [
"b0e7a45717fe6c9cf9bf3c0f47d47a2e6c68b1b6"
] | [
"mmdet/evaluators/voc_evaluator.py"
] | [
"#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport sys\nimport tempfile\nimport time\nfrom collections import ChainMap\nfrom loguru import logger\nfrom tqdm import tqdm\n\nimport numpy as np\n\nimport torch\n\nfrom mmdet.utils import gather, is_main_process, ... | [
[
"torch.ones",
"torch.load",
"torch.cuda.FloatTensor",
"torch.distributed.reduce",
"torch.no_grad",
"numpy.empty"
]
] |
gogobd/Recycle-GAN | [
"c7fd530be2eebee83fb2cbf056777b30c539bddc"
] | [
"models/cycle_gan_model.py"
] | [
"import numpy as np\nimport torch\nimport os\nfrom collections import OrderedDict\nfrom torch.autograd import Variable\nimport itertools\nimport util.util as util\nfrom util.image_pool import ImagePool\nfrom .base_model import BaseModel\nfrom . import networks\nimport sys\n\n\nclass CycleGANModel(BaseModel):\n d... | [
[
"torch.nn.L1Loss",
"torch.autograd.Variable"
]
] |
nowcastsystem/QUANTAXIS | [
"66b5d002adf69642241a1bdb5edd90dc4111e690"
] | [
"QUANTAXIS/QAFetch/QAQuery_Advance.py"
] | [
"# coding: utf-8\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 \"Software\"), to deal\n# in the Software without restriction, including witho... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
jiaowozidaren/graduation_paper | [
"7c2f1a9138ff79fedb12b0250ca4c90bbc40a49c"
] | [
"my_ising_grid.py"
] | [
"import numpy as np\nimport Ising as Is\nimport matplotlib.pyplot as plt\nimport math\nimport matplotlib as mpl\nfrom matplotlib.animation import FuncAnimation\nimport matplotlib.animation as animation\n\nfig, ax = plt.subplots()\ndata = []\n\nT = 4\ng = Is.Ising_mat(100,100,T)\ng.random_state()\n\nprint(\"begin\")... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplots"
]
] |
Anjum48/segmentation_models.pytorch | [
"871c88cc774d4d4416ce26b5c8b7162405248311"
] | [
"segmentation_models_pytorch/encoders/__init__.py"
] | [
"import functools\nimport torch.utils.model_zoo as model_zoo\n\nfrom .resnet import resnet_encoders\nfrom .dpn import dpn_encoders\nfrom .vgg import vgg_encoders\nfrom .senet import senet_encoders\nfrom .densenet import densenet_encoders\nfrom .inceptionresnetv2 import inceptionresnetv2_encoders\nfrom .inceptionv4 ... | [
[
"torch.utils.model_zoo.load_url"
]
] |
zjzh/mne-python | [
"89e163f60be122be2150ee93a9d3fcea5641b8b7"
] | [
"mne/viz/_brain/_brain.py"
] | [
"# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Eric Larson <larson.eric.d@gmail.com>\n# Oleh Kozynets <ok7mailbox@gmail.com>\n# Guillaume Favelier <guillaume.favelier@gmail.com>\n# jona-sassenhagen <jona.sassenhagen@gmail.com>\n# Joan Massich <mailsik@gm... | [
[
"numpy.diag",
"numpy.dot",
"numpy.asarray",
"numpy.in1d",
"numpy.round",
"numpy.max",
"numpy.concatenate",
"matplotlib.image.imread",
"numpy.mean",
"numpy.any",
"numpy.searchsorted",
"numpy.cross",
"numpy.where",
"numpy.clip",
"numpy.unique",
"numpy.... |
data301-2021-summer2/project-group5 | [
"f33e165cca2f383f0f8d43da175d4a1fcd36cf17"
] | [
"analysis/scripts/aliproject_functions.py"
] | [
"import seaborn as sns\nimport pandas as pd\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\n\n\ndef load_and_process(url_or_path_to_csv_file):\n\n # Method Chain 1 (Load data and deal with missing data)\n \n\n df = ( pd.read_csv (url_or_path_to_csv_file,na_values=['No Reasonable offer refu... | [
[
"pandas.read_csv"
]
] |
Eshan-Agarwal/addons | [
"0b186d6fd94768bffedc258ee531c96ebe5ce62f"
] | [
"tensorflow_addons/metrics/r_square.py"
] | [
"# Copyright 2019 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.convert_to_tensor",
"tensorflow.reduce_sum",
"tensorflow.shape",
"tensorflow.subtract"
]
] |
tusharnankani/Scrapera | [
"d4b0ed33df200fadfe45638410cdb510382004ae"
] | [
"scrapera/text/instagram.py"
] | [
"import os\n\nimport pandas as pd\nimport json\nimport urllib.request\nimport urllib\n\n\nclass InstagramCommentsScraper:\n def _extract_get_comments_data(self, json_response):\n comments_list, usernames_list, timestamps_list = [], [], []\n for node in json_response['graphql']['shortcode_media']['e... | [
[
"pandas.DataFrame"
]
] |
ch3njust1n/record | [
"364e16d748dc3b70879835c5e13467cfcc1865a7"
] | [
"record/__main__.py"
] | [
"'''\nAuthor: Justin Chen\nDate: \t2.15.2020\n'''\nimport os\nimport pwd\nimport json\nimport atexit\nimport signal\nimport psutil\nimport platform\nfrom datetime import datetime\n\nfrom numpy import ndarray\nfrom torch import cuda, Tensor, manual_seed\nfrom pymongo import MongoClient\nfrom gridfs import GridFS\nfr... | [
[
"torch.manual_seed",
"torch.cuda.device_count",
"torch.cuda.get_device_name"
]
] |
pauloabelha/pytorch-mask-rcnn | [
"2c252c8a75f8287a127f9c91dc8c61cf0e7c0e94"
] | [
"model.py"
] | [
"\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implemenetation.\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport datetime\nimport math\nimport os\nimport random\nimport re\n\nimport numpy as np\nimport torch\nimport torch.nn ... | [
[
"torch.nn.functional.upsample",
"torch.nn.Softmax",
"numpy.amax",
"torch.max",
"torch.cat",
"torch.zeros",
"torch.load",
"torch.utils.data.DataLoader",
"torch.nn.init.xavier_uniform_",
"torch.FloatTensor",
"numpy.any",
"torch.nn.functional.smooth_l1_loss",
"nump... |
htwangtw/depersonalisation | [
"2631c9fd6fd64f9d680b292d317f991f6a52b85f"
] | [
"data/code/src/subject_trialHRV.py"
] | [
"import glob, os\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\n\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nfrom scipy.stats import zscore\nfrom scipy import interpolate, signal\n\nfrom tftb.processing import smoothed_pseudo_wigner_ville as spwvd\n\n# misc\nimport warnings\n\n... | [
[
"pandas.concat",
"pandas.read_csv",
"numpy.nanmedian",
"numpy.linspace",
"numpy.isnan",
"numpy.arange",
"scipy.stats.zscore",
"numpy.cumsum",
"matplotlib.pyplot.plot",
"scipy.interpolate.interp1d",
"numpy.diff",
"scipy.signal.hamming",
"numpy.array",
"numpy.... |
InformationMaximisingNeuralNetworks/imnn | [
"2eb04d9dc1acc4e8d1e60ef0bb25dfac17bd9f81"
] | [
"imnn/imnn/dataset_gradient_imnn_test.py"
] | [
"import pytest\nimport jax\nimport jaxlib\nimport jax.numpy as np\nimport tensorflow as tf\nfrom test.aggregated_defaults import aggregatedTests\nfrom test.gradient_defaults import gradientTests\nfrom imnn.imnn import DatasetGradientIMNN\n\n\nclass datasetGradientTests(\n aggregatedTests, gradientTests):\n ... | [
[
"tensorflow.data.Dataset.from_tensor_slices"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.