repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
tjwei/play_nsfw | [
"d93dc117fdf62da229a4b6957fba87aeb6a53750"
] | [
"classify_nsfw3.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nCopyright 2016 Yahoo Inc.\nLicensed under the terms of the 2 clause BSD license. \nPlease see LICENSE file in the project root for terms.\n\"\"\"\n\nimport numpy as np\nimport os\nimport sys\nimport argparse\nimport glob\nimport time\nfrom PIL import Image\nfrom io import BytesIO\nim... | [
[
"numpy.array"
]
] |
peterfpeterson/python_notebooks | [
"7bbc4d369f7175b7588c0c4abfd155403f2749b6"
] | [
"notebooks/__code/rename_files.py"
] | [
"from ipywidgets import widgets\nfrom IPython.core.display import display, HTML\nimport os\nimport numpy as np\nfrom __code import utilities\nfrom __code.ipywe import fileselector\n\nfrom __code.file_handler import ListMostDominantExtension\nfrom __code.ipywe.myfileselector import FileSelectorPanelWithJumpFolders\n... | [
[
"numpy.int"
]
] |
andretocci/Marketing-Attribution-Models | [
"01e1b2de609515720a554b213070c1bc8ed24198"
] | [
"marketing_attribution_models/MAM.py"
] | [
"import itertools\nimport math\nimport re\nimport warnings\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\n\nfrom .models import heuristic\nfrom .data import random_data\nfrom .data_prep import journey\nfrom .data_prep import group_data\n\n\nclass MAM:\n \"\"\"... | [
[
"numpy.trunc",
"pandas.merge",
"pandas.to_datetime",
"pandas.Series",
"numpy.linalg.inv",
"numpy.linalg.eig",
"numpy.asarray",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.linalg.pinv",
"matplotlib.pyplot.xticks",
"numpy.array",
"numpy.where",
"p... |
cvlab-stonybrook/Emotion-Prediction | [
"fb45f943208467ef91d8e43874599263f669166d"
] | [
"main/CNNs/mains_emotions/MultiDS_Mix_test.py"
] | [
"# Copyright (c) 2019 Zijun Wei, Yevheniia Soroka\n# Licensed under the MIT License.\n# Authors: Zijun Wei, Yevheniia Soroka \n# Usage(TODO): modified from https://github.com/pytorch/examples/blob/master/imagenet/main.py\n# Email: hzwzijun@gmail.com, ysoroka@cs.stonybrook.edu\n# Created: 25/Jun/2019 11:09\n\nimport... | [
[
"torch.set_default_tensor_type",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.distributed.init_process_group",
"torch.nn.functional.log_softmax",
"torch.load",
"torch.manual_seed",
"torch.utils.data.DataLoader"... |
hlxsrc/MuLC | [
"8c5d9d48cfd370a218e2abc9b9baee1182a3c379"
] | [
"train.py"
] | [
"# USAGE\n# python train.py --dataset dataset --model fashion.model --labelbin mlb.pickle\n\n# set the matplotlib backend so figures can be saved in the background\nimport matplotlib\nmatplotlib.use(\"Agg\")\n\n# import the necessary packages\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nfro... | [
[
"matplotlib.pyplot.legend",
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"matplotlib.pyplot.title",
"matplotlib.use",
"numpy.arange",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.MultiLabelBina... |
nmnaughton/rl-baselines3-zoo | [
"24029383893bb581ae0d02a3501db5238912049c"
] | [
"utils/hyperparams_opt.py"
] | [
"from typing import Any, Dict\n\nimport numpy as np\nimport optuna\nfrom stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise\nfrom torch import nn as nn\n\nfrom utils import linear_schedule\n\n\ndef sample_ppo_params(trial: optuna.Trial) -> Dict[str, Any]:\n \"\"\"\n Sampler ... | [
[
"numpy.zeros",
"numpy.ones"
]
] |
NeuroscienceScripts/pulse2percept | [
"65c11393a33d1531cd02a3e38243414bf8172e9a"
] | [
"pulse2percept/models/granley2021.py"
] | [
"\"\"\"`BiphasicAxonMapModel`\"\"\"\nfrom typing import Type\nimport numpy as np\nimport sys\n\nfrom . import AxonMapModel, AxonMapSpatial, TemporalModel, Model\nfrom ..implants import ProsthesisSystem, ElectrodeArray\nfrom ..stimuli import BiphasicPulseTrain, Stimulus\nfrom ..percepts import Percept\nfrom ..utils ... | [
[
"numpy.array",
"numpy.random.random",
"numpy.any"
]
] |
effigies/nilearn | [
"7e9cd8c63154af564383c12d6d581583a6e1a4c4"
] | [
"examples/03_connectivity/plot_multi_subject_connectome.py"
] | [
"\"\"\"\nGroup Sparse inverse covariance for multi-subject connectome\n=============================================================\n\nThis example shows how to estimate a connectome on a group of subjects\nusing the group sparse inverse covariance estimate.\n\n\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy... | [
[
"matplotlib.pyplot.imshow",
"sklearn.covariance.GraphLassoCV",
"matplotlib.pyplot.title",
"numpy.concatenate",
"matplotlib.pyplot.colorbar",
"sklearn.externals.joblib.Memory",
"matplotlib.pyplot.figure"
]
] |
beizhengren/pytorch-deeplab-xception | [
"8dc3107104f4d25ec74ea29ba72af360f192afc1"
] | [
"dataloaders/__init__.py"
] | [
"from dataloaders.datasets import cityscapes, coco, combine_dbs, pascal, sbd\nfrom torch.utils.data import DataLoader\n\ndef make_data_loader(args, **kwargs):\n\n if args.dataset == 'pascal': \n train_set = pascal.VOCSegmentation(args, split='train')\n val_set = pascal.VOCSegmentation(args, split='... | [
[
"torch.utils.data.DataLoader"
]
] |
SachiniSiriwardene/design-space-exploration | [
"9330c4403ef5654fffae74819836d34911b650a4"
] | [
"explorer.py"
] | [
"\"\"\"\n Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n\n WSO2 Inc. licenses this file to you under the Apache License,\n Version 2.0 (the \"License\"); you may not use this file except\n in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apach... | [
[
"pandas.read_csv",
"numpy.random.seed",
"sklearn.utils.shuffle",
"pandas.DataFrame",
"numpy.append",
"numpy.array",
"numpy.empty"
]
] |
tangandrew/mixreg | [
"6e013110fa2826971e192cbb50e56be9969e2b5e",
"6e013110fa2826971e192cbb50e56be9969e2b5e"
] | [
"train_procgen/utils.py",
"train_procgen/model.py"
] | [
"import tensorflow as tf\n\nREWARD_RANGE_FOR_C51 = {\n 'starpilot': (0, 35),\n 'caveflyer': (0, 13.4),\n 'dodgeball': (0, 19),\n 'fruitbot': (-5, 27.2),\n 'jumper': (0, 10),\n 'climber': (0, 12.6)\n}\n\ndef reduce_std(input_tensor, axis=None, keepdims=False):\n \"\"\"\n Tensorflow 1.12 compa... | [
[
"tensorflow.math.sqrt",
"tensorflow.math.reduce_mean",
"tensorflow.math.square"
],
[
"tensorflow.variables_initializer",
"tensorflow.nn.l2_loss",
"tensorflow.train.AdamOptimizer",
"numpy.where",
"numpy.random.beta",
"tensorflow.get_collection",
"numpy.arange",
"tens... |
lc0/tensorflow-recorder | [
"d083ef223273ed2c8f6542b19d74fc0ed09d9344"
] | [
"tfrecorder/check.py"
] | [
"# Lint as: python3\n\n# Copyright 2020 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap... | [
[
"tensorflow.data.TFRecordDataset",
"tensorflow.io.parse_single_example",
"tensorflow.io.gfile.glob"
]
] |
cjbayron/imageclassifier-cli | [
"3e298269c244b49e29d66e85c126584b73976532"
] | [
"util/utilities.py"
] | [
"# -*- coding:utf-8 -*-\n\"\"\"\nUtilities\n\nCollection of utility functions\n\"\"\"\n\nimport json\nimport glob\nimport os\nimport random\nimport pathlib\nfrom datetime import datetime\n\nimport numpy as np\nimport tensorflow as tf\n\nimport common.constants as const\n\n\ndef get_randomized_image_list(data_dir):\... | [
[
"tensorflow.FixedLenFeature",
"tensorflow.data.TFRecordDataset",
"tensorflow.image.per_image_standardization",
"tensorflow.image.decode_image",
"tensorflow.image.convert_image_dtype",
"tensorflow.train.BytesList",
"tensorflow.parse_single_example",
"numpy.array",
"numpy.where",... |
LCAV/PyLocus | [
"a4132c0561ade6a79d584d61aea10358ecc53fba"
] | [
"pylocus/simulation.py"
] | [
"#!/usr/bin/env python\n# module SIMULATION\nimport numpy as np\n\n\ndef weights_one(N):\n weights = np.ones((N, N))\n weights[range(N), range(N)] = 0.0\n return weights\n\n\ndef weights_zero(N):\n weights = weights_one(N)\n weights[0, 1] = 0.0\n weights[1, 0] = 0.0\n return weights\n\n\ndef we... | [
[
"numpy.sqrt",
"numpy.power",
"numpy.random.choice",
"numpy.triu_indices",
"numpy.arange",
"numpy.ones",
"numpy.random.normal",
"numpy.triu",
"numpy.zeros"
]
] |
albertometelli/pfqi | [
"84901d291e759cb4e2471f0b2ba521acad6ac335"
] | [
"trlib/environments/car_on_hill.py"
] | [
"import gym\nimport numpy as np\nfrom builtins import range\nfrom gym import spaces\nfrom gym.utils import seeding\nfrom scipy.integrate import odeint\n\n\nclass CarOnHill(gym.Env):\n \"\"\"\n The Car On Hill environment as presented in:\n \"Tree-Based Batch Mode Reinforcement Learning, D. Ernst et. al.\"\... | [
[
"numpy.abs",
"scipy.integrate.odeint",
"numpy.append",
"numpy.array",
"numpy.zeros"
]
] |
chccc1994/openvino | [
"031e998a15ec738c64cc2379d7f30fb73087c272",
"031e998a15ec738c64cc2379d7f30fb73087c272"
] | [
"model-optimizer/mo/ops/op.py",
"runtime/bindings/python/tests/test_ngraph/test_gather.py"
] | [
"# Copyright (C) 2018-2021 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\nimport copy\nimport logging as log\nfrom collections import namedtuple\n\nimport networkx as nx\nimport numpy as np\n\nfrom mo.front.common.partial_infer.utils import int64_array, strict_compare_tensors\nfrom mo.front.extractor i... | [
[
"numpy.array",
"numpy.expand_dims",
"numpy.array_equal"
],
[
"numpy.array",
"numpy.allclose"
]
] |
nickcotton89/sympy | [
"a22f40463cba702b4a3d2c55bb9dee32ce5a45fa"
] | [
"sympy/matrices/expressions/matexpr.py"
] | [
"from typing import Tuple as tTuple\n\nfrom sympy.core.logic import FuzzyBool\n\nfrom functools import wraps, reduce\nimport collections\n\nfrom sympy.core import S, Symbol, Integer, Basic, Expr, Mul, Add\nfrom sympy.core.decorators import call_highest_priority\nfrom sympy.core.compatibility import SYMPY_INTS, defa... | [
[
"numpy.empty"
]
] |
EdwardSmith1884/Multi-View-Silhouette-and-Depth-Decomposition-for-High-Resolution-3D-Object-Representation | [
"58d316ca85061eed6c1e7ed5611741050ada6004"
] | [
"scripts/models.py"
] | [
"import tensorflow as tf \nimport tensorlayer as tl\nfrom tensorlayer.layers import *\nfrom math import log \n\ndef upscale(faces, ratio, scope = 'up', is_train=True, reuse=False):\n\tw_init = tf.random_normal_initializer(stddev=0.02)\n\tg_init = tf.random_normal_initializer(1., 0.02)\n \n\twith tf.variable_scop... | [
[
"tensorflow.nn.relu",
"tensorflow.nn.sigmoid",
"tensorflow.shape",
"tensorflow.variable_scope",
"tensorflow.random_normal_initializer"
]
] |
akurmustafa/rl | [
"cb6ee6e8b4360ade6aa592d7ffdd34dffbe4ed41"
] | [
"bandit/k_bandit_gradient.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport numpy.matlib\n# parameters to set #######################\nn_bandit = 10\nvariance_reward_init = 1\nvariance_reward = 1\nmean_reward_init = 4\nn_step = 1000\nn_sim = 2000\nprint_every = 10000\nprint_every_sim = 10\nstationary_mode = True\nvariance_nonstat... | [
[
"numpy.arange",
"matplotlib.pyplot.subplots",
"numpy.ones",
"numpy.max",
"numpy.argmax",
"numpy.zeros_like",
"numpy.mean",
"numpy.random.randn",
"numpy.exp",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.show"
]
] |
Drunkar/tensor2tensor | [
"8d3d175d649680c8e5b98a1b1c1c5e782ff492ac"
] | [
"tensor2tensor/utils/mtf_model.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.logging.warning",
"tensorflow.device",
"tensorflow.summary.scalar",
"tensorflow.assign_add",
"tensorflow.shape",
"tensorflow.slice",
"tensorflow.train.CheckpointSaverHook",
"tensorflow.global_variables",
"tensorflow.expand_dims",
... |
steps3d/graphics-book | [
"3c624976504876b7aa89e1d81dc8bb0806ac46c6"
] | [
"Code/python-code/Mesh.py"
] | [
"\"\"\"\n Wrapper for mesh to be rendered by OpenGL\n\"\"\"\n\nimport math\nimport numpy\nimport glm\nfrom OpenGL.GL import *\n\nclass Mesh:\n def __init__ ( self ):\n self.vertices = []\n self.indices = []\n self.vao = 0\n self.vbo = 0\n self.ibo = 0\n ... | [
[
"numpy.array"
]
] |
RaymondDunn/pycro-manager | [
"b7c1a7b84b31b5d8587934c569fd5de2c44114fe"
] | [
"test/magellan_focus_surface.py"
] | [
"from pycromanager import Bridge, Acquisition\nimport numpy as np\n\nbridge = Bridge()\n# get object representing micro-magellan API\nmagellan = bridge.get_magellan()\n\n\ndef hook_fn(event):\n coordinates = np.array([event[\"x\"], event[\"y\"], event[\"z\"]])\n\n return event\n\n\nif __name__ == \"__main__\"... | [
[
"numpy.array"
]
] |
cap-ntu/Video-to-Online-Platform | [
"757c68d9de0778e3da8bbfa678d89251a6955573"
] | [
"hysia/utils/misc.py"
] | [
"import json\nimport logging\nimport re\nfrom pathlib import Path\nfrom typing import Union, Tuple, Optional\n\nimport tensorflow as tf\n\nfrom .perf import StreamSuppressor\n\n\nclass _Struct(object):\n def __init__(self, d):\n for a, b in d.items():\n if isinstance(b, (list, tuple)):\n ... | [
[
"tensorflow.gfile.GFile",
"tensorflow.Graph",
"tensorflow.import_graph_def",
"tensorflow.GraphDef"
]
] |
poch4319/Method-Exploration-Relation-Extraction-Using-BERT | [
"81ffbae2508f641b9028baba4983f673edecb424"
] | [
"data/loader.py"
] | [
"\"\"\"\nData loader for TACRED json files.\n\"\"\"\n\nimport json\nimport random\nimport torch\nimport numpy as np\nfrom tqdm import tqdm\nfrom transformers import *\n\nfrom utils import constant, helper, vocab\n\n#from bert_serving.client import BertClient\n\n\n\nclass DataLoader(object):\n \"\"\"\n Load da... | [
[
"torch.eq",
"torch.LongTensor",
"numpy.random.random",
"torch.tensor"
]
] |
tatarize/vpype | [
"ee1c20d9f920b74206034624571f854fa470cf38"
] | [
"vpype_cli/operations.py"
] | [
"import logging\nfrom typing import List, Optional, Tuple, Union, cast\n\nimport click\nimport numpy as np\n\nimport vpype as vp\n\nfrom .cli import cli\n\n__all__ = (\n \"crop\",\n \"filter_command\",\n \"layout\",\n \"linemerge\",\n \"linesimplify\",\n \"linesort\",\n \"multipass\",\n \"pa... | [
[
"numpy.abs",
"numpy.arange",
"numpy.round",
"numpy.argmin",
"numpy.flip",
"numpy.zeros"
]
] |
marscher/scipy | [
"a0972b42590dbe96b6a5496a43488b6f636933af"
] | [
"scipy/stats/_discrete_distns.py"
] | [
"#\n# Author: Travis Oliphant 2002-2011 with contributions from\n# SciPy Developers 2004-2011\n#\nfrom functools import partial\nfrom scipy import special\nfrom scipy.special import entr, logsumexp, betaln, gammaln as gamln, zeta\nfrom scipy._lib._util import _lazywhere, rng_integers\n\nfrom numpy import... | [
[
"scipy.special.pdtr",
"scipy.special.zeta",
"numpy.minimum",
"numpy.sqrt",
"numpy.asarray",
"numpy.squeeze",
"numpy.all",
"numpy.max",
"numpy.zeros_like",
"scipy.special.pdtrc",
"numpy.moveaxis",
"numpy.exp",
"numpy.where",
"numpy.polyval",
"numpy.hstack... |
Snoeprol/AvogadroMoleculeAttacher | [
"ef862a2b7d1b6b87213f6abd927122270dafbe69",
"ef862a2b7d1b6b87213f6abd927122270dafbe69"
] | [
"src/parser.py",
"src/mathhelper.py"
] | [
"from os import path\nimport numpy as np\nimport glob\nfrom . import mathhelper as mh\nimport copy\n\nclass Atom:\n\n def __init__(self, kind, x, y, z):\n self.x = x \n self.y = y\n self.z = z \n self.kind = kind\n\nclass Vector:\n\n def __init__(self, x, y, z):\n ... | [
[
"numpy.array",
"numpy.subtract"
],
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.identity",
"numpy.cross",
"numpy.zeros"
]
] |
MariusAnje/proxylessnas | [
"e6e37a946e734c731168ce82c244d9878e7fee59"
] | [
"search/modules/layers.py"
] | [
"# ProxylessNAS: Direct Neural Architecture Search on Target Task and Hardware\n# Han Cai, Ligeng Zhu, Song Han\n# International Conference on Learning Representations (ICLR), 2019.\n\nfrom utils import *\nfrom collections import OrderedDict\nfrom torch import nn\nimport torch.nn.functional as F\nimport torch\n\nde... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.Dropout",
"torch.nn.ReLU6",
"torch.nn.Dropout2d",
"torch.zeros",
"torch.round",
"torch.nn.Conv2d",
"torch.nn.functional.conv2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.devic... |
mit-quest/COVID19-campus-modeling | [
"0a45b2c492ea3ec4f301504579c6a23558e6ac65",
"0a45b2c492ea3ec4f301504579c6a23558e6ac65"
] | [
"analyses/campus_analysis/campus-statistics.py",
"models/common/model_utils.py"
] | [
"import os\nimport json\nimport datetime\nimport multiprocessing\nimport random\nimport copy\nimport time\nimport warnings\n\nimport pandas as pd\nimport numpy as np\n\nfrom datetime import date, timedelta\nfrom pathlib import Path\n\nfrom models.common.mit_buildings import MITBuildings\nfrom models.common.to_preci... | [
[
"pandas.concat",
"pandas.to_datetime",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.percentile",
"pandas.unique",
"pandas.date_range"
],
[
"pandas.to_datetime"
]
] |
flexiblevision/models | [
"1f7afa5c8a51b07255098362cbed36e22abe112b"
] | [
"research/object_detection/model_tpu_main.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.contrib.tpu.TPUConfig",
"tensorflow.app.run"
]
] |
Kitware/trame-mnist | [
"60802a9c7fc93bc61c100acf0a540e466637c3e2"
] | [
"trame_mnist/app/engine/ml/testing.py"
] | [
"import torch\nimport torchvision\nimport numpy as np\n\nfrom .common import DATA_DIR, TRANSFORM\nfrom .prediction import get_model\n\nBATCH_SIZE = 32\n\nDATASET_TEST = torchvision.datasets.MNIST(\n root=DATA_DIR,\n train=False,\n download=True,\n transform=TRANSFORM,\n)\n\nLOADER_TEST = torch.utils.dat... | [
[
"numpy.amax",
"numpy.around",
"torch.utils.data.DataLoader",
"torch.no_grad",
"numpy.where",
"numpy.sum",
"numpy.zeros"
]
] |
NLPatVCU/multitasking_transformers | [
"3245518a6cb3748916214233ce77965384df72f9"
] | [
"multitasking_transformers/data/ner_dataset.py"
] | [
"from builtins import print\n\nimport torch, os, pickle, warnings\nfrom typing import Tuple, List, Union\nfrom spacy.gold import biluo_tags_from_offsets\nfrom transformers import BertTokenizer, AlbertTokenizer\n\n\n\"\"\"\nGiven a dictionary of NER labels, creates a pytorch Dataset of BERT-style input tensors.\n\"\... | [
[
"torch.zeros_like",
"torch.FloatTensor",
"torch.tensor"
]
] |
jdddog/dragnet | [
"e6e1b9e58a7c61d147de5da8d6b7b80a38dad9ed"
] | [
"test/test_weninger.py"
] | [
"import numpy as np\n\nfrom dragnet.features import _weninger\n\n\ndef test_weninger_sx_sdx():\n x = np.linspace(0, 10, 10)\n actual = _weninger.sx_sdx(x)\n expected = np.array(\n [[0.47448994, 2.22222222],\n [1.18661763, 2.22222222],\n [2.22759261, 2.22222222],\n [3.33348203... | [
[
"numpy.array",
"numpy.allclose",
"numpy.linspace"
]
] |
HongyiZhu/EHI | [
"9fbbc6046546dd7fc6de5d831b4c941bc4404e02"
] | [
"gcae_utils.py"
] | [
"import networkx as nx\nimport numpy as np\nimport scipy.sparse as sp\nfrom scipy.linalg import pinvh\nfrom graph_embedding_config import *\nimport torch\nimport scipy\nimport pickle\n\n\ndef load_data(graph, configs):\n # build graph\n adj = sp... | [
[
"torch.Size",
"numpy.power",
"numpy.asarray",
"scipy.sparse.diags",
"torch.from_numpy",
"torch.FloatTensor",
"numpy.identity",
"torch.sparse.FloatTensor",
"numpy.isinf",
"numpy.vstack"
]
] |
snkilmartin/dispatch | [
"db48c65d4b56734eb866016461e22923a4c8dea4"
] | [
"src/dispatch/incident/metrics.py"
] | [
"import json\nimport math\nimport logging\nfrom itertools import groupby\n\nfrom datetime import date\nfrom dateutil.relativedelta import relativedelta\n\nfrom calendar import monthrange\n\nfrom dispatch.config import INCIDENT_METRIC_FORECAST_REGRESSIONS\nfrom dispatch.incident_type.models import IncidentType\nfrom... | [
[
"pandas.DataFrame.from_dict"
]
] |
imhgchoi/meta-rl | [
"b90e6fa75b5c320b98b58cf0242fd55b47128dc6"
] | [
"cuda/policy/baseline.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport pdb\n\nfrom collections import OrderedDict\n\nclass LinearFeatureBaseline(nn.Module):\n \"\"\"Linear baseline based on handcrafted features, as described in [1] \n (Supplementary Material 2).\n\n [1] Yan Duan, Xi Chen, Rein Houth... | [
[
"torch.isinf",
"torch.isnan",
"torch.Tensor",
"torch.cat",
"torch.eye",
"torch.nonzero"
]
] |
gengcong940126/mimicry | [
"30a001426a4685d5a83258f52faa9564cefa9158"
] | [
"tests/datasets/test_data_utils.py"
] | [
"import os\nimport shutil\n\nimport numpy as np\nimport pytest\nimport torch\nfrom skimage.io import imsave\n\nfrom torch_mimicry.datasets import data_utils\n\n\nclass TestDataUtils:\n def setup(self):\n self.dataset_dir = './datasets'\n self.test_dir = os.path.join(\n os.path.dirname(os... | [
[
"numpy.random.randn",
"torch.load"
]
] |
persai-lab/EDM2020-DMKT | [
"ded1e76a5908432f5b927fc3bda7c0e059e2bc00"
] | [
"deepkt/agents/dmkt.py"
] | [
"import numpy as np\n\nfrom tqdm import tqdm\nimport shutil\nimport random\n\nimport torch\nfrom torch import nn\nfrom torch.backends import cudnn\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom sklearn import metrics\nimport sys\n\nfrom deepkt.agents.base im... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.nn.BCELoss",
"torch.no_grad",
"torch.device",
"torch.masked_select"
]
] |
vishalsubbiah/PySyft | [
"bbb775873b73b3457091e0f5a4494e3940c49497"
] | [
"test/notebooks/test_notebooks.py"
] | [
"import glob\nimport os\nimport sys\nimport time\nimport urllib.request\nfrom pathlib import Path\nfrom zipfile import ZipFile\n\nimport pytest\nimport nbformat\nimport numpy as np\nimport pandas as pd\nimport papermill as pm\nimport torch\n\nimport syft as sy\nfrom syft import TorchHook\nfrom syft.workers.websocke... | [
[
"torch.tensor"
]
] |
Pandinosaurus/mlstatpy | [
"549adf8c00902ffcf81dc70e7528857dbde1072f"
] | [
"src/mlstatpy/optim/sgd.py"
] | [
"\"\"\"\n@file\n@brief Implements simple stochastic gradient optimisation.\nIt is inspired from `_stochastic_optimizers.py\n<https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/\nneural_network/_stochastic_optimizers.py>`_.\n\"\"\"\nimport numpy\nfrom numpy.core._exceptions import UFuncTypeError\n\n\nc... | [
[
"numpy.maximum",
"numpy.abs",
"numpy.minimum",
"numpy.random.choice",
"numpy.isnan",
"numpy.sign",
"numpy.zeros_like",
"numpy.sum"
]
] |
maziseu/tfx | [
"63cc76f22947be8af9293953463fd1d2d462016b"
] | [
"tfx/tools/cli/container_builder/skaffold_cli_test.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 Google LLC. 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\... | [
[
"tensorflow.compat.v2.test.main"
]
] |
harrywang/clearml | [
"d72a42b89feba761115103c51b73897f04ae61d7"
] | [
"clearml/binding/artifacts.py"
] | [
"import json\nimport mimetypes\nimport os\nimport pickle\nfrom six.moves.urllib.parse import quote\nfrom copy import deepcopy\nfrom datetime import datetime\nfrom multiprocessing import RLock, Event\nfrom multiprocessing.pool import ThreadPool\nfrom tempfile import mkdtemp, mkstemp\nfrom threading import Thread\nfr... | [
[
"numpy.load",
"numpy.savez_compressed",
"pandas.read_csv"
]
] |
rhondamorgan/EXOSIMS | [
"4c96a7867f6f5a61ccdbd9f1971759fc34a1108c"
] | [
"EXOSIMS/OpticalSystem/Nemati.py"
] | [
"# -*- coding: utf-8 -*-\r\nfrom EXOSIMS.Prototypes.OpticalSystem import OpticalSystem\r\nimport astropy.units as u\r\nimport numpy as np\r\nimport scipy.stats as st\r\nimport scipy.optimize as opt\r\nfrom numpy import nan\r\n\r\nclass Nemati(OpticalSystem):\r\n \"\"\"Nemati Optical System class\r\n \r\n T... | [
[
"numpy.true_divide",
"numpy.log",
"numpy.sqrt",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.errstate",
"numpy.array",
"numpy.isinf"
]
] |
jakelong0509/master | [
"0507a796d0c40d5b28e54f162e5639ddfe2d1c2a",
"0507a796d0c40d5b28e54f162e5639ddfe2d1c2a"
] | [
"Supervised Learning/Song_Detector/song_preprocessing.py",
"RL_Personal/CartPole_RBF.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.io import wavfile\nimport os\nfrom pydub import AudioSegment\n\n\n# return song list and number of song\ndef get_songs(dir):\n songs = None;\n song_no = 0;\n for(dirpath, dirnames, filenames) in os.walk(dir):\n songs = filenames\n ... | [
[
"numpy.swapaxes",
"matplotlib.pyplot.specgram",
"numpy.append",
"numpy.repeat",
"numpy.array",
"numpy.zeros",
"scipy.io.wavfile.read"
],
[
"numpy.dot",
"numpy.random.random",
"numpy.sqrt",
"sklearn.kernel_approximation.RBFSampler",
"matplotlib.pyplot.plot",
... |
diorcety/fabio | [
"fde08f104bd2dfb0d1390f8520b254897694c326"
] | [
"fabio/binaryimage.py"
] | [
"# coding: utf-8\n#\n# Project: X-ray image reader\n# https://github.com/silx-kit/fabio\n#\n#\n# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France\n#\n# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)\n#\n# This program is free software: you can redistri... | [
[
"numpy.array",
"numpy.fromstring"
]
] |
miaow1988/dlfs | [
"4369a8a0173d1be62c0722abf0ab1c2a529a677a"
] | [
"test/test_cross_entropy_loss.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport unittest\n\nimport numpy as np\n\nimport dlfs.layers\nfrom dlfs.layers import check_parameter_gradient\nfrom ... | [
[
"numpy.random.rand"
]
] |
NiharG15/keras | [
"7f4030475571a99cb3cafef5ca03407e32003c46"
] | [
"tests/keras/backend/backend_test.py"
] | [
"import pytest\nfrom numpy.testing import assert_allclose\nimport numpy as np\nimport scipy.sparse as sparse\nimport warnings\nfrom keras.utils.test_utils import keras_test\n\nfrom keras import backend as K\nfrom keras.backend import floatx, set_floatx, variable\nfrom keras.utils.conv_utils import convert_kernel\ni... | [
[
"numpy.expand_dims",
"numpy.asarray",
"numpy.all",
"numpy.max",
"numpy.alltrue",
"numpy.mean",
"numpy.exp",
"numpy.random.randint",
"numpy.allclose",
"numpy.arange",
"numpy.eye",
"numpy.std",
"numpy.repeat",
"numpy.zeros",
"numpy.log",
"numpy.random.... |
Seanny123/DeepSLAM | [
"75aded2b4005c1bf0f8eba566942de9d679add6d"
] | [
"filter_boost.py"
] | [
"import numpy as np\nimport h5py\nimport scipy.sparse\nimport scipy.io\nfrom constants import *\nimport os\nimport pickle\n\n# frame length, which also dictates the delay being frame capture and feedback\n# because of forward_fit\n# which isn't even in the report...\nflen = DEE\nflen_2 = 3\ndt = EPSILON\nst = 0.75 ... | [
[
"numpy.abs",
"numpy.arange",
"numpy.sort",
"numpy.round",
"numpy.argmin",
"numpy.diff",
"numpy.zeros",
"numpy.where"
]
] |
snowmodel-tools/preprocess_python | [
"61aea1ae1918642ffe7e1799fed3d257d01fa8c1"
] | [
"02_GEE_topoveg.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport ee\nimport geemap\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport pandas as pd\nimport requests\nfrom rasterio.warp import transform\nimport xarray as xr\n# Initialize the Earth Engine module.\nee.Initialize()\n\n\n# In[2]:\n\n\... | [
[
"numpy.asarray",
"numpy.squeeze",
"numpy.savetxt",
"numpy.meshgrid",
"numpy.empty"
]
] |
khaeru/xarray | [
"62893abeb9ae29221ab9a635bd18de903a930e33"
] | [
"xarray/core/dataarray.py"
] | [
"import datetime\nimport functools\nimport warnings\nfrom numbers import Number\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Dict,\n Hashable,\n Iterable,\n List,\n Mapping,\n Optional,\n Sequence,\n Tuple,\n TypeVar,\n Union,\n cast,\n)\n\nimport numpy as np... | [
[
"pandas.isnull",
"pandas.DataFrame",
"numpy.full",
"numpy.errstate",
"numpy.ma.MaskedArray"
]
] |
LuciaBaldassini/recordlinkage | [
"8892d917caf82131ddce3ad2559570b2a0caca02"
] | [
"recordlinkage/compare.py"
] | [
"from functools import partial\n\nimport numpy\n\nimport pandas\n\nfrom recordlinkage.algorithms.distance import _1d_distance\nfrom recordlinkage.algorithms.distance import _haversine_distance\nfrom recordlinkage.algorithms.numeric import _exp_sim\nfrom recordlinkage.algorithms.numeric import _gauss_sim\nfrom recor... | [
[
"pandas.Series",
"pandas.isnull"
]
] |
maciejjan/morle | [
"a56a3371e403568b6b7abc63e08f6a111e0b5fee"
] | [
"src/morle/algorithms/mcmc/samplers.py"
] | [
"import morle.algorithms.fst as FST\nfrom morle.algorithms.align import extract_all_rules\nfrom morle.algorithms.mcmc.statistics import \\\n MCMCStatistic, ScalarStatistic, IterationStatistic, EdgeStatistic, \\\n RuleStatistic, UnorderedWordPairStatistic\nfrom morle.datastruct.lexicon import LexiconEntry, Lex... | [
[
"numpy.sum",
"numpy.isnan",
"scipy.sparse.csr_matrix",
"numpy.copy",
"numpy.any",
"numpy.zeros",
"numpy.isinf"
]
] |
abnvar/devro | [
"25a9e996e73494728595d3135451c9fceb5f0324"
] | [
"devro/env/components.py"
] | [
"import cv2\nimport time\nimport simpy\nimport random\nimport threading\nimport numpy as np\nfrom math import sin, cos\n\nfrom devro.visualization import display\n\nclass DynObstacle():\n def __init__(self, radius, velocity, pixelSpan, direction):\n self.velocity = velocity\n self.position = {\"x\"... | [
[
"numpy.asarray",
"numpy.stack",
"numpy.ones"
]
] |
chripell/yaaca | [
"9048ca5dc458f9a7dde9ca745f057f7499b19972"
] | [
"yaaca.py"
] | [
"#!/usr/bin/env python3\n\nimport sys\nimport os\nsys.path.append(os.path.join(os.path.dirname(__file__), \"astrolove\"))\nsys.path.append(\"/usr/lib/astrolove\")\n\nimport ASI\ntry:\n import astrolib as AL\nexcept ImportError:\n print(\"Cannot import astrolove, SAA won't work\")\nimport focuser\ntry:\n im... | [
[
"numpy.fft.fft2",
"numpy.clip",
"numpy.arange",
"numpy.dstack",
"numpy.max",
"numpy.array",
"numpy.histogram",
"numpy.roll"
]
] |
anindex/tp-rmp | [
"b7db7d1f6a03c0ae3f082b69fe3fff8b60351250",
"b7db7d1f6a03c0ae3f082b69fe3fff8b60351250"
] | [
"scripts/test_tprmp_2d_moving.py",
"scripts/plot_model.py"
] | [
"import sys\nimport argparse\nimport numpy as np\nfrom os.path import join, dirname, abspath, expanduser\nimport matplotlib.pyplot as plt\nfrom matplotlib.animation import FFMpegWriter\nimport logging\nlogging.basicConfig()\nlogging.getLogger().setLevel(logging.INFO)\n\nROOT_DIR = join(dirname(abspath(__file__)), '... | [
[
"numpy.linalg.inv",
"numpy.arange",
"numpy.linalg.norm",
"numpy.cos",
"numpy.sin",
"numpy.zeros_like",
"numpy.array",
"matplotlib.pyplot.ion",
"matplotlib.animation.FFMpegWriter",
"matplotlib.pyplot.figure"
],
[
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.sh... |
Greg-Kojadinovich/space-dash-app | [
"ed6974b2a59961a6522fbf342af6359e6d39b9c4"
] | [
"spacex_dash_app.py"
] | [
"# Import required libraries\nimport pandas as pd\nimport dash\nimport dash_html_components as html\nimport dash_core_components as dcc\nfrom dash.dependencies import Input, Output\nimport plotly.express as px\n\n# Read the airline data into pandas dataframe\nspacex_df = pd.read_csv(\"spacex_launch_dash.csv\")\nmax... | [
[
"pandas.read_csv"
]
] |
Reself-C/COMAP-MCM-ICM-2022 | [
"30fe1de5b58de99878bc1358662f3ae7d7689b20"
] | [
"Codes/pgportfolio/tdagent/algorithms/cornk.py"
] | [
"from ..tdagent import TDAgent\nimport numpy as np\nimport logging\nfrom scipy.optimize import minimize\n\nclass CORNK(TDAgent):\n '''\n Correlation driven non parametric Uniform\n '''\n def __init__(self, K=5, L=10, pc=0.1, exp_w=None):\n '''\n :param K: maximum window size\n :para... | [
[
"numpy.dot",
"numpy.arange",
"numpy.sort",
"numpy.ones",
"numpy.ceil",
"scipy.optimize.minimize",
"numpy.corrcoef",
"numpy.zeros",
"numpy.sum",
"numpy.divide"
]
] |
cypypccpy/Isaac-ManipulaRL | [
"11168d0a8c2db31a02ac8af8962cead64671c99b"
] | [
"rlgpu/utils/rl_pytorch/sac_hrl/mynetwork/network.py"
] | [
"from math import log\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nimport numpy as np\nfrom einops.layers.torch import Rearrange, Reduce\nfrom einops import rearrange\nfrom torch.distributions import Normal\n\n# Value Net\nclass ValueNet(nn.Module):\n def __init__(se... | [
[
"torch.clamp",
"torch.nn.Linear",
"torch.nn.Hardswish",
"torch.cat"
]
] |
kleinay/seq2seq_constrained_decoding | [
"656bb82001ced8f134e6e291564ea06de8b14005"
] | [
"constrained_decoding/word_list_decoding.py"
] | [
"from typing import List, Iterable, Tuple, Any, Union, Dict, Optional, Callable\n\nimport torch\nfrom transformers import LogitsProcessor\n\nclass WhiteListLogitsProcessor(LogitsProcessor):\n \"\"\"\n A simple LogitsProcessor constraining the generation to \"white list\", i.e. a set of allowed tokens. \n ... | [
[
"torch.ones",
"torch.zeros"
]
] |
songfeng/transformers | [
"0179030f9a28322e551d8a4cb455c756a09c9bc3"
] | [
"src/transformers/models/colbert/convert_colbert_original_checkpoint_to_pytorch.py"
] | [
"# Copyright 2020 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"torch.serialization.default_restore_location"
]
] |
sarahaguasvivas/gpc_controller | [
"3f64a2ce6e04b23bd6dbbe0db9df982eba2f640d",
"3f64a2ce6e04b23bd6dbbe0db9df982eba2f640d"
] | [
"python/logger/logger.py",
"python/block_gym/block_gym_vani.py"
] | [
"import numpy as np\nfrom scipy import stats\n\nclass Logger:\n def __init__(self):\n self.log_dictionary = {}\n\n def add_to_log(self, **kwargs):\n pass\n\n def log(self, log_dict):\n for key in log_dict.keys():\n if key not in self.log_dictionary.keys():\n s... | [
[
"numpy.array",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"numpy.abs",
"matplotlib.pyplot.title",
"numpy.min",
"numpy.reshape",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"numpy.max",
"matplotlib.pyplot.ylabel",
"numpy.std",
"numpy.mean",
... |
sdurand543/stability_estimation2 | [
"9e2e01dd5781f402313248dff0be62ca9fbab1ab"
] | [
"mpc_controller/three_leg_balance_gait_generator.py"
] | [
"\"\"\"Gait pattern planning module.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\n#from __future__ import google_type_annotations\nfrom __future__ import print_function\n\nimport os\nimport inspect\ncurrentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentfram... | [
[
"numpy.array",
"numpy.zeros"
]
] |
gillenbrown/prettyplot | [
"8551ca3cdb15f26f2c9517765e1abc063ea67242"
] | [
"betterplotlib/__init__.py"
] | [
"from matplotlib.projections import register_projection\nimport matplotlib.pyplot as plt\n\nfrom .axes_bpl import Axes_bpl\n\nfrom .colors import *\nfrom .styles import *\nfrom ._interface import *\n\nregister_projection(Axes_bpl)\n\ndef subplots(*args, **kwargs):\n \"\"\"\n A wrapper to the plt.subplots() fu... | [
[
"matplotlib.projections.register_projection",
"matplotlib.pyplot.subplots"
]
] |
JSchapke/solution_AI4EO-AirQuality-Health | [
"467b9d8ae8845404c9c1c6071fbeffb2cdfee60e"
] | [
"lib/utils.py"
] | [
"import copy\nimport numpy as np\n\n\ndef get_coords(cams_eop):\n grid = cams_eop.data[\"PM2_5\"].squeeze()\n bbox = cams_eop.bbox\n X = bbox.min_x, bbox.max_x\n Y = bbox.min_y, bbox.max_y\n\n coords = []\n positions = []\n for i in range(grid.shape[0]):\n for j in range(grid.shape[1]):\... | [
[
"numpy.isnan",
"numpy.arange",
"numpy.abs"
]
] |
jli0108/simplex | [
"826a35385a0f6eeeacece3570b55fd74d3a60509"
] | [
"revised_simplex.py"
] | [
"import numpy as np\nfrom numpy.linalg import inv\nimport sys\n# -- Solve your LP problems with this simple code!!! -----\n# -- Your LP must be in the following format: ------------\n# -- Maximize/Minimize c^T x -----------------------------\n# -- subject to Ax <= b ----------------------------------\n\n# -- Modify... | [
[
"numpy.dot",
"numpy.linalg.inv",
"numpy.arange",
"numpy.eye",
"numpy.concatenate",
"numpy.array",
"numpy.zeros"
]
] |
gstoica27/cpg_ppo | [
"3d4e409932230833ec930b1f56415a8f22ecaadf"
] | [
"network.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.layers as layers\n\nfrom rlsaber.tf_util import lstm, batch_to_seq, seq_to_batch\nfrom utils import *\nfrom collections import defaultdict\n\n\ndef make_cnn(convs, padding, inpt, initializer=None):\n if initializer is None:\n initiali... | [
[
"tensorflow.contrib.layers.convolution2d",
"tensorflow.nn.softmax",
"tensorflow.concat",
"tensorflow.distributions.Normal",
"numpy.sqrt",
"tensorflow.zeros_initializer",
"tensorflow.exp",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.orthogonal_initializer",
"ten... |
tigersean/datafeed | [
"65853faeff8a8632d2431bea68214637bdfa27f2"
] | [
"datafeed/dividend.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2011 yinhm\n\nimport datetime\nimport numpy as np\n\nfrom pandas import DataFrame\nfrom pandas import DatetimeIndex\n\n \nclass Dividend(object):\n\n def __init__(self, div):\n \"\"\"\n Paramaters:\n div: numpy dividend dat... | [
[
"pandas.DataFrame.from_records"
]
] |
jidv/outils_graphiques | [
"4bbcc26e972bbafef10f3c6714f7f50952ddd143"
] | [
"InterfaceGrille/InterfaceGrille/interface_grille.py"
] | [
"from os import path as os_path\nfrom os import walk as os_walk\nfrom pathlib import Path\nfrom sys import stdout as sys_stdout\nfrom sys import exc_info as sys_exc_info\nfrom traceback import print_exception as traceback_print_exception\nfrom logging import basicConfig as logging_basicConfig\nfrom logging import e... | [
[
"matplotlib.rcParams.keys",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.isinteractive",
"matplotlib.pyplot.sca",
"matplotlib.pyplot.savefig",
"matplotlib.get_backend",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.figure"
]
] |
Saransh-cpp/pyhf | [
"29c3df0e23a428004a065aed61cefb6a526a7332"
] | [
"tests/test_scripts.py"
] | [
"import json\nimport shlex\nimport pyhf\nimport time\nimport sys\nimport logging\nimport pytest\nfrom click.testing import CliRunner\nfrom unittest import mock\nfrom importlib import reload\nfrom importlib import import_module\n\n\ndef test_version(script_runner):\n command = 'pyhf --version'\n start = time.t... | [
[
"numpy.array_equal"
]
] |
kennydn99/tf-pose-estimation | [
"dbbb424cbafbee8a0f70183e5d8ba16febca1c42"
] | [
"deeplifting/packages/lifting/_pose_estimator.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Jul 13 16:20 2017\n\n@author: Denis Tome'\n\"\"\"\nfrom . import utils\nimport cv2\nimport numpy as np\nimport tensorflow as tf\n\nimport abc\nABC = abc.ABCMeta('ABC', (object,), {})\n\n__all__ = [\n 'PoseEstimatorInterface',\n 'PoseEstimator'\n]\n\n\nclass PoseEst... | [
[
"tensorflow.image.resize_images",
"numpy.squeeze",
"tensorflow.placeholder",
"numpy.round",
"tensorflow.global_variables_initializer",
"tensorflow.reset_default_graph",
"tensorflow.variable_scope",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.array"
]
] |
prabindh/squeezedet-keras | [
"78d18ba198a9c3aa2b2843a0008e89b63255b280"
] | [
"scripts/main/model/dataGenerator.py"
] | [
"# Project: squeezeDetOnKeras\n# Filename: dataGenerator\n# Author: Christopher Ehmann\n# Date: 29.11.17\n# Organisation: searchInk\n# Email: christopher@searchink.com\n\nimport threading\nimport cv2\nimport numpy as np\nimport random\nfrom main.utils.utils import bbox_transform_inv, batch_iou, sparse_to_dense\ncla... | [
[
"numpy.square",
"numpy.log",
"numpy.asarray",
"numpy.concatenate",
"numpy.std",
"numpy.mean",
"numpy.argsort",
"numpy.array",
"numpy.zeros"
]
] |
EvictionLab/eviction-lab-etl | [
"d94a7e52de8890c9371518b5020d1a6aa3a5fc2e",
"d94a7e52de8890c9371518b5020d1a6aa3a5fc2e"
] | [
"scripts/csvjoin.py",
"scripts/recalc_afacts.py"
] | [
"import sys\nimport pandas as pd\nfrom functools import reduce\nfrom utils_validation import log_dem_eviction_comparison\n\nINT_COLS = ['imputed', 'subbed', 'low-flag']\n\nif __name__ == '__main__':\n join_keys = sys.argv[1].split(',')\n dtypes = {k: 'object' for k in join_keys}\n dtypes['name'] = 'object'... | [
[
"pandas.merge",
"pandas.read_csv"
],
[
"pandas.read_csv"
]
] |
vin-ivar/simple_elmo_training | [
"438c11aeaa605f7b58c5cb459b75528cb8a8c178"
] | [
"usage_token.py"
] | [
"\"\"\"\nELMo usage example with pre-computed and cached context independent\ntoken representations\n\nBelow, we show usage for SQuAD where each input example consists of both\na question and a paragraph of context.\n\"\"\"\n\nimport tensorflow as tf\nimport os\nfrom bilm import TokenBatcher, BidirectionalLanguageM... | [
[
"tensorflow.compat.v1.Session",
"tensorflow.global_variables_initializer",
"tensorflow.compat.v1.placeholder",
"tensorflow.reset_default_graph",
"tensorflow.compat.v1.variable_scope"
]
] |
hbin-ac/mmpose | [
"b9363f5b6cb95178aa63265b9397b1a116136279"
] | [
"mmpose/apis/inference.py"
] | [
"import os\n\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.parallel import collate, scatter\nfrom mmcv.runner import load_checkpoint\n\nfrom mmpose.datasets.pipelines import Compose\nfrom mmpose.models import build_posenet\n\nos.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'\n\n\ndef init_pose_model(config, c... | [
[
"torch.no_grad",
"numpy.array",
"numpy.zeros"
]
] |
CRIPAC-DIG/DESTINE | [
"9ef2e1583ec8b6ef63971b83a05f3a3c924a4e3f"
] | [
"models/DESTINE.py"
] | [
"import torch\r\nimport torch.nn.functional as F\r\n\r\nfrom layers.activation import DisentangledSelfAttention\r\nfrom torchfm.layer import FeaturesEmbedding, FeaturesLinear, MultiLayerPerceptron\r\n\r\n\r\nclass DESTINE(torch.nn.Module):\r\n def __init__(\r\n self, field_dims, embed_dim, atten_embed... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"torch.nn.functional.relu"
]
] |
tmadden/snowflakes | [
"f10168a6ead8e5c9ca010adbec179aa3f957c75a"
] | [
"utilities.py"
] | [
"import asyncio\nimport math\nimport time\n\nfrom pywizlight.rgbcw import rgb2rgbcw\n\n\ndef index(p):\n return p[0] * 4 + p[1]\n\n\ndef in_bounds(p):\n return p[0] >= 0 and p[0] < 4 and p[1] >= 0 and p[1] < 4\n\n\ndef flipped(v):\n return [-v[0], -v[1]]\n\n\ndef equal(a, b):\n return round(a[0]) == rou... | [
[
"numpy.array",
"scipy.spatial.Delaunay"
]
] |
AuthEceSoftEng/Pattern-Recognition | [
"862bb067d3fbaf2675f230012f90c3846bda919c"
] | [
"Assignment/library/utilities.py"
] | [
"import requests\nimport pandas as pd\n\n# Get info about a specific user/organization by his/her/its username\ndef getUser(username):\n url = \"https://api.github.com/users/\" + username\n r = requests.get(url = url, params = {}) \n response = r.json() \n print(response[\"repos_url\"])\n\n# Get the pub... | [
[
"pandas.read_csv"
]
] |
alexshuang/fairseq | [
"a87cafda718c7706e6f1694f0d39fc589ed2b264"
] | [
"examples/speech_recognition/infer.py"
] | [
"#!/usr/bin/env python3 -u\n# 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\n\"\"\"\nRun inference for pre-processed data with a trained model.\n\"\"\"\n\nimport logging\nimport math... | [
[
"torch.cuda.is_available",
"torch.flatten"
]
] |
wang9702/GPT2 | [
"ae1e64737bddeb6ecbfbf1b197aaa5b98e58e725"
] | [
"train_new.py"
] | [
"# -*- coding:utf-8 -*-\n# @project: GPT2-NewsTitle\n# @filename: train.py\n# @author: 刘聪NLP\n# @contact: logcongcong@gmail.com\n# @time: 2020/12/16 16:28\n\"\"\"\n 文件说明:\n 通过新闻正文生成新闻标题的GPT2模型的训练文件\n\"\"\"\n\nimport torch\nimport os\nimport random\nimport numpy as np\nimport argparse\nimport logging\nfrom tra... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.utils.data.RandomSampler",
"torch.cuda.empty_cache",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.DataParallel"
]
] |
cellimnet/FociNet | [
"e4470ac898e40b7e42c2bd357494941d8bc22624"
] | [
"UNet_pre.py"
] | [
"import os, warnings, random\nfrom math import floor, ceil\nfrom skimage import measure\nfrom skimage import morphology, feature\nimport numpy as np\nimport cv2 as cv\nimport skimage.morphology as sm\nfrom skimage.transform import resize\nfrom tensorflow.keras.models import Model, load_model\nfrom tensorflow.keras.... | [
[
"tensorflow.keras.models.load_model",
"numpy.pad",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.keras.layers.Conv2D",
"numpy.squeeze",
"tensorflow.keras.layers.concatenate",
"tensorflow.keras.layers.Dr... |
zhengying-liu/mlt | [
"6fd704c72c24a0128e092c1087de97ef341347ea"
] | [
"tests/test_meta_learner.py"
] | [
"# Author: Zhengying Liu\n# Creation date: 4 Dec 2020\n\nfrom mlt.meta_learner import RandomSearchMetaLearner\nfrom mlt.meta_learner import MeanMetaLearner\nfrom mlt.meta_learner import GreedyMetaLearner\nfrom mlt.meta_learner import OptimalMetaLearner\nfrom mlt.meta_learner import TopkRankMetaLearner\nfrom mlt.met... | [
[
"numpy.dot",
"numpy.linalg.matrix_rank",
"numpy.random.choice",
"numpy.arange",
"numpy.eye",
"matplotlib.pyplot.show",
"pandas.DataFrame",
"numpy.ones",
"numpy.concatenate",
"numpy.random.permutation",
"numpy.random.rand",
"numpy.array",
"numpy.zeros",
"nump... |
mcgarc/qiskit-terra | [
"efe09ce7f7fc9074622deef087773090e07a8c75"
] | [
"qiskit/tools/qi/qi.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 2017, IBM.\n#\n# This source code is licensed under the Apache License, Version 2.0 found in\n# the LICENSE.txt file in the root directory of this source tree.\n\n# pylint: disable=invalid-name,anomalous-backslash-in-string\n# pylint: disable=assignment-from-no-return\n\n\"\"... | [
[
"numpy.diag",
"numpy.dot",
"numpy.product",
"numpy.linalg.eigvals",
"numpy.sqrt",
"numpy.trace",
"numpy.eye",
"scipy.linalg.eigh",
"numpy.copy",
"numpy.isrealobj",
"numpy.tensordot",
"numpy.outer",
"numpy.zeros",
"numpy.log",
"numpy.array",
"numpy.su... |
leoxiaobin/mxnet | [
"df00ef4304a7d2248edd09bf7626dbcd68299d66"
] | [
"tests/python/unittest/test_operator.py"
] | [
"# pylint: skip-file\nimport numpy as np\nimport mxnet as mx\nimport random\nfrom numpy.testing import assert_allclose\nfrom mxnet.test_utils import *\n\ndef np_softmax(x, axis=-1):\n # fix for old numpy on Travis not supporting keepdims\n # x = x - np.max(x, axis=-1, keepdims=True)\n x = x - np.max(x, axi... | [
[
"numpy.dot",
"numpy.radians",
"numpy.minimum",
"numpy.sqrt",
"numpy.arctan",
"numpy.arctanh",
"numpy.asarray",
"numpy.expand_dims",
"numpy.random.random_sample",
"numpy.round",
"numpy.max",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.fix",
"numpy.exp... |
deebuls/bayespy | [
"9b037eefeca3657f6f78d9e90b49aa619a89b4f1"
] | [
"bayespy/inference/vmp/nodes/stochastic.py"
] | [
"################################################################################\n# Copyright (C) 2013-2014 Jaakko Luttinen\n#\n# This file is licensed under the MIT License.\n################################################################################\n\n\nimport numpy as np\n\nfrom bayespy.utils import misc\... | [
[
"numpy.logical_or",
"numpy.ndim",
"numpy.all",
"numpy.shape",
"numpy.any",
"numpy.copyto"
]
] |
longnsl1998/vietocr | [
"686dd6c9d897e0401c20e7dcadb07a07c1dbc284"
] | [
"tool/create_dataset.py"
] | [
"import sys\nimport os\nimport lmdb # install lmdb by \"pip install lmdb\"\nimport cv2\nimport numpy as np\nfrom tqdm import tqdm\n\ndef checkImageIsValid(imageBin):\n isvalid = True\n imgH = None\n imgW = None\n\n imageBuf = np.fromstring(imageBin, dtype=np.uint8)\n try:\n img = cv2.imdecode(... | [
[
"numpy.array",
"numpy.fromstring"
]
] |
algoprog/Quin | [
"c1fd3b8e5e2163217f6c8062620ee0c1dfeed0e8"
] | [
"models/tokenization.py"
] | [
"import numpy as np\n\n\ndef get_segments(sentence):\n sentence_segments = []\n temp = []\n i = 0\n for token in sentence.split(\" \"):\n temp.append(i)\n if token == \"[SEP]\":\n i += 1\n sentence_segments.append(temp)\n return sentence_segments\n\n\ndef tokenize(text, ma... | [
[
"numpy.asarray"
]
] |
tsumli/pytorch-lightning | [
"3e6f884a89fc6b4c621625fbbf8e46c8780931f4"
] | [
"pytorch_lightning/utilities/device_parser.py"
] | [
"# Copyright The PyTorch Lightning team.\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... | [
[
"torch.cuda.device_count"
]
] |
yliuhz/PMAW | [
"23f4f3ec2ccb381be3d4b2edea0878e4015e1ae4"
] | [
"src/mlp_maccs_out.py"
] | [
"# MLP\nimport csv\nfrom itertools import islice\nimport random\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn.neural_network import MLPRegressor\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.model_selection import KFold, train_test_split\nimport pandas as pd\nfrom sklearn.utils ... | [
[
"tensorflow.keras.callbacks.LearningRateScheduler",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"sklearn.preprocessing.MinMaxScaler",
"matplotlib.pyplot.gca",
"numpy.reshape",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.text",
"matplotlib.pyplot.figure",
"matplotlib.pypl... |
ncrubin/grove | [
"5f8024445263fc8b5ead39520e9e5f019bfe3e31"
] | [
"grove/tomography/tomography.py"
] | [
"##############################################################################\n# Copyright 2017-2018 Rigetti Computing\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#\... | [
[
"numpy.random.randn",
"numpy.random.seed"
]
] |
Tommy3121173/tommy | [
"429aefb377f84a1d49e85f825a32ac2c160ebc85"
] | [
"functions_example.py/homeworkA1.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jun 29 16:53:38 2018\n\n@author: tommy_mizuki\n\"\"\"\nimport numpy as np\nimport pandas as pd\nurl = 'https://raw.githubusercontent.com/justmarkham/DAT8/master/data/u.user'\n#Import the data\ndata = pd.read_csv(url, sep = '|')\n#Check if I could import the data\n\ns... | [
[
"pandas.read_csv"
]
] |
bblais/Plasticnet | [
"e450e56a9b993e361873b6a235fdcc55a5690abb"
] | [
"setup.py"
] | [
"# this is from https://github.com/cython/cython/wiki/PackageHierarchy\n\n\n\n\nimport sys, os, stat, subprocess\nfrom distutils.core import setup\nfrom Cython.Distutils import build_ext\nfrom distutils.extension import Extension\n\n# we'd better have Cython installed, or it's a no-go\ntry:\n from Cython.Distuti... | [
[
"numpy.get_include"
]
] |
ntropy-esa/lca_algebraic | [
"419806b8ff793c790eb86800e003f2a0bcdb0be3"
] | [
"lca_algebraic/helpers.py"
] | [
"import re\nimport types\nfrom collections import defaultdict\nfrom copy import deepcopy\nfrom itertools import chain\n\nimport pandas as pd\nfrom IPython.core.display import display\nfrom bw2data.backends.peewee.utils import dict_as_exchangedataset\nfrom sympy import symbols\n\nfrom .base_utils import *\nfrom .bas... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
kayla-leonard/pisa | [
"130c6aac0ebd20f19b44b4f1c1c6dbb0f85daf17"
] | [
"pisa/core/map.py"
] | [
"\"\"\"\nMap class to contain 2D histogram, error, and metadata about the contents.\nMapSet class to contain a set of maps.\n\nAlso provide basic mathematical operations that user applies directly to the\ncontainers but that get passed down to operate on the contained data.\n\"\"\"\n\n\nfrom __future__ import absol... | [
[
"numpy.nanmax",
"numpy.true_divide",
"numpy.sqrt",
"numpy.get_printoptions",
"numpy.nanmin",
"numpy.all",
"numpy.max",
"numpy.argmin",
"numpy.any",
"numpy.moveaxis",
"numpy.where",
"numpy.asscalar",
"numpy.allclose",
"numpy.reshape",
"numpy.array_repr",
... |
PNNL-Comp-Mass-Spec/AutoCCS | [
"e2b0ede9f2227e1f0503af827ce8b320fddb4a2d"
] | [
"step_field_ccs.py"
] | [
"from scipy.stats import linregress\nimport numpy as np\n\ndef mass_ppm_error(x, mass):\n return abs(x - mass) / mass * 1e6\n\nclass SteppedFieldCCS:\n \"\"\"compute the ccs for the multi-fields (stepped field method)\n \"\"\"\n def __init__(self, meta_df, adduct_mass, old_drift_tube_length, charge_stat... | [
[
"scipy.stats.linregress",
"numpy.array",
"numpy.mean"
]
] |
UCB-stat-159-s21/homework-8-group-7-1 | [
"30be891097d576056483c6e43cc0ba15d4f765ca"
] | [
"analysis/onesided.py"
] | [
"\"\"\"Onesided CI functions.\"\"\"\n\nimport numpy as np\nimport scipy.special\nimport math\nfrom itertools import combinations\nfrom itertools import filterfalse\nimport math\nfrom cibin import *\n\n\ndef pval_one_lower(n, m, N, Z_all, tau_obs):\n \"\"\"\n Calculate the p-value of a one sided test.\n\n G... | [
[
"numpy.arange",
"numpy.matmul",
"numpy.round",
"numpy.repeat",
"numpy.array",
"numpy.zeros"
]
] |
syanga/dcglearn | [
"c3faaed7e04431c86649512813c17968de6803eb"
] | [
"dglearn/learning/sparse_mle.py"
] | [
"import numpy as np\nfrom scipy.optimize import minimize, Bounds\n\n\ndef l1_structure_learning(data, l1_coeff=0.1, threshold=1e-4):\n '''\n l1-regularized MLE\n '''\n dim = data.shape[1]\n samples = data.shape[0]\n\n def objective(x, l1_coeff):\n \"\"\" MLE optimization objective \"\"\... | [
[
"numpy.log",
"numpy.abs",
"numpy.eye",
"numpy.ones",
"numpy.sign",
"scipy.optimize.Bounds",
"numpy.random.normal",
"numpy.fill_diagonal",
"numpy.exp",
"numpy.zeros",
"numpy.sum"
]
] |
ProkopHapala/SimpleSimulationEngine | [
"9c5480f2392c9c89b9fee4902db0c4cde5323a6c"
] | [
"python/pyMolecular/examples/replace111.py"
] | [
"#!/usr/bin/python\n# use like:\n# python replace.py answer.bas 1 14 2.0 0.75\n\n\nimport sys\nimport numpy as np\nimport atomicUtils as au\n\n# ---- setup\nfin = sys.argv[1]\ntyp = int(sys.argv[2])\nofTyp = int(sys.argv[3])\nrcut = float(sys.argv[4])\nprob = float(sys.argv[5])\n\nreps... | [
[
"numpy.logical_and",
"numpy.genfromtxt"
]
] |
BongSangKim/UGRP-in-progress | [
"c8ed53d57f24a50dda441a4db9bd250e1124e9dd"
] | [
"folder/DQNcoding/main.py"
] | [
"#https://github.com/seungeunrho/minimalRL/blob/52aaa800e7bad30920a21a62f04a17d25663245c/dqn.py\n\ndel gym.envs.registry.env_specs['UDN-v0']\n\nimport gym\nimport gym_UDN\nimport collections #replay buffer에서 쓰일 deque를 import하기 위함 double ended que?\nimport random\n\nimport torch #pytorch \nimport torch.nn as nn... | [
[
"torch.from_numpy",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.functional.smooth_l1_loss",
"torch.cuda.is_available"
]
] |
aseyboldt/numba | [
"4cb9e4f0b3cabd9e6a144fa4f3f7e5d6bee45635",
"0c0a8aa7a7cad8b5f0a5383101f5cca5a4a89df3"
] | [
"numba/tests/test_object_conversion.py",
"numba/tests/test_forloop.py"
] | [
"import ctypes\nimport unittest\n\nimport numpy as np\nfrom numba.minivect import minitypes\nfrom numba import *\n\n@autojit(backend='ast')\ndef convert(obj_var, native_var):\n obj_var = native_var\n native_var = obj_var\n return native_var\n\n@autojit(locals=dict(obj=object_))\ndef convert_float(obj):\n ... | [
[
"numpy.arange"
],
[
"numpy.array"
]
] |
dansbecker/what-celebrity | [
"845c87538394fe3a3e23d62eb2e3fb46b03e39a3"
] | [
"make_training_thumbnails.py"
] | [
"import numpy as np\nimport os\nimport pandas as pd\nfrom PIL import Image, ImageDraw\n\ndef ensure_thumbnail_paths(img_df, thumbnails_path=\"work/thumbnails\"):\n os.makedirs(thumbnails_path, exist_ok=True)\n for celeb in img_df.celeb.unique():\n os.makedirs(os.path.join(thumbnails_path, celeb), exist... | [
[
"numpy.array",
"numpy.savez",
"pandas.read_csv",
"numpy.empty"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.