repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
tvquynh/tune-sklearn | [
"298709319ae856230e1287dd59bbaeabe3e66bf9"
] | [
"examples/warm_start.py"
] | [
"\"\"\"\nAn example training a LogisticRegression model, performing grid search\nusing TuneGridSearchCV.\n\nThis example uses early stopping to further improve runtimes\nby eliminating worse hyperparameter choices early based off\nof its average test score from cross validation. Usually\nthis will require the estim... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LogisticRegression",
"numpy.array",
"sklearn.datasets.load_iris"
]
] |
FukukouSSJouhou/A_MIA_R3 | [
"970e80f6b71ba3c6eab013470b52f1e76fb04d3c"
] | [
"A_MIA_R3_Core/faceproc/Facemod.py"
] | [
"import json\nimport math\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport wave\nfrom tkinter import Image, ttk\nfrom typing import ClassVar\n\nimport numpy as np\nimport cv2\nimport tkinter as tk\n\nfrom PIL import Image, ImageTk\nfrom PySide2 import QtCore, QtGui\nfrom keras_preprocessing import i... | [
[
"numpy.delete",
"tensorflow.python.keras.models.load_model",
"matplotlib.pyplot.show",
"numpy.expand_dims",
"matplotlib.pyplot.imshow"
]
] |
quiqua/pandas-qt | [
"f1911e43fc4a77b6a5237dd25f3b31a4ac305a1b"
] | [
"examples/BasicExample.py"
] | [
"\"\"\"set the sip version, cause pandas-qt uses version 2 by default\"\"\"\nimport sip\nsip.setapi('QString', 2)\nsip.setapi('QVariant', 2)\nfrom PyQt4 import QtGui\n\nimport pandas\nimport pandasqt\nimport numpy\n\n\"\"\"setup a new empty model\"\"\"\nmodel = pandasqt.DataFrameModel()\n\n\"\"\"setup an applicatio... | [
[
"pandas.DataFrame"
]
] |
h4ck1337/Snapchat-filter | [
"72ac1cc243ccfa143c61f84b4b53e5b9883c4cab"
] | [
"full face.py"
] | [
"import cv2\r\nimport numpy as np\r\ncap=cv2.VideoCapture(0)\r\n\r\nface_detect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml')\r\neye_detect=cv2.CascadeClassifier('frontalEyes35x16.xml')\r\nnoise_detect=cv2.CascadeClassifier('Nose18x15.xml')\r\nmustache=cv2.imread('mustache.png',-1)\r\nglasses=cv2.imr... | [
[
"numpy.array"
]
] |
pedrooa/pandas | [
"fc41f92cab49050b74cdd3dae37a8186b923c502"
] | [
"pandas/core/generic.py"
] | [
"import collections\nfrom datetime import timedelta\nimport functools\nimport gc\nimport json\nimport operator\nimport pickle\nimport re\nfrom textwrap import dedent\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Dict,\n FrozenSet,\n Hashable,\n List,\n Mapping,\n Optional,\n... | [
[
"pandas.io.pickle.to_pickle",
"pandas.core.nanops.na_accum_func",
"pandas.io.formats.excel.ExcelFormatter",
"pandas.core.dtypes.common.is_number",
"pandas.core.construction.create_series_with_explicit_dtype",
"pandas.compat.numpy.function.validate_clip_with_axis",
"pandas.core.resample... |
founture123/LSAFGCMR | [
"5e032e1e2e14710f6b058cd0a796ba335382c2b7"
] | [
"validate.py"
] | [
"import sys\r\nimport torch\r\nfrom torch.autograd import Variable\r\n\r\ndef validate(loader, model, args, flag):\r\n model.eval()\r\n # if args.gpu is not None:\r\n # model = model.module\r\n\r\n total_output = []\r\n total_label = []\r\n start_model = True\r\n for i, (input, target) in e... | [
[
"torch.autograd.Variable",
"torch.no_grad",
"torch.max"
]
] |
nguyendohoangkhoi/Deductive-Exploration | [
"371502f00305d8f2e6c14b65eaa8686d2a5609e4"
] | [
"space/src/dataset/atari.py"
] | [
"import os\nimport sys\nimport torch\nimport numpy as np\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nimport PIL\n\nclass Atari(Dataset):\n def __init__(self, root, mode, gamelist=None):\n assert mode in ['train', 'validation', 'test'], f'Invalid dataset mode \"{mode}\"'\n \n ... | [
[
"numpy.array",
"torch.from_numpy"
]
] |
HCDM/XRec | [
"dae7d3e1237b8e41913656eb33d81e78c61424ea",
"dae7d3e1237b8e41913656eb33d81e78c61424ea"
] | [
"SAER/src/utils/checkpoint.py",
"CompExp/src/utils/checkpoint.py"
] | [
"import os\nimport pickle\nimport torch\n\nMETA_FILE = 'meta.pt'\n\nclass CheckpointManager:\n def __init__(self, path):\n self.path = path\n\n def __fullpath(self, name):\n return os.path.join(self.path, name)\n\n def __ensure_folder(self):\n if not os.path.exists(self.path):\n ... | [
[
"torch.save",
"torch.load"
],
[
"torch.save",
"torch.load"
]
] |
Censio/tensorflow | [
"7ed4d3cda2ef63a444b0704ed7cf431de92096bb"
] | [
"tensorflow/contrib/learn/python/learn/tests/experiment_test.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this 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 r... | [
[
"tensorflow.contrib.learn.python.learn.run_config.RunConfig",
"tensorflow.logging.info",
"tensorflow.test.main",
"tensorflow.contrib.learn.Experiment"
]
] |
scwangdyd/large_vocabulary_hoi_detection | [
"db7a4397c3050b1bf9a3f7473edf125e2b1046c4",
"db7a4397c3050b1bf9a3f7473edf125e2b1046c4"
] | [
"choir/modeling/test_time_augmentation.py",
"choir/evaluation/hico_evaluation.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport copy\nimport numpy as np\nfrom itertools import count\nimport torch\nfrom fvcore.transforms import HFlipTransform, NoOpTransform\nfrom torch import nn\nfrom torch.nn.parallel import DistributedDataParallel\n\nfrom choir.data.detection_u... | [
[
"torch.stack",
"numpy.copy",
"torch.from_numpy",
"torch.logical_or",
"torch.zeros_like",
"torch.mean"
],
[
"torch.cat",
"numpy.mean",
"numpy.where",
"numpy.cumsum",
"torch.topk",
"numpy.max",
"numpy.arange",
"torch.zeros_like",
"torch.as_tensor",
... |
vineeths96/Video-Interpolation-using-Deep-Optical-Flow | [
"5dd536bcc2d6c0d0d1718dccb09eb71ca77d2d94"
] | [
"finetuned/deep_optical_flow.py"
] | [
"import cv2\nimport numpy as np\nimport scipy.ndimage\nfrom flownet2.Flownet2ControllerFineTune import FlowControllerFineTune\n\n\ndef deep_optical_flow(model_path, firstImage, secondImage, lr, num_iter, image_ind, dataset):\n \"\"\"\n FlowNet2 Deep Optical flow estimation between firstImage and secondImage\n... | [
[
"numpy.array"
]
] |
mpaloni/pioneer | [
"c49efa2e071307b2534ca2abe7560f57683d2d9e"
] | [
"src/analyze_latent.py"
] | [
"import torch, torchvision\nimport os\nimport argparse\n\ndef main():\n\tparser = argparse.ArgumentParser(description='PIONEER Zeta')\n\tparser.add_argument('--first', type=str, help='Subject on the left side of the operator')\n\t\n\targs=parser.parse_args()\n\t\n\tf1=torch.load(os.path.expanduser(args.first))\n\t#... | [
[
"torch.max",
"torch.min",
"torch.mean",
"torch.sum"
]
] |
januseriksen/pyscf | [
"5cd81a47fb67cdf81ad2837a1a857effd48c472f",
"5cd81a47fb67cdf81ad2837a1a857effd48c472f"
] | [
"pyscf/shciscf/shci.py",
"pyscf/lo/boys.py"
] | [
"#!/usr/bin/env python\n# Copyright 2014-2019 The PySCF Developers. 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/LIC... | [
[
"numpy.zeros_like",
"numpy.asarray",
"numpy.zeros",
"numpy.ascontiguousarray",
"numpy.eye",
"numpy.identity",
"numpy.tensordot",
"numpy.where",
"numpy.einsum"
],
[
"numpy.array",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.zeros",
"numpy.eye",
"nump... |
Ranga2904/Refining-Economics | [
"09cce288a0208827fdbf9225e9c07fb23f871ed6"
] | [
"Refining Economics.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[288]:\n\n\n# This code performs analysis and visualization seen in 'Refining Margins Over the Years'\n\n\n# In[289]:\n\n\n# (1) Import necessary packages, modules\n\nimport pandas as pd, numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.pylab as plab\nim... | [
[
"pandas.to_datetime",
"pandas.merge",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.subplots",
"numpy.mean",
"matplotlib.pyplot.show",
"numpy.arange",
"matplotlib.pyplot.scatter",
"pa... |
HatsuneMiku4/reaver | [
"059320ce109498ec4100fcc2cee32177c427f1ea"
] | [
"reaver/models/sc2/fully_conv.py"
] | [
"import gin\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.keras import Model\nfrom tensorflow.python.keras.initializers import VarianceScaling\nfrom tensorflow.python.keras.layers import Input, Concatenate, Dense, Embedding, Conv2D, Flatten, Lambda\nfrom reaver.models.base.layers import Squee... | [
[
"tensorflow.python.keras.layers.Concatenate",
"tensorflow.python.keras.initializers.VarianceScaling",
"tensorflow.python.keras.Model",
"tensorflow.python.keras.layers.Input",
"tensorflow.python.keras.layers.Conv2D",
"tensorflow.ones_like",
"tensorflow.python.keras.layers.Embedding",
... |
mouni97matelabs/raven-distribution-framework | [
"d577e0f00fd5471613aea79af61e655f0831bb3d",
"d577e0f00fd5471613aea79af61e655f0831bb3d"
] | [
"test_knn.py",
"ravop/ml/knn_demo.py"
] | [
"\nfrom sklearn.datasets import load_iris\nfrom ravop.ml.knn import KNN\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.neighbors import KNeighborsClassifier\nimport pandas as pd\nimport numpy as np\nimport sys\n\n\ndataset = load_iris()\n\nX = dataset.data\nX = X[:10]\nprint(\"\\n New X array i... | [
[
"pandas.DataFrame",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.mean",
"numpy.std",
"sklearn.model_selection.train_test_split",
"sklearn.datasets.load_iris"
],
[
"pandas.DataFrame",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.mean",
"numpy.std",
"sklearn.m... |
SteScheller/AoC_2020 | [
"f60d89d19b6c6c19e12f263fe46bc5f36b737327"
] | [
"13/shuttle.py"
] | [
"#!/usr/bin/env python3\n\nimport math\nfrom typing import List, Tuple, Union\n\nimport numpy as np\n\ndef parse_input(file_path: str) -> Tuple[int, List[Union[int, str]]]:\n with open(file_path) as f:\n lines = f.readlines()\n t = int(lines[0].strip())\n ids = [int(id_) if id_ != 'x' else id_\n ... | [
[
"numpy.lcm.reduce"
]
] |
dieuthu/sequencetagging | [
"66e31a5ab98cb7cff2cf0b8d089ad89a2202dd33"
] | [
"model/base_model.py"
] | [
"import os\nimport tensorflow as tf\n\n\nclass BaseModel(object):\n \"\"\"Generic class for general methods that are not specific to NER\"\"\"\n\n def __init__(self, config):\n \"\"\"Defines self.config and self.logger\n\n Args:\n config: (Config instance) class with hyper parameters,... | [
[
"tensorflow.train.AdamOptimizer",
"tensorflow.contrib.framework.get_variables",
"tensorflow.clip_by_global_norm",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.train.AdagradOptimizer",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.variable_scope",
"tensorflow.v... |
niansong1996/wassp | [
"c25255b41c8c69fe02c41780e4f3e7a8e96b0b89"
] | [
"table/experiment.py"
] | [
"#-*- coding: utf-8 -*-\nimport json\nimport time\nimport os\nimport codecs\nimport multiprocessing\n\nimport tensorflow as tf\n\nfrom nsm import data_utils\nfrom nsm import agent_factory\n\nfrom table.utils import get_flags, init_experiment, get_experiment_dir, get_init_model_path, show_samples, get_train_shard_pa... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.gfile.Exists",
"tensorflow.logging.info",
"tensorflow.gfile.DeleteRecursively",
"tensorflow.gfile.MkDir",
"tensorflow.app.run"
]
] |
dukebw/MichiGAN | [
"3048e259dd2d368bb7a790a034e54d46f3da2a20"
] | [
"models/networks/partialconv2d.py"
] | [
"###############################################################################\n# BSD 3-Clause License\n#\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Author & Contact: Guilin Liu (guilinl@nvidia.com)\n###############################################################################\n\nimpo... | [
[
"torch.mul",
"torch.no_grad",
"torch.clamp",
"torch.ones",
"torch.nn.functional.conv2d"
]
] |
ChunchuanLv/examples | [
"0940311ee5dfa9a388e15cc2051a67f6620dfc3e"
] | [
"OpenNMT/onmt/modules/GlobalAttention.py"
] | [
"\"\"\"\nGlobal attention takes a matrix and a query vector. It\nthen computes a parameterized convex combination of the matrix\nbased on the input query.\n\n\n H_1 H_2 H_3 ... H_n\n q q q q\n | | | |\n \\ | | /\n .....\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.Softmax",
"torch.nn.Tanh",
"torch.bmm"
]
] |
lonelu/Metalprot | [
"e51bee472c975aa171bdb6ee426a07ca69f110ee",
"e51bee472c975aa171bdb6ee426a07ca69f110ee"
] | [
"metalprot/basic/vdmer_2ndshell.py",
"metalprot/search/search_selfcenter.py"
] | [
"import prody as pr\nimport numpy as np\n\n\nmetal_sel = 'ion or name NI MN ZN CO CU MG FE' \n\n\ndef organize_2ndshellVdm(query):\n '''\n A query for 2nd shell can have different atom orders as an prody.atomGroup.\n The function is supposed to get the atomGroup of the query with the right atom order.\n ... | [
[
"numpy.array"
],
[
"numpy.prod"
]
] |
Hiroshiba/espnet | [
"fe0183b78b3495324e6769e340c3bd80f91e7f8e"
] | [
"espnet_pytorch_library/conformer/encoder_layer.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Copyright 2020 Johns Hopkins University (Shinji Watanabe)\n# Northwestern Polytechnical University (Pengcheng Guo)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"Encoder self-attention layer definition.\"\"\"\n\nimport torch... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.cat"
]
] |
zeeshanbasar/devnagri-classifier | [
"ccd0ba76e0b9c015c5c18e6d8d3d5e5c86900ee8"
] | [
"devnagri-script-detection_test2.py"
] | [
"# basic imports\r\nimport numpy as np\r\n#import matplotlib.pyplot as plt\r\n#import os\r\n#import cv2\r\nimport pickle\r\nimport tensorflow as tf\r\nfrom tensorflow.keras.models import Sequential\r\nimport tensorflow.keras.layers as tfl\r\n#from tensorflow.keras.callbacks import TensorBoard, LearningRateScheduler... | [
[
"tensorflow.keras.utils.to_categorical",
"numpy.array",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Activation",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tenso... |
deepanshug4/Vechile_Classification_with_NumberPlate_Detection | [
"5d144b556499cf28ed6c7f17f707b684619809d7"
] | [
"vehicle_count.py"
] | [
"# TechVidvan Vehicle counting and Classification\r\n\r\n# Import necessary packages\r\n\r\nimport cv2\r\nimport csv\r\nimport collections\r\nimport numpy as np\r\nfrom tracker import *\r\n\r\n# Initialize Tracker\r\ntracker = EuclideanDistTracker()\r\n\r\n# Initialize the videocapture object\r\ncap = cv2.VideoCapt... | [
[
"numpy.random.seed",
"numpy.argmax"
]
] |
nikosavola/PehmoleluBot | [
"aa003a1e9fbe177ae90ab1ed0a5c96740eb15f58"
] | [
"pehmolelubot.py"
] | [
"# -*- coding: utf-8 -*-\nfrom telegram.ext import Updater, MessageHandler, CommandHandler, Filters\nimport os\nimport subprocess\nimport logging\nimport random\nimport numpy\nimport datetime\nimport time\nimport atexit\n\nlogging.basicConfig(\n filename='spam.log',\n level=logging.INFO,\n format='[%(ascti... | [
[
"numpy.random.exponential"
]
] |
TheJacksonLaboratory/human-chromatin-folding-dynamics | [
"db854a22c828b159bbdbc585be67c2928c4a4988"
] | [
"scripts/CRN_region_plotandstats.py"
] | [
"# The main contribution of this code is from Jianhao Peng\r\n# This code modify the code from Jianhao\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport argparse\r\nfrom multiprocessing import Pool\r\nfrom tqdm import tqdm\r\nimport functools\r\nimport warnings\r\nimport ... | [
[
"numpy.array",
"numpy.ones_like",
"numpy.zeros",
"pandas.DataFrame",
"numpy.sum",
"matplotlib.pyplot.close",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
tkim135/allennlp | [
"397f46bd83e24ad8c40a9febd2b5be49583012a6"
] | [
"allennlp/modules/span_extractors/self_attentive_span_extractor.py"
] | [
"import torch\nfrom overrides import overrides\n\nfrom allennlp.modules.span_extractors.span_extractor import SpanExtractor\nfrom allennlp.modules.time_distributed import TimeDistributed\nfrom allennlp.nn import util\n\n@SpanExtractor.register(\"self_attentive\")\nclass SelfAttentiveSpanExtractor(SpanExtractor):\n ... | [
[
"torch.nn.Linear"
]
] |
mesnico/RelationNetworks-CLEVR | [
"b8e0e7af12408877c8a18d8f2802d88138605983"
] | [
"utils.py"
] | [
"import json\nimport os\nimport pickle\nimport re\n\nimport torch\nfrom tqdm import tqdm\n\nclasses = {\n 'number':['0','1','2','3','4','5','6','7','8','9','10'],\n 'material':['rubber','metal'],\n 'color':['cyan','blue','yellow','purple','red','green','gray','brown'],\n ... | [
[
"torch.autograd.Variable",
"torch.LongTensor",
"torch.stack",
"torch.arange"
]
] |
frastlin/CamIO-Python | [
"6544d060cc3a86505ef79781f9631e8b4083aed3"
] | [
"src/explorer-pygame-display.py"
] | [
"#explorer-pygame-display.py\n#(c) James Coughlan, Smith-Kettlewell Eye Research Institute\n#This modifies explorer.py by displaying graphics using pygame rather than OpenCV, and using pygame to capture key presses.\n#Motivation: pygame.mixer.Channel doesn't work properly without using the pygame.display\n\n#First ... | [
[
"numpy.array"
]
] |
parejkoj/astropy | [
"0a178ed9bb90ddad9cb27cc17191c7c09a213a76"
] | [
"astropy/table/operations.py"
] | [
"\"\"\"\nHigh-level table operations:\n\n- join()\n- setdiff()\n- hstack()\n- vstack()\n- cstack()\n\"\"\"\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom copy import deepcopy\nimport collections\nimport itertools\nfrom collections import OrderedDict, Counter\nfrom collections.abc import Ma... | [
[
"numpy.concatenate",
"numpy.empty",
"numpy.setdiff1d",
"numpy.diff",
"numpy.any",
"numpy.arange",
"numpy.broadcast_to",
"numpy.flatnonzero"
]
] |
half5life/SourceIO | [
"f3dc6db92daa537acbb487ce09f371866f6e3e7f",
"f3dc6db92daa537acbb487ce09f371866f6e3e7f"
] | [
"goldsrc/bsp/import_bsp.py",
"source1/mdl/structs/attachment.py"
] | [
"import math\nfrom pathlib import Path\nfrom typing import Dict, Any, cast\n\nimport bpy\nimport numpy as np\n\nfrom .bsp_file import BspFile\nfrom .entity_handlers import entity_handlers\nfrom .lump import LumpType\nfrom .lumps.edge_lump import EdgeLump\nfrom .lumps.entity_lump import EntityLump\nfrom .lumps.face_... | [
[
"numpy.divide",
"numpy.dot",
"numpy.zeros",
"numpy.where",
"numpy.abs",
"numpy.dstack",
"numpy.insert",
"numpy.unique"
],
[
"numpy.zeros"
]
] |
anonymouskddsubmission1557/anonymouskddsubmission1557 | [
"a4645dd84070c32fc8e120a03a7a1c4ad6987a5f"
] | [
"network/feast.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch_geometric.nn import FeaStConv\r\n\r\n\r\n\r\nclass FeaST1(nn.Module):\r\n def __init__(self, nfeat, nhid, nclass, dropout,nlayer=1):\r\n super(FeaST1, self).__init__()\r\n self.conv1 = FeaStConv(nfeat, nclass)\r... | [
[
"torch.nn.functional.dropout",
"torch.nn.Sigmoid"
]
] |
sa616473/lendingCompany | [
"6bb26a8c482e45b113b12c17186495eb2d1020c0"
] | [
"src/analyzation/analysis.py"
] | [
"import pandas as pd\nimport numpy as np\n\nlending_data_info = pd.read_csv('../data/raw/lending_club_info.csv', index_col='LoanStatNew')\n\ndef feat_info(col_name):\n '''\n Takes the column name or list of names\n and prints their features\n '''\n print(lending_data_info.loc[col_name]['Description']... | [
[
"pandas.read_csv",
"numpy.isnan"
]
] |
qin-yu/Plantseg-Cellpose-Augmentation | [
"1a3891a870bf674a316ba985353294736bcd2a18"
] | [
"src/datasets/investigate_dataset/jview.py"
] | [
"import skimage.io\nimport h5py\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef describe(im, name = None):\n if name is not None: print(name)\n print(f\"\\tdtype: {im.dtype}\")\n print(f\"\\tshape: {im.shape}\")\n print(f\"\\tmin: {im.min()}\")\n print(f\"\\tmean: {im.mean()}\")\n prin... | [
[
"numpy.zeros_like",
"numpy.unique"
]
] |
theblackcat102/ALBERT-Pytorch | [
"eebf3465cbc82c643dbe561b480bed0116f34d21"
] | [
"glue.py"
] | [
"# Copyright 2018 Dong-Hyun Lee, Kakao Brain.\n# (Strongly inspired by original Google BERT code and Hugging Face's code)\n\n\"\"\" Fine-tuning on A Classification Task with pretrained Transformer \"\"\"\n\nimport itertools\nimport csv\nimport os\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import Da... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.cat",
"torch.utils.data.Dataset.__init__",
"torch.nn.ReLU",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss",
"torch.nn.AdaptiveMaxPool1d"
]
] |
liuzuxin/Bullet-Safety-Gym | [
"6420fb2a5fabd3369ba613066559dd13b39de37f"
] | [
"bullet_safety_gym/envs/sensors.py"
] | [
"import pybullet as pb\nimport math\nimport abc\nimport numpy as np\n\n\nclass Sensor(abc.ABC):\n \"\"\" Baseclass for sensor units.\"\"\"\n def __init__(\n self,\n bc,\n offset: list,\n agent,\n obstacles: list,\n coordinate_system: int,\n ... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.arctan2",
"numpy.zeros"
]
] |
aioz-ai/BMVC20_CBSwR | [
"fd24336c3cba0b85c0fa2482bf82409457534266"
] | [
"find_lr.py"
] | [
"import torch.optim as optim\nfrom models import build_dual_model\nfrom dataset import MetricLearningDataset\nfrom torch.utils.data import DataLoader\nfrom augmentation import transform_train, transform_test\nfrom torch.autograd import Variable\nimport math\nimport torch\nimport numpy as np\nfrom trainer.trainer im... | [
[
"torch.zeros",
"torch.cat",
"torch.cuda.manual_seed",
"torch.unique",
"numpy.zeros",
"numpy.random.seed",
"torch.no_grad",
"matplotlib.pyplot.plot",
"torch.softmax",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.load",
"matplotlib.pyplot.show",
... |
junron/ml-paint | [
"a69dadafb798f7de62c395993fbf55bb45c9fb65"
] | [
"sniff.py"
] | [
"import sys\nfrom io import StringIO\nimport re\nimport json\nfrom tensorflow import keras\nfrom tensorflow.keras.models import load_model\nimport numpy as np\nimport socket\nimport json\n\nmodel = load_model(\"model-final.hd5\")\nprint(\"ok\")\nwhile True:\n # hex encoded packet payload - no split, no colons\n ... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.keras.models.load_model",
"numpy.array"
]
] |
SENC/acme | [
"6016899a7b6dbaab90d6eb0b1fe8588aac17deee"
] | [
"acme/agents/jax/impala/agent.py"
] | [
"# python3\n# Copyright 2018 DeepMind Technologies Limited. 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... | [
[
"numpy.ones"
]
] |
NH-24/intro-to-ds | [
"3bc5f5c9b971ccf99b016cda8853a9cee13a789c"
] | [
"INTRO_TO_DS/code.py"
] | [
"# --------------\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\n# Read the data\ndata = pd.read_csv(path)\n\n# print the first 5 rows of the dataset\nprint(data.head())\n\n# Split the data into independent and target variable\nX = data.drop(['G3'],1)\ny = data.G3\n\n# Split the data ... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.metrics.accuracy_score",
"sklearn.ensemble.RandomForestClassifier"
]
] |
zuoyuwei/crnn_torch_trt | [
"ba1f7e8d113a25325389ba2435cef9a548e55210",
"ba1f7e8d113a25325389ba2435cef9a548e55210"
] | [
"tool/create_dataset_copy.py",
"onnx2trt.py"
] | [
"import os\nimport lmdb\nimport cv2\nimport numpy as np\nimport argparse\nimport shutil\nimport sys\n\ndef checkImageIsValid(imageBin):\n if imageBin is None:\n return False\n \n try:\n imageBuf = np.fromstring(imageBin, dtype=np.uint8)\n img = cv2.imdecode(imageBuf, cv2.IMREAD_GRAYSCA... | [
[
"numpy.fromstring"
],
[
"numpy.array",
"numpy.copyto"
]
] |
palmtrey/nearface | [
"9274f13b2924a3ad9f97446772eb63bc7c482bff"
] | [
"tests/deepface-tests/Ensemble-Face-Recognition.py"
] | [
"import pandas as pd\nimport numpy as np\nimport itertools\nfrom sklearn import metrics\nfrom sklearn.metrics import confusion_matrix,accuracy_score, roc_curve, auc\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\ntqdm.pandas()\n\n#--------------------------\n#Data set\n\n# Ref: https://github.com/serengil/... | [
[
"sklearn.metrics.confusion_matrix",
"pandas.DataFrame",
"matplotlib.pyplot.figure",
"pandas.concat",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",
"pandas.read_csv",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.roc_curve"
]
] |
ghchen18/acl22_sixtp | [
"445f1711f0ca7fff1abace00bdca3151b56dc769"
] | [
"fairseq/tasks/cross_lingual_lm.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport itertools\nimport logging\nimport os\nfrom collections import OrderedDict\n\nimport numpy as np\nfrom fairseq import tokenize... | [
[
"numpy.concatenate"
]
] |
victoryc/torchsparse | [
"cca1d339b33f0151b07a83e66a8c99c9bfd0b1a9"
] | [
"torchsparse/nn/modules/norm.py"
] | [
"import torch\nfrom torch import nn\nfrom torchsparse.sparse_tensor import *\n\n_all__ = ['BatchNorm', 'GroupNorm']\n\nclass BatchNorm(nn.BatchNorm1d):\n def __init__(self,\n num_features: int,\n *,\n eps: float = 1e-5,\n momentum: float = 0.1) -> N... | [
[
"torch.zeros_like",
"torch.transpose"
]
] |
bumplzz69/LightGBM | [
"b1e5a843ab57c64b01c8896ef3cda6fdf907d417"
] | [
"tests/python_package_test/test_sklearn.py"
] | [
"# coding: utf-8\n# pylint: skip-file\nimport math\nimport os\nimport unittest\n\nimport lightgbm as lgb\nimport numpy as np\nfrom sklearn import __version__ as sk_version\nfrom sklearn.base import clone\nfrom sklearn.datasets import (load_boston, load_breast_cancer, load_digits,\n load... | [
[
"numpy.testing.assert_allclose",
"sklearn.datasets.load_digits",
"sklearn.externals.joblib.dump",
"numpy.exp",
"numpy.mean",
"numpy.where",
"sklearn.datasets.load_boston",
"numpy.full",
"numpy.testing.assert_array_almost_equal",
"numpy.arange",
"sklearn.base.clone",
... |
jason-neal/equanimous-octo-tribble | [
"a8788909331034725afe38ae96c83584b17c9fbd"
] | [
"octotribble/extraction/dracs_quicklooks2017.py"
] | [
"# DRACS Output quicklook/status.\n\n# Plot all 8 reduced spectra\n# Plot all 8 normalized reduced spectra\n# plot mean combined and median combined spectra.\n\nfrom __future__ import division, print_function\n\nimport argparse\nimport os\nimport sys\nfrom os.path import join\n\nimport matplotlib.pyplot as plt\nimp... | [
[
"numpy.max",
"matplotlib.pyplot.xlim",
"numpy.median",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.arange",
"matp... |
ahmed-shariff/experiment_server | [
"49e9293da23daf5625d66833cfb9eff8d962f682"
] | [
"experiment_server/_process_config.py"
] | [
"from pathlib import Path\nfrom shutil import ExecError\nfrom typing import Any, Callable, Dict, List, Tuple, Union\nfrom experiment_server._participant_ordering import construct_participant_condition, ORDERING_BEHAVIOUR\nfrom experiment_server.utils import ExperimentServerConfigurationExcetion\nfrom loguru import ... | [
[
"pandas.DataFrame"
]
] |
bmullet/neural_conduit | [
"06a9976d8ad69be154907f208dae05d36be0d5ac"
] | [
"constitutive.py"
] | [
"import numpy as np\nfrom scipy import special as sp\nfrom scipy.optimize import fsolve\nimport utils\nimport copy\nimport tensorflow as tf\n\n\n\n\ndef reformat_params (m):\n \"\"\"\n output m dictionary from smf or tdc is a bit tedious for what we want here. \n Need to clean up a few things to make sure ... | [
[
"numpy.array",
"tensorflow.where",
"scipy.optimize.fsolve",
"numpy.exp",
"numpy.argmax",
"numpy.power",
"numpy.sqrt",
"numpy.all",
"scipy.special.erf",
"numpy.log10",
"tensorflow.cast"
]
] |
timothijoe/DI-drive | [
"3cddefc85bbbca6bcdd8a4d796decacaf8d81778",
"3cddefc85bbbca6bcdd8a4d796decacaf8d81778",
"3cddefc85bbbca6bcdd8a4d796decacaf8d81778"
] | [
"core/policy/lbc_policy.py",
"core/utils/others/visualizer.py",
"core/utils/model_utils/resnet.py"
] | [
"from collections import namedtuple\nimport os\nfrom ding.torch_utils.data_helper import to_device, to_dtype, to_tensor\nimport torch\nfrom torchvision import transforms\nimport numpy as np\nfrom typing import Dict, List, Any, Optional\n\nfrom .base_carla_policy import BaseCarlaPolicy\nfrom core.models import PIDCo... | [
[
"numpy.concatenate",
"torch.device",
"numpy.array",
"numpy.linalg.norm",
"numpy.sin",
"numpy.sum",
"torch.no_grad",
"numpy.tan",
"numpy.mean",
"numpy.stack",
"torch.eye",
"torch.cuda.is_available",
"numpy.linalg.solve",
"numpy.clip",
"numpy.arctan2",
... |
tukss/yt | [
"8bf6fce609cad3d4b291ebd94667019ab2e18377",
"8bf6fce609cad3d4b291ebd94667019ab2e18377"
] | [
"yt/data_objects/index_subobjects/unstructured_mesh.py",
"yt/utilities/decompose.py"
] | [
"import numpy as np\n\nfrom yt.data_objects.selection_objects.data_selection_objects import (\n YTSelectionContainer,\n)\nfrom yt.funcs import mylog\nfrom yt.utilities.lib.mesh_utilities import fill_fcoords, fill_fwidths\n\n\nclass UnstructuredMesh(YTSelectionContainer):\n # This is a base class, not meant to... | [
[
"numpy.empty",
"numpy.zeros",
"numpy.unique"
],
[
"numpy.bincount",
"numpy.product",
"numpy.array",
"numpy.ones",
"numpy.any",
"numpy.where",
"numpy.sqrt",
"numpy.all",
"numpy.unique"
]
] |
maurendeviia/pythoncharmers | [
"b5775d0f51a6f2e5dc0365345e0436dea4c72c14"
] | [
"plot_matrix.py"
] | [
"# Importing necessary libraries\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n# Initialising arrays\nx = np.array([1, 4, 16, 32])\n\n# Plotting to our canvas\nplt.plot(x)\n\n# Display plotted\ndef funcname(parameter_list):\n \"\"\"\n docstring\n \"\"\"\n pass\nprint()\nfor target_list in... | [
[
"numpy.array",
"matplotlib.pyplot.plot"
]
] |
ucds-sg/h2oai | [
"7042860767dc25d1a7d7122103bbd5016d02df53"
] | [
"data/seattle_rain_modify.py"
] | [
"\"\"\"Transpose the Monthly Seattle Rain Inches data set for Time Series use cases\"\"\"\n\n# Contributors: Michelle Tanco - michelle.tanco@h2oai\n# Created: October 18th, 2019\n# Last Updated: October 18th, 2019\n\nfrom typing import Union, List\nfrom h2oaicore.data import CustomData\nimport datatable as dt\nimpo... | [
[
"pandas.to_datetime"
]
] |
nehak0601/gramex | [
"0354f58efe5e1fe7e5339c91dcf6baa38bcc50b7"
] | [
"tests/test_drivehandler.py"
] | [
"import os\nimport json\nimport time\nimport requests\nimport pandas as pd\nimport gramex.data\nfrom shutil import rmtree\nfrom mimetypes import guess_type\nfrom tornado.web import create_signed_value\nfrom gramex import conf\nfrom gramex.http import (OK, BAD_REQUEST, NOT_FOUND, REQUEST_ENTITY_TOO_LARGE,\n ... | [
[
"pandas.util.testing.assert_frame_equal"
]
] |
iamkaiwei/kaggle-landmark-recognition-2020-1st-place | [
"97df71ecfd37122730b7f0b29fde09ac36358609"
] | [
"src/utils.py"
] | [
"from conf import *\n\nimport torch\nimport random\nimport numpy as np\nimport os\n\nfrom typing import Dict, Tuple, Any\n\nfrom sklearn.metrics import roc_auc_score\nfrom scipy.special import expit, softmax\nfrom sklearn.metrics import precision_score\n\n\n\ndef set_seed(seed=1234):\n random.seed(seed)\n os.... | [
[
"torch.device",
"torch.cat",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.manual_seed",
"numpy.argsort",
"torch.ones_like",
"torch.topk"
]
] |
PJansson/Chexpert | [
"94b20deedbca9261eaf82b9a4309bb74d42ea8b0"
] | [
"chexpert/data/transforms.py"
] | [
"import cv2\nimport numpy as np\nfrom albumentations import ImageOnlyTransform\n\n\nclass TemplateMatch(ImageOnlyTransform):\n def __init__(self, data_dir, dataset, template_size=320, always_apply=True, p=1.0):\n super().__init__(always_apply, p)\n template_frontal = f\"{data_dir}/{dataset}/templat... | [
[
"numpy.repeat"
]
] |
arkilpatel/Transformer-Computation-Analysis | [
"82341f5f2f9cd0831e390f44b338165e45cd6413"
] | [
"Transformer/src/model.py"
] | [
"import numpy as np\r\nimport random\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport math\r\nimport copy\r\nimport time\r\nimport logging\r\nfrom torch.autograd import Variable\r\nimport pdb\r\nfrom src.components.utils import *\r\nfrom src.components.encoder import *\r\nfrom s... | [
[
"torch.nn.Linear",
"torch.nn.init.xavier_uniform_"
]
] |
UltraAssassin64/Toxicity-Detection-with-Emoji | [
"84d136740a87754606cad638765ee49912e07e2a"
] | [
"source/data_preprocessing.py"
] | [
"__author__ = \"Baishali Dutta\"\r\n__copyright__ = \"Copyright (C) 2021 Baishali Dutta\"\r\n__license__ = \"Apache License 2.0\"\r\n__version__ = \"0.1\"\r\n\r\n# -------------------------------------------------------------------------\r\n# Import Libraries\r\n# -------------------------... | [
[
"numpy.asarray",
"numpy.zeros"
]
] |
Vail-qin/Keras-TextClassification | [
"8acda5ae37db2647c8ecaa70027ffc6003d2abca"
] | [
"keras_textclassification/m15_SWEM/graph.py"
] | [
"# -*- coding: UTF-8 -*-\n# !/usr/bin/python\n# @time :2019/12/13 10:51\n# @author :Mo\n# @function :graph of SWEM\n# @paper : Baseline Needs More Love: On Simple Word-Embedding-Based Models and Associated Pooling Mechanisms()\n\n\nfrom keras.layers import GlobalMaxPooling1D, GlobalAveragePooling1D, MaxPoo... | [
[
"tensorflow.reduce_max",
"tensorflow.reduce_mean",
"tensorflow.concat",
"tensorflow.expand_dims"
]
] |
WenqiJiang/faiss-cpu-profiling | [
"f2c7b3051f8860e8918c713ef4baddd563cc515c"
] | [
"MICRO_CPU_profiling/plot_SIFT100M/plot_throughput_experiment_2_algorithm_settings.py"
] | [
"import matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pickle\n\nplt.style.use('ggplot')\n\n# SIFT100M, K=100\ny_no_OPQ = np.array([1500, 2103, 2533, 3624, 5903, 7468, 7032, 7194, 553])\ny_OPQ = np.array([1509, 2446, 3423, 3602, 5649, 6954, 7794, 7390, 518])\n\nx_labels = ['nlist=1024', 'nl... | [
[
"matplotlib.pyplot.rcParams.update",
"numpy.array",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.amax",
"matplotlib.pyplot.style.use",
"numpy.amin",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks"
]
] |
acmore/OpenEmbedding | [
"607a47c0543f8108d6390bda83db1fb4f4280a90"
] | [
"laboratory/inject/network_model.py"
] | [
"import os\nimport pandas\nimport tensorflow as tf\nimport horovod.tensorflow.keras as hvd\nimport deepctr.models\nimport deepctr.feature_column\n\nimport argparse\nparser = argparse.ArgumentParser()\ndefault_data = os.path.dirname(os.path.abspath(__file__)) + '/train100.csv'\nparser.add_argument('--data', default=... | [
[
"pandas.read_csv",
"tensorflow.keras.callbacks.ModelCheckpoint"
]
] |
vishalbelsare/graphs | [
"4fbeb025dfe33340335f34300f58dd3809228822",
"4fbeb025dfe33340335f34300f58dd3809228822",
"4fbeb025dfe33340335f34300f58dd3809228822"
] | [
"graphs/datasets/tests/test_mountain_car.py",
"examples/interactive.py",
"graphs/construction/downsample.py"
] | [
"from __future__ import absolute_import\nimport numpy as np\nimport unittest\nfrom matplotlib import pyplot\npyplot.switch_backend('template')\n\nfrom ... import Graph\nfrom .. import mountain_car as mcar\n\n\nclass TestMountainCar(unittest.TestCase):\n\n def test_traj_sampling(self):\n traj, traces = mcar.moun... | [
[
"matplotlib.pyplot.switch_backend",
"numpy.random.random"
],
[
"matplotlib.pyplot.ginput",
"matplotlib.pyplot.plot"
],
[
"numpy.linalg.norm",
"numpy.arange",
"numpy.vstack",
"sklearn.metrics.pairwise.pairwise_distances",
"numpy.cumsum",
"numpy.einsum",
"numpy.se... |
CNLPT/lightNLP | [
"c7f128422ba5b16f514bb294145cb3b562e95829"
] | [
"lightnlp/sl/cws/module.py"
] | [
"import torch\nfrom tqdm import tqdm\n\nfrom ...utils.learning import adjust_learning_rate\nfrom ...utils.log import logger\nfrom ...base.module import Module\n\nfrom .config import DEVICE, DEFAULT_CONFIG\nfrom .model import Config, BiLstmCrf\nfrom .tool import cws_tool\nfrom .utils.convert import bis_cws\n\nseed =... | [
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.tensor"
]
] |
cghawthorne/tensorboard | [
"82ef0a5a4b4177ab22b9673e29cab49e99438370"
] | [
"tensorboard/plugins/text/text_plugin.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... | [
[
"numpy.array"
]
] |
Fei00Wu/espresso | [
"4e8e6e2f9151a87448845c5142611c103dd4580c"
] | [
"tests/espresso/test_speech_dataset.py"
] | [
"# Copyright (c) Yiming Wang\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport unittest\nimport string\nimport numpy as np\nimport os\n\nimport torch\n\nfrom espresso.data import (\n AsrDictionary,\n AsrTextDataset,\n ... | [
[
"numpy.random.seed",
"torch.from_numpy",
"torch.cuda.is_available",
"numpy.random.randint",
"torch.utils.data.DataLoader",
"numpy.random.uniform"
]
] |
SergeyVolodko/sonnet | [
"ae34a78bc230f5316dc99dc06326c35d6c4d9f09"
] | [
"sonnet/src/initializers.py"
] | [
"# Copyright 2019 The Sonnet Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ... | [
[
"tensorflow.linalg.tensor_diag_part",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.sqrt",
"tensorflow.linalg.qr",
"tensorflow.cast",
"tensorflow.linalg.matrix_transpose",
"tensorflow.zeros",
"tensorflow.minimum",
"tensorflow.eye",
"tensorflow.fill",
"tensorf... |
eff-kay/vaex | [
"a30a4f7520b93b1898a8d03db9a7ded468f35940"
] | [
"packages/vaex-hdf5/vaex/hdf5/dataset.py"
] | [
"__author__ = 'maartenbreddels'\nimport os\nimport logging\nimport numpy as np\nimport numpy.ma\nimport vaex\nfrom vaex.utils import ensure_string\nimport re\nimport six\nimport vaex.dataset\nimport vaex.file\nfrom vaex.expression import Expression\nfrom vaex.dataset_mmap import DatasetMemoryMapped\nfrom vaex.file ... | [
[
"numpy.ma.array"
]
] |
kmatt/toyplot | [
"d6784ab176c93aebf9b12831ced8f435bdcfeab1"
] | [
"toyplot/format.py"
] | [
"# Copyright 2014, Sandia Corporation. Under the terms of Contract\n# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain\n# rights in this software.\n\n\"\"\"Strategy objects for formatting text.\"\"\"\n\n\nimport numbers\nimport warnings\n\nimport custom_inherit\nimport numpy\n\nimport ... | [
[
"numpy.isnan"
]
] |
Gxx-5/MyPhoto2Cartoon | [
"aa05dfa8b7d6c507c33026a2e8b299d5779357be"
] | [
"utils/preprocess.py"
] | [
"# coding=utf-8\nfrom .face_detect import FaceDetect\nfrom .face_seg import FaceSeg\n# from yoloFace.face_detector import face_detect\nfrom facecrop.faceCrop import FaceCrop\nimport numpy as np\nimport cv2\nimport time\nimport dlib\n\n\nclass Preprocess:\n def __init__(self, device='cpu', detector='dlib'):\n ... | [
[
"numpy.max",
"numpy.zeros",
"numpy.ones",
"numpy.min",
"numpy.dstack"
]
] |
darwinli/buylowsellhigh_catalyst | [
"f7a143cb78c614d2d347742375e8bb4d76221d5c"
] | [
"catalyst/utils/math_utils.py"
] | [
"#\n# Copyright 2013 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or... | [
[
"numpy.isnan"
]
] |
apaszke/dex-lang | [
"b4ce47b24fc8159e403c8825876178d1d62819f2"
] | [
"misc/py/generate-dex-data.py"
] | [
"# Copyright 2019 Google LLC\n#\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file or at\n# https://developers.google.com/open-source/licenses/bsd\n\nfrom collections import namedtuple\nimport numpy as np\nimport dex_binary_object as dbo\n\ndata = (1.2,\n 1... | [
[
"numpy.array"
]
] |
reikdas/awkward-1.0 | [
"40fdf1e6bf427dab7923934d6180e1621ea59e73"
] | [
"tests/test_0057-virtual-array.py"
] | [
"# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/master/LICENSE\n\nfrom __future__ import absolute_import\n\nimport sys\nimport json\ntry:\n # pybind11 only supports cPickle protocol 2+ (-1 in pickle.dumps)\n # (automatically satisfied in Python 3; this is just to keep testing Pytho... | [
[
"numpy.array"
]
] |
almaan/eggplant | [
"f9e507e809b9a0abe6f080d726a666283bbcfceb"
] | [
"test/test_preprocess.py"
] | [
"import numpy as np\nimport pandas as pd\nimport anndata as ad\nimport squidpy as sq\nimport eggplant as eg\nfrom scipy.spatial.distance import cdist\nimport torch as t\nimport unittest\nimport gpytorch as gp\nfrom . import utils as ut\n\n\nclass GetLandmarkDistance(unittest.TestCase):\n def test_default_wo_ref(... | [
[
"pandas.Index",
"numpy.isnan",
"pandas.DataFrame",
"numpy.random.uniform",
"numpy.unique"
]
] |
kakhahmed/EXtra-data | [
"67a9405cd67dd8b333dbc1633276611a8d9cb538"
] | [
"extra_data/utils.py"
] | [
"\"\"\"\nHelpers functions for the euxfel_h5tools package.\n\nCopyright (c) 2017, European X-Ray Free-Electron Laser Facility GmbH\nAll rights reserved.\n\nYou should have received a copy of the 3-Clause BSD License along with this\nprogram. If not, see <https://opensource.org/licenses/BSD-3-Clause>\n\"\"\"\n\nfrom... | [
[
"matplotlib.pyplot.draw",
"matplotlib.pyplot.imshow"
]
] |
ZiBuDo/MyCareer | [
"41a686f199e5e88ff4d863c54304b8128bd87580",
"41a686f199e5e88ff4d863c54304b8128bd87580"
] | [
"examples/text/hashing_vs_dict_vectorizer.py",
"examples/linear_model/plot_polynomial_interpolation.py"
] | [
"\"\"\"\n===========================================\nFeatureHasher and DictVectorizer Comparison\n===========================================\n\nCompares FeatureHasher and DictVectorizer by using both to vectorize\ntext documents.\n\nThe example demonstrates syntax and speed only; it doesn't actually do\nanything ... | [
[
"sklearn.feature_extraction.FeatureHasher",
"sklearn.feature_extraction.DictVectorizer",
"sklearn.datasets.fetch_20newsgroups"
],
[
"numpy.sin",
"numpy.random.RandomState",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"sklearn.preprocessing.PolynomialFeatures",
"sk... |
paulesta55/PPO-PyTorch | [
"a609c1a9a33533d80130cad7b43436c92c69c97d"
] | [
"network.py"
] | [
"import random\nfrom collections import namedtuple\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torchvision.transforms as T\nimport logging\n\nTransition = namedtuple('Transition',\n ('state', 'action', 'next_state', 'reward'))\n\n... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.Softmax",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d"
]
] |
byhob/xarm_ros | [
"52a3b08198e950c287dafac0029ee62862369a5e"
] | [
"examples/xarm7_redundancy_res/scripts/robot_jogging.py"
] | [
"#!/usr/bin/env python\nimport argparse\nimport rospy\nimport actionlib\nfrom control_msgs.msg import FollowJointTrajectoryActionFeedback, FollowJointTrajectoryActionResult, \\\n FollowJointTrajectoryAction, FollowJointTrajectoryGoal\nfrom trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint\nimport ... | [
[
"numpy.identity",
"numpy.array",
"numpy.linalg.pinv",
"numpy.zeros"
]
] |
sebascuri/GPSSMtorch | [
"799db18bebd4cc70ed4c054cadfcf5c4693c95ae"
] | [
"experiments/robomove/process_robomove.py"
] | [
"\"\"\"Python Script Template.\"\"\"\nfrom gpssm.plotters import plot_evaluation_datasets\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom itertools import product\n\nSPLITS = ['test', 'train', 'last']\n\ndef parse_file(file_name):\n \"\"\"Parse a file.\"\"\"\n with open(file_name) as file:\n ... | [
[
"numpy.std",
"numpy.mean"
]
] |
GrahamAnto/cannabis-data-science | [
"1d5f3085e7b2858b6791840b90335be4669268b3"
] | [
"2022-03-09/utils.py"
] | [
"\"\"\"\nUtility Functions | Cannabis Data Science\nCopyright (c) 2021-2022 Cannlytics\n\nAuthor: Keegan Skeate <keegan@cannlytics.com>\nCreated: 10/27/2021\nUpdated: 1/18/2022\nLicense: MIT License <https://opensource.org/licenses/MIT>\n\"\"\"\n# Standard imports.\nfrom datetime import datetime\nimport re\nfrom ty... | [
[
"pandas.tseries.offsets.MonthEnd",
"pandas.to_datetime"
]
] |
lucyvost/STRIFE | [
"3557e9b989db2fd37bf187214e5dcfc5bcf67bf7"
] | [
"old_STRIFE_changes2.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jul 26 17:12:05 2021\n\n@author: Tom Hadfield\n\nMain class for STRIFE algorithm\n\npython STRIFE_changes2.py -p Mpro.pdb -f less_fragments_to_elaborate2.sdf -o otw -s less_fragments_to_elaborate2.smi -it otw -m new_hotspots100\n\n\n\"\"\"\n\n... | [
[
"numpy.arccos",
"numpy.linalg.norm",
"numpy.savetxt",
"numpy.dot",
"pandas.DataFrame",
"numpy.min",
"numpy.subtract",
"pandas.read_csv"
]
] |
ganguli-lab/Theano | [
"d61c929b6d1a5bae314545cba79c879de687ea18"
] | [
"theano/sparse/type.py"
] | [
"import numpy\ntry:\n import scipy.sparse\n imported_scipy = True\nexcept ImportError:\n imported_scipy = False\n\nimport theano\nfrom theano import gof\n\n\ndef _is_sparse(x):\n \"\"\"\n @rtype: boolean\n @return: True iff x is a L{scipy.sparse.spmatrix} (and not a\n L{numpy.ndarray})\n \"\... | [
[
"numpy.may_share_memory"
]
] |
airenas/pwgan-pytorch-serving | [
"fb16498946b880e2f147acdeb76372e0b7ab6b4a"
] | [
"service/pwgan/model.py"
] | [
"import base64\nimport io\nimport logging\nimport os\nimport time\n\nimport soundfile\nimport torch\nimport yaml\nfrom parallel_wavegan.utils import load_model\n\nfrom service.metrics import ElapsedLogger\n\nlogger = logging.getLogger(__name__)\n\n\ndef as_string(data, sampling_rate):\n buffer = io.BytesIO()\n ... | [
[
"torch.device",
"torch.no_grad",
"torch.cuda.synchronize"
]
] |
michaelwolz/ChessML | [
"72d82804cac0554440ef39caf0f25eb399f4a34f"
] | [
"chess_net_simple.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# The SimpleNet just decides whether a given chess tile is empty or full. This class is just intended for testing and\n# to simplify the labeling progress while sorting out empty tiles that make up a large part of the data.\n\nimport torch\nimport torch.optim as optim\nimp... | [
[
"torch.nn.Linear",
"torch.max",
"torch.no_grad",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.nn.functional.relu",
"torch.nn.functional.max_pool2d",
"torch.nn.CrossEntropyLoss"
]
] |
amhajavi/SiameseCapsule | [
"7caac103399c1bb4c492b55f4af62909ddd51a1b"
] | [
"misc/utils.py"
] | [
"# Third Party\nimport librosa\nimport numpy as np\nimport math\n\n# ===============================================\n# code from Arsha for loading data.\n# ===============================================\ndef load_wav(vid_path, sr, mode='train'):\n wav, sr_ret = librosa.load(vid_path, sr=sr)\n assert s... | [
[
"numpy.random.normal",
"numpy.mean",
"numpy.std",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.amax",
"numpy.append",
"numpy.random.random"
]
] |
vbreeden/pymir3x | [
"4dedcfcc27a5e32f46897044ca8409c9df340dab"
] | [
"pymir3x/Onsets.py"
] | [
"\"\"\"\nCompute onset times from time-domain audio data\nSpectra are computed as necessary\nSupported methods:\n- Time-domain: energy\n- Spectral: flux\n\nPorted from https://github.com/jsawruk/pymir: 30 August 2017\n\"\"\"\n\nimport numpy\n\nfrom pymir3x import Energy, SpectralFlux\n\n\ndef onsets(audio_data, met... | [
[
"numpy.average",
"numpy.array"
]
] |
arthurlirui/refsepECCV2020 | [
"3a58d5ff2c908f6d30c1c1d9278d4b335fd65f42"
] | [
"src/options/base_options.py"
] | [
"import argparse\nimport os\nfrom util import util\nimport torch\n\n\nclass BaseOptions():\n def __init__(self):\n self.parser = argparse.ArgumentParser()\n self.initialized = False\n\n def initialize(self): \n # experiment specifics\n self.parser.add_argument('--name', type=str... | [
[
"torch.cuda.set_device"
]
] |
TheoNguyen611/glowIP | [
"6629b1f62f7d12a57c17194baec7ce85f99753c7"
] | [
"glow/squeeze.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\n\n# device \nif torch.cuda.is_available():\n device = \"cuda\"\nelse:\n device = \"cpu\"\n \n\n\nclass Squeeze(nn.Module):\n \n \n def __init__(self, factor, contiguous=False):\n super(Squeeze, self).__init__()\n self.factor =... | [
[
"numpy.random.normal",
"torch.cuda.is_available",
"torch.tensor",
"torch.norm"
]
] |
physsz/foolbox | [
"7b0e60b994468ab5cf065d7ca931853dd2b2b8ed",
"7b0e60b994468ab5cf065d7ca931853dd2b2b8ed"
] | [
"foolbox/models/lasagne.py",
"foolbox/tests/test_attacks_gradient.py"
] | [
"from __future__ import absolute_import\nimport numpy as np\n\n\nfrom .base import DifferentiableModel\n\n\nclass LasagneModel(DifferentiableModel):\n \"\"\"Creates a :class:`Model` instance from a `Lasagne` network.\n\n Parameters\n ----------\n input_layer : `lasagne.layers.Layer`\n The input t... | [
[
"numpy.array",
"numpy.squeeze"
],
[
"numpy.linspace"
]
] |
DeepVoodooFX/pixel2style2pixel | [
"0254c32400d55f7e400ead15b02ad6a992ba1e21"
] | [
"scripts/style_mixing.py"
] | [
"import os\nfrom argparse import Namespace\n\nfrom tqdm import tqdm\nimport numpy as np\nfrom PIL import Image\nimport torch\nfrom torch.utils.data import DataLoader\nimport sys\n\nsys.path.append(\".\")\nsys.path.append(\"..\")\n\nfrom configs import data_configs\nfrom datasets.inference_dataset import InferenceDa... | [
[
"torch.no_grad",
"numpy.random.randn",
"torch.load",
"torch.from_numpy"
]
] |
zhenwendai/RGP | [
"be679607d3457a1038a2fe39b36b816ea380ea39",
"be679607d3457a1038a2fe39b36b816ea380ea39"
] | [
"testing/minibatch_tests.py",
"autoreg/util.py"
] | [
"#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport numpy as np\nimport GPy\nimport os\nimport copy\n\nimport autoreg\nfrom autoreg.data_streamers import TrivialDataStreamer, RandomPermutationDataStreamer, StdMemoryDataStreamer\n\n# base_path = os.path.dirname(__file__)\n\n\ndef generate_dat... | [
[
"numpy.isclose",
"numpy.random.randn"
],
[
"numpy.lib.stride_tricks.as_strided",
"numpy.exp",
"scipy.linalg.lstsq",
"numpy.any",
"numpy.abs",
"numpy.clip"
]
] |
little111cow/2021-D- | [
"db128ae39678581a28b974a6a91a3d8d7d119704"
] | [
"code/s1/dc_corr.py"
] | [
"from scipy.io import loadmat, savemat\n\nfrom scipy.spatial.distance import pdist, squareform\nimport numpy as np\n\n\ndef distcorr(X, Y):\n\t\"\"\"距离相关系数\"\"\"\n\tX = np.atleast_1d(X)\n\tY = np.atleast_1d(Y)\n\tif np.prod(X.shape) == len(X):\n\t\tX = X[:, None]\n\tif np.prod(Y.shape) == len(Y):\n\t\tY = Y[:, None... | [
[
"scipy.spatial.distance.pdist",
"scipy.io.loadmat",
"scipy.io.savemat",
"numpy.prod",
"numpy.atleast_1d",
"numpy.sqrt",
"numpy.atleast_2d"
]
] |
lakhotiaharshit/qcodes_generate_test_db | [
"181cdfc7a447c99d73a7244424fa6f4bb453676d"
] | [
"generate_version_4a.py"
] | [
"\"\"\"\nGenerate a version 4a database file for qcodes' test suite to consume.\n\nVersion 4a accidentally serialised the RunDescriber with an InterDependencies_\nobject instead of an InterDependencies object\n\"\"\"\n\nimport os\nimport numpy as np\n\n# NB: it's important that we do not import anything from qcodes... | [
[
"numpy.random.seed",
"numpy.random.rand"
]
] |
mktranstrum/ICTSSloppyModels2017 | [
"bb4861153f955f583714e60661310a3c2dc7582e"
] | [
"Figures/StructuralLinear/PlotStructuralLinear.py"
] | [
"import numpy as np\nimport pylab\n\nsqrt = np.sqrt\n\nfig_width = 8.0 # inches \ngolden_mean = (sqrt(5)-1.0)/2.0 # Aesthetic ratio\nfig_height = fig_width*golden_mean # height in inches\ndpi = 600.0 # Convert inch to pt\n\nfig_size = [fig_width,fig... | [
[
"numpy.dot",
"numpy.random.seed",
"numpy.ones",
"numpy.random.randn",
"numpy.linspace"
]
] |
Frekby/glumpy | [
"7a71151ac208766d9697737cb7978bb9d12aa243"
] | [
"examples/transparency/oit-teapot.py"
] | [
"# -----------------------------------------------------------------------------\n# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.\n# Distributed under the (new) BSD License.\n# -----------------------------------------------------------------------------\nimport numpy as np\nfrom glumpy import ap... | [
[
"numpy.zeros"
]
] |
kvdblom/AutoFolio | [
"60a38a485e832b4e9bd2d06cbe7e1aecc994bb32"
] | [
"autofolio/feature_preprocessing/pca.py"
] | [
"import logging\n\nimport numpy as np\nimport pandas as pd\n\nfrom sklearn.decomposition import PCA\n\nfrom ConfigSpace.hyperparameters import CategoricalHyperparameter, \\\n UniformFloatHyperparameter, UniformIntegerHyperparameter\nfrom ConfigSpace.conditions import EqualsCondition, InCondition\nfrom ConfigSpac... | [
[
"numpy.array"
]
] |
rougier/spatial-computation | [
"393da8a6127d50c4b456d39a4fa6ec2febff311a"
] | [
"data/edge-bundling.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.path import Path\nimport matplotlib.patches as patches\n\n\ndef curve(P0,P1):\n\n x = .25\n y = .15\n\n length = np.sqrt(((P1-P0)**2).sum())\n\n \n T = (P1-P0)/length\n O = np.array([-T[1],T[0]])\n\n V = np.zeros((8,2))\n ... | [
[
"matplotlib.path.Path",
"numpy.array",
"numpy.random.normal",
"numpy.zeros",
"matplotlib.patches.PathPatch",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
intel/chainer | [
"47ddf4e8ddfc3e0a56c6fd34a67e4cddd5a9e710",
"a69103a4aa59d5b318f39b01dbcb858d465b89cf"
] | [
"chainer/link.py",
"tests/chainer_tests/functions_tests/connection_tests/test_linear.py"
] | [
"import collections\nimport contextlib\nimport copy\nimport warnings\n\nimport numpy\nimport six\n\nimport chainer\nfrom chainer.backends import cuda\nfrom chainer.backends import intel64\nfrom chainer import initializers\nfrom chainer import variable\n\n\ndef _is_shape(value):\n if value is None:\n retur... | [
[
"numpy.array",
"numpy.copyto",
"numpy.asarray"
],
[
"numpy.random.uniform",
"numpy.prod",
"numpy.ones"
]
] |
DistributedML/TorML | [
"f41a0378f5e46e578c6bd9c8bfd56037d1a228cf"
] | [
"ML_experimental/code/logistic_main4.py"
] | [
"from __future__ import division\nimport utils\nimport logistic_model\nimport global_model4\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n\ncollection4 = [\"bank\", \"creditcard\", \"diabetic\", \"eye\", \"logisticData\", \n \"magic\",\"occupancy\", \"pulsars\", \"skin\", \"tom\", \"tr... | [
[
"numpy.hstack",
"numpy.random.shuffle",
"matplotlib.pyplot.figure"
]
] |
plroit/qasrl-gs | [
"a37fca4c29091533ee1dda2ac80717ebf2ce607a"
] | [
"scripts/evaluate_dataset.py"
] | [
"import os\n\nfrom typing import List, Dict, Generator, Tuple\nimport pandas as pd\nimport numpy as np\nfrom argparse import ArgumentParser\n\nfrom tqdm import tqdm\n\nfrom evaluate import evaluate, Metrics, match_arguments\nfrom common import Question, Role, QUESTION_FIELDS, Argument\nfrom decode_encode_answers im... | [
[
"numpy.zeros",
"pandas.merge",
"pandas.DataFrame",
"pandas.concat",
"pandas.read_csv"
]
] |
GaelVaroquaux/canica | [
"7414aaa8441e85ed5d0b36153ad554e6bc843713"
] | [
"canica/algorithms/test/test_fastica.py"
] | [
"\"\"\"\nTest the fastica algorithm.\n\"\"\"\n\nimport numpy as np\n\n# No relative import to be able to run this file as a demo\n#from ..fastica import fastica\n#from ..common import center_and_norm\nfrom canica.algorithms.fastica import fastica\nfrom canica.algorithms.common import center_and_norm \n\ndef test_fa... | [
[
"numpy.linspace",
"numpy.dot",
"numpy.sin",
"numpy.cos"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.